lamassu-server/public/static/js/main.ff8544f4.chunk.js
2021-11-23 09:54:48 +00:00

2 lines
No EOL
645 KiB
JavaScript

(this["webpackJsonplamassu-admin"]=this["webpackJsonplamassu-admin"]||[]).push([[0],{578:function(e,t){},581:function(e,t){},582:function(e,t){},604:function(e,t){},606:function(e,t){},614:function(e,t){},616:function(e,t){},735:function(e,t,n){"use strict";n.r(t);var r=n(1),a=n.n(r),i=n(41),o=n.n(i),c=n(2),l=n(9),s=n(5),d=n(57),u=n(8),m=n(852),h=n(773),b=n(279),p=n(419),f=n(293),j=n(772),g=n(846),O=n(10),x=n.n(O),v=n(66),y=n(373),w=n(139),C=n(51),k=a.a.createContext(),S=n(779),N=n(778),I=n(7),E=n.n(I),F=n(789),L=n(416),P=n(402),D=n(392),B=n(86),R=n(383),T=n(775),A=n(164),M=n(244),W=n(776),z=n(4),$=n(20),q="#5f668a",H="#44e188",V="#ecfbef",U="#3fd07e",G="#ebefff",X="#dbdfed",Y="#16d6d3",_="#5a67ff",Z="#ffffff",K="#ff584a",Q="#ffeceb",J="#1b2559",ee="#48f694",te=H,ne=U,re="#fafbff",ae=G,ie=X,oe="#dddddd",ce="#f2f2f2",le=J,se=q,de="#72799d",ue=q,me=K,he=1200,be=ee,pe="Mont",fe="MuseoSans",je=24,ge=20,Oe=16,xe=14,ve=13;var ye=ve,we=xe,Ce=Oe,ke=je,Se=500,Ne=fe,Ie=32,Ee=48;var Fe=2*Ie,Le=J,Pe=Q,De=V,Be={lineHeight:"120%",color:le},Re={h1:{extend:Be,fontSize:je,fontFamily:pe,fontWeight:900},h2:{extend:Be,fontSize:ge,fontFamily:pe,fontWeight:900},h3:{extend:Be,fontSize:xe,fontFamily:pe,fontWeight:900},h4:{extend:Be,fontSize:xe,fontFamily:pe,fontWeight:700},h5:{extend:Be,fontSize:Oe,fontFamily:pe,fontWeight:700},p:{extend:Be,fontSize:xe,fontFamily:fe,fontWeight:500},tl1:{extend:Be,fontSize:ge,fontFamily:fe,fontWeight:700},tl2:{extend:Be,fontSize:xe,fontFamily:fe,fontWeight:700},info1:{extend:Be,fontSize:je,fontFamily:fe,fontWeight:700},info2:{extend:Be,fontSize:Oe,fontFamily:fe,fontWeight:700},info3:{extend:Be,fontSize:Oe,fontFamily:fe,fontWeight:500},mono:{extend:Be,fontSize:xe,fontFamily:"BPmono",fontWeight:500},monoBold:{fontWeight:700},monoSmall:{fontSize:ve},inputFont:{fontSize:ge,fontFamily:fe,fontWeight:500,lineHeight:"110%",color:le},regularLabel:{fontSize:xe,fontFamily:fe,fontWeight:500,lineHeight:"110%"},label1:{fontSize:ve,fontFamily:fe,fontWeight:500,color:le},label2:{fontSize:ve,fontFamily:fe,fontWeight:700,color:le},label3:{fontSize:xe,fontFamily:fe,fontWeight:500,color:le},confirmationCode:{extend:Be,fontSize:35,fontFamily:pe,fontWeight:900},inline:{display:"inline"},noMargin:{margin:0}},Te=function(e,t,n){return{backgroundColor:e,"&:hover":{backgroundColor:t},"&:active":{backgroundColor:n}}},Ae={actionButton:{extend:Re.p,cursor:"pointer",border:"none",height:28,outline:0,borderRadius:6,padding:"0 8px",display:"flex",alignItems:"center"},primary:{extend:Te(ae,ie,se),"&:active":{color:Z,"& $actionButtonIcon":{display:"none"},"& $actionButtonIconActive":{display:"flex"}},"& $actionButtonIconActive":{display:"none"}},secondary:{extend:Te(se,de,Z),color:Z,"&:active":{color:le,"& $actionButtonIcon":{display:"flex"},"& $actionButtonIconActive":{display:"none"}},"& $actionButtonIcon":{display:"none"},"& $actionButtonIconActive":{display:"flex"}},actionButtonIcon:{display:"flex",paddingRight:7,"@global":{svg:{width:14,height:14}}},actionButtonIconActive:{}},Me=n(0),We=Object(f.a)(Ae),ze=Object(r.memo)((function(e){var t,n=e.className,r=e.Icon,a=e.InverseIcon,i=e.color,o=e.children,c=Object($.a)(e,["className","Icon","InverseIcon","color","children"]),l=We(),d=(t={},Object(z.a)(t,l.actionButton,!0),Object(z.a)(t,l.primary,"primary"===i),Object(z.a)(t,l.secondary,"secondary"===i),t);return Object(Me.jsxs)("button",Object(s.a)(Object(s.a)({className:E()(d,n)},c),{},{children:[r&&Object(Me.jsx)("div",{className:l.actionButtonIcon,children:Object(Me.jsx)(r,{})}),a&&Object(Me.jsx)("div",{className:E()(l.actionButtonIcon,l.actionButtonIconActive),children:Object(Me.jsx)(a,{})}),o&&Object(Me.jsx)("div",{children:o})]}))})),$e=Object(f.a)(Re);function qe(e){var t,n=e.children,r=e.noMargin,a=e.className,i=Object($.a)(e,["children","noMargin","className"]),o=$e(),c=(t={},Object(z.a)(t,o.h1,!0),Object(z.a)(t,o.noMargin,r),Object(z.a)(t,a,!!a),t);return Object(Me.jsx)("h1",Object(s.a)(Object(s.a)({className:E()(c)},i),{},{children:n}))}function He(e){var t,n=e.children,r=e.noMargin,a=e.className,i=Object($.a)(e,["children","noMargin","className"]),o=$e(),c=(t={},Object(z.a)(t,o.h2,!0),Object(z.a)(t,o.noMargin,r),Object(z.a)(t,a,!!a),t);return Object(Me.jsx)("h2",Object(s.a)(Object(s.a)({className:E()(c)},i),{},{children:n}))}function Ve(e){var t,n=e.children,r=e.noMargin,a=e.className,i=Object($.a)(e,["children","noMargin","className"]),o=$e(),c=(t={},Object(z.a)(t,o.h3,!0),Object(z.a)(t,o.noMargin,r),Object(z.a)(t,a,!!a),t);return Object(Me.jsx)("h3",Object(s.a)(Object(s.a)({className:E()(c)},i),{},{children:n}))}function Ue(e){var t,n=e.children,r=e.noMargin,a=e.className,i=Object($.a)(e,["children","noMargin","className"]),o=$e(),c=(t={},Object(z.a)(t,o.h4,!0),Object(z.a)(t,o.noMargin,r),Object(z.a)(t,a,!!a),t);return Object(Me.jsx)("h4",Object(s.a)(Object(s.a)({className:E()(c)},i),{},{children:n}))}function Ge(e){var t,n=e.children,r=e.noMargin,a=e.className,i=Object($.a)(e,["children","noMargin","className"]),o=$e(),c=(t={},Object(z.a)(t,o.h5,!0),Object(z.a)(t,o.noMargin,r),Object(z.a)(t,a,!!a),t);return Object(Me.jsx)("h5",Object(s.a)(Object(s.a)({className:E()(c)},i),{},{children:n}))}var Xe=rt("p"),Ye=rt("info1"),_e=rt("info2"),Ze=rt("info3"),Ke=rt("mono"),Qe=rt("tl1"),Je=rt("tl2"),et=rt("label1"),tt=rt("label2"),nt=rt("label3");function rt(e){return function(t){var n,r=t.inline,a=t.noMargin,i=t.className,o=t.children,c=Object($.a)(t,["inline","noMargin","className","children"]),l=$e(),d=(n={},Object(z.a)(n,i,!!i),Object(z.a)(n,l[e],e),Object(z.a)(n,l.inline,r),Object(z.a)(n,l.noMargin,a),n);return Object(Me.jsx)("p",Object(s.a)(Object(s.a)({className:E()(d)},c),{},{children:o}))}}function at(){return(at=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function it(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var ot=r.createElement("desc",null,"Created with Sketch."),ct=r.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"nav-/-primary-/-1440",transform:"translate(-1295.000000, -19.000000)",stroke:"#1B2559",strokeWidth:2},r.createElement("g",{id:"icon/menu/notification",transform:"translate(1296.000000, 20.000000)"},r.createElement("path",{d:"M10.1052632,14.3157895 C10.1052632,15.2454737 9.35073684,16 8.42105263,16 C7.49136842,16 6.73684211,15.2454737 6.73684211,14.3157895",id:"Stroke-1"}),r.createElement("path",{d:"M1.6,14.3157895 C0.7168,14.3157895 0,13.6031813 0,12.7251462 C0,11.8471111 0.7168,11.1345029 1.6,11.1345029 L1.6,6.3625731 C1.6,2.84884211 4.4656,0 8,0 C11.5344,0 14.4,2.84884211 14.4,6.3625731 L14.4,11.1345029 C15.2832,11.1345029 16,11.8471111 16,12.7251462 C16,13.6031813 15.2832,14.3157895 14.4,14.3157895 L1.6,14.3157895 Z",id:"Stroke-3",strokeLinejoin:"round"}))));function lt(e,t){var n=e.title,a=e.titleId,i=it(e,["title","titleId"]);return r.createElement("svg",at({width:"18px",height:"18px",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,ot,ct)}var st=r.forwardRef(lt);n.p;function dt(){return(dt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function ut(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var mt=r.createElement("desc",null,"Created with Sketch."),ht=r.createElement("g",{id:"icon/stage/spring/empty",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("circle",{id:"Oval-Copy-6",stroke:"#DDDDDD",strokeWidth:2,transform:"translate(9.000000, 9.000000) rotate(-270.000000) translate(-9.000000, -9.000000) ",cx:9,cy:9,r:8}));function bt(e,t){var n=e.title,a=e.titleId,i=ut(e,["title","titleId"]);return r.createElement("svg",dt({width:"18px",height:"18px",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,mt,ht)}var pt=r.forwardRef(bt);n.p;function ft(){return(ft=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function jt(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var gt=r.createElement("desc",null,"Created with Sketch."),Ot=r.createElement("g",{id:"icon/stage/zodiac/empty",stroke:"none",strokeWidth:2,fill:"none",fillRule:"evenodd"},r.createElement("circle",{id:"Oval-Copy-6",stroke:"#5F668A",transform:"translate(9.000000, 9.000000) rotate(-270.000000) translate(-9.000000, -9.000000) ",cx:9,cy:9,r:8}));function xt(e,t){var n=e.title,a=e.titleId,i=jt(e,["title","titleId"]);return r.createElement("svg",ft({width:"18px",height:"18px",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,gt,Ot)}var vt=r.forwardRef(xt);n.p;function yt(){return(yt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function wt(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Ct=r.createElement("desc",null,"Created with Sketch."),kt=r.createElement("g",{id:"icon/stage/zodiac/full",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("circle",{id:"Oval-2-Copy",fill:"#1B2559",cx:9,cy:9,r:8}),r.createElement("circle",{id:"Oval-Copy-5",stroke:"#1B2559",strokeWidth:2,transform:"translate(9.000000, 9.000000) rotate(-270.000000) translate(-9.000000, -9.000000) ",cx:9,cy:9,r:8}));function St(e,t){var n=e.title,a=e.titleId,i=wt(e,["title","titleId"]);return r.createElement("svg",yt({width:"18px",height:"18px",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Ct,kt)}var Nt=r.forwardRef(St),It=(n.p,{background:{position:"absolute",width:"100vw",height:"100vh",left:0,top:0,zIndex:-1,backgroundColor:Z,boxShadow:"0 0 14px 0 rgba(0, 0, 0, 0.24)"},container:{left:-200,top:-42,backgroundColor:Z,height:"110vh"},header:{display:"flex",justifyContent:"space-between"},headerText:{marginTop:20,marginLeft:24},actionButtons:{display:"flex",marginLeft:16,height:0},notificationIcon:function(e){var t=e.buttonCoords,n=e.xOffset;return{position:"absolute",top:t?t.y-1:0,left:t?t.x-n:0,cursor:"pointer",background:"transparent",boxShadow:"0px 0px 0px transparent",border:"0px solid transparent",textShadow:"0px 0px 0px transparent",outline:"none"}},clearAllButton:{marginTop:-16,marginLeft:8,backgroundColor:G},notificationsList:{width:440,height:"90vh",maxHeight:"100vh",marginTop:24,marginLeft:0,marginRight:-50,overflowY:"auto",overflowX:"hidden",backgroundColor:Z,zIndex:10},notificationRow:{position:"relative",marginBottom:4,paddingTop:12},unread:{backgroundColor:V},notificationRowIcon:{alignSelf:"center","& > *":{marginLeft:24}},unreadIcon:{marginLeft:8,marginTop:5,width:"12px",height:"12px",backgroundColor:ee,borderRadius:"50%",cursor:"pointer",zIndex:1},readIcon:{marginLeft:8,marginTop:5,width:"12px",height:"12px",border:[[1,"solid",q]],borderRadius:"50%",cursor:"pointer",zIndex:1},notificationTitle:{margin:0,color:q},notificationBody:{margin:0},notificationSubtitle:{margin:0,marginBottom:8,color:q},stripes:{position:"absolute",height:"100%",top:"0px",opacity:"60%"},hasUnread:{position:"absolute",top:0,left:16,width:"9px",height:"9px",backgroundColor:ee,borderRadius:"50%"}}),Et=n(377),Ft=n.n(Et);function Lt(){return(Lt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Pt(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Dt=r.createElement("g",{id:"\\u21B3-notification-center",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("g",{id:"notification-center_v01a#2-(open)",transform:"translate(-1023.000000, -459.000000)",stroke:"#1B2559"},r.createElement("g",{id:"Group-5",transform:"translate(1000.000000, 0.000000)"},r.createElement("g",{id:"icon/sf-small/wrench",transform:"translate(24.000000, 460.000000)"},r.createElement("path",{d:"M15.7602493,3.10720971 L13.1962412,5.67121772 L10.3290323,5.67121772 L10.3290323,2.80400876 L12.8930403,0.24000075 C12.4378389,0.0872002725 11.9506373,0 11.4434358,0 C8.9282279,0 6.88822153,2.04000637 6.88822153,4.55681424 C6.88822153,5.08081588 6.98102182,5.58321745 7.14422233,6.05201891 L0.580201813,12.6168394 C-0.193400604,13.3904418 -0.193400604,14.6456458 0.580201813,15.4200482 C1.35460423,16.1936506 2.60980816,16.1936506 3.38341057,15.4200482 L9.94823109,8.85602767 C10.4170326,9.01922818 10.9186341,9.11202847 11.4434358,9.11202847 C13.9602436,9.11202847 16.00025,7.0720221 16.00025,4.55681424 C16.00025,4.04961265 15.9130497,3.56241113 15.7602493,3.10720971 Z",id:"Stroke-1"})))));function Bt(e,t){var n=e.title,a=e.titleId,i=Pt(e,["title","titleId"]);return r.createElement("svg",Lt({width:"32px",height:"32px",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Dt)}var Rt=r.forwardRef(Bt);n.p;function Tt(){return(Tt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function At(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Mt=r.createElement("g",{id:"\\u21B3-notification-center",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("g",{id:"notification-center_v01a#1-(marked-one-as-read)",transform:"translate(-1023.000000, -123.000000)",stroke:"#1B2559"},r.createElement("g",{id:"Group-5",transform:"translate(1000.000000, 0.000000)"},r.createElement("g",{id:"Group-4",transform:"translate(24.000000, 124.000000)"},r.createElement("g",{id:"Group-3"},r.createElement("line",{x1:0,y1:4,x2:16,y2:4,id:"Path-2"}),r.createElement("polyline",{id:"Path-3",points:"12 0 16 4 12 8"})),r.createElement("g",{id:"Group-2",transform:"translate(8.000000, 12.000000) scale(-1, 1) translate(-8.000000, -12.000000) translate(0.000000, 8.000000)"},r.createElement("line",{x1:0,y1:4,x2:16,y2:4,id:"Path-2-Copy"}),r.createElement("polyline",{id:"Path-3-Copy",points:"12 0 16 4 12 8"}))))));function Wt(e,t){var n=e.title,a=e.titleId,i=At(e,["title","titleId"]);return r.createElement("svg",Tt({width:"24px",height:"24px",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Mt)}var zt=r.forwardRef(Wt);n.p;function $t(){return($t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function qt(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Ht=r.createElement("defs",null,r.createElement("pattern",{id:"pattern_68JiZ",patternUnits:"userSpaceOnUse",width:5.5,height:5.5,patternTransform:"rotate(45)"},r.createElement("line",{x1:0,y:0,x2:0,y2:5.5,stroke:"#DBDFED",strokeWidth:3}))),Vt=r.createElement("rect",{width:"100%",height:"100%",fill:"url(#pattern_68JiZ)",opacity:1});function Ut(e,t){var n=e.title,a=e.titleId,i=qt(e,["title","titleId"]);return r.createElement("svg",$t({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"36px",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Ht,"{' '}\n ",Vt)}var Gt=r.forwardRef(Ut);n.p;function Xt(){return(Xt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Yt(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var _t=r.createElement("desc",null,"Created with Sketch."),Zt=r.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"icon/warning-icon/tomato"},r.createElement("rect",{id:"Rectangle",stroke:"#FF584A",strokeWidth:2,x:1,y:1,width:22,height:22,rx:11}),r.createElement("path",{d:"M11.2971429,14.4857143 L11.1085714,5.82857143 L13.3714286,5.82857143 L13.2,14.4857143 L11.2971429,14.4857143 Z M11.1942857,18 L11.1942857,15.9771429 L13.3028571,15.9771429 L13.3028571,18 L11.1942857,18 Z",id:"!",fill:"#FF584A",fillRule:"nonzero"})));function Kt(e,t){var n=e.title,a=e.titleId,i=Yt(e,["title","titleId"]);return r.createElement("svg",Xt({width:"24px",height:"24px",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,_t,Zt)}var Qt,Jt,en,tn=r.forwardRef(Kt),nn=(n.p,Object(f.a)(It)),rn={transaction:{display:"Transactions",icon:Object(Me.jsx)(zt,{})},highValueTransaction:{display:"Transactions",icon:Object(Me.jsx)(zt,{})},fiatBalance:{display:"Maintenance",icon:Object(Me.jsx)(Rt,{})},cryptoBalance:{display:"Maintenance",icon:Object(Me.jsx)(Rt,{})},compliance:{display:"Compliance",icon:Object(Me.jsx)(tn,{})},error:{display:"Error",icon:Object(Me.jsx)(tn,{})}},an=function(e){var t,n,r,a=e.id,i=e.type,o=(e.detail,e.message),c=e.deviceName,l=e.created,s=e.read,d=e.valid,u=e.toggleClear,m=nn(),b=null!==(t=A.a([i,"display"])(rn))&&void 0!==t?t:null,p=null!==(n=A.a([i,"icon"])(rn))&&void 0!==n?n:Object(Me.jsx)(Rt,{}),f=Ft()((new Date).getTime()-new Date(l).getTime(),{compact:!0,verbose:!0}),j=b&&c?"".concat(b," - ").concat(c):"".concat(!b&&c?c:b),g=(r={},Object(z.a)(r,m.readIcon,s),Object(z.a)(r,m.unreadIcon,!s),r);return Object(Me.jsxs)(h.a,{container:!0,className:E()(m.notificationRow,!s&&d?m.unread:""),children:[Object(Me.jsx)(h.a,{item:!0,xs:2,className:m.notificationRowIcon,children:p}),Object(Me.jsxs)(h.a,{item:!0,container:!0,xs:7,direction:"row",children:[Object(Me.jsx)(h.a,{item:!0,xs:12,children:Object(Me.jsx)(tt,{className:m.notificationTitle,children:j})}),Object(Me.jsx)(h.a,{item:!0,xs:12,children:Object(Me.jsx)(Je,{className:m.notificationBody,children:o})}),Object(Me.jsx)(h.a,{item:!0,xs:12,children:Object(Me.jsx)(et,{className:m.notificationSubtitle,children:f})})]}),Object(Me.jsx)(h.a,{item:!0,xs:3,style:{zIndex:1},children:Object(Me.jsx)("div",{onClick:function(){return u(a)},className:E()(g)})}),!d&&Object(Me.jsx)(Gt,{className:m.stripes})]})},on=Object(f.a)(It),cn=x()(Qt||(Qt=Object(l.a)(["\n query getNotifications {\n notifications {\n id\n type\n detail\n message\n created\n read\n valid\n }\n hasUnreadNotifications\n machines {\n deviceId\n name\n }\n }\n"]))),ln=x()(Jt||(Jt=Object(l.a)(["\n mutation toggleClearNotification($id: ID!, $read: Boolean!) {\n toggleClearNotification(id: $id, read: $read) {\n id\n read\n }\n }\n"]))),sn=x()(en||(en=Object(l.a)(["\n mutation clearAllNotifications {\n clearAllNotifications {\n id\n }\n }\n"]))),dn=function(e){var t,n,a=e.close,i=e.hasUnreadProp,o=e.buttonCoords,l=e.popperRef,s=e.refetchHasUnreadHeader,d=Object(u.c)(cn,{pollInterval:6e4}),m=d.data,h=d.loading,b=Object(r.useState)(300),p=Object(c.a)(b,2),f=p[0],j=p[1],g=Object(r.useState)(!1),O=Object(c.a)(g,2),x=O[0],v=O[1],y=on({buttonCoords:o,xOffset:f}),w=L.a(B.a(R.a("name")),T.a(R.a("deviceId")))(null!==(t=A.a(["machines"])(m))&&void 0!==t?t:[]),C=null!==(n=A.a(["notifications"])(m))&&void 0!==n?n:[],k=Object(r.useState)(i),S=Object(c.a)(k,2),N=S[0],I=S[1],E=Object(u.b)(ln,{onError:function(){return console.error("Error while clearing notification")},refetchQueries:function(){return["getNotifications"]}}),F=Object(c.a)(E,1)[0],P=Object(u.b)(sn,{onError:function(){return console.error("Error while clearing all notifications")},refetchQueries:function(){return["getNotifications"]}}),D=Object(c.a)(P,1)[0];Object(r.useEffect)((function(){j(l.current.getBoundingClientRect().x),m&&m.hasUnreadNotifications!==N&&(s(),I(!N))}),[l,m,N,s]);return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)("div",{className:y.container,children:[Object(Me.jsxs)("div",{className:y.header,children:[Object(Me.jsx)(Ge,{className:y.headerText,children:"Notifications"}),Object(Me.jsxs)("button",{onClick:a,className:y.notificationIcon,children:[Object(Me.jsx)(st,{}),N&&Object(Me.jsx)("div",{className:y.hasUnread})]})]}),Object(Me.jsxs)("div",{className:y.actionButtons,children:[N&&Object(Me.jsx)(ze,{color:"primary",Icon:Nt,InverseIcon:pt,className:y.clearAllButton,onClick:function(){return v(!x)},children:x?"Show all":"Show unread"}),N&&Object(Me.jsx)(ze,{color:"primary",Icon:vt,InverseIcon:pt,className:y.clearAllButton,onClick:D,children:"Mark all as read"})]}),Object(Me.jsx)("div",{className:y.notificationsList,children:!h&&(x&&N?M.a(W.a("read",!1))(C):C).map((function(e){return Object(Me.jsx)(an,{id:e.id,type:e.type,detail:e.detail,message:e.message,deviceName:w[e.detail.deviceId],created:e.created,read:e.read,valid:e.valid,toggleClear:function(){return F({variables:{id:e.id,read:!e.read}})}},e.id)}))})]}),Object(Me.jsx)("div",{className:y.background})]})},un=n(787),mn=n(788),hn=n(278),bn=n(226),pn=n(17),fn=n(131),jn=n.n(fn),gn=n(785),On=n(786),xn=n(6),vn=Object(f.a)({title:{marginTop:24,marginBottom:24}}),yn=Object(r.memo)((function(e){var t=e.children,n=vn();return Object(Me.jsx)(qe,{className:n.title,children:t})}));function wn(){return(wn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Cn(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var kn=r.createElement("desc",null,"Created with Sketch."),Sn=r.createElement("g",{id:"icon/button/add/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("path",{d:"M11.5384615,6 C11.5384615,9.05815385 9.05815385,11.5384615 6,11.5384615 C2.94184615,11.5384615 0.461538462,9.05815385 0.461538462,6 C0.461538462,2.94184615 2.94184615,0.461538462 6,0.461538462 C9.05815385,0.461538462 11.5384615,2.94184615 11.5384615,6 Z",id:"Stroke-1",stroke:"#1B2559"}),r.createElement("line",{x1:6,y1:3.69230769,x2:6,y2:8.30769231,id:"Stroke-3",stroke:"#1B2559"}),r.createElement("line",{x1:3.69230769,y1:6,x2:8.30769231,y2:6,id:"Stroke-5",stroke:"#1B2559"}));function Nn(e,t){var n=e.title,a=e.titleId,i=Cn(e,["title","titleId"]);return r.createElement("svg",wn({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,kn,Sn)}var In=r.forwardRef(Nn),En=(n.p,{button:{extend:Re.p,border:"none",backgroundColor:G,cursor:"pointer",outline:0,display:"flex",justifyContent:"center",alignItems:"center",width:167,height:48,color:le,"&:hover":{backgroundColor:X},"&:active":{backgroundColor:q,color:Z,"& svg g *":{stroke:Z}},"& svg":{marginRight:8}}}),Fn=Object(f.a)(En),Ln=Object(r.memo)((function(e){var t=e.className,n=e.children,r=Object($.a)(e,["className","children"]),a=Fn();return Object(Me.jsxs)("button",Object(s.a)(Object(s.a)({className:E()(a.button,t)},r),{},{children:[Object(Me.jsx)(In,{}),n]}))})),Pn=Re.h1,Dn=Re.h3,Bn=function(e){switch(e){case"xl":return 61;case"sm":return 32;case"lg":default:return 40}},Rn={wrapper:function(e){var t=e.size,n=Bn(t);return{height:n+n/12/2}},button:function(e){var t=e.size,n=Bn(t),r="xl"===t?3:n/12;return{extend:"xl"===t?Pn:Dn,border:"none",color:Z,cursor:"pointer",fontWeight:900,outline:0,backgroundColor:ee,"&:disabled":{backgroundColor:oe,boxShadow:"none","&:hover":{backgroundColor:oe,boxShadow:"none"},"&:active":{marginTop:0}},shadowSize:r,height:n,padding:"0 ".concat("xl"===t?20:n/2,"px"),borderRadius:n/4,boxShadow:"0 ".concat(r,"px ").concat(te),"&:hover":{backgroundColor:te,boxShadow:"0 ".concat(r,"px ").concat(ne)},"&:active":{marginTop:r/2,backgroundColor:te,boxShadow:"0 ".concat(r/2,"px ").concat(ne)}}}},Tn=Object(f.a)(Rn),An=Object(r.memo)((function(e){var t=e.size,n=void 0===t?"lg":t,r=e.children,a=e.className,i=e.buttonClassName,o=Object($.a)(e,["size","children","className","buttonClassName"]),c=Tn({size:n});return Object(Me.jsx)("div",{className:E()(a,c.wrapper),children:Object(Me.jsx)("button",Object(s.a)(Object(s.a)({className:E()(i,c.button)},o),{},{children:r}))})})),Mn=function(e,t,n){return{backgroundColor:e,"&:hover":{backgroundColor:t},"&:active":{backgroundColor:n}}},Wn={baseButton:{extend:Mn(ae,ie,se),cursor:"pointer",border:"none",outline:0,height:32,color:le,"&:active":{color:Z}},primary:{extend:Mn(ae,ie,se),"&:active":{color:Z,"& $buttonIcon":{display:"none"},"& $buttonIconActive":{display:"block"}},"& $buttonIconActive":{display:"none"}},secondary:{extend:Mn(se,de,Z),color:Z,"&:active":{color:le,"& $buttonIcon":{display:"flex"},"& $buttonIconActive":{display:"none"}},"& $buttonIcon":{display:"none"},"& $buttonIconActive":{display:"flex"}}},zn=Wn.baseButton,$n=Wn.primary,qn={featureButton:{extend:zn,width:zn.height,borderRadius:zn.height/2,display:"flex",padding:0},primary:$n,buttonIcon:{margin:"auto","& svg":{width:16,height:16,overflow:"visible","& g":{strokeWidth:1.8}}},buttonIconActive:{}},Hn=Object(f.a)(qn),Vn=Object(r.memo)((function(e){var t,n=e.className,r=e.Icon,a=e.InverseIcon,i=e.children,o=Object($.a)(e,["className","Icon","InverseIcon","children"]),c=Hn(),l=(t={},Object(z.a)(t,c.featureButton,!0),Object(z.a)(t,c.primary,!0),t);return Object(Me.jsxs)("button",Object(s.a)(Object(s.a)({className:E()(l,n)},o),{},{children:[r&&Object(Me.jsx)("div",{className:c.buttonIcon,children:Object(Me.jsx)(r,{})}),a&&Object(Me.jsx)("div",{className:E()(c.buttonIcon,c.buttonIconActive),children:Object(Me.jsx)(a,{})}),i]}))})),Un=n(285),Gn=n(777),Xn=function(e){var t,n=e.children,a=e.bgColor,i=void 0===a?Z:a,o=e.arrowSize,l=void 0===o?6:o,d=e.className,u=Object($.a)(e,["children","bgColor","arrowSize","className"]),m=Object(r.useState)(null),h=Object(c.a)(m,2),b=h[0],p=h[1],j={popover:{zIndex:3e3,backgroundColor:i,borderRadius:4},arrow:{position:"absolute",fontSize:l,width:"3em",height:"3em"},arrowBottom:{top:0,width:0,height:0,borderLeft:[["2em","solid","transparent"]],borderRight:[["2em","solid","transparent"]],borderBottom:[["2em","solid",i]],marginTop:"-1.9em","&:after":{zIndex:-10,content:'""',position:"absolute",width:3*l,height:3*l,marginLeft:0,bottom:0,top:"calc(50% - 0px)",left:0,border:"5px solid #fff",borderColor:"transparent transparent #fff #fff",transformOrigin:"0 0",transform:"rotate(45deg)",boxShadow:"0px 2px 1px -1px rgba(0,0,0,0.2),0px 1px 1px 0px rgba(0,0,0,0.14),0px 1px 3px 0px rgba(0,0,0,0.12)"}},arrowTop:{bottom:0,width:0,height:0,borderLeft:[["2em","solid","transparent"]],borderRight:[["2em","solid","transparent"]],borderTop:[["2em","solid",i]],marginBottom:"-1.9em","&:after":{zIndex:-10,content:'""',position:"absolute",width:3*l,height:3*l,marginLeft:0,bottom:0,top:-(4*l+2),left:0,border:"5px solid #fff",borderColor:"transparent transparent #fff #fff",transformOrigin:"0 0",transform:"rotate(45deg)",boxShadow:"0px 2px 1px -1px rgba(0,0,0,0.2),0px 1px 1px 0px rgba(0,0,0,0.14),0px 1px 3px 0px rgba(0,0,0,0.12)"}},arrowRight:{left:0,width:0,height:0,borderTop:[["2em","solid","transparent"]],borderBottom:[["2em","solid","transparent"]],borderRight:[["2em","solid",i]],marginLeft:"-1.9em"},arrowLeft:{right:0,width:0,height:0,borderTop:[["2em","solid","transparent"]],borderBottom:[["2em","solid","transparent"]],borderLeft:[["2em","solid",i]],marginRight:"-1.9em"},root:{backgroundColor:i}},g=Object(f.a)(j)(),O=(t={},Object(z.a)(t,g.arrow,!0),Object(z.a)(t,g.arrowBottom,"bottom"===u.placement),Object(z.a)(t,g.arrowTop,"top"===u.placement),Object(z.a)(t,g.arrowRight,"right"===u.placement),Object(z.a)(t,g.arrowLeft,"left"===u.placement),t),x=Gn.a(u.modifiers,{flip:{enabled:!1},preventOverflow:{enabled:!0,boundariesElement:"scrollParent"},offset:{enabled:!0,offset:"0, 10"},arrow:{enabled:!0,element:b},computeStyle:{gpuAcceleration:!1}});return Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsx)(N.a,Object(s.a)(Object(s.a)({disablePortal:!1,modifiers:x,className:g.popover},u),{},{children:Object(Me.jsxs)(Un.a,{className:E()(g.root,d),children:[Object(Me.jsx)("span",{className:E()(O),ref:p}),n]})}))})},Yn=Re.info2,_n=function(e,t,n){return{backgroundColor:e,"&:hover":{backgroundColor:t},"&:active":{backgroundColor:n}}},Zn={idButton:{width:34,height:28,display:"flex",borderRadius:4,padding:0,border:"none",cursor:"pointer"},buttonIcon:{margin:"auto",lineHeight:1,"& svg":{overflow:"visible"}},closed:{extend:_n(ae,ie,se)},open:{extend:_n(se,se,se)},popoverContent:{extend:Yn,padding:8,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:4,"& img":{maxHeight:145}}},Kn=Object(f.a)(Zn),Qn=Object(r.memo)((function(e){var t,n=e.name,a=e.className,i=e.Icon,o=e.InverseIcon,l=(e.popoverWidth,e.children),d=e.popoverClassname,u=Object($.a)(e,["name","className","Icon","InverseIcon","popoverWidth","children","popoverClassname"]),m=Object(r.useState)(null),h=Object(c.a)(m,2),b=h[0],p=h[1],f=Kn(),j=Boolean(b),g=j?"simple-popper-".concat(n):void 0,O=(t={},Object(z.a)(t,f.idButton,!0),Object(z.a)(t,f.primary,!0),Object(z.a)(t,f.open,j),Object(z.a)(t,f.closed,!j),t),x=Object(z.a)({},f.buttonIcon,!0),v=function(){p(null)};return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(S.a,{onClickAway:v,children:Object(Me.jsxs)("button",Object(s.a)(Object(s.a)({"aria-describedby":g,onClick:function(e){p(b?null:e.currentTarget)},className:E()(O,a)},u),{},{children:[i&&!j&&Object(Me.jsx)("div",{className:E()(x),children:Object(Me.jsx)(i,{})}),o&&j&&Object(Me.jsx)("div",{className:E()(x),children:Object(Me.jsx)(o,{})})]}))}),Object(Me.jsx)(Xn,{className:d,id:g,open:j,anchorEl:b,onClose:v,arrowSize:3,placement:"top",children:Object(Me.jsx)("div",{className:f.popoverContent,children:Object(Me.jsx)("div",{children:l})})})]})})),Jn={label:function(e){var t=e.size;return{width:t,height:t}},root:{"& svg":{flex:1},"&:hover":{backgroundColor:"inherit"},"&:hover rect":{stroke:q},"&:hover polygon":{stroke:q},"&:hover path":{stroke:q}}},er=Object(f.a)(Jn),tr=function(e){var t=e.size,n=e.children,r=e.onClick,a=Object($.a)(e,["size","children","onClick"]),i=er({size:t});return Object(Me.jsx)(hn.a,Object(s.a)(Object(s.a)({},a),{},{size:"small",classes:{root:i.root,label:i.label},disableRipple:!0,onClick:r,children:n}))},nr=n(193),rr=function(e){return{boxShadow:"inset 0 -4px 0 0 ".concat(Object(nr.fade)(e,.8)),"&:hover":{boxShadow:"none",backgroundColor:Object(nr.fade)(e,.8)}}},ar={link:{extend:Re.h4,textDecoration:"none",border:"none",backgroundColor:"transparent",cursor:"pointer",padding:"0",height:"100%"},primary:{extend:rr(be)},secondary:{extend:rr("#ff584a"),"&:hover":{color:Z}},noColor:{extend:rr(Z)},action:{extend:rr(be),color:G}},ir=Object(f.a)(ar),or=Object(r.memo)((function(e){var t,n=e.submit,r=e.className,a=e.children,i=e.color,o=void 0===i?"primary":i,c=Object($.a)(e,["submit","className","children","color"]),l=ir(),d=(t={},Object(z.a)(t,l.link,!0),Object(z.a)(t,l.primary,"primary"===o),Object(z.a)(t,l.secondary,"secondary"===o),Object(z.a)(t,l.noColor,"noColor"===o),Object(z.a)(t,l.action,"action"===o),t);return Object(Me.jsx)("button",Object(s.a)(Object(s.a)({type:n?"submit":"button",className:E()(d,r)},c),{},{children:a}))})),cr=Wn.baseButton,lr=Wn.primary,sr={button:{extend:cr,borderRadius:cr.height/2,outline:0,padding:"0 20px"},primary:lr,buttonIcon:{marginTop:4,marginRight:4,"& svg":{width:20,height:20,overflow:"visible"}},buttonIconActive:{}};Object(f.a)(sr);function dr(){return(dr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function ur(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var mr=r.createElement("desc",null,"Created with Sketch."),hr=r.createElement("g",{id:"icon/button/cancel/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("g",{id:"Group-5",transform:"translate(1.000000, 1.000000)",stroke:"#FFFFFF"},r.createElement("line",{x1:10,y1:0,x2:0,y2:10,id:"Stroke-1"}),r.createElement("line",{x1:0,y1:0,x2:10,y2:10,id:"Stroke-3"})));function br(e,t){var n=e.title,a=e.titleId,i=ur(e,["title","titleId"]);return r.createElement("svg",dr({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,mr,hr)}var pr=r.forwardRef(br),fr=(n.p,Wn.baseButton),jr={button:{extend:fr,padding:0,color:Z,borderRadius:fr.height/2},normalButton:{width:fr.height},activeButton:{display:"flex",flexDirection:"row",alignItems:"center",backgroundColor:se,fontWeight:"bold",padding:"0 5px","&:hover":{backgroundColor:se}},buttonIcon:{width:16,height:16,overflow:"visible","& g":{strokeWidth:1.8}},buttonIconActiveLeft:{marginRight:12,marginLeft:4},buttonIconActiveRight:{marginRight:5,marginLeft:20},white:{color:Z}},gr=Object(f.a)(jr),Or=Object(r.memo)((function(e){var t,n=e.className,a=e.Icon,i=e.InverseIcon,o=e.toggle,l=e.children,s=Object(r.useState)(!1),d=Object(c.a)(s,2),u=d[0],m=d[1],h=gr(),b=(t={},Object(z.a)(t,h.button,!0),Object(z.a)(t,h.normalButton,!u),Object(z.a)(t,h.activeButton,u),t),p=Object(Me.jsx)(a,{className:h.buttonIcon}),f=Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(i,{className:E()(h.buttonIcon,h.buttonIconActiveLeft)}),Object(Me.jsx)(Ue,{className:h.white,children:l}),Object(Me.jsx)(pr,{className:E()(h.buttonIcon,h.buttonIconActiveRight)})]});return Object(Me.jsx)("button",{className:E()(b,n),onClick:function(){var e=!u;o(e),m(e)},children:u?f:p})}));function xr(){return(xr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function vr(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var yr=r.createElement("desc",null,"Created with Sketch."),wr=r.createElement("g",{id:"icon/action/external-link/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("polyline",{id:"Stroke-1",stroke:"#FFFFFF",strokeWidth:2,points:"20 12.1113 20 21.0003 0 21.0003 0 1.0003 8.889 1.0003"}),r.createElement("polyline",{id:"Stroke-3",stroke:"#FFFFFF",strokeWidth:2,points:"14.4443 1 20.0003 1 20.0003 6.556"}),r.createElement("line",{x1:10,y1:11,x2:20,y2:1,id:"Stroke-5",stroke:"#FFFFFF",strokeWidth:2}));function Cr(e,t){var n=e.title,a=e.titleId,i=vr(e,["title","titleId"]);return r.createElement("svg",xr({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,yr,wr)}var kr=r.forwardRef(Cr);n.p;function Sr(){return(Sr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Nr(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Ir=r.createElement("desc",null,"Created with Sketch."),Er=r.createElement("g",{id:"icon/action/external-link/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("g",{id:"Group-7",transform:"translate(0.000000, 1.000000)",stroke:"#1B2559",strokeWidth:2},r.createElement("polyline",{id:"Stroke-1",points:"20 11.1113 20 20.0003 0 20.0003 0 0.0003 8.889 0.0003"}),r.createElement("polyline",{id:"Stroke-3",points:"14.4443 0 20.0003 0 20.0003 5.556"}),r.createElement("line",{x1:10,y1:10,x2:20,y2:0,id:"Stroke-5"})));function Fr(e,t){var n=e.title,a=e.titleId,i=Nr(e,["title","titleId"]);return r.createElement("svg",Sr({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Ir,Er)}var Lr=r.forwardRef(Fr),Pr=(n.p,Object(f.a)({actionButton:{marginBottom:32},actionButtonLink:{textDecoration:"none",color:J}})),Dr=function(e){var t=e.link,n=e.label,r=Pr();return Object(Me.jsx)("a",{className:r.actionButtonLink,target:"_blank",rel:"noopener noreferrer",href:t,children:Object(Me.jsx)(ze,{className:r.actionButton,color:"primary",Icon:Lr,InverseIcon:kr,children:n})})},Br=n(192),Rr=n(860),Tr=n(390),Ar=n(868),Mr=n(781),Wr=n(867),zr=n(395),$r=n(782),qr=n(854),Hr=function(e){switch(e){case"sm":return{fontSize:we};case"lg":return{fontSize:ke,fontWeight:700};default:return{fontSize:Ce}}},Vr={fontWeight:700},Ur={size:function(e){var t=e.size;return Object(s.a)({marginTop:"lg"===t?0:2},Hr(t))},bold:Vr,root:function(e){return{width:e.width,"& input":{textAlign:e.textAlign}}},underline:{"&:before":{borderBottomColor:ee},"&:hover:not(.Mui-disabled)::before":{borderBottomColor:ee}}},Gr=Object(f.a)(Ur),Xr=Object(r.memo)((function(e){var t=e.name,n=e.isPasswordFilled,r=e.onChange,a=e.onBlur,i=e.value,o=e.error,c=(e.suffix,e.textAlign),l=e.width,d=e.size,u=e.bold,m=e.className,h=e.InputProps,b=Object($.a)(e,["name","isPasswordFilled","onChange","onBlur","value","error","suffix","textAlign","width","size","bold","className","InputProps"]),p=Gr({textAlign:c,width:l,size:d}),f=!o&&!D.a(i)&&!Wr.a(i),j=n||f,g=Object(z.a)({},p.bold,u);return Object(Me.jsx)(qr.a,Object(s.a)({id:t,onChange:r,onBlur:a,error:o,value:i,classes:{root:p.root},className:m,InputProps:Object(s.a)({className:E()(g),classes:{root:p.size,underline:j?p.underline:null}},h)},b))})),Yr=function(e){e.optionsLimit;var t=e.limit,n=e.options,r=e.label,a=e.valueProp,i=e.multiple,o=e.onChange,c=e.labelProp,l=(e.shouldStayOpen,e.value),d=e.error,u=e.fullWidth,m=e.textAlign,h=e.size,b=e.autoFocus,p=Object($.a)(e,["optionsLimit","limit","options","label","valueProp","multiple","onChange","labelProp","shouldStayOpen","value","error","fullWidth","textAlign","size","autoFocus"]),f=function(e){return function(t){return Ar.a(W.a(a,t))(e)}},j=R.a(a),g=a?(i?B.a(f(n)):f(n))(l):l,O=function(){return D.a(g)?[]:i?g:[g]};return Object(Me.jsx)(Rr.a,Object(s.a)(Object(s.a)({options:n,multiple:i,value:g,onChange:function(e,t){if(!a)return o(e,t);var n=i?B.a(j)(t):j(t);o(e,n)},getOptionLabel:A.a([c]),forcePopupIcon:!1,filterOptions:function(e,n){var r=n.inputValue;return Mr.a(Wr.a(r)?O():[],function(e,t){return t?Object(Tr.a)(e,t,{keys:[a,c]}):e}(e,r)).slice(0,zr.a(void 0)(t)&&Math.max(t,Wr.a(r)?O().length:0))},openOnFocus:!0,autoHighlight:!0,disableClearable:!0,ChipProps:{onDelete:null},clearOnEscape:!0,getOptionSelected:$r.a(a)},p),{},{renderInput:function(e){return Object(Me.jsx)(Xr,Object(s.a)(Object(s.a)({},e),{},{autoFocus:b,label:r,value:l,error:d,size:h,fullWidth:u,textAlign:m}))}}))},_r=n(861),Zr=n(398),Kr=n.n(Zr),Qr=n(397),Jr=n.n(Qr);function ea(){return(ea=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function ta(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var na=r.createElement("desc",null,"Created with Sketch."),ra=r.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"icon/warning-icon/comet"},r.createElement("rect",{id:"Rectangle",stroke:"#5F668A",strokeWidth:2,x:1,y:1,width:22,height:22,rx:11}),r.createElement("path",{d:"M11.2971429,14.4857143 L11.1085714,5.82857143 L13.3714286,5.82857143 L13.2,14.4857143 L11.2971429,14.4857143 Z M11.1942857,18 L11.1942857,15.9771429 L13.3028571,15.9771429 L13.3028571,18 L11.1942857,18 Z",id:"!",fill:"#5F668A",fillRule:"nonzero"})));function aa(e,t){var n=e.title,a=e.titleId,i=ta(e,["title","titleId"]);return r.createElement("svg",ea({width:"24px",height:"24px",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,na,ra)}var ia=r.forwardRef(aa),oa=(n.p,Object(f.a)({root:{color:ee,"&$checked":{color:ee}},checked:{},checkBoxLabel:{display:"flex"},wrapper:{display:"flex",alignItems:"center","& > svg":{marginRight:10}},message:{display:"flex",alignItems:"center",color:se,margin:0,whiteSpace:"break-spaces"}})),ca=function(e){var t=e.name,n=e.onChange,r=e.value,a=e.settings,i=Object($.a)(e,["name","onChange","value","settings"]),o=a.enabled,c=a.label,l=a.disabledMessage,d=oa();return Object(Me.jsx)(Me.Fragment,{children:o?Object(Me.jsxs)("div",{className:d.checkBoxLabel,children:[Object(Me.jsx)(tt,{children:c}),Object(Me.jsx)(_r.a,Object(s.a)({id:t,classes:{root:d.root,checked:d.checked},onChange:n,value:r,checked:r,icon:Object(Me.jsx)(Jr.a,{style:{marginLeft:2,fontSize:Oe}}),checkedIcon:Object(Me.jsx)(Kr.a,{style:{fontSize:ge}}),disableRipple:!0},i))]}):Object(Me.jsxs)("div",{className:d.wrapper,children:[Object(Me.jsx)(ia,{}),Object(Me.jsx)(Ze,{className:d.message,children:l})]})})},la=n(399),sa=n.n(la),da={input:{width:"3.5rem !important",height:"5rem",border:"2px solid",borderColor:G,borderRadius:"4px"},focus:{color:J,border:"2px solid",borderColor:J,borderRadius:"4px"},error:{borderColor:me},container:{justifyContent:"space-evenly"}},ua=Object(f.a)(da),ma=Object(f.a)(Re),ha=function(e){var t=e.name,n=e.value,r=e.onChange,a=e.numInputs,i=e.error,o=e.inputStyle,c=e.containerStyle,l=Object($.a)(e,["name","value","onChange","numInputs","error","inputStyle","containerStyle"]),d=ua(),u=ma();return Object(Me.jsx)(sa.a,Object(s.a)({id:t,value:n,onChange:r,numInputs:a,separator:Object(Me.jsx)("span",{children:" "}),containerStyle:E()(c,d.container),inputStyle:E()(o,d.input,u.confirmationCode),focusStyle:d.focus,errorStyle:d.error,hasErrored:i,isInputNum:!0},l))},ba=n(400),pa=Object(r.memo)((function(e){var t=e.name,n=e.onChange,r=e.onBlur,a=e.value,i=e.error,o=e.suffix,c=e.textAlign,l=e.width,d=e.size,u=e.bold,m=e.className,h=e.decimalPlaces,b=(e.InputProps,Object($.a)(e,["name","onChange","onBlur","value","error","suffix","textAlign","width","size","bold","className","decimalPlaces","InputProps"]));return Object(Me.jsx)(ba.a,Object(s.a)({name:t,onChange:n,onBlur:r,value:a,error:i,suffix:o,textAlign:c,width:l,size:d,bold:u,className:m,customInput:Xr,decimalScale:h,onValueChange:function(e){n({target:{id:t,value:e.floatValue}})}},b))})),fa=n(880),ja=n(783),ga=n(859),Oa=Object(f.a)({label:{height:16,lineHeight:"16px",margin:[[0,0,4,0]],paddingLeft:3}}),xa=function(e){var t=e.name,n=e.label,r=e.value,a=e.options,i=e.onChange,o=e.className,c=e.labelClassName,l=e.radioClassName,s=Oa();return Object(Me.jsxs)(Me.Fragment,{children:[n&&Object(Me.jsx)(et,{className:s.label,children:n}),Object(Me.jsx)(fa.a,{name:t,value:r,onChange:i,className:E()(o),children:a.map((function(e,t){return Object(Me.jsx)(ja.a,{value:e.code,control:Object(Me.jsx)(ga.a,{className:l}),label:e.display,className:E()(c)},t)}))})]})},va=Object(r.memo)((function(e){var t=e.value,n=e.onFocus,a=e.isPasswordFilled,i=e.onBlur,o=Object($.a)(e,["value","onFocus","isPasswordFilled","onBlur"]),l=Object(r.useState)(!1),d=Object(c.a)(l,2),u=d[0],m=d[1];return Object(Me.jsx)(Xr,Object(s.a)(Object(s.a)({},o),{},{type:"password",onFocus:function(e){m(!0),n&&n(e)},onBlur:function(e){m(!1),i&&i(e)},isPasswordFilled:a,value:t,InputProps:{value:t},InputLabelProps:{shrink:a||t||u},placeholder:a?"\u26ac \u26ac \u26ac This field is set \u26ac \u26ac \u26ac":""}))})),ya=n(784),wa=Object(f.a)((function(e){return{root:{width:32,height:20,padding:0,margin:e.spacing(1)},switchBase:{padding:2,"&$disabled":{color:ce,"& + $track":{backgroundColor:oe,opacity:1}},"&$checked":{transform:"translateX(58%)",color:e.palette.common.white,"&$disabled":{color:ce},"& + $track":{backgroundColor:ee,opacity:1,border:"none"}},"&$focusVisible $thumb":{border:"6px solid #fff",boxShadow:"0 0 4px 0 rgba(0,0,0,0.24)"}},thumb:{width:16,height:16},track:{borderRadius:17,border:"none",backgroundColor:se,opacity:1,transition:e.transitions.create(["background-color","border"])},disabled:{},checked:{},focusVisible:{}}})),Ca=Object(r.memo)((function(e){var t=Object.assign({},e),n=wa();return Object(Me.jsx)(ya.a,Object(s.a)({focusVisibleClassName:n.focusVisible,disableRipple:!0,classes:{root:n.root,switchBase:n.switchBase,thumb:n.thumb,track:n.track,checked:n.checked,disabled:n.disabled}},t))})),ka=function(e){var t=e.options,n=e.onChange,a=Object($.a)(e,["options","onChange"]),i=Object(r.useState)(!1),o=Object(c.a)(i,2),l=o[0],d=o[1],u=a.field,m=u.name,h=u.onBlur,b=u.value,p=a.form,f=p.touched,j=p.errors,g=p.setFieldValue,O=p.setFieldTouched,x=!(!f[m]||!j[m]),v=Object(pn.e)(),y=v.initialValues,w=v.values,C="Function"===Br.a(t)?t(y,w):t,k=function(e){return g(m,e)},S=!!a.shouldStayOpen;return Object(Me.jsx)(Yr,Object(s.a)({name:m,onChange:function(e,t){if(n)return n(b,t,k);g(m,t)},onBlur:function(e){m&&O(m,!0),h&&h(e)},value:b,error:x,open:l,options:C,onOpen:function(){if(!a.multiple)return d(!0);d((null===b||void 0===b?void 0:b.length)!==a.limit)},onClose:function(e,t){d(!(!S||"blur"===t))}},a))},Sa=n(879),Na=n(23),Ia=Object(r.memo)((function(e){var t=e.classes,n=Object($.a)(e,["classes"]);return Object(Me.jsx)(Sa.a,Object(s.a)({size:"small",classes:t},n))})),Ea=Object(Na.a)((function(e){return{root:{backgroundColor:ae,borderRadius:4,margin:e.spacing(.5,.25),height:18},label:{fontSize:ye,color:le,fontWeight:Se,fontFamily:Ne,paddingRight:4,paddingLeft:4}}}))(Ia),Fa={cashOut:{empty:K,full:J},cashIn:{empty:J,full:K}},La=function(e){var t=e.cashOut,n=e.applyColorVariant,r=e.isLow;return Fa[t?"cashOut":"cashIn"][n||!r?"full":"empty"]},Pa={cashbox:{borderColor:La,backgroundColor:La,height:118,width:80,border:"2px solid",textAlign:"end",display:"inline-block"},fiatBalanceAlertCashbox:{borderColor:La,backgroundColor:La,height:118,width:80,border:"4px solid"},emptyPart:{backgroundColor:"white",height:function(e){var t=e.percent;return"".concat(100-t,"%")},position:"relative","& > p":{color:La,display:"inline-block",position:"absolute",margin:0,bottom:0,right:0}},fullPart:{backgroundColor:La,"& > p":{color:"white",display:"inline"}}},Da={row:{display:"flex"},innerRow:{display:"flex",justifyContent:"flex-start"},col2:{marginLeft:16},noMarginText:{marginTop:0,marginBottom:0},link:{marginTop:8},chip:{margin:[[0,0,0,7]]}},Ba=Object(f.a)(Pa),Ra=Object(f.a)(Da),Ta=function(e){var t,n=e.percent,r=void 0===n?0:n,a=e.cashOut,i=void 0!==a&&a,o=e.className,c=e.emptyPartClassName,l=e.labelClassName,s=e.applyColorVariant,d=e.applyFiatBalanceAlertsStyling,u=e.omitInnerPercentage,m=e.isLow,h=Ba({percent:r,cashOut:i,applyColorVariant:s,isLow:m}),b=r<=51,p=(t={},Object(z.a)(t,h.fiatBalanceAlertCashbox,d),Object(z.a)(t,h.cashbox,!d),t);return Object(Me.jsxs)("div",{className:E()(o,p),children:[Object(Me.jsx)("div",{className:E()(c,h.emptyPart),children:!u&&b&&Object(Me.jsxs)(tt,{className:l,children:[r.toFixed(0),"%"]})}),Object(Me.jsx)("div",{className:h.fullPart,children:!u&&!b&&Object(Me.jsxs)(tt,{className:l,children:[r.toFixed(0),"%"]})})]})},Aa=function(e){e.currency;var t=e.notes,n=(e.total,Ra());return Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsx)("div",{className:n.row,children:Object(Me.jsxs)("div",{children:[Object(Me.jsx)("div",{className:n.innerRow,children:Object(Me.jsxs)(_e,{className:n.noMarginText,children:[t," notes"]})}),Object(Me.jsx)("div",{className:n.innerRow})]})})})},Ma=function(e){var t=e.capacity,n=void 0===t?500:t,r=e.denomination,a=void 0===r?0:r,i=e.currency,o=e.notes,c=e.className,l=e.editingMode,s=void 0!==l&&l,d=100*o/n,u=d<e.threshold,m=Ra();return Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsxs)("div",{className:m.row,children:[Object(Me.jsx)("div",{className:m.col,children:Object(Me.jsx)(Ta,{className:c,percent:d,cashOut:!0,isLow:u})}),!s&&Object(Me.jsxs)("div",{className:m.col2,children:[Object(Me.jsxs)("div",{className:m.innerRow,children:[Object(Me.jsx)(_e,{className:m.noMarginText,children:o}),Object(Me.jsx)(Ea,{className:m.chip,label:"".concat(a," ").concat(i.code)})]}),Object(Me.jsx)("div",{className:m.innerRow,children:Object(Me.jsxs)(et,{className:m.noMarginText,children:[o*a," ",i.code]})})]})]})})},Wa=Object(f.a)({flex:{display:"flex"},cashCassette:{width:80,height:36,marginRight:16}}),za=Object(r.memo)((function(e){var t=e.decimalPlaces,n=e.threshold,a=Object($.a)(e,["decimalPlaces","threshold"]),i=Wa(),o=a.field,l=o.name,d=o.onChange,u=o.onBlur,m=o.value,h=a.form,b=h.touched,p=h.errors,f=Object(r.useState)(m),j=Object(c.a)(f,2),g=j[0],O=j[1],x=!(!b[l]||!p[l]);return Object(Me.jsxs)("div",{className:i.flex,children:[Object(Me.jsx)(Ma,{className:i.cashCassette,notes:g,editingMode:!0,threshold:n}),Object(Me.jsx)(pa,Object(s.a)({name:l,onChange:function(e){return O(e.target.value),d(e)},onBlur:u,value:m,error:x,decimalPlaces:t},a))]})})),$a=Object(r.memo)((function(e){var t=e.label,n=(e.textAlign,e.fullWidth,e.enabled),r=void 0===n||n,a=e.disabledMessage,i=void 0===a?"":a,o=Object($.a)(e,["label","textAlign","fullWidth","enabled","disabledMessage"]),c=o.field,l=c.name,d=c.onChange,u=c.value,m={enabled:r,label:t,disabledMessage:i};return Object(Me.jsx)(ca,Object(s.a)({name:l,onChange:d,value:u,settings:m},o))})),qa=Object(r.memo)((function(e){var t=e.decimalPlaces,n=Object($.a)(e,["decimalPlaces"]),r=n.field,a=r.name,i=r.onChange,o=r.onBlur,c=r.value,l=n.form,d=l.touched,u=l.errors,m=!(!d[a]||!u[a]);return Object(Me.jsx)(pa,Object(s.a)({name:a,onChange:i,onBlur:o,value:c,error:m,decimalPlaces:t},n))})),Ha=Object(r.memo)((function(e){var t=e.label,n=Object($.a)(e,["label"]),r=n.field,a=r.name,i=r.onChange,o=r.value;return Object(Me.jsx)(xa,Object(s.a)({name:a,label:t,value:o,options:n.options,ariaLabel:a,onChange:function(e){i(e),n.resetError&&n.resetError()},className:n.className},n))})),Va=Object(r.memo)((function(e){var t=e.isPasswordFilled,n=Object($.a)(e,["isPasswordFilled"]),r=n.field,a=r.name,i=r.onChange,o=r.onBlur,c=r.value,l=n.form,d=l.touched,u=l.errors,m=!t&&!(!d[a]||!u[a]);return Object(Me.jsx)(va,Object(s.a)({name:a,isPasswordFilled:t,onChange:i,onBlur:o,value:c,error:m},n))})),Ua=Object(r.memo)((function(e){var t=Object.assign({},e),n=t.field,r=n.name,a=n.onChange,i=n.onBlur,o=n.value,c=t.form,l=c.touched,d=c.errors,u=!(!l[r]||!d[r]);return Object(Me.jsx)(Xr,Object(s.a)({name:r,onChange:a,onBlur:i,value:o,error:u},t))}));function Ga(){return(Ga=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Xa(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Ya=r.createElement("desc",null,"Created with Sketch."),_a=r.createElement("g",{id:"icon/stage/zodiac/complete",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("circle",{id:"Oval",stroke:"#1B2559",transform:"translate(9.000000, 9.000000) rotate(-270.000000) translate(-9.000000, -9.000000) ",cx:9,cy:9,r:8}),r.createElement("path",{d:"M7.80983711,12 C7.54819546,12 7.28655382,11.9032616 7.08725647,11.710772 L5.29971255,9.98428824 C4.90009582,9.59832189 4.90009582,8.97445811 5.29971255,8.58849175 C5.69932929,8.2025254 6.34525711,8.2025254 6.74487384,8.58849175 L7.80983711,9.61707728 L11.2551262,6.28947477 C11.6547429,5.90350841 12.3016927,5.90350841 12.7002874,6.28947477 C13.0999042,6.674454 13.0999042,7.2993049 12.7002874,7.68527125 L8.53241776,11.710772 C8.33312041,11.9032616 8.07147876,12 7.80983711,12",id:"Path",fill:"#1B2559"}));function Za(e,t){var n=e.title,a=e.titleId,i=Xa(e,["title","titleId"]);return r.createElement("svg",Ga({width:"18px",height:"18px",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Ya,_a)}var Ka=r.forwardRef(Za);n.p;function Qa(){return(Qa=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Ja(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var ei=r.createElement("desc",null,"Created with Sketch."),ti=r.createElement("g",{id:"icon/stage/zodiac/current",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("circle",{id:"Oval-2-Copy",fill:"#1B2559",cx:9,cy:9,r:4}),r.createElement("circle",{id:"Oval-Copy-5",stroke:"#1B2559",strokeWidth:2,transform:"translate(9.000000, 9.000000) rotate(-270.000000) translate(-9.000000, -9.000000) ",cx:9,cy:9,r:8}));function ni(e,t){var n=e.title,a=e.titleId,i=Ja(e,["title","titleId"]);return r.createElement("svg",Qa({width:"18px",height:"18px",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,ei,ti)}var ri,ai=r.forwardRef(ni),ii=(n.p,Re.tl2),oi=Re.p,ci=G,li={sidebar:Object(z.a)({display:"flex",backgroundColor:ci,width:520,marginLeft:-300,boxShadow:"-500px 0px 0px 0px ".concat(ci),borderRadius:"0 20px 0 0",alignItems:"flex-end",padding:24,flexDirection:"column"},(ri=1440,"@media only screen and (max-width: ".concat(ri,")")),{width:"auto",marginLeft:0,minWidth:250,boxShadow:"-200px 0px 0px 0px ".concat(ci)}),link:{extend:oi,position:"relative",color:ue,margin:"12px 24px 12px 0",cursor:"pointer","&:hover::after":{height:"140%"},"&:after":{content:'""',display:"block",background:J,width:4,height:0,left:"100%",marginLeft:20,bottom:-2,position:"absolute",borderRadius:1e3,transition:"all 0.2s cubic-bezier(0.95, 0.1, 0.45, 0.94)"}},activeLink:{extend:ii,color:J,"&::after":{height:"140%"}},customRenderLink:{"&:hover::after":{height:"100%"},"&:after":{bottom:0}},customRenderActiveLink:{"&::after":{height:"100%"}},item:{position:"relative",margin:"12px 0 12px 0",display:"flex"},itemText:{extend:oi,color:ue,marginRight:24},itemTextActive:{extend:ii,color:J},itemTextPast:{color:J},stepperPath:{position:"absolute",height:25,width:1,border:[[1,"solid",ue]],right:8,top:18},stepperPast:{border:[[1,"solid",J]]}},si=Object(f.a)(li),di=function(e){var t=e.data,n=e.displayName,r=e.isSelected,a=e.onClick,i=e.children,o=e.itemRender,c=e.loading,l=void 0!==c&&c,s=si();return Object(Me.jsxs)("div",{className:s.sidebar,children:[l&&Object(Me.jsx)(Xe,{children:"Loading..."}),!l&&(null===t||void 0===t?void 0:t.map((function(e,t){var i;return Object(Me.jsx)("div",{className:E()((i={},Object(z.a)(i,s.activeLink,r(e)),Object(z.a)(i,s.customRenderActiveLink,o&&r(e)),Object(z.a)(i,s.customRenderLink,o),Object(z.a)(i,s.link,!0),i)),onClick:function(){return a(e)},children:o?o(e,r(e)):n(e)},t)}))),!l&&i]})},ui=function(e){var t,n,r=e.step,a=e.it,i=e.idx,o=e.steps,c=si(),l=r===i,s=i<r,d=i>r;return Object(Me.jsxs)("div",{className:c.item,children:[Object(Me.jsx)("span",{className:E()((t={},Object(z.a)(t,c.itemText,!0),Object(z.a)(t,c.itemTextActive,l),Object(z.a)(t,c.itemTextPast,s),t)),children:a.label}),l&&Object(Me.jsx)(ai,{}),s&&Object(Me.jsx)(Ka,{}),d&&Object(Me.jsx)(vt,{}),i<o.length-1&&Object(Me.jsx)("div",{className:E()((n={},Object(z.a)(n,c.stepperPath,!0),Object(z.a)(n,c.stepperPast,s),n))})]})};function mi(){return(mi=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function hi(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var bi=r.createElement("style",{type:"text/css"},"\n\t.st0{fill-rule:evenodd;clip-rule:evenodd;fill:#1B2559;}\n"),pi=r.createElement("desc",null,"Created with Sketch."),fi=r.createElement("g",{id:"color_x2F_primary_x2F_zodiac",transform:"translate(-0.000000, 0.000000)"},r.createElement("g",{id:"Mask"},r.createElement("path",{id:"path-1_1_",className:"st0",d:"M11.1,9l6.5,6.5c0.6,0.6,0.6,1.5,0,2.1c-0.3,0.3-0.7,0.4-1.1,0.4c-0.4,0-0.8-0.2-1.1-0.4 L9,11.1l-6.5,6.5C2.3,17.8,1.9,18,1.5,18c-0.4,0-0.8-0.2-1.1-0.4c-0.6-0.6-0.6-1.5,0-2.1L6.9,9L0.4,2.5C-0.1,2-0.1,1,0.4,0.4 C1-0.1,2-0.1,2.5,0.4L9,6.9l6.5-6.5c0.6-0.6,1.5-0.6,2.1,0c0.6,0.6,0.6,1.5,0,2.1L11.1,9z"})));function ji(e,t){var n=e.title,a=e.titleId,i=hi(e,["title","titleId"]);return r.createElement("svg",mi({id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 18 18",style:{enableBackground:"new 0 0 18 18"},xmlSpace:"preserve",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,bi,pi,fi)}var gi=r.forwardRef(ji);n.p;function Oi(){return(Oi=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function xi(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var vi=r.createElement("desc",null,"Created with Sketch."),yi=r.createElement("g",{id:"icon/stage/spring/complete",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("circle",{id:"Oval",stroke:"#48F694",strokeWidth:2,transform:"translate(9.000000, 9.000000) rotate(-270.000000) translate(-9.000000, -9.000000) ",cx:9,cy:9,r:8}),r.createElement("path",{d:"M7.80983711,12 C7.54819546,12 7.28655382,11.9032616 7.08725647,11.710772 L5.29971255,9.98428824 C4.90009582,9.59832189 4.90009582,8.97445811 5.29971255,8.58849175 C5.69932929,8.2025254 6.34525711,8.2025254 6.74487384,8.58849175 L7.80983711,9.61707728 L11.2551262,6.28947477 C11.6547429,5.90350841 12.3016927,5.90350841 12.7002874,6.28947477 C13.0999042,6.674454 13.0999042,7.2993049 12.7002874,7.68527125 L8.53241776,11.710772 C8.33312041,11.9032616 8.07147876,12 7.80983711,12",id:"Path",fill:"#48F694"}));function wi(e,t){var n=e.title,a=e.titleId,i=xi(e,["title","titleId"]);return r.createElement("svg",Oi({width:"18px",height:"18px",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,vi,yi)}var Ci,ki,Si=r.forwardRef(wi),Ni=(n.p,"100%"),Ii="column",Ei={dialog:{backgroundColor:re,width:Ni,minHeight:Ni,display:"flex",flexDirection:Ii,padding:0},wrapper:{width:he,height:Ni,margin:"0 auto",flex:1,display:"flex",flexDirection:Ii},contentDiv:{display:"flex",flex:1,flexDirection:"row"},headerDiv:{display:"flex",justifyContent:"space-between",alignItems:"center"},contentWrapper:{marginLeft:48},button:{marginTop:64},nameTitle:{marginTop:16,marginBottom:25},qrTitle:{marginTop:12,marginBottom:40},qrCodeWrapper:{display:"flex"},qrTextInfoWrapper:{display:"flex",flexDirection:"row"},qrTextWrapper:{width:381,marginLeft:80,display:"flex",flexDirection:"column"},textWrapper:{display:"flex",flexDirection:"column"},qrTextIcon:{marginRight:16},qrText:{marginTop:0},item:{position:"relative",margin:"12px 0 12px 0",display:"flex"},itemText:{extend:Re.p,color:ue,marginRight:24},itemTextActive:{extend:Re.tl2,color:J},itemTextPast:{color:J},stepperPath:{position:"absolute",height:25,width:1,border:[[1,"solid",ue]],right:8,top:18},stepperPast:{border:[[1,"solid",J]]},successMessageWrapper:{backgroundColor:V,display:"flex",flexDirection:"row",padding:"0px 10px",borderRadius:"8px"},successMessage:{color:H,margin:"8px 0px"},successMessageIcon:{marginRight:16,marginBottom:2,display:"flex",flexDirection:"col",alignItems:"center"},errorMessage:{color:me}},Fi=x()(Ci||(Ci=Object(l.a)(["\n mutation createPairingTotem($name: String!) {\n createPairingTotem(name: $name)\n }\n"]))),Li=x()(ki||(ki=Object(l.a)(["\n {\n machines {\n name\n deviceId\n }\n }\n"]))),Pi=Object(f.a)(Ei),Di=L.a(gn.a,On.a([],["machines"])),Bi={name:""},Ri=xn.e().shape({name:xn.g().required("Machine name is required.").max(50).test("unique-name","Machine name is already in use.",(function(e,t){return!t.options.context.machineNames.includes(e)}))}),Ti=[{label:"Machine name",component:function(e){var t=e.nextStep,n=e.classes,r=e.setQrCode,a=e.setName,i=Object(u.b)(Fi,{onCompleted:function(e){var n=e.createPairingTotem;r(n),t()},onError:function(e){return console.log(e)}}),o=Object(c.a)(i,1)[0],l=Object(u.c)(Li).data,s=B.a(R.a("name"),(null===l||void 0===l?void 0:l.machines)||{});return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(_e,{className:n.nameTitle,children:"Machine Name (ex: Coffee shop 01)"}),Object(Me.jsx)(pn.d,{validateOnBlur:!1,validateOnChange:!1,initialValues:Bi,validate:function(e){try{Ri.validateSync(e,{context:{machineNames:s}})}catch(t){return t}},onSubmit:function(e){var t=e.name;a(t),o({variables:{name:t}})},children:function(e){var t=e.errors;return Object(Me.jsxs)(pn.c,{className:n.form,children:[Object(Me.jsx)("div",{children:Object(Me.jsx)(pn.a,{name:"name",label:"Enter machine name",component:Ua})}),t&&Object(Me.jsx)(Xe,{className:n.errorMessage,children:t.message}),Object(Me.jsx)("div",{className:n.button,children:Object(Me.jsx)(An,{type:"submit",children:"Submit"})})]})}})]})}},{label:"Scan QR code",component:function(e){var t,n=e.classes,a=e.qrCode,i=e.name,o=e.count,c=e.onPaired,l=Object(r.useRef)(null),s=Object(u.c)(Li,{pollInterval:1e4}).data;Object(r.useEffect)((function(){return function(){l.current&&clearTimeout(l.current)}}),[]);var d=null===s||void 0===s||null===(t=s.machines)||void 0===t?void 0:t.find((function(e){return e.name===i})),m=Di(s)>o&&d;return m&&(l.current=setTimeout((function(){return c(d)}),2e3)),Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(_e,{className:n.qrTitle,children:"Scan QR code with your new cryptomat"}),Object(Me.jsxs)("div",{className:n.qrCodeWrapper,children:[Object(Me.jsx)("div",{children:Object(Me.jsx)(jn.a,{size:240,fgColor:J,value:a})}),Object(Me.jsxs)("div",{className:n.qrTextWrapper,children:[Object(Me.jsxs)("div",{className:n.qrTextInfoWrapper,children:[Object(Me.jsx)("div",{className:n.qrTextIcon,children:Object(Me.jsx)(ia,{})}),Object(Me.jsx)("div",{className:n.textWrapper,children:Object(Me.jsx)(Xe,{className:n.qrText,children:"To pair the machine you need scan the QR code with your machine. To do this either snap a picture of this QR code or download it through the button above and scan it with the scanning bay on your machine."})})]}),m&&Object(Me.jsxs)("div",{className:n.successMessageWrapper,children:[Object(Me.jsx)("div",{className:n.successMessageIcon,children:Object(Me.jsx)(Si,{})}),Object(Me.jsx)(_e,{className:n.successMessage,children:"Machine has been successfully paired!"})]})]})]})]})}}],Ai=Object(r.memo)((function(e){var t=e.close,n=e.onPaired,a=Pi(),i=Object(u.c)(Li).data,o=Object(r.useState)(""),l=Object(c.a)(o,2),s=l[0],d=l[1],m=Object(r.useState)(""),h=Object(c.a)(m,2),b=h[0],p=h[1],f=Object(r.useState)(0),j=Object(c.a)(f,2),g=j[0],O=j[1],x=Di(i),v=Ti[g].component;return Object(Me.jsx)("div",{children:Object(Me.jsx)(un.a,{fullScreen:!0,className:a.dialog,open:!0,"aria-labelledby":"form-dialog-title",children:Object(Me.jsx)(mn.a,{className:a.dialog,children:Object(Me.jsxs)("div",{className:a.wrapper,children:[Object(Me.jsxs)("div",{className:a.headerDiv,children:[Object(Me.jsx)(yn,{children:"Add Machine"}),Object(Me.jsx)(hn.a,{disableRipple:!0,onClick:t,children:Object(Me.jsx)(bn.a,{color:"error",children:Object(Me.jsx)(gi,{})})})]}),Object(Me.jsxs)("div",{className:a.contentDiv,children:[Object(Me.jsx)(di,{children:Ti.map((function(e,t){return function(e,t,n,r){var a,i,o=e===n,c=n<e,l=n>e;return Object(Me.jsxs)("div",{className:r.item,children:[Object(Me.jsx)("span",{className:E()((a={},Object(z.a)(a,r.itemText,!0),Object(z.a)(a,r.itemTextActive,o),Object(z.a)(a,r.itemTextPast,c),a)),children:t.label}),o&&Object(Me.jsx)(ai,{}),c&&Object(Me.jsx)(Ka,{}),l&&Object(Me.jsx)(vt,{}),n<Ti.length-1&&Object(Me.jsx)("div",{className:E()((i={},Object(z.a)(i,r.stepperPath,!0),Object(z.a)(i,r.stepperPast,c),i))})]})}(g,e,t,a)}))}),Object(Me.jsx)("div",{className:a.contentWrapper,children:Object(Me.jsx)(v,{classes:a,nextStep:function(){return O(1)},count:x,onPaired:n,qrCode:s,setQrCode:d,name:b,setName:p})})]})]})})})})}));function Mi(){return(Mi=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Wi(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var zi=r.createElement("desc",null,"Created with Sketch."),$i=r.createElement("g",{id:"icon/button/add/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("path",{d:"M11.5384615,6 C11.5384615,9.05815385 9.05815385,11.5384615 6,11.5384615 C2.94184615,11.5384615 0.461538462,9.05815385 0.461538462,6 C0.461538462,2.94184615 2.94184615,0.461538462 6,0.461538462 C9.05815385,0.461538462 11.5384615,2.94184615 11.5384615,6 Z",id:"Stroke-1",stroke:"#FFFFFF"}),r.createElement("line",{x1:6,y1:3.69230769,x2:6,y2:8.30769231,id:"Stroke-3",stroke:"#FFFFFF"}),r.createElement("line",{x1:3.69230769,y1:6,x2:8.30769231,y2:6,id:"Stroke-5",stroke:"#FFFFFF"}));function qi(e,t){var n=e.title,a=e.titleId,i=Wi(e,["title","titleId"]);return r.createElement("svg",Mi({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,zi,$i)}var Hi=r.forwardRef(qi);n.p;function Vi(){return(Vi=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Ui(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Gi=r.createElement("desc",null,"Created with Sketch."),Xi=r.createElement("defs",null,r.createElement("path",{d:"M17.8413132,12.8764646 C17.8413132,12.8764646 16.6555879,12.5091919 15.661533,12.2855556 C15.661533,12.2855556 15.3477198,10.3246465 14.8939121,8.23646465 C14.8939121,8.23646465 15.1560495,8.21373737 15.3383242,8.8710101 L16.0223242,12.0219192 C16.0223242,12.0219192 17.2343571,12.2991919 18.1795549,12.6537374 L17.8413132,12.8764646 Z M15.2603407,6.10282828 L15.5328132,5.80555556 C16.0627253,5.87828283 16.3483516,6.02828283 16.3483516,6.02828283 L16.291978,6.11191919 L16.3972088,6.9310101 C16.2440604,6.93646465 16.0091703,7.05919192 16.0091703,7.05919192 L15.8315934,6.95010101 L15.8315934,6.38282828 C15.3026209,6.29919192 15.2556429,6.21828283 15.2556429,6.21828283 L15.2603407,6.10282828 Z M12.4557527,18.2873737 C11.2831813,18.4964646 9.84565385,18.2237374 9.84565385,18.2237374 L9.89732967,17.9991919 C9.89732967,17.9991919 11.6496099,18.1955556 12.6248736,17.8973737 C12.5553462,18.0628283 12.5356154,18.1137374 12.4557527,18.2873737 L12.4557527,18.2873737 Z M9.18984066,14.5464646 C8.379,15.1364646 7.56064286,15.6791919 7.00442308,16.1091919 C6.9705989,16.6955556 6.91516484,17.6464646 6.91516484,17.6464646 L5.46448352,18.5182828 L5.22207692,18.3737374 C5.27845055,17.9219192 5.34891758,17.5882828 5.34891758,17.5882828 L5.55186264,17.4410101 C5.50676374,17.7282828 5.48515385,18.1346465 5.48515385,18.1346465 L6.5928956,17.440101 C6.63705495,16.7019192 6.72443407,15.960101 6.72443407,15.960101 C6.9705989,15.7373737 8.73697253,14.5237374 10.0100803,13.6864646 C10.0100803,13.6864646 10.018533,13.9437374 9.18984066,14.5464646 L9.18984066,14.5464646 Z M14.977533,0.195555556 C15.2612802,0.167373737 15.5065055,0.184646465 15.7103901,0.228282828 L15.7103901,0.228282828 L15.8813901,0.697373737 L16.1003077,0.361919192 C16.2694286,0.447373737 16.3746593,0.547373737 16.4056648,0.624646465 C16.4056648,0.624646465 16.3615055,0.909191919 16.4319725,1.36464646 C16.5005604,1.80373737 16.6988077,2.78191919 16.6988077,2.78191919 C16.9740989,3.00646465 17.2850934,3.51282828 17.2850934,3.51282828 C17.4758242,4.41737374 17.4645495,5.04919192 17.4636099,5.1210101 C16.6734396,4.68646465 15.6173736,4.58555556 15.6173736,4.58555556 L15.6173736,4.58555556 L15.2481264,4.90828283 C15.9753462,5.00828283 16.8792033,5.26555556 17.1122143,5.44555556 C17.2484505,5.74737374 17.3386484,6.22828283 17.3386484,6.22828283 L17.3386484,6.22828283 L17.0445659,6.58919192 L17.3198571,6.8810101 C17.3386484,7.22464646 17.2183846,7.56919192 17.2183846,7.56919192 C17.7905769,7.93010101 17.9512418,8.79373737 18.3101538,10.250101 C18.6700055,11.7064646 18.9903956,12.9055556 18.9903956,12.9055556 L18.9903956,12.9055556 L18.4567253,13.2019192 C19.1623352,15.7282828 18.444511,17.7391919 17.5378352,19.0664646 C16.6320989,20.3946465 16.0862143,21.7137374 16.1031264,22.8910101 L16.1031264,22.8910101 L16.5475385,23.2346465 L16.7749121,23.9491919 L14.3048077,23.9491919 L14.293533,23.2728283 C14.2925934,21.5619192 14.9230385,20.1328283 14.9230385,20.1328283 C15.2857088,20.0473737 15.6596538,19.7628283 15.6596538,19.7628283 C15.0733681,19.8828283 14.3414505,19.7964646 14.3414505,19.7964646 C14.8676044,18.8537374 15.0292088,18.1773737 15.0292088,18.1773737 L15.0292088,18.1773737 L14.7811648,18.1228283 C14.6956648,18.310101 14.6073462,18.4937374 14.5133901,18.6710101 C13.8754286,19.8864646 13.1735769,20.6628283 12.7554725,22.4055556 L12.7554725,22.4055556 L13.1933077,22.7455556 L13.6987912,23.9491919 L10.8509835,23.9491919 C10.8340714,21.8246465 11.495522,20.2273737 11.7341703,19.7628283 C10.2233571,19.9264646 8.42128022,19.1782828 6.99314835,19.4664646 C6.60041209,21.9473737 4.59257143,22.4355556 3.65019231,22.300101 L3.65019231,22.300101 L2.97652747,23.4146465 L3.58724176,23.9491919 L1.33135714,23.9491919 C1.32008242,23.8546465 1.2918956,23.7537374 1.22988462,23.6591919 C1.22988462,23.6591919 1.97401648,22.5882828 2.48231868,21.150101 C2.89008791,21.3255556 3.75166484,20.9928283 3.78736813,20.1055556 C3.82401099,19.2191919 3.67086264,17.8419192 4.46854945,16.7891919 C5.2652967,15.7355556 6.12687363,15.1655556 7.25152747,14.3328283 C7.98250549,13.7910101 9.22084615,12.8755556 9.99974176,12.3010101 L9.99974176,12.3010101 L9.61546154,12.3864646 L6.81087363,14.6491919 L5.82997253,14.6491919 L8.66368681,12.1164646 L8.29725824,12.1091919 L5.33576374,14.6491919 L4.34170879,14.6491919 L7.27313736,11.720101 L6.9208022,11.7173737 L3.88038462,14.6491919 L2.86565934,14.6491919 L5.8093022,11.3037374 L5.46918132,11.3055556 L2.43534066,14.6491919 L1.36706044,14.6491919 L4.22614286,10.8528283 L3.89635714,10.8573737 L0.963989011,14.6491919 L0,14.6491919 C0,14.6491919 4.11809341,8.22464646 4.92893407,7.00737374 C5.73883516,5.79010101 6.6192033,4.62282828 8.06894505,4.38464646 C9.53465934,4.14282828 10.5343516,4.46646465 11.2502967,5.63373737 C11.636456,6.2610101 12.1034176,6.97828283 12.4698462,7.55919192 C12.0968407,8.1510101 11.6298791,8.6110101 11.5857198,9.32282828 C11.534044,10.1419192 12.0921429,10.6373737 12.6558791,10.6773737 C12.2321374,10.5282828 11.8976538,10.0337374 12.0489231,9.37646465 C12.2058297,8.69737374 12.7554725,8.35191919 13.1726374,7.80282828 C13.5315495,7.32828283 13.5371868,6.63282828 13.5108791,6.4010101 C13.4836319,6.16919192 13.2167967,5.98828283 13.2167967,5.98828283 C13.2167967,5.98828283 13.2252527,5.52373737 13.2167967,5.01646465 C13.2083407,4.51010101 13.4300769,4.21828283 13.4300769,4.21828283 C13.4300769,4.21828283 13.4216209,3.4610101 13.3943736,2.57646465 C13.3671264,1.72555556 13.2863242,1.46828283 13.205522,1.35464646 C13.205522,1.35464646 13.2694121,1.10919192 13.5099396,0.844646465 L13.5099396,0.844646465 L13.7542253,1.06282828 L13.8284505,0.571919192 C13.9825385,0.469191919 14.1723297,0.375555556 14.4072198,0.307373737 C14.4325879,0.30010101 14.4570165,0.294646465 14.4823846,0.288282828 L14.4823846,0.288282828 L14.7896209,0.644646465 Z M7.71628243,19.8937938 C8.32897736,19.8402566 9.02386307,19.9393405 9.75797621,20.0432188 L9.75797621,20.0432188 L9.86538462,20.058401 C9.7449004,20.8103202 9.02106112,21.7691969 7.79193531,22.0896215 L7.79193531,22.0896215 L9.01358923,23.5151515 L7.36136769,23.5151515 C7.15589073,23.2226941 6.50396838,22.32135 6.16586538,21.9681638 C6.72065317,21.6525335 7.42954868,21.0388524 7.71628243,19.8937938 Z",id:"path-1"})),Yi=r.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"nav-/-primary-/-1440",transform:"translate(-128.000000, -14.000000)"},r.createElement("g",{id:"icon/lamassu-logo",transform:"translate(128.000000, 14.000000)"},r.createElement("g",{id:"color/amaz/default"},r.createElement("mask",{id:"mask-2",fill:"white"},r.createElement("use",{xlinkHref:"#path-1"})),r.createElement("use",{id:"Mask",fill:"#16D6D3",xlinkHref:"#path-1"})))));function _i(e,t){var n=e.title,a=e.titleId,i=Ui(e,["title","titleId"]);return r.createElement("svg",Vi({width:"19px",height:"24px",viewBox:"0 0 19 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Gi,Xi,Yi)}var Zi=r.forwardRef(_i);n.p;function Ki(){return(Ki=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Qi(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Ji=r.createElement("desc",null,"Created with Sketch."),eo=r.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"nav-/-primary-/-1440",transform:"translate(-1295.000000, -19.000000)",stroke:"#FFFFFF",strokeWidth:2},r.createElement("g",{id:"icon/menu/notification",transform:"translate(1296.000000, 20.000000)"},r.createElement("path",{d:"M10.1052632,14.3157895 C10.1052632,15.2454737 9.35073684,16 8.42105263,16 C7.49136842,16 6.73684211,15.2454737 6.73684211,14.3157895",id:"Stroke-1"}),r.createElement("path",{d:"M1.6,14.3157895 C0.7168,14.3157895 0,13.6031813 0,12.7251462 C0,11.8471111 0.7168,11.1345029 1.6,11.1345029 L1.6,6.3625731 C1.6,2.84884211 4.4656,0 8,0 C11.5344,0 14.4,2.84884211 14.4,6.3625731 L14.4,11.1345029 C15.2832,11.1345029 16,11.8471111 16,12.7251462 C16,13.6031813 15.2832,14.3157895 14.4,14.3157895 L1.6,14.3157895 Z",id:"Stroke-3",strokeLinejoin:"round"}))));function to(e,t){var n=e.title,a=e.titleId,i=Qi(e,["title","titleId"]);return r.createElement("svg",Ki({width:"18px",height:"18px",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Ji,eo)}var no=r.forwardRef(to),ro=(n.p,Re.tl2),ao=Re.p,io=56,oo=40;var co,lo,so,uo,mo,ho,bo,po,fo,jo,go,Oo,xo,vo={headerContainer:{position:"relative"},header:{backgroundColor:J,color:Z,height:io,display:"flex"},content:{maxWidth:he,flex:1,display:"flex",alignItems:"center",margin:"0 auto"},nav:{flex:1,display:"flex",alignItems:"center",justifyContent:"space-between"},ul:{display:"flex",paddingLeft:36,height:56,margin:0},li:{listStyle:"none",color:Z,margin:[[20,20,0,20]],"&:hover":{color:Z},"&:hover::after":{width:"50%",marginLeft:"-25%"},position:"relative","&:after":{content:'""',display:"block",background:Z,width:0,height:4,left:"50%",marginLeft:0,bottom:-8,position:"absolute",borderRadius:1e3,transition:[["all","0.2s","cubic-bezier(0.95, 0.1, 0.45, 0.94)"]]}},link:{extend:ao,textDecoration:"none",border:"none",color:Z,backgroundColor:"transparent"},forceSize:{display:"inline-block",textAlign:"center","&:after":{display:"block",content:"attr(forcesize)",fontWeight:700,height:0,overflow:"hidden",visibility:"hidden"}},activeLink:{color:Z,"& li::after":{width:"50%",marginLeft:"-25%"}},addMachine:{marginLeft:"auto"},subheader:{backgroundColor:ae,color:Z,height:oo,display:"flex"},subheaderUl:{display:"flex",paddingLeft:0},subheaderLi:{extend:ro,display:"flex",alignItems:"center",height:24,listStyle:"none",padding:[[0,20]],"&:first-child":{paddingLeft:0}},subheaderLink:{extend:ao,textDecoration:"none",border:"none",color:ue},activeSubheaderLink:{extend:ro,color:le},white:{color:Z},logo:{display:"flex",alignItems:"center","& > svg":{marginRight:16}},logoLink:{cursor:"pointer"},actionButtonsContainer:{zIndex:1,position:"relative",display:"flex",justifyContent:"space-between",minWidth:200,transform:"translateZ(0)"},notificationIcon:{marginTop:4,cursor:"pointer",background:"transparent",boxShadow:"0px 0px 0px transparent",border:"0px solid transparent",textShadow:"0px 0px 0px transparent",outline:"none"},hasUnread:{position:"absolute",top:4,left:182,width:"9px",height:"9px",backgroundColor:ee,borderRadius:"50%"},popper:{zIndex:1}},yo=Object(f.a)(vo),wo=x()(co||(co=Object(l.a)(["\n query getUnread {\n hasUnreadNotifications\n }\n"]))),Co=function(e){var t=e.item,n=e.classes,a=e.user,i=Object(r.useState)(null),o=Object(c.a)(i,2),l=o[0],s=o[1];return Object(Me.jsx)("div",{className:n.subheader,children:Object(Me.jsx)("div",{className:n.content,children:Object(Me.jsx)("nav",{children:Object(Me.jsx)("ul",{className:n.subheaderUl,children:t.children.map((function(e,t){return F.a(a.role,e.allowedRoles)?Object(Me.jsx)("li",{className:n.subheaderLi,children:Object(Me.jsx)(C.c,{to:{pathname:e.route,state:{prev:l}},className:n.subheaderLink,activeClassName:n.activeSubheaderLink,isActive:function(t){return!!t&&(s(e.route),!0)},children:e.label})},t):Object(Me.jsx)(Me.Fragment,{})}))})})})})},ko=L.a(P.a,D.a),So=Object(r.memo)((function(e){var t=e.tree,n=e.user,a=Object(r.useState)(!1),i=Object(c.a)(a,2),o=i[0],l=i[1],s=Object(r.useState)(null),d=Object(c.a)(s,2),m=d[0],h=d[1],b=Object(r.useState)({x:0,y:0}),p=Object(c.a)(b,2),f=p[0],j=p[1],g=Object(r.useState)(),O=Object(c.a)(g,2),x=O[0],v=O[1],y=Object(r.useState)(!1),k=Object(c.a)(y,2),I=k[0],L=k[1],P=Object(u.c)(wo),D=P.data,B=P.refetch,R=P.startPolling,T=P.stopPolling,A=Object(r.useRef)(),M=Object(r.useRef)(),W=Object(w.h)(),z=yo();Object(r.useEffect)((function(){return(null===D||void 0===D?void 0:D.hasUnreadNotifications)?L(!0):ko(null===D||void 0===D?void 0:D.hasUnreadNotifications)?L(!1):void 0}),[D]),Object(r.useEffect)((function(){return R(6e4),T}));var $=function(){h(null),document.querySelector("#root").classList.remove("root-notifcenter-open"),document.querySelector("body").classList.remove("body-notifcenter-open")},q=Boolean(m),H=q?"notifications-popper":void 0;return Object(Me.jsxs)("header",{className:z.headerContainer,children:[Object(Me.jsx)("div",{className:z.header,children:Object(Me.jsxs)("div",{className:z.content,children:[Object(Me.jsxs)("div",{onClick:function(){v(!1),W.push("/dashboard")},className:E()(z.logo,z.logoLink),children:[Object(Me.jsx)(Zi,{}),Object(Me.jsx)(Ue,{className:z.white,children:"Lamassu Admin"})]}),Object(Me.jsx)("nav",{className:z.nav,children:Object(Me.jsx)("ul",{className:z.ul,children:t.map((function(e,t){return F.a(n.role,e.allowedRoles)?Object(Me.jsx)(C.c,{to:e.route||e.children[0].route,isActive:function(t){return!!t&&(v(e),!0)},className:E()(z.link,z.whiteLink),activeClassName:z.activeLink,children:Object(Me.jsx)("li",{className:z.li,children:Object(Me.jsx)("span",{className:z.forceSize,forcesize:e.label,children:e.label})})},t):Object(Me.jsx)(Me.Fragment,{})}))})}),Object(Me.jsxs)("div",{className:z.actionButtonsContainer,children:[Object(Me.jsx)(ze,{color:"secondary",Icon:In,InverseIcon:Hi,onClick:function(){return l(!0)},children:"Add machine"}),Object(Me.jsx)(S.a,{onClickAway:$,children:Object(Me.jsxs)("div",{ref:A,children:[Object(Me.jsxs)("button",{onClick:function(e){var t=A.current.getBoundingClientRect();j({x:t.x,y:t.y}),h(m?null:e.currentTarget),document.querySelector("#root").classList.add("root-notifcenter-open"),document.querySelector("body").classList.add("body-notifcenter-open")},className:z.notificationIcon,children:[Object(Me.jsx)(no,{}),I&&Object(Me.jsx)("div",{className:z.hasUnread})]}),Object(Me.jsx)(N.a,{ref:M,id:H,open:q,anchorEl:m,className:z.popper,disablePortal:!1,modifiers:{preventOverflow:{enabled:!0,boundariesElement:"viewport"}},children:Object(Me.jsx)(dn,{popperRef:M,buttonCoords:f,close:$,hasUnreadProp:I,refetchHasUnreadHeader:B})})]})})]})]})}),x&&x.children&&Object(Me.jsx)(Co,{item:x,classes:z,user:n}),o&&Object(Me.jsx)(Ai,{close:function(){return l(!1)},onPaired:function(e){l(!1),W.push("/maintenance/machine-status",{id:e.deviceId})}})]})})),No=n(855),Io={wrapper:{display:"flex",alignItems:"center","& > svg":{marginRight:10}},message:{display:"flex",alignItems:"center",color:me,margin:0,whiteSpace:"break-spaces"}},Eo=Object(f.a)(Io),Fo=function(e){var t=e.className,n=e.children,r=(Object($.a)(e,["className","children"]),Eo());return Object(Me.jsxs)("div",{className:E()(r.wrapper,t),children:[Object(Me.jsx)(tn,{}),Object(Me.jsx)(Ze,{className:r.message,children:n})]})},Lo={titleWrapper:{display:"flex",justifyContent:"space-between",alignItems:"center",flexDirection:"row"},titleAndButtonsContainer:{display:"flex",alignItems:"center"},error:{marginLeft:12},subpageButton:{marginLeft:12},buttonText:{color:re,fontSize:15},icon:{marginRight:6},label:{marginRight:24}},Po=Object(f.a)(Lo),Do=function(e){var t=e.className,n=e.title,r=e.error,a=e.labels,i=e.button,o=e.children,c=e.appendix,l=e.appendixClassName,s=Po();return Object(Me.jsxs)("div",{className:E()(s.titleWrapper,t),children:[Object(Me.jsxs)("div",{className:s.titleAndButtonsContainer,children:[Object(Me.jsx)(yn,{children:n}),c&&Object(Me.jsx)("div",{className:l,children:c}),r&&Object(Me.jsx)(Fo,{className:s.error,children:"Failed to save"}),i&&Object(Me.jsx)(Or,{className:s.subpageButton,Icon:i.icon,InverseIcon:i.inverseIcon,toggle:i.toggle,children:Object(Me.jsx)(Ye,{className:s.buttonText,children:i.text})})]}),Object(Me.jsx)(No.a,{display:"flex",flexDirection:"row",children:(null!==a&&void 0!==a?a:[]).map((function(e,t){var n=e.icon,r=e.label;return Object(Me.jsxs)(No.a,{display:"flex",alignItems:"center",children:[Object(Me.jsx)("div",{className:s.icon,children:n}),Object(Me.jsx)(et,{className:s.label,children:r})]},t)}))}),o]})},Bo=n(235),Ro=n(851),To=n(870),Ao=n(823),Mo=n(828),Wo=n(874),zo=n(863),$o=n(864),qo=n(826),Ho=n(869),Vo=n(116),Uo=n.n(Vo),Go={title:{paddingTop:8},input:{marginBottom:25,marginTop:-15},wrapper:{padding:"2.5em 4em",width:575,display:"flex",flexDirection:"column"},titleWrapper:{display:"flex",flexDirection:"row",alignItems:"center",marginBottom:30},rememberMeWrapper:{marginTop:35,display:"flex",flexDirection:"row"},icon:{transform:"scale(1.5)",marginRight:25},checkbox:{transform:"scale(1.5)",marginRight:5,marginLeft:-5},footer:{marginTop:"10vh"},twofaFooter:{marginTop:"6vh"},loginButton:{display:"block",width:"100%"},welcomeBackground:{background:"url(/wizard-background.svg) no-repeat center center fixed",backgroundColor:re,backgroundSize:"cover",height:"100vh",width:"100vw",position:"relative",left:"50%",right:"50%",marginLeft:"-50vw",marginRight:"-50vw",minHeight:"100vh"},info:{marginBottom:"5vh"},info2:{textAlign:"justify"},infoWrapper:{marginBottom:"3vh"},errorMessage:{color:me},qrCodeWrapper:{display:"flex",justifyContent:"center",marginBottom:"3vh"},secretWrapper:{display:"flex",justifyContent:"center",alignItems:"center"},secretLabel:{marginRight:15},secret:{marginRight:35},hiddenSecret:{marginRight:35,filter:"blur(8px)"},confirm2FAInput:{marginTop:25},confirmPassword:{marginTop:25},error:{color:me}},Xo="LOGIN",Yo="SETUP2FA",_o="INPUT2FA",Zo=Object(f.a)(Go),Ko=x()(lo||(lo=Object(l.a)(["\n mutation input2FA(\n $username: String!\n $password: String!\n $code: String!\n $rememberMe: Boolean!\n ) {\n input2FA(\n username: $username\n password: $password\n code: $code\n rememberMe: $rememberMe\n )\n }\n"]))),Qo=x()(so||(so=Object(l.a)(["\n {\n userData {\n id\n username\n role\n }\n }\n"]))),Jo=function(e){var t=e.state,n=e.dispatch,a=Zo(),i=Object(w.h)(),o=Object(r.useContext)(k).setUserData,l=Object(r.useState)(!1),s=Object(c.a)(l,2),d=s[0],m=s[1],h=Object(u.a)(Qo,{onCompleted:function(e){var t=e.userData;o(t),i.push("/")}}),b=Object(c.a)(h,2),p=b[0],f=b[1].error,j=Object(u.b)(Ko,{onCompleted:function(e){if(e.input2FA){var n={context:{headers:{"Pazuz-Operator-Identifier":Uo.a.encode(t.clientField)}}};return p(n)}return m(!0)}}),g=Object(c.a)(j,2),O=g[0],x=g[1].error,v=f?"Internal server error":6!==t.twoFAField.length&&d?"The code should have 6 characters!":x||d?"Code is invalid. Please try again.":null;return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Qe,{className:a.info,children:"Enter your two-factor authentication code"}),Object(Me.jsx)(ha,{name:"2fa",value:t.twoFAField,onChange:function(e){n({type:_o,payload:{twoFAField:e}}),m(!1)},numInputs:6,error:d,shouldAutoFocus:!0}),Object(Me.jsxs)("div",{className:a.twofaFooter,children:[v&&Object(Me.jsx)(Xe,{className:a.errorMessage,children:v}),Object(Me.jsx)(An,{onClick:function(){if(6===t.twoFAField.length){var e={variables:{username:t.clientField,password:t.passwordField,code:t.twoFAField,rememberMe:t.rememberMeField},context:{headers:{"Pazuz-Operator-Identifier":Uo.a.encode(t.clientField)}}};O(e)}else m(!0)},buttonClassName:a.loginButton,children:"Login"})]})]})},ec=n(31),tc=n.n(ec),nc=n(64),rc=Object(f.a)(Go),ac=x()(uo||(uo=Object(l.a)(["\n mutation login($username: String!, $password: String!) {\n login(username: $username, password: $password)\n }\n"]))),ic=xn.e().shape({client:xn.g().required("Client field is required!").email("Username field should be in an email format!"),password:xn.g().required("Password field is required"),rememberMe:xn.b()}),oc={client:"",password:"",rememberMe:!1},cc=function(e,t,n){return e&&t?n?"Invalid login/password combination":e.client&&t.client?e.client:e.password&&t.password?e.password:null:null},lc=function(e){e.state;var t=e.dispatch,n=rc(),r=Object(u.b)(ac),a=Object(c.a)(r,2),i=a[0],o=a[1].error,l=function(){var e=Object(nc.a)(tc.a.mark((function e(n,r,a){var o,c,l,s;return tc.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o={variables:{username:n,password:r},context:{headers:{"Pazuz-Operator-Identifier":Uo.a.encode(n)}}},e.next=3,i(o);case 3:if(c=e.sent,(l=c.data).login){e.next=7;break}return e.abrupt("return");case 7:return s="INPUT2FA"===l.login?_o:Yo,e.abrupt("return",t({type:s,payload:{clientField:n,passwordField:r,rememberMeField:a}}));case 9:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}();return Object(Me.jsx)(pn.d,{validationSchema:ic,initialValues:oc,onSubmit:function(e){return l(e.client,e.password,e.rememberMe)},children:function(e){var t=e.errors,r=e.touched;return Object(Me.jsxs)(pn.c,{id:"login-form",children:[Object(Me.jsx)(pn.b,{name:"client",label:"Client",size:"lg",component:Ua,fullWidth:!0,autoFocus:!0,className:n.input,error:cc(t,r,o)}),Object(Me.jsx)(pn.b,{name:"password",size:"lg",component:Va,label:"Password",fullWidth:!0,error:cc(t,r,o)}),Object(Me.jsxs)("div",{className:n.rememberMeWrapper,children:[Object(Me.jsx)(pn.b,{name:"rememberMe",className:n.checkbox,component:$a}),Object(Me.jsx)(nt,{children:"Keep me logged in"})]}),Object(Me.jsxs)("div",{className:n.footer,children:[cc(t,r,o)&&Object(Me.jsx)(Xe,{className:n.errorMessage,children:cc(t,r,o)}),Object(Me.jsx)(An,{type:"submit",form:"login-form",buttonClassName:n.loginButton,children:"Login"})]})]})}})},sc=x()(mo||(mo=Object(l.a)(["\n mutation setup2FA(\n $username: String!\n $password: String!\n $rememberMe: Boolean!\n $codeConfirmation: String!\n ) {\n setup2FA(\n username: $username\n password: $password\n rememberMe: $rememberMe\n codeConfirmation: $codeConfirmation\n )\n }\n"]))),dc=x()(ho||(ho=Object(l.a)(["\n query get2FASecret($username: String!, $password: String!) {\n get2FASecret(username: $username, password: $password) {\n secret\n otpauth\n }\n }\n"]))),uc=x()(bo||(bo=Object(l.a)(["\n {\n userData {\n id\n username\n role\n }\n }\n"]))),mc=Object(f.a)(Go),hc=function(e){var t=e.state,n=(e.dispatch,mc()),a=Object(w.h)(),i=Object(r.useContext)(k).setUserData,o=Object(r.useState)(null),l=Object(c.a)(o,2),s=l[0],d=l[1],m=Object(r.useState)(null),h=Object(c.a)(m,2),b=h[0],p=h[1],f=Object(r.useState)(!1),j=Object(c.a)(f,2),g=j[0],O=j[1],x=Object(r.useState)(!1),v=Object(c.a)(x,2),y=v[0],C=v[1],S=Object(r.useState)(""),N=Object(c.a)(S,2),I=N[0],E=N[1],F={variables:{username:t.clientField,password:t.passwordField},context:{headers:{"Pazuz-Operator-Identifier":Uo.a.encode(t.clientField)}},onCompleted:function(e){var t=e.get2FASecret;d(t.secret),p(t.otpauth)}},L={variables:{username:t.clientField,password:t.passwordField,rememberMe:t.rememberMeField,codeConfirmation:I},context:{headers:{"Pazuz-Operator-Identifier":Uo.a.encode(t.clientField)}}},P=Object(u.c)(dc,F).error,D=Object(u.a)(uc,{onCompleted:function(e){var t=e.userData;i(t),a.push("/")}}),B=Object(c.a)(D,1)[0],R=Object(u.b)(sc,{onCompleted:function(e){var n=e.setup2FA,r={context:{headers:{"Pazuz-Operator-Identifier":Uo.a.encode(t.clientField)}}};n?B(r):C(!0)}}),T=Object(c.a)(R,2),A=T[0],M=T[1].error,W=function(){return M||P?"Internal server error.":6!==I.length&&y?"The code should have 6 characters!":y?"Code is invalid. Please try again.":null};return s&&b&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)("div",{className:n.infoWrapper,children:[Object(Me.jsx)(nt,{className:n.info2,children:"We detected that this account does not have its two-factor authentication enabled. In order to protect the resources in the system, a two-factor authentication is enforced."}),Object(Me.jsx)(nt,{className:n.info2,children:"To finish this process, please scan the following QR code or insert the secret further below on an authentication app of your choice, such as Google Authenticator or Authy."})]}),Object(Me.jsx)("div",{className:n.qrCodeWrapper,children:Object(Me.jsx)(jn.a,{size:240,fgColor:J,value:b})}),Object(Me.jsxs)("div",{className:n.secretWrapper,children:[Object(Me.jsx)(nt,{className:n.secretLabel,children:"Your secret:"}),Object(Me.jsx)(nt,{className:g?n.secret:n.hiddenSecret,children:s}),Object(Me.jsx)(ze,{disabled:!s&&!b,color:"primary",onClick:function(){O(!g)},children:g?"Hide":"Show"})]}),Object(Me.jsx)("div",{className:n.confirm2FAInput,children:Object(Me.jsx)(ha,{name:"2fa",value:I,onChange:function(e){E(e),C(!1)},numInputs:6,error:y,shouldAutoFocus:!0})}),Object(Me.jsxs)("div",{className:n.twofaFooter,children:[W()&&Object(Me.jsx)(Xe,{className:n.errorMessage,children:W()}),Object(Me.jsx)(An,{onClick:function(){6===I.length?A(L):C(!0)},buttonClassName:n.loginButton,children:"Done"})]})]})},bc=Object(f.a)(Go),pc={twoFAField:"",clientField:"",passwordField:"",rememberMeField:!1,loginState:Xo},fc=function(e,t){var n=t.type,r=t.payload;return Object(s.a)(Object(s.a)(Object(s.a)({},e),r),{},{loginState:n})},jc=function(){var e=bc(),t=Object(r.useReducer)(fc,pc),n=Object(c.a)(t,2),a=n[0],i=n[1];return Object(Me.jsx)(Un.a,{elevation:1,children:Object(Me.jsxs)("div",{className:e.wrapper,children:[Object(Me.jsxs)("div",{className:e.titleWrapper,children:[Object(Me.jsx)(Zi,{className:e.icon}),Object(Me.jsx)(Ge,{className:e.title,children:"Lamassu Admin"})]}),function(){switch(a.loginState){case Xo:return Object(Me.jsx)(lc,{state:a,dispatch:i});case _o:return Object(Me.jsx)(Jo,{state:a,dispatch:i});case Yo:return Object(Me.jsx)(hc,{state:a,dispatch:i})}}()]})})},gc=Object(f.a)(Go),Oc=function(){var e=gc();return Object(Me.jsx)(h.a,{container:!0,spacing:0,direction:"column",alignItems:"center",justify:"center",className:e.welcomeBackground,children:Object(Me.jsx)(h.a,{children:Object(Me.jsx)(jc,{})})})},xc=function(){return new URLSearchParams(Object(w.i)().search)},vc=Object(f.a)(Go),yc=x()(po||(po=Object(l.a)(["\n query validateRegisterLink($token: String!) {\n validateRegisterLink(token: $token) {\n username\n role\n }\n }\n"]))),wc=x()(fo||(fo=Object(l.a)(["\n mutation register(\n $token: String!\n $username: String!\n $password: String!\n $role: String!\n ) {\n register(\n token: $token\n username: $username\n password: $password\n role: $role\n )\n }\n"]))),Cc=xn.e().shape({password:xn.g().required("A password is required").test("len","Your password must contain more than 8 characters",(function(e){return e.length>=8})),confirmPassword:xn.g().oneOf([xn.f("password"),null],"Passwords must match")}),kc={password:"",confirmPassword:""},Sc={username:null,role:null,result:""},Nc=function(e,t){var n=t.type,r=t.payload;return Object(s.a)(Object(s.a)(Object(s.a)({},e),r),{},{result:n})},Ic=function(e,t,n,r){return e&&t?n||r?"Internal server error":e.password&&t.password?e.password:e.confirmPassword&&t.confirmPassword?e.confirmPassword:null:null},Ec=function(){var e,t=vc(),n=Object(w.h)(),a=xc().get("t"),i=null!==(e=xc().get("id"))&&void 0!==e?e:null,o=Object(r.useReducer)(Nc,Sc),l=Object(c.a)(o,2),s=l[0],d=l[1],m={context:{headers:{"Pazuz-Operator-Identifier":i}},variables:{token:a},onCompleted:function(e){var t=e.validateRegisterLink;if(!t)return d({type:"failure"});d({type:"success",payload:{username:t.username,role:t.role}})},onError:function(){return d({type:"failure"})}},b=Object(u.c)(yc,m),p=b.error,f=b.loading,j=Object(u.b)(wc,{onCompleted:function(e){e.register&&n.push("/wizard",{fromAuthRegister:!0})}}),g=Object(c.a)(j,2),O=g[0],x=g[1].error;return Object(Me.jsx)(h.a,{container:!0,spacing:0,direction:"column",alignItems:"center",justify:"center",className:t.welcomeBackground,children:Object(Me.jsx)(h.a,{children:Object(Me.jsx)("div",{children:Object(Me.jsx)(Un.a,{elevation:1,children:Object(Me.jsxs)("div",{className:t.wrapper,children:[Object(Me.jsxs)("div",{className:t.titleWrapper,children:[Object(Me.jsx)(Zi,{className:t.icon}),Object(Me.jsx)(He,{className:t.title,children:"Lamassu Admin"})]}),!f&&"success"===s.result&&Object(Me.jsx)(pn.d,{validationSchema:Cc,initialValues:kc,onSubmit:function(e){O({variables:{token:a,username:s.username,password:e.password,role:s.role}})},children:function(e){var n=e.errors,r=e.touched;return Object(Me.jsxs)(pn.c,{id:"register-form",children:[Object(Me.jsx)(pn.b,{name:"password",label:"Insert a password",autoFocus:!0,component:Va,size:"lg",fullWidth:!0,className:t.input}),Object(Me.jsx)(pn.b,{name:"confirmPassword",label:"Confirm your password",component:Va,size:"lg",fullWidth:!0}),Object(Me.jsxs)("div",{className:t.footer,children:[Ic(n,r,p,x)&&Object(Me.jsx)(Xe,{className:t.errorMessage,children:Ic(n,r,p,x)}),Object(Me.jsx)(An,{type:"submit",form:"register-form",buttonClassName:t.loginButton,children:"Done"})]})]})}}),!f&&"failure"===s.result&&Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsx)(nt,{children:"Link has expired"})})]})})})})})},Fc=Object(f.a)(Go),Lc=x()(jo||(jo=Object(l.a)(["\n query validateReset2FALink($token: String!) {\n validateReset2FALink(token: $token) {\n user_id\n secret\n otpauth\n }\n }\n"]))),Pc=x()(go||(go=Object(l.a)(["\n mutation reset2FA($token: String!, $userID: ID!, $code: String!) {\n reset2FA(token: $token, userID: $userID, code: $code)\n }\n"]))),Dc={userID:null,secret:null,otpauth:null,result:null},Bc=function(e,t){var n=t.type,r=t.payload;return Object(s.a)(Object(s.a)(Object(s.a)({},e),r),{},{result:n})},Rc=function(){var e=Fc(),t=Object(w.h)(),n=new URLSearchParams(Object(w.i)().search).get("t"),a=Object(r.useState)(!1),i=Object(c.a)(a,2),o=i[0],l=i[1],s=Object(r.useState)(!1),d=Object(c.a)(s,2),m=d[0],b=d[1],p=Object(r.useState)(""),f=Object(c.a)(p,2),j=f[0],g=f[1],O=Object(r.useReducer)(Bc,Dc),x=Object(c.a)(O,2),v=x[0],y=x[1],C=Object(u.c)(Lc,{variables:{token:n},onCompleted:function(e){var t=e.validateReset2FALink;y(t?{type:"success",payload:{userID:t.user_id,secret:t.secret,otpauth:t.otpauth}}:{type:"failure"})},onError:function(){y({type:"failure"})}}),k=C.error,S=C.loading,N=Object(u.b)(Pc,{onCompleted:function(e){e.reset2FA?t.push("/"):b(!0)}}),I=Object(c.a)(N,2),E=I[0],F=I[1].error,L=function(){return k?"Internal server error":6!==j.length&&m?"The code should have 6 characters!":F||m?"Code is invalid. Please try again.":null};return Object(Me.jsx)(h.a,{container:!0,spacing:0,direction:"column",alignItems:"center",justify:"center",className:e.welcomeBackground,children:Object(Me.jsx)(h.a,{children:Object(Me.jsx)("div",{children:Object(Me.jsx)(Un.a,{elevation:1,children:Object(Me.jsxs)("div",{className:e.wrapper,children:[Object(Me.jsxs)("div",{className:e.titleWrapper,children:[Object(Me.jsx)(Zi,{className:e.icon}),Object(Me.jsx)(He,{className:e.title,children:"Lamassu Admin"})]}),!S&&"success"===v.result&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)("div",{className:e.infoWrapper,children:Object(Me.jsx)(tt,{className:e.info2,children:"To finish this process, please scan the following QR code or insert the secret further below on an authentication app of your choice, such Google Authenticator or Authy."})}),Object(Me.jsx)("div",{className:e.qrCodeWrapper,children:Object(Me.jsx)(jn.a,{size:240,fgColor:J,value:v.otpauth})}),Object(Me.jsxs)("div",{className:e.secretWrapper,children:[Object(Me.jsx)(tt,{className:e.secretLabel,children:"Your secret:"}),Object(Me.jsx)(tt,{className:o?e.secret:e.hiddenSecret,children:v.secret}),Object(Me.jsx)(ze,{color:"primary",onClick:function(){l(!o)},children:o?"Hide":"Show"})]}),Object(Me.jsx)("div",{className:e.confirm2FAInput,children:Object(Me.jsx)(ha,{name:"2fa",value:j,onChange:function(e){g(e),b(!1)},numInputs:6,error:m,shouldAutoFocus:!0})}),Object(Me.jsxs)("div",{className:e.twofaFooter,children:[L()&&Object(Me.jsx)(Xe,{className:e.errorMessage,children:L()}),Object(Me.jsx)(An,{onClick:function(){6===j.length?E({variables:{token:n,userID:v.userID,code:j}}):b(!0)},buttonClassName:e.loginButton,children:"Done"})]})]}),!S&&"failure"===v.result&&Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsx)(nt,{children:"Link has expired"})})]})})})})})},Tc=Object(f.a)(Go),Ac=x()(Oo||(Oo=Object(l.a)(["\n query validateResetPasswordLink($token: String!) {\n validateResetPasswordLink(token: $token) {\n id\n }\n }\n"]))),Mc=x()(xo||(xo=Object(l.a)(["\n mutation resetPassword($token: String!, $userID: ID!, $newPassword: String!) {\n resetPassword(token: $token, userID: $userID, newPassword: $newPassword)\n }\n"]))),Wc=xn.e().shape({password:xn.g().required("A new password is required").test("len","New password must contain more than 8 characters",(function(e){return e.length>=8})),confirmPassword:xn.g().oneOf([xn.f("password"),null],"Passwords must match")}),zc={password:"",confirmPassword:""},$c=function(e,t,n){return e&&t?n?"Internal server error":e.password&&t.password?e.password:e.confirmPassword&&t.confirmPassword?e.confirmPassword:null:null},qc=function(){var e=Tc(),t=Object(w.h)(),n=new URLSearchParams(Object(w.i)().search).get("t"),a=Object(r.useState)(null),i=Object(c.a)(a,2),o=i[0],l=i[1],s=Object(r.useState)(!0),d=Object(c.a)(s,2),m=d[0],b=d[1],p=Object(r.useState)(!1),f=Object(c.a)(p,2),j=f[0],g=f[1];Object(u.c)(Ac,{variables:{token:n},onCompleted:function(e){var t=e.validateResetPasswordLink;b(!1),t?(g(!0),l(t.id)):g(!1)},onError:function(){b(!1),g(!1)}});var O=Object(u.b)(Mc,{onCompleted:function(e){e.resetPassword&&t.push("/")}}),x=Object(c.a)(O,2),v=x[0],y=x[1].error;return Object(Me.jsx)(h.a,{container:!0,spacing:0,direction:"column",alignItems:"center",justify:"center",className:e.welcomeBackground,children:Object(Me.jsx)(h.a,{children:Object(Me.jsx)("div",{children:Object(Me.jsx)(Un.a,{elevation:1,children:Object(Me.jsxs)("div",{className:e.wrapper,children:[Object(Me.jsxs)("div",{className:e.titleWrapper,children:[Object(Me.jsx)(Zi,{className:e.icon}),Object(Me.jsx)(He,{className:e.title,children:"Lamassu Admin"})]}),!m&&j&&Object(Me.jsx)(pn.d,{validationSchema:Wc,initialValues:zc,onSubmit:function(e){v({variables:{token:n,userID:o,newPassword:e.confirmPassword}})},children:function(t){var n=t.errors,r=t.touched;return Object(Me.jsxs)(pn.c,{id:"reset-password",children:[Object(Me.jsx)(pn.b,{name:"password",autoFocus:!0,size:"lg",component:Va,label:"New password",fullWidth:!0,className:e.input}),Object(Me.jsx)(pn.b,{name:"confirmPassword",size:"lg",component:Va,label:"Confirm your password",fullWidth:!0}),Object(Me.jsxs)("div",{className:e.footer,children:[$c(n,r,y)&&Object(Me.jsx)(Xe,{className:e.errorMessage,children:$c(n,r,y)}),Object(Me.jsx)(An,{type:"submit",form:"reset-password",buttonClassName:e.loginButton,children:"Done"})]})]})}}),!m&&!j&&Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsx)(nt,{children:"Link has expired"})})]})})})})})};function Hc(){return(Hc=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Vc(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Uc=r.createElement("desc",null,"Created with Sketch."),Gc=r.createElement("g",{id:"Styleguide",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"icon/direction/cash-in",transform:"translate(-1.000000, 0.000000)",fill:"#16D6D3"},r.createElement("path",{d:"M3.99134364,0.321790399 L10.1430099,4.40569595 C11.0271728,4.99266501 11.2660914,6.1822461 10.6766494,7.06269968 C10.5357408,7.27317585 10.3543728,7.45378298 10.1430099,7.59410043 L3.99134364,11.678006 C3.10718075,12.264975 1.91258801,12.0270588 1.32314609,11.1466052 C1.11243854,10.8318699 1,10.4620686 1,10.0838037 L1,1.91599264 C1,0.857819122 1.86143307,0 2.92406462,0 C3.30392305,0 3.67528233,0.11196683 3.99134364,0.321790399 Z",id:"Path-3"})));function Xc(e,t){var n=e.title,a=e.titleId,i=Vc(e,["title","titleId"]);return r.createElement("svg",Hc({width:"10px",height:"12px",viewBox:"0 0 10 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Uc,Gc)}var Yc=r.forwardRef(Xc);n.p;function _c(){return(_c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Zc(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Kc=r.createElement("desc",null,"Created with Sketch."),Qc=r.createElement("g",{id:"Styleguide",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"icon/direction/cash-out",transform:"translate(-1.000000, 0.000000)",fill:"#5A67FF"},r.createElement("path",{d:"M3.99134364,0.321790399 L10.1430099,4.40569595 C11.0271728,4.99266501 11.2660914,6.1822461 10.6766494,7.06269968 C10.5357408,7.27317585 10.3543728,7.45378298 10.1430099,7.59410043 L3.99134364,11.678006 C3.10718075,12.264975 1.91258801,12.0270588 1.32314609,11.1466052 C1.11243854,10.8318699 1,10.4620686 1,10.0838037 L1,1.91599264 C1,0.857819122 1.86143307,0 2.92406462,0 C3.30392305,0 3.67528233,0.11196683 3.99134364,0.321790399 Z",id:"Path-3",transform:"translate(6.000000, 6.000000) scale(-1, 1) translate(-6.000000, -6.000000) "})));function Jc(e,t){var n=e.title,a=e.titleId,i=Zc(e,["title","titleId"]);return r.createElement("svg",_c({width:"10px",height:"12px",viewBox:"0 0 10 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Kc,Qc)}var el,tl=r.forwardRef(Jc),nl=(n.p,{headerLabels:{display:"flex",flexDirection:"row"},headerLabelContainerMargin:{marginRight:24},headerLabelContainer:{display:"flex",alignItems:"center"},headerLabelSpan:{extend:Re.label1,marginLeft:6},root:{flexGrow:1,display:"flex",marginBottom:120},card:{wordWrap:"break-word",boxShadow:"0 0 4px 0 rgba(0, 0, 0, 0.08)",borderRadius:12,padding:24,backgroundColor:Z,flex:1,marginRight:24},container:{display:"flex",justifyContent:"space-between"},button:{color:J,minHeight:0,minWidth:0,padding:0,textTransform:"none","&:hover":{backgroundColor:"transparent"}},upperButtonLabel:{textAlign:"center",marginBottom:0,marginTop:0,marginLeft:8},alertsCard:{marginBottom:8},h4:{marginTop:0},centerLabel:{marginTop:40,marginBottom:0},systemStatusCard:{flex:1,marginTop:8},expandedCard:{flex:.9},shrunkCard:{flex:.1},displayFlex:{display:"flex",flexDirection:"column"}}),rl=n(33),al=n.n(rl),il=n(87),ol=n(790),cl=n(791),ll=n(403),sl=n(792),dl=n(793),ul="cashOut",ml="wallets",hl="operatorInfo",bl="notifications",pl="locale",fl="commissions",jl="receipt",gl="coinAtmRadar",Ol="termsConditions",xl="triggersConfig",vl=ol.a((function(e,t){return cl.a(B.a(ll.a(0,e),sl.a(t)))})),yl=ol.a((function(e,t){return cl.a(M.a((function(t){return e(t[0])}),sl.a(t)))})),wl=ol.a((function(e,t){return dl.a(e,t)?t.slice(e.length):t})),Cl=ol.a((function(e,t){return L.a(function(e){return vl(wl("".concat(e,"_")))}(e),function(e){return yl(dl.a("".concat(e,"_")))}(e))(t)})),kl=ol.a((function(e,t){return vl((function(t){return"".concat(e,"_").concat(t)}))(t)})),Sl={label:{color:se},headerLabels:{whiteSpace:"pre",display:"flex",flexDirection:"row",marginTop:-20},headerLabel:{display:"flex",alignItems:"center"},txOutMargin:{marginLeft:24},footer:function(e){var t=e.expanded,n=e.bigFooter;return{height:t&&n?312:t?208:96,left:0,bottom:0,position:"fixed",width:"100vw",backgroundColor:Z,textAlign:"left",boxShadow:"0px -1px 10px 0px rgba(50, 50, 50, 0.1)"}},tickerLabel:{color:se,marginTop:-5},content:{width:1200,backgroundColor:Z,zIndex:1,position:"fixed",bottom:-8,transform:"translateY(-100%)"},footerContainer:function(e){var t=e.expanded,n=e.bigFooter;return{marginLeft:40,height:100,marginTop:t&&n?-300:t?-200:-100,overflow:!t&&"hidden"}},mouseWatcher:function(e){var t=e.expanded,n=e.bigFooter;return{position:"fixed",bottom:0,left:0,width:"100vw",height:t&&n?312:t?208:96,zIndex:2}}},Nl=x()(el||(el=Object(l.a)(["\n query getData {\n cryptoRates\n cryptoCurrencies {\n code\n display\n }\n config\n accountsConfig {\n code\n display\n }\n }\n"])));al.a.config({ROUNDING_MODE:al.a.ROUND_HALF_UP});var Il=Object(f.a)(Sl),El=function(){var e,t,n,a,i,o=Object(u.c)(Nl).data,l=Object(r.useState)(!1),s=Object(c.a)(l,2),d=s[0],m=s[1],b=Object(r.useState)(null),p=Object(c.a)(b,2),f=p[0],j=p[1],g=null!==(e=A.a(["cryptoRates","withCommissions"])(o))&&void 0!==e?e:{},O=Il({bigFooter:il.a(g).length>8,expanded:d}),x=null!==(t=A.a(["config"])(o))&&void 0!==t?t:{},v=il.a(g).length>4,y=Cl("wallets")(x),w=null!==(n=A.a(["cryptoCurrencies"])(o))&&void 0!==n?n:[],C=null!==(a=A.a(["accountsConfig"])(o))&&void 0!==a?a:[],k=null!==(i=A.a(["locale_fiatCurrency"])(x))&&void 0!==i?i:"";return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)("div",{className:O.mouseWatcher,onMouseLeave:function(){clearTimeout(f),m(!1)},onMouseEnter:function(){j(setTimeout((function(){return v&&m(!0)}),300))}}),Object(Me.jsx)("div",{className:O.content,children:Object(Me.jsx)(h.a,{container:!0,spacing:1,children:Object(Me.jsx)(h.a,{container:!0,className:O.footerContainer,children:il.a(g).map((function(e){return function(e){var t=Ho.a(W.a("code",e))(w),n=y["".concat(e,"_ticker")],r=Ho.a(W.a("code",n))(C),a=r>-1?C[r].display:"",i=parseFloat(A.a(["cryptoRates","withoutCommissions",e,"cashIn"])(o)),c=parseFloat(A.a(["cryptoRates","withoutCommissions",e,"cashOut"])(o)),l=new al.a((i+c)/2).toFormat(2),s=new al.a(parseFloat(A.a(["cryptoRates","withCommissions",e,"cashIn"])(o))).toFormat(2),d=new al.a(parseFloat(A.a(["cryptoRates","withCommissions",e,"cashOut"])(o))).toFormat(2);return Object(Me.jsxs)(h.a,{item:!0,xs:3,children:[Object(Me.jsx)(tt,{className:O.label,children:w[t].display}),Object(Me.jsxs)("div",{className:O.headerLabels,children:[Object(Me.jsxs)("div",{className:O.headerLabel,children:[Object(Me.jsx)(Yc,{}),Object(Me.jsx)(tt,{children:" ".concat(s," ").concat(k)})]}),Object(Me.jsxs)("div",{className:E()(O.headerLabel,O.txOutMargin),children:[Object(Me.jsx)(tl,{}),Object(Me.jsx)(tt,{children:" ".concat(d," ").concat(k)})]})]}),Object(Me.jsx)(tt,{className:O.tickerLabel,children:"".concat(a,": ").concat(l," ").concat(k)})]},e)}(e)}))})})}),Object(Me.jsx)("div",{className:O.footer})]})},Fl=n(26),Ll=n.n(Fl),Pl=n(796),Dl=n(165),Bl=n(856);function Rl(){return(Rl=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Tl(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Al=r.createElement("g",{id:"icon/label/icon/down",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"Group-6"},r.createElement("circle",{id:"Oval",fill:"#FFECEB",cx:6,cy:6,r:6}),r.createElement("g",{id:"Group-5",transform:"translate(6.096194, 6.096194) rotate(-315.000000) translate(-6.096194, -6.096194) translate(2.596194, 3.096194)",stroke:"#FF584A"},r.createElement("polyline",{id:"Path-2",points:"3.15780333 -4.54747351e-13 6.15780333 2.82998193 3.15780333 5.65996386"}),r.createElement("line",{x1:5.42178888,y1:2.82998193,x2:-545696821e-21,y2:2.82998193,id:"Path-3"}))));function Ml(e,t){var n=e.title,a=e.titleId,i=Tl(e,["title","titleId"]);return r.createElement("svg",Rl({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Al)}var Wl=r.forwardRef(Ml);n.p;function zl(){return(zl=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function $l(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var ql=r.createElement("g",{id:"icon/label/icon/equal",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"Group-6",fill:"#EBEFFF"},r.createElement("circle",{id:"Oval",cx:6,cy:6,r:6})),r.createElement("g",{id:"Group",transform:"translate(4.000000, 4.000000)",stroke:"#5F668A",strokeLinecap:"square"},r.createElement("line",{x1:0,y1:1,x2:4,y2:1,id:"Line-12"}),r.createElement("line",{x1:0,y1:3,x2:4,y2:3,id:"Line-12"})));function Hl(e,t){var n=e.title,a=e.titleId,i=$l(e,["title","titleId"]);return r.createElement("svg",zl({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,ql)}var Vl=r.forwardRef(Hl);n.p;function Ul(){return(Ul=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Gl(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Xl=r.createElement("g",{id:"icon/label/icon/up",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"Group-6"},r.createElement("circle",{id:"Oval",fill:"#ECFBEF",cx:6,cy:6,r:6}),r.createElement("g",{id:"Group-5",transform:"translate(6.096194, 6.096194) rotate(-45.000000) translate(-6.096194, -6.096194) translate(2.596194, 3.096194)",stroke:"#00CD5A"},r.createElement("polyline",{id:"Path-2",points:"3.15780333 -4.54747351e-13 6.15780333 2.82998193 3.15780333 5.65996386"}),r.createElement("line",{x1:5.42178888,y1:2.82998193,x2:-545696821e-21,y2:2.82998193,id:"Path-3"}))));function Yl(e,t){var n=e.title,a=e.titleId,i=Gl(e,["title","titleId"]);return r.createElement("svg",Ul({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Xl)}var _l,Zl=r.forwardRef(Yl),Kl=(n.p,{wrapper:{display:"flex",height:130,marginTop:-8},percentageBox:{height:130,borderRadius:4,display:"flex",alignItems:"center",justifyContent:"center",whiteSpace:"pre"},label:{color:Z},inColor:{backgroundColor:Y},outColor:{backgroundColor:_},other:{minWidth:"6px",borderRadius:2},inWidth:{width:function(e){return"".concat(e,"%")}},outWidth:{width:function(e){return"".concat(100-e,"%")},marginRight:4}}),Ql=Object(f.a)(Kl),Jl=function(e){var t,n=e.cashIn,r=e.cashOut,a=n||0!==r?n:50,i=Ql(a),o=function(e){if(!(e<=15))return Object(Me.jsxs)(et,{className:i.label,children:[e,"%"]})},c=(t={},Object(z.a)(t,i.percentageBox,!0),Object(z.a)(t,i.other,a<5&&a>0),t);return Object(Me.jsxs)("div",{className:i.wrapper,children:[Object(Me.jsx)("div",{className:E()(c,i.outColor,i.outWidth),children:o(100-a)}),Object(Me.jsx)("div",{className:E()(c,i.inColor,i.inWidth),children:o(a)})]})},es=n(27),ts=n(794),ns=n(243),rs=n(795),as=function(e){var t=e.cashInFee?Number.parseFloat(e.cashInFee):0;return Number.parseFloat(e.commissionPercentage)*Number.parseFloat(e.fiat)+t},is=function(e,t,n){return{created:new Date(new Date(e.created).getTime()+t).toISOString(),profit:n}},os=function(e){var t=e.created;return new Date(t).toISOString().substring(0,10)},cs=function(e){var t=e.created;return new Date(t).toISOString().substring(0,13)},ls=function(e,t){var n=e.profit||0;return Object(s.a)(Object(s.a)({},t),{},{profit:n+as(t)})},ss={Day:864e5,Week:6048e5,Month:2592e6},ds=function(e){var t=e.data,n=e.previousTimeData,a=e.previousProfit,i=e.timeFrame,o=Object(r.useRef)(),l=Object(r.useCallback)((function(){var e=es.select(o.current),r=0,l=0,s=0,d=336-s-l,u=128-r-0,m=function(){var e="Day"===i?cs:os,r=ts.a(ns.a(ls,[],e,t));if(!r.length&&!n.length){var o={created:(new Date).toISOString(),profit:0};return[[o,is(o,-36e5,0)],!0]}if(!r.length&&n.length){var c={created:(new Date).toISOString(),profit:0};return[[c,is(c,-ss[i],1)],!1]}if(r.length&&!n.length){var l={created:(new Date).toISOString(),profit:1};return[[l,is(l,-ss[i],0)],!1]}return 1===r.length?[rs.a({created:new Date(Date.now()-ss[i]).toISOString(),profit:a},r),!1]:[r,!1]}(),h=Object(c.a)(m,2),b=h[0],p=h[1];e.attr("width",d),e.append("rect").attr("x",0).attr("y",-r).attr("width",d+s+l).attr("height",u+r).attr("fill",re).attr("transform","translate(".concat(0,",",r,")")),e.append("linearGradient").attr("id","area-gradient").attr("gradientUnits","userSpaceOnUse").attr("x1",0).attr("y1",0).attr("x2",0).attr("y2","100%").selectAll("stop").data([{offset:"0%",color:G},{offset:"25%",color:G},{offset:"100%",color:re}]).enter().append("stop").attr("offset",(function(e){return e.offset})).attr("stop-color",(function(e){return e.color}));var f=e.append("g").attr("transform","translate(".concat(s,",").concat(r,")")),j=es.extent(b,(function(e){return e.created})),g=p?[0,.1]:[0,es.max(b,(function(e){return e.profit}))],O=es.scaleLinear().range([u,30]).domain([0,g[1]]),x=es.scaleTime().domain([new Date(j[0]),new Date(j[1])]).range([0,d]),v=es.line().x((function(e){return x(new Date(e.created))})).y((function(e){return O(e.profit)})),y=es.area().x((function(e){return x(new Date(e.created))})).y0(u).y1((function(e){return O(e.profit)}));f.append("path").datum(b).attr("d",y).attr("fill","url(#area-gradient)"),f.append("path").datum(b).attr("d",v).attr("fill","none").attr("stroke-width","2").attr("stroke-linejoin","round").attr("stroke",J)}),[t,i,n,a]);return Object(r.useEffect)((function(){es.select(o.current).selectAll("*").remove(),l()}),[l,t]),Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsx)("svg",{ref:o})})},us=function(e){var t=e.data,n=e.timeFrame,a=e.timezone,i=Object(r.useRef)(),o=Object(r.useCallback)((function(){var e=es.select(i.current),r=25,o=15,c=555-o-0,l=150-r-25,s=parseInt(a.split(":")[1]);e.attr("width",c),e.append("rect").attr("x",0).attr("y",0).attr("width",c).attr("height",l+r).attr("fill",re);var d=e.append("g").attr("transform","translate(".concat(o,",").concat(r,")")),u=function(){if(0===t.length)return 100;var e=100*Math.ceil(es.max(t,(function(e){return parseFloat(e.fiat)}))/100),n=Math.max(100,e);return n%1e3===0?n+100:n}(),m=function(){switch(n){case"Week":return{nice:7,ticks:7,subtractDays:7,timeRange:[50,500]};case"Month":return{nice:6,ticks:6,subtractDays:30,timeRange:[50,500]};default:return{nice:null,ticks:4,subtractDays:1,timeRange:[50,500]}}}(),h=es.scaleLinear().range([l,0]).domain([0,u]).nice(3),b=es.scaleTime().domain([Ll()().add(-m.subtractDays,"day").valueOf(),Ll()().valueOf()]).range(m.timeRange).nice(m.nice);d.append("g").style("color","#eef1ff").call(es.axisLeft(h).ticks(4).tickSize(-c).tickFormat("")).call((function(e){return e.select(".domain").remove()})),d.append("g").attr("transform","translate(0,"+l+")").style("font-size","13px").style("color","#5f668a").style("font-family","MuseoSans").style("margin-top","11px").call(es.axisBottom(b).ticks(m.ticks).tickSize(0).tickFormat((function(e){switch(n){case"Week":return es.timeFormat("%a %d")(e);case"Month":return es.timeFormat("%b %d")(e);default:return Ll.a.utc(e).add(s,"minutes").format("HH:mm")}}))).selectAll("text").attr("dy","1.5em"),d.append("g").attr("transform","translate(0,"+l+")").style("color","#eef1ff").call(es.axisBottom(b).ticks(6).tickSize(0).tickFormat("")).selectAll("text").attr("dy","1.5em"),d.append("g").style("font-size","13px").style("color","#5f668a").style("font-family","MuseoSans").style("margin-top","11px").call(es.axisLeft(h).ticks(4).tickSize(0)).call((function(e){return e.select(".domain").remove()})).selectAll("text").attr("dy","-0.40em").attr("dx","3em"),e.append("g").attr("transform","translate(".concat(o,",").concat(r,")")).selectAll("circle").data(t).enter().append("circle").attr("cx",(function(e){return function(e){var t=Ll.a.utc(e);return b(t.valueOf())}(e.created)})).attr("cy",(function(e){return h(e.fiat)})).attr("r",4).style("fill",(function(e){return"cashIn"===e.txClass?Y:_}))}),[t,n,a]);return Object(r.useEffect)((function(){es.select(i.current).selectAll("*").remove(),o()}),[o]),Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsx)("svg",{ref:i})})},ms=function(e){var t=e.info,n=e.label;return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Ye,{style:{marginBottom:0},children:t}),Object(Me.jsx)(et,{style:{margin:0},children:n})]})},hs=n(98),bs={titleWrapper:{display:"flex",justifyContent:"space-between",alignItems:"center",flexDirection:"row"},titleAndButtonsContainer:{display:"flex"},error:{marginLeft:12},icon:{marginRight:6},h4:{margin:0,marginRight:64},label:{cursor:"pointer",minHeight:0,minWidth:0,padding:0,color:se,textTransform:"none",borderBottom:"2px solid transparent",display:"inline-block",lineHeight:1.5,"&:hover":{backgroundColor:"transparent"}},newHighlightedLabel:{cursor:"pointer",color:J,fontWeight:700,borderRadius:0,minHeight:0,minWidth:0,textTransform:"none",borderBottom:"2px solid ".concat(J),display:"inline-block",lineHeight:1.5,"&:hover":{backgroundColor:"transparent"}},navButton:{marginLeft:24},navContainer:{display:"flex"},profitLabel:{fontSize:Oe,fontFamily:fe,fontWeight:700,color:le},percentUp:{fontSize:Oe,fontFamily:fe,fontWeight:700,color:U,height:10},percentDown:{fontSize:Oe,fontFamily:fe,fontWeight:700,color:K,height:13},percentNeutral:{fontSize:Oe,fontFamily:fe,fontWeight:700,color:q},profitContainer:{display:"flex",justifyContent:"space-between",margin:"0 26px -30px 16px",position:"relative"},gridContainer:{marginTop:30,height:225},inSquare:{width:8,height:8,borderRadius:2,marginTop:18,marginRight:4,backgroundColor:Y},outSquare:{width:8,height:8,borderRadius:2,marginTop:18,marginRight:4,backgroundColor:_},directionLabelContainer:{display:"flex"},dirLabContMargin:{marginRight:20},directionIcon:{width:16,height:16,marginBottom:-2,marginRight:4},labelMargin:{marginBottom:20,marginRight:32}},ps=Object(f.a)(bs),fs=["Month","Week","Day"],js=function(e){var t=e.handleSetRange,n=ps(),a=Object(r.useState)("Day"),i=Object(c.a)(a,2),o=i[0],l=i[1],s=hs.a(o);return Object(Me.jsxs)("div",{className:E()(n.titleWrapper),children:[Object(Me.jsx)("div",{className:n.titleAndButtonsContainer,children:Object(Me.jsx)(Ue,{className:n.h4,children:"System performance"})}),Object(Me.jsx)("div",{className:n.navContainer,children:fs.map((function(e,r){return Object(Me.jsx)("div",{onClick:function(e){return n=e.target.innerText,l(n),void t(n);var n},className:s(e)?E()(n.newHighlightedLabel,n.navButton):E()(n.label,n.navButton),children:e},r)}))})]})};al.a.config({ROUNDING_MODE:al.a.ROUND_HALF_UP});var gs=B.a(R.a("fiat")),Os=Object(f.a)(bs),xs=B.a(R.a("cashInFee")),vs=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=t?Ll()(t):Ll()();return n.subtract(e,"second")},ys={Day:{left:vs(172800,Ll()()),right:vs(86400,Ll()())},Week:{left:vs(1209600,Ll()()),right:vs(604800,Ll()())},Month:{left:vs(5184e3,Ll()()),right:vs(2592e3,Ll()())}},ws=x()(_l||(_l=Object(l.a)(["\n query getData {\n transactions {\n fiatCode\n fiat\n cashInFee\n commissionPercentage\n created\n txClass\n error\n }\n fiatRates {\n code\n name\n rate\n }\n config\n }\n"]))),Cs=function(e,t){return e+Number.parseFloat(t.commissionPercentage)*Number.parseFloat(t.fiat)},ks=function(){var e,t,n,a=Os(),i=Object(r.useState)("Day"),o=Object(c.a)(i,2),l=o[0],d=o[1],m=Object(u.c)(ws),b=m.data,p=m.loading,f=Cl("locale")(null===b||void 0===b?void 0:b.config).fiatCurrency,j=Cl("locale")(null===b||void 0===b?void 0:b.config).timezone,g=function(e){return function(t){return null===t.error&&(e?null===t.error&&Ll.a.utc(t.created).utcOffset(j).isBetween(ys[l].left,ys[l].right):null===t.error&&Ll.a.utc(t.created).utcOffset(j).isBetween(ys[l].right,Ll()()))}},O=function(e){if(e.fiatCode===f)return e;var t=Ar.a(W.a("code",e.fiatCode))(b.fiatRates),n=Ar.a(W.a("code",f))(b.fiatRates).rate/t.rate;return Object(s.a)(Object(s.a)({},e),{},{fiat:parseFloat(e.fiat)*n})},x=B.a(O)(M.a(g(!1),null!==(e=null===b||void 0===b?void 0:b.transactions)&&void 0!==e?e:[])),v=B.a(O)(M.a(g(!0),null!==(t=null===b||void 0===b?void 0:b.transactions)&&void 0!==t?t:[])),y=function(e){var t=Pl.a(xs(e)),n=Dl.a(Cs,0,e);return new al.a(n+t)},w=function(){var e=Bl.a(W.a("txClass","cashIn"))(x),t=Object(c.a)(e,2),n=t[0],r=t[1],a=n.length+r.length;return 0===a?{cashIn:0,cashOut:0}:{cashIn:Math.round(n.length/a*100),cashOut:Math.round(r.length/a*100)}},C=function(){var e=y(x),t=y(v);return e.eq(t)?0:t.eq(0)?100:e.minus(t).times(100).div(t).toNumber()}(),k=(n={},Object(z.a)(n,a.percentDown,C<0),Object(z.a)(n,a.percentUp,C>0),Object(z.a)(n,a.percentNeutral,0===C),n);return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(js,{handleSetRange:d}),!p&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)(h.a,{container:!0,spacing:2,children:[Object(Me.jsx)(h.a,{item:!0,xs:3,children:Object(Me.jsx)(ms,{info:gn.a(x),label:"transactions"})}),Object(Me.jsx)(h.a,{item:!0,xs:3,children:Object(Me.jsx)(ms,{info:new al.a(Pl.a(gs(x))).toFormat(2),label:"".concat(null===b||void 0===b?void 0:b.config.locale_fiatCurrency," volume")})})]}),Object(Me.jsx)(h.a,{container:!0,className:a.gridContainer,children:Object(Me.jsxs)(h.a,{item:!0,xs:12,children:[Object(Me.jsx)(tt,{children:"Transactions"}),Object(Me.jsx)(us,{timeFrame:l,data:x,timezone:j})]})}),Object(Me.jsxs)(h.a,{container:!0,className:a.gridContainer,children:[Object(Me.jsxs)(h.a,{item:!0,xs:8,children:[Object(Me.jsx)(tt,{className:a.labelMargin,children:"Profit from commissions"}),Object(Me.jsxs)("div",{className:a.profitContainer,children:[Object(Me.jsx)("div",{className:a.profitLabel,children:"".concat(y(x).toFormat(2)," ").concat(null===b||void 0===b?void 0:b.config.locale_fiatCurrency)}),Object(Me.jsxs)("div",{className:E()(k),children:[0===C?Object(Me.jsx)(Vl,{className:a.directionIcon}):C>0?Object(Me.jsx)(Zl,{className:a.directionIcon}):Object(Me.jsx)(Wl,{className:a.directionIcon}),"".concat(new al.a(C).toFormat(2),"%")]})]}),Object(Me.jsx)(ds,{timeFrame:l,data:x,previousTimeData:v,previousProfit:y(v)})]}),Object(Me.jsxs)(h.a,{item:!0,xs:4,children:[Object(Me.jsxs)(h.a,{container:!0,children:[Object(Me.jsx)(h.a,{item:!0,children:Object(Me.jsx)(tt,{className:a.labelMargin,children:"Direction"})}),Object(Me.jsxs)(h.a,{item:!0,className:E()(a.directionLabelContainer,a.dirLabContMargin),children:[Object(Me.jsx)("div",{className:a.outSquare}),Object(Me.jsx)(et,{className:a.directionLabel,children:"Out"})]}),Object(Me.jsxs)(h.a,{item:!0,className:a.directionLabelContainer,children:[Object(Me.jsx)("div",{className:a.inSquare}),Object(Me.jsx)(et,{className:a.directionLabel,children:"In"})]})]}),Object(Me.jsx)(h.a,{item:!0,xs:!0,children:Object(Me.jsx)(Jl,{cashIn:w().cashIn,cashOut:w().cashOut})})]})]})]})]})},Ss=Object(f.a)(nl),Ns=function(){var e=Ss();return Object(Me.jsx)(h.a,{item:!0,xs:12,className:e.displayFlex,children:Object(Me.jsx)("div",{className:e.card,children:Object(Me.jsx)(ks,{})})})},Is=n(798),Es=Object.freeze({DEFAULT:"default",SHRUNK:"shrunk",EXPANDED:"expanded"}),Fs={card:{wordWrap:"break-word",boxShadow:"0 0 4px 0 rgba(0, 0, 0, 0.08)",borderRadius:12,padding:24,backgroundColor:Z}},Ls=Object(f.a)(Fs),Ps=function(e){var t=e.className,n=e.state,r=e.shrunkComponent,a=e.children,i=Ls();return Object(Me.jsx)(h.a,{item:!0,className:E()(t,i.card),children:n===Es.SHRUNK?r:a})},Ds={container:{display:"flex",justifyContent:"space-between"},h4:{margin:0,marginBottom:10},centerLabel:{marginBottom:0,padding:0,textAlign:"center"},upperButtonLabel:{marginTop:-3,marginBottom:24},button:{color:J,marginTop:0,minHeight:0,minWidth:0,padding:0,textTransform:"none","&:hover":{backgroundColor:"transparent"}},alertsTableContainer:{margin:0},expandedAlertsTableContainer:{margin:0,maxHeight:460},noAlertsLabel:{color:q,marginLeft:-5,height:100},table:{maxHeight:465,overflowX:"hidden",overflowY:"auto"},listItemText:{margin:"8px 0 8px 0"},linkIcon:{marginLeft:"auto",cursor:"pointer"}},Bs=n(780),Rs=n(797),Ts=n(130);function As(){return(As=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Ms(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Ws=r.createElement("desc",null,"Created with Sketch."),zs=r.createElement("g",{id:"icon/button/link/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("g",{id:"Group-7",stroke:"#1B2559",strokeWidth:1.2},r.createElement("polyline",{id:"Stroke-1",points:"12 6.66678 12 12.00018 0 12.00018 0 0.00018 5.3334 0.00018"}),r.createElement("polyline",{id:"Stroke-3",points:"8.66658 0 12.00018 0 12.00018 3.3336"}),r.createElement("line",{x1:6,y1:6,x2:12,y2:0,id:"Stroke-5"})));function $s(e,t){var n=e.title,a=e.titleId,i=Ms(e,["title","titleId"]);return r.createElement("svg",As({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Ws,zs)}var qs=r.forwardRef($s);n.p;function Hs(){return(Hs=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Vs(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Us=r.createElement("g",{id:"DASHBOARD",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"dashboard_v9#1-(week)",transform:"translate(-772.000000, -212.000000)"},r.createElement("g",{id:"dashboard/row/alert/positive",transform:"translate(756.000000, 204.000000)"},r.createElement("g",{id:"Group-2",transform:"translate(16.000000, 8.000000)"},r.createElement("polygon",{id:"Rectangle-2-Copy-45",fill:"#FF584A",fillRule:"nonzero",points:"0 11 16 11 16 16 0 16"}),r.createElement("rect",{id:"Rectangle-Copy-10",stroke:"#FF584A",strokeWidth:2,x:1,y:1,width:14,height:14})))));function Gs(e,t){var n=e.title,a=e.titleId,i=Vs(e,["title","titleId"]);return r.createElement("svg",Hs({width:"16px",height:"16px",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),void 0===n?r.createElement("title",{id:a},"07E3DD15-D5E4-46A8-BF7B-064F598230CE"):n?r.createElement("title",{id:a},n):null,Us)}var Xs,Ys=r.forwardRef(Gs),_s=(n.p,Object(f.a)(Ds)),Zs={error:Object(Me.jsx)(tn,{style:{height:20,width:20,marginRight:12}}),fiatBalance:Object(Me.jsx)(Ys,{style:{height:18,width:18,marginRight:14}})},Ks={error:"/maintenance/machine-status",fiatBalance:"/maintenance/cash-cassettes",cryptoBalance:"/maintenance/funding"},Qs=function(e){var t=e.numToRender,n=e.alerts,r=e.machines,a=Object(w.h)(),i=_s(),o=Ts.a(0,t,n);return Object(Me.jsx)(Bs.a,{dense:!0,className:i.table,children:o.map((function(e,t){return Object(Me.jsxs)(Rs.a,{children:[Zs[e.type]||Object(Me.jsx)(Rt,{style:{height:23,width:23,marginRight:8}}),Object(Me.jsx)(Xe,{className:i.listItemText,children:"".concat(e.message).concat(e.detail.deviceId&&" - "+r[e.detail.deviceId])}),Object(Me.jsx)(qs,{className:i.linkIcon,onClick:function(){return a.push(Ks[e.type]||"/dashboard")}})]},t)}))})},Js=x()(Xs||(Xs=Object(l.a)(["\n query getAlerts {\n alerts {\n id\n type\n detail\n message\n created\n read\n valid\n }\n machines {\n deviceId\n name\n }\n }\n"]))),ed=Object(f.a)(Ds),td=function(e){var t,n,r,a=e.onReset,i=e.onExpand,o=e.size,c=ed(),l=o===Es.EXPANDED,s=Object(u.c)(Js).data,d=null!==(t=A.a(["alerts"])(s))&&void 0!==t?t:[],m=L.a(B.a(R.a("name")),T.a(R.a("deviceId")))(null!==(n=null===s||void 0===s?void 0:s.machines)&&void 0!==n?n:[]),b=d.length,p=(r={},Object(z.a)(r,c.alertsTableContainer,!l),Object(z.a)(r,c.expandedAlertsTableContainer,l),r);return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)("div",{className:c.container,children:[Object(Me.jsx)(Ue,{className:c.h4,children:"Alerts (".concat(b,")")}),l&&Object(Me.jsx)(et,{className:c.upperButtonLabel,children:Object(Me.jsx)(Is.a,{onClick:a,size:"small",disableRipple:!0,disableFocusRipple:!0,className:c.button,children:"Show less"})})]}),Object(Me.jsx)(h.a,{className:E()(p),container:!0,spacing:1,children:Object(Me.jsxs)(h.a,{item:!0,xs:12,children:[!d.length&&Object(Me.jsx)(et,{className:c.noAlertsLabel,children:"No new alerts. Your system is running smoothly."}),Object(Me.jsx)(Qs,{numToRender:l?d.length:3,alerts:d,machines:m})]})}),!l&&b>3&&Object(Me.jsx)(h.a,{item:!0,xs:12,children:Object(Me.jsx)(et,{className:c.centerLabel,children:Object(Me.jsx)(Is.a,{onClick:function(){return i("alerts")},size:"small",disableRipple:!0,disableFocusRipple:!0,className:c.button,children:"Show all (".concat(d.length,")")})})})]})},nd=n(801),rd=n(804),ad=n(799),id=n(800),od=n(802),cd=n(803),ld={error:K,warning:"#ff7311",success:ne,neutral:J},sd={error:Q,warning:"#fbf3ec",success:V,neutral:G},dd=Object(f.a)({root:{borderRadius:4,marginTop:4,marginRight:2,marginBottom:4,marginLeft:2,height:24,backgroundColor:function(e){var t=e.type;return sd[t]}},label:{fontSize:ye,fontWeight:Se,fontFamily:Ne,paddingRight:4,paddingLeft:4,color:function(e){var t=e.type;return ld[t]}}}),ud=function(e){var t=e.status,n=dd({type:t.type});return Object(Me.jsx)(Sa.a,{type:t.type,label:t.label,classes:n})},md=function(e){var t=e.statuses,n=t.find((function(e){return"error"===e.type}))||t.find((function(e){return"warning"===e.type}))||t[0],r={label:"+".concat(t.length-1),type:n.type};return Object(Me.jsxs)("div",{children:[Object(Me.jsx)(ud,{status:n}),t.length>1&&Object(Me.jsx)(ud,{status:r})]})};function hd(){return(hd=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function bd(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var pd=r.createElement("defs",null,r.createElement("circle",{id:"path-1-right",cx:10,cy:10,r:10})),fd=r.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"pop-up/action/download-logs/date-range-copy-2",transform:"translate(-232.000000, -187.000000)"},r.createElement("g",{id:"icon/sf-contain-b-copy-4",transform:"translate(242.000000, 197.000000) scale(-1, 1) rotate(-270.000000) translate(-242.000000, -197.000000) translate(232.000000, 187.000000)"},r.createElement("mask",{id:"mask-2",fill:"white"},r.createElement("use",{xlinkHref:"#path-1-right"})),r.createElement("use",{id:"Mask",fill:"#EBEFFF",fillRule:"nonzero",xlinkHref:"#path-1-right"}),r.createElement("g",{id:"icon/sf-small/wizzard",mask:"url(#mask-2)",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("g",{transform:"translate(6.666667, 6.000000)",id:"Group"},r.createElement("g",null,r.createElement("polyline",{id:"Path-3",stroke:"#1B2559",strokeWidth:2,points:"0 4.83333333 3.33333333 8.16666667 6.66666667 4.83333333"}),r.createElement("line",{x1:3.33333333,y1:.25,x2:3.33333333,y2:6.5,id:"Path-4",stroke:"#1B2559",strokeWidth:2})))))));function jd(e,t){var n=e.title,a=e.titleId,i=bd(e,["title","titleId"]);return r.createElement("svg",hd({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,pd,fd)}var gd,Od=r.forwardRef(jd),xd=(n.p,{container:{display:"flex",justifyContent:"space-between"},label:{margin:0,color:se},row:{backgroundColor:re,borderBottom:"none"},clickableRow:{cursor:"pointer"},header:{display:"flex",alignItems:"center",whiteSpace:"pre"},error:{color:me},button:{color:J,minHeight:0,minWidth:0,padding:0,textTransform:"none","&:hover":{backgroundColor:"transparent"},marginBottom:-40},buttonLabel:{position:"absolute",bottom:160,marginBottom:0},upperButtonLabel:{textAlign:"center",marginBottom:0,marginTop:0},statusHeader:{marginLeft:2},table:{maxHeight:440,"&::-webkit-scrollbar":{width:7},"&::-webkit-scrollbar-thumb":{backgroundColor:se,borderRadius:5}},tableBody:{overflow:"auto"},h4:{marginTop:0},tl2:{display:"inline"},label1:{display:"inline"},machinesTableContainer:{marginTop:10,height:220},expandedMachinesTableContainer:{marginTop:10,height:414},centerLabel:{marginBottom:0,padding:0,textAlign:"center"},machineNameWrapper:{display:"flex",flexDirection:"row",alignItems:"center"},machineRedirectIcon:{marginLeft:10}}),vd=Object(f.a)(xd),yd=Object(Na.a)({root:{borderBottom:"4px solid white",padding:0,paddingLeft:15}})(ad.a),wd=Object(Na.a)({root:{borderBottom:"4px solid white",padding:0,paddingLeft:15,backgroundColor:"white"}})(ad.a),Cd=function(e){var t=e.machines,n=e.numToRender,r=vd(),a=Object(w.h)(),i=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500;return Math.round(e/t*100)},o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=i(e,t);return n<20?Object(Me.jsx)(Je,{className:r.error,children:"".concat(n,"%")}):Object(Me.jsx)(Je,{children:"".concat(n,"%")})},c=function(e){var t=e.name,n=e.deviceId;return a.push("/machines/".concat(n),{selectedMachine:t})};return Object(Me.jsx)(id.a,{className:r.table,children:Object(Me.jsxs)(nd.a,{children:[Object(Me.jsx)(od.a,{children:Object(Me.jsxs)(cd.a,{children:[Object(Me.jsx)(wd,{children:Object(Me.jsx)("div",{className:r.header,children:Object(Me.jsx)(tt,{className:r.label,children:"Machines"})})}),Object(Me.jsx)(wd,{children:Object(Me.jsx)("div",{className:"".concat(r.header," ").concat(r.statusHeader),children:Object(Me.jsx)(tt,{className:r.label,children:"Status"})})}),Object(Me.jsx)(wd,{children:Object(Me.jsxs)("div",{className:r.header,children:[Object(Me.jsx)(tl,{}),Object(Me.jsx)(tt,{className:r.label,children:" 1"})]})}),Object(Me.jsx)(wd,{children:Object(Me.jsxs)("div",{className:r.header,children:[Object(Me.jsx)(tl,{}),Object(Me.jsx)(tt,{className:r.label,children:" 2"})]})})]})}),Object(Me.jsx)(rd.a,{children:t.map((function(e,t){return t<n?Object(Me.jsxs)(cd.a,{onClick:function(){return c(e)},className:E()(r.row),children:[Object(Me.jsxs)(yd,{align:"left",className:r.machineNameWrapper,children:[Object(Me.jsx)(Je,{children:e.name}),Object(Me.jsx)(Od,{className:E()(r.machineRedirectIcon,r.clickableRow),onClick:function(){return c(e)}})]}),Object(Me.jsx)(yd,{children:Object(Me.jsx)(ud,{status:e.statuses[0]})}),Object(Me.jsx)(yd,{align:"left",children:o(e.cassette1)}),Object(Me.jsx)(yd,{align:"left",children:o(e.cassette2)})]},e.deviceId+t):null}))})]})})},kd=Object(f.a)(xd),Sd=x()(gd||(gd=Object(l.a)(["\n query getData {\n machines {\n name\n deviceId\n cashbox\n cassette1\n cassette2\n statuses {\n label\n type\n }\n }\n serverVersion\n uptime {\n name\n state\n uptime\n }\n }\n"]))),Nd=function(e){var t,n,r=e.onReset,a=e.onExpand,i=e.size,o=kd(),c=Object(u.c)(Sd),l=c.data,s=c.loading,d=null!==(t=A.a(["machines"])(l))&&void 0!==t?t:[],m=i===Es.EXPANDED,b=(n={},Object(z.a)(n,o.machinesTableContainer,!m),Object(z.a)(n,o.expandedMachinesTableContainer,m),n);return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)("div",{className:o.container,children:[Object(Me.jsx)(Ue,{className:o.h4,children:"System status"})," ",m&&Object(Me.jsx)(et,{className:o.upperButtonLabel,children:Object(Me.jsx)(Is.a,{onClick:r,size:"small",disableRipple:!0,disableFocusRipple:!0,className:o.button,children:"Show less"})})]}),!s&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)(h.a,{container:!0,spacing:1,children:[Object(Me.jsxs)(h.a,{item:!0,xs:4,children:[Object(Me.jsx)(Je,{className:o.tl2,children:null===l||void 0===l?void 0:l.serverVersion}),Object(Me.jsx)(et,{className:o.label1,children:" server version"})]}),Object(Me.jsx)(h.a,{item:!0,xs:4})]}),Object(Me.jsx)(h.a,{container:!0,spacing:1,className:E()(b),children:Object(Me.jsx)(h.a,{item:!0,xs:12,children:Object(Me.jsx)(Cd,{numToRender:m?1/0:4,machines:d})})}),!m&&d.length>4&&Object(Me.jsx)(h.a,{item:!0,xs:12,children:Object(Me.jsx)(et,{className:o.centerLabel,children:Object(Me.jsx)(Is.a,{onClick:function(){return a()},size:"small",disableRipple:!0,disableFocusRipple:!0,className:o.button,children:"Show all (".concat(d.length,")")})})})]})]})},Id=Object(f.a)(nl),Ed=function(e){var t=e.title,n=e.buttonName,r=e.onUnshrink,a=Id();return Object(Me.jsxs)("div",{className:a.container,children:[Object(Me.jsx)(Ue,{className:a.h4,children:t}),Object(Me.jsx)(et,{className:a.upperButtonLabel,children:Object(Me.jsx)(Is.a,{onClick:r,size:"small",disableRipple:!0,disableFocusRipple:!0,className:a.button,children:n})})]})},Fd=function(){var e,t,n=Id(),a=Object(r.useState)(Es.DEFAULT),i=Object(c.a)(a,2),o=i[0],l=i[1],s=Object(r.useState)(Es.DEFAULT),d=Object(c.a)(s,2),u=d[0],m=d[1],b=function(){m(Es.DEFAULT),l(Es.DEFAULT)};return Object(Me.jsx)(h.a,{item:!0,xs:12,className:n.displayFlex,children:Object(Me.jsx)("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Ps,{className:E()((e={},Object(z.a)(e,n.alertsCard,u!==Es.SHRUNK),Object(z.a)(e,n.shrunkCard,u===Es.SHRUNK),Object(z.a)(e,n.expandedCard,u===Es.EXPANDED),e)),state:u,shrunkComponent:Object(Me.jsx)(Ed,{title:"Alerts",buttonName:"Show alerts",onUnshrink:b}),children:Object(Me.jsx)(td,{onExpand:function(){m(Es.EXPANDED),l(Es.SHRUNK)},onReset:b,size:u})}),Object(Me.jsx)(Ps,{className:E()((t={},Object(z.a)(t,n.shrunkCard,o===Es.SHRUNK),Object(z.a)(t,n.systemStatusCard,o!==Es.SHRUNK),Object(z.a)(t,n.expandedCard,u===Es.EXPANDED),t)),state:o,shrunkComponent:Object(Me.jsx)(Ed,{title:"System status",buttonName:"Show machines",onUnshrink:b}),children:Object(Me.jsx)(Nd,{onExpand:function(){l(Es.EXPANDED),m(Es.SHRUNK)},onReset:b,size:o})})]})})})},Ld=Object(f.a)(nl),Pd=function(){var e=Ld();return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Do,{title:"Dashboard",children:Object(Me.jsxs)("div",{className:e.headerLabels,children:[Object(Me.jsxs)("div",{className:E()(e.headerLabelContainer,e.headerLabelContainerMargin),children:[Object(Me.jsx)(tl,{}),Object(Me.jsx)("span",{className:e.headerLabelSpan,children:"Cash-out"})]}),Object(Me.jsxs)("div",{className:e.headerLabelContainer,children:[Object(Me.jsx)(Yc,{}),Object(Me.jsx)("span",{className:e.headerLabelSpan,children:"Cash-in"})]})]})}),Object(Me.jsx)("div",{className:e.root,children:Object(Me.jsxs)(h.a,{container:!0,children:[Object(Me.jsx)(h.a,{container:!0,direction:"column",item:!0,xs:6,children:Object(Me.jsx)(Ns,{})}),Object(Me.jsx)(h.a,{container:!0,direction:"column",item:!0,xs:6,children:Object(Me.jsx)(Fd,{})})]})}),Object(Me.jsx)(El,{})]})},Dd=n(865),Bd=n(188),Rd=n.n(Bd),Td=n(814),Ad=n(404),Md=n(871),Wd=n(812),zd=n(173),$d=n(813),qd=n(866),Hd="You have unsaved changes on this page. Are you sure you want to leave?",Vd=function(e){var t=e.message,n=void 0===t?Hd:t,a=Object(pn.e)(),i=a.dirty&&0===a.submitCount;Object(r.useEffect)((function(){window.onbeforeunload=i?o:void 0}),[i]);var o=function(){return Hd};return Object(Me.jsx)(w.a,{when:i,message:n})},Ud=n(805),Gd=n(806),Xd=Re.tl2,Yd=Re.label1,_d={size:function(e){var t=e.size;return Hr(t)},bold:Vr,header:{extend:Xd,backgroundColor:Le,height:Ie,textAlign:"left",color:Z,display:"flex",alignItems:"center"},doubleHeader:{extend:Xd,backgroundColor:Le,height:Fe,color:Z,display:"table-row"},thDoubleLevel:function(e){return{width:e.width,display:"table-cell","& > :first-child":{margin:[[0,10]],extend:Yd,fontWeight:700,display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:se,color:Z,borderRadius:[[0,0,8,8]],height:28},"& > :last-child":{padding:[[0,11]],display:"table-cell",verticalAlign:"middle",height:Fe-28}}},cellDoubleLevel:{display:"flex",padding:[[0,16]]},td:function(e){var t=e.textAlign;return{width:e.width,padding:[[1,24,0,24]],textAlign:t}},tdHeader:{verticalAlign:"middle",display:"table-cell",padding:[[0,24]]},trError:{backgroundColor:Pe},trAdding:{backgroundColor:De},mainContent:function(e){return{display:"flex",alignItems:"center",minHeight:{sm:34,lg:68}[e.size]||48}},cardContentRoot:{margin:0,padding:0,"&:last-child":{padding:0}},card:{extend:Re.p,"&:before":{height:0},margin:[[4,0,0,0]],width:"100%",boxShadow:[[0,0,4,0,"rgba(0, 0, 0, 0.08)"]]},actionCol:{marginLeft:"auto"},errorContent:{padding:[[12,0,12,24]],color:me}},Zd=Object(f.a)(_d),Kd=function(e){var t=e.children,n=e.className,r=Object($.a)(e,["children","className"]);return Object(Me.jsx)("div",Object(s.a)(Object(s.a)({className:E()(n)},r),{},{children:t}))},Qd=function(e){var t=e.children,n=e.className,r=Zd();return Object(Me.jsx)("div",{className:E()(n,r.header),children:t})},Jd=function(e){var t=e.children,n=e.className,r=Zd();return Object(Me.jsx)("div",{className:E()(n,r.doubleHeader),children:t})},eu=function(e){var t=e.children,n=e.className;return Object(Me.jsx)("div",{className:E()(n),children:t})},tu=function(e){var t,n=e.children,r=e.header,a=e.className,i=e.width,o=void 0===i?100:i,c=e.size,l=e.bold,s=e.textAlign,d=e.action,u=Zd({textAlign:s,width:o,size:c}),m=(t={},Object(z.a)(t,u.td,!0),Object(z.a)(t,u.tdHeader,r),Object(z.a)(t,u.actionCol,d),Object(z.a)(t,u.size,!r),Object(z.a)(t,u.bold,!r&&l),t);return Object(Me.jsx)("div",{className:E()(a,m),children:n})},nu=function(e){var t=e.children,n=Object($.a)(e,["children"]);return Object(Me.jsx)(tu,Object(s.a)(Object(s.a)({header:!0},n),{},{children:t}))},ru=function(e){var t=e.title,n=e.children,r=e.className,a=e.width,i=Zd({width:a});return Object(Me.jsxs)("div",{className:E()(r,i.thDoubleLevel),children:[Object(Me.jsx)("div",{children:t}),Object(Me.jsx)("div",{children:n})]})},au=function(e){var t,n=e.onClick,r=e.error,a=e.errorMessage,i=e.children,o=e.className,c=e.size,l=e.newRow,s=Zd({size:c}),d={root:s.cardContentRoot},u=(t={},Object(z.a)(t,s.tr,!0),Object(z.a)(t,s.trError,r),Object(z.a)(t,s.card,!0),Object(z.a)(t,s.trAdding,l),Object(z.a)(t,"className",o),t);return Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsx)(Ud.a,{className:E()(u,o),onClick:n,children:Object(Me.jsxs)(Gd.a,{classes:d,children:[Object(Me.jsx)("div",{className:s.mainContent,children:i}),r&&Object(Me.jsx)("div",{className:s.errorContent,children:a})]})})})},iu=a.a.createContext(),ou=n(808),cu=n(809),lu=n(807),su=n(237),du=su.create({checkTypes:!1,env:su.env}),uu=du.compose(du.joinWith(""))(ll.a(0,du.toLower)),mu=du.compose(du.joinWith(""))(ll.a(0,du.toUpper)),hu=du.compose(mu)(du.toLower),bu=L.a(du.splitOn(" "),lu.a(/([A-Z])/g," $1"),uu),pu=L.a(du.joinWith(" "),du.map(hu),bu),fu=function(e,t,n){return 1===parseInt(e)?t:n},ju=function(){var e=Object(r.useContext)(iu),t=e.elements,n=e.enableEdit,a=e.editWidth,i=e.enableDelete,o=e.deleteWidth,l=e.enableToggle,s=e.toggleWidth,d=e.DEFAULT_COL_SIZE,u=function(e,t){var n=e.name,r=e.width,a=void 0===r?d:r,i=e.header,o=e.textAlign;return Object(Me.jsx)(tu,{header:!0,width:a,textAlign:o,children:i||pu(n)},t)},m=function(e){var t=Bl.a(To.a("doubleHeader"))(e),n=Object(c.a)(t,2),r=n[0],a=n[1];if(!r.length)return[e,Qd];var i=ou.a(r[0],e),o=L.a(Pl.a,B.a(A.a(["width"])))(r);return[cu.a(i,{width:o,elements:r,name:r[0].doubleHeader},a),Jd]}(t),h=Object(c.a)(m,2),b=h[0],p=h[1];return Object(Me.jsxs)(p,{children:[b.map((function(e,t){var n=e.width,r=e.elements,a=e.name;return r&&r.length?Object(Me.jsx)(ru,{width:n,title:a,children:r.map(u)},t):u(e,t)})),n&&Object(Me.jsx)(tu,{header:!0,width:a,textAlign:"center",children:"Edit"}),i&&Object(Me.jsx)(tu,{header:!0,width:o,textAlign:"center",children:"Delete"}),l&&Object(Me.jsx)(tu,{header:!0,width:s,textAlign:"center",children:"Enable"})]})},gu=n(811),Ou=n(810),xu=Object(f.a)({content:{width:434,padding:16,paddingRight:28},titleSection:{padding:16,paddingRight:12,display:"flex",justifyContent:"space-between",margin:0},actions:{padding:32,paddingTop:16},title:{margin:0},closeButton:{padding:0,marginTop:-4}}),vu=function(e){var t=e.children,n=e.close,r=xu();return Object(Me.jsxs)("div",{className:r.titleSection,children:[t,n&&Object(Me.jsx)(tr,{size:16,"aria-label":"close",onClick:n,className:r.closeButton,children:Object(Me.jsx)(gi,{})})]})},yu=function(e){var t=e.title,n=void 0===t?"Confirm Delete":t,r=e.open,a=void 0!==r&&r,i=e.onConfirmed,o=e.onDismissed,c=e.item,l=void 0===c?"item":c,s=e.confirmationMessage,d=void 0===s?"Are you sure you want to delete this ".concat(l,"?"):s,u=e.errorMessage,m=void 0===u?"":u,h=xu();return Object(Me.jsxs)(un.a,{open:a,"aria-labelledby":"form-dialog-title",children:[Object(Me.jsx)(vu,{close:function(){return o()},children:Object(Me.jsx)(Ue,{className:h.title,children:n})}),m&&Object(Me.jsx)(vu,{children:Object(Me.jsx)(Fo,{children:m.split(":").map((function(e){return Object(Me.jsxs)(Me.Fragment,{children:[e,Object(Me.jsx)("br",{})]})}))})}),Object(Me.jsx)(mn.a,{className:h.content,children:d&&Object(Me.jsx)(Xe,{children:d})}),Object(Me.jsx)(Ou.a,{className:h.actions,children:Object(Me.jsx)(An,{onClick:i,children:"Confirm"})})]})},wu=n(417);function Cu(){return(Cu=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function ku(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Su=r.createElement("desc",null,"Created with Sketch."),Nu=r.createElement("defs",null,r.createElement("path",{id:"arrow-path",d:"M5.3501239,7.53208616 L0.473798314,2.73082122 C-0.158421727,2.1051411 -0.158421727,1.0952488 0.476737158,0.466675069 C1.11220338,-0.155816755 2.1378971,-0.155816755 2.77494316,0.468226909 L6.49990857,4.13723769 L10.2264532,0.466675069 C10.8619195,-0.155816755 11.8876132,-0.155816755 12.5260183,0.469568675 C13.1582383,1.0952488 13.1582383,2.1051411 12.5245507,2.73226987 L7.64673876,7.53497972 C7.33802629,7.83583835 6.92590837,8 6.49990828,8 C6.0739082,8 5.66179027,7.83583835 5.3501239,7.53208616 Z"})),Iu=r.createElement("g",{id:"Styleguide",stroke:"none",strokeWidth:1,fillRule:"evenodd"},r.createElement("g",{id:"icon/action/arrow/regular"},r.createElement("mask",{id:"mask-2",fill:"white"},r.createElement("use",{xlinkHref:"#path-1"})),r.createElement("use",{id:"Mask",fillRule:"nonzero",xlinkHref:"#arrow-path"})));function Eu(e,t){var n=e.title,a=e.titleId,i=ku(e,["title","titleId"]);return r.createElement("svg",Cu({width:"13px",height:"8px",viewBox:"0 0 13 8",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Su,Nu,Iu)}var Fu=r.forwardRef(Eu),Lu=(n.p,Re.p),Pu=152,Du={selectedItem:{width:111,display:"block",whiteSpace:"nowrap",overflow:"hidden"},select:{width:Pu,zIndex:2,"& label":{extend:Re.label1,color:se,paddingLeft:10},"& button":{extend:Lu,position:"relative",border:0,backgroundColor:ae,width:Pu,padding:[[6,0,6,12]],borderRadius:20,lineHeight:"1.14",textAlign:"left",color:se,cursor:"pointer",outline:"0 none"},"& ul":{maxHeight:"200px",width:Pu,overflowY:"auto",position:"absolute",margin:0,borderTop:0,padding:0,borderRadius:[[0,0,8,8]],backgroundColor:ae,outline:"0 none","& li":{extend:Lu,listStyleType:"none",padding:[[6,12]],cursor:"pointer","& span":{width:"100%",display:"block",overflow:"hidden",whiteSpace:"nowrap"}},"& li:hover":{backgroundColor:se,color:Z}},"& svg":{position:"absolute",top:12,right:14,fill:se}},selectFiltered:{"& button":{backgroundColor:se,color:Z},"& ul":{"& li":{backgroundColor:se,color:Z},"& li:hover":{backgroundColor:ae,color:se}},"& svg":{fill:[[Z],"!important"]}},open:{"& button":{borderRadius:[[8,8,0,0]]}}},Bu=Object(f.a)(Du);var Ru=function(e){var t,n=e.className,r=e.label,a=e.items,i=Object($.a)(e,["className","label","items"]),o=Bu(),c=Object(wu.a)({items:a,selectedItem:i.selectedItem,onSelectedItemChange:function(e){i.onSelectedItemChange(e.selectedItem)}}),l=c.isOpen,d=c.selectedItem,u=c.getToggleButtonProps,m=c.getLabelProps,h=c.getMenuProps,b=c.getItemProps,p=(t={},Object(z.a)(t,o.select,!0),Object(z.a)(t,o.selectFiltered,d!==i.default),Object(z.a)(t,o.open,l),t);return Object(Me.jsxs)("div",{className:E()(p,n),children:[Object(Me.jsx)("label",Object(s.a)(Object(s.a)({},m()),{},{children:r})),Object(Me.jsxs)("button",Object(s.a)(Object(s.a)({},u()),{},{children:[Object(Me.jsx)("span",{className:o.selectedItem,children:d.display}),Object(Me.jsx)(Fu,{})]})),Object(Me.jsx)("ul",Object(s.a)(Object(s.a)({},h()),{},{children:l&&a.map((function(e,t){var n=e.code,r=e.display;return Object(Me.jsx)("li",Object(s.a)(Object(s.a)({},b({code:n,index:t})),{},{children:Object(Me.jsx)("span",{children:r})}),"".concat(n).concat(t))}))}))]})};function Tu(){return(Tu=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Au(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Mu=r.createElement("defs",null,r.createElement("path",{id:"a",d:"M0 0h22v22H0z"})),Wu=r.createElement("g",{fill:"none",fillRule:"evenodd"},r.createElement("mask",{id:"b",fill:"#fff"},r.createElement("use",{xlinkHref:"#a"})),r.createElement("path",{stroke:"#9B9B9B",strokeWidth:2,strokeLinecap:"round",mask:"url(#b)",d:"M9 9v9M13 9v9"}),r.createElement("g",{mask:"url(#b)",stroke:"#9B9B9B",strokeLinecap:"round",strokeWidth:2},r.createElement("path",{strokeLinejoin:"round",d:"M3 6l2 15h12l2-15"}),r.createElement("path",{d:"M1 5h20M14 4a3 3 0 10-6 0"})));function zu(e,t){var n=e.title,a=e.titleId,i=Au(e,["title","titleId"]);return r.createElement("svg",Tu({width:22,height:22,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Mu,Wu)}var $u=r.forwardRef(zu);n.p;function qu(){return(qu=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Hu(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Vu=r.createElement("desc",null,"Created with Sketch."),Uu=r.createElement("g",{id:"icon/action/delete/enabled",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round"},r.createElement("line",{x1:9,y1:9,x2:9,y2:18,id:"Stroke-1",stroke:"#1B2559",strokeWidth:2}),r.createElement("line",{x1:13,y1:9,x2:13,y2:18,id:"Stroke-2",stroke:"#1B2559",strokeWidth:2}),r.createElement("polyline",{id:"Stroke-3",stroke:"#1B2559",strokeWidth:2,strokeLinejoin:"round",points:"3 6 5 21 17 21 19 6"}),r.createElement("line",{x1:1,y1:5,x2:21,y2:5,id:"Stroke-5",stroke:"#1B2559",strokeWidth:2}),r.createElement("path",{d:"M14,4 C14,2.343 12.657,1 11,1 C9.343,1 8,2.343 8,4",id:"Stroke-7",stroke:"#1B2559",strokeWidth:2}));function Gu(e,t){var n=e.title,a=e.titleId,i=Hu(e,["title","titleId"]);return r.createElement("svg",qu({width:"22px",height:"22px",viewBox:"0 0 22 22",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Vu,Uu)}var Xu=r.forwardRef(Gu);n.p;function Yu(){return(Yu=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function _u(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Zu=r.createElement("desc",null,"Created with Sketch."),Ku=r.createElement("g",{id:"icon/action/edit/disabled",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("path",{d:"M1,18 L1,18 C1,19.657 2.343,21 4,21 L18,21 C19.657,21 21,19.657 21,18",id:"Stroke-1",stroke:"#9B9B9B",strokeWidth:2}),r.createElement("polygon",{id:"Stroke-3",stroke:"#9B9B9B",strokeWidth:2,points:"6 12 17 1 21 5 10 16 6 16"}));function Qu(e,t){var n=e.title,a=e.titleId,i=_u(e,["title","titleId"]);return r.createElement("svg",Yu({width:"22px",height:"22px",viewBox:"0 0 22 22",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Zu,Ku)}var Ju=r.forwardRef(Qu);n.p;function em(){return(em=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function tm(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var nm=r.createElement("desc",null,"Created with Sketch."),rm=r.createElement("g",{id:"icon/action/edit/enabled",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("path",{d:"M1,18 L1,18 C1,19.657 2.343,21 4,21 L18,21 C19.657,21 21,19.657 21,18",id:"Stroke-1",stroke:"#1B2559",strokeWidth:2}),r.createElement("polygon",{id:"Stroke-3",stroke:"#1B2559",strokeWidth:2,points:"6 12 17 1 21 5 10 16 6 16"}));function am(e,t){var n=e.title,a=e.titleId,i=tm(e,["title","titleId"]);return r.createElement("svg",em({width:"22px",height:"22px",viewBox:"0 0 22 22",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,nm,rm)}var im,om,cm,lm=r.forwardRef(am),sm=(n.p,{saveButton:{marginRight:20},lastOfGroup:{marginBottom:24},extraPadding:{paddingLeft:35,paddingRight:30},extraPaddingRight:{paddingRight:39},withSuffix:function(e){var t=e.textAlign;return{display:"flex",alignItems:"center",justifyContent:"right"===t?"end":t}},suffix:{margin:[[0,0,0,7]]},size:function(e){var t=e.size;return Hr(t)},bold:Vr}),dm=Object(f.a)(sm),um=function(e){var t=e.disabled,n=e.editing,a=dm(),i=Object(pn.e)(),o=i.values,l=i.submitForm,s=i.resetForm,d=Object(r.useContext)(iu),u=d.editWidth,m=d.onEdit,h=d.enableEdit,b=d.enableDelete,p=d.disableRowEdit,f=d.onDelete,j=d.deleteWidth,g=d.enableToggle,O=d.onToggle,x=d.toggleWidth,v=d.forceAdd,y=d.clearError,w=d.actionColSize,C=d.error,k=t||p&&p(o),S=Object(r.useState)(!1),N=Object(c.a)(S,2),I=N[0],E=N[1];return Object(Me.jsxs)(Me.Fragment,{children:[n&&Object(Me.jsxs)(tu,{textAlign:"center",width:w,children:[Object(Me.jsx)(or,{className:a.saveButton,type:"submit",color:"primary",onClick:l,children:"Save"}),!v&&Object(Me.jsx)(or,{color:"secondary",onClick:function(){y(),s()},children:"Cancel"})]}),!n&&h&&Object(Me.jsx)(tu,{textAlign:"center",width:u,children:Object(Me.jsx)(tr,{disabled:k,className:a.editButton,onClick:function(){return m&&m(o.id)},children:k?Object(Me.jsx)(Ju,{}):Object(Me.jsx)(lm,{})})}),!n&&b&&Object(Me.jsxs)(tu,{textAlign:"center",width:j,children:[Object(Me.jsx)(tr,{disabled:t,onClick:function(){E(!0)},children:t?Object(Me.jsx)($u,{}):Object(Me.jsx)(Xu,{})}),Object(Me.jsx)(yu,{open:I,setDeleteDialog:E,onConfirmed:function(){f(o.id).then((function(e){D.a(e)||E(!1)}))},onDismissed:function(){E(!1),y()},errorMessage:C})]}),!n&&g&&Object(Me.jsx)(tu,{textAlign:"center",width:x,children:Object(Me.jsx)(Ca,{checked:!!o.active,value:!!o.active,disabled:t,onChange:function(){return O(o.id)}})})]})},mm=function(e){var t,n=e.editing,r=e.focus,a=e.config,i=e.extraPaddingRight,o=e.extraPadding,c=a.name,l=a.bypassField,d=a.input,u=a.editable,m=void 0===u||u,h=a.size,b=a.bold,p=a.width,f=a.textAlign,j=a.editingAlign,g=void 0===j?f:j,O=a.suffix,x=a.SuffixComponent,v=void 0===x?tt:x,y=a.textStyle,w=void 0===y?function(e){}:y,C=a.view,k=void 0===C?function(e){return null===e||void 0===e?void 0:e.toString()}:C,S=a.inputProps,N=void 0===S?{}:S,I=Object(pn.e)().values,E=n&&function(e){return"function"===typeof e?e(I):e}(m),F=!l,L=dm({textAlign:E?g:f,size:h}),P=Object(s.a)({fullWidth:!0,autoFocus:r,size:h,bold:b,textAlign:E?g:f},N);return Object(Me.jsxs)(tu,{className:(t={},Object(z.a)(t,L.extraPaddingRight,i),Object(z.a)(t,L.extraPadding,o),Object(z.a)(t,L.withSuffix,O),t),width:p,size:h,bold:b,textAlign:f,children:[E&&F&&Object(Me.jsx)(pn.b,Object(s.a)({name:c,component:d},P)),E&&!F&&Object(Me.jsx)(a.input,{name:c}),!E&&I&&Object(Me.jsx)("div",{style:w(I,E),children:k(I[c],I)}),O&&Object(Me.jsx)(v,{className:L.suffix,style:E?{}:w(I,E),children:O})]})},hm=function(e){var t=e.editing,n=e.disabled,a=e.lastOfGroup,i=e.newRow,o=Object(pn.e)(),l=o.touched,s=o.errors,d=o.values,u=Object(r.useContext)(iu),m=u.elements,h=u.enableEdit,b=u.enableDelete,p=u.error,f=u.enableToggle,j=u.rowSize,g=u.stripeWhen,O=dm(),x=!t&&g&&g(d)?function(e){var t=Bl.a(W.a("stripe",!0))(e),n=Object(c.a)(t,2),r=n[0],a=n[1];if(!r.length)return e;var i=ou.a(r[0],e),o=L.a(Pl.a,B.a(A.a(["width"])))(r);return cu.a(i,{width:o,editable:!1,view:function(){return Object(Me.jsx)(Gt,{})}},a)}(m):m,v=Bl.a(To.a("doubleHeader"))(m),y=Object(c.a)(v,1)[0],w=(null===y||void 0===y?void 0:y.length)?ou.a(y[0],m):-1,C=(null===y||void 0===y?void 0:y.length)?ou.a(y[y.length-1],m):-1,k=x.findIndex((function(e){return void 0===e.editable||e.editable})),S=Object(z.a)({},O.lastOfGroup,a),N=gu.a(il.a(l),s),I=N&&il.a(N).length>0||!!p,F=p||N&&ts.a(N).join(", ");return Object(Me.jsxs)(au,{className:E()(S),size:j,error:t&&I,newRow:i&&!I,errorMessage:F,children:[x.map((function(e,n){return Object(Me.jsx)(mm,{config:e,editing:t,focus:n===k&&t,extraPaddingRight:C===n,extraPadding:w===n},n)})),(h||b||f)&&Object(Me.jsx)(um,{disabled:n,editing:t})]})},bm={wrapper:function(e){return{width:e.width}},addLink:{marginLeft:"auto"},title:{margin:0,color:se},outerHeader:{minHeight:16,marginBottom:24,display:"flex",justifyContent:"space-between",alignItems:"center"}},pm=Object(f.a)(bm),fm=L.a(Dl.a(Ad.a)(0),B.a((function(e){var t;return null!==(t=e.width)&&void 0!==t?t:100}))),jm=function(e){var t,n,a,i=e.name,o=e.title,l=e.titleLg,d=e.elements,u=void 0===d?[]:d,m=e.data,h=void 0===m?[]:m,b=e.save,p=e.error,f=e.rowSize,j=void 0===f?"md":f,g=e.validationSchema,O=e.enableCreate,x=e.enableEdit,v=e.editWidth,y=e.enableDelete,w=e.deleteWidth,C=void 0===w?87:w,k=e.enableToggle,S=e.toggleWidth,N=void 0===S?87:S,I=e.onToggle,E=e.forceDisable,F=e.disableAdd,L=e.initialValues,P=e.setEditing,D=e.shouldOverrideEdit,B=e.editOverride,T=e.stripeWhen,A=e.disableRowEdit,M=e.groupBy,$=e.sortBy,q=e.createText,H=void 0===q?"Add override":q,V=e.forceAdd,U=void 0!==V&&V,G=e.tbodyWrapperClass,X=Object(r.useState)(null),Y=Object(c.a)(X,2),_=Y[0],Z=Y[1],K=Object(r.useState)(!1),Q=Object(c.a)(K,2),J=Q[0],ee=Q[1],te=Object(r.useState)(!1),ne=Object(c.a)(te,2),re=ne[0],ae=ne[1],ie=Object(r.useState)(null),oe=Object(c.a)(ie,2),ce=oe[0],le=oe[1];Object(r.useEffect)((function(){return le(p)}),[p]),Object(r.useEffect)((function(){le(null),ee(U)}),[U]);var se=function(){var e=Object(nc.a)(tc.a.mark((function e(t){var n,r,a;return tc.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!re){e.next=2;break}return e.abrupt("return");case 2:if(ae(!0),n=g.cast(t),r=Ho.a(W.a("id",n.id))(h),a=-1!==r?Md.a(r,n,h):Wd.a(n,h),hs.a(h[r],n)){e.next=16;break}return e.prev=7,e.next=10,b(Object(z.a)({},i,a),n);case 10:e.next=16;break;case 12:return e.prev=12,e.t0=e.catch(7),ae(!1),e.abrupt("return");case 16:ee(!1),Z(null),P&&P(!1),ae(!1);case 20:case"end":return e.stop()}}),e,null,[[7,12]])})));return function(t){return e.apply(this,arguments)}}(),de=function(){ee(!1),Z(null),P&&P(!1)},ue=function(){ee(!0),le(null),P&&P(!0,!0)},me=y||k?87:174,he=zr.a(me)(v),be=(null!==(t=y&&C)&&void 0!==t?t:0)+(null!==(n=x&&he)&&void 0!==n?n:0)+(null!==(a=k&&N)&&void 0!==a?a:0),pe=fm(u)+be,fe=pm({width:pe}),je=!h.length&&O&&!J,ge=!E&&!_&&!F&&!J,Oe=J||0!==h.length,xe=$?$d.a($)(h):h,ve={elements:u,enableEdit:x,onEdit:function(e){if(D&&D(e))return B(e);Z(e),le(null),P&&P(e,!0)},clearError:function(){return le(null)},error:ce,disableRowEdit:A,editWidth:he,enableDelete:y,onDelete:function(e){var t=zd.a((function(t){return t.id===e}),h);return b(Object(z.a)({},i,t))},deleteWidth:C,enableToggle:k,rowSize:j,onToggle:I,toggleWidth:N,actionColSize:be,stripeWhen:T,forceAdd:U,DEFAULT_COL_SIZE:100};return Object(Me.jsx)(iu.Provider,{value:ve,children:Object(Me.jsxs)("div",{className:fe.wrapper,children:[je&&ge&&Object(Me.jsx)(Ln,{onClick:ue,children:H}),Oe&&Object(Me.jsxs)(Me.Fragment,{children:[(o||O)&&Object(Me.jsxs)("div",{className:fe.outerHeader,children:[o&&l&&Object(Me.jsx)(Qe,{className:fe.title,children:o}),o&&!l&&Object(Me.jsx)(_e,{className:fe.title,children:o}),O&&ge&&Object(Me.jsx)(or,{className:fe.addLink,onClick:ue,children:H})]}),Object(Me.jsxs)(Kd,{children:[Object(Me.jsx)(ju,{}),Object(Me.jsx)("div",{className:G,children:Object(Me.jsxs)(eu,{children:[J&&Object(Me.jsx)(pn.d,{validateOnBlur:!1,validateOnChange:!1,initialValues:Object(s.a)({id:Object(qd.a)()},L),onReset:de,validationSchema:g,onSubmit:se,children:Object(Me.jsxs)(pn.c,{children:[Object(Me.jsx)(Vd,{}),Object(Me.jsx)(hm,{editing:!0,disabled:E,newRow:!0})]})}),xe.map((function(e,t){var n,r=xe[t+1],a=!!M&&r,i="Function"===Br.a(M)?M:R.a(M),o=a&&i(e)!==i(r);return Object(Me.jsx)(pn.d,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,initialValues:e,onReset:de,validationSchema:g,onSubmit:se,children:Object(Me.jsxs)(pn.c,{children:[Object(Me.jsx)(Vd,{}),Object(Me.jsx)(hm,{lastOfGroup:o,editing:_===e.id,disabled:E||_&&_!==e.id||J})]})},null!==(n=e.id)&&void 0!==n?n:t)}))]})})]})]})]})})},gm=function(e){var t=e.name,n=e.save,r=e.data,a=void 0===r?{}:r,i=e.namespaces,o=void 0===i?[]:i,c=Object($.a)(e,["name","save","data","namespaces"]),l=B.a((function(e){return Object(s.a)({id:e},Cl(e)(a))}))(o);return Object(Me.jsx)(jm,Object(s.a)({name:t,data:l,save:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var a=t[1];return n(kl(a.id)(Td.a(["id2"],a)))}},c))},Om={cashbox:{width:80,height:36}},xm=Object(f.a)(Om),vm=xn.e().shape({name:xn.g().required("Required"),cashbox:xn.d().label("Cashbox").required().integer().min(0).max(1e3),cassette1:xn.d().required("Required").integer().min(0).max(500),cassette2:xn.d().required("Required").integer().min(0).max(500)}),ym=x()(im||(im=Object(l.a)(["\n mutation MachineAction(\n $deviceId: ID!\n $action: MachineAction!\n $cashbox: Int!\n $cassette1: Int!\n $cassette2: Int!\n ) {\n machineAction(\n deviceId: $deviceId\n action: $action\n cashbox: $cashbox\n cassette1: $cassette1\n cassette2: $cassette2\n ) {\n deviceId\n cashbox\n cassette1\n cassette2\n }\n }\n"]))),wm=function(e){var t=e.machine,n=e.config,r=e.refetchData,a=xm(),i=n&&Cl("cashOut")(n),o=n&&Cl("locale")(n),l=n&&Cl("notifications",n),s=null===o||void 0===o?void 0:o.fiatCurrency,d=function(e){return Cl(e)(i)},m=function(e){var t=e.deviceId;return!d(t).active},h=[{name:"cashbox",header:"Cashbox",width:240,stripe:!1,view:function(e){return Object(Me.jsx)(Aa,{currency:{code:s},notes:e,total:0})},input:qa,inputProps:{decimalPlaces:0}},{name:"cassette1",header:"Cash-out 1",width:265,stripe:!0,view:function(e,t){var n,r=t.deviceId;return Object(Me.jsx)(Ma,{className:a.cashbox,denomination:null===(n=d(r))||void 0===n?void 0:n.top,currency:{code:s},notes:e,threshold:l.fillingPercentageCassette1})},input:qa,inputProps:{decimalPlaces:0}},{name:"cassette2",header:"Cash-out 2",width:265,stripe:!0,view:function(e,t){var n,r=t.deviceId;return Object(Me.jsx)(Ma,{className:a.cashbox,denomination:null===(n=d(r))||void 0===n?void 0:n.bottom,currency:{code:s},notes:e,threshold:l.fillingPercentageCassette2})},input:qa,inputProps:{decimalPlaces:0}}],b=Object(u.b)(ym,{refetchQueries:function(){return r()}}),p=Object(c.a)(b,2),f=p[0],j=p[1].error;return t.name?Object(Me.jsx)(jm,{error:null===j||void 0===j?void 0:j.message,stripeWhen:m,disableRowEdit:m,name:"cashboxes",elements:h,data:[t]||!1,save:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t[1],a=r.deviceId,i=r.cashbox,o=r.cassette1,c=r.cassette2;return f({variables:{action:"setCassetteBills",deviceId:a,cashbox:i,cassette1:o,cassette2:c}})},validationSchema:vm}):null},Cm=n(815),km={marginLeft:6},Sm=Object(Me.jsxs)("div",{children:[Object(Me.jsx)(Yc,{}),Object(Me.jsx)("span",{style:km,children:"Cash-in"})]}),Nm=Object(Me.jsxs)("div",{children:[Object(Me.jsx)(tl,{}),Object(Me.jsx)("span",{style:km,children:"Cash-out"})]}),Im=function(e){return function(e){return[{name:"name",width:280,size:"sm",view:function(e){return"".concat(e)}},{header:Sm,name:"cashIn",display:"Cash-in",width:130,textAlign:"right",suffix:"%"},{header:Nm,name:"cashOut",display:"Cash-out",width:130,textAlign:"right",suffix:"%",inputProps:{decimalPlaces:3}},{name:"fixedFee",display:"Fixed fee",width:144,doubleHeader:"Cash-in only",textAlign:"right",suffix:e},{name:"minimumTx",display:"Minimun Tx",width:144,doubleHeader:"Cash-in only",textAlign:"right",suffix:e}]}(e)},Em=x()(om||(om=Object(l.a)(["\n query getData {\n config\n cryptoCurrencies {\n code\n display\n }\n machines {\n name\n deviceId\n }\n }\n"]))),Fm=x()(cm||(cm=Object(l.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),Lm=function(e){var t=e.name,n=e.id,r=Object(u.c)(Em),a=r.data,i=r.loading,o=Object(u.b)(Fm,{refetchQueries:function(){return["getData"]}}),l=Object(c.a)(o,1)[0],s=(null===a||void 0===a?void 0:a.config)&&Cl(t)(a.config),d=A.a(["fiatCurrency"])(Cl(pl)(null===a||void 0===a?void 0:a.config)),m=function(){if(i||!n||!s)return[];var e={};Cm.a((function(t){return e[R.a("code")(t)]={code:t.code,name:t.display,cashIn:s.cashIn,cashOut:s.cashOut,fixedFee:s.fixedFee,minimumTx:s.minimumTx}}))(a.cryptoCurrencies);var t=function(e){return W.a("machine",e)},r=s.overrides?M.a(t("ALL_MACHINES"))(s.overrides):[],o=function(t){e[t.cryptoCurrencies[0]].cashIn=t.cashIn,e[t.cryptoCurrencies[0]].cashOut=t.cashOut,e[t.cryptoCurrencies[0]].fixedFee=t.fixedFee,e[t.cryptoCurrencies[0]].minimumTx=t.minimumTx};Cm.a(o)(r);var c=s.overrides?M.a(t(n))(s.overrides):[];return Cm.a(o)(c),ts.a(e)}();return Object(Me.jsx)(jm,{name:"overrides",save:function(e){var n=kl(t)(e);return l({variables:{config:n}})},data:m,elements:Im(d)})},Pm=n(393),Dm=n(816),Bm=n(817),Rm=n(818),Tm=function(e){return Dm.a(Bm.a(R.a("utcOffset")),B.a((function(t){return{utcOffset:t.utcOffset,dstOffset:t.dstOffset,utcOffsetStr:t.utcOffsetStr,dstOffsetStr:t.dstOffsetStr,cities:B.a((function(e){var t=Rm.a("/",e.name);return{region:t[0],city:lu.a(/_/g," ",t[1]),country:e.country}}),M.a((function(e){return $r.a("utcOffset",t,e)&&$r.a("dstOffset",t,e)&&!D.a(e.country)&&!F.a("Etc",e.name)&&F.a("/",e.name)}),e))}}),function(e){return B.a((function(e){return{utcOffset:e.utcOffset,dstOffset:e.dstOffset,utcOffsetStr:e.utcOffsetStr,dstOffsetStr:e.dstOffsetStr}}),Pm.a((function(e){return[e.utcOffset,e.dstOffset,e.utcOffsetStr,e.dstOffsetStr]}),e))}(e)))},Am=function(e){return B.a((function(e){return{label:(t=e,"(UTC".concat(t.utcOffsetStr,") ").concat(B.a((function(e){return e.city}),t.cities).join(", "))),code:"".concat(e.utcOffset,":").concat(e.dstOffset)};var t}),function(e){var t=Tm(e),n=M.a((function(e){return!Wr.a(e.cities)}),t);return B.a((function(e){return Object(s.a)(Object(s.a)({},e),{},{cities:Pm.a(R.a("country"),Pm.a(R.a("city"),e.cities))})}),n)}(e))},Mm=function(e,t,n){var r,a=null!==(r=null===t||void 0===t?void 0:t.split(":")[1])&&void 0!==r?r:0;return Ll.a.utc(e).utcOffset(parseInt(a)).format(n)},Wm=function(e,t){return Ll()(e).format(t)},zm={grid:{flex:1,height:"100%"},content:{display:"flex",flexDirection:"column",flex:1,marginLeft:48,maxWidth:900},subtitle:{display:"flex",justifyContent:"space-between",alignItems:"center",flexDirection:"row",color:q},label3:{color:q,marginTop:0},row:{display:"flex",flexDirection:"row",justifyContent:"space-around"},rowItem:{flex:1,marginBottom:16},detailItem:{marginBottom:32},actionButtonsContainer:{display:"flex",flexDirection:"row"},breadcrumbsContainer:{marginTop:32},breadcrumbLink:{textDecoration:"none"},detailsMargin:{marginTop:24},sidebarContainer:{height:400,overflowY:"auto"}},$m=Object(f.a)(zm),qm=function(e){var t=e.data,n=e.timezone,r=$m();return Object(Me.jsxs)("div",{className:r.row,children:[Object(Me.jsxs)("div",{className:r.rowItem,children:[Object(Me.jsx)(nt,{className:r.label3,children:"Paired at"}),Object(Me.jsx)(Xe,{children:t.pairedAt?Mm(t.pairedAt,n,"YYYY-MM-DD HH:mm:ss"):""})]}),Object(Me.jsxs)("div",{className:r.rowItem,children:[Object(Me.jsx)(nt,{className:r.label3,children:"Machine model"}),Object(Me.jsx)(Xe,{children:t.model})]}),Object(Me.jsxs)("div",{className:r.rowItem,children:[Object(Me.jsx)(nt,{className:r.label3,children:"Software version"}),Object(Me.jsx)(Xe,{children:t.version})]})]})},Hm=n(878),Vm=Object(f.a)({dialogContent:{width:434,padding:16,paddingRight:28},dialogTitle:{padding:16,paddingRight:12,display:"flex","justify-content":"space-between","& > h4":{margin:0},"& > button":{padding:0,marginTop:-4}},dialogActions:{padding:32,paddingTop:16}}),Um=function(e){var t=e.children,n=e.onClose,r=Vm();return Object(Me.jsxs)("div",{className:r.dialogTitle,children:[t,n&&Object(Me.jsx)(tr,{size:16,"aria-label":"close",onClick:n,children:Object(Me.jsx)(gi,{})})]})},Gm=Object(r.memo)((function(e){var t=e.title,n=void 0===t?"Confirm action":t,a=e.errorMessage,i=void 0===a?"This action requires confirmation":a,o=e.open,l=e.toBeConfirmed,d=e.saveButtonAlwaysEnabled,u=void 0!==d&&d,m=e.message,h=e.confirmationMessage,b=void 0===h?"Write '".concat(l,"' to confirm this action"):h,p=e.onConfirmed,f=e.onDismissed,j=e.initialValue,g=void 0===j?"":j,O=e.disabled,x=void 0!==O&&O,v=Object($.a)(e,["title","errorMessage","open","toBeConfirmed","saveButtonAlwaysEnabled","message","confirmationMessage","onConfirmed","onDismissed","initialValue","disabled"]),y=Vm(),w=Object(r.useState)(g),C=Object(c.a)(w,2),k=C[0],S=C[1],N=Object(r.useState)(!1),I=Object(c.a)(N,2),E=I[0],F=I[1],L=!u&&l!==k||""===k;return Object(Me.jsxs)(un.a,Object(s.a)(Object(s.a)({open:o,"aria-labelledby":"form-dialog-title"},v),{},{children:[Object(Me.jsx)(Um,{id:"customized-dialog-title",onClose:function(){S(""),F(!1),f()},children:Object(Me.jsx)(Ue,{children:n})}),i&&Object(Me.jsx)(Um,{children:Object(Me.jsx)(Fo,{children:i.split(":").map((function(e){return Object(Me.jsxs)(Me.Fragment,{children:[e,Object(Me.jsx)("br",{})]})}))})}),Object(Me.jsxs)(mn.a,{className:y.dialogContent,children:[m&&Object(Me.jsx)(Xe,{children:m}),Object(Me.jsx)(Hm.a,{htmlFor:"confirm-input",children:b}),Object(Me.jsx)(Xr,{disabled:x,name:"confirm-input",autoFocus:!0,id:"confirm-input",type:"text",size:"sm",fullWidth:!0,value:k,touched:{},error:E,InputLabelProps:{shrink:!0},onChange:function(e){return S(e.target.value)}})]}),Object(Me.jsx)(Ou.a,{className:y.dialogActions,children:Object(Me.jsx)(An,{color:"green",disabled:L,onClick:function(){return p(k)},children:"Confirm"})})]}))}));function Xm(){return(Xm=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Ym(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var _m=r.createElement("desc",null,"Created with Sketch."),Zm=r.createElement("g",{id:"icon/button/edit/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("path",{d:"M0,10 L0,10 C0,10.9942 0.8058,11.8 1.8,11.8 L10.2,11.8 C11.1942,11.8 12,10.9942 12,10",id:"Stroke-1",stroke:"#FFFFFF"}),r.createElement("polygon",{id:"Stroke-3",stroke:"#FFFFFF",points:"3 6.86666667 8.86666667 1 11 3.13333333 5.13333333 9 3 9"}));function Km(e,t){var n=e.title,a=e.titleId,i=Ym(e,["title","titleId"]);return r.createElement("svg",Xm({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,_m,Zm)}var Qm=r.forwardRef(Km);n.p;function Jm(){return(Jm=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function eh(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var th=r.createElement("desc",null,"Created with Sketch."),nh=r.createElement("g",{id:"icon/button/edit/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("path",{d:"M0,10 L0,10 C0,10.9942 0.8058,11.8 1.8,11.8 L10.2,11.8 C11.1942,11.8 12,10.9942 12,10",id:"Stroke-1",stroke:"#1B2559"}),r.createElement("polygon",{id:"Stroke-3",stroke:"#1B2559",points:"3 6.86666667 8.86666667 1 11 3.13333333 5.13333333 9 3 9"}));function rh(e,t){var n=e.title,a=e.titleId,i=eh(e,["title","titleId"]);return r.createElement("svg",Jm({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,th,nh)}var ah=r.forwardRef(rh);n.p;function ih(){return(ih=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function oh(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var ch=r.createElement("desc",null,"Created with Sketch."),lh=r.createElement("g",{id:"icon/button/reboot/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("g",{id:"Group-3",stroke:"#FFFFFF"},r.createElement("g",{id:"Group-2"},r.createElement("path",{d:"M3.57419317,11.1560104 C2.91506589,10.8661403 2.29620875,10.4522182 1.75493083,9.91362078 C-0.568892549,7.60089351 -0.587250991,3.86936104 1.71406849,1.57845195 C2.03057585,1.26367293 2.37407977,0.992496226 2.73740775,0.764921841",id:"Stroke-1"}),r.createElement("polyline",{id:"Stroke-3",points:"3.37563213 1.84831169 3.36911784 0.595324675 2.18174122 4.15223411e-14"})),r.createElement("line",{x1:5.92223784,y1:7.57277922,x2:5.92223784,y2:3.98212987,id:"Stroke-9"}),r.createElement("g",{id:"Group-2",transform:"translate(9.818105, 6.000000) scale(-1, -1) translate(-9.818105, -6.000000) translate(7.636287, 0.000000)"},r.createElement("path",{d:"M3.57419317,11.1560104 C2.91506589,10.8661403 2.29620875,10.4522182 1.75493083,9.91362078 C-0.568892549,7.60089351 -0.587250991,3.86936104 1.71406849,1.57845195 C2.03057585,1.26367293 2.37407977,0.992496226 2.73740775,0.764921841",id:"Stroke-1"}),r.createElement("polyline",{id:"Stroke-3",points:"3.37563213 1.84831169 3.36911784 0.595324675 2.18174122 4.15223411e-14"}))));function sh(e,t){var n=e.title,a=e.titleId,i=oh(e,["title","titleId"]);return r.createElement("svg",ih({width:"12px",height:"12px",viewBox:"-0.493 -0.5 12.993 13",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,ch,lh)}var dh=r.forwardRef(sh);n.p;function uh(){return(uh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function mh(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var hh=r.createElement("desc",null,"Created with Sketch."),bh=r.createElement("g",{id:"icon/button/reboot/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("g",{id:"Group-3",stroke:"#1B2559"},r.createElement("g",{id:"Group-2"},r.createElement("path",{d:"M3.57419317,11.1560104 C2.91506589,10.8661403 2.29620875,10.4522182 1.75493083,9.91362078 C-0.568892549,7.60089351 -0.587250991,3.86936104 1.71406849,1.57845195 C2.03057585,1.26367293 2.37407977,0.992496226 2.73740775,0.764921841",id:"Stroke-1"}),r.createElement("polyline",{id:"Stroke-3",points:"3.37563213 1.84831169 3.36911784 0.595324675 2.18174122 4.15223411e-14"})),r.createElement("line",{x1:5.92223784,y1:7.57277922,x2:5.92223784,y2:3.98212987,id:"Stroke-9"}),r.createElement("g",{id:"Group-2",transform:"translate(9.818105, 6.000000) scale(-1, -1) translate(-9.818105, -6.000000) translate(7.636287, 0.000000)"},r.createElement("path",{d:"M3.57419317,11.1560104 C2.91506589,10.8661403 2.29620875,10.4522182 1.75493083,9.91362078 C-0.568892549,7.60089351 -0.587250991,3.86936104 1.71406849,1.57845195 C2.03057585,1.26367293 2.37407977,0.992496226 2.73740775,0.764921841",id:"Stroke-1"}),r.createElement("polyline",{id:"Stroke-3",points:"3.37563213 1.84831169 3.36911784 0.595324675 2.18174122 4.15223411e-14"}))));function ph(e,t){var n=e.title,a=e.titleId,i=mh(e,["title","titleId"]);return r.createElement("svg",uh({width:"12px",height:"12px",viewBox:"-0.493 -0.5 12.993 13",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,hh,bh)}var fh=r.forwardRef(ph);n.p;function jh(){return(jh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function gh(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Oh=r.createElement("desc",null,"Created with Sketch."),xh=r.createElement("g",{id:"icon/button/shut-down/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("g",{id:"Group-5",transform:"translate(1.000000, 0.000000)",stroke:"#FFFFFF"},r.createElement("path",{d:"M7.7735,2 C9.116,2.89710351 10,4.4271328 10,6.16330077 C10,8.92665975 7.7615,11.1666667 5,11.1666667 C2.2385,11.1666667 0,8.92665975 0,6.16330077 C0,4.43663919 0.8745,2.91361461 2.204,2.01450976",id:"Stroke-1"}),r.createElement("line",{x1:5,y1:.75,x2:5,y2:3.25,id:"Stroke-3"})));function vh(e,t){var n=e.title,a=e.titleId,i=gh(e,["title","titleId"]);return r.createElement("svg",jh({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Oh,xh)}var yh=r.forwardRef(vh);n.p;function wh(){return(wh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Ch(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var kh=r.createElement("desc",null,"Created with Sketch."),Sh=r.createElement("g",{id:"icon/button/shut-down/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("g",{id:"Group-5",transform:"translate(1.000000, 0.000000)",stroke:"#1B2559"},r.createElement("path",{d:"M7.7735,2 C9.116,2.89710351 10,4.4271328 10,6.16330077 C10,8.92665975 7.7615,11.1666667 5,11.1666667 C2.2385,11.1666667 0,8.92665975 0,6.16330077 C0,4.43663919 0.8745,2.91361461 2.204,2.01450976",id:"Stroke-1"}),r.createElement("line",{x1:5,y1:.75,x2:5,y2:3.25,id:"Stroke-3"})));function Nh(e,t){var n=e.title,a=e.titleId,i=Ch(e,["title","titleId"]);return r.createElement("svg",wh({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,kh,Sh)}var Ih=r.forwardRef(Nh);n.p;function Eh(){return(Eh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Fh(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Lh=r.createElement("desc",null,"Created with Sketch."),Ph=r.createElement("g",{id:"icon/button/unpair/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("g",{id:"Group-12",stroke:"#FFFFFF"},r.createElement("g",{id:"Group-5"},r.createElement("polyline",{id:"Stroke-1",points:"3.75 6 2.25 6 0 3.75 3.75 0 6.75 3"}),r.createElement("polyline",{id:"Stroke-3",points:"8.25 6 9.75 6 12 8.25 8.25 12 5.25 9"})),r.createElement("line",{x1:8.25,y1:3,x2:8.25,y2:1.5,id:"Stroke-6"}),r.createElement("line",{x1:9.75,y1:3,x2:10.5,y2:2.25,id:"Stroke-7"}),r.createElement("line",{x1:9.75,y1:4.5,x2:11.25,y2:4.5,id:"Stroke-8"}),r.createElement("line",{x1:2.25,y1:7.5,x2:.75,y2:7.5,id:"Stroke-9"}),r.createElement("line",{x1:2.25,y1:9,x2:1.5,y2:9.75,id:"Stroke-10"}),r.createElement("line",{x1:3.75,y1:9,x2:3.75,y2:10.5,id:"Stroke-11"})));function Dh(e,t){var n=e.title,a=e.titleId,i=Fh(e,["title","titleId"]);return r.createElement("svg",Eh({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Lh,Ph)}var Bh=r.forwardRef(Dh);n.p;function Rh(){return(Rh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Th(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Ah=r.createElement("desc",null,"Created with Sketch."),Mh=r.createElement("g",{id:"icon/button/unpair/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("g",{id:"Group-12",stroke:"#1B2559"},r.createElement("g",{id:"Group-5"},r.createElement("polyline",{id:"Stroke-1",points:"3.75 6 2.25 6 0 3.75 3.75 0 6.75 3"}),r.createElement("polyline",{id:"Stroke-3",points:"8.25 6 9.75 6 12 8.25 8.25 12 5.25 9"})),r.createElement("line",{x1:8.25,y1:3,x2:8.25,y2:1.5,id:"Stroke-6"}),r.createElement("line",{x1:9.75,y1:3,x2:10.5,y2:2.25,id:"Stroke-7"}),r.createElement("line",{x1:9.75,y1:4.5,x2:11.25,y2:4.5,id:"Stroke-8"}),r.createElement("line",{x1:2.25,y1:7.5,x2:.75,y2:7.5,id:"Stroke-9"}),r.createElement("line",{x1:2.25,y1:9,x2:1.5,y2:9.75,id:"Stroke-10"}),r.createElement("line",{x1:3.75,y1:9,x2:3.75,y2:10.5,id:"Stroke-11"})));function Wh(e,t){var n=e.title,a=e.titleId,i=Th(e,["title","titleId"]);return r.createElement("svg",Rh({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Ah,Mh)}var zh,$h,qh=r.forwardRef(Wh),Hh=(n.p,{label:{extend:Re.label1,color:se,marginBottom:4},inlineChip:{marginInlineEnd:"0.25em"},stack:{display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"start"},mr:{marginRight:8,marginBottom:8},warning:{color:me}}),Vh=Object(f.a)(Hh),Uh=x()(zh||(zh=Object(l.a)(["\n mutation MachineAction(\n $deviceId: ID!\n $action: MachineAction!\n $newName: String\n ) {\n machineAction(deviceId: $deviceId, action: $action, newName: $newName) {\n deviceId\n }\n }\n"]))),Gh=x()($h||($h=Object(l.a)(["\n query getMachine($deviceId: ID!) {\n machine(deviceId: $deviceId) {\n latestEvent {\n note\n }\n }\n }\n"]))),Xh=function(e){var t=e.children,n=Vh();return Object(Me.jsx)("div",{className:n.label,children:t})},Yh=Object(r.memo)((function(e){var t=e.machine,n=e.onActionSuccess,a=Object(r.useState)({command:null}),i=Object(c.a)(a,2),o=i[0],l=i[1],d=Object(r.useState)(null),m=Object(c.a)(d,2),h=m[0],b=m[1],p=Vh(),f=Object(Me.jsx)("span",{className:p.warning,children:"A user may be in the middle of a transaction and they could lose their funds if you continue."}),j=Object(u.a)(Gh,{variables:{deviceId:t.deviceId},onCompleted:function(e){var t,n=(t=function(e){var t,n;return JSON.parse(null!==(t=null===(n=e.machine.latestEvent)||void 0===n?void 0:n.note)&&void 0!==t?t:'{"state": null}').state}(e))&&!["chooseCoin","idle","pendingIdle","dualIdle","networkDown","unpaired","maintenance","virgin","wifiList"].includes(t)?f:null;l((function(e){return Object(s.a)(Object(s.a)({},e),{},{message:n})}))}}),g=Object(c.a)(j,2),O=g[0],x=g[1].loading,v=Object(u.b)(Uh,{onError:function(e){var t=e.message;b(null!==t&&void 0!==t?t:"An error ocurred")},onCompleted:function(){n&&n(),l({command:null})}}),y=Object(c.a)(v,2),w=y[0],C=y[1].loading,k=Boolean(o.command),S=!("restartServices"!==(null===o||void 0===o?void 0:o.command)||!x);return Object(Me.jsxs)("div",{children:[Object(Me.jsx)(Xh,{children:"Actions"}),Object(Me.jsxs)("div",{className:p.stack,children:[Object(Me.jsx)(ze,{color:"primary",className:p.mr,Icon:ah,InverseIcon:Qm,disabled:C,onClick:function(){return l({command:"rename",display:"Rename",confirmationMessage:"Write the new name for this machine"})},children:"Rename"}),Object(Me.jsx)(ze,{color:"primary",className:p.mr,Icon:qh,InverseIcon:Bh,disabled:C,onClick:function(){return l({command:"unpair",display:"Unpair"})},children:"Unpair"}),Object(Me.jsx)(ze,{color:"primary",className:p.mr,Icon:fh,InverseIcon:dh,disabled:C,onClick:function(){return l({command:"reboot",display:"Reboot"})},children:"Reboot"}),Object(Me.jsx)(ze,{color:"primary",className:p.mr,Icon:Ih,InverseIcon:yh,disabled:C,onClick:function(){return l({command:"shutdown",display:"Shutdown",message:"In order to bring it back online, the machine will need to be visited and its power reset."})},children:"Shutdown"}),Object(Me.jsx)(ze,{color:"primary",className:p.inlineChip,Icon:fh,InverseIcon:dh,disabled:C,onClick:function(){O(),l({command:"restartServices",display:"Restart services for"})},children:"Restart Services"})]}),Object(Me.jsx)(Gm,{disabled:S,open:k,title:"".concat(null===o||void 0===o?void 0:o.display," this machine?"),errorMessage:h,toBeConfirmed:t.name,message:null===o||void 0===o?void 0:o.message,confirmationMessage:null===o||void 0===o?void 0:o.confirmationMessage,saveButtonAlwaysEnabled:"rename"===(null===o||void 0===o?void 0:o.command),onConfirmed:function(e){b(null),w({variables:Object(s.a)({deviceId:t.deviceId,action:"".concat(null===o||void 0===o?void 0:o.command)},"rename"===(null===o||void 0===o?void 0:o.command)&&{newName:e})})},onDismissed:function(){l({command:null}),b(null)}})]})})),_h=n(405);function Zh(){return(Zh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Kh(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Qh=r.createElement("desc",null,"Created with Sketch."),Jh=r.createElement("g",{id:"Styleguide",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinejoin:"round"},r.createElement("g",{id:"icon/action/copy",transform:"translate(1.000000, 1.000000)",stroke:"#1B2559"},r.createElement("g",{id:"Group-5-Copy-2"},r.createElement("polyline",{id:"Stroke-1",strokeWidth:2,points:"6 1.2 6 -0.00024 16 -0.00024 16 13.06376 12 13.06376"}),r.createElement("polygon",{id:"Stroke-3",strokeWidth:2,strokeLinecap:"round",points:"0 15.9368 10 15.9368 10 2.9368 0 2.9368"}))));function eb(e,t){var n=e.title,a=e.titleId,i=Kh(e,["title","titleId"]);return r.createElement("svg",Zh({width:"18px",height:"18px",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Qh,Jh)}var tb=r.forwardRef(eb),nb=(n.p,{titleWrapper:{display:"flex",justifyContent:"space-between",alignItems:"center",flexDirection:"row"},wrapper:{flex:1,display:"flex",flexDirection:"row",height:"100%"},tableWrapper:{flex:1,marginLeft:40,display:"block",overflowX:"auto",width:"100%",maxWidth:"78%",maxHeight:"70vh"},table:{whiteSpace:"nowrap",display:"block","& th":{position:"sticky",top:0}},dateColumn:{minWidth:160},levelColumn:{minWidth:100},fillColumn:{width:"100%"},shareButton:{margin:8,display:"flex",alignItems:"center",fontSize:ve,padding:[[0,12]]},shareIcon:{marginRight:6},button:{margin:8},titleAndButtonsContainer:{display:"flex"},buttonsWrapper:{display:"flex",marginLeft:16,"& > *":{margin:"auto 6px"}}}),rb=Re.label1,ab={wrapper:{extend:Re.mono,display:"flex",alignItems:"center"},address:{lineBreak:"anywhere"},buttonWrapper:{"& button":{border:"none",backgroundColor:"transparent",cursor:"pointer"}},popoverContent:{extend:rb,display:"flex",justifyContent:"center",alignItems:"center",color:Z,borderRadius:4,padding:[[5,9]]}},ib={idCardDataCard:{extend:Re.p,display:"flex",padding:[[11,8]],"& > div":{display:"flex",flexDirection:"column","& > div":{width:144,height:37,marginBottom:15,"&:last-child":{marginBottom:0}}}}},ob={label:{extend:rb,color:se,marginBottom:4}},cb={titleWrapper:nb.titleWrapper,titleAndButtonsContainer:nb.titleAndButtonsContainer,buttonsWrapper:nb.buttonsWrapper,headerLabels:{display:"flex",flexDirection:"row","& div":{display:"flex",alignItems:"center"},"& > div:first-child":{marginRight:24},"& span":{extend:rb,marginLeft:6}},overflowTd:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},flexWrapper:{display:"flex",alignItems:"center",justifyContent:"space-between",marginRight:16},customerLinkIcon:{marginLeft:2},flexRow:{display:"flex",flexDirection:"row",alignItems:"center"},machineRedirectContainer:{marginLeft:10,paddingLeft:5,paddingRight:5}},lb=Object(f.a)(ab),sb=function(e){var t=e.className,n=e.buttonClassname,a=e.children,i=e.wrapperClassname,o=(Object($.a)(e,["className","buttonClassname","children","wrapperClassname"]),Object(r.useState)(null)),l=Object(c.a)(o,2),s=l[0],d=l[1];Object(r.useEffect)((function(){s&&setTimeout((function(){return d(null)}),3e3)}),[s]);var u=lb(),m=Boolean(s),h=m?"simple-popper":void 0;return Object(Me.jsx)("div",{className:E()(u.wrapper,i),children:a&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)("div",{className:E()(u.address,t),children:a}),Object(Me.jsx)("div",{className:E()(u.buttonWrapper,n),children:Object(Me.jsx)(_h.CopyToClipboard,{text:lu.a(/\s/g,"")(a),children:Object(Me.jsx)("button",{"aria-describedby":h,onClick:function(e){return function(e){d(s?null:e.currentTarget)}(e)},children:Object(Me.jsx)(tb,{})})})}),Object(Me.jsx)(Xn,{id:h,open:m,anchorEl:s,onClose:function(){d(null)},arrowSize:3,bgColor:q,placement:"top",children:Object(Me.jsx)("div",{className:u.popoverContent,children:Object(Me.jsx)("div",{children:"Copied to clipboard!"})})})]})})},db=Object(f.a)(zm),ub=function(e){if(!e)return null;var t=Ll()().diff(e,"seconds");if(t<60)return"".concat(t," ").concat(1===t?"second":"seconds"," ago");if(t<3600){var n=Math.round(t/60);return"".concat(n," ").concat(1===n?"minute":"minutes"," ago")}if(t<86400){var r=Math.round(t/3600);return"".concat(r," ").concat(1===r?"hour":"hours"," ago")}var a=Math.round(t/3600/24);return"".concat(a," ").concat(1===a?"day":"days"," ago")},mb=function(e){var t=e.data,n=e.onActionSuccess,r=db();return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)("div",{className:r.row,children:Object(Me.jsx)("div",{className:r.rowItem,children:Object(Me.jsx)(Ve,{children:t.name})})}),Object(Me.jsx)("div",{className:r.row,children:Object(Me.jsxs)("div",{className:r.rowItem,children:[Object(Me.jsx)(nt,{className:r.label3,children:"Status"}),t&&t.statuses?Object(Me.jsx)(ud,{status:t.statuses[0]}):null]})}),Object(Me.jsx)("div",{className:r.row,children:Object(Me.jsxs)("div",{className:r.rowItem,children:[Object(Me.jsx)(nt,{className:r.label3,children:"Last ping"}),Object(Me.jsx)(Xe,{children:ub(t.lastPing)})]})}),Object(Me.jsx)("div",{className:r.row,children:Object(Me.jsxs)("div",{className:r.rowItem,children:[Object(Me.jsx)(nt,{className:r.label3,children:"Network speed"}),Object(Me.jsx)(Xe,{children:t.downloadSpeed?new al.a(t.downloadSpeed).toFixed(4).toString()+" MB/s":"unavailable"})]})}),Object(Me.jsx)("div",{className:r.row,children:Object(Me.jsx)(Yh,{machine:t,onActionSuccess:n})}),Object(Me.jsx)("div",{className:r.row,children:Object(Me.jsxs)("div",{className:r.rowItem,children:[Object(Me.jsx)(nt,{className:r.label3,children:"Device ID"}),Object(Me.jsx)(Xe,{children:Object(Me.jsx)(sb,{buttonClassname:r.copyToClipboard,children:t.deviceId})})]})})]})},hb=n(61),bb=n(819),pb=n(820),fb=n(872),jb=n(238),gb=n.n(jb),Ob=n(406),xb=n.n(Ob);function vb(){return(vb=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function yb(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var wb=r.createElement("desc",null,"Created with Sketch."),Cb=r.createElement("g",{id:"icon/action/help/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("path",{d:"M20.0004,11 C20.0004,6.03028475 15.9701153,2 11.0004,2 C6.03004556,2 2.0004,6.02992391 2.0004,11 C2.0004,15.9700761 6.03004556,20 11.0004,20 C15.9701153,20 20.0004,15.9697153 20.0004,11 Z M22.0004,11 C22.0004,17.0742847 17.0746847,22 11.0004,22 C4.92544514,22 0.000400000001,17.0746147 0.000400000001,11 C0.000400000001,4.92538534 4.92544514,0 11.0004,0 C17.0746847,0 22.0004,4.92571525 22.0004,11 Z",id:"Stroke-1",fill:"#1B2559",fillRule:"nonzero"}),r.createElement("path",{d:"M9.9164,8.9063 C9.9164,9.45858475 9.46868475,9.9063 8.9164,9.9063 C8.36411525,9.9063 7.9164,9.45858475 7.9164,8.9063 C7.9164,6.89094438 9.72972438,5.35290249 11.7463843,5.7072003 C13.0663562,5.93764844 14.1348314,7.00654285 14.3652323,8.32479116 C14.6130182,9.7312185 13.941375,11.0876584 12.732214,11.7545735 C12.370484,11.9534687 12.1664,12.2664153 12.1664,12.5913 L12.1664,12.6563 C12.1664,13.2085847 11.7186847,13.6563 11.1664,13.6563 C10.6141153,13.6563 10.1664,13.2085847 10.1664,12.6563 L10.1664,12.5913 C10.1664,11.5009567 10.7946963,10.5375141 11.7674377,10.0026589 C12.2360927,9.74417086 12.493064,9.22519581 12.3953326,8.67046887 C12.3098185,8.1811985 11.8915858,7.76280177 11.4013649,7.67721566 C10.6126181,7.53864454 9.9164,8.1291691 9.9164,8.9063 Z",id:"Stroke-3",fill:"#1B2559",fillRule:"nonzero"}),r.createElement("path",{d:"M10.1039,15.2188 C10.1039,14.6318 10.5799,14.1568 11.1659,14.1568 C11.7529,14.1568 12.2289,14.6318 12.2289,15.2188 C12.2289,15.8058 11.7529,16.2808 11.1659,16.2808 C10.5799,16.2808 10.1039,15.8058 10.1039,15.2188",id:"Fill-5",fill:"#1B2559"}));function kb(e,t){var n=e.title,a=e.titleId,i=yb(e,["title","titleId"]);return r.createElement("svg",vb({width:"22px",height:"22px",viewBox:"0 0 22 22",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,wb,Cb)}var Sb=r.forwardRef(kb),Nb=(n.p,Object(f.a)({transparentButton:{border:"none",backgroundColor:"transparent",marginTop:4,outline:"none",cursor:"pointer"},popoverContent:function(e){return{width:e.width,padding:[[10,15]]}}})),Ib=function(e){var t=Nb({width:e}),n=Object(r.useState)(null),a=Object(c.a)(n,2),i=a[0],o=a[1],l=Boolean(i);return{classes:t,helpPopperAnchorEl:i,helpPopperOpen:l,handleOpenHelpPopper:function(e){o(i?null:e.currentTarget)},handleCloseHelpPopper:function(){o(null)}}},Eb=Object(r.memo)((function(e){var t=e.children,n=e.width,r=e.Icon,a=void 0===r?Sb:r,i=Ib(n);return Object(Me.jsx)(S.a,{onClickAway:i.handleCloseHelpPopper,children:Object(Me.jsxs)("div",{children:[Object(Me.jsx)("button",{type:"button",className:i.classes.transparentButton,onClick:i.handleOpenHelpPopper,children:Object(Me.jsx)(a,{})}),Object(Me.jsx)(Xn,{open:i.helpPopperOpen,anchorEl:i.helpPopperAnchorEl,placement:"bottom",children:Object(Me.jsx)("div",{className:i.classes.popoverContent,children:t})})]})})})),Fb=Object(r.memo)((function(e){var t=e.parentElements,n=e.children,r=e.width,a=Ib(r);return Object(Me.jsxs)("div",{children:[Object(Me.jsx)("div",{onMouseEnter:a.handleOpenHelpPopper,onMouseLeave:a.handleCloseHelpPopper,children:t}),Object(Me.jsx)(Xn,{open:a.helpPopperOpen,anchorEl:a.helpPopperAnchorEl,placement:"bottom",children:Object(Me.jsx)("div",{className:a.classes.popoverContent,children:n})})]})}));function Lb(){return(Lb=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Pb(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Db=r.createElement("g",{id:"icon/ID/card/new/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("polygon",{id:"Stroke-1",stroke:"#FFFFFF",strokeWidth:1.6,points:"1 17 23 17 23 1 1 1"}),r.createElement("line",{x1:12.7857143,y1:5,x2:19.8571429,y2:5,id:"Stroke-3",stroke:"#FFFFFF",strokeWidth:1.6}),r.createElement("line",{x1:12.7857143,y1:8.2,x2:19.8571429,y2:8.2,id:"Stroke-4",stroke:"#FFFFFF",strokeWidth:1.6}),r.createElement("polygon",{id:"Stroke-5",stroke:"#FFFFFF",strokeWidth:1.6,points:"4.14285714 12.2 9.64285714 12.2 9.64285714 5 4.14285714 5"}));function Bb(e,t){var n=e.title,a=e.titleId,i=Pb(e,["title","titleId"]);return r.createElement("svg",Lb({width:"24px",height:"18px",viewBox:"0 0 24 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),void 0===n?r.createElement("title",{id:a},"icon/ID/card/new/white"):n?r.createElement("title",{id:a},n):null,Db)}var Rb=r.forwardRef(Bb);n.p;function Tb(){return(Tb=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Ab(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Mb=r.createElement("g",{id:"icon/ID/card/new/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("g",{id:"Group-2",transform:"translate(1.000000, 1.000000)",stroke:"#1B2559",strokeWidth:1.6},r.createElement("g",{id:"id-copy"},r.createElement("polygon",{id:"Stroke-1",points:"0 16 22 16 22 0 0 0"}),r.createElement("line",{x1:11.7857143,y1:4,x2:18.8571429,y2:4,id:"Stroke-3"}),r.createElement("line",{x1:11.7857143,y1:7.2,x2:18.8571429,y2:7.2,id:"Stroke-4"}),r.createElement("polygon",{id:"Stroke-5",points:"3.14285714 11.2 8.64285714 11.2 8.64285714 4 3.14285714 4"}))));function Wb(e,t){var n=e.title,a=e.titleId,i=Ab(e,["title","titleId"]);return r.createElement("svg",Tb({width:"24px",height:"18px",viewBox:"0 0 24 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),void 0===n?r.createElement("title",{id:a},"icon/ID/card/new/zodiac"):n?r.createElement("title",{id:a},n):null,Mb)}var zb=r.forwardRef(Wb);n.p;function $b(){return($b=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function qb(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Hb=r.createElement("g",{id:"icon/ID/phone/new/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("path",{d:"M7.47150618,13.52898 C10.939556,16.9970298 14.7804112,17.1146315 16.4756355,16.9586292 C17.0220434,16.9090285 17.5308507,16.6578249 17.9188563,16.2698193 L20.0004862,14.1881894 L18.0220577,12.210561 L16.0436293,11.5505516 L14.7244104,12.8697705 C14.7244104,12.8697705 13.4059914,14.1881894 10.1091441,10.8905421 C6.81229671,7.59449473 8.13071565,6.27527578 8.13071565,6.27527578 L9.4499346,4.95605683 L8.78992512,2.97842842 L6.81229671,1 L4.73066681,3.0816299 C4.34186123,3.46963548 4.09145763,3.97844279 4.04105691,4.52485063 C3.88585468,6.22007499 4.00345637,10.0601301 7.47150618,13.52898 Z",id:"Stroke-1-Copy",stroke:"#FFFFFF",strokeWidth:1.6}));function Vb(e,t){var n=e.title,a=e.titleId,i=qb(e,["title","titleId"]);return r.createElement("svg",$b({width:"24px",height:"18px",viewBox:"0 0 24 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),void 0===n?r.createElement("title",{id:a},"icon/ID/phone/new/white"):n?r.createElement("title",{id:a},n):null,Hb)}var Ub=r.forwardRef(Vb);n.p;function Gb(){return(Gb=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Xb(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Yb=r.createElement("g",{id:"icon/ID/phone/new/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("path",{d:"M7.47150618,13.52898 C10.939556,16.9970298 14.7804112,17.1146315 16.4756355,16.9586292 C17.0220434,16.9090285 17.5308507,16.6578249 17.9188563,16.2698193 L20.0004862,14.1881894 L18.0220577,12.210561 L16.0436293,11.5505516 L14.7244104,12.8697705 C14.7244104,12.8697705 13.4059914,14.1881894 10.1091441,10.8905421 C6.81229671,7.59449473 8.13071565,6.27527578 8.13071565,6.27527578 L9.4499346,4.95605683 L8.78992512,2.97842842 L6.81229671,1 L4.73066681,3.0816299 C4.34186123,3.46963548 4.09145763,3.97844279 4.04105691,4.52485063 C3.88585468,6.22007499 4.00345637,10.0601301 7.47150618,13.52898 Z",id:"Stroke-1-Copy",stroke:"#1B2559",strokeWidth:1.6}));function _b(e,t){var n=e.title,a=e.titleId,i=Xb(e,["title","titleId"]);return r.createElement("svg",Gb({width:"24px",height:"18px",viewBox:"0 0 24 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),void 0===n?r.createElement("title",{id:a},"icon/ID/phone/new/zodiac"):n?r.createElement("title",{id:a},n):null,Yb)}var Zb=r.forwardRef(_b);n.p;function Kb(){return(Kb=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Qb(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Jb=r.createElement("g",{id:"icon/ID/photo/new/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("path",{d:"M12,14 C9.7912,14 8,12.2088 8,10 C8,7.7912 9.7912,6 12,6 C14.2088,6 16,7.7912 16,10 C16,12.2088 14.2088,14 12,14 Z M16.7142857,3.4 L14.3571429,1 L9.64285714,1 L7.28571429,3.4 L1,3.4 L1,17 L23,17 L23,3.4 L16.7142857,3.4 Z",id:"Stroke-1",stroke:"#FFFFFF",strokeWidth:1.6}));function ep(e,t){var n=e.title,a=e.titleId,i=Qb(e,["title","titleId"]);return r.createElement("svg",Kb({width:"24px",height:"18px",viewBox:"0 0 24 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),void 0===n?r.createElement("title",{id:a},"icon/ID/photo/new/white"):n?r.createElement("title",{id:a},n):null,Jb)}var tp=r.forwardRef(ep);n.p;function np(){return(np=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function rp(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var ap=r.createElement("g",{id:"icon/ID/photo/new/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("path",{d:"M12,14 C9.7912,14 8,12.2088 8,10 C8,7.7912 9.7912,6 12,6 C14.2088,6 16,7.7912 16,10 C16,12.2088 14.2088,14 12,14 Z M16.7142857,3.4 L14.3571429,1 L9.64285714,1 L7.28571429,3.4 L1,3.4 L1,17 L23,17 L23,3.4 L16.7142857,3.4 Z",id:"Stroke-1",stroke:"#1B2559",strokeWidth:1.6}));function ip(e,t){var n=e.title,a=e.titleId,i=rp(e,["title","titleId"]);return r.createElement("svg",np({width:"24px",height:"18px",viewBox:"0 0 24 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),void 0===n?r.createElement("title",{id:a},"icon/ID/photo/new/zodiac"):n?r.createElement("title",{id:a},n):null,ap)}var op=r.forwardRef(ip);n.p;function cp(){return(cp=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function lp(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var sp=r.createElement("desc",null,"Created with Sketch."),dp=r.createElement("g",{id:"icon/button/cancel/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("g",{id:"Group-5",stroke:"#1B2559",strokeWidth:1.2},r.createElement("line",{x1:12,y1:0,x2:0,y2:12,id:"Stroke-1"}),r.createElement("line",{x1:0,y1:0,x2:12,y2:12,id:"Stroke-3"})));function up(e,t){var n=e.title,a=e.titleId,i=lp(e,["title","titleId"]);return r.createElement("svg",cp({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,sp,dp)}var mp=r.forwardRef(up);n.p;function hp(){return(hp=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function bp(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var pp=r.createElement("desc",null,"Created with Sketch."),fp=r.createElement("g",{id:"icon/button/download/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("g",{id:"icon/sf-small/wizzard",stroke:"#FFFFFF"},r.createElement("polyline",{id:"Path-3",points:"3.6 5.4 6 7.8 8.4 5.4"}),r.createElement("line",{x1:6,y1:.5,x2:6,y2:7.4,id:"Path-4"}),r.createElement("path",{d:"M0,10 L0,10 C0,10.9942 0.8058,11.8 1.8,11.8 L10.2,11.8 C11.1942,11.8 12,10.9942 12,10",id:"Stroke-1"})));function jp(e,t){var n=e.title,a=e.titleId,i=bp(e,["title","titleId"]);return r.createElement("svg",hp({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,pp,fp)}var gp=r.forwardRef(jp);n.p;function Op(){return(Op=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function xp(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var vp=r.createElement("desc",null,"Created with Sketch."),yp=r.createElement("g",{id:"icon/button/download/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("g",{id:"icon/sf-small/wizzard",stroke:"#1B2559"},r.createElement("polyline",{id:"Path-3",points:"3.6 5.4 6 7.8 8.4 5.4"}),r.createElement("line",{x1:6,y1:.5,x2:6,y2:7.4,id:"Path-4"}),r.createElement("path",{d:"M0,10 L0,10 C0,10.9942 0.8058,11.8 1.8,11.8 L10.2,11.8 C11.1942,11.8 12,10.9942 12,10",id:"Stroke-1"})));function wp(e,t){var n=e.title,a=e.titleId,i=xp(e,["title","titleId"]);return r.createElement("svg",Op({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,vp,yp)}var Cp,kp,Sp,Np=r.forwardRef(wp),Ip=(n.p,n(83)),Ep=n(415),Fp=n(140),Lp=n(78),Pp=n(407),Dp=n(283),Bp="",Rp=function(e){var t=e.children,n=Object(w.h)(),a=Object(w.i)(),i=Object(r.useContext)(k),o=(i.userData,function(e,t,n,r,a){return new Fp.a({link:Lp.a.from([Object(Pp.a)((function(n){var a=n.graphQLErrors,i=n.networkError;a&&a.forEach((function(n){var a=n.message,i=n.locations,o=n.path,c=n.extensions;"UNAUTHENTICATED"===(null===c||void 0===c?void 0:c.code)&&(r(null),"/login"!==t.pathname&&e.push("/login")),console.log("[GraphQL error]: Message: ".concat(a,", Location: ").concat(i,", Path: ").concat(o))})),i&&console.log("[Network error]: ".concat(i))})),new Lp.a((function(e,t){return t(e).map((function(t){var n=e.getContext().response.headers;if(n){var r=n.get("lamassu_role");a(r)}return t}))})),Lp.a.split((function(e){return"pazuz"===e.getContext().clientName}),new Dp.a({credentials:"include",uri:"".concat("","/graphql")}),new Dp.a({credentials:"include",uri:"".concat(Bp,"/graphql")}))]),cache:new Ep.a,defaultOptions:{watchQuery:{fetchPolicy:"no-cache",errorPolicy:"ignore"},query:{fetchPolicy:"no-cache",errorPolicy:"all"},mutate:{errorPolicy:"all"}}})}(n,a,0,i.setUserData,i.setRole));return Object(Me.jsx)(Ip.a,{client:o,children:t})},Tp={wrapper:{display:"flex",flexDirection:"column",marginTop:24},row:{display:"flex",flexDirection:"row",marginBottom:36},secondRow:{display:"flex",flexDirection:"row",justifyContent:"space-between",marginBottom:36},lastRow:{display:"flex",flexDirection:"row",marginBottom:32},label:{color:se,margin:[[0,0,6,0]]},txIcon:{marginRight:10},clipboardPopover:{height:164,width:215},idButton:{marginRight:4},idCardDataCard:{extend:Re.p,display:"flex",padding:[[11,8]],"& > div":{display:"flex",flexDirection:"column","& > div":{width:144,height:37,marginBottom:15,"&:last-child":{marginBottom:0}}}},bold:{fontWeight:700},direction:{width:233},availableIds:{width:232},exchangeRate:{width:250},commission:{width:217},address:{width:280},downloadRawLogs:{width:180},cancelTransaction:{width:160},status:{width:230,"& > button":{marginTop:20}},transactionId:{width:280},sessionId:{width:215},container:{display:"flex"},chip:{display:"flex",alignItems:"center",padding:"4px 8px 4px 8px",backgroundColor:q,color:Z,height:24,marginBottom:-24,marginTop:-3,marginLeft:7,borderRadius:4},chipLabel:{color:Z},otherActionsGroup:{display:"flex",flexDirection:"row"}},Ap=function(e){return"cashOut"===e.txClass?function(e){return"Operator cancel"===e.hasError?"Cancelled":e.hasError?"Error":e.dispense?"Success":e.expired?"Expired":"Pending"}(e):function(e){return e.operatorCompleted?"Cancelled":e.hasError?"Error":e.sendConfirmed?"Sent":e.expired?"Expired":"Pending"}(e)},Mp=function(e){return e.hasError?e.hasError:null},Wp=Object(f.a)(Tp),zp=x()(Cp||(Cp=Object(l.a)(["\n query txSummaryAndLogs(\n $txId: ID!\n $deviceId: ID!\n $limit: Int\n $from: Date\n $until: Date\n $txClass: String\n $timezone: String\n ) {\n serverLogsCsv(\n limit: $limit\n from: $from\n until: $until\n timezone: $timezone\n )\n machineLogsCsv(\n deviceId: $deviceId\n limit: $limit\n from: $from\n until: $until\n timezone: $timezone\n )\n transactionCsv(id: $txId, txClass: $txClass, timezone: $timezone)\n txAssociatedDataCsv(id: $txId, txClass: $txClass, timezone: $timezone)\n }\n"]))),$p=x()(kp||(kp=Object(l.a)(["\n mutation cancelCashOutTransaction($id: ID!) {\n cancelCashOutTransaction(id: $id) {\n id\n }\n }\n"]))),qp=x()(Sp||(Sp=Object(l.a)(["\n mutation cancelCashInTransaction($id: ID!) {\n cancelCashInTransaction(id: $id) {\n id\n }\n }\n"]))),Hp=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return hb.utils.formatCryptoAddress(e,t).replace(/(.{5})/g,"$1 ")},Vp=function(e){var t=e.children,n=Wp();return Object(Me.jsx)(et,{className:n.label,children:t})},Up=function(e){var t=e.it,n=e.timezone,a=Wp(),i=Object(r.useState)({command:null}),o=Object(c.a)(i,2),l=o[0],s=o[1],d=Object(r.useState)(""),m=Object(c.a)(d,2),h=m[0],b=m[1],p="cashIn"===t.txClass,f=new xb.a,j=Object(u.a)(zp,{onCompleted:function(e){return L(e)}}),g=Object(c.a)(j,1)[0],O=Object(u.b)(p?qp:$p,{onError:function(e){var t=e.message;return b(null!==t&&void 0!==t?t:"An error occurred.")},refetchQueries:function(){return["transactions"]}}),x=Object(c.a)(O,1)[0],v=Number.parseFloat(t.fiat),y=hb.utils.toUnit(new al.a(t.cryptoAtoms),t.cryptoCode),w=Number.parseFloat(t.commissionPercentage,2),C=Number(v*w).toFixed(2),k=t.discount?"-".concat(t.discount,"%"):null,S=al()(v/y).toFormat(2),N="1 ".concat(t.cryptoCode," = ").concat(S," ").concat(t.fiatCode),I=t.customerIdCardData&&{name:"".concat(hu(t.customerIdCardData.firstName)," ").concat(hu(t.customerIdCardData.lastName)),age:Ll()().diff(Ll()(t.customerIdCardData.dateOfBirth),"years"),country:t.customerIdCardData.country,idCardNumber:t.customerIdCardData.documentNumber,idCardExpirationDate:Ll()(t.customerIdCardData.expirationDate).format("DD-MM-YYYY")},E=Ll()(t.created).subtract(3,"m").format(),F=Ll()(t.created).add(3,"m").format(),L=function(){var e=Object(nc.a)(tc.a.mark((function e(n){var r,a,i;return tc.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r="tx_".concat(t.id,"_summary.zip"),a=il.a(n),B.a((function(e){return f.file(e+".csv",n[e])}),a),e.next=5,f.generateAsync({type:"blob"});case 5:i=e.sent,gb.a.saveAs(i,r);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),P=Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Vp,{children:"Transaction status"}),Object(Me.jsx)("span",{className:a.bold,children:Ap(t)})]});return Object(Me.jsxs)("div",{className:a.wrapper,children:[Object(Me.jsxs)("div",{className:a.row,children:[Object(Me.jsxs)("div",{className:a.direction,children:[Object(Me.jsx)(Vp,{children:"Direction"}),Object(Me.jsxs)("div",{children:[Object(Me.jsx)("span",{className:a.txIcon,children:p?Object(Me.jsx)(Yc,{}):Object(Me.jsx)(tl,{})}),Object(Me.jsx)("span",{children:p?"Cash-in":"Cash-out"})]})]}),Object(Me.jsxs)("div",{className:a.availableIds,children:[Object(Me.jsx)(Vp,{children:"Available IDs"}),Object(Me.jsxs)(No.a,{display:"flex",flexDirection:"row",children:[t.customerPhone&&Object(Me.jsx)(Qn,{className:a.idButton,name:"phone",Icon:Zb,InverseIcon:Ub,children:t.customerPhone}),t.customerIdCardPhotoPath&&!t.customerIdCardData&&Object(Me.jsx)(Qn,{popoverClassname:a.clipboardPopover,className:a.idButton,name:"card",Icon:zb,InverseIcon:Rb,children:Object(Me.jsx)("img",{className:a.idCardPhoto,src:"".concat(Bp,"/id-card-photo/").concat(t.customerIdCardPhotoPath),alt:""})}),t.customerIdCardData&&Object(Me.jsx)(Qn,{className:a.idButton,name:"card",Icon:zb,InverseIcon:Rb,children:Object(Me.jsxs)("div",{className:a.idCardDataCard,children:[Object(Me.jsxs)("div",{children:[Object(Me.jsxs)("div",{children:[Object(Me.jsx)(Vp,{children:"Name"}),Object(Me.jsx)("div",{children:I.name})]}),Object(Me.jsxs)("div",{children:[Object(Me.jsx)(Vp,{children:"Age"}),Object(Me.jsx)("div",{children:I.age})]}),Object(Me.jsxs)("div",{children:[Object(Me.jsx)(Vp,{children:"Country"}),Object(Me.jsx)("div",{children:I.country})]})]}),Object(Me.jsxs)("div",{children:[Object(Me.jsxs)("div",{children:[Object(Me.jsx)(Vp,{children:"ID number"}),Object(Me.jsx)("div",{children:I.idCardNumber})]}),Object(Me.jsxs)("div",{children:[Object(Me.jsx)(Vp,{children:"Expiration date"}),Object(Me.jsx)("div",{children:I.idCardExpirationDate})]})]})]})}),t.customerFrontCameraPath&&Object(Me.jsx)(Qn,{name:"cam",Icon:op,InverseIcon:tp,children:Object(Me.jsx)("img",{src:"".concat(Bp,"/front-camera-photo/").concat(t.customerFrontCameraPath),alt:""})})]})]}),Object(Me.jsxs)("div",{className:a.exchangeRate,children:[Object(Me.jsx)(Vp,{children:"Exchange rate"}),Object(Me.jsx)("div",{children:y>0?N:"-"})]}),Object(Me.jsxs)("div",{className:a.commission,children:[Object(Me.jsx)(Vp,{children:"Commission"}),Object(Me.jsxs)("div",{className:a.container,children:["".concat(C," ").concat(t.fiatCode," (").concat(100*w," %)"),k&&Object(Me.jsx)("div",{className:a.chip,children:Object(Me.jsx)(et,{className:a.chipLabel,children:k})})]})]}),Object(Me.jsxs)("div",{children:[Object(Me.jsx)(Vp,{children:"Fixed fee"}),Object(Me.jsx)("div",{children:p?"".concat(Number.parseFloat(t.cashInFee)," ").concat(t.fiatCode):"N/A"})]})]}),Object(Me.jsxs)("div",{className:a.secondRow,children:[Object(Me.jsxs)("div",{className:a.address,children:[Object(Me.jsx)(Vp,{children:"Address"}),Object(Me.jsx)("div",{children:Object(Me.jsx)(sb,{children:Hp(t.cryptoCode,t.toAddress)})})]}),Object(Me.jsxs)("div",{className:a.transactionId,children:[Object(Me.jsx)(Vp,{children:"Transaction ID"}),Object(Me.jsx)("div",{children:"cashOut"===t.txClass?"N/A":Object(Me.jsx)(sb,{children:t.txHash})})]}),Object(Me.jsxs)("div",{className:a.sessionId,children:[Object(Me.jsx)(Vp,{children:"Session ID"}),Object(Me.jsx)(sb,{children:t.id})]})]}),Object(Me.jsxs)("div",{className:a.lastRow,children:[Object(Me.jsxs)("div",{className:a.status,children:[Mp(t)?Object(Me.jsx)(Fb,{parentElements:P,width:200,children:Object(Me.jsx)(Xe,{children:Mp(t)})}):P,"Pending"===Ap(t)&&Object(Me.jsx)(ze,{color:"primary",Icon:mp,InverseIcon:pr,className:a.cancelTransaction,onClick:function(){return s({command:"cancelTx"})},children:"Cancel transaction"})]}),Object(Me.jsxs)("div",{children:[Object(Me.jsx)(Vp,{children:"Other actions"}),Object(Me.jsx)("div",{className:a.otherActionsGroup,children:Object(Me.jsx)(ze,{color:"primary",Icon:Np,InverseIcon:gp,className:a.downloadRawLogs,onClick:function(){return function(e,t){var n=e.id,r=e.deviceId,a=e.txClass;g({variables:{txId:n,from:E,until:F,deviceId:r,txClass:a,timezone:t}})}(t,n)},children:"Download raw logs"})})]})]}),Object(Me.jsx)(Gm,{open:"cancelTx"===l.command,title:"Cancel this transaction?",errorMessage:h,toBeConfirmed:t.machineName,message:p?"The user will not be able to redeem the inserted bills, even if they subsequently confirm the transaction. If they've already deposited bills, you'll need to reconcile this transaction with them manually.":"The user will not be able to redeem the cash, even if they subsequently send the required coins. If they've already sent you coins, you'll need to reconcile this transaction with them manually.",onConfirmed:function(){b(null),s({command:null}),x({variables:{id:t.id}})},onDismissed:function(){s({command:null}),b(null)}})]})},Gp=Object(r.memo)(Up,(function(e,t){return e.it.id===t.it.id&&Ap(e.it)===Ap(t.it)})),Xp=n(117),Yp={expandButton:{outline:"none",border:"none",backgroundColor:"transparent",cursor:"pointer",padding:4},rowWrapper:{padding:1},row:{border:[[2,"solid","transparent"]],borderRadius:0},expanded:{border:[[2,"solid",G]],boxShadow:"0 0 8px 0 rgba(0,0,0,0.08)"},before:{paddingTop:12},after:{paddingBottom:12},pointer:{cursor:"pointer"},body:{flex:[[1,1,"auto"]]},table:function(e){return{marginBottom:30,minHeight:200,width:e.width,flex:1,display:"flex",flexDirection:"column"}},emptyTable:{width:"100%",display:"flex",flexDirection:"column",alignItems:"center",marginTop:52}};function _p(){return(_p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Zp(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Kp=r.createElement("desc",null,"Created with Sketch."),Qp=r.createElement("g",{id:"Styleguide",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"icon/action/expand/closed",transform:"translate(1.000000, 1.000000)",stroke:"#1B2559",strokeWidth:1.5},r.createElement("circle",{id:"Oval-4",cx:14,cy:2,r:2}),r.createElement("circle",{id:"Oval-4-Copy",cx:8,cy:2,r:2}),r.createElement("circle",{id:"Oval-4-Copy-2",cx:2,cy:2,r:2})));function Jp(e,t){var n=e.title,a=e.titleId,i=Zp(e,["title","titleId"]);return r.createElement("svg",_p({width:"18px",height:"6px",viewBox:"0 0 18 6",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Kp,Qp)}var ef=r.forwardRef(Jp);n.p;function tf(){return(tf=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function nf(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var rf=r.createElement("desc",null,"Created with Sketch."),af=r.createElement("g",{id:"Styleguide",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"icon/action/expand/open",transform:"translate(1.000000, 1.000000)",fill:"#1B2559",stroke:"#1B2559",strokeWidth:1.5},r.createElement("circle",{id:"Oval-4",cx:14,cy:2,r:2}),r.createElement("circle",{id:"Oval-4-Copy",cx:8,cy:2,r:2}),r.createElement("circle",{id:"Oval-4-Copy-2",cx:2,cy:2,r:2})));function of(e,t){var n=e.title,a=e.titleId,i=nf(e,["title","titleId"]);return r.createElement("svg",tf({width:"18px",height:"6px",viewBox:"0 0 18 6",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,rf,af)}var cf,lf,sf,df,uf=r.forwardRef(of),mf=(n.p,Object(f.a)(Yp)),hf=function(e){var t,n=e.id,r=e.elements,a=e.data,i=e.width,o=e.Details,c=e.expanded,l=e.expandRow,d=e.expWidth,u=e.expandable,m=e.onClick,h=mf(),b=m||u,p=(t={},Object(z.a)(t,h.pointer,b),Object(z.a)(t,h.row,!0),Object(z.a)(t,h.expanded,c),t);return Object(Me.jsxs)("div",{className:h.rowWrapper,children:[Object(Me.jsx)("div",{className:E()(Object(z.a)({},h.before,c&&0!==n)),children:Object(Me.jsxs)(au,{className:E()(p),onClick:function(){u&&l(n),m&&m(a)},error:a.error,errorMessage:a.errorMessage,children:[r.map((function(e,t){var n=e.view,r=void 0===n?function(e){return null===e||void 0===e?void 0:e.toString()}:n,i=Object($.a)(e,["view"]);return Object(Me.jsx)(tu,Object(s.a)(Object(s.a)({},i),{},{children:r(a)}),t)})),u&&Object(Me.jsx)(tu,{width:d,textAlign:"center",children:Object(Me.jsxs)("button",{onClick:function(){return l(n)},className:h.expandButton,children:[c&&Object(Me.jsx)(uf,{}),!c&&Object(Me.jsx)(ef,{})]})})]})}),u&&c&&Object(Me.jsx)("div",{className:h.after,children:Object(Me.jsx)(au,{className:E()(Object(z.a)({},h.expanded,c)),children:Object(Me.jsx)(tu,{width:i,children:Object(Me.jsx)(o,{it:a})})})})]})},bf=function(e){var t=e.elements,n=void 0===t?[]:t,a=e.data,i=void 0===a?[]:a,o=e.Details,l=(e.className,e.expandable),d=e.initialExpanded,u=e.onClick,m=e.loading,h=e.emptyText,b=e.extraHeight,p=Object($.a)(e,["elements","data","Details","className","expandable","initialExpanded","onClick","loading","emptyText","extraHeight"]),f=Object(r.useState)(d),j=Object(c.a)(f,2),g=j[0],O=j[1];Object(r.useEffect)((function(){return O(d)}),[d]);var x=L.a(Pl.a,B.a(R.a("width")))(n),v=850-x,y=x+(l?v:0),w=mf({width:y}),C=function(e){O(e===g?null:e)},k=new Xp.c({defaultHeight:62,fixedWidth:!0});function S(e){var t=e.index,r=e.key,a=e.parent,c=e.style;return Object(Me.jsx)(Xp.b,{cache:k,columnIndex:0,parent:a,rowIndex:t,children:Object(Me.jsx)("div",{style:c,children:Object(Me.jsx)(hf,{width:y,id:t,expWidth:v,elements:n,data:i[t],Details:o,expanded:t===g,expandRow:C,expandable:l,onClick:u})})},r)}return Object(Me.jsx)(No.a,{display:"flex",flex:"1",flexDirection:"column",children:Object(Me.jsxs)(Kd,{className:w.table,children:[Object(Me.jsxs)(Qd,{children:[n.map((function(e,t){var n=e.width,r=e.className,a=e.textAlign,i=e.header;return Object(Me.jsx)(nu,{width:n,className:r,textAlign:a,children:i},t)})),l&&Object(Me.jsx)(nu,{width:v})]}),Object(Me.jsxs)(eu,{className:w.body,children:[m&&Object(Me.jsx)(Ue,{children:"Loading..."}),!m&&Wr.a(i)&&Object(Me.jsx)(Ue,{children:h}),Object(Me.jsx)(Xp.a,{disableWidth:!0,disableHeight:!0,children:function(){return Object(Me.jsx)(Xp.d,Object(s.a)(Object(s.a)({style:{overflowX:"inherit",outline:"none"}},p),{},{height:62*i.length+b,width:y,rowCount:i.length,rowHeight:k.rowHeight,rowRenderer:S,overscanRowCount:50,deferredMeasurementCache:k}))}})]})]})})},pf=Object(f.a)(cb),ff=x()(cf||(cf=Object(l.a)(["\n query transactions($limit: Int, $from: Date, $until: Date, $deviceId: ID) {\n transactions(\n limit: $limit\n from: $from\n until: $until\n deviceId: $deviceId\n ) {\n id\n txClass\n txHash\n toAddress\n commissionPercentage\n expired\n machineName\n operatorCompleted\n sendConfirmed\n dispense\n hasError: error\n deviceId\n fiat\n cashInFee\n fiatCode\n cryptoAtoms\n cryptoCode\n toAddress\n created\n customerName\n customerIdCardData\n customerIdCardPhotoPath\n customerFrontCameraPath\n customerPhone\n discount\n customerId\n isAnonymous\n }\n }\n"]))),jf=function(e){var t=e.id,n=pf(),a=Object(r.useState)(0),i=Object(c.a)(a,2),o=i[0],l=i[1],s=Object(r.useState)(""),d=Object(c.a)(s,2),m=d[0],h=d[1],b=Object(u.a)(ff,{variables:{limit:5,deviceId:t}}),p=Object(c.a)(b,2),f=p[0],j=p[1],g=j.data,O=j.loading;!O&&g&&(g.transactions=g.transactions.splice(0,5)),Object(r.useEffect)((function(){null!==t&&f()}),[f,t]);var x=[{header:"",width:0,size:"sm",view:function(e){return"cashOut"===e.txClass?Object(Me.jsx)(tl,{}):Object(Me.jsx)(Yc,{})}},{header:"Customer",width:122,size:"sm",view:function(e){return e.customerName?e.customerName:e.customerIdCardData?function(e){var t=e.firstName,n=e.lastName;return"".concat(bb.a(pb.a,fb.a)(t),". ").concat(n)}(e.customerIdCardData):e.customerPhone}},{header:"Cash",width:144,textAlign:"right",size:"sm",view:function(e){return"".concat(Number.parseFloat(e.fiat)," ").concat(e.fiatCode)}},{header:"Crypto",width:164,textAlign:"right",size:"sm",view:function(e){return"".concat(hb.utils.toUnit(new al.a(e.cryptoAtoms),e.cryptoCode).toFormat(5)," ").concat(e.cryptoCode)}},{header:"Address",view:function(e){return hb.utils.formatCryptoAddress(e.cryptoCode,e.toAddress)},className:n.overflowTd,size:"sm",textAlign:"left",width:140},{header:"Date (UTC)",view:function(e){return Ll.a.utc(e.created).format("YYYY-MM-DD")},textAlign:"left",size:"sm",width:140},{header:"Status",view:function(e){return Ap(e)},size:"sm",width:20}];return Object(Me.jsx)(bf,{extraHeight:o,onClick:function(e){m===e.id?(h(""),l(0)):(h(e.id),l(310))},loading:O||null===t,emptyText:"No transactions so far",elements:x,data:A.a(["transactions"])(g),Details:Gp,expandable:!0})},gf=Object(f.a)(zm),Of=x()(lf||(lf=Object(l.a)(["\n query getMachine($deviceId: ID!) {\n machine(deviceId: $deviceId) {\n name\n deviceId\n paired\n lastPing\n pairedAt\n version\n model\n cashbox\n cassette1\n cassette2\n statuses {\n label\n type\n }\n downloadSpeed\n responseTime\n packetLoss\n latestEvent {\n note\n }\n }\n config\n }\n"]))),xf=function(e){return e.slice(e.lastIndexOf("/")+1)},vf=function(){var e,t,n,r,a,i=Object(w.i)(),o=Object(u.c)(Of,{variables:{deviceId:xf(i.pathname)}}),c=o.data,l=o.refetch,s=gf(),d=null!==(e=A.a(["config","locale_timezone"],c))&&void 0!==e?e:{},m=null!==(t=A.a(["machine"])(c))&&void 0!==t?t:{},b=null!==(n=A.a(["config"])(c))&&void 0!==n?n:{},p=null!==(r=A.a(["name"])(m))&&void 0!==r?r:null,f=null!==(a=A.a(["deviceId"])(m))&&void 0!==a?a:null;return Object(Me.jsxs)(h.a,{container:!0,className:s.grid,children:[Object(Me.jsxs)(h.a,{item:!0,xs:3,children:[Object(Me.jsx)(h.a,{item:!0,xs:12,children:Object(Me.jsxs)("div",{className:s.breadcrumbsContainer,children:[Object(Me.jsxs)(Dd.a,{separator:Object(Me.jsx)(Rd.a,{fontSize:"small"}),children:[Object(Me.jsx)(C.b,{to:"/dashboard",className:s.breadcrumbLink,children:Object(Me.jsx)(nt,{noMargin:!0,className:s.subtitle,children:"Dashboard"})}),Object(Me.jsx)(Je,{noMargin:!0,className:s.subtitle,children:p})]}),Object(Me.jsx)(mb,{data:m,onActionSuccess:l})]})}),Object(Me.jsx)(h.a,{item:!0,xs:12})]}),Object(Me.jsx)(h.a,{item:!0,xs:9,children:Object(Me.jsxs)("div",{className:s.content,children:[Object(Me.jsxs)("div",{className:E()(s.detailItem,s.detailsMargin),children:[Object(Me.jsx)(Qe,{className:s.subtitle,children:"Details"}),Object(Me.jsx)(qm,{data:m,timezone:d})]}),Object(Me.jsxs)("div",{className:s.detailItem,children:[Object(Me.jsx)(Qe,{className:s.subtitle,children:"Cash cassettes"}),Object(Me.jsx)(wm,{refetchData:l,machine:m,config:null!==b&&void 0!==b&&b})]}),Object(Me.jsxs)("div",{className:s.transactionsItem,children:[Object(Me.jsx)(Qe,{className:s.subtitle,children:"Latest transactions"}),Object(Me.jsx)(jf,{id:f})]}),Object(Me.jsxs)("div",{className:s.detailItem,children:[Object(Me.jsx)(Qe,{className:s.subtitle,children:"Commissions"}),Object(Me.jsx)(Lm,{name:"commissions",id:f})]})]})})]})},yf=n(394),wf=n(72),Cf=n.n(wf),kf=n(821),Sf=n(822),Nf=n(230),If=n(824),Ef=n(825),Ff={AUD:{5:130,10:137,20:144,50:151,100:158},BBD:{2:150,5:150,10:150,20:150,50:150,100:150},CAD:{5:152,10:152,20:152,50:152,100:152},CHF:{10:126,20:137,50:148,100:159,200:170,1e3:181},DKK:{50:125,100:135,200:145,500:155,1e3:165},EUR:{5:120,10:127,20:133,50:140,100:147,200:153,500:160},GBP:{5:135,10:142,20:149,50:156},HKD:{10:134,20:143,50:148,100:153,500:158,1e3:163},HUF:{200:154,500:154,1e3:154,2e3:154,5e3:154,1e4:154,2e4:154},ILS:{20:129,50:136,100:143,200:150},JMD:{50:145,100:145,500:145,1e3:145,5e3:145},JPY:{1e3:150,2e3:154,5e3:156,1e4:160},KZT:{200:126,500:130,1e3:134,2e3:139,5e3:144,1e4:155,2e4:155},MXN:{20:120,50:127,100:134,200:141,500:148,1e3:155},MYR:{1:120,5:135,10:140,20:145,50:145,100:150},NZD:{5:135,10:140,20:145,50:150,100:155},PHP:{20:160,50:160,100:160,200:160,500:160,1e3:160},PLN:{10:120,20:126,50:132,100:138,200:144,500:150},SGD:{2:126,5:133,10:141,50:156,100:162,1e3:170},TWD:{100:145,200:150,500:155,1e3:160,2e3:165},UAH:{1:118,2:118,5:118,10:124,20:130,50:136,100:142,200:148,500:154},USD:{1:156,5:156,10:156,20:156,50:156,100:156},VND:{1e4:132,2e4:136,5e4:140,1e5:144,2e5:148,5e5:152},ZAR:{10:128,20:134,50:140,100:146,200:152}},Lf=ol.a((function(e,t){var n=R.a("fiatCurrency")(e);return L.a(B.a((function(e){return{code:parseInt(e),display:e}})),il.a,A.a([n]))(t)})),Pf=9999999,Df={name:"All Machines",deviceId:"ALL_MACHINES"},Bf={display:"All Coins",code:"ALL_COINS"},Rf={marginLeft:6},Tf=Object(Me.jsxs)("div",{children:[Object(Me.jsx)(Yc,{}),Object(Me.jsx)("span",{style:Rf,children:"Cash-in"})]}),Af=Object(Me.jsxs)("div",{children:[Object(Me.jsx)(tl,{}),Object(Me.jsx)("span",{style:Rf,children:"Cash-out"})]}),Mf=function(e,t,n){return function(r){if(!e)return"";var a=Ar.a(W.a(null!==n&&void 0!==n?n:"code",r))(e);return a?R.a(t,a):"Unpaired machine"}},Wf=function(e){return function(t){return t?L.a(kf.a(", "),B.a(Mf(e,"display")))(t):t}},zf=function(e,t,n){var r=F.a(Bf.code)(t),a=F.a(Bf.code)(e);return r&&a&&gn.a(t)>1?n(zd.a(hs.a(Bf.code))(t)):r&&!a?n([Bf.code]):void n(t)},$f=function(e){return[{header:Tf,name:"cashIn",display:"Cash-in",width:169,size:"lg",editingAlign:"right",input:qa,suffix:"%",bold:Vr,inputProps:{decimalPlaces:3}},{header:Af,name:"cashOut",display:"Cash-out",width:169,size:"lg",editingAlign:"right",input:qa,suffix:"%",bold:Vr,inputProps:{decimalPlaces:3}},{name:"fixedFee",display:"Fixed fee",width:169,size:"lg",doubleHeader:"Cash-in only",textAlign:"center",editingAlign:"right",input:qa,suffix:e,bold:Vr,inputProps:{decimalPlaces:2}},{name:"minimumTx",display:"Minimun Tx",width:169,size:"lg",doubleHeader:"Cash-in only",textAlign:"center",editingAlign:"right",input:qa,suffix:e,bold:Vr,inputProps:{decimalPlaces:2}}]},qf=function(e,t,n){return function(e,t,n){var r=[Df].concat(e(["machines"])),a=e(["cryptoCurrencies"]),i=[Bf].concat(B.a((function(e){return{display:e.code,code:e.code}}))(null!==a&&void 0!==a?a:[]));return[{name:"machine",width:196,size:"sm",view:Mf(r,"name","deviceId"),input:ka,inputProps:{options:r,valueProp:"deviceId",labelProp:"name"}},{name:"cryptoCurrencies",width:280,size:"sm",view:Wf(i),input:ka,inputProps:{options:i,valueProp:"code",labelProp:"display",multiple:!0,onChange:zf,shouldStayOpen:!0}},{header:Tf,name:"cashIn",display:"Cash-in",width:130,input:qa,textAlign:"right",suffix:"%",bold:Vr,inputProps:{decimalPlaces:3}},{header:Af,name:"cashOut",display:"Cash-out",width:130,input:qa,textAlign:"right",suffix:"%",bold:Vr,inputProps:{decimalPlaces:3}},{name:"fixedFee",display:"Fixed fee",width:144,input:qa,doubleHeader:"Cash-in only",textAlign:"right",suffix:t,bold:Vr,inputProps:{decimalPlaces:2}},{name:"minimumTx",display:"Minimun Tx",width:169,size:"lg",doubleHeader:"Cash-in only",textAlign:"center",editingAlign:"right",input:qa,suffix:t,bold:Vr,inputProps:{decimalPlaces:2}}]}(A.a(Sf.a,e),t)},Hf=100,Vf=function(e){var t=Lf(e,Ff).map((function(e){return parseInt(e.code)})),n=Wr.a(t)?Pf:Math.max.apply(Math,Object(d.a)(t));return xn.e().shape({cashIn:xn.d().label("Cash-in").min(0).max(Hf).required(),cashOut:xn.d().label("Cash-out").min(0).max(Hf).required(),fixedFee:xn.d().label("Fixed Fee").min(0).max(n).required(),minimumTx:xn.d().label("Minimum Tx").min(0).max(n).required()})},Uf=function(e,t,n){var r=A.a(Sf.a,t),a=[Df].concat(r(["machines"])),i=r(["cryptoCurrencies"]),o=[Bf].concat(B.a((function(e){return{display:e.code,code:e.code}}))(null!==i&&void 0!==i?i:[])),c=Lf(n,Ff).map((function(e){return parseInt(e.code)})),l=Wr.a(c)?Pf:Math.max.apply(Math,Object(d.a)(c));return xn.e().shape({machine:xn.g().nullable().label("Machine").required(),cryptoCurrencies:xn.a().test({test:function(){var t=this.parent,n=t.id,r=t.machine,i=t.cryptoCurrencies,c=function(e,t,n){var r=R.a("cryptoCurrencies"),a=R.a("machine"),i=M.a(W.a("machine",t))(n),o=Ar.a(W.a("id",e))(n),c=r(o),l=a(o),s=L.a(Nf.a,Ao.a,B.a(r))(i);return t!==l?null!==s&&void 0!==s?s:[]:If.a(s,c)}(n,r,e),l=r===Df.deviceId,s=F.a(Bf.code,i);if(l&&s)return this.createError({message:"All machines and all coins should be configured in the default setup table"});var d=Ef.a(c,i);if(!Wr.a(d)){var u=Wf(o)(d),m=Mf(a,"name","deviceId")(r),h="".concat(u," already overriden for machine: ").concat(m);return this.createError({message:h})}return!0}}).label("Crypto Currencies").required().min(1),cashIn:xn.d().label("Cash-in").min(0).max(Hf).required(),cashOut:xn.d().label("Cash-out").min(0).max(Hf).required(),fixedFee:xn.d().label("Fixed Fee").min(0).max(l).required(),minimumTx:xn.d().label("Minimum Tx").min(0).max(l).required()})},Gf={cashIn:"",cashOut:"",fixedFee:"",minimumTx:""},Xf={machine:null,cryptoCurrencies:[],cashIn:"",cashOut:"",fixedFee:"",minimumTx:""},Yf=function(e){var t=e.machine,n=e.cryptoCurrencies,r=t===Df.deviceId,a=qo.a(Bf.code,n);return r&&a?0:r?1:a?2:3},_f=function(e,t,n,r){return{minimumTx:r.minimumTx,fixedFee:r.fixedFee,cashOut:r.cashOut,cashIn:r.cashIn,machine:t,cryptoCurrencies:[e],default:n,id:Object(qd.a)()}},Zf=function(e){var t=Lf(e,Ff).map((function(e){return parseInt(e.code)})),n=Wr.a(t)?Pf:Math.max.apply(Math,Object(d.a)(t));return xn.e().shape({machine:xn.g().label("Machine").required(),cryptoCurrencies:xn.a().label("Crypto Currency").required().min(1),cashIn:xn.d().label("Cash-in").min(0).max(Hf).required(),cashOut:xn.d().label("Cash-out").min(0).max(Hf).required(),fixedFee:xn.d().label("Fixed Fee").min(0).max(n).required(),minimumTx:xn.d().label("Minimum Tx").min(0).max(n).required()})},Kf=function(e,t){return{color:e.default?J:te}},Qf=function(e,t,n){var r=A.a(Sf.a,e);return Jf(r,t,Gf)},Jf=function(e,t,n){var r=[Df].concat(e(["machines"]));return[{name:"machine",width:196,size:"sm",view:Mf(r,"name","deviceId"),editable:!1},{name:"cryptoCurrencies",display:"Crypto Currency",width:265,view:R.a(0),size:"sm",editable:!1},{header:Tf,name:"cashIn",display:"Cash-in",width:130,input:qa,textAlign:"right",suffix:"%",textStyle:function(e){return Kf(e)},inputProps:{decimalPlaces:3}},{header:Af,name:"cashOut",display:"Cash-out",width:130,input:qa,textAlign:"right",greenText:!0,suffix:"%",textStyle:function(e){return Kf(e)},inputProps:{decimalPlaces:3}},{name:"fixedFee",display:"Fixed fee",width:144,input:qa,doubleHeader:"Cash-in only",textAlign:"right",suffix:t,textStyle:function(e){return Kf(e)},inputProps:{decimalPlaces:2}},{name:"minimumTx",display:"Minimun Tx",width:144,input:qa,doubleHeader:"Cash-in only",textAlign:"right",suffix:t,textStyle:function(e){return Kf(e)},inputProps:{decimalPlaces:2}}]},ej=n(410),tj=n(827),nj=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return M.a((function(e){return F.a(e.name,t)}),rj(e,n,r))},rj=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=function(e,t,n){return function(r){return e?L.a(R.a(t),Ar.a(W.a(null!==n&&void 0!==n?n:"code",r)))(e):""}},a=function(e){return function(t){return t?L.a(kf.a(", "),B.a(r(e,"code")))(t):t}},i=B.a((function(e){return e.machine}),n),o=function(e){return tj.a((function(e,t){return e.deviceId===t}),e,i)},c=e(["machines"]),l=e(["countries"]),s=e(["currencies"]),d=e(["languages"]),u=e(["cryptoCurrencies"]),m=ts.a(ej.getAllTimezones()),h=Am(m),b=function(e){var t=Ar.a(W.a("deviceId",e.machine))(c);return t?[t]:[]};return[{name:"machine",width:200,size:"sm",view:r(c,"name","deviceId"),input:ka,inputProps:{options:function(e){return Mo.a(b(e))(o(c))},valueProp:"deviceId",labelProp:"name"}},{name:"country",width:200,size:"sm",view:r(l,"display"),input:ka,inputProps:{options:l,valueProp:"code",labelProp:"display"}},{name:"fiatCurrency",width:150,size:"sm",view:r(s,"code"),input:ka,inputProps:{options:s,valueProp:"code",labelProp:"code"}},{name:"languages",width:200,size:"sm",view:a(d),input:ka,inputProps:{options:d,valueProp:"code",labelProp:"display",multiple:!0}},{name:"cryptoCurrencies",width:170,size:"sm",view:a(u),input:ka,inputProps:{options:u,valueProp:"code",labelProp:"code",multiple:!0,optionsLimit:null,onChange:t}},{name:"timezone",width:320,size:"sm",view:r(h,"label"),input:ka,inputProps:{options:h,valueProp:"code",labelProp:"label"}}]},aj=function(e,t){var n=A.a(Sf.a,e);return nj(n,["country","fiatCurrency","languages","cryptoCurrencies","timezone"],t)},ij=function(e,t,n){var r=A.a(Sf.a,e);return nj(r,["machine","country","languages","cryptoCurrencies"],n,t)},oj=xn.e().shape({country:xn.g().label("Country").required(),fiatCurrency:xn.g().label("Fiat Currency").required(),languages:xn.a().label("Languages").required().min(1).max(4),cryptoCurrencies:xn.a().label("Crypto Currencies").required().min(1),timezone:xn.g().label("Timezone").required()}),cj=xn.e().shape({machine:xn.g().label("Machine").required(),country:xn.g().label("Country").required(),languages:xn.a().label("Languages").required().min(1).max(4),cryptoCurrencies:xn.a().label("Crypto Currencies").required().min(1)}),lj={country:"",fiatCurrency:"",languages:[],cryptoCurrencies:[],timezone:""},sj={machine:"",country:"",languages:[],cryptoCurrencies:[]},dj=n(873),uj=n(829),mj=n(830),hj=dj.a(uj.a(Number),mj.a(hs.a(NaN))),bj=function(e){return hj(e)?e:null},pj={editDisabled:{color:oe}},fj=function(e){return M.a((function(t){return t.class===e}))},jj=function(e){var t=e.id;return M.a((function(e){return qo.a(t)(e.cryptos)}))},gj=xn.e().shape({ticker:xn.g().required(),wallet:xn.g().required(),exchange:xn.g().required(),zeroConf:xn.g().required(),zeroConfLimit:xn.d().integer().required("Zero Conf Limit is a required field").min(0).max(Pf).transform(bj)}),Oj=xn.e().shape({cryptoUnits:xn.g().required()}),xj=function(e,t){var n=ol.a((function(e,t){var n=il.a(e.getCryptoCurrency(t.id).units);return B.a((function(e){return{code:e,display:e}}))(n)}));return[{name:"id",header:"Cryptocurrency",width:180,view:function(t){return L.a(R.a(["display"]),Ar.a(W.a("code",t)))(e)},size:"sm",editable:!1},{name:"cryptoUnits",size:"sm",stripe:!0,width:190,input:ka,inputProps:{options:n(t),valueProp:"code",labelProp:"display"}}]},vj=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=r?11:0,i=function(t){return L.a(R.a(["display"]),Ar.a(W.a("code",t)))(e)},o=function(e){return fj(e)(t||[])},c=function(e){return function(t){return L.a(R.a("display"),Ar.a(W.a("code",t)))(o(e))}},l=ol.a((function(e,t){return jj(t)(o(e))}));return[{name:"id",header:"Cryptocurrency",width:150-a,view:i,size:"sm",editable:!1},{name:"ticker",size:"sm",stripe:!0,view:c("ticker"),width:175-a,input:ka,inputProps:{options:l("ticker"),valueProp:"code",labelProp:"display",optionsLimit:null}},{name:"wallet",size:"sm",stripe:!0,view:c("wallet"),width:175-a,input:ka,inputProps:{options:l("wallet"),valueProp:"code",labelProp:"display",optionsLimit:null,onChange:n}},{name:"exchange",size:"sm",stripe:!0,view:c("exchange"),width:175-a,input:ka,inputProps:{options:l("exchange"),valueProp:"code",labelProp:"display",optionsLimit:null,onChange:n}},{name:"zeroConf",header:"Confidence Checking",size:"sm",stripe:!0,view:c("zeroConf"),input:ka,width:210-a,inputProps:{options:l("zeroConf"),valueProp:"code",labelProp:"display",optionsLimit:null,onChange:n}},{name:"zeroConfLimit",header:"0-conf Limit",size:"sm",stripe:!0,view:function(e,t){return"ETH"===t.id?Object(Me.jsx)("span",{style:pj.editDisabled,children:e}):e},input:qa,width:145-a,inputProps:{decimalPlaces:0},editable:function(e){return"ETH"!==e.id}}]},yj=Object(f.a)({subtitle:{color:se,marginTop:16,marginBottom:16},extraMarginTop:{marginTop:72}}),wj=Object(r.memo)((function(e){var t,n=e.children,r=e.className,a=e.extraMarginTop,i=yj(),o=(t={},Object(z.a)(t,i.subtitle,!0),Object(z.a)(t,i.extraMarginTop,a),t);return Object(Me.jsx)(Qe,{className:E()(o,r),children:n})})),Cj=Object(f.a)({section:{marginBottom:72},sectionHeader:{display:"flex",alignItems:"center"},sectionTitle:{margin:[[16,20,23,0]]}}),kj=function(e){var t=e.error,n=e.children,r=e.title,a=Cj();return Object(Me.jsxs)("div",{className:a.section,children:[(r||t)&&Object(Me.jsxs)("div",{className:a.sectionHeader,children:[Object(Me.jsx)(wj,{className:a.sectionTitle,children:r}),t&&Object(Me.jsx)(Fo,{children:"Failed to save changes"})]}),n]})},Sj=Object(f.a)(Ei),Nj=Object(f.a)({autoComplete:{width:"100%"}}),Ij=x()(sf||(sf=Object(l.a)(["\n query getData {\n config\n }\n"]))),Ej=x()(df||(df=Object(l.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"])));var Fj,Lj,Pj=function(e){var t=e.isActive,n=e.doContinue,r=Sj(),a=(Nj(),Object(u.c)(Ij).data),i=Object(u.b)(Ej,{onCompleted:n}),o=Object(c.a)(i,1)[0],l=A.a(["fiatCurrency"])(Cl(pl)(null===a||void 0===a?void 0:a.config)),s=Cl(pl)(null===a||void 0===a?void 0:a.config);return Object(Me.jsxs)("div",{className:r.wrapper,children:[Object(Me.jsx)(Do,{title:"Commissions"}),Object(Me.jsx)(kj,{children:Object(Me.jsx)(jm,{title:"Default setup",rowSize:"lg",titleLg:!0,name:"commissions",initialValues:Gf,enableEdit:!0,forceAdd:t,save:function(e){var t=kl("commissions")(e.commissions[0]);return o({variables:{config:t}})},validationSchema:Vf(s),data:[],elements:$f(l)})})]})},Dj=Object(f.a)(Ei),Bj=x()(Fj||(Fj=Object(l.a)(["\n query getData {\n config\n accounts\n currencies {\n code\n display\n }\n countries {\n code\n display\n }\n cryptoCurrencies {\n code\n display\n }\n languages {\n code\n display\n }\n machines {\n name\n deviceId\n }\n }\n"]))),Rj=x()(Lj||(Lj=Object(l.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"])));var Tj,Aj,Mj=function(e){var t=e.isActive,n=e.doContinue,r=Dj(),a=Object(u.c)(Bj).data,i=Object(u.b)(Rj,{onCompleted:n}),o=Object(c.a)(i,1)[0],l=rO((null===a||void 0===a?void 0:a.config)||{},(null===a||void 0===a?void 0:a.cryptoCurrencies)||[]);return Object(Me.jsxs)("div",{className:r.wrapper,children:[Object(Me.jsx)(Do,{title:"Locales"}),Object(Me.jsx)(kj,{children:Object(Me.jsx)(jm,{title:"Default settings",rowSize:"lg",titleLg:!0,name:"locale",initialValues:lj,forceAdd:t,enableEdit:!0,save:function(e){var t=kl("locale")(e.locale[0]);return o({variables:{config:t}})},validationSchema:oj,data:[],elements:aj(Gn.a(a,{cryptoCurrencies:l}),(function(e,t,n){return n(t)}))})})]})},Wj=Object(f.a)({message:function(e){return{width:e.width,marginTop:4,marginLeft:16}}}),zj=function(e){var t=e.children,n=e.width,r=void 0===n?330:n,a=e.className,i=Wj({width:r});return Object(Me.jsxs)(No.a,{display:"flex",className:a,children:[Object(Me.jsx)(ia,{}),Object(Me.jsx)(et,{className:i.message,children:t})]})},$j=n(831),qj=Object(f.a)({button:{margin:[["auto",0,32,"auto"]]},form:{flex:1,display:"flex",flexDirection:"column"},grid:{marginBottom:24,marginTop:12}}),Hj=function(e){var t=e.validationSchema,n=e.elements,r=e.value,a=e.save,i=e.buttonLabel,o=void 0===i?"Save changes":i,c=e.buttonClass,l=e.xs,d=void 0===l?12:l,u=qj(),m=L.a($j.a,B.a((function(e){var t,n=e.code;return Object(z.a)({},n,null!==(t=r&&r[n])&&void 0!==t?t:"")})))(n),b=Gn.a(m,r);return Object(Me.jsx)(pn.d,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,initialValues:b,validationSchema:t,onSubmit:function(e){var t=L.a(B.a(R.a("code")),M.a((function(t){return R.a("component",t)===Va&&Wr.a(e[R.a("code",t)])})))(n);return a(Td.a(t,e))},children:Object(Me.jsxs)(pn.c,{className:u.form,children:[Object(Me.jsx)(h.a,{container:!0,spacing:3,className:u.grid,children:n.map((function(e){var t=e.component,n=e.code,r=e.display,a=e.settings,i=e.inputProps;return Object(Me.jsx)(h.a,{item:!0,xs:d,children:Object(Me.jsx)(pn.a,Object(s.a)(Object(s.a)({component:t},i),{},{name:n,label:r,settings:a,fullWidth:!0}))},n)}))}),Object(Me.jsx)(An,{className:E()(u.button,c),type:"submit",children:o})]})})},Vj=function(e){return{test:function(t){return!D.a(e)||!D.a(t)||this.createError()}}},Uj={code:"twilio",name:"Twilio",title:"Twilio (SMS)",elements:[{code:"accountSid",display:"Account SID",component:Ua},{code:"authToken",display:"Auth Token",component:Va},{code:"fromNumber",display:"Twilio Number (international format)",component:Ua,face:!0},{code:"toNumber",display:"Notifications Number (international format)",component:Ua,face:!0}],getValidationSchema:function(e){return xn.e().shape({accountSid:xn.g().max(100,"Too long").required(),authToken:xn.g().max(100,"Too long").test(Vj(null===e||void 0===e?void 0:e.authToken)),fromNumber:xn.g().max(100,"Too long").required(),toNumber:xn.g().max(100,"Too long").required()})}},Gj={radioGroup:{flexDirection:"row",width:600},radioLabel:{width:150,height:48},mdForm:{width:385},infoMessage:{display:"flex",marginBottom:20,"& > p":{width:330,marginTop:4,marginLeft:16}},actionButton:{marginBottom:32},actionButtonLink:{textDecoration:"none",color:J},error:{color:me},button:{marginTop:40},formButton:{margin:[[24,0,0]]}},Xj=x()(Tj||(Tj=Object(l.a)(["\n {\n config\n accounts\n }\n"]))),Yj=x()(Aj||(Aj=Object(l.a)(["\n mutation Save($accounts: JSONObject) {\n saveAccounts(accounts: $accounts)\n }\n"]))),_j=Object(f.a)(Object(s.a)(Object(s.a)({},Gj),{},{content:{width:820},radioLabel:Object(s.a)(Object(s.a)({},Gj.radioLabel),{},{width:280}),wrapper:{width:1200,height:100,margin:[[0,"auto"]]},title:{marginLeft:8,marginBottom:5},info:{marginTop:20,marginBottom:20}})),Zj=[{code:"enable",display:"Yes, I will"},{code:"disable",display:"No, not for now"}];var Kj,Qj,Jj,eg,tg,ng,rg,ag,ig,og,cg,lg=function(e){var t,n,a=e.doContinue,i=_j(),o=Object(r.useState)(null),l=Object(c.a)(o,2),s=l[0],d=l[1],m=Object(r.useState)(!1),h=Object(c.a)(m,2),b=h[0],p=h[1],f=Object(u.c)(Xj),j=f.data,g=f.refetch,O=Object(u.b)(Yj,{onCompleted:a}),x=Object(c.a)(O,1)[0],v=null!==(t=null===j||void 0===j?void 0:j.accounts)&&void 0!==t?t:[],y=(n={},Object(z.a)(n,i.title,!0),Object(z.a)(n,i.error,b),n);return Object(Me.jsx)("div",{className:i.wrapper,children:Object(Me.jsxs)("div",{className:i.content,children:[Object(Me.jsx)(qe,{children:"Twilio (SMS service)"}),Object(Me.jsxs)(No.a,{display:"flex",alignItems:"end",children:[Object(Me.jsx)(Ue,{noMargin:!0,className:E()(y),children:"Will you setup a two way machine or compliance?"}),Object(Me.jsxs)(Eb,{width:304,children:[Object(Me.jsx)(Xe,{children:"Two-way machines allow your customers not only to buy (cash-in) but also sell cryptocurrencies (cash-out)."}),Object(Me.jsx)(Xe,{children:"You\u2019ll need an SMS service for cash-out transactions and for any compliance triggers"})]})]}),Object(Me.jsx)(xa,{labelClassName:i.radioLabel,className:i.radioGroup,options:Zj,value:s,onChange:function(e){d(e.target.value),p(!1)}}),Object(Me.jsx)(zj,{className:i.info,children:"To set up Twilio please read the instructions from our support portal."}),Object(Me.jsx)(Dr,{link:"https://support.lamassu.is/hc/en-us/articles/115001203951-Twilio-for-SMS",label:"Twilio for SMS"}),"enable"===s&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Ue,{noMargin:!0,children:"Enter credentials"}),Object(Me.jsx)(Hj,{xs:6,save:function(e){return x({variables:{accounts:{twilio:e}}}).then((function(){return g()}))},value:v.twilio,elements:Uj.elements,validationSchema:Uj.validationSchema,buttonLabel:"Continue",buttonClass:i.formButton})]}),"enable"!==s&&Object(Me.jsx)(An,{size:"lg",onClick:function(){if(!s)return p(!0);a()},className:i.button,children:"Continue"})]})})},sg=n(832),dg=Object(f.a)(Gj),ug=x()(Kj||(Kj=Object(l.a)(["\n query getData {\n config\n accounts\n accountsConfig {\n code\n display\n class\n cryptos\n }\n cryptoCurrencies {\n code\n display\n }\n }\n"]))),mg=x()(Qj||(Qj=Object(l.a)(["\n mutation Save($config: JSONObject, $accounts: JSONObject) {\n saveConfig(config: $config)\n saveAccounts(accounts: $accounts)\n }\n"]))),hg=function(e){var t,n=e.data,a=e.doContinue,i=dg(),o=Object(u.c)(ug).data,l=Object(u.b)(mg,{onCompleted:a}),d=Object(c.a)(l,1)[0],m=Object(r.useState)(!1),h=Object(c.a)(m,2),b=h[0],p=h[1],f=null===n||void 0===n?void 0:n.coin,j=null===o||void 0===o?void 0:o.accountsConfig,g=null!==(t=null===o||void 0===o?void 0:o.cryptoCurrencies)&&void 0!==t?t:[];return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Ue,{className:b&&i.error,children:"All set"}),Object(Me.jsx)(Xe,{children:"These are your wallet settings. You can later edit these and add additional coins."}),Object(Me.jsx)(gm,{rowSize:"lg",titleLg:!0,name:"All set",namespaces:[f],data:kl(f,Td.a("coin",n)),elements:vj(g,j,!0)}),Object(Me.jsx)(An,{size:"lg",onClick:function(){var e=fb.a(il.a(hb.utils.getCryptoCurrency(f).units)),t=Object(s.a)(Object(s.a)({zeroConfLimit:0},n),{},{cryptoUnits:e});if(!gj.isValidSync(t))return p(!0);var r=kl(f,Td.a("coin",t)),a=kl(ml)(r);return p(!1),d({variables:{config:a}})},className:i.button,children:"Continue"})]})},bg={code:"binanceus",name:"Binance.us",title:"Binance.us (Exchange)",elements:[{code:"apiKey",display:"API Key",component:Ua,face:!0,long:!0},{code:"privateKey",display:"Private Key",component:Va}],getValidationSchema:function(e){return xn.e().shape({apiKey:xn.g().max(100,"Too long").required(),privateKey:xn.g().max(100,"Too long").test(Vj(null===e||void 0===e?void 0:e.privateKey))})}},pg=function(e){return e&&e.length},fg=function(e,t){return xn.g().max(100,"Too long").when(e,{is:pg,then:xn.g().test(Vj(t))})},jg={code:"bitgo",name:"BitGo",title:"BitGo (Wallet)",elements:[{code:"token",display:"API Token",component:Ua,face:!0,long:!0},{code:"environment",display:"Environment",component:ka,inputProps:{options:[{code:"prod",display:"prod"},{code:"test",display:"test"}],labelProp:"display",valueProp:"code"},face:!0},{code:"BTCWalletId",display:"BTC Wallet ID",component:Ua},{code:"BTCWalletPassphrase",display:"BTC Wallet Passphrase",component:Va},{code:"LTCWalletId",display:"LTC Wallet ID",component:Ua},{code:"LTCWalletPassphrase",display:"LTC Wallet Passphrase",component:Va},{code:"ZECWalletId",display:"ZEC Wallet ID",component:Ua},{code:"ZECWalletPassphrase",display:"ZEC Wallet Passphrase",component:Va},{code:"BCHWalletId",display:"BCH Wallet ID",component:Ua},{code:"BCHWalletPassphrase",display:"BCH Wallet Passphrase",component:Va},{code:"DASHWalletId",display:"DASH Wallet ID",component:Ua},{code:"DASHWalletPassphrase",display:"DASH Wallet Passphrase",component:Va}],getValidationSchema:function(e){return xn.e().shape({token:xn.g().max(100,"Too long").required(),BTCWalletId:xn.g().max(100,"Too long"),BTCWalletPassphrase:fg("BTCWalletId",null===e||void 0===e?void 0:e.BTCWalletPassphrase),LTCWalletId:xn.g().max(100,"Too long"),LTCWalletPassphrase:fg("LTCWalletId",null===e||void 0===e?void 0:e.LTCWalletPassphrase),ZECWalletId:xn.g().max(100,"Too long"),ZECWalletPassphrase:fg("ZECWalletId",null===e||void 0===e?void 0:e.ZECWalletPassphrase),BCHWalletId:xn.g().max(100,"Too long"),BCHWalletPassphrase:fg("BCHWalletId",null===e||void 0===e?void 0:e.BCHWalletPassphrase),DASHWalletId:xn.g().max(100,"Too long"),DASHWalletPassphrase:fg("DASHWalletId",null===e||void 0===e?void 0:e.DASHWalletPassphrase),environment:xn.g().matches(/(prod|test)/).required()})}},gg={code:"bitstamp",name:"Bitstamp",title:"Bitstamp (Exchange)",elements:[{code:"clientId",display:"Client ID",component:Ua,face:!0,long:!0},{code:"key",display:"API Key",component:Ua,face:!0,long:!0},{code:"secret",display:"API Secret",component:Va}],getValidationSchema:function(e){return xn.e().shape({clientId:xn.g().max(100,"Too long").required(),key:xn.g().max(100,"Too long").required(),secret:xn.g().max(100,"Too long").test(Vj(null===e||void 0===e?void 0:e.secret))})}},Og={code:"blockcypher",name:"Blockcypher",title:"Blockcypher (Payments)",elements:[{code:"token",display:"API Token",component:Ua,face:!0,long:!0},{code:"confidenceFactor",display:"Confidence Factor",component:Ua,face:!0},{code:"rbf",component:$a,settings:{enabled:!0,disabledMessage:"RBF verification not available",label:"Enable RBF verification",requirement:"bitcoind"},face:!0}],getValidationSchema:function(){return xn.e().shape({token:xn.g().max(100,"Too long").required(),confidenceFactor:xn.d().integer("Please input a positive integer").positive("Please input a positive integer").required()})}},xg={code:"cex",name:"Cex",title:"Cex (Exchange)",elements:[{code:"apiKey",display:"API Key",component:Ua,face:!0,long:!0},{code:"privateKey",display:"Private Key",component:Va}],getValidationSchema:function(e){return xn.e().shape({apiKey:xn.g().max(100,"Too long").required(),privateKey:xn.g().max(100,"Too long").test(Vj(null===e||void 0===e?void 0:e.privateKey))})}},vg={code:"ftx",name:"Ftx",title:"Ftx (Exchange)",elements:[{code:"apiKey",display:"API Key",component:Ua,face:!0,long:!0},{code:"privateKey",display:"Private Key",component:Va}],getValidationSchema:function(e){return xn.e().shape({apiKey:xn.g().max(100,"Too long").required(),privateKey:xn.g().max(100,"Too long").test(Vj(null===e||void 0===e?void 0:e.privateKey))})}},yg={code:"infura",name:"Infura",title:"Infura (Wallet)",elements:[{code:"apiKey",display:"Project ID",component:Ua,face:!0,long:!0},{code:"apiSecret",display:"Project Secret",component:Va},{code:"endpoint",display:"Endpoint",component:Ua,face:!0}],getValidationSchema:function(e){return xn.e().shape({apiKey:xn.g().max(100,"Too long").required(),apiSecret:xn.g().max(100,"Too long").test(Vj(null===e||void 0===e?void 0:e.apiSecret)),endpoint:xn.g().max(100,"Too long").required()})}},wg={code:"itbit",name:"itBit",title:"itBit (Exchange)",elements:[{code:"userId",display:"User ID",component:Ua,face:!0,long:!0},{code:"walletId",display:"Wallet ID",component:Ua,face:!0,long:!0},{code:"clientKey",display:"Client Key",component:Ua},{code:"clientSecret",display:"Client Secret",component:Va}],getValidationSchema:function(e){return xn.e().shape({userId:xn.g().max(100,"Too long").required(),walletId:xn.g().max(100,"Too long").required(),clientKey:xn.g().max(100,"Too long").required(),clientSecret:xn.g().max(100,"Too long").test(Vj(null===e||void 0===e?void 0:e.clientSecret))})}},Cg={code:"kraken",name:"Kraken",title:"Kraken (Exchange)",elements:[{code:"apiKey",display:"API Key",component:Ua,face:!0,long:!0},{code:"privateKey",display:"Private Key",component:Va}],getValidationSchema:function(e){return xn.e().shape({apiKey:xn.g().max(100,"Too long").required(),privateKey:xn.g().max(100,"Too long").test(Vj(null===e||void 0===e?void 0:e.privateKey))})}},kg={code:"mailgun",name:"Mailgun",title:"Mailgun (Email)",elements:[{code:"apiKey",display:"API Key",component:Ua},{code:"domain",display:"Domain",component:Ua},{code:"fromEmail",display:"From Email",component:Ua,face:!0},{code:"toEmail",display:"To Email",component:Ua,face:!0}],getValidationSchema:function(){return xn.e().shape({apiKey:xn.g().max(100,"Too long").required(),domain:xn.g().max(100,"Too long").required(),fromEmail:xn.g().max(100,"Too long").email("Please input a valid email address").required(),toEmail:xn.g().max(100,"Too long").email("Please input a valid email address").required()})}},Sg=(Jj={},Object(z.a)(Jj,jg.code,jg),Object(z.a)(Jj,gg.code,gg),Object(z.a)(Jj,Og.code,Og),Object(z.a)(Jj,yg.code,yg),Object(z.a)(Jj,wg.code,wg),Object(z.a)(Jj,Cg.code,Cg),Object(z.a)(Jj,kg.code,kg),Object(z.a)(Jj,Uj.code,Uj),Object(z.a)(Jj,bg.code,bg),Object(z.a)(Jj,xg.code,xg),Object(z.a)(Jj,vg.code,vg),Jj),Ng=Object(f.a)(Object(s.a)(Object(s.a)({},Gj),{},{radioGroup:Gj.radioGroup,radioLabel:Object(s.a)(Object(s.a)({},Gj.radioLabel),{},{width:200})})),Ig=x()(eg||(eg=Object(l.a)(["\n {\n accounts\n }\n"]))),Eg=x()(tg||(tg=Object(l.a)(["\n mutation SaveAccountsBC($accounts: JSONObject) {\n saveAccounts(accounts: $accounts)\n }\n"]))),Fg=[{code:"enable",display:"I will enable cash-out"},{code:"disable",display:"I won't enable cash-out"}],Lg=function(e){var t,n=e.addData,a=Ng(),i=Object(u.c)(Ig).data,o=Object(u.b)(Eg,{onCompleted:function(){return n({zeroConf:"blockcypher"})}}),l=Object(c.a)(o,1)[0],s=Object(r.useState)(null),d=Object(c.a)(s,2),m=d[0],h=d[1],b=Object(r.useState)(!1),p=Object(c.a)(b,2),f=p[0],j=p[1],g=null!==(t=null===i||void 0===i?void 0:i.accounts)&&void 0!==t?t:[];return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Ue,{className:f&&a.error,children:"Blockcypher"}),Object(Me.jsx)(Xe,{children:"If you are enabling cash-out services, create a Blockcypher account."}),Object(Me.jsx)(Dr,{link:"https://support.lamassu.is/hc/en-us/articles/115001209472-Blockcypher",label:"Configuring Blockcypher"}),Object(Me.jsx)(xa,{labelClassName:a.radioLabel,className:a.radioGroup,options:Fg,value:m,onChange:function(e){h(e.target.value),j(!1)}}),Object(Me.jsxs)("div",{className:a.mdForm,children:["disable"===m&&Object(Me.jsx)(An,{size:"lg",onClick:function(){return n({zeroConf:"none",zeroConfLimit:0})},className:a.button,children:"Continue"}),"enable"===m&&Object(Me.jsx)(Hj,{value:g.blockcypher,save:function(e){return l({variables:{accounts:{blockcypher:e}}})},elements:Sg.blockcypher.elements,validationSchema:Sg.blockcypher.validationSchema,buttonLabel:"Continue",buttonClass:a.formButton})]})]})},Pg=Object(f.a)(Gj),Dg=x()(ng||(ng=Object(l.a)(["\n {\n cryptoCurrencies {\n code\n display\n }\n }\n"]))),Bg=xn.e().shape({coin:xn.g().required()}),Rg=function(e){var t,n=e.addData,a=Pg(),i=Object(r.useState)(!1),o=Object(c.a)(i,2),l=o[0],s=o[1],d=Object(u.c)(Dg).data,m=null!==(t=null===d||void 0===d?void 0:d.cryptoCurrencies)&&void 0!==t?t:[];return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Ue,{className:l&&a.error,children:"Choose your first cryptocurrency"}),Object(Me.jsx)(pn.d,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,initialValues:{coin:""},onSubmit:function(e){return Bg.isValidSync(e)?"BTC"!==e.coin?n({coin:e.coin,zeroConf:"none",zeroConfLimit:0}):void n(e):s(!0)},children:Object(Me.jsxs)(pn.c,{onChange:function(){return s(!1)},children:[Object(Me.jsx)(Vd,{}),Object(Me.jsx)(pn.b,{component:Ha,name:"coin",labelClassName:a.radioLabel,className:a.radioGroup,options:m}),Object(Me.jsx)(An,{size:"lg",type:"submit",className:a.button,children:"Continue"})]})})]})},Tg=function(e,t){return M.a((function(n){return function(e){return W.a("class",e)}(t)(n)&&function(e){return L.a(qo.a(e),R.a("cryptos"))}(e)(n)}))},Ag=function(e,t,n,r){var a=Tg(r,n)(e),i=Bl.a((function(e){var n=e.code,r=function(e){return t&&t[e]}(n);return!Sg[n]||(0,Sg[n].getValidationSchema)(r).isValidSync(r)}))(a),o=Object(c.a)(i,2);return{filled:o[0],unfilled:o[1]}},Mg=Object(f.a)(Gj),Wg=x()(rg||(rg=Object(l.a)(["\n {\n accounts\n accountsConfig {\n code\n display\n class\n cryptos\n }\n cryptoCurrencies {\n code\n display\n }\n }\n"]))),zg=x()(ag||(ag=Object(l.a)(["\n mutation Save($accounts: JSONObject) {\n saveAccounts(accounts: $accounts)\n }\n"]))),$g=function(e){return!qo.a(e)(["mock-exchange"])},qg=function(e){var t,n,a,i=e.data,o=e.addData,l=Mg(),s=Object(u.c)(Wg).data,d=Object(u.b)(zg,{onCompleted:function(){return k()}}),m=Object(c.a)(d,1)[0],h=Object(r.useState)(null),b=Object(c.a)(h,2),p=b[0],f=b[1],j=Object(r.useState)(!1),g=Object(c.a)(j,2),O=g[0],x=g[1],v=null!==(t=null===s||void 0===s?void 0:s.accounts)&&void 0!==t?t:[],y=null!==(n=null===s||void 0===s?void 0:s.accountsConfig)&&void 0!==n?n:[],w=i.coin,C=Ag(y,v,"exchange",w),k=function(){if(!p)return x(!0);o({exchange:p})};return Object(Me.jsxs)("div",{className:l.mdForm,children:[Object(Me.jsx)(Ue,{className:O&&l.error,children:"Choose your exchange"}),Object(Me.jsx)(xa,{labelClassName:l.radioLabel,className:l.radioGroup,options:Mr.a(C.filled,C.unfilled),value:p,onChange:function(e){f(e.target.value),x(!1)}}),!$g(p)&&Object(Me.jsx)(An,{size:"lg",onClick:k,className:l.button,children:"Continue"}),$g(p)&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)("div",{className:l.infoMessage,children:[Object(Me.jsx)(ia,{}),Object(Me.jsxs)(Ze,{children:["Make sure you set up ",Sg[p].name," to enter the necessary information below. Please follow the instructions on our support page if you haven\u2019t."]})]}),Object(Me.jsx)(Dr,{link:{kraken:"https://support.lamassu.is/hc/en-us/articles/115001206891-Kraken-trading",itbit:"https://support.lamassu.is/hc/en-us/articles/360026195032-itBit-trading",bitstamp:"https://support.lamassu.is/hc/en-us/articles/115001206911-Bitstamp-trading"}[p],label:"".concat(Sg[p].name," trading")}),Object(Me.jsx)(Ue,{noMargin:!0,children:"Enter exchange information"}),Object(Me.jsx)(Hj,{value:v[p],save:(a=p,function(e){var t=Object(z.a)({},a,e);return m({variables:{accounts:t}})}),elements:Sg[p].elements,validationSchema:Sg[p].validationSchema,buttonLabel:"Continue",buttonClass:l.formButton})]})]})},Hg=Object(f.a)(Gj),Vg=x()(ig||(ig=Object(l.a)(["\n {\n accountsConfig {\n code\n display\n class\n cryptos\n }\n }\n"]))),Ug=function(e){var t,n,a=e.data,i=e.addData,o=Hg(),l=Object(u.c)(Vg).data,s=Object(r.useState)(null),d=Object(c.a)(s,2),m=d[0],h=d[1],b=Object(r.useState)(!1),p=Object(c.a)(b,2),f=p[0],j=p[1],g=null!==(t=null===l||void 0===l?void 0:l.accounts)&&void 0!==t?t:[],O=null!==(n=null===l||void 0===l?void 0:l.accountsConfig)&&void 0!==n?n:[],x=a.coin,v=Ag(O,g,"ticker",x);return Object(Me.jsxs)("div",{className:o.mdForm,children:[Object(Me.jsx)(Ue,{className:f&&o.error,children:"Choose your ticker"}),Object(Me.jsx)(xa,{labelClassName:o.radioLabel,className:o.radioGroup,options:Mr.a(v.filled,v.unfilled),value:m,onChange:function(e){h(e.target.value),j(!1)}}),Object(Me.jsx)(An,{size:"lg",onClick:function(){if(!m)return j(!0);i({ticker:m})},className:o.button,children:"Continue"})]})},Gg=function(e){var t;return{code:"bitgo",name:"BitGo",title:"BitGo (Wallet)",elements:[{code:"token",display:"API Token",component:Ua,face:!0,long:!0},{code:"environment",display:"Environment",component:ka,inputProps:{options:[{code:"prod",display:"prod"},{code:"test",display:"test"}],labelProp:"display",valueProp:"code"},face:!0},{code:"".concat(e,"WalletId"),display:"".concat(e," Wallet ID"),component:Ua},{code:"".concat(e,"WalletPassphrase"),display:"".concat(e," Wallet Passphrase"),component:Va}],validationSchema:xn.e().shape((t={token:xn.g().max(100,"Too long").required(),environment:xn.g().matches(/(prod|test)/).required()},Object(z.a)(t,"".concat(e,"WalletId"),xn.g().max(100,"Too long").required()),Object(z.a)(t,"".concat(e,"WalletPassphrase"),xn.g().max(100,"Too long").required()),t))}},Xg=Object(f.a)(Gj),Yg=x()(og||(og=Object(l.a)(["\n {\n accounts\n accountsConfig {\n code\n display\n class\n cryptos\n }\n cryptoCurrencies {\n code\n display\n }\n }\n"]))),_g=x()(cg||(cg=Object(l.a)(["\n mutation Save($accounts: JSONObject) {\n saveAccounts(accounts: $accounts)\n }\n"]))),Zg=function(e){return qo.a(e)(["infura","bitgo"])},Kg=function(e){var t,n,a,i=e.data,o=e.addData,l=Xg(),s=Object(u.c)(Yg).data,d=Object(u.b)(_g,{onCompleted:function(){return S()}}),m=Object(c.a)(d,1)[0],h=Object(r.useState)(null),b=Object(c.a)(h,2),p=b[0],f=b[1],j=Object(r.useState)(!1),g=Object(c.a)(j,2),O=g[0],x=g[1],v=null!==(t=null===s||void 0===s?void 0:s.accounts)&&void 0!==t?t:[],y=null!==(n=null===s||void 0===s?void 0:s.accountsConfig)&&void 0!==n?n:[],w=i.coin,C=Ag(y,v,"wallet",w),k=function(e){return function(t){var n=Object(z.a)({},e,t);return m({variables:{accounts:n}})}},S=function(){if(!p)return x(!0);o({wallet:p})};return Object(Me.jsxs)("div",{className:l.mdForm,children:[Object(Me.jsx)(Ue,{className:O&&l.error,children:"Choose your wallet"}),Object(Me.jsx)(xa,{labelClassName:l.radioLabel,className:l.radioGroup,options:Mr.a(C.filled,C.unfilled),value:p,onChange:function(e){f(e.target.value),x(!1)}}),(a=p,qo.a(a)(["bitcoind","geth","litecoind","dashd","zcashd","bitcoincashd"])&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)("div",{className:l.infoMessage,children:[Object(Me.jsx)(ia,{}),Object(Me.jsxs)(Ze,{children:["To set up ",p," please read the node wallet instructions from our support portal."]})]}),Object(Me.jsx)(Dr,{link:"https://support.lamassu.is/hc/en-us/articles/115001209552-Setting-up-your-node-wallets",label:"Support article"})]})),!Zg(p)&&Object(Me.jsx)(An,{size:"lg",onClick:S,className:l.button,children:"Continue"}),"bitgo"===p&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)("div",{className:l.infoMessage,children:[Object(Me.jsx)(ia,{}),Object(Me.jsx)(Ze,{children:"Make sure you set up a BitGo wallet to enter the necessary information below. Please follow the instructions on our support page if you haven\u2019t."})]}),Object(Me.jsx)(Dr,{link:"https://support.lamassu.is/hc/en-us/articles/360024455592-Setting-up-BitGo",label:"Support article"}),Object(Me.jsx)(Ue,{noMargin:!0,children:"Enter wallet information"}),Object(Me.jsx)(Hj,{value:v.bitgo,save:k(p),elements:Gg(w).elements,validationSchema:Gg(w).validationSchema,buttonLabel:"Continue",buttonClass:l.formButton})]}),"infura"===p&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Ue,{noMargin:!0,children:"Enter wallet information"}),Object(Me.jsx)(Hj,{value:v.infura,save:k(p),elements:Sg.infura.elements,validationSchema:Sg.infura.getValidationSchema(v.infura),buttonLabel:"Continue",buttonClass:l.formButton})]})]})},Qg=Object(f.a)(Ei),Jg=[{label:"Choose cryptocurrency",component:Rg},{label:"Choose wallet",component:Kg},{label:"Choose ticker",component:Ug},{label:"Exchange",component:qg},{label:"Blockcypher",component:Lg},{label:"All set",component:hg}],eO=function(e){var t=e.doContinue,n=Object(r.useState)(0),a=Object(c.a)(n,2),i=a[0],o=a[1],l=Object(r.useState)({}),s=Object(c.a)(l,2),d=s[0],u=s[1],m=Qg(),h="BTC"===(null===d||void 0===d?void 0:d.coin)?Jg:sg.a(4,1,Jg),b=h[i].component;return Object(Me.jsxs)("div",{className:m.wrapper,children:[Object(Me.jsx)("div",{className:m.headerDiv,children:Object(Me.jsx)(Do,{title:"Wallet settings"})}),Object(Me.jsxs)("div",{className:m.contentDiv,children:[Object(Me.jsx)(di,{children:h.map((function(e,t){return Object(Me.jsx)(ui,{step:i,it:e,idx:t,steps:h},t)}))}),Object(Me.jsx)("div",{className:m.contentWrapper,children:Object(Me.jsx)(b,{data:d,addData:function(e){u(Gn.a(d,e)),o(i+1)},doContinue:t})})]})]})},tO={welcome:{textAlign:"center",paddingTop:256},title:{lineHeight:1,fontSize:48},getStarted:{fontSize:24,fontWeight:500,marginBottom:54,color:q}},nO=Object(f.a)(tO);var rO=function(e,t){var n=Cl(ml,e);return M.a((function(e){return gj.isValidSync(Cl(e.code,n))}))(t)},aO=function(e,t){return e?function(e,t){var n=Cl(ml,e),r=B.a((function(e){return Cl(e.code,n)}))(t);return L.a(Wo.a(yf.a),B.a((function(e){return gj.isValidSync(e)})))(r)}(e,t)?function(e){var t=Cl(pl,e);return oj.isValidSync(t)}(e)?function(e){var t=Cl(fl,e),n=Cl(pl,e);return Vf(n).isValidSync(t)}(e)?0:3:2:1:0},iO=[{id:"welcome",Component:function(e){var t=e.doContinue,n=nO();return Object(Me.jsxs)("div",{className:n.welcome,children:[Object(Me.jsx)(qe,{className:n.title,children:"Welcome to the Lamassu Admin"}),Object(Me.jsxs)(Xe,{className:n.getStarted,children:["To get you started, we\u2019ve put together a wizard that will",Object(Me.jsx)("br",{}),"help set up what you need before pairing your machines."]}),Object(Me.jsx)(An,{size:"xl",onClick:t,children:"Get started"})]})}},{id:"wallet",Component:eO,exImage:"/assets/wizard/fullexample.wallet.png",subtitle:"Wallet settings",text:"Your wallet settings are the first step for this wizard. \n We'll start by setting up one of cryptocurrencies to get you up and running,\n but you can later set up as many as you want."},{id:"locale",Component:Mj,exImage:"/assets/wizard/fullexample.locale.png",subtitle:"Locales",text:"From the Locales panel, you can define default settings\n that will be applied to all machines you add to your network later on.\n These settings may be overridden for specific machines in the Overrides section."},{id:"twilio",Component:lg,exImage:"/assets/wizard/fullexample.twilio.png",subtitle:"Twilio (SMS service)",text:Object(Me.jsxs)(Me.Fragment,{children:["Twilio is used for SMS operator notifications, phone number collection for compliance, and 1-confirmation redemptions on cash-out transactions.",Object(Me.jsx)("br",{}),"You'll need to configure Twilio if you're offering cash-out or any compliance options"]})},{id:"commissions",Component:Pj,exImage:"/assets/wizard/fullexample.commissions.png",subtitle:"Commissions",text:"From the Commissions page, you can define all the commissions of your\n machines. The values set here will be default values of all machines\n you'll later add to your network. Default settings keep you from\n having to enter the same values everytime you add a new machine. Once\n a machine is added, you may override these values per machine and per\n cryptocurrency in the overrides section."}],oO=n(834),cO=n(420),lO=Object(f.a)({modal:{display:"flex",justifyContent:"center",flexDirection:"column",alignItems:"center"},wrapper:function(e){var t=e.width,n=e.height;return{width:t,height:n,display:"flex",flexDirection:"column",minHeight:null!==n&&void 0!==n?n:400,maxHeight:"90vh",overflowY:"auto",borderRadius:8,outline:0}},infoPanelWrapper:function(e){var t=e.width,n=e.infoPanelHeight;return{width:t,height:n,marginTop:16,display:"flex",flexDirection:"column",minHeight:null!==n&&void 0!==n?n:200,maxHeight:"90vh",overflowY:"auto",borderRadius:8,outline:0}},panelContent:{width:"100%",display:"flex",flexDirection:"column",flex:1,padding:[[0,24]]},content:function(e){var t=e.small;return{width:"100%",display:"flex",flexDirection:"column",flex:1,padding:e.xl?[[0,88]]:t?[[0,16]]:[[0,32]]}},button:function(e){var t=e.small,n=e.xl;return{padding:[[0,0,n?26:0,0]],margin:n?[[0,0,"auto","auto"]]:t?[[12,12,"auto","auto"]]:[[16,16,"auto","auto"]]}},header:{display:"flex"},title:function(e){return{margin:e.small?[[20,0,8,16]]:[[28,0,8,32]]}}}),sO=function(e){var t=e.width,n=e.height,r=e.infoPanelHeight,a=e.title,i=e.small,o=e.xl,c=e.infoPanel,l=e.handleClose,d=e.children,u=(e.secondaryModal,e.className),m=e.closeOnEscape,h=e.closeOnBackdropClick,b=Object($.a)(e,["width","height","infoPanelHeight","title","small","xl","infoPanel","handleClose","children","secondaryModal","className","closeOnEscape","closeOnBackdropClick"]),p=lO({width:t,height:n,small:i,infoPanelHeight:r,xl:o}),f=i?Ue:qe,j=o?28:i?16:20;return Object(Me.jsx)(cO.a,Object(s.a)(Object(s.a)({onClose:function(e,t){(h||"backdropClick"!==t)&&(m||"escapeKeyDown"!==t)&&l()},className:p.modal},b),{},{children:Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)(Un.a,{className:E()(p.wrapper,u),children:[Object(Me.jsxs)("div",{className:p.header,children:[a&&Object(Me.jsx)(f,{className:p.title,children:a}),Object(Me.jsx)(tr,{size:j,className:p.button,onClick:function(){return l()},children:Object(Me.jsx)(gi,{})})]}),Object(Me.jsx)("div",{className:p.content,children:d})]}),c&&Object(Me.jsx)(Un.a,{className:E()(p.infoPanelWrapper,u),children:Object(Me.jsx)("div",{className:p.panelContent,children:c})})]})}))},dO=n(833);function uO(){return(uO=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function mO(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var hO=r.createElement("desc",null,"Created with Sketch."),bO=r.createElement("g",{id:"icon/stage/spring/current",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("circle",{id:"Oval-2-Copy",fill:"#48F694",cx:9,cy:9,r:4}),r.createElement("circle",{id:"Oval-Copy-5",stroke:"#48F694",strokeWidth:2,transform:"translate(9.000000, 9.000000) rotate(-270.000000) translate(-9.000000, -9.000000) ",cx:9,cy:9,r:8}));function pO(e,t){var n=e.title,a=e.titleId,i=mO(e,["title","titleId"]);return r.createElement("svg",uO({width:"18px",height:"18px",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,hO,bO)}var fO=r.forwardRef(pO),jO=(n.p,{stages:{display:"flex",alignItems:"center"},wrapper:{display:"flex",alignItems:"center",margin:0},stage:{display:"flex",height:28,width:28,zIndex:2,"& > svg":{height:"100%",width:"100%",overflow:"visible"}},separator:{width:28,height:2,border:[[2,"solid"]],zIndex:1},separatorSpring:{borderColor:ee},separatorZodiac:{borderColor:J},separatorSpringEmpty:{borderColor:oe},separatorZodiacEmpty:{borderColor:se}}),gO=Object(f.a)(jO),OO=Object(r.memo)((function(e){var t,n,r=e.steps,a=e.currentStep,i=e.color,o=void 0===i?"spring":i,c=e.className;if(a<1||a>r)throw Error("Value of currentStage is invalid");if(r<1)throw Error("Value of stages is invalid");var l=gO(),s=(t={},Object(z.a)(t,l.separator,!0),Object(z.a)(t,l.separatorSpring,"spring"===o),Object(z.a)(t,l.separatorZodiac,"zodiac"===o),t),d=(n={},Object(z.a)(n,l.separator,!0),Object(z.a)(n,l.separatorSpringEmpty,"spring"===o),Object(z.a)(n,l.separatorZodiacEmpty,"zodiac"===o),n);return Object(Me.jsxs)("div",{className:E()(c,l.stages),children:[dO.a(1,a).map((function(e){return Object(Me.jsxs)("div",{className:l.wrapper,children:[e>1&&Object(Me.jsx)("div",{className:E()(s)}),Object(Me.jsxs)("div",{className:l.stage,children:["spring"===o&&Object(Me.jsx)(Si,{}),"zodiac"===o&&Object(Me.jsx)(Ka,{})]})]},e)})),Object(Me.jsxs)("div",{className:l.wrapper,children:[a>1&&Object(Me.jsx)("div",{className:E()(s)}),Object(Me.jsxs)("div",{className:l.stage,children:["spring"===o&&Object(Me.jsx)(fO,{}),"zodiac"===o&&Object(Me.jsx)(ai,{})]})]}),dO.a(a+1,r+1).map((function(e){return Object(Me.jsxs)("div",{className:l.wrapper,children:[Object(Me.jsx)("div",{className:E()(d)}),Object(Me.jsxs)("div",{className:l.stage,children:["spring"===o&&Object(Me.jsx)(pt,{}),"zodiac"===o&&Object(Me.jsx)(vt,{})]})]},e)}))]})})),xO=Object(f.a)((function(){return{drawer:{borderTop:"none",boxShadow:"0 0 4px 0 rgba(0, 0, 0, 0.08)"},wrapper:{padding:"32px 0",flexGrow:1,height:264},smallWrapper:{height:84},title:{margin:[[0,32,0,0]]},subtitle:{marginTop:8,marginBottom:6,lineHeight:1.25,display:"inline"},modal:{background:"none",boxShadow:"none"}}}));var vO,yO,wO,CO=function(e){var t,n=e.currentStep,a=e.steps,i=e.subtitle,o=e.text,l=e.exImage,s=e.open,d=e.start,u=xO(),m=Object(r.useState)(!1),b=Object(c.a)(m,2),p=b[0],f=b[1],j=(t={},Object(z.a)(t,u.wrapper,!0),Object(z.a)(t,u.smallWrapper,!s),t);return Object(Me.jsxs)(oO.a,{anchor:"bottom",open:!0,variant:"persistent",classes:{paperAnchorDockedBottom:u.drawer},children:[Object(Me.jsxs)("div",{className:E()(j),children:[Object(Me.jsxs)(h.a,{container:!0,direction:"row",justify:"center",alignItems:"baseline",children:[Object(Me.jsxs)(h.a,{item:!0,xs:5,container:!0,direction:s?"column":"row",justify:"flex-start",alignItems:"baseline",children:[Object(Me.jsx)(He,{className:u.title,children:"Setup Lamassu Admin"}),Object(Me.jsx)(_e,{className:u.subtitle,children:i}),s&&Object(Me.jsx)(Xe,{children:o})]}),Object(Me.jsx)(h.a,{item:!0,xs:4,container:!0,direction:"column",justify:"flex-start",alignItems:"flex-end",spacing:5,children:Object(Me.jsx)(h.a,{item:!0,xs:12,children:a&&n&&Object(Me.jsx)(OO,{currentStep:n,steps:a})})})]}),s&&Object(Me.jsxs)(h.a,{container:!0,direction:"row",justify:"center",alignItems:"baseline",children:[Object(Me.jsx)(h.a,{item:!0,xs:5,container:!0,direction:"column",justify:"flex-start",alignItems:"flex-start",children:Object(Me.jsx)(or,{onClick:function(){f(!0)},children:"See full example"})}),Object(Me.jsx)(h.a,{item:!0,xs:4,container:!0,direction:"column",justify:"flex-start",alignItems:"flex-end",spacing:5,children:Object(Me.jsx)(h.a,{item:!0,children:Object(Me.jsx)(An,{size:"lg",onClick:d,children:"Get Started"})})})]})]}),Object(Me.jsx)(sO,{closeOnEscape:!0,closeOnBackdropClick:!0,className:u.modal,xl:!0,width:1328,handleClose:function(){f(!1)},open:p,children:Object(Me.jsx)("img",{width:1152,src:l,alt:""})})]})},kO=Object(f.a)({wrapper:{display:"flex",padding:[[16,0]],flexDirection:"column",justifyContent:"space-between",backgroundColor:re},welcomeBackground:{background:"url(/wizard-background.svg) no-repeat center center fixed",backgroundColor:re,backgroundSize:"cover"},blurred:{filter:"blur(4px)",pointerEvents:"none"}}),SO=x()(vO||(vO=Object(l.a)(["\n query getData {\n config\n accounts\n cryptoCurrencies {\n code\n display\n }\n }\n"]))),NO=function(e){e.fromAuthRegister;var t,n,a=kO(),i=Object(u.c)(SO),o=i.data,l=i.loading,s=Object(w.h)(),d=Object(r.useContext)(k).setWizardTested,m=Object(r.useState)(0),h=Object(c.a)(m,2),b=h[0],p=h[1],f=Object(r.useState)(!0),j=Object(c.a)(f,2),g=j[0],O=j[1],x=Object(r.useState)(!1),v=Object(c.a)(x,2),y=v[0],C=v[1];if(l)return Object(Me.jsx)(Me.Fragment,{});var S=aO(null===o||void 0===o?void 0:o.config,null===o||void 0===o?void 0:o.cryptoCurrencies),N=s.length&&!(null===(t=s.location.state)||void 0===t?void 0:t.fromAuthRegister);0===S&&(d(!0),N?s.goBack():s.push("/"));var I=0===b,F=(n={},Object(z.a)(n,a.blurred,y),Object(z.a)(n,a.wrapper,!0),Object(z.a)(n,a.welcomeBackground,I),n),L=iO[b];return Object(Me.jsxs)(un.a,{fullScreen:!0,open:g,children:[Object(Me.jsx)(mn.a,{className:E()(F),children:Object(Me.jsx)(L.Component,{doContinue:function(){b>=iO.length-1&&(O(!1),s.push("/"));var e=0===b&&S?S:b+1;C(!0),p(e)},isActive:!y})}),!I&&Object(Me.jsx)(CO,{currentStep:b,steps:iO.length-1,exImage:L.exImage,subtitle:L.subtitle,text:L.text,open:y,start:function(){C(!1)}})]})},IO=function(e){return!D.a(null===e||void 0===e?void 0:e.id)&&!D.a(null===e||void 0===e?void 0:e.username)&&!D.a(null===e||void 0===e?void 0:e.role)},EO="user",FO="superuser",LO=function(e){var t=Object.assign({},e),n=Object(r.useContext)(k).userData;return IO(n)?Object(Me.jsx)(w.c,Object(s.a)({},t)):Object(Me.jsx)(w.b,{to:"/login"})},PO=function(e){var t=e.component,n=e.restricted,a=Object($.a)(e,["component","restricted"]),i=Object(r.useContext)(k).userData;return Object(Me.jsx)(w.c,Object(s.a)(Object(s.a)({},a),{},{render:function(e){return IO(i)&&n?Object(Me.jsx)(w.b,{to:"/"}):Object(Me.jsx)(t,Object(s.a)({},e))}}))},DO=n(839),BO=n(840),RO=n(862),TO=6e4,AO=864e5,MO=6048e5,WO=2592e6,zO={overviewLegend:{display:"flex",justifyContent:"flex-end","& span":{marginRight:24},"& > :last-child":{marginRight:0}},legendEntry:{display:"flex",flexDirection:"row",alignItems:"center","& > :first-child":{marginRight:8}},dropdownsOverviewWrapper:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:16},verticalLine:{height:64,width:1,border:"solid",borderWidth:.5,borderColor:de},dropdowns:{display:"flex",flexDirection:"row","& div":{marginRight:24},"& > :last-child":{marginRight:0}},overview:{display:"flex",flexDirection:"row",alignItems:"center","& div":{marginRight:40},"& > :last-child":{marginRight:0}},overviewFieldWrapper:{marginTop:6,marginBottom:6,"& span":{fontSize:24}},overviewGrowth:{display:"flex",flexDirection:"row",alignItems:"center","& p":{marginLeft:4}},growthPercentage:{fontWeight:"bold"},growth:{color:"#00CD5A"},decline:{color:K},graphHeaderWrapper:{display:"flex",flexDirection:"row",justifyContent:"space-between",marginBottom:40},graphHeaderLeft:{display:"flex",flexDirection:"column"},graphHeaderRight:{marginTop:15,display:"flex",flexDirection:"row","& > *":{marginRight:30,"&:last-child":{marginRight:0}}},graphLegend:{display:"flex",flexDirection:"row",alignItems:"center","& span":{marginRight:24},"& > :last-child":{marginRight:0}},machineSelector:{width:248},cashInIcon:{width:12,height:12,borderRadius:12,backgroundColor:Y},cashOutIcon:{width:12,height:12,borderRadius:12,backgroundColor:_},txIcon:{width:12,height:12,borderRadius:12,backgroundColor:"#000"},topMachinesRadio:{display:"flex",flexDirection:"row"}},$O=Object(f.a)(zO),qO=function(e){var t=e.IconElement,n=e.IconComponent,r=e.label,a=$O();return Object(Me.jsxs)("span",{className:a.legendEntry,children:[!!n&&Object(Me.jsx)(n,{height:12}),!!t&&t,Object(Me.jsx)(Xe,{children:r})]})},HO=n(838),VO={dotOtWrapper:{position:"absolute",top:function(e){var t;return null!==(t=null===e||void 0===e?void 0:e.y)&&void 0!==t?t:0},left:function(e){var t;return null!==(t=null===e||void 0===e?void 0:e.x)&&void 0!==t?t:0},width:150,padding:12,borderRadius:8},dotOtTransactionAmount:{margin:[[8,0,8,0]]},dotOtTransactionVolume:{color:q},dotOtTransactionClasses:{marginTop:15,"& p > span":{marginLeft:5},"& p:last-child":{marginTop:5}}},UO=Object(f.a)(VO),GO=function(e){var t,n=e.coords,r=e.data,a=e.dateInterval,i=e.period,o=e.currency,c=e.representing,l=UO(n),s=F.a("hourOfDay",c.code)?[Wm(a[1],"HH:mm"),Wm(a[0],"HH:mm")]:[Mm(a[1],null,"day"===i.code?"MMM D, HH:mm":"MMM D"),Mm(a[0],null,"day"===i.code?"HH:mm":"MMM D")],d=Dl.a((function(e,t){return e.volume+=parseInt(t.fiat),"cashIn"===t.txClass&&e.cashIn++,"cashOut"===t.txClass&&e.cashOut++,e}),{volume:0,cashIn:0,cashOut:0},r);return Object(Me.jsxs)(Un.a,{className:l.dotOtWrapper,children:[Object(Me.jsx)(_e,{noMargin:!0,children:"day"===i.code||F.a("hourOfDay",c.code)?"".concat(s[0]," - ").concat(s[1]):"".concat(s[0])}),Object(Me.jsxs)(Xe,{noMargin:!0,className:l.dotOtTransactionAmount,children:[gn.a(r)," ",fu(gn.a(r),"transaction","transactions")]}),Object(Me.jsxs)(Xe,{noMargin:!0,className:l.dotOtTransactionVolume,children:[(t=d.volume,t.toLocaleString("en-US",{maximumFractionDigits:2}))," ",o," in volume"]}),Object(Me.jsxs)("div",{className:l.dotOtTransactionClasses,children:[Object(Me.jsxs)(nt,{noMargin:!0,children:[Object(Me.jsx)(Yc,{}),Object(Me.jsxs)("span",{children:[d.cashIn," cash-in"]})]}),Object(Me.jsxs)(nt,{noMargin:!0,children:[Object(Me.jsx)(tl,{}),Object(Me.jsxs)("span",{children:[d.cashOut," cash-out"]})]})]})]})},XO=Object(r.memo)(GO,(function(e,t){return e.coords===t.coords})),YO=n(835),_O=n(836),ZO=function(e){var t=e.data,n=e.timezone,a=e.setSelectionCoords,i=e.setSelectionData,o=e.setSelectionDateInterval,c=Object(r.useRef)(null),l=10,s=401,d=1163,u=Object(r.useMemo)((function(){return{top:25,right:.5,bottom:27,left:36.5}}),[]),m=parseInt(n.split(":")[1])*TO,h=function(e,t){for(var n=[],r=new Date(e[0]),a=new Date(e[1]),i=RO.a(r);i<=a;)n.push(RO.a(i)),i.setUTCHours(i.getUTCHours()+t);return n},b=Object(r.useCallback)((function(e,n){return M.a((function(t){var r=new Date(t.created).setTime(new Date(t.created).getTime()+new Date(t.created).getTimezoneOffset()*TO+m),a=new Date(r);return e.getUTCHours()<n.getUTCHours()&&a.getUTCHours()>=new Date(e).getUTCHours()&&a.getUTCHours()<new Date(n).getUTCHours()||e.getUTCHours()>n.getUTCHours()&&a.getUTCHours()<=new Date(e).getUTCHours()&&a.getUTCHours()<new Date(n).getUTCHours()}),t)}),[t,m]),p=Object(r.useCallback)((function(e,t){return Dl.a((function(e,t){return"cashIn"===t.txClass&&(e.cashIn+=al()(t.fiat).toNumber()),"cashOut"===t.txClass&&(e.cashOut+=al()(t.fiat).toNumber()),e}),{cashIn:0,cashOut:0},b(e,t))}),[b]),f=es.scaleUtc().domain([Ll()().startOf("day").utc(),Ll()().startOf("day").add(1,"day").utc()]).rangeRound([u.left,d-u.right]),j=B.a((function(e){var t=RO.a(e);e.setUTCHours(e.getUTCHours()+2);var n=RO.a(e);return[t,b(t,n)]}),YO.a(h(f.domain(),2))),g=B.a((function(e){var t=RO.a(e);e.setUTCHours(e.getUTCHours()+2);var n=RO.a(e);return[t,p(t,n)]}),YO.a(h(f.domain(),2))),O=es.scaleLinear().domain([0,0!==es.max(g.map((function(e){return e[1]})),(function(e){return e.cashIn+e.cashOut}))?es.max(g.map((function(e){return e[1]})),(function(e){return e.cashIn+e.cashOut})):50]).range([s-u.bottom,u.top]),x=Object(r.useCallback)((function(e){return e.attr("transform","translate(0, ".concat(s-u.bottom,")")).call(es.axisBottom(f).ticks(es.timeHour.every(2)).tickFormat(es.timeFormat("%H:%M")))}),[u,f]),v=Object(r.useCallback)((function(e){return e.attr("transform","translate(".concat(u.left,", 0)")).call(es.axisLeft(O).ticks(4.01).tickSize(0).tickFormat("")).call((function(e){return e.select(".domain").remove()}))}),[u,O]),y=Object(r.useCallback)((function(e){return e.attr("stroke",ie).append("g").selectAll("line").data(h(f.domain(),2)).join("line").attr("x1",(function(e){var t=f(e),n=h(f.domain(),2);return t===f(n[gn.a(n)-1])?t-1:.5+t})).attr("x2",(function(e){var t=f(e),n=h(f.domain(),2);return t===f(n[gn.a(n)-1])?t-1:.5+t})).attr("y1",u.top).attr("y2",s-u.bottom)}),[u,f]),w=Object(r.useCallback)((function(e){return e.append("g").selectAll("line").data(h(f.domain(),2)).join("rect").attr("x",(function(e){return f(e)})).attr("y",u.top).attr("width",(function(e){var t=Math.round(100*f(e))/100,n=h(f.domain(),2).map((function(e){return f(e)})),r=Ho.a((function(e){return e===t}),n),a=r+1===gn.a(n)?0:n[r+1]-n[r];return Math.round(100*a)/100})).attr("height",s-u.bottom-u.top).attr("stroke","transparent").attr("fill","transparent").on("mouseover",(function(e){var t=RO.a(new Date(e.target.__data__)),n=RO.a(t);t.setUTCHours(t.getUTCHours()+2);var r=RO.a(t),c=j.find((function(e){return hs.a(n,e[0])}))[1],l=RO.a(e.target.getBoundingClientRect().x),s=RO.a(e.target.getBoundingClientRect().x+e.target.getBoundingClientRect().width),d=e.target.x.baseVal.value<872.25?s+25:l-150-25,u=RO.a(e.target.getBoundingClientRect().y);o([r,n]),i(c),a({x:Math.round(d),y:Math.round(u)}),es.select("#event-rect-".concat(f(e.target.__data__))).attr("fill",ae)})).on("mouseleave",(function(e){es.select("#event-rect-".concat(f(e.target.__data__))).attr("fill","transparent"),o(null),i(null),a(null)}))}),[u,j,a,i,o,f]),C=Object(r.useCallback)((function(e){return e.append("g").selectAll("line").data(h(f.domain(),2)).join("rect").attr("id",(function(e){return"event-rect-".concat(f(e))})).attr("x",(function(e){return f(e)})).attr("y",u.top).attr("width",(function(e){var t=Math.round(100*f(e))/100,n=h(f.domain(),2).map((function(e){return f(e)})),r=Ho.a((function(e){return e===t}),n),a=r+1===gn.a(n)?0:n[r+1]-n[r];return Math.round(100*a)/100})).attr("height",s-u.bottom-u.top).attr("stroke","transparent").attr("fill","transparent")}),[u,f]),k=Object(r.useCallback)((function(){return es.selectAll(".tick text").style("stroke",le).style("fill",le).style("stroke-width",.5).style("font-family",fe)}),[]),S=Object(r.useCallback)((function(e){e.selectAll("rect").data(YO.a(h(f.domain(),2))).join("rect").attr("stroke",Y).attr("fill",Y).attr("x",(function(e){return f(e)+5})).attr("y",(function(e){var t=Ar.a((function(t){return hs.a(t[0],e)}),g);return O(t[1].cashIn)-u.top+u.bottom})).attr("height",(function(e){var t=Ar.a((function(t){return hs.a(t[0],e)}),g);return _O.a(0,s,s-O(t[1].cashIn)-u.bottom-5)})).attr("width",(function(e){var t=Math.round(100*f(e))/100,n=h(f.domain(),2).map((function(e){return f(e)})),r=Ho.a((function(e){return e===t}),n),a=r===gn.a(n)?0:n[r+1]-n[r];return Math.round(100*(a-l))/100})).attr("rx",2.5)}),[f,O,u,g]),N=Object(r.useCallback)((function(e){e.selectAll("rect").data(YO.a(h(f.domain(),2))).join("rect").attr("stroke",_).attr("fill",_).attr("x",(function(e){return f(e)+5})).attr("y",(function(e){var t=Ar.a((function(t){return hs.a(t[0],e)}),g);return O(t[1].cashIn+t[1].cashOut)-u.top+u.bottom})).attr("height",(function(e){var t=Ar.a((function(t){return hs.a(t[0],e)}),g);return _O.a(0,s,s-O(t[1].cashOut)-u.bottom-5)})).attr("width",(function(e){var t=Math.round(100*f(e))/100,n=h(f.domain(),2).map((function(e){return f(e)})),r=Ho.a((function(e){return e===t}),n),a=r===gn.a(n)?0:n[r+1]-n[r];return Math.round(100*(a-l))/100})).attr("rx",2.5)}),[f,O,u,g]),I=Object(r.useCallback)((function(){var e=es.select(c.current).attr("viewBox",[0,0,d,s]);return e.append("g").call(x),e.append("g").call(v),e.append("g").call(y),e.append("g").call(C),e.append("g").call(k),e.append("g").call(S),e.append("g").call(N),e.append("g").call(w),e.node()}),[x,v,C,w,y,S,k,N]);return Object(r.useEffect)((function(){es.select(c.current).selectAll("*").remove(),I()}),[I]),Object(Me.jsx)("svg",{ref:c})},KO=Object(r.memo)(ZO,(function(e,t){return hs.a(e.period,t.period)&&hs.a(e.selectedDay,t.selectedDay)})),QO=function(e){var t,n=e.data,a=e.period,i=e.timezone,o=e.setSelectionCoords,c=e.setSelectionData,l=e.setSelectionDateInterval,s=Object(r.useRef)(null),u=401,m=1163,h=Object(r.useMemo)((function(){return{top:25,right:.5,bottom:27,left:36.5}}),[]),b=parseInt(i.split(":")[1])*TO,p=Date.now()+b,f={day:[p-AO,p],week:[p-MO,p],month:[p-WO,p]},j=Object(r.useMemo)((function(){return{day:{freq:24,step:36e5,tick:es.utcHour.every(1),labelFormat:"%H:%M"},week:{freq:7,step:864e5,tick:es.utcDay.every(1),labelFormat:"%a %d"},month:{freq:30,step:864e5,tick:es.utcDay.every(1),labelFormat:"%d"}}}),[]),g=Object(r.useCallback)((function(e){var t=new Date(e),n=t.getUTCDate(),r=t.getUTCDay(),a=t.getUTCMonth(),i=new Date(t.getTime());i.setUTCDate(n-1);var o=i.getUTCDate(),c=i.getUTCDay(),l=i.getUTCMonth(),s=Ll.a.weekdaysShort(),d=Ll.a.monthsShort();return{previous:a!==l?d[l]:"".concat(s[c]," ").concat(o),current:a!==l?d[a]:"".concat(s[r]," ").concat(n)}}),[]),O=Object(r.useCallback)((function(e){for(var t=[],n=function(e){var t=j[a.code].step;return new Date(Math.ceil(e.valueOf()/t)*t)},r=0;r<=j[a.code].freq;r++){var i=new Date(p-r*j[a.code].step);n(i)>e[1]||(i<e[0]||t.push(n(i)))}return t}),[p,j,a.code]),x=Object(r.useCallback)((function(e){var t=[];t.push(e[1]);for(var n=function(e){var t=j[a.code].step;return new Date(Math.ceil(e.valueOf()/t)*t)},r=0;r<=j[a.code].freq;r++){var i=new Date(p-r*j[a.code].step);n(i)>new Date(e[1])||(i<new Date(e[0])||t.push(n(i)))}return t.push(e[0]),t}),[p,j,a.code]),v=es.scaleUtc().domain(f[a.code]).range([h.left,m-h.right]),y=es.scaleLinear().domain([0,1.03*(null!==(t=es.max(n,(function(e){return new al.a(e.fiat).toNumber()})))&&void 0!==t?t:1e3)]).nice().range([u-h.bottom,h.top]),w=function(e,t){for(var n=[t[1]].concat(Object(d.a)(M.a((function(e){return e>t[0]&&e<t[1]}),e)),[t[0]]),r=[],a=0;a<n.length-1;a++)r.push([n[a],n[a+1]]);return r},C=Object(r.useCallback)((function(e){return e.attr("transform","translate(0, ".concat(u-h.bottom,")")).call(es.axisBottom(v).ticks(j[a.code].tick).tickFormat((function(e){return es.timeFormat(j[a.code].labelFormat)(e.getTime()+e.getTimezoneOffset()*TO)}))).call((function(e){return e.select(".domain").remove()})).call((function(e){return e.append("line").attr("x1",h.left).attr("y1",-401+h.top+h.bottom).attr("x2",h.left).attr("stroke",J).attr("stroke-width",1)}))}),[h,j,a.code,v]),k=Object(r.useCallback)((function(e){return e.attr("transform","translate(".concat(h.left,", 0)")).call(es.axisLeft(y).ticks(4.01)).call((function(e){return e.select(".domain").remove()})).call((function(e){return e.selectAll(".tick line").filter((function(e){return 0===e})).clone().attr("x2",m-h.right-h.left).attr("stroke-width",1).attr("stroke",J)}))}),[h,y]),S=Object(r.useCallback)((function(e){e.attr("stroke",ie).attr("fill",ie).call((function(e){return e.append("g").selectAll("line").data(O(v.domain())).join("line").attr("x1",(function(e){return.5+v(e)})).attr("x2",(function(e){return.5+v(e)})).attr("y1",h.top).attr("y2",u-h.bottom)})).call((function(e){return e.append("g").selectAll("line").data(es.axisLeft(y).scale().ticks(4.01)).join("line").attr("y1",(function(e){return.5+y(e)})).attr("y2",(function(e){return.5+y(e)})).attr("x1",h.left).attr("x2",m-h.right)})).call((function(e){return e.append("g").selectAll("line").data(x(v.domain())).join("rect").attr("x",(function(e){return v(e)})).attr("y",h.top).attr("width",(function(e){var t=Math.round(100*v(e))/100,n=function(e,t){var n;return null!==(n=Ar.a((function(e){return t<=e[0]&&t>=e[1]}),e))&&void 0!==n?n:[0,0]}(w(x(v.domain()).map((function(e){return Math.round(100*v(e))/100})),v.range()),t);return Math.round(100*(n[0]-n[1]))/100})).attr("height",u-h.bottom-h.top).attr("stroke","transparent").attr("fill","transparent").on("mouseover",(function(e){var t=Math.round(100*e.target.x.baseVal.value)/100,r=function(e,t,n){for(var r=Nf.a(Ao.a(t)),a=t.length-1;a>=0;a--)if(n<r[a])return[e[a],e[a+1]]}(x(v.domain()),w(x(v.domain()).map((function(e){return Math.round(100*v(e))/100})),v.range()),t),a=n.filter((function(e){var t=new Date(e.created),n=t.setTime(t.getTime()+b);return n>new Date(r[1])&&n<=new Date(r[0])})),i=RO.a(e.target.getBoundingClientRect().x),s=RO.a(e.target.getBoundingClientRect().x+e.target.getBoundingClientRect().width),d=e.target.x.baseVal.value<872.25?s+25:i-150-25,u=RO.a(e.target.getBoundingClientRect().y);l(r),c(a),o({x:Math.round(d),y:Math.round(u)}),es.select(e.target).attr("fill",ae)})).on("mouseleave",(function(e){es.select(e.target).attr("fill","transparent"),l(null),c(null),o(null)}))})).call((function(e){return e.append("g").selectAll("line").data(O(v.domain()).filter((function(e){return"day"===a.code?0===e.getUTCHours():1===e.getUTCDate()}))).join("line").attr("class","dateSeparator").attr("x1",(function(e){return.5+v(e)})).attr("x2",(function(e){return.5+v(e)})).attr("y1",h.top-50).attr("y2",u-h.bottom).attr("stroke-width",5).join("text")})).call((function(e){var t,n,r=null===es||void 0===es||null===(t=es.select(".dateSeparator"))||void 0===t||null===(n=t.node())||void 0===n?void 0:n.getBBox();if(r){var i=O(v.domain()).filter((function(e){return"day"===a.code?0===e.getUTCHours():1===e.getUTCDate()})),o=g(i);return e.append("text").attr("x",r.x-10).attr("y",r.y+33).attr("text-anchor","end").attr("dy",".25em").text(o.previous)}})).call((function(e){var t,n,r=null===es||void 0===es||null===(t=es.select(".dateSeparator"))||void 0===t||null===(n=t.node())||void 0===n?void 0:n.getBBox();if(r){var i=O(v.domain()).filter((function(e){return"day"===a.code?0===e.getUTCHours():1===e.getUTCDate()})),o=g(i);return e.append("text").attr("x",r.x+10).attr("y",r.y+33).attr("text-anchor","start").attr("dy",".25em").text(o.current)}}))}),[h,O,g,v,y,a,x,n,b,o,c,l]),N=Object(r.useCallback)((function(){return es.selectAll(".tick text").style("stroke",le).style("fill",le).style("stroke-width",.5).style("font-family",fe)}),[]),I=Object(r.useCallback)((function(){return es.selectAll("text").style("stroke",se).style("fill",se).style("stroke-width",.5).style("font-family",fe)}),[]),E=Object(r.useCallback)((function(){es.selectAll(".tick line").style("stroke",J).style("fill",J)}),[]),F=Object(r.useCallback)((function(e){e.attr("stroke",J).attr("stroke-width",3).attr("stroke-dasharray","10, 5").call((function(e){var t,r;return e.append("line").attr("y1",.5+y(null!==(t=es.mean(n,(function(e){return new al.a(e.fiat).toNumber()})))&&void 0!==t?t:0)).attr("y2",.5+y(null!==(r=es.mean(n,(function(e){return new al.a(e.fiat).toNumber()})))&&void 0!==r?r:0)).attr("x1",h.left).attr("x2",m-h.right)}))}),[h,y,n]),L=Object(r.useCallback)((function(e){e.selectAll("circle").data(n).join("circle").attr("cx",(function(e){var t=new Date(e.created);return v(t.setTime(t.getTime()+b))})).attr("cy",(function(e){return y(new al.a(e.fiat).toNumber())})).attr("fill",(function(e){return"cashIn"===e.txClass?Y:_})).attr("r",3.5)}),[n,b,v,y]),P=Object(r.useCallback)((function(){var e=es.select(s.current).attr("viewBox",[0,0,m,u]);return e.append("g").call(S),e.append("g").call(F),e.append("g").call(C),e.append("g").call(k),e.append("g").call(N),e.append("g").call(I),e.append("g").call(E),e.append("g").call(L),e.node()}),[F,S,C,k,L,I,E,N]);return Object(r.useEffect)((function(){es.select(s.current).selectAll("*").remove(),P()}),[P]),Object(Me.jsx)("svg",{ref:s})},JO=Object(r.memo)(QO,(function(e,t){return hs.a(e.period,t.period)&&hs.a(e.selectedMachine,t.selectedMachine)})),ex=n(837),tx=n(245),nx=n(382),rx=function(e){var t=e.data,n=e.machines,a=e.currency,i=Object(r.useRef)(null),o=.15,c=401,l=Object(r.useMemo)((function(){return{top:25,right:.5,bottom:27,left:36.5}}),[]),s=RO.a(n),d=gn.a(n)>=5?s:B.a((function(e){return D.a(s[e])?{code:"ghostMachine".concat(e),display:""}:s[e]}),ex.a(yf.a,5)),u=Dl.a((function(e,n){return e[n.code]=M.a((function(e){return e.deviceId===n.code}),t),e}),{},d),m=Dm.a((function(e,t){return t[1]-e[1]}),B.a((function(e){return[e.code,(t=e.code,Dl.a((function(e,t){return e+al()(t.fiat).toNumber()}),0,u[t]))];var t}),d)),h=tx.a(5,m),b=cl.a(B.a((function(e){return[e[0],(t=e[0],Dl.a((function(e,t){return"cashIn"===t.txClass&&(e.cashIn+=al()(t.fiat).toNumber()),"cashOut"===t.txClass&&(e.cashOut+=al()(t.fiat).toNumber()),e}),{cashIn:0,cashOut:0},u[t]))];var t}),h)),p=es.scaleBand().domain(h).range([l.left,1163-l.right]).paddingInner(o),f=es.scaleLinear().domain([0,0!==es.max(h,(function(e){return e[1]}))?es.max(h,(function(e){return e[1]})):50]).range([c-l.bottom,l.top]),j=Object(r.useCallback)((function(e){return e.attr("class","x-axis-1").attr("transform","translate(0, ".concat(c-l.bottom,")")).call(es.axisBottom(p).tickFormat((function(e){var t;return"".concat(null!==(t=Ar.a((function(t){return t.code===e[0]}),d).display)&&void 0!==t?t:"")})).tickSize(0).tickPadding(10))}),[l,p,d]),g=Object(r.useCallback)((function(e){e.attr("class","x-axis-2").attr("transform","translate(0, ".concat(c-l.bottom,")")).call(es.axisBottom(p).tickFormat((function(e){return F.a("ghostMachine",e[0])?"":"".concat(e[1].toFixed(2)," ").concat(a)})).tickSize(0).tickPadding(10))}),[l,p,a]),O=Object(r.useCallback)((function(){es.selectAll(".x-axis-1 .tick text").attr("transform",(function(e){var t=(p.range()[1]-p.range()[0])/5;return"translate(".concat(-t/2.25+this.getBBox().width/2,", 0)")}))}),[p]),x=Object(r.useCallback)((function(){es.selectAll(".x-axis-2 .tick text").attr("transform",(function(e){var t=(p.range()[1]-p.range()[0])/5;return"translate(".concat(t/2.25-this.getBBox().width/2,", 0)")}))}),[p]),v=Object(r.useCallback)((function(e){return e.attr("transform","translate(".concat(l.left,", 0)")).call(es.axisLeft(f).ticks(4.01).tickSize(0).tickFormat("")).call((function(e){return e.select(".domain").remove()}))}),[l,f]),y=Object(r.useCallback)((function(){return es.selectAll(".tick text").style("stroke",le).style("fill",le).style("stroke-width",.5).style("font-family",fe)}),[]),w=Object(r.useCallback)((function(e){e.attr("stroke",ie).attr("fill",ie).call((function(e){return e.append("g").selectAll("line").data(nx.a(p.domain())).join("line").attr("x1",(function(e){var t=Ho.a((function(t){return hs.a(t,e)}),p.domain()),n=.075*(p(p.domain()[t])-p(p.domain()[t-1]));return.5+p(e)-n})).attr("x2",(function(e){var t=Ho.a((function(t){return hs.a(t,e)}),p.domain()),n=.075*(p(p.domain()[t])-p(p.domain()[t-1]));return.5+p(e)-n})).attr("y1",l.top).attr("y2",c-l.bottom)}))}),[l,p]),C=Object(r.useCallback)((function(e){e.selectAll("rect").data(sl.a(b)).join("rect").attr("fill",Y).attr("x",(function(e){return p([e[0],e[1].cashIn+e[1].cashOut])})).attr("y",(function(e){return f(e[1].cashIn)-l.top+l.bottom})).attr("height",(function(e){return _O.a(0,c,c-f(e[1].cashIn)-l.bottom-10)})).attr("width",p.bandwidth()).attr("rx",2.5)}),[b,p,f,l]),k=Object(r.useCallback)((function(e){e.selectAll("rect").data(sl.a(b)).join("rect").attr("fill",_).attr("x",(function(e){return p([e[0],e[1].cashIn+e[1].cashOut])})).attr("y",(function(e){return f(e[1].cashIn+e[1].cashOut)-l.top+l.bottom})).attr("height",(function(e){return _O.a(0,c,c-f(e[1].cashOut)-l.bottom-5)})).attr("width",p.bandwidth()).attr("rx",2.5)}),[b,p,f,l]),S=Object(r.useCallback)((function(){var e=es.select(i.current).attr("viewBox",[0,0,1163,c]);return e.append("g").call(j),e.append("g").call(g),e.append("g").call(v),e.append("g").call(y),e.append("g").call(w),e.append("g").call(C),e.append("g").call(k),e.append("g").call(O),e.append("g").call(x),e.node()}),[j,g,O,x,v,y,w,C,k]);return Object(r.useEffect)((function(){es.select(i.current).selectAll("*").remove(),S()}),[S]),Object(Me.jsx)("svg",{ref:i})},ax=Object(r.memo)(rx,(function(e,t){return hs.a(e.period,t.period)})),ix=function(e){var t=e.data,n=e.representing,a=e.period,i=e.timezone,o=e.currency,l=e.selectedMachine,s=e.machines,d=e.selectedDay,u=Object(r.useState)(null),m=Object(c.a)(u,2),h=m[0],b=m[1],p=Object(r.useState)(null),f=Object(c.a)(p,2),j=f[0],g=f[1],O=Object(r.useState)(null),x=Object(c.a)(O,2),v=x[0],y=x[1];return Object(Me.jsxs)("div",{children:[!D.a(h)&&Object(Me.jsx)(XO,{coords:h,dateInterval:j,data:v,period:a,currency:o,timezone:i,representing:n}),function(e){switch(e.code){case"overTime":return Object(Me.jsx)(JO,{data:t,period:a,timezone:i,setSelectionCoords:b,setSelectionDateInterval:g,setSelectionData:y,selectedMachine:l});case"topMachinesVolume":case"topMachinesTransactions":return Object(Me.jsx)(ax,{data:t,period:a,timezone:i,setSelectionCoords:b,setSelectionDateInterval:g,setSelectionData:y,selectedMachine:l,machines:M.a((function(e){return"all"!==e.code}),s),currency:o});case"hourOfDayVolume":case"hourOfDayTransactions":return Object(Me.jsx)(KO,{data:t,period:a,timezone:i,setSelectionCoords:b,setSelectionDateInterval:g,setSelectionData:y,selectedMachine:l,machines:M.a((function(e){return"all"!==e.code}),s),currency:o,selectedDay:d});default:throw new Error("There's no graph to represent ".concat(e))}}(n)]})},ox=Object(r.memo)(ix),cx=Object(f.a)(zO),lx=[{code:"hourOfDayTransactions",display:"Transactions"},{code:"hourOfDayVolume",display:"Volume"}],sx=B.a((function(e){return{code:HO.a(e),display:e}}),Ll.a.weekdays()),dx=function(e){var t=e.title,n=e.period,a=e.data,i=e.machines,o=e.selectedMachine,l=e.handleMachineChange,s=e.timezone,d=e.currency,u=cx(),m=Object(r.useState)(lx[0].code),h=Object(c.a)(m,2),b=h[0],p=h[1],f=Object(r.useState)(sx[0]),j=Object(c.a)(f,2),g=j[0],O=j[1],x={cashIn:Object(Me.jsx)("div",{className:u.cashInIcon}),cashOut:Object(Me.jsx)("div",{className:u.cashOutIcon})},v=parseInt(s.split(":")[1])*TO,y=Dl.a((function(e,t){var n=new Date(t.created);switch(n.setTime(n.getTime()+n.getTimezoneOffset()*TO+v),n.getDay()){case 0:e.sunday.push(t);break;case 1:e.monday.push(t);break;case 2:e.tuesday.push(t);break;case 3:e.wednesday.push(t);break;case 4:e.thursday.push(t);break;case 5:e.friday.push(t);break;case 6:e.saturday.push(t);break;default:throw new Error("Day of week not recognized")}return e}),cl.a(B.a((function(e){return[e.code,[]]}),sx)),a);return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)("div",{className:u.graphHeaderWrapper,children:[Object(Me.jsxs)("div",{className:u.graphHeaderLeft,children:[Object(Me.jsx)(He,{noMargin:!0,children:t}),Object(Me.jsxs)(No.a,{className:u.graphLegend,children:[Object(Me.jsx)(qO,{IconElement:x.cashIn,label:"Cash-in"}),Object(Me.jsx)(qO,{IconElement:x.cashOut,label:"Cash-out"})]})]}),Object(Me.jsxs)("div",{className:u.graphHeaderRight,children:[Object(Me.jsx)(xa,{options:lx,className:u.topMachinesRadio,value:b,onChange:function(e){return p(e.target.value)}}),Object(Me.jsx)(Ru,{label:"Day of the week",items:sx,default:sx[0],selectedItem:g,onSelectedItemChange:O}),Object(Me.jsx)(Ru,{label:"Machines",onSelectedItemChange:l,items:i,default:i[0],selectedItem:o})]})]}),Object(Me.jsx)(ox,{representing:Ar.a((function(e){return e.code===b}))(lx),period:n,data:y[g.code],timezone:s,currency:d,selectedMachine:o,machines:i,selectedDay:g})]})},ux=Object(f.a)(zO),mx=function(e){var t=e.title,n=e.representing,r=e.period,a=e.data,i=e.machines,o=e.selectedMachine,c=e.handleMachineChange,l=e.timezone,s=e.currency,d=ux(),u={cashIn:Object(Me.jsx)("div",{className:d.cashInIcon}),cashOut:Object(Me.jsx)("div",{className:d.cashOutIcon}),transaction:Object(Me.jsx)("div",{className:d.txIcon}),average:Object(Me.jsx)("svg",{height:"12",width:"18",children:Object(Me.jsx)("path",{stroke:J,strokeWidth:"3",strokeDasharray:"5, 2",d:"M 5 6 l 20 0"})})};return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)("div",{className:d.graphHeaderWrapper,children:[Object(Me.jsxs)("div",{className:d.graphHeaderLeft,children:[Object(Me.jsx)(He,{noMargin:!0,children:t}),Object(Me.jsxs)(No.a,{className:d.graphLegend,children:[Object(Me.jsx)(qO,{IconElement:u.cashIn,label:"Cash-in"}),Object(Me.jsx)(qO,{IconElement:u.cashOut,label:"Cash-out"}),Object(Me.jsx)(qO,{IconElement:u.transaction,label:"One transaction"}),Object(Me.jsx)(qO,{IconElement:u.average,label:"Average"})]})]}),Object(Me.jsx)("div",{className:d.graphHeaderRight,children:Object(Me.jsx)(Ru,{label:"Machines",onSelectedItemChange:c,items:i,default:i[0],selectedItem:o})})]}),Object(Me.jsx)(ox,{representing:n,period:r,data:a,timezone:l,currency:s,selectedMachine:o,machines:i})]})},hx=Object(f.a)(zO),bx=[{code:"topMachinesTransactions",display:"Transactions"},{code:"topMachinesVolume",display:"Volume"}],px=function(e){var t=e.title,n=e.period,a=e.data,i=e.machines,o=e.selectedMachine,l=e.timezone,s=e.currency,d=hx(),u=Object(r.useState)(bx[0].code),m=Object(c.a)(u,2),h=m[0],b=m[1],p={cashIn:Object(Me.jsx)("div",{className:d.cashInIcon}),cashOut:Object(Me.jsx)("div",{className:d.cashOutIcon})};return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)("div",{className:d.graphHeaderWrapper,children:[Object(Me.jsxs)("div",{className:d.graphHeaderLeft,children:[Object(Me.jsx)(He,{noMargin:!0,children:t}),Object(Me.jsxs)(No.a,{className:d.graphLegend,children:[Object(Me.jsx)(qO,{IconElement:p.cashIn,label:"Cash-in"}),Object(Me.jsx)(qO,{IconElement:p.cashOut,label:"Cash-out"})]})]}),Object(Me.jsx)("div",{className:d.graphHeaderRight,children:Object(Me.jsx)(xa,{options:bx,className:d.topMachinesRadio,value:h,onChange:function(e){return b(e.target.value)}})})]}),Object(Me.jsx)(ox,{representing:Ar.a(W.a("code",h),bx),period:n,data:a,timezone:l,currency:s,selectedMachine:o,machines:i})]})},fx=Object(f.a)(zO),jx=[{code:"all",display:"All machines"}],gx=[{code:"overTime",display:"Over time"},{code:"topMachines",display:"Top Machines"},{code:"hourOfTheDay",display:"Hour of the day"}],Ox=[{code:"day",display:"Last 24 hours"},{code:"week",display:"Last 7 days"},{code:"month",display:"Last 30 days"}],xx={day:AO,week:MO,month:WO},vx=x()(yO||(yO=Object(l.a)(["\n query transactions($limit: Int, $from: Date, $until: Date) {\n transactions(limit: $limit, from: $from, until: $until) {\n id\n txClass\n txHash\n toAddress\n commissionPercentage\n expired\n machineName\n operatorCompleted\n sendConfirmed\n dispense\n hasError: error\n deviceId\n fiat\n cashInFee\n fiatCode\n cryptoAtoms\n cryptoCode\n toAddress\n created\n }\n }\n"]))),yx=x()(wO||(wO=Object(l.a)(["\n query getData {\n config\n machines {\n name\n deviceId\n }\n fiatRates {\n code\n name\n rate\n }\n }\n"]))),wx=function(e){var t,n=e.label,r=e.value,a=e.oldValue,i=e.currency,o=fx(),c=100*(r-a)/(!a||hs.a(a,0)?1:a),l=(t={},Object(z.a)(t,o.growthPercentage,!0),Object(z.a)(t,o.growth,DO.a(r,a)),Object(z.a)(t,o.decline,DO.a(a,r)),t);return Object(Me.jsxs)("div",{className:o.overviewEntry,children:[Object(Me.jsx)(Xe,{noMargin:!0,children:n}),Object(Me.jsxs)(_e,{noMargin:!0,className:o.overviewFieldWrapper,children:[Object(Me.jsx)("span",{children:r.toLocaleString("en-US",{maximumFractionDigits:2})}),!!i&&" ".concat(i)]}),Object(Me.jsxs)("span",{className:o.overviewGrowth,children:[DO.a(c,0)&&Object(Me.jsx)(Zl,{height:10}),BO.a(c,0)&&Object(Me.jsx)(Wl,{height:10}),hs.a(c,0)&&Object(Me.jsx)(Vl,{height:10}),Object(Me.jsxs)(Xe,{noMargin:!0,className:E()(l),children:[c.toLocaleString("en-US",{maximumFractionDigits:2}),"%"]})]})]})},Cx=function(){var e,t,n,a,i,o=fx(),l=Object(u.c)(vx),d=l.data,m=l.loading,h=Object(u.c)(yx),b=h.data,p=h.loading,f=Object(r.useState)(gx[0]),j=Object(c.a)(f,2),g=j[0],O=j[1],x=Object(r.useState)(Ox[0]),v=Object(c.a)(x,2),y=v[0],w=v[1],C=Object(r.useState)(jx[0]),k=Object(c.a)(C,2),S=k[0],N=k[1],I=m||p,E=null!==(e=A.a(["transactions"])(d))&&void 0!==e?e:[],F=null!==(t=A.a(["machines"])(b))&&void 0!==t?t:[],L=null!==(n=A.a(["config"])(b))&&void 0!==n?n:[],P=null!==(a=A.a(["fiatRates"])(b))&&void 0!==a?a:[],D=Cl("locale")(L).fiatCurrency,R=null===L||void 0===L?void 0:L.locale_timezone,T=function(e){if(e.fiatCode===D)return e;var t=Ar.a(W.a("code",e.fiatCode))(P),n=Ar.a(W.a("code",D))(P),r=(null===n||void 0===n?void 0:n.rate)/(null===t||void 0===t?void 0:t.rate);return Object(s.a)(Object(s.a)({},e),{},{fiat:parseFloat(e.fiat)*r})},z=null!==(i=B.a(T)(null===E||void 0===E?void 0:E.filter((function(e){return(!e.dispensed||!e.expired)&&(e.sendConfirmed||e.dispense)}))))&&void 0!==i?i:[],$=RO.a(jx);Cm.a((function(e){return $.push({code:e.deviceId,display:e.name})}),F);var q=M.a((function(e){return"all"===S.code||e.deviceId===S.code}),z),H=function(e){var t,n;return{current:null!==(t=q.filter((function(t){return new Date(t.created)>=Date.now()-xx[e]})))&&void 0!==t?t:[],previous:null!==(n=q.filter((function(t){return new Date(t.created)<Date.now()-xx[e]&&new Date(t.created)>=Date.now()-2*xx[e]})))&&void 0!==n?n:[]}},V={current:H(y.code).current.length,previous:H(y.code).previous.length},U={current:Pl.a(B.a((function(e){return e.fiat}),H(y.code).current))/(0===V.current?1:V.current),previous:Pl.a(B.a((function(e){return e.fiat}),H(y.code).previous))/(0===V.previous?1:V.previous)},G={current:Pl.a(B.a((function(e){return e.fiat}),H(y.code).current)),previous:Pl.a(B.a((function(e){return e.fiat}),H(y.code).previous))},X={current:Pl.a(B.a((function(e){return e.fiat*e.commissionPercentage}),H(y.code).current)),previous:Pl.a(B.a((function(e){return e.fiat*e.commissionPercentage}),H(y.code).previous))};return!I&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Do,{title:"Analytics",children:Object(Me.jsxs)(No.a,{className:o.overviewLegend,children:[Object(Me.jsx)(qO,{IconComponent:Zl,label:"Up since last period"}),Object(Me.jsx)(qO,{IconComponent:Wl,label:"Down since last period"}),Object(Me.jsx)(qO,{IconComponent:Vl,label:"Same since last period"})]})}),Object(Me.jsxs)("div",{className:o.dropdownsOverviewWrapper,children:[Object(Me.jsxs)("div",{className:o.dropdowns,children:[Object(Me.jsx)(Ru,{label:"Representing",onSelectedItemChange:O,items:gx,default:gx[0],selectedItem:g}),Object(Me.jsx)(Ru,{label:"Time period",onSelectedItemChange:w,items:Ox,default:Ox[0],selectedItem:y})]}),Object(Me.jsxs)("div",{className:o.overview,children:[Object(Me.jsx)(wx,{label:"Transactions",value:V.current,oldValue:V.previous}),Object(Me.jsx)("div",{className:o.verticalLine}),Object(Me.jsx)(wx,{label:"Avg. txn amount",value:U.current,oldValue:U.previous,currency:D}),Object(Me.jsx)("div",{className:o.verticalLine}),Object(Me.jsx)(wx,{label:"Volume",value:G.current,oldValue:G.previous,currency:D}),Object(Me.jsx)("div",{className:o.verticalLine}),Object(Me.jsx)(wx,{label:"Commissions",value:X.current,oldValue:X.previous,currency:D})]})]}),function(e){switch(e.code){case"overTime":return Object(Me.jsx)(mx,{title:"Transactions over time",representing:e,period:y,data:B.a(T)(H(y.code).current),machines:$,selectedMachine:S,handleMachineChange:N,timezone:R,currency:D});case"topMachines":return Object(Me.jsx)(px,{title:"Transactions over time",representing:e,period:y,data:B.a(T)(H(y.code).current),machines:$,selectedMachine:S,handleMachineChange:N,timezone:R,currency:D});case"hourOfTheDay":return Object(Me.jsx)(dx,{title:"Avg. transactions per hour of the day",representing:e,period:y,data:B.a(T)(H(y.code).current),machines:$,selectedMachine:S,handleMachineChange:N,timezone:R,currency:D});default:throw new Error("There's no graph info to represent ".concat(e))}}(g)]})},kx=n(841),Sx={grid:{flex:1,height:"100%"},content:{display:"flex",flexDirection:"column",flex:1,marginLeft:48},footer:{margin:[["auto",0,24,"auto"]]},modalTitle:{margin:[["auto",0,8.5,"auto"]]},subtitle:{display:"flex",justifyContent:"space-between",alignItems:"center",flexDirection:"row"},white:{color:Z},deleteButton:{paddingLeft:13},addressRow:{marginLeft:8},error:{color:me}},Nx=Object(f.a)(Sx),Ix=function(e){var t=e.onClose,n=e.selectedCoin,r=e.addToBlacklist,a=e.errorMsg,i=Nx();return Object(Me.jsxs)(sO,{closeOnBackdropClick:!0,width:676,height:200,handleClose:t,open:!0,children:[Object(Me.jsx)(pn.d,{validateOnBlur:!1,validateOnChange:!1,initialValues:{address:""},validationSchema:xn.e({address:xn.g().trim().required("An address is required")}),onSubmit:function(e,t){var a=e.address,i=t.resetForm;!function(e){"BCH"!==n.code||e.startsWith("bitcoincash:")||(e="bitcoincash:"+e),r(n.code,e)}(a.trim()),i()},children:Object(Me.jsxs)(pn.c,{id:"address-form",children:[Object(Me.jsx)(Ve,{className:i.modalTitle,children:n.display?"Blacklist ".concat(HO.a(n.display)," address"):""}),Object(Me.jsx)("span",{className:i.error,children:a}),Object(Me.jsx)(pn.b,{name:"address",fullWidth:!0,autoComplete:"off",label:"Paste new address to blacklist here",placeholder:"ex: ".concat({BTC:"1ADwinnimZKGgQ3dpyfoUZvJh4p1UWSSpD",ETH:"0x71C7656EC7ab88b098defB751B7401B5f6d8976F",LTC:"LPKvbjwV1Kaksktzkr7TMK3FQtQEEe6Wqa",DASH:"XqQ7gU8eM76rEfey726cJpT2RGKyJyBrcn",ZEC:"t1KGyyv24eL354C9gjveBGEe8Xz9UoPKvHR",BCH:"qrd6za97wm03lfyg82w0c9vqgc727rhemg5yd9k3dm"}[n.code]),component:Ua})]})}),Object(Me.jsx)("div",{className:i.footer,children:Object(Me.jsx)(No.a,{display:"flex",justifyContent:"flex-end",children:Object(Me.jsx)(or,{type:"submit",form:"address-form",children:"Blacklist address"})})})]})};function Ex(){return(Ex=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Fx(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Lx=r.createElement("defs",null,r.createElement("circle",{id:"path-100",cx:80,cy:80,r:80}),r.createElement("rect",{id:"path-300",x:28,y:44,width:104,height:116,rx:4}),r.createElement("filter",{x:"-23.1%",y:"-20.7%",width:"146.2%",height:"141.4%",filterUnits:"objectBoundingBox",id:"filter-4"},r.createElement("feOffset",{dx:0,dy:0,in:"SourceAlpha",result:"shadowOffsetOuter1"}),r.createElement("feGaussianBlur",{stdDeviation:8,in:"shadowOffsetOuter1",result:"shadowBlurOuter1"}),r.createElement("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.08 0",type:"matrix",in:"shadowBlurOuter1"})),r.createElement("rect",{id:"path-5",x:37,y:66,width:84,height:8,rx:2}),r.createElement("mask",{id:"mask-6",maskContentUnits:"userSpaceOnUse",maskUnits:"objectBoundingBox",x:0,y:0,width:84,height:8,fill:"white"},r.createElement("use",{xlinkHref:"#path-5"})),r.createElement("rect",{id:"path-7",x:37,y:78,width:84,height:8,rx:2}),r.createElement("mask",{id:"mask-8",maskContentUnits:"userSpaceOnUse",maskUnits:"objectBoundingBox",x:0,y:0,width:84,height:8,fill:"white"},r.createElement("use",{xlinkHref:"#path-7"})),r.createElement("rect",{id:"path-9",x:37,y:90,width:84,height:8,rx:2}),r.createElement("mask",{id:"mask-10",maskContentUnits:"userSpaceOnUse",maskUnits:"objectBoundingBox",x:0,y:0,width:84,height:8,fill:"white"},r.createElement("use",{xlinkHref:"#path-9"})),r.createElement("rect",{id:"path-11",x:37,y:102,width:84,height:8,rx:2}),r.createElement("mask",{id:"mask-12",maskContentUnits:"userSpaceOnUse",maskUnits:"objectBoundingBox",x:0,y:0,width:84,height:8,fill:"white"},r.createElement("use",{xlinkHref:"#path-11"}))),Px=r.createElement("g",{id:"\\u21B3-v13a",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"transactions_v13a#1-(empty-table)",transform:"translate(-640.000000, -220.000000)"},r.createElement("g",{id:"Group-2",transform:"translate(640.000000, 220.000000)"},r.createElement("g",{id:"Rectangle"},r.createElement("mask",{id:"mask-200",fill:"white"},r.createElement("use",{xlinkHref:"#path-100"})),r.createElement("use",{id:"Mask",fill:"#EBEFFF",xlinkHref:"#path-100"}),r.createElement("g",{mask:"url(#mask-200)"},r.createElement("use",{fill:"black",fillOpacity:1,filter:"url(#filter-4)",xlinkHref:"#path-300"}),r.createElement("use",{fill:"#FFFFFF",fillRule:"evenodd",xlinkHref:"#path-300"}))),r.createElement("use",{id:"Rectangle",stroke:"#5F668A",mask:"url(#mask-6)",strokeDasharray:1,xlinkHref:"#path-5"}),r.createElement("use",{id:"Rectangle-Copy",stroke:"#5F668A",mask:"url(#mask-8)",strokeDasharray:1,xlinkHref:"#path-7"}),r.createElement("use",{id:"Rectangle-Copy-2",stroke:"#5F668A",mask:"url(#mask-10)",strokeDasharray:1,xlinkHref:"#path-9"}),r.createElement("use",{id:"Rectangle-Copy-3",stroke:"#5F668A",mask:"url(#mask-12)",strokeDasharray:1,xlinkHref:"#path-11"}),r.createElement("rect",{id:"Rectangle",fill:"#EBEFFF",x:37,y:56,width:84,height:6,rx:2}))));function Dx(e,t){var n=e.title,a=e.titleId,i=Fx(e,["title","titleId"]);return r.createElement("svg",Ex({width:"160px",height:"160px",viewBox:"0 0 160 160",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Lx,Px)}var Bx,Rx,Tx,Ax,Mx,Wx,zx,$x=r.forwardRef(Dx),qx=(n.p,Object(f.a)({emptyTable:{width:"100%",display:"flex",flexDirection:"column",alignItems:"center",marginTop:52}})),Hx=Object(r.memo)((function(e){var t=e.message,n=qx();return Object(Me.jsxs)("div",{className:n.emptyTable,children:[Object(Me.jsx)($x,{}),Object(Me.jsx)(Ue,{children:t})]})})),Vx=Object(f.a)({table:{tableLayout:"fixed",borderCollapse:"separate",borderSpacing:"0 0"}}),Ux=Object(r.memo)((function(e){var t=e.className,n=e.children,r=Object($.a)(e,["className","children"]),a=Vx();return Object(Me.jsx)("table",Object(s.a)(Object(s.a)({},r),{},{className:E()(a.table,t),children:n}))})),Gx=Object(r.memo)((function(e){var t=e.children,n=Object($.a)(e,["children"]);return Object(Me.jsx)("tbody",Object(s.a)(Object(s.a)({},n),{},{children:t}))})),Xx=Object(f.a)({td:{padding:[[0,24]]},alignRight:{textAlign:"right"}}),Yx=Object(r.memo)((function(e){var t,n=e.colspan,r=e.rightAlign,a=e.className,i=e.children,o=Object($.a)(e,["colspan","rightAlign","className","children"]),c=Xx(),l=(t={},Object(z.a)(t,c.td,!0),Object(z.a)(t,c.alignRight,r),t);return Object(Me.jsx)("td",Object(s.a)(Object(s.a)({colSpan:n,className:E()(l,a)},o),{},{children:i}))})),_x=Object(r.memo)((function(e){var t=e.children,n=Object($.a)(e,["children"]);return Object(Me.jsx)("thead",Object(s.a)(Object(s.a)({},n),{},{children:t}))})),Zx=Re.tl2,Kx=Object(f.a)({th:{extend:Zx,backgroundColor:Le,height:Ie,textAlign:"left",color:Z,padding:"0 ".concat(24,"px")},alignRight:{textAlign:"right"}}),Qx=Object(r.memo)((function(e){var t,n=e.rightAlign,r=e.children,a=e.className,i=Object($.a)(e,["rightAlign","children","className"]),o=Kx(),c=(t={},Object(z.a)(t,o.th,!0),Object(z.a)(t,o.alignRight,n),t);return Object(Me.jsx)("th",Object(s.a)(Object(s.a)({},i),{},{className:E()(c,a),children:r}))})),Jx=Re.info2,ev=Re.p,tv=Object(f.a)({tr:{extend:ev,padding:4,height:Ee,backgroundColor:"#ffffff"},lg:{extend:Jx,height:76},sm:{height:30},error:{backgroundColor:Pe},success:{backgroundColor:De}}),nv=Object(r.memo)((function(e){var t,n=e.className,r=e.children,a=e.header,i=e.error,o=e.success,c=e.size,l=void 0===c?"sm":c,d=Object($.a)(e,["className","children","header","error","success","size"]),u=tv(),m=(t={},Object(z.a)(t,u.tr,!a),Object(z.a)(t,u.sm,!a&&"sm"===l),Object(z.a)(t,u.lg,!a&&"lg"===l),Object(z.a)(t,u.error,i),Object(z.a)(t,u.success,o),t);return Object(Me.jsx)("tr",Object(s.a)(Object(s.a)({className:E()(m,n)},d),{},{children:r}))})),rv=Object(f.a)(Yp),av=function(e){var t,n=e.id,r=e.elements,a=e.data,i=e.width,o=e.Details,c=e.expanded,l=e.expandRow,d=e.expWidth,u=e.expandable,m=e.onClick,h=e.size,b=Object($.a)(e,["id","elements","data","width","Details","expanded","expandRow","expWidth","expandable","onClick","size"]),p=rv(),f=m||u,j=(t={},Object(z.a)(t,p.pointer,f),Object(z.a)(t,p.row,!0),Object(z.a)(t,p.expanded,c),t);return Object(Me.jsxs)("div",{className:p.rowWrapper,children:[Object(Me.jsx)("div",{className:E()(Object(z.a)({},p.before,c&&0!==n)),children:Object(Me.jsxs)(au,{size:h,className:E()(j),onClick:function(){u&&l(n,a),m&&m(a)},error:a.error,errorMessage:a.errorMessage,children:[r.map((function(e,t){var n=e.view,r=void 0===n?function(e){return null===e||void 0===e?void 0:e.toString()}:n,i=Object($.a)(e,["view"]);return Object(Me.jsx)(tu,Object(s.a)(Object(s.a)({},i),{},{children:r(a)}),t)})),u&&Object(Me.jsx)(tu,{width:d,textAlign:"center",children:Object(Me.jsxs)("button",{onClick:function(){return l(n,a)},className:p.expandButton,children:[c&&Object(Me.jsx)(uf,{}),!c&&Object(Me.jsx)(ef,{})]})})]})}),u&&c&&Object(Me.jsx)("div",{className:p.after,children:Object(Me.jsx)(au,{className:E()(Object(z.a)({},p.expanded,c)),children:Object(Me.jsx)(tu,{width:i,children:Object(Me.jsx)(o,{it:a,timezone:b.timezone})})})})]})},iv=function(e){var t=e.elements,n=void 0===t?[]:t,a=e.data,i=void 0===a?[]:a,o=e.Details,l=(e.className,e.expandable),d=e.initialExpanded,u=e.onClick,m=e.loading,h=e.emptyText,b=e.rowSize,p=Object($.a)(e,["elements","data","Details","className","expandable","initialExpanded","onClick","loading","emptyText","rowSize"]),f=Object(r.useState)(d),j=Object(c.a)(f,2),g=j[0],O=j[1];Object(r.useEffect)((function(){return O(d)}),[d]);var x=L.a(Pl.a,B.a(R.a("width")))(n),v=1200-x,y=x+(l?v:0),w=rv({width:y}),C=function(e,t){t.id?(k.clear(t.id),O(t.id===g?null:t.id)):(k.clear(e),O(e===g?null:e))},k=new Xp.c({defaultHeight:58,fixedWidth:!0});function S(e){var t=e.index,r=e.key,a=e.parent,c=e.style;return Object(Me.jsx)(Xp.b,{cache:k,columnIndex:0,parent:a,rowIndex:t,children:function(e){var r=e.registerChild;return Object(Me.jsx)("div",{ref:r,style:c,children:Object(Me.jsx)(av,{width:y,size:b,id:i[t].id?i[t].id:t,expWidth:v,elements:n,data:i[t],Details:o,expanded:i[t].id?i[t].id===g:t===g,expandRow:C,expandable:l,onClick:u,timezone:p.timezone})})}},r)}return Object(Me.jsx)(No.a,{display:"flex",flex:"1",flexDirection:"column",children:Object(Me.jsxs)(Kd,{className:w.table,children:[Object(Me.jsxs)(Qd,{children:[n.map((function(e,t){var n=e.width,r=e.className,a=e.textAlign,i=e.header;return Object(Me.jsx)(nu,{width:n,className:r,textAlign:a,children:i},t)})),l&&Object(Me.jsx)(nu,{width:v})]}),Object(Me.jsxs)(eu,{className:w.body,children:[m&&Object(Me.jsx)(Ue,{children:"Loading..."}),!m&&Wr.a(i)&&Object(Me.jsx)(Hx,{message:h}),Object(Me.jsx)(Xp.a,{disableWidth:!0,children:function(e){var t=e.height;return Object(Me.jsx)(Xp.d,Object(s.a)(Object(s.a)({style:{overflow:"inherit",outline:"none"}},p),{},{height:m?0:t,width:y,rowCount:i.length,rowHeight:k.rowHeight,rowRenderer:S,overscanRowCount:5,deferredMeasurementCache:k}))}})]})]})})},ov=Object(f.a)(Sx),cv=function(e){var t=e.data,n=e.selectedCoin,a=e.handleDeleteEntry,i=e.errorMessage,o=e.setErrorMessage,l=e.deleteDialog,s=e.setDeleteDialog,d=ov(),u=Object(r.useState)(),m=Object(c.a)(u,2),h=m[0],b=m[1],p=[{name:"address",header:Object(Me.jsx)(et,{className:d.white,children:"Addresses"}),width:800,textAlign:"left",size:"sm",view:function(e){return Object(Me.jsx)("div",{className:d.addressRow,children:Object(Me.jsx)(sb,{children:A.a(["address"],e)})})}},{name:"deleteButton",header:Object(Me.jsx)(et,{className:d.white,children:"Delete"}),width:130,textAlign:"center",size:"sm",view:function(e){return Object(Me.jsx)(tr,{className:d.deleteButton,onClick:function(){s(!0),b(e)},children:Object(Me.jsx)(Xu,{})})}}],f=n?t[n.code]:t[il.a(t)[0]];return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(iv,{data:f,elements:p,emptyText:"No blacklisted addresses so far",name:"blacklistTable"}),Object(Me.jsx)(yu,{open:l,onDismissed:function(){s(!1),o(null)},onConfirmed:function(){o(null),a(A.a(["cryptoCode"],h),A.a(["address"],h))},errorMessage:i})]})},lv=Object(f.a)(Sx),sv=kx.a((function(e){return e.cryptoCode})),dv=x()(Bx||(Bx=Object(l.a)(["\n mutation DeleteBlacklistRow($cryptoCode: String!, $address: String!) {\n deleteBlacklistRow(cryptoCode: $cryptoCode, address: $address) {\n cryptoCode\n address\n }\n }\n"]))),uv=x()(Rx||(Rx=Object(l.a)(["\n query getBlacklistData {\n blacklist {\n cryptoCode\n address\n }\n cryptoCurrencies {\n display\n code\n }\n }\n"]))),mv=x()(Tx||(Tx=Object(l.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),hv=x()(Ax||(Ax=Object(l.a)(["\n query getData {\n config\n }\n"]))),bv=x()(Mx||(Mx=Object(l.a)(["\n mutation InsertBlacklistRow($cryptoCode: String!, $address: String!) {\n insertBlacklistRow(cryptoCode: $cryptoCode, address: $address) {\n cryptoCode\n address\n }\n }\n"]))),pv=function(){var e,t,n,a=Object(u.c)(uv).data,i=Object(u.c)(hv).data,o=Object(r.useState)(!1),l=Object(c.a)(o,2),s=l[0],d=l[1],m=Object(r.useState)({code:"BTC",display:"Bitcoin"}),b=Object(c.a)(m,2),p=b[0],f=b[1],j=Object(r.useState)(null),g=Object(c.a)(j,2),O=g[0],x=g[1],v=Object(r.useState)(!1),y=Object(c.a)(v,2),w=y[0],C=y[1],k=Object(u.b)(dv,{onError:function(e){var t=e.message;x(null!==t&&void 0!==t?t:"Error while deleting row")},onCompleted:function(){return C(!1)},refetchQueries:function(){return["getBlacklistData"]}}),S=Object(c.a)(k,1)[0],N=Object(u.b)(bv,{onError:function(){return console.log("Error while adding row")},refetchQueries:function(){return["getBlacklistData"]}}),I=Object(c.a)(N,1)[0],E=Object(u.b)(mv,{refetchQueries:function(){return["getData"]}}),F=Object(c.a)(E,1)[0],L=lv(),P=null!==(e=A.a(["blacklist"])(a))&&void 0!==e?e:[],B=null!==(t=A.a(["cryptoCurrencies"],a))&&void 0!==t?t:[],R=sv(P),T=(null===i||void 0===i?void 0:i.config)&&Cl("compliance")(i.config),M=null!==(n=null===T||void 0===T?void 0:T.rejectAddressReuse)&&void 0!==n&&n,z=function(e,t){try{return!D.a(hb.utils.parseUrl(e,"main",t))}catch(n){return!1}},$=function(){var e=Object(nc.a)(tc.a.mark((function e(t,n){var r,a;return tc.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(x(null),z(t,n)){e.next=4;break}return x("Invalid address"),e.abrupt("return");case 4:return e.next=6,I({variables:{cryptoCode:t,address:n}});case 6:if((r=e.sent).errors){e.next=9;break}return e.abrupt("return",d(!1));case 9:a=r.errors.some((function(e){return e.message.includes("duplicate")})),x(a?"This address is already being blocked":"Server error");case 11:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Do,{title:"Blacklisted addresses",children:Object(Me.jsx)(No.a,{display:"flex",justifyContent:"flex-end",children:Object(Me.jsx)(or,{color:"primary",onClick:function(){return d(!0)},children:"Blacklist new addresses"})})}),Object(Me.jsxs)(h.a,{container:!0,className:L.grid,children:[Object(Me.jsx)(di,{data:B,isSelected:W.a("code",p.code),displayName:function(e){return e.display},onClick:function(e){f({code:e.code,display:e.display})}}),Object(Me.jsxs)("div",{className:L.content,children:[Object(Me.jsxs)(No.a,{display:"flex",justifyContent:"space-between",mb:3,children:[Object(Me.jsxs)(Ue,{noMargin:!0,className:L.subtitle,children:[p.display?"".concat(p.display," blacklisted addresses"):""," "]}),Object(Me.jsxs)(No.a,{display:"flex",alignItems:"center",justifyContent:"flex-end",mr:"-5px",children:[Object(Me.jsx)(Xe,{children:"Reject reused addresses"}),Object(Me.jsx)(Ca,{checked:M,onChange:function(e){!function(e){var t=kl("compliance")(e);F({variables:{config:t}})}({rejectAddressReuse:e.target.checked})},value:M}),Object(Me.jsx)(tt,{children:M?"On":"Off"}),Object(Me.jsx)(Eb,{width:304,children:Object(Me.jsx)(Xe,{children:'The "Reject reused addresses" option means that all addresses that are used once will be automatically rejected if there\'s an attempt to use them again on a new transaction.'})})]})]}),Object(Me.jsx)(cv,{data:R,selectedCoin:p,handleDeleteEntry:function(e,t){S({variables:{cryptoCode:e,address:t}})},errorMessage:O,setErrorMessage:x,deleteDialog:w,setDeleteDialog:C})]})]}),s&&Object(Me.jsx)(Ix,{onClose:function(){x(null),d(!1)},errorMsg:O,selectedCoin:p,addToBlacklist:$})]})},fv={logo:{maxHeight:80,maxWidth:200},subtitle:{margin:0,marginBottom:42,textAlign:"center"},text:{margin:0},button:{margin:[[0,"auto"]]},modalContent:{display:"flex",flexDirection:"column",justifyContent:"space-between",flex:1,padding:[[0,34,107,34]]},innerContent:{paddingBottom:72},title:{color:_,marginBottom:12,marginTop:30,textAlign:"center"},titleDecorator:{verticalAlign:"bottom",marginRight:12,width:24,height:26}},jv=Object(f.a)(fv),gv=function(e){var t=e.name,n=e.onContinue,r=jv();return Object(Me.jsxs)("div",{className:r.modalContent,children:[Object(Me.jsxs)("div",{className:r.innerContent,children:[Object(Me.jsxs)(qe,{className:r.title,children:[Object(Me.jsx)(tl,{className:r.titleDecorator}),Object(Me.jsx)("span",{children:"Enable cash-out"})]}),Object(Me.jsx)(_e,{className:r.subtitle,children:t}),Object(Me.jsxs)(Xe,{children:["You are about to activate cash-out functionality on your ",t," ","machine which will allow your customers to sell crypto to you."]}),Object(Me.jsx)(Xe,{children:"In order to activate cash-out for this machine, please enter the denominations for the machine."})]}),Object(Me.jsx)(An,{className:r.button,onClick:n,children:"Start configuration"})]})},Ov=n.p+"static/media/cashout-cassette-1.fac6c691.svg",xv=n.p+"static/media/cashout-cassette-2.34a98cfa.svg",vv={title:{margin:[[0,0,12,0]]},titleDiv:{paddingBottom:32},subtitle:{margin:[[32,0,21,0]]},edit:{margin:[[0,0,0,0]]},error:{color:me},bill:{width:131,display:"flex",alignItems:"center",justifyContent:"end"},billInput:{width:"100%"},suffix:{paddingLeft:16},button:{marginLeft:"auto"},submit:{float:"right"},picker:{width:150},header:{display:"flex",paddingBottom:95},thirdStepHeader:{display:"flex",paddingBottom:188},step:{flex:1},stepImage:{position:"relative",top:-20,right:14},content:{display:"flex",flexDirection:"column",justifyContent:"space-between",flex:1,paddingBottom:32},disclaimer:{display:"flex",flex:1,flexDirection:"column",justifyContent:"space-between"},disclaimerIcon:{float:"left",margin:[[-4,16,48,0]]}},yv=Object(f.a)(vv),wv=function(e){var t=e.name,n=e.step,r=e.schema,a=e.error,i=e.lastStep,o=e.onContinue,c=e.steps,l=e.fiatCurrency,s=e.options,d=yv(),u=i?"Finish":"Next",m={1:Ov,2:xv};return Object(Me.jsxs)("div",{className:d.content,children:[Object(Me.jsxs)("div",{className:d.titleDiv,children:[Object(Me.jsx)(_e,{className:d.title,children:t}),Object(Me.jsx)(OO,{steps:3,currentStep:n})]}),n<=2&&Object(Me.jsx)(pn.d,{validateOnBlur:!1,validateOnChange:!1,onSubmit:o,initialValues:{top:"",bottom:""},enableReinitialize:!0,validationSchema:r,children:Object(Me.jsxs)(pn.c,{children:[Object(Me.jsxs)("div",{className:d.header,children:[c.map((function(e,t){var r=e.type,a=e.display,i=e.component;return 1+t===n&&Object(Me.jsxs)("div",{className:d.step,children:[Object(Me.jsxs)(Ue,{className:d.edit,children:["Edit ",a]}),Object(Me.jsx)(et,{children:"Choose bill denomination"}),Object(Me.jsxs)("div",{className:d.bill,children:[Object(Me.jsx)(pn.b,{className:d.billInput,type:"text",size:"lg",autoFocus:1+t===n,component:(null===s||void 0===s?void 0:s.length)>0?i:qa,fullWidth:!0,decimalPlaces:0,name:r,options:s,valueProp:"code",labelProp:"display"}),Object(Me.jsx)(Ye,{noMargin:!0,className:d.suffix,children:l})]})]},t)})),Object(Me.jsx)("img",{className:d.stepImage,alt:"cassette",width:"148",height:"196",src:m[n]})]}),Object(Me.jsx)(An,{className:d.submit,type:"submit",children:u})]})}),i&&Object(Me.jsxs)("div",{className:d.disclaimer,children:[Object(Me.jsx)(_e,{className:d.title,children:"Cash-out Bill Count"}),Object(Me.jsxs)(Xe,{children:[Object(Me.jsx)(ia,{className:d.disclaimerIcon}),"When enabling cash-out, your bill count will be automatically set to zero. Make sure you physically put cash inside the cash cassettes to allow the machine to dispense it to your users. If you already did, make sure you set the correct cash-out bill count for this machine on your Cash Cassettes tab under Maintenance."]}),Object(Me.jsx)(_e,{className:d.title,children:"Default Commissions"}),Object(Me.jsxs)(Xe,{children:[Object(Me.jsx)(ia,{className:d.disclaimerIcon}),"When enabling cash-out, default commissions will be set. To change commissions for this machine, please go to the Commissions tab under Settings where you can set exceptions for each of the available cryptocurrencies."]}),Object(Me.jsxs)("div",{children:[a&&Object(Me.jsx)(Fo,{children:"Failed to save"}),Object(Me.jsx)(An,{className:d.submit,onClick:function(){return o()},children:u})]})]})]})},Cv=xn.e().shape({top:xn.d().label("Cassette 1 (Top)").required().min(1).max(Pf),bottom:xn.d().label("Cassette 2 (Bottom)").required().min(1).max(Pf)}),kv=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=Lf(t,Ff),a=(null===r||void 0===r?void 0:r.length)>0?{options:r,labelProp:"display",valueProp:"code",className:n.autoComplete}:{decimalPlaces:0};return[{name:"id",header:"Machine",width:300,view:function(t){return e.find((function(e){return e.deviceId===t})).name},size:"sm",editable:!1},{name:"top",header:"Cassette 1 (Top)",stripe:!0,width:250,textAlign:"right",view:function(e){return e},input:(null===r||void 0===r?void 0:r.length)>0?ka:qa,inputProps:a,suffix:R.a("fiatCurrency")(t),bold:Vr},{name:"bottom",header:"Cassette 2 (Bottom)",stripe:!0,textAlign:"right",width:250,view:function(e){return e},input:(null===r||void 0===r?void 0:r.length)>0?ka:qa,inputProps:a,suffix:R.a("fiatCurrency")(t),bold:Vr}]},Sv=function(e){var t=e.machine,n=e.locale,a=e.onClose,i=e.save,o=e.error,l=Object(r.useState)({step:0,config:{active:!0}}),s=Object(c.a)(l,2),d=s[0],u=d.step,m=d.config,h=s[1],b=Lf(n,Ff),p=3===u,f=function(){var e=Object(nc.a)(tc.a.mark((function e(n){var r;return tc.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!p){e.next=2;break}return e.abrupt("return",i(kl(t.deviceId,Cv.cast(m))));case 2:r=Gn.a(m,n),h({step:u+1,config:r});case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),j=[{type:"top",display:"Cassette 1 (Top)",component:ka,inputProps:{options:B.a((function(e){return{code:e,display:e}}))(b),labelProp:"display",valueProp:"code"}},{type:"bottom",display:"Cassette 2",component:ka,inputProps:{options:B.a((function(e){return{code:e,display:e}}))(b),labelProp:"display",valueProp:"code"}}];return Object(Me.jsxs)(sO,{title:0===u?null:"Enable cash-out",handleClose:a,width:554,height:520,open:!0,children:[0===u&&Object(Me.jsx)(gv,{name:t.name,onContinue:function(){return f()}}),0!==u&&Object(Me.jsx)(wv,{step:u,name:t.name,error:o,lastStep:p,steps:j,fiatCurrency:n.fiatCurrency,options:b,schema:xn.e().shape({top:xn.d().required(),bottom:u>=2?xn.d().required():xn.d()}),onContinue:f})]})},Nv=Object(f.a)({fudgeFactor:{display:"flex",alignItems:"center",marginRight:156},switchLabel:{margin:6,width:24},autoComplete:{width:"100%"}}),Iv=x()(Wx||(Wx=Object(l.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),Ev=x()(zx||(zx=Object(l.a)(["\n query getData {\n machines {\n name\n deviceId\n cashbox\n cassette1\n cassette2\n }\n config\n }\n"]))),Fv=function(e){var t,n,a=e.name,i=Nv(),o=Object(r.useState)(!1),l=Object(c.a)(o,2),s=l[0],d=l[1],m=Object(u.c)(Ev).data,h=Object(u.b)(Iv,{onCompleted:function(){return d(!1)},refetchQueries:function(){return["getData"]}}),b=Object(c.a)(h,2),p=b[0],f=b[1].error,j=function(e,t){var n=kl(a)(e);return p({variables:{config:n,accounts:t}})},g=(null===m||void 0===m?void 0:m.config)&&Cl(a)(m.config),O=null!==(t=null===g||void 0===g?void 0:g.fudgeFactorActive)&&void 0!==t&&t,x=(null===m||void 0===m?void 0:m.config)&&Cl("locale")(m.config),v=null!==(n=null===m||void 0===m?void 0:m.machines)&&void 0!==n?n:[];return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Do,{title:"Cash-out",children:Object(Me.jsxs)("div",{className:i.fudgeFactor,children:[Object(Me.jsx)(Xe,{children:"Transaction fudge factor"}),Object(Me.jsx)(Ca,{checked:O,onChange:function(e){j({fudgeFactorActive:e.target.checked})},value:O}),Object(Me.jsx)(tt,{className:i.switchLabel,children:O?"On":"Off"}),Object(Me.jsxs)(Eb,{width:304,children:[Object(Me.jsx)(Xe,{children:"Automatically accept customer deposits as complete if their received amount is 100 crypto atoms or less."}),Object(Me.jsx)(Xe,{children:"(Crypto atoms are the smallest unit in each cryptocurrency. E.g., satoshis in Bitcoin, or wei in Ethereum.)"})]})]})}),Object(Me.jsx)(gm,{namespaces:B.a(A.a(["deviceId"]))(v),data:g,stripeWhen:function(e){return 1===L.a(gn.a,il.a)(e)},enableEdit:!0,editWidth:134,enableToggle:!0,toggleWidth:109,onToggle:function(e){var t=Cl(e)(g);if(!Cv.isValidSync(t))return d(e);j(kl(e,{active:!(null===t||void 0===t?void 0:t.active)}))},save:j,error:null===f||void 0===f?void 0:f.message,validationSchema:Cv,disableRowEdit:L.a(P.a,A.a(["active"])),elements:kv(v,x,i)}),Wr.a(v)&&Object(Me.jsx)(Hx,{message:"No machines so far"}),s&&Object(Me.jsx)(Sv,{machine:Ar.a(W.a("deviceId",s))(v),onClose:function(){return d(!1)},save:j,error:null===f||void 0===f?void 0:f.message,locale:x})]})},Lv=n(844),Pv=n(845);function Dv(){return(Dv=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Bv(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Rv=r.createElement("desc",null,"Created with Sketch."),Tv=r.createElement("g",{id:"icon/sf-small/listing/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("line",{x1:0,y1:1,x2:20,y2:1,id:"Path-4",stroke:"#FFFFFF",strokeWidth:2}),r.createElement("line",{x1:0,y1:7,x2:9,y2:7,id:"Path-4-Copy",stroke:"#FFFFFF",strokeWidth:2}),r.createElement("line",{x1:0,y1:13,x2:20,y2:13,id:"Path-4-Copy-2",stroke:"#FFFFFF",strokeWidth:2}),r.createElement("line",{x1:0,y1:19,x2:12,y2:19,id:"Path-4-Copy-3",stroke:"#FFFFFF",strokeWidth:2}));function Av(e,t){var n=e.title,a=e.titleId,i=Bv(e,["title","titleId"]);return r.createElement("svg",Dv({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Rv,Tv)}var Mv=r.forwardRef(Av);n.p;function Wv(){return(Wv=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function zv(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var $v=r.createElement("desc",null,"Created with Sketch."),qv=r.createElement("g",{id:"icon/sf-small/listing/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("line",{x1:0,y1:1,x2:20,y2:1,id:"Path-4",stroke:"#1B2559",strokeWidth:2}),r.createElement("line",{x1:0,y1:7,x2:9,y2:7,id:"Path-4-Copy",stroke:"#1B2559",strokeWidth:2}),r.createElement("line",{x1:0,y1:13,x2:20,y2:13,id:"Path-4-Copy-2",stroke:"#1B2559",strokeWidth:2}),r.createElement("line",{x1:0,y1:19,x2:12,y2:19,id:"Path-4-Copy-3",stroke:"#1B2559",strokeWidth:2}));function Hv(e,t){var n=e.title,a=e.titleId,i=zv(e,["title","titleId"]);return r.createElement("svg",Wv({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,$v,qv)}var Vv=r.forwardRef(Hv);n.p;function Uv(){return(Uv=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Gv(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Xv=r.createElement("rect",{width:12,height:12,rx:3,ry:3,fill:"#44e188"});function Yv(e,t){var n=e.title,a=e.titleId,i=Gv(e,["title","titleId"]);return r.createElement("svg",Uv({width:12,height:12,viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Xv)}var _v,Zv,Kv=r.forwardRef(Yv),Qv=(n.p,n(875)),Jv=Object(r.memo)((function(e){var t,n=e.config,a=e.locale,i=e.currency,o=e.data,l=e.error,s=e.save,d=e.saveOverrides,u=Object(r.useState)(!1),m=Object(c.a)(u,2),h=m[0],b=m[1],p=Object(r.useState)(!1),f=Object(c.a)(p,2),j=f[0],g=f[1],O=n&&!Wr.a(n)?n:Gf,x=null!==(t=null===O||void 0===O?void 0:O.overrides)&&void 0!==t?t:[],v=$d.a([Bm.a(Yf),Bm.a(R.a("machine"))])(x);return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(kj,{children:Object(Me.jsx)(jm,{error:null===l||void 0===l?void 0:l.message,title:"Default setup",rowSize:"lg",titleLg:!0,name:"commissions",enableEdit:!0,initialValues:O,save:s,validationSchema:Vf(a),data:Qv.a(O),elements:$f(i),setEditing:function(e,t){return b(t)},forceDisable:j})}),Object(Me.jsx)(kj,{children:Object(Me.jsx)(jm,{error:null===l||void 0===l?void 0:l.message,title:"Overrides",titleLg:!0,name:"overrides",enableDelete:!0,enableEdit:!0,enableCreate:!0,groupBy:Yf,initialValues:Xf,save:d,validationSchema:Uf(v,o,a),data:v,elements:qf(o,i),setEditing:function(e,t){return g(t)},forceDisable:h})})]})})),ey=n(842),ty=n(843),ny=n(857),ry={code:"SHOW_ALL",display:"Show all"},ay=[{code:"machine",display:"Machine Name"},{code:"cryptoCurrencies",display:"Cryptocurrency"},{code:"cashIn",display:"Cash-in"},{code:"cashOut",display:"Cash-out"},{code:"fixedFee",display:"Fixed Fee"},{code:"minimumTx",display:"Minimum Tx"}],iy=Object(f.a)({headerLine:{display:"flex",justifyContent:"",marginBottom:24},select:{marginRight:24},tableWrapper:{flex:1,display:"block",overflowY:"auto",width:"100%",maxHeight:"70vh"}}),oy=function(e,t){return{code:e,display:t||e}},cy=Object(r.memo)((function(e){var t,n=e.config,a=e.localeConfig,i=e.currency,o=e.data,l=e.error,s=e.saveOverrides,d=iy(),u=Object(r.useState)(ry),m=Object(c.a)(u,2),h=m[0],b=m[1],p=Object(r.useState)(ry),f=Object(c.a)(p,2),j=f[0],g=f[1],O=Object(r.useState)(ay[0]),x=Object(c.a)(O,2),v=x[0],y=x[1],w=null!==(t=R.a("cryptoCurrencies",a))&&void 0!==t?t:[],C=B.a(oy)(w),k=ey.a(R.a("display"),B.a((function(e){return oy(R.a("deviceId",e),R.a("name",e))}))(R.a("machines",o))),S=ny.a(B.a((function(e){var t,n=null===(t=R.a("overrides",a))||void 0===t?void 0:t.find(W.a("machine",e)),r=n?R.a("cryptoCurrencies",n):w;return ty.a([e],r)}))(k.map(R.a("code")))),N=B.a((function(e){var t=Object(c.a)(e,2),r=t[0];return function(e,t,n){var r,a=null!==(r=R.a("overrides",n))&&void 0!==r?r:[];if(!a&&Wr.a(a))return _f(e,t,!0,n);var i=Ar.a((function(n){return n.machine===t&&wf.includes(e)(n.cryptoCurrencies)}))(a);if(void 0!==i)return _f(e,t,!1,i);var o=Ar.a((function(e){return e.machine===t&&wf.includes("ALL_COINS")(e.cryptoCurrencies)}))(a);if(void 0!==o)return _f(e,t,!1,o);var c=Ar.a((function(t){return"ALL_MACHINES"===t.machine&&wf.includes(e)(t.cryptoCurrencies)}))(a);return void 0!==c?_f(e,t,!1,c):_f(e,t,!0,n)}(t[1],r,n)}))(S),I=L.a(function(e){switch(e){case ay[0]:return ey.a(Ar.a(W.a("code",R.a("machine"))));case ay[1]:return ey.a(A.a(["cryptoCurrencies",0]));default:return ey.a(R.a(e.code))}}(v),function(e,t){return L.a(M.a((function(e){return t===ry|t.code===e.machine})),M.a((function(t){return e===ry|e.code===t.cryptoCurrencies[0]})))}(j,h))(N);return Object(Me.jsxs)("div",{children:[Object(Me.jsxs)("div",{className:d.headerLine,children:[Object(Me.jsx)(Ru,{className:d.select,onSelectedItemChange:b,label:"Machines",default:ry,items:[ry].concat(k),selectedItem:h}),Object(Me.jsx)(Ru,{className:d.select,onSelectedItemChange:g,label:"Cryptocurrency",default:ry,items:[ry].concat(C),selectedItem:j}),Object(Me.jsx)(Ru,{onSelectedItemChange:y,label:"Sort by",default:ay[0],items:ay,selectedItem:v})]}),Object(Me.jsx)("div",{className:d.tableWrapper,children:Object(Me.jsx)(jm,{error:null===l||void 0===l?void 0:l.message,name:"comissionsList",enableEdit:!0,save:s,initialValues:Xf,validationSchema:Zf(a),data:I,elements:Qf(o,i)})})]})})),ly=Object(f.a)({listViewButton:{marginLeft:4}}),sy=x()(_v||(_v=Object(l.a)(["\n query getData {\n config\n cryptoCurrencies {\n code\n display\n }\n machines {\n name\n deviceId\n }\n }\n"]))),dy=x()(Zv||(Zv=Object(l.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),uy=function(e){var t,n=e.name,a=ly(),i=Object(r.useState)(!1),o=Object(c.a)(i,2),l=o[0],s=o[1],d=Object(r.useState)(null),m=Object(c.a)(d,2),h=m[0],b=m[1],p=Object(u.c)(sy),f=p.data,j=p.loading,g=Object(u.b)(dy,{refetchQueries:function(){return["getData"]},onError:function(e){return b(e)}}),O=Object(c.a)(g,1)[0],x=(null===f||void 0===f?void 0:f.config)&&Cl(n)(f.config),v=(null===f||void 0===f?void 0:f.config)&&Cl(pl)(f.config),y=R.a("fiatCurrency")(v),w=R.a("overrides")(x),C=l?[{label:"Override value",icon:Object(Me.jsx)(Kv,{})}]:[];return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Do,{title:"Commissions",labels:C,button:{text:"List view",icon:Vv,inverseIcon:Mv,toggle:s},iconClassName:a.listViewButton}),!l&&!j&&Object(Me.jsx)(Jv,{config:x,locale:v,currency:y,data:f,error:h,save:function(e){var t=kl(n)(e.commissions[0]);return O({variables:{config:t}})},saveOverrides:function(e){var t=kl(n)(e);return b(null),O({variables:{config:t}})},classes:a}),l&&!j&&Object(Me.jsx)(cy,{config:x,localeConfig:v,currency:y,data:f,error:h,saveOverrides:(t=w,function(e,n){var r,a=A.a(["cryptoCurrencies",0],n),i=$r.a("machine",n),o=M.a(dj.a(i,(function(e){return!$r.a("cryptoCurrencies",n,e)}))),c=(r=a,function(e){return Lv.a(e,{cryptoCurrencies:Pv.a([r],e.cryptoCurrencies)})}),l=B.a(c)(o(t)).concat(M.a((function(e){return!i(e)}),t)),s={commissions_overrides:Wd.a(n,l)};return O({variables:{config:s}})})})]})},my=n(847);function hy(){return(hy=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function by(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var py=r.createElement("desc",null,"Created with Sketch."),fy=r.createElement("g",{id:"icon/button/authorize/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("circle",{id:"Oval",stroke:"#FFFFFF",cx:6,cy:6,r:5}),r.createElement("polyline",{id:"Stroke-13",stroke:"#FFFFFF",strokeLinecap:"round",strokeLinejoin:"round",points:"4 6.66666667 5 8 8 4"}));function jy(e,t){var n=e.title,a=e.titleId,i=by(e,["title","titleId"]);return r.createElement("svg",hy({viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,py,fy)}var gy=r.forwardRef(jy);n.p;function Oy(){return(Oy=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function xy(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var vy=r.createElement("desc",null,"Created with Sketch."),yy=r.createElement("g",{id:"icon/button/authorize/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"Group-9",stroke:"#1B2559"},r.createElement("circle",{id:"Oval",cx:6,cy:6,r:5})),r.createElement("polyline",{id:"Stroke-13",stroke:"#1B2559",strokeLinecap:"round",strokeLinejoin:"round",points:"4 6.66666667 5 8 8 4"}));function wy(e,t){var n=e.title,a=e.titleId,i=xy(e,["title","titleId"]);return r.createElement("svg",Oy({viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,vy,yy)}var Cy=r.forwardRef(wy),ky=(n.p,{label1:{display:"flex",marginBottom:2,marginTop:"auto",width:85},label1Pending:{color:q},label1Rejected:{color:K},label1Accepted:{color:U},cardActionButton:{display:"flex",height:28,marginRight:"auto",marginLeft:12},propertyCardTopRow:{display:"flex",margin:[[0,10,5,0]]},propertyCardBottomRow:{display:"flex",flexDirection:"row",height:45},propertyCard:{display:"flex",flexDirection:"column",borderRadius:8,width:"100%",height:100,padding:[[20]],boxSizing:"border-box",boxShadow:"0 0 8px 0 rgba(0, 0, 0, 0.04)",border:"solid 0",backgroundColor:Z,margin:[[20,0,0,0]]},rowSpaceBetween:{display:"flex",flexFlow:"row nowrap",alignItems:"center",justifyContent:"space-between"},columnSpaceBetween:{display:"flex",flexFlow:"column nowrap",alignItems:"center",justifyContent:"space-between",width:90},buttonsWrapper:{display:"flex",flexDirection:"row",justifyContent:"flex-end",marginLeft:"auto",marginTop:"auto"}}),Sy=(Object(f.a)(ky),"automatic"),Ny="verified",Iy="blocked";function Ey(){return(Ey=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Fy(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Ly=r.createElement("desc",null,"Created with Sketch."),Py=r.createElement("g",{id:"icon/button/block/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("g",{id:"Group-5",stroke:"#FFFFFF"},r.createElement("circle",{id:"Oval",cx:6,cy:6,r:5}),r.createElement("line",{x1:9,y1:3,x2:3,y2:9,id:"Stroke-3"})));function Dy(e,t){var n=e.title,a=e.titleId,i=Fy(e,["title","titleId"]);return r.createElement("svg",Ey({viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Ly,Py)}var By=r.forwardRef(Dy);n.p;function Ry(){return(Ry=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Ty(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Ay=r.createElement("desc",null,"Created with Sketch."),My=r.createElement("g",{id:"icon/button/block/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("g",{id:"Group-5",stroke:"#1B2559"},r.createElement("circle",{id:"Oval",cx:6,cy:6,r:5}),r.createElement("line",{x1:9,y1:3,x2:3,y2:9,id:"Stroke-3"})));function Wy(e,t){var n=e.title,a=e.titleId,i=Ty(e,["title","titleId"]);return r.createElement("svg",Ry({viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Ay,My)}var zy=r.forwardRef(Wy);n.p;function $y(){return($y=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function qy(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Hy=r.createElement("g",{id:"icon/button/data/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"Data-icon---small",transform:"translate(0.500000, 0.500000)",stroke:"#FFFFFF"},r.createElement("path",{d:"M11,2.44444444 L11,5.5 C11,6.85002939 8.53756612,7.94444444 5.5,7.94444444 C2.521994,7.94444444 0.0939612041,6.81341452 1.11160464e-12,5.5 L0.00282594991,2.44444444",id:"oval-3"}),r.createElement("path",{d:"M11,5.5 L11,8.55555556 C11,9.90558494 8.53756612,11 5.5,11 C2.521994,11 0.0939612041,9.86897007 1.11160464e-12,8.55555556 L0.00282594991,5.5",id:"oval-2"}),r.createElement("ellipse",{id:"oval-1",cx:5.5,cy:2.44444444,rx:5.5,ry:2.44444444})),r.createElement("g",{id:"Group-9",transform:"translate(0.000000, 4.000000)"},r.createElement("circle",{id:"Oval",stroke:"#FFFFFF",fill:"#5F668A",cx:4,cy:4,r:3.5}),r.createElement("polygon",{id:"Path",fill:"#FFFFFF",fillRule:"nonzero",points:"4.33333333 3.66666667 6 3.66666667 6 4.33333333 4.33333333 4.33333333 4.33333333 6 3.66666667 6 3.66666667 4.33333333 2 4.33333333 2 3.66666667 3.66666667 3.66666667 3.66666667 2 4.33333333 2"})));function Vy(e,t){var n=e.title,a=e.titleId,i=qy(e,["title","titleId"]);return r.createElement("svg",$y({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Hy)}var Uy=r.forwardRef(Vy);n.p;function Gy(){return(Gy=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Xy(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Yy=r.createElement("g",{id:"icon/button/data/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"Data-icon---small",transform:"translate(1.500000, 0.500000)",stroke:"#1B2559"},r.createElement("path",{d:"M10,2 L10,4.77777778 C10,6.00507722 7.76142375,7 5,7 C2.29272181,7 0.0854192765,5.97179097 0,4.77777778 L0.00256904537,2",id:"oval-3"}),r.createElement("path",{d:"M10,5 L10,7.77777778 C10,9.00507722 7.76142375,10 5,10 C2.29272181,10 0.0854192765,8.97179097 0,7.77777778 L0.00256904537,5",id:"oval-2"}),r.createElement("ellipse",{id:"oval-1",cx:5,cy:2,rx:5,ry:2})),r.createElement("g",{id:"Group-9",transform:"translate(0.000000, 4.000000)"},r.createElement("circle",{id:"Oval",stroke:"#1B2559",fill:"#EBEFFF",cx:4,cy:4,r:3.5}),r.createElement("polygon",{id:"Path",fill:"#1B2559",fillRule:"nonzero",points:"4.33333333 3.66666667 6 3.66666667 6 4.33333333 4.33333333 4.33333333 4.33333333 6 3.66666667 6 3.66666667 4.33333333 2 4.33333333 2 3.66666667 3.66666667 3.66666667 3.66666667 2 4.33333333 2"})));function _y(e,t){var n=e.title,a=e.titleId,i=Xy(e,["title","titleId"]);return r.createElement("svg",Gy({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Yy)}var Zy=r.forwardRef(_y);n.p;function Ky(){return(Ky=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Qy(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Jy=r.createElement("g",{id:"icon/button/loyalty/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("polygon",{id:"Stroke-2",stroke:"#FFFFFF",strokeLinejoin:"round",points:"8.27822222 0.5 3.72177778 0.5 0.5 3.72177778 0.5 8.27822222 3.72177778 11.5 8.27822222 11.5 11.5 8.27822222 11.5 3.72177778"}),r.createElement("path",{d:"M7.55533889,6.66641667 C8.04667222,6.66641667 8.44450556,7.06486111 8.44450556,7.55558333 C8.44450556,8.04630556 8.04667222,8.44475 7.55533889,8.44475 C7.06461667,8.44475 6.66678333,8.04630556 6.66678333,7.55558333 C6.66678333,7.06486111 7.06461667,6.66641667 7.55533889,6.66641667 Z M8.44481111,3.55555556 L4.44447778,8.44444444 L3.55592222,8.44444444 L7.55564444,3.55555556 L8.44481111,3.55555556 Z M4.44423333,3.55525 C4.93556667,3.55525 5.3334,3.95369444 5.3334,4.44441667 C5.3334,4.93513889 4.93556667,5.33358333 4.44423333,5.33358333 C3.95351111,5.33358333 3.55567778,4.93513889 3.55567778,4.44441667 C3.55567778,3.95369444 3.95351111,3.55525 4.44423333,3.55525 Z",id:"Combined-Shape",fill:"#FFFFFF"}));function ew(e,t){var n=e.title,a=e.titleId,i=Qy(e,["title","titleId"]);return r.createElement("svg",Ky({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Jy)}var tw=r.forwardRef(ew);n.p;function nw(){return(nw=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function rw(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var aw=r.createElement("g",{id:"icon/button/loyalty/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("polygon",{id:"Stroke-2",stroke:"#1B2559",strokeLinejoin:"round",points:"8.27822222 0.5 3.72177778 0.5 0.5 3.72177778 0.5 8.27822222 3.72177778 11.5 8.27822222 11.5 11.5 8.27822222 11.5 3.72177778"}),r.createElement("path",{d:"M7.55533889,6.66641667 C8.04667222,6.66641667 8.44450556,7.06486111 8.44450556,7.55558333 C8.44450556,8.04630556 8.04667222,8.44475 7.55533889,8.44475 C7.06461667,8.44475 6.66678333,8.04630556 6.66678333,7.55558333 C6.66678333,7.06486111 7.06461667,6.66641667 7.55533889,6.66641667 Z M8.44481111,3.55555556 L4.44447778,8.44444444 L3.55592222,8.44444444 L7.55564444,3.55555556 L8.44481111,3.55555556 Z M4.44423333,3.55525 C4.93556667,3.55525 5.3334,3.95369444 5.3334,4.44441667 C5.3334,4.93513889 4.93556667,5.33358333 4.44423333,5.33358333 C3.95351111,5.33358333 3.55567778,4.93513889 3.55567778,4.44441667 C3.55567778,3.95369444 3.95351111,3.55525 4.44423333,3.55525 Z",id:"Combined-Shape",fill:"#1B2559"}));function iw(e,t){var n=e.title,a=e.titleId,i=rw(e,["title","titleId"]);return r.createElement("svg",nw({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,aw)}var ow=r.forwardRef(iw);n.p;function cw(){return(cw=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function lw(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var sw=r.createElement("desc",null,"Created with Sketch."),dw=r.createElement("g",{id:"icon/sf-small/search/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("path",{d:"M15.8635238,8.17028571 C15.8635238,12.4198095 12.4187619,15.8645714 8.1692381,15.8645714 C3.92066667,15.8645714 0.475904762,12.4198095 0.475904762,8.17028571 C0.475904762,3.9207619 3.92066667,0.476 8.1692381,0.476 C12.4187619,0.476 15.8635238,3.9207619 15.8635238,8.17028571 Z",id:"Stroke-1",stroke:"#FFFFFF",strokeWidth:2}),r.createElement("line",{x1:13.7035238,y1:13.7046667,x2:19.4844762,y2:19.485619,id:"Stroke-3",stroke:"#FFFFFF",strokeWidth:2,strokeLinecap:"round"}));function uw(e,t){var n=e.title,a=e.titleId,i=lw(e,["title","titleId"]);return r.createElement("svg",cw({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,sw,dw)}var mw=r.forwardRef(uw);n.p;function hw(){return(hw=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function bw(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var pw=r.createElement("g",{id:"icon/search/dark02",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"Group",transform:"translate(1.000000, 1.000000)",stroke:"#1B2559",strokeWidth:2},r.createElement("path",{d:"M14.2771714,7.35325714 C14.2771714,11.1778286 11.1768857,14.2781143 7.35231429,14.2781143 C3.5286,14.2781143 0.428314286,11.1778286 0.428314286,7.35325714 C0.428314286,3.52868571 3.5286,0.4284 7.35231429,0.4284 C11.1768857,0.4284 14.2771714,3.52868571 14.2771714,7.35325714 Z",id:"Stroke-1"}),r.createElement("line",{x1:12.3331714,y1:12.3342,x2:17.5360286,y2:17.5370571,id:"Stroke-3",strokeLinecap:"round"})));function fw(e,t){var n=e.title,a=e.titleId,i=bw(e,["title","titleId"]);return r.createElement("svg",hw({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),void 0===n?r.createElement("title",{id:a},"icon/search/dark02"):n?r.createElement("title",{id:a},n):null,pw)}var jw=r.forwardRef(fw),gw=(n.p,Object(f.a)({row:{display:"flex",flexDirection:"row"},image:function(e){return{objectFit:"cover",borderRadius:"8px 0px 0px 8px",width:e.width,height:e.height}},popupImage:function(e){return{objectFit:"cover",width:e.popupWidth,height:e.popupHeight}},button:function(e){return{borderRadius:"0px 8px 8px 0px",height:e.height}},popoverContent:{display:"block",padding:[[10,15]]}})),Ow=Object(r.memo)((function(e){var t=e.className,n=e.width,a=e.height,i=e.popupWidth,o=e.popupHeight,l=e.src,s=gw({width:n,height:a,popupWidth:i,popupHeight:o}),d=Object(r.useState)(null),u=Object(c.a)(d,2),m=u[0],h=u[1],b=Boolean(m),p=function(e){var t=e.className;return Object(Me.jsx)("img",{className:E()(t),src:l,alt:""})};return Object(Me.jsx)(S.a,{onClickAway:function(){h(null)},children:Object(Me.jsxs)("div",{className:E()(s.row,t),children:[Object(Me.jsx)(p,{className:s.image}),Object(Me.jsx)(Vn,{Icon:jw,InverseIcon:mw,className:s.button,onClick:function(e){h(m?null:e.currentTarget)}}),Object(Me.jsx)(Xn,{open:b,anchorEl:m,placement:"top",children:Object(Me.jsx)("div",{className:s.popoverContent,children:Object(Me.jsx)(p,{className:s.popupImage})})})]})})}));function xw(){return(xw=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function vw(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var yw=r.createElement("g",{id:"icon/ID/card/new/comet",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("polygon",{id:"Stroke-1",stroke:"#5F668A",strokeWidth:1.6,points:"1 17 23 17 23 1 1 1"}),r.createElement("line",{x1:12.7857143,y1:5,x2:19.8571429,y2:5,id:"Stroke-3",stroke:"#5F668A",strokeWidth:1.6}),r.createElement("line",{x1:12.7857143,y1:8.2,x2:19.8571429,y2:8.2,id:"Stroke-4",stroke:"#5F668A",strokeWidth:1.6}),r.createElement("polygon",{id:"Stroke-5",stroke:"#5F668A",strokeWidth:1.6,points:"4.14285714 12.2 9.64285714 12.2 9.64285714 5 4.14285714 5"}));function ww(e,t){var n=e.title,a=e.titleId,i=vw(e,["title","titleId"]);return r.createElement("svg",xw({width:"24px",height:"18px",viewBox:"0 0 24 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),void 0===n?r.createElement("title",{id:a},"icon/ID/card/new/comet"):n?r.createElement("title",{id:a},n):null,yw)}var Cw=r.forwardRef(ww);n.p;function kw(){return(kw=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Sw(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Nw=r.createElement("g",{id:"icon/ID/phone/new/comet",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("path",{d:"M7.47150618,13.52898 C10.939556,16.9970298 14.7804112,17.1146315 16.4756355,16.9586292 C17.0220434,16.9090285 17.5308507,16.6578249 17.9188563,16.2698193 L20.0004862,14.1881894 L18.0220577,12.210561 L16.0436293,11.5505516 L14.7244104,12.8697705 C14.7244104,12.8697705 13.4059914,14.1881894 10.1091441,10.8905421 C6.81229671,7.59449473 8.13071565,6.27527578 8.13071565,6.27527578 L9.4499346,4.95605683 L8.78992512,2.97842842 L6.81229671,1 L4.73066681,3.0816299 C4.34186123,3.46963548 4.09145763,3.97844279 4.04105691,4.52485063 C3.88585468,6.22007499 4.00345637,10.0601301 7.47150618,13.52898 Z",id:"Stroke-1-Copy",stroke:"#5F668A",strokeWidth:1.6}));function Iw(e,t){var n=e.title,a=e.titleId,i=Sw(e,["title","titleId"]);return r.createElement("svg",kw({width:"24px",height:"18px",viewBox:"0 0 24 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),void 0===n?r.createElement("title",{id:a},"icon/ID/phone/new/comet"):n?r.createElement("title",{id:a},n):null,Nw)}var Ew=r.forwardRef(Iw);n.p;function Fw(){return(Fw=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Lw(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Pw=r.createElement("desc",null,"Created with Sketch."),Dw=r.createElement("g",{id:"icon/crossed-camera",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"crossed-camera"},r.createElement("g",{id:"Group-2"},r.createElement("g",{id:"icon/ID/cam/zodiac",transform:"translate(0.000000, 3.657143)",fill:"#1B2559",fillRule:"nonzero"},r.createElement("path",{d:"M16,19.1876029 C12.4482116,19.1876029 9.56809571,16.389776 9.56809571,12.9394673 C9.56809571,9.48915858 12.4482116,6.69133172 16,6.69133172 C19.5517884,6.69133172 22.4319043,9.48915858 22.4319043,12.9394673 C22.4319043,16.389776 19.5517884,19.1876029 16,19.1876029 Z M16,17.104891 C18.3677075,17.104891 20.2879362,15.239526 20.2879362,12.9394673 C20.2879362,10.6394086 18.3677075,8.77404358 16,8.77404358 C13.6322925,8.77404358 11.7120638,10.6394086 11.7120638,12.9394673 C11.7120638,15.239526 13.6322925,17.104891 16,17.104891 Z M22.7667469,3.30692494 L30.7397807,3.30692494 C31.3318211,3.30692494 31.8117647,3.77315587 31.8117647,4.34828087 L31.8117647,22.0513317 C31.8117647,22.6264567 31.3318211,23.0926877 30.7397807,23.0926877 L1.26021934,23.0926877 C0.6681789,23.0926877 0.188235294,22.6264567 0.188235294,22.0513317 L0.188235294,4.34828087 C0.188235294,3.77315587 0.6681789,3.30692494 1.26021934,3.30692494 L9.23325311,3.30692494 L12.0766705,0.494526627 C12.2782333,0.295162767 12.5538198,0.182857143 12.8414756,0.182857143 L19.1585244,0.182857143 C19.4461802,0.182857143 19.7217667,0.295162767 19.9233295,0.494526627 L22.7667469,3.30692494 Z M29.6677966,5.3896368 L22.3170489,5.3896368 C22.0293931,5.3896368 21.7538065,5.27733118 21.5522438,5.07796732 L18.7088264,2.26556901 L13.2911736,2.26556901 L10.4477562,5.07796732 C10.2461935,5.27733118 9.97060695,5.3896368 9.68295115,5.3896368 L2.33220339,5.3896368 L2.33220339,21.0099758 L29.6677966,21.0099758 L29.6677966,5.3896368 Z",id:"Stroke-1"})),r.createElement("line",{x1:32,y1:0,x2:0,y2:32,id:"Line",stroke:"#FF584A",strokeWidth:2,strokeLinecap:"square"}))));function Bw(e,t){var n=e.title,a=e.titleId,i=Lw(e,["title","titleId"]);return r.createElement("svg",Fw({width:"32px",height:"32px",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Pw,Dw)}var Rw=r.forwardRef(Bw);n.p;function Tw(){return(Tw=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Aw(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Mw=r.createElement("desc",null,"Created with Sketch."),Ww=r.createElement("g",{id:"icon/action/edit/disabled",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("path",{d:"M1,18 L1,18 C1,19.657 2.343,21 4,21 L18,21 C19.657,21 21,19.657 21,18",id:"Stroke-1",stroke:"#5f668a",strokeWidth:2}),r.createElement("polygon",{id:"Stroke-3",stroke:"#5f668a",strokeWidth:2,points:"6 12 17 1 21 5 10 16 6 16"}));function zw(e,t){var n=e.title,a=e.titleId,i=Aw(e,["title","titleId"]);return r.createElement("svg",Tw({width:"22px",height:"22px",viewBox:"0 0 22 22",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Mw,Ww)}var $w=r.forwardRef(zw);n.p;function qw(){return(qw=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Hw(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Vw=r.createElement("g",{id:"icon/sf-small/listing/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("line",{x1:1,y1:1,x2:19.0952381,y2:1,id:"Path-4",stroke:"#FFFFFF",strokeWidth:2}),r.createElement("line",{x1:1,y1:7,x2:19.0952381,y2:7,id:"Path-4-Copy",stroke:"#FFFFFF",strokeWidth:2}),r.createElement("line",{x1:1,y1:13,x2:19.0952381,y2:13,id:"Path-4-Copy-2",stroke:"#FFFFFF",strokeWidth:2}),r.createElement("line",{x1:1,y1:19,x2:19.0952381,y2:19,id:"Path-4-Copy-3",stroke:"#FFFFFF",strokeWidth:2}));function Uw(e,t){var n=e.title,a=e.titleId,i=Hw(e,["title","titleId"]);return r.createElement("svg",qw({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Vw)}var Gw=r.forwardRef(Uw);n.p;function Xw(){return(Xw=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Yw(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var _w=r.createElement("g",{id:"icon/sf-small/listing/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("line",{x1:1,y1:1,x2:19.0952381,y2:1,id:"Path-4",stroke:"#1B2559",strokeWidth:2}),r.createElement("line",{x1:1,y1:7,x2:19.0952381,y2:7,id:"Path-4-Copy",stroke:"#1B2559",strokeWidth:2}),r.createElement("line",{x1:1,y1:13,x2:19.0952381,y2:13,id:"Path-4-Copy-2",stroke:"#1B2559",strokeWidth:2}),r.createElement("line",{x1:1,y1:19,x2:19.0952381,y2:19,id:"Path-4-Copy-3",stroke:"#1B2559",strokeWidth:2}));function Zw(e,t){var n=e.title,a=e.titleId,i=Yw(e,["title","titleId"]);return r.createElement("svg",Xw({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,_w)}var Kw=r.forwardRef(Zw);n.p;function Qw(){return(Qw=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Jw(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var eC=r.createElement("g",{id:"icon/sf-small/overview/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("rect",{id:"Rectangle",stroke:"#FFFFFF",strokeWidth:2,x:1,y:1,width:7,height:7,rx:2}),r.createElement("rect",{id:"Rectangle-Copy-2",stroke:"#FFFFFF",strokeWidth:2,x:1,y:12,width:7,height:7,rx:2}),r.createElement("rect",{id:"Rectangle-Copy",stroke:"#FFFFFF",strokeWidth:2,x:12,y:1,width:7,height:7,rx:2}),r.createElement("rect",{id:"Rectangle-Copy-3",stroke:"#FFFFFF",strokeWidth:2,x:12,y:12,width:7,height:7,rx:2}));function tC(e,t){var n=e.title,a=e.titleId,i=Jw(e,["title","titleId"]);return r.createElement("svg",Qw({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,eC)}var nC=r.forwardRef(tC);n.p;function rC(){return(rC=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function aC(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var iC=r.createElement("g",{id:"icon/sf-small/overview/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("rect",{id:"Rectangle",stroke:"#1B2559",strokeWidth:2,x:1,y:1,width:7,height:7,rx:2}),r.createElement("rect",{id:"Rectangle-Copy-2",stroke:"#1B2559",strokeWidth:2,x:1,y:12,width:7,height:7,rx:2}),r.createElement("rect",{id:"Rectangle-Copy",stroke:"#1B2559",strokeWidth:2,x:12,y:1,width:7,height:7,rx:2}),r.createElement("rect",{id:"Rectangle-Copy-3",stroke:"#1B2559",strokeWidth:2,x:12,y:12,width:7,height:7,rx:2}));function oC(e,t){var n=e.title,a=e.titleId,i=aC(e,["title","titleId"]);return r.createElement("svg",rC({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,iC)}var cC=r.forwardRef(oC),lC=(n.p,function(e,t){return D.a(e)?"":t}),sC={header:{display:"flex",flexDirection:"row",marginBottom:15},title:{marginTop:7,marginRight:24},editIcon:{marginTop:5},cardIcon:{marginTop:7},viewIcons:{marginRight:12},wrapper:{display:"flex"},separator:{display:"flex",flexBasis:"100%",justifyContent:"center",color:se,margin:[[8,0,8,0]],"&::before, &::after":{content:"",flexGrow:1,background:se,height:1,fontSize:1,lineHeight:0,margin:[[0,8,0,8]]}}},dC=n(853),uC=Object(f.a)({radio:{padding:4,margin:4},radioGroup:{flexDirection:"row"},error:{color:me},specialLabel:{height:40,padding:0,width:250},label:{height:40,padding:0},specialGrid:{display:"grid",gridTemplateColumns:[[182,162,141]]}}),mC=function(e){return"blocked"===e.authorizedOverride?{label:"Blocked",type:"error"}:e.isSuspended?e.daysSuspended>0?{label:"".concat(e.daysSuspended," day suspension"),type:"warning"}:{label:"< 1 day suspension",type:"warning"}:{label:"Authorized",type:"success"}},hC=function(e,t){var n=e&&t?Object(dC.a)(e,t):null;return n?n.formatInternational():e},bC=function(e){var t,n,r=A.a(["idCardData"])(e);return"".concat(null!==(t=A.a(["firstName"])(r))&&void 0!==t?t:""," ").concat(null!==(n=A.a(["lastName"])(r))&&void 0!==n?n:"").trim()},pC=[{display:"Custom entry",code:"custom"},{display:"Populate existing requirement",code:"requirement"}],fC=[{display:"Text",code:"text"},{display:"File",code:"file"},{display:"Image",code:"image"}],jC=[{display:"Birthdate",code:"birthdate"},{display:"ID card image",code:"idCardPhoto"},{display:"ID data",code:"idCardData"},{display:"Customer camera",code:"facephoto"},{display:"US SSN",code:"usSsn"}],gC=[{display:"Data entry title",code:"title"}],OC=xn.e().shape({entryType:xn.g().required()}),xC=xn.e().shape({title:xn.g().required(),file:xn.c().required()}),vC=xn.e().shape({title:xn.g().required(),image:xn.c().required()}),yC=function(e){var t=e.selectedValues,n=null===t||void 0===t?void 0:t.dataType,r="file"===n||"image"===n;return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(No.a,{display:"flex",alignItems:"center",children:Object(Me.jsx)(Ue,{children:"Custom ".concat(n," entry")})}),wC[n].options.map((function(e){var t=e.display,n=e.code;return Object(Me.jsx)(pn.b,{name:n,label:t,component:Ua,width:390})})),r&&Object(Me.jsx)(uS,{type:n})]})},wC={text:{schema:xn.e().shape({title:xn.g().required(),data:xn.g().required()}),options:[{display:"Data entry title",code:"title"},{display:"Data entry",code:"data"}],Component:yC,initialValues:{data:"",title:""}},file:{schema:xC,options:gC,Component:yC,initialValues:{file:"",title:""}},image:{schema:vC,options:gC,Component:yC,initialValues:{image:"",title:""}}},CC={schema:OC,options:pC,Component:function(){var e=uC(),t=Object(pn.e)().values,n="custom"===t.entryType,r="requirement"===t.entryType;return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(No.a,{display:"flex",alignItems:"center",children:Object(Me.jsx)(Ue,{children:"Type of entry"})}),Object(Me.jsx)(pn.b,{component:Ha,name:"entryType",options:pC,labelClassName:e.specialLabel,radioClassName:e.radio,className:E()(e.radioGroup,e.specialGrid)}),n&&Object(Me.jsxs)("div",{children:[Object(Me.jsx)(No.a,{display:"flex",alignItems:"center",children:Object(Me.jsx)(Ue,{children:"Type of data"})}),Object(Me.jsx)(pn.b,{component:Ha,name:"dataType",options:fC,labelClassName:e.label,radioClassName:e.radio,className:E()(e.radioGroup,e.specialGrid)})]}),r&&Object(Me.jsxs)("div",{children:[Object(Me.jsx)(No.a,{display:"flex",alignItems:"center",children:Object(Me.jsx)(Ue,{children:"Requirements"})}),Object(Me.jsx)(pn.b,{component:Ha,name:"requirement",options:jC,labelClassName:e.label,radioClassName:e.radio,className:E()(e.radioGroup,e.specialGrid)})]})]})},initialValues:{entryType:""}},kC={stepper:{margin:[[16,0,14,0]]},submit:{display:"flex",flexDirection:"row",margin:[["auto",0,24]]},button:{marginLeft:"auto"},form:{height:"100%",display:"flex",flexDirection:"column"},infoTitle:{margin:[[18,0,20,0]]},infoCurrentText:{color:q},blankSpace:{padding:[[0,30]],margin:[[0,4,0,2]],borderBottom:"1px solid ".concat(q),display:"inline-block"}},SC=Object(f.a)(kC),NC=function(e){var t=e.onClose,n=e.save,a=e.error,i=SC(),o=Object(r.useState)(null),l=Object(c.a)(o,2),d=l[0],u=l[1],m=Object(r.useState)({step:1}),h=Object(c.a)(m,2),b=h[0],p=b.step,f=b.config,j=h[1],g=2===p,O=function(e,t){switch(e){case 1:return CC;case 2:return wC[null===t||void 0===t?void 0:t.dataType];default:return r.Fragment}}(p,d),x=function(){var e=Object(nc.a)(tc.a.mark((function e(t){var r;return tc.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=Gn.a(f,O.schema.cast(t)),u(r),!g){e.next=4;break}return e.abrupt("return",n(r));case 4:j({step:p+1,config:r});case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsxs)(sO,{title:"Manual data entry",handleClose:t,width:520,height:520,open:!0,children:[Object(Me.jsx)(OO,{className:i.stepper,steps:2,currentStep:p}),Object(Me.jsx)(pn.d,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,onSubmit:x,initialValues:O.initialValues,validationSchema:O.schema,children:Object(Me.jsxs)(pn.c,{className:i.form,children:[Object(Me.jsx)(O.Component,Object(s.a)({selectedValues:d},O.props)),Object(Me.jsxs)("div",{className:i.submit,children:[a&&Object(Me.jsx)(Fo,{children:"Failed to save"}),Object(Me.jsx)(An,{className:i.button,type:"submit",children:g?"Add Data":"Next"})]})]})})]})})},IC={titleWrapper:nb.titleWrapper,titleAndButtonsContainer:nb.titleAndButtonsContainer,row:{display:"flex",flexFlow:"row nowrap"},rowSpaceBetween:{display:"flex",flexFlow:"row nowrap",alignItems:"center",justifyContent:"space-between"},column:{display:"flex",flexFlow:"column nowrap",width:"100%",height:"100%",justifyContent:"space-between"},textInput:{width:144},p:{fontFamily:"MuseoSans",fontSize:xe,fontWeight:500,fontStretch:"normal",fontStyle:"normal",lineHeight:1.14,letterSpacing:"normal",color:J},txId:{fontFamily:"MuseoSans",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},txClassIconLeft:{marginRight:11},txClassIconRight:{marginLeft:11},headerLabels:{display:"flex",flexDirection:"row","& div":{display:"flex",alignItems:"center"},"& > div:first-child":{marginRight:24},"& span":{extend:Re.label1,marginLeft:6}},photo:{width:92,height:92,borderRadius:8,backgroundColor:G,margin:[[0,28,0,0]],alignItems:"center",justifyContent:"center",display:"flex"},img:{width:80},customerName:{marginBottom:32},icon:{marginRight:11},name:{display:"flex",flexDirection:"row",alignItems:"center"},value:{height:16},label:{marginBottom:4,color:q},txSummaryValue:{height:16,marginRight:25},txSummaryLabel:{marginBottom:4,color:q,marginRight:25},idIcon:{marginRight:10},subpageButton:{marginLeft:16},txTableSpacing:{marginTop:40}},EC=n(286),FC=n(411),LC=n.n(FC);function PC(){return(PC=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function DC(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var BC=r.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("polygon",{id:"Simple-Arrow-White",fill:"#FFFFFF",fillRule:"nonzero",points:"12.1912718 1.56064837 10.8306233 0.395663059 0.196798664 16.2200463 10.8250965 32.3956631 12.1967987 31.2473125 2.33241023 16.233075"}));function RC(e,t){var n=e.title,a=e.titleId,i=DC(e,["title","titleId"]);return r.createElement("svg",PC({width:"13px",height:"33px",viewBox:"0 0 13 33",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,BC)}var TC=r.forwardRef(RC);n.p;function AC(){return(AC=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function MC(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var WC=r.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"Group-2-Copy",transform:"translate(1.000000, 1.000000)",stroke:"#FFFFFF",strokeWidth:2},r.createElement("polyline",{id:"Path-4-Copy",points:"0 0 12 15.8202247 0 32"})));function zC(e,t){var n=e.title,a=e.titleId,i=MC(e,["title","titleId"]);return r.createElement("svg",AC({width:"15px",height:"34px",viewBox:"0 0 15 34",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,WC)}var $C=r.forwardRef(zC),qC=(n.p,Object(f.a)({imgWrapper:{alignItems:"center",justifyContent:"center",display:"flex",width:550},imgInner:{objectFit:"cover",objectPosition:"center",width:550,marginBottom:40}})),HC=Object(r.memo)((function(e){var t=e.photosData,n=e.slidePhoto,r=qC();return Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsx)(LC.a,{PrevIcon:Object(Me.jsx)(TC,{}),NextIcon:Object(Me.jsx)($C,{}),navButtonsProps:{style:{backgroundColor:"transparent",borderRadius:0,width:50,color:"transparent",opacity:1}},autoPlay:!1,indicators:!1,navButtonsAlwaysVisible:!0,next:function(e){return n(e)},prev:function(e){return n(e)},children:t.map((function(e,t){return Object(Me.jsx)("div",{children:Object(Me.jsx)("div",{className:r.imgWrapper,children:Object(Me.jsx)("img",{className:r.imgInner,src:"".concat(Bp,"/").concat(null===e||void 0===e?void 0:e.photoDir,"/").concat(null===e||void 0===e?void 0:e.path),alt:""})})})}))})})})),VC=Object(f.a)({closeButton:{display:"flex",padding:[[16,16,0,16]],paddingRight:12,justifyContent:"end"},title:{margin:[[0,16,8,20]]}}),UC=Object(r.memo)((function(e){var t=e.title,n=void 0===t?"":t,r=e.open,a=e.onDissmised,i=(e.disabled,e.data),o=Object($.a)(e,["title","open","onDissmised","disabled","data"]),c=VC();return Object(Me.jsxs)(un.a,Object(s.a)(Object(s.a)({PaperProps:{style:{borderRadius:8}},fullWidth:!0,open:r,"aria-labelledby":"form-dialog-title"},o),{},{children:[Object(Me.jsx)("div",{className:c.closeButton,children:Object(Me.jsx)(tr,{size:16,"aria-label":"close",onClick:function(){a()},children:Object(Me.jsx)(gi,{})})}),Object(Me.jsx)(qe,{className:c.title,children:n}),Object(Me.jsx)(mn.a,{className:c.dialogContent,children:i})]}))})),GC={photo:{width:135,height:135,borderRadius:8,backgroundColor:G,margin:[[0,28,0,0]],alignItems:"center",justifyContent:"center",display:"flex"},img:{objectFit:"cover",objectPosition:"center",width:135,height:135},container:{position:"relative","& > img":{display:"block"},"& > circle":{position:"absolute",top:"0",right:"0",marginRight:5,marginTop:5}},circle:{background:re,borderRadius:"50%",width:25,height:25,alignItems:"center",justifyContent:"center",display:"flex"},label:{color:se,margin:[[0,0,6,0]]},firstRow:{padding:[[8]],display:"flex",flexDirection:"column"},secondRow:{extend:Re.p,display:"flex",padding:[[8]],"& > div":{display:"flex",flexDirection:"column","& > div":{width:144,height:37,marginBottom:15,marginRight:55}}},imgWrapper:{alignItems:"center",justifyContent:"center",display:"flex",width:550,height:550},imgInner:{objectFit:"cover",objectPosition:"center",width:550,height:550,marginBottom:40}},XC=Object(f.a)(GC),YC=function(e){var t=e.children,n=XC();return Object(Me.jsx)(et,{className:n.label,children:t})},_C=Object(r.memo)((function(e){var t=e.frontCameraData,n=e.txPhotosData,a=XC(),i=Object(r.useState)(!1),o=Object(c.a)(i,2),l=o[0],d=o[1],u=B.a((function(e){return To.a("id")(e)?Object(s.a)(Object(s.a)({},e),{},{photoDir:"operator-data/customersphotos"}):Object(s.a)(Object(s.a)({},e),{},{photoDir:"front-camera-photo"})})),m=B.a(L.a(cl.a,B.a((function(e){var t=Object(c.a)(e,2),n=t[0],r=t[1];return"txCustomerPhotoPath"===n||"frontCameraPath"===n?["path",r]:"txCustomerPhotoAt"===n||"frontCameraAt"===n?["date",r]:e})),sl.a)),h=M.a((function(e){return!D.a(e.date)&&!D.a(e.path)}))(u(m(rs.a(t,n)))),b=fb.a(h);return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Ud.a,{className:a.photo,elevation:0,children:Object(Me.jsx)(EC.a,{disabled:!b,className:a.button,onClick:function(){d(!0)},children:b?Object(Me.jsxs)("div",{className:a.container,children:[Object(Me.jsx)("img",{className:a.img,src:"".concat(Bp,"/").concat(b.photoDir,"/").concat(b.path),alt:""}),Object(Me.jsx)("circle",{className:a.circle,children:Object(Me.jsx)("div",{children:Object(Me.jsx)(_e,{children:h.length})})})]}):Object(Me.jsx)(Rw,{})})}),Object(Me.jsx)(UC,{open:l,title:"Photo roll",data:Object(Me.jsx)(ZC,{photosData:h}),onDissmised:function(){d(!1)}})]})})),ZC=Object(r.memo)((function(e){var t,n,a=e.photosData,i=XC(),o=Object(r.useState)(0),l=Object(c.a)(o,2),s=l[0],d=l[1],u=!To.a("id")(a[s]);return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(HC,{photosData:a,slidePhoto:function(e){return d(e)}}),!u&&Object(Me.jsxs)("div",{className:i.firstRow,children:[Object(Me.jsx)(YC,{children:"Session ID"}),Object(Me.jsx)(sb,{children:a&&(null===(t=a[s])||void 0===t?void 0:t.id)})]}),Object(Me.jsxs)("div",{className:i.secondRow,children:[Object(Me.jsx)("div",{children:Object(Me.jsxs)("div",{children:[Object(Me.jsx)(YC,{children:"Date"}),Object(Me.jsx)("div",{children:a&&(null===(n=a[s])||void 0===n?void 0:n.date)})]})}),Object(Me.jsxs)("div",{children:[Object(Me.jsx)(YC,{children:"Taken by"}),Object(Me.jsx)("div",{children:u?"Compliance scan":"Acceptance of T&C"})]})]})]})})),KC=_C,QC=Object(f.a)(IC),JC=Object(r.memo)((function(e){var t=e.txData,n=e.customer,r=e.locale,a=(e.setShowCompliance,QC()),i=A.a(["idCardData","documentNumber"])(n),o=A.a(["usSsn"])(n),c=[{header:"Phone number",size:172,value:hC(n.phone,r.country)}];i&&c.push({header:"ID number",size:172,value:i}),o&&c.push({header:"US SSN",size:127,value:o});var l=bC(n);return Object(Me.jsxs)(No.a,{display:"flex",children:[Object(Me.jsx)(KC,{frontCameraData:gu.a(["frontCameraPath","frontCameraAt"])(n),txPhotosData:t&&B.a(gu.a(["id","txCustomerPhotoPath","txCustomerPhotoAt"]))(t)}),Object(Me.jsxs)(No.a,{display:"flex",flexDirection:"column",children:[Object(Me.jsxs)("div",{className:a.name,children:[Object(Me.jsx)(zb,{className:a.idIcon}),Object(Me.jsx)(He,{noMargin:!0,children:l.length?l:hC(A.a(["phone"])(n),r.country)})]}),Object(Me.jsx)(No.a,{display:"flex",mt:"auto",children:c.map((function(e,t){var n=e.size,r=e.header;return Object(Me.jsx)(et,{noMargin:!0,className:a.label,style:{width:n},children:r},t)}))}),Object(Me.jsx)(No.a,{display:"flex",children:c.map((function(e,t){var n=e.size,r=e.value;return Object(Me.jsx)(Xe,{noMargin:!0,className:a.value,style:{width:n},children:r},t)}))})]})]})}));function ek(){return(ek=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function tk(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var nk=r.createElement("g",{id:"icon/customer-nav/data/comet",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("path",{d:"M19,5 L19,10 C19,12.209139 14.9705627,14 10,14 C5.12689927,14 1.1537547,12.1492238 1,10 L1.00462428,5",id:"Path-Copy-3",stroke:"#5F668A",strokeWidth:2}),r.createElement("path",{d:"M19,10 L19,15 C19,17.209139 14.9705627,19 10,19 C5.12689927,19 1.1537547,17.1492238 1,15 L1.00462428,10",id:"Path-Copy-3",stroke:"#5F668A",strokeWidth:2}),r.createElement("ellipse",{id:"Oval-Copy-3",stroke:"#5F668A",strokeWidth:2,cx:10,cy:5,rx:9,ry:4}));function rk(e,t){var n=e.title,a=e.titleId,i=tk(e,["title","titleId"]);return r.createElement("svg",ek({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,nk)}var ak=r.forwardRef(rk);n.p;function ik(){return(ik=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function ok(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var ck=r.createElement("g",{id:"icon/customer-nav/data/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("path",{d:"M19,5 L19,10 C19,12.209139 14.9705627,14 10,14 C5.12689927,14 1.1537547,12.1492238 1,10 L1.00462428,5",id:"Path-Copy-3",stroke:"#FFFFFF",strokeWidth:2}),r.createElement("path",{d:"M19,10 L19,15 C19,17.209139 14.9705627,19 10,19 C5.12689927,19 1.1537547,17.1492238 1,15 L1.00462428,10",id:"Path-Copy-3",stroke:"#FFFFFF",strokeWidth:2}),r.createElement("ellipse",{id:"Oval-Copy-3",stroke:"#FFFFFF",strokeWidth:2,cx:10,cy:5,rx:9,ry:4}));function lk(e,t){var n=e.title,a=e.titleId,i=ok(e,["title","titleId"]);return r.createElement("svg",ik({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,ck)}var sk=r.forwardRef(lk);n.p;function dk(){return(dk=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function uk(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var mk=r.createElement("g",{id:"icon/customer-nav/overview/comet",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("rect",{id:"Rectangle",stroke:"#5F668A",strokeWidth:2,x:1,y:1,width:7,height:7,rx:2}),r.createElement("rect",{id:"Rectangle-Copy-2",stroke:"#5F668A",strokeWidth:2,x:1,y:12,width:7,height:7,rx:2}),r.createElement("rect",{id:"Rectangle-Copy",stroke:"#5F668A",strokeWidth:2,x:12,y:1,width:7,height:7,rx:2}),r.createElement("rect",{id:"Rectangle-Copy-3",stroke:"#5F668A",strokeWidth:2,x:12,y:12,width:7,height:7,rx:2}));function hk(e,t){var n=e.title,a=e.titleId,i=uk(e,["title","titleId"]);return r.createElement("svg",dk({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,mk)}var bk=r.forwardRef(hk);n.p;function pk(){return(pk=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function fk(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var jk=r.createElement("g",{id:"icon/customer-nav/overview/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("rect",{id:"Rectangle",stroke:"#FFFFFF",strokeWidth:2,x:1,y:1,width:7,height:7,rx:2}),r.createElement("rect",{id:"Rectangle-Copy-2",stroke:"#FFFFFF",strokeWidth:2,x:1,y:12,width:7,height:7,rx:2}),r.createElement("rect",{id:"Rectangle-Copy",stroke:"#FFFFFF",strokeWidth:2,x:12,y:1,width:7,height:7,rx:2}),r.createElement("rect",{id:"Rectangle-Copy-3",stroke:"#FFFFFF",strokeWidth:2,x:12,y:12,width:7,height:7,rx:2}));function gk(e,t){var n=e.title,a=e.titleId,i=fk(e,["title","titleId"]);return r.createElement("svg",pk({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,jk)}var Ok=r.forwardRef(gk),xk=(n.p,{sidebar:{display:"flex",backgroundColor:"#ebefff",width:219,flexDirection:"column",borderRadius:5,marginBottom:50},link:{alignItems:"center",display:"flex",extend:Re.p,position:"relative",color:de,padding:15,cursor:"pointer"},activeLink:{display:"flex",alignItems:"center",extend:Re.tl2,color:Z,backgroundColor:de,"&:first-child":{borderRadius:[5,5,0,0]},"&:last-child":{borderRadius:[0,0,5,5]}},icon:{marginRight:15}}),vk=Object(f.a)(xk),yk=function(e){var t=e.isSelected,n=e.onClick,r=vk(),a=[{code:"overview",display:"Overview",Icon:Ok,InverseIcon:bk},{code:"customerData",display:"Customer Data",Icon:sk,InverseIcon:ak}];return Object(Me.jsx)("div",{className:r.sidebar,children:null===a||void 0===a?void 0:a.map((function(e){var a,i=e.Icon,o=e.InverseIcon,c=e.display,l=e.code;return Object(Me.jsxs)("div",{className:E()((a={},Object(z.a)(a,r.activeLink,t(l)),Object(z.a)(a,r.link,!0),a)),onClick:function(){return n(l)},children:[Object(Me.jsx)("div",{className:r.icon,children:t(l)?Object(Me.jsx)(i,{}):Object(Me.jsx)(o,{})}),c]})}))})};function wk(){return(wk=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Ck(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var kk=r.createElement("desc",null,"Created with Sketch."),Sk=r.createElement("g",{id:"icon/action/edit/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("path",{d:"M1,18 L1,18 C1,19.657 2.343,21 4,21 L18,21 C19.657,21 21,19.657 21,18",id:"Stroke-1",stroke:"#FFFFFF",strokeWidth:2}),r.createElement("polygon",{id:"Stroke-3",stroke:"#FFFFFF",strokeWidth:2,points:"6 12 17 1 21 5 10 16 6 16"}));function Nk(e,t){var n=e.title,a=e.titleId,i=Ck(e,["title","titleId"]);return r.createElement("svg",wk({width:"22px",height:"22px",viewBox:"0 0 22 22",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,kk,Sk)}var Ik=r.forwardRef(Nk);n.p;function Ek(){return(Ek=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Fk(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Lk=r.createElement("desc",null,"Created with Sketch."),Pk=r.createElement("defs",null,r.createElement("polygon",{id:"path-1",points:"0 21 21 21 21 0 0 0"})),Dk=r.createElement("g",{id:"icon/sf-small/save/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"Group"},r.createElement("polygon",{id:"Stroke-1",stroke:"#FFFFFF",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",points:"20.5 20.5 0.5 20.5 0.5 0.5 16.75 0.5 20.5 4.25"}),r.createElement("mask",{id:"mask-2",fill:"white"},r.createElement("use",{xlinkHref:"#path-1"})),r.createElement("g",{id:"Clip-4"}),r.createElement("polygon",{id:"Stroke-5",stroke:"#FFFFFF",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",mask:"url(#mask-2)",points:"4.25 7.5 16.75 7.5 16.75 0.5 4.25 0.5"}),r.createElement("circle",{id:"Oval",stroke:"#FFFFFF",strokeWidth:2,mask:"url(#mask-2)",cx:11,cy:14,r:3})));function Bk(e,t){var n=e.title,a=e.titleId,i=Fk(e,["title","titleId"]);return r.createElement("svg",Ek({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Lk,Pk,Dk)}var Rk=r.forwardRef(Bk);n.p;function Tk(){return(Tk=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Ak(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Mk=r.createElement("desc",null,"Created with Sketch."),Wk=r.createElement("defs",null,r.createElement("polygon",{id:"path-1",points:"0 21 21 21 21 0 0 0"})),zk=r.createElement("g",{id:"icon/sf-small/save/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"Group"},r.createElement("g",{id:"Group-10"},r.createElement("g",{id:"Group-6"},r.createElement("polygon",{id:"Stroke-1",stroke:"#1B2559",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",points:"20.5 20.5 0.5 20.5 0.5 0.5 16.75 0.5 20.5 4.25"}),r.createElement("mask",{id:"mask-2",fill:"white"},r.createElement("use",{xlinkHref:"#path-1"})),r.createElement("g",{id:"Clip-4"}),r.createElement("polygon",{id:"Stroke-5",stroke:"#1B2559",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",mask:"url(#mask-2)",points:"4.25 7.5 16.75 7.5 16.75 0.5 4.25 0.5"}))),r.createElement("circle",{id:"Oval",stroke:"#1B2559",strokeWidth:2,cx:11,cy:14,r:3})));function $k(e,t){var n=e.title,a=e.titleId,i=Ak(e,["title","titleId"]);return r.createElement("svg",Tk({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,Mk,Wk,zk)}var qk=r.forwardRef($k),Hk=(n.p,{label1:{display:"flex",width:85,justifyContent:"right"},label1Pending:{color:q},label1Rejected:{color:K},label1Accepted:{color:U},editButton:{marginTop:30,display:"flex",justifyContent:"right"},button:{marginRight:8},editingButtons:{marginTop:30,display:"flex",justifyContent:"right"},card:{borderRadius:10,marginRight:15,marginBottom:15},cardHeader:{display:"flex",flexDirection:"row",marginBottom:15},editIcon:{marginTop:5},cardIcon:{marginTop:7},cardTitle:{margin:[[8,15,15,15]]}}),Vk=Object(f.a)(Hk),Uk={field:{position:"relative",width:280,height:48,padding:[[0,4,4,0]]},label:{color:q,margin:[[0,0,0,0]]},notEditing:{display:"flex",flexDirection:"column","& > p:first-child":{height:16,lineHeight:"16px",transformOrigin:"left",paddingLeft:0,margin:[[3,0,3,0]]},"& > p:last-child":{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",margin:0}},editing:{"& > div":{"& > input":{padding:0}}}},Gk=Object(f.a)(Uk),Xk=function(e){var t,n=e.editing,r=e.field,a=e.size,i=Object($.a)(e,["editing","field","size"]),o=Gk(),c=(t={},Object(z.a)(t,o.field,!0),Object(z.a)(t,o.notEditing,!n),t);return Object(Me.jsxs)("div",{className:E()(c),children:[!n&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(et,{className:o.label,children:r.label}),Object(Me.jsx)(Ze,{children:r.value})]}),n&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(et,{className:o.label,children:r.label}),Object(Me.jsx)(pn.b,Object(s.a)({className:o.editing,id:r.name,component:r.component,value:r.value,type:r.type,width:a},i))]})]})},Yk=function(e){var t,n=e.data,a=e.save,i=e.authorize,o=e.reject,l=e.state,s=e.title,d=e.titleIcon,u=e.children,m=Vk(),b=Object(r.useState)(!1),p=Object(c.a)(b,2),f=p[0],j=p[1],g=Object(r.useState)(null),O=Object(c.a)(g,2),x=O[0],v=O[1],y=(t={},Object(z.a)(t,m.label1,!0),Object(z.a)(t,m.label1Pending,l===Sy),Object(z.a)(t,m.label1Rejected,l===Iy),Object(z.a)(t,m.label1Accepted,l===Ny),t),w=l===Sy?{label:"Pending",type:"neutral"}:l===Iy?{label:"Rejected",type:"error"}:{label:"Accepted",type:"success"},C=function(e){return Object(Me.jsx)(Xk,{field:e,editing:f,size:180})};return Object(Me.jsx)("div",{children:Object(Me.jsx)(Ud.a,{className:m.card,children:Object(Me.jsxs)(Gd.a,{children:[Object(Me.jsxs)("div",{className:m.cardHeader,children:[d,Object(Me.jsx)(Ve,{className:m.cardTitle,children:s}),Object(Me.jsx)(Eb,{width:304}),Object(Me.jsx)("div",{className:E()(y),children:Object(Me.jsx)(md,{statuses:[w]})})]}),Object(Me.jsx)(pn.d,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,onSubmit:function(e){return a(e)},onReset:function(){j(!1),v(!1)},children:Object(Me.jsxs)(pn.c,{children:[Object(Me.jsx)(Vd,{}),Object(Me.jsx)("div",{className:m.row,children:Object(Me.jsxs)(h.a,{container:!0,children:[Object(Me.jsx)(h.a,{container:!0,direction:"column",item:!0,xs:6,children:null===n||void 0===n?void 0:n.map((function(e,t){return t>=0&&t<4?C(e):null}))}),Object(Me.jsx)(h.a,{container:!0,direction:"column",item:!0,xs:6,children:null===n||void 0===n?void 0:n.map((function(e,t){return t>=4?C(e):null}))})]})}),u,Object(Me.jsxs)("div",{className:m.edit,children:[!f&&Object(Me.jsx)("div",{className:m.editButton,children:Object(Me.jsx)(ze,{color:"primary",Icon:lm,InverseIcon:Ik,onClick:function(){return j(!0)},children:"Edit"})}),f&&Object(Me.jsxs)("div",{className:m.editingButtons,children:[n&&Object(Me.jsx)("div",{className:m.button,children:Object(Me.jsx)(ze,{color:"secondary",Icon:qk,InverseIcon:Rk,type:"submit",children:"Save"})}),Object(Me.jsx)("div",{className:m.button,children:Object(Me.jsx)(ze,{color:"secondary",Icon:mp,InverseIcon:pr,type:"reset",children:"Cancel"})}),"Accepted"!==w.label&&Object(Me.jsx)("div",{className:m.button,children:Object(Me.jsx)(ze,{color:"secondary",Icon:Cy,InverseIcon:gy,type:"submit",onClick:function(){return i()},children:"Authorize"})}),"Rejected"!==w.label&&Object(Me.jsx)(ze,{color:"secondary",Icon:mp,InverseIcon:pr,type:"submit",onClick:function(){return o()},children:"Reject"}),x&&Object(Me.jsx)(Fo,{children:"Failed to save changes"})]})]})]})})]})})})},_k=(Object(f.a)({field:{height:46},label:{color:q,margin:[[0,3]]},value:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",margin:0,paddingLeft:4}}),Object(f.a)(IC)),Zk=function(e){var t,n=e.customer,r=e.data,a=e.loading,i=e.locale,o=_k(),c="cashOut"===n.lastTxClass?tl:Yc,l=!(Wr.a(r)||D.a(r)),s=i.timezone,d=(t={},Object(z.a)(t,o.titleAndButtonsContainer,a||!a&&!l),Object(z.a)(t,o.txTableSpacing,!a&&l),t),u=[{header:"Transactions",size:127,value:lC(n.totalTxs,"".concat(Number.parseInt(n.totalTxs)))},{header:"Transaction volume",size:167,value:lC(n.totalSpent,"".concat(Number.parseFloat(n.totalSpent)," ").concat(n.lastTxFiatCode))},{header:"Last active",size:142,value:!D.a(s)&&lC(n.lastActive,Mm(n.lastActive,s,"YYYY-MM-D"))},{header:"Last transaction",size:198,value:lC(n.lastTxFiat,Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(c,{className:o.icon}),"".concat(Number.parseFloat(n.lastTxFiat)," \n ").concat(n.lastTxFiatCode)]}))}],m=[{header:"Machine",width:160,view:A.a(["machineName"])},{header:"Direction",width:125,view:function(e){return Object(Me.jsx)(Me.Fragment,{children:"cashOut"===e.txClass?Object(Me.jsx)(tl,{className:o.txClassIconLeft}):Object(Me.jsx)(Yc,{className:o.txClassIconLeft})})}},{header:"Transaction ID",width:145,view:function(e){return Object(Me.jsx)(sb,{className:o.txId,children:e.id})}},{header:"Cash",width:155,textAlign:"right",view:function(e){return Object(Me.jsxs)(Me.Fragment,{children:["".concat(Number.parseFloat(e.fiat)," "),Object(Me.jsx)(tt,{inline:!0,children:e.fiatCode})]})}},{header:"Crypto",width:145,textAlign:"right",view:function(e){return Object(Me.jsxs)(Me.Fragment,{children:["".concat(hb.utils.toUnit(new al.a(e.cryptoAtoms),e.cryptoCode).toFormat(5)," "),Object(Me.jsx)(tt,{inline:!0,children:e.cryptoCode})]})}},{header:"Date",width:100,view:function(e){return Mm(e.created,s,"YYYY-MM-D")}},{header:"Time (h:m:s)",width:130,view:function(e){return Mm(e.created,s,"HH:mm:ss")}}];return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Ve,{children:"Transactions"}),Object(Me.jsxs)(No.a,{display:"flex",flexDirection:"column",children:[Object(Me.jsx)(No.a,{display:"flex",mt:"auto",children:u.map((function(e,t){var n=e.size,r=e.header;return Object(Me.jsx)(et,{noMargin:!0,className:o.txSummaryLabel,style:{width:n},children:r},t)}))}),Object(Me.jsx)(No.a,{display:"flex",children:u.map((function(e,t){var n=e.size,r=e.value;return Object(Me.jsx)(Xe,{noMargin:!0,className:o.txSummaryValue,style:{width:n},children:r},t)}))})]}),Object(Me.jsx)("div",{className:o.titleWrapper,children:Object(Me.jsx)("div",{className:E()(d),children:a?Object(Me.jsx)(Ue,{children:"Loading"}):l?"":Object(Me.jsx)(Ue,{children:"No transactions so far"})})}),l&&Object(Me.jsx)(iv,{elements:m,data:r})]})},Kk=n(414);function Qk(){return(Qk=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Jk(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var eS=r.createElement("g",{id:"icon/button/photo/zodiac-resized",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"Group-2"},r.createElement("g",{id:"Group",transform:"translate(11.666667, 8.333333) scale(-1, 1) translate(-11.666667, -8.333333) translate(3.333333, 0.000000)",stroke:"#1B2559"},r.createElement("rect",{id:"Rectangle-Copy",x:.5,y:.5,width:15.6666667,height:15.6666667,rx:1}),r.createElement("circle",{id:"Oval-Copy",fill:"#1B2559",cx:12.5,cy:4.16666667,r:1}),r.createElement("g",{id:"Group-14",transform:"translate(0.775621, 9.722222)",strokeLinejoin:"round"},r.createElement("polyline",{id:"Path-Copy-2",points:"0 4.58204149 5.10673153 0 11.6154223 6.31150113"}),r.createElement("polyline",{id:"Path",points:"9.02830015 3.23981481 11.3158819 0.925925926 15.0663146 4.81868037"}))),r.createElement("g",{id:"Group-9",transform:"translate(0.000000, 6.666667)"},r.createElement("circle",{id:"Oval",stroke:"#1B2559",fill:"#EBEFFF",cx:6.66666667,cy:6.66666667,r:6.16666667}),r.createElement("polygon",{id:"Path",fill:"#1B2559",fillRule:"nonzero",points:"7.22222222 6.11111111 10 6.11111111 10 7.22222222 7.22222222 7.22222222 7.22222222 10 6.11111111 10 6.11111111 7.22222222 3.33333333 7.22222222 3.33333333 6.11111111 6.11111111 6.11111111 6.11111111 3.33333333 7.22222222 3.33333333"}))));function tS(e,t){var n=e.title,a=e.titleId,i=Jk(e,["title","titleId"]);return r.createElement("svg",Qk({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,eS)}var nS=r.forwardRef(tS);n.p;function rS(){return(rS=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function aS(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var iS=r.createElement("g",{id:"icon/button/upload-file/zodiac-resized",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"Add-File-Icon",transform:"translate(0.000000, 0.500000)"},r.createElement("g",{id:"file-icon",transform:"translate(5.934783, 0.000000)",stroke:"#1B2559"},r.createElement("g",{id:"lines",transform:"translate(3.130435, 7.826087)",strokeLinecap:"round"},r.createElement("line",{x1:0,y1:7.04347826,x2:7.82608696,y2:7.04347826,id:"line-3"}),r.createElement("line",{x1:0,y1:3.91304348,x2:7.82608696,y2:3.91304348,id:"line-2"}),r.createElement("line",{x1:0,y1:.782608696,x2:5.47826087,y2:.782608696,id:"line-1"})),r.createElement("polygon",{id:"paper",strokeLinecap:"round",strokeLinejoin:"round",points:"13.5652174 18.6521739 0 18.6521739 -1.18243096e-12 0 8.47826087 2.91569667e-12 13.5652174 5.08695652"}),r.createElement("polygon",{id:"fold",strokeLinejoin:"round",points:"8.47826087 0 8.47826087 5.08695652 13.5652174 5.08695652"})),r.createElement("g",{id:"plus-sign",transform:"translate(0.000000, 5.934783)"},r.createElement("circle",{id:"Oval",stroke:"#1B2559",fill:"#EBEFFF",cx:6.7826087,cy:6.7826087,r:6.2826087}),r.createElement("polygon",{id:"Path",fill:"#1B2559",fillRule:"nonzero",points:"7.34782609 6.2173913 10.173913 6.2173913 10.173913 7.34782609 7.34782609 7.34782609 7.34782609 10.173913 6.2173913 10.173913 6.2173913 7.34782609 3.39130435 7.34782609 3.39130435 6.2173913 6.2173913 6.2173913 6.2173913 3.39130435 7.34782609 3.39130435"}))));function oS(e,t){var n=e.title,a=e.titleId,i=aS(e,["title","titleId"]);return r.createElement("svg",rS({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,iS)}var cS,lS,sS=r.forwardRef(oS),dS=(n.p,Object(f.a)({box:{boxSizing:"border-box",marginTop:40,width:450,height:120,borderStyle:"dashed",borderColor:se,borderRadius:4,borderWidth:1,backgroundColor:ae,display:"flex",justifyContent:"center"},inputContent:{marginTop:35,display:"flex"},uploadContent:{marginTop:50,display:"flex"},board:{width:450,height:120},icon:{margin:[[14,20,0,0]]}})),uS=function(e){var t=e.type,n=dS(),a=Object(r.useState)({}),i=Object(c.a)(a,2),o=i[0],l=i[1],d=Object(pn.e)().setFieldValue,u="image",m=t===u,h=Object(r.useCallback)((function(e){d(t,fb.a(e).name),l({preview:m?URL.createObjectURL(fb.a(e)):fb.a(e).name})}),[m,t,d]),b=Object(Kk.a)({onDrop:h}),p=b.getRootProps,f=b.getInputProps;return Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsxs)("div",Object(s.a)(Object(s.a)({},p()),{},{className:n.board,children:[Wr.a(o)&&Object(Me.jsxs)("div",{className:n.box,children:[Object(Me.jsx)("input",Object(s.a)({},f())),Object(Me.jsxs)("div",{className:n.inputContent,children:[m?Object(Me.jsx)(nS,{className:n.icon}):Object(Me.jsx)(sS,{className:n.icon}),Object(Me.jsx)(nt,{children:"Drag and drop ".concat(m?"an image":"a file"," or click to open the explorer")})]})]}),!Wr.a(o)&&t===u&&Object(Me.jsx)("div",{children:Object(Me.jsx)("img",{src:o.preview,className:n.box,alt:""})},o.name),!Wr.a(o)&&t!==u&&Object(Me.jsx)("div",{className:n.box,children:Object(Me.jsx)(Ve,{className:n.uploadContent,children:o.preview})})]}))})},mS=Object(f.a)(sC),hS=function(e){var t=e.show,n=e.src,r=mS({width:165});return Object(Me.jsx)(Me.Fragment,{children:t?Object(Me.jsx)(Ow,{src:n,width:165,height:45,popupWidth:360,popupHeight:240}):Object(Me.jsx)("div",{className:r.photoWrapper,children:Object(Me.jsx)(Rw,{})})})},bS=function(e){var t,n,a,i,o=e.customer,l=e.updateCustomer,s=mS(),d=Object(r.useState)(!1),u=Object(c.a)(d,2),m=u[0],b=u[1],p=A.a(["idCardData"])(o),f=A.a(["expirationDate"])(p),j=A.a(["country"])(p),g=A.a(["dateOfBirth"])(p),O=A.a(["sanctions"])(o),x=A.a(["sanctionsAt"])(o)?O?"Passed":"Failed":"Not checked yet",v=function(e){return e%2===0},y=Cf.a.filter((function(e){return!Cf.a.isEmpty(e.data)||!Cf.a.isNil(e.children)})),w=Cf.a.filter((function(e){return""!==e.value})),C={idScan:xn.e().shape({name:xn.g(),idNumber:xn.g(),birthDate:xn.g(),age:xn.g(),gender:xn.g(),state:xn.g(),expirationDate:xn.g()}),usSsn:xn.e().shape({usSsn:xn.g()})},k=[{name:"name",label:"Name",value:"".concat(bC(o)),component:Ua},{name:"idNumber",label:"ID number",value:null!==(t=A.a(["documentNumber"])(p))&&void 0!==t?t:"",component:Ua},{name:"birthDate",label:"Birth Date",value:lC(g,Ll.a.utc(g).format("YYYY-MM-DD")),component:Ua},{name:"age",label:"Age",value:lC(g,Ll.a.utc().diff(Ll.a.utc(g).format("YYYY-MM-DD"),"years")),component:Ua},{name:"gender",label:"Gender",value:null!==(n=A.a(["gender"])(p))&&void 0!==n?n:"",component:Ua},{name:"state",label:"Canada"===j?"Province":"State",value:null!==(a=A.a(["state"])(p))&&void 0!==a?a:"",component:Ua},{name:"expirationDate",label:"Expiration Date",value:lC(f,Ll.a.utc(f).format("YYYY-MM-DD")),component:Ua}],S=[{name:"us ssn",label:"US SSN",value:"".concat(null!==(i=o.usSsn)&&void 0!==i?i:""),component:Ua,size:190}],N={idScan:{name:"",idNumber:"",birthDate:"",age:"",gender:"",state:"",expirationDate:""},usSsn:{usSsn:""}},I=[{data:w(k),title:"ID Scan",titleIcon:Object(Me.jsx)(Ew,{className:s.cardIcon}),state:A.a(["idCardDataOverride"])(o),authorize:function(){return l({idCardDataOverride:Ny})},reject:function(){return l({idCardDataOverride:Iy})},save:function(e){return console.log(e)},validationSchema:C.idScan,initialValues:N.idScan},{title:"SMS Confirmation",titleIcon:Object(Me.jsx)(Cw,{className:s.cardIcon}),authorize:function(){},reject:function(){},save:function(){}},{title:"Name",titleIcon:Object(Me.jsx)($w,{className:s.editIcon}),authorize:function(){},reject:function(){},save:function(){}},{title:"Sanctions check",titleIcon:Object(Me.jsx)($w,{className:s.editIcon}),state:A.a(["sanctionsOverride"])(o),authorize:function(){return l({sanctionsOverride:Ny})},reject:function(){return l({sanctionsOverride:Iy})},save:function(){},children:Object(Me.jsx)(Ze,{children:x})},{title:"Front facing camera",titleIcon:Object(Me.jsx)($w,{className:s.editIcon}),state:A.a(["frontCameraOverride"])(o),authorize:function(){return l({frontCameraOverride:Ny})},reject:function(){return l({frontCameraOverride:Iy})},save:function(){},children:o.frontCameraPath?Object(Me.jsx)(hS,{show:o.frontCameraPath,src:"".concat(Bp,"/front-camera-photo/").concat(A.a(["frontCameraPath"])(o))}):null},{title:"ID card image",titleIcon:Object(Me.jsx)($w,{className:s.editIcon}),state:A.a(["idCardPhotoOverride"])(o),authorize:function(){return l({idCardPhotoOverride:Ny})},reject:function(){return l({idCardPhotoOverride:Iy})},save:function(){},children:o.idCardPhotoPath?Object(Me.jsx)(hS,{show:o.idCardPhotoPath,src:"".concat(Bp,"/id-card-photo/").concat(A.a(["idCardPhotoPath"])(o))}):null},{data:w(S),title:"US SSN",titleIcon:Object(Me.jsx)(Cw,{className:s.cardIcon}),state:A.a(["usSsnOverride"])(o),authorize:function(){return l({usSsnOverride:Ny})},reject:function(){return l({usSsnOverride:Iy})},save:function(){},validationSchema:C.usSsn,initialValues:N.usSsn}],E=function(e,t){var n=e.title,r=e.authorize,a=e.reject,i=e.state,o=e.titleIcon,c=e.data,l=e.save,s=e.children,d=e.validationSchema,u=e.initialValues;return Object(Me.jsx)(Yk,{title:n,authorize:r,reject:a,state:i,titleIcon:o,data:c,children:s,validationSchema:d,initialValues:u,save:l},t)},F=y(I);return Object(Me.jsxs)("div",{children:[Object(Me.jsxs)("div",{className:s.header,children:[Object(Me.jsx)(Ve,{className:s.title,children:"Customer data"}),Object(Me.jsx)(Vn,{active:!m,className:s.viewIcons,Icon:cC,InverseIcon:nC,onClick:function(){return b(!1)}}),Object(Me.jsx)(Vn,{active:m,className:s.viewIcons,Icon:Kw,InverseIcon:Gw,onClick:function(){return b(!0)}})]}),Object(Me.jsxs)("div",{children:[!m&&Object(Me.jsxs)(h.a,{container:!0,children:[Object(Me.jsx)(h.a,{container:!0,direction:"column",item:!0,xs:6,children:F.map((function(e,t){return v(t)?E(e,t):null}))}),Object(Me.jsx)(h.a,{container:!0,direction:"column",item:!0,xs:6,children:F.map((function(e,t){return v(t)?null:E(e,t)}))})]}),null]})]})},pS={labelLink:{cursor:"pointer",color:q},breadcrumbs:{margin:[[20,0]]},actionLabel:{color:q,margin:[[4,0]]},customerDetails:{marginBottom:18},customerBlock:function(e){return{display:"flex",flexDirection:"row",margin:[[0,0,4,0]],padding:[[0,e.blocked?35:48,0]]}},customerDiscount:{display:"flex",flexDirection:"row",margin:[[0,0,4,0]],padding:[[0,23.5,0]]},customerManualDataEntry:{display:"flex",flexDirection:"row",margin:[[8,0,4,0]],padding:[[0,40.5,0]]},panels:{display:"flex"},rightSidePanel:{display:"block",width:1100},leftSidePanel:{width:300}},fS=Object(f.a)(pS),jS=x()(cS||(cS=Object(l.a)(["\n query customer($customerId: ID!) {\n config\n customer(customerId: $customerId) {\n id\n authorizedOverride\n frontCameraPath\n frontCameraAt\n frontCameraOverride\n phone\n isAnonymous\n smsOverride\n idCardData\n idCardDataOverride\n idCardDataExpiration\n idCardPhotoPath\n idCardPhotoOverride\n usSsn\n usSsnOverride\n sanctions\n sanctionsAt\n sanctionsOverride\n totalTxs\n totalSpent\n lastActive\n lastTxFiat\n lastTxFiatCode\n lastTxClass\n daysSuspended\n isSuspended\n transactions {\n txClass\n id\n fiat\n fiatCode\n cryptoAtoms\n cryptoCode\n created\n machineName\n errorMessage: error\n error: errorCode\n txCustomerPhotoAt\n txCustomerPhotoPath\n }\n }\n }\n"]))),gS=x()(lS||(lS=Object(l.a)(["\n mutation setCustomer($customerId: ID!, $customerInput: CustomerInput) {\n setCustomer(customerId: $customerId, customerInput: $customerInput) {\n id\n authorizedOverride\n frontCameraPath\n frontCameraOverride\n phone\n smsOverride\n idCardData\n idCardDataOverride\n idCardDataExpiration\n idCardPhotoPath\n idCardPhotoOverride\n usSsn\n usSsnOverride\n sanctions\n sanctionsAt\n sanctionsOverride\n totalTxs\n totalSpent\n lastActive\n lastTxFiat\n lastTxFiatCode\n lastTxClass\n subscriberInfo\n }\n }\n"]))),OS=Object(r.memo)((function(){var e,t,n,a=Object(w.h)(),i=Object(r.useState)(!1),o=Object(c.a)(i,2),l=o[0],s=o[1],d=Object(r.useState)(!1),m=Object(c.a)(d,2),h=m[0],b=m[1],p=Object(r.useState)(null),f=Object(c.a)(p,1)[0],j=Object(r.useState)("overview"),g=Object(c.a)(j,2),O=g[0],x=g[1],v=Object(w.j)().id,y=Object(u.c)(jS,{variables:{customerId:v}}),C=y.data,k=y.refetch,S=y.loading,N=Object(u.b)(gS,{onCompleted:function(){return k()}}),I=Object(c.a)(N,1)[0],E=function(e){return I({variables:{customerId:v,customerInput:e}})},F=null!==(e=A.a(["config"])(C))&&void 0!==e?e:[],L=F&&Cl(pl,F),P=null!==(t=A.a(["customer"])(C))&&void 0!==t?t:[],D=null!==(n=A.a(["transactions"])(P))&&void 0!==n?n:[],B=Dm.a(my.a(R.a("cryptoAtoms")))(D),T=bC(P),M=A.a(["authorizedOverride"])(P)===Iy,W=P.isSuspended,z="customerData"===O,$="overview"===O,q=fS({blocked:M});return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)(Dd.a,{classes:{root:q.breadcrumbs},separator:Object(Me.jsx)(Rd.a,{fontSize:"small"}),"aria-label":"breadcrumb",children:[Object(Me.jsx)(et,{noMargin:!0,className:q.labelLink,onClick:function(){return a.push("/compliance/customers")},children:"Customers"}),Object(Me.jsx)(tt,{noMargin:!0,className:q.labelLink,children:T.length?T:hC(A.a(["phone"])(P),L.country)})]}),Object(Me.jsxs)("div",{className:q.panels,children:[Object(Me.jsx)("div",{className:q.leftSidePanel,children:!S&&!P.isAnonymous&&Object(Me.jsxs)("div",{children:[Object(Me.jsx)("div",{children:Object(Me.jsx)(yk,{isSelected:function(e){return e===O},onClick:function(e){return x(e)}})}),Object(Me.jsx)(et,{className:q.actionLabel,children:"Actions"}),Object(Me.jsx)("div",{children:Object(Me.jsx)(ze,{className:q.customerManualDataEntry,color:"primary",Icon:Zy,InverseIcon:Uy,onClick:function(){return b(!0)},children:"Manual data entry"})}),Object(Me.jsx)("div",{children:Object(Me.jsx)(ze,{className:q.customerDiscount,color:"primary",Icon:ow,InverseIcon:tw,onClick:function(){},children:"Add individual discount"})}),Object(Me.jsxs)("div",{children:[W&&Object(Me.jsx)(ze,{color:"primary",Icon:Cy,InverseIcon:gy,onClick:function(){return E({suspendedUntil:null})},children:"Unsuspend customer"}),Object(Me.jsx)(ze,{color:"primary",className:q.customerBlock,Icon:M?Cy:zy,InverseIcon:M?gy:By,onClick:function(){return E({authorizedOverride:M?Ny:Iy})},children:"".concat(M?"Authorize":"Block"," customer")}),Object(Me.jsx)(ze,{color:"primary",Icon:M?Cy:zy,InverseIcon:M?gy:By,onClick:function(){return I({variables:{customerId:v,customerInput:{subscriberInfo:!0}}})},children:"Retrieve information"})]})]})}),Object(Me.jsxs)("div",{className:q.rightSidePanel,children:[$&&Object(Me.jsxs)("div",{children:[Object(Me.jsx)(No.a,{className:q.customerDetails,display:"flex",justifyContent:"space-between",children:Object(Me.jsx)(JC,{customer:P,locale:L,setShowCompliance:function(){return s(!l)}})}),Object(Me.jsx)("div",{children:Object(Me.jsx)(Zk,{customer:P,data:B,locale:L,loading:S})})]}),z&&Object(Me.jsx)("div",{children:Object(Me.jsx)(bS,{customer:P,updateCustomer:E})})]}),h&&Object(Me.jsx)(NC,{error:null===f||void 0===f?void 0:f.message,save:function(){},onClose:function(){return b(null)}})]})]})})),xS=n(876),vS=n(877),yS=Wn.baseButton,wS=yS.height/2,CS=yS.height/4,kS="rgba(0, 0, 0, 0.08)",SS="0 4px 4px 0 ".concat(kS),NS={size:function(e){var t=e.size;return Object(s.a)({marginTop:"lg"===t?0:2},Hr(t))},bold:Vr,autocomplete:{'&[data-focus="true"]':{backgroundColor:kS}},popup:{display:"flex",flexDirection:"column",borderRadius:[[0,0,CS,CS]],backgroundColor:G,boxShadow:SS},separator:{width:"88%",height:1,margin:"0 auto",border:"solid 0.5px",borderColor:q},item:{display:"flex",flexDirection:"row",width:"100%",height:36,alignItems:"center"},itemLabel:{margin:[0],whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},itemType:{marginLeft:"auto",fontSize:12,color:q,margin:[0]},input:{display:"flex",flex:1,width:273,padding:[[8,12]],alignItems:"center",height:32,borderRadius:wS,backgroundColor:G,color:J},inputWithPopup:{borderRadius:[[CS,CS,0,0]],boxShadow:SS},iconButton:{marginRight:12}},IS=Object(f.a)(NS),ES=Object(r.memo)((function(e){var t,n=e.loading,a=void 0!==n&&n,i=e.filters,o=void 0===i?[]:i,l=e.options,d=void 0===l?[]:l,u=e.inputPlaceholder,m=void 0===u?"":u,h=e.size,b=e.onChange,p=Object($.a)(e,["loading","filters","options","inputPlaceholder","size","onChange"]),f=IS({size:h}),j=Object(r.useState)(!1),g=Object(c.a)(j,2),O=g[0],x=g[1],v=(t={},Object(z.a)(t,f.input,!0),Object(z.a)(t,f.inputWithPopup,O),t),y=function(e){return b(e)};return Object(Me.jsx)(Rr.a,Object(s.a)({loading:a,classes:{option:f.autocomplete},value:o,options:d,getOptionLabel:function(e){return e.value},renderOption:function(e){return Object(Me.jsxs)("div",{className:f.item,children:[Object(Me.jsx)(Xe,{className:f.itemLabel,children:e.value}),Object(Me.jsx)(Xe,{className:f.itemType,children:e.type})]})},autoHighlight:!0,disableClearable:!0,clearOnEscape:!0,multiple:!0,filterSelectedOptions:!0,getOptionSelected:function(e,t){return e.type===t.type},PaperComponent:function(e){var t=e.children;return Object(Me.jsxs)(Un.a,{elevation:0,className:f.popup,children:[Object(Me.jsx)("div",{className:f.separator}),t]})},renderInput:function(e){return Object(Me.jsx)(vS.a,Object(s.a)(Object(s.a)({ref:e.InputProps.ref},e),{},{className:E()(v),startAdornment:Object(Me.jsx)(jw,{className:f.iconButton}),placeholder:m,inputProps:Object(s.a)({className:f.bold,classes:{root:f.size}},e.inputProps)}))},onOpen:function(){return x(!0)},onClose:function(){return x(!1)},onChange:function(e,t){return y(t)}},p))}));function FS(){return(FS=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function LS(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var PS=r.createElement("g",{id:"icon/button/filter/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("path",{d:"M0.6,-3.33066907e-16 L0.509218076,0.00652107669 C0.068925647,0.0708166555 -0.160361948,0.596737342 0.124968515,0.966531156 L4.166,6.204 L4.16660432,9.6 C4.16660432,9.79162756 4.25813682,9.97172829 4.41293455,10.0846831 L6.8797259,11.8846831 L6.96095139,11.9350192 C7.34801849,12.1353088 7.83339568,11.8580867 7.83339568,11.4 L7.833,6.204 L11.8750315,0.966531156 C12.179384,0.572084421 11.8982155,-3.33066907e-16 11.4,-3.33066907e-16 L0.6,-3.33066907e-16 Z M10.179,1.199 L6.75836419,5.63346884 L6.70465653,5.71638775 C6.65811535,5.80315577 6.63339568,5.90052663 6.63339568,6 L6.633,10.219 L5.366,9.294 L5.36660432,6 L5.35847177,5.90154229 C5.34231401,5.80441508 5.30240262,5.71222382 5.24163581,5.63346884 L1.82,1.199 L10.179,1.199 Z",id:"Path",fill:"#FFFFFF",fillRule:"nonzero"}));function DS(e,t){var n=e.title,a=e.titleId,i=LS(e,["title","titleId"]);return r.createElement("svg",FS({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),void 0===n?r.createElement("title",{id:a},"icon/button/filter/white"):n?r.createElement("title",{id:a},n):null,PS)}var BS=r.forwardRef(DS);n.p;function RS(){return(RS=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function TS(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var AS=r.createElement("g",{id:"icon/button/filter/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("path",{d:"M0.6,-4.56301663e-14 L0.509218076,0.00652107669 C0.068925647,0.0708166555 -0.160361948,0.596737342 0.124968515,0.966531156 L4.166,6.204 L4.16660432,9.6 C4.16660432,9.79162756 4.25813682,9.97172829 4.41293455,10.0846831 L6.8797259,11.8846831 L6.96095139,11.9350192 C7.34801849,12.1353088 7.83339568,11.8580867 7.83339568,11.4 L7.833,6.204 L11.8750315,0.966531156 C12.179384,0.572084421 11.8982155,-4.56301663e-14 11.4,-4.56301663e-14 L0.6,-4.56301663e-14 Z M10.179,1.199 L6.75836419,5.63346884 L6.70465653,5.71638775 C6.65811535,5.80315577 6.63339568,5.90052663 6.63339568,6 L6.633,10.219 L5.366,9.294 L5.36660432,6 L5.35847177,5.90154229 C5.34231401,5.80441508 5.30240262,5.71222382 5.24163581,5.63346884 L1.82,1.199 L10.179,1.199 Z",id:"Path",fill:"#1B2559",fillRule:"nonzero"}));function MS(e,t){var n=e.title,a=e.titleId,i=TS(e,["title","titleId"]);return r.createElement("svg",RS({width:"12px",height:"12px",viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),void 0===n?r.createElement("title",{id:a},"icon/button/filter/zodiac"):n?r.createElement("title",{id:a},n):null,AS)}var WS,zS,$S,qS=r.forwardRef(MS),HS=(n.p,{root:{marginLeft:0,height:20,backgroundColor:G,"&:hover, &:focus, &:active":{backgroundColor:G},marginBottom:"auto"},label:{fontSize:ye,fontWeight:Se,fontFamily:Ne,paddingRight:0,paddingLeft:8,color:J}}),VS={button:{width:8,height:8,marginLeft:8,marginRight:8},text:{marginTop:0,marginBottom:0},filters:{display:"flex",marginBottom:16},deleteWrapper:{display:"flex",marginLeft:"auto",justifyContent:"flex-end",flexDirection:"row"},entries:{color:se,margin:"auto",marginRight:12},chips:{marginTop:"auto"}},US=Object(f.a)(HS),GS=Object(f.a)(VS),XS=function(e){var t=e.filters,n=e.onFilterDelete,r=e.setFilters,a=e.entries,i=US(),o=GS();return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Xe,{className:o.text,children:"Filters:"}),Object(Me.jsxs)("div",{className:o.filters,children:[Object(Me.jsx)("div",{className:o.chips,children:t.map((function(e,t){return Object(Me.jsx)(Ea,{classes:i,label:"".concat(hu(e.type),": ").concat(e.value),onDelete:function(){return n(e)},deleteIcon:Object(Me.jsx)(gi,{className:o.button})},t)}))}),Object(Me.jsxs)("div",{className:o.deleteWrapper,children:[Object(Me.jsx)(nt,{className:o.entries,children:"".concat(null!==a&&void 0!==a?a:0," entries")}),Object(Me.jsx)(ze,{color:"secondary",Icon:qS,InverseIcon:BS,className:o.deleteButton,onClick:function(){return r([])},children:"Delete filters"})]})]})]})},YS=Object(f.a)(IC),_S=function(e){var t=e.data,n=e.locale,r=e.onClick,a=e.loading,i=YS(),o=[{header:"Phone",width:175,view:function(e){return hC(e.phone,n.country)}},{header:"Name",width:247,view:bC},{header:"Total TXs",width:130,textAlign:"right",view:function(e){return"".concat(Number.parseInt(e.totalTxs))}},{header:"Total spent",width:155,textAlign:"right",view:function(e){var t;return"".concat(Number.parseFloat(e.totalSpent)," ").concat(null!==(t=e.lastTxFiatCode)&&void 0!==t?t:"")}},{header:"Last active",width:137,view:function(e){return lC(e.lastActive,Ll.a.utc(e.lastActive).format("YYYY-MM-D"))}},{header:"Last transaction",width:165,textAlign:"right",view:function(e){var t,n=!D.a(e.lastTxFiatCode),r="cashOut"===e.lastTxClass?tl:Yc,a=Object(Me.jsx)(r,{className:i.txClassIconRight});return Object(Me.jsxs)(Me.Fragment,{children:[n&&"".concat(parseFloat(e.lastTxFiat)," ").concat(null!==(t=e.lastTxFiatCode)&&void 0!==t?t:""),n&&a]})}},{header:"Status",width:191,view:function(e){return Object(Me.jsx)(md,{statuses:[mC(e)]})}}];return Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsx)(iv,{loading:a,emptyText:"No customers so far",elements:o,data:t,onClick:r})})},ZS=x()(WS||(WS=Object(l.a)(["\n query filters {\n customerFilters {\n type\n value\n }\n }\n"]))),KS=x()(zS||(zS=Object(l.a)(["\n query configAndCustomers(\n $phone: String\n $name: String\n $address: String\n $id: String\n ) {\n config\n customers(phone: $phone, name: $name, address: $address, id: $id) {\n id\n idCardData\n phone\n totalTxs\n totalSpent\n lastActive\n lastTxFiat\n lastTxFiatCode\n lastTxClass\n authorizedOverride\n daysSuspended\n isSuspended\n }\n }\n"]))),QS=Object(f.a)(nb),JS=function(){var e,t=QS(),n=Object(w.h)(),a=Object(r.useState)([]),i=Object(c.a)(a,2),o=i[0],l=i[1],s=Object(r.useState)({}),d=Object(c.a)(s,2),m=d[0],h=d[1],b=Object(r.useState)([]),p=Object(c.a)(b,2),f=p[0],j=p[1],g=Object(u.c)(KS,{variables:m,onCompleted:function(e){return l(A.a(["customers"])(e))}}),O=g.data,x=g.loading,v=g.refetch,y=Object(u.c)(ZS),C=y.data,k=y.loading,S=null!==(e=A.a(["config"])(O))&&void 0!==e?e:[],N=S&&Cl(pl,S),I=$d.a([my.a(R.a("lastActive"))])(null!==o&&void 0!==o?o:[]),E=A.a(["customerFilters"])(C);return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Do,{title:"Customers",appendix:Object(Me.jsx)("div",{children:Object(Me.jsx)(ES,{loading:k,filters:f,options:E,inputPlaceholder:"Search customers",onChange:function(e){var t=L.a($j.a,B.a((function(e){return Object(z.a)({},e.type,e.value)})))(e);j(e),h({phone:t.phone,name:t.name,address:t.address,id:t.id}),v&&v()}})}),appendixClassName:t.buttonsWrapper,labels:[{label:"Cash-in",icon:Object(Me.jsx)(Yc,{})},{label:"Cash-out",icon:Object(Me.jsx)(tl,{})}]}),f.length>0&&Object(Me.jsx)(XS,{filters:f,onFilterDelete:function(e){return j(M.a((function(t){return!xS.a(gu.a(["type","value"],t),e)}))(f))},setFilters:j}),Object(Me.jsx)(_S,{data:I,locale:N,onClick:function(e){return n.push("/compliance/customer/".concat(e.id))},loading:x})]})},eN=n(740),tN=Object(eN.a)({wrapper:{display:"flex",alignItems:"center"},colorIndicator:{borderRadius:3,height:12,width:12,marginRight:8}}),nN=function(e){var t=e.className,n=e.label,r=e.color,a=Object($.a)(e,["className","label","color"]),i=tN();return Object(Me.jsxs)("div",Object(s.a)(Object(s.a)({className:E()(i.wrapper,t)},a),{},{children:[r&&Object(Me.jsx)("div",{className:i.colorIndicator,style:{backgroundColor:r}}),Object(Me.jsx)(et,Object(s.a)(Object(s.a)({},a),{},{children:n}))]}))},rN=Re.label1,aN=Re.mono,iN={wrapper:{display:"flex",flex:1,flexDirection:"row",height:"100%"},main:{display:"flex",flex:1},firstSide:{margin:"0 ".concat(64,"px 0 ").concat(48,"px")},secondSide:{marginTop:-29},error:{color:me},coinTotal:{margin:"".concat(12,"px 0")},leftSpacer:{marginLeft:8},topSpacer:{marginTop:40},addressWrapper:{display:"flex",flexDirection:"column",flex:1,backgroundColor:ae},address:{width:375,margin:"".concat(12,"px ").concat(24,"px")},itemWrapper:{textAlign:"end"},item:{extend:rN,margin:2},inactiveItem:{color:q},firstItem:{fontWeight:700,margin:2},total:{marginTop:"auto",textAlign:"right",marginRight:24},totalPending:{marginTop:2},totalTitle:{color:ue,marginBottom:2},table:{marginTop:8,marginLeft:48},tableLabel:{justifyContent:"end",marginTop:-38},pending:{backgroundColor:ce},copyToClipboard:{marginLeft:"auto",paddingTop:6,paddingLeft:15,marginRight:-11},mono:{extend:aN,width:375,margin:"".concat(12,"px ").concat(24,"px")}},oN=Object(f.a)(iN),cN=165,lN=140,sN=130,dN=x()($S||($S=Object(l.a)(["\n {\n funding {\n cryptoCode\n errorMsg\n fundingAddress\n fundingAddressUrl\n confirmedBalance\n pending\n fiatConfirmedBalance\n fiatPending\n fiatCode\n display\n unitScale\n }\n }\n"]))),uN=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return hb.utils.formatCryptoAddress(e,t).replace(/(.{4})/g,"$1 ")},mN=function(e,t){return e.plus(t)},hN=function(e){return new al.a(e).toFormat(2)},bN=function(e){return hN(e.filter((function(e){return!e.errorMsg})).map((function(e){return new al.a(e.fiatConfirmedBalance)})).reduce(mN,new al.a(0)))},pN=function(){var e,t=Object(r.useState)(null),n=Object(c.a)(t,2),a=n[0],i=n[1],o=Object(r.useState)(!1),l=Object(c.a)(o,1)[0],s=oN(),d=[{cryptoAmount:2,balance:10.23,fiatValue:1e3,date:new Date,performedBy:null,pending:!0},{cryptoAmount:10,balance:12.23,fiatValue:12e3,date:new Date,performedBy:null},{cryptoAmount:5,balance:5,fiatValue:5e4,date:new Date,performedBy:null}],m=Object(u.c)(dN),h=m.data,b=m.loading,p=null!==(e=A.a(["funding"])(h))&&void 0!==e?e:[];p.length&&!a&&i(p[0]);var f=hN(p.filter((function(e){return!e.errorMsg})).map((function(e){return new al.a(e.fiatPending)})).reduce(mN,new al.a(0))),j=function(e){return e>=0?"+":""};return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)("div",{children:Object(Me.jsx)(yn,{children:"Funding"})}),Object(Me.jsxs)("div",{className:s.wrapper,children:[Object(Me.jsx)(di,{data:p,isSelected:function(e){return a&&a.cryptoCode===e.cryptoCode},onClick:i,displayName:function(e){return e.display},itemRender:function(e,t){var n,r,a=(n={},Object(z.a)(n,s.item,!0),Object(z.a)(n,s.inactiveItem,!t),n),i=(r={},Object(z.a)(r,s.itemWrapper,!0),Object(z.a)(r,s.error,e.errorMsg),r);return Object(Me.jsxs)("div",{className:E()(i),children:[Object(Me.jsx)("div",{className:s.firstItem,children:e.display}),!e.errorMsg&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)("div",{className:E()(a),children:[hN(e.fiatConfirmedBalance)," ",e.fiatCode]}),Object(Me.jsxs)("div",{className:E()(a),children:[e.confirmedBalance," ",e.cryptoCode]})]})]})},loading:b,children:p.length&&Object(Me.jsxs)("div",{className:s.total,children:[Object(Me.jsx)(et,{className:s.totalTitle,children:"Total Crypto Balance"}),Object(Me.jsxs)(Ye,{noMargin:!0,children:[bN(p),p[0].fiatCode]}),Object(Me.jsxs)(et,{className:s.totalPending,children:["(",j(f)," ",f," pending)"]})]})}),a&&!l&&a.errorMsg&&Object(Me.jsx)("div",{className:s.main,children:Object(Me.jsx)("div",{className:s.firstSide,children:Object(Me.jsx)(Ze,{className:s.error,children:a.errorMsg})})}),a&&!l&&!a.errorMsg&&Object(Me.jsxs)("div",{className:s.main,children:[Object(Me.jsxs)("div",{className:s.firstSide,children:[Object(Me.jsxs)(Ve,{children:["Balance (",a.display,")"]}),Object(Me.jsxs)("div",{className:s.coinTotal,children:[Object(Me.jsx)(Ye,{inline:!0,noMargin:!0,children:"".concat(a.confirmedBalance," ").concat(a.cryptoCode)}),Object(Me.jsx)(_e,{inline:!0,noMargin:!0,className:s.leftSpacer,children:"(".concat(j(a.pending)," ").concat(a.pending," pending)")})]}),Object(Me.jsxs)("div",{className:s.coinTotal,children:[Object(Me.jsx)(Ze,{inline:!0,noMargin:!0,children:"= ".concat(hN(a.fiatConfirmedBalance)," ").concat(a.fiatCode)}),Object(Me.jsx)(nt,{inline:!0,noMargin:!0,className:s.leftSpacer,children:"(".concat(j(a.fiatPending)," ").concat(hN(a.fiatPending)," pending)")})]}),Object(Me.jsx)(Ve,{className:s.topSpacer,children:"Address"}),Object(Me.jsx)("div",{className:s.addressWrapper,children:Object(Me.jsx)("div",{className:s.mono,children:Object(Me.jsx)("strong",{children:Object(Me.jsx)(sb,{buttonClassname:s.copyToClipboard,children:uN(a.cryptoCode,a.fundingAddress)})})})})]}),Object(Me.jsxs)("div",{className:s.secondSide,children:[Object(Me.jsxs)(et,{children:["Scan to send ",a.display]}),Object(Me.jsx)(jn.a,{size:240,fgColor:J,value:a.fundingAddressUrl})]})]}),a&&l&&Object(Me.jsxs)("div",{children:[Object(Me.jsx)(nN,{className:s.tableLabel,label:"Pending",color:"#cacaca"}),Object(Me.jsxs)(Kd,{className:s.table,children:[Object(Me.jsxs)(Qd,{children:[Object(Me.jsx)(tu,{header:!0,width:cN,children:"Amount Entered"}),Object(Me.jsx)(tu,{header:!0,width:cN,children:"Balance After"}),Object(Me.jsx)(tu,{header:!0,width:cN,children:"Cash Value"}),Object(Me.jsx)(tu,{header:!0,width:sN,children:"Date"}),Object(Me.jsx)(tu,{header:!0,width:lN,children:"Time (h:m:s)"}),Object(Me.jsx)(tu,{header:!0,width:cN,children:"Performed By"})]}),Object(Me.jsx)(eu,{children:d.map((function(e,t){return Object(Me.jsxs)(au,{className:E()(Object(z.a)({},s.pending,e.pending)),children:[Object(Me.jsxs)(tu,{width:cN,children:[e.cryptoAmount," ",a.cryptoCode]}),Object(Me.jsxs)(tu,{width:cN,children:[e.balance," ",a.cryptoCode]}),Object(Me.jsxs)(tu,{width:cN,children:[e.fiatValue," ",a.fiatCode]}),Object(Me.jsx)(tu,{width:sN,children:Ll()(e.date).format("YYYY-MM-DD")}),Object(Me.jsx)(tu,{width:lN,children:Ll()(e.date).format("hh:mm:ss")}),Object(Me.jsx)(tu,{width:cN,children:"add"})]},t)}))})]})]})]})]})};function fN(){return(fN=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function jN(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var gN=r.createElement("circle",{cx:52,cy:32,r:32,fill:"#F7931A"}),ON=r.createElement("path",{d:"m66.1 27.4c0.6-4.3-2.6-6.5-7-8.1l1.4-5.8-3.5-0.9-1.4 5.6c-0.9-0.2-1.9-0.4-2.8-0.7l1.4-5.7-3.5-0.9-1.4 5.8c-0.8-0.2-1.5-0.3-2.2-0.5l0 0-4.8-1.2-0.9 3.8s2.6 0.6 2.6 0.6c1.4 0.4 1.7 1.3 1.6 2l-1.6 6.6c0.1 0 0.2 0.1 0.4 0.1-0.1 0-0.2-0.1-0.4-0.1l-2.3 9.2c-0.2 0.4-0.6 1.1-1.6 0.8 0 0.1-2.6-0.6-2.6-0.6l-1.7 4 4.6 1.1c0.9 0.2 1.7 0.4 2.5 0.6l-1.5 5.8 3.5 0.9 1.4-5.8c1 0.3 1.9 0.5 2.8 0.7l-1.4 5.7 3.5 0.9 1.5-5.8c6 1.1 10.5 0.7 12.4-4.7 1.5-4.4-0.1-6.9-3.2-8.5 2.3-0.5 4-2 4.5-5.2zm-8 11.2c-1.1 4.4-8.4 2-10.8 1.4l1.9-7.7c2.4 0.6 10 1.8 8.9 6.3zm1.1-11.3c-1 4-7.1 2-9.1 1.5l1.7-7c2 0.5 8.4 1.4 7.3 5.6z",fill:"#FFF"});function xN(e,t){var n=e.title,a=e.titleId,i=jN(e,["title","titleId"]);return r.createElement("svg",fN({xmlns:"http://www.w3.org/2000/svg",width:104,height:64,ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,gN,ON)}var vN=r.forwardRef(xN);n.p;function yN(){return(yN=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function wN(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var CN=r.createElement("path",{fill:"#0AC18E",d:"m0,0l29.7,0a39,39,0,0,0,0,64l-29.7,0zm52,0a32,32,0,0,0,0,64a32,32,0,0,0,0,-64m52,0l-29.7,0a39,39,0,0,1,0,64l29.7,0z"}),kN=r.createElement("path",{fill:"#FFF",transform:"rotate(-28 52 32)",d:"m66.103,27.444c0.637-4.258-2.605-6.547-7.038-8.074l1.438-5.768-3.511-0.875-1.4,5.616c-0.923-0.23-1.871-0.447-2.813-0.662l1.41-5.653-3.509-0.875-1.439,5.766c-0.764-0.174-1.514-0.346-2.242-0.527l0.004-0.018-4.842-1.209-0.934,3.75s2.605,0.597,2.55,0.634c1.422,0.355,1.679,1.296,1.636,2.042l-1.638,6.571c0.098,0.025,0.225,0.061,0.365,0.117-0.117-0.029-0.242-0.061-0.371-0.092l-2.296,9.205c-0.174,0.432-0.615,1.08-1.609,0.834,0.035,0.051-2.552-0.637-2.552-0.637l-1.743,4.019,4.569,1.139c0.85,0.213,1.683,0.436,2.503,0.646l-1.453,5.834,3.507,0.875,1.439-5.772c0.958,0.26,1.888,0.5,2.798,0.726l-1.434,5.745,3.511,0.875,1.453-5.823c5.987,1.133,10.489,0.676,12.384-4.739,1.527-4.36-0.076-6.875-3.226-8.515,2.294-0.529,4.022-2.038,4.483-5.155zm-8.022,11.249c-1.085,4.36-8.426,2.003-10.806,1.412l1.928-7.729c2.38,0.594,10.012,1.77,8.878,6.317zm1.086-11.312c-0.99,3.966-7.1,1.951-9.082,1.457l1.748-7.01c1.982,0.494,8.365,1.416,7.334,5.553z"});function SN(e,t){var n=e.title,a=e.titleId,i=wN(e,["title","titleId"]);return r.createElement("svg",yN({xmlns:"http://www.w3.org/2000/svg",width:104,height:64,ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,CN,kN)}var NN=r.forwardRef(SN);n.p;function IN(){return(IN=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function EN(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var FN=r.createElement("circle",{cx:1e3,cy:1e3,r:1e3,fill:"#2573c2"}),LN=r.createElement("g",{fill:"#fff"},r.createElement("path",{d:"M1652.6 736.8a143.65 143.65 0 0 0-19.2-63.6c-10-20-27.8-35.6-48.6-43.6a143.51 143.51 0 0 0-68.4-15H628.8l-63.6 190.6h804.2l-127 389.6h-804l-63.6 190.6h891.8a246.33 246.33 0 0 0 77.8-15c25-14.2 53.6-28.6 77.8-48.6a382.69 382.69 0 0 0 63.6-63.6 432.2 432.2 0 0 0 39.2-73.4l117.8-370.4a137.38 137.38 0 0 0 9.8-77.6z"}),r.createElement("path",{d:"M882.2 911.6H409l-63.6 176.2h478z"}));function PN(e,t){var n=e.title,a=e.titleId,i=EN(e,["title","titleId"]);return r.createElement("svg",IN({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2000 2000",width:2500,height:2500,ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,FN,LN)}var DN=r.forwardRef(PN);n.p;function BN(){return(BN=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function RN(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var TN=r.createElement("g",null,r.createElement("polygon",{fill:"#343434",points:"127.9611 0 125.1661 9.5 125.1661 285.168 127.9611 287.958 255.9231 212.32"}),r.createElement("polygon",{fill:"#8C8C8C",points:"127.962 0 0 212.32 127.962 287.959 127.962 154.158"}),r.createElement("polygon",{fill:"#3C3C3B",points:"127.9611 312.1866 126.3861 314.1066 126.3861 412.3056 127.9611 416.9066 255.9991 236.5866"}),r.createElement("polygon",{fill:"#8C8C8C",points:"127.962 416.9052 127.962 312.1852 0 236.5852"}),r.createElement("polygon",{fill:"#141414",points:"127.9611 287.9577 255.9211 212.3207 127.9611 154.1587"}),r.createElement("polygon",{fill:"#393939",points:"0.0009 212.3208 127.9609 287.9578 127.9609 154.1588"}));function AN(e,t){var n=e.title,a=e.titleId,i=RN(e,["title","titleId"]);return r.createElement("svg",BN({width:"256px",height:"417px",viewBox:"0 0 256 417",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",preserveAspectRatio:"xMidYMid",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,TN)}var MN=r.forwardRef(AN);n.p;function WN(){return(WN=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function zN(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var $N=r.createElement("circle",{fill:"#989898",cx:52,cy:32,r:32}),qN=r.createElement("path",{fill:"#FFF",d:"m46.92598,12.31703l-4.97801,18.8088l-3.42705,1.32711l-1.64691,6.17189l3.42705,-1.29514l-2.8461,10.76083l30.60893,0l2.09993,-7.98401l-18.42505,0l2.09993,-7.82412l3.3631,-1.26316l1.6469,-6.17188l-3.36309,1.29513l3.6509,-13.83611l-12.21053,0z"});function HN(e,t){var n=e.title,a=e.titleId,i=zN(e,["title","titleId"]);return r.createElement("svg",WN({xmlns:"http://www.w3.org/2000/svg",width:104,height:64,ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,$N,qN)}var VN=r.forwardRef(HN);n.p;function UN(){return(UN=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function GN(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var XN=r.createElement("path",{d:"M1000 0c552.26 0 1000 447.74 1000 1000s-447.76 1000-1000 1000S0 1552.38 0 1000 447.68 0 1000 0",fill:"#53ae94"}),YN=r.createElement("path",{d:"M1123.42 866.76V718h340.18V491.34H537.28V718H877.5v148.64C601 879.34 393.1 934.1 393.1 999.7s208 120.36 484.4 133.14v476.5h246V1132.8c276-12.74 483.48-67.46 483.48-133s-207.48-120.26-483.48-133m0 225.64v-.12c-6.94.44-42.6 2.58-122 2.58-63.48 0-108.14-1.8-123.88-2.62v.2C633.34 1081.66 451 1039.12 451 988.22S633.36 894.84 877.62 884v166.1c16 1.1 61.76 3.8 124.92 3.8 75.86 0 114-3.16 121-3.8V884c243.8 10.86 425.72 53.44 425.72 104.16s-182 93.32-425.72 104.18",fill:"#fff"});function _N(e,t){var n=e.title,a=e.titleId,i=GN(e,["title","titleId"]);return r.createElement("svg",UN({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2000 2000",width:2500,height:2500,ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,XN,YN)}var ZN=r.forwardRef(_N);n.p;function KN(){return(KN=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function QN(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var JN=r.createElement("style",{type:"text/css"},"\n\t.st0{fill:#231F20;}\n\t.st1{fill:#F4B728;}\n"),eI=r.createElement("path",{className:"st0",d:"M245.4,20C121.1,20,20,121.1,20,245.4s101.1,225.4,225.4,225.4s225.4-101.1,225.4-225.4S369.7,20,245.4,20z M245.4,433.6c-103.8,0-188.2-84.4-188.2-188.2S141.6,57.2,245.4,57.2s188.2,84.4,188.2,188.2S349.2,433.6,245.4,433.6z"}),tI=r.createElement("circle",{className:"st1",cx:245.4,cy:245.4,r:177.6}),nI=r.createElement("polygon",{className:"st0",points:"165,315.5 165,349.9 226.5,349.9 226.5,387.6 264.3,387.6 264.3,349.9 325.8,349.9 325.8,304.4 230.4,304.4 325.8,175 325.8,140.6 264.3,140.6 264.3,103 226.5,103 226.5,140.6 165,140.6 165,186.2 260.4,186.2 "});function rI(e,t){var n=e.title,a=e.titleId,i=QN(e,["title","titleId"]);return r.createElement("svg",KN({id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 493.3 490.2",style:{enableBackground:"new 0 0 493.3 490.2"},xmlSpace:"preserve",ref:t,"aria-labelledby":a},i),JN,void 0===n?r.createElement("title",{id:a},"headerArtboard 7"):n?r.createElement("title",{id:a},n):null,eI,tI,nI)}var aI,iI,oI,cI,lI,sI,dI,uI,mI,hI=r.forwardRef(rI),bI=(n.p,Object(f.a)({logo:{maxHeight:80,maxWidth:200},title:{margin:[[24,0,32,0]]},text:{margin:0},button:{marginTop:"auto",marginBottom:58},modalContent:{display:"flex",flexDirection:"column",alignItems:"center",padding:[[0,42]],flex:1}})),pI=function(e){var t=e.code,n=e.name,r=e.onContinue,a=bI(),i=function(e){switch(e){case"BTC":return vN;case"BCH":return NN;case"DASH":return DN;case"ETH":return MN;case"LTC":return VN;case"ZEC":return hI;case"USDT":return ZN;default:return null}}(t);return Object(Me.jsxs)("div",{className:a.modalContent,children:[Object(Me.jsx)(i,{className:a.logo}),Object(Me.jsxs)(qe,{className:a.title,children:["Enable ",n]}),Object(Me.jsxs)(Xe,{className:a.text,children:["You are about to enable ",n," on your system. This will allow you to use this cryptocurrency on your machines. To be able to do that, you\u2019ll have to set up all the necessary 3rd party services."]}),Object(Me.jsx)(An,{className:a.button,onClick:r,children:"Start configuration"})]})},fI={title:{margin:[[0,0,12,0]]},subtitle:{margin:[[32,0,21,0]]},error:{color:me},button:{marginLeft:"auto"},submit:{display:"flex",flexDirection:"row",margin:[["auto",0,24]]},radioGroup:{flexDirection:"row"},radioLabel:{width:150,height:48},radio:{padding:4,margin:4},setupNew:{display:"flex",alignItems:"center",height:48},picker:{width:150},horizontalAlign:{display:"flex",flexDirection:"row"},centerAlignment:{alignItems:"center"},zeroConfLimit:{marginRight:5,"& > div":{fontSize:je,fontFamily:pe,fontWeight:300,"& > input":{padding:[[6,0,2]]}}}},jI=Object(f.a)(fI),gI={form:null,selected:null,isNew:!1,iError:!1},OI=function(e,t){switch(t.type){case"select":return{form:null,selected:t.selected,isNew:null,iError:!1};case"new":return{form:e.form,selected:null,isNew:!0,iError:!1};case"form":return{form:t.form,selected:t.form.code,isNew:!0,iError:!1};case"error":return Gn.a(e,{innerError:!0});case"reset":return gI;default:throw new Error}},xI=function(e){var t,n=e.type,a=e.schema,i=e.coin,o=e.name,l=e.step,s=e.error,d=e.lastStep,u=e.onContinue,m=e.fiatCurrency,h=e.filled,b=e.unfilled,p=e.getValue,f=jI(),j=Object(r.useReducer)(OI,gI),g=Object(c.a)(j,2),O=g[0],x=O.innerError,v=O.selected,y=O.form,w=O.isNew,C=g[1];Object(r.useEffect)((function(){C({type:"reset"})}),[l]);var k=function(e,t){if(!e||!e[n])return C({type:"error"});u(e,t)},S=d?"Finish":"Next",N=null!==o&&void 0!==o?o:n,I=(t={},Object(z.a)(t,f.subtitle,!0),Object(z.a)(t,f.error,x),t);return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(_e,{className:f.title,children:pu(N)}),Object(Me.jsx)(OO,{steps:5,currentStep:l}),Object(Me.jsx)(Ue,{className:E()(I),children:l<4?"Select a ".concat(N," or set up a new one"):"Select ".concat(N," for ").concat(i)}),5!==l&&Object(Me.jsx)(xa,{options:h,value:v,className:f.radioGroup,onChange:function(e,t){C({type:"select",selected:t})},labelClassName:f.radioLabel,radioClassName:f.radio}),5===l&&Object(Me.jsx)(pn.d,{validateOnBlur:!1,validateOnChange:!0,initialValues:{zeroConfLimit:""},enableReinitialize:!0,validationSchema:a,children:function(e){e.values;var t=e.setFieldValue;return Object(Me.jsx)(pn.c,{children:Object(Me.jsxs)("div",{className:E()(f.horizontalAlign,f.lineAlignment),children:[Object(Me.jsx)(pn.b,{component:qa,decimalPlaces:0,width:50,placeholder:"0",name:"zeroConfLimit",onChange:function(e){C({type:"select",selected:e.target.value}),t(e.target.id,e.target.value)},className:f.zeroConfLimit}),Object(Me.jsx)(_e,{children:m})]})})}}),Object(Me.jsxs)("div",{className:f.setupNew,children:[!Wr.a(b)&&!D.a(b)&&Object(Me.jsx)(xa,{value:w,onChange:function(e,t){C({type:"new"})},labelClassName:f.radioLabel,radioClassName:f.radio,options:[{display:"Set up new",code:!0}]}),w&&Object(Me.jsx)(Yr,{fullWidth:!0,label:"Select ".concat(N),className:f.picker,getOptionSelected:$r.a("code"),labelProp:"display",options:b,onChange:function(e,t){C({type:"form",form:t})}})]}),y&&Object(Me.jsx)(Hj,{save:function(e){return k(Object(z.a)({},n,y.code),Object(z.a)({},y.code,e))},elements:Sg[y.code].elements,validationSchema:Sg[y.code].validationSchema,value:p(y.code),buttonLabel:S}),!y&&Object(Me.jsxs)("div",{className:f.submit,children:[s&&Object(Me.jsx)(Fo,{children:"Failed to save"}),Object(Me.jsx)(An,{className:f.button,onClick:function(){return k(Object(z.a)({},n,v))},children:S})]})]})},vI=function(e,t){return M.a((function(n){return function(e){return W.a("class",e)}(t)(n)&&function(e){return L.a(qo.a(e),R.a("cryptos"))}(e)(n)}))},yI=M.a((function(e){return!e.deprecated})),wI=function(e,t,n,r){var a=yI(vI(r,n)(e)),i=Bl.a((function(e){var n=e.code,r=function(e){return t&&t[e]}(n);return!Sg[n]||(0,Sg[n].getValidationSchema)(r).isValidSync(r)}))(a),o=Object(c.a)(i,2);return{filled:o[0],unfilled:o[1]}},CI=function(e){var t=e.coin,n=e.onClose,a=e.accountsConfig,i=e.accounts,o=e.fiatCurrency,l=e.save,d=e.error,u=Object(r.useState)({step:0,config:{active:!0},accountsToSave:{}}),m=Object(c.a)(u,2),h=m[0],b=h.step,p=h.config,f=h.accountsToSave,j=m[1],g="Enable ".concat(t.display),O=5===b,x={filled:vI(t.code,"ticker")(a)},v=wI(a,i,"wallet",t.code),y=wI(a,i,"exchange",t.code),w=wI(a,i,"zeroConf",t.code),C=function(){var e=Object(nc.a)(tc.a.mark((function e(n,r){var a,i,o,c;return tc.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=Gn.a(p,n),i=r?Gn.a(f,r):f,!O){e.next=6;break}return o=fb.a(il.a(hb.utils.getCryptoCurrency(t.code).units)),c=Object(s.a)(Object(s.a)({},a),{},{cryptoUnits:o}),e.abrupt("return",l(kl(t.code,c),i));case 6:j({step:b+1,config:a,accountsToSave:i});case 7:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();return Object(Me.jsxs)(sO,{title:0===b?null:g,handleClose:n,width:554,open:!0,children:[0===b&&Object(Me.jsx)(pI,{code:t.code,name:t.display,onContinue:function(){return C()}}),0!==b&&Object(Me.jsx)(xI,Object(s.a)(Object(s.a)({step:b,coin:t.display,fiatCurrency:o,error:d,lastStep:O},function(){switch(b){case 1:return Object(s.a)({type:"ticker"},x);case 2:return Object(s.a)({type:"wallet"},v);case 3:return Object(s.a)({type:"exchange"},y);case 4:return Object(s.a)({type:"zeroConf",name:"confidence checking",schema:xn.e().shape({zeroConfLimit:xn.d().required()})},w);case 5:return Object(s.a)({type:"zeroConfLimit",name:"0-conf limit"},w);default:return null}}()),{},{onContinue:C,getValue:function(e){return Ar.a(W.a("code",e))(i)}}))]})},kI=Object(f.a)({rightAligned:{marginTop:"20px",marginLeft:"auto",marginBottom:"20px"},rightLink:{marginLeft:"20px"}}),SI=x()(aI||(aI=Object(l.a)(["\n query getData {\n config\n accounts\n accountsConfig {\n code\n display\n class\n cryptos\n }\n currencies {\n code\n display\n }\n countries {\n code\n display\n }\n cryptoCurrencies {\n code\n display\n }\n languages {\n code\n display\n }\n machines {\n name\n deviceId\n }\n }\n"]))),NI=x()(iI||(iI=Object(l.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),II=function(e){var t=e.open,n=e.close,r=e.save,a=kI();return Object(Me.jsxs)(sO,{title:"Change fiat currency?",handleClose:n,width:450,height:310,open:t,children:[Object(Me.jsx)(Xe,{children:"Please note that all values you set that were based on your prior fiat currency are still the same. If you need to adjust these to reflect the new fiat currency (such as minimum transaction amounts, fixed fees, and compliance triggers, for example), please do so now."}),Object(Me.jsx)(Xe,{children:"Also, if you have cash-out enabled, you must define new dispenser bill counts for the new currency for cash-out on the new currency to work."}),Object(Me.jsxs)("div",{className:a.rightAligned,children:[Object(Me.jsx)(or,{onClick:n,color:"secondary",children:"Cancel"}),Object(Me.jsx)(or,{className:a.rightLink,onClick:r,color:"primary",children:"Save"})]})]})},EI=function(e){var t,n,a,i,o,l,s=e.name,d=Object(r.useState)(!1),m=Object(c.a)(d,2),h=m[0],b=m[1],p=Object(r.useState)(null),f=Object(c.a)(p,2),j=f[0],g=f[1],O=Object(r.useState)(null),x=Object(c.a)(O,2),v=x[0],y=x[1],w=Object(r.useState)(!1),C=Object(c.a)(w,2),k=C[0],S=C[1],N=Object(r.useState)(!1),I=Object(c.a)(N,2),E=I[0],F=I[1],P=Object(u.c)(SI).data,D=Object(u.b)(NI,{onCompleted:function(){return b(!1)},refetchQueries:function(){return["getData"]},onError:function(e){return y(e)}}),B=Object(c.a)(D,1)[0],R=Object(r.useState)(null),T=Object(c.a)(R,2),A=T[0],M=T[1],z=(null===P||void 0===P?void 0:P.config)&&Cl(s)(P.config),$=(null===P||void 0===P?void 0:P.config)&&Cl(ml)(P.config),q=null===P||void 0===P?void 0:P.accountsConfig,H=null!==(t=null===P||void 0===P?void 0:P.accounts)&&void 0!==t?t:[],V=null!==(n=null===P||void 0===P?void 0:P.cryptoCurrencies)&&void 0!==n?n:[],U=z&&!Wr.a(z)?z:lj,G=null!==(a=U.overrides)&&void 0!==a?a:[],X=function(e){return M(null),B({variables:{config:e}})},Y=function(e,t,n){var r=If.a(t,e)[0];if(!r)return n(t);var a=Cl(r)($);if(!gj.isValidSync(a))return g((function(){return function(){return n(t)}})),void b(r);n(t)};return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(II,{open:A,close:function(){return M(null)},save:function(){return A&&X(A)}}),Object(Me.jsx)(Do,{title:"Locales"}),Object(Me.jsx)(kj,{children:Object(Me.jsx)(jm,{title:"Default settings",error:null===v||void 0===v?void 0:v.message,titleLg:!0,name:"locale",enableEdit:!0,initialValues:U,save:function(e){var t=kl(s)(e.locale[0]);return z.fiatCurrency&&t.locale_fiatCurrency!==z.fiatCurrency?M(t):X(t)},validationSchema:oj,data:Qv.a(U),elements:aj(P,Y),setEditing:function(e,t){return S(t)},forceDisable:E})}),Object(Me.jsx)(kj,{children:Object(Me.jsx)(jm,{error:null===v||void 0===v?void 0:v.message,title:"Overrides",titleLg:!0,name:"overrides",enableDelete:!0,enableEdit:!0,enableCreate:!0,initialValues:sj,save:function(e){var t=kl(s)(e);return y(null),B({variables:{config:t}})},validationSchema:cj,data:null!==G&&void 0!==G?G:[],elements:ij(P,G,Y),disableAdd:L.a(Wr.a,If.a)(null!==(i=null===P||void 0===P?void 0:P.machines.map((function(e){return e.deviceId})))&&void 0!==i?i:[],null!==(o=null===G||void 0===G?void 0:G.map((function(e){return e.machine})))&&void 0!==o?o:[]),setEditing:function(e,t){return F(t)},forceDisable:k})}),h&&Object(Me.jsx)(CI,{coin:Ar.a(W.a("code",h))(V),onClose:function(){return b(!1)},save:function(e){return X(kl(ml)(e)).then((function(e){return j(),g(null),e}))},error:null===v||void 0===v?void 0:v.message,cryptoCurrencies:V,userAccounts:null===P||void 0===P||null===(l=P.config)||void 0===l?void 0:l.accounts,accounts:H,accountsConfig:q})]})},FI={identification:{display:"flex",flexDirection:"row",alignItems:"center","& > *:first-child":{marginLeft:0},"& > *":{marginLeft:6},"& > *:nth-child(3)":{marginLeft:15}},form:{display:"flex",flexDirection:"column",height:"100%","& > *:first-child":{marginTop:10},"& > *":{marginBottom:20}},customerAutocomplete:{width:350},discountRateWrapper:{display:"flex",flexDirection:"row",alignItems:"center"},discountInput:{display:"flex",flexDirection:"row",alignItems:"center"},footer:{display:"flex",flexDirection:"row",margin:[["auto",0,24,0]]},submit:{margin:[["auto",0,0,"auto"]]},error:{color:me}},LI=Object(f.a)(FI),PI={customer:"",discount:""},DI=xn.e().shape({customer:xn.g().required("A customer is required!"),discount:xn.d().required("A discount rate is required!").min(0,"Discount rate should be a positive number!").max(100,"Discount rate should have a maximum value of 100%!")}),BI=function(e,t,n){return e&&t?n?"Internal server error":e.customer&&t.customer?e.customer:e.discount&&t.discount?e.discount:null:null},RI=function(e){var t=e.showModal,n=e.setShowModal,r=e.onClose,a=e.creationError,i=e.addDiscount,o=e.customers,c=LI();return Object(Me.jsx)(Me.Fragment,{children:t&&Object(Me.jsx)(sO,{title:"Add individual customer discount",closeOnBackdropClick:!0,width:600,height:500,handleClose:r,open:!0,children:Object(Me.jsx)(pn.d,{validateOnBlur:!1,validateOnChange:!1,initialValues:PI,validationSchema:DI,onSubmit:function(e){!function(e,t){i({variables:{customerId:e,discount:parseInt(t)}}),n(!1)}(e.customer,e.discount)},children:function(e){var t=e.errors,n=e.touched;return Object(Me.jsxs)(pn.c,{id:"individual-discount-form",className:c.form,children:[Object(Me.jsx)("div",{className:c.customerAutocomplete,children:Object(Me.jsx)(pn.b,{name:"customer",label:"Select a customer",component:ka,fullWidth:!0,options:B.a((function(e){var t,n,r,a,i,o;return{code:e.id,display:"".concat(null!==(t=null===e||void 0===e||null===(n=e.idCardData)||void 0===n?void 0:n.firstName)&&void 0!==t?t:"").concat((null===e||void 0===e||null===(r=e.idCardData)||void 0===r?void 0:r.firstName)&&(null===e||void 0===e||null===(a=e.idCardData)||void 0===a?void 0:a.lastName)?" ":"").concat(null!==(i=null===e||void 0===e||null===(o=e.idCardData)||void 0===o?void 0:o.lastName)&&void 0!==i?i:""," (").concat(e.phone,")")}}))(o),labelProp:"display",valueProp:"code"})}),Object(Me.jsxs)("div",{children:[Object(Me.jsxs)("div",{className:c.discountRateWrapper,children:[Object(Me.jsx)(Ve,{children:"Define discount rate"}),Object(Me.jsxs)(Eb,{width:304,children:[Object(Me.jsx)(Xe,{children:"This is a percentage discount off of your existing commission rates for a customer entering this code at the machine."}),Object(Me.jsx)(Xe,{children:"For instance, if you charge 8% commissions, and this code is set for 50%, then you'll instead be charging 4% on transactions using the code."})]})]}),Object(Me.jsxs)("div",{className:c.discountInput,children:[Object(Me.jsx)(pn.b,{name:"discount",size:"lg",autoComplete:"off",width:50,decimalScale:0,className:c.discountInputField,component:qa}),Object(Me.jsx)(Qe,{inline:!0,className:c.inputLabel,children:"%"})]})]}),Object(Me.jsxs)("div",{className:c.footer,children:[BI(t,n,a)&&Object(Me.jsx)(Fo,{children:BI(t,n,a)}),Object(Me.jsx)(An,{type:"submit",form:"individual-discount-form",className:c.submit,children:"Add discount"})]})]})}})})})},TI=Object(f.a)(FI),AI=x()(oI||(oI=Object(l.a)(["\n query individualDiscounts {\n individualDiscounts {\n id\n customerId\n discount\n }\n }\n"]))),MI=x()(cI||(cI=Object(l.a)(["\n mutation deleteIndividualDiscount($discountId: ID!) {\n deleteIndividualDiscount(discountId: $discountId) {\n id\n }\n }\n"]))),WI=x()(lI||(lI=Object(l.a)(["\n mutation createIndividualDiscount($customerId: ID!, $discount: Int!) {\n createIndividualDiscount(customerId: $customerId, discount: $discount) {\n id\n }\n }\n"]))),zI=x()(sI||(sI=Object(l.a)(["\n {\n customers {\n id\n phone\n idCardData\n phone\n }\n }\n"]))),$I=function(){var e=TI(),t=Object(r.useState)(!1),n=Object(c.a)(t,2),a=n[0],i=n[1],o=Object(r.useState)(),l=Object(c.a)(o,2),s=l[0],d=l[1],m=Object(r.useState)(""),h=Object(c.a)(m,2),b=h[0],p=h[1],f=Object(r.useState)(!1),j=Object(c.a)(f,2),g=j[0],O=j[1],x=function(){return O(!g)},v=Object(u.c)(AI),y=v.data,w=v.loading,C=Object(u.c)(zI),k=C.data,S=C.loading,N=Object(u.b)(WI,{refetchQueries:function(){return["individualDiscounts"]}}),I=Object(c.a)(N,2),E=I[0],F=I[1].error,L=function(e){var t=A.a(["customers"])(k);return Ar.a(W.a("id",e))(t)},P=Object(u.b)(MI,{onError:function(e){var t=e.message;p(null!==t&&void 0!==t?t:"Error while deleting row")},onCompleted:function(){return i(!1)},refetchQueries:function(){return["individualDiscounts"]}}),B=Object(c.a)(P,1)[0],R=[{header:"Identification",width:312,textAlign:"left",size:"sm",view:function(t){var n,r,a=L(t.customerId);return Object(Me.jsxs)("div",{className:e.identification,children:[Object(Me.jsx)(Zb,{}),Object(Me.jsx)("span",{children:a.phone}),(null===a||void 0===a||null===(n=a.idCardData)||void 0===n?void 0:n.documentNumber)&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(zb,{}),Object(Me.jsx)("span",{children:null===a||void 0===a||null===(r=a.idCardData)||void 0===r?void 0:r.documentNumber})]})]})}},{header:"Name",width:300,textAlign:"left",size:"sm",view:function(e){var t,n,r=L(e.customerId);return D.a(r.idCardData)?Object(Me.jsx)(Me.Fragment,{children:"-"}):Object(Me.jsx)(Me.Fragment,{children:"".concat(null!==(t=r.idCardData.firstName)&&void 0!==t?t:"").concat(r.idCardData.firstName&&r.idCardData.lastName?" ":"").concat(null!==(n=r.idCardData.lastName)&&void 0!==n?n:"")})}},{header:"Discount rate",width:220,textAlign:"left",size:"sm",view:function(e){return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Qe,{inline:!0,children:e.discount})," %"]})}},{header:"Revoke",width:100,textAlign:"center",size:"sm",view:function(e){return Object(Me.jsx)(tr,{onClick:function(){i(!0),d({variables:{discountId:e.id}})},children:Object(Me.jsx)(Xu,{})})}}],T=w||S;return Object(Me.jsxs)(Me.Fragment,{children:[!T&&!Wr.a(y.individualDiscounts)&&Object(Me.jsx)(No.a,{marginBottom:4,marginTop:-7,className:e.tableWidth,display:"flex",justifyContent:"flex-end",children:Object(Me.jsx)(or,{color:"primary",onClick:x,children:"Add new code"})}),!T&&!Wr.a(y.individualDiscounts)&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(iv,{elements:R,data:A.a(["individualDiscounts"])(y)}),Object(Me.jsx)(yu,{open:a,onDismissed:function(){i(!1),p(null)},onConfirmed:function(){p(null),B(s)},errorMessage:b})]}),!T&&Wr.a(y.individualDiscounts)&&Object(Me.jsxs)(No.a,{display:"flex",alignItems:"left",flexDirection:"column",children:[Object(Me.jsx)(nt,{children:"It seems there are no active individual customer discounts on your network."}),Object(Me.jsx)(An,{onClick:x,children:"Add individual discount"})]}),Object(Me.jsx)(RI,{showModal:g,setShowModal:O,onClose:function(){O(!1)},creationError:F,addDiscount:E,customers:A.a(["customers"])(k)})]})},qI={footer:{display:"flex",flexDirection:"row",margin:[["auto",0,24,0]]},modalLabel1:{marginTop:20},modalLabel2Wrapper:{marginTop:40,display:"flex",flexDirection:"row",justifyContent:"flex-start"},discountInput:{display:"flex",flexDirection:"row",alignItems:"flex-start"},inputLabel:{color:J,fontFamily:pe,fontSize:24,marginLeft:8,marginTop:15},tableWidth:{width:620},error:{color:me},form:{display:"flex",flexDirection:"column",height:"100%"},submit:{margin:[["auto",0,0,"auto"]]}},HI=Object(f.a)(qI),VI={code:"",discount:""},UI=xn.e().shape({code:xn.g().required().trim().max(25),discount:xn.d().required().min(0).max(100)}),GI=function(e){var t=e.showModal,n=e.onClose,r=e.errorMsg,a=e.addCode,i=HI();return Object(Me.jsx)(Me.Fragment,{children:t&&Object(Me.jsx)(sO,{title:"Add promo code discount",closeOnBackdropClick:!0,width:600,height:500,handleClose:n,open:!0,children:Object(Me.jsx)(pn.d,{validateOnBlur:!1,validateOnChange:!1,initialValues:VI,validationSchema:UI,onSubmit:function(e){!function(e,t){a(pb.a(e),parseInt(t))}(e.code,e.discount)},children:Object(Me.jsxs)(pn.c,{id:"promo-form",className:i.form,children:[Object(Me.jsx)(Ve,{className:i.modalLabel1,children:"Promo code name"}),Object(Me.jsx)(pn.b,{name:"code",autoFocus:!0,size:"lg",autoComplete:"off",width:338,inputProps:{style:{textTransform:"uppercase"}},component:Ua}),Object(Me.jsxs)("div",{className:i.modalLabel2Wrapper,children:[Object(Me.jsx)(Ve,{className:i.modalLabel2,children:"Define discount rate"}),Object(Me.jsxs)(Eb,{width:304,children:[Object(Me.jsx)(Xe,{children:"This is a percentage discount off of your existing commission rates for a customer entering this code at the machine."}),Object(Me.jsx)(Xe,{children:"For instance, if you charge 8% commissions, and this code is set for 50%, then you'll instead be charging 4% on transactions using the code."})]})]}),Object(Me.jsxs)("div",{className:i.discountInput,children:[Object(Me.jsx)(pn.b,{name:"discount",size:"lg",autoComplete:"off",width:50,decimalScale:0,className:i.discountInputField,component:qa}),Object(Me.jsx)(Qe,{inline:!0,className:i.inputLabel,children:"%"})]}),Object(Me.jsxs)("div",{className:i.footer,children:[r&&Object(Me.jsx)(Fo,{children:r}),Object(Me.jsx)(An,{type:"submit",form:"promo-form",className:i.submit,children:"Add code"})]})]})})})})},XI=Object(f.a)(qI),YI="Failed to save",_I=x()(dI||(dI=Object(l.a)(["\n query promoCodes {\n promoCodes {\n id\n code\n discount\n }\n }\n"]))),ZI=x()(uI||(uI=Object(l.a)(["\n mutation deletePromoCode($codeId: ID!) {\n deletePromoCode(codeId: $codeId) {\n id\n }\n }\n"]))),KI=x()(mI||(mI=Object(l.a)(["\n mutation createPromoCode($code: String!, $discount: Int!) {\n createPromoCode(code: $code, discount: $discount) {\n id\n code\n discount\n }\n }\n"]))),QI=function(){var e=XI(),t=Object(r.useState)(!1),n=Object(c.a)(t,2),a=n[0],i=n[1],o=Object(r.useState)(),l=Object(c.a)(o,2),s=l[0],d=l[1],m=Object(r.useState)(!1),h=Object(c.a)(m,2),b=h[0],p=h[1],f=Object(r.useState)(null),j=Object(c.a)(f,2),g=j[0],O=j[1],x=function(){return p(!b)},v=Object(u.c)(_I),y=v.data,w=v.loading,C=Object(u.b)(ZI,{onError:function(e){var t=e.message;O(null!==t&&void 0!==t?t:"Error while deleting row")},onCompleted:function(){return i(!1)},refetchQueries:function(){return["promoCodes"]}}),k=Object(c.a)(C,1)[0],S=Object(u.b)(KI,{refetchQueries:function(){return["promoCodes"]}}),N=Object(c.a)(S,1)[0],I=[{header:"Code",width:300,textAlign:"left",size:"sm",view:function(e){return e.code}},{header:"Discount",width:220,textAlign:"left",size:"sm",view:function(e){return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Qe,{inline:!0,children:e.discount})," % in commissions"]})}},{header:"Delete",width:100,textAlign:"center",size:"sm",view:function(e){return Object(Me.jsx)(tr,{onClick:function(){i(!0),d({variables:{codeId:e.id}})},children:Object(Me.jsx)(Xu,{})})}}];return Object(Me.jsxs)(Me.Fragment,{children:[!w&&!Wr.a(y.promoCodes)&&Object(Me.jsx)(No.a,{marginBottom:4,marginTop:-7,className:e.tableWidth,display:"flex",justifyContent:"flex-end",children:Object(Me.jsx)(or,{color:"primary",onClick:x,children:"Add new code"})}),!w&&!Wr.a(y.promoCodes)&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(iv,{elements:I,data:A.a(["promoCodes"])(y)}),Object(Me.jsx)(yu,{open:a,onDismissed:function(){i(!1),O(null)},onConfirmed:function(){O(null),k(s)},errorMessage:g})]}),!w&&Wr.a(y.promoCodes)&&Object(Me.jsxs)(No.a,{display:"flex",alignItems:"left",flexDirection:"column",children:[Object(Me.jsx)(nt,{children:"Currently, there are no active promo codes on your network."}),Object(Me.jsx)(An,{onClick:x,children:"Add Code"})]}),Object(Me.jsx)(GI,{showModal:b,onClose:function(){O(null),p(!1)},errorMsg:g,addCode:function(e,t){O(null),N({variables:{code:e,discount:t}}).then((function(e){if(!e.errors)return p(!1);var t=Wo.a((function(e){return F.a("duplicate",null===e||void 0===e?void 0:e.message)}))(e.errors);O(t?"There is already a promotion with that code!":YI)})).catch((function(e){O(YI),console.log(e)}))}})]})};function JI(){return(JI=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function eE(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var tE=r.createElement("desc",null,"Created with Sketch."),nE=r.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("g",{id:"pop-up/action/download-logs/date-range-copy-3",transform:"translate(-117.000000, -116.000000)",stroke:"#1B2559",strokeWidth:2},r.createElement("g",{id:"arrow-download-logs",transform:"translate(128.500000, 124.500000) rotate(-90.000000) translate(-128.500000, -124.500000) translate(121.000000, 114.000000)"},r.createElement("polyline",{id:"Path-3",points:"0 13.3571429 7.14285714 20.5 14.2857143 13.3571429"}),r.createElement("line",{x1:7.14285714,y1:.142857143,x2:7.14285714,y2:20.1428571,id:"Path-4"}))));function rE(e,t){var n=e.title,a=e.titleId,i=eE(e,["title","titleId"]);return r.createElement("svg",JI({width:"23px",height:"17px",viewBox:"0 0 23 17",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),void 0===n?r.createElement("title",{id:a},"arrow download logs"):n?r.createElement("title",{id:a},n):null,tE,nE)}var aE=r.forwardRef(rE);n.p;function iE(){return(iE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function oE(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var cE=r.createElement("desc",null,"Created with Sketch."),lE=r.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"pop-up/action/download-logs/date-range-copy-2",transform:"translate(-20.000000, -187.000000)"},r.createElement("g",{id:"icon/sf-contain-b-copy-5",transform:"translate(30.000000, 197.000000) rotate(-270.000000) translate(-30.000000, -197.000000) translate(20.000000, 187.000000)"},r.createElement("g",{id:"icon/sf-small/wizzard",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("g",{transform:"translate(6.666667, 6.000000)",id:"Group"},r.createElement("g",null,r.createElement("polyline",{id:"Path-3",stroke:"#1B2559",strokeWidth:2,points:"0 4.83333333 3.33333333 8.16666667 6.66666667 4.83333333"}),r.createElement("line",{x1:3.33333333,y1:.25,x2:3.33333333,y2:6.5,id:"Path-4",stroke:"#1B2559",strokeWidth:2})))))));function sE(e,t){var n=e.title,a=e.titleId,i=oE(e,["title","titleId"]);return r.createElement("svg",iE({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,cE,lE)}var dE=r.forwardRef(sE);n.p;function uE(){return(uE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function mE(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var hE=r.createElement("desc",null,"Created with Sketch."),bE=r.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"pop-up/action/download-logs/date-range-copy-2",transform:"translate(-20.000000, -187.000000)"},r.createElement("g",{id:"icon/sf-contain-b-copy-5",transform:"translate(30.000000, 197.000000) rotate(270.000000) translate(-30.000000, -197.000000) translate(20.000000, 187.000000)"},r.createElement("g",{id:"icon/sf-small/wizzard",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("g",{transform:"translate(6.666667, 6.000000)",id:"Group"},r.createElement("g",null,r.createElement("polyline",{id:"Path-3",stroke:"#1B2559",strokeWidth:2,points:"0 4.83333333 3.33333333 8.16666667 6.66666667 4.83333333"}),r.createElement("line",{x1:3.33333333,y1:.25,x2:3.33333333,y2:6.5,id:"Path-4",stroke:"#1B2559",strokeWidth:2})))))));function pE(e,t){var n=e.title,a=e.titleId,i=mE(e,["title","titleId"]);return r.createElement("svg",uE({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,hE,bE)}var fE,jE,gE,OE,xE=r.forwardRef(pE),vE=(n.p,{wrapper:{height:26,display:"flex",alignItems:"center",justifyContent:"center",position:"relative",overflow:"hidden"},button:{outline:"none",extend:Re.label1,border:"none",cursor:"pointer",backgroundColor:"transparent",color:J,zIndex:2},lowerBound:{left:"50%"},upperBound:{right:"50%"},selected:{width:26,height:26,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:H,borderRadius:"50%",position:"absolute",zIndex:1},between:{position:"absolute",width:"100%",height:"100%",zIndex:0,backgroundColor:V},disabled:{color:oe,cursor:"default"}}),yE=Object(f.a)(vE),wE=function(e){var t,n,r,a=e.isLowerBound,i=e.isUpperBound,o=e.isBetween,c=e.isDisabled,l=e.children,s=(Object($.a)(e,["isLowerBound","isUpperBound","isBetween","isDisabled","children"]),yE()),d=a||i,u=(t={},Object(z.a)(t,s.between,o&&!(a&&i)),Object(z.a)(t,s.lowerBound,a&&!i),Object(z.a)(t,s.upperBound,i&&!a),t),m=(n={},Object(z.a)(n,s.wrapper,!0),Object(z.a)(n,s.selected,d),n),h=(r={},Object(z.a)(r,s.button,!0),Object(z.a)(r,s.disabled,c),r);return Object(Me.jsxs)("div",{className:s.wrapper,children:[Object(Me.jsx)("div",{className:E()(u)}),Object(Me.jsx)("div",{className:E()(m),children:Object(Me.jsx)("button",{className:E()(h),children:l})})]})},CE={wrapper:{display:"flex",flexDirection:"column",alignItems:"center"},button:{outline:"none"},navbar:{extend:Re.p,display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%",padding:[[15,15]],color:J,"& button":{display:"flex",alignItems:"center",padding:0,border:"none",backgroundColor:G,cursor:"pointer",borderRadius:"50%",width:20,height:20,position:"relative",overflow:"hidden","& svg":{position:"absolute",left:0}}},table:{borderCollapse:"collapse",width:"100%",color:J,"& tr":{"&:first-child":{paddingLeft:5},"&:last-child":{paddingRight:5}},"& th, & td":{margin:0,padding:[[3,0,3,0]]},"& th":{extend:Re.label2}}},kE=Object(f.a)(CE),SE=function(e){var t=e.minDate,n=e.maxDate,a=e.handleSelect,i=Object($.a)(e,["minDate","maxDate","handleSelect"]),o=Object(r.useState)(Ll()()),l=Object(c.a)(o,2),s=l[0],d=l[1],u=kE(),m=Ll.a.weekdaysMin().map((function(e){return e.slice(0,1)})),h=function(e){var t=Ll()(e).subtract(1,"month"),n=dO.a(0,Ll()(e).startOf("month").weekday()).reverse(),r=B.a((function(e){return Ll()(t).endOf("month").subtract(e,"days")}))(n),a=dO.a(0,function(e){return Number.parseInt(Ll()(e).endOf("month").format("D"))}(e)),i=B.a((function(t){return Ll()(e).startOf("month").add(t,"days")}))(a),o=Ll()(e).add(1,"month"),c=dO.a(0,42-r.length-i.length),l=B.a((function(e){return Ll()(o).startOf("month").add(e,"days")}))(c);return Mo.a(Mo.a(r,i),l)},b=function(e,t){return h(e).slice(7*t-7,7*t)};return Object(Me.jsxs)("div",{className:u.wrapper,children:[Object(Me.jsxs)("div",{className:u.navbar,children:[Object(Me.jsx)("button",{className:u.button,onClick:function(){return function(e){var n=Ll()(e).subtract(1,"month");d(t?n.isSameOrAfter(t,"month")?n:s:n)}(s)},children:Object(Me.jsx)(dE,{})}),Object(Me.jsx)("span",{children:"".concat(s.format("MMMM")," ").concat(s.format("YYYY"))}),Object(Me.jsx)("button",{className:u.button,onClick:function(){return function(e){var t=Ll()(e).add(1,"month");d(n?t.isSameOrBefore(n,"month")?t:s:t)}(s)},children:Object(Me.jsx)(xE,{})})]}),Object(Me.jsxs)("table",{className:u.table,children:[Object(Me.jsx)("thead",{children:Object(Me.jsx)("tr",{children:m.map((function(e,t){return Object(Me.jsx)("th",{children:e},t)}))})}),Object(Me.jsx)("tbody",{children:dO.a(1,8).map((function(e,r){return Object(Me.jsx)("tr",{children:b(s,e).map((function(e,r){return Object(Me.jsx)("td",{onClick:function(){return a(e,t,n)},children:Object(Me.jsx)(wE,{isDisabled:n&&e.isAfter(n,"day")||t&&e.isBefore(t,"day"),isLowerBound:e.isSame(i.from,"day"),isUpperBound:e.isSame(i.to,"day"),isBetween:e.isBetween(i.from,i.to,"day",[]),children:e.format("D")})},r)}))},r)}))})]})]})},NE=Object(f.a)({wrapper:{backgroundColor:"white",borderRadius:10}}),IE=function(e){var t=e.minDate,n=e.maxDate,a=e.className,i=e.onRangeChange,o=Object(r.useState)(null),l=Object(c.a)(o,2),s=l[0],d=l[1],u=Object(r.useState)(null),m=Object(c.a)(u,2),h=m[0],b=m[1];Object(r.useEffect)((function(){i(s,h)}),[s,i,h]);var p=NE();return Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsx)("div",{className:E()(p.wrapper,a),children:Object(Me.jsx)(SE,{from:s,to:h,minDate:t,maxDate:n,handleSelect:function(e,t,n){if(!(n&&e.isAfter(n,"day")||t&&e.isBefore(t,"day")))return s&&!h&&e.isBefore(s,"day")?(b(s),void d(e)):void(s&&!h&&e.isSameOrAfter(s,"day")?b(Ll()(e.toDate().setHours(23,59,59,999))):(d(e),b(null)))}})})})},EE=Re.label1,FE=Re.h4,LE={wrapper:{height:46,width:99},container:{display:"flex"},monthWeekDayContainer:{display:"flex",flexDirection:"column"},label:{extend:EE,lineHeight:1.33,color:J},bigNumber:{extend:Re.info1,lineHeight:1,marginRight:7},monthYear:{extend:Re.label2,lineHeight:1.17,color:J},weekDay:{extend:EE,lineHeight:1.33,color:se}},PE=Object(f.a)(LE),DE=function(e){var t=e.date,n=e.children,r=(Object($.a)(e,["date","children"]),PE());return Object(Me.jsxs)("div",{className:r.wrapper,children:[Object(Me.jsx)("div",{className:r.label,children:n}),t&&Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsxs)("div",{className:r.container,children:[Object(Me.jsx)("div",{className:r.bigNumber,children:t.format("D")}),Object(Me.jsxs)("div",{className:r.monthWeekDayContainer,children:[Object(Me.jsx)("span",{className:r.monthYear,children:"".concat(t.format("MMM")," ").concat(t.format("YYYY"))}),Object(Me.jsx)("span",{className:r.weekDay,children:t.format("dddd")})]})]})})]})},BE={popoverContent:{width:280},popoverHeader:{extend:FE,padding:[[15,15,0,15]]},radioButtonsContainer:{padding:[[5,15,5,15]]},radioButtons:{display:"flex",justifyContent:"space-between",flexDirection:"row",color:J},dateRangePickerShowing:{display:"block",height:"100%"},dateRangePickerHidden:{display:"none",height:0},download:{padding:[[10,15]]},dateContainerWrapper:{display:"flex",justifyContent:"space-between",alignItems:"center",position:"relative",backgroundColor:G,padding:[[0,15]],minHeight:70},arrowContainer:{position:"absolute",left:125,top:26},arrow:{margin:"auto"}},RE=Object(f.a)(BE),TE="all",AE="range",ME="advanced",WE="simplified",zE=function(e){var t,n=e.name,a=e.query,i=e.args,o=e.title,l=e.getLogs,d=e.timezone,m=e.simplified,h=Object(r.useState)(TE),b=Object(c.a)(h,2),p=b[0],f=b[1],j=Object(r.useState)(ME),g=Object(c.a)(j,2),O=g[0],x=g[1],v=Object(r.useState)({from:null,until:null}),y=Object(c.a)(v,2),w=y[0],C=y[1],k=Object(r.useState)(null),N=Object(c.a)(k,2),I=N[0],F=N[1],L=Object(u.a)(a,{onCompleted:function(e){return T(l(e),w)}}),P=Object(c.a)(L,1)[0],D=RE(),B=(t={},Object(z.a)(t,D.dateRangePickerShowing,p===AE),Object(z.a)(t,D.dateRangePickerHidden,p===TE),t),R=Object(r.useCallback)((function(e,t){C({from:e,until:t})}),[C]),T=function(e,t){var r=function(e){return Mm(e,d,"YYYY-MM-DD_HH-mm")},a=new window.Blob([e],{type:"text/plain;charset=utf-8"});gb.a.saveAs(a,p===TE?"".concat(r(new Date),"_").concat(n,".csv"):"".concat(r(t.from),"_").concat(r(t.until),"_").concat(n,".csv"))},M=[{display:"All logs",code:TE},{display:"Date range",code:AE}],W=[{display:"Advanced logs",code:ME},{display:"Simplified logs",code:WE}],$=Boolean(I),q=$?"date-range-popover":void 0;return Object(Me.jsx)(S.a,{onClickAway:function(){F(null)},children:Object(Me.jsxs)("div",{children:[Object(Me.jsx)(Vn,{Icon:Np,InverseIcon:gp,onClick:function(e){F(I?null:e.currentTarget)},variant:"contained"}),Object(Me.jsx)(Xn,{id:q,open:$,anchorEl:I,placement:"bottom",children:Object(Me.jsxs)("div",{className:D.popoverContent,children:[Object(Me.jsx)("div",{className:D.popoverHeader,children:o}),Object(Me.jsx)("div",{className:D.radioButtonsContainer,children:Object(Me.jsx)(xa,{name:"logs-select",value:p,options:M,ariaLabel:"logs-select",onChange:function(e){var t=A.a(["target","value"])(e);f(t),t===TE&&C({from:null,until:null})},className:D.radioButtons})}),p===AE&&Object(Me.jsxs)("div",{className:E()(B),children:[Object(Me.jsx)("div",{className:D.dateContainerWrapper,children:w&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(DE,{date:w.from,children:"From"}),Object(Me.jsx)("div",{className:D.arrowContainer,children:Object(Me.jsx)(aE,{className:D.arrow})}),Object(Me.jsx)(DE,{date:w.until,children:"To"})]})}),Object(Me.jsx)(IE,{maxDate:Ll()(),onRangeChange:R})]}),m&&Object(Me.jsx)("div",{className:D.radioButtonsContainer,children:Object(Me.jsx)(xa,{name:"simplified-tx-logs",value:O,options:W,ariaLabel:"simplified-tx-logs",onChange:function(e){var t=A.a(["target","value"])(e);x(t)},className:D.radioButtons})}),Object(Me.jsx)("div",{className:D.download,children:Object(Me.jsx)(or,{color:"primary",onClick:function(){return function(e,t){p===TE&&P({variables:Object(s.a)(Object(s.a)({},t),{},{simplified:O===WE})}),e&&e.from&&(e.from&&!e.until&&(e.until=Ll()()),Ll()(e.from).isSame(e.until,"day")&&(e.until=Ll()()),p===AE&&P({variables:Object(s.a)(Object(s.a)({},t),{},{from:e.from,until:e.until,simplified:O===WE})}))}(w,i)},children:"Download"})})]})})]})})},$E=Object(f.a)(nb),qE=x()(fE||(fE=Object(l.a)(["\n {\n machines {\n name\n deviceId\n }\n }\n"]))),HE=x()(jE||(jE=Object(l.a)(["\n query MachineLogs(\n $deviceId: ID!\n $limit: Int\n $from: Date\n $until: Date\n $timezone: String\n ) {\n machineLogsCsv(\n deviceId: $deviceId\n limit: $limit\n from: $from\n until: $until\n timezone: $timezone\n )\n }\n"]))),VE=x()(gE||(gE=Object(l.a)(["\n query MachineLogs($deviceId: ID!, $limit: Int, $from: Date, $until: Date) {\n machineLogs(\n deviceId: $deviceId\n limit: $limit\n from: $from\n until: $until\n ) {\n logLevel\n id\n timestamp\n message\n }\n }\n"]))),UE=x()(OE||(OE=Object(l.a)(["\n query getData {\n config\n }\n"]))),GE=function(){var e,t,n=$E(),a=Object(r.useState)(null),i=Object(c.a)(a,2),o=i[0],l=i[1],s=Object(r.useState)(null),d=Object(c.a)(s,2),m=d[0],h=d[1],b=null===o||void 0===o?void 0:o.deviceId,p=Object(u.c)(qE).data,f=Object(u.c)(UE).data,j=A.a(["config","locale_timezone"],f),g=Object(u.c)(VE,{variables:{deviceId:b,limit:500},skip:!o,onCompleted:function(){return h("")}}),O=g.data,x=g.loading;(null===p||void 0===p||null===(e=p.machines)||void 0===e?void 0:e.length)&&!o&&l(null===p||void 0===p?void 0:p.machines[0]);return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)("div",{className:n.titleWrapper,children:Object(Me.jsxs)("div",{className:n.titleAndButtonsContainer,children:[Object(Me.jsx)(yn,{children:"Machine Logs"}),O&&Object(Me.jsxs)("div",{className:n.buttonsWrapper,children:[Object(Me.jsx)(zE,{title:"Download logs",name:o.name,query:HE,args:{deviceId:b,timezone:j},getLogs:function(e){return A.a(["machineLogsCsv"])(e)},timezone:j}),Object(Me.jsx)(Ze,{children:m})]})]})}),Object(Me.jsxs)("div",{className:n.wrapper,children:[Object(Me.jsx)(di,{displayName:function(e){return e.name},data:(null===p||void 0===p?void 0:p.machines)||[],isSelected:function(e){return A.a(["deviceId"])(o)===e.deviceId},onClick:l}),Object(Me.jsxs)("div",{className:n.tableWrapper,children:[Object(Me.jsxs)(Ux,{className:n.table,children:[Object(Me.jsx)(_x,{children:Object(Me.jsxs)(nv,{header:!0,children:[Object(Me.jsx)(Qx,{className:n.dateColumn,children:"Date"}),Object(Me.jsx)(Qx,{className:n.levelColumn,children:"Level"}),Object(Me.jsx)(Qx,{className:n.fillColumn})]})}),Object(Me.jsx)(Gx,{children:O&&O.machineLogs.map((function(e,t){return Object(Me.jsxs)(nv,{size:"sm",children:[Object(Me.jsx)(Yx,{children:j&&Mm(e.timestamp,j,"YYYY-MM-DD HH:mm")}),Object(Me.jsx)(Yx,{children:e.logLevel}),Object(Me.jsx)(Yx,{children:e.message})]},t)}))})]}),x&&Object(Me.jsx)(Ue,{children:"Loading..."}),!x&&!(null===O||void 0===O||null===(t=O.machineLogs)||void 0===t?void 0:t.length)&&Object(Me.jsx)(Ue,{children:"No activity so far"})]})]})]})};function XE(){return(XE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function YE(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var _E=r.createElement("desc",null,"Created with Sketch."),ZE=r.createElement("g",{id:"icon/sf-small/clock/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("g",{id:"Group-7",stroke:"#FFFFFF",strokeWidth:2},r.createElement("path",{d:"M0,10 C0,15.522 4.478,20 10,20 C15.522,20 20,15.522 20,10 C20,4.478 15.522,0 10,0 C7.749,0 5.671,0.744 4,1.999",id:"Stroke-1"}),r.createElement("polyline",{id:"Stroke-3",points:"13 11 10 11.063 10 7"}),r.createElement("polyline",{id:"Stroke-5",points:"3 0 3 3 5 4"})));function KE(e,t){var n=e.title,a=e.titleId,i=YE(e,["title","titleId"]);return r.createElement("svg",XE({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,_E,ZE)}var QE=r.forwardRef(KE);n.p;function JE(){return(JE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function eF(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var tF=r.createElement("desc",null,"Created with Sketch."),nF=r.createElement("g",{id:"icon/sf-small/clock/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},r.createElement("g",{id:"Group-7",stroke:"#1B2559",strokeWidth:2},r.createElement("path",{d:"M0,10 C0,15.522 4.478,20 10,20 C15.522,20 20,15.522 20,10 C20,4.478 15.522,0 10,0 C7.749,0 5.671,0.744 4,1.999",id:"Stroke-1"}),r.createElement("polyline",{id:"Stroke-3",points:"13 11 10 11.063 10 7"}),r.createElement("polyline",{id:"Stroke-5",points:"3 0 3 3 5 4"})));function rF(e,t){var n=e.title,a=e.titleId,i=eF(e,["title","titleId"]);return r.createElement("svg",JE({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,tF,nF)}var aF,iF,oF,cF,lF,sF,dF=r.forwardRef(rF),uF=(n.p,{cashbox:{width:80,height:36},tableContainer:{flex:1,marginBottom:100},tBody:{maxHeight:"65vh",overflow:"auto"},tableWidth:{display:"flex",alignItems:"center",marginRight:1},descriptions:{color:se,marginTop:0},cashboxReset:{color:se,margin:[[13,0,-5,20]]},selection:{marginRight:12}}),mF={footerLabel:{color:q,alignSelf:"center"},footerContent:{width:1200,maxHeight:64,display:"flex",justifyContent:"space-around",position:"fixed"},footerContainer:{position:"fixed",height:64,left:0,bottom:0,width:"100vw",backgroundColor:"white",display:"flex",justifyContent:"space-around",boxShadow:[[0,-1,10,0,"rgba(50, 50, 50, 0.1)"]]},flex:{display:"flex",marginLeft:-640},icon:{alignSelf:"center",height:20,width:20,marginRight:8},iconLabel:{alignSelf:"center",marginRight:8},valueDisplay:{alignSelf:"center"}},hF=Object(f.a)(mF),bF=function(e){var t=e.machines,n=e.config,r=e.currencyCode,a=(e.bills,e.deviceIds,hF()),i=n&&Cl("cashOut")(n),o=function(e){return Cl(e)(i)},c=Pl.a(Dl.a((function(e,t){var n,r,a=t.cassette1,i=t.cassette2,c=t.id,l=null!==(n=o(c).top)&&void 0!==n?n:0,s=null!==(r=o(c).bottom)&&void 0!==r?r:0;return[e[0]+=a*l,e[1]+=i*s]}),[0,0],t));return Object(Me.jsx)("div",{className:a.footerContainer,children:Object(Me.jsxs)("div",{className:a.footerContent,children:[Object(Me.jsx)(Ze,{className:a.footerLabel,children:"Cash value in System"}),Object(Me.jsxs)("div",{className:a.flex,children:[Object(Me.jsx)(tl,{className:a.icon}),Object(Me.jsx)(_e,{className:a.iconLabel,children:"Cash-out:"}),Object(Me.jsxs)(Ye,{className:a.valueDisplay,children:[c," ",r]})]})]})})},pF=x()(aF||(aF=Object(l.a)(["\n query cashboxBatches {\n cashboxBatches {\n id\n deviceId\n created\n operationType\n customBillCount\n performedBy\n bills {\n fiat\n deviceId\n created\n cashbox\n }\n }\n }\n"]))),fF=x()(iF||(iF=Object(l.a)(["\n mutation editBatch($id: ID, $performedBy: String) {\n editBatch(id: $id, performedBy: $performedBy) {\n id\n }\n }\n"]))),jF=xn.e().shape({performedBy:xn.g().nullable()}),gF=Object(f.a)({operationType:{marginLeft:8},operationTypeWrapper:{display:"flex",flexDirection:"row",alignItems:"center"},saveAndCancel:{display:"flex",flexDirection:"row",justifyContent:"space-between"}}),OF=function(e){var t=e.machines,n=e.currency,a=gF(),i=Object(r.useState)(!1),o=Object(c.a)(i,2),l=o[0],m=o[1],h=Object(r.useState)([]),b=Object(c.a)(h,2),p=b[0],f=b[1],j=Object(u.c)(pF),g=j.data,O=j.loading,x=Object(u.b)(fF,{refetchQueries:function(){return["cashboxBatches"]}}),v=Object(c.a)(x,1)[0],y=A.a(["cashboxBatches"])(g),w={"cash-in-empty":Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Yc,{}),Object(Me.jsx)("span",{className:a.operationType,children:"Cash-in emptied"})]}),"cash-out-1-refill":Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(tl,{}),Object(Me.jsx)("span",{className:a.operationType,children:"Cash-out 1 refill"})]}),"cash-out-1-empty":Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(tl,{}),Object(Me.jsx)("span",{className:a.operationType,children:"Cash-out 1 emptied"})]}),"cash-out-2-refill":Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(tl,{}),Object(Me.jsx)("span",{className:a.operationType,children:"Cash-out 2 refill"})]}),"cash-out-2-empty":Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(tl,{}),Object(Me.jsx)("span",{className:a.operationType,children:"Cash-out 2 emptied"})]})},C=function(e){f(M.a((function(t){return t.id!==e}),p))},k=function(e){return!Wo.a(W.a("id",e),p)},S=[{name:"operation",header:"Operation",width:200,textAlign:"left",view:function(e){return Object(Me.jsx)("div",{className:a.operationTypeWrapper,children:w[e.operationType]})}},{name:"machine",header:"Machine",width:200,textAlign:"left",view:function(e){return Ar.a(W.a("id",e.deviceId))(t).name}},{name:"billCount",header:"Bill Count",width:115,textAlign:"left",input:qa,inputProps:{decimalPlaces:0},view:function(e){return D.a(e.customBillCount)?e.bills.length:e.customBillCount}},{name:"total",header:"Total",width:100,textAlign:"right",view:function(e){return Object(Me.jsxs)("span",{children:[Pl.a(B.a((function(e){return R.a("fiat",e)}),e.bills))," ",n]})}},{name:"date",header:"Date",width:135,textAlign:"right",view:function(e){return Ll.a.utc(e.created).format("YYYY-MM-DD")}},{name:"time",header:"Time (h:m)",width:125,textAlign:"right",view:function(e){return Ll.a.utc(e.created).format("HH:mm")}},{name:"performedBy",header:"Performed by",width:180,textAlign:"left",view:function(e){return k(e.id)?D.a(e.performedBy)?"Unknown entity":e.performedBy:Object(Me.jsx)(Xr,{onChange:function(t){return f(B.a((function(n){return n.id===e.id?Object(s.a)(Object(s.a)({},n),{},{performedBy:t.target.value}):n}),p))},error:l,width:161.5,value:R.a("performedBy",Ar.a((function(t){return t.id===e.id}),p))})}},{name:"",header:"Edit",width:150,textAlign:"right",view:function(e){return k(e.id)?Object(Me.jsx)(tr,{onClick:function(){f([].concat(Object(d.a)(p),[{id:e.id,performedBy:e.performedBy}]))},children:Object(Me.jsx)(lm,{})}):Object(Me.jsxs)("div",{className:a.saveAndCancel,children:[Object(Me.jsx)(or,{type:"submit",color:"primary",onClick:function(){return function(e){var t=Ar.a((function(t){return t.id===e.id}),p),n=""===t.performedBy?null:t.performedBy;return jF.isValid(t).then((function(){m(!1),v({variables:{id:e.id,performedBy:n}})})).catch(m(!0)),C(e.id)}(e)},children:"Save"}),Object(Me.jsx)(or,{color:"secondary",onClick:function(){return C(e.id)},children:"Cancel"})]})}}];return Object(Me.jsx)(Me.Fragment,{children:!O&&Object(Me.jsx)(iv,{name:"cashboxHistory",elements:S,data:y,emptyText:"No cashbox batches so far"})})},xF=n.p+"static/media/both-filled.7af80d5f.svg",vF={button:{margin:[[35,"auto",0,"auto"]]},modalContent:{display:"flex",flexDirection:"column",alignItems:"center",flex:1,padding:[[0,34]]},splashTitle:{marginTop:15},warningInfo:{display:"flex",flexDirection:"row",alignItems:"center",marginTop:15},warningIcon:{width:25,height:25,marginRight:8,display:"block"},warningText:{flexBasis:"100%",flexGrow:1},machineName:{margin:[[5,0]],color:q}},yF=Object(f.a)(vF),wF=function(e){var t=e.name,n=e.onContinue,r=yF();return Object(Me.jsxs)("div",{className:r.modalContent,children:[Object(Me.jsx)("img",{width:"148",height:"196",alt:"cassette",src:xF}),Object(Me.jsx)(qe,{className:r.splashTitle,noMargin:!0,children:"Update counts"}),Object(Me.jsx)(_e,{className:r.machineName,noMargin:!0,children:t}),Object(Me.jsxs)("div",{className:r.warningInfo,children:[Object(Me.jsx)(ia,{className:r.warningIcon}),Object(Me.jsx)(Xe,{noMargin:!0,className:r.warningText,children:"Before updating counts on Lamassu Admin, make sure you've done it before on the machines."})]}),Object(Me.jsxs)("div",{className:r.warningInfo,children:[Object(Me.jsx)(ia,{className:r.warningIcon}),Object(Me.jsx)(Xe,{noMargin:!0,className:r.warningText,children:"For cash-out cassettes, please make sure you've removed the remaining bills before adding the new ones."})]}),Object(Me.jsx)(An,{className:r.button,onClick:n,children:"Get started"})]})},CF=n.p+"static/media/acceptor-left.f37bcb1a.svg",kF=n.p+"static/media/dispenser-1.e4200f4e.svg",SF=n.p+"static/media/dispenser-2.9f7807a5.svg",NF={content:{display:"flex",flexDirection:"column",justifyContent:"space-between",flex:1,paddingBottom:32},titleDiv:{marginBottom:32},title:{margin:[[0,0,12,0]],color:q},stepImage:{width:148,height:196},form:{paddingBottom:95},verticalAlign:{display:"flex",flexDirection:"column"},horizontalAlign:{display:"flex",flexDirection:"row"},centerAlignment:{alignItems:"center"},lineAlignment:{alignItems:"baseline"},fullWidth:{margin:[[0,"auto"]],flexBasis:"auto"},formWrapper:{flexBasis:"100%",display:"flex",justifyContent:"center"},submit:{float:"right"},cashboxBills:{marginRight:5},cassetteCashbox:{width:40,height:35},cassetteFormTitle:{marginTop:18},cassetteFormTitleContent:{marginLeft:10,marginRight:25},smBottomMargin:{marginBottom:25},fiatTotal:{color:q},errorMessage:{color:me}},IF=Object(f.a)(NF),EF=function(e){var t=e.step,n=e.name,r=e.machine,a=e.cashoutSettings,i=e.cassetteCapacity,o=(e.error,e.lastStep),c=e.steps,l=e.fiatCurrency,s=e.onContinue,d=IF(),u=o?"Finish":"Confirm",m={1:CF,2:kF,3:SF},h=[{display:"Yes",code:"YES"},{display:"No",code:"NO"}],b={amount:2===t?null===r||void 0===r?void 0:r.cassette1:null===r||void 0===r?void 0:r.cassette2,denomination:2===t?a.top:a.bottom},p=function(e){var n=2===t?e.cassette1Count:e.cassette2Count,r=null!==n&&void 0!==n?n:b.amount;return _O.a(0,100,r/i*100)};return Object(Me.jsxs)("div",{className:d.content,children:[Object(Me.jsxs)("div",{className:d.titleDiv,children:[Object(Me.jsx)(_e,{className:d.title,children:n}),Object(Me.jsx)(OO,{steps:c.length,currentStep:t})]}),1===t&&Object(Me.jsx)(pn.d,{validateOnBlur:!1,validateOnChange:!1,onSubmit:s,initialValues:{wasCashboxEmptied:""},enableReinitialize:!0,validationSchema:c[t-1].schema,children:function(e){e.values;var n=e.errors;return Object(Me.jsxs)(pn.c,{children:[Object(Me.jsxs)("div",{className:E()(d.horizontalAlign,d.form),children:[Object(Me.jsx)("img",{className:d.stepImage,alt:"cassette",src:m[t]}),Object(Me.jsx)("div",{className:d.formWrapper,children:Object(Me.jsxs)("div",{className:E()(d.verticalAlign,d.fullWidth),children:[Object(Me.jsx)(Ue,{noMargin:!0,children:"Did you empty the cash-in box?"}),Object(Me.jsx)(pn.b,{component:Ha,name:"wasCashboxEmptied",options:h,className:d.horizontalAlign}),n.wasCashboxEmptied&&Object(Me.jsx)("div",{className:d.errorMessage,children:n.wasCashboxEmptied}),Object(Me.jsxs)("div",{className:E()(d.horizontalAlign,d.centerAlignment),children:[Object(Me.jsx)(Xe,{children:"Since previous update"}),Object(Me.jsx)(Eb,{width:215,children:Object(Me.jsx)(Xe,{children:"Number of bills inside the cashbox, since the last cashbox changes."})})]}),Object(Me.jsxs)("div",{className:E()(d.horizontalAlign,d.lineAlignment),children:[Object(Me.jsx)(Ye,{noMargin:!0,className:d.cashboxBills,children:null===r||void 0===r?void 0:r.cashbox}),Object(Me.jsx)(Xe,{noMargin:!0,children:"accepted bills"})]})]})})]}),Object(Me.jsx)(An,{className:d.submit,type:"submit",children:u})]})}}),(2===t||3===t)&&Object(Me.jsx)(pn.d,{validateOnBlur:!1,validateOnChange:!1,onSubmit:s,initialValues:{cassette1Count:"",cassette2Count:""},enableReinitialize:!0,validationSchema:c[t-1].schema,children:function(e){var n,r,a=e.values,i=e.errors;return Object(Me.jsxs)(pn.c,{children:[Object(Me.jsxs)("div",{className:E()(d.horizontalAlign,d.form),children:[Object(Me.jsx)("img",{className:d.stepImage,alt:"cassette",src:m[t]}),Object(Me.jsx)("div",{className:d.formWrapper,children:Object(Me.jsxs)("div",{className:E()(d.verticalAlign,d.fullWidth),children:[Object(Me.jsxs)("div",{className:E()(d.horizontalAlign,d.smBottomMargin),children:[Object(Me.jsxs)("div",{className:E()(d.horizontalAlign,d.cassetteFormTitle),children:[Object(Me.jsx)(tl,{}),Object(Me.jsxs)(Ue,{className:d.cassetteFormTitleContent,noMargin:!0,children:["Cash-out ",t-1," (dispenser)"]})]}),Object(Me.jsx)(Ta,{className:d.cassetteCashbox,percent:p(a),cashOut:!0})]}),Object(Me.jsx)(Ue,{noMargin:!0,children:"Refill bill count"}),Object(Me.jsxs)("div",{className:E()(d.horizontalAlign,d.lineAlignment),children:[Object(Me.jsx)(pn.b,{component:qa,decimalPlaces:0,width:50,placeholder:b.amount.toString(),name:"cassette".concat(t-1,"Count"),className:d.cashboxBills}),Object(Me.jsxs)(Xe,{children:[b.denomination," ",l," bills loaded"]})]}),Object(Me.jsxs)(Xe,{noMargin:!0,className:d.fiatTotal,children:["="," ",2===t?(null!==(n=a.cassette1Count)&&void 0!==n?n:0)*b.denomination:(null!==(r=a.cassette2Count)&&void 0!==r?r:0)*b.denomination," ",l]}),Object(Me.jsx)(Xe,{className:d.errorMessage,children:2===t?i.cassette1Count:i.cassette2Count})]})})]}),Object(Me.jsx)(An,{className:d.submit,type:"submit",children:u})]})}})]})},FF=x()(oF||(oF=Object(l.a)(["\n mutation createBatch($deviceId: ID, $cashboxCount: Int) {\n createBatch(deviceId: $deviceId, cashboxCount: $cashboxCount) {\n id\n }\n }\n"]))),LF=function(e){var t=e.machine,n=e.cashoutSettings,a=e.locale,i=e.onClose,o=e.save,l=e.error,s=Object(r.useState)({step:0,config:{active:!0}}),d=Object(c.a)(s,2),m=d[0],h=m.step,b=m.config,p=d[1],f=Object(u.b)(FF),j=Object(c.a)(f,1)[0],g=Wr.a(n)||!(null===n||void 0===n?void 0:n.active),O=h===(g?1:3),x=function(e){var n=Gn.a(b,e);if(O){var r,a,c=[null===b||void 0===b?void 0:b.wasCashboxEmptied,null===e||void 0===e?void 0:e.wasCashboxEmptied].includes("YES"),l=c?0:null===t||void 0===t?void 0:t.cashbox;return c&&j({variables:{deviceId:t.id,cashboxCount:t.cashbox}}),o(t.id,parseInt(l),parseInt(null!==(r=e.cassette1Count)&&void 0!==r?r:0),parseInt(null!==(a=e.cassette2Count)&&void 0!==a?a:0)),i()}p({step:h+1,config:n})},v=[{type:"cashbox",schema:xn.e().shape({wasCashboxEmptied:xn.g().required("Select one option.")}),cashoutRequired:!1},{type:"cassette 1",schema:xn.e().shape({cassette1Count:xn.d().label("Bill count").required().min(0).max(500)}),cashoutRequired:!0},{type:"cassette 2",schema:xn.e().shape({cassette2Count:xn.d().label("Bill count").required().min(0).max(500)}),cashoutRequired:!0}],y=M.a((function(e){return!e.cashoutRequired||!g&&e.cashoutRequired}),v);return Object(Me.jsxs)(sO,{title:0===h?null:"Update counts",handleClose:i,width:554,height:520,open:!0,children:[0===h&&Object(Me.jsx)(wF,{name:null===t||void 0===t?void 0:t.name,onContinue:function(){return x()}}),0!==h&&Object(Me.jsx)(EF,{step:h,name:null===t||void 0===t?void 0:t.name,machine:t,cashoutSettings:n,cassetteCapacity:500,error:l,lastStep:O,steps:y,fiatCurrency:a.fiatCurrency,onContinue:x})]})},PF=Object(f.a)(uF),DF=xn.e().shape({name:xn.g().required(),cashbox:xn.d().label("Cashbox").required().integer().min(0).max(1e3),cassette1:xn.d().label("Cassette 1 (top)").required().integer().min(0).max(500),cassette2:xn.d().label("Cassette 2 (bottom)").required().integer().min(0).max(500)}),BF=x()(cF||(cF=Object(l.a)(["\n query getData {\n machines {\n name\n id: deviceId\n cashbox\n cassette1\n cassette2\n }\n config\n }\n"]))),RF=x()(lF||(lF=Object(l.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),TF=x()(sF||(sF=Object(l.a)(["\n mutation MachineAction(\n $deviceId: ID!\n $action: MachineAction!\n $cashbox: Int!\n $cassette1: Int!\n $cassette2: Int!\n ) {\n machineAction(\n deviceId: $deviceId\n action: $action\n cashbox: $cashbox\n cassette1: $cassette1\n cassette2: $cassette2\n ) {\n deviceId\n cashbox\n cassette1\n cassette2\n }\n }\n"]))),AF=function(){var e,t,n,a,i=PF(),o=Object(r.useState)(!1),l=Object(c.a)(o,2),s=l[0],d=l[1],m=Object(r.useState)(null),h=Object(c.a)(m,2),b=h[0],p=h[1],f=Object(r.useState)(null),j=Object(c.a)(f,2),g=j[0],O=j[1],x=Object(u.c)(BF).data,v=Object(r.useState)(!1),y=Object(c.a)(v,2),w=y[0],C=y[1],k=Object(r.useState)(""),S=Object(c.a)(k,2),N=S[0],I=S[1],E=null!==(e=A.a(["machines"])(x))&&void 0!==e?e:[],F=null!==(t=A.a(["config"])(x))&&void 0!==t?t:{},L=Cl("notifications",F),P=Object(u.b)(TF,{refetchQueries:function(){return["getData"]}}),D=Object(c.a)(P,2),T=D[0],M=D[1].error,z=Object(u.b)(RF,{onCompleted:function(){return p(!1)},refetchQueries:function(){return["getData"]}}),$=Object(c.a)(z,1)[0],q=kx.a((function(e){return e.deviceId}))(null!==(n=A.a(["bills"])(x))&&void 0!==n?n:[]),H=Nf.a(B.a(R.a("deviceId"))(null!==(a=A.a(["bills"])(x))&&void 0!==a?a:[])),V=(null===x||void 0===x?void 0:x.config)&&Cl("cashOut")(x.config),U=(null===x||void 0===x?void 0:x.config)&&Cl("locale")(x.config),G=null===U||void 0===U?void 0:U.fiatCurrency,X=(null===x||void 0===x?void 0:x.config)&&Cl("cashIn")(x.config).cashboxReset,Y=function(e){e&&(!function(e){var t=kl("cashIn")(e);$({variables:{config:t}})}({cashboxReset:e}),p(!1))},_=function(e,t,n,r){return T({variables:{action:"setCassetteBills",deviceId:e,cashbox:t,cassette1:n,cassette2:r}})},Z=function(e){return Cl(e)(V)},K=[{display:"Automatic",code:"automatic"},{display:"Manual",code:"manual"}],Q=function(e){var t=A.a(["target","value"])(e);O(t)},J=[{name:"name",header:"Machine",width:254,view:function(e){return Object(Me.jsx)(Me.Fragment,{children:e})},input:function(e){var t=e.field.value;return Object(Me.jsx)(Me.Fragment,{children:t})}},{name:"cashbox",header:"Cashbox",width:240,view:function(e){return Object(Me.jsx)(Aa,{currency:{code:G},notes:e,total:0})},input:qa,inputProps:{decimalPlaces:0}},{name:"cassette1",header:"Cassette 1 (Top)",width:265,stripe:!0,view:function(e,t){var n,r=t.id;return Object(Me.jsx)(Ma,{className:i.cashbox,denomination:null===(n=Z(r))||void 0===n?void 0:n.top,currency:{code:G},notes:e,threshold:L.fillingPercentageCassette1})},input:za,inputProps:{decimalPlaces:0,threshold:L.fillingPercentageCassette1}},{name:"cassette2",header:"Cassette 2 (Bottom)",width:265,stripe:!0,view:function(e,t){var n,r=t.id;return Object(Me.jsx)(Ma,{className:i.cashbox,denomination:null===(n=Z(r))||void 0===n?void 0:n.bottom,currency:{code:G},notes:e,threshold:L.fillingPercentageCassette2})},input:za,inputProps:{decimalPlaces:0,threshold:L.fillingPercentageCassette2}},{name:"edit",header:"Edit",width:175,textAlign:"center",view:function(e,t){var n=t.id;return Object(Me.jsx)(tr,{onClick:function(){I(n),C(!0)},children:Object(Me.jsx)(lm,{})})}}];return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Do,{title:"Cash Cassettes",button:{text:"Cashbox history",icon:dF,inverseIcon:QE,toggle:d},iconClassName:i.listViewButton,className:i.tableWidth,children:!s&&Object(Me.jsxs)(No.a,{alignItems:"center",justifyContent:"flex-end",children:[Object(Me.jsx)(et,{className:i.cashboxReset,children:"Cashbox reset"}),Object(Me.jsxs)(No.a,{display:"flex",alignItems:"center",justifyContent:"flex-end",mr:"-4px",children:[X&&Object(Me.jsx)(Xe,{className:i.selection,children:hu(X)}),Object(Me.jsx)(tr,{onClick:function(){return p(!0)},className:i.button,children:Object(Me.jsx)(lm,{})})]})]})}),Object(Me.jsxs)("div",{className:i.tableContainer,children:[!s&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(jm,{error:null===M||void 0===M?void 0:M.message,name:"cashboxes",stripeWhen:function(e){var t=e.id;return!Z(t).active},elements:J,data:E,save:_,validationSchema:DF,tbodyWrapperClass:i.tBody}),x&&Wr.a(E)&&Object(Me.jsx)(Hx,{message:"No machines so far"})]}),s&&Object(Me.jsx)(OF,{machines:E,currency:G})]}),Object(Me.jsx)(bF,{currencyCode:G,machines:E,config:F,bills:q,deviceIds:H}),w&&Object(Me.jsx)(LF,{machine:Ar.a(W.a("id",N))(E),cashoutSettings:Z(N),onClose:function(){C(!1)},error:null===M||void 0===M?void 0:M.message,save:_,locale:U}),b&&Object(Me.jsxs)(sO,{title:"Cashbox reset",width:478,handleClose:function(){return p(null)},open:!0,children:[Object(Me.jsx)(Xe,{className:i.descriptions,children:"Specify if you want your cash-in counts to be reset automatically or manually."}),Object(Me.jsx)(xa,{name:"set-automatic-reset",value:null!==g&&void 0!==g?g:X,options:[K[0]],onChange:Q,className:i.radioButtons}),Object(Me.jsx)(Xe,{className:i.descriptions,children:"Choose this option if you want your cash-in cashbox count to be reset automatically when it is physically removed from the machine."}),Object(Me.jsx)(xa,{name:"set-manual-reset",value:null!==g&&void 0!==g?g:X,options:[K[1]],onChange:Q,className:i.radioButtons}),Object(Me.jsx)(Xe,{className:i.descriptions,children:"Choose this option if you want to edit your cash-in counts manually on Lamassu Admin, after you physically remove the bills from the cashbox."}),Object(Me.jsx)(Ou.a,{className:i.actions,children:Object(Me.jsx)(An,{onClick:function(){return Y(g)},children:"Confirm"})})]})]})};function MF(){return(MF=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function WF(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var zF=r.createElement("rect",{width:12,height:12,rx:3,ry:3,fill:"#ff7311"});function $F(e,t){var n=e.title,a=e.titleId,i=WF(e,["title","titleId"]);return r.createElement("svg",MF({width:12,height:12,viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,zF)}var qF=r.forwardRef($F);n.p;function HF(){return(HF=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function VF(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var UF=r.createElement("rect",{width:12,height:12,rx:3,ry:3,fill:"#ff584a"});function GF(e,t){var n=e.title,a=e.titleId,i=VF(e,["title","titleId"]);return r.createElement("svg",HF({width:12,height:12,viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,UF)}var XF,YF,_F,ZF,KF=r.forwardRef(GF),QF=(n.p,{douro1:"Douro",sintra:"Sintra",gaia:"Gaia"}),JF=Object(s.a)(Object(s.a)({},ib),{},{wrapper:{display:"flex",marginTop:12,marginBottom:16,fontSize:xe},row:{display:"flex",flexDirection:"row"},list:{padding:0,margin:0,listStyle:"none"},item:{height:24,marginBottom:12},link:{color:J,textDecoration:"none"},separator:{width:1,height:170,zIndex:1,marginRight:60,marginLeft:"auto",background:Object(nr.fade)(q,.5)}}),eL=Object(f.a)(ob),tL=function(e){var t=e.children,n=eL();return Object(Me.jsx)("div",{className:n.label,children:t})},nL=Object(f.a)(JF),rL=function(e){var t=e.children,n=Object($.a)(e,["children"]);return Object(Me.jsx)(h.a,Object(s.a)(Object(s.a)({container:!0,spacing:4},n),{},{children:t}))},aL=function(e){var t=e.children,n=Object($.a)(e,["children"]);return Object(Me.jsx)(h.a,Object(s.a)(Object(s.a)({item:!0,xs:!0},n),{},{children:t}))},iL=function(e){var t=e.it,n=e.onActionSuccess,r=e.timezone,a=nL();return Object(Me.jsx)(rL,{className:a.wrapper,children:Object(Me.jsx)(aL,{xs:!0,children:Object(Me.jsxs)(rL,{className:a.row,children:[Object(Me.jsxs)(aL,{xs:2,children:[Object(Me.jsx)(tL,{children:"Machine Model"}),Object(Me.jsx)("span",{children:QF[t.model]})]}),Object(Me.jsxs)(aL,{xs:4,children:[Object(Me.jsx)(tL,{children:"Paired at"}),Object(Me.jsx)("span",{children:r&&Mm(t.pairedAt,r,"YYYY-MM-DD HH:mm:ss")})]}),Object(Me.jsx)(aL,{xs:6,children:Object(Me.jsx)(Yh,{machine:t,onActionSuccess:n})}),Object(Me.jsxs)(aL,{xs:2,children:[Object(Me.jsx)(tL,{children:"Network speed"}),Object(Me.jsx)("span",{children:t.downloadSpeed?new al.a(t.downloadSpeed).toFixed(4).toString()+" MB/s":"unavailable"})]}),Object(Me.jsxs)(aL,{xs:2,children:[Object(Me.jsx)(tL,{children:"Latency"}),Object(Me.jsx)("span",{children:t.responseTime?new al.a(t.responseTime).toFixed(3).toString()+" ms":"unavailable"})]}),Object(Me.jsxs)(aL,{xs:2,children:[Object(Me.jsx)(tL,{children:"Packet Loss"}),Object(Me.jsx)("span",{children:t.packetLoss?new al.a(t.packetLoss).toFixed(3).toString()+" %":"unavailable"})]})]})})})},oL=x()(XF||(XF=Object(l.a)(["\n {\n machines {\n name\n deviceId\n lastPing\n pairedAt\n version\n paired\n cashbox\n cassette1\n cassette2\n version\n model\n statuses {\n label\n type\n }\n downloadSpeed\n responseTime\n packetLoss\n }\n }\n"]))),cL=x()(YF||(YF=Object(l.a)(["\n query getData {\n config\n }\n"]))),lL=Object(f.a)(cb),sL=function(){var e,t=lL(),n=Object(w.h)(),r=Object(w.i)().state,a=null===r||void 0===r?void 0:r.id,i=Object(u.c)(oL),o=i.data,c=i.refetch,l=i.loading,s=Object(u.c)(cL),d=s.data,m=s.configLoading,h=A.a(["config","locale_timezone"],d),b=[{header:"Machine Name",width:250,size:"sm",textAlign:"left",view:function(e){return Object(Me.jsxs)("div",{className:t.flexRow,children:[e.name,Object(Me.jsx)("div",{className:t.machineRedirectContainer,onClick:function(){n.push("/machines/".concat(e.deviceId))},children:Object(Me.jsx)(Od,{})})]})}},{header:"Status",width:350,size:"sm",textAlign:"left",view:function(e){return Object(Me.jsx)(md,{statuses:e.statuses})}},{header:"Last ping",width:200,size:"sm",textAlign:"left",view:function(e){return e.lastPing?Ll()(e.lastPing).fromNow():"unknown"}},{header:"Software Version",width:200,size:"sm",textAlign:"left",view:function(e){return e.version||"unknown"}}],p=null!==(e=A.a(["machines"])(o))&&void 0!==e?e:[],f=Ho.a(W.a("deviceId",a))(p);return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)("div",{className:t.titleWrapper,children:[Object(Me.jsx)("div",{className:t.titleAndButtonsContainer,children:Object(Me.jsx)(yn,{children:"Machine Status"})}),Object(Me.jsxs)("div",{className:t.headerLabels,children:[Object(Me.jsxs)("div",{children:[Object(Me.jsx)(qF,{}),Object(Me.jsx)("span",{children:"Warning"})]}),Object(Me.jsxs)("div",{children:[Object(Me.jsx)(KF,{}),Object(Me.jsx)("span",{children:"Error"})]})]})]}),Object(Me.jsx)(iv,{loading:l&&m,elements:b,data:p,Details:function(e){var t=e.it;return Object(Me.jsx)(iL,{it:t,onActionSuccess:c,timezone:h})},initialExpanded:f,emptyText:"No machines so far",expandable:!0})]})},dL=a.a.createContext(),uL=Object(f.a)({header:{display:"flex",alignItems:"center",marginBottom:16,height:26,margin:0},title:{flexShrink:2,margin:0,overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},button:{border:"none",backgroundColor:"transparent",cursor:"pointer",marginLeft:8},editingButtons:{display:"flex",flexShrink:0,marginLeft:16,justifyContent:"space-between",width:110}}),mL=function(e){var t=e.title,n=e.editing,r=e.disabled,a=e.setEditing,i=uL();return Object(Me.jsxs)("div",{className:i.header,children:[Object(Me.jsx)(Ue,{className:i.title,children:t}),!n&&Object(Me.jsx)(tr,{onClick:function(){return a(!0)},className:i.button,disabled:r,children:r?Object(Me.jsx)(Ju,{}):Object(Me.jsx)(lm,{})}),n&&Object(Me.jsxs)("div",{className:i.editingButtons,children:[Object(Me.jsx)(or,{color:"primary",type:"submit",children:"Save"}),Object(Me.jsx)(or,{color:"secondary",type:"reset",children:"Cancel"})]})]})},hL=Object(f.a)({text:{margin:[[7,0,7,1]]},fieldWrapper:{height:53},valueWrapper:{display:"flex",alignItems:"baseline"},label:{margin:0},decoration:{margin:[[0,0,0,7]]}}),bL=function(e){var t,n=e.label,r=e.name,a=e.editing,i=e.displayValue,o=e.decoration,c=e.className,l=e.decimalPlaces,s=void 0===l?0:l,d=e.width,u=void 0===d?80:d,m=hL({width:u,editing:a}),h=Object(pn.e)().values,b=(t={},Object(z.a)(t,m.fieldWrapper,!0),Object(z.a)(t,"className",c),t);return Object(Me.jsxs)("div",{className:E()(b),children:[n&&Object(Me.jsx)(et,{className:m.label,children:n}),Object(Me.jsxs)("div",{className:m.valueWrapper,children:[!a&&Object(Me.jsx)(Ye,{className:m.text,children:i(h[r])}),a&&Object(Me.jsx)(pn.b,{id:r,size:"lg",fullWidth:!0,name:r,component:qa,textAlign:"right",width:u,decimalPlaces:s}),Object(Me.jsx)(Je,{className:m.decoration,children:o})]})]})},pL=function(e){var t,n=e.title,a=e.label,i=e.width,o=void 0===i?80:i,l=e.min,s=void 0===l?0:l,d=e.max,u=void 0===d?9999999:d,m=e.name,h=e.section,b=e.className,p=Object(r.useState)(!1),f=Object(c.a)(p,2),j=f[0],g=f[1],O=function(){var e=Object(nc.a)(tc.a.mark((function e(t,n){return tc.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!j){e.next=2;break}return e.abrupt("return");case 2:return g(!0),e.next=5,v(t,n);case 5:g(!1);case 6:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),x=Object(r.useContext)(dL),v=x.save,y=x.data,w=x.currency,C=x.isEditing,k=x.isDisabled,S=x.setEditing,N=xn.e().shape(Object(z.a)({},m,xn.d().transform(bj).integer().min(s).max(u).nullable()));return Object(Me.jsx)(pn.d,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,initialValues:Object(z.a)({},m,null!==(t=y&&y[m])&&void 0!==t?t:""),validationSchema:N,onSubmit:function(e){return O(h,N.cast(e))},onReset:function(){S(m,!1)},children:Object(Me.jsxs)(pn.c,{className:b,children:[Object(Me.jsx)(Vd,{}),Object(Me.jsx)(mL,{title:n,editing:C(m),disabled:k(m),setEditing:function(e){return S(m,e)}}),Object(Me.jsx)(bL,{label:a,name:m,editing:C(m),width:o,displayValue:function(e){return""===e?"-":e},decoration:w})]})})},fL="cryptoLowBalance",jL="cryptoHighBalance",gL=Object(f.a)({cryptoBalanceAlerts:{display:"flex",marginBottom:36,height:135,alignItems:"center"},cryptoBalanceAlertsForm:{width:222,marginRight:32},cryptoBalanceAlertsSecondForm:{marginLeft:50},vertSeparator:{width:1,height:"100%",borderRight:[[1,"solid","black"]]}}),OL=function(e){var t=e.section,n=e.fieldWidth,a=gL(),i=Object(r.useContext)(dL),o=i.data,c=i.save,l=i.currency,s=i.setEditing,d=i.isEditing,u=i.isDisabled;return Object(Me.jsxs)("div",{className:a.cryptoBalanceAlerts,children:[Object(Me.jsx)(pL,{name:fL,data:o,save:c,section:t,decoration:l,className:a.cryptoBalanceAlertsForm,title:"Default (Low Balance)",label:"Alert me under",editing:d(fL),disabled:u(fL),setEditing:function(e){return s(fL,e)},width:n}),Object(Me.jsx)("div",{className:a.vertSeparator}),Object(Me.jsx)(pL,{name:jL,data:o,section:t,save:c,decoration:l,className:a.cryptoBalanceAlertsSecondForm,title:"Default (High Balance)",label:"Alert me over",editing:d(jL),disabled:u(jL),setEditing:function(e){return s(jL,e)},width:n})]})},xL="highBalance",vL="lowBalance",yL="cryptoCurrency",wL="cryptoBalanceOverrides",CL=function(e){var t,n,a,i=e.section,o=Object(r.useContext)(dL),c=o.cryptoCurrencies,l=void 0===c?[]:c,s=o.data,d=o.save,u=o.error,m=o.currency,h=o.isDisabled,b=o.setEditing,p=null!==(t=null===s||void 0===s?void 0:s.cryptoBalanceOverrides)&&void 0!==t?t:[],f=B.a(R.a(yL))(p),j=M.a((function(e){return!qo.a(e.code,f)}))(l),g=(n={},Object(z.a)(n,yL,null),Object(z.a)(n,vL,""),Object(z.a)(n,xL,""),n),O=xn.e().shape((a={},Object(z.a)(a,yL,xn.g().label("Cryptocurrency").nullable().required()),Object(z.a)(a,vL,xn.d().label("Low Balance").when(xL,{is:function(e){return!e},then:xn.d().required()}).transform(bj).integer().min(0).max(Pf).nullable()),Object(z.a)(a,xL,xn.d().label("High Balance").when(vL,{is:function(e){return!e},then:xn.d().required()}).transform(bj).integer().min(0).max(Pf).nullable()),a),[vL,xL]),x=[{name:yL,header:"Cryptocurrency",width:166,size:"sm",view:function(e){return L.a(A.a(["display"]),Ar.a(W.a("code",e)))(l)},input:ka,inputProps:{options:function(e){return Mo.a(j,function(e){var t=L.a(Ar.a(W.a("code",null===e||void 0===e?void 0:e.cryptoCurrency)))(l);return t?[t]:[]}(e))},optionsLimit:null,valueProp:"code",labelProp:"display"}},{name:vL,width:155,textAlign:"right",bold:!0,input:qa,suffix:m,inputProps:{decimalPlaces:2}},{name:xL,width:155,textAlign:"right",bold:!0,input:qa,suffix:m,inputProps:{decimalPlaces:2}}];return Object(Me.jsx)(jm,{name:wL,title:"Overrides",error:null===u||void 0===u?void 0:u.message,enableDelete:!0,enableEdit:!0,enableCreate:!0,save:function(e){return d(i,e)},initialValues:g,validationSchema:O,forceDisable:h(wL)||!l,data:p,elements:x,disableAdd:!(null===j||void 0===j?void 0:j.length),onDelete:function(e){var t={cryptoBalanceOverrides:zd.a((function(t){return t.id===e}),p)};return d(t)},setEditing:function(e){return b(wL,e)}})},kL={wrapper:{display:"flex"},form:{marginBottom:36},first:{width:236},title:{marginTop:0},row:{width:183,display:"grid",gridTemplateColumns:"repeat(2,1fr)",gridTemplateRows:"1fr",gridColumnGap:18,gridRowGap:0},col2:{width:136},cashboxLabel:{marginRight:4,fontSize:20},cashboxEmptyPart:{backgroundColor:"".concat(re)}},SL=Object(f.a)(kL),NL="fiatBalanceAlerts",IL=function(e){var t,n,a=e.section,i=e.min,o=void 0===i?0:i,c=e.max,l=void 0===c?100:c,s=e.fieldWidth,d=void 0===s?80:s,u=Object(r.useContext)(dL),m=u.isEditing,h=u.isDisabled,b=u.setEditing,p=u.data,f=u.save,j=SL(),g=m(NL),O=xn.e().shape({fillingPercentageCassette1:xn.d().transform(bj).integer().min(o).max(l).nullable(),fillingPercentageCassette2:xn.d().transform(bj).integer().min(o).max(l).nullable()});return Object(Me.jsx)(pn.d,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,initialValues:{fillingPercentageCassette1:null!==(t=A.a(["fillingPercentageCassette1"])(p))&&void 0!==t?t:"",fillingPercentageCassette2:null!==(n=A.a(["fillingPercentageCassette2"])(p))&&void 0!==n?n:""},validationSchema:O,onSubmit:function(e){return f(a,O.cast(e))},onReset:function(){b(NL,!1)},children:function(e){var t,n,r=e.values;return Object(Me.jsxs)(pn.c,{className:j.form,children:[Object(Me.jsx)(Vd,{}),Object(Me.jsx)(mL,{title:"Cash out (Empty)",editing:g,disabled:h(NL),setEditing:function(e){return b(NL,e)}}),Object(Me.jsxs)("div",{className:j.wrapper,children:[Object(Me.jsx)("div",{className:j.first,children:Object(Me.jsxs)("div",{className:j.row,children:[Object(Me.jsx)(Ta,{labelClassName:j.cashboxLabel,emptyPartClassName:j.cashboxEmptyPart,percent:null!==(t=r.fillingPercentageCassette1)&&void 0!==t?t:null===p||void 0===p?void 0:p.fillingPercentageCassette1,applyColorVariant:!0,applyFiatBalanceAlertsStyling:!0,omitInnerPercentage:!0,cashOut:!0}),Object(Me.jsxs)("div",{className:j.col2,children:[Object(Me.jsx)(Je,{className:j.title,children:"Cassette 1 (Top)"}),Object(Me.jsx)(bL,{label:"Alert me under",name:"fillingPercentageCassette1",editing:g,displayValue:function(e){return""===e?"-":e},decoration:"%",width:d})]})]})}),Object(Me.jsxs)("div",{className:j.row,children:[Object(Me.jsx)(Ta,{labelClassName:j.cashboxLabel,emptyPartClassName:j.cashboxEmptyPart,percent:null!==(n=r.fillingPercentageCassette2)&&void 0!==n?n:null===p||void 0===p?void 0:p.fillingPercentageCassette2,applyColorVariant:!0,applyFiatBalanceAlertsStyling:!0,omitInnerPercentage:!0,cashOut:!0}),Object(Me.jsxs)("div",{className:j.col2,children:[Object(Me.jsx)(Je,{className:j.title,children:"Cassette 2 (Bottom)"}),Object(Me.jsx)(bL,{label:"Alert me under",name:"fillingPercentageCassette2",editing:g,displayValue:function(e){return""===e?"-":e},decoration:"%",width:d})]})]})]})]})}})},EL="fillingPercentageCassette1",FL="fillingPercentageCassette2",LL="machine",PL="fiatBalanceOverrides",DL=function(e){var t,n,a,i=e.section,o=Object(r.useContext)(dL),c=o.machines,l=void 0===c?[]:c,s=o.data,d=o.save,u=o.isDisabled,m=o.setEditing,h=o.error,b=null!==(t=null===s||void 0===s?void 0:s.fiatBalanceOverrides)&&void 0!==t?t:[],p=B.a((function(e){return e.machine}),b),f=M.a((function(e){return!qo.a(e.deviceId,p)}))(l),j=(n={},Object(z.a)(n,LL,null),Object(z.a)(n,EL,""),Object(z.a)(n,FL,""),n),g=xn.e().shape((a={},Object(z.a)(a,LL,xn.g().label("Machine").nullable().required()),Object(z.a)(a,EL,xn.d().label("Cassette 1 (top)").when(FL,{is:function(e){return!e},then:xn.d().required()}).transform(bj).integer().min(0).max(100).nullable()),Object(z.a)(a,FL,xn.d().label("Cassette 2 (bottom)").when(EL,{is:function(e){return!e},then:xn.d().required()}).transform(bj).integer().min(0).max(100).nullable()),a),[EL,FL]),O=[{name:LL,width:238,size:"sm",view:function(e){return L.a(A.a(["name"]),Ar.a(W.a("deviceId",e)))(l)},input:ka,inputProps:{options:function(e){return Mo.a(f,function(e){var t=L.a(Ar.a(W.a("deviceId",null===e||void 0===e?void 0:e.machine)))(l);return t?[t]:[]}(e))},valueProp:"deviceId",labelProp:"name"}},{name:EL,header:"Cash-out 1",width:155,textAlign:"right",doubleHeader:"Cash-out (Cassette Empty)",bold:!0,input:qa,suffix:"%",inputProps:{decimalPlaces:0}},{name:FL,header:"Cash-out 2",width:155,textAlign:"right",doubleHeader:"Cash-out (Cassette Empty)",bold:!0,input:qa,suffix:"%",inputProps:{decimalPlaces:0}}];return Object(Me.jsx)(jm,{name:PL,title:"Overrides",error:null===h||void 0===h?void 0:h.message,enableDelete:!0,enableEdit:!0,enableCreate:!0,save:function(e){return d(i,g.cast(e))},initialValues:j,validationSchema:g,forceDisable:u(PL)||!l,data:b,elements:O,disableAdd:!(null===f||void 0===f?void 0:f.length),setEditing:function(e){return m(PL,e)}})},BL={balance:152,transactions:184,compliance:178,errors:142,security:152,active:263},RL=function(e){var t=e.namespace,n=e.forceDisable,a=Object(r.useContext)(dL),i=a.data,o=a.save,c=L.a(o(null),kl(t)),l=Cl(t)(i),s=n||!l||!l.active,d=function(e){var t=e.name,n=e.disabled,r=!(!l||!l[t]);return Object(Me.jsx)(tu,{width:BL[t],textAlign:"center",children:Object(Me.jsx)(Ca,{disabled:n,checked:r,onChange:function(e){c(Object(z.a)({},t,e.target.checked))},value:r})})};return Object(Me.jsxs)(au,{children:[Object(Me.jsx)(tu,{width:129,children:pu(t)}),Object(Me.jsx)(d,{name:"balance",disabled:s}),Object(Me.jsx)(d,{name:"transactions",disabled:s}),Object(Me.jsx)(d,{name:"compliance",disabled:s}),Object(Me.jsx)(d,{name:"errors",disabled:s}),Object(Me.jsx)(d,{name:"security",disabled:s}),Object(Me.jsx)(d,{name:"active",disabled:n})]})},TL=Object(f.a)({wizardTable:{width:930}}),AL=function(e){var t=e.wizard,n=e.forceDisable,r=t?20:0,a=TL();return Object(Me.jsxs)(Kd,{className:t?a.wizardTable:null,children:[Object(Me.jsxs)(Qd,{children:[Object(Me.jsx)(nu,{width:129-r,children:"Channel"}),Object.keys(BL).map((function(e){return Object(Me.jsx)(nu,{width:BL[e]-r,textAlign:"center",children:pu(e)},e)}))]}),Object(Me.jsxs)(eu,{children:[Object(Me.jsx)(RL,{namespace:"email",forceDisable:n}),Object(Me.jsx)(RL,{namespace:"sms",forceDisable:n}),Object(Me.jsx)(RL,{namespace:"notificationCenter",forceDisable:n})]})]})},ML=function(e){var t=e.section,n=e.fieldWidth;return Object(Me.jsx)(pL,{section:t,title:"High value transaction",label:"Alert me over",name:"highValueTransaction",width:n})},WL=x()(_F||(_F=Object(l.a)(["\n query getData {\n config\n machines {\n name\n deviceId\n }\n cryptoCurrencies {\n code\n display\n }\n }\n"]))),zL=x()(ZF||(ZF=Object(l.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),$L=function(e){var t=e.name,n=e.displaySetup,a=void 0===n||n,i=e.displayTransactionAlerts,o=void 0===i||i,l=e.displayFiatAlerts,s=void 0===l||l,d=e.displayCryptoAlerts,m=void 0===d||d,h=e.displayOverrides,b=void 0===h||h,p=e.displayTitle,f=void 0===p||p,j=e.wizard,g=void 0!==j&&j,O=Object(r.useState)(null),x=Object(c.a)(O,2),v=x[0],y=x[1],w=Object(r.useState)(null),C=Object(c.a)(w,2),k=C[0],S=C[1],N=Object(r.useState)(null),I=Object(c.a)(N,2),E=I[0],F=I[1],L=Object(u.c)(WL).data,P=Object(u.b)(zL,{refetchQueries:["getData"],onCompleted:function(){return F(null)},onError:function(e){return S(e)}}),D=Object(c.a)(P,1)[0],B=Cl(t)(null===L||void 0===L?void 0:L.config),R=null===L||void 0===L?void 0:L.machines,T=null===L||void 0===L?void 0:L.cryptoCurrencies,M=A.a(["fiatCurrency"])(Cl(pl)(null===L||void 0===L?void 0:L.config)),W={save:ol.a((function(e,n){var r=kl(t)(n);return y(e),S(null),D({variables:{config:r}})})),error:k,editingKey:E,data:B,currency:M,isEditing:function(e){return E===e},isDisabled:function(e){return E&&E!==e},setEditing:function(e,t){t||S(null),F(t?e:null)},setSection:y,machines:R,cryptoCurrencies:T};return Object(Me.jsxs)(dL.Provider,{value:W,children:[f&&Object(Me.jsx)(Do,{title:"Notifications"}),a&&Object(Me.jsx)(kj,{title:"Setup",error:k&&!v,children:Object(Me.jsx)(AL,{forceDisable:!!E,wizard:g})}),o&&Object(Me.jsx)(kj,{title:"Transaction alerts",error:k&&"tx"===v,children:Object(Me.jsx)(ML,{section:"tx",fieldWidth:130})}),s&&Object(Me.jsxs)(kj,{title:"Fiat balance alerts",error:k&&"fiat"===v,children:[Object(Me.jsx)(IL,{section:"fiat",max:100,fieldWidth:50}),b&&Object(Me.jsx)(DL,{section:"fiat"})]}),m&&Object(Me.jsxs)(kj,{title:"Crypto balance alerts",error:k&&"crypto"===v,children:[Object(Me.jsx)(OL,{section:"crypto",fieldWidth:130}),b&&Object(Me.jsx)(CL,{section:"crypto",fieldWidth:130})]})]})};function qL(){return(qL=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function HL(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var VL=r.createElement("g",{id:"\\u21B3\\u21B3-Coin-ATM-Radar",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("g",{id:"operator-info_v4-CAR#1",transform:"translate(-832.000000, -608.000000)",fill:"#FF584A",fillRule:"nonzero"},r.createElement("g",{id:"Group",transform:"translate(832.000000, 608.000000)"},r.createElement("polygon",{id:"Line-7",points:"13.0484874 0 16 2.95151255 2.95151255 16 0 13.0484874"}),r.createElement("polygon",{id:"Line-7",transform:"translate(8.000000, 8.000000) scale(-1, 1) translate(-8.000000, -8.000000) ",points:"13.0484874 0 16 2.95151255 2.95151255 16 0 13.0484874"}))));function UL(e,t){var n=e.title,a=e.titleId,i=HL(e,["title","titleId"]);return r.createElement("svg",qL({width:"16px",height:"16px",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),void 0===n?r.createElement("title",{id:a},"Group"):n?r.createElement("title",{id:a},n):null,VL)}var GL=r.forwardRef(UL);n.p;function XL(){return(XL=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function YL(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var _L=r.createElement("desc",null,"Created with Sketch."),ZL=r.createElement("g",{id:"icon/table/true",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},r.createElement("path",{d:"M4.17451294,13.3251347 L0.599425104,9.29667256 C-0.199808368,8.3960844 -0.199808368,6.94040225 0.599425104,6.03981409 C1.39865858,5.13922593 2.69051421,5.13922593 3.48974768,6.03981409 L5.61967423,8.439847 L12.5102523,0.675441122 C13.3094858,-0.225147041 14.6033855,-0.225147041 15.4005749,0.675441122 C16.1998084,1.57372599 16.1998084,3.03171143 15.4005749,3.93229959 L7.06483552,13.3251347 C6.66624082,13.7742771 6.14295752,14 5.61967423,14 C5.09639093,14 4.57310763,13.7742771 4.17451294,13.3251347 Z",id:"Fill-1",fill:"#48F694"}));function KL(e,t){var n=e.title,a=e.titleId,i=YL(e,["title","titleId"]);return r.createElement("svg",XL({width:"16px",height:"14px",viewBox:"0 0 16 14",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),void 0===n?r.createElement("title",{id:a},"icon/table/true"):n?r.createElement("title",{id:a},n):null,_L,ZL)}var QL,JL,eP,tP,nP,rP,aP,iP,oP,cP,lP,sP,dP,uP,mP,hP,bP,pP,fP,jP=r.forwardRef(KL),gP=(n.p,{booleanPropertiesTableWrapper:{display:"flex",flexDirection:"column",width:396},tableRow:{display:"flex",alignItems:"center",justifyContent:"space-between","&:nth-child(even)":{backgroundColor:re},"&:nth-child(odd)":{backgroundColor:G},minHeight:32,height:"auto",padding:[[8,16,8,24]],boxShadow:"0 0 0 0 rgba(0, 0, 0, 0)"},leftTableCell:{display:"flex",alignItems:"center",justifyContent:"left",width:200,padding:[0]},rightTableCell:{display:"flex",alignItems:"center",justifyContent:"right",padding:[0]},transparentButton:{"& > *":{margin:"auto 12px"},"& button":{border:"none",backgroundColor:"transparent",cursor:"pointer"}},rowWrapper:{display:"flex",alignItems:"center",position:"relative",flex:"wrap"},rightAligned:{marginLeft:"auto"},radioButtons:{display:"flex",flexDirection:"row",margin:[-15]},rightLink:{marginLeft:"20px"},fillColumn:nb.fillColumn,popoverContent:{width:272,padding:[[10,15]]}}),OP=Object(f.a)(gP),xP=function(e){var t=e.name;return"true"===Object(pn.e)().values[t]?Object(Me.jsx)(jP,{}):Object(Me.jsx)(GL,{})},vP=Object(r.memo)((function(e){var t=e.title,n=e.disabled,a=e.data,i=e.elements,o=e.save,l=e.forcedEditing,s=void 0!==l&&l,d=cl.a(i.map((function(e){var t;return[e.name,null!==(t=a[e.name])&&void 0!==t?t:null]}))),u=cl.a(i.map((function(e){return[e.name,xn.b().required()]}))),m=Object(r.useState)(s),h=Object(c.a)(m,2),b=h[0],p=h[1],f=OP(),j=function(){var e=Object(nc.a)(tc.a.mark((function e(t){return tc.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o(M.a(mj.a(D.a),t)),p(!1);case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),g=[{display:"Yes",code:"true"},{display:"No",code:"false"}];return Object(Me.jsx)("div",{className:f.booleanPropertiesTableWrapper,children:Object(Me.jsx)(pn.d,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,onSubmit:j,initialValues:d,schemaValidation:u,children:function(e){var r=e.resetForm;return Object(Me.jsxs)(pn.c,{children:[Object(Me.jsxs)("div",{className:f.rowWrapper,children:[Object(Me.jsx)(Ue,{children:t}),b?Object(Me.jsxs)("div",{className:f.rightAligned,children:[Object(Me.jsx)(or,{type:"submit",color:"primary",children:"Save"}),Object(Me.jsx)(or,{type:"reset",className:f.rightLink,onClick:function(){r(),p(!1)},color:"secondary",children:"Cancel"})]}):Object(Me.jsx)(tr,{className:f.transparentButton,onClick:function(){return p(!0)},children:n?Object(Me.jsx)(Ju,{}):Object(Me.jsx)(lm,{})})]}),Object(Me.jsx)(Vd,{}),Object(Me.jsx)(Ux,{className:f.fillColumn,children:Object(Me.jsx)(Gx,{className:f.fillColumn,children:i.map((function(e,t){return Object(Me.jsxs)(nv,{size:"sm",className:f.tableRow,children:[Object(Me.jsx)(Yx,{className:f.leftTableCell,children:e.display}),Object(Me.jsxs)(Yx,{className:f.rightTableCell,children:[b&&Object(Me.jsx)(pn.b,{component:Ha,name:e.name,options:g,className:E()(f.radioButtons,f.rightTableCell)}),!b&&Object(Me.jsx)(xP,{name:e.name})]})]},t)}))})})]})}})})})),yP={content:{display:"flex"},header:{display:"flex",alignItems:"center",position:"relative",flex:"wrap"},section:{marginBottom:52},row:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:28,width:600,"&:last-child":{marginBottom:0}},switchRow:{display:"flex",alignItems:"center",position:"relative",flex:"wrap",justifyContent:"space-between",width:396},switch:{display:"flex",alignItems:"center"},submit:{justifyContent:"flex-start",alignItems:"center",padding:[[0,4,4,4]],"& > button":{marginRight:40}},transparentButton:{"& > *":{margin:"auto 12px"},"& button":{border:"none",backgroundColor:"transparent",cursor:"pointer"}},infoMessage:{display:"flex",marginBottom:52,"& > p":{width:330,color:se,marginTop:4,marginLeft:16}},formErrorMsg:{margin:[[0,0,20,0]]}},wP=Object(f.a)(yP),CP=x()(QL||(QL=Object(l.a)(["\n query getData {\n config\n }\n"]))),kP=x()(JL||(JL=Object(l.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),SP=Object(r.memo)((function(e){var t=e.title,n=e.disabled,r=void 0!==n&&n,a=e.checked,i=e.save,o=e.label,c=wP();return Object(Me.jsxs)("div",{className:c.switchRow,children:[Object(Me.jsx)(Xe,{children:t}),Object(Me.jsxs)("div",{className:c.switch,children:[Object(Me.jsx)(Ca,{disabled:r,checked:a,onChange:function(e){return i&&i(e.target.checked)}}),o&&Object(Me.jsx)(tt,{children:o})]})]})})),NP=Object(r.memo)((function(e){var t=e.wizard,n=wP(),r=Object(u.c)(CP).data,a=Object(u.b)(kP,{refetchQueries:["getData"]}),i=Object(c.a)(a,1)[0],o=function(e){return i({variables:{config:kl(gl,e)}})},l=(null===r||void 0===r?void 0:r.config)&&Cl(gl,r.config);return l?Object(Me.jsx)("div",{className:n.content,children:Object(Me.jsxs)("div",{children:[Object(Me.jsxs)("div",{className:n.header,children:[Object(Me.jsx)(Ue,{children:"Coin ATM Radar share settings"}),Object(Me.jsx)(Eb,{width:304,children:Object(Me.jsxs)(Xe,{children:["For details on configuring this panel, please read the relevant knowledgebase article"," ",Object(Me.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://support.lamassu.is/hc/en-us/articles/360023720472-Coin-ATM-Radar",children:"here"}),"."]})})]}),Object(Me.jsx)(SP,{title:"Share information?",checked:l.active,save:function(e){return o({active:e})},label:l.active?"Yes":"No"}),Object(Me.jsx)(vP,{editing:t,title:"Machine info",data:l,elements:[{name:"commissions",display:"Commissions"},{name:"limitsAndVerification",display:"Limits and verification"}],save:o})]})}):null})),IP={field:{position:"relative",width:280,height:48,padding:[[0,4,4,0]]},notEditing:{display:"flex",flexDirection:"column","& > p:first-child":{height:16,lineHeight:"16px",fontSize:ve,transformOrigin:"left",paddingLeft:0,margin:[[3,0,3,0]]},"& > p:last-child":{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",margin:0}}},EP=Object(f.a)(IP),FP=function(e){var t,n=e.editing,r=e.field,a=e.displayValue,i=Object($.a)(e,["editing","field","displayValue"]),o=EP(),c=(t={},Object(z.a)(t,o.field,!0),Object(z.a)(t,o.notEditing,!n),t);return Object(Me.jsxs)("div",{className:E()(c),children:[!n&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(nt,{children:r.label}),Object(Me.jsx)(Ze,{children:a(r.value)})]}),n&&Object(Me.jsx)(pn.b,Object(s.a)({id:r.name,name:r.name,component:r.component,placeholder:r.placeholder,type:r.type,label:r.label,width:280},i))]})},LP=x()(eP||(eP=Object(l.a)(["\n query getData {\n config\n }\n"]))),PP=x()(tP||(tP=Object(l.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),DP=Object(f.a)(yP),BP=function(e){var t,n,a,i,o=e.wizard,l=DP(),s=Object(r.useState)(o||!1),d=Object(c.a)(s,2),m=d[0],h=d[1],b=Object(r.useState)(null),p=Object(c.a)(b,2),f=p[0],j=p[1],g=Object(u.b)(PP,{onCompleted:function(){return h(!1)},refetchQueries:function(){return["getData"]},onError:function(e){return j(e)}}),O=Object(c.a)(g,1)[0],x=Object(u.c)(LP).data,v=function(e){return O({variables:{config:kl(hl,e)}})},y=(null===x||void 0===x?void 0:x.config)&&Cl(hl,x.config);if(!y)return null;var w=xn.e().shape({active:xn.b(),name:xn.g(),phone:xn.g(),email:xn.g().email("Please enter a valid email address").required("An email is required"),website:xn.g(),companyNumber:xn.g()}),C=[{name:"name",label:"Full name",value:null!==(t=y.name)&&void 0!==t?t:"",component:Ua},{name:"phone",label:"Phone number",value:y.phone,component:Ua},{name:"email",label:"Email",value:null!==(n=y.email)&&void 0!==n?n:"",component:Ua},{name:"website",label:"Website",value:null!==(a=y.website)&&void 0!==a?a:"",component:Ua},{name:"companyNumber",label:"Company number",value:null!==(i=y.companyNumber)&&void 0!==i?i:"",component:Ua}],k=function(e){return Ar.a(W.a("name",e))(C)},S=function(e){return k(e).value},N=function(e){return e},I={initialValues:{active:y.active,name:S("name"),phone:S("phone"),email:S("email"),website:S("website"),companyNumber:S("companyNumber")}},F=function(e){return D.a(e.email)?null:e.email};return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)("div",{className:l.header,children:Object(Me.jsx)(Ue,{children:"Contact information"})}),Object(Me.jsxs)("div",{className:l.switchRow,children:[Object(Me.jsx)(Xe,{children:"Info card enabled?"}),Object(Me.jsxs)("div",{className:l.switch,children:[Object(Me.jsx)(Ca,{checked:y.active,onChange:function(e){return v({active:e.target.checked})}}),Object(Me.jsx)(tt,{children:y.active?"Yes":"No"})]})]}),Object(Me.jsxs)("div",{className:l.section,children:[Object(Me.jsxs)("div",{className:l.header,children:[Object(Me.jsx)(Ue,{children:"Info card"}),!m&&Object(Me.jsx)(tr,{className:l.transparentButton,onClick:function(){return h(!0)},children:Object(Me.jsx)(lm,{})})]}),Object(Me.jsx)(pn.d,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,initialValues:I.initialValues,validationSchema:w,onSubmit:function(e){return v(w.cast(e))},onReset:function(){h(!1),j(null)},children:function(e){var t=e.errors;return Object(Me.jsxs)(pn.c,{children:[Object(Me.jsx)(Vd,{}),Object(Me.jsxs)("div",{className:l.row,children:[Object(Me.jsx)(FP,{field:k("name"),editing:m,displayValue:N,onFocus:function(){return j(null)}}),Object(Me.jsx)(FP,{field:k("phone"),editing:m,displayValue:N,onFocus:function(){return j(null)}})]}),Object(Me.jsxs)("div",{className:l.row,children:[Object(Me.jsx)(FP,{field:k("email"),editing:m,displayValue:N,onFocus:function(){return j(null)}}),Object(Me.jsx)(FP,{field:k("website"),editing:m,displayValue:N,onFocus:function(){return j(null)}})]}),Object(Me.jsx)("div",{className:l.row,children:Object(Me.jsx)(FP,{field:k("companyNumber"),editing:m,displayValue:N,onFocus:function(){return j(null)}})}),m&&!!F(t)&&Object(Me.jsx)(Fo,{className:l.formErrorMsg,children:F(t)}),Object(Me.jsx)("div",{className:E()(l.row,l.submit),children:m&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(or,{color:"primary",type:"submit",children:"Save"}),Object(Me.jsx)(or,{color:"secondary",type:"reset",children:"Cancel"}),f&&Object(Me.jsx)(Fo,{children:"Failed to save changes"})]})})]})}})]}),!o&&Object(Me.jsxs)("div",{className:E()(l.section,l.infoMessage),children:[Object(Me.jsx)(ia,{}),Object(Me.jsx)(et,{children:"Sharing your information with your customers through your machines allows them to contact you in case there's a problem with a machine in your network or a transaction."})]})]})},RP=Object(f.a)(yP),TP=x()(nP||(nP=Object(l.a)(["\n query getData {\n config\n }\n"]))),AP=x()(rP||(rP=Object(l.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),MP=Object(r.memo)((function(e){var t=e.wizard,n=RP(),r=Object(u.c)(TP).data,a=Object(u.b)(AP,{refetchQueries:function(){return["getData"]}}),i=Object(c.a)(a,1)[0],o=(null===r||void 0===r?void 0:r.config)&&Cl(jl,r.config);return o?Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)("div",{className:n.header,children:Object(Me.jsx)(Ue,{children:"Receipt options"})}),Object(Me.jsxs)("div",{className:n.switchRow,children:[Object(Me.jsx)(Xe,{children:"Enable receipt printing"}),Object(Me.jsxs)("div",{className:n.switch,children:[Object(Me.jsx)(Ca,{checked:o.active,onChange:function(e){return i({variables:{config:kl(jl,Gn.a(o,{active:e.target.checked}))}})}}),Object(Me.jsx)(tt,{children:o.active?"Yes":"No"})]})]}),Object(Me.jsxs)("div",{className:n.switchRow,children:[Object(Me.jsx)(Xe,{children:"Offer SMS receipt"}),Object(Me.jsxs)("div",{className:n.switch,children:[Object(Me.jsx)(Ca,{checked:o.sms,onChange:function(e){return i({variables:{config:kl(jl,Gn.a(o,{sms:e.target.checked}))}})}}),Object(Me.jsx)(tt,{children:o.sms?"Yes":"No"})]})]}),Object(Me.jsx)(vP,{editing:t,title:"Visible on the receipt (options)",data:o,elements:[{name:"operatorWebsite",display:"Operator website"},{name:"operatorEmail",display:"Operator email"},{name:"operatorPhone",display:"Operator phone"},{name:"companyNumber",display:"Company number"},{name:"machineLocation",display:"Machine location"},{name:"customerNameOrPhoneNumber",display:"Customer name or phone number (if known)"},{name:"exchangeRate",display:"Exchange rate"},{name:"addressQRCode",display:"Address QR code"}],save:function(e){return i({variables:{config:kl(jl,e)}})}})]}):null})),WP=Object(f.a)({field:{position:"relative",width:280,padding:[[0,4,4,0]]},notEditing:{display:"flex",flexDirection:"column"},notEditingSingleLine:{"& > p:first-child":{height:16,lineHeight:"16px",transform:"scale(0.75)",transformOrigin:"left",paddingLeft:0,margin:[[1,0,6,0]]},"& > p:last-child":{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",height:25,margin:0}},notEditingMultiline:{"& > p:first-child":{height:16,lineHeight:"16px",transform:"scale(0.75)",transformOrigin:"left",paddingLeft:0,margin:[[1,0,5,0]]},"& > p:last-child":{width:502,height:121,overflowY:"auto",lineHeight:"19px",wordWrap:"anywhere",margin:0}}}),zP=function(e){var t,n=e.editing,r=e.name,a=e.width,i=e.placeholder,o=e.label,c=e.value,l=e.multiline,d=void 0!==l&&l,u=e.rows,m=e.onFocus,h=Object($.a)(e,["editing","name","width","placeholder","label","value","multiline","rows","onFocus"]),b=WP(),p=(t={},Object(z.a)(t,b.field,!0),Object(z.a)(t,b.notEditing,!n),Object(z.a)(t,b.notEditingSingleLine,!n&&!d),Object(z.a)(t,b.notEditingMultiline,!n&&d),t);return Object(Me.jsxs)("div",{className:E()(p),children:[!n&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(nt,{children:o}),Object(Me.jsx)(Ze,{children:c})]}),n&&Object(Me.jsx)(pn.b,Object(s.a)({id:r,name:r,component:Ua,width:a,placeholder:i,type:"text",label:o,multiline:d,rows:u,rowsMax:"6",onFocus:m},h))]})},$P=x()(aP||(aP=Object(l.a)(["\n query getData {\n config\n }\n"]))),qP=x()(iP||(iP=Object(l.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),HP=Object(f.a)(yP),VP=function(){var e,t,n,a,i,o,l=Object(r.useState)(null),s=Object(c.a)(l,2),d=s[0],m=s[1],h=Object(r.useState)(!1),b=Object(c.a)(h,2),p=b[0],f=b[1],j=Object(u.b)(qP,{onCompleted:function(){m(null),f(!1)},refetchQueries:function(){return["getData"]},onError:function(e){return m(e)}}),g=Object(c.a)(j,1)[0],O=HP(),x=Object(u.c)($P).data,v=(null===x||void 0===x?void 0:x.config)&&Cl(Ol,x.config),y=null!==v&&void 0!==v?v:{},w=null!==(e=null===v||void 0===v?void 0:v.active)&&void 0!==e&&e,C=null!==(t=null===v||void 0===v?void 0:v.delay)&&void 0!==t&&t,k=function(e){return g({variables:{config:kl(Ol,e)}})},S=[{name:"title",label:"Screen title",value:null!==(n=y.title)&&void 0!==n?n:"",width:282},{name:"text",label:"Text content",value:null!==(a=y.text)&&void 0!==a?a:"",width:502,multiline:!0,rows:6},{name:"acceptButtonText",label:"Accept button text",value:null!==(i=y.acceptButtonText)&&void 0!==i?i:"",placeholder:"I accept",width:282},{name:"cancelButtonText",label:"Cancel button text",value:null!==(o=y.cancelButtonText)&&void 0!==o?o:"",placeholder:"Cancel",width:282}],N=function(e){return function(e){return Ar.a(W.a("name",e))(S)}(e).value},I={title:N("title"),text:N("text"),acceptButtonText:N("acceptButtonText"),cancelButtonText:N("cancelButtonText")},F=xn.e().shape({title:xn.g().required().max(50,"Too long"),text:xn.g().required(),acceptButtonText:xn.g().required().max(50,"Too long"),cancelButtonText:xn.g().required().max(50,"Too long")});return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)("div",{className:O.header,children:Object(Me.jsx)(Ue,{children:"Terms & Conditions"})}),Object(Me.jsxs)("div",{className:O.switchRow,children:[Object(Me.jsx)(Xe,{children:"Show on screen"}),Object(Me.jsxs)("div",{className:O.switch,children:[Object(Me.jsx)(Ca,{checked:w,onChange:function(e){return k({active:e.target.checked})}}),Object(Me.jsx)(tt,{children:w?"Yes":"No"})]})]}),Object(Me.jsxs)("div",{className:O.switchRow,children:[Object(Me.jsx)(Xe,{children:"Add 7 seconds delay on screen"}),Object(Me.jsxs)("div",{className:O.switch,children:[Object(Me.jsx)(Ca,{checked:C,onChange:function(e){return k({delay:e.target.checked})}}),Object(Me.jsx)(tt,{children:C?"Yes":"No"})]})]}),Object(Me.jsxs)("div",{className:O.header,children:[Object(Me.jsx)(_e,{children:"Info card"}),!p&&Object(Me.jsx)(tr,{className:O.transparentButton,onClick:function(){return f(!0)},children:Object(Me.jsx)(lm,{})})]}),Object(Me.jsx)(pn.d,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,initialValues:I,validationSchema:F,onSubmit:function(e){return k(e)},onReset:function(){f(!1),m(null)},children:Object(Me.jsxs)(pn.c,{children:[Object(Me.jsx)(Vd,{}),S.map((function(e,t){return Object(Me.jsx)("div",{className:O.row,children:Object(Me.jsx)(zP,{editing:p,name:e.name,width:e.width,placeholder:e.placeholder,label:e.label,value:e.value,multiline:e.multiline,rows:e.rows,onFocus:function(){return m(null)}})},t)})),Object(Me.jsx)("div",{className:E()(O.row,O.submit),children:p&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(or,{color:"primary",type:"submit",children:"Save"}),Object(Me.jsx)(or,{color:"secondary",type:"reset",children:"Cancel"}),d&&Object(Me.jsx)(Fo,{children:"Failed to save changes"})]})})]})})]})},UP={running:ne,notRunning:"#ffeceb"},GP={running:"#ecfbef",notRunning:me},XP={uptimeContainer:{display:"inline-block",minWidth:104,margin:[[0,20]]},name:{extend:Re.label1,paddingLeft:4,color:se}},YP=Object(f.a)(XP),_P=Object(f.a)({root:{borderRadius:4,marginTop:4,marginRight:2,marginBottom:4,marginLeft:2,height:24,backgroundColor:function(e){var t=e.type;return GP[t]}},label:{fontSize:ye,fontWeight:Se,fontFamily:Ne,padding:[[4,8]],color:function(e){var t=e.type;return UP[t]}}}),ZP=function(e){var t,n=e.process,r=(Object($.a)(e,["process"]),YP());return Object(Me.jsxs)("div",{className:r.uptimeContainer,children:[Object(Me.jsx)("div",{className:r.name,children:HO.a(n.name)}),Object(Me.jsx)(Sa.a,{label:"RUNNING"===n.state?"Running for ".concat((t=n.uptime,t<60?"".concat(t,"s"):t<3600?"".concat(Math.floor(t/60),"m"):t<86400?"".concat(Math.floor(t/60/60),"h"):"".concat(Math.floor(t/60/60/24),"d"))):hu(n.state),classes:_P({type:"RUNNING"===n.state?"running":"notRunning"})})]})},KP={serverTableWrapper:{extend:nb.tableWrapper,maxWidth:"100%",marginLeft:0},serverVersion:{extend:Re.p,color:se,margin:"auto 0 auto 0"},headerLine2:{display:"flex",justifyContent:"space-between",marginBottom:24},uptimeContainer:{margin:"auto 0 auto 0"}},QP=Gn.a(nb,KP),JP=Object(f.a)(QP),eD={code:"SHOW_ALL",display:"Show all"},tD=x()(oP||(oP=Object(l.a)(["\n query ServerData($limit: Int, $from: Date, $until: Date, $timezone: String) {\n serverLogsCsv(\n limit: $limit\n from: $from\n until: $until\n timezone: $timezone\n )\n }\n"]))),nD=x()(cP||(cP=Object(l.a)(["\n query ServerData($limit: Int, $from: Date, $until: Date) {\n serverVersion\n uptime {\n name\n state\n uptime\n }\n serverLogs(limit: $limit, from: $from, until: $until) {\n logLevel\n id\n timestamp\n message\n }\n }\n"]))),rD=x()(lP||(lP=Object(l.a)(["\n query getData {\n config\n }\n"]))),aD=function(){var e,t,n=JP(),a=Object(r.useRef)(),i=Object(r.useState)(null),o=Object(c.a)(i,2),l=o[0],s=o[1],d=Object(r.useState)(eD),m=Object(c.a)(d,2),h=m[0],b=m[1],p=Object(u.c)(nD,{onCompleted:function(){return s("")},variables:{limit:500}}),f=p.data,j=p.loading,g=Object(u.c)(rD),O=g.data,x=g.configLoading,v=A.a(["config","locale_timezone"],O),y=null===f||void 0===f?void 0:f.serverVersion,w=null!==(e=null===f||void 0===f?void 0:f.uptime)&&void 0!==e?e:[],C=L.a(Wd.a(eD),Nf.a,Mo.a([{code:"error",display:"Error"},{code:"info",display:"Info"},{code:"debug",display:"Debug"}]),B.a((function(e){return{code:A.a(["logLevel"])(e),display:pu(A.a(["logLevel"])(e))}})),A.a(["serverLogs"]));return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)("div",{className:n.titleWrapper,children:[Object(Me.jsxs)("div",{className:n.titleAndButtonsContainer,children:[Object(Me.jsx)(yn,{children:"Server"}),f&&Object(Me.jsxs)("div",{className:n.buttonsWrapper,children:[Object(Me.jsx)(zE,{title:"Download logs",name:"server-logs",query:tD,args:{timezone:v},logs:f.serverLogs,getLogs:function(e){return A.a(["serverLogsCsv"])(e)},timezone:v}),Object(Me.jsx)(Ze,{children:l})]})]}),Object(Me.jsx)("div",{className:n.serverVersion,children:y&&Object(Me.jsxs)("span",{children:["Server version: v",y]})})]}),Object(Me.jsxs)("div",{className:n.headerLine2,children:[f&&Object(Me.jsx)(Ru,{onSelectedItemChange:function(e){a.current&&a.current.scrollTo(0,0),b(e)},label:"Level",items:C(f),default:eD,selectedItem:h}),Object(Me.jsx)("div",{className:n.uptimeContainer,children:w&&w.map((function(e,t){return Object(Me.jsx)(ZP,{process:e},t)}))})]}),Object(Me.jsx)("div",{className:n.wrapper,children:Object(Me.jsxs)("div",{ref:a,className:n.serverTableWrapper,children:[Object(Me.jsxs)(Ux,{className:n.table,children:[Object(Me.jsx)(_x,{children:Object(Me.jsxs)(nv,{header:!0,children:[Object(Me.jsx)(Qx,{className:n.dateColumn,children:"Date"}),Object(Me.jsx)(Qx,{className:n.levelColumn,children:"Level"}),Object(Me.jsx)(Qx,{className:n.fillColumn})]})}),Object(Me.jsx)(Gx,{children:f&&f.serverLogs.filter((function(e){return h===eD||e.logLevel===h.code})).map((function(e,t){return Object(Me.jsxs)(nv,{size:"sm",children:[Object(Me.jsx)(Yx,{children:v&&Mm(e.timestamp,v,"YYYY-MM-DD HH:mm")}),Object(Me.jsx)(Yx,{children:e.logLevel}),Object(Me.jsx)(Yx,{children:e.message})]},t)}))})]}),j&&x&&Object(Me.jsx)(Ue,{children:"Loading..."}),!j&&!x&&!(null===f||void 0===f||null===(t=f.serverLogs)||void 0===t?void 0:t.length)&&Object(Me.jsx)(Ue,{children:"No activity so far"})]})})]})},iD=n(858),oD=n(848),cD=n(849),lD={tr:function(e){return{margin:0,height:e.height}},table:function(e){return{width:e.width}},head:{display:"flex",flex:1,justifyContent:"space-between",alignItems:"center",paddingRight:12},button:{marginBottom:1},itemWrapper:{display:"flex",flexDirection:"column",marginTop:16,minHeight:35},label:{extend:Re.label1,color:se,marginBottom:4},item:{extend:Re.p,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},sD=Object(f.a)(lD),dD=function(e){var t=e.width,n=void 0===t?378:t,r=e.height,a=void 0===r?128:r,i=e.title,o=e.items,c=e.onEdit,l=e.className,s=sD({width:n,height:a});return Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsxs)(Kd,{className:E()(l,s.table),children:[Object(Me.jsx)(Qd,{children:Object(Me.jsxs)(nu,{className:s.head,children:[i,Object(Me.jsx)(tr,{onClick:c,className:s.button,children:Object(Me.jsx)(Ik,{})})]})}),Object(Me.jsx)(eu,{children:Object(Me.jsx)(au,{className:s.tr,children:Object(Me.jsx)(tu,{width:n,children:o&&Object(Me.jsxs)(Me.Fragment,{children:[o[0]&&Object(Me.jsxs)("div",{className:s.itemWrapper,children:[Object(Me.jsx)("div",{className:s.label,children:o[0].label}),Object(Me.jsx)("div",{className:s.item,children:o[0].value})]}),o[1]&&Object(Me.jsxs)("div",{className:s.itemWrapper,children:[Object(Me.jsx)("div",{className:s.label,children:o[1].label}),Object(Me.jsx)("div",{className:s.item,children:o[1].value})]})]})})})})]})})},uD=x()(sP||(sP=Object(l.a)(["\n query getData {\n accounts\n config\n }\n"]))),mD=x()(dP||(dP=Object(l.a)(["\n mutation Save($accounts: JSONObject) {\n saveAccounts(accounts: $accounts)\n }\n"]))),hD=Object(f.a)({wrapper:{marginLeft:1}}),bD=function(){var e,t=Object(r.useState)(null),n=Object(c.a)(t,2),a=n[0],i=n[1],o=Object(u.c)(uD).data,l=Object(u.b)(mD,{onCompleted:function(){return i(null)},refetchQueries:["getData"]}),d=Object(c.a)(l,1)[0],m=hD(),b=null!==(e=null===o||void 0===o?void 0:o.accounts)&&void 0!==e?e:{},p=function(e,t){var n=M.a(R.a("face"))(t),r=b[e]||{};return B.a((function(e){var t,n=e.display,a=e.code;return{label:n,value:e.long?(t=r[a],!t||t.length<=20?t:"".concat(t.slice(0,8),"(...)").concat(t.slice(t.length-8,t.length))):r[a]}}))(n)};return Object(Me.jsxs)("div",{className:m.wrapper,children:[Object(Me.jsx)(Do,{title:"3rd Party Services"}),Object(Me.jsx)(h.a,{container:!0,spacing:4,children:ts.a(Sg).map((function(e){return Object(Me.jsx)(h.a,{item:!0,children:Object(Me.jsx)(dD,{editMessage:"Configure "+e.title,title:e.title,onEdit:function(){return i(e)},items:p(e.code,e.elements)})},e.code)}))}),a&&Object(Me.jsx)(sO,{title:"Edit ".concat(a.name),width:478,handleClose:function(){return i(null)},open:!0,children:Object(Me.jsx)(Hj,{save:function(e){return d({variables:{accounts:Object(z.a)({},a.code,e)}})},elements:function(e){var t=e.code,n=e.elements;return B.a((function(e){return e.component===$a?function(e){var t=e.settings,n=iD.a(["config","wallets_BTC_wallet"]),r=hs.a(oD.a(n,o),t.requirement);return t.enabled=r,e}(e):e.component!==Va?e:Object(s.a)(Object(s.a)({},e),{},{inputProps:{isPasswordFilled:!D.a(b[t])&&!D.a(A.a([e.code],b[t]))}})}),n)}(a),validationSchema:function(e){var t=e.code,n=e.getValidationSchema;return n(b[t])}(a),value:function(e){var t=e.elements,n=e.code,r=b[n],a=M.a(W.a("component",Va)),i=B.a(R.a(["code"])),o=L.a(i,a)(t);return cD.a((function(e,t){return F.a(t,o)?"":e}),r)}(a)})})]})},pD=n(413),fD=n.n(pD),jD=x()(uP||(uP=Object(l.a)(["\n query sessions {\n sessions {\n sid\n sess\n expire\n }\n }\n"]))),gD=x()(mP||(mP=Object(l.a)(["\n mutation deleteSession($sid: String!) {\n deleteSession(sid: $sid) {\n sid\n }\n }\n"]))),OD=function(){var e=Object(u.c)(jD).data,t=Object(u.b)(gD,{refetchQueries:function(){return["sessions"]}}),n=Object(c.a)(t,1)[0],r=[{header:"Login",width:207,textAlign:"left",size:"sm",view:function(e){return e.sess.user.username}},{header:"Last known use",width:305,textAlign:"center",size:"sm",view:function(e){if(D.a(e.sess.ua))return"No Record";var t=fD()(e.sess.ua);return"".concat(t.browser.name," ").concat(t.browser.version," on ").concat(t.os.name," ").concat(t.os.version)}},{header:"Last known location",width:250,textAlign:"center",size:"sm",view:function(e){return"localhost"===(t=e.sess.ipAddress)||"::1"===t||"127.0.0.1"===t?"This device":e.sess.ipAddress;var t}},{header:"Expiration date (UTC)",width:290,textAlign:"right",size:"sm",view:function(e){return"".concat(Ll.a.utc(e.expire).format("YYYY-MM-DD")," ").concat(Ll.a.utc(e.expire).format("HH:mm:ss"))}},{header:"",width:80,textAlign:"center",size:"sm",view:function(e){return Object(Me.jsx)(tr,{onClick:function(){n({variables:{sid:e.sid}})},children:Object(Me.jsx)(Xu,{})})}}];return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Do,{title:"Session Management"}),Object(Me.jsx)(iv,{elements:r,data:A.a(["sessions"])(e)})]})},xD=Object(f.a)(cb),vD=x()(hP||(hP=Object(l.a)(["\n query getData {\n config\n }\n"]))),yD=x()(bP||(bP=Object(l.a)(["\n query transactions(\n $simplified: Boolean\n $limit: Int\n $from: Date\n $until: Date\n $timezone: String\n ) {\n transactionsCsv(\n simplified: $simplified\n limit: $limit\n from: $from\n until: $until\n timezone: $timezone\n )\n }\n"]))),wD=x()(pP||(pP=Object(l.a)(["\n query filters {\n transactionFilters {\n type\n value\n }\n }\n"]))),CD=x()(fP||(fP=Object(l.a)(["\n query transactions(\n $limit: Int\n $from: Date\n $until: Date\n $txClass: String\n $machineName: String\n $customerName: String\n $fiatCode: String\n $cryptoCode: String\n $toAddress: String\n $status: String\n ) {\n transactions(\n limit: $limit\n from: $from\n until: $until\n txClass: $txClass\n machineName: $machineName\n customerName: $customerName\n fiatCode: $fiatCode\n cryptoCode: $cryptoCode\n toAddress: $toAddress\n status: $status\n ) {\n id\n txClass\n txHash\n toAddress\n commissionPercentage\n expired\n machineName\n operatorCompleted\n sendConfirmed\n dispense\n hasError: error\n deviceId\n fiat\n cashInFee\n fiatCode\n cryptoAtoms\n cryptoCode\n toAddress\n created\n customerName\n customerIdCardData\n customerIdCardPhotoPath\n customerFrontCameraPath\n customerPhone\n discount\n customerId\n isAnonymous\n }\n }\n"]))),kD=function(){var e,t=xD(),n=Object(w.h)(),a=Object(r.useState)([]),i=Object(c.a)(a,2),o=i[0],l=i[1],s=Object(u.c)(wD),d=s.data,m=s.loading,h=Object(r.useState)({limit:1e3}),b=Object(c.a)(h,2),p=b[0],f=b[1],j=Object(u.c)(CD,{variables:p}),g=j.data,O=j.loading,x=j.refetch,v=j.startPolling,y=j.stopPolling;Object(r.useEffect)((function(){return v(1e4),y}));var C=null!==(e=null===g||void 0===g?void 0:g.transactions)&&void 0!==e?e:[],k=Object(u.c)(vD),S=k.data,N=k.configLoading,I=A.a(["config","locale_timezone"],S),E=function(e){return e.isAnonymous?"Anonymous":e.customerName?e.customerName:e.customerIdCardData?function(e){var t=e.firstName,n=e.lastName;return"".concat(bb.a(pb.a,fb.a)(t),". ").concat(n)}(e.customerIdCardData):e.customerPhone},F=[{header:"",width:32,size:"sm",view:function(e){return"cashOut"===e.txClass?Object(Me.jsx)(tl,{}):Object(Me.jsx)(Yc,{})}},{header:"Machine",name:"machineName",width:160,size:"sm",view:A.a(["machineName"])},{header:"Customer",width:202,size:"sm",view:function(e){return Object(Me.jsxs)("div",{className:t.flexWrapper,children:[Object(Me.jsx)("div",{className:t.overflowTd,children:E(e)}),!e.isAnonymous&&Object(Me.jsx)("div",{onClick:function(){return t=e.customerId,n.push("/compliance/customer/".concat(t));var t},children:Object(Me.jsx)(Od,{className:t.customerLinkIcon})})]})}},{header:"Cash",width:144,textAlign:"right",size:"sm",view:function(e){return"".concat(Number.parseFloat(e.fiat)," ").concat(e.fiatCode)}},{header:"Crypto",width:150,textAlign:"right",size:"sm",view:function(e){return"".concat(hb.utils.toUnit(new al.a(e.cryptoAtoms),e.cryptoCode)," ").concat(e.cryptoCode)}},{header:"Address",view:function(e){return hb.utils.formatCryptoAddress(e.cryptoCode,e.toAddress)},className:t.overflowTd,size:"sm",width:140},{header:"Date (UTC)",view:function(e){return I&&Mm(e.created,I,"YYYY-MM-DD HH:mm:ss")},textAlign:"right",size:"sm",width:195},{header:"Status",view:function(e){return Ap(e)},textAlign:"left",size:"sm",width:80}],P=A.a(["transactionFilters"])(d);return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)("div",{className:t.titleWrapper,children:[Object(Me.jsxs)("div",{className:t.titleAndButtonsContainer,children:[Object(Me.jsx)(yn,{children:"Transactions"}),Object(Me.jsx)("div",{className:t.buttonsWrapper,children:Object(Me.jsx)(ES,{loading:m,filters:o,options:P,inputPlaceholder:"Search Transactions",onChange:function(e){var t=L.a($j.a,B.a((function(e){return Object(z.a)({},e.type,e.value)})))(e);l(e),f({limit:1e3,txClass:t.type,machineName:t.machine,customerName:t.customer,fiatCode:t.fiat,cryptoCode:t.crypto,toAddress:t.address,status:t.status}),x&&x()}})}),C&&Object(Me.jsx)("div",{className:t.buttonsWrapper,children:Object(Me.jsx)(zE,{title:"Download logs",name:"transactions",query:yD,getLogs:function(e){return A.a(["transactionsCsv"])(e)},simplified:!0,timezone:I,args:{timezone:I}})})]}),Object(Me.jsxs)("div",{className:t.headerLabels,children:[Object(Me.jsxs)("div",{children:[Object(Me.jsx)(Yc,{}),Object(Me.jsx)("span",{children:"Cash-in"})]}),Object(Me.jsxs)("div",{children:[Object(Me.jsx)(tl,{}),Object(Me.jsx)("span",{children:"Cash-out"})]})]})]}),o.length>0&&Object(Me.jsx)(XS,{entries:C.length,filters:o,onFilterDelete:function(e){return l(M.a((function(t){return!xS.a(gu.a(["type","value"],t),e)}))(o))},setFilters:l}),Object(Me.jsx)(iv,{loading:O&&N,emptyText:"No transactions so far",elements:F,data:C,Details:Gp,expandable:!0,rowSize:"sm",timezone:I})]})};function SD(){return(SD=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function ND(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var ID=r.createElement("desc",null,"Created with Sketch."),ED=r.createElement("g",{id:"icon/sf-small/settings/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinejoin:"round"},r.createElement("path",{d:"M10,13 C8.34325,13 7,11.65675 7,10 C7,8.34325 8.34325,7 10,7 C11.65675,7 13,8.34325 13,10 C13,11.65675 11.65675,13 10,13 Z M19.843,11.816 C19.945,11.391 20,10.45 20,10 C20,9.55 19.945,8.609 19.843,8.184 L17.649,7.656 C17.499,7.166 17.302,6.695 17.065,6.25 L18.244,4.324 C18.016,3.951 17.39,3.247 17.071,2.929 C16.753,2.61 16.049,1.984 15.676,1.756 L13.75,2.935 C13.305,2.698 12.834,2.501 12.344,2.351 L11.816,0.157 C11.391,0.055 10.45,0 10,0 C9.55,0 8.609,0.055 8.184,0.157 L7.656,2.351 C7.166,2.501 6.695,2.698 6.25,2.935 L4.324,1.756 C3.951,1.984 3.247,2.61 2.929,2.929 C2.61,3.247 1.984,3.951 1.756,4.324 L2.935,6.25 C2.698,6.695 2.501,7.166 2.351,7.656 L0.157,8.184 C0.055,8.609 0,9.55 0,10 C0,10.45 0.055,11.391 0.157,11.816 L2.351,12.344 C2.501,12.834 2.698,13.304 2.935,13.75 L1.756,15.676 C1.984,16.049 2.61,16.753 2.929,17.071 C3.247,17.39 3.951,18.016 4.324,18.244 L6.25,17.065 C6.696,17.302 7.166,17.499 7.656,17.649 L8.184,19.843 C8.609,19.945 9.55,20 10,20 C10.45,20 11.391,19.945 11.816,19.843 L12.344,17.649 C12.834,17.499 13.304,17.302 13.75,17.065 L15.676,18.244 C16.049,18.016 16.753,17.39 17.071,17.071 C17.39,16.753 18.016,16.049 18.244,15.676 L17.065,13.75 C17.302,13.304 17.499,12.834 17.649,12.344 L19.843,11.816 Z",id:"Stroke-1",stroke:"#FFFFFF",strokeWidth:2}));function FD(e,t){var n=e.title,a=e.titleId,i=ND(e,["title","titleId"]);return r.createElement("svg",SD({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,ID,ED)}var LD=r.forwardRef(FD);n.p;function PD(){return(PD=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function DD(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var BD=r.createElement("desc",null,"Created with Sketch."),RD=r.createElement("g",{id:"icon/sf-small/settings/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinejoin:"round"},r.createElement("path",{d:"M10,13 C8.34325,13 7,11.65675 7,10 C7,8.34325 8.34325,7 10,7 C11.65675,7 13,8.34325 13,10 C13,11.65675 11.65675,13 10,13 Z M19.843,11.816 C19.945,11.391 20,10.45 20,10 C20,9.55 19.945,8.609 19.843,8.184 L17.649,7.656 C17.499,7.166 17.302,6.695 17.065,6.25 L18.244,4.324 C18.016,3.951 17.39,3.247 17.071,2.929 C16.753,2.61 16.049,1.984 15.676,1.756 L13.75,2.935 C13.305,2.698 12.834,2.501 12.344,2.351 L11.816,0.157 C11.391,0.055 10.45,0 10,0 C9.55,0 8.609,0.055 8.184,0.157 L7.656,2.351 C7.166,2.501 6.695,2.698 6.25,2.935 L4.324,1.756 C3.951,1.984 3.247,2.61 2.929,2.929 C2.61,3.247 1.984,3.951 1.756,4.324 L2.935,6.25 C2.698,6.695 2.501,7.166 2.351,7.656 L0.157,8.184 C0.055,8.609 0,9.55 0,10 C0,10.45 0.055,11.391 0.157,11.816 L2.351,12.344 C2.501,12.834 2.698,13.304 2.935,13.75 L1.756,15.676 C1.984,16.049 2.61,16.753 2.929,17.071 C3.247,17.39 3.951,18.016 4.324,18.244 L6.25,17.065 C6.696,17.302 7.166,17.499 7.656,17.649 L8.184,19.843 C8.609,19.945 9.55,20 10,20 C10.45,20 11.391,19.945 11.816,19.843 L12.344,17.649 C12.834,17.499 13.304,17.302 13.75,17.065 L15.676,18.244 C16.049,18.016 16.753,17.39 17.071,17.071 C17.39,16.753 18.016,16.049 18.244,15.676 L17.065,13.75 C17.302,13.304 17.499,12.834 17.649,12.344 L19.843,11.816 Z",id:"Stroke-1",stroke:"#1B2559",strokeWidth:2}));function TD(e,t){var n=e.title,a=e.titleId,i=DD(e,["title","titleId"]);return r.createElement("svg",PD({width:"20px",height:"20px",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":a},i),n?r.createElement("title",{id:a},n):null,BD,RD)}var AD,MD,WD,zD,$D,qD,HD,VD,UD,GD,XD,YD,_D,ZD,KD,QD,JD,eB,tB,nB,rB,aB,iB=r.forwardRef(TD),oB=(n.p,n(850)),cB=Object(f.a)({radioLabel:{height:40,padding:[[0,10]]},radio:{padding:4,margin:4},radioGroup:{flexDirection:"row"},error:{color:me},specialLabel:{height:40,padding:0},specialGrid:{display:"grid",gridTemplateColumns:[[182,162,141]]},directionIcon:{marginRight:2},directionName:{marginLeft:6},thresholdWrapper:{display:"flex",flexDirection:"column"},thresholdTitle:{marginTop:50},thresholdContentWrapper:{display:"flex",flexDirection:"row"},thresholdField:{marginRight:6,width:75},description:{marginTop:7},space:{marginLeft:6,marginRight:6},lastSpace:{marginLeft:6},suspensionDays:{width:34},input:{marginTop:-2},limitedInput:{width:50},daysInput:{width:60}}),lB=xn.g().required(),sB=xn.e().shape({threshold:xn.d().nullable().transform(bj).label("Invalid threshold"),thresholdDays:xn.d().transform(bj).nullable().label("Invalid threshold days")}),dB=xn.e().shape({requirement:xn.g().required(),suspensionDays:xn.d().transform(bj).nullable()}),uB=xn.e().shape({triggerType:lB,requirement:dB,threshold:sB}).test((function(e,t){var n=e.threshold,r=e.triggerType;if(!r||!{txAmount:function(e){return e.threshold>=0},txVolume:function(e){return e.threshold>=0&&e.thresholdDays>0},txVelocity:function(e){return e.threshold>0&&e.thresholdDays>0},consecutiveDays:function(e){return e.thresholdDays>0}}[r](n))return t.createError({path:"threshold",message:{txAmount:function(e){return"Amount must be greater than or equal to 0"},txVolume:function(e){var t=[];return e.threshold<0&&t.push("Volume must be greater than or equal to 0"),e.thresholdDays<=0&&t.push("Days must be greater than 0"),t.join(", ")},txVelocity:function(e){var t=[];return e.threshold<=0&&t.push("Transactions must be greater than 0"),e.thresholdDays<=0&&t.push("Days must be greater than 0"),t.join(", ")},consecutiveDays:function(e){return"Days must be greater than 0"}}[r](n)})})).test((function(e,t){var n=e.requirement;if(!n||!function(e){return"suspend"!==e.requirement||e.suspensionDays>0}(n))return t.createError({path:"requirement",message:"Suspension days must be greater than 0"})})),mB=xn.e().shape({triggerType:xn.g().required(),threshold:xn.e({threshold:xn.d().transform(bj).nullable(),thresholdDays:xn.d().transform(bj).nullable()})}).test((function(e,t){var n=e.threshold,r=e.triggerType;if(!r||!{txAmount:function(e){return e.threshold>=0},txVolume:function(e){return e.threshold>=0&&e.thresholdDays>0},txVelocity:function(e){return e.threshold>0&&e.thresholdDays>0},consecutiveDays:function(e){return e.thresholdDays>0}}[r](n))return t.createError({path:"threshold",message:{txAmount:function(e){return"Amount must be greater than or equal to 0"},txVolume:function(e){var t=[];return(!e.threshold||e.threshold<0)&&t.push("Volume must be greater than or equal to 0"),(!e.thresholdDays||e.thresholdDays<=0)&&t.push("Days must be greater than 0"),t.join(", ")},txVelocity:function(e){var t=[];return(!e.threshold||e.threshold<=0)&&t.push("Transactions must be greater than 0"),(!e.thresholdDays||e.thresholdDays<=0)&&t.push("Days must be greater than 0"),t.join(", ")},consecutiveDays:function(e){return"Days must be greater than 0"}}[r](n)})})),hB=[{display:"Transaction amount",code:"txAmount"},{display:"Transaction volume",code:"txVolume"},{display:"Transaction velocity",code:"txVelocity"},{display:"Consecutive days",code:"consecutiveDays"}],bB=function(e){var t,n,r,a,i,o,c=Object.assign({},e),l=cB(),s=Object(pn.e)(),d=s.errors,u=s.touched,m=s.values,h=s.setTouched,b=s.handleChange,p=Object(z.a)({},l.error,d.triggerType&&u.triggerType),f=qo.a(null===m||void 0===m?void 0:m.triggerType),j=f(["txAmount","txVolume"]),g=f(["txVelocity"]),O=f(["txVolume","txVelocity"]),x=f(["consecutiveDays"]),v=!!d.threshold&&!!(null===(t=u.threshold)||void 0===t?void 0:t.threshold)&&!x&&(!(null===(n=m.threshold)||void 0===n?void 0:n.threshold)||(null===(r=m.threshold)||void 0===r?void 0:r.threshold)<0),y=!!d.threshold&&!!(null===(a=u.threshold)||void 0===a?void 0:a.thresholdDays)&&!f(["txAmount"])&&(!(null===(i=m.threshold)||void 0===i?void 0:i.thresholdDays)||(null===(o=m.threshold)||void 0===o?void 0:o.thresholdDays)<0),w=!(!y&&!v),C=Object(z.a)({},l.error,w);return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(No.a,{display:"flex",alignItems:"center",children:Object(Me.jsx)(Ue,{className:E()(p),children:"Choose trigger type"})}),Object(Me.jsx)(pn.b,{component:Ha,name:"triggerType",options:hB,labelClassName:l.radioLabel,radioClassName:l.radio,className:l.radioGroup,onChange:function(e){b(e),h({threshold:!1,thresholdDays:!1})}}),Object(Me.jsxs)("div",{className:l.thresholdWrapper,children:[(j||g||O||x)&&Object(Me.jsx)(Ue,{className:E()(C,l.thresholdTitle),children:"Threshold"}),Object(Me.jsxs)("div",{className:l.thresholdContentWrapper,children:[j&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(pn.b,{className:l.thresholdField,component:qa,size:"lg",name:"threshold.threshold",error:v}),Object(Me.jsx)(Ye,{className:E()(l.description),children:c.currency})]}),g&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(pn.b,{className:l.thresholdField,component:qa,size:"lg",name:"threshold.threshold",error:v}),Object(Me.jsx)(Ye,{className:E()(l.description),children:"transactions"})]}),O&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Ye,{className:E()(p,l.space,l.description),children:"in"}),Object(Me.jsx)(pn.b,{className:l.thresholdField,component:qa,size:"lg",name:"threshold.thresholdDays",error:y}),Object(Me.jsx)(Ye,{className:E()(l.description),children:"days"})]}),x&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(pn.b,{className:l.thresholdField,component:qa,size:"lg",name:"threshold.thresholdDays",error:y}),Object(Me.jsx)(Ye,{className:E()(l.description),children:"consecutive days"})]})]})]})]})},pB=xn.e().shape({requirement:xn.e({requirement:xn.g().required(),suspensionDays:xn.d().when("requirement",{is:function(e){return"suspend"===e},then:xn.d().nullable().transform(bj),otherwise:xn.d().nullable().transform((function(){return null}))})}).required()}).test((function(e,t){var n=e.requirement;if(!n||!function(e){return"suspend"!==e.requirement||e.suspensionDays>0}(n))return t.createError({path:"requirement",message:"Suspension days must be greater than 0"})})),fB=[{display:"SMS verification",code:"sms"},{display:"ID card image",code:"idCardPhoto"},{display:"ID data",code:"idCardData"},{display:"Customer camera",code:"facephoto"},{display:"Sanctions",code:"sanctions"},{display:"US SSN",code:"usSsn"},{display:"Suspend",code:"suspend"},{display:"Block",code:"block"}],jB={schema:pB,options:fB,Component:function(){var e,t,n,r,a=cB(),i=Object(pn.e)(),o=i.touched,c=i.errors,l=i.values,s=i.handleChange,d=i.setTouched,u=!!c.requirement&&!!(null===(e=o.requirement)||void 0===e?void 0:e.suspensionDays)&&(!(null===(t=l.requirement)||void 0===t?void 0:t.suspensionDays)||(null===(n=l.requirement)||void 0===n?void 0:n.suspensionDays)<0),m="suspend"===(null===l||void 0===l||null===(r=l.requirement)||void 0===r?void 0:r.requirement),h=Object(z.a)({},a.error,!!c.requirement&&!m||m&&u);return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(No.a,{display:"flex",alignItems:"center",children:Object(Me.jsx)(Ue,{className:E()(h),children:"Choose a requirement"})}),Object(Me.jsx)(pn.b,{component:Ha,name:"requirement.requirement",options:fB,labelClassName:a.specialLabel,radioClassName:a.radio,className:E()(a.radioGroup,a.specialGrid),onChange:function(e){s(e),d({suspensionDays:!1})}}),m&&Object(Me.jsx)(pn.b,{className:a.thresholdField,component:qa,label:"Days",size:"lg",name:"requirement.suspensionDays",error:u})]})},initialValues:{requirement:{requirement:"",suspensionDays:""}}},gB=function(e,t,n){return function(r){return e?L.a(R.a(t),Ar.a(W.a(null!==n&&void 0!==n?n:"code",r)))(e):""}},OB=function(){var e,t=Object(pn.e)().values,n=cB(),r=null===t||void 0===t||null===(e=t.requirement)||void 0===e?void 0:e.requirement,a="suspend"===r,i=gB(fB,"display")(r);return Object(Me.jsxs)(No.a,{display:"flex",alignItems:"baseline",children:["".concat(i," ").concat(a?"for":""),a&&Object(Me.jsx)(pn.b,{bold:!0,className:n.suspensionDays,name:"requirement.suspensionDays",component:qa,textAlign:"center"}),a&&"days"]})},xB=function(e){var t=e.requirement,n=e.suspensionDays,r=cB(),a=gB(fB,"display")(t),i="suspend"===t;return Object(Me.jsxs)(No.a,{display:"flex",alignItems:"baseline",children:["".concat(a," ").concat(i?"for":""),i&&Object(Me.jsx)(_e,{className:r.space,noMargin:!0,children:n}),i&&"days"]})},vB=function(e){var t,n,r,a=e.config,i=e.currency,o=e.isEdit,c=cB(),l=(t={},Object(z.a)(t,c.input,!0),Object(z.a)(t,c.limitedInput,"txVelocity"===(null===a||void 0===a?void 0:a.triggerType)),Object(z.a)(t,c.daysInput,"consecutiveDays"===(null===a||void 0===a?void 0:a.triggerType)),t),s=null===a||void 0===a||null===(n=a.threshold)||void 0===n?void 0:n.threshold,d=null===a||void 0===a||null===(r=a.threshold)||void 0===r?void 0:r.thresholdDays,u=o?Object(Me.jsx)(pn.b,{bold:!0,className:E()(l),name:"threshold.threshold",component:qa,textAlign:"right"}):Object(Me.jsx)(_e,{noMargin:!0,children:s}),m=o?Object(Me.jsx)(pn.b,{bold:!0,className:E()(l),name:"threshold.thresholdDays",component:qa,textAlign:"right"}):Object(Me.jsx)(_e,{noMargin:!0,children:d});switch(null===a||void 0===a?void 0:a.triggerType){case"txAmount":return Object(Me.jsxs)(No.a,{display:"flex",alignItems:"baseline",justifyContent:"right",children:[u,Object(Me.jsx)(tt,{noMargin:!0,className:c.lastSpace,children:i})]});case"txVolume":return Object(Me.jsxs)(No.a,{display:"flex",alignItems:"baseline",justifyContent:"right",children:[u,Object(Me.jsx)(tt,{noMargin:!0,className:c.lastSpace,children:i}),Object(Me.jsx)(et,{noMargin:!0,className:c.space,children:"in"}),m,Object(Me.jsx)(et,{noMargin:!0,className:c.lastSpace,children:"days"})]});case"txVelocity":return Object(Me.jsxs)(No.a,{display:"flex",alignItems:"baseline",justifyContent:"right",children:[u,Object(Me.jsx)(et,{className:c.space,noMargin:!0,children:"transactions in"}),m,Object(Me.jsx)(et,{className:c.lastSpace,noMargin:!0,children:"days"})]});case"consecutiveDays":return Object(Me.jsxs)(No.a,{display:"flex",alignItems:"baseline",justifyContent:"right",children:[m,Object(Me.jsx)(et,{className:c.lastSpace,noMargin:!0,children:"days"})]});default:return""}},yB=Object(r.memo)((function(e){var t=e.currency,n=Object(pn.e)().values;return Object(Me.jsx)(vB,{isEdit:!0,config:n,currency:t})})),wB=function(e){var t=e.config,n=e.currency;return Object(Me.jsx)(vB,{config:t,currency:n})},CB=function(e,t){return[{name:"triggerType",size:"sm",width:230,input:function(e){var t=e.field.value;return Object(Me.jsx)(Me.Fragment,{children:gB(hB,"display")(t)})},view:gB(hB,"display"),inputProps:{options:hB,valueProp:"code",labelProp:"display",optionsLimit:null}},{name:"requirement",size:"sm",width:230,bypassField:!0,input:OB,view:function(e){return Object(Me.jsx)(xB,Object(s.a)({},e))}},{name:"threshold",size:"sm",width:284,textAlign:"right",input:function(){return Object(Me.jsx)(yB,{currency:e})},view:function(t,n){return Object(Me.jsx)(wB,{config:n,currency:e})}}]},kB=B.a(R.a("code"))(hB),SB=[oB.a((function(e,t){return kB.indexOf(e.triggerType)<kB.indexOf(t.triggerType)}))],NB=function(e){return B.a((function(e){var t=e.requirement,n=e.threshold,r=Object($.a)(e,["requirement","threshold"]);return Object(s.a)({requirement:t.requirement,suspensionDays:t.suspensionDays,threshold:n.threshold,thresholdDays:n.thresholdDays},r)}))(e)},IB={stepper:{margin:[[16,0,14,0]]},submit:{display:"flex",flexDirection:"row",margin:[["auto",0,24]]},button:{marginLeft:"auto"},form:{height:"100%",display:"flex",flexDirection:"column"},infoTitle:{margin:[[18,0,20,0]]},infoCurrentText:{color:q},blankSpace:{padding:[[0,30]],margin:[[0,4,0,2]],borderBottom:"1px solid ".concat(q),display:"inline-block"}},EB=Object(f.a)(IB),FB=function(e,t){switch(e){case 1:return function(e){return{schema:mB,options:hB,Component:bB,props:{currency:e},initialValues:{triggerType:"",threshold:{threshold:"",thresholdDays:""}}}}(t);case 2:return jB;default:return r.Fragment}},LB=function(e,t,n,r){switch(e){case 1:return Object(Me.jsxs)(Me.Fragment,{children:["If the user ",DB(t,n,r)]});case 2:return Object(Me.jsxs)(Me.Fragment,{children:["the user will be ",BB(t,r),"."]});default:return Object(Me.jsx)(Me.Fragment,{})}},PB=function(e,t){var n=Object(Me.jsx)("span",{className:t.blankSpace});return Wr.a(e)||D.a(e)?n:e},DB=function(e,t,n){switch(e.triggerType){case"txAmount":return Object(Me.jsxs)(Me.Fragment,{children:["makes a single transaction over"," ",PB(e.threshold.threshold,n)," ",t]});case"txVolume":return Object(Me.jsxs)(Me.Fragment,{children:["makes more than ",PB(e.threshold.threshold,n)," ",t," worth of transactions within"," ",PB(e.threshold.thresholdDays,n)," ",fu(e.threshold.thresholdDays,"day","days")]});case"txVelocity":return Object(Me.jsxs)(Me.Fragment,{children:["makes more than ",PB(e.threshold.threshold,n)," ",fu(e.threshold.threshold,"transaction","transactions")," ","in ",PB(e.threshold.thresholdDays,n)," ",fu(e.threshold.thresholdDays,"day","days")]});case"consecutiveDays":return Object(Me.jsxs)(Me.Fragment,{children:["at least one transaction every day for"," ",PB(e.threshold.thresholdDays,n)," ",fu(e.threshold.thresholdDays,"day","days")]});default:return Object(Me.jsx)(Me.Fragment,{})}},BB=function(e,t){var n;switch(null===(n=e.requirement)||void 0===n?void 0:n.requirement){case"sms":return Object(Me.jsx)(Me.Fragment,{children:"asked to enter code provided through SMS verification"});case"idCardPhoto":return Object(Me.jsx)(Me.Fragment,{children:"asked to scan a ID with photo"});case"idCardData":return Object(Me.jsx)(Me.Fragment,{children:"asked to scan a ID"});case"facephoto":return Object(Me.jsx)(Me.Fragment,{children:"asked to have a photo taken"});case"usSsn":return Object(Me.jsx)(Me.Fragment,{children:"asked to input his social security number"});case"sanctions":return Object(Me.jsx)(Me.Fragment,{children:"matched against the OFAC sanctions list"});case"superuser":return Object(Me.jsx)(Me.Fragment,{});case"suspend":return Object(Me.jsxs)(Me.Fragment,{children:["suspended for"," ",PB(e.requirement.suspensionDays,t)," ",fu(e.requirement.suspensionDays,"day","days")]});case"block":return Object(Me.jsx)(Me.Fragment,{children:"blocked"});default:return PB(null,t)}},RB=function(e){var t=e.step,n=e.config,r=void 0===n?{}:n,a=e.liveValues,i=void 0===a?{}:a,o=e.currency,c=EB(),l=dO.a(1,t).map((function(e){return LB(e,r,o,c)})),s=LB(t,i,o,c),d=2===t;return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Ge,{className:c.infoTitle,children:"Trigger overview so far"}),Object(Me.jsxs)(Ze,{noMargin:!0,className:c.infoText,children:[l,1!==t&&", ",s,!d&&"..."]})]})},TB=function(e){var t=e.setValues,n=Object(pn.e)().values;return Object(r.useEffect)((function(){t&&n&&t(n)}),[t,n]),null},AB=function(e){var t=e.onClose,n=e.save,a=e.error,i=e.currency,o=EB(),l=Object(r.useState)({}),d=Object(c.a)(l,2),u=d[0],m=d[1],h=Object(r.useState)({step:1}),b=Object(c.a)(h,2),p=b[0],f=p.step,j=p.config,g=b[1],O=2===f,x=FB(f,i),v=function(){var e=Object(nc.a)(tc.a.mark((function e(t){var r;return tc.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=Gn.a(j,x.schema.cast(t)),!O){e.next=3;break}return e.abrupt("return",n(r));case 3:g({step:f+1,config:r});case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),y=function(e,t,n){var r,a,i,o,c,l,s,d,u,m,h=null===n||void 0===n?void 0:n.triggerType,b=qo.a(h),p="suspend"===(null===n||void 0===n||null===(r=n.requirement)||void 0===r?void 0:r.requirement),f=!!e.requirement&&!!(null===(a=t.requirement)||void 0===a?void 0:a.suspensionDays)&&(!(null===(i=n.requirement)||void 0===i?void 0:i.suspensionDays)||(null===(o=n.requirement)||void 0===o?void 0:o.suspensionDays)<0),j=!!e.threshold&&!!(null===(c=t.threshold)||void 0===c?void 0:c.threshold)&&!b(["consecutiveDays"])&&(!(null===(l=n.threshold)||void 0===l?void 0:l.threshold)||(null===(s=n.threshold)||void 0===s?void 0:s.threshold)<0),g=!!e.threshold&&!!(null===(d=t.threshold)||void 0===d?void 0:d.thresholdDays)&&!b(["txAmount"])&&(!(null===(u=n.threshold)||void 0===u?void 0:u.thresholdDays)||(null===(m=n.threshold)||void 0===m?void 0:m.thresholdDays)<0);return b(["txAmount","txVolume","txVelocity"])&&j||b(["txVolume","txVelocity","consecutiveDays"])&&g?e.threshold:p&&f?e.requirement:void 0};return Object(Me.jsx)(Me.Fragment,{children:Object(Me.jsxs)(sO,{title:"New compliance trigger",handleClose:t,width:520,height:520,infoPanel:Object(Me.jsx)(RB,{currency:i,step:f,config:j,liveValues:u}),infoPanelHeight:172,open:!0,children:[Object(Me.jsx)(OO,{className:o.stepper,steps:2,currentStep:f}),Object(Me.jsx)(pn.d,{validateOnBlur:!1,validateOnChange:!0,enableReinitialize:!0,onSubmit:v,initialValues:x.initialValues,validationSchema:x.schema,children:function(e){var t=e.errors,n=e.touched,r=e.values;return Object(Me.jsxs)(pn.c,{className:o.form,children:[Object(Me.jsx)(TB,{setValues:m}),Object(Me.jsx)(x.Component,Object(s.a)({},x.props)),Object(Me.jsxs)("div",{className:o.submit,children:[a&&Object(Me.jsx)(Fo,{children:"Failed to save"}),y(t,n,r)&&Object(Me.jsx)(Fo,{children:y(t,n,r)}),Object(Me.jsx)(An,{className:o.button,type:"submit",children:O?"Finish":"Next"})]})]})}})]})})},MB=[{display:"Sanctions",code:"sanctions"},{display:"ID card image",code:"idCardPhoto"},{display:"ID data",code:"idCardData"},{display:"Customer camera",code:"facephoto"},{display:"US SSN",code:"usSsn"}],WB=xn.e().shape({expirationTime:xn.g().label("Expiration time").required(),automation:xn.g().label("Automation").matches(/(Manual|Automatic)/).required()}),zB=[{expirationTime:"Forever",automation:"Automatic"}],$B={requirement:"",expirationTime:"Forever",automation:"Automatic"},qB=x()(AD||(AD=Object(l.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),HB=x()(MD||(MD=Object(l.a)(["\n query getData {\n config\n }\n"]))),VB=Object(r.memo)((function(){var e,t,n=xl,a=Object(r.useState)(null),i=Object(c.a)(a,2),o=i[0],l=i[1],s=Object(r.useState)(!1),d=Object(c.a)(s,2),m=d[0],h=d[1],b=Object(r.useState)(!1),p=Object(c.a)(b,2),f=p[0],j=p[1],g=Object(u.c)(HB).data,O=Object(u.b)(qB,{refetchQueries:function(){return["getData"]},onError:function(e){return l(e)}}),x=Object(c.a)(O,1)[0],v=(null===g||void 0===g?void 0:g.config)&&Cl(n)(null===g||void 0===g?void 0:g.config),y=v&&!Wr.a(v)?v:zB,w=null!==(e=null===v||void 0===v?void 0:v.overrides)&&void 0!==e?e:[];return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(kj,{children:Object(Me.jsx)(jm,{title:"Default requirement settings",error:null===o||void 0===o?void 0:o.message,titleLg:!0,name:"triggersConfig",enableEdit:!0,initialValues:y,save:function(e){var t=kl(n)(e.triggersConfig[0]);return l(null),x({variables:{config:t}})},validationSchema:WB,data:Qv.a(y),elements:[{name:"expirationTime",header:"Expiration Time",width:196,size:"sm",editable:!1},{name:"automation",header:"Automation",width:196,size:"sm",input:ka,inputProps:{options:[{code:"Automatic",display:"Automatic"},{code:"Manual",display:"Manual"}],labelProp:"display",valueProp:"code"}}],setEditing:function(e,t){return h(t)},forceDisable:f})}),Object(Me.jsx)(kj,{children:Object(Me.jsx)(jm,{error:null===o||void 0===o?void 0:o.message,title:"Overrides",titleLg:!0,name:"overrides",enableDelete:!0,enableEdit:!0,enableCreate:!0,initialValues:$B,save:function(e){var t=kl(n)(e);return l(null),x({variables:{config:t}})},validationSchema:(t=w,xn.e().shape({id:xn.g().label("Requirement").required().test({test:function(){var e,n=this.parent.requirement;return!Ar.a(W.a("requirement",n))(t)||this.createError({message:"Requirement ".concat((e=n,R.a("display",Ar.a(W.a("code",e))(MB)))," already overriden")})}}),expirationTime:xn.g().label("Expiration time").required(),automation:xn.g().label("Automation").matches(/(Manual|Automatic)/).required()})),data:w,elements:[{name:"requirement",header:"Requirement",width:196,size:"sm",view:gB(MB,"display"),input:ka,inputProps:{options:MB,labelProp:"display",valueProp:"code"}},{name:"expirationTime",header:"Expiration Time",width:196,size:"sm",editable:!1},{name:"automation",header:"Automation",width:196,size:"sm",input:ka,inputProps:{options:[{code:"Automatic",display:"Automatic"},{code:"Manual",display:"Manual"}],labelProp:"display",valueProp:"code"}}],setEditing:function(e,t){return j(t)},forceDisable:m})})]})})),UB=Object(f.a)({switchLabel:{margin:6,width:24},tableRadioGroup:{flexDirection:"row",justifyContent:"space-between"},tableRadioLabel:{marginRight:0},tableWidth:{width:918}}),GB=x()(WD||(WD=Object(l.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),XB=x()(zD||(zD=Object(l.a)(["\n query getData {\n config\n }\n"]))),YB=function(){var e,t,n,a=UB(),i=Object(r.useState)(!1),o=Object(c.a)(i,2),l=o[0],d=o[1],m=Object(r.useState)(!1),h=Object(c.a)(m,2),b=h[0],p=h[1],f=Object(u.c)(XB),j=f.data,g=f.loading,O=function(e){return B.a((function(e){var t=e.requirement,n=e.suspensionDays,r=e.threshold,a=e.thresholdDays,i=Object($.a)(e,["requirement","suspensionDays","threshold","thresholdDays"]);return Object(s.a)({requirement:{requirement:t,suspensionDays:n},threshold:{threshold:r,thresholdDays:a}},i)}))(e)}(null!==(e=null===j||void 0===j||null===(t=j.config)||void 0===t?void 0:t.triggers)&&void 0!==e?e:[]),x=(null===j||void 0===j?void 0:j.config)&&Cl("compliance")(j.config),v=null!==(n=null===x||void 0===x?void 0:x.rejectAddressReuse)&&void 0!==n&&n,y=Object(r.useState)(null),w=Object(c.a)(y,2),C=w[0],k=w[1],S=Object(u.b)(GB,{onCompleted:function(){return d(!1)},refetchQueries:function(){return["getData"]},onError:function(e){return k(e)}}),N=Object(c.a)(S,1)[0],I=A.a(["fiatCurrency"])(Cl(pl)(null===j||void 0===j?void 0:j.config));return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Do,{title:"Compliance Triggers",button:{text:"Advanced settings",icon:iB,inverseIcon:LD,toggle:p},className:a.tableWidth,children:!b&&Object(Me.jsx)(No.a,{display:"flex",alignItems:"center",children:Object(Me.jsxs)(No.a,{display:"flex",alignItems:"center",justifyContent:"flex-end",mr:"-5px",children:[Object(Me.jsx)(Xe,{children:"Reject reused addresses"}),Object(Me.jsx)(Ca,{checked:v,onChange:function(e){!function(e){var t=kl("compliance")(e);N({variables:{config:t}})}({rejectAddressReuse:e.target.checked})},value:v}),Object(Me.jsx)(tt,{className:a.switchLabel,children:v?"On":"Off"}),Object(Me.jsx)(Eb,{width:304,children:Object(Me.jsx)(Xe,{children:"This option requires a user to scan a different cryptocurrency address if they attempt to scan one that had been previously used for a transaction in your network"})})]})})}),!b&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(No.a,{marginBottom:2,className:a.tableWidth,display:"flex",justifyContent:"flex-end",children:!g&&!Wr.a(O)&&Object(Me.jsx)(or,{color:"primary",onClick:function(){return d(!0)},children:"+ Add new trigger"})}),Object(Me.jsx)(jm,{data:O,name:"triggers",enableEdit:!0,sortBy:SB,groupBy:"triggerType",enableDelete:!0,error:null===C||void 0===C?void 0:C.message,save:function(e){return k(null),N({variables:{config:{triggers:NB(e.triggers)}}})},validationSchema:uB,elements:CB(I)}),l&&Object(Me.jsx)(AB,{currency:I,error:null===C||void 0===C?void 0:C.message,save:function(e){var t=Mo.a([Object(s.a)({id:Object(qd.a)(),direction:"both"},e)])(O);return N({variables:{config:{triggers:NB(t)}}})},onClose:function(){return d(null)}}),!g&&Wr.a(O)&&Object(Me.jsxs)(No.a,{display:"flex",alignItems:"center",flexDirection:"column",mt:15,children:[Object(Me.jsx)(He,{children:"It seems there are no active compliance triggers on your network"}),Object(Me.jsx)(An,{onClick:function(){return d(!0)},children:"Add first trigger"})]})]}),b&&Object(Me.jsx)(VB,{error:C,save:N,data:j})]})},_B={footer:{display:"flex",flexDirection:"row",margin:[["auto",0,24,0]]},modalTitle:{marginTop:-5,color:J,fontFamily:pe},modalLabel1:{marginTop:20},modalLabel2:{marginTop:40},inputLabel:{color:J,fontFamily:pe,fontSize:24,marginLeft:8,marginTop:15},tableWidth:{width:1132},radioGroup:{flexDirection:"row",width:500},radioLabel:{width:150,height:48},copyToClipboard:{marginLeft:"auto",paddingTop:7,marginRight:-5},chip:{backgroundColor:ae,fontFamily:pe,marginLeft:15,marginTop:-5},actionChip:{backgroundColor:ae,marginRight:15,marginTop:-5},info:{fontFamily:fe,textAlign:"justify"},addressWrapper:{backgroundColor:ae,marginTop:8,height:35},address:{margin:"0px ".concat(16,"px 0px ").concat(16,"px"),paddingRight:-15},errorMessage:{fontFamily:fe,color:me},codeContainer:{marginTop:15,marginBottom:15},form:{display:"flex",flexDirection:"column",height:"100%"},submit:{margin:[["auto",0,0,"auto"]]},error:{color:me},link:{position:"absolute",top:10,left:0,bottom:"-20px",right:"-20px",whiteSpace:"nowrap",overflowX:"auto",width:"92.5%"},linkWrapper:{width:"100%",height:"100%",overflow:"hidden",position:"relative"}},ZB=Object(f.a)(_B),KB=x()($D||($D=Object(l.a)(["\n query confirm2FA($code: String!) {\n confirm2FA(code: $code)\n }\n"]))),QB=function(e){var t=e.showModal,n=e.handleClose,a=e.setConfirmation,i=ZB(),o=Object(r.useState)(""),l=Object(c.a)(o,2),s=l[0],d=l[1],m=Object(r.useState)(!1),h=Object(c.a)(m,2),b=h[0],p=h[1],f=Object(u.a)(KB,{onCompleted:function(e){return e.confirm2FA?(a(s),d(""),void p(!1)):p(!0)}}),j=Object(c.a)(f,2),g=j[0],O=j[1].error,x=function(){return O?"Internal server error":6!==s.length&&b?"The code should have 6 characters!":b?"Code is invalid. Please try again.":null};return t&&Object(Me.jsxs)(sO,{closeOnBackdropClick:!0,width:500,height:350,handleClose:n,open:!0,children:[Object(Me.jsx)(_e,{className:i.modalTitle,children:"Confirm action"}),Object(Me.jsx)(Xe,{className:i.info,children:"To make changes on this user, please confirm this action by entering your two-factor authentication code below."}),Object(Me.jsx)(ha,{name:"2fa",value:s,onChange:function(e){d(e),p(!1)},numInputs:6,error:b,containerStyle:i.codeContainer,shouldAutoFocus:!0}),x()&&Object(Me.jsx)(Xe,{className:i.errorMessage,children:x()}),Object(Me.jsx)("div",{className:i.footer,children:Object(Me.jsx)(An,{className:i.submit,onClick:function(){6===s.length?g({variables:{code:s}}):p(!0)},children:"Confirm"})})]})},JB=x()(qD||(qD=Object(l.a)(["\n mutation changeUserRole(\n $confirmationCode: String\n $id: ID!\n $newRole: String!\n ) {\n changeUserRole(\n confirmationCode: $confirmationCode\n id: $id\n newRole: $newRole\n ) {\n id\n }\n }\n"]))),eR=Object(f.a)(_B),tR=function(e){var t=e.state,n=e.dispatch,a=e.user,i=e.requiresConfirmation,o=eR(),l=Object(u.b)(JB,{onCompleted:function(){return j()},refetchQueries:function(){return["users"]}}),s=Object(c.a)(l,2),d=s[0],m=s[1].error,h=Object(r.useState)(null),b=Object(c.a)(h,2),p=b[0],f=b[1],j=function(){f(null),n({type:"close",payload:"showRoleModal"})};return t.showRoleModal&&i&&!p&&Object(Me.jsx)(QB,{showModal:t.showRoleModal,handleClose:j,setConfirmation:f})||t.showRoleModal&&Object(Me.jsxs)(sO,{closeOnBackdropClick:!0,width:450,height:250,handleClose:j,open:!0,children:[Object(Me.jsxs)(_e,{className:o.modalTitle,children:["Change ",a.username,"'s role?"]}),Object(Me.jsxs)(Xe,{className:o.info,children:["You are about to alter ",a.username,"'s role. This will change this user's permission to access certain resources."]}),Object(Me.jsx)(Xe,{className:o.info,children:"Do you wish to proceed?"}),Object(Me.jsxs)("div",{className:o.footer,children:[m&&Object(Me.jsx)(Fo,{children:m}),Object(Me.jsx)(An,{className:o.submit,onClick:function(){d({variables:{confirmationCode:p,id:a.id,newRole:"superuser"===a.role?"user":"superuser"}})},children:"Confirm"})]})]})},nR=function(e){return"".concat("").concat(e)},rR=Object(f.a)(_B),aR=x()(HD||(HD=Object(l.a)(["\n mutation createRegisterToken($username: String!, $role: String!) {\n createRegisterToken(username: $username, role: $role) {\n token\n expire\n }\n }\n"]))),iR=xn.e().shape({username:xn.g().email("Username field should be in an email format!").required("Username field is required!"),role:xn.g().required("Role field is required!")}),oR={username:"",role:""},cR=[{code:"user",display:"Regular user"},{code:"superuser",display:"Superuser"}],lR=function(e,t,n){return e&&t?n?"Internal server error":e.username&&t.username?e.username:null:null},sR=function(e){var t=e.state,n=e.dispatch,a=rR(),i=Object(r.useState)(""),o=Object(c.a)(i,2),l=o[0],s=o[1],d=Object(r.useState)(null),m=Object(c.a)(d,2),h=m[0],b=m[1],p=function(){b(null),n({type:"close",payload:"showCreateUserModal"})},f=Object(u.b)(aR,{onCompleted:function(e){var t=e.createRegisterToken,n="t=".concat(t.token);b(nR("/register?".concat(n)))}}),j=Object(c.a)(f,2),g=j[0],O=j[1].error;return Object(Me.jsxs)(Me.Fragment,{children:[t.showCreateUserModal&&!h&&Object(Me.jsx)(sO,{closeOnBackdropClick:!0,width:600,height:400,handleClose:p,open:!0,children:Object(Me.jsx)(pn.d,{validationSchema:iR,initialValues:oR,onSubmit:function(e){s(e.username),g({variables:{username:e.username,role:e.role}})},children:function(e){var t,n,r=e.errors,i=e.touched;return Object(Me.jsxs)(pn.c,{id:"register-user-form",className:a.form,children:[Object(Me.jsx)(qe,{className:a.modalTitle,children:"Create new user"}),Object(Me.jsx)(pn.b,{component:Ua,name:"username",width:338,autoFocus:!0,label:"User login"}),Object(Me.jsx)(Ve,{className:E()((t=r,n=i,Object(z.a)({},a.error,t.role&&n.role)),a.modalLabel2),children:"Role"}),Object(Me.jsx)(pn.b,{component:Ha,name:"role",labelClassName:a.radioLabel,className:a.radioGroup,options:cR}),Object(Me.jsxs)("div",{className:a.footer,children:[lR(r,i,O)&&Object(Me.jsx)(Fo,{children:lR(r,i,O)}),Object(Me.jsx)(An,{type:"submit",form:"register-user-form",className:a.submit,children:"Finish"})]})]})}})}),t.showCreateUserModal&&h&&Object(Me.jsxs)(sO,{closeOnBackdropClick:!0,width:500,height:200,handleClose:p,open:!0,children:[Object(Me.jsxs)(_e,{className:a.modalTitle,children:["Creating ",l,"..."]}),Object(Me.jsxs)(Xe,{className:a.info,children:["Safely share this link with ",l," to finish the registration process."]}),Object(Me.jsx)("div",{className:a.addressWrapper,children:Object(Me.jsx)(Ke,{className:a.address,children:Object(Me.jsx)("strong",{children:Object(Me.jsx)(sb,{className:a.link,buttonClassname:a.copyToClipboard,wrapperClassname:a.linkWrapper,children:h})})})})]})]})},dR=x()(VD||(VD=Object(l.a)(["\n mutation enableUser($confirmationCode: String, $id: ID!) {\n enableUser(confirmationCode: $confirmationCode, id: $id) {\n id\n }\n }\n"]))),uR=x()(UD||(UD=Object(l.a)(["\n mutation disableUser($confirmationCode: String, $id: ID!) {\n disableUser(confirmationCode: $confirmationCode, id: $id) {\n id\n }\n }\n"]))),mR=Object(f.a)(_B),hR=function(e){var t=e.state,n=e.dispatch,a=e.user,i=e.requiresConfirmation,o=mR(),l=Object(u.b)(dR,{onCompleted:function(){return y()},refetchQueries:function(){return["users"]}}),s=Object(c.a)(l,2),d=s[0],m=s[1].error,h=Object(u.b)(uR,{onCompleted:function(){return y()},refetchQueries:function(){return["users"]}}),b=Object(c.a)(h,2),p=b[0],f=b[1].error,j=Object(r.useState)(null),g=Object(c.a)(j,2),O=g[0],x=g[1],v=function(){(null===a||void 0===a?void 0:a.enabled)?p({variables:{confirmationCode:O,id:a.id}}):d({variables:{confirmationCode:O,id:a.id}})},y=function(){x(null),n({type:"close",payload:"showEnableUserModal"})};return t.showEnableUserModal&&i&&!O&&Object(Me.jsx)(QB,{showModal:t.showEnableUserModal,handleClose:y,setConfirmation:x})||t.showEnableUserModal&&Object(Me.jsxs)(sO,{closeOnBackdropClick:!0,width:450,height:275,handleClose:y,open:!0,children:[!a.enabled&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)(_e,{className:o.modalTitle,children:["Enable ",a.username,"?"]}),Object(Me.jsxs)(Xe,{className:o.info,children:["You are about to enable ",a.username," into the system, activating previous eligible sessions and grant permissions to access the system."]}),Object(Me.jsx)(Xe,{className:o.info,children:"Do you wish to proceed?"})]}),a.enabled&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)(_e,{className:o.modalTitle,children:["Disable ",a.username,"?"]}),Object(Me.jsxs)(Xe,{className:o.info,children:["You are about to disable ",a.username," from the system, deactivating previous eligible sessions and removing permissions to access the system."]}),Object(Me.jsx)(Xe,{className:o.info,children:"Do you wish to proceed?"})]}),Object(Me.jsxs)("div",{className:o.footer,children:[f&&Object(Me.jsx)(Fo,{children:f}),m&&Object(Me.jsx)(Fo,{children:m}),Object(Me.jsx)(An,{className:o.submit,onClick:function(){return v()},children:"Confirm"})]})]})},bR=x()(GD||(GD=Object(l.a)(["\n mutation createReset2FAToken($confirmationCode: String, $userID: ID!) {\n createReset2FAToken(confirmationCode: $confirmationCode, userID: $userID) {\n token\n user_id\n expire\n }\n }\n"]))),pR=Object(f.a)(_B),fR=function(e){var t=e.state,n=e.dispatch,a=e.user,i=e.requiresConfirmation,o=pR(),l=Object(r.useState)(""),s=Object(c.a)(l,2),d=s[0],m=s[1],h=Object(u.b)(bR,{onCompleted:function(e){var t=e.createReset2FAToken;m(nR("/reset2fa?t=".concat(t.token)))}}),b=Object(c.a)(h,2),p=b[0],f=b[1],j=f.loading,g=f.error,O=Object(r.useState)(null),x=Object(c.a)(O,2),v=x[0],y=x[1];Object(r.useEffect)((function(){t.showReset2FAModal&&(v||!i)&&p({variables:{confirmationCode:v,userID:null===a||void 0===a?void 0:a.id}})}),[v,p,i,t.showReset2FAModal,null===a||void 0===a?void 0:a.id]);var w=function(){y(null),n({type:"close",payload:"showReset2FAModal"})};return t.showReset2FAModal&&i&&!v&&Object(Me.jsx)(QB,{showModal:t.showReset2FAModal,handleClose:w,setConfirmation:y})||t.showReset2FAModal&&(v||!i)&&!j&&Object(Me.jsxs)(sO,{closeOnBackdropClick:!0,width:500,height:200,handleClose:w,open:!0,children:[Object(Me.jsxs)(_e,{className:o.modalTitle,children:["Reset 2FA for ",a.username]}),Object(Me.jsxs)(Xe,{className:o.info,children:["Safely share this link with ",a.username," for a two-factor authentication reset."]}),!g&&Object(Me.jsx)("div",{className:o.addressWrapper,children:Object(Me.jsx)(Ke,{className:o.address,children:Object(Me.jsx)("strong",{children:Object(Me.jsx)(sb,{className:o.link,buttonClassname:o.copyToClipboard,wrapperClassname:o.linkWrapper,children:d})})})}),g&&Object(Me.jsx)(Fo,{children:g})]})},jR=x()(XD||(XD=Object(l.a)(["\n mutation createResetPasswordToken($confirmationCode: String, $userID: ID!) {\n createResetPasswordToken(\n confirmationCode: $confirmationCode\n userID: $userID\n ) {\n token\n user_id\n expire\n }\n }\n"]))),gR=Object(f.a)(_B),OR=function(e){var t=e.state,n=e.dispatch,a=e.user,i=e.requiresConfirmation,o=gR(),l=Object(r.useState)(""),s=Object(c.a)(l,2),d=s[0],m=s[1],h=Object(u.b)(jR,{onCompleted:function(e){var t=e.createResetPasswordToken;m(nR("/resetpassword?t=".concat(t.token)))}}),b=Object(c.a)(h,2),p=b[0],f=b[1],j=f.loading,g=f.error,O=Object(r.useState)(null),x=Object(c.a)(O,2),v=x[0],y=x[1];Object(r.useEffect)((function(){t.showResetPasswordModal&&(v||!i)&&p({variables:{confirmationCode:v,userID:null===a||void 0===a?void 0:a.id}})}),[v,p,i,t.showResetPasswordModal,null===a||void 0===a?void 0:a.id]);var w=function(){y(null),n({type:"close",payload:"showResetPasswordModal"})};return t.showResetPasswordModal&&i&&!v&&Object(Me.jsx)(QB,{showModal:t.showResetPasswordModal,handleClose:w,setConfirmation:y})||t.showResetPasswordModal&&(v||!i)&&!j&&Object(Me.jsxs)(sO,{closeOnBackdropClick:!0,width:500,height:180,handleClose:w,open:!0,children:[Object(Me.jsxs)(_e,{className:o.modalTitle,children:["Reset password for ",a.username]}),Object(Me.jsxs)(Xe,{className:o.info,children:["Safely share this link with ",a.username," for a password reset."]}),!g&&Object(Me.jsx)("div",{className:o.addressWrapper,children:Object(Me.jsx)(Ke,{className:o.address,children:Object(Me.jsx)("strong",{children:Object(Me.jsx)(sb,{className:o.link,buttonClassname:o.copyToClipboard,wrapperClassname:o.linkWrapper,children:d})})})}),g&&Object(Me.jsx)(Fo,{children:g})]})},xR=Object(f.a)(_B),vR=x()(YD||(YD=Object(l.a)(["\n query users {\n users {\n id\n username\n role\n enabled\n last_accessed\n last_accessed_from\n last_accessed_address\n }\n }\n"]))),yR={showCreateUserModal:!1,showResetPasswordModal:!1,showReset2FAModal:!1,showRoleModal:!1,showEnableUserModal:!1},wR=function(e,t){var n=t.type,r=t.payload;switch(n){case"close":return yR;case"open":return Object(s.a)(Object(s.a)({},yR),{},Object(z.a)({},r,!0));default:return yR}},CR=function(){var e=xR(),t=Object(r.useContext)(k).userData,n=Object(u.c)(vR).data,a=Object(r.useReducer)(wR,yR),i=Object(c.a)(a,2),o=i[0],l=i[1],s=Object(r.useState)(null),d=Object(c.a)(s,2),m=d[0],h=d[1],b=[{header:"Login",width:257,textAlign:"left",size:"sm",view:function(n){return t.id===n.id?Object(Me.jsxs)(Me.Fragment,{children:[n.username,Object(Me.jsx)(Sa.a,{size:"small",label:"You",className:e.chip})]}):n.username}},{header:"Role",width:105,textAlign:"center",size:"sm",view:function(e){switch(e.role){case"user":return"Regular";case"superuser":return"Superuser";default:return e.role}}},{header:"",width:80,textAlign:"center",size:"sm",view:function(e){return Object(Me.jsx)(Ca,{disabled:t.id===e.id,checked:"superuser"===e.role,onClick:function(){h(e),l({type:"open",payload:"showRoleModal"})},value:"superuser"===e.role})}},{header:"",width:25,textAlign:"center",size:"sm",view:function(e){}},{header:"Actions",width:565,textAlign:"left",size:"sm",view:function(t){return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Sa.a,{size:"small",label:"Reset password",className:e.actionChip,onClick:function(){h(t),l({type:"open",payload:"showResetPasswordModal"})}}),Object(Me.jsx)(Sa.a,{size:"small",label:"Reset 2FA",className:e.actionChip,onClick:function(){h(t),l({type:"open",payload:"showReset2FAModal"})}})]})}},{header:"Enabled",width:100,textAlign:"center",size:"sm",view:function(e){return Object(Me.jsx)(Ca,{disabled:t.id===e.id,checked:e.enabled,onClick:function(){h(e),l({type:"open",payload:"showEnableUserModal"})},value:e.enabled})}}];return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(Do,{title:"User Management"}),Object(Me.jsx)(No.a,{marginBottom:3,marginTop:-5,className:e.tableWidth,display:"flex",justifyContent:"flex-end",children:Object(Me.jsx)(or,{color:"primary",onClick:function(){l({type:"open",payload:"showCreateUserModal"})},children:"Add new user"})}),Object(Me.jsx)(iv,{elements:b,data:A.a(["users"])(n)}),Object(Me.jsx)(sR,{state:o,dispatch:l}),Object(Me.jsx)(OR,{state:o,dispatch:l,user:m,requiresConfirmation:"superuser"===(null===m||void 0===m?void 0:m.role)}),Object(Me.jsx)(fR,{state:o,dispatch:l,user:m,requiresConfirmation:"superuser"===(null===m||void 0===m?void 0:m.role)}),Object(Me.jsx)(tR,{state:o,dispatch:l,user:m,requiresConfirmation:"superuser"===(null===m||void 0===m?void 0:m.role)}),Object(Me.jsx)(hR,{state:o,dispatch:l,user:m,requiresConfirmation:"superuser"===(null===m||void 0===m?void 0:m.role)})]})},kR=x()(_D||(_D=Object(l.a)(["\n mutation Save($config: JSONObject, $accounts: JSONObject) {\n saveConfig(config: $config)\n saveAccounts(accounts: $accounts)\n }\n"]))),SR=x()(ZD||(ZD=Object(l.a)(["\n query getData {\n config\n accounts\n cryptoCurrencies {\n code\n display\n }\n }\n"]))),NR=function(){var e,t=ml,n=Object(u.c)(SR).data,r=Object(u.b)(kR,{refetchQueries:function(){return["getData"]}}),a=Object(c.a)(r,2),i=a[0],o=a[1].error,l=(null===n||void 0===n?void 0:n.config)&&Cl(t)(n.config),s=null!==(e=null===n||void 0===n?void 0:n.cryptoCurrencies)&&void 0!==e?e:[];return Object(Me.jsx)(gm,{name:"advancedWallet",namespaces:B.a(A.a(["code"]))(s),data:l,error:null===o||void 0===o?void 0:o.message,enableEdit:!0,editWidth:174,save:function(e,n){var r=kl(t)(e);return i({variables:{config:r,accounts:n}})},validationSchema:Oj,elements:xj(s,hb.utils)})},IR={header:{display:"flex",alignItems:"center",justifyContent:"space-between"},feeDiscountLabel:{color:se,margin:[[13,0,-5,20]]},selection:{marginRight:12}},ER=x()(KD||(KD=Object(l.a)(["\n mutation Save($config: JSONObject, $accounts: JSONObject) {\n saveConfig(config: $config)\n saveAccounts(accounts: $accounts)\n }\n"]))),FR=x()(QD||(QD=Object(l.a)(["\n mutation Save($accounts: JSONObject) {\n saveAccounts(accounts: $accounts)\n }\n"]))),LR=x()(JD||(JD=Object(l.a)(["\n query getData {\n config\n accounts\n accountsConfig {\n code\n display\n class\n cryptos\n deprecated\n }\n cryptoCurrencies {\n code\n display\n }\n }\n"]))),PR=Object(f.a)(IR),DR=function(e){var t,n,a,i=e.name,o=PR(),l=Object(r.useState)(null),s=Object(c.a)(l,2),d=s[0],m=s[1],h=Object(r.useState)(null),b=Object(c.a)(h,2),p=b[0],f=b[1],j=Object(r.useState)(null),g=Object(c.a)(j,2),O=g[0],x=g[1],v=Object(r.useState)(null),y=Object(c.a)(v,2),w=y[0],C=y[1],k=Object(r.useState)(!1),S=Object(c.a)(k,2),N=S[0],I=S[1],E=Object(r.useState)(!1),F=Object(c.a)(E,2),L=F[0],P=F[1],D=Object(u.c)(LR).data,R=Object(u.b)(ER,{onCompleted:function(){return I(!1)},refetchQueries:function(){return["getData"]}}),T=Object(c.a)(R,2),M=T[0],$=T[1].error,q=Object(u.b)(FR,{onCompleted:function(){return x(null)},refetchQueries:function(){return["getData"]}}),H=Object(c.a)(q,1)[0],V=function(e,t){var n=kl(i)(e);return M({variables:{config:n,accounts:t}})},U=(null===D||void 0===D?void 0:D.config)&&Cl("locale")(D.config).fiatCurrency,G=(null===D||void 0===D?void 0:D.config)&&Cl(i)(D.config),X=null===D||void 0===D?void 0:D.accountsConfig,Y=null!==(t=null===D||void 0===D?void 0:D.cryptoCurrencies)&&void 0!==t?t:[],_=null!==(n=null===D||void 0===D?void 0:D.accounts)&&void 0!==n?n:[];return Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsxs)("div",{className:o.header,children:[Object(Me.jsx)(Do,{title:"Wallet Settings",button:{text:"Advanced settings",icon:iB,inverseIcon:LD,toggle:P}}),Object(Me.jsxs)(No.a,{alignItems:"center",justifyContent:"end",children:[Object(Me.jsx)(et,{className:o.feeDiscountLabel,children:"Fee discount"}),Object(Me.jsxs)(No.a,{display:"flex",alignItems:"center",justifyContent:"end",mr:"-4px",children:[Object(Me.jsx)(Xe,{className:o.selection,children:p}),Object(Me.jsx)(tr,{onClick:function(){return m(!0)},children:Object(Me.jsx)(lm,{})})]})]})]}),!L&&Object(Me.jsxs)(Me.Fragment,{children:[Object(Me.jsx)(gm,{name:"test",namespaces:B.a(A.a(["code"]))(Y),data:G,error:null===$||void 0===$?void 0:$.message,stripeWhen:function(e){return!gj.isValidSync(e)},enableEdit:!0,shouldOverrideEdit:function(e){var t=Cl(e)(G);return!gj.isValidSync(t)},editOverride:I,editWidth:174,save:V,validationSchema:gj,elements:vj(Y,X,(function(e,t,n){return t?!_[t]&&Sg[t]?(x(Sg[t]),void C((function(){return function(){return n(t)}}))):void n(t):n(t)}))}),N&&Object(Me.jsx)(CI,{coin:Ar.a(W.a("code",N))(Y),onClose:function(){return I(!1)},save:V,error:null===$||void 0===$?void 0:$.message,cryptoCurrencies:Y,fiatCurrency:U,userAccounts:null===D||void 0===D||null===(a=D.config)||void 0===a?void 0:a.accounts,accounts:_,accountsConfig:X}),O&&Object(Me.jsx)(sO,{title:"Edit ".concat(O.name),width:478,handleClose:function(){return x(null)},open:!0,children:Object(Me.jsx)(Hj,{save:function(e){return H({variables:{accounts:Object(z.a)({},O.code,e)}}).then((function(e){return w(),C(null),e}))},elements:O.elements,validationSchema:O.validationSchema,value:_[O.code]})})]}),L&&Object(Me.jsx)(NR,{}),d&&Object(Me.jsxs)(sO,{title:"Fee discount for BTC",width:478,handleClose:function(){return m(null)},open:!0,children:[Object(Me.jsx)(Xe,{children:"Set a priority level for your outgoing BTC transactions, selecting a percentage off of the fee estimate your wallet uses."}),Object(Me.jsx)(xa,{name:"set-automatic-reset",value:p,options:[{display:"+20%",code:"1.2"},{display:"Default",code:"1"},{display:"-20%",code:"0.8"},{display:"-40%",code:"0.6"},{display:"-60%",code:"0.4"}],onChange:function(e){var t=A.a(["target","value"])(e);f(t)}}),Object(Me.jsx)(Ou.a,{children:Object(Me.jsx)(An,{onClick:function(){return function(e){var t=kl(i)(e);return m(!1),M({variables:{config:t}})}({BTC_feeMultiplier:p})},children:"Confirm"})})]})]})},BR=function(){return[{key:"transactions",label:"Transactions",route:"/transactions",allowedRoles:[EO,FO],component:kD},{key:"maintenance",label:"Maintenance",route:"/maintenance",allowedRoles:[EO,FO],get component(){var e=this;return function(){return Object(Me.jsx)(w.b,{to:e.children[0].route})}},children:[{key:"cash_cassettes",label:"Cash Cassettes",route:"/maintenance/cash-cassettes",allowedRoles:[EO,FO],component:AF},{key:"funding",label:"Funding",route:"/maintenance/funding",allowedRoles:[EO,FO],component:pN},{key:"logs",label:"Machine Logs",route:"/maintenance/logs",allowedRoles:[EO,FO],component:GE},{key:"machine-status",label:"Machine Status",route:"/maintenance/machine-status",allowedRoles:[EO,FO],component:sL},{key:"server-logs",label:"Server",route:"/maintenance/server-logs",allowedRoles:[EO,FO],component:aD}]},{key:"analytics",label:"Analytics",route:"/analytics",allowedRoles:[EO,FO],component:Cx},{key:"settings",label:"Settings",route:"/settings",allowedRoles:[EO,FO],get component(){var e=this;return function(){return Object(Me.jsx)(w.b,{to:e.children[0].route})}},children:[{key:fl,label:"Commissions",route:"/settings/commissions",allowedRoles:[EO,FO],component:uy},{key:pl,label:"Locales",route:"/settings/locale",allowedRoles:[EO,FO],component:EI},{key:ul,label:"Cash-out",route:"/settings/cash-out",allowedRoles:[EO,FO],component:Fv},{key:bl,label:"Notifications",route:"/settings/notifications",allowedRoles:[EO,FO],component:$L},{key:"services",label:"3rd party services",route:"/settings/3rd-party-services",allowedRoles:[EO,FO],component:bD},{key:ml,label:"Wallet",route:"/settings/wallet-settings",allowedRoles:[EO,FO],component:DR},{key:hl,label:"Operator Info",route:"/settings/operator-info",title:"Operator Information",allowedRoles:[EO,FO],get component(){var e=this;return function(){var t;return Object(Me.jsx)(w.b,{to:{pathname:e.children[0].route,state:{prev:null===(t=e.state)||void 0===t?void 0:t.prev}}})}},children:[{key:"contact-info",label:"Contact information",route:"/settings/operator-info/contact-info",allowedRoles:[EO,FO],component:BP},{key:"receipt-printing",label:"Receipt",route:"/settings/operator-info/receipt-printing",allowedRoles:[EO,FO],component:MP},{key:"coin-atm-radar",label:"Coin ATM Radar",route:"/settings/operator-info/coin-atm-radar",allowedRoles:[EO,FO],component:NP},{key:"terms-conditions",label:"Terms & Conditions",route:"/settings/operator-info/terms-conditions",allowedRoles:[EO,FO],component:VP}]}]},{key:"compliance",label:"Compliance",route:"/compliance",allowedRoles:[EO,FO],get component(){var e=this;return function(){return Object(Me.jsx)(w.b,{to:e.children[0].route})}},children:[{key:"triggers",label:"Triggers",route:"/compliance/triggers",allowedRoles:[EO,FO],component:YB},{key:"customers",label:"Customers",route:"/compliance/customers",allowedRoles:[EO,FO],component:JS},{key:"blacklist",label:"Blacklist",route:"/compliance/blacklist",allowedRoles:[EO,FO],component:pv},{key:"loyalty",label:"Loyalty",route:"/compliance/loyalty",title:"Loyalty Panel",allowedRoles:[EO,FO],get component(){var e=this;return function(){var t;return Object(Me.jsx)(w.b,{to:{pathname:e.children[0].route,state:{prev:null===(t=e.state)||void 0===t?void 0:t.prev}}})}},children:[{key:"individual-discounts",label:"Individual Discounts",route:"/compliance/loyalty/individual-discounts",allowedRoles:[EO,FO],component:$I},{key:"promo-codes",label:"Promo Codes",route:"/compliance/loyalty/codes",allowedRoles:[EO,FO],component:QI}]},{key:"customer",route:"/compliance/customer/:id",allowedRoles:[EO,FO],component:OS}]},{key:"system",label:"System",route:"/system",allowedRoles:[FO],get component(){var e=this;return function(){return Object(Me.jsx)(w.b,{to:e.children[0].route})}},children:[{key:"user-management",label:"User Management",route:"/system/user-management",allowedRoles:[FO],component:CR},{key:"session-management",label:"Session Management",route:"/system/session-management",allowedRoles:[FO],component:OD}]}]},RR=function(e){e.numberOfChips;return{totalAssetWrapper:{display:"flex",flexDirection:"row"},totalAssetFieldWrapper:{display:"flex",flexDirection:"column"},fieldHeader:{color:se,marginBottom:5},fieldValue:{fontSize:36},fieldCurrency:{fontSize:20,alignSelf:"flex-end",margin:[[0,0,5,5]]},separator:{fontSize:32,alignSelf:"center",margin:[[25,20,0,20]]},walletChipList:{display:"flex",flexDirection:"row",flexWrap:"wrap"},walletChipWrapper:{flexGrow:0,flexShrink:0,flexBasis:"16.66667%","&:nth-child(6n+1)":{"& > div":{margin:[[0,10,0,0]]}},"&:nth-child(6n)":{"& > div":{margin:[[0,0,0,10]]}},margin:[[10,0]]},walletChip:{height:200,margin:[[0,10]]},walletHeader:{display:"flex",flexDirection:"row",justifyContent:"space-between",height:50},logo:{transform:"scale(0.4, 0.4)",height:80,maxWidth:110,margin:[[-14,0,0,-26]]},zecLogo:{margin:[[-15,0,0,-10]]},bchLogo:{margin:[[-12,0,0,-18]]},hedgedText:{color:se,margin:[[13,12,0,0]]},walletValueWrapper:{display:"flex",flexDirection:"column",margin:[[0,0,0,15]]},walletValue:{fontSize:18,margin:[[0,0,10,0]]},walletChipTitle:{marginTop:50}}},TR=(Object(f.a)(RR),x()(eB||(eB=Object(l.a)(["\n query operatorByUsername($username: String) {\n operatorByUsername(username: $username) {\n id\n entityId\n name\n fiatBalances\n cryptoBalances\n machines\n joined\n assetValue\n preferredFiatCurrency\n contactInfo {\n name\n email\n }\n fundings {\n id\n origin\n destination\n fiatAmount\n fiatBalanceAfter\n fiatCurrency\n created\n status\n description\n }\n }\n }\n"]))),function(){return{totalAssetWrapper:{display:"flex",flexDirection:"row"},totalAssetFieldWrapper:{display:"flex",flexDirection:"column"},fieldHeader:{color:se,marginBottom:5},fieldValue:{fontSize:36},fieldCurrency:{fontSize:20,alignSelf:"flex-end",margin:[[0,0,5,5]]},separator:{fontSize:32,alignSelf:"center",margin:[[25,20,0,20]]},tableTitle:{marginTop:35},operation:{display:"flex",flexDirection:"row",alignItems:"center"}}}),AR=(Object(f.a)(TR),x()(tB||(tB=Object(l.a)(["\n query operatorByUsername($username: String) {\n operatorByUsername(username: $username) {\n id\n entityId\n name\n fiatBalances\n cryptoBalances\n machines\n joined\n assetValue\n preferredFiatCurrency\n contactInfo {\n name\n email\n }\n fundings {\n id\n origin\n destination\n fiatAmount\n fiatBalanceAfter\n fiatCurrency\n created\n status\n description\n }\n }\n }\n"]))),function(){return{card:{wordWrap:"break-word",boxShadow:"0 0 4px 0 rgba(0, 0, 0, 0.08)",borderRadius:12,padding:24,backgroundColor:Z},h4:{marginTop:0},label:{margin:0,color:se},asset:{float:"left"},amount:{float:"right"},row:{backgroundColor:re,borderBottom:"none"},totalRow:{backgroundColor:ae,borderBottom:"none"},leftSide:{margin:[[0,10,20,0]]},rightSide:{margin:[[0,0,0,10]]}}}),MR=(Object(f.a)(AR),x()(nB||(nB=Object(l.a)(["\n query operatorByUsername($username: String) {\n operatorByUsername(username: $username) {\n id\n entityId\n name\n fiatBalances\n cryptoBalances\n machines\n joined\n assetValue\n preferredFiatCurrency\n contactInfo {\n name\n email\n }\n fundings {\n id\n origin\n destination\n fiatAmount\n fiatBalanceAfter\n fiatCurrency\n created\n status\n description\n }\n }\n }\n"]))),{borderBottom:"4px solid white",padding:0,paddingLeft:20,paddingRight:20}),WR=(Object(Na.a)({root:MR})(ad.a),Object(Na.a)({root:Object(s.a)(Object(s.a)({},MR),{},{backgroundColor:"white"})})(ad.a),Object(f.a)({wrapper:{flex:1,display:"flex",flexDirection:"column",height:"100%"}})),zR=BR(),$R=B.a(Ro.a(To.a("children"),R.a("children"))),qR=L.a(Ao.a,$R)(zR),HR=M.a(To.a("children"))(qR).concat(M.a(To.a("children"))(zR)),VR=L.a(Ao.a,$R)(qR),UR=Mo.a(VR,HR),GR=function(){var e=WR(),t=Object(w.h)(),n=Object(w.i)(),a=Object(r.useContext)(k),i=a.wizardTested,o=a.userData;if(!i&&!qo.a(n.pathname)(["/404","/register","/wizard","/login","/register","/resetpassword","/reset2fa"]))return t.push("/wizard"),null;var c=n.state?b.a:Bo.a,l=c===b.a?{direction:Ho.a(W.a("route",n.state.prev))(VR)>Ho.a(W.a("route",n.pathname))(VR)?"right":"left"}:{timeout:400};return Object(Me.jsxs)(w.e,{children:[Object(Me.jsx)(LO,{exact:!0,path:"/",children:Object(Me.jsx)(w.b,{to:{pathname:"/dashboard"}})}),Object(Me.jsx)(LO,{path:"/dashboard",children:Object(Me.jsx)(c,Object(s.a)(Object(s.a)({className:e.wrapper},l),{},{in:!0,mountOnEnter:!0,unmountOnExit:!0,children:Object(Me.jsx)("div",{className:e.wrapper,children:Object(Me.jsx)(Pd,{})})}))}),Object(Me.jsx)(LO,{path:"/machines",component:vf}),Object(Me.jsx)(LO,{path:"/wizard",component:NO}),Object(Me.jsx)(PO,{path:"/register",component:Ec}),Object(Me.jsx)(PO,{path:"/login",restricted:!0,component:Oc}),Object(Me.jsx)(PO,{path:"/resetpassword",component:qc}),Object(Me.jsx)(PO,{path:"/reset2fa",component:Rc}),(o?UR.filter((function(e){var t=e.allowedRoles;return F.a(o.role,t)})):[]).map((function(t){var r=t.route,a=t.component,i=t.key;return Object(Me.jsx)(LO,{path:r,children:Object(Me.jsx)(c,Object(s.a)(Object(s.a)({className:e.wrapper},l),{},{in:!!Object(w.g)(n.pathname,{path:r}),mountOnEnter:!0,unmountOnExit:!0,children:Object(Me.jsx)("div",{className:e.wrapper,children:Object(Me.jsx)(LO,{path:r,children:Object(Me.jsx)(a,{name:i})},i)})}))},i)})),Object(Me.jsx)(PO,{path:"/404"}),Object(Me.jsx)(PO,{path:"*",children:Object(Me.jsx)(w.b,{to:{pathname:"/404"}})})]})},XR="100%",YR={"@global":Object(s.a)(Object(s.a)({},{"@font-face":[{fontFamily:"Mont",src:['url("/fonts/MontHeavy/mont-heavy-webfont.woff2") format("woff2")','url("/fonts/MontHeavy/mont-heavy-webfont.woff") format("woff")'],fontWeight:900,fontStyle:"normal"},{fontFamily:"Mont",src:['url("/fonts/MontHeavy/mont-bold-webfont.woff2") format("woff2")','url("/fonts/MontHeavy/mont-bold-webfont.woff") format("woff")'],fontWeight:700,fontStyle:"normal"},{fontFamily:"MuseoSans",src:['url("/fonts/MuseoSans/MuseoSans_500-webfont.woff2") format("woff2")','url("/fonts/MuseoSans/MuseoSans_500-webfont.woff") format("woff")'],fontWeight:500,fontStyle:"normal"},{fontFamily:"MuseoSans",src:['url("/fonts/MuseoSans/MuseoSans_700-webfont.woff2") format("woff2")','url("/fonts/MuseoSans/MuseoSans_700-webfont.woff") format("woff")'],fontWeight:700,fontStyle:"normal"},{fontFamily:"BPmono",src:'url("/fonts/BPmono/BPmono.ttf") format("truetype")',fontWeight:500,fontStyle:"normal"}]}),{},(rB={"#root":{width:XR,minHeight:XR},".root-notifcenter-open":{overflowY:"auto",position:"absolute",top:0,bottom:0,left:0},".body-notifcenter-open":{overflow:"hidden"},html:{height:XR},body:{width:he,display:"flex",minHeight:XR,"@media screen and (min-width: 1200px)":{width:"auto"}}},Object(z.a)(rB,'a::-moz-focus-inner,\n \'input[type="submit"]::-moz-focus-inner,\n input[type="button"]::-moz-focus-inner',{border:0}),Object(z.a)(rB,'a::-moz-focus-inner,\n input[type="submit"]::-moz-focus-inner,\n input[type="button"]::-moz-focus-inner',{border:0}),Object(z.a)(rB,"a,\n a:visited,\n a:focus,\n a:active,\n a:hover",{outline:"0 none"}),Object(z.a)(rB,"button::-moz-focus-inner",{border:0}),Object(z.a)(rB,".ReactVirtualized__Grid__innerScrollContainer",{overflow:"inherit !important"}),rB))},_R=n(162),ZR=Re.p,KR=Object(_R.a)({typography:{fontFamily:Ne,body1:Object(s.a)({},ZR)},MuiButtonBase:{disableRipple:!0},palette:{primary:{light:ee,dark:ee,main:ee},secondary:{light:ee,dark:ee,main:ee},background:{default:re}},overrides:{MuiRadio:{colorSecondary:{color:ee}},MuiAutocomplete:{root:{color:le},noOptions:{padding:[[6,16]]},option:{'&[data-focus="true"]':{backgroundColor:ae}},paper:{color:le,margin:0},listbox:{padding:0},tag:{'&[data-tag-index="0"]':{marginLeft:0},margin:2,backgroundColor:ae,borderRadius:4,height:18}},MuiChip:{label:{paddingLeft:4,paddingRight:4,color:le,fontSize:ve}},MuiInput:{root:{color:le},underline:{"&:before":{borderBottom:[[2,"solid",le]]}}},MuiInputLabel:{root:{font:"inherit",fontSize:Oe,color:se},shrink:{color:le,transform:"translate(0, 1.7px) scale(0.83)"}},MuiFormLabel:{root:{"&$focused":{color:le}}},MuiListItem:{root:{"&:nth-of-type(odd)":{backgroundColor:re}}}}}),QR=Object(v.c)({plugins:[Object(y.a)()].concat(Object(d.a)(Object(p.a)().plugins))}),JR="100%",eT="column",tT=Object(f.a)(Object(s.a)(Object(s.a)({},YR),{},{root:{backgroundColor:re,width:JR,minHeight:JR,display:"flex",flexDirection:eT},wrapper:{width:he,height:JR,margin:"0 auto",flex:1,display:"flex",flexDirection:eT},grid:{flex:1,height:"100%"},contentWithSidebar:{flex:1,marginLeft:48,paddingTop:15},contentWithoutSidebar:{width:he}})),nT=x()(aB||(aB=Object(l.a)(["\n query userData {\n userData {\n id\n username\n role\n enabled\n last_accessed\n last_accessed_from\n last_accessed_address\n }\n }\n"]))),rT=function(){var e=tT(),t=Object(w.i)(),n=Object(w.h)(),a=Object(r.useContext)(k),i=a.wizardTested,o=a.userData,c=a.setUserData,l=Object(u.c)(nT,{onCompleted:function(e){!o&&(null===e||void 0===e?void 0:e.userData)&&c(e.userData)}}).loading,s=t.pathname,d=function(e){return Wo.a((function(t){return t.route===e}))(L.a(Ao.a,B.a(R.a("children")),M.a(To.a("children")))(qR))}(s),m=d?function(e){return Ar.a(W.a("route",zo.a(1,$o.a((function(e){return"/"!==e}),e))))(UR)}(s):{},p="/404"===t.pathname,f=d?e.contentWithSidebar:e.contentWithoutSidebar;return Object(Me.jsxs)("div",{className:e.root,children:[!p&&i&&o&&Object(Me.jsx)(So,{tree:zR,user:o}),Object(Me.jsxs)("main",{className:e.wrapper,children:[d&&!p&&i&&Object(Me.jsx)(b.a,{direction:"left",in:!0,mountOnEnter:!0,unmountOnExit:!0,children:Object(Me.jsx)("div",{children:Object(Me.jsx)(Do,{title:m.title})})}),Object(Me.jsxs)(h.a,{container:!0,className:e.grid,children:[d&&!p&&i&&Object(Me.jsx)(di,{data:m.children,isSelected:function(e){return t.pathname===e.route},displayName:function(e){return e.label},onClick:function(e){return n.push(e.route)}}),Object(Me.jsx)("div",{className:f,children:!l&&Object(Me.jsx)(GR,{})})]})]})]})},aT=function(){var e=Object(r.useState)(!1),t=Object(c.a)(e,2),n=t[0],a=t[1],i=Object(r.useState)(null),o=Object(c.a)(i,2),l=o[0],d=o[1];return Object(Me.jsx)(k.Provider,{value:{wizardTested:n,setWizardTested:a,userData:l,setUserData:d,setRole:function(e){l&&e&&l.role!==e&&d(Object(s.a)(Object(s.a)({},l),{},{role:e}))}},children:Object(Me.jsx)(C.a,{children:Object(Me.jsx)(Rp,{children:Object(Me.jsx)(j.b,{jss:QR,children:Object(Me.jsxs)(g.a,{theme:KR,children:[Object(Me.jsx)(m.a,{}),Object(Me.jsx)(rT,{})]})})})})})};Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));Promise.resolve().then((function(){return o.a.render(Object(Me.jsx)(a.a.StrictMode,{children:Object(Me.jsx)(aT,{})}),document.getElementById("root"))})),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then((function(e){e.unregister()}))}},[[735,1,2]]]);
//# sourceMappingURL=main.ff8544f4.chunk.js.map