lamassu-server/public/static/js/main.900511f9.chunk.js
2023-06-15 20:42:32 +01:00

2 lines
No EOL
835 KiB
JavaScript

(this["webpackJsonplamassu-admin"]=this["webpackJsonplamassu-admin"]||[]).push([[0],{735:function(e,t){},737:function(e,t){},738:function(e,t){},759:function(e,t){},761:function(e,t){},768:function(e,t){},770:function(e,t){},817:function(e,t){},895:function(e,t){},897:function(e,t){},908:function(e,t){},922:function(e,t){},968:function(e,t,n){"use strict";n.r(t);var a=n(1),r=n.n(a),i=n(47),o=n.n(i),l=n(2),c=n(9),s=n(6),d=n(50),u=n(8),m=n(1112),h=n(1032),p=n(395),b=n(574),f=n(407),j=n(1008),g=n(1096),O=n(10),x=n.n(O),v=n(72),y=n(524),w=n(173),C=n(56),k=r.a.createContext(),E=n(1014),N=n(1012),S=n(7),I=n.n(S),L=n(1031),P=n(533),F=n(552),D=n(545),T=n(97),R=n(536),B=n(1009),A=n(210),M=n(329),W=n(1010),z=n(5),q=n(20),$="#5f668a",H="#44e188",V="#ecfbef",U="#3fd07e",G="#ebefff",X="#dbdfed",_="#16d6d3",Z="#5a67ff",K="#ffffff",Q="#ff584a",Y="#ffeceb",J="#1b2559",ee="#48f694",te=H,ne=U,ae="#fafbff",re=G,ie=X,oe="#dddddd",le="#f2f2f2",ce=J,se=$,de="#72799d",ue="#525772",me=$,he=Q,pe=Y,be=1200,fe=ee,je="Mont",ge="MuseoSans",Oe="BPmono",xe=24,ve=20,ye=16,we=14,Ce=13;var ke=Ce,Ee=we,Ne=ye,Se=xe,Ie=500,Le=ge,Pe=32,Fe=48;var De=2*Pe,Te=J,Re=Y,Be=V,Ae={lineHeight:"120%",color:ce},Me={h1:{extend:Ae,fontSize:xe,fontFamily:je,fontWeight:900},h2:{extend:Ae,fontSize:ve,fontFamily:je,fontWeight:900},h3:{extend:Ae,fontSize:we,fontFamily:je,fontWeight:900},h4:{extend:Ae,fontSize:we,fontFamily:je,fontWeight:700},h5:{extend:Ae,fontSize:ye,fontFamily:je,fontWeight:700},p:{extend:Ae,fontSize:we,fontFamily:ge,fontWeight:500},tl1:{extend:Ae,fontSize:ve,fontFamily:ge,fontWeight:700},tl2:{extend:Ae,fontSize:we,fontFamily:ge,fontWeight:700},info1:{extend:Ae,fontSize:xe,fontFamily:ge,fontWeight:700},info2:{extend:Ae,fontSize:ye,fontFamily:ge,fontWeight:700},info3:{extend:Ae,fontSize:ye,fontFamily:ge,fontWeight:500},mono:{extend:Ae,fontSize:we,fontFamily:Oe,fontWeight:500},monoBold:{fontWeight:700},monoSmall:{fontSize:Ce},inputFont:{fontSize:ve,fontFamily:ge,fontWeight:500,lineHeight:"110%",color:ce},regularLabel:{fontSize:we,fontFamily:ge,fontWeight:500,lineHeight:"110%"},label1:{fontSize:Ce,fontFamily:ge,fontWeight:500,color:ce},label2:{fontSize:Ce,fontFamily:ge,fontWeight:700,color:ce},label3:{fontSize:we,fontFamily:ge,fontWeight:500,color:ce},confirmationCode:{extend:Ae,fontSize:35,fontFamily:ge,fontWeight:900},inline:{display:"inline"},noMargin:{margin:0}},We=function(e,t,n){return{backgroundColor:e,"&:hover":{backgroundColor:t},"&:active":{backgroundColor:n}}},ze={actionButton:{extend:Me.p,cursor:"pointer",border:"none",height:28,outline:0,borderRadius:6,padding:"0 8px",display:"flex",alignItems:"center"},primary:{extend:We(re,ie,se),"&:active":{color:K,"& $actionButtonIcon":{display:"none"},"& $actionButtonIconActive":{display:"flex"}},"& $actionButtonIconActive":{display:"none"}},secondary:{extend:We(se,de,ue),color:K,"&:active":{"& $actionButtonIcon":{display:"flex"},"& $actionButtonIconActive":{display:"none"}},"& $actionButtonIcon":{display:"none"},"& $actionButtonIconActive":{display:"flex"}},spring:{extend:We(te,ee,ne),color:K,"&:active":{"& $actionButtonIcon":{display:"flex"},"& $actionButtonIconActive":{display:"none"}},"& $actionButtonIcon":{display:"none"},"& $actionButtonIconActive":{display:"flex"}},tomato:{extend:We("#E45043",he,"#CE463A"),color:K,"&:active":{"& $actionButtonIcon":{display:"flex"},"& $actionButtonIconActive":{display:"none"}},"& $actionButtonIcon":{display:"none"},"& $actionButtonIconActive":{display:"flex"}},actionButtonIcon:{display:"flex",paddingRight:7,"@global":{svg:{width:14,height:14}}},actionButtonIconActive:{}},qe=n(0),$e=Object(f.a)(ze),He=Object(a.memo)((function(e){var t,n=e.className,a=e.Icon,r=e.InverseIcon,i=e.color,o=e.children,l=Object(q.a)(e,["className","Icon","InverseIcon","color","children"]),c=$e(),d=(t={},Object(z.a)(t,c.actionButton,!0),Object(z.a)(t,c.primary,"primary"===i),Object(z.a)(t,c.secondary,"secondary"===i),Object(z.a)(t,c.spring,"spring"===i),Object(z.a)(t,c.tomato,"tomato"===i),t);return Object(qe.jsxs)("button",Object(s.a)(Object(s.a)({className:I()(d,n)},l),{},{children:[a&&Object(qe.jsx)("div",{className:c.actionButtonIcon,children:Object(qe.jsx)(a,{})}),r&&Object(qe.jsx)("div",{className:I()(c.actionButtonIcon,c.actionButtonIconActive),children:Object(qe.jsx)(r,{})}),o&&Object(qe.jsx)("div",{children:o})]}))})),Ve=Object(f.a)(Me);function Ue(e){var t,n=e.children,a=e.noMargin,r=e.className,i=Object(q.a)(e,["children","noMargin","className"]),o=Ve(),l=(t={},Object(z.a)(t,o.h1,!0),Object(z.a)(t,o.noMargin,a),Object(z.a)(t,r,!!r),t);return Object(qe.jsx)("h1",Object(s.a)(Object(s.a)({className:I()(l)},i),{},{children:n}))}function Ge(e){var t,n=e.children,a=e.noMargin,r=e.className,i=Object(q.a)(e,["children","noMargin","className"]),o=Ve(),l=(t={},Object(z.a)(t,o.h2,!0),Object(z.a)(t,o.noMargin,a),Object(z.a)(t,r,!!r),t);return Object(qe.jsx)("h2",Object(s.a)(Object(s.a)({className:I()(l)},i),{},{children:n}))}function Xe(e){var t,n=e.children,a=e.noMargin,r=e.className,i=Object(q.a)(e,["children","noMargin","className"]),o=Ve(),l=(t={},Object(z.a)(t,o.h3,!0),Object(z.a)(t,o.noMargin,a),Object(z.a)(t,r,!!r),t);return Object(qe.jsx)("h3",Object(s.a)(Object(s.a)({className:I()(l)},i),{},{children:n}))}function _e(e){var t,n=e.children,a=e.noMargin,r=e.className,i=Object(q.a)(e,["children","noMargin","className"]),o=Ve(),l=(t={},Object(z.a)(t,o.h4,!0),Object(z.a)(t,o.noMargin,a),Object(z.a)(t,r,!!r),t);return Object(qe.jsx)("h4",Object(s.a)(Object(s.a)({className:I()(l)},i),{},{children:n}))}function Ze(e){var t,n=e.children,a=e.noMargin,r=e.className,i=Object(q.a)(e,["children","noMargin","className"]),o=Ve(),l=(t={},Object(z.a)(t,o.h5,!0),Object(z.a)(t,o.noMargin,a),Object(z.a)(t,r,!!r),t);return Object(qe.jsx)("h5",Object(s.a)(Object(s.a)({className:I()(l)},i),{},{children:n}))}var Ke=ot("p"),Qe=ot("info1"),Ye=ot("info2"),Je=ot("info3"),et=ot("mono"),tt=ot("tl1"),nt=ot("tl2"),at=ot("label1"),rt=ot("label2"),it=ot("label3");function ot(e){return function(t){var n,a=t.inline,r=t.noMargin,i=t.className,o=t.children,l=Object(q.a)(t,["inline","noMargin","className","children"]),c=Ve(),d=(n={},Object(z.a)(n,i,!!i),Object(z.a)(n,c[e],e),Object(z.a)(n,c.inline,a),Object(z.a)(n,c.noMargin,r),n);return Object(qe.jsx)("p",Object(s.a)(Object(s.a)({className:I()(d)},l),{},{children:o}))}}function lt(){return(lt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function ct(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var st=a.createElement("desc",null,"Created with Sketch."),dt=a.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"nav-/-primary-/-1440",transform:"translate(-1295.000000, -19.000000)",stroke:"#1B2559",strokeWidth:2},a.createElement("g",{id:"icon/menu/notification",transform:"translate(1296.000000, 20.000000)"},a.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"}),a.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 ut(e,t){var n=e.title,r=e.titleId,i=ct(e,["title","titleId"]);return a.createElement("svg",lt({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":r},i),n?a.createElement("title",{id:r},n):null,st,dt)}var mt=a.forwardRef(ut);n.p;function ht(){return(ht=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function pt(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var bt=a.createElement("desc",null,"Created with Sketch."),ft=a.createElement("g",{id:"icon/stage/spring/empty",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.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 jt(e,t){var n=e.title,r=e.titleId,i=pt(e,["title","titleId"]);return a.createElement("svg",ht({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":r},i),n?a.createElement("title",{id:r},n):null,bt,ft)}var gt=a.forwardRef(jt);n.p;function Ot(){return(Ot=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function xt(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var vt=a.createElement("desc",null,"Created with Sketch."),yt=a.createElement("g",{id:"icon/stage/zodiac/empty",stroke:"none",strokeWidth:2,fill:"none",fillRule:"evenodd"},a.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 wt(e,t){var n=e.title,r=e.titleId,i=xt(e,["title","titleId"]);return a.createElement("svg",Ot({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":r},i),n?a.createElement("title",{id:r},n):null,vt,yt)}var Ct=a.forwardRef(wt);n.p;function kt(){return(kt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Et(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Nt=a.createElement("desc",null,"Created with Sketch."),St=a.createElement("g",{id:"icon/stage/zodiac/full",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("circle",{id:"Oval-2-Copy",fill:"#1B2559",cx:9,cy:9,r:8}),a.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 It(e,t){var n=e.title,r=e.titleId,i=Et(e,["title","titleId"]);return a.createElement("svg",kt({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":r},i),n?a.createElement("title",{id:r},n):null,Nt,St)}var Lt=a.forwardRef(It),Pt=(n.p,{container:{"@media only screen and (max-width: 1920px)":{width:"30vw"},width:"40vw",height:"110vh",right:0,backgroundColor:K,boxShadow:"0 0 14px 0 rgba(0, 0, 0, 0.24)"},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: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:{height:"90vh",maxHeight:"100vh",marginTop:24,marginLeft:0,overflowY:"auto",overflowX:"hidden",backgroundColor:K,zIndex:10},notificationRow:{display:"flex",flexDirection:"row",justifyContent:"flex-start",position:"relative",marginBottom:4,paddingTop:12,"& > *:first-child":{marginRight:24},"& > *":{marginRight:10},"& > *:last-child":{marginRight:0}},notificationContent:{display:"flex",flexDirection:"column",justifyContent:"center",width:300},unread:{backgroundColor:V},notificationRowIcon:{alignSelf:"center","& > *":{marginLeft:24}},readIconWrapper:{flexGrow:1},unreadIcon:{marginTop:2,width:"12px",height:"12px",backgroundColor:ee,borderRadius:"50%",cursor:"pointer",zIndex:1},readIcon:{marginLeft:8,marginTop:5,width:"12px",height:"12px",border:[[1,"solid",$]],borderRadius:"50%",cursor:"pointer",zIndex:1},notificationTitle:{margin:0,color:$},notificationBody:{margin:0},notificationSubtitle:{margin:0,marginBottom:8,color:$},stripes:{position:"absolute",height:"100%",top:"0px",opacity:"60%"},hasUnread:{position:"absolute",top:0,left:16,width:"9px",height:"9px",backgroundColor:ee,borderRadius:"50%"}}),Ft=n(528),Dt=n.n(Ft);function Tt(){return(Tt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Rt(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Bt=a.createElement("g",{id:"\\u21B3-notification-center",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"notification-center_v01a#2-(open)",transform:"translate(-1023.000000, -459.000000)",stroke:"#1B2559"},a.createElement("g",{id:"Group-5",transform:"translate(1000.000000, 0.000000)"},a.createElement("g",{id:"icon/sf-small/wrench",transform:"translate(24.000000, 460.000000)"},a.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 At(e,t){var n=e.title,r=e.titleId,i=Rt(e,["title","titleId"]);return a.createElement("svg",Tt({width:"32px",height:"32px",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,Bt)}var Mt=a.forwardRef(At);n.p;function Wt(){return(Wt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function zt(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var qt=a.createElement("g",{id:"\\u21B3-notification-center",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"notification-center_v01a#1-(marked-one-as-read)",transform:"translate(-1023.000000, -123.000000)",stroke:"#1B2559"},a.createElement("g",{id:"Group-5",transform:"translate(1000.000000, 0.000000)"},a.createElement("g",{id:"Group-4",transform:"translate(24.000000, 124.000000)"},a.createElement("g",{id:"Group-3"},a.createElement("line",{x1:0,y1:4,x2:16,y2:4,id:"Path-2"}),a.createElement("polyline",{id:"Path-3",points:"12 0 16 4 12 8"})),a.createElement("g",{id:"Group-2",transform:"translate(8.000000, 12.000000) scale(-1, 1) translate(-8.000000, -12.000000) translate(0.000000, 8.000000)"},a.createElement("line",{x1:0,y1:4,x2:16,y2:4,id:"Path-2-Copy"}),a.createElement("polyline",{id:"Path-3-Copy",points:"12 0 16 4 12 8"}))))));function $t(e,t){var n=e.title,r=e.titleId,i=zt(e,["title","titleId"]);return a.createElement("svg",Wt({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":r},i),n?a.createElement("title",{id:r},n):null,qt)}var Ht=a.forwardRef($t);n.p;function Vt(){return(Vt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Ut(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Gt=a.createElement("desc",null,"Created with Sketch."),Xt=a.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"icon/warning-icon/tomato"},a.createElement("rect",{id:"Rectangle",stroke:"#FF584A",strokeWidth:2,x:1,y:1,width:22,height:22,rx:11}),a.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 _t(e,t){var n=e.title,r=e.titleId,i=Ut(e,["title","titleId"]);return a.createElement("svg",Vt({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":r},i),n?a.createElement("title",{id:r},n):null,Gt,Xt)}var Zt,Kt,Qt,Yt=a.forwardRef(_t),Jt=(n.p,Object(f.a)(Pt)),en={transaction:{display:"Transactions",icon:Object(qe.jsx)(Ht,{height:16,width:16})},highValueTransaction:{display:"Transactions",icon:Object(qe.jsx)(Ht,{height:16,width:16})},fiatBalance:{display:"Maintenance",icon:Object(qe.jsx)(Mt,{height:16,width:16})},cryptoBalance:{display:"Maintenance",icon:Object(qe.jsx)(Mt,{height:16,width:16})},compliance:{display:"Compliance",icon:Object(qe.jsx)(Yt,{height:16,width:16})},error:{display:"Error",icon:Object(qe.jsx)(Yt,{height:16,width:16})}},tn=function(e){var t,n,a,r=e.id,i=e.type,o=(e.detail,e.message),l=e.deviceName,c=e.created,s=e.read,d=e.valid,u=e.toggleClear,m=Jt(),h=null!==(t=A.a([i,"display"])(en))&&void 0!==t?t:null,p=null!==(n=A.a([i,"icon"])(en))&&void 0!==n?n:Object(qe.jsx)(Mt,{height:16,width:16}),b=Dt()((new Date).getTime()-new Date(c).getTime(),{compact:!0,verbose:!0}),f=h&&l?"".concat(h," - ").concat(l):"".concat(!h&&l?l:h),j=(a={},Object(z.a)(a,m.readIcon,s),Object(z.a)(a,m.unreadIcon,!s),a);return Object(qe.jsxs)("div",{className:I()(m.notificationRow,!s&&d?m.unread:""),children:[Object(qe.jsx)("div",{className:m.notificationRowIcon,children:Object(qe.jsx)("div",{children:p})}),Object(qe.jsxs)("div",{className:m.notificationContent,children:[Object(qe.jsx)(rt,{className:m.notificationTitle,children:f}),Object(qe.jsx)(nt,{className:m.notificationBody,children:o}),Object(qe.jsx)(at,{className:m.notificationSubtitle,children:b})]}),Object(qe.jsx)("div",{className:m.readIconWrapper,children:Object(qe.jsx)("div",{onClick:function(){return u(r)},className:I()(j)})})]})},nn=Object(f.a)(Pt),an=x()(Zt||(Zt=Object(c.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"]))),rn=x()(Kt||(Kt=Object(c.a)(["\n mutation toggleClearNotification($id: ID!, $read: Boolean!) {\n toggleClearNotification(id: $id, read: $read) {\n id\n read\n }\n }\n"]))),on=x()(Qt||(Qt=Object(c.a)(["\n mutation clearAllNotifications {\n clearAllNotifications {\n id\n }\n }\n"]))),ln=function(e){var t,n,r=e.close,i=e.hasUnreadProp,o=e.buttonCoords,c=e.popperRef,s=e.refetchHasUnreadHeader,d=Object(u.c)(an,{pollInterval:6e4}),m=d.data,h=d.loading,p=Object(a.useState)(300),b=Object(l.a)(p,2),f=b[0],j=b[1],g=Object(a.useState)(!1),O=Object(l.a)(g,2),x=O[0],v=O[1],y=nn({buttonCoords:o,xOffset:f}),w=P.a(T.a(R.a("name")),B.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(a.useState)(i),E=Object(l.a)(k,2),N=E[0],S=E[1],I=Object(u.b)(rn,{onError:function(){return console.error("Error while clearing notification")},refetchQueries:function(){return["getNotifications"]}}),L=Object(l.a)(I,1)[0],F=Object(u.b)(on,{onError:function(){return console.error("Error while clearing all notifications")},refetchQueries:function(){return["getNotifications"]}}),D=Object(l.a)(F,1)[0];Object(a.useEffect)((function(){j(c.current.getBoundingClientRect().x),m&&m.hasUnreadNotifications!==N&&(s(),S(!N))}),[c,m,N,s]);return Object(qe.jsx)(qe.Fragment,{children:Object(qe.jsxs)("div",{className:y.container,children:[Object(qe.jsxs)("div",{className:y.header,children:[Object(qe.jsx)(Ze,{className:y.headerText,children:"Notifications"}),Object(qe.jsxs)("button",{onClick:r,className:y.notificationIcon,children:[Object(qe.jsx)(mt,{}),N&&Object(qe.jsx)("div",{className:y.hasUnread})]})]}),Object(qe.jsxs)("div",{className:y.actionButtons,children:[N&&Object(qe.jsx)(He,{color:"primary",Icon:Lt,InverseIcon:gt,className:y.clearAllButton,onClick:function(){return v(!x)},children:x?"Show all":"Show unread"}),N&&Object(qe.jsx)(He,{color:"primary",Icon:Ct,InverseIcon:gt,className:y.clearAllButton,onClick:D,children:"Mark all as read"})]}),Object(qe.jsx)("div",{className:y.notificationsList,children:!h&&(x&&N?M.a(W.a("read",!1))(C):C).map((function(e){return Object(qe.jsx)(tn,{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 L({variables:{id:e.id,read:!e.read}})}},e.id)}))})]})})},cn=n(1029),sn=n(1030),dn=n(394),un=n(295),mn=n(11),hn=n(165),pn=n.n(hn),bn=n(553),fn=n(1027),jn=n(1132),gn=n(120),On=n(1028),xn=n(3),vn=Object(f.a)({title:{marginTop:24,marginBottom:24}}),yn=Object(a.memo)((function(e){var t=e.children,n=vn();return Object(qe.jsx)(Ue,{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 a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Cn(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var kn=a.createElement("desc",null,"Created with Sketch."),En=a.createElement("g",{id:"icon/button/add/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.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"}),a.createElement("line",{x1:6,y1:3.69230769,x2:6,y2:8.30769231,id:"Stroke-3",stroke:"#1B2559"}),a.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,r=e.titleId,i=Cn(e,["title","titleId"]);return a.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":r},i),n?a.createElement("title",{id:r},n):null,kn,En)}var Sn=a.forwardRef(Nn),In=(n.p,{button:{extend:Me.p,border:"none",backgroundColor:G,cursor:"pointer",outline:0,display:"flex",justifyContent:"center",alignItems:"center",width:167,height:48,color:ce,"&:hover":{backgroundColor:X},"&:active":{backgroundColor:$,color:K,"& svg g *":{stroke:K}},"& svg":{marginRight:8}}}),Ln=Object(f.a)(In),Pn=Object(a.memo)((function(e){var t=e.className,n=e.children,a=Object(q.a)(e,["className","children"]),r=Ln();return Object(qe.jsxs)("button",Object(s.a)(Object(s.a)({className:I()(r.button,t)},a),{},{children:[Object(qe.jsx)(Sn,{}),n]}))})),Fn=Me.h1,Dn=Me.h3,Tn=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=Tn(t);return{height:n+n/12/2}},button:function(e){var t=e.size,n=e.backgroundColor,a=Tn(t),r="xl"===t?3:a/12,i="grey"===n;return{extend:"xl"===t?Fn:Dn,border:"none",color:K,cursor:"pointer",fontWeight:900,outline:0,backgroundColor:i?de:ee,"&:disabled":{backgroundColor:oe,boxShadow:"none","&:hover":{backgroundColor:oe,boxShadow:"none"},"&:active":{marginTop:0}},shadowSize:r,height:a,padding:"0 ".concat("xl"===t?20:a/2,"px"),borderRadius:a/4,boxShadow:"0 ".concat(r,"px ").concat(i?se:te),"&:hover":{backgroundColor:i?se:te,boxShadow:"0 ".concat(r,"px ").concat(i?ue:ne)},"&:active":{marginTop:r/2,backgroundColor:i?de:te,boxShadow:"0 ".concat(r/2,"px ").concat(i?ue:ne)}}}},Bn=Object(f.a)(Rn),An=Object(a.memo)((function(e){var t=e.size,n=void 0===t?"lg":t,a=e.children,r=e.className,i=e.buttonClassName,o=e.backgroundColor,l=Object(q.a)(e,["size","children","className","buttonClassName","backgroundColor"]),c=Bn({size:n,backgroundColor:o});return Object(qe.jsx)("div",{className:I()(r,c.wrapper),children:Object(qe.jsx)("button",Object(s.a)(Object(s.a)({className:I()(i,c.button)},l),{},{children:a}))})})),Mn=function(e,t,n){return{backgroundColor:e,"&:hover":{backgroundColor:t},"&:active":{backgroundColor:n}}},Wn={baseButton:{extend:Mn(re,ie,se),cursor:"pointer",border:"none",outline:0,height:32,color:ce,"&:active":{color:K}},primary:{extend:Mn(re,ie,se),"&:active":{color:K,"& $buttonIcon":{display:"none"},"& $buttonIconActive":{display:"block"}},"& $buttonIconActive":{display:"none"}},secondary:{extend:Mn(se,de,K),color:K,"&:active":{color:ce,"& $buttonIcon":{display:"flex"},"& $buttonIconActive":{display:"none"}},"& $buttonIcon":{display:"none"},"& $buttonIconActive":{display:"flex"}}},zn=Wn.baseButton,qn=Wn.primary,$n={featureButton:{extend:zn,width:zn.height,borderRadius:zn.height/2,display:"flex",padding:0},primary:qn,buttonIcon:{margin:"auto","& svg":{width:16,height:16,overflow:"visible","& g":{strokeWidth:1.8}}},buttonIconActive:{}},Hn=Object(f.a)($n),Vn=Object(a.memo)((function(e){var t,n=e.className,a=e.Icon,r=e.InverseIcon,i=e.children,o=Object(q.a)(e,["className","Icon","InverseIcon","children"]),l=Hn(),c=(t={},Object(z.a)(t,l.featureButton,!0),Object(z.a)(t,l.primary,!0),t);return Object(qe.jsxs)("button",Object(s.a)(Object(s.a)({className:I()(c,n)},o),{},{children:[a&&Object(qe.jsx)("div",{className:l.buttonIcon,children:Object(qe.jsx)(a,{})}),r&&Object(qe.jsx)("div",{className:I()(l.buttonIcon,l.buttonIconActive),children:Object(qe.jsx)(r,{})}),i]}))})),Un=n(402),Gn=n(1011),Xn=function(e){var t,n=e.children,r=e.bgColor,i=void 0===r?K:r,o=e.arrowSize,c=void 0===o?6:o,d=e.className,u=Object(q.a)(e,["children","bgColor","arrowSize","className"]),m=Object(a.useState)(null),h=Object(l.a)(m,2),p=h[0],b=h[1],j={popover:{zIndex:3e3,backgroundColor:i,borderRadius:4},arrow:{position:"absolute",fontSize:c,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*c,height:3*c,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*c,height:3*c,marginLeft:0,bottom:0,top:-(4*c+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:p},computeStyle:{gpuAcceleration:!1}});return Object(qe.jsx)(qe.Fragment,{children:Object(qe.jsx)(N.a,Object(s.a)(Object(s.a)({disablePortal:!1,modifiers:x,className:g.popover},u),{},{children:Object(qe.jsxs)(Un.a,{className:I()(g.root,d),children:[Object(qe.jsx)("span",{className:I()(O),ref:b}),n]})}))})},_n=Me.info2,Zn=function(e,t,n){return{backgroundColor:e,"&:hover":{backgroundColor:t},"&:active":{backgroundColor:n}}},Kn={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:Zn(re,ie,se)},open:{extend:Zn(se,se,se)},popoverContent:{extend:_n,padding:8,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:4,"& img":{maxHeight:145}}},Qn=Object(f.a)(Kn),Yn=Object(a.memo)((function(e){var t,n=e.name,r=e.className,i=e.Icon,o=e.InverseIcon,c=(e.popoverWidth,e.children),d=e.popoverClassname,u=Object(q.a)(e,["name","className","Icon","InverseIcon","popoverWidth","children","popoverClassname"]),m=Object(a.useState)(null),h=Object(l.a)(m,2),p=h[0],b=h[1],f=Qn(),j=Boolean(p),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(){b(null)};return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(E.a,{onClickAway:v,children:Object(qe.jsxs)("button",Object(s.a)(Object(s.a)({"aria-describedby":g,onClick:function(e){b(p?null:e.currentTarget)},className:I()(O,r)},u),{},{children:[i&&!j&&Object(qe.jsx)("div",{className:I()(x),children:Object(qe.jsx)(i,{})}),o&&j&&Object(qe.jsx)("div",{className:I()(x),children:Object(qe.jsx)(o,{})})]}))}),Object(qe.jsx)(Xn,{className:d,id:g,open:j,anchorEl:p,onClose:v,arrowSize:3,placement:"top",children:Object(qe.jsx)("div",{className:f.popoverContent,children:Object(qe.jsx)("div",{children:c})})})]})})),Jn={label:function(e){var t=e.size;return{width:t,height:t}},root:{"& svg":{flex:1},"&:hover":{backgroundColor:"inherit"},"&:hover rect":{stroke:$},"&:hover polygon":{stroke:$},"&:hover path":{stroke:$}}},ea=Object(f.a)(Jn),ta=function(e){var t=e.size,n=e.children,a=e.onClick,r=Object(q.a)(e,["size","children","onClick"]),i=ea({size:t});return Object(qe.jsx)(dn.a,Object(s.a)(Object(s.a)({},r),{},{size:"small",classes:{root:i.root,label:i.label},disableRipple:!0,onClick:a,children:n}))},na=n(248),aa=function(e){return{boxShadow:"inset 0 -4px 0 0 ".concat(Object(na.fade)(e,.8)),"&:hover":{boxShadow:"none",backgroundColor:Object(na.fade)(e,.8)}}},ra={link:{extend:Me.h4,textDecoration:"none",border:"none",backgroundColor:"transparent",cursor:"pointer",padding:"0",height:"100%"},primary:{extend:aa(fe)},secondary:{extend:aa("#ff584a"),"&:hover":{color:K}},noColor:{extend:aa(K)},action:{extend:aa(fe),color:G}},ia=Object(f.a)(ra),oa=Object(a.memo)((function(e){var t,n=e.submit,a=e.className,r=e.children,i=e.color,o=void 0===i?"primary":i,l=Object(q.a)(e,["submit","className","children","color"]),c=ia(),d=(t={},Object(z.a)(t,c.link,!0),Object(z.a)(t,c.primary,"primary"===o),Object(z.a)(t,c.secondary,"secondary"===o),Object(z.a)(t,c.noColor,"noColor"===o),Object(z.a)(t,c.action,"action"===o),t);return Object(qe.jsx)("button",Object(s.a)(Object(s.a)({type:n?"submit":"button",className:I()(d,a)},l),{},{children:r}))})),la=Wn.baseButton,ca=Wn.primary,sa={button:{extend:la,borderRadius:la.height/2,outline:0,padding:"0 20px"},primary:ca,buttonIcon:{marginTop:4,marginRight:4,"& svg":{width:20,height:20,overflow:"visible"}},buttonIconActive:{}};Object(f.a)(sa);function da(){return(da=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function ua(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var ma=a.createElement("desc",null,"Created with Sketch."),ha=a.createElement("g",{id:"icon/button/cancel/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"Group-5",transform:"translate(1.000000, 1.000000)",stroke:"#FFFFFF"},a.createElement("line",{x1:10,y1:0,x2:0,y2:10,id:"Stroke-1"}),a.createElement("line",{x1:0,y1:0,x2:10,y2:10,id:"Stroke-3"})));function pa(e,t){var n=e.title,r=e.titleId,i=ua(e,["title","titleId"]);return a.createElement("svg",da({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":r},i),n?a.createElement("title",{id:r},n):null,ma,ha)}var ba=a.forwardRef(pa),fa=(n.p,Wn.baseButton),ja={button:{extend:fa,padding:0,color:K,borderRadius:fa.height/2},normalButton:{width:fa.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:K}},ga=Object(f.a)(ja),Oa=Object(a.memo)((function(e){var t,n=e.className,r=e.Icon,i=e.InverseIcon,o=e.toggle,c=e.forceDisable,s=void 0!==c&&c,d=e.children,u=Object(a.useState)(!1),m=Object(l.a)(u,2),h=m[0],p=m[1],b=!s&&h,f=ga(),j=(t={},Object(z.a)(t,f.button,!0),Object(z.a)(t,f.normalButton,!b),Object(z.a)(t,f.activeButton,b),t),g=Object(qe.jsx)(r,{className:f.buttonIcon}),O=Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(i,{className:I()(f.buttonIcon,f.buttonIconActiveLeft)}),Object(qe.jsx)(_e,{className:f.white,children:d}),Object(qe.jsx)(ba,{className:I()(f.buttonIcon,f.buttonIconActiveRight)})]});return Object(qe.jsx)("button",{className:I()(j,n),onClick:function(){s=!1;var e=!b;o(e),p(e)},children:b?O:g})}));function xa(){return(xa=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function va(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var ya=a.createElement("desc",null,"Created with Sketch."),wa=a.createElement("g",{id:"icon/action/external-link/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.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"}),a.createElement("polyline",{id:"Stroke-3",stroke:"#FFFFFF",strokeWidth:2,points:"14.4443 1 20.0003 1 20.0003 6.556"}),a.createElement("line",{x1:10,y1:11,x2:20,y2:1,id:"Stroke-5",stroke:"#FFFFFF",strokeWidth:2}));function Ca(e,t){var n=e.title,r=e.titleId,i=va(e,["title","titleId"]);return a.createElement("svg",xa({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":r},i),n?a.createElement("title",{id:r},n):null,ya,wa)}var ka=a.forwardRef(Ca);n.p;function Ea(){return(Ea=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Na(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Sa=a.createElement("desc",null,"Created with Sketch."),Ia=a.createElement("g",{id:"icon/action/external-link/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"Group-7",transform:"translate(0.000000, 1.000000)",stroke:"#1B2559",strokeWidth:2},a.createElement("polyline",{id:"Stroke-1",points:"20 11.1113 20 20.0003 0 20.0003 0 0.0003 8.889 0.0003"}),a.createElement("polyline",{id:"Stroke-3",points:"14.4443 0 20.0003 0 20.0003 5.556"}),a.createElement("line",{x1:10,y1:10,x2:20,y2:0,id:"Stroke-5"})));function La(e,t){var n=e.title,r=e.titleId,i=Na(e,["title","titleId"]);return a.createElement("svg",Ea({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":r},i),n?a.createElement("title",{id:r},n):null,Sa,Ia)}var Pa=a.forwardRef(La),Fa=(n.p,Object(f.a)({actionButton:{marginBottom:32},actionButtonLink:{textDecoration:"none",color:J}})),Da=function(e){var t=e.link,n=e.label,a=Fa();return Object(qe.jsx)("a",{className:a.actionButtonLink,target:"_blank",rel:"noopener noreferrer",href:t,children:Object(qe.jsx)(He,{className:a.actionButton,color:"primary",Icon:Pa,InverseIcon:ka,children:n})})},Ta=n(247),Ra=n(1119),Ba=n(543),Aa=n(1130),Ma=n(1019),Wa=n(1129),za=n(546),qa=n(1020),$a=n(1140),Ha=function(e){switch(e){case"sm":return{fontSize:Ee};case"lg":return{fontSize:Se,fontWeight:700};default:return{fontSize:Ne}}},Va={fontWeight:700},Ua={size:function(e){var t=e.size;return Object(s.a)({marginTop:"lg"===t?0:2},Ha(t))},bold:Va,root:function(e){return{width:e.width,"& input":{textAlign:e.textAlign}}},underline:{"&:before":{borderBottomColor:ee},"&:hover:not(.Mui-disabled)::before":{borderBottomColor:ee}}},Ga=Object(f.a)(Ua),Xa=Object(a.memo)((function(e){var t=e.name,n=e.isPasswordFilled,a=e.onChange,r=e.onBlur,i=e.value,o=e.error,l=(e.suffix,e.textAlign),c=e.width,d=e.size,u=e.bold,m=e.className,h=e.InputProps,p=Object(q.a)(e,["name","isPasswordFilled","onChange","onBlur","value","error","suffix","textAlign","width","size","bold","className","InputProps"]),b=Ga({textAlign:l,width:c,size:d}),f=!o&&!D.a(i)&&!Wa.a(i),j=n||f,g=Object(z.a)({},b.bold,u);return Object(qe.jsx)($a.a,Object(s.a)({id:t,onChange:a,onBlur:r,error:o,value:i,classes:{root:b.root},className:m,InputProps:Object(s.a)({className:I()(g),classes:{root:b.size,underline:j?b.underline:null}},h)},p))})),_a=function(e){e.optionsLimit;var t=e.limit,n=e.options,a=e.label,r=e.valueProp,i=e.multiple,o=e.onChange,l=e.labelProp,c=(e.shouldStayOpen,e.value),d=e.error,u=e.fullWidth,m=e.textAlign,h=e.size,p=e.autoFocus,b=Object(q.a)(e,["optionsLimit","limit","options","label","valueProp","multiple","onChange","labelProp","shouldStayOpen","value","error","fullWidth","textAlign","size","autoFocus"]),f=function(e){return function(t){return Aa.a(W.a(r,t))(e)}},j=R.a(r),g=r?(i?T.a(f(n)):f(n))(c):c,O=function(){return D.a(g)?[]:i?g:[g]};return Object(qe.jsx)(Ra.a,Object(s.a)(Object(s.a)({options:n,multiple:i,value:g,onChange:function(e,t){if(!r)return o(e,t);var n=i?T.a(j)(t):j(t);o(e,n)},getOptionLabel:A.a([l]),forcePopupIcon:!1,filterOptions:function(e,n){var a=n.inputValue;return Ma.a(Wa.a(a)?O():[],function(e,t){return t?Object(Ba.a)(e,t,{keys:[r,l]}):e}(e,a)).slice(0,za.a(void 0)(t)&&Math.max(t,Wa.a(a)?O().length:0))},openOnFocus:!0,autoHighlight:!0,disableClearable:!0,ChipProps:{onDelete:null},clearOnEscape:!0,getOptionSelected:qa.a(r)},b),{},{renderInput:function(e){return Object(qe.jsx)(Xa,Object(s.a)(Object(s.a)({},e),{},{autoFocus:p,label:a,value:c,error:d,size:h,fullWidth:u,textAlign:m}))}}))},Za=n(1120),Ka=n(549),Qa=n.n(Ka),Ya=n(548),Ja=n.n(Ya);function er(){return(er=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function tr(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var nr=a.createElement("desc",null,"Created with Sketch."),ar=a.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"icon/warning-icon/comet"},a.createElement("rect",{id:"Rectangle",stroke:"#5F668A",strokeWidth:2,x:1,y:1,width:22,height:22,rx:11}),a.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 rr(e,t){var n=e.title,r=e.titleId,i=tr(e,["title","titleId"]);return a.createElement("svg",er({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":r},i),n?a.createElement("title",{id:r},n):null,nr,ar)}var ir=a.forwardRef(rr),or=(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"}})),lr=function(e){var t=e.name,n=e.onChange,a=e.value,r=e.settings,i=Object(q.a)(e,["name","onChange","value","settings"]),o=r.enabled,l=r.label,c=r.disabledMessage,d=r.rightSideLabel,u=or();return Object(qe.jsx)(qe.Fragment,{children:o?Object(qe.jsxs)("div",{className:u.checkBoxLabel,children:[!d&&Object(qe.jsx)(rt,{children:l}),Object(qe.jsx)(Za.a,Object(s.a)({id:t,classes:{root:u.root,checked:u.checked},onChange:n,value:a,checked:a,icon:Object(qe.jsx)(Ja.a,{style:{marginLeft:2,fontSize:ye}}),checkedIcon:Object(qe.jsx)(Qa.a,{style:{fontSize:ve}}),disableRipple:!0},i)),d&&Object(qe.jsx)(rt,{children:l})]}):Object(qe.jsxs)("div",{className:u.wrapper,children:[Object(qe.jsx)(ir,{}),Object(qe.jsx)(Je,{className:u.message,children:c})]})})},cr=n(550),sr=n.n(cr),dr={input:{width:"3.5rem !important",height:"5rem",border:"2px solid",borderColor:G,borderRadius:"4px"},focus:{border:"2px solid",borderColor:J,borderRadius:"4px","&:focus":{outline:"none"}},error:{borderColor:he},container:{justifyContent:"space-evenly"}},ur=Object(f.a)(dr),mr=Object(f.a)(Me),hr=function(e){var t=e.name,n=e.value,a=e.onChange,r=e.numInputs,i=e.error,o=e.inputStyle,l=e.containerStyle,c=Object(q.a)(e,["name","value","onChange","numInputs","error","inputStyle","containerStyle"]),d=ur(),u=mr();return Object(qe.jsx)(sr.a,Object(s.a)({id:t,value:n,onChange:a,numInputs:r,separator:Object(qe.jsx)("span",{children:" "}),containerStyle:I()(l,d.container),inputStyle:I()(o,d.input,u.confirmationCode),focusStyle:d.focus,errorStyle:d.error,hasErrored:i,isInputNum:!0},c))},pr=n(1017),br=n(1142),fr=n(1021),jr=n(1115),gr=function(e){var t=e.label,n=e.name,a=e.options,r=e.onChange,i=e.value,o=e.className;return Object(qe.jsxs)(pr.a,{className:I()(o),children:[Object(qe.jsx)(br.a,{children:t}),Object(qe.jsx)(jr.a,{autoWidth:!0,labelId:t,id:n,value:i,onChange:r,children:a.map((function(e,t){return Object(qe.jsx)(fr.a,{value:e.value,children:e.display},t)}))})]})},Or=n(551),xr=Object(a.memo)((function(e){var t=e.name,n=e.onChange,a=e.onBlur,r=e.value,i=e.error,o=e.suffix,l=e.textAlign,c=e.width,d=e.size,u=e.bold,m=e.className,h=e.decimalPlaces,p=(e.InputProps,Object(q.a)(e,["name","onChange","onBlur","value","error","suffix","textAlign","width","size","bold","className","decimalPlaces","InputProps"]));return Object(qe.jsx)(Or.a,Object(s.a)({name:t,onChange:n,onBlur:a,value:r,error:i,suffix:o,textAlign:l,width:c,size:d,bold:u,className:m,customInput:Xa,decimalScale:h,onValueChange:function(e){n({target:{id:t,value:e.floatValue}})}},p))})),vr=n(1144),yr=n(1022),wr=n(1118),Cr={label:{height:16,lineHeight:"16px",margin:[[0,0,4,0]],paddingLeft:3},subtitle:{marginTop:-8,marginLeft:32,color:se}},kr=Object(f.a)(Cr),Er=function(e){var t=e.name,n=e.label,a=e.value,i=e.options,o=e.onChange,l=e.className,c=e.labelClassName,s=e.radioClassName,d=kr();return Object(qe.jsxs)(qe.Fragment,{children:[n&&Object(qe.jsx)(at,{className:d.label,children:n}),Object(qe.jsx)(vr.a,{name:t,value:a,onChange:o,className:I()(l),children:i.map((function(e,t){return Object(qe.jsx)(r.a.Fragment,{children:Object(qe.jsxs)("div",{children:[Object(qe.jsx)(yr.a,{disabled:e.disabled,value:e.code,control:Object(qe.jsx)(wr.a,{className:s}),label:e.display,className:I()(c)}),e.subtitle&&Object(qe.jsx)(at,{className:d.subtitle,children:e.subtitle})]})},t)}))})]})},Nr=Object(a.memo)((function(e){var t=e.value,n=e.onFocus,r=e.isPasswordFilled,i=e.onBlur,o=Object(q.a)(e,["value","onFocus","isPasswordFilled","onBlur"]),c=Object(a.useState)(!1),d=Object(l.a)(c,2),u=d[0],m=d[1];return Object(qe.jsx)(Xa,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:r,value:t,InputProps:{value:t},InputLabelProps:{shrink:r||t||u},placeholder:r?"\u26ac \u26ac \u26ac This field is set \u26ac \u26ac \u26ac":""}))})),Sr=n(1023),Ir=Object(f.a)((function(e){return{root:{width:32,height:20,padding:0,margin:e.spacing(1)},switchBase:{padding:2,"&$disabled":{color:le,"& + $track":{backgroundColor:oe,opacity:1}},"&$checked":{transform:"translateX(58%)",color:e.palette.common.white,"&$disabled":{color:le},"& + $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:{}}})),Lr=Object(a.memo)((function(e){var t=Object.assign({},e),n=Ir();return Object(qe.jsx)(Sr.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))})),Pr=n(1158),Fr=n(1024),Dr={noTextTransform:{textTransform:"none"},flex:{display:"flex",alignItems:"center",justifyContent:"start",width:"90%",overflow:"hidden",maxHeight:80},buttonTextContent:{marginLeft:32,textTransform:"none",textAlign:"left"},button:{backgroundColor:ae,marginBottom:16},paragraph:{color:$,marginTop:-10}},Tr=Object(f.a)(Dr),Rr=function(e){var t=e.name,n=e.orientation,a=void 0===n?"vertical":n,r=e.value,i=e.exclusive,o=void 0===i||i,l=e.onChange,c=e.size,s=void 0===c?"small":c,d=Object(q.a)(e,["name","orientation","value","exclusive","onChange","size"]),u=Tr();return Object(qe.jsx)(Pr.a,{size:s,name:t,orientation:a,value:r,exclusive:o,onChange:l,children:d.options.map((function(e){return Object(qe.jsx)(Fr.a,{className:u.button,value:e.value,"aria-label":e.value,children:Object(qe.jsxs)("div",{className:u.flex,children:[Object(qe.jsx)(e.icon,{}),Object(qe.jsxs)("div",{className:u.buttonTextContent,children:[Object(qe.jsx)(_e,{children:e.title}),Object(qe.jsxs)(Ke,{className:u.paragraph,children:[" ",e.description]})]})]})},e.value)}))})},Br=function(e){var t=e.options,n=e.onChange,r=Object(q.a)(e,["options","onChange"]),i=Object(a.useState)(!1),o=Object(l.a)(i,2),c=o[0],d=o[1],u=r.field,m=u.name,h=u.onBlur,p=u.value,b=r.form,f=b.touched,j=b.errors,g=b.setFieldValue,O=b.setFieldTouched,x=!(!f[m]||!j[m]),v=Object(mn.f)(),y=v.initialValues,w=v.values,C="Function"===Ta.a(t)?t(y,w):t,k=function(e){return g(m,e)},E=!!r.shouldStayOpen;return Object(qe.jsx)(_a,Object(s.a)({name:m,onChange:function(e,t){if(n)return n(p,t,k);g(m,t)},onBlur:function(e){m&&O(m,!0),h&&h(e)},value:p,error:x,open:c,options:C,onOpen:function(){if(!r.multiple)return d(!0);d((null===p||void 0===p?void 0:p.length)!==r.limit)},onClose:function(e,t){d(!(!E||"blur"===t))}},r))},Ar=n(1143),Mr=n(24),Wr=Object(a.memo)((function(e){var t=e.classes,n=Object(q.a)(e,["classes"]);return Object(qe.jsx)(Ar.a,Object(s.a)({size:"small",classes:t},n))})),zr=Object(Mr.a)((function(e){return{root:{backgroundColor:re,borderRadius:4,margin:e.spacing(.5,.25),height:18},label:{fontSize:ke,color:ce,fontWeight:Ie,fontFamily:Le,paddingRight:4,paddingLeft:4}}}))(Wr),qr=n(1131),$r=n(1025),Hr=n(1026),Vr=qr.a($r.a(Number),Hr.a(gn.a(NaN))),Ur=function(e){return Vr(e)?e:null},Gr=function(e){return Vr(parseInt(e))?parseInt(e):0},Xr=function(e){return e.toLocaleString("en-US",{maximumFractionDigits:2})},_r={cashOut:{empty:Q,full:J},cashIn:{empty:J,full:Q}},Zr=function(e){var t=e.cashOut,n=e.applyColorVariant,a=e.isLow;return _r[t?"cashOut":"cashIn"][n||!a?"full":"empty"]},Kr={cashbox:{borderColor:Zr,backgroundColor:Zr,height:118,width:function(e){var t=e.width;return null!==t&&void 0!==t?t:80},border:"2px solid",textAlign:"end",display:"inline-block"},fiatBalanceAlertCashbox:{borderColor:Zr,backgroundColor:Zr,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:Zr,display:"inline-block",position:"absolute",margin:0,bottom:0,right:0}},fullPart:{backgroundColor:Zr,"& > p":{color:"white",display:"inline"}}},Qr={row:{display:"flex"},innerRow:{display:"flex",justifyContent:"flex-start"},col2:{marginLeft:14},noMarginText:{marginTop:0,marginBottom:0},link:{marginTop:8},chip:{margin:[[0,0,0,7]]}},Yr=Object(f.a)(Kr),Jr=Object(f.a)(Qr),ei=function(e){var t,n=e.percent,a=void 0===n?0:n,r=e.cashOut,i=void 0!==r&&r,o=e.width,l=e.className,c=e.emptyPartClassName,s=e.labelClassName,d=e.applyColorVariant,u=e.applyFiatBalanceAlertsStyling,m=e.omitInnerPercentage,h=e.isLow,p=Yr({percent:a,cashOut:i,width:o,applyColorVariant:d,isLow:h}),b=a<=51,f=(t={},Object(z.a)(t,p.fiatBalanceAlertCashbox,u),Object(z.a)(t,p.cashbox,!u),t);return Object(qe.jsxs)("div",{className:I()(l,f),children:[Object(qe.jsx)("div",{className:I()(c,p.emptyPart),children:!m&&b&&Object(qe.jsxs)(rt,{className:s,children:[a.toFixed(0),"%"]})}),Object(qe.jsx)("div",{className:p.fullPart,children:!m&&!b&&Object(qe.jsxs)(rt,{className:s,children:[a.toFixed(0),"%"]})})]})},ti=function(e){var t=e.currency,n=e.notes,a=e.total,r=Jr();return Object(qe.jsx)(qe.Fragment,{children:Object(qe.jsx)("div",{className:r.row,children:Object(qe.jsxs)("div",{children:[Object(qe.jsx)("div",{className:r.innerRow,children:Object(qe.jsxs)(Ye,{className:r.noMarginText,children:[n," notes"]})}),Object(qe.jsx)("div",{className:r.innerRow,children:Object(qe.jsxs)(at,{className:r.noMarginText,children:[a," ",t.code]})})]})})})},ni=function(e){var t=e.capacity,n=void 0===t?500:t,a=e.denomination,r=void 0===a?0:a,i=e.currency,o=e.notes,l=e.className,c=e.editingMode,s=void 0!==c&&c,d=e.threshold,u=e.width,m=100*o/n,h=m<d,p=Jr();return Object(qe.jsx)(qe.Fragment,{children:Object(qe.jsxs)("div",{className:p.row,children:[Object(qe.jsx)("div",{className:p.col,children:Object(qe.jsx)(ei,{className:l,percent:m,cashOut:!0,isLow:h,width:u})}),!s&&Object(qe.jsxs)("div",{className:p.col2,children:[Object(qe.jsxs)("div",{className:p.innerRow,children:[Object(qe.jsx)(Ye,{className:p.noMarginText,children:o}),Object(qe.jsx)(zr,{className:p.chip,label:"".concat(r," ").concat(i.code)})]}),Object(qe.jsx)("div",{className:p.innerRow,children:Object(qe.jsxs)(at,{className:p.noMarginText,children:[Xr(o*r)," ",i.code]})})]})]})})},ai=Object(f.a)({flex:{display:"flex"},cashCassette:{height:36,marginRight:14}}),ri=Object(a.memo)((function(e){var t=e.decimalPlaces,n=e.width,r=e.threshold,i=e.inputClassName,o=Object(q.a)(e,["decimalPlaces","width","threshold","inputClassName"]),c=ai(),d=o.field,u=d.name,m=d.onChange,h=d.onBlur,p=d.value,b=o.form,f=b.touched,j=b.errors,g=Object(a.useState)(p),O=Object(l.a)(g,2),x=O[0],v=O[1],y=!(!f[u]||!j[u]);return Object(qe.jsxs)("div",{className:c.flex,children:[Object(qe.jsx)(ni,{className:I()(c.cashCassette,i),notes:x,editingMode:!0,width:n,threshold:r}),Object(qe.jsx)(xr,Object(s.a)({name:u,onChange:function(e){return v(e.target.value),m(e)},onBlur:h,value:p,error:y,decimalPlaces:t},o))]})})),ii=Object(a.memo)((function(e){var t=e.label,n=(e.textAlign,e.fullWidth,e.enabled),a=void 0===n||n,r=e.disabledMessage,i=void 0===r?"":r,o=Object(q.a)(e,["label","textAlign","fullWidth","enabled","disabledMessage"]),l=o.field,c=l.name,d=l.onChange,u=l.value,m={enabled:a,label:t,disabledMessage:i};return Object(qe.jsx)(lr,Object(s.a)({name:c,onChange:d,value:u,settings:m},o))})),oi=Object(a.memo)((function(e){var t=e.label,n=Object(q.a)(e,["label"]),a=n.field,r=a.name,i=a.value,o=n.form.setFieldValue;return Object(qe.jsx)(gr,Object(s.a)({name:r,label:t,value:i,options:n.options,ariaLabel:r,onChange:function(e){o(r,e.target.value),n.resetError&&n.resetError()},className:n.className},n))})),li=Object(a.memo)((function(e){var t=e.decimalPlaces,n=Object(q.a)(e,["decimalPlaces"]),a=n.field,r=a.name,i=a.onChange,o=a.onBlur,l=a.value,c=n.form,d=c.touched,u=c.errors,m=!(!d[r]||!u[r]);return Object(qe.jsx)(xr,Object(s.a)({name:r,onChange:i,onBlur:o,value:l,error:m,decimalPlaces:t},n))})),ci=Object(a.memo)((function(e){var t=e.label,n=Object(q.a)(e,["label"]),a=n.field,r=a.name,i=a.onChange,o=a.value;return Object(qe.jsx)(Er,Object(s.a)({name:r,label:t,value:o,options:n.options,ariaLabel:r,onChange:function(e){i(e),n.resetError&&n.resetError()},className:n.className},n))})),si=Object(a.memo)((function(e){var t=e.isPasswordFilled,n=Object(q.a)(e,["isPasswordFilled"]),a=n.field,r=a.name,i=a.onChange,o=a.onBlur,l=a.value,c=n.form,d=c.touched,u=c.errors,m=!t&&!(!d[r]||!u[r]);return Object(qe.jsx)(Nr,Object(s.a)({name:r,isPasswordFilled:t,onChange:i,onBlur:o,value:l,error:m},n))})),di=Object(a.memo)((function(e){var t=Object.assign({},e),n=t.field,a=n.name,r=n.onChange,i=n.onBlur,o=n.value,l=t.form,c=l.touched,d=l.errors,u=!(!c[a]||!d[a]);return Object(qe.jsx)(Xa,Object(s.a)({name:a,onChange:r,onBlur:i,value:o,error:u},t))}));function ui(){return(ui=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function mi(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var hi=a.createElement("desc",null,"Created with Sketch."),pi=a.createElement("g",{id:"icon/stage/zodiac/complete",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.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}),a.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 bi(e,t){var n=e.title,r=e.titleId,i=mi(e,["title","titleId"]);return a.createElement("svg",ui({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":r},i),n?a.createElement("title",{id:r},n):null,hi,pi)}var fi=a.forwardRef(bi);n.p;function ji(){return(ji=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function gi(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Oi=a.createElement("desc",null,"Created with Sketch."),xi=a.createElement("g",{id:"icon/stage/zodiac/current",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("circle",{id:"Oval-2-Copy",fill:"#1B2559",cx:9,cy:9,r:4}),a.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 vi(e,t){var n=e.title,r=e.titleId,i=gi(e,["title","titleId"]);return a.createElement("svg",ji({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":r},i),n?a.createElement("title",{id:r},n):null,Oi,xi)}var yi,wi=a.forwardRef(vi),Ci=(n.p,Me.tl2),ki=Me.p,Ei=G,Ni={sidebar:Object(z.a)({display:"flex",backgroundColor:Ei,width:520,marginLeft:-300,boxShadow:"-500px 0px 0px 0px ".concat(Ei),borderRadius:"0 20px 0 0",alignItems:"flex-end",padding:24,flexDirection:"column"},(yi=1440,"@media only screen and (max-width: ".concat(yi,")")),{width:"auto",marginLeft:0,minWidth:250,boxShadow:"-200px 0px 0px 0px ".concat(Ei)}),linkWrapper:{cursor:"pointer"},link:{extend:ki,position:"relative",color:me,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:Ci,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:ki,color:me,marginRight:24},itemTextActive:{extend:Ci,color:J},itemTextPast:{color:J},stepperPath:{position:"absolute",height:25,width:1,border:[[1,"solid",me]],right:8,top:18},stepperPast:{border:[[1,"solid",J]]}},Si=Object(f.a)(Ni),Ii=function(e){var t=e.data,n=e.displayName,a=e.isSelected,r=e.onClick,i=e.children,o=e.itemRender,l=e.loading,c=void 0!==l&&l,s=Si();return Object(qe.jsxs)("div",{className:s.sidebar,children:[c&&Object(qe.jsx)(Ke,{children:"Loading..."}),!c&&(null===t||void 0===t?void 0:t.map((function(e,t){var i;return Object(qe.jsx)("div",{className:s.linkWrapper,onClick:function(){return r(e)},children:Object(qe.jsx)("div",{className:I()((i={},Object(z.a)(i,s.activeLink,a(e)),Object(z.a)(i,s.customRenderActiveLink,o&&a(e)),Object(z.a)(i,s.customRenderLink,o),Object(z.a)(i,s.link,!0),i)),children:o?o(e,a(e)):n(e)},t)})}))),!c&&i]})},Li=function(e){var t,n,a=e.step,r=e.it,i=e.idx,o=e.steps,l=Si(),c=a===i,s=i<a,d=i>a;return Object(qe.jsxs)("div",{className:l.item,children:[Object(qe.jsx)("span",{className:I()((t={},Object(z.a)(t,l.itemText,!0),Object(z.a)(t,l.itemTextActive,c),Object(z.a)(t,l.itemTextPast,s),t)),children:r.label}),c&&Object(qe.jsx)(wi,{}),s&&Object(qe.jsx)(fi,{}),d&&Object(qe.jsx)(Ct,{}),i<o.length-1&&Object(qe.jsx)("div",{className:I()((n={},Object(z.a)(n,l.stepperPath,!0),Object(z.a)(n,l.stepperPast,s),n))})]})};function Pi(){return(Pi=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Fi(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Di=a.createElement("g",{id:"icon/ID/photo/new/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.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 Ti(e,t){var n=e.title,r=e.titleId,i=Fi(e,["title","titleId"]);return a.createElement("svg",Pi({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":r},i),void 0===n?a.createElement("title",{id:r},"icon/ID/photo/new/zodiac"):n?a.createElement("title",{id:r},n):null,Di)}var Ri=a.forwardRef(Ti);n.p;function Bi(){return(Bi=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Ai(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Mi=a.createElement("style",{type:"text/css"},"\n\t.st0{fill-rule:evenodd;clip-rule:evenodd;fill:#1B2559;}\n"),Wi=a.createElement("desc",null,"Created with Sketch."),zi=a.createElement("g",{id:"color_x2F_primary_x2F_zodiac",transform:"translate(-0.000000, 0.000000)"},a.createElement("g",{id:"Mask"},a.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 qi(e,t){var n=e.title,r=e.titleId,i=Ai(e,["title","titleId"]);return a.createElement("svg",Bi({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":r},i),n?a.createElement("title",{id:r},n):null,Mi,Wi,zi)}var $i=a.forwardRef(qi);n.p;function Hi(){return(Hi=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Vi(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Ui=a.createElement("desc",null,"Created with Sketch."),Gi=a.createElement("g",{id:"icon/stage/spring/complete",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.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}),a.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 Xi(e,t){var n=e.title,r=e.titleId,i=Vi(e,["title","titleId"]);return a.createElement("svg",Hi({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":r},i),n?a.createElement("title",{id:r},n):null,Ui,Gi)}var _i,Zi,Ki=a.forwardRef(Xi),Qi=(n.p,"100%"),Yi="column",Ji={dialog:{backgroundColor:ae,width:Qi,minHeight:Qi,display:"flex",flexDirection:Yi,padding:0},wrapper:{width:be,height:Qi,margin:"0 auto",flex:1,display:"flex",flexDirection:Yi},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:Me.p,color:me,marginRight:24},itemTextActive:{extend:Me.tl2,color:J},itemTextPast:{color:J},stepperPath:{position:"absolute",height:25,width:1,border:[[1,"solid",me]],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:he},qrCodeImageWrapper:{display:"flex",flexDirection:"column",backgroundColor:"white",border:"5px solid ".concat(J),padding:5,borderRadius:15},qrCodeScanMessage:{display:"flex",flexDirection:"row",alignItems:"center",margin:[[0,0,20,20]],"& > p":{marginLeft:10}}},eo=x()(_i||(_i=Object(c.a)(["\n mutation createPairingTotem($name: String!) {\n createPairingTotem(name: $name)\n }\n"]))),to=x()(Zi||(Zi=Object(c.a)(["\n {\n machines {\n name\n deviceId\n }\n }\n"]))),no=Object(f.a)(Ji),ao=P.a(bn.a,fn.a([],["machines"])),ro={name:""},io=xn.f().shape({name:xn.h().required("Machine name is required.").max(50).test("unique-name","Machine name is already in use.",(function(e,t){return!jn.a((function(t){return gn.a(On.a(t),On.a(e))}),t.options.context.machineNames)}))}),oo=[{label:"Machine name",component:function(e){var t=e.nextStep,n=e.classes,a=e.setQrCode,r=e.setName,i=Object(u.b)(eo,{onCompleted:function(e){var n=e.createPairingTotem;a(n),t()},onError:function(e){return console.log(e)}}),o=Object(l.a)(i,1)[0],c=Object(u.c)(to).data,s=T.a(R.a("name"),(null===c||void 0===c?void 0:c.machines)||{});return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(Ye,{className:n.nameTitle,children:"Machine Name (ex: Coffee shop 01)"}),Object(qe.jsx)(mn.e,{validateOnBlur:!1,validateOnChange:!1,initialValues:ro,validate:function(e){try{io.validateSync(e,{context:{machineNames:s}})}catch(t){return t}},onSubmit:function(e){var t=e.name;r(t),o({variables:{name:t}})},children:function(e){var t=e.errors;return Object(qe.jsxs)(mn.d,{className:n.form,children:[Object(qe.jsx)("div",{children:Object(qe.jsx)(mn.a,{name:"name",label:"Enter machine name",component:di})}),t&&Object(qe.jsx)(Ke,{className:n.errorMessage,children:t.message}),Object(qe.jsx)("div",{className:n.button,children:Object(qe.jsx)(An,{type:"submit",children:"Submit"})})]})}})]})}},{label:"Scan QR code",component:function(e){var t,n=e.classes,r=e.qrCode,i=e.name,o=e.count,l=e.onPaired,c=Object(a.useRef)(null),s=Object(u.c)(to,{pollInterval:1e4}).data;Object(a.useEffect)((function(){return function(){c.current&&clearTimeout(c.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=ao(s)>o&&d;return m&&(c.current=setTimeout((function(){return l(d)}),2e3)),Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(Ye,{className:n.qrTitle,children:"Scan QR code with your new cryptomat"}),Object(qe.jsxs)("div",{className:n.qrCodeWrapper,children:[Object(qe.jsxs)("div",{className:n.qrCodeImageWrapper,children:[Object(qe.jsx)(pn.a,{size:280,fgColor:J,includeMargin:!0,value:r,className:n.qrCodeBorder}),Object(qe.jsxs)("div",{className:n.qrCodeScanMessage,children:[Object(qe.jsx)(Ri,{}),Object(qe.jsx)(Ke,{noMargin:!0,children:"Snap a picture and scan"})]})]}),Object(qe.jsxs)("div",{className:n.qrTextWrapper,children:[Object(qe.jsxs)("div",{className:n.qrTextInfoWrapper,children:[Object(qe.jsx)("div",{className:n.qrTextIcon,children:Object(qe.jsx)(ir,{})}),Object(qe.jsx)("div",{className:n.textWrapper,children:Object(qe.jsx)(Ke,{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(qe.jsxs)("div",{className:n.successMessageWrapper,children:[Object(qe.jsx)("div",{className:n.successMessageIcon,children:Object(qe.jsx)(Ki,{})}),Object(qe.jsx)(Ye,{className:n.successMessage,children:"Machine has been successfully paired!"})]})]})]})]})}}],lo=Object(a.memo)((function(e){var t=e.close,n=e.onPaired,r=no(),i=Object(u.c)(to).data,o=Object(a.useState)(""),c=Object(l.a)(o,2),s=c[0],d=c[1],m=Object(a.useState)(""),h=Object(l.a)(m,2),p=h[0],b=h[1],f=Object(a.useState)(0),j=Object(l.a)(f,2),g=j[0],O=j[1],x=ao(i),v=oo[g].component;return Object(qe.jsx)("div",{children:Object(qe.jsx)(cn.a,{fullScreen:!0,className:r.dialog,open:!0,"aria-labelledby":"form-dialog-title",children:Object(qe.jsx)(sn.a,{className:r.dialog,children:Object(qe.jsxs)("div",{className:r.wrapper,children:[Object(qe.jsxs)("div",{className:r.headerDiv,children:[Object(qe.jsx)(yn,{children:"Add Machine"}),Object(qe.jsx)(dn.a,{disableRipple:!0,onClick:t,children:Object(qe.jsx)(un.a,{color:"error",children:Object(qe.jsx)($i,{})})})]}),Object(qe.jsxs)("div",{className:r.contentDiv,children:[Object(qe.jsx)(Ii,{children:oo.map((function(e,t){return function(e,t,n,a){var r,i,o=e===n,l=n<e,c=n>e;return Object(qe.jsxs)("div",{className:a.item,children:[Object(qe.jsx)("span",{className:I()((r={},Object(z.a)(r,a.itemText,!0),Object(z.a)(r,a.itemTextActive,o),Object(z.a)(r,a.itemTextPast,l),r)),children:t.label}),o&&Object(qe.jsx)(wi,{}),l&&Object(qe.jsx)(fi,{}),c&&Object(qe.jsx)(Ct,{}),n<oo.length-1&&Object(qe.jsx)("div",{className:I()((i={},Object(z.a)(i,a.stepperPath,!0),Object(z.a)(i,a.stepperPast,l),i))})]})}(g,e,t,r)}))}),Object(qe.jsx)("div",{className:r.contentWrapper,children:Object(qe.jsx)(v,{classes:r,nextStep:function(){return O(1)},count:x,onPaired:n,qrCode:s,setQrCode:d,name:p,setName:b})})]})]})})})})}));function co(){return(co=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function so(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var uo=a.createElement("desc",null,"Created with Sketch."),mo=a.createElement("g",{id:"icon/button/add/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.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"}),a.createElement("line",{x1:6,y1:3.69230769,x2:6,y2:8.30769231,id:"Stroke-3",stroke:"#FFFFFF"}),a.createElement("line",{x1:3.69230769,y1:6,x2:8.30769231,y2:6,id:"Stroke-5",stroke:"#FFFFFF"}));function ho(e,t){var n=e.title,r=e.titleId,i=so(e,["title","titleId"]);return a.createElement("svg",co({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":r},i),n?a.createElement("title",{id:r},n):null,uo,mo)}var po=a.forwardRef(ho);n.p;function bo(){return(bo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function fo(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var jo=a.createElement("desc",null,"Created with Sketch."),go=a.createElement("defs",null,a.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"})),Oo=a.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"nav-/-primary-/-1440",transform:"translate(-128.000000, -14.000000)"},a.createElement("g",{id:"icon/lamassu-logo",transform:"translate(128.000000, 14.000000)"},a.createElement("g",{id:"color/amaz/default"},a.createElement("mask",{id:"mask-2",fill:"white"},a.createElement("use",{xlinkHref:"#path-1"})),a.createElement("use",{id:"Mask",fill:"#16D6D3",xlinkHref:"#path-1"})))));function xo(e,t){var n=e.title,r=e.titleId,i=fo(e,["title","titleId"]);return a.createElement("svg",bo({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":r},i),n?a.createElement("title",{id:r},n):null,jo,go,Oo)}var vo=a.forwardRef(xo);n.p;function yo(){return(yo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function wo(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Co=a.createElement("desc",null,"Created with Sketch."),ko=a.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"nav-/-primary-/-1440",transform:"translate(-1295.000000, -19.000000)",stroke:"#FFFFFF",strokeWidth:2},a.createElement("g",{id:"icon/menu/notification",transform:"translate(1296.000000, 20.000000)"},a.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"}),a.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 Eo(e,t){var n=e.title,r=e.titleId,i=wo(e,["title","titleId"]);return a.createElement("svg",yo({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":r},i),n?a.createElement("title",{id:r},n):null,Co,ko)}var No=a.forwardRef(Eo),So=(n.p,Me.p),Io=56,Lo=40;var Po,Fo,Do,To,Ro,Bo,Ao,Mo,Wo,zo,qo,$o,Ho,Vo,Uo,Go,Xo,_o,Zo,Ko={headerContainer:{position:"relative"},header:{backgroundColor:J,color:K,height:Io,display:"flex"},content:{maxWidth:be,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:K,margin:[[20,20,0,20]],"&:hover":{color:K},"&:hover::after":{width:"50%",marginLeft:"-25%"},position:"relative","&:after":{content:'""',display:"block",background:K,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:So,textDecoration:"none",border:"none",color:K,backgroundColor:"transparent"},forceSize:{display:"inline-block",textAlign:"center","&:after":{display:"block",content:"attr(forcesize)",fontWeight:700,height:0,overflow:"hidden",visibility:"hidden"}},activeLink:{color:K,"& li::after":{width:"50%",marginLeft:"-25%"}},addMachine:{marginLeft:"auto"},subheader:{backgroundColor:re,color:K,height:Lo,display:"flex"},subheaderUl:{display:"flex",paddingLeft:0,margin:0},subheaderLi:{listStyle:"none",padding:[[0,20]],"&:first-child":{paddingLeft:0}},subheaderLink:{extend:So,textDecoration:"none",border:"none",color:me},activeSubheaderLink:{textShadow:"0.2px 0 0 currentColor",color:ce},white:{color:K},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:186,width:"9px",height:"9px",backgroundColor:ee,borderRadius:"50%"},popper:{zIndex:1}},Qo=Object(f.a)(Ko),Yo=x()(Po||(Po=Object(c.a)(["\n query getUnread {\n hasUnreadNotifications\n }\n"]))),Jo=function(e){var t=e.item,n=e.classes,r=e.user,i=Object(a.useState)(null),o=Object(l.a)(i,2),c=o[0],s=o[1];return Object(qe.jsx)("div",{className:n.subheader,children:Object(qe.jsx)("div",{className:n.content,children:Object(qe.jsx)("nav",{children:Object(qe.jsx)("ul",{className:n.subheaderUl,children:t.children.map((function(e,t){return L.a(r.role,e.allowedRoles)?Object(qe.jsx)("li",{className:n.subheaderLi,children:Object(qe.jsx)(C.c,{to:{pathname:e.route,state:{prev:c}},className:n.subheaderLink,activeClassName:n.activeSubheaderLink,isActive:function(t){return!!t&&(s(e.route),!0)},children:e.label})},t):Object(qe.jsx)(qe.Fragment,{})}))})})})})},el=P.a(F.a,D.a),tl=Object(a.memo)((function(e){var t=e.tree,n=e.user,r=Object(a.useState)(!1),i=Object(l.a)(r,2),o=i[0],c=i[1],s=Object(a.useState)(null),d=Object(l.a)(s,2),m=d[0],h=d[1],p=Object(a.useState)({x:0,y:0}),b=Object(l.a)(p,2),f=b[0],j=b[1],g=Object(a.useState)(),O=Object(l.a)(g,2),x=O[0],v=O[1],y=Object(a.useState)(!1),k=Object(l.a)(y,2),S=k[0],P=k[1],F=Object(u.c)(Yo),D=F.data,T=F.refetch,R=F.startPolling,B=F.stopPolling,A=Object(a.useRef)(),M=Object(a.useRef)(),W=Object(w.h)(),z=Qo();Object(a.useEffect)((function(){return(null===D||void 0===D?void 0:D.hasUnreadNotifications)?P(!0):el(null===D||void 0===D?void 0:D.hasUnreadNotifications)?P(!1):void 0}),[D]),Object(a.useEffect)((function(){return R(6e4),B}));var q=function(){h(null),document.querySelector("#root").classList.remove("root-notifcenter-open"),document.querySelector("body").classList.remove("body-notifcenter-open")},$=Boolean(m),H=$?"notifications-popper":void 0;return Object(qe.jsxs)("header",{className:z.headerContainer,children:[Object(qe.jsx)("div",{className:z.header,children:Object(qe.jsxs)("div",{className:z.content,children:[Object(qe.jsxs)("div",{onClick:function(){v(!1),W.push("/dashboard")},className:I()(z.logo,z.logoLink),children:[Object(qe.jsx)(vo,{}),Object(qe.jsx)(_e,{className:z.white,children:"Lamassu Admin"})]}),Object(qe.jsx)("nav",{className:z.nav,children:Object(qe.jsx)("ul",{className:z.ul,children:t.map((function(e,t){return L.a(n.role,e.allowedRoles)?Object(qe.jsx)(C.c,{to:e.route||e.children[0].route,isActive:function(t){return!!t&&(v(e),!0)},className:I()(z.link,z.whiteLink),activeClassName:z.activeLink,children:Object(qe.jsx)("li",{className:z.li,children:Object(qe.jsx)("span",{className:z.forceSize,forcesize:e.label,children:e.label})})},t):Object(qe.jsx)(qe.Fragment,{})}))})}),Object(qe.jsxs)("div",{className:z.actionButtonsContainer,children:[Object(qe.jsx)(He,{color:"secondary",Icon:Sn,InverseIcon:po,onClick:function(){return c(!0)},children:"Add machine"}),Object(qe.jsx)(E.a,{onClickAway:q,children:Object(qe.jsxs)("div",{ref:A,children:[Object(qe.jsxs)("button",{onClick:function(e){var t=A.current.getBoundingClientRect();j({x:t.x,y:t.y+5}),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(qe.jsx)(No,{}),S&&Object(qe.jsx)("div",{className:z.hasUnread})]}),Object(qe.jsx)(N.a,{ref:M,id:H,open:$,anchorEl:m,className:z.popper,disablePortal:!1,placement:"bottom-end",modifiers:{offset:{enabled:!0,offset:"100vw"},preventOverflow:{enabled:!0,boundariesElement:"viewport",padding:0}},children:Object(qe.jsx)(ln,{popperRef:M,buttonCoords:f,close:q,hasUnreadProp:S,refetchHasUnreadHeader:T})})]})})]})]})}),x&&x.children&&Object(qe.jsx)(Jo,{item:x,classes:z,user:n}),o&&Object(qe.jsx)(lo,{close:function(){return c(!1)},onPaired:function(e){c(!1),W.push("/maintenance/machine-status",{id:e.deviceId})}})]})})),nl=n(1114),al={wrapper:{display:"flex",alignItems:"center","& > svg":{marginRight:10}},message:{display:"flex",alignItems:"center",color:he,margin:0,whiteSpace:"break-spaces"}},rl=Object(f.a)(al),il=function(e){var t=e.className,n=e.children,a=(Object(q.a)(e,["className","children"]),rl());return Object(qe.jsxs)("div",{className:I()(a.wrapper,t),children:[Object(qe.jsx)(Yt,{}),Object(qe.jsx)(Je,{className:a.message,children:n})]})},ol={titleWrapper:{display:"flex",justifyContent:"space-between",alignItems:"center",flexDirection:"row"},titleAndButtonsContainer:{display:"flex",alignItems:"center"},error:{marginLeft:12},subpageButton:{marginLeft:12},buttonText:{color:ae,fontFamily:"Mont",fontSize:15},icon:{marginRight:6},label:{marginRight:24}},ll=Object(f.a)(ol),cl=function(e){var t=e.className,n=e.title,a=e.error,r=e.labels,i=e.buttons,o=void 0===i?[]:i,l=e.children,c=e.appendix,s=e.appendixRight,d=ll();return Object(qe.jsxs)("div",{className:I()(d.titleWrapper,t),children:[Object(qe.jsxs)("div",{className:d.titleAndButtonsContainer,children:[Object(qe.jsx)(yn,{children:n}),!!c&&c,a&&Object(qe.jsx)(il,{className:d.error,children:"Failed to save"}),o.length>0&&Object(qe.jsx)(qe.Fragment,{children:o.map((function(e,t){return D.a(e.component)?Object(qe.jsx)(Oa,{className:d.subpageButton,Icon:e.icon,InverseIcon:e.inverseIcon,toggle:e.toggle,forceDisable:e.forceDisable,children:Object(qe.jsx)(Qe,{className:d.buttonText,children:e.text})},t):e.component}))})]}),Object(qe.jsxs)(nl.a,{display:"flex",flexDirection:"row",alignItems:"center",children:[(null!==r&&void 0!==r?r:[]).map((function(e,t){var n=e.icon,a=e.label;return Object(qe.jsxs)(nl.a,{display:"flex",alignItems:"center",children:[Object(qe.jsx)("div",{className:d.icon,children:n}),Object(qe.jsx)(at,{className:d.label,children:a})]},t)})),s]}),l]})},sl=n(304),dl=n(1111),ul=n(1134),ml=n(1074),hl=n(1066),pl=n(1124),bl=n(1125),fl=n(1077),jl=n(1133),gl=n(141),Ol=n.n(gl),xl={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"},fidoLoginButtonWrapper:{marginBottom:12},loginButton:{display:"block",width:"100%"},welcomeBackground:{background:"url(/wizard-background.svg) no-repeat center center fixed",backgroundColor:ae,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:he},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:he},enterButton:{display:"none"}},vl="LOGIN",yl="SETUP2FA",wl="INPUT2FA",Cl="FIDO",kl=Object(f.a)(xl),El=x()(Fo||(Fo=Object(c.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"]))),Nl=x()(Do||(Do=Object(c.a)(["\n {\n userData {\n id\n username\n role\n }\n }\n"]))),Sl=function(e){var t=e.state,n=e.dispatch,r=kl(),i=Object(w.h)(),o=Object(a.useContext)(k).setUserData,c=Object(a.useState)(!1),s=Object(l.a)(c,2),d=s[0],m=s[1],h=Object(u.a)(Nl,{onCompleted:function(e){var t=e.userData;o(t),i.push("/")}}),p=Object(l.a)(h,2),b=p[0],f=p[1].error,j=Object(u.b)(El,{onCompleted:function(e){if(e.input2FA){var n={context:{headers:{"Pazuz-Operator-Identifier":Ol.a.encode(t.clientField)}}};return b(n)}return m(!0)}}),g=Object(l.a)(j,2),O=g[0],x=g[1].error,v=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":Ol.a.encode(t.clientField)}}};O(e)}else m(!0)},y=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(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(tt,{className:r.info,children:"Enter your two-factor authentication code"}),Object(qe.jsx)(mn.e,{onSubmit:function(){},initialValues:{},children:Object(qe.jsxs)(mn.d,{children:[Object(qe.jsx)(hr,{name:"2fa",value:t.twoFAField,onChange:function(e){n({type:wl,payload:{twoFAField:e}}),m(!1)},numInputs:6,error:d,shouldAutoFocus:!0}),Object(qe.jsx)("button",{onClick:v,className:r.enterButton})]})}),Object(qe.jsxs)("div",{className:r.twofaFooter,children:[y&&Object(qe.jsx)(Ke,{className:r.errorMessage,children:y}),Object(qe.jsx)(An,{onClick:v,buttonClassName:r.loginButton,children:"Login"})]})]})},Il=n(218),Ll=Object(f.a)(xl),Pl=x()(To||(To=Object(c.a)(["\n {\n userData {\n id\n username\n role\n }\n }\n"]))),Fl=xn.f().shape({localClient:xn.h().required("Client field is required!").email("Username field should be in an email format!"),localRememberMe:xn.b()}),Dl={localClient:"",localRememberMe:!1},Tl=function(e){var t=e.state,n=e.strategy,r=x()(Ro||(Ro=Object(c.a)(["\n query generateAssertionOptions($username: String!",", $domain: String!) {\n generateAssertionOptions(username: $username",", domain: $domain)\n }\n "])),"FIDO2FA"===n?", $password: String!":"","FIDO2FA"===n?", password: $password":""),i=x()(Bo||(Bo=Object(c.a)(["\n mutation validateAssertion(\n $username: String!\n ","\n $rememberMe: Boolean!\n $assertionResponse: JSONObject!\n $domain: String!\n ) {\n validateAssertion(\n username: $username\n ","\n rememberMe: $rememberMe\n assertionResponse: $assertionResponse\n domain: $domain\n )\n }\n "])),"FIDO2FA"===n?", $password: String!":"","FIDO2FA"===n?"password: $password":""),o=Ll(),s=Object(w.h)(),d=Object(a.useContext)(k).setUserData,m=Object(a.useState)(""),h=Object(l.a)(m,2),p=h[0],b=h[1],f=Object(a.useState)(!1),j=Object(l.a)(f,2),g=j[0],O=j[1],v=Object(a.useState)(!1),y=Object(l.a)(v,2),C=y[0],E=y[1],N=Object(a.useState)(!1),S=Object(l.a)(N,2),I=S[0],L=S[1],P=Object(u.b)(i,{onCompleted:function(e){e.validateAssertion?q():L(!0)}}),F=Object(l.a)(P,2),D=F[0],T=F[1].error,R=Object(u.a)(r,{variables:"FIDO2FA"===n?{username:t.clientField,password:t.passwordField,domain:window.location.hostname}:{username:p,domain:window.location.hostname},onCompleted:function(e){var a=e.generateAssertionOptions;Object(Il.a)(a).then((function(e){var a="FIDO2FA"===n?{username:t.clientField,password:t.passwordField,rememberMe:t.rememberMeField,assertionResponse:e,domain:window.location.hostname}:{username:p,rememberMe:g,assertionResponse:e,domain:window.location.hostname};D({variables:a})})).catch((function(e){console.error(e),L(!0)}))}}),B=Object(l.a)(R,2),A=B[0],M=B[1].error,W=Object(u.a)(Pl,{onCompleted:function(e){var t=e.userData;d(t),s.push("/")}}),z=Object(l.a)(W,2),q=z[0],$=z[1].error,H=function(e,t){return e&&t?M||$||T?"Internal server error":e.client&&t.client?e.client:C?"Invalid login.":I?"Code is invalid. Please try again.":null:null};return Object(qe.jsxs)(qe.Fragment,{children:["FIDOPasswordless"===n&&Object(qe.jsx)(mn.e,{validationSchema:Fl,initialValues:Dl,onSubmit:function(e){E(!1),b(e.localClient),O(e.localRememberMe),A()},children:function(e){var t=e.errors,n=e.touched;return Object(qe.jsxs)(mn.d,{id:"fido-form",children:[Object(qe.jsx)(mn.b,{name:"localClient",label:"Client",size:"lg",component:di,fullWidth:!0,autoFocus:!0,className:o.input,error:H(t,n),onKeyUp:function(){C&&E(!1)}}),Object(qe.jsxs)("div",{className:o.rememberMeWrapper,children:[Object(qe.jsx)(mn.b,{name:"localRememberMe",className:o.checkbox,component:ii}),Object(qe.jsx)(rt,{className:o.inputLabel,children:"Keep me logged in"})]}),Object(qe.jsxs)("div",{className:o.twofaFooter,children:[H(t,n)&&Object(qe.jsx)(Ke,{className:o.errorMessage,children:H(t,n)}),Object(qe.jsx)(An,{type:"submit",form:"fido-form",buttonClassName:o.loginButton,children:"Use FIDO"})]})]})}}),"FIDO2FA"===n&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(Ge,{className:o.info,children:"Insert your hardware key and follow the instructions"}),Object(qe.jsx)(An,{type:"button",form:"fido-form",onClick:function(){return A()},buttonClassName:o.loginButton,children:"Use FIDO"})]})]})},Rl=n(35),Bl=n.n(Rl),Al=n(66),Ml=Object(f.a)(xl),Wl=x()(Ao||(Ao=Object(c.a)(["\n mutation login($username: String!, $password: String!) {\n login(username: $username, password: $password)\n }\n"]))),zl=x()(Mo||(Mo=Object(c.a)(["\n query generateAssertionOptions($domain: String!) {\n generateAssertionOptions(domain: $domain)\n }\n"]))),ql=x()(Wo||(Wo=Object(c.a)(["\n mutation validateAssertion(\n $assertionResponse: JSONObject!\n $domain: String!\n ) {\n validateAssertion(assertionResponse: $assertionResponse, domain: $domain)\n }\n"]))),$l=x()(zo||(zo=Object(c.a)(["\n {\n userData {\n id\n username\n role\n }\n }\n"]))),Hl=xn.f().shape({email:xn.h().label("Email").required().email(),password:xn.h().required("Password field is required"),rememberMe:xn.b()}),Vl={email:"",password:"",rememberMe:!1},Ul=function(e,t,n){return e&&t?n?"Invalid email/password combination":e.email&&t.email?e.email:e.password&&t.password?e.password:null:null},Gl=function(e){e.state;var t=e.dispatch,n=e.strategy,r=Ml(),i=Object(w.h)(),o=Object(a.useContext)(k).setUserData,c=Object(u.b)(Wl),s=Object(l.a)(c,2),d=s[0],m=s[1].error,h=function(){var e=Object(Al.a)(Bl.a.mark((function e(n,a,r){var i,o,l;return Bl.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i={variables:{username:n,password:a},context:{headers:{"Pazuz-Operator-Identifier":Ol.a.encode(n)}}},e.next=3,d(i);case 3:if(o=e.sent,(l=o.data).login){e.next=7;break}return e.abrupt("return");case 7:return e.abrupt("return",t({type:l.login,payload:{clientField:n,passwordField:a,rememberMeField:r}}));case 8:case"end":return e.stop()}}),e)})));return function(t,n,a){return e.apply(this,arguments)}}(),p=Object(u.b)(ql,{onCompleted:function(e){return e.validateAssertion&&E()}}),b=Object(l.a)(p,2),f=b[0],j=b[1].error,g=Object(u.a)(zl,{onCompleted:function(e){var t=e.generateAssertionOptions;Object(Il.a)(t).then((function(e){f({variables:{assertionResponse:e,domain:window.location.hostname}})})).catch((function(e){console.error(e)}))}}),O=Object(l.a)(g,2),x=O[0],v=O[1].error,y=Object(u.a)($l,{onCompleted:function(e){var t=e.userData;o(t),i.push("/")}}),C=Object(l.a)(y,2),E=C[0],N=C[1].error;return Object(qe.jsx)(mn.e,{validationSchema:Hl,initialValues:Vl,onSubmit:function(e){return h(e.email,e.password,e.rememberMe)},children:function(e){var a=e.errors,i=e.touched;return Object(qe.jsxs)(mn.d,{id:"login-form",children:[Object(qe.jsx)(mn.b,{name:"email",label:"Email",size:"lg",component:di,fullWidth:!0,autoFocus:!0,className:r.input,error:Ul(a,i,m||j||v||N)}),Object(qe.jsx)(mn.b,{name:"password",size:"lg",component:si,label:"Password",fullWidth:!0,error:Ul(a,i,m||j||v||N)}),Object(qe.jsxs)("div",{className:r.rememberMeWrapper,children:[Object(qe.jsx)(mn.b,{name:"rememberMe",className:r.checkbox,component:ii}),Object(qe.jsx)(it,{children:"Keep me logged in"})]}),Object(qe.jsxs)("div",{className:r.footer,children:[Ul(a,i,m||j||v||N)&&Object(qe.jsx)(Ke,{className:r.errorMessage,children:Ul(a,i,m||j||v||N)}),"FIDO2FA"!==n&&Object(qe.jsx)(An,{type:"button",onClick:function(){return"FIDOUsernameless"===n?x({variables:{domain:window.location.hostname}}):t({type:"FIDO",payload:{}})},buttonClassName:r.loginButton,className:r.fidoLoginButtonWrapper,children:"I have a hardware key"}),Object(qe.jsx)(An,{type:"submit",form:"login-form",buttonClassName:r.loginButton,children:"Login"})]})]})}})},Xl=x()(qo||(qo=Object(c.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"]))),_l=x()($o||($o=Object(c.a)(["\n query get2FASecret($username: String!, $password: String!) {\n get2FASecret(username: $username, password: $password) {\n secret\n otpauth\n }\n }\n"]))),Zl=x()(Ho||(Ho=Object(c.a)(["\n {\n userData {\n id\n username\n role\n }\n }\n"]))),Kl=Object(f.a)(xl),Ql=function(e){var t=e.state,n=(e.dispatch,Kl()),r=Object(w.h)(),i=Object(a.useContext)(k).setUserData,o=Object(a.useState)(null),c=Object(l.a)(o,2),s=c[0],d=c[1],m=Object(a.useState)(null),h=Object(l.a)(m,2),p=h[0],b=h[1],f=Object(a.useState)(!1),j=Object(l.a)(f,2),g=j[0],O=j[1],x=Object(a.useState)(!1),v=Object(l.a)(x,2),y=v[0],C=v[1],E=Object(a.useState)(""),N=Object(l.a)(E,2),S=N[0],I=N[1],L={variables:{username:t.clientField,password:t.passwordField},context:{headers:{"Pazuz-Operator-Identifier":Ol.a.encode(t.clientField)}},onCompleted:function(e){var t=e.get2FASecret;d(t.secret),b(t.otpauth)}},P={variables:{username:t.clientField,password:t.passwordField,rememberMe:t.rememberMeField,codeConfirmation:S},context:{headers:{"Pazuz-Operator-Identifier":Ol.a.encode(t.clientField)}}},F=Object(u.c)(_l,L).error,D=Object(u.a)(Zl,{onCompleted:function(e){var t=e.userData;i(t),r.push("/")}}),T=Object(l.a)(D,1)[0],R=Object(u.b)(Xl,{onCompleted:function(e){var n=e.setup2FA,a={context:{headers:{"Pazuz-Operator-Identifier":Ol.a.encode(t.clientField)}}};n?T(a):C(!0)}}),B=Object(l.a)(R,2),A=B[0],M=B[1].error,W=function(){return M||F?"Internal server error.":6!==S.length&&y?"The code should have 6 characters!":y?"Code is invalid. Please try again.":null},z=function(){6===S.length?A(P):C(!0)};return s&&p&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsxs)("div",{className:n.infoWrapper,children:[Object(qe.jsx)(it,{className:n.info2,children:"This account does not yet have two-factor authentication enabled. To secure the admin, two-factor authentication is required."}),Object(qe.jsx)(it,{className:n.info2,children:"To complete the registration process, scan the following QR code or insert the secret below on a 2FA app, such as Google Authenticator or AndOTP."})]}),Object(qe.jsx)("div",{className:n.qrCodeWrapper,children:Object(qe.jsx)(pn.a,{size:240,fgColor:J,value:p})}),Object(qe.jsxs)("div",{className:n.secretWrapper,children:[Object(qe.jsx)(it,{className:n.secretLabel,children:"Your secret:"}),Object(qe.jsx)(it,{className:g?n.secret:n.hiddenSecret,children:s}),Object(qe.jsx)(He,{disabled:!s&&!p,color:"primary",onClick:function(){O(!g)},children:g?"Hide":"Show"})]}),Object(qe.jsx)("div",{className:n.confirm2FAInput,children:Object(qe.jsx)(mn.e,{onSubmit:function(){},initialValues:{},children:Object(qe.jsxs)(mn.d,{children:[Object(qe.jsx)(hr,{name:"2fa",value:S,onChange:function(e){I(e),C(!1)},numInputs:6,error:y,shouldAutoFocus:!0}),Object(qe.jsx)("button",{onClick:z,className:n.enterButton})]})})}),Object(qe.jsxs)("div",{className:n.twofaFooter,children:[W()&&Object(qe.jsx)(Ke,{className:n.errorMessage,children:W()}),Object(qe.jsx)(An,{onClick:z,buttonClassName:n.loginButton,children:"Done"})]})]})},Yl="FIDO2FA",Jl=Object(f.a)(xl),ec={twoFAField:"",clientField:"",passwordField:"",rememberMeField:!1,loginState:vl},tc=function(e,t){var n=t.type,a=t.payload;return Object(s.a)(Object(s.a)(Object(s.a)({},e),a),{},{loginState:n})},nc=function(){var e=Jl(),t=Object(a.useReducer)(tc,ec),n=Object(l.a)(t,2),r=n[0],i=n[1];return Object(qe.jsx)(Un.a,{elevation:1,children:Object(qe.jsxs)("div",{className:e.wrapper,children:[Object(qe.jsxs)("div",{className:e.titleWrapper,children:[Object(qe.jsx)(vo,{className:e.icon}),Object(qe.jsx)(Ze,{className:e.title,children:"Lamassu Admin"})]}),function(){switch(r.loginState){case vl:return Object(qe.jsx)(Gl,{state:r,dispatch:i,strategy:Yl});case wl:return Object(qe.jsx)(Sl,{state:r,dispatch:i});case yl:return Object(qe.jsx)(Ql,{state:r,dispatch:i});case Cl:return Object(qe.jsx)(Tl,{state:r,strategy:Yl})}}()]})})},ac=Object(f.a)(xl),rc=function(){var e=ac();return Object(qe.jsx)(h.a,{container:!0,spacing:0,direction:"column",alignItems:"center",justify:"center",className:e.welcomeBackground,children:Object(qe.jsx)(h.a,{children:Object(qe.jsx)(nc,{})})})},ic=function(){return new URLSearchParams(Object(w.i)().search)},oc=Object(f.a)(xl),lc=x()(Vo||(Vo=Object(c.a)(["\n query validateRegisterLink($token: String!) {\n validateRegisterLink(token: $token) {\n username\n role\n }\n }\n"]))),cc=x()(Uo||(Uo=Object(c.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"]))),sc=xn.f({password:xn.h().required("A password is required").min(8,"Your password must contain at least ".concat(8," characters")),confirmPassword:xn.h().required("Please confirm the password").oneOf([xn.g("password")],"Passwords must match")}),dc={password:"",confirmPassword:""},uc={username:null,role:null,result:""},mc=function(e,t){var n=t.type,a=t.payload;return Object(s.a)(Object(s.a)(Object(s.a)({},e),a),{},{result:n})},hc=function(e,t,n,a){return e&&t?n||a?"Internal server error":e.password&&t.password?e.password:e.confirmPassword&&t.confirmPassword?e.confirmPassword:null:null},pc=function(){var e,t=oc(),n=Object(w.h)(),r=ic().get("t"),i=null!==(e=ic().get("id"))&&void 0!==e?e:null,o=Object(a.useReducer)(mc,uc),c=Object(l.a)(o,2),s=c[0],d=c[1],m={context:{headers:{"Pazuz-Operator-Identifier":i}},variables:{token:r},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"})}},p=Object(u.c)(lc,m),b=p.error,f=p.loading,j=Object(u.b)(cc,{onCompleted:function(e){e.register&&n.push("/wizard",{fromAuthRegister:!0})}}),g=Object(l.a)(j,2),O=g[0],x=g[1].error;return Object(qe.jsx)(h.a,{container:!0,spacing:0,direction:"column",alignItems:"center",justify:"center",className:t.welcomeBackground,children:Object(qe.jsx)(h.a,{children:Object(qe.jsx)("div",{children:Object(qe.jsx)(Un.a,{elevation:1,children:Object(qe.jsxs)("div",{className:t.wrapper,children:[Object(qe.jsxs)("div",{className:t.titleWrapper,children:[Object(qe.jsx)(vo,{className:t.icon}),Object(qe.jsx)(Ge,{className:t.title,children:"Lamassu Admin"})]}),!f&&"success"===s.result&&Object(qe.jsx)(mn.e,{validationSchema:sc,initialValues:dc,onSubmit:function(e){O({variables:{token:r,username:s.username,password:e.password,role:s.role}})},children:function(e){var n=e.errors,a=e.touched;return Object(qe.jsxs)(mn.d,{id:"register-form",children:[Object(qe.jsx)(mn.b,{name:"password",label:"Insert a password",autoFocus:!0,component:si,size:"lg",fullWidth:!0,className:t.input}),Object(qe.jsx)(mn.b,{name:"confirmPassword",label:"Confirm your password",component:si,size:"lg",fullWidth:!0}),Object(qe.jsxs)("div",{className:t.footer,children:[hc(n,a,b,x)&&Object(qe.jsx)(Ke,{className:t.errorMessage,children:hc(n,a,b,x)}),Object(qe.jsx)(An,{type:"submit",form:"register-form",buttonClassName:t.loginButton,children:"Done"})]})]})}}),!f&&"failure"===s.result&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(it,{children:"Link has expired"}),Object(qe.jsxs)(it,{children:["To obtain a new link, run the command"," ",Object(qe.jsx)("strong",{children:"lamassu-register"})," in your server\u2019s terminal."]})]})]})})})})})},bc=Object(f.a)(xl),fc=x()(Go||(Go=Object(c.a)(["\n query validateReset2FALink($token: String!) {\n validateReset2FALink(token: $token) {\n user_id\n secret\n otpauth\n }\n }\n"]))),jc=x()(Xo||(Xo=Object(c.a)(["\n mutation reset2FA($token: String!, $userID: ID!, $code: String!) {\n reset2FA(token: $token, userID: $userID, code: $code)\n }\n"]))),gc={userID:null,secret:null,otpauth:null,result:null},Oc=function(e,t){var n=t.type,a=t.payload;return Object(s.a)(Object(s.a)(Object(s.a)({},e),a),{},{result:n})},xc=function(){var e=bc(),t=Object(w.h)(),n=new URLSearchParams(Object(w.i)().search).get("t"),r=Object(a.useState)(!1),i=Object(l.a)(r,2),o=i[0],c=i[1],s=Object(a.useState)(!1),d=Object(l.a)(s,2),m=d[0],p=d[1],b=Object(a.useState)(""),f=Object(l.a)(b,2),j=f[0],g=f[1],O=Object(a.useReducer)(Oc,gc),x=Object(l.a)(O,2),v=x[0],y=x[1],C=Object(u.c)(fc,{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,E=C.loading,N=Object(u.b)(jc,{onCompleted:function(e){e.reset2FA?t.push("/"):p(!0)}}),S=Object(l.a)(N,2),I=S[0],L=S[1].error,P=function(){return k?"Internal server error":6!==j.length&&m?"The code should have 6 characters!":L||m?"Code is invalid. Please try again.":null},F=function(){6===j.length?I({variables:{token:n,userID:v.userID,code:j}}):p(!0)};return Object(qe.jsx)(h.a,{container:!0,spacing:0,direction:"column",alignItems:"center",justify:"center",className:e.welcomeBackground,children:Object(qe.jsx)(h.a,{children:Object(qe.jsx)("div",{children:Object(qe.jsx)(Un.a,{elevation:1,children:Object(qe.jsxs)("div",{className:e.wrapper,children:[Object(qe.jsxs)("div",{className:e.titleWrapper,children:[Object(qe.jsx)(vo,{className:e.icon}),Object(qe.jsx)(Ge,{className:e.title,children:"Lamassu Admin"})]}),!E&&"success"===v.result&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)("div",{className:e.infoWrapper,children:Object(qe.jsx)(rt,{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(qe.jsx)("div",{className:e.qrCodeWrapper,children:Object(qe.jsx)(pn.a,{size:240,fgColor:J,value:v.otpauth})}),Object(qe.jsxs)("div",{className:e.secretWrapper,children:[Object(qe.jsx)(rt,{className:e.secretLabel,children:"Your secret:"}),Object(qe.jsx)(rt,{className:o?e.secret:e.hiddenSecret,children:v.secret}),Object(qe.jsx)(He,{color:"primary",onClick:function(){c(!o)},children:o?"Hide":"Show"})]}),Object(qe.jsx)("div",{className:e.confirm2FAInput,children:Object(qe.jsx)(mn.e,{onSubmit:function(){},initialValues:{},children:Object(qe.jsxs)(mn.d,{children:[Object(qe.jsx)(hr,{name:"2fa",value:j,onChange:function(e){g(e),p(!1)},numInputs:6,error:m,shouldAutoFocus:!0}),Object(qe.jsx)("button",{onClick:F,className:e.enterButton})]})})}),Object(qe.jsxs)("div",{className:e.twofaFooter,children:[P()&&Object(qe.jsx)(Ke,{className:e.errorMessage,children:P()}),Object(qe.jsx)(An,{onClick:F,buttonClassName:e.loginButton,children:"Done"})]})]}),!E&&"failure"===v.result&&Object(qe.jsx)(qe.Fragment,{children:Object(qe.jsx)(it,{children:"Link has expired"})})]})})})})})},vc=Object(f.a)(xl),yc=x()(_o||(_o=Object(c.a)(["\n query validateResetPasswordLink($token: String!) {\n validateResetPasswordLink(token: $token) {\n id\n }\n }\n"]))),wc=x()(Zo||(Zo=Object(c.a)(["\n mutation resetPassword($token: String!, $userID: ID!, $newPassword: String!) {\n resetPassword(token: $token, userID: $userID, newPassword: $newPassword)\n }\n"]))),Cc=xn.f().shape({password:xn.h().required("A new password is required").test("len","New password must contain more than 8 characters",(function(e){return e.length>=8})),confirmPassword:xn.h().oneOf([xn.g("password"),null],"Passwords must match")}),kc={password:"",confirmPassword:""},Ec=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},Nc=function(){var e=vc(),t=Object(w.h)(),n=new URLSearchParams(Object(w.i)().search).get("t"),r=Object(a.useState)(null),i=Object(l.a)(r,2),o=i[0],c=i[1],s=Object(a.useState)(!0),d=Object(l.a)(s,2),m=d[0],p=d[1],b=Object(a.useState)(!1),f=Object(l.a)(b,2),j=f[0],g=f[1];Object(u.c)(yc,{variables:{token:n},onCompleted:function(e){var t=e.validateResetPasswordLink;p(!1),t?(g(!0),c(t.id)):g(!1)},onError:function(){p(!1),g(!1)}});var O=Object(u.b)(wc,{onCompleted:function(e){e.resetPassword&&t.push("/")}}),x=Object(l.a)(O,2),v=x[0],y=x[1].error;return Object(qe.jsx)(h.a,{container:!0,spacing:0,direction:"column",alignItems:"center",justify:"center",className:e.welcomeBackground,children:Object(qe.jsx)(h.a,{children:Object(qe.jsx)("div",{children:Object(qe.jsx)(Un.a,{elevation:1,children:Object(qe.jsxs)("div",{className:e.wrapper,children:[Object(qe.jsxs)("div",{className:e.titleWrapper,children:[Object(qe.jsx)(vo,{className:e.icon}),Object(qe.jsx)(Ge,{className:e.title,children:"Lamassu Admin"})]}),!m&&j&&Object(qe.jsx)(mn.e,{validationSchema:Cc,initialValues:kc,onSubmit:function(e){v({variables:{token:n,userID:o,newPassword:e.confirmPassword}})},children:function(t){var n=t.errors,a=t.touched;return Object(qe.jsxs)(mn.d,{id:"reset-password",children:[Object(qe.jsx)(mn.b,{name:"password",autoFocus:!0,size:"lg",component:si,label:"New password",fullWidth:!0,className:e.input}),Object(qe.jsx)(mn.b,{name:"confirmPassword",size:"lg",component:si,label:"Confirm your password",fullWidth:!0}),Object(qe.jsxs)("div",{className:e.footer,children:[Ec(n,a,y)&&Object(qe.jsx)(Ke,{className:e.errorMessage,children:Ec(n,a,y)}),Object(qe.jsx)(An,{type:"submit",form:"reset-password",buttonClassName:e.loginButton,children:"Done"})]})]})}}),!m&&!j&&Object(qe.jsx)(qe.Fragment,{children:Object(qe.jsx)(it,{children:"Link has expired"})})]})})})})})};function Sc(){return(Sc=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Ic(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Lc=a.createElement("desc",null,"Created with Sketch."),Pc=a.createElement("g",{id:"Styleguide",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"icon/direction/cash-in",transform:"translate(-1.000000, 0.000000)",fill:"#16D6D3"},a.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 Fc(e,t){var n=e.title,r=e.titleId,i=Ic(e,["title","titleId"]);return a.createElement("svg",Sc({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":r},i),n?a.createElement("title",{id:r},n):null,Lc,Pc)}var Dc=a.forwardRef(Fc);n.p;function Tc(){return(Tc=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Rc(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Bc=a.createElement("desc",null,"Created with Sketch."),Ac=a.createElement("g",{id:"Styleguide",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"icon/direction/cash-out",transform:"translate(-1.000000, 0.000000)",fill:"#5A67FF"},a.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 Mc(e,t){var n=e.title,r=e.titleId,i=Rc(e,["title","titleId"]);return a.createElement("svg",Tc({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":r},i),n?a.createElement("title",{id:r},n):null,Bc,Ac)}var Wc,zc=a.forwardRef(Mc),qc=(n.p,{headerLabels:{display:"flex",flexDirection:"row","& > div:first-child":{display:"flex",alignItems:"center",marginLeft:0},"& > div":{display:"flex",alignItems:"center",marginLeft:25},"& > div:last-child":{display:"flex",alignItems:"center",marginLeft:64},"& > div > span":{extend:Me.label1,marginLeft:7}},root:{flexGrow:1,display:"flex",marginBottom:120},emptyMachinesRoot:{height:300,backgroundColor:G,border:"solid 2px ".concat(X)},card:{wordWrap:"break-word",boxShadow:"0 0 4px 0 rgba(0, 0, 0, 0.08)",borderRadius:12,padding:24,backgroundColor:K,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"},inline:{display:"inline"},emptyMachinesContent:{display:"flex",flexDirection:"column",height:"100%",justifyContent:"center",alignItems:"center","& > :first-child":{marginTop:0},"& > *":{marginTop:25}},offColor:{color:de}}),$c=n(33),Hc=n.n($c),Vc=n(98),Uc=n(1033),Gc=n(1034),Xc=n(555),_c=n(1035),Zc=n(1036),Kc="advanced",Qc="cashOut",Yc="wallets",Jc="operatorInfo",es="notifications",ts="locale",ns="commissions",as="receipt",rs="coinAtmRadar",is="termsConditions",os="triggersConfig",ls=Uc.a((function(e,t){return Gc.a(T.a(Xc.a(0,e),_c.a(t)))})),cs=Uc.a((function(e,t){return Gc.a(M.a((function(t){return e(t[0])}),_c.a(t)))})),ss=Uc.a((function(e,t){return Zc.a(e,t)?t.slice(e.length):t})),ds=Uc.a((function(e,t){return P.a(function(e){return ls(ss("".concat(e,"_")))}(e),function(e){return cs(Zc.a("".concat(e,"_")))}(e))(t)})),us=Uc.a((function(e,t){return ls((function(t){return"".concat(e,"_").concat(t)}))(t)})),ms={label:{color:se},headerLabels:{whiteSpace:"pre",display:"flex",flexDirection:"row",marginTop:-20},headerLabel:{display:"flex",alignItems:"center"},txOutMargin:{marginLeft:24},tickerLabel:{color:se,marginTop:-5},footer1:{left:0,bottom:0,position:"fixed",width:"100vw",backgroundColor:K,textAlign:"left",zIndex:1,boxShadow:"0px -1px 10px 0px rgba(50, 50, 50, 0.1)",minHeight:96,transition:"min-height 0.5s ease-out","&:hover":{transition:"min-height 0.5s ease-in",minHeight:200}},content1:{width:1200,maxHeight:100,backgroundColor:K,zIndex:2,bottom:-8,margin:"0 auto"}},hs=x()(Wc||(Wc=Object(c.a)(["\n query getData {\n cryptoRates\n cryptoCurrencies {\n code\n display\n }\n config\n accountsConfig {\n code\n display\n }\n }\n"])));Hc.a.config({ROUNDING_MODE:Hc.a.ROUND_HALF_UP});var ps=Object(f.a)(ms),bs=function(){var e,t,n,a,r,i=Object(u.c)(hs).data,o=null!==(e=A.a(["cryptoRates","withCommissions"])(i))&&void 0!==e?e:{},l=ps(),c=null!==(t=A.a(["config"])(i))&&void 0!==t?t:{},s=(Vc.a(o).length,ds("wallets")(c)),d=null!==(n=A.a(["cryptoCurrencies"])(i))&&void 0!==n?n:[],m=null!==(a=A.a(["accountsConfig"])(i))&&void 0!==a?a:[],p=null!==(r=A.a(["locale_fiatCurrency"])(c))&&void 0!==r?r:"";return Object(qe.jsx)("div",{className:l.footer1,children:Object(qe.jsx)("div",{className:l.content1,children:Object(qe.jsx)(h.a,{container:!0,children:Object(qe.jsx)(h.a,{container:!0,className:l.footerContainer1,children:Vc.a(o).map((function(e){return function(e){var t=jl.a(W.a("code",e))(d),n=s["".concat(e,"_ticker")],a=jl.a(W.a("code",n))(m),r=a>-1?m[a].display:"",o=parseFloat(A.a(["cryptoRates","withoutCommissions",e,"cashIn"])(i)),c=parseFloat(A.a(["cryptoRates","withoutCommissions",e,"cashOut"])(i)),u=new Hc.a((o+c)/2).toFormat(2),b=new Hc.a(parseFloat(A.a(["cryptoRates","withCommissions",e,"cashIn"])(i))).toFormat(2),f=new Hc.a(parseFloat(A.a(["cryptoRates","withCommissions",e,"cashOut"])(i))).toFormat(2);return Object(qe.jsxs)(h.a,{item:!0,xs:3,children:[Object(qe.jsx)(rt,{className:l.label,children:d[t].display}),Object(qe.jsxs)("div",{className:l.headerLabels,children:[Object(qe.jsxs)("div",{className:l.headerLabel,children:[Object(qe.jsx)(Dc,{}),Object(qe.jsx)(rt,{children:" ".concat(b," ").concat(p)})]}),Object(qe.jsxs)("div",{className:I()(l.headerLabel,l.txOutMargin),children:[Object(qe.jsx)(zc,{}),Object(qe.jsx)(rt,{children:" ".concat(f," ").concat(p)})]})]}),Object(qe.jsx)(rt,{className:l.tickerLabel,children:"".concat(r,": ").concat(u," ").concat(p)})]},e)}(e)}))})})})})},fs=n(1149),js=n(1041),gs=n(163),Os=n(1121);function xs(){return(xs=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function vs(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var ys=a.createElement("defs",null,a.createElement("circle",{id:"path-100",cx:80,cy:80,r:80}),a.createElement("rect",{id:"path-300",x:28,y:44,width:104,height:116,rx:4}),a.createElement("filter",{x:"-23.1%",y:"-20.7%",width:"146.2%",height:"141.4%",filterUnits:"objectBoundingBox",id:"filter-4"},a.createElement("feOffset",{dx:0,dy:0,in:"SourceAlpha",result:"shadowOffsetOuter1"}),a.createElement("feGaussianBlur",{stdDeviation:8,in:"shadowOffsetOuter1",result:"shadowBlurOuter1"}),a.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"})),a.createElement("rect",{id:"path-5",x:37,y:66,width:84,height:8,rx:2}),a.createElement("mask",{id:"mask-6",maskContentUnits:"userSpaceOnUse",maskUnits:"objectBoundingBox",x:0,y:0,width:84,height:8,fill:"white"},a.createElement("use",{xlinkHref:"#path-5"})),a.createElement("rect",{id:"path-7",x:37,y:78,width:84,height:8,rx:2}),a.createElement("mask",{id:"mask-8",maskContentUnits:"userSpaceOnUse",maskUnits:"objectBoundingBox",x:0,y:0,width:84,height:8,fill:"white"},a.createElement("use",{xlinkHref:"#path-7"})),a.createElement("rect",{id:"path-9",x:37,y:90,width:84,height:8,rx:2}),a.createElement("mask",{id:"mask-10",maskContentUnits:"userSpaceOnUse",maskUnits:"objectBoundingBox",x:0,y:0,width:84,height:8,fill:"white"},a.createElement("use",{xlinkHref:"#path-9"})),a.createElement("rect",{id:"path-11",x:37,y:102,width:84,height:8,rx:2}),a.createElement("mask",{id:"mask-12",maskContentUnits:"userSpaceOnUse",maskUnits:"objectBoundingBox",x:0,y:0,width:84,height:8,fill:"white"},a.createElement("use",{xlinkHref:"#path-11"}))),ws=a.createElement("g",{id:"\\u21B3-v13a",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"transactions_v13a#1-(empty-table)",transform:"translate(-640.000000, -220.000000)"},a.createElement("g",{id:"Group-2",transform:"translate(640.000000, 220.000000)"},a.createElement("g",{id:"Rectangle"},a.createElement("mask",{id:"mask-200",fill:"white"},a.createElement("use",{xlinkHref:"#path-100"})),a.createElement("use",{id:"Mask",fill:"#EBEFFF",xlinkHref:"#path-100"}),a.createElement("g",{mask:"url(#mask-200)"},a.createElement("use",{fill:"black",fillOpacity:1,filter:"url(#filter-4)",xlinkHref:"#path-300"}),a.createElement("use",{fill:"#FFFFFF",fillRule:"evenodd",xlinkHref:"#path-300"}))),a.createElement("use",{id:"Rectangle",stroke:"#5F668A",mask:"url(#mask-6)",strokeDasharray:1,xlinkHref:"#path-5"}),a.createElement("use",{id:"Rectangle-Copy",stroke:"#5F668A",mask:"url(#mask-8)",strokeDasharray:1,xlinkHref:"#path-7"}),a.createElement("use",{id:"Rectangle-Copy-2",stroke:"#5F668A",mask:"url(#mask-10)",strokeDasharray:1,xlinkHref:"#path-9"}),a.createElement("use",{id:"Rectangle-Copy-3",stroke:"#5F668A",mask:"url(#mask-12)",strokeDasharray:1,xlinkHref:"#path-11"}),a.createElement("rect",{id:"Rectangle",fill:"#EBEFFF",x:37,y:56,width:84,height:6,rx:2}))));function Cs(e,t){var n=e.title,r=e.titleId,i=vs(e,["title","titleId"]);return a.createElement("svg",xs({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":r},i),n?a.createElement("title",{id:r},n):null,ys,ws)}var ks=a.forwardRef(Cs),Es=(n.p,Object(f.a)({emptyTable:{width:"100%",display:"flex",flexDirection:"column",alignItems:"center",marginTop:52}})),Ns=Object(a.memo)((function(e){var t=e.message,n=e.className,a=Es();return Object(qe.jsxs)("div",{className:I()(n,a.emptyTable),children:[Object(qe.jsx)(ks,{}),Object(qe.jsx)(_e,{children:t})]})})),Ss=Object(f.a)({table:{tableLayout:"fixed",borderCollapse:"separate",borderSpacing:"0 0"}}),Is=Object(a.memo)((function(e){var t=e.className,n=e.children,a=Object(q.a)(e,["className","children"]),r=Ss();return Object(qe.jsx)("table",Object(s.a)(Object(s.a)({},a),{},{className:I()(r.table,t),children:n}))})),Ls=Object(a.memo)((function(e){var t=e.children,n=Object(q.a)(e,["children"]);return Object(qe.jsx)("tbody",Object(s.a)(Object(s.a)({},n),{},{children:t}))})),Ps=Object(f.a)({td:{padding:[[0,24]]},alignRight:{textAlign:"right"}}),Fs=Object(a.memo)((function(e){var t,n=e.colspan,a=e.rightAlign,r=e.className,i=e.children,o=Object(q.a)(e,["colspan","rightAlign","className","children"]),l=Ps(),c=(t={},Object(z.a)(t,l.td,!0),Object(z.a)(t,l.alignRight,a),t);return Object(qe.jsx)("td",Object(s.a)(Object(s.a)({colSpan:n,className:I()(c,r)},o),{},{children:i}))})),Ds=Object(a.memo)((function(e){var t=e.children,n=Object(q.a)(e,["children"]);return Object(qe.jsx)("thead",Object(s.a)(Object(s.a)({},n),{},{children:t}))})),Ts=Me.tl2,Rs=Object(f.a)({th:{extend:Ts,backgroundColor:Te,height:Pe,textAlign:"left",color:K,padding:"0 ".concat(24,"px")},alignRight:{textAlign:"right"}}),Bs=Object(a.memo)((function(e){var t,n=e.rightAlign,a=e.children,r=e.className,i=Object(q.a)(e,["rightAlign","children","className"]),o=Rs(),l=(t={},Object(z.a)(t,o.th,!0),Object(z.a)(t,o.alignRight,n),t);return Object(qe.jsx)("th",Object(s.a)(Object(s.a)({},i),{},{className:I()(l,r),children:a}))})),As=Me.info2,Ms=Me.p,Ws=Object(f.a)({tr:{extend:Ms,padding:4,height:Fe,backgroundColor:"#ffffff"},lg:{extend:As,height:76},sm:{height:30},error:{backgroundColor:Re},success:{backgroundColor:Be}}),zs=Object(a.memo)((function(e){var t,n=e.className,a=e.children,r=e.header,i=e.error,o=e.success,l=e.size,c=void 0===l?"sm":l,d=Object(q.a)(e,["className","children","header","error","success","size"]),u=Ws(),m=(t={},Object(z.a)(t,u.tr,!r),Object(z.a)(t,u.sm,!r&&"sm"===c),Object(z.a)(t,u.lg,!r&&"lg"===c),Object(z.a)(t,u.error,i),Object(z.a)(t,u.success,o),t);return Object(qe.jsx)("tr",Object(s.a)(Object(s.a)({className:I()(m,n)},d),{},{children:a}))}));function qs(){return(qs=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function $s(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Hs=a.createElement("g",{id:"icon/label/icon/down",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"Group-6"},a.createElement("circle",{id:"Oval",fill:"#FFECEB",cx:6,cy:6,r:6}),a.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"},a.createElement("polyline",{id:"Path-2",points:"3.15780333 -4.54747351e-13 6.15780333 2.82998193 3.15780333 5.65996386"}),a.createElement("line",{x1:5.42178888,y1:2.82998193,x2:-545696821e-21,y2:2.82998193,id:"Path-3"}))));function Vs(e,t){var n=e.title,r=e.titleId,i=$s(e,["title","titleId"]);return a.createElement("svg",qs({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":r},i),n?a.createElement("title",{id:r},n):null,Hs)}var Us=a.forwardRef(Vs);n.p;function Gs(){return(Gs=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Xs(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var _s=a.createElement("g",{id:"icon/label/icon/equal",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"Group-6",fill:"#EBEFFF"},a.createElement("circle",{id:"Oval",cx:6,cy:6,r:6})),a.createElement("g",{id:"Group",transform:"translate(4.000000, 4.000000)",stroke:"#5F668A",strokeLinecap:"square"},a.createElement("line",{x1:0,y1:1,x2:4,y2:1,id:"Line-12"}),a.createElement("line",{x1:0,y1:3,x2:4,y2:3,id:"Line-12"})));function Zs(e,t){var n=e.title,r=e.titleId,i=Xs(e,["title","titleId"]);return a.createElement("svg",Gs({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":r},i),n?a.createElement("title",{id:r},n):null,_s)}var Ks=a.forwardRef(Zs);n.p;function Qs(){return(Qs=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Ys(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Js=a.createElement("g",{id:"icon/label/icon/up",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"Group-6"},a.createElement("circle",{id:"Oval",fill:"#ECFBEF",cx:6,cy:6,r:6}),a.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"},a.createElement("polyline",{id:"Path-2",points:"3.15780333 -4.54747351e-13 6.15780333 2.82998193 3.15780333 5.65996386"}),a.createElement("line",{x1:5.42178888,y1:2.82998193,x2:-545696821e-21,y2:2.82998193,id:"Path-3"}))));function ed(e,t){var n=e.title,r=e.titleId,i=Ys(e,["title","titleId"]);return a.createElement("svg",Qs({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":r},i),n?a.createElement("title",{id:r},n):null,Js)}var td,nd=a.forwardRef(ed),ad=(n.p,6e4),rd=864e5,id=6048e5,od=2592e6,ld=n(568),cd=n(1037),sd={"Pacific/Midway":{short:"SST",long:"Midway Island, Samoa"},"Pacific/Honolulu":{short:"HAST",long:"Hawaii"},"America/Juneau":{short:"AKST",long:"Alaska"},"America/Boise":{short:"MST",long:"Mountain Time"},"America/Dawson":{short:"MST",long:"Dawson, Yukon"},"America/Chihuahua":{short:null,long:"Chihuahua, La Paz, Mazatlan"},"America/Phoenix":{short:"MST",long:"Arizona"},"America/Chicago":{short:"CST",long:"Central Time"},"America/Regina":{short:"CST",long:"Saskatchewan"},"America/Mexico_City":{short:"CST",long:"Guadalajara, Mexico City, Monterrey"},"America/Belize":{short:"CST",long:"Central America"},"America/Detroit":{short:"EST",long:"Eastern Time"},"America/Bogota":{short:"COT",long:"Bogota, Lima, Quito"},"America/Caracas":{short:"VET",long:"Caracas, La Paz"},"America/Santiago":{short:"CLST",long:"Santiago"},"America/St_Johns":{short:"HNTN",long:"Newfoundland and Labrador"},"America/Sao_Paulo":{short:"BRT",long:"Brasilia"},"America/Tijuana":{short:"PST",long:"Tijuana"},"America/Montevideo":{short:"UYT",long:"Montevideo"},"America/Argentina/Buenos_Aires":{short:null,long:"Buenos Aires, Georgetown"},"America/Godthab":{short:null,long:"Greenland"},"America/Los_Angeles":{short:"PST",long:"Pacific Time"},"Atlantic/Azores":{short:"AZOT",long:"Azores"},"Atlantic/Cape_Verde":{short:"CVT",long:"Cape Verde Islands"},GMT:{short:"GMT",long:"UTC"},"Europe/London":{short:"GMT",long:"Edinburgh, London"},"Europe/Dublin":{short:"GMT",long:"Dublin"},"Europe/Lisbon":{short:"WET",long:"Lisbon"},"Africa/Casablanca":{short:"WET",long:"Casablanca, Monrovia"},"Atlantic/Canary":{short:"WET",long:"Canary Islands"},"Europe/Belgrade":{short:"CET",long:"Belgrade, Bratislava, Budapest, Ljubljana, Prague"},"Europe/Sarajevo":{short:"CET",long:"Sarajevo, Skopje, Warsaw, Zagreb"},"Europe/Brussels":{short:"CET",long:"Brussels, Copenhagen, Madrid, Paris"},"Europe/Amsterdam":{short:"CET",long:"Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna"},"Africa/Algiers":{short:"CET",long:"West Central Africa"},"Europe/Bucharest":{short:"EET",long:"Bucharest"},"Africa/Cairo":{short:"EET",long:"Cairo"},"Europe/Helsinki":{short:"EET",long:"Helsinki, Kiev, Riga, Sofia, Tallinn, Vilnius"},"Europe/Athens":{short:"EET",long:"Athens, Istanbul, Minsk"},"Asia/Jerusalem":{short:"IST",long:"Jerusalem"},"Africa/Harare":{short:"CAT",long:"Harare, Pretoria"},"Europe/Moscow":{short:"MSK",long:"Moscow, St. Petersburg, Volgograd"},"Asia/Kuwait":{short:"AST",long:"Kuwait, Riyadh"},"Africa/Nairobi":{short:"EAT",long:"Nairobi"},"Asia/Baghdad":{short:"AST",long:"Baghdad"},"Asia/Tehran":{short:"IRST",long:"Tehran"},"Asia/Dubai":{short:"GST",long:"Abu Dhabi, Muscat"},"Asia/Baku":{short:"AZT",long:"Baku, Tbilisi, Yerevan"},"Asia/Kabul":{short:"AFT",long:"Kabul"},"Asia/Yekaterinburg":{short:"YEKT",long:"Ekaterinburg"},"Asia/Karachi":{short:"PKT",long:"Islamabad, Karachi, Tashkent"},"Asia/Kolkata":{short:"IST",long:"Chennai, Kolkata, Mumbai, New Delhi"},"Asia/Kathmandu":{short:null,long:"Kathmandu"},"Asia/Dhaka":{short:"BST",long:"Astana, Dhaka"},"Asia/Colombo":{short:"IST",long:"Sri Jayawardenepura"},"Asia/Almaty":{short:"ALMT",long:"Almaty, Novosibirsk"},"Asia/Rangoon":{short:null,long:"Yangon Rangoon"},"Asia/Bangkok":{short:"ICT",long:"Bangkok, Hanoi, Jakarta"},"Asia/Krasnoyarsk":{short:"KRAT",long:"Krasnoyarsk"},"Asia/Shanghai":{short:"CST",long:"Beijing, Chongqing, Hong Kong SAR, Urumqi"},"Asia/Kuala_Lumpur":{short:"MYT",long:"Kuala Lumpur, Singapore"},"Asia/Taipei":{short:"CST",long:"Taipei"},"Australia/Perth":{short:"AWST",long:"Perth"},"Asia/Irkutsk":{short:"IRKT",long:"Irkutsk, Ulaanbaatar"},"Asia/Seoul":{short:"KST",long:"Seoul"},"Asia/Tokyo":{short:"JST",long:"Osaka, Sapporo, Tokyo"},"Asia/Yakutsk":{short:"YAKT",long:"Yakutsk"},"Australia/Darwin":{short:"ACST",long:"Darwin"},"Australia/Adelaide":{short:"ACDT",long:"Adelaide"},"Australia/Sydney":{short:"AEDT",long:"Canberra, Melbourne, Sydney"},"Australia/Brisbane":{short:"AEST",long:"Brisbane"},"Australia/Hobart":{short:"AEDT",long:"Hobart"},"Asia/Vladivostok":{short:"VLAT",long:"Vladivostok"},"Pacific/Guam":{short:"ChST",long:"Guam, Port Moresby"},"Asia/Magadan":{short:"MAGT",long:"Magadan, Solomon Islands, New Caledonia"},"Asia/Kamchatka":{short:"PETT",long:"Kamchatka, Marshall Islands"},"Pacific/Fiji":{short:"FJT",long:"Fiji Islands"},"Pacific/Auckland":{short:"NZDT",long:"Auckland, Wellington"},"Pacific/Tongatapu":{short:null,long:"Nuku'alofa"}},dd=function(e){var t=_c.a(e);return gs.a((function(e,t){var n=Object(cd.a)(t[0])<0,a=Object(ld.a)({start:0,end:Math.abs(Object(cd.a)(t[0]))}),r=a.hours.toLocaleString("en-US",{minimumIntegerDigits:2,useGrouping:!1}),i=a.minutes.toLocaleString("en-US",{minimumIntegerDigits:2,useGrouping:!1}),o="(GMT".concat(n?"-":"+").concat(r,":").concat(i,")");return e.push({label:"".concat(o," - ").concat(t[1].long),code:t[0]}),e}),[],t)}(sd),ud=n(1156),md=n(1157),hd=n(1038),pd=function(e){var t=Intl.DateTimeFormat().resolvedOptions().timeZone;return Object(ud.a)(t,e)},bd=function(e,t){var n=Intl.DateTimeFormat().resolvedOptions().timeZone;return Object(md.a)(t,Object(ud.a)(n,e))},fd=function(e,t,n){var a=Intl.DateTimeFormat().resolvedOptions().timeZone,r=Object(md.a)(t,Object(ud.a)(a,e));return Object(hd.a)(n,r)},jd=function(e,t){return Object(hd.a)(t,e)},gd={wrapper:{display:"flex",height:142},percentageBox:{height:142,borderRadius:4,display:"flex",alignItems:"center",justifyContent:"center",whiteSpace:"pre"},label:{color:K},inColor:{backgroundColor:_},outColor:{backgroundColor:Z},other:{minWidth:"6px",borderRadius:2},inWidth:{width:function(e){return"".concat(e,"%")},marginRight:function(e){return 100===e?0:4}},outWidth:{width:function(e){return"".concat(100-e,"%")}}},Od=Object(f.a)(gd),xd=function(e){var t,n=e.cashIn,a=e.cashOut,r=n||0!==a?n:50,i=Od(r),o=function(e){if(!(e<=15))return Object(qe.jsxs)(at,{className:i.label,children:[e,"%"]})},l=(t={},Object(z.a)(t,i.percentageBox,!0),Object(z.a)(t,i.other,r<5&&r>0),t);return Object(qe.jsxs)("div",{className:i.wrapper,children:[Object(qe.jsx)("div",{className:I()(l,i.inColor,i.inWidth),children:o(r)}),Object(qe.jsx)("div",{className:I()(l,i.outColor,i.outWidth),children:o(100-r)})]})},vd=n(28),yd=n(1039),wd=n(328),Cd=n(1040),kd=function(e){var t=e.cashInFee?Number.parseFloat(e.cashInFee):0;return Number.parseFloat(e.commissionPercentage)*Number.parseFloat(e.fiat)+t},Ed=function(e,t,n){return{created:new Date(new Date(e.created).getTime()+t).toISOString(),profit:n}},Nd=function(e){var t=e.created;return new Date(t).toISOString().substring(0,10)},Sd=function(e){var t=e.created;return new Date(t).toISOString().substring(0,13)},Id=function(e,t){var n=e.profit||0;return Object(s.a)(Object(s.a)({},t),{},{profit:n+kd(t)})},Ld={Day:864e5,Week:6048e5,Month:2592e6},Pd=function(e){var t=e.data,n=e.previousTimeData,r=e.previousProfit,i=e.timeFrame,o=Object(a.useRef)(),c=Object(a.useCallback)((function(){var e=vd.select(o.current),a=0,c=0,s=0,d=336-s-c,u=140-a-0,m=function(){var e="Day"===i?Sd:Nd,a=yd.a(wd.a(Id,[],e,t));if(!a.length&&!n.length){var o={created:(new Date).toISOString(),profit:0};return[[o,Ed(o,-36e5,0)],!0]}if(!a.length&&n.length){var l={created:(new Date).toISOString(),profit:0};return[[l,Ed(l,-Ld[i],1)],!1]}if(a.length&&!n.length){var c={created:(new Date).toISOString(),profit:1};return[[c,Ed(c,-Ld[i],0)],!1]}return 1===a.length?[Cd.a({created:new Date(Date.now()-Ld[i]).toISOString(),profit:r},a),!1]:[a,!1]}(),h=Object(l.a)(m,2),p=h[0],b=h[1];e.attr("width",d),e.append("rect").attr("x",0).attr("y",-a).attr("width",d+s+c).attr("height",u+a).attr("fill",ae).attr("transform","translate(".concat(0,",",a,")")),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:ae}]).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(a,")")),j=vd.extent(p,(function(e){return e.created})),g=b?[0,.1]:[0,vd.max(p,(function(e){return e.profit}))],O=vd.scaleLinear().range([u,40]).domain([0,g[1]]),x=vd.scaleTime().domain([new Date(j[0]),new Date(j[1])]).range([0,d]),v=vd.line().x((function(e){return x(new Date(e.created))})).y((function(e){return O(e.profit)})),y=vd.area().x((function(e){return x(new Date(e.created))})).y0(u).y1((function(e){return O(e.profit)}));f.append("path").datum(p).attr("d",y).attr("fill","url(#area-gradient)"),f.append("path").datum(p).attr("d",v).attr("fill","none").attr("stroke-width","2").attr("stroke-linejoin","round").attr("stroke",J)}),[t,i,n,r]);return Object(a.useEffect)((function(){vd.select(o.current).selectAll("*").remove(),c()}),[c,t]),Object(qe.jsx)(qe.Fragment,{children:Object(qe.jsx)("svg",{ref:o})})},Fd=n(1146),Dd=n(1147),Td=n(1148),Rd=function(e){var t,n=e.data,r=e.timeFrame,i=e.timezone,o=Object(a.useRef)(null),l=250,c=555,s=Object(a.useMemo)((function(){return{top:20,right:3.5,bottom:27,left:33.5}}),[]),d=Object(cd.a)(i),u=Date.now()+d,m={Day:[u-rd,u],Week:[u-id,u],Month:[u-od,u]},h=Object(a.useMemo)((function(){return{Day:{freq:24,step:36e5,tick:vd.utcHour.every(4),labelFormat:"%H:%M"},Week:{freq:7,step:864e5,tick:vd.utcDay.every(1),labelFormat:"%a %d"},Month:{freq:30,step:864e5,tick:vd.utcDay.every(2),labelFormat:"%d"}}}),[]),p=Object(a.useCallback)((function(e){return"Day"===r?0===e.getUTCHours():1===e.getUTCDate()}),[r]),b=Object(a.useCallback)((function(e){var t=new Date(e),n=t.getUTCDate(),a=t.getUTCDay(),r=t.getUTCMonth(),i=new Date(t.getTime());i.setUTCDate(n-1);var o=i.getUTCDate(),l=i.getUTCDay(),c=i.getUTCMonth(),s=Array.from(Array(7)).map((function(e,t){return Object(hd.a)("EEE",Object(Fd.a)({days:t},Object(Dd.a)(new Date)))})),d=Array.from(Array(12)).map((function(e,t){return Object(hd.a)("LLL",Object(Fd.a)({months:t},Object(Td.a)(new Date)))}));return{previous:r!==c?d[c]:"".concat(s[l]," ").concat(o),current:r!==c?d[r]:"".concat(s[a]," ").concat(n)}}),[]),f=Object(a.useCallback)((function(e){for(var t=[],n=function(e){var t=h[r].step;return new Date(Math.ceil(e.valueOf()/t)*t)},a=0;a<=h[r].freq;a++){var i=new Date(u-a*h[r].step);n(i)>e[1]||(i<e[0]||t.push(n(i)))}return t}),[u,h,r]),j=vd.scaleUtc().domain(m[r]).range([s.left,c-s.right]),g=vd.scaleLinear().domain([0,1.05*(null!==(t=vd.max(n,(function(e){return new Hc.a(e.fiat).toNumber()})))&&void 0!==t?t:1e3)]).nice().range([l-s.bottom,s.top]),O=Object(a.useCallback)((function(e){e.append("rect").attr("x",0).attr("y",s.top).attr("width",c).attr("height",l-s.top-s.bottom).attr("fill",ae)}),[s]),x=Object(a.useCallback)((function(e){return e.attr("transform","translate(0, ".concat(l-s.bottom,")")).call(vd.axisBottom(j).ticks(h[r].tick).tickFormat((function(e){return vd.timeFormat(h[r].labelFormat)(e.getTime()+e.getTimezoneOffset()*ad)}))).call((function(e){return e.select(".domain").remove()}))}),[s,h,r,j]),v=Object(a.useCallback)((function(e){return e.attr("transform","translate(".concat(s.left,", 0)")).call(vd.axisLeft(g).ticks(5)).call((function(e){return e.select(".domain").remove()})).selectAll("text").attr("dy","-0.25rem")}),[s,g]),y=Object(a.useCallback)((function(e){e.attr("stroke",ie).attr("fill",ie).call((function(e){return e.append("g").selectAll("line").data(f(j.domain())).join("line").attr("x1",(function(e){return.5+j(e)})).attr("x2",(function(e){return.5+j(e)})).attr("y1",s.top).attr("y2",l-s.bottom).attr("stroke-width",1)})).call((function(e){return e.append("g").selectAll("line").data(vd.axisLeft(g).scale().ticks(5)).join("line").attr("y1",(function(e){return.5+g(e)})).attr("y2",(function(e){return.5+g(e)})).attr("x1",s.left).attr("x2",c)})).call((function(e){return e.append("g").selectAll("line").data(f(j.domain()).filter(p)).join("line").attr("class","dateSeparator").attr("x1",(function(e){return.5+j(e)})).attr("x2",(function(e){return.5+j(e)})).attr("y1",s.top-10).attr("y2",l-s.bottom).attr("stroke-width",2).join("text")})).call((function(e){var t,n,a=null===vd||void 0===vd||null===(t=vd.select(".dateSeparator"))||void 0===t||null===(n=t.node())||void 0===n?void 0:n.getBBox();if(a){var r=f(j.domain()).filter(p),i=b(r);return e.append("text").attr("x",a.x-7).attr("y",a.y).attr("text-anchor","end").attr("dy",".25em").text(i.previous)}})).call((function(e){var t,n,a=null===vd||void 0===vd||null===(t=vd.select(".dateSeparator"))||void 0===t||null===(n=t.node())||void 0===n?void 0:n.getBBox();if(a){var r=f(j.domain()).filter(p),i=b(r);return e.append("text").attr("x",a.x+7).attr("y",a.y).attr("text-anchor","start").attr("dy",".25em").text(i.current)}}))}),[s,f,b,j,g,p]),w=Object(a.useCallback)((function(){return vd.selectAll(".tick text").style("stroke",se).style("fill",se).style("stroke-width",0).style("font-family",ge)}),[]),C=Object(a.useCallback)((function(){return vd.selectAll("text").style("stroke",se).style("fill",se).style("stroke-width",0).style("font-family",ge)}),[]),k=Object(a.useCallback)((function(){vd.selectAll(".tick line").style("stroke","transparent").style("fill","transparent")}),[]),E=Object(a.useCallback)((function(e){e.selectAll("circle").data(n).join("circle").attr("cx",(function(e){var t=new Date(e.created);return j(t.setTime(t.getTime()+d))})).attr("cy",(function(e){return g(new Hc.a(e.fiat).toNumber())})).attr("fill",(function(e){return"cashIn"===e.txClass?_:Z})).attr("r",3.5)}),[n,d,j,g]),N=Object(a.useCallback)((function(){var e=vd.select(o.current).attr("viewBox",[0,0,c,l]);return e.append("g").call(O),e.append("g").call(y),e.append("g").call(x),e.append("g").call(v),e.append("g").call(w),e.append("g").call(C),e.append("g").call(k),e.append("g").call(E),e.node()}),[O,y,x,v,E,C,k,w]);return Object(a.useEffect)((function(){vd.select(o.current).selectAll("*").remove(),N()}),[N]),Object(qe.jsx)("svg",{ref:o})},Bd=function(e){var t=e.info,n=e.label;return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(Qe,{style:{marginBottom:0},children:t}),Object(qe.jsx)(at,{style:{margin:0},children:n})]})},Ad={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"},percentUp:{fontSize:ye,fontFamily:ge,fontWeight:700,color:U,height:10},percentDown:{fontSize:ye,fontFamily:ge,fontWeight:700,color:Q,height:13},percentNeutral:{fontSize:ye,fontFamily:ge,fontWeight:700,color:$},profitContainer:{display:"flex",justifyContent:"space-between",margin:"23px 26px -30px 16px",position:"relative"},profitLabel:{fontSize:ye,fontFamily:ge,fontWeight:700,color:ce},directionIcon:{width:16,height:16,marginBottom:-2,marginRight:4},emptyTransactions:{paddingTop:40},commissionProfitTitle:{marginBottom:16},graphHeader:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",marginBottom:16},labelWrapper:{display:"flex",flexDirection:"row",alignItems:"center","& > div":{display:"flex",flexDirection:"row",alignItems:"center",marginLeft:15,"&:first-child":{marginLeft:0},"& > p":{marginLeft:8}}},txGraphContainer:{height:300,marginTop:30},commissionsGraphContainer:{height:250,marginTop:30},verticalLine:{height:15,width:1,backgroundColor:de,marginLeft:31,marginRight:16}},Md=Object(f.a)(Ad),Wd=["Month","Week","Day"],zd=function(e){var t=e.handleSetRange,n=e.showPicker,r=Md(),i=Object(a.useState)("Day"),o=Object(l.a)(i,2),c=o[0],s=o[1],d=gn.a(c);return Object(qe.jsxs)("div",{className:I()(r.titleWrapper),children:[Object(qe.jsx)("div",{className:r.titleAndButtonsContainer,children:Object(qe.jsx)(_e,{className:r.h4,children:"System performance"})}),n&&Object(qe.jsx)("div",{className:r.navContainer,children:Wd.map((function(e,n){return Object(qe.jsx)("div",{onClick:function(e){return n=e.target.innerText,s(n),void t(n);var n},className:d(e)?I()(r.newHighlightedLabel,r.navButton):I()(r.label,r.navButton),children:e},n)}))})]})};Hc.a.config({ROUNDING_MODE:Hc.a.ROUND_HALF_UP});var qd=T.a(R.a("fiat")),$d=Object(f.a)(Ad),Hd=x()(td||(td=Object(c.a)(["\n query getData($excludeTestingCustomers: Boolean) {\n transactions(excludeTestingCustomers: $excludeTestingCustomers) {\n fiatCode\n fiat\n cashInFee\n commissionPercentage\n created\n txClass\n error\n profit\n dispense\n sendConfirmed\n }\n fiatRates {\n code\n name\n rate\n }\n config\n }\n"]))),Vd=function(){var e,t,n,r,i,o,c=$d(),d=Object(a.useState)("Day"),m=Object(l.a)(d,2),p=m[0],b=m[1],f=Object(u.c)(Hd,{variables:{excludeTestingCustomers:!0}}),j=f.data,g=f.loading,O=ds("locale")(null===j||void 0===j?void 0:j.config).fiatCurrency,x=ds("locale")(null===j||void 0===j?void 0:j.config).timezone,v=Date.now(),y={Day:[v-rd,v],Week:[v-id,v],Month:[v-od,v]},w=function(e){return function(t){return null===t.error&&(!("cashOut"===t.txClass&&!t.dispense)&&(!("cashIn"===t.txClass&&!t.sendConfirmed)&&(e?null===t.error&&Object(fs.a)(bd(y[p][1],x),bd(t.created,x))&&Object(fs.a)(bd(t.created,x),bd(y[p][0],x)):null===t.error&&Object(fs.a)(bd(t.created,x),bd(y[p][1],x))&&Object(fs.a)(bd(y[p][0],x),bd(t.created,x)))))}},C=function(e){if(e.fiatCode===O)return e;var t=Aa.a(W.a("code",e.fiatCode))(j.fiatRates),n=Aa.a(W.a("code",O))(j.fiatRates).rate/t.rate;return Object(s.a)(Object(s.a)({},e),{},{fiat:parseFloat(e.fiat)*n})},k=T.a(C)(M.a(w(!1),null!==(e=null===j||void 0===j?void 0:j.transactions)&&void 0!==e?e:[])),E=T.a(C)(M.a(w(!0),null!==(t=null===j||void 0===j?void 0:j.transactions)&&void 0!==t?t:[])),N=function(e){return gs.a((function(e,t){return e.plus(t.profit)}),new Hc.a(0),e)},S=function(){var e=Os.a(W.a("txClass","cashIn"))(k),t=Object(l.a)(e,2),n=t[0],a=t[1],r=n.length+a.length;return 0===r?{cashIn:0,cashOut:0}:{cashIn:Math.round(n.length/r*100),cashOut:Math.round(a.length/r*100)}},L=function(){var e=N(k),t=N(E);return e.eq(t)?0:t.eq(0)?100:e.minus(t).times(100).div(t).toNumber()}(),P=(n={},Object(z.a)(n,c.percentDown,L<0),Object(z.a)(n,c.percentUp,L>0),Object(z.a)(n,c.percentNeutral,0===L),n);return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(zd,{showPicker:!g&&!Wa.a(j.transactions),handleSetRange:b}),!g&&Wa.a(j.transactions)&&Object(qe.jsx)(Ns,{className:c.emptyTransactions,message:"No transactions so far"}),!g&&!Wa.a(j.transactions)&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsxs)(h.a,{container:!0,spacing:2,children:[Object(qe.jsx)(h.a,{item:!0,xs:3,children:Object(qe.jsx)(Bd,{info:bn.a(k),label:"transactions"})}),Object(qe.jsx)(h.a,{item:!0,xs:3,children:Object(qe.jsx)(Bd,{info:new Hc.a(js.a(qd(k))).toFormat(2),label:"".concat(null===j||void 0===j?void 0:j.config.locale_fiatCurrency," volume")})})]}),Object(qe.jsx)(h.a,{container:!0,className:c.txGraphContainer,children:Object(qe.jsxs)(h.a,{item:!0,xs:12,children:[Object(qe.jsxs)("div",{className:c.graphHeader,children:[Object(qe.jsx)(rt,{noMargin:!0,children:"Transactions"}),Object(qe.jsxs)("div",{className:c.labelWrapper,children:[Object(qe.jsxs)(Ke,{noMargin:!0,children:[null!==(r=null===(i=sd[x])||void 0===i?void 0:i.short)&&void 0!==r?r:null===(o=sd[x])||void 0===o?void 0:o.long," ","timezone"]}),Object(qe.jsx)("span",{className:c.verticalLine}),Object(qe.jsxs)("div",{children:[Object(qe.jsx)("svg",{width:8,height:8,children:Object(qe.jsx)("rect",{width:8,height:8,rx:4,fill:_})}),Object(qe.jsx)(at,{noMargin:!0,children:"In"})]}),Object(qe.jsxs)("div",{children:[Object(qe.jsx)("svg",{width:8,height:8,children:Object(qe.jsx)("rect",{width:8,height:8,rx:4,fill:Z})}),Object(qe.jsx)(at,{noMargin:!0,children:"Out"})]})]})]}),Object(qe.jsx)(Rd,{timeFrame:p,data:k,timezone:x})]})}),Object(qe.jsxs)(h.a,{container:!0,className:c.commissionGraphContainer,children:[Object(qe.jsxs)(h.a,{item:!0,xs:8,children:[Object(qe.jsx)(rt,{noMargin:!0,className:c.commissionProfitTitle,children:"Profit from commissions"}),Object(qe.jsxs)("div",{className:c.profitContainer,children:[Object(qe.jsx)("div",{className:c.profitLabel,children:"".concat(N(k).toFormat(2)," ").concat(null===j||void 0===j?void 0:j.config.locale_fiatCurrency)}),Object(qe.jsxs)("div",{className:I()(P),children:[0===L?Object(qe.jsx)(Ks,{className:c.directionIcon}):L>0?Object(qe.jsx)(nd,{className:c.directionIcon}):Object(qe.jsx)(Us,{className:c.directionIcon}),"".concat(new Hc.a(L).toFormat(2),"%")]})]}),Object(qe.jsx)(Pd,{timeFrame:p,data:k,previousTimeData:E,previousProfit:N(E)})]}),Object(qe.jsxs)(h.a,{item:!0,xs:4,children:[Object(qe.jsxs)(h.a,{container:!0,className:c.graphHeader,children:[Object(qe.jsx)(rt,{noMargin:!0,children:"Direction"}),Object(qe.jsxs)("div",{className:c.labelWrapper,children:[Object(qe.jsxs)("div",{children:[Object(qe.jsx)("svg",{width:8,height:8,children:Object(qe.jsx)("rect",{width:8,height:8,rx:2,fill:_})}),Object(qe.jsx)(at,{noMargin:!0,children:"In"})]}),Object(qe.jsxs)("div",{children:[Object(qe.jsx)("svg",{width:8,height:8,children:Object(qe.jsx)("rect",{width:8,height:8,rx:2,fill:Z})}),Object(qe.jsx)(at,{noMargin:!0,children:"Out"})]})]})]}),Object(qe.jsx)(h.a,{item:!0,xs:!0,children:Object(qe.jsx)(xd,{cashIn:S().cashIn,cashOut:S().cashOut})})]})]})]})]})},Ud=Object(f.a)(qc),Gd=function(){var e=Ud();return Object(qe.jsx)(h.a,{item:!0,xs:12,className:e.displayFlex,children:Object(qe.jsx)("div",{className:e.card,children:Object(qe.jsx)(Vd,{})})})},Xd=n(1042),_d=Object.freeze({DEFAULT:"default",SHRUNK:"shrunk",EXPANDED:"expanded"}),Zd={card:{wordWrap:"break-word",boxShadow:"0 0 4px 0 rgba(0, 0, 0, 0.08)",borderRadius:12,padding:24,backgroundColor:K}},Kd=Object(f.a)(Zd),Qd=function(e){var t=e.className,n=e.state,a=e.shrunkComponent,r=e.children,i=Kd();return Object(qe.jsx)(h.a,{item:!0,className:I()(t,i.card),children:n===_d.SHRUNK?a:r})},Yd={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:$,marginLeft:-5,height:100},table:{maxHeight:465,overflowX:"hidden",overflowY:"auto"},listItemText:{margin:"8px 0 8px 0"},linkIcon:{marginLeft:"auto",cursor:"pointer"}},Jd=n(1018),eu=n(973),tu=n(104);function nu(){return(nu=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function au(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var ru=a.createElement("g",{id:"DASHBOARD",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"dashboard_v9#1-(week)",transform:"translate(-772.000000, -212.000000)"},a.createElement("g",{id:"dashboard/row/alert/positive",transform:"translate(756.000000, 204.000000)"},a.createElement("g",{id:"Group-2",transform:"translate(16.000000, 8.000000)"},a.createElement("polygon",{id:"Rectangle-2-Copy-45",fill:"#FF584A",fillRule:"nonzero",points:"0 11 16 11 16 16 0 16"}),a.createElement("rect",{id:"Rectangle-Copy-10",stroke:"#FF584A",strokeWidth:2,x:1,y:1,width:14,height:14})))));function iu(e,t){var n=e.title,r=e.titleId,i=au(e,["title","titleId"]);return a.createElement("svg",nu({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":r},i),void 0===n?a.createElement("title",{id:r},"07E3DD15-D5E4-46A8-BF7B-064F598230CE"):n?a.createElement("title",{id:r},n):null,ru)}var ou=a.forwardRef(iu);n.p;function lu(){return(lu=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function cu(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var su=a.createElement("defs",null,a.createElement("circle",{id:"path-1-right",cx:10,cy:10,r:10})),du=a.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"pop-up/action/download-logs/date-range-copy-2",transform:"translate(-232.000000, -187.000000)"},a.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)"},a.createElement("mask",{id:"mask-2",fill:"white"},a.createElement("use",{xlinkHref:"#path-1-right"})),a.createElement("use",{id:"Mask",fill:"#EBEFFF",fillRule:"nonzero",xlinkHref:"#path-1-right"}),a.createElement("g",{id:"icon/sf-small/wizzard",mask:"url(#mask-2)",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{transform:"translate(6.666667, 6.000000)",id:"Group"},a.createElement("g",null,a.createElement("polyline",{id:"Path-3",stroke:"#1B2559",strokeWidth:2,points:"0 4.83333333 3.33333333 8.16666667 6.66666667 4.83333333"}),a.createElement("line",{x1:3.33333333,y1:.25,x2:3.33333333,y2:6.5,id:"Path-4",stroke:"#1B2559",strokeWidth:2})))))));function uu(e,t){var n=e.title,r=e.titleId,i=cu(e,["title","titleId"]);return a.createElement("svg",lu({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":r},i),n?a.createElement("title",{id:r},n):null,su,du)}var mu,hu,pu,bu,fu=a.forwardRef(uu),ju=(n.p,Object(f.a)(Yd)),gu={error:Object(qe.jsx)(Yt,{style:{height:20,width:20,marginRight:12}}),fiatBalance:Object(qe.jsx)(ou,{style:{height:18,width:18,marginRight:14}})},Ou={error:"/maintenance/machine-status",fiatBalance:"/maintenance/cash-cassettes",cryptoBalance:"/maintenance/funding"},xu=function(e){var t=e.numToRender,n=e.alerts,a=e.machines,r=Object(w.h)(),i=ju(),o=tu.a(0,t,n),l=function(e){var t=e.detail.deviceId;if(!t)return"".concat(e.message);var n=za.a("Unpaired device",a[t]);return"".concat(e.message," - ").concat(n)};return Object(qe.jsx)(Jd.a,{dense:!0,className:i.table,children:o.map((function(e,t){return Object(qe.jsxs)(eu.a,{children:[gu[e.type]||Object(qe.jsx)(Mt,{style:{height:23,width:23,marginRight:8}}),Object(qe.jsx)(Ke,{className:i.listItemText,children:l(e)}),Object(qe.jsx)(fu,{className:i.linkIcon,onClick:function(){return r.push(Ou[e.type]||"/dashboard")}})]},t)}))})},vu=x()(mu||(mu=Object(c.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"]))),yu=Object(f.a)(Yd),wu=function(e){var t,n,a,r=e.onReset,i=e.onExpand,o=e.size,l=yu(),c=o===_d.EXPANDED,s=Object(u.c)(vu).data,d=null!==(t=A.a(["alerts"])(s))&&void 0!==t?t:[],m=P.a(T.a(R.a("name")),B.a(R.a("deviceId")))(null!==(n=null===s||void 0===s?void 0:s.machines)&&void 0!==n?n:[]),p=d.length,b=(a={},Object(z.a)(a,l.alertsTableContainer,!c),Object(z.a)(a,l.expandedAlertsTableContainer,c),a);return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsxs)("div",{className:l.container,children:[Object(qe.jsx)(_e,{className:l.h4,children:"Alerts (".concat(p,")")}),c&&Object(qe.jsx)(at,{className:l.upperButtonLabel,children:Object(qe.jsx)(Xd.a,{onClick:r,size:"small",disableRipple:!0,disableFocusRipple:!0,className:l.button,children:"Show less"})})]}),Object(qe.jsx)(h.a,{className:I()(b),container:!0,spacing:1,children:Object(qe.jsxs)(h.a,{item:!0,xs:12,children:[!d.length&&Object(qe.jsx)(at,{className:l.noAlertsLabel,children:"No new alerts. Your system is running smoothly."}),Object(qe.jsx)(xu,{numToRender:c?d.length:3,alerts:d,machines:m})]})}),!c&&p>3&&Object(qe.jsx)(h.a,{item:!0,xs:12,children:Object(qe.jsx)(at,{className:l.centerLabel,children:Object(qe.jsx)(Xd.a,{onClick:function(){return i("alerts")},size:"small",disableRipple:!0,disableFocusRipple:!0,className:l.button,children:"Show all (".concat(d.length,")")})})})]})},Cu=n(1045),ku=n(1049),Eu=n(1043),Nu=n(1044),Su=n(1046),Iu=n(1047),Lu=n(570),Pu=n(1048),Fu=n(301),Du=n(1050),Tu={error:Q,warning:"#ff7311",success:ne,neutral:J},Ru={error:Y,warning:"#fbf3ec",success:V,neutral:G},Bu=Object(f.a)({root:{borderRadius:4,marginTop:4,marginRight:2,marginBottom:4,marginLeft:2,height:24,backgroundColor:function(e){var t=e.type;return Ru[t]}},label:{fontSize:ke,fontWeight:Ie,fontFamily:Le,paddingRight:4,paddingLeft:4,color:function(e){var t=e.type;return Tu[t]}}}),Au=function(e){var t=e.status,n=Bu({type:t.type});return Object(qe.jsx)(Ar.a,{type:t.type,label:t.label,classes:n})},Mu=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],a={label:"+".concat(t.length-1),type:n.type};return Object(qe.jsxs)("div",{children:[Object(qe.jsx)(Au,{status:n}),t.length>1&&Object(qe.jsx)(Au,{status:a})]})},Wu={container:{display:"flex",justifyContent:"space-between"},label:{margin:0,color:se},row:{backgroundColor:ae,borderBottom:"none"},clickableRow:{cursor:"pointer"},header:{display:"flex",alignItems:"center",whiteSpace:"pre"},error:{color:he},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}},zu=x()(hu||(hu=Object(c.a)(["\n query getConfig {\n config\n }\n"]))),qu=Object(f.a)(Wu),$u=Object(Mr.a)({root:{borderBottom:"4px solid white",padding:0,paddingLeft:15}})(Eu.a),Hu=Object(Mr.a)({root:{borderBottom:"4px solid white",padding:0,paddingLeft:15,backgroundColor:"white"}})(Eu.a),Vu=function(e){var t,n=e.machines,a=void 0===n?[]:n,r=e.numToRender,i=qu(),o=Object(w.h)(),l=Object(u.c)(zu).data,c=ds("notifications",null!==(t=A.a(["config"],l))&&void 0!==t?t:{}),s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500;return Math.round(e/t*100)},m=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:500,a=s(t,n),r=Lu.a(A.a(["fillingPercentageCassette".concat(e)]),za.a(20))(c);return a<r?Object(qe.jsx)(nt,{className:i.error,children:"".concat(a,"%")}):Object(qe.jsx)(nt,{children:"".concat(a,"%")})},h=function(e){var t=e.name,n=e.deviceId;return o.push("/machines/".concat(n),{selectedMachine:t})},p=Math.max.apply(Math,Object(d.a)(T.a((function(e){return e.numberOfCassettes}),a)).concat([0]));return Object(qe.jsx)(Nu.a,{className:i.table,children:Object(qe.jsxs)(Cu.a,{children:[Object(qe.jsx)(Su.a,{children:Object(qe.jsxs)(Iu.a,{children:[Object(qe.jsx)(Hu,{children:Object(qe.jsx)("div",{className:i.header,children:Object(qe.jsx)(rt,{className:i.label,children:"Machines"})})}),Object(qe.jsx)(Hu,{children:Object(qe.jsx)("div",{className:"".concat(i.header," ").concat(i.statusHeader),children:Object(qe.jsx)(rt,{className:i.label,children:"Status"})})}),T.a((function(e){return Object(qe.jsx)(Hu,{children:Object(qe.jsxs)("div",{className:i.header,children:[Object(qe.jsx)(zc,{}),Object(qe.jsxs)(rt,{className:i.label,children:[" ",e+1]})]})})}),Pu.a(Fu.a,p))]})}),Object(qe.jsx)(ku.a,{children:a.map((function(e,t){return t<r?Object(qe.jsxs)(Iu.a,{onClick:function(){return h(e)},className:I()(i.row),children:[Object(qe.jsx)($u,{align:"left",children:Object(qe.jsxs)("div",{className:i.machineNameWrapper,children:[Object(qe.jsx)(nt,{children:e.name}),Object(qe.jsx)(fu,{className:I()(i.machineRedirectIcon,i.clickableRow),onClick:function(){return h(e)}})]})}),Object(qe.jsx)($u,{children:Object(qe.jsx)(Au,{status:e.statuses[0]})}),T.a((function(t){return e.numberOfCassettes>=t?Object(qe.jsx)($u,{align:"left",children:m(t,e["cassette".concat(t)])}):Object(qe.jsx)($u,{align:"left",children:Object(qe.jsx)(nt,{children:"\u2014 %"})})}),Du.a(1,p+1))]},e.deviceId+t):null}))})]})})},Uu=Object(f.a)(Wu),Gu=x()(pu||(pu=Object(c.a)(["\n query getData {\n machines {\n name\n deviceId\n cashbox\n cassette1\n cassette2\n cassette3\n cassette4\n numberOfCassettes\n statuses {\n label\n type\n }\n }\n serverVersion\n uptime {\n name\n state\n uptime\n }\n }\n"]))),Xu=function(e){var t,n,a=e.onReset,r=e.onExpand,i=e.size,o=Uu(),l=Object(u.c)(Gu),c=l.data,s=l.loading,d=null!==(t=A.a(["machines"])(c))&&void 0!==t?t:[],m=i===_d.EXPANDED,p=(n={},Object(z.a)(n,o.machinesTableContainer,!m),Object(z.a)(n,o.expandedMachinesTableContainer,m),n);return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsxs)("div",{className:o.container,children:[Object(qe.jsx)(_e,{className:o.h4,children:"System status"})," ",m&&Object(qe.jsx)(at,{className:o.upperButtonLabel,children:Object(qe.jsx)(Xd.a,{onClick:a,size:"small",disableRipple:!0,disableFocusRipple:!0,className:o.button,children:"Show less"})})]}),!s&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsxs)(h.a,{container:!0,spacing:1,children:[Object(qe.jsxs)(h.a,{item:!0,xs:4,children:[Object(qe.jsx)(nt,{className:o.tl2,children:null===c||void 0===c?void 0:c.serverVersion}),Object(qe.jsx)(at,{className:o.label1,children:" server version"})]}),Object(qe.jsx)(h.a,{item:!0,xs:4})]}),Object(qe.jsx)(h.a,{container:!0,spacing:1,className:I()(p),children:Object(qe.jsx)(h.a,{item:!0,xs:12,children:Object(qe.jsx)(Vu,{numToRender:m?1/0:4,machines:d})})}),!m&&d.length>4&&Object(qe.jsx)(h.a,{item:!0,xs:12,children:Object(qe.jsx)(at,{className:o.centerLabel,children:Object(qe.jsx)(Xd.a,{onClick:function(){return r()},size:"small",disableRipple:!0,disableFocusRipple:!0,className:o.button,children:"Show all (".concat(d.length,")")})})})]})]})},_u=Object(f.a)(qc),Zu=function(e){var t=e.title,n=e.buttonName,a=e.onUnshrink,r=_u();return Object(qe.jsxs)("div",{className:r.container,children:[Object(qe.jsx)(_e,{className:r.h4,children:t}),Object(qe.jsx)(at,{className:r.upperButtonLabel,children:Object(qe.jsx)(Xd.a,{onClick:a,size:"small",disableRipple:!0,disableFocusRipple:!0,className:r.button,children:n})})]})},Ku=function(){var e,t,n=_u(),r=Object(a.useState)(_d.DEFAULT),i=Object(l.a)(r,2),o=i[0],c=i[1],s=Object(a.useState)(_d.DEFAULT),d=Object(l.a)(s,2),u=d[0],m=d[1],p=function(){m(_d.DEFAULT),c(_d.DEFAULT)};return Object(qe.jsx)(h.a,{item:!0,xs:12,className:n.displayFlex,children:Object(qe.jsx)("div",{style:{flex:1,display:"flex",flexDirection:"column"},children:Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(Qd,{className:I()((e={},Object(z.a)(e,n.alertsCard,u!==_d.SHRUNK),Object(z.a)(e,n.shrunkCard,u===_d.SHRUNK),Object(z.a)(e,n.expandedCard,u===_d.EXPANDED),e)),state:u,shrunkComponent:Object(qe.jsx)(Zu,{title:"Alerts",buttonName:"Show alerts",onUnshrink:p}),children:Object(qe.jsx)(wu,{onExpand:function(){m(_d.EXPANDED),c(_d.SHRUNK)},onReset:p,size:u})}),Object(qe.jsx)(Qd,{className:I()((t={},Object(z.a)(t,n.shrunkCard,o===_d.SHRUNK),Object(z.a)(t,n.systemStatusCard,o!==_d.SHRUNK),Object(z.a)(t,n.expandedCard,u===_d.EXPANDED),t)),state:o,shrunkComponent:Object(qe.jsx)(Zu,{title:"System status",buttonName:"Show machines",onUnshrink:p}),children:Object(qe.jsx)(Xu,{onExpand:function(){c(_d.EXPANDED),m(_d.SHRUNK)},onReset:p,size:o})})]})})})},Qu=Object(f.a)(qc),Yu=x()(bu||(bu=Object(c.a)(["\n query getData {\n machines {\n name\n }\n serverVersion\n }\n"]))),Ju=function(){var e=Object(w.h)(),t=Qu(),n=Object(a.useState)(!1),r=Object(l.a)(n,2),i=r[0],o=r[1],c=Object(u.c)(Yu),s=c.data;return c.loading?Object(qe.jsx)(qe.Fragment,{}):Wa.a(s.machines)?Object(qe.jsxs)(qe.Fragment,{children:[i&&Object(qe.jsx)(lo,{close:function(){return o(!1)},onPaired:function(t){o(!1),e.push("/maintenance/machine-status",{id:t.deviceId})}}),Object(qe.jsx)(cl,{title:"Dashboard",children:Object(qe.jsx)("div",{className:t.headerLabels,children:Object(qe.jsxs)("span",{children:[Object(qe.jsx)(nt,{className:t.inline,children:null===s||void 0===s?void 0:s.serverVersion})," ",Object(qe.jsx)(at,{className:t.inline,children:" server version"})]})})}),Object(qe.jsx)("div",{className:t.emptyMachinesRoot,children:Object(qe.jsxs)("div",{className:t.emptyMachinesContent,children:[Object(qe.jsx)(Ue,{className:t.offColor,children:"No machines on your system yet"}),Object(qe.jsx)(Ye,{className:t.offColor,children:"To fully take advantage of Lamassu Admin, add a new machine to your system"}),Object(qe.jsx)(An,{onClick:function(){return o(!0)},children:"+ Add new machine"})]})}),Object(qe.jsx)(bs,{})]}):Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(cl,{title:"Dashboard",children:Object(qe.jsxs)("div",{className:t.headerLabels,children:[Object(qe.jsxs)("div",{children:[Object(qe.jsx)(Dc,{}),Object(qe.jsx)("span",{children:"Cash-in"})]}),Object(qe.jsxs)("div",{children:[Object(qe.jsx)(zc,{}),Object(qe.jsx)("span",{children:"Cash-out"})]}),Object(qe.jsxs)("div",{children:[Object(qe.jsx)("svg",{width:12,height:12,children:Object(qe.jsx)("rect",{width:12,height:12,rx:3,fill:he})}),Object(qe.jsx)("span",{children:"Action Required"})]})]})}),Object(qe.jsx)("div",{className:t.root,children:Object(qe.jsxs)(h.a,{container:!0,children:[Object(qe.jsx)(h.a,{container:!0,direction:"column",item:!0,xs:6,children:Object(qe.jsx)(Gd,{})}),Object(qe.jsx)(h.a,{container:!0,direction:"column",item:!0,xs:6,children:Object(qe.jsx)(Ku,{})})]})}),Object(qe.jsx)(bs,{})]})},em=n(1126),tm=n(243),nm=n.n(tm),am=n(1063),rm=n(1064),im=n(1065),om=n(556),lm=n(1060),cm=n(1135),sm=n(1058),dm=n(223),um=n(1059),mm=n(1128),hm="You have unsaved changes on this page. Are you sure you want to leave?",pm=function(e){var t=e.message,n=void 0===t?hm:t,r=Object(mn.f)(),i=r.dirty&&0===r.submitCount;Object(a.useEffect)((function(){window.onbeforeunload=i?o:void 0}),[i]);var o=function(){return hm};return Object(qe.jsx)(w.a,{when:i,message:n})},bm=n(1051),fm=n(1052),jm=Me.tl2,gm=Me.label1,Om={size:function(e){var t=e.size;return Ha(t)},bold:Va,header:{extend:jm,backgroundColor:Te,height:Pe,textAlign:"left",color:K,display:"flex",alignItems:"center"},doubleHeader:{extend:jm,backgroundColor:Te,height:De,color:K,display:"table-row"},thDoubleLevel:function(e){return{width:e.width,display:"table-cell","& > :first-child":{margin:[[0,10]],extend:gm,fontWeight:700,display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:se,color:K,borderRadius:[[0,0,8,8]],height:28},"& > :last-child":{padding:[[0,11]],display:"table-cell",verticalAlign:"middle",height:De-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:Re},trAdding:{backgroundColor:Be},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:Me.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:he}},xm=Object(f.a)(Om),vm=function(e){var t=e.children,n=e.className,a=Object(q.a)(e,["children","className"]);return Object(qe.jsx)("div",Object(s.a)(Object(s.a)({className:I()(n)},a),{},{children:t}))},ym=function(e){var t=e.children,n=e.className,a=xm();return Object(qe.jsx)("div",{className:I()(n,a.header),children:t})},wm=function(e){var t=e.children,n=e.className,a=xm();return Object(qe.jsx)("div",{className:I()(n,a.doubleHeader),children:t})},Cm=function(e){var t=e.children,n=e.className;return Object(qe.jsx)("div",{className:I()(n),children:t})},km=function(e){var t,n=e.children,a=e.header,r=e.className,i=e.width,o=void 0===i?100:i,l=e.size,c=e.bold,s=e.textAlign,d=e.action,u=xm({textAlign:s,width:o,size:l}),m=(t={},Object(z.a)(t,u.td,!0),Object(z.a)(t,u.tdHeader,a),Object(z.a)(t,u.actionCol,d),Object(z.a)(t,u.size,!a),Object(z.a)(t,u.bold,!a&&c),t);return Object(qe.jsx)("div",{className:I()(r,m),children:n})},Em=function(e){var t=e.children,n=Object(q.a)(e,["children"]);return Object(qe.jsx)(km,Object(s.a)(Object(s.a)({header:!0},n),{},{children:t}))},Nm=function(e){var t=e.title,n=e.children,a=e.className,r=e.width,i=xm({width:r});return Object(qe.jsxs)("div",{className:I()(a,i.thDoubleLevel),children:[Object(qe.jsx)("div",{children:t}),Object(qe.jsx)("div",{children:n})]})},Sm=function(e){var t,n=e.onClick,a=e.error,r=e.errorMessage,i=e.shouldShowError,o=e.children,l=e.className,c=e.size,s=e.newRow,d=xm({size:c}),u={root:d.cardContentRoot},m=(t={},Object(z.a)(t,d.tr,!0),Object(z.a)(t,d.trError,a),Object(z.a)(t,d.card,!0),Object(z.a)(t,d.trAdding,s),Object(z.a)(t,"className",l),t);return Object(qe.jsx)(qe.Fragment,{children:Object(qe.jsx)(bm.a,{className:I()(m,l),onClick:n,children:Object(qe.jsxs)(fm.a,{classes:u,children:[Object(qe.jsx)("div",{className:d.mainContent,children:o}),a&&i&&Object(qe.jsx)("div",{className:d.errorContent,children:r})]})})})},Im=r.a.createContext(),Lm=n(1054),Pm=n(1055),Fm=n(1122),Dm=n(1053),Tm=n(318),Rm=Tm.create({checkTypes:!1,env:Tm.env}),Bm=Rm.compose(Rm.joinWith(""))(Xc.a(0,Rm.toLower)),Am=Rm.compose(Rm.joinWith(""))(Xc.a(0,Rm.toUpper)),Mm=Rm.compose(Am)(Rm.toLower),Wm=P.a(Rm.splitOn(" "),Dm.a(/([A-Z])/g," $1"),Bm),zm=P.a(Rm.joinWith(" "),Rm.map(Mm),Wm),qm=function(e,t,n){return 1===parseInt(e)?t:n},$m=Object(f.a)({orderedBySpan:{whiteSpace:"nowrap"}}),Hm=function(){var e=$m(),t=Object(a.useContext)(Im),n=t.elements,r=t.enableEdit,i=t.enableEditText,o=t.editWidth,c=t.enableDelete,s=t.deleteWidth,d=t.enableToggle,u=t.toggleWidth,m=t.orderedBy,h=t.DEFAULT_COL_SIZE,p=function(t,n){var a,r=t.name,i=t.display,o=t.width,l=void 0===o?h:o,c=t.header,s=t.textAlign,d=I()(Object(z.a)({},e.orderedBySpan,D.a(c)&&!D.a(m)&&gn.a(r,m.code)));return Object(qe.jsx)(km,{header:!0,width:l,textAlign:s,children:D.a(c)?Object(qe.jsxs)("span",{className:d,children:[D.a(i)?zm(r):i," ",!D.a(m)&&gn.a(r,m.code)&&"-"]}):Object(qe.jsx)(qe.Fragment,{children:null!==(a=function(e){if(!D.a(m)&&gn.a(r,m.code))try{var t=Fm.a(e),n=A.a(["props","children"],t),a=Aa.a((function(e){return gn.a(e.type,"span")}),n);return a.props.children=Cd.a(" -",a.props.children),t}catch(i){return e}return e}(c))&&void 0!==a?a:c})},n)},b=function(e){var t=Os.a(ul.a("doubleHeader"))(e),n=Object(l.a)(t,2),a=n[0],r=n[1];if(!a.length)return[e,ym];var i=Lm.a(a[0],e),o=P.a(js.a,T.a(A.a(["width"])))(a);return[Pm.a(i,{width:o,elements:a,name:a[0].doubleHeader},r),wm]}(n),f=Object(l.a)(b,2),j=f[0],g=f[1];return Object(qe.jsxs)(g,{children:[j.map((function(e,t){var n=e.width,a=e.elements,r=e.name;return a&&a.length?Object(qe.jsx)(Nm,{width:n,title:r,children:a.map(p)},t):p(e,t)})),r&&Object(qe.jsx)(km,{header:!0,width:o,textAlign:"center",children:null!==i&&void 0!==i?i:"Edit"}),c&&Object(qe.jsx)(km,{header:!0,width:s,textAlign:"center",children:"Delete"}),d&&Object(qe.jsx)(km,{header:!0,width:u,textAlign:"center",children:"Enable"})]})},Vm=n(1057),Um=n(1056),Gm=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}}),Xm=function(e){var t=e.children,n=e.close,a=Gm();return Object(qe.jsxs)("div",{className:a.titleSection,children:[t,n&&Object(qe.jsx)(ta,{size:16,"aria-label":"close",onClick:n,className:a.closeButton,children:Object(qe.jsx)($i,{})})]})},_m=function(e){var t=e.title,n=void 0===t?"Confirm Delete":t,a=e.open,r=void 0!==a&&a,i=e.onConfirmed,o=e.onDismissed,l=e.item,c=void 0===l?"item":l,s=e.confirmationMessage,d=void 0===s?"Are you sure you want to delete this ".concat(c,"?"):s,u=e.extraMessage,m=e.errorMessage,h=void 0===m?"":m,p=Gm();return Object(qe.jsxs)(cn.a,{open:r,"aria-labelledby":"form-dialog-title",children:[Object(qe.jsx)(Xm,{close:function(){return o()},children:Object(qe.jsx)(_e,{className:p.title,children:n})}),h&&Object(qe.jsx)(Xm,{children:Object(qe.jsx)(il,{children:h.split(":").map((function(e){return Object(qe.jsxs)(qe.Fragment,{children:[e,Object(qe.jsx)("br",{})]})}))})}),Object(qe.jsxs)(sn.a,{className:p.content,children:[d&&Object(qe.jsx)(Ke,{children:d}),u]}),Object(qe.jsx)(Um.a,{className:p.actions,children:Object(qe.jsx)(An,{onClick:i,children:"Confirm"})})]})},Zm=n(569);function Km(){return(Km=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Qm(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Ym=a.createElement("desc",null,"Created with Sketch."),Jm=a.createElement("defs",null,a.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"})),eh=a.createElement("g",{id:"Styleguide",stroke:"none",strokeWidth:1,fillRule:"evenodd"},a.createElement("g",{id:"icon/action/arrow/regular"},a.createElement("mask",{id:"mask-2",fill:"white"},a.createElement("use",{xlinkHref:"#path-1"})),a.createElement("use",{id:"Mask",fillRule:"nonzero",xlinkHref:"#arrow-path"})));function th(e,t){var n=e.title,r=e.titleId,i=Qm(e,["title","titleId"]);return a.createElement("svg",Km({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":r},i),n?a.createElement("title",{id:r},n):null,Ym,Jm,eh)}var nh=a.forwardRef(th),ah=(n.p,Me.p),rh=152,ih={selectedItem:{width:111,display:"block",whiteSpace:"nowrap",overflow:"hidden"},select:{width:rh,zIndex:1,"& label":{extend:Me.label1,color:se,paddingLeft:10},"& button":{extend:ah,position:"relative",border:0,backgroundColor:re,width:rh,padding:[[6,0,6,12]],borderRadius:20,lineHeight:"1.14",textAlign:"left",color:se,cursor:"pointer",outline:"0 none"},"& ul":{maxHeight:"200px",width:rh,overflowY:"auto",position:"absolute",margin:0,borderTop:0,padding:0,borderRadius:[[0,0,8,8]],backgroundColor:re,outline:"0 none","& li":{extend:ah,listStyleType:"none",padding:[[6,12]],cursor:"pointer","& span":{width:"100%",display:"block",overflow:"hidden",whiteSpace:"nowrap"}},"& li:hover":{backgroundColor:se,color:K}},"& svg":{position:"absolute",top:12,right:14,fill:se}},selectFiltered:{"& button":{backgroundColor:se,color:K},"& ul":{"& li":{backgroundColor:se,color:K},"& li:hover":{backgroundColor:re,color:se}},"& svg":{fill:[[K],"!important"]}},open:{"& button":{borderRadius:[[8,8,0,0]]}}},oh=Object(f.a)(ih);var lh=function(e){var t,n=e.className,a=e.label,r=e.items,i=Object(q.a)(e,["className","label","items"]),o=oh(),l=Object(Zm.a)({items:r,selectedItem:i.selectedItem,onSelectedItemChange:function(e){i.onSelectedItemChange(e.selectedItem)}}),c=l.isOpen,d=l.selectedItem,u=l.getToggleButtonProps,m=l.getLabelProps,h=l.getMenuProps,p=l.getItemProps,b=(t={},Object(z.a)(t,o.select,!0),Object(z.a)(t,o.selectFiltered,!!i.defaultAsFilter||!gn.a(d,i.default)),Object(z.a)(t,o.open,c),t);return Object(qe.jsxs)("div",{className:I()(b,n),children:[Object(qe.jsx)("label",Object(s.a)(Object(s.a)({},m()),{},{children:a})),Object(qe.jsxs)("button",Object(s.a)(Object(s.a)({},u()),{},{children:[Object(qe.jsx)("span",{className:o.selectedItem,children:d.display}),Object(qe.jsx)(nh,{})]})),Object(qe.jsx)("ul",Object(s.a)(Object(s.a)({},h()),{},{children:c&&r.map((function(e,t){var n=e.code,a=e.display;return Object(qe.jsx)("li",Object(s.a)(Object(s.a)({},p({code:n,index:t})),{},{children:Object(qe.jsx)("span",{children:a})}),"".concat(n).concat(t))}))}))]})};function ch(){return(ch=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function sh(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var dh=a.createElement("defs",null,a.createElement("path",{id:"a",d:"M0 0h22v22H0z"})),uh=a.createElement("g",{fill:"none",fillRule:"evenodd"},a.createElement("mask",{id:"b",fill:"#fff"},a.createElement("use",{xlinkHref:"#a"})),a.createElement("path",{stroke:"#9B9B9B",strokeWidth:2,strokeLinecap:"round",mask:"url(#b)",d:"M9 9v9M13 9v9"}),a.createElement("g",{mask:"url(#b)",stroke:"#9B9B9B",strokeLinecap:"round",strokeWidth:2},a.createElement("path",{strokeLinejoin:"round",d:"M3 6l2 15h12l2-15"}),a.createElement("path",{d:"M1 5h20M14 4a3 3 0 10-6 0"})));function mh(e,t){var n=e.title,r=e.titleId,i=sh(e,["title","titleId"]);return a.createElement("svg",ch({width:22,height:22,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,dh,uh)}var hh=a.forwardRef(mh);n.p;function ph(){return(ph=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function bh(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var fh=a.createElement("desc",null,"Created with Sketch."),jh=a.createElement("g",{id:"icon/action/delete/enabled",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round"},a.createElement("line",{x1:9,y1:9,x2:9,y2:18,id:"Stroke-1",stroke:"#1B2559",strokeWidth:2}),a.createElement("line",{x1:13,y1:9,x2:13,y2:18,id:"Stroke-2",stroke:"#1B2559",strokeWidth:2}),a.createElement("polyline",{id:"Stroke-3",stroke:"#1B2559",strokeWidth:2,strokeLinejoin:"round",points:"3 6 5 21 17 21 19 6"}),a.createElement("line",{x1:1,y1:5,x2:21,y2:5,id:"Stroke-5",stroke:"#1B2559",strokeWidth:2}),a.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 gh(e,t){var n=e.title,r=e.titleId,i=bh(e,["title","titleId"]);return a.createElement("svg",ph({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":r},i),n?a.createElement("title",{id:r},n):null,fh,jh)}var Oh=a.forwardRef(gh);n.p;function xh(){return(xh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function vh(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var yh=a.createElement("desc",null,"Created with Sketch."),wh=a.createElement("g",{id:"icon/action/edit/disabled",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.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}),a.createElement("polygon",{id:"Stroke-3",stroke:"#9B9B9B",strokeWidth:2,points:"6 12 17 1 21 5 10 16 6 16"}));function Ch(e,t){var n=e.title,r=e.titleId,i=vh(e,["title","titleId"]);return a.createElement("svg",xh({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":r},i),n?a.createElement("title",{id:r},n):null,yh,wh)}var kh=a.forwardRef(Ch);n.p;function Eh(){return(Eh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Nh(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Sh=a.createElement("desc",null,"Created with Sketch."),Ih=a.createElement("g",{id:"icon/action/edit/enabled",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.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}),a.createElement("polygon",{id:"Stroke-3",stroke:"#1B2559",strokeWidth:2,points:"6 12 17 1 21 5 10 16 6 16"}));function Lh(e,t){var n=e.title,r=e.titleId,i=Nh(e,["title","titleId"]);return a.createElement("svg",Eh({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":r},i),n?a.createElement("title",{id:r},n):null,Sh,Ih)}var Ph=a.forwardRef(Lh);n.p;function Fh(){return(Fh=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Dh(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Th=a.createElement("defs",null,a.createElement("pattern",{id:"pattern_68JiZ",patternUnits:"userSpaceOnUse",width:5.5,height:5.5,patternTransform:"rotate(45)"},a.createElement("line",{x1:0,y:0,x2:0,y2:5.5,stroke:"#DBDFED",strokeWidth:3}))),Rh=a.createElement("rect",{width:"100%",height:"100%",fill:"url(#pattern_68JiZ)",opacity:1});function Bh(e,t){var n=e.title,r=e.titleId,i=Dh(e,["title","titleId"]);return a.createElement("svg",Fh({xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"36px",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,Th,"{' '}\n ",Rh)}var Ah=a.forwardRef(Bh),Mh=(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?"flex-end":t}},suffix:{margin:[[0,0,0,7]]},size:function(e){var t=e.size;return Ha(t)},bold:Va}),Wh=Object(f.a)(Mh),zh=function(e){var t=e.disabled,n=e.editing,r=Wh(),i=Object(mn.f)(),o=i.values,c=i.submitForm,s=i.resetForm,d=Object(a.useContext)(Im),u=d.editWidth,m=d.onEdit,h=d.enableEdit,p=d.enableDelete,b=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||b&&b(o),E=Object(a.useState)(!1),N=Object(l.a)(E,2),S=N[0],I=N[1];return Object(qe.jsxs)(qe.Fragment,{children:[n&&Object(qe.jsxs)(km,{textAlign:"center",width:w,children:[Object(qe.jsx)(oa,{className:r.saveButton,type:"submit",color:"primary",onClick:c,children:"Save"}),!v&&Object(qe.jsx)(oa,{color:"secondary",onClick:function(){y(),s()},children:"Cancel"})]}),!n&&h&&Object(qe.jsx)(km,{textAlign:"center",width:u,children:Object(qe.jsx)(ta,{disabled:k,className:r.editButton,onClick:function(){return m&&m(o.id)},children:k?Object(qe.jsx)(kh,{}):Object(qe.jsx)(Ph,{})})}),!n&&p&&Object(qe.jsxs)(km,{textAlign:"center",width:j,children:[Object(qe.jsx)(ta,{disabled:t,onClick:function(){I(!0)},children:t?Object(qe.jsx)(hh,{}):Object(qe.jsx)(Oh,{})}),Object(qe.jsx)(_m,{open:S,setDeleteDialog:I,onConfirmed:function(){f(o.id).then((function(e){D.a(e)||I(!1)}))},onDismissed:function(){I(!1),y()},errorMessage:C})]}),!n&&g&&Object(qe.jsx)(km,{textAlign:"center",width:x,children:Object(qe.jsx)(Lr,{checked:!!o.active,value:!!o.active,disabled:t,onChange:function(){return O(o.id)}})})]})},qh=function(e){var t,n=e.editing,a=e.focus,r=e.config,i=e.extraPaddingRight,o=e.extraPadding,l=r.name,c=r.bypassField,d=r.input,u=r.editable,m=void 0===u||u,h=r.size,p=r.bold,b=r.width,f=r.textAlign,j=r.editingAlign,g=void 0===j?f:j,O=r.suffix,x=r.SuffixComponent,v=void 0===x?rt:x,y=r.textStyle,w=void 0===y?function(e){}:y,C=r.isHidden,k=void 0===C?function(e){return!1}:C,E=r.view,N=void 0===E?function(e){return null===e||void 0===e?void 0:e.toString()}:E,S=r.inputProps,I=void 0===S?{}:S,L=Object(mn.f)().values,P=n&&function(e){return"function"===typeof e?e(L):e}(m),F=!c,D=Wh({textAlign:P?g:f,size:h}),T=Object(s.a)({fullWidth:!0,autoFocus:a,size:h,bold:p,textAlign:P?g:f},I);return Object(qe.jsxs)(km,{className:(t={},Object(z.a)(t,D.extraPaddingRight,i),Object(z.a)(t,D.extraPadding,o),Object(z.a)(t,D.withSuffix,O),t),width:b,size:h,bold:p,textAlign:f,children:[P&&F&&!k(L)&&Object(qe.jsx)(mn.b,Object(s.a)({name:l,component:d},T)),P&&!F&&!k(L)&&Object(qe.jsx)(r.input,{name:l}),!P&&L&&!k(L)&&Object(qe.jsx)("div",{style:w(L,P),children:N(L[l],L)}),O&&!k(L)&&Object(qe.jsx)(v,{className:D.suffix,style:P?{}:w(L,P),children:O}),k(L)&&Object(qe.jsx)(Ah,{})]})},$h=function(e){var t=e.editing,n=e.disabled,r=e.lastOfGroup,i=e.newRow,o=Object(mn.f)(),c=o.touched,s=o.errors,d=o.values,u=Object(a.useContext)(Im),m=u.elements,h=u.enableEdit,p=u.enableDelete,b=u.error,f=u.enableToggle,j=u.rowSize,g=u.stripeWhen,O=Wh(),x=!t&&g&&g(d)?function(e){var t=Os.a(W.a("stripe",!0))(e),n=Object(l.a)(t,2),a=n[0],r=n[1];if(!a.length)return e;var i=Lm.a(a[0],e),o=P.a(js.a,T.a(A.a(["width"])))(a);return Pm.a(i,{width:o,editable:!1,view:function(){return Object(qe.jsx)(Ah,{})}},r)}(m):m,v=Os.a(ul.a("doubleHeader"))(m),y=Object(l.a)(v,1)[0],w=(null===y||void 0===y?void 0:y.length)?Lm.a(y[0],m):-1,C=(null===y||void 0===y?void 0:y.length)?Lm.a(y[y.length-1],m):-1,k=x.findIndex((function(e){return void 0===e.editable||e.editable})),E=Object(z.a)({},O.lastOfGroup,r),N=Vm.a(Vc.a(c),s),S=N&&Vc.a(N).length>0||!!b,L=b||N&&yd.a(N).join(", ");return Object(qe.jsxs)(Sm,{className:I()(E),size:j,error:t&&S,newRow:i&&!S,shouldShowError:!0,errorMessage:L,children:[x.map((function(e,n){return Object(qe.jsx)(qh,{config:e,editing:t,focus:n===k&&t,extraPaddingRight:C===n,extraPadding:w===n},n)})),(h||p||f)&&Object(qe.jsx)(zh,{disabled:n,editing:t})]})},Hh={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"}},Vh=Object(f.a)(Hh),Uh=P.a(gs.a(om.a)(0),T.a((function(e){var t;return null!==(t=e.width)&&void 0!==t?t:100}))),Gh=function(e){var t,n,r,i=e.name,o=e.title,c=e.titleLg,d=e.elements,u=void 0===d?[]:d,m=e.data,h=void 0===m?[]:m,p=e.save,b=e.error,f=e.rowSize,j=void 0===f?"md":f,g=e.validationSchema,O=e.enableCreate,x=e.enableEdit,v=e.enableEditText,y=e.editWidth,w=e.enableDelete,C=e.deleteWidth,k=void 0===C?87:C,E=e.enableToggle,N=e.toggleWidth,S=void 0===N?87:N,I=e.onToggle,L=e.forceDisable,P=e.disableAdd,F=e.initialValues,D=e.setEditing,T=e.shouldOverrideEdit,B=e.editOverride,A=e.stripeWhen,M=e.disableRowEdit,q=e.groupBy,$=e.sortBy,H=e.createText,V=void 0===H?"Add override":H,U=e.forceAdd,G=void 0!==U&&U,X=e.tbodyWrapperClass,_=e.orderedBy,Z=void 0===_?null:_,K=Object(a.useState)(null),Q=Object(l.a)(K,2),Y=Q[0],J=Q[1],ee=Object(a.useState)(!1),te=Object(l.a)(ee,2),ne=te[0],ae=te[1],re=Object(a.useState)(!1),ie=Object(l.a)(re,2),oe=ie[0],le=ie[1],ce=Object(a.useState)(null),se=Object(l.a)(ce,2),de=se[0],ue=se[1];Object(a.useEffect)((function(){return ue(b)}),[b]),Object(a.useEffect)((function(){ue(null),ae(G)}),[G]);var me=function(){var e=Object(Al.a)(Bl.a.mark((function e(t){var n,a,r;return Bl.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!oe){e.next=2;break}return e.abrupt("return");case 2:if(le(!0),n=g.cast(t),a=jl.a(W.a("id",n.id))(h),r=-1!==a?cm.a(a,n,h):sm.a(n,h),gn.a(h[a],n)){e.next=16;break}return e.prev=7,e.next=10,p(Object(z.a)({},i,r),n);case 10:e.next=16;break;case 12:return e.prev=12,e.t0=e.catch(7),le(!1),e.abrupt("return");case 16:ae(!1),D&&D(!1),le(!1);case 19:case"end":return e.stop()}}),e,null,[[7,12]])})));return function(t){return e.apply(this,arguments)}}(),he=function(){ae(!1),J(null),D&&D(!1)},pe=function(){ae(!0),ue(null),D&&D(!0,!0)},be=w||E?87:174,fe=za.a(be)(y),je=(null!==(t=w&&k)&&void 0!==t?t:0)+(null!==(n=x&&fe)&&void 0!==n?n:0)+(null!==(r=E&&S)&&void 0!==r?r:0),ge=Uh(u)+je,Oe=Vh({width:ge}),xe=!h.length&&O&&!ne,ve=!L&&!Y&&!P&&!ne,ye=ne||0!==h.length,we=$?um.a($)(h):h,Ce={elements:u,enableEdit:x,enableEditText:v,onEdit:function(e){if(T&&T(e))return B(e);J(e),ue(null),D&&D(e,!0)},clearError:function(){return ue(null)},error:de,disableRowEdit:M,editWidth:fe,enableDelete:w,onDelete:function(e){var t=dm.a((function(t){return t.id===e}),h);return p(Object(z.a)({},i,t))},deleteWidth:k,enableToggle:E,rowSize:j,onToggle:I,toggleWidth:S,actionColSize:je,stripeWhen:A,forceAdd:G,orderedBy:Z,DEFAULT_COL_SIZE:100};return Object(qe.jsx)(Im.Provider,{value:Ce,children:Object(qe.jsxs)("div",{className:Oe.wrapper,children:[xe&&ve&&Object(qe.jsx)(Pn,{onClick:pe,children:V}),ye&&Object(qe.jsxs)(qe.Fragment,{children:[(o||O)&&Object(qe.jsxs)("div",{className:Oe.outerHeader,children:[o&&c&&Object(qe.jsx)(tt,{className:Oe.title,children:o}),o&&!c&&Object(qe.jsx)(Ye,{className:Oe.title,children:o}),O&&ve&&Object(qe.jsx)(oa,{className:Oe.addLink,onClick:pe,children:V})]}),Object(qe.jsxs)(vm,{children:[Object(qe.jsx)(Hm,{}),Object(qe.jsx)("div",{className:X,children:Object(qe.jsxs)(Cm,{children:[ne&&Object(qe.jsx)(mn.e,{validateOnBlur:!1,validateOnChange:!1,initialValues:Object(s.a)({id:Object(mm.a)()},F),onReset:he,validationSchema:g,onSubmit:me,children:Object(qe.jsxs)(mn.d,{children:[Object(qe.jsx)(pm,{}),Object(qe.jsx)($h,{editing:!0,disabled:L,newRow:!0})]})}),we.map((function(e,t){var n,a=we[t+1],r=!!q&&a,i="Function"===Ta.a(q)?q:R.a(q),o=r&&i(e)!==i(a);return Object(qe.jsx)(mn.e,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,initialValues:e,onReset:he,validationSchema:g,onSubmit:me,children:Object(qe.jsxs)(mn.d,{children:[Object(qe.jsx)(pm,{}),Object(qe.jsx)($h,{lastOfGroup:o,editing:Y===e.id,disabled:L||Y&&Y!==e.id||ne})]})},null!==(n=e.id)&&void 0!==n?n:t)}))]})})]})]})]})})},Xh=function(e){var t=e.name,n=e.save,a=e.data,r=void 0===a?{}:a,i=e.namespaces,o=void 0===i?[]:i,l=Object(q.a)(e,["name","save","data","namespaces"]),c=T.a((function(e){return Object(s.a)({id:e},ds(e)(r))}))(o);return Object(qe.jsx)(Gh,Object(s.a)({name:t,data:c,save:function(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];var r=t[1];return n(us(r.id)(lm.a(["id2"],r)))}},l))},_h=n(575),Zh=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]]}}}),Kh=function(e){var t=e.width,n=e.height,a=e.infoPanelHeight,r=e.title,i=e.small,o=e.xl,l=e.infoPanel,c=e.handleClose,d=e.children,u=(e.secondaryModal,e.className),m=e.closeOnEscape,h=e.closeOnBackdropClick,p=Object(q.a)(e,["width","height","infoPanelHeight","title","small","xl","infoPanel","handleClose","children","secondaryModal","className","closeOnEscape","closeOnBackdropClick"]),b=Zh({width:t,height:n,small:i,infoPanelHeight:a,xl:o}),f=i?_e:Ue,j=o?28:i?16:20;return Object(qe.jsx)(_h.a,Object(s.a)(Object(s.a)({onClose:function(e,t){(h||"backdropClick"!==t)&&(m||"escapeKeyDown"!==t)&&c()},className:b.modal},p),{},{children:Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsxs)(Un.a,{className:I()(b.wrapper,u),children:[Object(qe.jsxs)("div",{className:b.header,children:[r&&Object(qe.jsx)(f,{className:b.title,children:r}),Object(qe.jsx)(ta,{size:j,className:b.button,onClick:function(){return c()},children:Object(qe.jsx)($i,{})})]}),Object(qe.jsx)("div",{className:b.content,children:d})]}),l&&Object(qe.jsx)(Un.a,{className:I()(b.infoPanelWrapper,u),children:Object(qe.jsx)("div",{className:b.panelContent,children:l})})]})}))},Qh=9999999,Yh="manual",Jh=/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,ep=["ETH"],tp=n.p+"static/media/both-filled.7af80d5f.svg",np={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:$}},ap=Object(f.a)(np),rp=function(e){var t=e.name,n=e.onContinue,a=ap();return Object(qe.jsxs)("div",{className:a.modalContent,children:[Object(qe.jsx)("img",{width:"148",height:"196",alt:"cassette",src:tp}),Object(qe.jsx)(Ue,{className:a.splashTitle,noMargin:!0,children:"Update counts"}),Object(qe.jsx)(Ye,{className:a.machineName,noMargin:!0,children:t}),Object(qe.jsxs)("div",{className:a.warningInfo,children:[Object(qe.jsx)(ir,{className:a.warningIcon}),Object(qe.jsx)(Ke,{noMargin:!0,className:a.warningText,children:"Before updating counts on Lamassu Admin, make sure you've done it before on the machines."})]}),Object(qe.jsxs)("div",{className:a.warningInfo,children:[Object(qe.jsx)(ir,{className:a.warningIcon}),Object(qe.jsx)(Ke,{noMargin:!0,className:a.warningText,children:"For cash cassettes, please make sure you've removed the remaining bills before adding the new ones."})]}),Object(qe.jsx)(An,{className:a.button,onClick:n,children:"Get started"})]})},ip=n(1061),op=n(1062);function lp(){return(lp=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function cp(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var sp=a.createElement("desc",null,"Created with Sketch."),dp=a.createElement("g",{id:"icon/stage/spring/current",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("circle",{id:"Oval-2-Copy",fill:"#48F694",cx:9,cy:9,r:4}),a.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 up(e,t){var n=e.title,r=e.titleId,i=cp(e,["title","titleId"]);return a.createElement("svg",lp({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":r},i),n?a.createElement("title",{id:r},n):null,sp,dp)}var mp=a.forwardRef(up),hp=(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}}),pp=Object(f.a)(hp),bp=Object(a.memo)((function(e){var t,n,a=e.steps,r=e.currentStep,i=e.color,o=void 0===i?"spring":i,l=e.className;if(r<1||r>a)throw Error("Value of currentStage is invalid");if(a<1)throw Error("Value of stages is invalid");var c=pp(),s=(t={},Object(z.a)(t,c.separator,!0),Object(z.a)(t,c.separatorSpring,"spring"===o),Object(z.a)(t,c.separatorZodiac,"zodiac"===o),t),d=(n={},Object(z.a)(n,c.separator,!0),Object(z.a)(n,c.separatorSpringEmpty,"spring"===o),Object(z.a)(n,c.separatorZodiacEmpty,"zodiac"===o),n);return Object(qe.jsxs)("div",{className:I()(l,c.stages),children:[Du.a(1,r).map((function(e){return Object(qe.jsxs)("div",{className:c.wrapper,children:[e>1&&Object(qe.jsx)("div",{className:I()(s)}),Object(qe.jsxs)("div",{className:c.stage,children:["spring"===o&&Object(qe.jsx)(Ki,{}),"zodiac"===o&&Object(qe.jsx)(fi,{})]})]},e)})),Object(qe.jsxs)("div",{className:c.wrapper,children:[r>1&&Object(qe.jsx)("div",{className:I()(s)}),Object(qe.jsxs)("div",{className:c.stage,children:["spring"===o&&Object(qe.jsx)(mp,{}),"zodiac"===o&&Object(qe.jsx)(wi,{})]})]}),Du.a(r+1,a+1).map((function(e){return Object(qe.jsxs)("div",{className:c.wrapper,children:[Object(qe.jsx)("div",{className:I()(d)}),Object(qe.jsxs)("div",{className:c.stage,children:["spring"===o&&Object(qe.jsx)(gt,{}),"zodiac"===o&&Object(qe.jsx)(Ct,{})]})]},e)}))]})}));function fp(){return(fp=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function jp(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var gp=a.createElement("desc",null,"Created with Sketch."),Op=a.createElement("g",{id:"icon/action/help/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.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"}),a.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"}),a.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 xp(e,t){var n=e.title,r=e.titleId,i=jp(e,["title","titleId"]);return a.createElement("svg",fp({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":r},i),n?a.createElement("title",{id:r},n):null,gp,Op)}var vp,yp,wp,Cp=a.forwardRef(xp),kp=(n.p,Object(f.a)({transparentButton:{border:"none",backgroundColor:"transparent",outline:"none",cursor:"pointer",marginTop:4},popoverContent:function(e){return{width:e.width,padding:[[10,15]]}}})),Ep=function(e){var t=kp({width:e}),n=Object(a.useState)(null),r=Object(l.a)(n,2),i=r[0],o=r[1],c=Boolean(i);return{classes:t,helpPopperAnchorEl:i,helpPopperOpen:c,handleOpenHelpPopper:function(e){o(i?null:e.currentTarget)},handleCloseHelpPopper:function(){o(null)}}},Np=Object(a.memo)((function(e){var t=e.parentElements,n=e.children,a=e.width,r=Ep(a);return Object(qe.jsxs)("div",{children:[!D.a(t)&&Object(qe.jsx)("div",{onMouseEnter:r.handleOpenHelpPopper,onMouseLeave:r.handleCloseHelpPopper,children:t}),D.a(t)&&Object(qe.jsx)("button",{type:"button",onMouseEnter:r.handleOpenHelpPopper,onMouseLeave:r.handleCloseHelpPopper,className:r.classes.transparentButton,children:Object(qe.jsx)(Cp,{})}),Object(qe.jsx)(Xn,{open:r.helpPopperOpen,anchorEl:r.helpPopperAnchorEl,placement:"bottom",children:Object(qe.jsx)("div",{className:r.classes.popoverContent,children:n})})]})})),Sp=n.p+"static/media/acceptor-left.f37bcb1a.svg",Ip=n.p+"static/media/dispenser-1.e4200f4e.svg",Lp=n.p+"static/media/dispenser-2.9f7807a5.svg",Pp=n.p+"static/media/3-cassettes-open-1-left.d6d9aa73.svg",Fp=n.p+"static/media/3-cassettes-open-2-left.a9ee8d4c.svg",Dp=n.p+"static/media/3-cassettes-open-3-left.08fed660.svg",Tp=n.p+"static/media/4-cassettes-open-1-left.7b00c51f.svg",Rp=n.p+"static/media/4-cassettes-open-2-left.b3d9541c.svg",Bp=n.p+"static/media/4-cassettes-open-3-left.e8f1667c.svg",Ap=n.p+"static/media/4-cassettes-open-4-left.bc1a9829.svg",Mp={content:{display:"flex",flexDirection:"column",justifyContent:"space-between",flex:1,paddingBottom:32},titleDiv:{marginBottom:32},title:{margin:[[0,0,12,0]],color:$},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:$},errorMessage:{color:he},stepErrorMessage:{maxWidth:275,marginTop:25}},Wp=Object(f.a)(Mp),zp=function(e,t){return[[Ip,Lp],[Pp,Fp,Dp],[Tp,Rp,Bp,Ap]][e-2][t-2]},qp=function(e){var t=e.step,n=e.name,a=e.machine,r=e.cashoutSettings,i=e.cassetteCapacity,o=(e.error,e.lastStep),l=e.steps,c=e.fiatCurrency,s=e.onContinue,d=e.initialValues,u=Wp(),m=o?"Finish":"Confirm",h=[{display:"Yes",code:"YES"},{display:"No",code:"NO"}],p="cassette".concat(t-1),b=a.numberOfCassettes,f=null===a||void 0===a?void 0:a[p],j=null===r||void 0===r?void 0:r[p],g=function(e){return e[p]||f},O=function(e){return g(e)*j},x=Lu.a(g,(function(e){return e/i*100}),ip.a(0,100));return Object(qe.jsxs)("div",{className:u.content,children:[Object(qe.jsxs)("div",{className:u.titleDiv,children:[Object(qe.jsx)(Ye,{className:u.title,children:n}),Object(qe.jsx)(bp,{steps:l.length,currentStep:t})]}),1===t&&Object(qe.jsx)(mn.e,{validateOnBlur:!1,validateOnChange:!1,onSubmit:s,initialValues:{wasCashboxEmptied:""},enableReinitialize:!0,validationSchema:l[0].schema,children:function(e){e.values;var t=e.errors;return Object(qe.jsxs)(mn.d,{children:[Object(qe.jsxs)("div",{className:I()(u.horizontalAlign,u.form),children:[Object(qe.jsx)("img",{className:u.stepImage,alt:"cassette",src:Sp}),Object(qe.jsx)("div",{className:u.formWrapper,children:Object(qe.jsxs)("div",{className:I()(u.verticalAlign,u.fullWidth),children:[Object(qe.jsx)(_e,{noMargin:!0,children:"Did you empty the cash box?"}),Object(qe.jsx)(mn.b,{component:ci,name:"wasCashboxEmptied",options:h,className:u.horizontalAlign}),t.wasCashboxEmptied&&Object(qe.jsx)("div",{className:u.errorMessage,children:t.wasCashboxEmptied}),Object(qe.jsxs)("div",{className:I()(u.horizontalAlign,u.centerAlignment),children:[Object(qe.jsx)(Ke,{children:"Since previous update"}),Object(qe.jsx)(Np,{width:215,children:Object(qe.jsx)(Ke,{children:"Number of bills inside the cash box, since the last cash box changes."})})]}),Object(qe.jsxs)("div",{className:I()(u.horizontalAlign,u.lineAlignment),children:[Object(qe.jsx)(Qe,{noMargin:!0,className:u.cashboxBills,children:null===a||void 0===a?void 0:a.cashbox}),Object(qe.jsx)(Ke,{noMargin:!0,children:"accepted bills"})]})]})})]}),Object(qe.jsx)(An,{className:u.submit,type:"submit",children:m})]})}}),t>1&&Object(qe.jsx)(mn.e,{validateOnBlur:!1,validateOnChange:!1,onSubmit:s,initialValues:d,enableReinitialize:!0,validationSchema:l[t-1].schema,children:function(e){var n=e.values,a=e.errors;return Object(qe.jsxs)(mn.d,{children:[Object(qe.jsxs)("div",{className:I()(u.horizontalAlign,u.form),children:[Object(qe.jsx)("img",{className:u.stepImage,alt:"cassette",src:zp(b,t)}),Object(qe.jsx)("div",{className:u.formWrapper,children:Object(qe.jsxs)("div",{className:I()(u.verticalAlign,u.fullWidth),children:[Object(qe.jsxs)("div",{className:I()(u.horizontalAlign,u.smBottomMargin),children:[Object(qe.jsxs)("div",{className:I()(u.horizontalAlign,u.cassetteFormTitle),children:[Object(qe.jsx)(zc,{}),Object(qe.jsxs)(_e,{className:u.cassetteFormTitleContent,noMargin:!0,children:["Cash cassette ",t-1," (dispenser)"]})]}),Object(qe.jsx)(ei,{className:u.cassetteCashbox,percent:x(n),cashOut:!0})]}),Object(qe.jsx)(_e,{noMargin:!0,children:"Refill bill count"}),Object(qe.jsxs)("div",{className:I()(u.horizontalAlign,u.lineAlignment),children:[Object(qe.jsx)(mn.b,{component:li,decimalPlaces:0,width:50,placeholder:f.toString(),name:p,className:u.cashboxBills,autoFocus:!0}),Object(qe.jsxs)(Ke,{children:[j," ",c," bills loaded"]})]}),Object(qe.jsxs)(Ke,{noMargin:!0,className:u.fiatTotal,children:["= ",Xr(O(n))," ",c]}),!Wa.a(a)&&Object(qe.jsx)(il,{className:u.stepErrorMessage,children:op.a(yd.a(a))})]})})]}),Object(qe.jsx)(An,{className:u.submit,type:"submit",children:m})]})}})]})},$p=T.a((function(e){return"cassette".concat(e)}),Du.a(1,5)),Hp=function(e){var t=e.machine,n=e.cashoutSettings,r=e.locale,i=e.onClose,o=e.save,c=e.error,s=Object(a.useState)({step:0,config:{active:!0}}),d=Object(l.a)(s,2),u=d[0],m=u.step,h=u.config,p=d[1],b=Wa.a(n)||!(null===n||void 0===n?void 0:n.active)?0:t.numberOfCassettes,f=m===b+1,j=function(e){var n,a=Gn.a(h,e);if(f){var r=[null===h||void 0===h?void 0:h.wasCashboxEmptied,null===e||void 0===e?void 0:e.wasCashboxEmptied].includes("YES")?0:null===t||void 0===t?void 0:t.cashbox,l=(n=e,gs.a((function(e,t){return e[t]=Gr(n[t]),e}),{},$p));return o(t.id,r,l),i()}p({step:m+1,config:a})},g=Lu.a(om.a(1),Du.a(1),T.a((function(e){return{type:"cassette ".concat(e),schema:xn.f().shape(Object(z.a)({},"cassette".concat(e),xn.e().label("Bill count").positive().integer().required().min(0).max(500)))}}))),O=sm.a({type:"cashbox",schema:xn.f().shape({wasCashboxEmptied:xn.h().required("Select one option.")}),cashoutRequired:!1},g(b));return Object(qe.jsxs)(Kh,{title:0===m?null:"Update counts",handleClose:i,width:554,height:535,open:!0,children:[0===m&&Object(qe.jsx)(rp,{name:null===t||void 0===t?void 0:t.name,onContinue:function(){return j()}}),0!==m&&Object(qe.jsx)(qp,{step:m,name:null===t||void 0===t?void 0:t.name,machine:t,cashoutSettings:n,cassetteCapacity:500,error:c,lastStep:f,steps:O,fiatCurrency:r.fiatCurrency,onContinue:j,initialValues:Wa.a(n)?{}:gs.a((function(e,t){return e["cassette".concat(t)]="",e}),{},Du.a(1,b+1))})]})},Vp={cashbox:{height:36}},Up=Object(f.a)(Vp),Gp={2:{cashbox:203,cassette:280,cassetteGraph:80,editWidth:87},3:{cashbox:164,cassette:200,cassetteGraph:60,editWidth:87},4:{cashbox:131,cassette:158,cassetteGraph:40,editWidth:87}},Xp=xn.f().shape({name:xn.h().required("Required"),cashbox:xn.e().label("Cash box").required().integer().min(0).max(1e3),cassette1:xn.e().required("Required").integer().min(0).max(500),cassette2:xn.e().required("Required").integer().min(0).max(500),cassette3:xn.e().required("Required").integer().min(0).max(500),cassette4:xn.e().required("Required").integer().min(0).max(500)}),_p=x()(vp||(vp=Object(c.a)(["\n mutation MachineAction(\n $deviceId: ID!\n $action: MachineAction!\n $cashbox: Int!\n $cassette1: Int!\n $cassette2: Int!\n $cassette3: Int!\n $cassette4: Int!\n ) {\n machineAction(\n deviceId: $deviceId\n action: $action\n cashbox: $cashbox\n cassette1: $cassette1\n cassette2: $cassette2\n cassette3: $cassette3\n cassette4: $cassette4\n ) {\n deviceId\n cashbox\n cassette1\n cassette2\n cassette3\n cassette4\n }\n }\n"]))),Zp=function(e){var t=e.machine,n=e.config,r=e.refetchData,i=e.bills,o=Up(),c=Object(a.useState)(!1),d=Object(l.a)(c,2),m=d[0],h=d[1],p=n&&ds("cashOut")(n),b=n&&ds("locale")(n),f=n&&ds("notifications",n),j=null===b||void 0===b?void 0:b.fiatCurrency,g=t.numberOfCassettes,O=function(e){return ds(e)(p)},x=function(e){var t=e.deviceId;return!O(t).active},v=[{name:"cashbox",header:"Cash box",width:Gp[g].cashbox,stripe:!1,view:function(e){return Object(qe.jsx)(ti,{currency:{code:j},notes:e,total:js.a(T.a((function(e){return e.fiat}))(i))})},input:li,inputProps:{decimalPlaces:0}}];am.a(rm.a(im.a,g),(function(e){return v.push({name:"cassette".concat(e),header:"Cash cassette ".concat(e),width:Gp[g].cassette,stripe:!0,doubleHeader:"Cash-out",view:function(n){var a;return Object(qe.jsx)(ni,{className:o.cashbox,denomination:null===(a=O(t.deviceId))||void 0===a?void 0:a["cassette".concat(e)],currency:{code:j},notes:n,width:Gp[g].cassetteGraph,threshold:f["fillingPercentageCassette".concat(e)]})},isHidden:function(t){var n=t.numberOfCassettes;return e>n},input:ri,inputProps:{decimalPlaces:0,width:Gp[g].cassetteGraph,inputClassName:o.cashbox}}),om.a(1,e)}),1),v.push({name:"edit",header:"Edit",width:Gp[g].editWidth,view:function(){return Object(qe.jsx)(ta,{onClick:function(){h(!0)},children:Object(qe.jsx)(Ph,{})})}});var y=Object(u.b)(_p,{refetchQueries:function(){return r()}}),w=Object(l.a)(y,2),C=w[0],k=w[1].error,E=function(e,n,a){return C({variables:Object(s.a)({action:"setCassetteBills",deviceId:t.deviceId,cashbox:n},a)})};return t.name?Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(Gh,{error:null===k||void 0===k?void 0:k.message,editWidth:Gp[g].editWidth,stripeWhen:x,disableRowEdit:x,name:"cashboxes",elements:v,data:[t],save:E,validationSchema:Xp}),m&&Object(qe.jsx)(Hp,{machine:t,cashoutSettings:O(t.deviceId),onClose:function(){h(!1)},error:null===k||void 0===k?void 0:k.message,save:E,locale:b})]}):null},Kp=n(1136),Qp=n(1123),Yp={marginLeft:6},Jp=Object(qe.jsxs)("div",{children:[Object(qe.jsx)(Dc,{}),Object(qe.jsx)("span",{style:Yp,children:"Cash-in"})]}),eb=Object(qe.jsxs)("div",{children:[Object(qe.jsx)(zc,{}),Object(qe.jsx)("span",{style:Yp,children:"Cash-out"})]}),tb=function(e){return function(e){return[{name:"name",width:280,size:"sm",view:function(e){return"".concat(e)}},{header:Jp,name:"cashIn",display:"Cash-in",width:130,textAlign:"right",suffix:"%"},{header:eb,name:"cashOut",display:"Cash-out",width:130,textAlign:"right",suffix:"%",inputProps:{decimalPlaces:3}},{name:"fixedFee",display:"Fixed fee",width:155,doubleHeader:"Cash-in only",textAlign:"right",suffix:e},{name:"minimumTx",display:"Minimum Tx",width:155,doubleHeader:"Cash-in only",textAlign:"right",suffix:e}]}(e)},nb=x()(yp||(yp=Object(c.a)(["\n query getData {\n config\n cryptoCurrencies {\n code\n display\n }\n machines {\n name\n deviceId\n }\n }\n"]))),ab=x()(wp||(wp=Object(c.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),rb=function(e){var t=e.name,n=e.id,a=Object(u.c)(nb),r=a.data,i=a.loading,o=Object(u.b)(ab,{refetchQueries:function(){return["getData"]}}),c=Object(l.a)(o,1)[0],s=(null===r||void 0===r?void 0:r.config)&&ds(t)(r.config),d=A.a(["fiatCurrency"])(ds(ts)(null===r||void 0===r?void 0:r.config));return Object(qe.jsx)(Gh,{name:"overrides",save:function(e){var n=us(t)(e);return c({variables:{config:n}})},data:function(){if(i||!n||!s)return[];var e=s.overrides?hl.a(M.a(W.a("machine","ALL_MACHINES"),s.overrides),M.a(W.a("machine",n),s.overrides)):[];return T.a((function(t){return gs.a(Kp.a,{code:t.code,name:t.display,cashIn:s.cashIn,cashOut:s.cashOut,fixedFee:s.fixedFee,minimumTx:s.minimumTx},Qp.a(["cashIn","cashOut","fixedFee","minimumTx"],M.a((function(e){return L.a(t.code,e.cryptoCurrencies)||L.a("ALL_COINS",e.cryptoCurrencies)}),e)))}),r.cryptoCurrencies)}(),elements:tb(d)})},ib={douro1:"Douro",sintra:"Sintra",gaia:"Gaia",tejo:"Tejo"},ob={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:$},label3:{color:$,marginTop:0,fontSize:12},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"},contentContainer:{"& > *":{marginTop:26},"& > *:first-child":{marginTop:0}}},lb=Object(f.a)(ob),cb=function(e){var t=e.data,n=e.timezone,a=lb();return Object(qe.jsxs)("div",{className:a.row,children:[Object(qe.jsxs)("div",{className:a.rowItem,children:[Object(qe.jsx)(it,{className:a.label3,children:"Paired at"}),Object(qe.jsx)(Ke,{children:t.pairedAt?fd(t.pairedAt,n,"yyyy-MM-dd HH:mm:ss"):""})]}),Object(qe.jsxs)("div",{className:a.rowItem,children:[Object(qe.jsx)(it,{className:a.label3,children:"Machine model"}),Object(qe.jsx)(Ke,{children:ib[t.model]})]}),Object(qe.jsxs)("div",{className:a.rowItem,children:[Object(qe.jsx)(it,{className:a.label3,children:"Software version"}),Object(qe.jsx)(Ke,{children:t.version})]})]})},sb=n(1067),db=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}}),ub=function(e){var t=e.children,n=e.onClose,a=db();return Object(qe.jsxs)("div",{className:a.dialogTitle,children:[t,n&&Object(qe.jsx)(ta,{size:16,"aria-label":"close",onClick:n,children:Object(qe.jsx)($i,{})})]})},mb=Object(a.memo)((function(e){var t=e.title,n=void 0===t?"Confirm action":t,r=e.errorMessage,i=void 0===r?"This action requires confirmation":r,o=e.open,c=e.toBeConfirmed,d=e.saveButtonAlwaysEnabled,u=void 0!==d&&d,m=e.message,h=e.confirmationMessage,p=void 0===h?"Write '".concat(c,"' to confirm this action"):h,b=e.onConfirmed,f=e.onDismissed,j=e.initialValue,g=void 0===j?"":j,O=e.disabled,x=void 0!==O&&O,v=Object(q.a)(e,["title","errorMessage","open","toBeConfirmed","saveButtonAlwaysEnabled","message","confirmationMessage","onConfirmed","onDismissed","initialValue","disabled"]),y=db(),w=Object(a.useState)(g),C=Object(l.a)(w,2),k=C[0],E=C[1],N=Object(a.useState)(!1),S=Object(l.a)(N,2),I=S[0],L=S[1],P=!u&&c!==k||""===k;return Object(qe.jsxs)(cn.a,Object(s.a)(Object(s.a)({open:o,"aria-labelledby":"form-dialog-title"},v),{},{children:[Object(qe.jsx)(ub,{id:"customized-dialog-title",onClose:function(){E(""),L(!1),f()},children:Object(qe.jsx)(_e,{children:n})}),i&&Object(qe.jsx)(ub,{children:Object(qe.jsx)(il,{children:i.split(":").map((function(e){return Object(qe.jsxs)(qe.Fragment,{children:[e,Object(qe.jsx)("br",{})]})}))})}),Object(qe.jsxs)(sn.a,{className:y.dialogContent,children:[m&&Object(qe.jsx)(Ke,{children:m}),Object(qe.jsx)(br.a,{htmlFor:"confirm-input",children:p}),Object(qe.jsx)(Xa,{disabled:x,name:"confirm-input",autoFocus:!0,id:"confirm-input",type:"text",size:"sm",fullWidth:!0,value:k,touched:{},error:I,InputLabelProps:{shrink:!0},onChange:function(e){return E(e.target.value)}})]}),Object(qe.jsx)(Um.a,{className:y.dialogActions,children:Object(qe.jsx)(An,{color:"green",disabled:P,onClick:function(){return b(k)},children:"Confirm"})})]}))}));function hb(){return(hb=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function pb(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var bb=a.createElement("desc",null,"Created with Sketch."),fb=a.createElement("g",{id:"icon/button/edit/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.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"}),a.createElement("polygon",{id:"Stroke-3",stroke:"#FFFFFF",points:"3 6.86666667 8.86666667 1 11 3.13333333 5.13333333 9 3 9"}));function jb(e,t){var n=e.title,r=e.titleId,i=pb(e,["title","titleId"]);return a.createElement("svg",hb({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":r},i),n?a.createElement("title",{id:r},n):null,bb,fb)}var gb=a.forwardRef(jb);n.p;function Ob(){return(Ob=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function xb(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var vb=a.createElement("desc",null,"Created with Sketch."),yb=a.createElement("g",{id:"icon/button/edit/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.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"}),a.createElement("polygon",{id:"Stroke-3",stroke:"#1B2559",points:"3 6.86666667 8.86666667 1 11 3.13333333 5.13333333 9 3 9"}));function wb(e,t){var n=e.title,r=e.titleId,i=xb(e,["title","titleId"]);return a.createElement("svg",Ob({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":r},i),n?a.createElement("title",{id:r},n):null,vb,yb)}var Cb=a.forwardRef(wb);n.p;function kb(){return(kb=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Eb(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Nb=a.createElement("desc",null,"Created with Sketch."),Sb=a.createElement("g",{id:"icon/button/reboot/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"Group-3",stroke:"#FFFFFF"},a.createElement("g",{id:"Group-2"},a.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"}),a.createElement("polyline",{id:"Stroke-3",points:"3.37563213 1.84831169 3.36911784 0.595324675 2.18174122 4.15223411e-14"})),a.createElement("line",{x1:5.92223784,y1:7.57277922,x2:5.92223784,y2:3.98212987,id:"Stroke-9"}),a.createElement("g",{id:"Group-2",transform:"translate(9.818105, 6.000000) scale(-1, -1) translate(-9.818105, -6.000000) translate(7.636287, 0.000000)"},a.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"}),a.createElement("polyline",{id:"Stroke-3",points:"3.37563213 1.84831169 3.36911784 0.595324675 2.18174122 4.15223411e-14"}))));function Ib(e,t){var n=e.title,r=e.titleId,i=Eb(e,["title","titleId"]);return a.createElement("svg",kb({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":r},i),n?a.createElement("title",{id:r},n):null,Nb,Sb)}var Lb=a.forwardRef(Ib);n.p;function Pb(){return(Pb=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Fb(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Db=a.createElement("desc",null,"Created with Sketch."),Tb=a.createElement("g",{id:"icon/button/reboot/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"Group-3",stroke:"#1B2559"},a.createElement("g",{id:"Group-2"},a.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"}),a.createElement("polyline",{id:"Stroke-3",points:"3.37563213 1.84831169 3.36911784 0.595324675 2.18174122 4.15223411e-14"})),a.createElement("line",{x1:5.92223784,y1:7.57277922,x2:5.92223784,y2:3.98212987,id:"Stroke-9"}),a.createElement("g",{id:"Group-2",transform:"translate(9.818105, 6.000000) scale(-1, -1) translate(-9.818105, -6.000000) translate(7.636287, 0.000000)"},a.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"}),a.createElement("polyline",{id:"Stroke-3",points:"3.37563213 1.84831169 3.36911784 0.595324675 2.18174122 4.15223411e-14"}))));function Rb(e,t){var n=e.title,r=e.titleId,i=Fb(e,["title","titleId"]);return a.createElement("svg",Pb({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":r},i),n?a.createElement("title",{id:r},n):null,Db,Tb)}var Bb=a.forwardRef(Rb);n.p;function Ab(){return(Ab=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Mb(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Wb=a.createElement("desc",null,"Created with Sketch."),zb=a.createElement("g",{id:"icon/button/shut-down/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"Group-5",transform:"translate(1.000000, 0.000000)",stroke:"#FFFFFF"},a.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"}),a.createElement("line",{x1:5,y1:.75,x2:5,y2:3.25,id:"Stroke-3"})));function qb(e,t){var n=e.title,r=e.titleId,i=Mb(e,["title","titleId"]);return a.createElement("svg",Ab({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":r},i),n?a.createElement("title",{id:r},n):null,Wb,zb)}var $b=a.forwardRef(qb);n.p;function Hb(){return(Hb=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Vb(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Ub=a.createElement("desc",null,"Created with Sketch."),Gb=a.createElement("g",{id:"icon/button/shut-down/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"Group-5",transform:"translate(1.000000, 0.000000)",stroke:"#1B2559"},a.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"}),a.createElement("line",{x1:5,y1:.75,x2:5,y2:3.25,id:"Stroke-3"})));function Xb(e,t){var n=e.title,r=e.titleId,i=Vb(e,["title","titleId"]);return a.createElement("svg",Hb({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":r},i),n?a.createElement("title",{id:r},n):null,Ub,Gb)}var _b=a.forwardRef(Xb);n.p;function Zb(){return(Zb=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Kb(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Qb=a.createElement("desc",null,"Created with Sketch."),Yb=a.createElement("g",{id:"icon/button/unpair/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"Group-12",stroke:"#FFFFFF"},a.createElement("g",{id:"Group-5"},a.createElement("polyline",{id:"Stroke-1",points:"3.75 6 2.25 6 0 3.75 3.75 0 6.75 3"}),a.createElement("polyline",{id:"Stroke-3",points:"8.25 6 9.75 6 12 8.25 8.25 12 5.25 9"})),a.createElement("line",{x1:8.25,y1:3,x2:8.25,y2:1.5,id:"Stroke-6"}),a.createElement("line",{x1:9.75,y1:3,x2:10.5,y2:2.25,id:"Stroke-7"}),a.createElement("line",{x1:9.75,y1:4.5,x2:11.25,y2:4.5,id:"Stroke-8"}),a.createElement("line",{x1:2.25,y1:7.5,x2:.75,y2:7.5,id:"Stroke-9"}),a.createElement("line",{x1:2.25,y1:9,x2:1.5,y2:9.75,id:"Stroke-10"}),a.createElement("line",{x1:3.75,y1:9,x2:3.75,y2:10.5,id:"Stroke-11"})));function Jb(e,t){var n=e.title,r=e.titleId,i=Kb(e,["title","titleId"]);return a.createElement("svg",Zb({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":r},i),n?a.createElement("title",{id:r},n):null,Qb,Yb)}var ef=a.forwardRef(Jb);n.p;function tf(){return(tf=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function nf(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var af=a.createElement("desc",null,"Created with Sketch."),rf=a.createElement("g",{id:"icon/button/unpair/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"Group-12",stroke:"#1B2559"},a.createElement("g",{id:"Group-5"},a.createElement("polyline",{id:"Stroke-1",points:"3.75 6 2.25 6 0 3.75 3.75 0 6.75 3"}),a.createElement("polyline",{id:"Stroke-3",points:"8.25 6 9.75 6 12 8.25 8.25 12 5.25 9"})),a.createElement("line",{x1:8.25,y1:3,x2:8.25,y2:1.5,id:"Stroke-6"}),a.createElement("line",{x1:9.75,y1:3,x2:10.5,y2:2.25,id:"Stroke-7"}),a.createElement("line",{x1:9.75,y1:4.5,x2:11.25,y2:4.5,id:"Stroke-8"}),a.createElement("line",{x1:2.25,y1:7.5,x2:.75,y2:7.5,id:"Stroke-9"}),a.createElement("line",{x1:2.25,y1:9,x2:1.5,y2:9.75,id:"Stroke-10"}),a.createElement("line",{x1:3.75,y1:9,x2:3.75,y2:10.5,id:"Stroke-11"})));function of(e,t){var n=e.title,r=e.titleId,i=nf(e,["title","titleId"]);return a.createElement("svg",tf({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":r},i),n?a.createElement("title",{id:r},n):null,af,rf)}var lf,cf,sf=a.forwardRef(of),df=(n.p,{label:{extend:Me.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:he}}),uf=Object(f.a)(df),mf=x()(lf||(lf=Object(c.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"]))),hf=x()(cf||(cf=Object(c.a)(["\n query getMachine($deviceId: ID!) {\n machine(deviceId: $deviceId) {\n latestEvent {\n note\n }\n }\n }\n"]))),pf=Object(a.memo)((function(e){var t=e.machine,n=e.onActionSuccess,r=Object(a.useState)({command:null}),i=Object(l.a)(r,2),o=i[0],c=i[1],d=Object(a.useState)({}),m=Object(l.a)(d,2),h=m[0],p=m[1],b=Object(a.useState)(null),f=Object(l.a)(b,2),j=f[0],g=f[1],O=uf(),x=Object(qe.jsx)("span",{className:O.warning,children:"A user may be in the middle of a transaction and they could lose their funds if you continue."}),v=Object(u.a)(hf,h),y=Object(l.a)(v,2),w=y[0],C=y[1].loading,k=Object(u.b)(mf,{onError:function(e){var t=e.message;g(null!==t&&void 0!==t?t:"An error ocurred")},onCompleted:function(){n&&n(),c({display:o.display,command:null})}}),E=Object(l.a)(k,2),N=E[0],S=E[1].loading,I=Boolean(o.command),L=!("restartServices"!==(null===o||void 0===o?void 0:o.command)||!C),P=function(e){p({variables:{deviceId:t.deviceId},onCompleted:function(t){var n,a=(n=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}(t))&&!["chooseCoin","idle","pendingIdle","dualIdle","networkDown","unpaired","maintenance","virgin","wifiList"].includes(n)?x:null;c(Object(s.a)(Object(s.a)({},e),{},{message:a}))}}),w()};return Object(qe.jsxs)("div",{children:[Object(qe.jsx)(Xe,{children:"Actions"}),Object(qe.jsxs)("div",{className:O.stack,children:[Object(qe.jsx)(He,{color:"primary",className:O.mr,Icon:Cb,InverseIcon:gb,disabled:S,onClick:function(){return c({command:"rename",display:"Rename",confirmationMessage:"Write the new name for this machine"})},children:"Rename"}),Object(qe.jsx)(He,{color:"primary",className:O.mr,Icon:sf,InverseIcon:ef,disabled:S,onClick:function(){return c({command:"unpair",display:"Unpair"})},children:"Unpair"}),Object(qe.jsx)(He,{color:"primary",className:O.mr,Icon:Bb,InverseIcon:Lb,disabled:S,onClick:function(){return c({command:"reboot",display:"Reboot"})},children:"Reboot"}),Object(qe.jsx)(He,{color:"primary",className:O.mr,Icon:_b,InverseIcon:$b,disabled:S,onClick:function(){return c({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(qe.jsx)(He,{color:"primary",className:O.inlineChip,Icon:Bb,InverseIcon:Lb,disabled:S,onClick:function(){P({command:"restartServices",display:"Restart services for"})},children:"Restart Services"})]}),Object(qe.jsx)(mb,{disabled:L,open:I,title:"".concat(o.display," this machine?"),errorMessage:j,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){g(null),N({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(){c({display:o.display,command:null}),g(null)}})]})})),bf=n(557);function ff(){return(ff=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function jf(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var gf=a.createElement("desc",null,"Created with Sketch."),Of=a.createElement("g",{id:"Styleguide",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinejoin:"round"},a.createElement("g",{id:"icon/action/copy",transform:"translate(1.000000, 1.000000)",stroke:"#1B2559"},a.createElement("g",{id:"Group-5-Copy-2"},a.createElement("polyline",{id:"Stroke-1",strokeWidth:2,points:"6 1.2 6 -0.00024 16 -0.00024 16 13.06376 12 13.06376"}),a.createElement("polygon",{id:"Stroke-3",strokeWidth:2,strokeLinecap:"round",points:"0 15.9368 10 15.9368 10 2.9368 0 2.9368"}))));function xf(e,t){var n=e.title,r=e.titleId,i=jf(e,["title","titleId"]);return a.createElement("svg",ff({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":r},i),n?a.createElement("title",{id:r},n):null,gf,Of)}var vf=a.forwardRef(xf),yf=(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:Ce,padding:[[0,12]]},shareIcon:{marginRight:6},button:{margin:8},titleAndButtonsContainer:{display:"flex"},buttonsWrapper:{display:"flex",marginLeft:16,"& > *":{margin:"auto 6px"}}}),wf=Me.label1,Cf={wrapper:{extend:Me.mono,display:"flex",alignItems:"center"},address:{lineBreak:"anywhere"},buttonWrapper:{"& button":{border:"none",backgroundColor:"transparent",cursor:"pointer"}},popoverContent:{extend:wf,display:"flex",justifyContent:"center",alignItems:"center",color:K,borderRadius:4,padding:[[5,9]]}},kf={idCardDataCard:{extend:Me.p,display:"flex",padding:[[11,8]],"& > div":{display:"flex",flexDirection:"column","& > div":{width:144,height:37,marginBottom:15,"&:last-child":{marginBottom:0}}}}},Ef={label:{extend:wf,color:se,marginBottom:4}},Nf={titleWrapper:yf.titleWrapper,titleAndButtonsContainer:yf.titleAndButtonsContainer,buttonsWrapper:yf.buttonsWrapper,headerLabels:{display:"flex",flexDirection:"row","& div":{display:"flex",alignItems:"center"},"& > div":{marginLeft:24},"& > div:first-child":{marginLeft:0},"& span":{extend:wf,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}},Sf=Object(f.a)(Cf),If=function(e){var t=e.className,n=e.buttonClassname,r=e.children,i=e.wrapperClassname,o=(Object(q.a)(e,["className","buttonClassname","children","wrapperClassname"]),Object(a.useState)(null)),c=Object(l.a)(o,2),s=c[0],d=c[1];Object(a.useEffect)((function(){s&&setTimeout((function(){return d(null)}),3e3)}),[s]);var u=Sf(),m=Boolean(s),h=m?"simple-popper":void 0;return Object(qe.jsx)("div",{className:I()(u.wrapper,i),children:r&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)("div",{className:I()(u.address,t),children:r}),Object(qe.jsx)("div",{className:I()(u.buttonWrapper,n),children:Object(qe.jsx)(bf.CopyToClipboard,{text:Dm.a(/\s/g,"")(r),children:Object(qe.jsx)("button",{"aria-describedby":h,onClick:function(e){return function(e){d(s?null:e.currentTarget)}(e)},children:Object(qe.jsx)(vf,{})})})}),Object(qe.jsx)(Xn,{id:h,open:m,anchorEl:s,onClose:function(){d(null)},arrowSize:3,bgColor:$,placement:"top",children:Object(qe.jsx)("div",{className:u.popoverContent,children:Object(qe.jsx)("div",{children:"Copied to clipboard!"})})})]})})},Lf=Object(f.a)(ob),Pf=function(e){var t=e.data,n=e.onActionSuccess,a=Lf();return Object(qe.jsxs)("div",{className:a.contentContainer,children:[Object(qe.jsx)("div",{className:a.row,children:Object(qe.jsx)("div",{className:a.rowItem,children:Object(qe.jsx)(Xe,{children:t.name})})}),Object(qe.jsx)("div",{className:a.row,children:Object(qe.jsxs)("div",{className:a.rowItem,children:[Object(qe.jsx)(at,{className:a.label3,children:"Status"}),t&&t.statuses?Object(qe.jsx)(Au,{status:t.statuses[0]}):null]})}),Object(qe.jsxs)("div",{className:a.row,children:[Object(qe.jsxs)("div",{className:a.rowItem,children:[Object(qe.jsx)(at,{className:a.label3,children:"Ping"}),Object(qe.jsx)(Ke,{noMargin:!0,children:t.responseTime?new Hc.a(t.responseTime).toFixed(3).toString()+" ms":"unavailable"})]}),Object(qe.jsxs)("div",{className:a.rowItem,children:[Object(qe.jsx)(at,{className:a.label3,children:"Last ping"}),Object(qe.jsx)(Ke,{noMargin:!0,children:t.lastPing?Object(sb.a)(new Date(t.lastPing),new Date,{addSuffix:!0}):"unknown"})]}),Object(qe.jsxs)("div",{className:a.rowItem,children:[Object(qe.jsx)(at,{className:a.label3,children:"Network speed"}),Object(qe.jsx)(Ke,{noMargin:!0,children:t.downloadSpeed?new Hc.a(t.downloadSpeed).toFixed(t.downloadSpeed<10?2:0).toString()+" MB/s":"unavailable"})]})]}),Object(qe.jsx)("div",{className:a.row,children:Object(qe.jsxs)("div",{className:a.rowItem,children:[Object(qe.jsx)(at,{className:a.label3,children:"Device ID"}),Object(qe.jsx)(Ke,{noMargin:!0,children:Object(qe.jsx)(If,{buttonClassname:a.copyToClipboard,children:t.deviceId})})]})}),Object(qe.jsx)("div",{className:a.row,children:Object(qe.jsx)(pf,{machine:t,onActionSuccess:n})})]})},Ff=n(81),Df=n(1116),Tf=n(1072),Rf=n(1073),Bf=n(321),Af=n.n(Bf),Mf=n(558),Wf=n.n(Mf);function zf(){return(zf=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function qf(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var $f=a.createElement("g",{id:"icon/ID/card/new/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("polygon",{id:"Stroke-1",stroke:"#FFFFFF",strokeWidth:1.6,points:"1 17 23 17 23 1 1 1"}),a.createElement("line",{x1:12.7857143,y1:5,x2:19.8571429,y2:5,id:"Stroke-3",stroke:"#FFFFFF",strokeWidth:1.6}),a.createElement("line",{x1:12.7857143,y1:8.2,x2:19.8571429,y2:8.2,id:"Stroke-4",stroke:"#FFFFFF",strokeWidth:1.6}),a.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 Hf(e,t){var n=e.title,r=e.titleId,i=qf(e,["title","titleId"]);return a.createElement("svg",zf({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":r},i),void 0===n?a.createElement("title",{id:r},"icon/ID/card/new/white"):n?a.createElement("title",{id:r},n):null,$f)}var Vf=a.forwardRef(Hf);n.p;function Uf(){return(Uf=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Gf(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Xf=a.createElement("g",{id:"icon/ID/card/new/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"Group-2",transform:"translate(1.000000, 1.000000)",stroke:"#1B2559",strokeWidth:1.6},a.createElement("g",{id:"id-copy"},a.createElement("polygon",{id:"Stroke-1",points:"0 16 22 16 22 0 0 0"}),a.createElement("line",{x1:11.7857143,y1:4,x2:18.8571429,y2:4,id:"Stroke-3"}),a.createElement("line",{x1:11.7857143,y1:7.2,x2:18.8571429,y2:7.2,id:"Stroke-4"}),a.createElement("polygon",{id:"Stroke-5",points:"3.14285714 11.2 8.64285714 11.2 8.64285714 4 3.14285714 4"}))));function _f(e,t){var n=e.title,r=e.titleId,i=Gf(e,["title","titleId"]);return a.createElement("svg",Uf({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":r},i),void 0===n?a.createElement("title",{id:r},"icon/ID/card/new/zodiac"):n?a.createElement("title",{id:r},n):null,Xf)}var Zf=a.forwardRef(_f);n.p;function Kf(){return(Kf=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Qf(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Yf=a.createElement("g",{id:"icon/ID/phone/new/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.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 Jf(e,t){var n=e.title,r=e.titleId,i=Qf(e,["title","titleId"]);return a.createElement("svg",Kf({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":r},i),void 0===n?a.createElement("title",{id:r},"icon/ID/phone/new/white"):n?a.createElement("title",{id:r},n):null,Yf)}var ej=a.forwardRef(Jf);n.p;function tj(){return(tj=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function nj(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var aj=a.createElement("g",{id:"icon/ID/phone/new/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.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 rj(e,t){var n=e.title,r=e.titleId,i=nj(e,["title","titleId"]);return a.createElement("svg",tj({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":r},i),void 0===n?a.createElement("title",{id:r},"icon/ID/phone/new/zodiac"):n?a.createElement("title",{id:r},n):null,aj)}var ij=a.forwardRef(rj);n.p;function oj(){return(oj=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function lj(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var cj=a.createElement("g",{id:"icon/ID/photo/new/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.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 sj(e,t){var n=e.title,r=e.titleId,i=lj(e,["title","titleId"]);return a.createElement("svg",oj({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":r},i),void 0===n?a.createElement("title",{id:r},"icon/ID/photo/new/white"):n?a.createElement("title",{id:r},n):null,cj)}var dj=a.forwardRef(sj);n.p;function uj(){return(uj=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function mj(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var hj=a.createElement("desc",null,"Created with Sketch."),pj=a.createElement("g",{id:"icon/button/cancel/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"Group-5",stroke:"#1B2559",strokeWidth:1.2},a.createElement("line",{x1:12,y1:0,x2:0,y2:12,id:"Stroke-1"}),a.createElement("line",{x1:0,y1:0,x2:12,y2:12,id:"Stroke-3"})));function bj(e,t){var n=e.title,r=e.titleId,i=mj(e,["title","titleId"]);return a.createElement("svg",uj({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":r},i),n?a.createElement("title",{id:r},n):null,hj,pj)}var fj=a.forwardRef(bj);n.p;function jj(){return(jj=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function gj(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Oj=a.createElement("desc",null,"Created with Sketch."),xj=a.createElement("g",{id:"icon/button/download/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"icon/sf-small/wizzard",stroke:"#FFFFFF"},a.createElement("polyline",{id:"Path-3",points:"3.6 5.4 6 7.8 8.4 5.4"}),a.createElement("line",{x1:6,y1:.5,x2:6,y2:7.4,id:"Path-4"}),a.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 vj(e,t){var n=e.title,r=e.titleId,i=gj(e,["title","titleId"]);return a.createElement("svg",jj({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":r},i),n?a.createElement("title",{id:r},n):null,Oj,xj)}var yj=a.forwardRef(vj);n.p;function wj(){return(wj=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Cj(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var kj=a.createElement("desc",null,"Created with Sketch."),Ej=a.createElement("g",{id:"icon/button/download/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"icon/sf-small/wizzard",stroke:"#1B2559"},a.createElement("polyline",{id:"Path-3",points:"3.6 5.4 6 7.8 8.4 5.4"}),a.createElement("line",{x1:6,y1:.5,x2:6,y2:7.4,id:"Path-4"}),a.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 Nj(e,t){var n=e.title,r=e.titleId,i=Cj(e,["title","titleId"]);return a.createElement("svg",wj({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":r},i),n?a.createElement("title",{id:r},n):null,kj,Ej)}var Sj,Ij,Lj,Pj=a.forwardRef(Nj),Fj=(n.p,n(92)),Dj=n(567),Tj=n(175),Rj=n(110),Bj=n(559),Aj=n(399),Mj="",Wj="https://".concat(window.location.hostname,":4001"),zj=Object(Aj.createUploadLink)({credentials:"include",uri:"".concat(Mj,"/graphql")}),qj=Object(Aj.createUploadLink)({credentials:"include",uri:"".concat(Wj,"/graphql")}),$j=function(e){var t=e.children,n=Object(w.h)(),r=Object(w.i)(),i=Object(a.useContext)(k),o=(i.userData,function(e,t,n,a,r){return new Tj.a({link:Rj.ApolloLink.from([Object(Bj.a)((function(n){var r=n.graphQLErrors,i=n.networkError;r&&r.forEach((function(n){var r=n.message,i=n.locations,o=n.path,l=n.extensions;"UNAUTHENTICATED"===(null===l||void 0===l?void 0:l.code)&&(a(null),"/login"!==t.pathname&&e.push("/login")),console.log("[GraphQL error]: Message: ".concat(r,", Location: ").concat(i,", Path: ").concat(o))})),i&&console.log("[Network error]: ".concat(i))})),new Rj.ApolloLink((function(e,t){return t(e).map((function(t){var n=e.getContext().response.headers;if(n){var a=n.get("lamassu_role");r(a)}return t}))})),Rj.ApolloLink.split((function(e){return"pazuz"===e.getContext().clientName}),qj,zj)]),cache:new Dj.a,defaultOptions:{watchQuery:{fetchPolicy:"no-cache",errorPolicy:"ignore"},query:{fetchPolicy:"no-cache",errorPolicy:"all"},mutate:{errorPolicy:"all"}}})}(n,r,0,i.setUserData,i.setRole));return Object(qe.jsx)(Fj.a,{client:o,children:t})},Hj=n(1068),Vj=n(1069),Uj=n(1070),Gj=n(1071),Xj=Lu.a(Vm.a(["firstName","lastName"]),yd.a,dm.a(Hj.a([D.a,Wa.a])),T.a(Mm),Vj.a(" ")),_j=function(e){var t,n=e.isAnonymous,a=e.customerName,r=e.customerIdCardData,i=e.customerPhone;return n?"Anonymous":a||za.a(i,(t=r)?function(e){var t=e.firstName,n=e.lastName;return t&&n?"".concat(Uj.a(Gj.a,op.a)(t),". ").concat(n):D.a(t)?n:D.a(n)?t:null}(t):null)},Zj={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]],whiteSpace:"nowrap"},txIcon:{marginRight:10},clipboardPopover:{height:164,width:215},idButton:{marginRight:4},idCardDataCard:{extend:Me.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:$,color:K,height:24,marginBottom:-24,marginTop:-3,marginLeft:7,borderRadius:4},chipLabel:{color:K},otherActionsGroup:{display:"flex",flexDirection:"row"},addressHeader:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},walletScore:{display:"flex",flexDirection:"row",alignItems:"center","& > p":{marginLeft:5}},error:{color:Q},swept:{width:250}},Kj=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||e.batchError?"Error":e.sendConfirmed?"Sent":e.expired?"Expired":e.batched?"Batched":"Pending"}(e)},Qj=function(e){return D.a(e.hasError)?D.a(e.batchError)?null:"Batch error: ".concat(e.batchError):e.hasError},Yj=Object(f.a)(Zj),Jj=x()(Sj||(Sj=Object(c.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"]))),eg=x()(Ij||(Ij=Object(c.a)(["\n mutation cancelCashOutTransaction($id: ID!) {\n cancelCashOutTransaction(id: $id) {\n id\n }\n }\n"]))),tg=x()(Lj||(Lj=Object(c.a)(["\n mutation cancelCashInTransaction($id: ID!) {\n cancelCashInTransaction(id: $id) {\n id\n }\n }\n"]))),ng=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Ff.utils.formatCryptoAddress(e,t).replace(/(.{5})/g,"$1 ")},ag=function(e){var t=e.children,n=Yj();return Object(qe.jsx)(at,{className:n.label,children:t})},rg=function(e){var t,n,r,i=e.it,o=e.timezone,c=Yj(),s=Object(a.useState)({command:null}),d=Object(l.a)(s,2),m=d[0],h=d[1],p=Object(a.useState)(""),b=Object(l.a)(p,2),f=b[0],j=b[1],g="cashIn"===i.txClass,O=new Wf.a,x=Object(u.a)(Jj,{onCompleted:function(e){return $(M.a((function(e){return!Wa.a(e)}),e))}}),v=Object(l.a)(x,1)[0],y=Object(u.b)(g?tg:eg,{onError:function(e){var t=e.message;return j(null!==t&&void 0!==t?t:"An error occurred.")},refetchQueries:function(){return["transactions"]}}),w=Object(l.a)(y,1)[0],C=Hc()(i.profit).abs().toFixed(2,1),k=100*Number.parseFloat(i.commissionPercentage,2),E=g?Number.parseFloat(i.cashInFee):0,N=Hc()(i.fiat).minus(E).toFixed(2,1),S=function(e){return Ff.utils.toUnit(new Hc.a(e.cryptoAtoms),e.cryptoCode).toNumber()}(i),P=Hc()(N).div(S).toFixed(2,1),F="1 ".concat(i.cryptoCode," = ").concat(P," ").concat(i.fiatCode),R=i.discount?"-".concat(i.discount,"%"):null,B=Object(Df.a)(new Date,"yyyyMMdd"),A=i.customerIdCardData&&{name:Xj(i.customerIdCardData),age:null!==(t=i.customerIdCardData.dateOfBirth&&Object(Tf.a)(B(i.customerIdCardData.dateOfBirth),new Date))&&void 0!==t?t:"",country:i.customerIdCardData.country,idCardNumber:i.customerIdCardData.documentNumber,idCardExpirationDate:null!==(n=i.customerIdCardData.expirationDate&&Object(hd.a)("yyyy-MM-dd")(B(i.customerIdCardData.expirationDate)))&&void 0!==n?n:""},W=Object(Rf.a)({minutes:3},new Date(i.created)),q=Object(Fd.a)({minutes:3},new Date(i.created)),$=function(){var e=Object(Al.a)(Bl.a.mark((function e(t){var n,a,r;return Bl.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n="tx_".concat(i.id,"_summary.zip"),a=Vc.a(t),T.a((function(e){return O.file(e+".csv",t[e])}),a),e.next=5,O.generateAsync({type:"blob"});case 5:r=e.sent,Af.a.saveAs(r,n);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),H=function(e){return!D.a(e.errorCode)&&L.a(e.errorCode,["scoreThresholdReached","ciphertraceError"])},V=Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(ag,{children:"Transaction status"}),Object(qe.jsx)("span",{className:c.bold,children:Kj(i)})]}),U=Object(qe.jsxs)("div",{className:c.walletScore,children:[Object(qe.jsx)("svg",{width:103,height:10,children:T.a((function(e){return Object(qe.jsx)("circle",{cx:10*e+6,cy:4,r:3.5,fill:e<i.walletScore?H(i)?he:J:H(i)?pe:re})}),Du.a(0,10))}),Object(qe.jsx)(Ke,{noMargin:!0,className:I()((r={},Object(z.a)(r,c.bold,!0),Object(z.a)(r,c.error,H(i)),r)),children:i.walletScore})]});return Object(qe.jsxs)("div",{className:c.wrapper,children:[Object(qe.jsxs)("div",{className:c.row,children:[Object(qe.jsxs)("div",{className:c.direction,children:[Object(qe.jsx)(ag,{children:"Direction"}),Object(qe.jsxs)("div",{children:[Object(qe.jsx)("span",{className:c.txIcon,children:g?Object(qe.jsx)(Dc,{}):Object(qe.jsx)(zc,{})}),Object(qe.jsx)("span",{children:g?"Cash-in":"Cash-out"})]})]}),Object(qe.jsxs)("div",{className:c.availableIds,children:[Object(qe.jsx)(ag,{children:"Available IDs"}),Object(qe.jsxs)(nl.a,{display:"flex",flexDirection:"row",children:[i.customerPhone&&Object(qe.jsx)(Yn,{className:c.idButton,name:"phone",Icon:ij,InverseIcon:ej,children:i.customerPhone}),i.customerIdCardPhotoPath&&!i.customerIdCardData&&Object(qe.jsx)(Yn,{popoverClassname:c.clipboardPopover,className:c.idButton,name:"card",Icon:Zf,InverseIcon:Vf,children:Object(qe.jsx)("img",{className:c.idCardPhoto,src:"".concat(Mj,"/id-card-photo/").concat(i.customerIdCardPhotoPath),alt:""})}),i.customerIdCardData&&Object(qe.jsx)(Yn,{className:c.idButton,name:"card",Icon:Zf,InverseIcon:Vf,children:Object(qe.jsxs)("div",{className:c.idCardDataCard,children:[Object(qe.jsxs)("div",{children:[Object(qe.jsxs)("div",{children:[Object(qe.jsx)(ag,{children:"Name"}),Object(qe.jsx)("div",{children:A.name})]}),Object(qe.jsxs)("div",{children:[Object(qe.jsx)(ag,{children:"Age"}),Object(qe.jsx)("div",{children:A.age})]}),Object(qe.jsxs)("div",{children:[Object(qe.jsx)(ag,{children:"Country"}),Object(qe.jsx)("div",{children:A.country})]})]}),Object(qe.jsxs)("div",{children:[Object(qe.jsxs)("div",{children:[Object(qe.jsx)(ag,{children:"ID number"}),Object(qe.jsx)("div",{children:A.idCardNumber})]}),Object(qe.jsxs)("div",{children:[Object(qe.jsx)(ag,{children:"Expiration date"}),Object(qe.jsx)("div",{children:A.idCardExpirationDate})]})]})]})}),i.customerFrontCameraPath&&Object(qe.jsx)(Yn,{className:c.idButton,name:"cam",Icon:Ri,InverseIcon:dj,children:Object(qe.jsx)("img",{src:"".concat(Mj,"/front-camera-photo/").concat(i.customerFrontCameraPath),alt:""})}),i.txCustomerPhotoPath&&Object(qe.jsx)(Yn,{name:"cam",Icon:Ri,InverseIcon:dj,children:Object(qe.jsx)("img",{src:"".concat(Mj,"/operator-data/customersphotos/").concat(i.txCustomerPhotoPath),alt:""})})]})]}),Object(qe.jsxs)("div",{className:c.exchangeRate,children:[Object(qe.jsx)(ag,{children:"Exchange rate"}),Object(qe.jsx)("div",{children:S>0?F:"-"})]}),Object(qe.jsxs)("div",{className:c.commission,children:[Object(qe.jsx)(ag,{children:"Commission"}),Object(qe.jsxs)("div",{className:c.container,children:["".concat(C," ").concat(i.fiatCode," (").concat(k," %)"),R&&Object(qe.jsx)("div",{className:c.chip,children:Object(qe.jsx)(at,{className:c.chipLabel,children:R})})]})]}),Object(qe.jsxs)("div",{children:[Object(qe.jsx)(ag,{children:"Fixed fee"}),Object(qe.jsx)("div",{children:g?"".concat(E," ").concat(i.fiatCode):"N/A"})]})]}),Object(qe.jsxs)("div",{className:c.secondRow,children:[Object(qe.jsxs)("div",{className:c.address,children:[Object(qe.jsxs)("div",{className:c.addressHeader,children:[Object(qe.jsx)(ag,{children:"Address"}),!D.a(i.walletScore)&&Object(qe.jsx)(Np,{parentElements:U,children:"CipherTrace score: ".concat(i.walletScore,"/10")})]}),Object(qe.jsx)("div",{children:Object(qe.jsx)(If,{children:ng(i.cryptoCode,i.toAddress)})})]}),Object(qe.jsxs)("div",{className:c.transactionId,children:[Object(qe.jsx)(ag,{children:"Transaction ID"}),Object(qe.jsx)("div",{children:"cashOut"===i.txClass?"N/A":Object(qe.jsx)(If,{children:i.txHash})})]}),Object(qe.jsxs)("div",{className:c.sessionId,children:[Object(qe.jsx)(ag,{children:"Session ID"}),Object(qe.jsx)(If,{children:i.id})]})]}),Object(qe.jsxs)("div",{className:c.lastRow,children:[Object(qe.jsxs)("div",{className:c.status,children:[Qj(i)?Object(qe.jsx)(Np,{parentElements:V,width:200,children:Object(qe.jsx)(Ke,{children:Qj(i)})}):V,("cashOut"===i.txClass&&"Pending"===Kj(i)||"cashIn"===i.txClass&&"Batched"===Kj(i))&&Object(qe.jsx)(He,{color:"primary",Icon:fj,InverseIcon:ba,className:c.cancelTransaction,onClick:function(){return h({command:"cancelTx"})},children:"Cancel transaction"})]}),!D.a(i.swept)&&L.a(i.cryptoCode,ep)&&Object(qe.jsxs)("div",{className:c.swept,children:[Object(qe.jsx)(ag,{children:"Sweep status"}),Object(qe.jsx)("span",{className:c.bold,children:i.swept?"Swept":"Unswept"})]}),Object(qe.jsxs)("div",{children:[Object(qe.jsx)(ag,{children:"Other actions"}),Object(qe.jsx)("div",{className:c.otherActionsGroup,children:Object(qe.jsx)(He,{color:"primary",Icon:Pj,InverseIcon:yj,className:c.downloadRawLogs,onClick:function(){return function(e,t){var n=e.id,a=e.deviceId,r=e.txClass;v({variables:{txId:n,from:W,until:q,deviceId:a,txClass:r,timezone:t}})}(i,o)},children:"Download raw logs"})})]})]}),Object(qe.jsx)(mb,{open:"cancelTx"===m.command,title:"Cancel this transaction?",errorMessage:f,toBeConfirmed:i.machineName,message:g?"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(){j(null),h({command:null}),w({variables:{id:i.id}})},onDismissed:function(){h({command:null}),j(null)}})]})},ig=Object(a.memo)(rg,(function(e,t){return e.it.id===t.it.id&&e.it.hasError===t.it.hasError&&e.it.batchError===t.it.batchError&&Kj(e.it)===Kj(t.it)})),og=n(144),lg={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 cg(){return(cg=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function sg(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var dg=a.createElement("desc",null,"Created with Sketch."),ug=a.createElement("g",{id:"Styleguide",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"icon/action/expand/closed",transform:"translate(1.000000, 1.000000)",stroke:"#1B2559",strokeWidth:1.5},a.createElement("circle",{id:"Oval-4",cx:14,cy:2,r:2}),a.createElement("circle",{id:"Oval-4-Copy",cx:8,cy:2,r:2}),a.createElement("circle",{id:"Oval-4-Copy-2",cx:2,cy:2,r:2})));function mg(e,t){var n=e.title,r=e.titleId,i=sg(e,["title","titleId"]);return a.createElement("svg",cg({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":r},i),n?a.createElement("title",{id:r},n):null,dg,ug)}var hg=a.forwardRef(mg);n.p;function pg(){return(pg=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function bg(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var fg=a.createElement("desc",null,"Created with Sketch."),jg=a.createElement("g",{id:"Styleguide",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"icon/action/expand/open",transform:"translate(1.000000, 1.000000)",fill:"#1B2559",stroke:"#1B2559",strokeWidth:1.5},a.createElement("circle",{id:"Oval-4",cx:14,cy:2,r:2}),a.createElement("circle",{id:"Oval-4-Copy",cx:8,cy:2,r:2}),a.createElement("circle",{id:"Oval-4-Copy-2",cx:2,cy:2,r:2})));function gg(e,t){var n=e.title,r=e.titleId,i=bg(e,["title","titleId"]);return a.createElement("svg",pg({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":r},i),n?a.createElement("title",{id:r},n):null,fg,jg)}var Og,xg,vg,yg,wg,Cg=a.forwardRef(gg),kg=(n.p,Object(f.a)(lg)),Eg=function(e){var t,n=e.id,a=e.elements,r=e.data,i=e.width,o=e.Details,l=e.expanded,c=e.expandRow,d=e.expWidth,u=e.expandable,m=e.onClick,h=kg(),p=m||u,b=(t={},Object(z.a)(t,h.pointer,p),Object(z.a)(t,h.row,!0),Object(z.a)(t,h.expanded,l),t);return Object(qe.jsxs)("div",{className:h.rowWrapper,children:[Object(qe.jsx)("div",{className:I()(Object(z.a)({},h.before,l&&0!==n)),children:Object(qe.jsxs)(Sm,{className:I()(b),onClick:function(){u&&c(n),m&&m(r)},error:r.error,errorMessage:r.errorMessage,children:[a.map((function(e,t){var n=e.view,a=void 0===n?function(e){return null===e||void 0===e?void 0:e.toString()}:n,i=Object(q.a)(e,["view"]);return Object(qe.jsx)(km,Object(s.a)(Object(s.a)({},i),{},{children:a(r)}),t)})),u&&Object(qe.jsx)(km,{width:d,textAlign:"center",children:Object(qe.jsxs)("button",{onClick:function(){return c(n)},className:h.expandButton,children:[l&&Object(qe.jsx)(Cg,{}),!l&&Object(qe.jsx)(hg,{})]})})]})}),u&&l&&Object(qe.jsx)("div",{className:h.after,children:Object(qe.jsx)(Sm,{className:I()(Object(z.a)({},h.expanded,l)),children:Object(qe.jsx)(km,{width:i,children:Object(qe.jsx)(o,{it:r})})})})]})},Ng=function(e){var t=e.elements,n=void 0===t?[]:t,r=e.data,i=void 0===r?[]:r,o=e.Details,c=(e.className,e.expandable),d=e.initialExpanded,u=e.onClick,m=e.loading,h=e.emptyText,p=e.extraHeight,b=Object(q.a)(e,["elements","data","Details","className","expandable","initialExpanded","onClick","loading","emptyText","extraHeight"]),f=Object(a.useState)(d),j=Object(l.a)(f,2),g=j[0],O=j[1];Object(a.useEffect)((function(){return O(d)}),[d]);var x=P.a(js.a,T.a(R.a("width")))(n),v=850-x,y=x+(c?v:0),w=kg({width:y}),C=function(e){O(e===g?null:e)},k=new og.c({defaultHeight:62,fixedWidth:!0});function E(e){var t=e.index,a=e.key,r=e.parent,l=e.style;return Object(qe.jsx)(og.b,{cache:k,columnIndex:0,parent:r,rowIndex:t,children:Object(qe.jsx)("div",{style:l,children:Object(qe.jsx)(Eg,{width:y,id:t,expWidth:v,elements:n,data:i[t],Details:o,expanded:t===g,expandRow:C,expandable:c,onClick:u})})},a)}return Object(qe.jsx)(nl.a,{display:"flex",flex:"1",flexDirection:"column",children:Object(qe.jsxs)(vm,{className:w.table,children:[Object(qe.jsxs)(ym,{children:[n.map((function(e,t){var n=e.width,a=e.className,r=e.textAlign,i=e.header;return Object(qe.jsx)(Em,{width:n,className:a,textAlign:r,children:i},t)})),c&&Object(qe.jsx)(Em,{width:v})]}),Object(qe.jsxs)(Cm,{className:w.body,children:[m&&Object(qe.jsx)(_e,{children:"Loading..."}),!m&&Wa.a(i)&&Object(qe.jsx)(_e,{children:h}),Object(qe.jsx)(og.a,{disableWidth:!0,disableHeight:!0,children:function(){return Object(qe.jsx)(og.d,Object(s.a)(Object(s.a)({style:{overflowX:"inherit",outline:"none"}},b),{},{height:62*i.length+p,width:y,rowCount:i.length,rowHeight:k.rowHeight,rowRenderer:E,overscanRowCount:50,deferredMeasurementCache:k}))}})]})]})})},Sg=Object(f.a)(Nf),Ig=x()(Og||(Og=Object(c.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 rawTickerPrice\n profit\n }\n }\n"]))),Lg=x()(xg||(xg=Object(c.a)(["\n query getData {\n config\n }\n"]))),Pg=function(e){var t=e.id,n=Sg(),r=Object(a.useState)(0),i=Object(l.a)(r,2),o=i[0],c=i[1],s=Object(a.useState)(""),d=Object(l.a)(s,2),m=d[0],h=d[1],p=Object(u.a)(Ig,{variables:{limit:5,deviceId:t}}),b=Object(l.a)(p,2),f=b[0],j=b[1],g=j.data,O=j.loading,x=Object(u.c)(Lg),v=x.data,y=x.loading,w=A.a(["config","locale_timezone"],v),C=O||y;!C&&g&&(g.transactions=g.transactions.splice(0,5)),Object(a.useEffect)((function(){null!==t&&f()}),[f,t]);var k=[{header:"",width:0,size:"sm",view:function(e){return"cashOut"===e.txClass?Object(qe.jsx)(zc,{}):Object(qe.jsx)(Dc,{})}},{header:"Customer",width:122,size:"sm",view:_j},{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(Ff.utils.toUnit(new Hc.a(e.cryptoAtoms),e.cryptoCode).toFormat(5)," ").concat(e.cryptoCode)}},{header:"Address",view:function(e){return Ff.utils.formatCryptoAddress(e.cryptoCode,e.toAddress)},className:n.overflowTd,size:"sm",textAlign:"left",width:140},{header:"Date",view:function(e){return fd(e.created,w,"yyyy\u2011MM\u2011dd")},textAlign:"left",size:"sm",width:140},{header:"Status",view:function(e){return Kj(e)},size:"sm",width:20}];return Object(qe.jsx)(Ng,{extraHeight:o,onClick:function(e){m===e.id?(h(""),c(0)):(h(e.id),c(310))},loading:C||null===t,emptyText:"No transactions so far",elements:k,data:A.a(["transactions"])(g),Details:ig,expandable:!0})},Fg=Object(f.a)(ob),Dg=x()(vg||(vg=Object(c.a)(["\n query getMachine($deviceId: ID!, $billFilters: JSONObject) {\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 cassette3\n cassette4\n numberOfCassettes\n statuses {\n label\n type\n }\n downloadSpeed\n responseTime\n packetLoss\n latestEvent {\n note\n }\n }\n bills(filters: $billFilters) {\n id\n fiat\n deviceId\n created\n }\n config\n }\n"]))),Tg=function(e){var t,n,a,r,i,o,l=e.data,c=e.refetch,s=e.reload,d=Fg(),u=null!==(t=A.a(["config","locale_timezone"],l))&&void 0!==t?t:{},m=null!==(n=A.a(["machine"])(l))&&void 0!==n?n:{},p=null!==(a=A.a(["config"])(l))&&void 0!==a?a:{},b=null!==(r=A.a(["bills"])(l))&&void 0!==r?r:[],f=null!==(i=A.a(["name"])(m))&&void 0!==i?i:null,j=null!==(o=A.a(["deviceId"])(m))&&void 0!==o?o:null;return Object(qe.jsxs)(h.a,{container:!0,className:d.grid,children:[Object(qe.jsx)(h.a,{item:!0,xs:3,children:Object(qe.jsx)(h.a,{item:!0,xs:12,children:Object(qe.jsxs)("div",{className:d.breadcrumbsContainer,children:[Object(qe.jsxs)(em.a,{separator:Object(qe.jsx)(nm.a,{fontSize:"small"}),children:[Object(qe.jsx)(C.b,{to:"/dashboard",className:d.breadcrumbLink,children:Object(qe.jsx)(it,{noMargin:!0,className:d.subtitle,children:"Dashboard"})}),Object(qe.jsx)(nt,{noMargin:!0,className:d.subtitle,children:f})]}),Object(qe.jsx)(Pf,{data:m,onActionSuccess:s})]})})}),Object(qe.jsx)(h.a,{item:!0,xs:9,children:Object(qe.jsxs)("div",{className:d.content,children:[Object(qe.jsxs)("div",{className:I()(d.detailItem,d.detailsMargin),children:[Object(qe.jsx)(tt,{className:d.subtitle,children:"Details"}),Object(qe.jsx)(cb,{data:m,timezone:u})]}),Object(qe.jsxs)("div",{className:d.detailItem,children:[Object(qe.jsx)(tt,{className:d.subtitle,children:"Cash box & cassettes"}),Object(qe.jsx)(Zp,{refetchData:c,machine:m,config:null!==p&&void 0!==p&&p,bills:b})]}),Object(qe.jsxs)("div",{className:d.transactionsItem,children:[Object(qe.jsx)(tt,{className:d.subtitle,children:"Latest transactions"}),Object(qe.jsx)(Pg,{id:j})]}),Object(qe.jsxs)("div",{className:d.detailItem,children:[Object(qe.jsx)(tt,{className:d.subtitle,children:"Commissions"}),Object(qe.jsx)(rb,{name:"commissions",id:j})]})]})})]})},Rg=function(){var e=Object(w.i)(),t=Object(w.h)(),n=function(e){return e.slice(e.lastIndexOf("/")+1)}(e.pathname),r=Object(a.useState)(!0),i=Object(l.a)(r,2),o=i[0],c=i[1],s=Object(u.c)(Dg,{onCompleted:function(e){if(null===e.machine)return t.push("/maintenance/machine-status");c(!1)},variables:{deviceId:n,billFilters:{deviceId:n,batch:"none"}}}),d=s.data,m=s.refetch;return!o&&Object(qe.jsx)(Tg,{data:d,refetch:m,reload:function(){return t.push(e.pathname)}})},Bg=n(102),Ag=n(330),Mg=n(1075),Wg=n(1076),zg={AED:{thickness:12,lengths:{5:[153,133],10:[157,137],20:[159,139],50:[161,141],100:[165,145],200:[167,147],500:[169,149],1e3:[173,153]},polymer:!1},ANG:{thickness:12,lengths:{10:[152,142],25:[152,142],50:[152,142],100:[152,142]},polymer:!1},AUD:{thickness:13,lengths:{5:[140,120],10:[147,127],20:[154,134],50:[161,141],100:[168,148]},polymer:!0},BGN:{thickness:13,lengths:{1:[117,107],2:[121,111],5:[126,116],10:[131,121],20:[136,126],50:[141,131],100:[146,136]},polymer:!1},CAD:{thickness:13,lengths:{5:[162,142],10:[162,142],20:[162,142],50:[162,142],100:[162,142]},polymer:!0},CHF:{thickness:13,lengths:{10:[133,113],20:[140,120],50:[147,127],100:[154,134],200:[161,141],1e3:[168,148]},polymer:!1},CNY:{thickness:13,lengths:{1:[140,120],5:[145,125],10:[150,130],20:[155,135],50:[160,140],100:[145,165]},polymer:!1},COP:{thickness:13,lengths:{2e3:[138,118],5e3:[143,123],1e4:[148,128],2e4:[153,133],5e4:[158,138],1e5:[163,143]},polymer:!1},CRC:{thickness:13,lengths:{1e3:[130,120],2e3:[137,127],5e3:[144,134],1e4:[151,141],2e4:[158,148],5e4:[170,150]},polymer:!0},CZK:{thickness:12,lengths:{100:[150,130],200:[156,136],500:[162,142],1e3:[168,148],2e3:[174,154],5e3:[180,160]},polymer:!1},EUR:{thickness:12,lengths:{5:[130,110],10:[137,117],20:[143,123],50:[150,130],100:[157,137],200:[163,143],500:[170,150]},polymer:!1},GBP:{thickness:13,lengths:{5:[145,125],10:[152,132],20:[149,129],50:[166,146]},polymer:!0},GHS:{thickness:12,lengths:{1:[147,127],2:[150,130],5:[151,131],10:[155,135],20:[159,139],50:[163,143]},polymer:!1},GIP:{thickness:12,lengths:{5:[138,128],10:[146,136],20:[155,145],50:[162,152],100:[169,159]},polymer:!1},GTQ:{thickness:12,lengths:{5:[163,153],10:[161,151],20:[163,153],50:[161,151],100:[161,151],200:[161,151]},polymer:!1},HKD:{thickness:13,lengths:{10:[144,124],20:[153,133],50:[158,138],100:[163,143],500:[168,148],1e3:[174,154]},polymer:!1},HNL:{thickness:12,lengths:{1:[166,146],2:[166,146],5:[166,146],10:[166,146],20:[166,146],50:[166,146],100:[166,146],200:[166,146],500:[166,146]},polymer:!1},HRK:{thickness:12,lengths:{5:[127,117],10:[131,121],20:[135,125],50:[139,129],100:[143,133],200:[147,137],500:[151,141],1e3:[155,145]},polymer:!1},ILS:{thickness:13,lengths:{20:[139,119],50:[146,126],100:[153,133],200:[160,140]},polymer:!1},JPY:{thickness:13,lengths:{1e3:[153,147],2e3:[156,152],5e3:[157,154],1e4:[163,158]},polymer:!1},KRW:{thickness:13,lengths:{1e3:[146,126],2e3:[150,130],5e3:[152,132],1e4:[158,138],5e4:[164,144]},polymer:!1},MDL:{thickness:12,lengths:{1:[124,110],5:[124,110],10:[131,111],20:[131,111],50:[131,111],100:[131,111],200:[143,123],500:[143,123],1e3:[143,123]},polymer:!1},MKD:{thickness:12,lengths:{10:[145,135],50:[148,138],100:[151,141],200:[149,139],500:[154,144],1e3:[157,147],2e3:[157,147],5e3:[160,150]},polymer:!0},MXN:{thickness:12,lengths:{20:[125,115],50:[130,120],100:[137,127],200:[144,134],500:[151,141],1e3:[158,148]},polymer:!0},MYR:{thickness:12,lengths:{1:[130,110],5:[145,125],10:[150,130],20:[155,135],50:[155,135],100:[160,140]},polymer:!1},NAD:{thickness:12,lengths:{10:[134,124],20:[139,129],50:[145,135],100:[151,141],200:[157,147]},polymer:!1},NZD:{thickness:12,lengths:{5:[140,130],10:[145,135],20:[150,140],50:[155,145],100:[160,150]},polymer:!0},PHP:{thickness:12,lengths:{20:[170,150],100:[170,150],200:[170,150],500:[170,150],1e3:[170,150]},polymer:!1},PLN:{thickness:12,lengths:{10:[125,115],20:[131,121],50:[137,127],100:[143,133],200:[149,139],500:[155,145]},polymer:!1},RON:{thickness:12,lengths:{1:[130,110],5:[137,117],10:[143,123],50:[150,130],100:[157,137],200:[160,140],500:[163,143]},polymer:!0},SGD:{thickness:12,lengths:{2:[136,116],5:[143,123],10:[151,131],50:[166,146],100:[172,152],1e3:[180,160]},polymer:!1},TWD:{thickness:13,lengths:{100:[155,135],200:[160,140],500:[165,145],1e3:[170,150],2e3:[175,155]},polymer:!1},USD:{thickness:13,lengths:{1:[166,146],2:[166,146],5:[166,146],10:[166,146],20:[166,146],50:[166,146],100:[166,146]},polymer:!1},UYU:{thickness:13,lengths:{20:[164,154],50:[150,140],100:[164,154],200:[164,154],500:[164,154],1e3:[164,154],2e3:[164,154]},polymer:!1},ZAR:{thickness:12,lengths:{10:[138,118],20:[144,124],50:[150,130],100:[156,136],200:[162,142]},polymer:!1}},qg=Uc.a((function(e,t){var n=R.a("fiatCurrency")(e);return P.a(T.a((function(e){return{code:parseInt(e),display:e}})),Vc.a,A.a([n,"lengths"]))(t)})),$g={name:"All Machines",deviceId:"ALL_MACHINES"},Hg={display:"All Coins",code:"ALL_COINS"},Vg={marginLeft:6,whiteSpace:"nowrap"},Ug=Object(qe.jsxs)("div",{children:[Object(qe.jsx)(Dc,{}),Object(qe.jsx)("span",{style:Vg,children:"Cash-in"})]}),Gg=Object(qe.jsxs)("div",{children:[Object(qe.jsx)(zc,{}),Object(qe.jsx)("span",{style:Vg,children:"Cash-out"})]}),Xg=function(e,t,n){return function(a){if(!e)return"";var r=Aa.a(W.a(null!==n&&void 0!==n?n:"code",a))(e);return r?R.a(t,r):"Unpaired machine"}},_g=function(e){return function(t){return t?P.a(Vj.a(", "),T.a(Xg(e,"display")))(t):t}},Zg=function(e,t,n){var a=L.a(Hg.code)(t),r=L.a(Hg.code)(e);return a&&r&&bn.a(t)>1?n(dm.a(gn.a(Hg.code))(t)):a&&!r?n([Hg.code]):void n(t)},Kg=function(e){return[{header:Ug,name:"cashIn",display:"Cash-in",width:169,size:"lg",editingAlign:"right",input:li,suffix:"%",bold:Va,inputProps:{decimalPlaces:3}},{header:Gg,name:"cashOut",display:"Cash-out",width:169,size:"lg",editingAlign:"right",input:li,suffix:"%",bold:Va,inputProps:{decimalPlaces:3}},{name:"fixedFee",display:"Fixed fee",width:169,size:"lg",doubleHeader:"Cash-in only",textAlign:"center",editingAlign:"right",input:li,suffix:e,bold:Va,inputProps:{decimalPlaces:2}},{name:"minimumTx",display:"Minimum Tx",width:169,size:"lg",doubleHeader:"Cash-in only",textAlign:"center",editingAlign:"right",input:li,suffix:e,bold:Va,inputProps:{decimalPlaces:2}}]},Qg=function(e,t,n){return function(e,t,n){var a=[$g].concat(e(["machines"])),r=e(["cryptoCurrencies"]),i=[Hg].concat(T.a((function(e){return{display:e.code,code:e.code}}))(null!==r&&void 0!==r?r:[]));return[{name:"machine",width:196,size:"sm",view:Xg(a,"name","deviceId"),input:Br,inputProps:{options:a,valueProp:"deviceId",labelProp:"name"}},{name:"cryptoCurrencies",width:280,size:"sm",view:_g(i),input:Br,inputProps:{options:i,valueProp:"code",labelProp:"display",multiple:!0,onChange:Zg,shouldStayOpen:!0}},{header:Ug,name:"cashIn",display:"Cash-in",width:130,input:li,textAlign:"right",suffix:"%",bold:Va,inputProps:{decimalPlaces:3}},{header:Gg,name:"cashOut",display:"Cash-out",width:130,input:li,textAlign:"right",suffix:"%",bold:Va,inputProps:{decimalPlaces:3}},{name:"fixedFee",display:"Fixed fee",width:144,input:li,doubleHeader:"Cash-in only",textAlign:"right",suffix:t,bold:Va,inputProps:{decimalPlaces:2}},{name:"minimumTx",display:"Minimum Tx",width:169,doubleHeader:"Cash-in only",textAlign:"center",editingAlign:"right",input:li,suffix:t,bold:Va,inputProps:{decimalPlaces:2}}]}(A.a(im.a,e),t)},Yg=-15,Jg=100,eO=function(e){var t=qg(e,zg).map((function(e){return e.code})),n=Wa.a(t)?Qh:Math.max.apply(Math,Object(d.a)(t));return xn.f().shape({cashIn:xn.e().label("Cash-in").min(Yg).max(Jg).required(),cashOut:xn.e().label("Cash-out").min(Yg).max(Jg).required(),fixedFee:xn.e().label("Fixed Fee").min(0).max(n).required(),minimumTx:xn.e().label("Minimum Tx").min(0).max(n).required()})},tO=function(e,t,n){var a=A.a(im.a,t),r=[$g].concat(a(["machines"])),i=a(["cryptoCurrencies"]),o=[Hg].concat(T.a((function(e){return{display:e.code,code:e.code}}))(null!==i&&void 0!==i?i:[])),l=qg(n,zg).map((function(e){return parseInt(e.code)})),c=Wa.a(l)?Qh:Math.max.apply(Math,Object(d.a)(l));return xn.f().shape({machine:xn.h().nullable().label("Machine").required(),cryptoCurrencies:xn.a().test({test:function(){var t=this.parent,n=t.id,a=t.machine,i=t.cryptoCurrencies,l=function(e,t,n){var a=R.a("cryptoCurrencies"),r=R.a("machine"),i=M.a(W.a("machine",t))(n),o=Aa.a(W.a("id",e))(n),l=a(o),c=r(o),s=P.a(Ag.a,ml.a,T.a(a))(i);return t!==c?null!==s&&void 0!==s?s:[]:Mg.a(s,l)}(n,a,e),c=a===$g.deviceId,s=L.a(Hg.code,i);if(c&&s)return this.createError({message:"All machines and all coins should be configured in the default setup table"});var d=Wg.a(l,i);if(!Wa.a(d)){var u=_g(o)(d),m=Xg(r,"name","deviceId")(a),h="".concat(u," already overridden for machine: ").concat(m);return this.createError({message:h})}return!0}}).label("Crypto Currencies").required().min(1),cashIn:xn.e().label("Cash-in").min(Yg).max(Jg).required(),cashOut:xn.e().label("Cash-out").min(Yg).max(Jg).required(),fixedFee:xn.e().label("Fixed Fee").min(0).max(c).required(),minimumTx:xn.e().label("Minimum Tx").min(0).max(c).required()})},nO={cashIn:"",cashOut:"",fixedFee:"",minimumTx:""},aO={machine:null,cryptoCurrencies:[],cashIn:"",cashOut:"",fixedFee:"",minimumTx:""},rO=function(e){var t=e.machine,n=e.cryptoCurrencies,a=t===$g.deviceId,r=fl.a(Hg.code,n);return a&&r?0:a?1:r?2:3},iO=function(e,t,n,a){return{minimumTx:a.minimumTx,fixedFee:a.fixedFee,cashOut:a.cashOut,cashIn:a.cashIn,machine:t,cryptoCurrencies:[e],default:n,id:Object(mm.a)()}},oO=function(e){var t=qg(e,zg).map((function(e){return parseInt(e.code)})),n=Wa.a(t)?Qh:Math.max.apply(Math,Object(d.a)(t));return xn.f().shape({machine:xn.h().label("Machine").required(),cryptoCurrencies:xn.a().label("Crypto Currency").required().min(1),cashIn:xn.e().label("Cash-in").min(Yg).max(Jg).required(),cashOut:xn.e().label("Cash-out").min(Yg).max(Jg).required(),fixedFee:xn.e().label("Fixed Fee").min(0).max(n).required(),minimumTx:xn.e().label("Minimum Tx").min(0).max(n).required()})},lO=function(e,t){return{color:e.default?J:te}},cO=function(e,t,n){var a=A.a(im.a,e);return sO(a,t,nO)},sO=function(e,t,n){var a=[$g].concat(e(["machines"]));return[{name:"machine",width:196,size:"sm",view:Xg(a,"name","deviceId"),editable:!1},{name:"cryptoCurrencies",display:"Crypto Currency",width:255,view:R.a(0),size:"sm",editable:!1},{header:Ug,name:"cashIn",display:"Cash-in",width:130,input:li,textAlign:"right",suffix:"%",textStyle:function(e){return lO(e)},inputProps:{decimalPlaces:3}},{header:Gg,name:"cashOut",display:"Cash-out",width:140,input:li,textAlign:"right",greenText:!0,suffix:"%",textStyle:function(e){return lO(e)},inputProps:{decimalPlaces:3}},{name:"fixedFee",display:"Fixed fee",width:144,input:li,doubleHeader:"Cash-in only",textAlign:"right",suffix:t,textStyle:function(e){return lO(e)},inputProps:{decimalPlaces:2}},{name:"minimumTx",display:"Minimum Tx",width:144,input:li,doubleHeader:"Cash-in only",textAlign:"right",suffix:t,textStyle:function(e){return lO(e)},inputProps:{decimalPlaces:2}}]},dO=n(1078),uO=function(e,t,n){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return M.a((function(e){return L.a(e.name,t)}),mO(e,n,a))},mO=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],a=function(e,t,n){return function(a){return e?P.a(R.a(t),Aa.a(W.a(null!==n&&void 0!==n?n:"code",a)))(e):""}},r=function(e){return function(t){return t?P.a(Vj.a(", "),T.a(a(e,"code")))(t):t}},i=T.a((function(e){return e.machine}),n),o=function(e){return dO.a((function(e,t){return e.deviceId===t}),e,i)},l=e(["machines"]),c=e(["countries"]),s=e(["currencies"]),d=e(["languages"]),u=e(["cryptoCurrencies"]),m=dd,h=function(e){var t=Aa.a(W.a("deviceId",e.machine))(l);return t?[t]:[]};return[{name:"machine",width:200,size:"sm",view:a(l,"name","deviceId"),input:Br,inputProps:{options:function(e){return hl.a(h(e))(o(l))},valueProp:"deviceId",labelProp:"name"}},{name:"country",width:200,size:"sm",view:a(c,"display"),input:Br,inputProps:{options:c,valueProp:"code",labelProp:"display"}},{name:"fiatCurrency",width:150,size:"sm",view:a(s,"code"),input:Br,inputProps:{options:s,valueProp:"code",labelProp:"code"}},{name:"languages",width:200,size:"sm",view:r(d),input:Br,inputProps:{options:d,valueProp:"code",labelProp:"display",multiple:!0}},{name:"cryptoCurrencies",width:170,size:"sm",view:r(u),input:Br,inputProps:{options:u,valueProp:"code",labelProp:"code",multiple:!0,optionsLimit:null,onChange:t}},{name:"timezone",width:320,size:"sm",view:a(m,"label"),input:Br,inputProps:{options:m,valueProp:"code",labelProp:"label"}}]},hO=function(e,t){var n=A.a(im.a,e);return uO(n,["country","fiatCurrency","languages","cryptoCurrencies","timezone"],t,void 0)},pO=function(e,t,n){var a=A.a(im.a,e);return uO(a,["machine","country","languages","cryptoCurrencies"],n,t)},bO=xn.f().shape({country:xn.h().label("Country").required(),fiatCurrency:xn.h().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.h().label("Timezone").required()}),fO=xn.f().shape({machine:xn.h().label("Machine").required(),country:xn.h().label("Country").required(),languages:xn.a().label("Languages").required().min(1).max(4),cryptoCurrencies:xn.a().label("Crypto Currencies").required().min(1)}),jO={country:"",fiatCurrency:"",languages:[],cryptoCurrencies:[],timezone:""},gO={machine:"",country:"",languages:[],cryptoCurrencies:[]},OO=n(324),xO={editDisabled:{color:oe}},vO=function(e){return M.a((function(t){return t.class===e}))},yO=function(e){var t=e.id;return M.a((function(e){return fl.a(t)(e.cryptos)}))},wO=xn.f().shape({ticker:xn.h("The ticker must be a string").required("The ticker is required"),wallet:xn.h("The wallet must be a string").required("The wallet is required"),exchange:xn.h("The exchange must be a string").required("The exchange is required"),zeroConf:xn.h("The confidence checking must be a string"),zeroConfLimit:xn.e("The 0-conf limit must be an integer").integer("The 0-conf limit must be an integer").min(0,"The 0-conf limit must be a positive integer").max(Qh).transform(Gr)}),CO=xn.f().shape({cryptoUnits:xn.h().required(),feeMultiplier:xn.h().required(),allowTransactionBatching:xn.b()}),kO=xn.f().shape({cryptoUnits:xn.h().required(),feeMultiplier:xn.h().default((function(){return"1"})).required(),cryptoCurrency:xn.h().required(),allowTransactionBatching:xn.b().default((function(){return!1})).required()}),EO={cryptoUnits:"",feeMultiplier:"",cryptoCurrency:"",allowTransactionBatching:null},NO=function(e){return P.a(R.a(["display"]),Aa.a(W.a("code",e)))(SO)},SO=[{display:"+60%",code:"1.6"},{display:"+50%",code:"1.5"},{display:"+40%",code:"1.4"},{display:"+30%",code:"1.3"},{display:"+20%",code:"1.2"},{display:"+10%",code:"1.1"},{display:"Default",code:"1"},{display:"-10%",code:"0.9"},{display:"-20%",code:"0.8"},{display:"-30%",code:"0.7"},{display:"-40%",code:"0.6"},{display:"-50%",code:"0.5"},{display:"-60%",code:"0.4"}],IO=[{display:"mili",code:"mili"},{display:"full",code:"full"}],LO=Uc.a((function(e,t){if(D.a(t.cryptoCurrency))return IO;var n=Vc.a(e.getCryptoCurrency(t.cryptoCurrency).units);return T.a((function(e){return{code:e,display:e}}))(n)})),PO=function(e,t,n){return[{name:"cryptoCurrency",width:180,input:Br,inputProps:{options:function(n){return hl.a(e,t(n))},optionsLimit:null,valueProp:"code",labelProp:"display"},size:"sm"},{name:"cryptoUnits",size:"sm",stripe:!0,width:190,input:Br,inputProps:{options:LO(n),valueProp:"code",labelProp:"display"}},{name:"allowTransactionBatching",size:"sm",stripe:!0,width:250,view:function(e,t){return"BTC"!==t.cryptoCurrency?Object(qe.jsx)("span",{style:xO.editDisabled,children:"No"}):t.allowTransactionBatching?"Yes":"No"},input:ii,editable:function(e){return"BTC"===e.cryptoCurrency}},{name:"feeMultiplier",header:"Miner's Fee",size:"sm",stripe:!0,width:250,view:function(e,t){return"BTC"!==t.cryptoCurrency?Object(qe.jsx)("span",{style:xO.editDisabled,children:"Default"}):NO(t.feeMultiplier)},input:Br,inputProps:{options:SO,valueProp:"code",labelProp:"display"},editable:function(e){return"BTC"===e.cryptoCurrency}}]},FO=Hr.a(Lu.a(R.a("id"),OO.a(L.a)(["ETH","USDT"]))),DO=function(e,t,n){var a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=a?11:0,i=function(t){return P.a(R.a(["display"]),Aa.a(W.a("code",t)))(e)},o=function(e){return vO(e)(t||[])},l=function(e){return function(t){return P.a(R.a("display"),Aa.a(W.a("code",t)))(o(e))}},c=Uc.a((function(e,t){return yO(t)(o(e))}));return[{name:"id",header:"Cryptocurrency",width:150-r,view:i,size:"sm",editable:!1},{name:"ticker",size:"sm",stripe:!0,view:l("ticker"),width:175-r,input:Br,inputProps:{options:c("ticker"),valueProp:"code",labelProp:"display",optionsLimit:null}},{name:"wallet",size:"sm",stripe:!0,view:l("wallet"),width:175-r,input:Br,inputProps:{options:c("wallet"),valueProp:"code",labelProp:"display",optionsLimit:null,onChange:n}},{name:"exchange",size:"sm",stripe:!0,view:l("exchange"),width:175-r,input:Br,inputProps:{options:c("exchange"),valueProp:"code",labelProp:"display",optionsLimit:null,onChange:n}},{name:"zeroConf",header:"Confidence Checking",size:"sm",stripe:!0,view:function(e,t){var n=l("zeroConf")(e,t);return FO(t)?n:Object(qe.jsx)("span",{style:xO.editDisabled,children:n})},input:Br,width:210-r,inputProps:{options:c("zeroConf"),valueProp:"code",labelProp:"display",optionsLimit:null,onChange:n},editable:FO},{name:"zeroConfLimit",header:"0-conf Limit",size:"sm",stripe:!0,view:function(e,t){return FO(t)?e:Object(qe.jsx)("span",{style:xO.editDisabled,children:e})},input:li,width:145-r,inputProps:{decimalPlaces:0},editable:FO}]},TO=Object(f.a)({subtitle:{color:se,marginTop:16,marginBottom:16},extraMarginTop:{marginTop:72}}),RO=Object(a.memo)((function(e){var t,n=e.children,a=e.className,r=e.extraMarginTop,i=TO(),o=(t={},Object(z.a)(t,i.subtitle,!0),Object(z.a)(t,i.extraMarginTop,r),t);return Object(qe.jsx)(tt,{className:I()(o,a),children:n})})),BO=Object(f.a)({section:{marginBottom:72},sectionHeader:{display:"flex",alignItems:"center"},sectionTitle:{margin:[[16,20,23,0]]}}),AO=function(e){var t=e.error,n=e.children,a=e.title,r=BO();return Object(qe.jsxs)("div",{className:r.section,children:[(a||t)&&Object(qe.jsxs)("div",{className:r.sectionHeader,children:[Object(qe.jsx)(RO,{className:r.sectionTitle,children:a}),t&&Object(qe.jsx)(il,{children:"Failed to save changes"})]}),n]})},MO=Object(f.a)(Ji),WO=Object(f.a)({autoComplete:{width:"100%"}}),zO=x()(yg||(yg=Object(c.a)(["\n query getData {\n config\n }\n"]))),qO=x()(wg||(wg=Object(c.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"])));var $O,HO,VO=function(e){var t=e.isActive,n=e.doContinue,a=MO(),r=(WO(),Object(u.c)(zO).data),i=Object(u.b)(qO,{onCompleted:n}),o=Object(l.a)(i,1)[0],c=A.a(["fiatCurrency"])(ds(ts)(null===r||void 0===r?void 0:r.config)),s=ds(ts)(null===r||void 0===r?void 0:r.config);return Object(qe.jsxs)("div",{className:a.wrapper,children:[Object(qe.jsx)(cl,{title:"Commissions"}),Object(qe.jsx)(AO,{children:Object(qe.jsx)(Gh,{title:"Default setup",rowSize:"lg",titleLg:!0,name:"commissions",initialValues:nO,enableEdit:!0,forceAdd:t,save:function(e){var t=us("commissions")(e.commissions[0]);return o({variables:{config:t}})},validationSchema:eO(s),data:[],elements:Kg(c)})})]})},UO=Object(f.a)(Ji),GO=x()($O||($O=Object(c.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"]))),XO=x()(HO||(HO=Object(c.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"])));var _O,ZO,KO=function(e){var t=e.isActive,n=e.doContinue,a=UO(),r=Object(u.c)(GO).data,i=Object(u.b)(XO,{onCompleted:n}),o=Object(l.a)(i,1)[0],c=Ov((null===r||void 0===r?void 0:r.config)||{},(null===r||void 0===r?void 0:r.cryptoCurrencies)||[]);return Object(qe.jsxs)("div",{className:a.wrapper,children:[Object(qe.jsx)(cl,{title:"Locales"}),Object(qe.jsx)(AO,{children:Object(qe.jsx)(Gh,{title:"Default settings",rowSize:"lg",titleLg:!0,name:"locale",initialValues:jO,forceAdd:t,enableEdit:!0,save:function(e){var t=us("locale")(e.locale[0]);return o({variables:{config:t}})},validationSchema:bO,data:[],elements:hO(Gn.a(r,{cryptoCurrencies:c}),(function(e,t,n){return n(t)}))})})]})},QO=Object(f.a)({message:function(e){return{width:e.width,marginTop:4,marginLeft:16}}}),YO=function(e){var t=e.children,n=e.width,a=void 0===n?330:n,r=e.className,i=QO({width:a});return Object(qe.jsxs)(nl.a,{display:"flex",className:r,children:[Object(qe.jsx)(ir,{}),Object(qe.jsx)(at,{className:i.message,children:t})]})},JO=n(1079),ex=n(1080),tx={footer:{display:"flex",flexDirection:"row",margin:[["auto",0,32,0]]},button:{margin:[["auto",0,0,"auto"]]},form:{flex:1,display:"flex",flexDirection:"column"},grid:{marginBottom:24,marginTop:12}},nx=Object(f.a)(tx),ax=function(e){var t=e.validationSchema,n=e.elements,r=e.value,i=e.save,o=e.buttonLabel,c=void 0===o?"Save changes":o,d=e.buttonClass,u=e.xs,m=void 0===u?12:u,p=nx(),b=P.a(JO.a,T.a((function(e){var t,n=e.code;return Object(z.a)({},n,null!==(t=r&&r[n])&&void 0!==t?t:"")})))(n),f=Gn.a(b,r),j=Object(a.useState)([]),g=Object(l.a)(j,2),O=g[0],x=g[1];return Object(qe.jsx)(mn.e,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,initialValues:f,validationSchema:t,onSubmit:function(e){var t=P.a(T.a(R.a("code")),M.a((function(t){return R.a("component",t)===si&&Wa.a(e[R.a("code",t)])})))(n);return i(lm.a(t,e)).catch((function(e){x({save:"Failed to save changes"})}))},children:function(e){var t=e.errors;return Object(qe.jsxs)(mn.d,{className:p.form,children:[Object(qe.jsx)(h.a,{container:!0,spacing:3,className:p.grid,children:n.map((function(e){var t=e.component,n=e.code,a=e.display,r=e.settings,i=e.inputProps;return Object(qe.jsx)(h.a,{item:!0,xs:m,children:Object(qe.jsx)(mn.a,Object(s.a)(Object(s.a)({component:t},i),{},{name:n,label:a,settings:r,fullWidth:!0}))},n)}))}),Object(qe.jsxs)("div",{className:p.footer,children:[!Wa.a(ex.a(t,O))&&Object(qe.jsx)(il,{children:op.a(yd.a(ex.a(t,O)))}),Object(qe.jsx)(An,{className:I()(p.button,d),type:"submit",children:c})]})]})}})},rx=function(e,t){return{name:"secret-test",message:t?"The ".concat(t," is invalid"):"Invalid field",test:function(t){return!D.a(e)||!D.a(t)||this.createError()}}},ix=function(e,t){return!(Zc.a("0",t.originalValue)&&bn.a(t.originalValue)>1)||t.createError()},ox={code:"twilio",name:"Twilio",title:"Twilio (SMS)",elements:[{code:"accountSid",display:"Account SID",component:di},{code:"authToken",display:"Auth Token",component:si},{code:"fromNumber",display:"Twilio Number (international format)",component:di,face:!0},{code:"toNumber",display:"Notifications Number (international format)",component:di,face:!0}],getValidationSchema:function(e){return xn.f().shape({accountSid:xn.h("The account SID must be a string").max(100,"The account SID is too long").required("The account SID is required"),authToken:xn.h("The auth token must be a string").max(100,"The auth token is too long").test(rx(null===e||void 0===e?void 0:e.authToken,"auth token")),fromNumber:xn.h("The Twilio number must be a string").max(100,"The Twilio number is too long").required("The Twilio number is required"),toNumber:xn.h("The notifications number must be a string").max(100,"The notifications number is too long").required("The notifications number is required")})}},lx={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:he},button:{marginTop:40},formButton:{margin:[[24,0,0]]}},cx=x()(_O||(_O=Object(c.a)(["\n {\n config\n accounts\n }\n"]))),sx=x()(ZO||(ZO=Object(c.a)(["\n mutation Save($accounts: JSONObject) {\n saveAccounts(accounts: $accounts)\n }\n"]))),dx=Object(f.a)(Object(s.a)(Object(s.a)({},lx),{},{content:{width:820},radioLabel:Object(s.a)(Object(s.a)({},lx.radioLabel),{},{width:280}),wrapper:{width:1200,height:100,margin:[[0,"auto"]]},title:{marginLeft:8,marginBottom:5},info:{marginTop:20,marginBottom:20}})),ux=[{code:"enable",display:"Yes, I will"},{code:"disable",display:"No, not for now"}];var mx,hx,px,bx,fx,jx,gx,Ox,xx,vx,yx,wx=function(e){var t,n,r=e.doContinue,i=dx(),o=Object(a.useState)(null),c=Object(l.a)(o,2),s=c[0],d=c[1],m=Object(a.useState)(!1),h=Object(l.a)(m,2),p=h[0],b=h[1],f=Object(u.c)(cx),j=f.data,g=f.refetch,O=Object(u.b)(sx,{onCompleted:r}),x=Object(l.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,p),n);return Object(qe.jsx)("div",{className:i.wrapper,children:Object(qe.jsxs)("div",{className:i.content,children:[Object(qe.jsx)(Ue,{children:"Twilio (SMS service)"}),Object(qe.jsxs)(nl.a,{display:"flex",alignItems:"end",children:[Object(qe.jsx)(_e,{noMargin:!0,className:I()(y),children:"Will you setup a two way machine or compliance?"}),Object(qe.jsxs)(Np,{width:304,children:[Object(qe.jsx)(Ke,{children:"Two-way machines allow your customers not only to buy (cash-in) but also sell cryptocurrencies (cash-out)."}),Object(qe.jsx)(Ke,{children:"You\u2019ll need an SMS service for cash-out transactions and for any compliance triggers"})]})]}),Object(qe.jsx)(Er,{labelClassName:i.radioLabel,className:i.radioGroup,options:ux,value:s,onChange:function(e){d(e.target.value),b(!1)}}),Object(qe.jsx)(YO,{className:i.info,children:"To set up Twilio please read the instructions from our support portal."}),Object(qe.jsx)(Da,{link:"https://support.lamassu.is/hc/en-us/articles/115001203951-Twilio-for-SMS",label:"Twilio for SMS"}),"enable"===s&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(_e,{noMargin:!0,children:"Enter credentials"}),Object(qe.jsx)(ax,{xs:6,save:function(e){return x({variables:{accounts:{twilio:e}}}).then((function(){return g()}))},value:v.twilio,elements:ox.elements,validationSchema:ox.validationSchema,buttonLabel:"Continue",buttonClass:i.formButton})]}),"enable"!==s&&Object(qe.jsx)(An,{size:"lg",onClick:function(){if(!s)return b(!0);r()},className:i.button,children:"Continue"})]})})},Cx=n(1081),kx=Object(f.a)(lx),Ex=x()(mx||(mx=Object(c.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"]))),Nx=x()(hx||(hx=Object(c.a)(["\n mutation Save($config: JSONObject, $accounts: JSONObject) {\n saveConfig(config: $config)\n saveAccounts(accounts: $accounts)\n }\n"]))),Sx=function(e){var t,n=e.data,r=e.doContinue,i=kx(),o=Object(u.c)(Ex).data,c=Object(u.b)(Nx,{onCompleted:r}),d=Object(l.a)(c,1)[0],m=Object(a.useState)(!1),h=Object(l.a)(m,2),p=h[0],b=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:[],O=Lu.a(lm.a(["coin","zeroConf","zeroConfLimit"]),us(f))(n),x=M.a(Lu.a(R.a("name"),OO.a(L.a)(["zeroConf","zeroConfLimit"]),F.a()),DO(g,j,null,!0));return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(_e,{className:p&&i.error,children:"All set"}),Object(qe.jsx)(Ke,{children:"These are your wallet settings. You can later edit these and add additional coins."}),Object(qe.jsx)(Xh,{rowSize:"lg",titleLg:!0,name:"All set",namespaces:[f],data:O,elements:x}),Object(qe.jsx)(An,{size:"lg",onClick:function(){var e=Object(s.a)({zeroConfLimit:0},n);if(!wO.isValidSync(e))return b(!0);var t=us(f,lm.a("coin",e)),a=us(Yc)(t);return b(!1),d({variables:{config:a}})},className:i.button,children:"Continue"})]})},Ix={code:"binance",name:"Binance",title:"Binance (Exchange)",elements:[{code:"apiKey",display:"API Key",component:di,face:!0,long:!0},{code:"privateKey",display:"Private Key",component:si}],getValidationSchema:function(e){return xn.f().shape({apiKey:xn.h("The API key must be a string").max(100,"The API key is too long").required("The API key is required"),privateKey:xn.h("The private key must be a string").max(100,"The private key is too long").test(rx(null===e||void 0===e?void 0:e.privateKey,"private key"))})}},Lx={code:"binanceus",name:"Binance.us",title:"Binance.us (Exchange)",elements:[{code:"apiKey",display:"API Key",component:di,face:!0,long:!0},{code:"privateKey",display:"Private Key",component:si}],getValidationSchema:function(e){return xn.f().shape({apiKey:xn.h("The API key must be a string").max(100,"The API key is too long").required("The API key is required"),privateKey:xn.h("The private key must be a string").max(100,"The private key is too long").test(rx(null===e||void 0===e?void 0:e.privateKey,"private key"))})}},Px=function(e){return e&&e.length},Fx=function(e,t){return xn.h().max(100,"Too long").when(e,{is:Px,then:xn.h().test(rx(t))})},Dx={code:"bitgo",name:"BitGo",title:"BitGo (Wallet)",elements:[{code:"token",display:"API Token",component:di,face:!0,long:!0},{code:"environment",display:"Environment",component:Br,inputProps:{options:[{code:"prod",display:"prod"},{code:"test",display:"test"}],labelProp:"display",valueProp:"code"},face:!0},{code:"BTCWalletId",display:"BTC Wallet ID",component:di},{code:"BTCWalletPassphrase",display:"BTC Wallet Passphrase",component:si},{code:"LTCWalletId",display:"LTC Wallet ID",component:di},{code:"LTCWalletPassphrase",display:"LTC Wallet Passphrase",component:si},{code:"ZECWalletId",display:"ZEC Wallet ID",component:di},{code:"ZECWalletPassphrase",display:"ZEC Wallet Passphrase",component:si},{code:"BCHWalletId",display:"BCH Wallet ID",component:di},{code:"BCHWalletPassphrase",display:"BCH Wallet Passphrase",component:si},{code:"DASHWalletId",display:"DASH Wallet ID",component:di},{code:"DASHWalletPassphrase",display:"DASH Wallet Passphrase",component:si}],getValidationSchema:function(e){return xn.f().shape({token:xn.h("The token must be a string").max(100,"The token is too long").required("The token is required"),BTCWalletId:xn.h("The BTC wallet ID must be a string").max(100,"The BTC wallet ID is too long"),BTCWalletPassphrase:Fx("BTCWalletId",null===e||void 0===e?void 0:e.BTCWalletPassphrase),LTCWalletId:xn.h("The LTC wallet ID must be a string").max(100,"The LTC wallet ID is too long"),LTCWalletPassphrase:Fx("LTCWalletId",null===e||void 0===e?void 0:e.LTCWalletPassphrase),ZECWalletId:xn.h("The ZEC wallet ID must be a string").max(100,"The ZEC wallet ID is too long"),ZECWalletPassphrase:Fx("ZECWalletId",null===e||void 0===e?void 0:e.ZECWalletPassphrase),BCHWalletId:xn.h("The BCH wallet ID must be a string").max(100,"The BCH wallet ID is too long"),BCHWalletPassphrase:Fx("BCHWalletId",null===e||void 0===e?void 0:e.BCHWalletPassphrase),DASHWalletId:xn.h("The DASH wallet ID must be a string").max(100,"The DASH wallet ID is too long"),DASHWalletPassphrase:Fx("DASHWalletId",null===e||void 0===e?void 0:e.DASHWalletPassphrase),environment:xn.h("The environment must be a string").matches(/(prod|test)/).required("The environment is required")})}},Tx={code:"bitstamp",name:"Bitstamp",title:"Bitstamp (Exchange)",elements:[{code:"clientId",display:"Client ID",component:di,face:!0,long:!0},{code:"key",display:"API Key",component:di,face:!0,long:!0},{code:"secret",display:"API Secret",component:si}],getValidationSchema:function(e){return xn.f().shape({clientId:xn.h("The client ID must be a string").max(100,"The client ID is too long").required("The client ID is required"),key:xn.h("The API key must be a string").max(100,"The API key is too long").required("The API key is required"),secret:xn.h("The API secret must be a string").max(100,"The API secret is too long").test(rx(null===e||void 0===e?void 0:e.secret,"API secret"))})}},Rx={code:"blockcypher",name:"Blockcypher",title:"Blockcypher (Payments)",elements:[{code:"token",display:"API Token",component:di,face:!0,long:!0},{code:"confidenceFactor",display:"Confidence Factor",component:li,face:!0},{code:"rbf",component:ii,settings:{field:"wallets_BTC_wallet",enabled:!0,disabledMessage:"Lower the confidence of RBF transactions (Available when using bitcoind.)",label:"Lower the confidence of RBF transactions",requirement:"bitcoind",rightSideLabel:!0},face:!0}],getValidationSchema:function(){return xn.f().shape({token:xn.h("The token must be a string").max(100,"The token is too long").required("The token is required"),confidenceFactor:xn.e("The confidence factor must be a number").integer("The confidence factor must be an integer").min(0,"The confidence factor must be between 0 and 100").max(100,"The confidence factor must be between 0 and 100").required("The confidence factor is required")})}},Bx={code:"cex",name:"CEX.IO",title:"CEX.IO (Exchange)",elements:[{code:"apiKey",display:"API Key",component:di,face:!0,long:!0},{code:"privateKey",display:"Private Key",component:si}],getValidationSchema:function(e){return xn.f().shape({apiKey:xn.h("The API key must be a string").max(100,"The API key is too long").required("The API key is required"),privateKey:xn.h("The private key must be a string").max(100,"The private key is too long").test(rx(null===e||void 0===e?void 0:e.privateKey,"private key"))})}},Ax={code:"ciphertrace",name:"CipherTrace",title:"CipherTrace (Scoring)",elements:[{code:"authorizationValue",display:"Authorization value",component:si},{code:"scoreThreshold",display:"Score threshold",component:li,face:!0,long:!1},{code:"enabled",component:ii,settings:{enabled:!0,disabledMessage:"This plugin is disabled",label:"Enabled (Supported coins: BTC, ETH, BCH, LTC and all active ERC-20 tokens)",requirement:null,rightSideLabel:!0},face:!0}],getValidationSchema:function(e){return xn.f().shape({authorizationValue:xn.h("The authorization value must be a string").max(100,"Too long").test(rx(null===e||void 0===e?void 0:e.authorizationValue,"authorization value")),scoreThreshold:xn.e("The score threshold must be a number").required("A score threshold is required").min(1,"The score threshold must be between 1 and 10").max(10,"The score threshold must be between 1 and 10").integer("The score threshold must be an integer").test("no-leading-zeros","The score threshold must not have leading zeros",ix)})}},Mx={code:"infura",name:"Infura",title:"Infura (Wallet)",elements:[{code:"apiKey",display:"Project ID",component:di,face:!0,long:!0},{code:"apiSecret",display:"Project Secret",component:si},{code:"endpoint",display:"Endpoint",component:di,face:!0}],getValidationSchema:function(e){return xn.f().shape({apiKey:xn.h("The project ID must be a string").max(100,"The project ID is too long").required("The project ID is required"),apiSecret:xn.h("The project secret must be a string").max(100,"The project secret is too long").test(rx(null===e||void 0===e?void 0:e.apiSecret,"project secret")),endpoint:xn.h("The endpoint must be a string").max(100,"The endpoint is too long").required("The endpoint is required")})}},Wx={code:"itbit",name:"itBit",title:"itBit (Exchange)",elements:[{code:"userId",display:"User ID",component:di,face:!0,long:!0},{code:"walletId",display:"Wallet ID",component:di,face:!0,long:!0},{code:"clientKey",display:"Client Key",component:di},{code:"clientSecret",display:"Client Secret",component:si}],getValidationSchema:function(e){return xn.f().shape({userId:xn.h("The user ID must be a string").max(100,"The user ID is too long").required("The user ID is required"),walletId:xn.h("The wallet ID must be a string").max(100,"The wallet ID is too long").required("The wallet ID is required"),clientKey:xn.h("The client key must be a string").max(100,"The client key is too long").required("The client key is required"),clientSecret:xn.h("The client secret must be a string").max(100,"The client secret is too long").test(rx(null===e||void 0===e?void 0:e.clientSecret,"client secret"))})}},zx={code:"kraken",name:"Kraken",title:"Kraken (Exchange)",elements:[{code:"apiKey",display:"API Key",component:di,face:!0,long:!0},{code:"privateKey",display:"Private Key",component:si}],getValidationSchema:function(e){return xn.f().shape({apiKey:xn.h("The API key must be a string").max(100,"The API key is too long").required("The API key is required"),privateKey:xn.h("The private key must be a string").max(100,"The private key is too long").test(rx(null===e||void 0===e?void 0:e.privateKey,"private key"))})}},qx={code:"mailgun",name:"Mailgun",title:"Mailgun (Email)",elements:[{code:"apiKey",display:"API Key",component:di},{code:"domain",display:"Domain",component:di},{code:"fromEmail",display:"From Email",component:di,face:!0},{code:"toEmail",display:"To Email",component:di,face:!0}],getValidationSchema:function(){return xn.f().shape({apiKey:xn.h("The API key must be a string").max(100,"The API key is too long").required("The API key is required"),domain:xn.h("The domain must be a string").max(100,"The domain is too long").required("The domain is required"),fromEmail:xn.h("The from email must be a string").max(100,"The from email is too long").email("The from email must be a valid email address").required("The from email is required"),toEmail:xn.h("The to email must be a string").max(100,"The to email is too long").email("The to email must be a valid email address").required("The to email is required")})}},$x=(px={},Object(z.a)(px,Dx.code,Dx),Object(z.a)(px,Tx.code,Tx),Object(z.a)(px,Rx.code,Rx),Object(z.a)(px,Mx.code,Mx),Object(z.a)(px,Wx.code,Wx),Object(z.a)(px,zx.code,zx),Object(z.a)(px,qx.code,qx),Object(z.a)(px,ox.code,ox),Object(z.a)(px,Lx.code,Lx),Object(z.a)(px,Bx.code,Bx),Object(z.a)(px,Ax.code,Ax),Object(z.a)(px,Ix.code,Ix),px),Hx=Object(f.a)(Object(s.a)(Object(s.a)({},lx),{},{radioGroup:lx.radioGroup,radioLabel:Object(s.a)(Object(s.a)({},lx.radioLabel),{},{width:200})})),Vx=x()(bx||(bx=Object(c.a)(["\n {\n accounts\n }\n"]))),Ux=x()(fx||(fx=Object(c.a)(["\n mutation SaveAccountsBC($accounts: JSONObject) {\n saveAccounts(accounts: $accounts)\n }\n"]))),Gx=[{code:"enable",display:"I will enable cash-out"},{code:"disable",display:"I won't enable cash-out"}],Xx=function(e){var t,n=e.addData,r=Hx(),i=Object(u.c)(Vx).data,o=Object(u.b)(Ux,{onCompleted:function(){return n({zeroConf:"blockcypher"})}}),c=Object(l.a)(o,1)[0],s=Object(a.useState)(null),d=Object(l.a)(s,2),m=d[0],h=d[1],p=Object(a.useState)(!1),b=Object(l.a)(p,2),f=b[0],j=b[1],g=null!==(t=null===i||void 0===i?void 0:i.accounts)&&void 0!==t?t:[];return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(_e,{className:f&&r.error,children:"Blockcypher"}),Object(qe.jsx)(Ke,{children:"If you are enabling cash-out services, create a Blockcypher account."}),Object(qe.jsx)(Da,{link:"https://support.lamassu.is/hc/en-us/articles/115001209472-Blockcypher",label:"Configuring Blockcypher"}),Object(qe.jsx)(Er,{labelClassName:r.radioLabel,className:r.radioGroup,options:Gx,value:m,onChange:function(e){h(e.target.value),j(!1)}}),Object(qe.jsxs)("div",{className:r.mdForm,children:["disable"===m&&Object(qe.jsx)(An,{size:"lg",onClick:function(){return n({zeroConf:"none",zeroConfLimit:0})},className:r.button,children:"Continue"}),"enable"===m&&Object(qe.jsx)(ax,{value:g.blockcypher,save:function(e){return c({variables:{accounts:{blockcypher:e}}})},elements:$x.blockcypher.elements,validationSchema:$x.blockcypher.getValidationSchema,buttonLabel:"Continue",buttonClass:r.formButton})]})]})},_x=Object(f.a)(lx),Zx=x()(jx||(jx=Object(c.a)(["\n {\n cryptoCurrencies {\n code\n display\n }\n }\n"]))),Kx=xn.f().shape({coin:xn.h().required()}),Qx=function(e){var t,n=e.addData,r=_x(),i=Object(a.useState)(!1),o=Object(l.a)(i,2),c=o[0],s=o[1],d=Object(u.c)(Zx).data,m=null!==(t=null===d||void 0===d?void 0:d.cryptoCurrencies)&&void 0!==t?t:[];return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(_e,{className:c&&r.error,children:"Choose your first cryptocurrency"}),Object(qe.jsx)(mn.e,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,initialValues:{coin:""},onSubmit:function(e){return Kx.isValidSync(e)?"BTC"!==e.coin?n({coin:e.coin,zeroConf:"none",zeroConfLimit:0}):void n(e):s(!0)},children:Object(qe.jsxs)(mn.d,{onChange:function(){return s(!1)},children:[Object(qe.jsx)(pm,{}),Object(qe.jsx)(mn.b,{component:ci,name:"coin",labelClassName:r.radioLabel,className:r.radioGroup,options:m}),Object(qe.jsx)(An,{size:"lg",type:"submit",className:r.button,children:"Continue"})]})})]})},Yx=function(e,t){return M.a((function(n){return function(e){return W.a("class",e)}(t)(n)&&function(e){return P.a(fl.a(e),R.a("cryptos"))}(e)(n)}))},Jx=function(e,t,n,a){var r=Yx(a,n)(e),i=Os.a((function(e){var n=e.code,a=function(e){return t&&t[e]}(n);return!$x[n]||(0,$x[n].getValidationSchema)(a).isValidSync(a)}))(r),o=Object(l.a)(i,2);return{filled:o[0],unfilled:o[1]}},ev=Object(f.a)(lx),tv=x()(gx||(gx=Object(c.a)(["\n {\n accounts\n accountsConfig {\n code\n display\n class\n cryptos\n }\n cryptoCurrencies {\n code\n display\n }\n }\n"]))),nv=x()(Ox||(Ox=Object(c.a)(["\n mutation Save($accounts: JSONObject) {\n saveAccounts(accounts: $accounts)\n }\n"]))),av=function(e){return!D.a(e)&&!fl.a(e)(["mock-exchange","no-exchange"])},rv=function(e){var t,n,r,i=e.data,o=e.addData,c=ev(),s=Object(u.c)(tv).data,d=Object(u.b)(nv,{onCompleted:function(){return k()}}),m=Object(l.a)(d,1)[0],h=Object(a.useState)(null),p=Object(l.a)(h,2),b=p[0],f=p[1],j=Object(a.useState)(!1),g=Object(l.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=Jx(y,v,"exchange",w),k=function(){if(!b)return x(!0);o({exchange:b})};return Object(qe.jsxs)("div",{className:c.mdForm,children:[Object(qe.jsx)(_e,{className:O&&c.error,children:"Choose your exchange"}),Object(qe.jsx)(Er,{labelClassName:c.radioLabel,className:c.radioGroup,options:Ma.a(C.filled,C.unfilled),value:b,onChange:function(e){f(e.target.value),x(!1)}}),!av(b)&&Object(qe.jsx)(An,{size:"lg",onClick:k,className:c.button,children:"Continue"}),av(b)&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsxs)("div",{className:c.infoMessage,children:[Object(qe.jsx)(ir,{}),Object(qe.jsxs)(Je,{children:["Make sure you set up ",$x[b].name," to enter the necessary information below. Please follow the instructions on our support page if you haven\u2019t."]})]}),Object(qe.jsx)(Da,{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"}[b],label:"".concat($x[b].name," trading")}),Object(qe.jsx)(_e,{noMargin:!0,children:"Enter exchange information"}),Object(qe.jsx)(ax,{value:v[b],save:(r=b,function(e){var t=Object(z.a)({},r,e);return m({variables:{accounts:t}})}),elements:$x[b].elements,validationSchema:$x[b].validationSchema,buttonLabel:"Continue",buttonClass:c.formButton})]})]})},iv=Object(f.a)(lx),ov=x()(xx||(xx=Object(c.a)(["\n {\n accountsConfig {\n code\n display\n class\n cryptos\n }\n }\n"]))),lv=function(e){var t,n,r=e.data,i=e.addData,o=iv(),c=Object(u.c)(ov).data,s=Object(a.useState)(null),d=Object(l.a)(s,2),m=d[0],h=d[1],p=Object(a.useState)(!1),b=Object(l.a)(p,2),f=b[0],j=b[1],g=null!==(t=null===c||void 0===c?void 0:c.accounts)&&void 0!==t?t:[],O=null!==(n=null===c||void 0===c?void 0:c.accountsConfig)&&void 0!==n?n:[],x=r.coin,v=Jx(O,g,"ticker",x);return Object(qe.jsxs)("div",{className:o.mdForm,children:[Object(qe.jsx)(_e,{className:f&&o.error,children:"Choose your ticker"}),Object(qe.jsx)(Er,{labelClassName:o.radioLabel,className:o.radioGroup,options:Ma.a(v.filled,v.unfilled),value:m,onChange:function(e){h(e.target.value),j(!1)}}),Object(qe.jsx)(An,{size:"lg",onClick:function(){if(!m)return j(!0);i({ticker:m})},className:o.button,children:"Continue"})]})},cv=function(e){var t;return{code:"bitgo",name:"BitGo",title:"BitGo (Wallet)",elements:[{code:"token",display:"API Token",component:di,face:!0,long:!0},{code:"environment",display:"Environment",component:Br,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:di},{code:"".concat(e,"WalletPassphrase"),display:"".concat(e," Wallet Passphrase"),component:si}],validationSchema:xn.f().shape((t={token:xn.h("The token must be a string").max(100,"The token is too long").required("The token is required"),environment:xn.h("The environment must be a string").matches(/(prod|test)/).required("The environment is required")},Object(z.a)(t,"".concat(e,"WalletId"),xn.h("The ".concat(e," wallet ID must be a string")).max(100,"The ".concat(e," wallet ID is too long")).required("The ".concat(e," wallet ID is required"))),Object(z.a)(t,"".concat(e,"WalletPassphrase"),xn.h("The ".concat(e," passphrase must be a string")).max(100,"The ".concat(e," wallet passphrase is too long")).required("The ".concat(e," wallet passphrase is required"))),t))}},sv=Object(f.a)(lx),dv=x()(vx||(vx=Object(c.a)(["\n {\n accounts\n accountsConfig {\n code\n display\n class\n cryptos\n }\n cryptoCurrencies {\n code\n display\n }\n }\n"]))),uv=x()(yx||(yx=Object(c.a)(["\n mutation Save($accounts: JSONObject) {\n saveAccounts(accounts: $accounts)\n }\n"]))),mv=function(e){return fl.a(e)(["infura","bitgo"])},hv=function(e){var t,n,r,i=e.data,o=e.addData,c=sv(),s=Object(u.c)(dv).data,d=Object(u.b)(uv,{onCompleted:function(){return E()}}),m=Object(l.a)(d,1)[0],h=Object(a.useState)(null),p=Object(l.a)(h,2),b=p[0],f=p[1],j=Object(a.useState)(!1),g=Object(l.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=Jx(y,v,"wallet",w),k=function(e){return function(t){var n=Object(z.a)({},e,t);return m({variables:{accounts:n}})}},E=function(){if(!b)return x(!0);o({wallet:b})};return Object(qe.jsxs)("div",{className:c.mdForm,children:[Object(qe.jsx)(_e,{className:O&&c.error,children:"Choose your wallet"}),Object(qe.jsx)(Er,{labelClassName:c.radioLabel,className:c.radioGroup,options:Ma.a(C.filled,C.unfilled),value:b,onChange:function(e){f(e.target.value),x(!1)}}),(r=b,fl.a(r)(["bitcoind","geth","litecoind","dashd","zcashd","bitcoincashd"])&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsxs)("div",{className:c.infoMessage,children:[Object(qe.jsx)(ir,{}),Object(qe.jsxs)(Je,{children:["To set up ",b," please read the node wallet instructions from our support portal."]})]}),Object(qe.jsx)(Da,{link:"https://support.lamassu.is/hc/en-us/articles/115001209552-Setting-up-your-node-wallets",label:"Support article"})]})),!mv(b)&&Object(qe.jsx)(An,{size:"lg",onClick:E,className:c.button,children:"Continue"}),"bitgo"===b&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsxs)("div",{className:c.infoMessage,children:[Object(qe.jsx)(ir,{}),Object(qe.jsx)(Je,{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(qe.jsx)(Da,{link:"https://support.lamassu.is/hc/en-us/articles/360024455592-Setting-up-BitGo",label:"Support article"}),Object(qe.jsx)(_e,{noMargin:!0,children:"Enter wallet information"}),Object(qe.jsx)(ax,{value:v.bitgo,save:k(b),elements:cv(w).elements,validationSchema:cv(w).validationSchema,buttonLabel:"Continue",buttonClass:c.formButton})]}),"infura"===b&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(_e,{noMargin:!0,children:"Enter wallet information"}),Object(qe.jsx)(ax,{value:v.infura,save:k(b),elements:$x.infura.elements,validationSchema:$x.infura.getValidationSchema(v.infura),buttonLabel:"Continue",buttonClass:c.formButton})]})]})},pv=Object(f.a)(Ji),bv=[{label:"Choose cryptocurrency",component:Qx},{label:"Choose wallet",component:hv},{label:"Choose ticker",component:lv},{label:"Exchange",component:rv},{label:"Blockcypher",component:Xx},{label:"All set",component:Sx}],fv=function(e){var t=e.doContinue,n=Object(a.useState)(0),r=Object(l.a)(n,2),i=r[0],o=r[1],c=Object(a.useState)({}),s=Object(l.a)(c,2),d=s[0],u=s[1],m=pv(),h="BTC"===(null===d||void 0===d?void 0:d.coin)?bv:Cx.a(4,1,bv),p=h[i].component;return Object(qe.jsxs)("div",{className:m.wrapper,children:[Object(qe.jsx)("div",{className:m.headerDiv,children:Object(qe.jsx)(cl,{title:"Wallet settings"})}),Object(qe.jsxs)("div",{className:m.contentDiv,children:[Object(qe.jsx)(Ii,{children:h.map((function(e,t){return Object(qe.jsx)(Li,{step:i,it:e,idx:t,steps:h},t)}))}),Object(qe.jsx)("div",{className:m.contentWrapper,children:Object(qe.jsx)(p,{data:d,addData:function(e){u(Gn.a(d,e)),o(i+1)},doContinue:t})})]})]})},jv={welcome:{textAlign:"center",paddingTop:256},title:{lineHeight:1,fontSize:48},getStarted:{fontSize:24,fontWeight:500,marginBottom:54,color:$}},gv=Object(f.a)(jv);var Ov=function(e,t){var n=ds(Yc,e);return M.a((function(e){return wO.isValidSync(ds(e.code,n))}))(t)},xv=function(e,t){return e?function(e,t){var n=ds(Yc,e),a=T.a((function(e){return ds(e.code,n)}))(t);return P.a(jn.a(Fu.a),T.a((function(e){return wO.isValidSync(e)})))(a)}(e,t)?function(e){var t=ds(ts,e);return bO.isValidSync(t)}(e)?function(e){var t=ds(ns,e),n=ds(ts,e);return eO(n).isValidSync(t)}(e)?0:3:2:1:0},vv=[{id:"welcome",Component:function(e){var t=e.doContinue,n=gv();return Object(qe.jsxs)("div",{className:n.welcome,children:[Object(qe.jsx)(Ue,{className:n.title,children:"Welcome to the Lamassu Admin"}),Object(qe.jsxs)(Ke,{className:n.getStarted,children:["To get you started, we\u2019ve put together a wizard that will",Object(qe.jsx)("br",{}),"help set up what you need before pairing your machines."]}),Object(qe.jsx)(An,{size:"xl",onClick:t,children:"Get started"})]})}},{id:"wallet",Component:fv,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:KO,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:wx,exImage:"/assets/wizard/fullexample.twilio.png",subtitle:"Twilio (SMS service)",text:Object(qe.jsxs)(qe.Fragment,{children:["Twilio is used for SMS operator notifications, phone number collection for compliance, and 1-confirmation redemptions on cash-out transactions.",Object(qe.jsx)("br",{}),"You'll need to configure Twilio if you're offering cash-out or any compliance options"]})},{id:"commissions",Component:VO,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."}],yv=n(1082),wv=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 Cv,kv,Ev,Nv,Sv,Iv,Lv,Pv,Fv,Dv,Tv=function(e){var t,n=e.currentStep,r=e.steps,i=e.subtitle,o=e.text,c=e.exImage,s=e.open,d=e.start,u=wv(),m=Object(a.useState)(!1),p=Object(l.a)(m,2),b=p[0],f=p[1],j=(t={},Object(z.a)(t,u.wrapper,!0),Object(z.a)(t,u.smallWrapper,!s),t);return Object(qe.jsxs)(yv.a,{anchor:"bottom",open:!0,variant:"persistent",classes:{paperAnchorDockedBottom:u.drawer},children:[Object(qe.jsxs)("div",{className:I()(j),children:[Object(qe.jsxs)(h.a,{container:!0,direction:"row",justify:"center",alignItems:"baseline",children:[Object(qe.jsxs)(h.a,{item:!0,xs:5,container:!0,direction:s?"column":"row",justify:"flex-start",alignItems:"baseline",children:[Object(qe.jsx)(Ge,{className:u.title,children:"Setup Lamassu Admin"}),Object(qe.jsx)(Ye,{className:u.subtitle,children:i}),s&&Object(qe.jsx)(Ke,{children:o})]}),Object(qe.jsx)(h.a,{item:!0,xs:4,container:!0,direction:"column",justify:"flex-start",alignItems:"flex-end",spacing:5,children:Object(qe.jsx)(h.a,{item:!0,xs:12,children:r&&n&&Object(qe.jsx)(bp,{currentStep:n,steps:r})})})]}),s&&Object(qe.jsxs)(h.a,{container:!0,direction:"row",justify:"center",alignItems:"baseline",children:[Object(qe.jsx)(h.a,{item:!0,xs:5,container:!0,direction:"column",justify:"flex-start",alignItems:"flex-start",children:Object(qe.jsx)(oa,{onClick:function(){f(!0)},children:"See full example"})}),Object(qe.jsx)(h.a,{item:!0,xs:4,container:!0,direction:"column",justify:"flex-start",alignItems:"flex-end",spacing:5,children:Object(qe.jsx)(h.a,{item:!0,children:Object(qe.jsx)(An,{size:"lg",onClick:d,children:"Get Started"})})})]})]}),Object(qe.jsx)(Kh,{closeOnEscape:!0,closeOnBackdropClick:!0,className:u.modal,xl:!0,width:1328,handleClose:function(){f(!1)},open:b,children:Object(qe.jsx)("img",{width:1152,src:c,alt:""})})]})},Rv=Object(f.a)({wrapper:{display:"flex",padding:[[16,0]],flexDirection:"column",justifyContent:"space-between",backgroundColor:ae},welcomeBackground:{background:"url(/wizard-background.svg) no-repeat center center fixed",backgroundColor:ae,backgroundSize:"cover"},blurred:{filter:"blur(4px)",pointerEvents:"none"}}),Bv=x()(Cv||(Cv=Object(c.a)(["\n query getData {\n config\n accounts\n cryptoCurrencies {\n code\n display\n }\n }\n"]))),Av=function(e){e.fromAuthRegister;var t,n,r=Rv(),i=Object(u.c)(Bv),o=i.data,c=i.loading,s=Object(w.h)(),d=Object(a.useContext)(k).setWizardTested,m=Object(a.useState)(0),h=Object(l.a)(m,2),p=h[0],b=h[1],f=Object(a.useState)(!0),j=Object(l.a)(f,2),g=j[0],O=j[1],x=Object(a.useState)(!1),v=Object(l.a)(x,2),y=v[0],C=v[1],E=vv;if(c)return Object(qe.jsx)(qe.Fragment,{});var N=xv(null===o||void 0===o?void 0:o.config,null===o||void 0===o?void 0:o.cryptoCurrencies),S=s.length&&!(null===(t=s.location.state)||void 0===t?void 0:t.fromAuthRegister);0===N&&(d(!0),S?s.goBack():s.push("/"));var L=0===p,P=(n={},Object(z.a)(n,r.blurred,y),Object(z.a)(n,r.wrapper,!0),Object(z.a)(n,r.welcomeBackground,L),n),F=E[p];return Object(qe.jsxs)(cn.a,{fullScreen:!0,open:g,children:[Object(qe.jsx)(sn.a,{className:I()(P),children:Object(qe.jsx)(F.Component,{doContinue:function(){p>=E.length-1&&(O(!1),s.push("/"));var e=0===p&&N?N:p+1;C(!0),b(e)},isActive:!y})}),!L&&Object(qe.jsx)(Tv,{currentStep:p,steps:E.length-1,exImage:F.exImage,subtitle:F.subtitle,text:F.text,open:y,start:function(){C(!1)}})]})},Mv=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)},Wv="user",zv="superuser",qv=function(e){var t=Object.assign({},e),n=Object(a.useContext)(k).userData;return Mv(n)?Object(qe.jsx)(w.c,Object(s.a)({},t)):Object(qe.jsx)(w.b,{to:"/login"})},$v=function(e){var t=e.component,n=e.restricted,r=Object(q.a)(e,["component","restricted"]),i=Object(a.useContext)(k).userData;return Object(qe.jsx)(w.c,Object(s.a)(Object(s.a)({},r),{},{render:function(e){return Mv(i)&&n?Object(qe.jsx)(w.b,{to:"/"}):Object(qe.jsx)(t,Object(s.a)({},e))}}))},Hv=n(1088),Vv=n(1087),Uv=n(1086),Gv=n(1089),Xv={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:Q},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:_},cashOutIcon:{width:12,height:12,borderRadius:12,backgroundColor:Z},txIcon:{width:12,height:12,borderRadius:12,backgroundColor:"#000"},topMachinesRadio:{display:"flex",flexDirection:"row"}},_v=Object(f.a)(Xv),Zv=function(e){var t=e.IconElement,n=e.IconComponent,a=e.label,r=_v();return Object(qe.jsxs)("span",{className:r.legendEntry,children:[!!n&&Object(qe.jsx)(n,{height:12}),!!t&&t,Object(qe.jsx)(Ke,{children:a})]})},Kv={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:$},dotOtTransactionClasses:{marginTop:15,"& p > span":{marginLeft:5},"& p:last-child":{marginTop:5}}},Qv=Object(f.a)(Kv),Yv=function(e){var t=e.coords,n=e.data,a=e.dateInterval,r=e.period,i=e.currency,o=e.representing,l=Qv(t),c=L.a("hourOfDay",o.code)?[jd(a[1],"HH:mm"),jd(a[0],"HH:mm")]:[fd(a[1],null,"day"===r.code?"MMM d, HH:mm":"MMM d"),fd(a[0],null,"day"===r.code?"HH:mm":"MMM d")],s=gs.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},n);return Object(qe.jsxs)(Un.a,{className:l.dotOtWrapper,children:[Object(qe.jsx)(Ye,{noMargin:!0,children:"day"===r.code||L.a("hourOfDay",o.code)?"".concat(c[0]," - ").concat(c[1]):"".concat(c[0])}),Object(qe.jsxs)(Ke,{noMargin:!0,className:l.dotOtTransactionAmount,children:[bn.a(n)," ",qm(bn.a(n),"transaction","transactions")]}),Object(qe.jsxs)(Ke,{noMargin:!0,className:l.dotOtTransactionVolume,children:[Xr(s.volume)," ",i," in volume"]}),Object(qe.jsxs)("div",{className:l.dotOtTransactionClasses,children:[Object(qe.jsxs)(it,{noMargin:!0,children:[Object(qe.jsx)(Dc,{}),Object(qe.jsxs)("span",{children:[s.cashIn," cash-in"]})]}),Object(qe.jsxs)(it,{noMargin:!0,children:[Object(qe.jsx)(zc,{}),Object(qe.jsxs)("span",{children:[s.cashOut," cash-out"]})]})]})]})},Jv=Object(a.memo)(Yv,(function(e,t){return e.coords===t.coords})),ey=n(1083),ty=n(1084),ny=function(e){var t=e.data,n=e.timezone,r=e.setSelectionCoords,i=e.setSelectionData,o=e.setSelectionDateInterval,l=(e.selectedMachine,Object(a.useRef)(null)),c=10,s=401,d=1163,u=Object(a.useMemo)((function(){return{top:25,right:.5,bottom:27,left:36.5}}),[]),m=Object(cd.a)(n),h=function(e,t){for(var n=[],a=new Date(e[0]),r=new Date(e[1]),i=Fm.a(a);i<=r;)n.push(Fm.a(i)),i.setUTCHours(i.getUTCHours()+t);return n},p=Object(a.useCallback)((function(e,n){return M.a((function(t){var a=new Date(t.created).setTime(new Date(t.created).getTime()+new Date(t.created).getTimezoneOffset()*ad+m),r=new Date(a);return e.getUTCHours()<n.getUTCHours()&&r.getUTCHours()>=new Date(e).getUTCHours()&&r.getUTCHours()<new Date(n).getUTCHours()||e.getUTCHours()>n.getUTCHours()&&r.getUTCHours()<=new Date(e).getUTCHours()&&r.getUTCHours()<new Date(n).getUTCHours()}),t)}),[t,m]),b=Object(a.useCallback)((function(e,t){return gs.a((function(e,t){return"cashIn"===t.txClass&&(e.cashIn+=Hc()(t.fiat).toNumber()),"cashOut"===t.txClass&&(e.cashOut+=Hc()(t.fiat).toNumber()),e}),{cashIn:0,cashOut:0},p(e,t))}),[p]),f=vd.scaleUtc().domain([pd(Object(ey.a)(new Date)),pd(Object(Fd.a)({days:1},Object(ey.a)(new Date)))]).rangeRound([u.left,d-u.right]),j=T.a((function(e){var t=Fm.a(e);e.setUTCHours(e.getUTCHours()+2);var n=Fm.a(e);return[t,p(t,n)]}),ty.a(h(f.domain(),2))),g=T.a((function(e){var t=Fm.a(e);e.setUTCHours(e.getUTCHours()+2);var n=Fm.a(e);return[t,b(t,n)]}),ty.a(h(f.domain(),2))),O=vd.scaleLinear().domain([0,0!==vd.max(g.map((function(e){return e[1]})),(function(e){return e.cashIn+e.cashOut}))?vd.max(g.map((function(e){return e[1]})),(function(e){return e.cashIn+e.cashOut})):50]).range([s-u.bottom,u.top]),x=Object(a.useCallback)((function(e){return e.attr("transform","translate(0, ".concat(s-u.bottom,")")).call(vd.axisBottom(f).ticks(vd.timeHour.every(2)).tickFormat(vd.timeFormat("%H:%M")))}),[u,f]),v=Object(a.useCallback)((function(e){return e.attr("transform","translate(".concat(u.left,", 0)")).call(vd.axisLeft(O).ticks(4.01).tickSize(0).tickFormat("")).call((function(e){return e.select(".domain").remove()}))}),[u,O]),y=Object(a.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[bn.a(n)-1])?t-1:.5+t})).attr("x2",(function(e){var t=f(e),n=h(f.domain(),2);return t===f(n[bn.a(n)-1])?t-1:.5+t})).attr("y1",u.top).attr("y2",s-u.bottom)}),[u,f]),w=Object(a.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)})),a=jl.a((function(e){return e===t}),n),r=a+1===bn.a(n)?0:n[a+1]-n[a];return Math.round(100*r)/100})).attr("height",s-u.bottom-u.top).attr("stroke","transparent").attr("fill","transparent").on("mouseover",(function(e){var t=Fm.a(new Date(e.target.__data__)),n=Fm.a(t);t.setUTCHours(t.getUTCHours()+2);var a=Fm.a(t),l=j.find((function(e){return gn.a(n,e[0])}))[1],c=Fm.a(e.target.getBoundingClientRect().x),s=Fm.a(e.target.getBoundingClientRect().x+e.target.getBoundingClientRect().width),d=e.target.x.baseVal.value<872.25?s+25:c-150-25,u=Fm.a(e.target.getBoundingClientRect().y);o([a,n]),i(l),r({x:Math.round(d),y:Math.round(u)}),vd.select("#event-rect-".concat(f(e.target.__data__))).attr("fill",re)})).on("mouseleave",(function(e){vd.select("#event-rect-".concat(f(e.target.__data__))).attr("fill","transparent"),o(null),i(null),r(null)}))}),[u,j,r,i,o,f]),C=Object(a.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)})),a=jl.a((function(e){return e===t}),n),r=a+1===bn.a(n)?0:n[a+1]-n[a];return Math.round(100*r)/100})).attr("height",s-u.bottom-u.top).attr("stroke","transparent").attr("fill","transparent")}),[u,f]),k=Object(a.useCallback)((function(){return vd.selectAll(".tick text").style("stroke",ce).style("fill",ce).style("stroke-width",.5).style("font-family",ge)}),[]),E=Object(a.useCallback)((function(e){e.selectAll("rect").data(ty.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=Aa.a((function(t){return gn.a(t[0],e)}),g);return O(t[1].cashIn)-u.top+u.bottom})).attr("height",(function(e){var t=Aa.a((function(t){return gn.a(t[0],e)}),g);return ip.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)})),a=jl.a((function(e){return e===t}),n),r=a===bn.a(n)?0:n[a+1]-n[a];return Math.round(100*(r-c))/100})).attr("rx",2.5)}),[f,O,u,g]),N=Object(a.useCallback)((function(e){e.selectAll("rect").data(ty.a(h(f.domain(),2))).join("rect").attr("stroke",Z).attr("fill",Z).attr("x",(function(e){return f(e)+5})).attr("y",(function(e){var t=Aa.a((function(t){return gn.a(t[0],e)}),g);return O(t[1].cashIn+t[1].cashOut)-u.top+u.bottom})).attr("height",(function(e){var t=Aa.a((function(t){return gn.a(t[0],e)}),g);return ip.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)})),a=jl.a((function(e){return e===t}),n),r=a===bn.a(n)?0:n[a+1]-n[a];return Math.round(100*(r-c))/100})).attr("rx",2.5)}),[f,O,u,g]),S=Object(a.useCallback)((function(){var e=vd.select(l.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(E),e.append("g").call(N),e.append("g").call(w),e.node()}),[x,v,C,w,y,E,k,N]);return Object(a.useEffect)((function(){vd.select(l.current).selectAll("*").remove(),S()}),[S]),Object(qe.jsx)("svg",{ref:l})},ay=Object(a.memo)(ny,(function(e,t){return gn.a(e.period,t.period)&&gn.a(e.selectedDay,t.selectedDay)&&gn.a(e.selectedMachine,t.selectedMachine)})),ry=function(e){var t,n=e.data,r=e.period,i=e.timezone,o=e.setSelectionCoords,l=e.setSelectionData,c=e.setSelectionDateInterval,s=Object(a.useRef)(null),u=401,m=1163,h=Object(a.useMemo)((function(){return{top:25,right:3.5,bottom:27,left:36.5}}),[]),p=Object(cd.a)(i),b=Date.now()+p,f={day:[b-rd,b],week:[b-id,b],month:[b-od,b]},j=Object(a.useMemo)((function(){return{day:{freq:24,step:36e5,tick:vd.utcHour.every(1),labelFormat:"%H:%M"},week:{freq:7,step:864e5,tick:vd.utcDay.every(1),labelFormat:"%a %d"},month:{freq:30,step:864e5,tick:vd.utcDay.every(1),labelFormat:"%d"}}}),[]),g=Object(a.useCallback)((function(e){var t=new Date(e),n=t.getUTCDate(),a=t.getUTCDay(),r=t.getUTCMonth(),i=new Date(t.getTime());i.setUTCDate(n-1);var o=i.getUTCDate(),l=i.getUTCDay(),c=i.getUTCMonth(),s=Array.from(Array(7)).map((function(e,t){return Object(hd.a)("EEE",Object(Fd.a)({days:t},Object(Dd.a)(new Date)))})),d=Array.from(Array(12)).map((function(e,t){return Object(hd.a)("LLL",Object(Fd.a)({months:t},Object(Td.a)(new Date)))}));return{previous:r!==c?d[c]:"".concat(s[l]," ").concat(o),current:r!==c?d[r]:"".concat(s[a]," ").concat(n)}}),[]),O=Object(a.useCallback)((function(e){for(var t=[],n=function(e){var t=j[r.code].step;return new Date(Math.ceil(e.valueOf()/t)*t)},a=0;a<=j[r.code].freq;a++){var i=new Date(b-a*j[r.code].step);n(i)>e[1]||(i<e[0]||t.push(n(i)))}return t}),[b,j,r.code]),x=Object(a.useCallback)((function(e){var t=[];t.push(e[1]);for(var n=function(e){var t=j[r.code].step;return new Date(Math.ceil(e.valueOf()/t)*t)},a=0;a<=j[r.code].freq;a++){var i=new Date(b-a*j[r.code].step);n(i)>new Date(e[1])||(i<new Date(e[0])||t.push(n(i)))}return t.push(e[0]),t}),[b,j,r.code]),v=vd.scaleUtc().domain(f[r.code]).range([h.left,m-h.right]),y=vd.scaleUtc().domain(f[r.code]).range([h.left,m]),w=vd.scaleLinear().domain([0,1.03*(null!==(t=vd.max(n,(function(e){return new Hc.a(e.fiat).toNumber()})))&&void 0!==t?t:1e3)]).nice().range([u-h.bottom,h.top]),C=function(e,t,n){for(var a=[n[1]].concat(Object(d.a)(M.a((function(e){return e>t[0]&&e<t[1]}),e)),[t[0]]),r=[],i=0;i<a.length-1;i++)r.push([a[i],a[i+1]]);return r},k=Object(a.useCallback)((function(e){return e.attr("transform","translate(0, ".concat(u-h.bottom,")")).call(vd.axisBottom(v).ticks(j[r.code].tick).tickFormat((function(e){return vd.timeFormat(j[r.code].labelFormat)(e.getTime()+e.getTimezoneOffset()*ad)}))).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,r.code,v]),E=Object(a.useCallback)((function(e){return e.attr("transform","translate(".concat(h.left,", 0)")).call(vd.axisLeft(w).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.left).attr("stroke-width",1).attr("stroke",J)}))}),[h,w]),N=Object(a.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(vd.axisLeft(w).scale().ticks(4.01)).join("line").attr("y1",(function(e){return.5+w(e)})).attr("y2",(function(e){return.5+w(e)})).attr("x1",h.left).attr("x2",m)})).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=Aa.a((function(e){return t<=e[0]&&t>=e[1]}),e))&&void 0!==n?n:[0,0]}(C(x(v.domain()).map((function(e){return Math.round(100*v(e))/100})),v.range(),y.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,a=function(e,t,n){for(var a=Ag.a(ml.a(t)),r=t.length-1;r>=0;r--)if(n<a[r])return[e[r],e[r+1]]}(x(v.domain()),C(x(v.domain()).map((function(e){return Math.round(100*v(e))/100})),v.range(),y.range()),t);if(a){var r=n.filter((function(e){var t=new Date(e.created),n=t.setTime(t.getTime()+p);return n>new Date(a[1])&&n<=new Date(a[0])})),i=Fm.a(e.target.getBoundingClientRect().x),s=Fm.a(e.target.getBoundingClientRect().x+e.target.getBoundingClientRect().width),d=e.target.x.baseVal.value<872.25?s+25:i-150-25,u=Fm.a(e.target.getBoundingClientRect().y);c(a),l(r),o({x:Math.round(d),y:Math.round(u)}),vd.select(e.target).attr("fill",re)}})).on("mouseleave",(function(e){vd.select(e.target).attr("fill","transparent"),c(null),l(null),o(null)}))})).call((function(e){return e.append("g").selectAll("line").data(O(v.domain()).filter((function(e){return"day"===r.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,a=null===vd||void 0===vd||null===(t=vd.select(".dateSeparator"))||void 0===t||null===(n=t.node())||void 0===n?void 0:n.getBBox();if(a){var i=O(v.domain()).filter((function(e){return"day"===r.code?0===e.getUTCHours():1===e.getUTCDate()})),o=g(i);return e.append("text").attr("x",a.x-10).attr("y",a.y+33).attr("text-anchor","end").attr("dy",".25em").text(o.previous)}})).call((function(e){var t,n,a=null===vd||void 0===vd||null===(t=vd.select(".dateSeparator"))||void 0===t||null===(n=t.node())||void 0===n?void 0:n.getBBox();if(a){var i=O(v.domain()).filter((function(e){return"day"===r.code?0===e.getUTCHours():1===e.getUTCDate()})),o=g(i);return e.append("text").attr("x",a.x+10).attr("y",a.y+33).attr("text-anchor","start").attr("dy",".25em").text(o.current)}}))}),[h,O,g,v,y,w,r,x,n,p,o,l,c]),S=Object(a.useCallback)((function(){return vd.selectAll(".tick text").style("stroke",ce).style("fill",ce).style("stroke-width",.5).style("font-family",ge)}),[]),I=Object(a.useCallback)((function(){return vd.selectAll("text").style("stroke",se).style("fill",se).style("stroke-width",.5).style("font-family",ge)}),[]),L=Object(a.useCallback)((function(){vd.selectAll(".tick line").style("stroke",J).style("fill",J)}),[]),P=Object(a.useCallback)((function(e){e.attr("stroke",J).attr("stroke-width",3).attr("stroke-dasharray","10, 5").call((function(e){var t,a;return e.append("line").attr("y1",.5+w(null!==(t=vd.mean(n,(function(e){return new Hc.a(e.fiat).toNumber()})))&&void 0!==t?t:0)).attr("y2",.5+w(null!==(a=vd.mean(n,(function(e){return new Hc.a(e.fiat).toNumber()})))&&void 0!==a?a:0)).attr("x1",h.left).attr("x2",m)}))}),[h,w,n]),F=Object(a.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()+p))})).attr("cy",(function(e){return w(new Hc.a(e.fiat).toNumber())})).attr("fill",(function(e){return"cashIn"===e.txClass?_:Z})).attr("r",3.5)}),[n,p,v,w]),D=Object(a.useCallback)((function(){var e=vd.select(s.current).attr("viewBox",[0,0,m,u]);return e.append("g").call(N),e.append("g").call(P),e.append("g").call(k),e.append("g").call(E),e.append("g").call(S),e.append("g").call(I),e.append("g").call(L),e.append("g").call(F),e.node()}),[P,N,k,E,F,I,L,S]);return Object(a.useEffect)((function(){vd.select(s.current).selectAll("*").remove(),D()}),[D]),Object(qe.jsx)("svg",{ref:s})},iy=Object(a.memo)(ry,(function(e,t){return gn.a(e.period,t.period)&&gn.a(e.selectedMachine,t.selectedMachine)})),oy=n(1085),ly=n(331),cy=n(534),sy=function(e){var t=e.data,n=e.machines,r=e.currency,i=(e.selectedMachine,Object(a.useRef)(null)),o=.15,l=401,c=Object(a.useMemo)((function(){return{top:25,right:.5,bottom:27,left:36.5}}),[]),s=Fm.a(n),d=bn.a(n)>=5?s:T.a((function(e){return D.a(s[e])?{code:"ghostMachine".concat(e),display:""}:s[e]}),Pu.a(Fu.a,5)),u=gs.a((function(e,n){return e[n.code]=M.a((function(e){return e.deviceId===n.code}),t),e}),{},d),m=oy.a((function(e,t){return t[1]-e[1]}),T.a((function(e){return[e.code,(t=e.code,gs.a((function(e,t){return e+Hc()(t.fiat).toNumber()}),0,u[t]))];var t}),d)),h=ly.a(5,m),p=Gc.a(T.a((function(e){return[e[0],(t=e[0],gs.a((function(e,t){return"cashIn"===t.txClass&&(e.cashIn+=Hc()(t.fiat).toNumber()),"cashOut"===t.txClass&&(e.cashOut+=Hc()(t.fiat).toNumber()),e}),{cashIn:0,cashOut:0},u[t]))];var t}),h)),b=vd.scaleBand().domain(h).range([c.left,1163-c.right]).paddingInner(o),f=vd.scaleLinear().domain([0,0!==vd.max(h,(function(e){return e[1]}))?vd.max(h,(function(e){return e[1]})):50]).range([l-c.bottom,c.top]),j=Object(a.useCallback)((function(e){return e.attr("class","x-axis-1").attr("transform","translate(0, ".concat(l-c.bottom,")")).call(vd.axisBottom(b).tickFormat((function(e){var t;return"".concat(null!==(t=Aa.a((function(t){return t.code===e[0]}),d).display)&&void 0!==t?t:"")})).tickSize(0).tickPadding(10))}),[c,b,d]),g=Object(a.useCallback)((function(e){e.attr("class","x-axis-2").attr("transform","translate(0, ".concat(l-c.bottom,")")).call(vd.axisBottom(b).tickFormat((function(e){return L.a("ghostMachine",e[0])?"":"".concat(e[1].toFixed(2)," ").concat(r)})).tickSize(0).tickPadding(10))}),[c,b,r]),O=Object(a.useCallback)((function(){vd.selectAll(".x-axis-1 .tick text").attr("transform",(function(e){var t=(b.range()[1]-b.range()[0])/5;return"translate(".concat(-t/2.25+this.getBBox().width/2,", 0)")}))}),[b]),x=Object(a.useCallback)((function(){vd.selectAll(".x-axis-2 .tick text").attr("transform",(function(e){var t=(b.range()[1]-b.range()[0])/5;return"translate(".concat(t/2.25-this.getBBox().width/2,", 0)")}))}),[b]),v=Object(a.useCallback)((function(e){return e.attr("transform","translate(".concat(c.left,", 0)")).call(vd.axisLeft(f).ticks(4.01).tickSize(0).tickFormat("")).call((function(e){return e.select(".domain").remove()}))}),[c,f]),y=Object(a.useCallback)((function(){return vd.selectAll(".tick text").style("stroke",ce).style("fill",ce).style("stroke-width",.5).style("font-family",ge)}),[]),w=Object(a.useCallback)((function(e){e.attr("stroke",ie).attr("fill",ie).call((function(e){return e.append("g").selectAll("line").data(cy.a(b.domain())).join("line").attr("x1",(function(e){var t=jl.a((function(t){return gn.a(t,e)}),b.domain()),n=.075*(b(b.domain()[t])-b(b.domain()[t-1]));return.5+b(e)-n})).attr("x2",(function(e){var t=jl.a((function(t){return gn.a(t,e)}),b.domain()),n=.075*(b(b.domain()[t])-b(b.domain()[t-1]));return.5+b(e)-n})).attr("y1",c.top).attr("y2",l-c.bottom)}))}),[c,b]),C=Object(a.useCallback)((function(e){e.selectAll("rect").data(_c.a(p)).join("rect").attr("fill",_).attr("x",(function(e){return b([e[0],e[1].cashIn+e[1].cashOut])})).attr("y",(function(e){return f(e[1].cashIn)-c.top+c.bottom})).attr("height",(function(e){return ip.a(0,l,l-f(e[1].cashIn)-c.bottom-10)})).attr("width",b.bandwidth()).attr("rx",2.5)}),[p,b,f,c]),k=Object(a.useCallback)((function(e){e.selectAll("rect").data(_c.a(p)).join("rect").attr("fill",Z).attr("x",(function(e){return b([e[0],e[1].cashIn+e[1].cashOut])})).attr("y",(function(e){return f(e[1].cashIn+e[1].cashOut)-c.top+c.bottom})).attr("height",(function(e){return ip.a(0,l,l-f(e[1].cashOut)-c.bottom-5)})).attr("width",b.bandwidth()).attr("rx",2.5)}),[p,b,f,c]),E=Object(a.useCallback)((function(){var e=vd.select(i.current).attr("viewBox",[0,0,1163,l]);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(a.useEffect)((function(){vd.select(i.current).selectAll("*").remove(),E()}),[E]),Object(qe.jsx)("svg",{ref:i})},dy=Object(a.memo)(sy,(function(e,t){return gn.a(e.period,t.period)&&gn.a(e.selectedMachine,t.selectedMachine)})),uy=function(e){var t=e.data,n=e.representing,r=e.period,i=e.timezone,o=e.currency,c=e.selectedMachine,s=e.machines,d=e.selectedDay,u=Object(a.useState)(null),m=Object(l.a)(u,2),h=m[0],p=m[1],b=Object(a.useState)(null),f=Object(l.a)(b,2),j=f[0],g=f[1],O=Object(a.useState)(null),x=Object(l.a)(O,2),v=x[0],y=x[1];return Object(qe.jsxs)("div",{children:[!D.a(h)&&Object(qe.jsx)(Jv,{coords:h,dateInterval:j,data:v,period:r,currency:o,timezone:i,representing:n}),function(e){switch(e.code){case"overTime":return Object(qe.jsx)(iy,{data:t,period:r,timezone:i,setSelectionCoords:p,setSelectionDateInterval:g,setSelectionData:y,selectedMachine:c});case"topMachinesVolume":case"topMachinesTransactions":return Object(qe.jsx)(dy,{data:t,period:r,timezone:i,setSelectionCoords:p,setSelectionDateInterval:g,setSelectionData:y,selectedMachine:c,machines:M.a((function(e){return"all"!==e.code}),s),currency:o});case"hourOfDayVolume":case"hourOfDayTransactions":return Object(qe.jsx)(ay,{data:t,period:r,timezone:i,setSelectionCoords:p,setSelectionDateInterval:g,setSelectionData:y,selectedMachine:c,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)]})},my=Object(a.memo)(uy),hy=Object(f.a)(Xv),py=[{code:"hourOfDayTransactions",display:"Transactions"},{code:"hourOfDayVolume",display:"Volume"}],by=function(e){var t=e.title,n=e.period,r=e.data,i=e.machines,o=e.selectedMachine,c=e.handleMachineChange,s=e.selectedDay,d=e.dayOptions,u=e.handleDayChange,m=e.timezone,h=e.currency,p=hy(),b=Object(a.useState)(py[0].code),f=Object(l.a)(b,1)[0],j={cashIn:Object(qe.jsx)("div",{className:p.cashInIcon}),cashOut:Object(qe.jsx)("div",{className:p.cashOutIcon})},g=Object(cd.a)(m),O=gs.a((function(e,t){var n=new Date(t.created);switch(n.setTime(n.getTime()+n.getTimezoneOffset()*ad+g),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}),Gc.a(T.a((function(e){return[e.code,[]]}),d)),r);return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsxs)("div",{className:p.graphHeaderWrapper,children:[Object(qe.jsxs)("div",{className:p.graphHeaderLeft,children:[Object(qe.jsx)(Ge,{noMargin:!0,children:t}),Object(qe.jsxs)(nl.a,{className:p.graphLegend,children:[Object(qe.jsx)(Zv,{IconElement:j.cashIn,label:"Cash-in"}),Object(qe.jsx)(Zv,{IconElement:j.cashOut,label:"Cash-out"})]})]}),Object(qe.jsxs)("div",{className:p.graphHeaderRight,children:[Object(qe.jsx)(lh,{label:"Day of the week",items:d,default:d[0],selectedItem:s,onSelectedItemChange:u}),Object(qe.jsx)(lh,{label:"Machines",onSelectedItemChange:c,items:i,default:i[0],selectedItem:o})]})]}),Object(qe.jsx)(my,{representing:Aa.a((function(e){return e.code===f}))(py),period:n,data:O[s.code],timezone:m,currency:h,selectedMachine:o,machines:i,selectedDay:s})]})},fy=Object(f.a)(Xv),jy=function(e){var t=e.title,n=e.representing,a=e.period,r=e.data,i=e.machines,o=e.selectedMachine,l=e.handleMachineChange,c=e.timezone,s=e.currency,d=fy(),u={cashIn:Object(qe.jsx)("div",{className:d.cashInIcon}),cashOut:Object(qe.jsx)("div",{className:d.cashOutIcon}),transaction:Object(qe.jsx)("div",{className:d.txIcon}),average:Object(qe.jsx)("svg",{height:"12",width:"18",children:Object(qe.jsx)("path",{stroke:J,strokeWidth:"3",strokeDasharray:"5, 2",d:"M 5 6 l 20 0"})})};return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsxs)("div",{className:d.graphHeaderWrapper,children:[Object(qe.jsxs)("div",{className:d.graphHeaderLeft,children:[Object(qe.jsx)(Ge,{noMargin:!0,children:t}),Object(qe.jsxs)(nl.a,{className:d.graphLegend,children:[Object(qe.jsx)(Zv,{IconElement:u.cashIn,label:"Cash-in"}),Object(qe.jsx)(Zv,{IconElement:u.cashOut,label:"Cash-out"}),Object(qe.jsx)(Zv,{IconElement:u.transaction,label:"One transaction"}),Object(qe.jsx)(Zv,{IconElement:u.average,label:"Average"})]})]}),Object(qe.jsx)("div",{className:d.graphHeaderRight,children:Object(qe.jsx)(lh,{label:"Machines",onSelectedItemChange:l,items:i,default:i[0],selectedItem:o})})]}),Object(qe.jsx)(my,{representing:n,period:a,data:r,timezone:c,currency:s,selectedMachine:o,machines:i})]})},gy=Object(f.a)(Xv),Oy=[{code:"topMachinesTransactions",display:"Transactions"},{code:"topMachinesVolume",display:"Volume"}],xy=function(e){var t=e.title,n=e.period,r=e.data,i=e.machines,o=e.selectedMachine,c=e.timezone,s=e.currency,d=gy(),u=Object(a.useState)(Oy[0].code),m=Object(l.a)(u,1)[0],h={cashIn:Object(qe.jsx)("div",{className:d.cashInIcon}),cashOut:Object(qe.jsx)("div",{className:d.cashOutIcon})};return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsxs)("div",{className:d.graphHeaderWrapper,children:[Object(qe.jsxs)("div",{className:d.graphHeaderLeft,children:[Object(qe.jsx)(Ge,{noMargin:!0,children:t}),Object(qe.jsxs)(nl.a,{className:d.graphLegend,children:[Object(qe.jsx)(Zv,{IconElement:h.cashIn,label:"Cash-in"}),Object(qe.jsx)(Zv,{IconElement:h.cashOut,label:"Cash-out"})]})]}),Object(qe.jsx)("div",{className:d.graphHeaderRight})]}),Object(qe.jsx)(my,{representing:Aa.a(W.a("code",m),Oy),period:n,data:r,timezone:c,currency:s,selectedMachine:o,machines:i})]})},vy=Object(f.a)(Xv),yy=[{code:"all",display:"All machines"}],wy=[{code:"overTime",display:"Over time"},{code:"topMachines",display:"Top Machines"},{code:"hourOfTheDay",display:"Hour of the day"}],Cy=[{code:"day",display:"Last 24 hours"},{code:"week",display:"Last 7 days"},{code:"month",display:"Last 30 days"}],ky={day:rd,week:id,month:od},Ey=T.a((function(e){return{code:On.a(e),display:e}}),Array.from(Array(7)).map((function(e,t){return Object(hd.a)("EEEE",Object(Fd.a)({days:t},Object(Dd.a)(new Date)))}))),Ny=x()(kv||(kv=Object(c.a)(["\n query transactions(\n $from: Date\n $until: Date\n $excludeTestingCustomers: Boolean\n ) {\n transactions(\n from: $from\n until: $until\n excludeTestingCustomers: $excludeTestingCustomers\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 profit\n }\n }\n"]))),Sy=x()(Ev||(Ev=Object(c.a)(["\n query getData {\n config\n machines {\n name\n deviceId\n }\n fiatRates {\n code\n name\n rate\n }\n }\n"]))),Iy=function(e){var t,n=e.label,a=e.value,r=e.oldValue,i=e.currency,o=vy(),l=100*(a-r)/(!r||gn.a(r,0)?1:r),c=(t={},Object(z.a)(t,o.growthPercentage,!0),Object(z.a)(t,o.growth,rm.a(a,r)),Object(z.a)(t,o.decline,rm.a(r,a)),t);return Object(qe.jsxs)("div",{className:o.overviewEntry,children:[Object(qe.jsx)(Ke,{noMargin:!0,children:n}),Object(qe.jsxs)(Ye,{noMargin:!0,className:o.overviewFieldWrapper,children:[Object(qe.jsx)("span",{children:Xr(a)}),!!i&&" ".concat(i)]}),Object(qe.jsxs)("span",{className:o.overviewGrowth,children:[rm.a(l,0)&&Object(qe.jsx)(nd,{height:10}),Uv.a(l,0)&&Object(qe.jsx)(Us,{height:10}),gn.a(l,0)&&Object(qe.jsx)(Ks,{height:10}),Object(qe.jsxs)(Ke,{noMargin:!0,className:I()(c),children:[Xr(l),"%"]})]})]})},Ly=function(){var e,t,n,r,i,o=vy(),c=Object(u.c)(Ny,{variables:{from:Object(Vv.a)(65,Object(Hv.a)()),until:Object(Hv.a)(),excludeTestingCustomers:!0}}),d=c.data,m=c.loading,h=Object(u.c)(Sy),p=h.data,b=h.loading,f=Object(a.useState)(wy[0]),j=Object(l.a)(f,2),g=j[0],O=j[1],x=Object(a.useState)(Cy[0]),v=Object(l.a)(x,2),y=v[0],w=v[1],C=Object(a.useState)(yy[0]),k=Object(l.a)(C,2),E=k[0],N=k[1],S=Object(a.useState)(gn.a(g.code,"hourOfTheDay")?Ey[0]:null),I=Object(l.a)(S,2),L=I[0],P=I[1],F=m||b,R=null!==(e=A.a(["transactions"])(d))&&void 0!==e?e:[],B=null!==(t=A.a(["machines"])(p))&&void 0!==t?t:[],z=null!==(n=A.a(["config"])(p))&&void 0!==n?n:[],q=null!==(r=A.a(["fiatRates"])(p))&&void 0!==r?r:[],$=ds("locale")(z).fiatCurrency,H=null===z||void 0===z?void 0:z.locale_timezone,V=function(e){if(e.fiatCode===$)return e;var t=Aa.a(W.a("code",e.fiatCode))(q),n=Aa.a(W.a("code",$))(q),a=(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)*a})},U=null!==(i=T.a(V)(null===R||void 0===R?void 0:R.filter((function(e){return(!e.dispensed||!e.expired)&&(e.sendConfirmed||e.dispense)&&!e.hasError}))))&&void 0!==i?i:[],G=Fm.a(yy);Gv.a((function(e){return G.push({code:e.deviceId,display:e.name})}),B);var X=M.a((function(e){return"all"===E.code||e.deviceId===E.code}),U),_=function(e){var t,n;return{current:null!==(t=X.filter((function(t){var n=new Date(t.created);return(!!D.a(L)||gn.a(On.a(Object(hd.a)("EEEE",n)),L.code))&&n>=Date.now()-ky[e]})))&&void 0!==t?t:[],previous:null!==(n=X.filter((function(t){var n=new Date(t.created);return(!!D.a(L)||gn.a(On.a(Object(hd.a)("EEEE",n)),L.code))&&n<Date.now()-ky[e]&&n>=Date.now()-2*ky[e]})))&&void 0!==n?n:[]}},Z={current:_(y.code).current.length,previous:_(y.code).previous.length},K={current:js.a(T.a((function(e){return e.fiat}),_(y.code).current))/(0===Z.current?1:Z.current),previous:js.a(T.a((function(e){return e.fiat}),_(y.code).previous))/(0===Z.previous?1:Z.previous)},Q={current:js.a(T.a((function(e){return e.fiat}),_(y.code).current)),previous:js.a(T.a((function(e){return e.fiat}),_(y.code).previous))},Y={current:js.a(T.a((function(e){return e.profit}),_(y.code).current)),previous:js.a(T.a((function(e){return e.profit}),_(y.code).previous))};return!F&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(cl,{title:"Analytics",children:Object(qe.jsxs)(nl.a,{className:o.overviewLegend,children:[Object(qe.jsx)(Zv,{IconComponent:nd,label:"Up since last period"}),Object(qe.jsx)(Zv,{IconComponent:Us,label:"Down since last period"}),Object(qe.jsx)(Zv,{IconComponent:Ks,label:"Same since last period"})]})}),Object(qe.jsxs)("div",{className:o.dropdownsOverviewWrapper,children:[Object(qe.jsxs)("div",{className:o.dropdowns,children:[Object(qe.jsx)(lh,{label:"Representing",onSelectedItemChange:function(e){O(e),P(gn.a(e.code,"hourOfTheDay")?Ey[0]:null)},items:wy,default:wy[0],selectedItem:g,defaultAsFilter:!0}),Object(qe.jsx)(lh,{label:"Time period",onSelectedItemChange:w,items:Cy,default:Cy[0],selectedItem:y,defaultAsFilter:!0})]}),Object(qe.jsxs)("div",{className:o.overview,children:[Object(qe.jsx)(Iy,{label:"Transactions",value:Z.current,oldValue:Z.previous}),Object(qe.jsx)("div",{className:o.verticalLine}),Object(qe.jsx)(Iy,{label:"Avg. txn amount",value:K.current,oldValue:K.previous,currency:$}),Object(qe.jsx)("div",{className:o.verticalLine}),Object(qe.jsx)(Iy,{label:"Volume",value:Q.current,oldValue:Q.previous,currency:$}),Object(qe.jsx)("div",{className:o.verticalLine}),Object(qe.jsx)(Iy,{label:"Commissions",value:Y.current,oldValue:Y.previous,currency:$})]})]}),function(e){switch(e.code){case"overTime":return Object(qe.jsx)(jy,{title:"Transactions over time",representing:e,period:y,data:T.a(V)(_(y.code).current),machines:G,selectedMachine:E,handleMachineChange:N,timezone:H,currency:$});case"topMachines":return Object(qe.jsx)(xy,{title:"Top 5 Machines",representing:e,period:y,data:T.a(V)(_(y.code).current),machines:G,selectedMachine:E,handleMachineChange:N,timezone:H,currency:$});case"hourOfTheDay":return Object(qe.jsx)(by,{title:"Avg. transactions per hour of the day",representing:e,period:y,data:T.a(V)(_(y.code).current),machines:G,selectedMachine:E,handleMachineChange:N,selectedDay:L,dayOptions:Ey,handleDayChange:P,timezone:H,currency:$});default:throw new Error("There's no graph info to represent ".concat(e))}}(g)]})},Py=n(1090),Fy={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:K},deleteButton:{paddingLeft:13},addressRow:{marginLeft:8},error:{marginTop:20},closeButton:{display:"flex",padding:[[16,16,0,16]],paddingRight:12,justifyContent:"end"},dialogTitle:{margin:[[0,16,8,40]]},dialogContent:{width:615,marginLeft:16},dialogActions:{padding:32,paddingTop:16},cancelButton:{marginRight:8,padding:0}},Dy=Object(f.a)(Fy),Ty=function(e){var t=e.onClose,n=e.selectedCoin,a=e.addToBlacklist,r=e.errorMsg,i=Dy();return Object(qe.jsxs)(Kh,{closeOnBackdropClick:!0,width:676,height:200,handleClose:t,open:!0,children:[Object(qe.jsx)(mn.e,{validateOnBlur:!1,validateOnChange:!1,initialValues:{address:""},validationSchema:xn.f({address:xn.h().trim().required("An address is required")}),onSubmit:function(e){!function(e){"BCH"!==n.code||e.startsWith("bitcoincash:")||(e="bitcoincash:"+e),a(n.code,e)}(e.address.trim())},children:Object(qe.jsxs)(mn.d,{id:"address-form",children:[Object(qe.jsx)(Xe,{className:i.modalTitle,children:n.display?"Blacklist ".concat(On.a(n.display)," address"):""}),Object(qe.jsx)(mn.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",USDT:"0x5754284f345afc66a98fbb0a0afe71e0f007b949",XMR:"888tNkZrPN6JsEgekjMnABU4TBzc2Dt29EPAvkRxbANsAnjyPbb3iQ1YBRk1UXcdRsiKc9dhwMVgN5S9cQUiyoogDavup3H"}[n.code]),component:di}),!D.a(r)&&Object(qe.jsx)(il,{className:i.error,children:r})]})}),Object(qe.jsx)("div",{className:i.footer,children:Object(qe.jsx)(nl.a,{display:"flex",justifyContent:"flex-end",children:Object(qe.jsx)(oa,{type:"submit",form:"address-form",children:"Blacklist address"})})})]})},Ry=Object(f.a)(lg),By=function(e){var t,n=e.id,a=e.index,r=e.elements,i=e.data,o=e.width,l=e.Details,c=e.expanded,d=e.expandRow,u=e.expWidth,m=e.expandable,h=e.onClick,p=e.size,b=Object(q.a)(e,["id","index","elements","data","width","Details","expanded","expandRow","expWidth","expandable","onClick","size"]),f=Ry(),j=h||m,g=(t={},Object(z.a)(t,f.pointer,j),Object(z.a)(t,f.row,!0),Object(z.a)(t,f.expanded,c),t);return Object(qe.jsxs)("div",{className:f.rowWrapper,children:[Object(qe.jsx)("div",{className:I()(Object(z.a)({},f.before,c&&0!==a)),children:Object(qe.jsxs)(Sm,{size:p,className:I()(g),onClick:function(){m&&d(n,i),h&&h(i)},error:i.error||i.hasError||i.batchError,shouldShowError:!1,errorMessage:i.errorMessage||i.hasError||i.batchError,children:[r.map((function(e,t){var n=e.view,a=void 0===n?function(e){return null===e||void 0===e?void 0:e.toString()}:n,r=Object(q.a)(e,["view"]);return Object(qe.jsx)(km,Object(s.a)(Object(s.a)({},r),{},{children:a(i)}),t)})),m&&Object(qe.jsx)(km,{width:u,textAlign:"center",children:Object(qe.jsxs)("button",{onClick:function(){return d(n,i)},className:f.expandButton,children:[c&&Object(qe.jsx)(Cg,{}),!c&&Object(qe.jsx)(hg,{})]})})]})}),m&&c&&Object(qe.jsx)("div",{className:f.after,children:Object(qe.jsx)(Sm,{className:I()(Object(z.a)({},f.expanded,c)),children:Object(qe.jsx)(km,{width:o,children:Object(qe.jsx)(l,{it:i,timezone:b.timezone})})})})]})},Ay=function(e){var t=e.elements,n=void 0===t?[]:t,r=e.data,i=void 0===r?[]:r,o=e.Details,c=(e.className,e.expandable),d=e.initialExpanded,u=e.onClick,m=e.loading,h=e.emptyText,p=e.rowSize,b=Object(q.a)(e,["elements","data","Details","className","expandable","initialExpanded","onClick","loading","emptyText","rowSize"]),f=Object(a.useState)(d),j=Object(l.a)(f,2),g=j[0],O=j[1];Object(a.useEffect)((function(){return O(d)}),[d]);var x=P.a(js.a,T.a(R.a("width")))(n),v=1200-x,y=x+(c?v:0),w=Ry({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 og.c({defaultHeight:58,fixedWidth:!0});function E(e){var t=e.index,a=e.key,r=e.parent,l=e.style;return Object(qe.jsx)(og.b,{cache:k,columnIndex:0,parent:r,rowIndex:t,children:function(e){var a=e.registerChild;return Object(qe.jsx)("div",{ref:a,style:l,children:Object(qe.jsx)(By,{width:y,size:p,id:i[t].id?i[t].id:t,index:t,expWidth:v,elements:n,data:i[t],Details:o,expanded:i[t].id?i[t].id===g:t===g,expandRow:C,expandable:c,onClick:u,timezone:b.timezone})})}},a)}return Object(qe.jsx)(nl.a,{display:"flex",flex:"1",flexDirection:"column",children:Object(qe.jsxs)(vm,{className:w.table,children:[Object(qe.jsxs)(ym,{children:[n.map((function(e,t){var n=e.width,a=e.className,r=e.textAlign,i=e.header;return Object(qe.jsx)(Em,{width:n,className:a,textAlign:r,children:i},t)})),c&&Object(qe.jsx)(Em,{width:v})]}),Object(qe.jsxs)(Cm,{className:w.body,children:[m&&Object(qe.jsx)(_e,{children:"Loading..."}),!m&&Wa.a(i)&&Object(qe.jsx)(Ns,{message:h}),!m&&!Wa.a(i)&&Object(qe.jsx)(og.a,{disableWidth:!0,children:function(e){var t=e.height;return Object(qe.jsx)(og.d,Object(s.a)(Object(s.a)({style:{outline:"none"}},b),{},{height:m?0:t,width:y,rowCount:i.length,rowHeight:k.rowHeight,rowRenderer:E,overscanRowCount:5,deferredMeasurementCache:k}))}})]})]})})},My=Object(f.a)(Fy),Wy=function(e){var t=e.data,n=e.selectedCoin,r=e.handleDeleteEntry,i=e.errorMessage,o=e.setErrorMessage,c=e.deleteDialog,s=e.setDeleteDialog,d=My(),u=Object(a.useState)(),m=Object(l.a)(u,2),h=m[0],p=m[1],b=[{name:"address",header:Object(qe.jsx)(at,{className:d.white,children:"Addresses"}),width:800,textAlign:"left",size:"sm",view:function(e){return Object(qe.jsx)("div",{className:d.addressRow,children:Object(qe.jsx)(If,{children:A.a(["address"],e)})})}},{name:"deleteButton",header:Object(qe.jsx)(at,{className:d.white,children:"Delete"}),width:130,textAlign:"center",size:"sm",view:function(e){return Object(qe.jsx)(ta,{className:d.deleteButton,onClick:function(){s(!0),p(e)},children:Object(qe.jsx)(Oh,{})})}}],f=n?t[n.code]:t[Vc.a(t)[0]];return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(Ay,{data:f,elements:b,emptyText:"No blacklisted addresses so far",name:"blacklistTable"}),Object(qe.jsx)(_m,{open:c,onDismissed:function(){s(!1),o(null)},onConfirmed:function(){o(null),r(A.a(["cryptoCode"],h),A.a(["address"],h))},errorMessage:i})]})},zy=Object(f.a)(Fy),qy=Py.a((function(e){return e.cryptoCode})),$y=x()(Nv||(Nv=Object(c.a)(["\n mutation DeleteBlacklistRow($cryptoCode: String!, $address: String!) {\n deleteBlacklistRow(cryptoCode: $cryptoCode, address: $address) {\n cryptoCode\n address\n }\n }\n"]))),Hy=x()(Sv||(Sv=Object(c.a)(["\n query getBlacklistData {\n blacklist {\n cryptoCode\n address\n }\n cryptoCurrencies {\n display\n code\n }\n }\n"]))),Vy=x()(Iv||(Iv=Object(c.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),Uy=x()(Lv||(Lv=Object(c.a)(["\n query getData {\n config\n }\n"]))),Gy=x()(Pv||(Pv=Object(c.a)(["\n mutation InsertBlacklistRow($cryptoCode: String!, $address: String!) {\n insertBlacklistRow(cryptoCode: $cryptoCode, address: $address) {\n cryptoCode\n address\n }\n }\n"]))),Xy=function(e){var t=e.onConfirmed,n=e.onDissmised,a=e.open,r=e.props,i=zy();return Object(qe.jsxs)(cn.a,Object(s.a)(Object(s.a)({open:a,"aria-labelledby":"form-dialog-title",PaperProps:{style:{borderRadius:8,minWidth:656,bottom:125,right:7}}},r),{},{children:[Object(qe.jsx)("div",{className:i.closeButton,children:Object(qe.jsx)(ta,{size:16,"aria-label":"close",onClick:n,children:Object(qe.jsx)($i,{})})}),Object(qe.jsx)(Ge,{className:i.dialogTitle,children:"Are you sure you want to enable this?"}),Object(qe.jsxs)(sn.a,{className:i.dialogContent,children:[Object(qe.jsx)(Je,{children:"This mode means that only paper wallets will be printed for users, and they won't be permitted to scan an address from their own wallet."}),Object(qe.jsx)(Je,{children:"This mode is only useful for countries like Switzerland which mandates such a feature.\n"}),Object(qe.jsx)(Ye,{children:"Don't enable this if you want users to be able to scan an address of their choosing."})]}),Object(qe.jsxs)(Um.a,{className:i.dialogActions,children:[Object(qe.jsx)(An,{backgroundColor:"grey",className:i.cancelButton,onClick:function(){return n()},children:"Cancel"}),Object(qe.jsx)(An,{onClick:function(){return t(!0)},children:"Confirm"})]})]}))},_y=function(){var e,t,n=Object(u.c)(Hy).data,r=Object(u.c)(Uy).data,i=Object(a.useState)(!1),o=Object(l.a)(i,2),c=o[0],s=o[1],d=Object(a.useState)({code:"BTC",display:"Bitcoin"}),m=Object(l.a)(d,2),p=m[0],b=m[1],f=Object(a.useState)(null),j=Object(l.a)(f,2),g=j[0],O=j[1],x=Object(a.useState)(!1),v=Object(l.a)(x,2),y=v[0],w=v[1],C=Object(a.useState)(!1),k=Object(l.a)(C,2),E=k[0],N=k[1],S=Object(u.b)($y,{onError:function(e){var t=e.message;O(null!==t&&void 0!==t?t:"Error while deleting row")},onCompleted:function(){return w(!1)},refetchQueries:function(){return["getBlacklistData"]}}),I=Object(l.a)(S,1)[0],L=Object(u.b)(Gy,{onError:function(){return console.log("Error while adding row")},refetchQueries:function(){return["getBlacklistData"]}}),P=Object(l.a)(L,1)[0],F=Object(u.b)(Vy,{refetchQueries:function(){return["getData"]}}),T=Object(l.a)(F,1)[0],R=zy(),B=null!==(e=A.a(["blacklist"])(n))&&void 0!==e?e:[],M=null!==(t=A.a(["cryptoCurrencies"],n))&&void 0!==t?t:[],z=qy(B),q=(null===r||void 0===r?void 0:r.config)&&ds("compliance")(r.config),$=!!(null===q||void 0===q?void 0:q.rejectAddressReuse),H=!!(null===q||void 0===q?void 0:q.enablePaperWalletOnly),V=function(e){var t=us("compliance")(e);return T({variables:{config:t}})},U=function(e,t){try{return!D.a(Ff.utils.parseUrl(e,"main",t))}catch(n){return!1}},G=function(){var e=Object(Al.a)(Bl.a.mark((function e(t,n){var a,r;return Bl.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(O(null),U(t,n)){e.next=4;break}return O("Invalid address"),e.abrupt("return");case 4:return e.next=6,P({variables:{cryptoCode:t,address:n}});case 6:if((a=e.sent).errors){e.next=9;break}return e.abrupt("return",s(!1));case 9:r=a.errors.some((function(e){return e.message.includes("duplicate")})),O(r?"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(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(Xy,{open:E,onConfirmed:function(e){V({enablePaperWalletOnly:e}),N(!1)},onDissmised:function(){N(!1)}}),Object(qe.jsx)(cl,{title:"Blacklisted addresses",children:Object(qe.jsx)(nl.a,{display:"flex",justifyContent:"flex-end",children:Object(qe.jsx)(oa,{color:"primary",onClick:function(){return s(!0)},children:"Blacklist new addresses"})})}),Object(qe.jsxs)(h.a,{container:!0,className:R.grid,children:[Object(qe.jsx)(Ii,{data:M,isSelected:W.a("code",p.code),displayName:function(e){return e.display},onClick:function(e){b({code:e.code,display:e.display})}}),Object(qe.jsxs)("div",{className:R.content,children:[Object(qe.jsxs)(nl.a,{display:"flex",justifyContent:"space-between",mb:3,children:[Object(qe.jsxs)(_e,{noMargin:!0,className:R.subtitle,children:[p.display?"".concat(p.display," blacklisted addresses"):""," "]}),Object(qe.jsxs)(nl.a,{display:"flex",alignItems:"center",justifyContent:"end",mr:"-140px",children:[Object(qe.jsx)(Ke,{children:"Enable paper wallet (only)"}),Object(qe.jsx)(Lr,{checked:H,onChange:function(e){return H?V({enablePaperWalletOnly:e.target.checked}):N(!0)},value:H}),Object(qe.jsx)(rt,{children:H?"On":"Off"}),Object(qe.jsx)(Np,{width:304,children:Object(qe.jsx)(Ke,{children:'The "Enable paper wallet (only)" option means that only paper wallets will be printed for users, and they won\'t be permitted to scan an address from their own wallet.'})})]}),Object(qe.jsxs)(nl.a,{display:"flex",alignItems:"center",justifyContent:"flex-end",mr:"-5px",children:[Object(qe.jsx)(Ke,{children:"Reject reused addresses"}),Object(qe.jsx)(Lr,{checked:$,onChange:function(e){V({rejectAddressReuse:e.target.checked})},value:$}),Object(qe.jsx)(rt,{children:$?"On":"Off"}),Object(qe.jsx)(Np,{width:304,children:Object(qe.jsx)(Ke,{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(qe.jsx)(Wy,{data:z,selectedCoin:p,handleDeleteEntry:function(e,t){I({variables:{cryptoCode:e,address:t}})},errorMessage:g,setErrorMessage:O,deleteDialog:y,setDeleteDialog:w})]})]}),c&&Object(qe.jsx)(Ty,{onClose:function(){O(null),s(!1)},errorMsg:g,selectedCoin:p,addToBlacklist:G})]})},Zy={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:Z,marginBottom:12,marginTop:30,textAlign:"center"},titleDecorator:{verticalAlign:"bottom",marginRight:12,width:24,height:26}},Ky=Object(f.a)(Zy),Qy=function(e){var t=e.name,n=e.onContinue,a=Ky();return Object(qe.jsxs)("div",{className:a.modalContent,children:[Object(qe.jsxs)("div",{className:a.innerContent,children:[Object(qe.jsxs)(Ue,{className:a.title,children:[Object(qe.jsx)(zc,{className:a.titleDecorator}),Object(qe.jsx)("span",{children:"Enable cash-out"})]}),Object(qe.jsx)(Ye,{className:a.subtitle,children:t}),Object(qe.jsxs)(Ke,{children:["You are about to activate cash-out functionality on your ",t," ","machine which will allow your customers to sell crypto to you."]}),Object(qe.jsx)(Ke,{children:"In order to activate cash-out for this machine, please enter the denominations for the machine."})]}),Object(qe.jsx)(An,{className:a.button,onClick:n,children:"Start configuration"})]})},Yy=n.p+"static/media/cashout-cassette-1.fac6c691.svg",Jy=n.p+"static/media/cashout-cassette-2.34a98cfa.svg",ew={title:{margin:[[0,0,12,0]]},titleDiv:{paddingBottom:32},subtitle:{margin:[[32,0,21,0]]},edit:{margin:[[0,0,0,0]]},error:{color:he},bill:{width:131,display:"flex",alignItems:"center",justifyContent:"end"},billInput:{width:"100%"},suffix:{paddingLeft:16},submit:{alignSelf:"flex-end"},picker:{width:150},header:{display:"flex"},column:{display:"flex",flexGrow:2,flexDirection:"column",paddingBottom:32,justifyContent:"space-between"},step:{flex:1},stepImage:{position:"relative",top:-20,right:14},disclaimerIcon:{float:"left",margin:[[2,16,48,0]]}},tw=Object(f.a)(ew),nw=function(e){var t=e.name,n=e.step,a=e.schema,r=e.error,i=e.isLastStep,o=e.onContinue,l=e.steps,c=e.fiatCurrency,s=e.options,d=e.numberOfCassettes,u=tw(),m=i?"Finish":"Next";return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsxs)("div",{className:u.titleDiv,children:[Object(qe.jsx)(Ye,{className:u.title,children:t}),Object(qe.jsx)(bp,{steps:l.length+1,currentStep:n})]}),!i&&Object(qe.jsx)(mn.e,{validateOnBlur:!1,validateOnChange:!1,onSubmit:o,initialValues:{cassette1:"",cassette2:"",cassette3:"",cassette4:""},enableReinitialize:!0,validationSchema:a,children:Object(qe.jsxs)(mn.d,{className:u.column,children:[Object(qe.jsxs)("div",{className:u.header,children:[l.map((function(e,t){var a=e.type,r=e.display,i=e.component;return 1+t===n&&Object(qe.jsxs)("div",{className:u.step,children:[Object(qe.jsxs)(_e,{className:u.edit,children:["Edit ",r]}),Object(qe.jsx)(at,{children:"Choose bill denomination"}),Object(qe.jsxs)("div",{className:u.bill,children:[Object(qe.jsx)(mn.b,{className:u.billInput,type:"text",size:"lg",autoFocus:1+t===n,component:(null===s||void 0===s?void 0:s.length)>0?i:li,fullWidth:!0,decimalPlaces:0,name:a,options:s,valueProp:"code",labelProp:"display"}),Object(qe.jsx)(Qe,{noMargin:!0,className:u.suffix,children:c})]})]},t)})),Object(qe.jsx)("img",{className:u.stepImage,alt:"cassette",width:"148",height:"205",src:{2:{1:Yy,2:Jy},3:{1:Pp,2:Fp,3:Dp},4:{1:Tp,2:Rp,3:Bp,4:Ap}}[d][n]})]}),Object(qe.jsx)(An,{className:u.submit,type:"submit",children:m})]})}),i&&Object(qe.jsxs)("div",{className:u.column,children:[Object(qe.jsxs)("div",{children:[Object(qe.jsx)(Ye,{className:u.title,children:"Cash Cassette Bill Count"}),Object(qe.jsxs)(Ke,{children:[Object(qe.jsx)(ir,{className:u.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 cassette bill count for this machine on your Cash Boxes & Cassettes tab under Maintenance."]}),Object(qe.jsx)(Ye,{className:u.title,children:"Default Commissions"}),Object(qe.jsxs)(Ke,{children:[Object(qe.jsx)(ir,{className:u.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."]})]}),r&&Object(qe.jsx)(il,{children:"Failed to save"}),Object(qe.jsx)(An,{className:u.submit,onClick:function(){return o()},children:m})]})]})},aw={2:{machine:300,cassette:225,zeroConf:200},3:{machine:210,cassette:180,zeroConf:200},4:{machine:200,cassette:150,zeroConf:150}},rw=xn.f().shape({cassette1:xn.e().label("Cassette 1").required().min(1).max(Qh),cassette2:xn.e().label("Cassette 2").required().min(1).max(Qh),cassette3:xn.e().label("Cassette 3").min(1).max(Qh).nullable().transform(Ur),cassette4:xn.e().label("Cassette 4").min(1).max(Qh).nullable().transform(Ur)}),iw=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2?arguments[2]:void 0,r=R.a("fiatCurrency")(n),i=Math.max.apply(Math,Object(d.a)(T.a((function(e){return e.numberOfCassettes}),e)).concat([0])),o=qg(n,zg),l=(null===o||void 0===o?void 0:o.length)>0?{options:o,labelProp:"display",valueProp:"code",className:a.autoComplete}:{decimalPlaces:0},c=[{name:"id",header:"Machine",width:null===(t=aw[i])||void 0===t?void 0:t.machine,view:function(t){return e.find((function(e){return e.deviceId===t})).name},size:"sm",editable:!1}];return am.a(rm.a(im.a,i),(function(t){var n;return c.push({name:"cassette".concat(t),header:"Cassette ".concat(t),size:"sm",stripe:!0,textAlign:"right",width:null===(n=aw[i])||void 0===n?void 0:n.cassette,suffix:r,bold:Va,view:function(e){return e},input:(null===o||void 0===o?void 0:o.length)>0?Br:li,inputProps:l,doubleHeader:"Denominations",isHidden:function(n){return t>e.find((function(e){return e.deviceId===n.id})).numberOfCassettes}}),om.a(1,t)}),1),c},ow=function(e){var t=e.machine,n=e.locale,r=e.onClose,i=e.save,o=e.error,c=t.numberOfCassettes+1,s=Object(a.useState)({step:0,config:{active:!0}}),d=Object(l.a)(s,2),u=d[0],m=u.step,h=u.config,p=d[1],b=qg(n,zg),f=m===c,j=function(){var e=Object(Al.a)(Bl.a.mark((function e(n){var a;return Bl.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!f){e.next=2;break}return e.abrupt("return",i(us(t.deviceId,rw.cast(h,{assert:!1}))));case 2:a=Gn.a(h,n),p({step:m+1,config:a});case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),g=T.a((function(e){return{type:"cassette".concat(e),display:"Cassette ".concat(e),component:Br,inputProps:{options:b,labelProp:"display",valueProp:"code"}}}),Du.a(1,t.numberOfCassettes+1));return Object(qe.jsxs)(Kh,{title:0===m?null:"Enable cash-out",handleClose:r,width:554,height:520,open:!0,children:[0===m&&Object(qe.jsx)(Qy,{name:t.name,onContinue:function(){return j()}}),0!==m&&Object(qe.jsx)(nw,{step:m,name:t.name,numberOfCassettes:t.numberOfCassettes,error:o,isLastStep:f,steps:g,fiatCurrency:n.fiatCurrency,options:b,schema:xn.f().shape({cassette1:xn.e().required(),cassette2:t.numberOfCassettes>1&&m>=2?xn.e().required():xn.e().transform(Ur).nullable(),cassette3:t.numberOfCassettes>2&&m>=3?xn.e().required():xn.e().transform(Ur).nullable(),cassette4:t.numberOfCassettes>3&&m>=4?xn.e().required():xn.e().transform(Ur).nullable()}),onContinue:j})]})},lw=Object(f.a)({fudgeFactor:{display:"flex",alignItems:"center"},switchLabel:{margin:6,width:24},autoComplete:{width:"100%"}}),cw=x()(Fv||(Fv=Object(c.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),sw=x()(Dv||(Dv=Object(c.a)(["\n query getData {\n machines {\n name\n deviceId\n cashbox\n cassette1\n cassette2\n cassette3\n cassette4\n numberOfCassettes\n }\n config\n }\n"]))),dw=function(e){var t,n,r=e.name,i=lw(),o=Object(a.useState)(!1),c=Object(l.a)(o,2),s=c[0],d=c[1],m=Object(u.c)(sw),h=m.data,p=m.loading,b=Object(u.b)(cw,{onCompleted:function(){return d(!1)},refetchQueries:function(){return["getData"]}}),f=Object(l.a)(b,2),j=f[0],g=f[1].error,O=function(e,t){var n=us(r)(e);return j({variables:{config:n,accounts:t}})},x=(null===h||void 0===h?void 0:h.config)&&ds(r)(h.config),v=null!==(t=null===x||void 0===x?void 0:x.fudgeFactorActive)&&void 0!==t&&t,y=(null===h||void 0===h?void 0:h.config)&&ds("locale")(h.config),w=null!==(n=null===h||void 0===h?void 0:h.machines)&&void 0!==n?n:[];return!p&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(cl,{title:"Cash-out",children:Object(qe.jsxs)("div",{className:i.fudgeFactor,children:[Object(qe.jsx)(Ke,{children:"Transaction fudge factor"}),Object(qe.jsx)(Lr,{checked:v,onChange:function(e){O({fudgeFactorActive:e.target.checked})},value:v}),Object(qe.jsx)(rt,{className:i.switchLabel,children:v?"On":"Off"}),Object(qe.jsxs)(Np,{width:304,children:[Object(qe.jsx)(Ke,{children:"Automatically accept customer deposits as complete if their received amount is 100 crypto atoms or less."}),Object(qe.jsx)(Ke,{children:"(Crypto atoms are the smallest unit in each cryptocurrency. E.g., satoshis in Bitcoin, or wei in Ethereum.)"})]})]})}),Object(qe.jsx)(Xh,{namespaces:T.a(A.a(["deviceId"]))(w),data:x,stripeWhen:function(e){return 1===P.a(bn.a,Vc.a)(e)},enableEdit:!0,editWidth:134,enableToggle:!0,toggleWidth:109,onToggle:function(e){var t=ds(e)(x);if(!rw.isValidSync(t))return d(e);O(us(e,{active:!(null===t||void 0===t?void 0:t.active)}))},save:O,error:null===g||void 0===g?void 0:g.message,validationSchema:rw,disableRowEdit:P.a(F.a,A.a(["active"])),elements:iw(w,y,i)}),Wa.a(w)&&Object(qe.jsx)(Ns,{message:"No machines so far"}),s&&Object(qe.jsx)(ow,{machine:Aa.a(W.a("deviceId",s))(w),onClose:function(){return d(!1)},save:O,error:null===g||void 0===g?void 0:g.message,locale:y})]})},uw=n(1094);function mw(){return(mw=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function hw(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var pw=a.createElement("desc",null,"Created with Sketch."),bw=a.createElement("g",{id:"icon/sf-small/listing/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("line",{x1:0,y1:1,x2:20,y2:1,id:"Path-4",stroke:"#FFFFFF",strokeWidth:2}),a.createElement("line",{x1:0,y1:7,x2:9,y2:7,id:"Path-4-Copy",stroke:"#FFFFFF",strokeWidth:2}),a.createElement("line",{x1:0,y1:13,x2:20,y2:13,id:"Path-4-Copy-2",stroke:"#FFFFFF",strokeWidth:2}),a.createElement("line",{x1:0,y1:19,x2:12,y2:19,id:"Path-4-Copy-3",stroke:"#FFFFFF",strokeWidth:2}));function fw(e,t){var n=e.title,r=e.titleId,i=hw(e,["title","titleId"]);return a.createElement("svg",mw({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":r},i),n?a.createElement("title",{id:r},n):null,pw,bw)}var jw=a.forwardRef(fw);n.p;function gw(){return(gw=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Ow(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var xw=a.createElement("desc",null,"Created with Sketch."),vw=a.createElement("g",{id:"icon/sf-small/listing/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("line",{x1:0,y1:1,x2:20,y2:1,id:"Path-4",stroke:"#1B2559",strokeWidth:2}),a.createElement("line",{x1:0,y1:7,x2:9,y2:7,id:"Path-4-Copy",stroke:"#1B2559",strokeWidth:2}),a.createElement("line",{x1:0,y1:13,x2:20,y2:13,id:"Path-4-Copy-2",stroke:"#1B2559",strokeWidth:2}),a.createElement("line",{x1:0,y1:19,x2:12,y2:19,id:"Path-4-Copy-3",stroke:"#1B2559",strokeWidth:2}));function yw(e,t){var n=e.title,r=e.titleId,i=Ow(e,["title","titleId"]);return a.createElement("svg",gw({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":r},i),n?a.createElement("title",{id:r},n):null,xw,vw)}var ww=a.forwardRef(yw);n.p;function Cw(){return(Cw=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function kw(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Ew=a.createElement("rect",{width:12,height:12,rx:3,ry:3,fill:"#44e188"});function Nw(e,t){var n=e.title,r=e.titleId,i=kw(e,["title","titleId"]);return a.createElement("svg",Cw({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":r},i),n?a.createElement("title",{id:r},n):null,Ew)}var Sw,Iw,Lw=a.forwardRef(Nw),Pw=(n.p,n(1091)),Fw=n(1137),Dw=Object(a.memo)((function(e){var t,n=e.config,r=e.locale,i=e.currency,o=e.data,c=e.error,s=e.save,d=e.saveOverrides,u=Object(a.useState)(!1),m=Object(l.a)(u,2),h=m[0],p=m[1],b=Object(a.useState)(!1),f=Object(l.a)(b,2),j=f[0],g=f[1],O=n&&!Wa.a(n)?n:nO,x=null!==(t=null===O||void 0===O?void 0:O.overrides)&&void 0!==t?t:[],v=um.a([Pw.a(rO),Pw.a(R.a("machine"))])(x);return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(AO,{children:Object(qe.jsx)(Gh,{error:null===c||void 0===c?void 0:c.message,title:"Default setup",rowSize:"lg",titleLg:!0,name:"commissions",enableEdit:!0,initialValues:O,save:s,validationSchema:eO(r),data:Fw.a(O),elements:Kg(i),setEditing:function(e,t){return p(t)},forceDisable:j})}),Object(qe.jsx)(AO,{children:Object(qe.jsx)(Gh,{error:null===c||void 0===c?void 0:c.message,title:"Overrides",titleLg:!0,name:"overrides",enableDelete:!0,enableEdit:!0,enableCreate:!0,groupBy:rO,initialValues:aO,save:d,validationSchema:tO(v,o,r),data:v,elements:Qg(o,i),setEditing:function(e,t){return g(t)},forceDisable:h})})]})})),Tw=n(1092),Rw=n(1093),Bw=n(1117),Aw={code:"SHOW_ALL",display:"Show all"},Mw=[{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"}],Ww=Object(f.a)({headerLine:{display:"flex",justifyContent:"",marginBottom:24},select:{marginRight:24},tableWrapper:{flex:1,display:"block",overflowY:"auto",width:"100%",maxHeight:"70vh"}}),zw=function(e,t){return{code:e,display:t||e}},qw=Object(a.memo)((function(e){var t,n=e.config,r=e.localeConfig,i=e.currency,o=e.data,c=e.error,s=e.saveOverrides,d=Ww(),u=Object(a.useState)(Aw),m=Object(l.a)(u,2),h=m[0],p=m[1],b=Object(a.useState)(Aw),f=Object(l.a)(b,2),j=f[0],g=f[1],O=Object(a.useState)(Mw[0]),x=Object(l.a)(O,2),v=x[0],y=x[1],w=null!==(t=R.a("cryptoCurrencies",r))&&void 0!==t?t:[],C=T.a(zw)(w),k=Tw.a(R.a("display"),T.a((function(e){return zw(R.a("deviceId",e),R.a("name",e))}))(R.a("machines",o))),E=Bw.a(T.a((function(e){var t,n=null===(t=R.a("overrides",r))||void 0===t?void 0:t.find(W.a("machine",e)),a=n?R.a("cryptoCurrencies",n):w;return Rw.a([e],a)}))(k.map(R.a("code")))),N=T.a((function(e){var t=Object(l.a)(e,2),a=t[0];return function(e,t,n){var a,r=null!==(a=R.a("overrides",n))&&void 0!==a?a:[];if(!r&&Wa.a(r))return iO(e,t,!0,n);var i=Aa.a((function(n){return n.machine===t&&Bg.includes(e)(n.cryptoCurrencies)}))(r);if(void 0!==i)return iO(e,t,!1,i);var o=Aa.a((function(e){return e.machine===t&&Bg.includes("ALL_COINS")(e.cryptoCurrencies)}))(r);if(void 0!==o)return iO(e,t,!1,o);var l=Aa.a((function(t){return"ALL_MACHINES"===t.machine&&Bg.includes(e)(t.cryptoCurrencies)}))(r);return void 0!==l?iO(e,t,!1,l):iO(e,t,!0,n)}(t[1],a,n)}))(E),S=P.a(function(e){switch(e){case Mw[0]:return Tw.a(Aa.a(W.a("code",R.a("machine"))));case Mw[1]:return Tw.a(A.a(["cryptoCurrencies",0]));default:return Tw.a(R.a(e.code))}}(v),function(e,t){return P.a(M.a((function(e){return t===Aw|t.code===e.machine})),M.a((function(t){return e===Aw|e.code===t.cryptoCurrencies[0]})))}(j,h))(N);return Object(qe.jsxs)("div",{children:[Object(qe.jsxs)("div",{className:d.headerLine,children:[Object(qe.jsx)(lh,{className:d.select,onSelectedItemChange:p,label:"Machines",default:Aw,items:[Aw].concat(k),selectedItem:h}),Object(qe.jsx)(lh,{className:d.select,onSelectedItemChange:g,label:"Cryptocurrency",default:Aw,items:[Aw].concat(C),selectedItem:j}),Object(qe.jsx)(lh,{onSelectedItemChange:y,label:"Sort by",default:Mw[0],items:Mw,selectedItem:v,defaultAsFilter:!0})]}),Object(qe.jsx)("div",{className:d.tableWrapper,children:Object(qe.jsx)(Gh,{error:null===c||void 0===c?void 0:c.message,name:"comissionsList",enableEdit:!0,save:s,initialValues:aO,validationSchema:oO(r),data:S,elements:cO(o,i),orderedBy:v})})]})})),$w=Object(f.a)({listViewButton:{marginLeft:4}}),Hw=x()(Sw||(Sw=Object(c.a)(["\n query getData {\n config\n cryptoCurrencies {\n code\n display\n }\n machines {\n name\n deviceId\n }\n }\n"]))),Vw=x()(Iw||(Iw=Object(c.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),Uw=function(e){var t,n=e.name,r=$w(),i=Object(a.useState)(!1),o=Object(l.a)(i,2),c=o[0],s=o[1],d=Object(a.useState)(null),m=Object(l.a)(d,2),h=m[0],p=m[1],b=Object(u.c)(Hw),f=b.data,j=b.loading,g=Object(u.b)(Vw,{refetchQueries:function(){return["getData"]},onError:function(e){return p(e)}}),O=Object(l.a)(g,1)[0],x=(null===f||void 0===f?void 0:f.config)&&ds(n)(f.config),v=(null===f||void 0===f?void 0:f.config)&&ds(ts)(f.config),y=R.a("fiatCurrency")(v),w=R.a("overrides")(x),C=c?[{label:"Override value",icon:Object(qe.jsx)(Lw,{})}]:[];return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(cl,{title:"Commissions",labels:C,buttons:[{text:"List view",icon:ww,inverseIcon:jw,toggle:s}],iconClassName:r.listViewButton}),!c&&!j&&Object(qe.jsx)(Dw,{config:x,locale:v,currency:y,data:f,error:h,save:function(e){var t=us(n)(e.commissions[0]);return O({variables:{config:t}})},saveOverrides:function(e){var t=us(n)(e);return p(null),O({variables:{config:t}})},classes:r}),c&&!j&&Object(qe.jsx)(qw,{config:x,localeConfig:v,currency:y,data:f,error:h,saveOverrides:(t=w,function(e,n){var a,r=A.a(["cryptoCurrencies",0],n),i=qa.a("machine",n),o=M.a(qr.a(i,(function(e){return!qa.a("cryptoCurrencies",n,e)}))),l=(a=r,function(e){return ex.a(e,{cryptoCurrencies:uw.a([a],e.cryptoCurrencies)})}),c=T.a(l)(o(t)).concat(M.a((function(e){return!i(e)}),t)),s={commissions_overrides:sm.a(n,c)};return O({variables:{config:s}})})})]})},Gw=n(1097);function Xw(){return(Xw=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function _w(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Zw=a.createElement("desc",null,"Created with Sketch."),Kw=a.createElement("g",{id:"icon/button/authorize/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("circle",{id:"Oval",stroke:"#FFFFFF",cx:6,cy:6,r:5}),a.createElement("polyline",{id:"Stroke-13",stroke:"#FFFFFF",strokeLinecap:"round",strokeLinejoin:"round",points:"4 6.66666667 5 8 8 4"}));function Qw(e,t){var n=e.title,r=e.titleId,i=_w(e,["title","titleId"]);return a.createElement("svg",Xw({viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,Zw,Kw)}var Yw=a.forwardRef(Qw);n.p;function Jw(){return(Jw=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function eC(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var tC=a.createElement("desc",null,"Created with Sketch."),nC=a.createElement("g",{id:"icon/button/authorize/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"Group-9",stroke:"#1B2559"},a.createElement("circle",{id:"Oval",cx:6,cy:6,r:5})),a.createElement("polyline",{id:"Stroke-13",stroke:"#1B2559",strokeLinecap:"round",strokeLinejoin:"round",points:"4 6.66666667 5 8 8 4"}));function aC(e,t){var n=e.title,r=e.titleId,i=eC(e,["title","titleId"]);return a.createElement("svg",Jw({viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,tC,nC)}var rC=a.forwardRef(aC),iC=(n.p,{label1:{display:"flex",marginBottom:2,marginTop:"auto",width:85},label1Pending:{color:$},label1Rejected:{color:Q},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:K,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"}}),oC=(Object(f.a)(iC),"automatic"),lC="verified",cC="blocked";function sC(){return(sC=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function dC(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var uC=a.createElement("desc",null,"Created with Sketch."),mC=a.createElement("g",{id:"icon/button/block/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"Group-5",stroke:"#FFFFFF"},a.createElement("circle",{id:"Oval",cx:6,cy:6,r:5}),a.createElement("line",{x1:9,y1:3,x2:3,y2:9,id:"Stroke-3"})));function hC(e,t){var n=e.title,r=e.titleId,i=dC(e,["title","titleId"]);return a.createElement("svg",sC({viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,uC,mC)}var pC=a.forwardRef(hC);n.p;function bC(){return(bC=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function fC(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var jC=a.createElement("desc",null,"Created with Sketch."),gC=a.createElement("g",{id:"icon/button/block/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"Group-5",stroke:"#1B2559"},a.createElement("circle",{id:"Oval",cx:6,cy:6,r:5}),a.createElement("line",{x1:9,y1:3,x2:3,y2:9,id:"Stroke-3"})));function OC(e,t){var n=e.title,r=e.titleId,i=fC(e,["title","titleId"]);return a.createElement("svg",bC({viewBox:"0 0 12 12",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,jC,gC)}var xC=a.forwardRef(OC);n.p;function vC(){return(vC=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function yC(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var wC=a.createElement("g",{id:"icon/button/data/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"Data-icon---small",transform:"translate(0.500000, 0.500000)",stroke:"#FFFFFF"},a.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"}),a.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"}),a.createElement("ellipse",{id:"oval-1",cx:5.5,cy:2.44444444,rx:5.5,ry:2.44444444})),a.createElement("g",{id:"Group-9",transform:"translate(0.000000, 4.000000)"},a.createElement("circle",{id:"Oval",stroke:"#FFFFFF",fill:"#5F668A",cx:4,cy:4,r:3.5}),a.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 CC(e,t){var n=e.title,r=e.titleId,i=yC(e,["title","titleId"]);return a.createElement("svg",vC({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":r},i),n?a.createElement("title",{id:r},n):null,wC)}var kC=a.forwardRef(CC);n.p;function EC(){return(EC=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function NC(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var SC=a.createElement("g",{id:"icon/button/data/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"Data-icon---small",transform:"translate(1.500000, 0.500000)",stroke:"#1B2559"},a.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"}),a.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"}),a.createElement("ellipse",{id:"oval-1",cx:5,cy:2,rx:5,ry:2})),a.createElement("g",{id:"Group-9",transform:"translate(0.000000, 4.000000)"},a.createElement("circle",{id:"Oval",stroke:"#1B2559",fill:"#EBEFFF",cx:4,cy:4,r:3.5}),a.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 IC(e,t){var n=e.title,r=e.titleId,i=NC(e,["title","titleId"]);return a.createElement("svg",EC({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":r},i),n?a.createElement("title",{id:r},n):null,SC)}var LC=a.forwardRef(IC),PC=(n.p,n(1098));function FC(){return(FC=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function DC(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var TC=a.createElement("desc",null,"Created with Sketch."),RC=a.createElement("g",{id:"icon/sf-small/search/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.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}),a.createElement("line",{x1:13.7035238,y1:13.7046667,x2:19.4844762,y2:19.485619,id:"Stroke-3",stroke:"#FFFFFF",strokeWidth:2,strokeLinecap:"round"}));function BC(e,t){var n=e.title,r=e.titleId,i=DC(e,["title","titleId"]);return a.createElement("svg",FC({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":r},i),n?a.createElement("title",{id:r},n):null,TC,RC)}var AC=a.forwardRef(BC);n.p;function MC(){return(MC=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function WC(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var zC=a.createElement("g",{id:"icon/search/dark02",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"Group",transform:"translate(1.000000, 1.000000)",stroke:"#1B2559",strokeWidth:2},a.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"}),a.createElement("line",{x1:12.3331714,y1:12.3342,x2:17.5360286,y2:17.5370571,id:"Stroke-3",strokeLinecap:"round"})));function qC(e,t){var n=e.title,r=e.titleId,i=WC(e,["title","titleId"]);return a.createElement("svg",MC({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":r},i),void 0===n?a.createElement("title",{id:r},"icon/search/dark02"):n?a.createElement("title",{id:r},n):null,zC)}var $C=a.forwardRef(qC),HC=(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]]}})),VC=Object(a.memo)((function(e){var t=e.className,n=e.width,r=e.height,i=e.popupWidth,o=e.popupHeight,c=e.src,s=HC({width:n,height:r,popupWidth:i,popupHeight:o}),d=Object(a.useState)(null),u=Object(l.a)(d,2),m=u[0],h=u[1],p=Boolean(m),b=function(e){var t=e.className;return Object(qe.jsx)("img",{className:I()(t),src:c,alt:""})};return Object(qe.jsx)(E.a,{onClickAway:function(){h(null)},children:Object(qe.jsxs)("div",{className:I()(s.row,t),children:[Object(qe.jsx)(b,{className:s.image}),Object(qe.jsx)(Vn,{Icon:$C,InverseIcon:AC,className:s.button,onClick:function(e){h(m?null:e.currentTarget)}}),Object(qe.jsx)(Xn,{open:p,anchorEl:m,placement:"top",children:Object(qe.jsx)("div",{className:s.popoverContent,children:Object(qe.jsx)(b,{className:s.popupImage})})})]})})}));function UC(){return(UC=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function GC(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var XC=a.createElement("g",{id:"icon/ID/card/new/comet",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("polygon",{id:"Stroke-1",stroke:"#5F668A",strokeWidth:1.6,points:"1 17 23 17 23 1 1 1"}),a.createElement("line",{x1:12.7857143,y1:5,x2:19.8571429,y2:5,id:"Stroke-3",stroke:"#5F668A",strokeWidth:1.6}),a.createElement("line",{x1:12.7857143,y1:8.2,x2:19.8571429,y2:8.2,id:"Stroke-4",stroke:"#5F668A",strokeWidth:1.6}),a.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 _C(e,t){var n=e.title,r=e.titleId,i=GC(e,["title","titleId"]);return a.createElement("svg",UC({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":r},i),void 0===n?a.createElement("title",{id:r},"icon/ID/card/new/comet"):n?a.createElement("title",{id:r},n):null,XC)}var ZC=a.forwardRef(_C);n.p;function KC(){return(KC=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function QC(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var YC=a.createElement("g",{id:"icon/ID/phone/new/comet",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.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 JC(e,t){var n=e.title,r=e.titleId,i=QC(e,["title","titleId"]);return a.createElement("svg",KC({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":r},i),void 0===n?a.createElement("title",{id:r},"icon/ID/phone/new/comet"):n?a.createElement("title",{id:r},n):null,YC)}var ek=a.forwardRef(JC);n.p;function tk(){return(tk=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function nk(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var ak=a.createElement("desc",null,"Created with Sketch."),rk=a.createElement("g",{id:"icon/crossed-camera",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"crossed-camera"},a.createElement("g",{id:"Group-2"},a.createElement("g",{id:"icon/ID/cam/zodiac",transform:"translate(0.000000, 3.657143)",fill:"#1B2559",fillRule:"nonzero"},a.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"})),a.createElement("line",{x1:32,y1:0,x2:0,y2:32,id:"Line",stroke:"#FF584A",strokeWidth:2,strokeLinecap:"square"}))));function ik(e,t){var n=e.title,r=e.titleId,i=nk(e,["title","titleId"]);return a.createElement("svg",tk({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":r},i),n?a.createElement("title",{id:r},n):null,ak,rk)}var ok=a.forwardRef(ik);n.p;function lk(){return(lk=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function ck(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var sk=a.createElement("desc",null,"Created with Sketch."),dk=a.createElement("g",{id:"icon/action/edit/disabled",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.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}),a.createElement("polygon",{id:"Stroke-3",stroke:"#5f668a",strokeWidth:2,points:"6 12 17 1 21 5 10 16 6 16"}));function uk(e,t){var n=e.title,r=e.titleId,i=ck(e,["title","titleId"]);return a.createElement("svg",lk({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":r},i),n?a.createElement("title",{id:r},n):null,sk,dk)}var mk=a.forwardRef(uk);n.p;n.p;n.p;n.p;n.p;var hk={header:{display:"flex",flexDirection:"row",marginBottom:15},title:{marginTop:7,marginRight:24},editIcon:{marginTop:5},cardIcon:{marginTop:7},viewIcons:{marginRight:12},wrapper:{display:"block",overflow:"hidden",whiteSpace:"nowrap"},separator:{color:se,margin:[[8,0,8,150]],position:"relative",display:"inline-block","&:before, &:after":{content:'""',position:"absolute",background:se,top:"50%",width:1e3,height:1},"&:before":{right:"100%",marginRight:15},"&:after":{left:"100%",marginLeft:15}}},pk=n(1095),bk=n(1113),fk=n(572),jk=Object(f.a)({radio:{padding:4,margin:4},radioGroup:{flexDirection:"row"},error:{color:he},specialLabel:{height:40,padding:0,width:250},label:{height:40,padding:0},specialGrid:{display:"grid",gridTemplateColumns:[[182,162,141]]},picker:{width:150},field:{"& > *:last-child":{marginBottom:24}}}),gk="custom",Ok="requirement",xk=function(e,t){var n=e&&t?Object(bk.a)(e,t):null;return n?n.formatInternational():e},vk=function(e){var t,n,a=A.a(["idCardData"])(e);return"".concat(null!==(t=A.a(["firstName"])(a))&&void 0!==t?t:""," ").concat(null!==(n=A.a(["lastName"])(a))&&void 0!==n?n:"").trim()},yk=[{display:"Custom entry",code:"custom"},{display:"Populate existing requirement",code:"requirement"}],wk=[{display:"Text",code:"text"}],Ck=[{display:"ID card image",code:"idCardPhoto"},{display:"ID data",code:"idCardData"},{display:"US SSN",code:"usSsn"},{display:"Customer camera",code:"frontCamera"}],kk=[{label:"Data entry title",name:"title"}],Ek=xn.c((function(e){return"custom"===e.entryType?xn.f().shape({entryType:xn.h().required(),dataType:xn.h().required()}):"requirement"===e.entryType?xn.f().shape({entryType:xn.h().required(),requirement:xn.h().required()}):void 0})),Nk=xn.f().shape({title:xn.h().required(),file:xn.d().required()}),Sk=xn.f().shape({title:xn.h().required(),image:xn.d().required()}),Ik=xn.f().shape({title:xn.h().required(),data:xn.h().required()}),Lk=function(e){var t,n=e.selectedValues,a=e.customInfoRequirementOptions,r=jk(),i=null===n||void 0===n?void 0:n.entryType,o=null===n||void 0===n?void 0:n.dataType,l=null===n||void 0===n?void 0:n.requirement,c="requirement"===i,s=l===gk,u=Wa.a(a)?Ck:(t=Ck,[{display:"Custom information requirement",code:"custom"}].concat(Object(d.a)(t))),m=c?Aa.a(W.a("code",l))(u).display:"",h=c?"Requirement ".concat(m):"Custom ".concat(o," entry"),p=c?Rk[l]:Pk[o],b=c?"idCardPhoto"===l||"frontCamera"===l:"file"===o||"image"===o;return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(nl.a,{display:"flex",alignItems:"center",children:Object(qe.jsx)(_e,{children:h})}),s&&Object(qe.jsx)(Br,{fullWidth:!0,label:"Available requests",className:r.picker,getOptionSelected:qa.a("code"),labelProp:"display",options:a,onChange:function(e,t){}}),Object(qe.jsx)("div",{className:r.field,children:!b&&!s&&p.options.map((function(e){var t=e.label,n=e.name;return Object(qe.jsx)(mn.b,{name:n,label:t,component:di,width:390})}))}),b&&Object(qe.jsx)(UN,{type:c?l:o})]})},Pk={text:{schema:Ik,options:[{label:"Data entry title",name:"title"},{label:"Data entry",name:"data"}],Component:Lk,initialValues:{data:"",title:""},saveType:"customEntry"},file:{schema:Nk,options:kk,Component:Lk,initialValues:{file:null,title:""},saveType:"customEntryUpload"},image:{schema:Sk,options:kk,Component:Lk,initialValues:{image:null,title:""},saveType:"customEntryUpload"}},Fk={schema:Ek,options:yk,Component:function(e){e.customInfoRequirementOptions;var t=jk(),n=Object(mn.f)().values,a=n.entryType===gk,r=n.entryType===Ok;return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(nl.a,{display:"flex",alignItems:"center",children:Object(qe.jsx)(_e,{children:"Type of entry"})}),Object(qe.jsx)(mn.b,{component:ci,name:"entryType",options:yk,labelClassName:t.specialLabel,radioClassName:t.radio,className:I()(t.radioGroup,t.specialGrid)}),a&&Object(qe.jsxs)("div",{children:[Object(qe.jsx)(nl.a,{display:"flex",alignItems:"center",children:Object(qe.jsx)(_e,{children:"Type of data"})}),Object(qe.jsx)(mn.b,{component:ci,name:"dataType",options:wk,labelClassName:t.label,radioClassName:t.radio,className:I()(t.radioGroup,t.specialGrid)})]}),r&&Object(qe.jsxs)("div",{children:[Object(qe.jsx)(nl.a,{display:"flex",alignItems:"center",children:Object(qe.jsx)(_e,{children:"Requirements"})}),Object(qe.jsx)(mn.b,{component:ci,name:"requirement",options:Ck,labelClassName:t.label,radioClassName:t.radio,className:I()(t.radioGroup,t.specialGrid)})]})]})},initialValues:{entryType:""}},Dk={idCardData:[{name:"firstName",label:"First name",component:di,editable:!0},{name:"documentNumber",label:"ID number",component:di,editable:!0},{name:"dateOfBirth",label:"Birthdate",component:di,editable:!0},{name:"gender",label:"Gender",component:di,editable:!0},{name:"lastName",label:"Last name",component:di,editable:!0},{name:"expirationDate",label:"Expiration Date",component:di,editable:!0},{name:"country",label:"Country",component:di,editable:!0}],usSsn:[{name:"usSsn",label:"US SSN",component:di,size:190,editable:!0}],idCardPhoto:[{name:"idCardPhoto"}],frontCamera:[{name:"frontCamera"}]},Tk={idCardData:xn.f().shape({firstName:xn.h().required(),lastName:xn.h().required(),documentNumber:xn.h().required(),dateOfBirth:xn.h().test({test:function(e){return Object(pk.a)(Object(Df.a)(new Date,"yyyy-MM-dd",e))}}).required(),gender:xn.h().required(),country:xn.h().required(),expirationDate:xn.h().test({test:function(e){return Object(pk.a)(Object(Df.a)(new Date,"yyyy-MM-dd",e))}}).required()}),usSsn:xn.f().shape({usSsn:xn.h().required()}),idCardPhoto:xn.f().shape({idCardPhoto:xn.d().required()}),frontCamera:xn.f().shape({frontCamera:xn.d().required()})},Rk={idCardData:{schema:Tk.idCardData,options:Dk.idCardData,Component:Lk,initialValues:{firstName:"",lastName:"",documentNumber:"",dateOfBirth:"",gender:"",country:"",expirationDate:""},saveType:"customerData"},usSsn:{schema:Tk.usSsn,options:Dk.usSsn,Component:Lk,initialValues:{usSsn:""},saveType:"customerData"},idCardPhoto:{schema:Tk.idCardPhoto,options:Dk.idCardPhoto,Component:Lk,initialValues:{idCardPhoto:null},saveType:"customerDataUpload"},frontCamera:{schema:Tk.frontCamera,options:Dk.frontCamera,Component:Lk,initialValues:{frontCamera:null},saveType:"customerDataUpload"},custom:{Component:Lk,initialValues:{customInfoRequirement:null},saveType:"customInfoRequirement"}},Bk=function(e){return T.a((function(t){return e[t]=Object(hd.a)("yyyyMMdd")(Object(Df.a)(new Date,"yyyy-MM-dd",e[t]))}))(["dateOfBirth","expirationDate"]),e},Ak=T.a((function(e){return ul.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"})})),Mk=T.a(P.a(Gc.a,T.a((function(e){var t=Object(l.a)(e,2),n=t[0],a=t[1];return"txCustomerPhotoPath"===n||"frontCameraPath"===n?["path",a]:"txCustomerPhotoAt"===n||"frontCameraAt"===n?["date",a]:e})),_c.a)),Wk=M.a((function(e){return!D.a(e.date)&&!D.a(e.path)})),zk=P.a(Wk,Ak,Mk),qk={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:$},blankSpace:{padding:[[0,30]],margin:[[0,4,0,2]],borderBottom:"1px solid ".concat($),display:"inline-block"},dropdownField:{marginTop:16,minWidth:155}},$k=Object(f.a)(qk),Hk=function(e){var t=e.onClose,n=e.save,r=e.error,i=e.customInfoRequirementOptions,o=e.addCustomerData,c=e.addPhoto,d=$k(),u=Object(a.useState)(null),m=Object(l.a)(u,2),h=m[0],p=m[1],b=Object(a.useState)({step:1}),f=Object(l.a)(b,2),j=f[0],g=j.step,O=j.config,x=f[1],v=function(e,t){return"idCardData"===(null===(n=t)||void 0===n?void 0:n.requirement)?Object(z.a)({},t.requirement,Bk(e)):e;var n},y=2===g,w=function(e,t){var n=(null===t||void 0===t?void 0:t.entryType)!==Ok||D.a(null===t||void 0===t?void 0:t.requirement)?Pk[null===t||void 0===t?void 0:t.dataType]:Rk[null===t||void 0===t?void 0:t.requirement];switch(e){case 1:return Fk;case 2:return n;default:return a.Fragment}}(g,h),C=function(){var e=Object(Al.a)(Bl.a.mark((function e(t){var a;return Bl.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=Gn.a(O,w.schema.cast(t)),p(a),!y){e.next=11;break}e.t0=w.saveType,e.next="customerData"===e.t0?6:"customerDataUpload"===e.t0?7:"customEntry"===e.t0?8:"customInfoRequirement"===e.t0?9:10;break;case 6:return e.abrupt("return",o(v(t,a)));case 7:return e.abrupt("return",c({newPhoto:op.a(yd.a(t)),photoType:op.a(Vc.a(t))}));case 8:return e.abrupt("return",n(a));case 9:return e.abrupt("return");case 10:return e.abrupt("break",11);case 11:x({step:g+1,config:a});case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return Object(qe.jsx)(qe.Fragment,{children:Object(qe.jsxs)(Kh,{title:"Manual data entry",handleClose:t,width:520,height:520,open:!0,children:[Object(qe.jsx)(bp,{className:d.stepper,steps:2,currentStep:g}),Object(qe.jsx)(mn.e,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,onSubmit:C,initialValues:w.initialValues,validationSchema:w.schema,children:Object(qe.jsxs)(mn.d,{className:d.form,children:[Object(qe.jsx)(w.Component,Object(s.a)({selectedValues:h,customInfoRequirementOptions:i},w.props)),Object(qe.jsxs)("div",{className:d.submit,children:[r&&Object(qe.jsx)(il,{children:"Failed to save"}),Object(qe.jsx)(An,{className:d.button,type:"submit",children:y?"Add Data":"Next"})]})]})})]})})},Vk={titleWrapper:yf.titleWrapper,titleAndButtonsContainer:yf.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:we,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:Me.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:$},txSummaryValue:{height:16,marginRight:25},txSummaryLabel:{marginBottom:4,color:$,marginRight:25},idIcon:{marginRight:10},subpageButton:{marginLeft:16},txTableSpacing:{marginTop:40}},Uk=n(337),Gk=Object(f.a)({closeButton:{display:"flex",padding:[[16,16,0,16]],paddingRight:12,justifyContent:"end"},title:{margin:[[0,16,8,20]]}}),Xk=Object(a.memo)((function(e){var t=e.title,n=void 0===t?"":t,a=e.open,r=e.onDissmised,i=(e.disabled,e.data),o=Object(q.a)(e,["title","open","onDissmised","disabled","data"]),l=Gk();return Object(qe.jsxs)(cn.a,Object(s.a)(Object(s.a)({PaperProps:{style:{borderRadius:8}},fullWidth:!0,open:a,"aria-labelledby":"form-dialog-title"},o),{},{children:[Object(qe.jsx)("div",{className:l.closeButton,children:Object(qe.jsx)(ta,{size:16,"aria-label":"close",onClick:function(){r()},children:Object(qe.jsx)($i,{})})}),Object(qe.jsx)(Ue,{className:l.title,children:n}),Object(qe.jsx)(sn.a,{className:l.dialogContent,children:i})]}))})),_k={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:ae,borderRadius:"50%",width:25,height:25,alignItems:"center",justifyContent:"center",display:"flex"}},Zk=n(562),Kk=n.n(Zk);function Qk(){return(Qk=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Yk(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Jk=a.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("polygon",{id:"Simple-Arrow-White",fill:"#1b2559",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 eE(e,t){var n=e.title,r=e.titleId,i=Yk(e,["title","titleId"]);return a.createElement("svg",Qk({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":r},i),n?a.createElement("title",{id:r},n):null,Jk)}var tE=a.forwardRef(eE);n.p;function nE(){return(nE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function aE(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var rE=a.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"Group-2-Copy",transform:"translate(1.000000, 1.000000)",stroke:"#1b2559",strokeWidth:2},a.createElement("polyline",{id:"Path-4-Copy",points:"0 0 12 15.8202247 0 32"})));function iE(e,t){var n=e.title,r=e.titleId,i=aE(e,["title","titleId"]);return a.createElement("svg",nE({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":r},i),n?a.createElement("title",{id:r},n):null,rE)}var oE=a.forwardRef(iE),lE=(n.p,Object(f.a)({imgWrapper:{alignItems:"center",justifyContent:"center",display:"flex"},imgInner:{objectFit:"cover",objectPosition:"center",width:500,marginBottom:40}})),cE=Object(a.memo)((function(e){var t=e.photosData,n=e.slidePhoto,a=lE();return Object(qe.jsx)(qe.Fragment,{children:Object(qe.jsx)(Kk.a,{PrevIcon:Object(qe.jsx)(tE,{}),NextIcon:Object(qe.jsx)(oE,{}),navButtonsProps:{style:{backgroundColor:"transparent",borderRadius:0,color:"transparent",opacity:1}},navButtonsWrapperProps:{style:{marginLeft:-22,marginRight:-22}},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(qe.jsx)("div",{children:Object(qe.jsx)("div",{className:a.imgWrapper,children:Object(qe.jsx)("img",{className:a.imgInner,src:"".concat(Mj,"/").concat(null===e||void 0===e?void 0:e.photoDir,"/").concat(null===e||void 0===e?void 0:e.path),alt:""})})})}))})})})),sE={label:{color:se,margin:[[0,0,6,0]]},firstRow:{padding:[[8]],display:"flex",flexDirection:"column"},secondRow:{extend:Me.p,display:"flex",padding:[[8]],"& > div":{display:"flex",flexDirection:"column","& > div":{height:37,marginBottom:15,marginRight:55}}}},dE=Object(f.a)(sE),uE=Object(a.memo)((function(e){var t,n,r=e.photosData,i=e.timezone,o=dE(),c=Object(a.useState)(0),s=Object(l.a)(c,2),d=s[0],u=s[1],m=function(e){var t=e.children,n=dE();return Object(qe.jsx)(at,{className:n.label,children:t})},h=!ul.a("id")(r[d]);return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(cE,{photosData:r,slidePhoto:function(e){return u(e)}}),!h&&Object(qe.jsxs)("div",{className:o.firstRow,children:[Object(qe.jsx)(m,{children:"Session ID"}),Object(qe.jsx)(If,{children:r&&(null===(t=r[d])||void 0===t?void 0:t.id)})]}),Object(qe.jsxs)("div",{className:o.secondRow,children:[Object(qe.jsx)("div",{children:Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(m,{children:"Date"}),Object(qe.jsx)("div",{children:r&&fd(null===(n=r[d])||void 0===n?void 0:n.date,i,"yyyy-MM-dd HH:mm")})]})}),Object(qe.jsxs)("div",{children:[Object(qe.jsx)(m,{children:"Taken by"}),Object(qe.jsx)("div",{children:h?"Compliance scan":"Acceptance of T&C"})]})]})]})})),mE=Object(f.a)(_k),hE=Object(a.memo)((function(e){var t=e.photosData,n=e.timezone,r=mE(),i=Object(a.useState)(!1),o=Object(l.a)(i,2),c=o[0],s=o[1],d=um.a([function(e,t){return ul.a("id",e)-ul.a("id",t)},Gw.a(R.a("date"))],t),u=op.a(d);return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(bm.a,{className:r.photo,elevation:0,children:Object(qe.jsx)(Uk.a,{disabled:!u,className:r.button,onClick:function(){s(!0)},children:u?Object(qe.jsxs)("div",{className:r.container,children:[Object(qe.jsx)("img",{className:r.img,src:"".concat(Mj,"/").concat(u.photoDir,"/").concat(u.path),alt:""}),Object(qe.jsx)("circle",{className:r.circle,children:Object(qe.jsx)("div",{children:Object(qe.jsx)(Ye,{children:d.length})})})]}):Object(qe.jsx)(ok,{})})}),Object(qe.jsx)(Xk,{open:c,title:"Photo roll",data:Object(qe.jsx)(uE,{photosData:d,timezone:n}),onDissmised:function(){s(!1)}})]})})),pE=Object(f.a)(Vk),bE=Object(a.memo)((function(e){var t=e.customer,n=e.photosData,a=e.locale,r=e.timezone,i=pE(),o=A.a(["idCardData","documentNumber"])(t),l=A.a(["usSsn"])(t),c=[{header:"Phone number",size:172,value:xk(t.phone,a.country)}];o&&c.push({header:"ID number",size:172,value:o}),l&&c.push({header:"US SSN",size:127,value:l});var s=vk(t);return Object(qe.jsxs)(nl.a,{display:"flex",children:[Object(qe.jsx)(hE,{photosData:n,timezone:r}),Object(qe.jsxs)(nl.a,{display:"flex",flexDirection:"column",children:[Object(qe.jsxs)("div",{className:i.name,children:[Object(qe.jsx)(Zf,{className:i.idIcon}),Object(qe.jsx)(Ge,{noMargin:!0,children:s.length?s:xk(A.a(["phone"])(t),a.country)})]}),Object(qe.jsx)(nl.a,{display:"flex",mt:"auto",children:c.map((function(e,t){var n=e.size,a=e.header;return Object(qe.jsx)(at,{noMargin:!0,className:i.label,style:{width:n},children:a},t)}))}),Object(qe.jsx)(nl.a,{display:"flex",children:c.map((function(e,t){var n=e.size,a=e.value;return Object(qe.jsx)(Ke,{noMargin:!0,className:i.value,style:{width:n},children:a},t)}))})]})]})}));function fE(){return(fE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function jE(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var gE=a.createElement("g",{id:"icon/customer-nav/data/comet",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.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}),a.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}),a.createElement("ellipse",{id:"Oval-Copy-3",stroke:"#5F668A",strokeWidth:2,cx:10,cy:5,rx:9,ry:4}));function OE(e,t){var n=e.title,r=e.titleId,i=jE(e,["title","titleId"]);return a.createElement("svg",fE({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":r},i),n?a.createElement("title",{id:r},n):null,gE)}var xE=a.forwardRef(OE);n.p;function vE(){return(vE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function yE(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var wE=a.createElement("g",{id:"icon/customer-nav/data/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.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}),a.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}),a.createElement("ellipse",{id:"Oval-Copy-3",stroke:"#FFFFFF",strokeWidth:2,cx:10,cy:5,rx:9,ry:4}));function CE(e,t){var n=e.title,r=e.titleId,i=yE(e,["title","titleId"]);return a.createElement("svg",vE({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":r},i),n?a.createElement("title",{id:r},n):null,wE)}var kE=a.forwardRef(CE);n.p;function EE(){return(EE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function NE(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var SE=a.createElement("g",{id:"icon/customer-nav/note/comet",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("path",{d:"M18,1 C18.2761424,1 18.5261424,1.11192881 18.7071068,1.29289322 C18.8880712,1.47385763 19,1.72385763 19,2 L19,2 L19,18 C19,18.2761424 18.8880712,18.5261424 18.7071068,18.7071068 C18.5261424,18.8880712 18.2761424,19 18,19 L18,19 L2,19 C1.72385763,19 1.47385763,18.8880712 1.29289322,18.7071068 C1.11192881,18.5261424 1,18.2761424 1,18 L1,18 L1,2 C1,1.72385763 1.11192881,1.47385763 1.29289322,1.29289322 C1.47385763,1.11192881 1.72385763,1 2,1 L2,1 Z",id:"Rectangle",stroke:"#5F668A",strokeWidth:2}),a.createElement("line",{x1:5,y1:5,x2:15,y2:5,id:"Line-4",stroke:"#5F668A",strokeWidth:2,strokeLinecap:"round"}),a.createElement("line",{x1:5,y1:13,x2:10,y2:13,id:"Line-4-Copy",stroke:"#5F668A",strokeWidth:2,strokeLinecap:"round"}),a.createElement("line",{x1:5,y1:9,x2:15,y2:9,id:"Line-4",stroke:"#5F668A",strokeWidth:2,strokeLinecap:"round"}));function IE(e,t){var n=e.title,r=e.titleId,i=NE(e,["title","titleId"]);return a.createElement("svg",EE({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":r},i),n?a.createElement("title",{id:r},n):null,SE)}var LE=a.forwardRef(IE);n.p;function PE(){return(PE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function FE(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var DE=a.createElement("g",{id:"icon/customer-nav/note/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("path",{d:"M18,1 C18.2761424,1 18.5261424,1.11192881 18.7071068,1.29289322 C18.8880712,1.47385763 19,1.72385763 19,2 L19,2 L19,18 C19,18.2761424 18.8880712,18.5261424 18.7071068,18.7071068 C18.5261424,18.8880712 18.2761424,19 18,19 L18,19 L2,19 C1.72385763,19 1.47385763,18.8880712 1.29289322,18.7071068 C1.11192881,18.5261424 1,18.2761424 1,18 L1,18 L1,2 C1,1.72385763 1.11192881,1.47385763 1.29289322,1.29289322 C1.47385763,1.11192881 1.72385763,1 2,1 L2,1 Z",id:"Rectangle",stroke:"#FFFFFF",strokeWidth:2}),a.createElement("line",{x1:5,y1:5,x2:15,y2:5,id:"Line-4",stroke:"#FFFFFF",strokeWidth:2,strokeLinecap:"round"}),a.createElement("line",{x1:5,y1:13,x2:10,y2:13,id:"Line-4-Copy",stroke:"#FFFFFF",strokeWidth:2,strokeLinecap:"round"}),a.createElement("line",{x1:5,y1:9,x2:15,y2:9,id:"Line-4",stroke:"#FFFFFF",strokeWidth:2,strokeLinecap:"round"}));function TE(e,t){var n=e.title,r=e.titleId,i=FE(e,["title","titleId"]);return a.createElement("svg",PE({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":r},i),n?a.createElement("title",{id:r},n):null,DE)}var RE=a.forwardRef(TE);n.p;function BE(){return(BE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function AE(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var ME=a.createElement("g",{id:"icon/customer-nav/overview/comet",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("rect",{id:"Rectangle",stroke:"#5F668A",strokeWidth:2,x:1,y:1,width:7,height:7,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-2",stroke:"#5F668A",strokeWidth:2,x:1,y:12,width:7,height:7,rx:2}),a.createElement("rect",{id:"Rectangle-Copy",stroke:"#5F668A",strokeWidth:2,x:12,y:1,width:7,height:7,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-3",stroke:"#5F668A",strokeWidth:2,x:12,y:12,width:7,height:7,rx:2}));function WE(e,t){var n=e.title,r=e.titleId,i=AE(e,["title","titleId"]);return a.createElement("svg",BE({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":r},i),n?a.createElement("title",{id:r},n):null,ME)}var zE=a.forwardRef(WE);n.p;function qE(){return(qE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function $E(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var HE=a.createElement("g",{id:"icon/customer-nav/overview/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("rect",{id:"Rectangle",stroke:"#FFFFFF",strokeWidth:2,x:1,y:1,width:7,height:7,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-2",stroke:"#FFFFFF",strokeWidth:2,x:1,y:12,width:7,height:7,rx:2}),a.createElement("rect",{id:"Rectangle-Copy",stroke:"#FFFFFF",strokeWidth:2,x:12,y:1,width:7,height:7,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-3",stroke:"#FFFFFF",strokeWidth:2,x:12,y:12,width:7,height:7,rx:2}));function VE(e,t){var n=e.title,r=e.titleId,i=$E(e,["title","titleId"]);return a.createElement("svg",qE({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":r},i),n?a.createElement("title",{id:r},n):null,HE)}var UE=a.forwardRef(VE);n.p;function GE(){return(GE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function XE(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var _E=a.createElement("g",{id:"icon/customer-nav/photos/comet",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("rect",{id:"Rectangle",stroke:"#5F668A",strokeWidth:2,x:1,y:1,width:18,height:18,rx:1}),a.createElement("circle",{id:"Oval",stroke:"#5F668A",strokeWidth:2,cx:15,cy:5,r:1}),a.createElement("polyline",{id:"Path",stroke:"#5F668A",strokeWidth:2,strokeLinejoin:"round",points:"1 19 7 13 13 19"}),a.createElement("path",{d:"M13.3333333,14 L18,19 L13.3333333,19 L11,16.5 L13.3333333,14 Z",id:"Combined-Shape",stroke:"#5F668A",strokeWidth:2,strokeLinejoin:"round"}));function ZE(e,t){var n=e.title,r=e.titleId,i=XE(e,["title","titleId"]);return a.createElement("svg",GE({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":r},i),void 0===n?a.createElement("title",{id:r},"icon/customer-nav/photos/comet"):n?a.createElement("title",{id:r},n):null,_E)}var KE=a.forwardRef(ZE);n.p;function QE(){return(QE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function YE(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var JE=a.createElement("g",{id:"icon/customer-nav/photos/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("rect",{id:"Rectangle",stroke:"#FFFFFF",strokeWidth:2,x:1,y:1,width:18,height:18,rx:1}),a.createElement("circle",{id:"Oval",stroke:"#FFFFFF",strokeWidth:2,cx:15,cy:5,r:1}),a.createElement("polyline",{id:"Path",stroke:"#FFFFFF",strokeWidth:2,strokeLinejoin:"round",points:"1 19 7 13 13 19"}),a.createElement("path",{d:"M13.3333333,14 L18,19 L13.3333333,19 L11,16.5 L13.3333333,14 Z",id:"Combined-Shape",stroke:"#FFFFFF",strokeWidth:2,strokeLinejoin:"round"}));function eN(e,t){var n=e.title,r=e.titleId,i=YE(e,["title","titleId"]);return a.createElement("svg",QE({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":r},i),void 0===n?a.createElement("title",{id:r},"icon/customer-nav/photos/white"):n?a.createElement("title",{id:r},n):null,JE)}var tN=a.forwardRef(eN),nN=(n.p,{sidebar:{display:"flex",backgroundColor:"#ebefff",width:219,flexDirection:"column",borderRadius:5},link:{alignItems:"center",display:"flex",extend:Me.p,position:"relative",color:de,padding:15,cursor:"pointer"},activeLink:{display:"flex",alignItems:"center",extend:Me.tl2,color:K,backgroundColor:de,"&:first-child":{borderRadius:[[5,5,0,0]]},"&:last-child":{borderRadius:[[0,0,5,5]]}},icon:{marginRight:15}}),aN=Object(f.a)(nN),rN=function(e){var t=e.isSelected,n=e.onClick,a=aN(),r=[{code:"overview",display:"Overview",Icon:UE,InverseIcon:zE},{code:"customerData",display:"Customer Data",Icon:kE,InverseIcon:xE},{code:"notes",display:"Notes",Icon:RE,InverseIcon:LE},{code:"photos",display:"Photos & files",Icon:tN,InverseIcon:KE}];return Object(qe.jsx)("div",{className:a.sidebar,children:null===r||void 0===r?void 0:r.map((function(e){var r,i=e.Icon,o=e.InverseIcon,l=e.display,c=e.code;return Object(qe.jsxs)("div",{className:I()((r={},Object(z.a)(r,a.activeLink,t(c)),Object(z.a)(r,a.link,!0),r)),onClick:function(){return n(c)},children:[Object(qe.jsx)("div",{className:a.icon,children:t(c)?Object(qe.jsx)(i,{}):Object(qe.jsx)(o,{})}),l]})}))})};n.p;function iN(){return(iN=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function oN(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var lN=a.createElement("desc",null,"Created with Sketch."),cN=a.createElement("g",{id:"icon/action/edit/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.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}),a.createElement("polygon",{id:"Stroke-3",stroke:"#FFFFFF",strokeWidth:2,points:"6 12 17 1 21 5 10 16 6 16"}));function sN(e,t){var n=e.title,r=e.titleId,i=oN(e,["title","titleId"]);return a.createElement("svg",iN({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":r},i),n?a.createElement("title",{id:r},n):null,lN,cN)}var dN=a.forwardRef(sN);n.p;function uN(){return(uN=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function mN(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var hN=a.createElement("g",{id:"icon/button/replace/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"Group-3",transform:"translate(0.500000, 0.500000)",stroke:"#FFFFFF"},a.createElement("g",{id:"Group-2"},a.createElement("path",{d:"M3.27636475,10.2264084 C2.67216087,9.96069246 2.10487152,9.58126145 1.60869691,9.087544 C-0.521488181,6.9675304 -0.538316861,3.54693703 1.57123953,1.44692357 C1.86137314,1.15837428 2.17625375,0.909794042 2.50930653,0.701182852",id:"Stroke-1"}),a.createElement("polyline",{id:"Stroke-3",points:"3.0943493 1.69429658 3.08837783 0.545717786 1.99994228 0"})),a.createElement("g",{id:"Group-2",transform:"translate(8.999987, 5.500035) scale(-1, -1) translate(-8.999987, -5.500035) translate(6.999974, 0.000000)"},a.createElement("path",{d:"M3.27636475,10.2264084 C2.67216087,9.96069246 2.10487152,9.58126145 1.60869691,9.087544 C-0.521488181,6.9675304 -0.538316861,3.54693703 1.57123953,1.44692357 C1.86137314,1.15837428 2.17625375,0.909794042 2.50930653,0.701182852",id:"Stroke-1"}),a.createElement("polyline",{id:"Stroke-3",points:"3.0943493 1.69429658 3.08837783 0.545717786 1.99994228 3.80623901e-14"}))));function pN(e,t){var n=e.title,r=e.titleId,i=mN(e,["title","titleId"]);return a.createElement("svg",uN({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":r},i),n?a.createElement("title",{id:r},n):null,hN)}var bN=a.forwardRef(pN);n.p;function fN(){return(fN=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function jN(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var gN=a.createElement("desc",null,"Created with Sketch."),ON=a.createElement("defs",null,a.createElement("polygon",{id:"path-1",points:"0 21 21 21 21 0 0 0"})),xN=a.createElement("g",{id:"icon/sf-small/save/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"Group"},a.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"}),a.createElement("mask",{id:"mask-2",fill:"white"},a.createElement("use",{xlinkHref:"#path-1"})),a.createElement("g",{id:"Clip-4"}),a.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"}),a.createElement("circle",{id:"Oval",stroke:"#FFFFFF",strokeWidth:2,mask:"url(#mask-2)",cx:11,cy:14,r:3})));function vN(e,t){var n=e.title,r=e.titleId,i=jN(e,["title","titleId"]);return a.createElement("svg",fN({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":r},i),n?a.createElement("title",{id:r},n):null,gN,ON,xN)}var yN=a.forwardRef(vN),wN=(n.p,{label1:{display:"flex",width:85,justifyContent:"right"},label1Pending:{color:$},label1Rejected:{color:Q},label1Accepted:{color:U},editButton:{marginTop:20,display:"flex",justifyContent:"right"},deleteButton:{marginRight:8},headerWrapper:{display:"flex",flexDirection:"row",justifyContent:"space-between",height:40},editingWrapper:{display:"flex",flexDirection:"row",justifyContent:"space-between",marginTop:20},replace:{marginRight:5},input:{display:"none"},button:{marginRight:5},editingButtons:{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]]}}),CN=Object(f.a)(wN),kN={field:{position:"relative",width:280,height:48,padding:[[0,4,4,0]],marginTop:2},label:{color:$,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,fontSize:14}}},readOnlyLabel:{color:$,margin:[[3,0,3,0]]},readOnlyValue:{margin:0}},EN=Object(f.a)(kN),NN=function(e){var t,n=e.editing,a=e.field,r=e.value,i=e.size,o=Object(q.a)(e,["editing","field","value","size"]),l=EN(),c=(t={},Object(z.a)(t,l.field,!0),Object(z.a)(t,l.notEditing,!n),t);return Object(qe.jsxs)("div",{className:I()(c),children:[!n&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(at,{className:l.label,children:a.label}),Object(qe.jsx)(Ke,{children:r})]}),n&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(at,{className:l.label,children:a.label}),Object(qe.jsx)(mn.b,Object(s.a)({className:l.editing,id:a.name,name:a.name,component:a.component,type:a.type,width:i},o))]})]})},SN=function(e){var t,n=e.field,a=e.value,r=(Object(q.a)(e,["field","value"]),EN()),i=(t={},Object(z.a)(t,r.field,!0),Object(z.a)(t,r.notEditing,!0),t);return Object(qe.jsx)(qe.Fragment,{children:Object(qe.jsxs)("div",{className:I()(i),children:[Object(qe.jsx)(at,{className:r.readOnlyLabel,children:n.label}),Object(qe.jsx)(Ke,{className:r.readOnlyValue,children:a})]})})},IN=function(e){var t,n=e.fields,r=e.save,i=e.authorize,o=e.hasImage,c=e.reject,s=e.state,d=e.title,u=e.titleIcon,m=e.children,p=e.validationSchema,b=e.initialValues,f=(e.deleteEditedData,e.retrieveAdditionalData),j=e.hasAdditionalData,g=void 0===j||j,O=e.editable,x=CN(),v=Object(a.useState)(!1),y=Object(l.a)(v,2),w=y[0],C=y[1],k=Object(a.useState)(null),E=Object(l.a)(k,2),N=E[0],S=E[1],L=Object(a.useState)(null),P=Object(l.a)(L,2),F=P[0],D=P[1],T=(t={},Object(z.a)(t,x.label1,!0),Object(z.a)(t,x.label1Pending,s===oC),Object(z.a)(t,x.label1Rejected,s===cC),Object(z.a)(t,x.label1Accepted,s===lC),t),R=s===oC?{label:"Pending",type:"neutral"}:s===cC?{label:"Rejected",type:"error"}:{label:"Accepted",type:"success"};return Object(qe.jsx)("div",{children:Object(qe.jsx)(bm.a,{className:x.card,children:Object(qe.jsxs)(fm.a,{children:[Object(qe.jsxs)("div",{className:x.headerWrapper,children:[Object(qe.jsxs)("div",{className:x.cardHeader,children:[u,Object(qe.jsx)(Xe,{className:x.cardTitle,children:d})]}),s&&i&&Object(qe.jsx)("div",{className:I()(T),children:Object(qe.jsx)(Mu,{statuses:[R]})})]}),m,Object(qe.jsx)(mn.e,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,validationSchema:p,initialValues:b,onSubmit:function(e){r(e),C(!1)},onReset:function(){C(!1),D(!1)},children:function(e){var t=e.setFieldValue;return Object(qe.jsxs)(mn.d,{children:[Object(qe.jsx)(pm,{}),Object(qe.jsx)("div",{className:x.row,children:Object(qe.jsxs)(h.a,{container:!0,children:[Object(qe.jsx)(h.a,{container:!0,direction:"column",item:!0,xs:6,children:!o&&(null===n||void 0===n?void 0:n.map((function(e,t){return t>=0&&t<4?e.editable?Object(qe.jsx)(NN,{field:e,value:b[e.name],editing:w,size:180}):Object(qe.jsx)(SN,{field:e,value:b[e.name]}):null})))}),Object(qe.jsx)(h.a,{container:!0,direction:"column",item:!0,xs:6,children:!o&&(null===n||void 0===n?void 0:n.map((function(e,t){return t>=4?e.editable?Object(qe.jsx)(NN,{field:e,value:b[e.name],editing:w,size:180}):Object(qe.jsx)(SN,{field:e,value:b[e.name]}):null})))})]})}),Object(qe.jsxs)("div",{className:x.edit,children:[!w&&Object(qe.jsxs)("div",{className:x.editButton,children:[Object(qe.jsxs)("div",{className:x.deleteButton,children:[!1,!g&&Object(qe.jsx)(He,{color:"primary",type:"button",Icon:LC,InverseIcon:kC,onClick:function(){return f()},children:"Retrieve API data"})]}),O&&Object(qe.jsx)(He,{color:"primary",Icon:Ph,InverseIcon:dN,onClick:function(){return C(!0)},children:"Edit"}),!O&&i&&"Accepted"!==R.label&&Object(qe.jsx)("div",{className:x.button,children:Object(qe.jsx)(He,{color:"spring",type:"button",Icon:Yw,InverseIcon:Yw,onClick:function(){return i()},children:"Authorize"})}),!O&&i&&"Rejected"!==R.label&&Object(qe.jsx)(He,{color:"tomato",type:"button",Icon:pC,InverseIcon:pC,onClick:function(){return c()},children:"Reject"})]}),w&&Object(qe.jsxs)("div",{className:x.editingWrapper,children:[Object(qe.jsx)("div",{className:x.replace,children:o&&Object(qe.jsx)(He,{color:"secondary",type:"button",Icon:bN,InverseIcon:bN,onClick:function(){return N.click()},children:Object(qe.jsxs)("div",{children:[Object(qe.jsx)("input",{type:"file",alt:"",accept:"image/*",className:x.input,ref:function(e){return S(e)},onChange:function(e){var a=op.a(e.target.files);a&&t(op.a(n).name,a)}}),"Replace"]})})}),Object(qe.jsxs)("div",{className:x.editingButtons,children:[n&&Object(qe.jsx)("div",{className:x.button,children:Object(qe.jsx)(He,{color:"secondary",Icon:yN,InverseIcon:yN,type:"submit",children:"Save"})}),Object(qe.jsx)("div",{className:x.button,children:Object(qe.jsx)(He,{color:"secondary",Icon:ba,InverseIcon:ba,type:"reset",children:"Cancel"})}),i&&"Accepted"!==R.label&&Object(qe.jsx)("div",{className:x.button,children:Object(qe.jsx)(He,{color:"spring",type:"button",Icon:Yw,InverseIcon:Yw,onClick:function(){return i()},children:"Authorize"})}),i&&"Rejected"!==R.label&&Object(qe.jsx)(He,{color:"tomato",type:"button",Icon:pC,InverseIcon:pC,onClick:function(){return c()},children:"Reject"}),F&&Object(qe.jsx)(il,{children:"Failed to save changes"})]})]})]})]})}})]})})})},LN=(Object(f.a)({field:{height:46},label:{color:$,margin:[[0,3]]},value:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",margin:0,paddingLeft:4}}),function(e,t){return D.a(e)?"":t}),PN=Object(f.a)(Vk),FN=function(e){var t,n,a=e.customer,r=e.data,i=e.loading,o=e.locale,l=PN(),c="cashOut"===a.lastTxClass?zc:Dc,s=!(Wa.a(r)||D.a(r)),d=o.timezone,u=(t={},Object(z.a)(t,l.titleAndButtonsContainer,i||!i&&!s),Object(z.a)(t,l.txTableSpacing,!i&&s),t),m=[{header:"Transactions",size:127,value:LN(a.totalTxs,"".concat(Number.parseInt(a.totalTxs)))},{header:"Transaction volume",size:167,value:LN(a.totalSpent,"".concat(Number.parseFloat(a.totalSpent)," ").concat(a.lastTxFiatCode))},{header:"Last active",size:142,value:!D.a(d)&&(null!==(n=a.lastActive&&fd(a.lastActive,d,"yyyy-MM-dd"))&&void 0!==n?n:"")},{header:"Last transaction",size:198,value:LN(a.lastTxFiat,Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(c,{className:l.icon}),"".concat(Number.parseFloat(a.lastTxFiat)," \n ").concat(a.lastTxFiatCode)]}))}],h=[{width:40,view:function(e){return Object(qe.jsx)(qe.Fragment,{children:"cashOut"===e.txClass?Object(qe.jsx)(zc,{className:l.txClassIconLeft}):Object(qe.jsx)(Dc,{className:l.txClassIconLeft})})}},{header:"Machine",width:160,view:A.a(["machineName"])},{header:"Transaction ID",width:145,view:function(e){return Object(qe.jsx)(If,{className:l.txId,children:e.id})}},{header:"Cash",width:155,textAlign:"right",view:function(e){return Object(qe.jsxs)(qe.Fragment,{children:["".concat(Number.parseFloat(e.fiat)," "),Object(qe.jsx)(rt,{inline:!0,children:e.fiatCode})]})}},{header:"Crypto",width:145,textAlign:"right",view:function(e){return Object(qe.jsxs)(qe.Fragment,{children:["".concat(Ff.utils.toUnit(new Hc.a(e.cryptoAtoms),e.cryptoCode).toFormat(5)," "),Object(qe.jsx)(rt,{inline:!0,children:e.cryptoCode})]})}},{header:"Date",width:100,view:function(e){return fd(e.created,d,"yyyy\u2011MM\u2011dd")}},{header:"Time (h:m:s)",width:130,view:function(e){return fd(e.created,d,"HH:mm:ss")}}];return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(Xe,{children:"Transactions"}),Object(qe.jsxs)(nl.a,{display:"flex",flexDirection:"column",children:[Object(qe.jsx)(nl.a,{display:"flex",mt:"auto",children:m.map((function(e,t){var n=e.size,a=e.header;return Object(qe.jsx)(at,{noMargin:!0,className:l.txSummaryLabel,style:{width:n},children:a},t)}))}),Object(qe.jsx)(nl.a,{display:"flex",children:m.map((function(e,t){var n=e.size,a=e.value;return Object(qe.jsx)(Ke,{noMargin:!0,className:l.txSummaryValue,style:{width:n},children:a},t)}))})]}),Object(qe.jsx)("div",{className:l.titleWrapper,children:Object(qe.jsx)("div",{className:I()(u),children:i?Object(qe.jsx)(_e,{children:"Loading"}):s?"":Object(qe.jsx)(_e,{children:"No transactions so far"})})}),s&&Object(qe.jsx)(Ay,{elements:h,data:r})]})},DN=n(566);function TN(){return(TN=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function RN(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var BN=a.createElement("g",{id:"icon/button/photo/zodiac-resized",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"Group-2"},a.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"},a.createElement("rect",{id:"Rectangle-Copy",x:.5,y:.5,width:15.6666667,height:15.6666667,rx:1}),a.createElement("circle",{id:"Oval-Copy",fill:"#1B2559",cx:12.5,cy:4.16666667,r:1}),a.createElement("g",{id:"Group-14",transform:"translate(0.775621, 9.722222)",strokeLinejoin:"round"},a.createElement("polyline",{id:"Path-Copy-2",points:"0 4.58204149 5.10673153 0 11.6154223 6.31150113"}),a.createElement("polyline",{id:"Path",points:"9.02830015 3.23981481 11.3158819 0.925925926 15.0663146 4.81868037"}))),a.createElement("g",{id:"Group-9",transform:"translate(0.000000, 6.666667)"},a.createElement("circle",{id:"Oval",stroke:"#1B2559",fill:"#EBEFFF",cx:6.66666667,cy:6.66666667,r:6.16666667}),a.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 AN(e,t){var n=e.title,r=e.titleId,i=RN(e,["title","titleId"]);return a.createElement("svg",TN({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":r},i),n?a.createElement("title",{id:r},n):null,BN)}var MN=a.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 a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function zN(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var qN=a.createElement("g",{id:"icon/button/upload-file/zodiac-resized",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"Add-File-Icon",transform:"translate(0.000000, 0.500000)"},a.createElement("g",{id:"file-icon",transform:"translate(5.934783, 0.000000)",stroke:"#1B2559"},a.createElement("g",{id:"lines",transform:"translate(3.130435, 7.826087)",strokeLinecap:"round"},a.createElement("line",{x1:0,y1:7.04347826,x2:7.82608696,y2:7.04347826,id:"line-3"}),a.createElement("line",{x1:0,y1:3.91304348,x2:7.82608696,y2:3.91304348,id:"line-2"}),a.createElement("line",{x1:0,y1:.782608696,x2:5.47826087,y2:.782608696,id:"line-1"})),a.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"}),a.createElement("polygon",{id:"fold",strokeLinejoin:"round",points:"8.47826087 0 8.47826087 5.08695652 13.5652174 5.08695652"})),a.createElement("g",{id:"plus-sign",transform:"translate(0.000000, 5.934783)"},a.createElement("circle",{id:"Oval",stroke:"#1B2559",fill:"#EBEFFF",cx:6.7826087,cy:6.7826087,r:6.2826087}),a.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 $N(e,t){var n=e.title,r=e.titleId,i=zN(e,["title","titleId"]);return a.createElement("svg",WN({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":r},i),n?a.createElement("title",{id:r},n):null,qN)}var HN=a.forwardRef($N),VN=(n.p,Object(f.a)({box:{boxSizing:"border-box",width:450,height:120,borderStyle:"dashed",borderColor:se,borderRadius:4,borderWidth:1,backgroundColor:re,display:"flex",justifyContent:"center"},inputContent:{marginTop:35,display:"flex"},uploadContent:{marginTop:50,display:"flex"},board:{marginTop:40,width:450,height:120},icon:{margin:[[14,20,0,0]]}})),UN=function(e){var t=e.type,n=VN(),r=Object(a.useState)({}),i=Object(l.a)(r,2),o=i[0],c=i[1],d=Object(mn.f)().setFieldValue,u="image"===t||"frontCamera"===t||"idCardPhoto"===t,m=Object(a.useCallback)((function(e){d(t,op.a(e)),c({preview:u?URL.createObjectURL(op.a(e)):op.a(e).name})}),[u,t,d]),h=Object(DN.a)({onDrop:m}),p=h.getRootProps,b=h.getInputProps;return Object(qe.jsx)(qe.Fragment,{children:Object(qe.jsxs)("div",Object(s.a)(Object(s.a)({},p()),{},{className:n.board,children:[Wa.a(o)&&Object(qe.jsxs)("div",{className:n.box,children:[Object(qe.jsx)("input",Object(s.a)({},b())),Object(qe.jsxs)("div",{className:n.inputContent,children:[u?Object(qe.jsx)(MN,{className:n.icon}):Object(qe.jsx)(HN,{className:n.icon}),Object(qe.jsx)(it,{children:"Drag and drop ".concat(u?"an image":"a file"," or click to open the explorer")})]})]}),!Wa.a(o)&&u&&Object(qe.jsx)("div",{children:Object(qe.jsx)("img",{src:o.preview,className:n.box,alt:""})},o.name),!Wa.a(o)&&!u&&Object(qe.jsx)("div",{className:n.box,children:Object(qe.jsx)(Xe,{className:n.uploadContent,children:o.preview})})]}))})},GN=Object(f.a)(hk),XN=function(e){var t=e.show,n=e.src,a=GN({width:165});return Object(qe.jsx)(qe.Fragment,{children:t?Object(qe.jsx)(VC,{src:n,width:165,height:32,popupWidth:360,popupHeight:240}):Object(qe.jsx)("div",{className:a.photoWrapper,children:Object(qe.jsx)(ok,{})})})},_N=function(e){var t,n,r,i,o,c,s,d,u,m,p,b=e.locale,f=e.customer,j=e.updateCustomer,g=e.replacePhoto,O=e.editCustomer,x=e.deleteEditedData,v=e.updateCustomRequest,y=e.authorizeCustomRequest,w=e.updateCustomEntry,C=e.retrieveAdditionalDataDialog,k=e.setRetrieve,E=GN(),N=Object(a.useState)(!1),S=Object(l.a)(N,2),I=S[0],L=(S[1],A.a(["idCardData"])(f)),F=A.a(["expirationDate"])(L),T=A.a(["dateOfBirth"])(L),R=A.a(["sanctions"])(f),B=A.a(["sanctionsAt"])(f)?R?"Passed":"Failed":"Not checked yet",W=Tw.a(P.a(On.a,A.a(["customInfoRequest","customRequest","name"]))),q=[],$=[],H=W(null!==(t=A.a(["customInfoRequests"])(f))&&void 0!==t?t:[]),V=A.a(["phone"])(f),U=A.a(["subscriberInfo"])(f),G=function(e){return e%2===0},X=M.a((function(e){return e.isAvailable})),_={idCardData:{firstName:null!==(n=A.a(["firstName"])(L))&&void 0!==n?n:"",lastName:null!==(r=A.a(["lastName"])(L))&&void 0!==r?r:"",documentNumber:null!==(i=A.a(["documentNumber"])(L))&&void 0!==i?i:"",dateOfBirth:null!==(o=T&&Object(hd.a)("yyyy-MM-dd")(Object(Df.a)(new Date,"yyyyMMdd",T)))&&void 0!==o?o:"",gender:null!==(c=A.a(["gender"])(L))&&void 0!==c?c:"",country:null!==(s=A.a(["country"])(L))&&void 0!==s?s:"",expirationDate:null!==(d=F&&Object(hd.a)("yyyy-MM-dd")(Object(Df.a)(new Date,"yyyyMMdd",F)))&&void 0!==d?d:""},usSsn:{usSsn:null!==(u=f.usSsn)&&void 0!==u?u:""},frontCamera:{frontCamera:null},idCardPhoto:{idCardPhoto:null},smsData:{phoneNumber:xk(V,b.country)}},Z=[{name:"phoneNumber",label:"Phone number",component:di,editable:!1}],K={smsData:xn.c((function(e){var t,n=lm.a(["phoneNumber"])(e),a=Vc.a(n);if(2===bn.a(a))return xn.f().shape((t={},Object(z.a)(t,op.a(a),xn.h().required()),Object(z.a)(t,PC.a(a),xn.h().required()),t))}))},Q=[{fields:Dk.idCardData,title:"ID Scan",titleIcon:Object(qe.jsx)(ZC,{className:E.cardIcon}),state:A.a(["idCardDataOverride"])(f),authorize:function(){return j({idCardDataOverride:lC})},reject:function(){return j({idCardDataOverride:cC})},deleteEditedData:function(){return x({idCardData:null})},save:function(e){return O({idCardData:Gn.a(L,Bk(e))})},validationSchema:Tk.idCardData,initialValues:_.idCardData,isAvailable:!D.a(L),editable:!0},{fields:Z,title:"SMS data",titleIcon:Object(qe.jsx)(ek,{className:E.cardIcon}),state:A.a(["phoneOverride"])(f),authorize:function(){return j({phoneOverride:lC})},reject:function(){return j({phoneOverride:cC})},save:function(e){O({subscriberInfo:{result:Gn.a(U,lm.a(["phoneNumber"])(e))}})},validationSchema:K.smsData,retrieveAdditionalData:function(){return k(!0)},initialValues:_.smsData,isAvailable:!D.a(V),hasAdditionalData:!D.a(U)&&!Wa.a(U),editable:!1},{title:"Name",titleIcon:Object(qe.jsx)(mk,{className:E.editIcon}),authorize:function(){},reject:function(){},save:function(){},isAvailable:!1,editable:!0},{title:"Sanctions check",titleIcon:Object(qe.jsx)(mk,{className:E.editIcon}),state:A.a(["sanctionsOverride"])(f),authorize:function(){return j({sanctionsOverride:lC})},reject:function(){return j({sanctionsOverride:cC})},children:Object(qe.jsx)(Je,{children:B}),isAvailable:!D.a(R),editable:!0},{fields:Dk.frontCamera,title:"Front facing camera",titleIcon:Object(qe.jsx)(mk,{className:E.editIcon}),state:A.a(["frontCameraOverride"])(f),authorize:function(){return j({frontCameraOverride:lC})},reject:function(){return j({frontCameraOverride:cC})},save:function(e){return g({newPhoto:e.frontCamera,photoType:"frontCamera"})},deleteEditedData:function(){return x({frontCamera:null})},children:f.frontCameraPath?Object(qe.jsx)(XN,{show:f.frontCameraPath,src:"".concat(Mj,"/front-camera-photo/").concat(A.a(["frontCameraPath"])(f))}):null,hasImage:!0,validationSchema:Tk.frontCamera,initialValues:_.frontCamera,isAvailable:!D.a(f.frontCameraPath),editable:!0},{fields:Dk.idCardPhoto,title:"ID card image",titleIcon:Object(qe.jsx)(mk,{className:E.editIcon}),state:A.a(["idCardPhotoOverride"])(f),authorize:function(){return j({idCardPhotoOverride:lC})},reject:function(){return j({idCardPhotoOverride:cC})},save:function(e){return g({newPhoto:e.idCardPhoto,photoType:"idCardPhoto"})},deleteEditedData:function(){return x({idCardPhoto:null})},children:f.idCardPhotoPath?Object(qe.jsx)(XN,{show:f.idCardPhotoPath,src:"".concat(Mj,"/id-card-photo/").concat(A.a(["idCardPhotoPath"])(f))}):null,hasImage:!0,validationSchema:Tk.idCardPhoto,initialValues:_.idCardPhoto,isAvailable:!D.a(f.idCardPhotoPath),editable:!0},{fields:Dk.usSsn,title:"US SSN",titleIcon:Object(qe.jsx)(ZC,{className:E.cardIcon}),state:A.a(["usSsnOverride"])(f),authorize:function(){return j({usSsnOverride:lC})},reject:function(){return j({usSsnOverride:cC})},save:function(e){return O(e)},deleteEditedData:function(){return x({usSsn:null})},validationSchema:Tk.usSsn,initialValues:_.usSsn,isAvailable:!D.a(f.usSsn),editable:!0}];Gv.a((function(e){var t,n;$.push({fields:[{name:e.customInfoRequest.id,label:e.customInfoRequest.customRequest.name,value:null!==(t=e.customerData.data)&&void 0!==t?t:"",component:di,editable:!0}],title:e.customInfoRequest.customRequest.name,titleIcon:Object(qe.jsx)(ZC,{className:E.cardIcon}),state:A.a(["override"])(e),authorize:function(){return y({variables:{customerId:e.customerId,infoRequestId:e.customInfoRequest.id,override:lC}})},reject:function(){return y({variables:{customerId:e.customerId,infoRequestId:e.customInfoRequest.id,override:cC}})},save:function(t){v({variables:{customerId:e.customerId,infoRequestId:e.customInfoRequest.id,data:{info_request_id:e.customInfoRequest.id,data:t[e.customInfoRequest.id]}}})},deleteEditedData:function(){},validationSchema:xn.f().shape(Object(z.a)({},e.customInfoRequest.id,xn.h())),initialValues:Object(z.a)({},e.customInfoRequest.id,null!==(n=e.customerData.data)&&void 0!==n?n:"")})}),H),Gv.a((function(e){var t,n;q.push({fields:[{name:e.label,label:e.label,value:null!==(t=e.value)&&void 0!==t?t:"",component:di,editable:!0}],title:e.label,titleIcon:Object(qe.jsx)(mk,{className:E.editIcon}),save:function(t){w({fieldId:e.id,value:t[e.label]})},deleteEditedData:function(){},validationSchema:xn.f().shape(Object(z.a)({},e.label,xn.h())),initialValues:Object(z.a)({},e.label,null!==(n=e.value)&&void 0!==n?n:"")})}),null!==(m=A.a(["customFields"])(f))&&void 0!==m?m:[]),Gv.a((function(e){_.smsData[e]=U[e],Z.push({name:e,label:Mm(e),component:di,editable:!1})}),null!==(p=Vc.a(U))&&void 0!==p?p:[]);var Y=function(e,t){var n=e.title,a=e.authorize,r=e.reject,i=e.state,o=e.titleIcon,l=e.fields,c=e.save,s=e.deleteEditedData,d=e.retrieveAdditionalData,u=e.children,m=e.validationSchema,h=e.initialValues,p=e.hasImage,b=e.hasAdditionalData,f=e.editable;return Object(qe.jsx)(IN,{title:n,authorize:a,reject:r,state:i,titleIcon:o,hasImage:p,hasAdditionalData:b,fields:l,children:u,validationSchema:m,initialValues:h,save:c,deleteEditedData:s,retrieveAdditionalData:d,editable:f},t)},J=X(Q);return Object(qe.jsxs)("div",{children:[Object(qe.jsxs)("div",{className:E.header,children:[Object(qe.jsx)(Xe,{className:E.title,children:"Customer data"}),!1]}),Object(qe.jsxs)("div",{children:[!I&&f&&Object(qe.jsxs)(h.a,{container:!0,children:[Object(qe.jsx)(h.a,{container:!0,direction:"column",item:!0,xs:6,children:J.map((function(e,t){return G(t)?Y(e,t):null}))}),Object(qe.jsx)(h.a,{container:!0,direction:"column",item:!0,xs:6,children:J.map((function(e,t){return G(t)?null:Y(e,t)}))})]}),!Wa.a(q)&&Object(qe.jsxs)("div",{className:E.wrapper,children:[Object(qe.jsx)("span",{className:E.separator,children:"Custom data entry"}),Object(qe.jsxs)(h.a,{container:!0,children:[Object(qe.jsx)(h.a,{container:!0,direction:"column",item:!0,xs:6,children:q.map((function(e,t){return G(t)?Y(e,t):null}))}),Object(qe.jsx)(h.a,{container:!0,direction:"column",item:!0,xs:6,children:q.map((function(e,t){return G(t)?null:Y(e,t)}))})]})]}),!Wa.a($)&&Object(qe.jsxs)("div",{className:E.wrapper,children:[Object(qe.jsx)("span",{className:E.separator,children:"Custom requirements"}),Object(qe.jsxs)(h.a,{container:!0,children:[Object(qe.jsx)(h.a,{container:!0,direction:"column",item:!0,xs:6,children:$.map((function(e,t){return G(t)?Y(e,t):null}))}),Object(qe.jsx)(h.a,{container:!0,direction:"column",item:!0,xs:6,children:$.map((function(e,t){return G(t)?null:Y(e,t)}))})]})]})]}),C]})},ZN={header:{display:"flex",flexDirection:"row"},title:{marginTop:7,marginRight:24},notesChipList:{display:"flex",flexDirection:"row",flexWrap:"wrap"}},KN={noteCardWrapper:{flexGrow:0,flexShrink:0,flexBasis:"25%",minWidth:0,maxWidth:500,"&:nth-child(4n+1)":{"& > div":{margin:[[0,10,0,0]]}},"&:nth-child(4n)":{"& > div":{margin:[[0,0,0,10]]}},margin:[[10,0]]},noteCardChip:{height:200,margin:[[0,10]],padding:[[10,10]],cursor:"pointer"},newNoteCard:{backgroundColor:G,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},noteCardHeader:{display:"flex",flexDirection:"row",justifyContent:"space-between",width:"100%"},noteCardTitle:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",marginRight:10},noteCardContent:{display:"box",lineClamp:7,boxOrient:"vertical",margin:[[15,0]],overflow:"hidden",textOverflow:"ellipsis",wordWrap:"break-word"},editCardChip:{height:325,padding:15},editCardHeader:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:15},editCardActions:{display:"flex",flexDirection:"row",alignItems:"center","& > *":{marginRight:10},"& > *:last-child":{marginRight:0}},editNotesContent:{"& > div":{"&:after":{borderBottom:"none"},"&:before":{borderBottom:"none"},"&:hover:not(.Mui-disabled)::before":{borderBottom:"none"}}}},QN=Object(f.a)(KN),YN=function(e){var t=e.setOpenModal,n=QN();return Object(qe.jsx)("div",{className:n.noteCardWrapper,onClick:function(){return t(!0)},children:Object(qe.jsxs)(Un.a,{className:I()(n.noteCardChip,n.newNoteCard),children:[Object(qe.jsx)(Sn,{width:20,height:20}),Object(qe.jsx)(Ke,{children:"Add new"})]})})},JN={form:{display:"flex",flexDirection:"column",height:"100%","& > *":{marginTop:20},"& > *:last-child":{marginTop:"auto"}},submit:{margin:[["auto",0,0,"auto"]]},footer:{display:"flex",flexDirection:"row",margin:[["auto",0,24,0]]}},eS=Object(f.a)(JN),tS={title:"",content:""},nS=xn.f().shape({title:xn.h().required().trim().max(25),content:xn.h().required()}),aS=function(e){var t=e.showModal,n=e.onClose,a=e.onSubmit,r=e.errorMsg,i=eS();return Object(qe.jsx)(qe.Fragment,{children:Object(qe.jsx)(Kh,{title:"New note",closeOnBackdropClick:!0,width:416,height:472,handleClose:n,open:t,children:Object(qe.jsx)(mn.e,{validateOnBlur:!1,validateOnChange:!1,initialValues:tS,validationSchema:nS,onSubmit:function(e){var t=e.title,n=e.content;a({title:t,content:n})},children:Object(qe.jsxs)(mn.d,{id:"note-form",className:i.form,children:[Object(qe.jsx)(mn.b,{name:"title",autofocus:!0,size:"md",autoComplete:"off",width:350,component:di,label:"Note title"}),Object(qe.jsx)(mn.b,{name:"content",size:"sm",autoComplete:"off",width:350,component:di,multiline:!0,rows:11,label:"Note content"}),Object(qe.jsxs)("div",{className:i.footer,children:[r&&Object(qe.jsx)(il,{children:r}),Object(qe.jsx)(An,{type:"submit",form:"note-form",className:i.submit,children:"Add note"})]})]})})})})},rS=n(1099),iS=Object(f.a)(KN),oS=function(e){var t=rS.a(/\n/)(e);return T.a((function(e,n){return n===t.length?Object(qe.jsx)(qe.Fragment,{children:e}):Object(qe.jsxs)(qe.Fragment,{children:[e,Object(qe.jsx)("br",{})]})}),t)},lS=function(e){var t=e.note,n=e.deleteNote,a=e.handleClick,r=e.timezone,i=iS();return Object(qe.jsx)("div",{className:i.noteCardWrapper,children:Object(qe.jsxs)(Un.a,{className:i.noteCardChip,onClick:function(){return a(t)},children:[Object(qe.jsxs)("div",{className:i.noteCardHeader,children:[Object(qe.jsxs)("div",{className:i.noteCardTitle,children:[Object(qe.jsx)(Xe,{noMargin:!0,children:null===t||void 0===t?void 0:t.title}),Object(qe.jsx)(Ke,{noMargin:!0,children:fd(null===t||void 0===t?void 0:t.created,r,"yyyy-MM-dd")})]}),Object(qe.jsx)("div",{children:Object(qe.jsx)(Oh,{className:i.deleteIcon,onClick:function(e){e.stopPropagation(),n({noteId:t.id})}})})]}),Object(qe.jsx)(Ke,{noMargin:!0,className:i.noteCardContent,children:oS(null===t||void 0===t?void 0:t.content)})]})})},cS=n(1150),sS=n(1100);function dS(){return(dS=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function uS(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var mS=a.createElement("desc",null,"Created with Sketch."),hS=a.createElement("defs",null,a.createElement("polygon",{id:"path-1",points:"0 21 21 21 21 0 0 0"})),pS=a.createElement("g",{id:"icon/sf-small/save/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"Group"},a.createElement("g",{id:"Group-10"},a.createElement("g",{id:"Group-6"},a.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"}),a.createElement("mask",{id:"mask-2",fill:"white"},a.createElement("use",{xlinkHref:"#path-1"})),a.createElement("g",{id:"Clip-4"}),a.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"}))),a.createElement("circle",{id:"Oval",stroke:"#1B2559",strokeWidth:2,cx:11,cy:14,r:3})));function bS(e,t){var n=e.title,r=e.titleId,i=uS(e,["title","titleId"]);return a.createElement("svg",dS({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":r},i),n?a.createElement("title",{id:r},n):null,mS,hS,pS)}var fS=a.forwardRef(bS),jS=(n.p,Object(f.a)(KN)),gS=function(e){var t=e.note,n=e.cancel,r=e.edit,i=e.timezone,o=Object(a.useRef)(),l=jS(),c=xn.f().shape({content:xn.h()}),s={content:t.content};return Object(qe.jsxs)(Un.a,{className:l.editCardChip,children:[Object(qe.jsxs)("div",{className:l.editCardHeader,children:[Object(qe.jsxs)(Ke,{noMargin:!0,children:["Last edited ",Object(cS.a)({delimited:", "},Object(sS.a)({start:bd(new Date(t.lastEditedAt),i),end:bd(new Date,i)}))," ago"]}),Object(qe.jsxs)("div",{className:l.editCardActions,children:[Object(qe.jsx)(He,{color:"primary",type:"button",Icon:fj,InverseIcon:ba,onClick:n,children:"Cancel"}),Object(qe.jsx)(He,{color:"primary",type:"submit",form:"edit-note",Icon:fS,InverseIcon:yN,children:"Save changes"}),Object(qe.jsx)(He,{color:"primary",type:"button",Icon:fj,InverseIcon:ba,onClick:function(){return o.current.setFieldValue("content","")},children:"Clear content"})]})]}),Object(qe.jsx)(mn.e,{validateOnChange:!1,validateOnBlur:!1,validationSchema:c,initialValues:s,onSubmit:function(e){var n=e.content;return r({noteId:t.id,newContent:n,oldContent:t.content})},innerRef:o,children:Object(qe.jsx)(mn.d,{id:"edit-note",children:Object(qe.jsx)(mn.b,{name:"content",component:di,className:l.editNotesContent,size:"sm",autoComplete:"off",fullWidth:!0,multiline:!0,rows:15})})})]})},OS=Object(f.a)(ZN),xS=function(e){var t,n=e.customer,r=e.createNote,i=e.deleteNote,o=e.editNote,c=e.timezone,s=OS(),d=Object(a.useState)(!1),u=Object(l.a)(d,2),m=u[0],h=u[1],p=Object(a.useState)(null),b=Object(l.a)(p,2),f=b[0],j=b[1],g=oy.a((function(e,t){return new Date(null===t||void 0===t?void 0:t.created).getTime()-new Date(null===e||void 0===e?void 0:e.created).getTime()}),null!==(t=n.notes)&&void 0!==t?t:[]),O=function(){h(!1)};return Object(qe.jsxs)("div",{children:[Object(qe.jsx)("div",{className:s.header,children:Object(qe.jsx)(Xe,{className:s.title,children:"Notes"})}),D.a(f)&&Object(qe.jsxs)("div",{className:s.notesChipList,children:[Object(qe.jsx)(YN,{setOpenModal:h}),T.a((function(e){return Object(qe.jsx)(lS,{note:e,deleteNote:i,handleClick:j,timezone:c})}),g)]}),!D.a(f)&&Object(qe.jsx)(gS,{note:f,cancel:function(){j(null)},edit:function(e){gn.a(e.newContent,e.oldContent)||o({noteId:e.noteId,newContent:e.newContent}),j(null)},timezone:c}),m&&Object(qe.jsx)(aS,{showModal:m,onClose:O,onSubmit:function(e){return r(e),O()}})]})},vS=n(535),yS=n(1101);function wS(){return(wS=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function CS(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var kS=a.createElement("g",{id:"icon/ID/photo/new/comet",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.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:"#5F668A",strokeWidth:1.6}));function ES(e,t){var n=e.title,r=e.titleId,i=CS(e,["title","titleId"]);return a.createElement("svg",wS({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":r},i),void 0===n?a.createElement("title",{id:r},"icon/ID/photo/new/comet"):n?a.createElement("title",{id:r},n):null,kS)}var NS,SS,IS,LS,PS,FS,DS,TS,RS,BS,AS,MS,WS,zS,qS,$S,HS=a.forwardRef(ES),VS=(n.p,{header:{display:"flex",flexDirection:"row"},title:{marginTop:7,marginRight:24,marginBottom:32},photosChipList:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:14},image:{objectFit:"cover",objectPosition:"center",width:224,height:200,borderTopLeftRadius:4,borderTopRightRadius:4},photoCardChip:{cursor:"pointer"},footer:{display:"flex",flexDirection:"row",margin:[[8,0,0,8]]},date:{margin:[[0,0,8,12]]}}),US=Object(f.a)(VS),GS=function(e){var t=e.idx,n=e.date,a=e.src,r=e.setPhotosDialog,i=e.setPhotoClickIndex,o=US();return Object(qe.jsxs)(Un.a,{className:o.photoCardChip,onClick:function(){i(t),r(!0)},children:[Object(qe.jsx)("img",{className:o.image,src:a,alt:""}),Object(qe.jsxs)("div",{className:o.footer,children:[Object(qe.jsx)(HS,{}),Object(qe.jsx)(rt,{className:o.date,children:Object(hd.a)("yyyy-MM-dd",new Date(n))})]})]})},XS=function(e){var t=e.photosData,n=e.timezone,r=US(),i=Object(a.useState)(!1),o=Object(l.a)(i,2),c=o[0],s=o[1],d=Object(a.useState)(null),u=Object(l.a)(d,2),m=u[0],h=u[1],p=D.a(m)?t:P.a(ml.a,vS.a,yS.a(m))(t);return Object(qe.jsxs)("div",{children:[Object(qe.jsx)("div",{className:r.header,children:Object(qe.jsx)(Xe,{className:r.title,children:"Photos & files"})}),Object(qe.jsx)("div",{className:r.photosChipList,children:t.map((function(e,t){return Object(qe.jsx)(GS,{idx:t,date:e.date,src:"".concat(Mj,"/").concat(e.photoDir,"/").concat(e.path),setPhotosDialog:s,setPhotoClickIndex:h})}))}),Object(qe.jsx)(Xk,{open:c,title:"Photo roll",data:Object(qe.jsx)(uE,{photosData:p,timezone:n}),onDissmised:function(){s(!1),h(null)}})]})},_S={labelLink:{cursor:"pointer",color:$},breadcrumbs:{margin:[[20,0]]},actionLabel:{color:$,margin:[[4,0]]},customerDetails:{marginBottom:18},actionButton:{margin:[[0,0,4,0]],display:"flex",flexDirection:"row",justifyContent:"center"},actionBar:{display:"flex",flexDirection:"column",width:219},panels:{display:"flex"},rightSidePanel:{display:"block",width:1100,marginBottom:25},leftSidePanel:{width:300,"& > *":{marginBottom:25},"& > *:last-child":{marginBottom:0},"& > *:first-child":{marginBottom:50}},userStatusAction:{display:"flex",flexDirection:"row",alignItems:"center",backgroundColor:re,borderRadius:8,padding:[[0,5]]},closeButton:{display:"flex",padding:[[16,16,0,16]],paddingRight:12,justifyContent:"end"},dialogTitle:{margin:[[0,16,8,40]]},dialogContent:{width:615,marginLeft:16},dialogActions:{padding:32,paddingTop:16},cancelButton:{marginRight:8,padding:0},errorMessage:{marginLeft:38}},ZS=Object(f.a)(_S),KS=x()(NS||(NS=Object(c.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 idCardPhotoAt\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 isTestCustomer\n subscriberInfo\n phoneOverride\n customFields {\n id\n label\n value\n }\n notes {\n id\n customerId\n title\n content\n created\n lastEditedAt\n }\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 customInfoRequests {\n customerId\n override\n overrideBy\n overrideAt\n customerData\n customInfoRequest {\n id\n enabled\n customRequest\n }\n }\n }\n }\n"]))),QS=x()(SS||(SS=Object(c.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 phoneOverride\n }\n }\n"]))),YS=x()(IS||(IS=Object(c.a)(["\n mutation editCustomer($customerId: ID!, $customerEdit: CustomerEdit) {\n editCustomer(customerId: $customerId, customerEdit: $customerEdit) {\n id\n idCardData\n usSsn\n }\n }\n"]))),JS=x()(LS||(LS=Object(c.a)(["\n mutation replacePhoto(\n $customerId: ID!\n $photoType: String\n $newPhoto: Upload\n ) {\n replacePhoto(\n customerId: $customerId\n photoType: $photoType\n newPhoto: $newPhoto\n ) {\n id\n newPhoto\n photoType\n }\n }\n"]))),eI=x()(PS||(PS=Object(c.a)(["\n mutation deleteEditedData($customerId: ID!, $customerEdit: CustomerEdit) {\n deleteEditedData(customerId: $customerId, customerEdit: $customerEdit) {\n id\n frontCameraPath\n idCardData\n idCardPhotoPath\n usSsn\n }\n }\n"]))),tI=x()(FS||(FS=Object(c.a)(["\n mutation setAuthorizedCustomRequest(\n $customerId: ID!\n $infoRequestId: ID!\n $override: String!\n ) {\n setAuthorizedCustomRequest(\n customerId: $customerId\n infoRequestId: $infoRequestId\n override: $override\n )\n }\n"]))),nI=x()(DS||(DS=Object(c.a)(["\n mutation setCustomerCustomInfoRequest(\n $customerId: ID!\n $infoRequestId: ID!\n $data: JSON!\n ) {\n setCustomerCustomInfoRequest(\n customerId: $customerId\n infoRequestId: $infoRequestId\n data: $data\n )\n }\n"]))),aI=x()(TS||(TS=Object(c.a)(["\n mutation createCustomerNote(\n $customerId: ID!\n $title: String!\n $content: String!\n ) {\n createCustomerNote(\n customerId: $customerId\n title: $title\n content: $content\n )\n }\n"]))),rI=x()(RS||(RS=Object(c.a)(["\n mutation deleteCustomerNote($noteId: ID!) {\n deleteCustomerNote(noteId: $noteId)\n }\n"]))),iI=x()(BS||(BS=Object(c.a)(["\n mutation editCustomerNote($noteId: ID!, $newContent: String!) {\n editCustomerNote(noteId: $noteId, newContent: $newContent)\n }\n"]))),oI=x()(AS||(AS=Object(c.a)(["\n mutation enableTestCustomer($customerId: ID!) {\n enableTestCustomer(customerId: $customerId)\n }\n"]))),lI=x()(MS||(MS=Object(c.a)(["\n mutation disableTestCustomer($customerId: ID!) {\n disableTestCustomer(customerId: $customerId)\n }\n"]))),cI=x()(WS||(WS=Object(c.a)(["\n query getData {\n config\n }\n"]))),sI=x()(zS||(zS=Object(c.a)(["\n mutation addCustomField($customerId: ID!, $label: String!, $value: String!) {\n addCustomField(customerId: $customerId, label: $label, value: $value)\n }\n"]))),dI=x()(qS||(qS=Object(c.a)(["\n mutation saveCustomField($customerId: ID!, $fieldId: ID!, $value: String!) {\n saveCustomField(customerId: $customerId, fieldId: $fieldId, value: $value)\n }\n"]))),uI=x()($S||($S=Object(c.a)(["\n query customInfoRequests($onlyEnabled: Boolean) {\n customInfoRequests(onlyEnabled: $onlyEnabled) {\n id\n customRequest\n }\n }\n"]))),mI=Object(a.memo)((function(){var e,t,n,r,i,o=Object(w.h)(),c=Object(a.useState)(!1),s=Object(l.a)(c,2),d=s[0],m=s[1],h=Object(a.useState)(!1),p=Object(l.a)(h,2),b=p[0],f=p[1],j=Object(a.useState)(!1),g=Object(l.a)(j,2),O=g[0],x=g[1],v=Object(a.useState)(null),y=Object(l.a)(v,2),C=y[0],k=y[1],E=Object(a.useState)("overview"),N=Object(l.a)(E,2),S=N[0],I=N[1],L=Object(w.j)().id,P=Object(u.c)(KS,{variables:{customerId:L}}),F=P.data,D=P.refetch,B=P.loading,M=Object(u.c)(cI),W=M.data,z=M.loading,q=Object(u.c)(uI,{variables:{onlyEnabled:!0}}).data,$=Object(u.b)(sI,{onCompleted:function(){return D()}}),H=Object(l.a)($,1)[0],V=Object(u.b)(dI,{onCompleted:function(){return D()}}),U=Object(l.a)(V,1)[0],G=Object(u.b)(JS,{onCompleted:function(){return D()}}),X=Object(l.a)(G,1)[0],_=Object(u.b)(YS,{onCompleted:function(){return D()}}),Z=Object(l.a)(_,1)[0],K=Object(u.b)(eI,{onCompleted:function(){return D()}}),Q=Object(l.a)(K,1)[0],Y=Object(u.b)(QS,{onCompleted:function(){D(),m(!1)},onError:function(e){return k(e)}}),J=Object(l.a)(Y,1)[0],ee=Object(u.b)(tI,{onCompleted:function(){return D()}}),te=Object(l.a)(ee,1)[0],ne=Object(u.b)(nI,{onCompleted:function(){return D()}}),ae=Object(l.a)(ne,1)[0],re=Object(u.b)(aI,{onCompleted:function(){return D()}}),ie=Object(l.a)(re,1)[0],oe=Object(u.b)(rI,{onCompleted:function(){return D()}}),le=Object(l.a)(oe,1)[0],ce=Object(u.b)(iI,{onCompleted:function(){return D()}}),se=Object(l.a)(ce,1)[0],de=Object(u.b)(oI,{variables:{customerId:L},onCompleted:function(){return D()}}),ue=Object(l.a)(de,1)[0],me=Object(u.b)(lI,{variables:{customerId:L},onCompleted:function(){return D()}}),he=Object(l.a)(me,1)[0],pe=function(e){return J({variables:{customerId:L,customerInput:e}})},be=function(e){X({variables:{customerId:L,newPhoto:e.newPhoto,photoType:e.photoType}}),x(null)},fe=function(e){Z({variables:{customerId:L,customerEdit:e}}),x(null)},je=null!==(e=A.a(["config"])(F))&&void 0!==e?e:[],ge=je&&ds(ts,je),Oe=null!==(t=A.a(["customer"])(F))&&void 0!==t?t:[],xe=null!==(n=A.a(["transactions"])(Oe))&&void 0!==n?n:[],ve=oy.a(Gw.a(R.a("cryptoAtoms")))(xe),ye=vk(Oe),we=A.a(["authorizedOverride"])(Oe)===cC,Ce=Oe.isSuspended,ke="customerData"===S,Ee="overview"===S,Ne="notes"===S,Se="photos"===S,Ie=Vm.a(["frontCameraPath","frontCameraAt"])(Oe),Le=ve&&T.a(Vm.a(["id","txCustomerPhotoPath","txCustomerPhotoAt"]))(ve),Pe=zk(Cd.a(Ie,Le)),Fe=Oe.idCardPhotoPath?[{photoDir:"id-card-photo",path:Oe.idCardPhotoPath,date:Oe.idCardPhotoAt}]:[],De=B||z,Te=A.a(["config","locale_timezone"],W),Re=null!==(r=null===q||void 0===q||null===(i=q.customInfoRequests)||void 0===i?void 0:i.map((function(e){return{value:e.id,display:e.customRequest.name}})))&&void 0!==r?r:[],Be=ZS();return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsxs)(em.a,{classes:{root:Be.breadcrumbs},separator:Object(qe.jsx)(nm.a,{fontSize:"small"}),"aria-label":"breadcrumb",children:[Object(qe.jsx)(at,{noMargin:!0,className:Be.labelLink,onClick:function(){return o.push("/compliance/customers")},children:"Customers"}),Object(qe.jsx)(rt,{noMargin:!0,className:Be.labelLink,children:ye.length?ye:xk(A.a(["phone"])(Oe),ge.country)})]}),Object(qe.jsxs)("div",{className:Be.panels,children:[Object(qe.jsx)("div",{className:Be.leftSidePanel,children:!De&&!Oe.isAnonymous&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(rN,{isSelected:function(e){return e===S},onClick:function(e){return I(e)}}),Object(qe.jsxs)("div",{children:[Object(qe.jsx)(at,{className:Be.actionLabel,children:"Actions"}),Object(qe.jsxs)("div",{className:Be.actionBar,children:[Object(qe.jsx)(He,{className:Be.actionButton,color:"primary",Icon:LC,InverseIcon:kC,onClick:function(){return x(!0)},children:"Manual data entry"}),Ce&&Object(qe.jsx)(He,{className:Be.actionButton,color:"primary",Icon:rC,InverseIcon:Yw,onClick:function(){return pe({suspendedUntil:null})},children:"Unsuspend customer"}),Object(qe.jsx)(He,{color:"primary",className:Be.actionButton,Icon:we?rC:xC,InverseIcon:we?Yw:pC,onClick:function(){return pe({authorizedOverride:we?lC:cC})},children:"".concat(we?"Authorize":"Block"," customer")})]})]}),Object(qe.jsxs)("div",{children:[Object(qe.jsx)(at,{className:Be.actionLabel,children:"Special user status"}),Object(qe.jsx)("div",{className:Be.actionBar,children:Object(qe.jsxs)("div",{className:Be.userStatusAction,children:[Object(qe.jsx)(Lr,{checked:!!A.a(["isTestCustomer"])(Oe),value:!!A.a(["isTestCustomer"])(Oe),onChange:function(){return A.a(["isTestCustomer"])(Oe)?he():ue()}}),"Test user"]})})]})]})}),Object(qe.jsxs)("div",{className:Be.rightSidePanel,children:[Ee&&Object(qe.jsxs)("div",{children:[Object(qe.jsx)(nl.a,{className:Be.customerDetails,display:"flex",justifyContent:"space-between",children:Object(qe.jsx)(bE,{customer:Oe,photosData:Pe,locale:ge,setShowCompliance:function(){return f(!b)},timezone:Te})}),Object(qe.jsx)("div",{children:Object(qe.jsx)(FN,{customer:Oe,data:ve,locale:ge,loading:De})})]}),ke&&Object(qe.jsx)("div",{children:Object(qe.jsx)(_N,{locale:ge,customer:Oe,updateCustomer:pe,replacePhoto:be,editCustomer:fe,deleteEditedData:function(e){return Q({variables:{customerId:L,customerEdit:e}})},updateCustomRequest:ae,authorizeCustomRequest:te,updateCustomEntry:function(e){U({variables:{customerId:L,fieldId:e.fieldId,value:e.value}})},setRetrieve:m,retrieveAdditionalDataDialog:Object(qe.jsx)(hI,{onDismissed:function(){k(null),m(!1)},onConfirmed:function(){k(null),J({variables:{customerId:L,customerInput:{subscriberInfo:!0}}})},error:C,open:d})})}),Ne&&Object(qe.jsx)("div",{children:Object(qe.jsx)(xS,{customer:Oe,createNote:function(e){return ie({variables:{customerId:L,title:e.title,content:e.content}})},deleteNote:function(e){return le({variables:{noteId:e.noteId}})},editNote:function(e){return se({variables:{noteId:e.noteId,newContent:e.newContent}})},timezone:Te})}),Se&&Object(qe.jsx)("div",{children:Object(qe.jsx)(XS,{photosData:hl.a(Pe,Fe),timezone:Te})})]}),O&&Object(qe.jsx)(Hk,{error:null===C||void 0===C?void 0:C.message,save:function(e){H({variables:{customerId:L,label:e.title,value:e.data}}),x(null)},addPhoto:be,addCustomerData:fe,onClose:function(){return x(null)},customInfoRequirementOptions:Re})]})]})})),hI=function(e){var t=e.onConfirmed,n=e.onDismissed,a=e.open,r=e.error,i=e.props,o=ZS();return Object(qe.jsxs)(cn.a,Object(s.a)(Object(s.a)({open:a,"aria-labelledby":"form-dialog-title",PaperProps:{style:{borderRadius:8,minWidth:656,bottom:125,right:7}}},i),{},{children:[Object(qe.jsx)("div",{className:o.closeButton,children:Object(qe.jsx)(ta,{size:16,"aria-label":"close",onClick:function(){return n(!1)},children:Object(qe.jsx)($i,{})})}),Object(qe.jsx)(Ge,{className:o.dialogTitle,children:"Retrieve API data from Twilio"}),Object(qe.jsxs)(sn.a,{className:o.dialogContent,children:[Object(qe.jsx)(Je,{children:"With this action you'll be using Twilio's API to retrieve additional\n data from this user. This includes name and address, if available.\n"}),Object(qe.jsx)(Je,{children:" There is a small cost from Twilio for each retrieval. Would you like\n to proceed?"})]}),r&&Object(qe.jsx)(il,{className:o.errorMessage,children:"Failed to fetch additional data"}),Object(qe.jsxs)(Um.a,{className:o.dialogActions,children:[Object(qe.jsx)(An,{backgroundColor:"grey",className:o.cancelButton,onClick:function(){return n(!1)},children:"Cancel"}),Object(qe.jsx)(An,{onClick:function(){t()},children:"Confirm"})]})]}))},pI=mI,bI=n(564),fI=n(1138),jI=n(576),gI=Wn.baseButton,OI=gI.height/2,xI=gI.height/4,vI="rgba(0, 0, 0, 0.08)",yI="0 4px 4px 0 ".concat(vI),wI={size:function(e){var t=e.size;return Object(s.a)({marginTop:"lg"===t?0:2},Ha(t))},bold:Va,autocomplete:{'&[data-focus="true"]':{backgroundColor:vI}},popup:{display:"flex",flexDirection:"column",borderRadius:[[0,0,xI,xI]],backgroundColor:G,boxShadow:yI},separator:{width:"88%",height:1,margin:"0 auto",border:"solid 0.5px",borderColor:$},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:$,margin:[0]},input:{display:"flex",flex:1,width:273,padding:[[8,12]],alignItems:"center",height:32,borderRadius:OI,backgroundColor:G,color:J},inputWithPopup:{borderRadius:[[xI,xI,0,0]],boxShadow:yI},iconButton:{marginRight:12}},CI=Object(f.a)(wI),kI=Object(a.memo)((function(e){var t,n=e.loading,r=void 0!==n&&n,i=e.filters,o=void 0===i?[]:i,c=e.options,d=void 0===c?[]:c,u=e.inputPlaceholder,m=void 0===u?"":u,h=e.size,p=e.onChange,b=Object(q.a)(e,["loading","filters","options","inputPlaceholder","size","onChange"]),f=CI({size:h}),j=Object(a.useState)(!1),g=Object(l.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 p(e)};return Object(qe.jsx)(Ra.a,Object(s.a)({loading:r,classes:{option:f.autocomplete},value:o,options:d,getOptionLabel:function(e){return e.value},renderOption:function(e){return Object(qe.jsxs)("div",{className:f.item,children:[Object(qe.jsx)(Ke,{className:f.itemLabel,children:e.value}),Object(qe.jsx)(Ke,{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(qe.jsxs)(Un.a,{elevation:0,className:f.popup,children:[Object(qe.jsx)("div",{className:f.separator}),t]})},renderInput:function(e){return Object(qe.jsx)(jI.a,Object(s.a)(Object(s.a)({ref:e.InputProps.ref},e),{},{className:I()(v),startAdornment:Object(qe.jsx)($C,{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)}},b))}));function EI(){return(EI=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function NI(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var SI=a.createElement("g",{id:"icon/button/filter/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.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 II(e,t){var n=e.title,r=e.titleId,i=NI(e,["title","titleId"]);return a.createElement("svg",EI({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":r},i),void 0===n?a.createElement("title",{id:r},"icon/button/filter/white"):n?a.createElement("title",{id:r},n):null,SI)}var LI=a.forwardRef(II);n.p;function PI(){return(PI=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function FI(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var DI=a.createElement("g",{id:"icon/button/filter/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.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 TI(e,t){var n=e.title,r=e.titleId,i=FI(e,["title","titleId"]);return a.createElement("svg",PI({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":r},i),void 0===n?a.createElement("title",{id:r},"icon/button/filter/zodiac"):n?a.createElement("title",{id:r},n):null,DI)}var RI,BI,AI,MI,WI=a.forwardRef(TI),zI=(n.p,{root:{marginLeft:0,height:20,backgroundColor:G,"&:hover, &:focus, &:active":{backgroundColor:G},marginBottom:"auto"},label:{fontSize:ke,fontWeight:Ie,fontFamily:Le,paddingRight:0,paddingLeft:8,color:J}}),qI={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"}},$I=Object(f.a)(zI),HI=Object(f.a)(qI),VI=function(e){var t=e.filters,n=e.onFilterDelete,a=e.deleteAllFilters,r=e.entries,i=void 0===r?0:r,o=$I(),l=HI();return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(Ke,{className:l.text,children:"Filters:"}),Object(qe.jsxs)("div",{className:l.filters,children:[Object(qe.jsx)("div",{className:l.chips,children:t.map((function(e,t){return Object(qe.jsx)(zr,{classes:o,label:"".concat(Mm(e.type),": ").concat(e.value),onDelete:function(){return n(e)},deleteIcon:Object(qe.jsx)($i,{className:l.button})},t)}))}),Object(qe.jsxs)("div",{className:l.deleteWrapper,children:[Object(qe.jsx)(it,{className:l.entries,children:"".concat(i," ").concat(qm(i,"entry","entries"))}),Object(qe.jsx)(He,{color:"secondary",Icon:WI,InverseIcon:LI,className:l.deleteButton,onClick:a,children:"Delete filters"})]})]})]})},UI=Object(f.a)(Vk),GI=function(e){var t=e.data,n=e.locale,a=e.onClick,r=e.loading,i=(e.triggers,e.customRequests,UI()),o=[{header:"Phone",width:199,view:function(e){return xk(e.phone,n.country)}},{header:"Name",width:241,view:vk},{header:"Total TXs",width:126,textAlign:"right",view:function(e){return"".concat(Number.parseInt(e.totalTxs))}},{header:"Total spent",width:152,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:133,view:function(e){var t;return null!==(t=e.lastActive&&Object(hd.a)("yyyy-MM-dd",new Date(e.lastActive)))&&void 0!==t?t:""}},{header:"Last transaction",width:161,textAlign:"right",view:function(e){var t,n=!D.a(e.lastTxFiatCode),a="cashOut"===e.lastTxClass?zc:Dc,r=Object(qe.jsx)(a,{className:i.txClassIconRight});return Object(qe.jsxs)(qe.Fragment,{children:[n&&"".concat(parseFloat(e.lastTxFiat)," ").concat(null!==(t=e.lastTxFiatCode)&&void 0!==t?t:""),n&&r]})}},{header:"Status",width:191,view:function(e){return Object(qe.jsx)(Mu,{statuses:[e.authorizedStatus]})}}];return Object(qe.jsx)(qe.Fragment,{children:Object(qe.jsx)(Ay,{loading:r,emptyText:"No customers so far",elements:o,data:t,onClick:a})})},XI=n(400),_I={modalTitle:{marginTop:-5,color:J,fontFamily:je},footer:{display:"flex",flexDirection:"row",margin:[["auto",0,24,0]]},form:{display:"flex",flexDirection:"column",height:"100%"},submit:{margin:[["auto",0,0,"auto"]]}},ZI=XI.PhoneNumberUtil.getInstance(),KI=function(e,t){var n=Aa.a((function(e){var n=ZI.parseAndKeepRawInput(t,e);return ZI.isValidNumber(n)}),e),a=ZI.parseAndKeepRawInput(t,n);return ZI.format(a,XI.PhoneNumberFormat.E164)},QI={phoneNumber:""},YI=Object(f.a)(_I),JI=function(e,t){return e&&t&&e.phoneNumber&&t.phoneNumber?e.phoneNumber:null},eL=function(e){var t,n,a=e.showModal,r=e.handleClose,i=e.onSubmit,o=e.locale,l=YI(),c=Cd.a(null===o||void 0===o?void 0:o.country,T.a((function(e){return e.country}),null!==(t=null===o||void 0===o?void 0:o.overrides)&&void 0!==t?t:[]));return Object(qe.jsx)(Kh,{closeOnBackdropClick:!0,width:600,height:300,handleClose:r,open:a,children:Object(qe.jsx)(mn.e,{validationSchema:(n=c,xn.f().shape({phoneNumber:xn.h().required("A phone number is required").test("is-valid-number","That is not a valid phone number",(function(e){try{var t=T.a((function(t){var n=ZI.parseAndKeepRawInput(e,t);return ZI.isValidNumber(n)}),n);return jn.a((function(e){return!0===e}),t)}catch(a){}})).trim()})),initialValues:QI,validateOnChange:!1,onSubmit:function(e){i({variables:{phoneNumber:KI(c,e.phoneNumber)}})},children:function(e){var t=e.errors,n=e.touched;return Object(qe.jsxs)(mn.d,{id:"customer-registration-form",className:l.form,children:[Object(qe.jsx)(Ue,{className:l.modalTitle,children:"Create new customer"}),Object(qe.jsx)(mn.b,{component:di,name:"phoneNumber",width:338,autoFocus:!0,label:"Phone number"}),Object(qe.jsxs)("div",{className:l.footer,children:[JI(t,n)&&Object(qe.jsx)(il,{children:JI(t,n)}),Object(qe.jsx)(An,{type:"submit",form:"customer-registration-form",className:l.submit,children:"Finish"})]})]})}})})},tL=x()(RI||(RI=Object(c.a)(["\n query filters {\n customerFilters {\n type\n value\n }\n }\n"]))),nL=x()(BI||(BI=Object(c.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 frontCameraPath\n frontCameraOverride\n idCardPhotoPath\n idCardPhotoOverride\n idCardData\n idCardDataOverride\n usSsn\n usSsnOverride\n sanctions\n sanctionsOverride\n daysSuspended\n isSuspended\n customInfoRequests {\n customerId\n infoRequestId\n override\n overrideAt\n overrideBy\n customerData\n customInfoRequest {\n id\n enabled\n customRequest\n }\n }\n }\n customInfoRequests {\n id\n }\n }\n"]))),aL=x()(AI||(AI=Object(c.a)(["\n mutation createCustomer($phoneNumber: String) {\n createCustomer(phoneNumber: $phoneNumber) {\n phone\n }\n }\n"]))),rL=Object(f.a)(yf),iL=function(e){return gs.a((function(e,t){return Object(s.a)(Object(s.a)({},e),{},Object(z.a)({},t.type,t.value))}),{},e)},oL=function(){var e,t,n=rL(),r=Object(w.h)(),i=Object(a.useState)([]),o=Object(l.a)(i,2),c=o[0],s=o[1],d=Object(a.useState)({}),m=Object(l.a)(d,2),h=m[0],p=m[1],b=Object(a.useState)([]),f=Object(l.a)(b,2),j=f[0],g=f[1],O=Object(a.useState)(!1),x=Object(l.a)(O,2),v=x[0],y=x[1],C=Object(u.c)(nL,{variables:h,onCompleted:function(e){return s(A.a(["customers"])(e))}}),k=C.data,E=C.loading,N=C.refetch,S=Object(u.c)(tL),I=S.data,P=S.loading,F=Object(u.b)(aL,{onCompleted:function(){return y(!1)},refetchQueries:function(){return[{query:nL,variables:h}]}}),B=Object(l.a)(F,1)[0],W=null!==(e=A.a(["config"])(k))&&void 0!==e?e:[],z=null!==(t=A.a(["customInfoRequests"],k))&&void 0!==t?t:[],q=W&&ds(ts,W),$=W&&ds(os,W),H=Lu.a(T.a((function(e){return bI.a("authorizedStatus",function(e,t,n){var a=hl.a(["frontCamera","idCardData","idCardPhoto","usSsn","sanctions"],T.a((function(e){return e.id}),n)),r=["frontCamera","idCardPhoto"],i=function(e){var n,a,r=gn.a(e,"frontCamera")?"facephoto":e,i=M.a((function(e){return gn.a(On.a(e.automation),Yh)}),null!==(n=null===t||void 0===t?void 0:t.overrides)&&void 0!==n?n:[]);return!!Aa.a((function(e){return gn.a(e.requirement,r)}),i)||gn.a(On.a(null!==(a=t.automation)&&void 0!==a?a:""),Yh)},o=T.a((function(t){if(i(t)){if(fk.a(t)){var n=Aa.a((function(e){return e.infoRequestId===t}),e.customInfoRequests);return!D.a(n)&&gn.a(n.override,"automatic")}var a=L.a(t,r)?e["".concat(t,"Path")]:e["".concat(t)];return!D.a(a)&&gn.a(e["".concat(t,"Override")],"automatic")}return!1}),a),l=T.a((function(t){if(i(t)){if(fk.a(t)){var n=Aa.a((function(e){return e.infoRequestId===t}),e.customInfoRequests);return!D.a(n)&&gn.a(n.override,"blocked")}var a=L.a(t,r)?e["".concat(t,"Path")]:e["".concat(t)];return!D.a(a)&&gn.a(e["".concat(t,"Override")],"blocked")}return!1}),a);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"}:jn.a((function(e){return!0===e}),l)?{label:"Rejected",type:"error"}:jn.a((function(e){return!0===e}),o)?{label:"Pending",type:"warning"}:{label:"Authorized",type:"success"}}(e,$,z),e)})),um.a([Pw.a((function(e){return"Pending"===e.authorizedStatus.label?0:1})),Gw.a((function(e){var t;return new Date(null!==(t=R.a("lastActive",e))&&void 0!==t?t:"0")}))]))(null!==c&&void 0!==c?c:[]),V=A.a(["customerFilters"])(I);return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(cl,{title:"Customers",appendix:Object(qe.jsx)("div",{className:n.buttonsWrapper,children:Object(qe.jsx)(kI,{loading:P,filters:j,options:V,inputPlaceholder:"Search customers",onChange:function(e){var t=iL(e);g(e),p({phone:t.phone,name:t.name,address:t.address,id:t.id}),N&&N()}})}),appendixRight:Object(qe.jsx)(nl.a,{display:"flex",children:Object(qe.jsx)(oa,{color:"primary",onClick:function(){return y(!0)},children:"Add new user"})}),labels:[{label:"Cash-in",icon:Object(qe.jsx)(Dc,{})},{label:"Cash-out",icon:Object(qe.jsx)(zc,{})}]}),j.length>0&&Object(qe.jsx)(VI,{entries:H.length,filters:j,onFilterDelete:function(e){var t=M.a((function(t){return!fI.a(Vm.a(["type","value"],t),e)}))(j);g(t);var n=iL(t);p({phone:n.phone,name:n.name,address:n.address,id:n.id}),N&&N()},deleteAllFilters:function(){g([]);var e=iL([]);p({phone:e.phone,name:e.name,address:e.address,id:e.id}),N&&N()}}),Object(qe.jsx)(GI,{data:H,locale:q,onClick:function(e){return r.push("/compliance/customer/".concat(e.id))},loading:E,triggers:$,customRequests:z}),Object(qe.jsx)(eL,{showModal:v,handleClose:function(){return y(!1)},locale:q,onSubmit:B})]})},lL=n(975),cL=Object(lL.a)({wrapper:{display:"flex",alignItems:"center"},colorIndicator:{borderRadius:3,height:12,width:12,marginRight:8}}),sL=function(e){var t=e.className,n=e.label,a=e.color,r=Object(q.a)(e,["className","label","color"]),i=cL();return Object(qe.jsxs)("div",Object(s.a)(Object(s.a)({className:I()(i.wrapper,t)},r),{},{children:[a&&Object(qe.jsx)("div",{className:i.colorIndicator,style:{backgroundColor:a}}),Object(qe.jsx)(at,Object(s.a)(Object(s.a)({},r),{},{children:n}))]}))},dL=Me.label1,uL=Me.mono,mL={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:he},coinTotal:{margin:"".concat(12,"px 0")},leftSpacer:{marginLeft:8},topSpacer:{marginTop:40},addressWrapper:{display:"flex",flexDirection:"column",flex:1,backgroundColor:re},address:{width:375,margin:"".concat(12,"px ").concat(24,"px")},itemWrapper:{textAlign:"end"},item:{extend:dL,margin:2},inactiveItem:{color:$},firstItem:{fontWeight:700,margin:2},total:{marginTop:"auto",textAlign:"right",marginRight:24},totalPending:{marginTop:2},totalTitle:{color:me,marginBottom:2},table:{marginTop:8,marginLeft:48},tableLabel:{justifyContent:"end",marginTop:-38},pending:{backgroundColor:le},copyToClipboard:{marginLeft:"auto",paddingTop:6,paddingLeft:15,marginRight:-11},mono:{extend:uL,width:375,margin:"".concat(12,"px ").concat(24,"px")}},hL=Object(f.a)(mL),pL=165,bL=140,fL=130,jL=x()(MI||(MI=Object(c.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"]))),gL=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Ff.utils.formatCryptoAddress(e,t).replace(/(.{4})/g,"$1 ")},OL=function(e,t){return e.plus(t)},xL=function(e){return new Hc.a(e).toFormat(2)},vL=function(e){return xL(e.filter((function(e){return!e.errorMsg})).map((function(e){return new Hc.a(e.fiatConfirmedBalance)})).reduce(OL,new Hc.a(0)))},yL=function(){var e,t=Object(a.useState)(null),n=Object(l.a)(t,2),r=n[0],i=n[1],o=Object(a.useState)(!1),c=Object(l.a)(o,1)[0],s=hL(),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)(jL),h=m.data,p=m.loading,b=null!==(e=A.a(["funding"])(h))&&void 0!==e?e:[];b.length&&!r&&i(b[0]);var f=xL(b.filter((function(e){return!e.errorMsg})).map((function(e){return new Hc.a(e.fiatPending)})).reduce(OL,new Hc.a(0))),j=function(e){return e>=0?"+":""};return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)("div",{children:Object(qe.jsx)(yn,{children:"Funding"})}),Object(qe.jsxs)("div",{className:s.wrapper,children:[Object(qe.jsx)(Ii,{data:b,isSelected:function(e){return r&&r.cryptoCode===e.cryptoCode},onClick:i,displayName:function(e){return e.display},itemRender:function(e,t){var n,a,r=(n={},Object(z.a)(n,s.item,!0),Object(z.a)(n,s.inactiveItem,!t),n),i=(a={},Object(z.a)(a,s.itemWrapper,!0),Object(z.a)(a,s.error,e.errorMsg),a);return Object(qe.jsxs)("div",{className:I()(i),children:[Object(qe.jsx)("div",{className:s.firstItem,children:e.display}),!e.errorMsg&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsxs)("div",{className:I()(r),children:[xL(e.fiatConfirmedBalance)," ",e.fiatCode]}),Object(qe.jsxs)("div",{className:I()(r),children:[e.confirmedBalance," ",e.cryptoCode]})]})]})},loading:p,children:b.length&&Object(qe.jsxs)("div",{className:s.total,children:[Object(qe.jsx)(at,{className:s.totalTitle,children:"Total Crypto Balance"}),Object(qe.jsxs)(Qe,{noMargin:!0,children:[vL(b),b[0].fiatCode]}),Object(qe.jsxs)(at,{className:s.totalPending,children:["(",j(f)," ",f," pending)"]})]})}),r&&!c&&r.errorMsg&&Object(qe.jsx)("div",{className:s.main,children:Object(qe.jsx)("div",{className:s.firstSide,children:Object(qe.jsx)(Je,{className:s.error,children:L.a("ECONNREFUSED",r.errorMsg)?"Couldn't establish connection with the node. Make sure it is installed and try again":r.errorMsg})})}),r&&!c&&!r.errorMsg&&Object(qe.jsxs)("div",{className:s.main,children:[Object(qe.jsxs)("div",{className:s.firstSide,children:[Object(qe.jsxs)(Xe,{children:["Balance (",r.display,")"]}),Object(qe.jsxs)("div",{className:s.coinTotal,children:[Object(qe.jsx)(Qe,{inline:!0,noMargin:!0,children:"".concat(r.confirmedBalance," ").concat(r.cryptoCode)}),Object(qe.jsx)(Ye,{inline:!0,noMargin:!0,className:s.leftSpacer,children:"(".concat(j(r.pending)," ").concat(r.pending," pending)")})]}),Object(qe.jsxs)("div",{className:s.coinTotal,children:[Object(qe.jsx)(Je,{inline:!0,noMargin:!0,children:"= ".concat(xL(r.fiatConfirmedBalance)," ").concat(r.fiatCode)}),Object(qe.jsx)(it,{inline:!0,noMargin:!0,className:s.leftSpacer,children:"(".concat(j(r.fiatPending)," ").concat(xL(r.fiatPending)," pending)")})]}),Object(qe.jsx)(Xe,{className:s.topSpacer,children:"Address"}),Object(qe.jsx)("div",{className:s.addressWrapper,children:Object(qe.jsx)("div",{className:s.mono,children:Object(qe.jsx)("strong",{children:Object(qe.jsx)(If,{buttonClassname:s.copyToClipboard,children:gL(r.cryptoCode,r.fundingAddress)},r.cryptoCode)})})})]}),Object(qe.jsxs)("div",{className:s.secondSide,children:[Object(qe.jsxs)(at,{children:["Scan to send ",r.display]}),Object(qe.jsx)(pn.a,{size:240,fgColor:J,value:r.fundingAddressUrl})]})]}),r&&c&&Object(qe.jsxs)("div",{children:[Object(qe.jsx)(sL,{className:s.tableLabel,label:"Pending",color:"#cacaca"}),Object(qe.jsxs)(vm,{className:s.table,children:[Object(qe.jsxs)(ym,{children:[Object(qe.jsx)(km,{header:!0,width:pL,children:"Amount Entered"}),Object(qe.jsx)(km,{header:!0,width:pL,children:"Balance After"}),Object(qe.jsx)(km,{header:!0,width:pL,children:"Cash Value"}),Object(qe.jsx)(km,{header:!0,width:fL,children:"Date"}),Object(qe.jsx)(km,{header:!0,width:bL,children:"Time (h:m:s)"}),Object(qe.jsx)(km,{header:!0,width:pL,children:"Performed By"})]}),Object(qe.jsx)(Cm,{children:d.map((function(e,t){return Object(qe.jsxs)(Sm,{className:I()(Object(z.a)({},s.pending,e.pending)),children:[Object(qe.jsxs)(km,{width:pL,children:[e.cryptoAmount," ",r.cryptoCode]}),Object(qe.jsxs)(km,{width:pL,children:[e.balance," ",r.cryptoCode]}),Object(qe.jsxs)(km,{width:pL,children:[e.fiatValue," ",r.fiatCode]}),Object(qe.jsx)(km,{width:fL,children:Object(hd.a)("yyyy-MM-dd",e.date)}),Object(qe.jsx)(km,{width:bL,children:Object(hd.a)("hh:mm:ss",e.date)}),Object(qe.jsx)(km,{width:pL,children:"add"})]},t)}))})]})]})]})]})};function wL(){return(wL=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function CL(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var kL=a.createElement("circle",{cx:52,cy:32,r:32,fill:"#F7931A"}),EL=a.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 NL(e,t){var n=e.title,r=e.titleId,i=CL(e,["title","titleId"]);return a.createElement("svg",wL({xmlns:"http://www.w3.org/2000/svg",width:104,height:64,ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,kL,EL)}var SL=a.forwardRef(NL);n.p;function IL(){return(IL=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function LL(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var PL=a.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"}),FL=a.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 DL(e,t){var n=e.title,r=e.titleId,i=LL(e,["title","titleId"]);return a.createElement("svg",IL({xmlns:"http://www.w3.org/2000/svg",width:104,height:64,ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,PL,FL)}var TL=a.forwardRef(DL);n.p;function RL(){return(RL=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function BL(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var AL=a.createElement("circle",{cx:1e3,cy:1e3,r:1e3,fill:"#2573c2"}),ML=a.createElement("g",{fill:"#fff"},a.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"}),a.createElement("path",{d:"M882.2 911.6H409l-63.6 176.2h478z"}));function WL(e,t){var n=e.title,r=e.titleId,i=BL(e,["title","titleId"]);return a.createElement("svg",RL({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2000 2000",width:2500,height:2500,ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,AL,ML)}var zL=a.forwardRef(WL);n.p;function qL(){return(qL=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function $L(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var HL=a.createElement("g",null,a.createElement("polygon",{fill:"#343434",points:"127.9611 0 125.1661 9.5 125.1661 285.168 127.9611 287.958 255.9231 212.32"}),a.createElement("polygon",{fill:"#8C8C8C",points:"127.962 0 0 212.32 127.962 287.959 127.962 154.158"}),a.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"}),a.createElement("polygon",{fill:"#8C8C8C",points:"127.962 416.9052 127.962 312.1852 0 236.5852"}),a.createElement("polygon",{fill:"#141414",points:"127.9611 287.9577 255.9211 212.3207 127.9611 154.1587"}),a.createElement("polygon",{fill:"#393939",points:"0.0009 212.3208 127.9609 287.9578 127.9609 154.1588"}));function VL(e,t){var n=e.title,r=e.titleId,i=$L(e,["title","titleId"]);return a.createElement("svg",qL({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":r},i),n?a.createElement("title",{id:r},n):null,HL)}var UL=a.forwardRef(VL);n.p;function GL(){return(GL=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function XL(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var _L=a.createElement("circle",{fill:"#989898",cx:52,cy:32,r:32}),ZL=a.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 KL(e,t){var n=e.title,r=e.titleId,i=XL(e,["title","titleId"]);return a.createElement("svg",GL({xmlns:"http://www.w3.org/2000/svg",width:104,height:64,ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,_L,ZL)}var QL=a.forwardRef(KL);n.p;function YL(){return(YL=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function JL(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var eP=a.createElement("path",{d:"M127.998 0C57.318 0 0 57.317 0 127.999c0 14.127 2.29 27.716 6.518 40.43H44.8V60.733l83.2 83.2 83.198-83.2v107.695h38.282c4.231-12.714 6.521-26.303 6.521-40.43C256 57.314 198.681 0 127.998 0",fill:"#F60"}),tP=a.createElement("path",{d:"M108.867 163.062l-36.31-36.311v67.765H18.623c22.47 36.863 63.051 61.48 109.373 61.48s86.907-24.617 109.374-61.48h-53.933V126.75l-36.31 36.31-19.13 19.129-19.128-19.128h-.002z",fill:"#4C4C4C"});function nP(e,t){var n=e.title,r=e.titleId,i=JL(e,["title","titleId"]);return a.createElement("svg",YL({width:2500,height:2500,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"xMidYMid",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,eP,tP)}var aP=a.forwardRef(nP);n.p;function rP(){return(rP=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function iP(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var oP=a.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"}),lP=a.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 cP(e,t){var n=e.title,r=e.titleId,i=iP(e,["title","titleId"]);return a.createElement("svg",rP({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2000 2000",width:2500,height:2500,ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,oP,lP)}var sP=a.forwardRef(cP);n.p;function dP(){return(dP=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function uP(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var mP=a.createElement("style",{type:"text/css"},"\n\t.st0{fill:#231F20;}\n\t.st1{fill:#F4B728;}\n"),hP=a.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"}),pP=a.createElement("circle",{className:"st1",cx:245.4,cy:245.4,r:177.6}),bP=a.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 fP(e,t){var n=e.title,r=e.titleId,i=uP(e,["title","titleId"]);return a.createElement("svg",dP({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":r},i),mP,void 0===n?a.createElement("title",{id:r},"headerArtboard 7"):n?a.createElement("title",{id:r},n):null,hP,pP,bP)}var jP,gP,OP,xP,vP,yP,wP,CP,kP,EP=a.forwardRef(fP),NP=(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}})),SP=function(e){var t=e.code,n=e.name,a=e.onContinue,r=NP(),i=function(e){switch(e){case"BTC":return SL;case"BCH":return TL;case"DASH":return zL;case"ETH":return UL;case"LTC":return QL;case"ZEC":return EP;case"USDT":return sP;case"XMR":return aP;default:return null}}(t);return Object(qe.jsxs)("div",{className:r.modalContent,children:[Object(qe.jsx)(i,{className:r.logo}),Object(qe.jsxs)(Ue,{className:r.title,children:["Enable ",n]}),Object(qe.jsxs)(Ke,{className:r.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(qe.jsx)(An,{className:r.button,onClick:a,children:"Start configuration"})]})},IP={title:{margin:[[0,0,12,0]]},subtitle:{margin:[[32,0,21,0]]},error:{color:he},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:xe,fontFamily:je,fontWeight:300,"& > input":{padding:[[6,0,2]]}}}},LP=Object(f.a)(IP),PP={form:null,selected:null,isNew:!1,iError:!1},FP=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 PP;default:throw new Error}},DP=function(e){var t,n=e.type,r=e.schema,i=e.coin,o=e.name,c=e.error,s=e.step,d=e.maxSteps,u=e.lastStep,m=e.isLastStep,h=e.onContinue,p=e.fiatCurrency,b=e.filled,f=e.unfilled,j=e.getValue,g=LP(),O=Object(a.useReducer)(FP,PP),x=Object(l.a)(O,2),v=x[0],y=v.innerError,w=v.selected,C=v.form,k=v.isNew,E=x[1];Object(a.useEffect)((function(){E({type:"reset"})}),[s]);var N=function(e,t){if(!e||!e[n])return E({type:"error"});h(e,t)},S=m?"Finish":"Next",L=null!==o&&void 0!==o?o:n,P=(t={},Object(z.a)(t,g.subtitle,!0),Object(z.a)(t,g.error,y),t);return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(Ye,{className:g.title,children:zm(L)}),Object(qe.jsx)(bp,{steps:u,currentStep:s}),Object(qe.jsx)(_e,{className:I()(P),children:s<d-1?"Select a ".concat(L," or set up a new one"):"Select ".concat(L," for ").concat(i)}),!(m&&s===d)&&Object(qe.jsx)(Er,{options:b,value:w,className:g.radioGroup,onChange:function(e,t){E({type:"select",selected:t})},labelClassName:g.radioLabel,radioClassName:g.radio}),"zeroConfLimit"===n&&Object(qe.jsx)(mn.e,{validateOnBlur:!1,validateOnChange:!0,initialValues:{zeroConfLimit:""},enableReinitialize:!0,validationSchema:r,children:function(e){e.values;var t=e.setFieldValue;return Object(qe.jsx)(mn.d,{children:Object(qe.jsxs)("div",{className:I()(g.horizontalAlign,g.lineAlignment),children:[Object(qe.jsx)(mn.b,{component:li,decimalPlaces:0,width:50,placeholder:"0",name:"zeroConfLimit",onChange:function(e){E({type:"select",selected:e.target.value}),t(e.target.id,e.target.value)},className:g.zeroConfLimit}),Object(qe.jsx)(Ye,{children:p})]})})}}),Object(qe.jsxs)("div",{className:g.setupNew,children:[!Wa.a(f)&&!D.a(f)&&Object(qe.jsx)(Er,{value:k,onChange:function(e,t){E({type:"new"})},labelClassName:g.radioLabel,radioClassName:g.radio,options:[{display:"Set up new",code:!0}]}),k&&Object(qe.jsx)(_a,{fullWidth:!0,label:"Select ".concat(L),className:g.picker,getOptionSelected:qa.a("code"),labelProp:"display",options:f,onChange:function(e,t){E({type:"form",form:t})}})]}),C&&Object(qe.jsx)(ax,{save:function(e){return N(Object(z.a)({},n,C.code),Object(z.a)({},C.code,e))},elements:$x[C.code].elements,validationSchema:$x[C.code].validationSchema,value:j(C.code),buttonLabel:S}),!C&&Object(qe.jsxs)("div",{className:g.submit,children:[c&&Object(qe.jsx)(il,{children:"Failed to save"}),Object(qe.jsx)(An,{className:g.button,onClick:function(){return N(Object(z.a)({},n,w))},children:S})]})]})},TP=function(e,t){return M.a((function(n){return function(e){return W.a("class",e)}(t)(n)&&function(e){return P.a(fl.a(e),R.a("cryptos"))}(e)(n)}))},RP=M.a((function(e){return!e.deprecated})),BP=function(e,t,n,a){var r=RP(TP(a,n)(e)),i=Os.a((function(e){var n=e.code,a=function(e){return t&&t[e]}(n);return!$x[n]||(0,$x[n].getValidationSchema)(a).isValidSync(a)}))(r),o=Object(l.a)(i,2);return{filled:o[0],unfilled:o[1]}},AP=function(e){var t=e.coin,n=e.onClose,r=e.accountsConfig,i=e.accounts,o=e.fiatCurrency,c=e.save,d=e.error,u=Object(a.useState)({step:0,config:{active:!0},accountsToSave:{}}),m=Object(l.a)(u,2),h=m[0],p=h.step,b=h.config,f=h.accountsToSave,j=m[1],g="Enable ".concat(t.display),O={filled:TP(t.code,"ticker")(r)},x=BP(r,i,"wallet",t.code),v=BP(r,i,"exchange",t.code),y=BP(r,i,"zeroConf",t.code),w=[Object(s.a)({type:"ticker"},O),Object(s.a)({type:"wallet"},x),Object(s.a)({type:"exchange"},v)],C=!Wa.a(y.filled)||!D.a(y.unfilled)&&!Wa.a(y.unfilled),k=Object(s.a)({type:"zeroConf",name:"confidence checking",schema:xn.f().shape({zeroConfLimit:xn.e().required()})},y),E=C?hl.a(w,FO(t)?[k]:[k,{type:"zeroConfLimit",name:"0-conf limit"}]):w,N=E.length,S=p===N,I=p>0?E[p-1]:null,L=function(){var e=Object(Al.a)(Bl.a.mark((function e(n,a){var r,i;return Bl.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=Gn.a(b,n),i=a?Gn.a(f,a):f,!S){e.next=4;break}return e.abrupt("return",c(us(t.code,r),i));case 4:j({step:p+1,config:r,accountsToSave:i});case 5:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();return Object(qe.jsxs)(Kh,{title:0===p?null:g,handleClose:n,width:554,open:!0,children:[0===p&&Object(qe.jsx)(SP,{code:t.code,name:t.display,onContinue:function(){return L()}}),0!==p&&Object(qe.jsx)(DP,Object(s.a)(Object(s.a)({coin:t.display,fiatCurrency:o,error:d,step:p,maxSteps:5,lastStep:N,isLastStep:S},I),{},{onContinue:L,getValue:function(e){return Aa.a(W.a("code",e))(i)}}))]})},MP=Object(f.a)({rightAligned:{marginTop:"20px",marginLeft:"auto",marginBottom:"20px"},rightLink:{marginLeft:"20px"}}),WP=x()(jP||(jP=Object(c.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"]))),zP=x()(gP||(gP=Object(c.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),qP=function(e){var t=e.open,n=e.close,a=e.save,r=MP();return Object(qe.jsxs)(Kh,{title:"Change fiat currency?",handleClose:n,width:450,height:310,open:t,children:[Object(qe.jsx)(Ke,{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(qe.jsx)(Ke,{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(qe.jsxs)("div",{className:r.rightAligned,children:[Object(qe.jsx)(oa,{onClick:n,color:"secondary",children:"Cancel"}),Object(qe.jsx)(oa,{className:r.rightLink,onClick:a,color:"primary",children:"Save"})]})]})},$P=function(e){var t,n,r,i,o,c,s=e.name,d=Object(a.useState)(!1),m=Object(l.a)(d,2),h=m[0],p=m[1],b=Object(a.useState)(null),f=Object(l.a)(b,2),j=f[0],g=f[1],O=Object(a.useState)(null),x=Object(l.a)(O,2),v=x[0],y=x[1],w=Object(a.useState)(!1),C=Object(l.a)(w,2),k=C[0],E=C[1],N=Object(a.useState)(!1),S=Object(l.a)(N,2),I=S[0],L=S[1],F=Object(u.c)(WP).data,D=Object(u.b)(zP,{onCompleted:function(){return p(!1)},refetchQueries:function(){return["getData"]},onError:function(e){return y(e)}}),T=Object(l.a)(D,1)[0],R=Object(a.useState)(null),B=Object(l.a)(R,2),A=B[0],M=B[1],z=(null===F||void 0===F?void 0:F.config)&&ds(s)(F.config),q=(null===F||void 0===F?void 0:F.config)&&ds(Yc)(F.config),$=null===F||void 0===F?void 0:F.accountsConfig,H=null!==(t=null===F||void 0===F?void 0:F.accounts)&&void 0!==t?t:[],V=null!==(n=null===F||void 0===F?void 0:F.cryptoCurrencies)&&void 0!==n?n:[],U=z&&!Wa.a(z)?z:jO,G=null!==(r=U.overrides)&&void 0!==r?r:[],X=function(e){return M(null),T({variables:{config:e}})},_=function(e,t,n){var a=Mg.a(t,e)[0];if(!a)return n(t);var r=ds(a)(q);if(!wO.isValidSync(r))return g((function(){return function(){return n(t)}})),void p(a);n(t)};return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(qP,{open:A,close:function(){return M(null)},save:function(){return A&&X(A)}}),Object(qe.jsx)(cl,{title:"Locales"}),Object(qe.jsx)(AO,{children:Object(qe.jsx)(Gh,{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=us(s)(e.locale[0]);return z.fiatCurrency&&t.locale_fiatCurrency!==z.fiatCurrency?M(t):X(t)},validationSchema:bO,data:Fw.a(U),elements:hO(F,_),setEditing:function(e,t){return E(t)},forceDisable:I})}),Object(qe.jsx)(AO,{children:Object(qe.jsx)(Gh,{error:null===v||void 0===v?void 0:v.message,title:"Overrides",titleLg:!0,name:"overrides",enableDelete:!0,enableEdit:!0,enableCreate:!0,initialValues:gO,save:function(e){var t=us(s)(e);return y(null),T({variables:{config:t}})},validationSchema:fO,data:null!==G&&void 0!==G?G:[],elements:pO(F,G,_),disableAdd:P.a(Wa.a,Mg.a)(null!==(i=null===F||void 0===F?void 0:F.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 L(t)},forceDisable:k})}),h&&Object(qe.jsx)(AP,{coin:Aa.a(W.a("code",h))(V),onClose:function(){return p(!1)},save:function(e){return X(us(Yc)(e)).then((function(e){return j(),g(null),e}))},error:null===v||void 0===v?void 0:v.message,cryptoCurrencies:V,userAccounts:null===F||void 0===F||null===(c=F.config)||void 0===c?void 0:c.accounts,accounts:H,accountsConfig:$})]})},HP={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:he}},VP=Object(f.a)(HP),UP={customer:"",discount:""},GP=xn.f().shape({customer:xn.h().required("A customer is required!"),discount:xn.e().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%!")}),XP=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},_P=function(e){var t=e.showModal,n=e.setShowModal,a=e.onClose,r=e.creationError,i=e.addDiscount,o=e.customers,l=VP();return Object(qe.jsx)(qe.Fragment,{children:t&&Object(qe.jsx)(Kh,{title:"Add individual customer discount",closeOnBackdropClick:!0,width:600,height:500,handleClose:a,open:!0,children:Object(qe.jsx)(mn.e,{validateOnBlur:!1,validateOnChange:!1,initialValues:UP,validationSchema:GP,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(qe.jsxs)(mn.d,{id:"individual-discount-form",className:l.form,children:[Object(qe.jsx)("div",{className:l.customerAutocomplete,children:Object(qe.jsx)(mn.b,{name:"customer",label:"Select a customer",component:Br,fullWidth:!0,options:T.a((function(e){var t,n,a,r,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===(a=e.idCardData)||void 0===a?void 0:a.firstName)&&(null===e||void 0===e||null===(r=e.idCardData)||void 0===r?void 0:r.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(qe.jsxs)("div",{children:[Object(qe.jsxs)("div",{className:l.discountRateWrapper,children:[Object(qe.jsx)(Xe,{children:"Define discount rate"}),Object(qe.jsxs)(Np,{width:304,children:[Object(qe.jsx)(Ke,{children:"This is a percentage discount off of your existing commission rates for a customer entering this code at the machine."}),Object(qe.jsx)(Ke,{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(qe.jsxs)("div",{className:l.discountInput,children:[Object(qe.jsx)(mn.b,{name:"discount",size:"lg",autoComplete:"off",width:50,decimalScale:0,className:l.discountInputField,component:li}),Object(qe.jsx)(tt,{inline:!0,className:l.inputLabel,children:"%"})]})]}),Object(qe.jsxs)("div",{className:l.footer,children:[XP(t,n,r)&&Object(qe.jsx)(il,{children:XP(t,n,r)}),Object(qe.jsx)(An,{type:"submit",form:"individual-discount-form",className:l.submit,children:"Add discount"})]})]})}})})})},ZP=Object(f.a)(HP),KP=x()(OP||(OP=Object(c.a)(["\n query individualDiscounts {\n individualDiscounts {\n id\n customerId\n discount\n }\n }\n"]))),QP=x()(xP||(xP=Object(c.a)(["\n mutation deleteIndividualDiscount($discountId: ID!) {\n deleteIndividualDiscount(discountId: $discountId) {\n id\n }\n }\n"]))),YP=x()(vP||(vP=Object(c.a)(["\n mutation createIndividualDiscount($customerId: ID!, $discount: Int!) {\n createIndividualDiscount(customerId: $customerId, discount: $discount) {\n id\n }\n }\n"]))),JP=x()(yP||(yP=Object(c.a)(["\n {\n customers {\n id\n phone\n idCardData\n }\n }\n"]))),eF=function(){var e=ZP(),t=Object(a.useState)(!1),n=Object(l.a)(t,2),r=n[0],i=n[1],o=Object(a.useState)(),c=Object(l.a)(o,2),s=c[0],d=c[1],m=Object(a.useState)(""),h=Object(l.a)(m,2),p=h[0],b=h[1],f=Object(a.useState)(!1),j=Object(l.a)(f,2),g=j[0],O=j[1],x=function(){return O(!g)},v=Object(u.c)(KP),y=v.data,w=v.loading,C=Object(u.c)(JP),k=C.data,E=C.loading,N=Object(u.b)(YP,{refetchQueries:function(){return["individualDiscounts"]}}),S=Object(l.a)(N,2),I=S[0],L=S[1].error,P=function(e){var t=A.a(["customers"])(k);return Aa.a(W.a("id",e))(t)},F=Object(u.b)(QP,{onError:function(e){var t=e.message;b(null!==t&&void 0!==t?t:"Error while deleting row")},onCompleted:function(){return i(!1)},refetchQueries:function(){return["individualDiscounts"]}}),T=Object(l.a)(F,1)[0],R=[{header:"Identification",width:312,textAlign:"left",size:"sm",view:function(t){var n=P(t.customerId);return Object(qe.jsxs)("div",{className:e.identification,children:[Object(qe.jsx)(ij,{}),Object(qe.jsx)("span",{children:n.phone})]})}},{header:"Name",width:300,textAlign:"left",size:"sm",view:function(e){var t,n,a=P(e.customerId);return D.a(a.idCardData)?Object(qe.jsx)(qe.Fragment,{children:"-"}):Object(qe.jsx)(qe.Fragment,{children:"".concat(null!==(t=a.idCardData.firstName)&&void 0!==t?t:"").concat(a.idCardData.firstName&&a.idCardData.lastName?" ":"").concat(null!==(n=a.idCardData.lastName)&&void 0!==n?n:"")})}},{header:"Discount rate",width:220,textAlign:"left",size:"sm",view:function(e){return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(tt,{inline:!0,children:e.discount})," %"]})}},{header:"Revoke",width:100,textAlign:"center",size:"sm",view:function(e){return Object(qe.jsx)(ta,{onClick:function(){i(!0),d({variables:{discountId:e.id}})},children:Object(qe.jsx)(Oh,{})})}}],B=w||E;return Object(qe.jsxs)(qe.Fragment,{children:[!B&&!Wa.a(y.individualDiscounts)&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(nl.a,{marginBottom:4,marginTop:-7,className:e.tableWidth,display:"flex",justifyContent:"flex-end",children:Object(qe.jsx)(oa,{color:"primary",onClick:x,children:"Add new code"})}),Object(qe.jsx)(Ay,{elements:R,data:A.a(["individualDiscounts"])(y)}),Object(qe.jsx)(_m,{open:r,onDismissed:function(){i(!1),b(null)},onConfirmed:function(){b(null),T(s)},errorMessage:p})]}),!B&&Wa.a(y.individualDiscounts)&&Object(qe.jsxs)(nl.a,{display:"flex",alignItems:"left",flexDirection:"column",children:[Object(qe.jsx)(it,{children:"It seems there are no active individual customer discounts on your network."}),Object(qe.jsx)(An,{onClick:x,children:"Add individual discount"})]}),Object(qe.jsx)(_P,{showModal:g,setShowModal:O,onClose:function(){O(!1)},creationError:L,addDiscount:I,customers:A.a(["customers"])(k)})]})},tF={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:je,fontSize:24,marginLeft:8,marginTop:15},tableWidth:{width:620},error:{color:he},form:{display:"flex",flexDirection:"column",height:"100%"},submit:{margin:[["auto",0,0,"auto"]]}},nF=Object(f.a)(tF),aF={code:"",discount:""},rF=xn.f().shape({code:xn.h().required().trim().max(25),discount:xn.e().required().min(0).max(100)}),iF=function(e){var t=e.showModal,n=e.onClose,a=e.errorMsg,r=e.addCode,i=nF();return Object(qe.jsx)(qe.Fragment,{children:t&&Object(qe.jsx)(Kh,{title:"Add promo code discount",closeOnBackdropClick:!0,width:600,height:500,handleClose:n,open:!0,children:Object(qe.jsx)(mn.e,{validateOnBlur:!1,validateOnChange:!1,initialValues:aF,validationSchema:rF,onSubmit:function(e){!function(e,t){r(Gj.a(e),parseInt(t))}(e.code,e.discount)},children:Object(qe.jsxs)(mn.d,{id:"promo-form",className:i.form,children:[Object(qe.jsx)(Xe,{className:i.modalLabel1,children:"Promo code name"}),Object(qe.jsx)(mn.b,{name:"code",autoFocus:!0,size:"lg",autoComplete:"off",width:338,inputProps:{style:{textTransform:"uppercase"}},component:di}),Object(qe.jsxs)("div",{className:i.modalLabel2Wrapper,children:[Object(qe.jsx)(Xe,{className:i.modalLabel2,children:"Define discount rate"}),Object(qe.jsxs)(Np,{width:304,children:[Object(qe.jsx)(Ke,{children:"This is a percentage discount off of your existing commission rates for a customer entering this code at the machine."}),Object(qe.jsx)(Ke,{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(qe.jsxs)("div",{className:i.discountInput,children:[Object(qe.jsx)(mn.b,{name:"discount",size:"lg",autoComplete:"off",width:50,decimalScale:0,className:i.discountInputField,component:li}),Object(qe.jsx)(tt,{inline:!0,className:i.inputLabel,children:"%"})]}),Object(qe.jsxs)("div",{className:i.footer,children:[a&&Object(qe.jsx)(il,{children:a}),Object(qe.jsx)(An,{type:"submit",form:"promo-form",className:i.submit,children:"Add code"})]})]})})})})},oF=Object(f.a)(tF),lF="Failed to save",cF=x()(wP||(wP=Object(c.a)(["\n query promoCodes {\n promoCodes {\n id\n code\n discount\n }\n }\n"]))),sF=x()(CP||(CP=Object(c.a)(["\n mutation deletePromoCode($codeId: ID!) {\n deletePromoCode(codeId: $codeId) {\n id\n }\n }\n"]))),dF=x()(kP||(kP=Object(c.a)(["\n mutation createPromoCode($code: String!, $discount: Int!) {\n createPromoCode(code: $code, discount: $discount) {\n id\n code\n discount\n }\n }\n"]))),uF=function(){var e=oF(),t=Object(a.useState)(!1),n=Object(l.a)(t,2),r=n[0],i=n[1],o=Object(a.useState)(),c=Object(l.a)(o,2),s=c[0],d=c[1],m=Object(a.useState)(!1),h=Object(l.a)(m,2),p=h[0],b=h[1],f=Object(a.useState)(null),j=Object(l.a)(f,2),g=j[0],O=j[1],x=function(){return b(!p)},v=Object(u.c)(cF),y=v.data,w=v.loading,C=Object(u.b)(sF,{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(l.a)(C,1)[0],E=Object(u.b)(dF,{refetchQueries:function(){return["promoCodes"]}}),N=Object(l.a)(E,1)[0],S=[{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(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(tt,{inline:!0,children:e.discount})," % in commissions"]})}},{header:"Delete",width:100,textAlign:"center",size:"sm",view:function(e){return Object(qe.jsx)(ta,{onClick:function(){i(!0),d({variables:{codeId:e.id}})},children:Object(qe.jsx)(Oh,{})})}}];return Object(qe.jsxs)(qe.Fragment,{children:[!w&&!Wa.a(y.promoCodes)&&Object(qe.jsx)(nl.a,{marginBottom:4,marginTop:-7,className:e.tableWidth,display:"flex",justifyContent:"flex-end",children:Object(qe.jsx)(oa,{color:"primary",onClick:x,children:"Add new code"})}),!w&&!Wa.a(y.promoCodes)&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(Ay,{elements:S,data:A.a(["promoCodes"])(y)}),Object(qe.jsx)(_m,{open:r,onDismissed:function(){i(!1),O(null)},onConfirmed:function(){O(null),k(s)},errorMessage:g})]}),!w&&Wa.a(y.promoCodes)&&Object(qe.jsxs)(nl.a,{display:"flex",alignItems:"left",flexDirection:"column",children:[Object(qe.jsx)(it,{children:"Currently, there are no active promo codes on your network."}),Object(qe.jsx)(An,{onClick:x,children:"Add Code"})]}),Object(qe.jsx)(iF,{showModal:p,onClose:function(){O(null),b(!1)},errorMsg:g,addCode:function(e,t){O(null),N({variables:{code:e,discount:t}}).then((function(e){if(!e.errors)return b(!1);var t=jn.a((function(e){return L.a("duplicate",null===e||void 0===e?void 0:e.message)}))(e.errors);O(t?"There is already a promotion with that code!":lF)})).catch((function(e){O(lF),console.log(e)}))}})]})},mF=n(1127);function hF(){return(hF=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function pF(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var bF=a.createElement("desc",null,"Created with Sketch."),fF=a.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"pop-up/action/download-logs/date-range-copy-3",transform:"translate(-117.000000, -116.000000)",stroke:"#1B2559",strokeWidth:2},a.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)"},a.createElement("polyline",{id:"Path-3",points:"0 13.3571429 7.14285714 20.5 14.2857143 13.3571429"}),a.createElement("line",{x1:7.14285714,y1:.142857143,x2:7.14285714,y2:20.1428571,id:"Path-4"}))));function jF(e,t){var n=e.title,r=e.titleId,i=pF(e,["title","titleId"]);return a.createElement("svg",hF({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":r},i),void 0===n?a.createElement("title",{id:r},"arrow download logs"):n?a.createElement("title",{id:r},n):null,bF,fF)}var gF=a.forwardRef(jF),OF=(n.p,n(1104)),xF=n(1105),vF=n(1102),yF=n(1151),wF=n(1152),CF=n(1153),kF=n(1154),EF=n(1103),NF=n(1155);function SF(){return(SF=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function IF(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var LF=a.createElement("desc",null,"Created with Sketch."),PF=a.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"pop-up/action/download-logs/date-range-copy-2",transform:"translate(-20.000000, -187.000000)"},a.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)"},a.createElement("g",{id:"icon/sf-small/wizzard",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{transform:"translate(6.666667, 6.000000)",id:"Group"},a.createElement("g",null,a.createElement("polyline",{id:"Path-3",stroke:"#1B2559",strokeWidth:2,points:"0 4.83333333 3.33333333 8.16666667 6.66666667 4.83333333"}),a.createElement("line",{x1:3.33333333,y1:.25,x2:3.33333333,y2:6.5,id:"Path-4",stroke:"#1B2559",strokeWidth:2})))))));function FF(e,t){var n=e.title,r=e.titleId,i=IF(e,["title","titleId"]);return a.createElement("svg",SF({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":r},i),n?a.createElement("title",{id:r},n):null,LF,PF)}var DF=a.forwardRef(FF);n.p;function TF(){return(TF=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function RF(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var BF=a.createElement("desc",null,"Created with Sketch."),AF=a.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"pop-up/action/download-logs/date-range-copy-2",transform:"translate(-20.000000, -187.000000)"},a.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)"},a.createElement("g",{id:"icon/sf-small/wizzard",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{transform:"translate(6.666667, 6.000000)",id:"Group"},a.createElement("g",null,a.createElement("polyline",{id:"Path-3",stroke:"#1B2559",strokeWidth:2,points:"0 4.83333333 3.33333333 8.16666667 6.66666667 4.83333333"}),a.createElement("line",{x1:3.33333333,y1:.25,x2:3.33333333,y2:6.5,id:"Path-4",stroke:"#1B2559",strokeWidth:2})))))));function MF(e,t){var n=e.title,r=e.titleId,i=RF(e,["title","titleId"]);return a.createElement("svg",TF({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":r},i),n?a.createElement("title",{id:r},n):null,BF,AF)}var WF,zF,qF,$F,HF=a.forwardRef(MF),VF=(n.p,{wrapper:{height:26,display:"flex",alignItems:"center",justifyContent:"center",position:"relative",overflow:"hidden"},button:{outline:"none",extend:Me.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"}}),UF=Object(f.a)(VF),GF=function(e){var t,n,a,r=e.isLowerBound,i=e.isUpperBound,o=e.isBetween,l=e.isDisabled,c=e.children,s=(Object(q.a)(e,["isLowerBound","isUpperBound","isBetween","isDisabled","children"]),UF()),d=r||i,u=(t={},Object(z.a)(t,s.between,o&&!(r&&i)),Object(z.a)(t,s.lowerBound,r&&!i),Object(z.a)(t,s.upperBound,i&&!r),t),m=(n={},Object(z.a)(n,s.wrapper,!0),Object(z.a)(n,s.selected,d),n),h=(a={},Object(z.a)(a,s.button,!0),Object(z.a)(a,s.disabled,l),a);return Object(qe.jsxs)("div",{className:s.wrapper,children:[Object(qe.jsx)("div",{className:I()(u)}),Object(qe.jsx)("div",{className:I()(m),children:Object(qe.jsx)("button",{className:I()(h),children:c})})]})},XF={wrapper:{display:"flex",flexDirection:"column",alignItems:"center"},button:{outline:"none"},navbar:{extend:Me.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:Me.label2}}},_F=Object(f.a)(XF),ZF=function(e){var t=e.minDate,n=e.maxDate,r=e.handleSelect,i=Object(q.a)(e,["minDate","maxDate","handleSelect"]),o=Object(a.useState)(new Date),c=Object(l.a)(o,2),s=c[0],d=c[1],u=_F(),m=Array.from(Array(7)).map((function(e,t){return Object(hd.a)("EEEEE",Object(Fd.a)({days:t},Object(Dd.a)(new Date)))})),h=function(e){var t=Object(Rf.a)({months:1},e),n=Du.a(0,Object(yF.a)(Object(wF.a)(e))).reverse(),a=T.a((function(e){return Object(Rf.a)({days:e},Object(CF.a)(t))}))(n),r=Du.a(0,function(e){return Object(vF.a)(e)}(e)),i=T.a((function(t){return Object(Fd.a)({days:t},Object(wF.a)(e))}))(r),o=Object(Fd.a)({months:1},e),l=Du.a(0,42-a.length-i.length),c=T.a((function(e){return Object(Fd.a)({days:e},Object(wF.a)(o))}))(l);return hl.a(hl.a(a,i),c)},p=function(e,t){return h(e).slice(7*t-7,7*t)};return Object(qe.jsxs)("div",{className:u.wrapper,children:[Object(qe.jsxs)("div",{className:u.navbar,children:[Object(qe.jsx)("button",{className:u.button,onClick:function(){return function(e){var n=Object(Rf.a)({months:1},e);d(t?Object(kF.a)(t,n)||Object(EF.a)(t,n)>0?n:s:n)}(s)},children:Object(qe.jsx)(DF,{})}),Object(qe.jsx)("span",{children:"".concat(Object(hd.a)("MMMM",s)," ").concat(Object(hd.a)("yyyy",s))}),Object(qe.jsx)("button",{className:u.button,onClick:function(){return function(e){var t=Object(Fd.a)({months:1},e);d(n?Object(kF.a)(n,t)||Object(EF.a)(t,n)>0?t:s:t)}(s)},children:Object(qe.jsx)(HF,{})})]}),Object(qe.jsxs)("table",{className:u.table,children:[Object(qe.jsx)("thead",{children:Object(qe.jsx)("tr",{children:m.map((function(e,t){return Object(qe.jsx)("th",{children:e},t)}))})}),Object(qe.jsx)("tbody",{children:Du.a(1,8).map((function(e,a){return Object(qe.jsx)("tr",{children:p(s,e).map((function(e,a){return Object(qe.jsx)("td",{onClick:function(){return r(e)},children:Object(qe.jsx)(GF,{isDisabled:n&&Object(fs.a)(n,e)||t&&Object(fs.a)(e,t),isLowerBound:Object(NF.a)(i.from,e),isUpperBound:Object(NF.a)(i.to,e),isBetween:Object(fs.a)(i.from,e)&&Object(fs.a)(e,i.to),children:Object(hd.a)("d",e)})},a)}))},a)}))})]})]})},KF=Object(f.a)({wrapper:{backgroundColor:"white",borderRadius:10}}),QF=function(e){var t=e.minDate,n=e.maxDate,r=e.className,i=e.onRangeChange,o=Object(a.useState)(null),c=Object(l.a)(o,2),s=c[0],d=c[1],u=Object(a.useState)(null),m=Object(l.a)(u,2),h=m[0],p=m[1];Object(a.useEffect)((function(){i(s,h)}),[s,i,h]);var b=KF();return Object(qe.jsx)(qe.Fragment,{children:Object(qe.jsx)("div",{className:I()(b.wrapper,r),children:Object(qe.jsx)(ZF,{from:s,to:h,minDate:t,maxDate:n,handleSelect:function(e){n&&Object(OF.a)(n,e)>0||t&&Object(xF.a)(e,t)>0||(!s||h?(d(e),p(null)):Object(xF.a)(s,e)>=0?p(Object(mF.a)({hours:23,minutes:59,seconds:59,milliseconds:999},e)):(p(Object(mF.a)({hours:23,minutes:59,seconds:59,milliseconds:999},Fm.a(s))),d(e)))}})})})},YF=Me.label1,JF=Me.h4,eD={wrapper:{height:46,width:99},container:{display:"flex"},monthWeekDayContainer:{display:"flex",flexDirection:"column"},label:{extend:YF,lineHeight:1.33,color:J},bigNumber:{extend:Me.info1,lineHeight:1,marginRight:7},monthYear:{extend:Me.label2,lineHeight:1.17,color:J},weekDay:{extend:YF,lineHeight:1.33,color:se}},tD=Object(f.a)(eD),nD=function(e){var t=e.date,n=e.children,a=(Object(q.a)(e,["date","children"]),tD());return Object(qe.jsxs)("div",{className:a.wrapper,children:[Object(qe.jsx)("div",{className:a.label,children:n}),t&&Object(qe.jsx)(qe.Fragment,{children:Object(qe.jsxs)("div",{className:a.container,children:[Object(qe.jsx)("div",{className:a.bigNumber,children:Object(hd.a)("d",t)}),Object(qe.jsxs)("div",{className:a.monthWeekDayContainer,children:[Object(qe.jsx)("span",{className:a.monthYear,children:"".concat(Object(hd.a)("MMM",t)," ").concat(Object(hd.a)("yyyy",t))}),Object(qe.jsx)("span",{className:a.weekDay,children:Object(hd.a)("EEEE",t)})]})]})})]})},aD={popoverContent:{width:280},popoverHeader:{extend:JF,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"}},rD=Object(f.a)(aD),iD="all",oD="range",lD="advanced",cD="simplified",sD=function(e){var t,n=e.name,r=e.query,i=e.args,o=e.title,c=e.getLogs,d=e.timezone,m=e.simplified,h=e.className,p=Object(a.useState)(iD),b=Object(l.a)(p,2),f=b[0],j=b[1],g=Object(a.useState)(lD),O=Object(l.a)(g,2),x=O[0],v=O[1],y=Object(a.useState)({from:null,until:null}),w=Object(l.a)(y,2),C=w[0],k=w[1],N=Object(a.useState)(null),S=Object(l.a)(N,2),L=S[0],P=S[1],F=Object(u.a)(r,{onCompleted:function(e){return M(c(e),C)}}),D=Object(l.a)(F,1)[0],T=rD(),R=(t={},Object(z.a)(t,T.dateRangePickerShowing,f===oD),Object(z.a)(t,T.dateRangePickerHidden,f===iD),t),B=Object(a.useCallback)((function(e,t){k({from:e,until:t})}),[k]),M=function(e,t){var a=function(e){return fd(e,d,"yyyy-MM-dd_HH-mm")},r=new window.Blob([e],{type:"text/plain;charset=utf-8"});Af.a.saveAs(r,f===iD?"".concat(a(new Date),"_").concat(n,".csv"):"".concat(a(t.from),"_").concat(a(t.until),"_").concat(n,".csv"))},W=[{display:"All logs",code:iD},{display:"Date range",code:oD}],q=[{display:"Advanced logs",code:lD},{display:"Simplified logs",code:cD}],$=Boolean(L),H=$?"date-range-popover":void 0;return Object(qe.jsx)(E.a,{onClickAway:function(){P(null)},children:Object(qe.jsxs)("div",{className:h,children:[Object(qe.jsx)(Vn,{Icon:Pj,InverseIcon:yj,onClick:function(e){P(L?null:e.currentTarget)},variant:"contained"}),Object(qe.jsx)(Xn,{id:H,open:$,anchorEl:L,placement:"bottom",children:Object(qe.jsxs)("div",{className:T.popoverContent,children:[Object(qe.jsx)("div",{className:T.popoverHeader,children:o}),Object(qe.jsx)("div",{className:T.radioButtonsContainer,children:Object(qe.jsx)(Er,{name:"logs-select",value:f,options:W,ariaLabel:"logs-select",onChange:function(e){var t=A.a(["target","value"])(e);j(t),t===iD&&k({from:null,until:null})},className:T.radioButtons})}),f===oD&&Object(qe.jsxs)("div",{className:I()(R),children:[Object(qe.jsx)("div",{className:T.dateContainerWrapper,children:C&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(nD,{date:C.from,children:"From"}),Object(qe.jsx)("div",{className:T.arrowContainer,children:Object(qe.jsx)(gF,{className:T.arrow})}),Object(qe.jsx)(nD,{date:C.until,children:"To"})]})}),Object(qe.jsx)(QF,{maxDate:Object(mF.a)({hours:23,minutes:59,seconds:59,milliseconds:999},new Date),onRangeChange:B})]}),m&&Object(qe.jsx)("div",{className:T.radioButtonsContainer,children:Object(qe.jsx)(Er,{name:"simplified-tx-logs",value:x,options:q,ariaLabel:"simplified-tx-logs",onChange:function(e){var t=A.a(["target","value"])(e);v(t)},className:T.radioButtons})}),Object(qe.jsx)("div",{className:T.download,children:Object(qe.jsx)(oa,{color:"primary",onClick:function(){return function(e,t){f===iD&&D({variables:Object(s.a)(Object(s.a)({},t),{},{simplified:x===cD,excludeTestingCustomers:!0})}),e&&e.from&&(e.from&&!e.until&&(e.until=new Date),f===oD&&D({variables:Object(s.a)(Object(s.a)({},t),{},{from:e.from,until:e.until,simplified:x===cD,excludeTestingCustomers:!0})}))}(C,i)},children:"Download"})})]})})]})})},dD=Object(f.a)(yf),uD=x()(WF||(WF=Object(c.a)(["\n {\n machines {\n name\n deviceId\n }\n }\n"]))),mD=x()(zF||(zF=Object(c.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"]))),hD=x()(qF||(qF=Object(c.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"]))),pD=x()($F||($F=Object(c.a)(["\n query getData {\n config\n }\n"]))),bD=function(){var e,t,n=dD(),r=Object(a.useState)(null),i=Object(l.a)(r,2),o=i[0],c=i[1],s=Object(a.useState)(null),d=Object(l.a)(s,2),m=d[0],h=d[1],p=null===o||void 0===o?void 0:o.deviceId,b=Object(u.c)(uD),f=b.data,j=b.loading,g=Object(u.c)(pD),O=g.data,x=g.loading,v=A.a(["config","locale_timezone"],O),y=Object(u.c)(hD,{variables:{deviceId:p,limit:500},skip:!o,onCompleted:function(){return h("")}}),w=y.data,C=y.loading;(null===f||void 0===f||null===(e=f.machines)||void 0===e?void 0:e.length)&&!o&&c(null===f||void 0===f?void 0:f.machines[0]);var k=j||x||C;return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)("div",{className:n.titleWrapper,children:Object(qe.jsxs)("div",{className:n.titleAndButtonsContainer,children:[Object(qe.jsx)(yn,{children:"Machine Logs"}),w&&Object(qe.jsxs)("div",{className:n.buttonsWrapper,children:[Object(qe.jsx)(sD,{title:"Download logs",name:o.name,query:mD,args:{deviceId:p,timezone:v},getLogs:function(e){return A.a(["machineLogsCsv"])(e)},timezone:v}),Object(qe.jsx)(Je,{children:m})]})]})}),Object(qe.jsxs)("div",{className:n.wrapper,children:[Object(qe.jsx)(Ii,{displayName:function(e){return e.name},data:(null===f||void 0===f?void 0:f.machines)||[],isSelected:function(e){return A.a(["deviceId"])(o)===e.deviceId},onClick:c}),Object(qe.jsxs)("div",{className:n.tableWrapper,children:[Object(qe.jsxs)(Is,{className:n.table,children:[Object(qe.jsx)(Ds,{children:Object(qe.jsxs)(zs,{header:!0,children:[Object(qe.jsx)(Bs,{className:n.dateColumn,children:"Date"}),Object(qe.jsx)(Bs,{className:n.levelColumn,children:"Level"}),Object(qe.jsx)(Bs,{className:n.fillColumn})]})}),Object(qe.jsx)(Ls,{children:w&&w.machineLogs.map((function(e,t){return Object(qe.jsxs)(zs,{size:"sm",children:[Object(qe.jsx)(Fs,{children:v&&fd(e.timestamp,v,"yyyy-MM-dd HH:mm")}),Object(qe.jsx)(Fs,{children:e.logLevel}),Object(qe.jsx)(Fs,{children:e.message})]},t)}))})]}),k&&Object(qe.jsx)(_e,{children:"Loading..."}),!k&&!(null===w||void 0===w||null===(t=w.machineLogs)||void 0===t?void 0:t.length)&&Object(qe.jsx)(_e,{children:"No activity so far"})]})]})]})};function fD(){return(fD=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function jD(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var gD=a.createElement("desc",null,"Created with Sketch."),OD=a.createElement("g",{id:"icon/sf-small/clock/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"Group-7",stroke:"#FFFFFF",strokeWidth:2},a.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"}),a.createElement("polyline",{id:"Stroke-3",points:"13 11 10 11.063 10 7"}),a.createElement("polyline",{id:"Stroke-5",points:"3 0 3 3 5 4"})));function xD(e,t){var n=e.title,r=e.titleId,i=jD(e,["title","titleId"]);return a.createElement("svg",fD({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":r},i),n?a.createElement("title",{id:r},n):null,gD,OD)}var vD=a.forwardRef(xD);n.p;function yD(){return(yD=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function wD(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var CD=a.createElement("desc",null,"Created with Sketch."),kD=a.createElement("g",{id:"icon/sf-small/clock/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"Group-7",stroke:"#1B2559",strokeWidth:2},a.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"}),a.createElement("polyline",{id:"Stroke-3",points:"13 11 10 11.063 10 7"}),a.createElement("polyline",{id:"Stroke-5",points:"3 0 3 3 5 4"})));function ED(e,t){var n=e.title,r=e.titleId,i=wD(e,["title","titleId"]);return a.createElement("svg",yD({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":r},i),n?a.createElement("title",{id:r},n):null,CD,kD)}var ND,SD,ID,LD,PD,FD=a.forwardRef(ED),DD=(n.p,{cashbox:{height:36},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},downloadLogsButton:{marginLeft:13}}),TD={footerLabel:{color:$,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"},icon:{alignSelf:"center",height:20,width:20,marginRight:8},iconLabel:{alignSelf:"center",marginRight:8},valueDisplay:{alignSelf:"center"}},RD=Object(f.a)(TD),BD=function(e){var t=e.machines,n=e.config,a=e.currencyCode,r=e.bills,i=(e.deviceIds,RD()),o=n&&ds("cashOut")(n),l=function(e){return ds(e)(o)},c=js.a(gs.a((function(e,t){var n,a,r,i,o=t.cassette1,c=t.cassette2,s=t.cassette3,d=t.cassette4,u=t.id,m=null!==(n=l(u).cassette1)&&void 0!==n?n:0,h=null!==(a=l(u).cassette2)&&void 0!==a?a:0,p=null!==(r=l(u).cassette3)&&void 0!==r?r:0,b=null!==(i=l(u).cassette4)&&void 0!==i?i:0;return[e[0]+=o*m,e[1]+=c*h,e[2]+=s*p,e[3]+=d*b]}),[0,0,0,0],t)),s=js.a(T.a((function(e){return e.fiat}))(r)),d=new Hc.a(c+s).toFormat(0);return Object(qe.jsx)("div",{className:i.footerContainer,children:Object(qe.jsxs)("div",{className:i.footerContent,children:[Object(qe.jsx)(Je,{className:i.footerLabel,children:"Cash value in System"}),Object(qe.jsxs)("div",{className:i.flex,children:[Object(qe.jsx)(Dc,{className:i.icon}),Object(qe.jsx)(Ye,{className:i.iconLabel,children:"Cash-in:"}),Object(qe.jsxs)(Qe,{className:i.valueDisplay,children:[Xr(s)," ",a]})]}),Object(qe.jsxs)("div",{className:i.flex,children:[Object(qe.jsx)(zc,{className:i.icon}),Object(qe.jsx)(Ye,{className:i.iconLabel,children:"Cash-out:"}),Object(qe.jsxs)(Qe,{className:i.valueDisplay,children:[Xr(c)," ",a]})]}),Object(qe.jsxs)("div",{className:i.flex,children:[Object(qe.jsx)(Ye,{className:i.iconLabel,children:"Total:"}),Object(qe.jsxs)(Qe,{className:i.valueDisplay,children:[Xr(d)," ",a]})]})]})})},AD=x()(ND||(ND=Object(c.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 }\n }\n }\n"]))),MD=Object(f.a)({operationType:{marginLeft:8},operationTypeWrapper:{display:"flex",flexDirection:"row",alignItems:"center"},saveAndCancel:{display:"flex",flexDirection:"row",justifyContent:"space-between"}}),WD=function(e){var t=e.machines,n=e.currency,a=e.timezone,r=MD(),i=Object(u.c)(AD),o=i.data,l=i.loading,c=A.a(["cashboxBatches"])(o),s=gs.a((function(e,t){return Lu.a(bI.a("cash-cassette-".concat(t,"-refill"),Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(zc,{}),Object(qe.jsxs)("span",{className:r.operationType,children:["Cash cassette ",t," refill"]})]})),bI.a("cash-cassette-".concat(t,"-empty"),Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(zc,{}),Object(qe.jsxs)("span",{className:r.operationType,children:["Cash cassette ",t," emptied"]})]})))(e)}),{"cash-box-empty":Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(Dc,{}),Object(qe.jsx)("span",{className:r.operationType,children:"Cash box emptied"})]})},Du.a(1,5)),d=[{name:"operation",header:"Operation",width:200,textAlign:"left",view:function(e){return Object(qe.jsx)("div",{className:r.operationTypeWrapper,children:s[e.operationType]})}},{name:"machine",header:"Machine",width:200,textAlign:"left",view:Lu.a(R.a("deviceId"),(function(e){return Aa.a(W.a("id",e),t)}),za.a({name:Object(qe.jsx)("i",{children:"Unpaired device"})}),R.a("name"))},{name:"billCount",header:"Bill Count",width:115,textAlign:"left",input:li,inputProps:{decimalPlaces:0},view:function(e){return D.a(e.customBillCount)?e.bills.length:e.customBillCount}},{name:"total",header:"Total",width:180,textAlign:"right",view:function(e){return Object(qe.jsxs)("span",{children:[js.a(T.a((function(e){return R.a("fiat",e)}),e.bills))," ",n]})}},{name:"date",header:"Date",width:135,textAlign:"right",view:function(e){return fd(e.created,a,"yyyy-MM-dd")}},{name:"time",header:"Time (h:m)",width:125,textAlign:"right",view:function(e){return fd(e.created,a,"HH:mm")}}];return Object(qe.jsx)(Ay,{loading:l,name:"cashboxHistory",elements:d,data:c,emptyText:"No cash box batches so far"})},zD=Object(f.a)(DD),qD={2:{machine:250,cashbox:260,cassette:300,cassetteGraph:80,editWidth:90},3:{machine:220,cashbox:215,cassette:225,cassetteGraph:60,editWidth:90},4:{machine:190,cashbox:180,cassette:185,cassetteGraph:50,editWidth:90}},$D=xn.f().shape({name:xn.h().required(),cashbox:xn.e().label("Cash box").required().integer().min(0).max(1e3),cassette1:xn.e().label("Cassette 1").required().integer().min(0).max(500),cassette2:xn.e().label("Cassette 2").required().integer().min(0).max(500),cassette3:xn.e().label("Cassette 3").required().integer().min(0).max(500),cassette4:xn.e().label("Cassette 4").required().integer().min(0).max(500)}),HD=x()(SD||(SD=Object(c.a)(["\n query getData($billFilters: JSONObject) {\n machines {\n name\n id: deviceId\n cashbox\n cassette1\n cassette2\n cassette3\n cassette4\n numberOfCassettes\n }\n unpairedMachines {\n id: deviceId\n name\n }\n config\n bills(filters: $billFilters) {\n id\n fiat\n created\n deviceId\n }\n }\n"]))),VD=x()(ID||(ID=Object(c.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),UD=x()(LD||(LD=Object(c.a)(["\n mutation MachineAction(\n $deviceId: ID!\n $action: MachineAction!\n $cashbox: Int!\n $cassette1: Int!\n $cassette2: Int!\n $cassette3: Int!\n $cassette4: Int!\n ) {\n machineAction(\n deviceId: $deviceId\n action: $action\n cashbox: $cashbox\n cassette1: $cassette1\n cassette2: $cassette2\n cassette3: $cassette3\n cassette4: $cassette4\n ) {\n deviceId\n cashbox\n cassette1\n cassette2\n cassette3\n cassette4\n }\n }\n"]))),GD=x()(PD||(PD=Object(c.a)(["\n query cashboxBatchesCsv($from: Date, $until: Date, $timezone: String) {\n cashboxBatchesCsv(from: $from, until: $until, timezone: $timezone)\n }\n"]))),XD=function(){var e,t,n,r,i,o,c,m,h=zD(),p=Object(a.useState)(!1),b=Object(l.a)(p,2),f=b[0],j=b[1],g=Object(a.useState)(null),O=Object(l.a)(g,2),x=O[0],v=O[1],y=Object(a.useState)(null),w=Object(l.a)(y,2),C=w[0],k=w[1],E=Object(u.c)(HD,{variables:{billFilters:{batch:"none"}}}),N=E.data,S=E.loading,I=Object(a.useState)(!1),L=Object(l.a)(I,2),P=L[0],F=L[1],D=Object(a.useState)(""),B=Object(l.a)(D,2),M=B[0],z=B[1],q=null!==(e=A.a(["machines"])(N))&&void 0!==e?e:[],$=null!==(t=A.a(["unpairedMachines"])(N))&&void 0!==t?t:[],H=null!==(n=A.a(["config"])(N))&&void 0!==n?n:{},V=ds("notifications",H),U=Object(u.b)(UD,{refetchQueries:function(){return["getData"]}}),G=Object(l.a)(U,2),X=G[0],_=G[1].error,Z=Object(u.b)(VD,{onCompleted:function(){return v(!1)},refetchQueries:function(){return["getData"]}}),K=Object(l.a)(Z,1)[0],Q=A.a(["config","locale_timezone"],N),Y=Py.a((function(e){return e.deviceId}))(null!==(r=A.a(["bills"])(N))&&void 0!==r?r:[]),J=Ag.a(T.a(R.a("deviceId"))(null!==(i=A.a(["bills"])(N))&&void 0!==i?i:[])),ee=(null===N||void 0===N?void 0:N.config)&&ds("cashOut")(N.config),te=(null===N||void 0===N?void 0:N.config)&&ds("locale")(N.config),ne=null===te||void 0===te?void 0:te.fiatCurrency,ae=Math.max.apply(Math,Object(d.a)(T.a((function(e){return e.numberOfCassettes}),q)).concat([0])),re=function(e){return ds(e)(ee)},ie=(null===N||void 0===N?void 0:N.config)&&ds("cashIn")(N.config).cashboxReset,oe=function(e){e&&(!function(e){var t=us("cashIn")(e);K({variables:{config:t}})}({cashboxReset:e}),v(!1))},le=[{display:"Automatic",code:"automatic"},{display:"Manual",code:Yh}],ce=function(e){var t=A.a(["target","value"])(e);k(t)},se=[{name:"name",header:"Machine",width:null===(o=qD[ae])||void 0===o?void 0:o.machine,view:function(e){return Object(qe.jsx)(qe.Fragment,{children:e})},input:function(e){var t=e.field.value;return Object(qe.jsx)(qe.Fragment,{children:t})}},{name:"cashbox",header:"Cash box",width:null===(c=qD[ae])||void 0===c?void 0:c.cashbox,view:function(e,t){var n,a=t.id;return Object(qe.jsx)(ti,{currency:{code:ne},notes:e,total:js.a(T.a((function(e){return e.fiat}),null!==(n=Y[a])&&void 0!==n?n:[]))})},input:li,inputProps:{decimalPlaces:0}}];return am.a(rm.a(im.a,ae),(function(e){var t,n;return se.push({name:"cassette".concat(e),header:"Cassette ".concat(e),width:null===(t=qD[ae])||void 0===t?void 0:t.cassette,stripe:!0,doubleHeader:"Cash-out",view:function(t,n){var a,r,i=n.id;return Object(qe.jsx)(ni,{className:h.cashbox,denomination:null===(a=re(i))||void 0===a?void 0:a["cassette".concat(e)],currency:{code:ne},notes:t,width:null===(r=qD[ae])||void 0===r?void 0:r.cassetteGraph,threshold:V["fillingPercentageCassette".concat(e)]})},isHidden:function(t){var n=t.numberOfCassettes;return e>n},input:ri,inputProps:{decimalPlaces:0,width:null===(n=qD[ae])||void 0===n?void 0:n.cassetteGraph,inputClassName:h.cashbox}}),om.a(1,e)}),1),se.push({name:"edit",header:"Edit",width:null===(m=qD[ae])||void 0===m?void 0:m.editWidth,textAlign:"center",view:function(e,t){var n=t.id;return Object(qe.jsx)(ta,{onClick:function(){z(n),F(!0)},children:Object(qe.jsx)(Ph,{})})}}),!S&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(cl,{title:"Cash Boxes & Cassettes",buttons:[{text:"Cash box history",icon:FD,inverseIcon:vD,toggle:j},{component:f?Object(qe.jsx)(sD,{className:h.downloadLogsButton,title:"Download logs",name:"cashboxHistory",query:GD,getLogs:function(e){return A.a(["cashboxBatchesCsv"])(e)},timezone:Q,args:{timezone:Q}}):Object(qe.jsx)(qe.Fragment,{})}],iconClassName:h.listViewButton,className:h.tableWidth,children:!f&&Object(qe.jsxs)(nl.a,{alignItems:"center",justifyContent:"flex-end",children:[Object(qe.jsx)(at,{className:h.cashboxReset,children:"Cash box resets"}),Object(qe.jsxs)(nl.a,{display:"flex",alignItems:"center",justifyContent:"end",mr:"-4px",children:[ie&&Object(qe.jsx)(Ke,{className:h.selection,children:Mm(ie)}),Object(qe.jsx)(ta,{onClick:function(){return v(!0)},className:h.button,children:Object(qe.jsx)(Ph,{})})]})]})}),!f&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(Gh,{error:null===_||void 0===_?void 0:_.message,name:"cashboxes",stripeWhen:function(e){var t=e.id;return!re(t).active},elements:se,data:q,validationSchema:$D,tbodyWrapperClass:h.tBody}),N&&Wa.a(q)&&Object(qe.jsx)(Ns,{message:"No machines so far"})]}),f&&Object(qe.jsx)(WD,{machines:hl.a(q,$),currency:ne,timezone:Q}),Object(qe.jsx)(BD,{currencyCode:ne,machines:q,config:H,bills:A.a(["bills"])(N),deviceIds:J}),P&&Object(qe.jsx)(Hp,{machine:Aa.a(W.a("id",M),q),cashoutSettings:re(M),onClose:function(){F(!1)},error:null===_||void 0===_?void 0:_.message,save:function(e,t,n){return X({variables:Object(s.a)({action:"setCassetteBills",deviceId:e,cashbox:t},n)})},locale:te}),x&&Object(qe.jsxs)(Kh,{title:"Cash box resets",width:478,handleClose:function(){return v(null)},open:!0,children:[Object(qe.jsx)(Ke,{className:h.descriptions,children:"We can automatically assume you emptied a bill validator's cash box when the machine detects that it has been removed."}),Object(qe.jsx)(Er,{name:"set-automatic-reset",value:null!==C&&void 0!==C?C:ie,options:[le[0]],onChange:ce,className:h.radioButtons}),Object(qe.jsx)(Ke,{className:h.descriptions,children:"Assume the cash box is emptied whenever it's removed, creating a new batch on the history screen and setting its current balance to zero."}),Object(qe.jsx)(Er,{name:"set-manual-reset",value:null!==C&&void 0!==C?C:ie,options:[le[1]],onChange:ce,className:h.radioButtons}),Object(qe.jsx)(Ke,{className:h.descriptions,children:"Cash boxes won't be assumed emptied when removed, nor their counts modified. Instead, to update the count and create a new batch, you'll click the 'Edit' button on this panel."}),Object(qe.jsx)(Um.a,{className:h.actions,children:Object(qe.jsx)(An,{onClick:function(){return oe(C)},children:"Confirm"})})]})]})};function _D(){return(_D=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function ZD(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var KD=a.createElement("rect",{width:12,height:12,rx:3,ry:3,fill:"#ff7311"});function QD(e,t){var n=e.title,r=e.titleId,i=ZD(e,["title","titleId"]);return a.createElement("svg",_D({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":r},i),n?a.createElement("title",{id:r},n):null,KD)}var YD=a.forwardRef(QD);n.p;function JD(){return(JD=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function eT(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var tT=a.createElement("rect",{width:12,height:12,rx:3,ry:3,fill:"#ff584a"});function nT(e,t){var n=e.title,r=e.titleId,i=eT(e,["title","titleId"]);return a.createElement("svg",JD({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":r},i),n?a.createElement("title",{id:r},n):null,tT)}var aT,rT,iT,oT,lT,cT=a.forwardRef(nT),sT=(n.p,Object(s.a)(Object(s.a)({},kf),{},{wrapper:{display:"flex",marginTop:12,marginBottom:16,fontSize:we},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(na.fade)($,.5)}})),dT=Object(f.a)(Ef),uT=function(e){var t=e.children,n=dT();return Object(qe.jsx)("div",{className:n.label,children:t})},mT=Object(f.a)(sT),hT=function(e){var t=e.children,n=Object(q.a)(e,["children"]);return Object(qe.jsx)(h.a,Object(s.a)(Object(s.a)({container:!0,spacing:4},n),{},{children:t}))},pT=function(e){var t=e.children,n=Object(q.a)(e,["children"]);return Object(qe.jsx)(h.a,Object(s.a)(Object(s.a)({item:!0,xs:!0},n),{},{children:t}))},bT=function(e){var t=e.it,n=e.onActionSuccess,a=e.timezone,r=mT();return Object(qe.jsx)(hT,{className:r.wrapper,children:Object(qe.jsx)(pT,{xs:!0,children:Object(qe.jsxs)(hT,{className:r.row,children:[Object(qe.jsxs)(pT,{xs:2,children:[Object(qe.jsx)(uT,{children:"Machine Model"}),Object(qe.jsx)("span",{children:ib[t.model]})]}),Object(qe.jsxs)(pT,{xs:4,children:[Object(qe.jsx)(uT,{children:"Paired at"}),Object(qe.jsx)("span",{children:a&&fd(t.pairedAt,a,"yyyy-MM-dd HH:mm:ss")})]}),Object(qe.jsx)(pT,{xs:6,children:Object(qe.jsx)(pf,{machine:t,onActionSuccess:n})}),Object(qe.jsxs)(pT,{xs:2,children:[Object(qe.jsx)(uT,{children:"Network speed"}),Object(qe.jsx)("span",{children:t.downloadSpeed?new Hc.a(t.downloadSpeed).toFixed(4).toString()+" MB/s":"unavailable"})]}),Object(qe.jsxs)(pT,{xs:2,children:[Object(qe.jsx)(uT,{children:"Latency"}),Object(qe.jsx)("span",{children:t.responseTime?new Hc.a(t.responseTime).toFixed(3).toString()+" ms":"unavailable"})]}),Object(qe.jsxs)(pT,{xs:2,children:[Object(qe.jsx)(uT,{children:"Packet Loss"}),Object(qe.jsx)("span",{children:t.packetLoss?new Hc.a(t.packetLoss).toFixed(3).toString()+" %":"unavailable"})]})]})})})},fT=x()(aT||(aT=Object(c.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"]))),jT=x()(rT||(rT=Object(c.a)(["\n query getData {\n config\n }\n"]))),gT=Object(f.a)(Nf),OT=function(){var e,t=gT(),n=Object(w.h)(),a=Object(w.i)().state,r=null===a||void 0===a?void 0:a.id,i=Object(u.c)(fT),o=i.data,l=i.refetch,c=i.loading,s=Object(u.c)(jT),d=s.data,m=s.configLoading,h=A.a(["config","locale_timezone"],d),p=[{header:"Machine Name",width:250,size:"sm",textAlign:"left",view:function(e){return Object(qe.jsxs)("div",{className:t.flexRow,children:[e.name,Object(qe.jsx)("div",{className:t.machineRedirectContainer,onClick:function(){n.push("/machines/".concat(e.deviceId))},children:Object(qe.jsx)(fu,{})})]})}},{header:"Status",width:350,size:"sm",textAlign:"left",view:function(e){return Object(qe.jsx)(Mu,{statuses:e.statuses})}},{header:"Last ping",width:200,size:"sm",textAlign:"left",view:function(e){return e.lastPing?Object(sb.a)(new Date(e.lastPing),new Date,{addSuffix:!0}):"unknown"}},{header:"Software Version",width:200,size:"sm",textAlign:"left",view:function(e){return e.version||"unknown"}}],b=null!==(e=A.a(["machines"])(o))&&void 0!==e?e:[],f=jl.a(W.a("deviceId",r))(b),j=c||m;return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsxs)("div",{className:t.titleWrapper,children:[Object(qe.jsx)("div",{className:t.titleAndButtonsContainer,children:Object(qe.jsx)(yn,{children:"Machine Status"})}),Object(qe.jsxs)("div",{className:t.headerLabels,children:[Object(qe.jsxs)("div",{children:[Object(qe.jsx)(YD,{}),Object(qe.jsx)("span",{children:"Warning"})]}),Object(qe.jsxs)("div",{children:[Object(qe.jsx)(cT,{}),Object(qe.jsx)("span",{children:"Error"})]})]})]}),Object(qe.jsx)(Ay,{loading:j,elements:p,data:b,Details:function(e){var t=e.it;return Object(qe.jsx)(bT,{it:t,onActionSuccess:l,timezone:h})},initialExpanded:f,emptyText:"No machines so far",expandable:!0})]})},xT=r.a.createContext(),vT=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}}),yT=function(e){var t=e.title,n=e.editing,a=e.disabled,r=e.setEditing,i=vT();return Object(qe.jsxs)("div",{className:i.header,children:[Object(qe.jsx)(_e,{className:i.title,children:t}),!n&&Object(qe.jsx)(ta,{onClick:function(){return r(!0)},className:i.button,disabled:a,children:a?Object(qe.jsx)(kh,{}):Object(qe.jsx)(Ph,{})}),n&&Object(qe.jsxs)("div",{className:i.editingButtons,children:[Object(qe.jsx)(oa,{color:"primary",type:"submit",children:"Save"}),Object(qe.jsx)(oa,{color:"secondary",type:"reset",children:"Cancel"})]})]})},wT=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]]}}),CT=function(e){var t,n=e.label,a=e.name,r=e.editing,i=e.displayValue,o=e.decoration,l=e.className,c=e.decimalPlaces,s=void 0===c?0:c,d=e.width,u=void 0===d?80:d,m=wT({width:u,editing:r}),h=Object(mn.f)().values,p=(t={},Object(z.a)(t,m.fieldWrapper,!0),Object(z.a)(t,"className",l),t);return Object(qe.jsxs)("div",{className:I()(p),children:[n&&Object(qe.jsx)(at,{className:m.label,children:n}),Object(qe.jsxs)("div",{className:m.valueWrapper,children:[!r&&Object(qe.jsx)(Qe,{className:m.text,children:i(h[a])}),r&&Object(qe.jsx)(mn.b,{id:a,size:"lg",fullWidth:!0,name:a,component:li,textAlign:"right",width:u,decimalPlaces:s}),Object(qe.jsx)(nt,{className:m.decoration,children:o})]})]})},kT=function(e){var t,n=e.title,r=e.label,i=e.width,o=void 0===i?80:i,c=e.min,s=void 0===c?0:c,d=e.max,u=void 0===d?9999999:d,m=e.name,h=e.section,p=e.className,b=Object(a.useState)(!1),f=Object(l.a)(b,2),j=f[0],g=f[1],O=function(){var e=Object(Al.a)(Bl.a.mark((function e(t,n){return Bl.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(a.useContext)(xT),v=x.save,y=x.data,w=x.currency,C=x.isEditing,k=x.isDisabled,E=x.setEditing,N=xn.f().shape(Object(z.a)({},m,xn.e().transform(Ur).integer().min(s).max(u).nullable()));return Object(qe.jsx)(mn.e,{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(){E(m,!1)},children:Object(qe.jsxs)(mn.d,{className:p,children:[Object(qe.jsx)(pm,{}),Object(qe.jsx)(yT,{title:n,editing:C(m),disabled:k(m),setEditing:function(e){return E(m,e)}}),Object(qe.jsx)(CT,{label:r,name:m,editing:C(m),width:o,displayValue:function(e){return""===e?"-":e},decoration:w})]})})},ET="cryptoLowBalance",NT="cryptoHighBalance",ST=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"]]}}),IT=function(e){var t=e.section,n=e.fieldWidth,r=ST(),i=Object(a.useContext)(xT),o=i.data,l=i.save,c=i.currency,s=i.setEditing,d=i.isEditing,u=i.isDisabled;return Object(qe.jsxs)("div",{className:r.cryptoBalanceAlerts,children:[Object(qe.jsx)(kT,{name:ET,data:o,save:l,section:t,decoration:c,className:r.cryptoBalanceAlertsForm,title:"Default (Low Balance)",label:"Alert me under",editing:d(ET),disabled:u(ET),setEditing:function(e){return s(ET,e)},width:n}),Object(qe.jsx)("div",{className:r.vertSeparator}),Object(qe.jsx)(kT,{name:NT,data:o,section:t,save:l,decoration:c,className:r.cryptoBalanceAlertsSecondForm,title:"Default (High Balance)",label:"Alert me over",editing:d(NT),disabled:u(NT),setEditing:function(e){return s(NT,e)},width:n})]})},LT="highBalance",PT="lowBalance",FT="cryptoCurrency",DT="cryptoBalanceOverrides",TT=function(e){var t,n,r,i=e.section,o=Object(a.useContext)(xT),l=o.cryptoCurrencies,c=void 0===l?[]:l,s=o.data,d=o.save,u=o.error,m=o.currency,h=o.isDisabled,p=o.setEditing,b=null!==(t=null===s||void 0===s?void 0:s.cryptoBalanceOverrides)&&void 0!==t?t:[],f=T.a(R.a(FT))(b),j=M.a((function(e){return!fl.a(e.code,f)}))(c),g=(n={},Object(z.a)(n,FT,null),Object(z.a)(n,PT,""),Object(z.a)(n,LT,""),n),O=xn.f().shape((r={},Object(z.a)(r,FT,xn.h().label("Cryptocurrency").nullable().required()),Object(z.a)(r,PT,xn.e().label("Low Balance").when(LT,{is:function(e){return!e},then:xn.e().required()}).transform(Ur).integer().min(0).max(Qh).nullable()),Object(z.a)(r,LT,xn.e().label("High Balance").when(PT,{is:function(e){return!e},then:xn.e().required()}).transform(Ur).integer().min(0).max(Qh).nullable()),r),[PT,LT]),x=[{name:FT,header:"Cryptocurrency",width:166,size:"sm",view:function(e){return P.a(A.a(["display"]),Aa.a(W.a("code",e)))(c)},input:Br,inputProps:{options:function(e){return hl.a(j,function(e){var t=P.a(Aa.a(W.a("code",null===e||void 0===e?void 0:e.cryptoCurrency)))(c);return t?[t]:[]}(e))},optionsLimit:null,valueProp:"code",labelProp:"display"}},{name:PT,width:155,textAlign:"right",bold:!0,input:li,suffix:m,inputProps:{decimalPlaces:2}},{name:LT,width:155,textAlign:"right",bold:!0,input:li,suffix:m,inputProps:{decimalPlaces:2}}];return Object(qe.jsx)(Gh,{name:DT,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(DT)||!c,data:b,elements:x,disableAdd:!(null===j||void 0===j?void 0:j.length),onDelete:function(e){var t={cryptoBalanceOverrides:dm.a((function(t){return t.id===e}),b)};return d(t)},setEditing:function(e){return p(DT,e)}})},RT={wrapper:{display:"flex"},form:{marginBottom:36},title:{marginTop:0},row:{width:236,display:"grid",gridTemplateColumns:"repeat(2,1fr)",gridTemplateRows:"1fr",gridColumnGap:18,gridRowGap:0},col2:{width:136},cashboxLabel:{marginRight:4,fontSize:20},cashboxEmptyPart:{backgroundColor:"".concat(ae)}},BT=Object(f.a)(RT),AT="fiatBalanceAlertsCashIn",MT="fiatBalanceAlertsCashOut",WT=function(e){var t,n,r,i,o,l=e.section,c=e.min,s=void 0===c?0:c,u=e.max,m=void 0===u?100:u,h=e.fieldWidth,p=void 0===h?80:h,b=Object(a.useContext)(xT),f=b.isEditing,j=b.isDisabled,g=b.setEditing,O=b.data,x=b.save,v=b.machines,y=void 0===v?[]:v,w=BT(),C=Math.max.apply(Math,Object(d.a)(T.a((function(e){return e.numberOfCassettes}),y)).concat([2])),k=xn.f().shape({cashInAlertThreshold:xn.e().transform(Ur).integer().min(0).max(9999999).nullable(),fillingPercentageCassette1:xn.e().transform(Ur).integer().min(s).max(m).nullable(),fillingPercentageCassette2:xn.e().transform(Ur).integer().min(s).max(m).nullable(),fiatBalanceCassette3:xn.e().transform(Ur).integer().min(s).max(m).nullable(),fiatBalanceCassette4:xn.e().transform(Ur).integer().min(s).max(m).nullable()});return Object(qe.jsx)(mn.e,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,initialValues:{cashInAlertThreshold:null!==(t=null===O||void 0===O?void 0:O.cashInAlertThreshold)&&void 0!==t?t:"",fillingPercentageCassette1:null!==(n=null===O||void 0===O?void 0:O.fillingPercentageCassette1)&&void 0!==n?n:"",fillingPercentageCassette2:null!==(r=null===O||void 0===O?void 0:O.fillingPercentageCassette2)&&void 0!==r?r:"",fillingPercentageCassette3:null!==(i=null===O||void 0===O?void 0:O.fillingPercentageCassette3)&&void 0!==i?i:"",fillingPercentageCassette4:null!==(o=null===O||void 0===O?void 0:O.fillingPercentageCassette4)&&void 0!==o?o:""},validationSchema:k,onSubmit:function(e){return x(l,k.cast(e))},onReset:function(){g(AT,!1),g(MT,!1)},children:function(e){var t=e.values;return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsxs)(mn.d,{className:w.form,children:[Object(qe.jsx)(pm,{}),Object(qe.jsx)(yT,{title:"Cash box",editing:f(AT),disabled:j(AT),setEditing:function(e){return g(AT,e)}}),Object(qe.jsx)("div",{className:w.wrapper,children:Object(qe.jsx)("div",{className:w.first,children:Object(qe.jsx)("div",{className:w.row,children:Object(qe.jsx)("div",{className:w.col2,children:Object(qe.jsx)(CT,{label:"Alert me over",name:"cashInAlertThreshold",editing:f(AT),displayValue:function(e){return""===e?"-":e},decoration:"notes",width:p})})})})})]}),Object(qe.jsxs)(mn.d,{className:w.form,children:[Object(qe.jsx)(pm,{}),Object(qe.jsx)(yT,{title:"Cash out (Empty)",editing:f(MT),disabled:j(MT),setEditing:function(e){return g(MT,e)}}),Object(qe.jsx)("div",{className:w.wrapper,children:T.a((function(e){var n;return Object(qe.jsx)(qe.Fragment,{children:Object(qe.jsxs)("div",{className:w.row,children:[Object(qe.jsx)(ei,{labelClassName:w.cashboxLabel,emptyPartClassName:w.cashboxEmptyPart,percent:null!==(n=t["fillingPercentageCassette".concat(e+1)])&&void 0!==n?n:O["cassette".concat(e+1)],applyColorVariant:!0,applyFiatBalanceAlertsStyling:!0,omitInnerPercentage:!0,cashOut:!0}),Object(qe.jsxs)("div",{className:w.col2,children:[Object(qe.jsxs)(nt,{className:w.title,children:["Cassette ",e+1]}),Object(qe.jsx)(CT,{label:"Alert me under",name:"fillingPercentageCassette".concat(e+1),editing:f(MT),displayValue:function(e){return""===e?"-":e},decoration:"%",width:p})]})]})})}),Pu.a(Fu.a,C))})]})]})}})},zT="cashInAlertThreshold",qT="fillingPercentageCassette1",$T="fillingPercentageCassette2",HT="fillingPercentageCassette3",VT="fillingPercentageCassette4",UT="machine",GT="fiatBalanceOverrides",XT=[qT,$T,HT,VT],_T={2:{machine:230,cashbox:150,cassette:250},3:{machine:216,cashbox:150,cassette:270},4:{machine:210,cashbox:150,cassette:204}},ZT=function(e){var t,n,r,i=e.config,o=e.section,l=Object(a.useContext)(xT),c=l.machines,s=void 0===c?[]:c,u=l.data,m=l.save,h=l.isDisabled,p=l.setEditing,b=l.error,f=null!==(t=null===u||void 0===u?void 0:u.fiatBalanceOverrides)&&void 0!==t?t:[],j=T.a((function(e){return e.machine}),f),g=dO.a((function(e,t){return e.deviceId===t}),s,j),O=(n={},Object(z.a)(n,UT,null),Object(z.a)(n,zT,""),Object(z.a)(n,qT,""),Object(z.a)(n,$T,""),Object(z.a)(n,HT,""),Object(z.a)(n,VT,""),n),x=Math.max.apply(Math,Object(d.a)(T.a((function(e){return e.numberOfCassettes}),s)).concat([2])),v=100,y=xn.f().shape((r={},Object(z.a)(r,UT,xn.h().label("Machine").required()),Object(z.a)(r,zT,xn.e().label("Cash box").transform(Ur).integer().min(0).max(9999999).nullable()),Object(z.a)(r,qT,xn.e().label("Cassette 1").transform(Ur).integer().min(0).max(v).nullable()),Object(z.a)(r,$T,xn.e().label("Cassette 2").transform(Ur).integer().min(0).max(v).nullable()),Object(z.a)(r,HT,xn.e().label("Cassette 3").transform(Ur).integer().min(0).max(v).nullable()),Object(z.a)(r,VT,xn.e().label("Cassette 4").transform(Ur).integer().min(0).max(v).nullable()),r)).test((function(e,t){return jn.a((function(t){return!D.a(e[t])}),sm.a(zT,XT))?void 0:t.createError({path:zT,message:"The cash box or at least one of the cassettes must have a value"})})),w=hl.a([{name:UT,display:"Machine",width:_T[x].machine,size:"sm",view:function(e){return P.a(A.a(["name"]),Aa.a(W.a("deviceId",e)))(s)},input:Br,inputProps:{options:function(e){return hl.a(g,function(e){var t=Aa.a(W.a("deviceId",null===e||void 0===e?void 0:e.machine),s);return t?[t]:[]}(e))},valueProp:"deviceId",labelProp:"name"}},{name:zT,display:"Cash box",width:_T[x].cashbox,textAlign:"right",bold:!0,input:li,suffix:"notes",inputProps:{decimalPlaces:0}}],T.a((function(e){return{name:"fillingPercentageCassette".concat(e),display:"Cash cassette ".concat(e),width:_T[x].cassette,textAlign:"right",doubleHeader:"Cash Cassette Empty",bold:!0,input:li,suffix:"%",inputProps:{decimalPlaces:0},view:function(e){var t;return null!==(t=null===e||void 0===e?void 0:e.toString())&&void 0!==t?t:"\u2014"},isHidden:function(t){var n;return!function(e){return ds(e)(i)}(t.machine).active||e>za.a(0,null===(n=s.find((function(e){return e.deviceId===t.machine})))||void 0===n?void 0:n.numberOfCassettes)}}}),Du.a(1,x+1)));return Object(qe.jsx)(Gh,{name:GT,title:"Overrides",error:null===b||void 0===b?void 0:b.message,enableDelete:!0,enableEdit:!0,enableCreate:!0,save:function(e){return m(o,y.cast(e))},initialValues:O,validationSchema:y,forceDisable:h(GT)||!s,data:f,elements:w,disableAdd:!(null===g||void 0===g?void 0:g.length),setEditing:function(e){return p(GT,e)}})},KT={balance:152,transactions:184,compliance:178,errors:142,security:152,active:263},QT=function(e){var t=e.namespace,n=e.data,a=e.forceDisable,r=e.save,i=e.shouldUpperCase,o=e.onActivation,l=a||!n||!n.active,c=function(e){var t=e.name,a=e.disabled,i=!(!n||!n[t]);return Object(qe.jsx)(km,{width:KT[t],textAlign:"center",children:Object(qe.jsx)(Lr,{disabled:a,checked:i,onChange:function(e){("active"!==t||!1!==i||o())&&r(Object(z.a)({},t,e.target.checked))},value:i})})};return Object(qe.jsxs)(Sm,{children:[Object(qe.jsx)(km,{width:229,children:i?Gj.a(t):zm(t)}),Object(qe.jsx)(c,{name:"balance",disabled:l}),Object(qe.jsx)(c,{name:"transactions",disabled:l}),Object(qe.jsx)(c,{name:"compliance",disabled:l}),Object(qe.jsx)(c,{name:"errors",disabled:l}),Object(qe.jsx)(c,{name:"security",disabled:l}),Object(qe.jsx)(c,{name:"active",disabled:a})]})},YT=Object(f.a)({wizardTable:{width:930}}),JT=function(e){var t=e.wizard,n=e.forceDisable,r=Object(a.useContext)(xT),i=r.data,o=r.save,l=r.twilioAvailable,c=r.setSmsSetupPopup,s=r.mailgunAvailable,d=r.setEmailSetupPopup,u=[{name:"email",forceDisable:n,shouldUpperCase:!1,onActivation:function(){return!!s||(d(!0),!1)}},{name:"sms",forceDisable:n,shouldUpperCase:!0,onActivation:function(){return!!l||(c(!0),!1)}},{name:"notificationCenter",forceDisable:n,shouldUpperCase:!1,onActivation:function(){return!0}}],m=t?20:0,h=YT();return Object(qe.jsxs)(vm,{className:t?h.wizardTable:null,children:[Object(qe.jsxs)(ym,{children:[Object(qe.jsx)(Em,{width:229-m,children:"Channel"}),Object.keys(KT).map((function(e){return Object(qe.jsx)(Em,{width:KT[e]-m,textAlign:"center",children:zm(e)},e)}))]}),Object(qe.jsx)(Cm,{children:u.map((function(e){return Object(qe.jsx)(QT,{namespace:e.name,forceDisable:e.forceDisable,save:P.a(o(null),us(e.name)),data:ds(e.name)(i),shouldUpperCase:e.shouldUpperCase,onActivation:e.onActivation})}))})]})},eR=function(e){var t=e.section,n=e.fieldWidth;return Object(qe.jsx)(kT,{section:t,title:"High value transaction",label:"Alert me over",name:"highValueTransaction",width:n})},tR=x()(iT||(iT=Object(c.a)(["\n query getData {\n config\n machines {\n name\n deviceId\n numberOfCassettes\n }\n cryptoCurrencies {\n code\n display\n }\n accounts\n }\n"]))),nR=x()(oT||(oT=Object(c.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),aR=x()(lT||(lT=Object(c.a)(["\n mutation Save($accounts: JSONObject) {\n saveAccounts(accounts: $accounts)\n }\n"]))),rR=function(e){var t=e.name,n=e.displaySetup,r=void 0===n||n,i=e.displayTransactionAlerts,o=void 0===i||i,c=e.displayFiatAlerts,s=void 0===c||c,d=e.displayCryptoAlerts,m=void 0===d||d,h=e.displayOverrides,p=void 0===h||h,b=e.displayTitle,f=void 0===b||b,j=e.wizard,g=void 0!==j&&j,O=Object(a.useState)(null),x=Object(l.a)(O,2),v=x[0],y=x[1],w=Object(a.useState)(null),C=Object(l.a)(w,2),k=C[0],E=C[1],N=Object(a.useState)(null),S=Object(l.a)(N,2),I=S[0],L=S[1],F=Object(a.useState)(!1),D=Object(l.a)(F,2),T=D[0],R=D[1],B=Object(a.useState)(!1),M=Object(l.a)(B,2),W=M[0],z=M[1],q=Object(u.c)(tR),$=q.data,H=q.loading,V=Object(u.b)(nR,{refetchQueries:["getData"],onCompleted:function(){return L(null)},onError:function(e){return E(e)}}),U=Object(l.a)(V,1)[0],G=Object(u.b)(aR,{onCompleted:function(){R(!1),z(!1)},refetchQueries:["getData"],onError:function(e){return E(e)}}),X=Object(l.a)(G,1)[0],_=ds(t)(null===$||void 0===$?void 0:$.config),Z=null===$||void 0===$?void 0:$.machines,K=null===$||void 0===$?void 0:$.cryptoCurrencies,Q=ul.a("twilio",(null===$||void 0===$?void 0:$.accounts)||{}),Y=ul.a("mailgun",(null===$||void 0===$?void 0:$.accounts)||{}),J=A.a(["fiatCurrency"])(ds(ts)(null===$||void 0===$?void 0:$.config)),ee=Uc.a((function(e,n){var a=us(t)(n);return y(e),E(null),U({variables:{config:a}})})),te={save:ee,error:k,editingKey:I,data:_,currency:J,isEditing:function(e){return I===e},isDisabled:function(e){return I&&I!==e},setEditing:function(e,t){t||E(null),L(t?e:null)},setSection:y,machines:Z,cryptoCurrencies:K,twilioAvailable:Q,setSmsSetupPopup:R,mailgunAvailable:Y,setEmailSetupPopup:z};return!H&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsxs)(xT.Provider,{value:te,children:[f&&Object(qe.jsx)(cl,{title:"Notifications"}),r&&Object(qe.jsx)(AO,{title:"Setup",error:k&&!v,children:Object(qe.jsx)(JT,{forceDisable:!!I,wizard:g})}),o&&Object(qe.jsx)(AO,{title:"Transaction alerts",error:k&&"tx"===v,children:Object(qe.jsx)(eR,{section:"tx",fieldWidth:130})}),s&&Object(qe.jsxs)(AO,{title:"Fiat balance alerts",error:k&&"fiat"===v,children:[Object(qe.jsx)(WT,{section:"fiat",max:100,fieldWidth:50}),p&&Object(qe.jsx)(ZT,{config:ds(Qc)(null===$||void 0===$?void 0:$.config),section:"fiat"})]}),m&&Object(qe.jsxs)(AO,{title:"Crypto balance alerts",error:k&&"crypto"===v,children:[Object(qe.jsx)(IT,{section:"crypto",fieldWidth:130}),p&&Object(qe.jsx)(TT,{section:"crypto",fieldWidth:130})]})]}),T&&Object(qe.jsxs)(Kh,{title:"Configure Twilio",width:478,handleClose:function(){return R(!1)},open:!0,children:[Object(qe.jsx)(Ke,{children:"In order for the SMS notifications to work, you'll first need to configure Twilio."}),Object(qe.jsx)(ax,{save:function(e){return E(null),X({variables:{accounts:{twilio:e}}}).then((function(){return P.a(ee(null),us("sms"))({active:!0})}))},elements:ox.elements,validationSchema:ox.getValidationSchema})]}),W&&Object(qe.jsxs)(Kh,{title:"Configure Mailgun",width:478,handleClose:function(){return z(!1)},open:!0,children:[Object(qe.jsx)(Ke,{children:"In order for the mail notifications to work, you'll first need to configure Mailgun."}),Object(qe.jsx)(ax,{save:function(e){return E(null),X({variables:{accounts:{mailgun:e}}}).then((function(){return P.a(ee(null),us("email"))({active:!0})}))},elements:qx.elements,validationSchema:qx.getValidationSchema})]})]})},iR=n(1106);function oR(){return(oR=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function lR(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var cR=a.createElement("g",{id:"\\u21B3\\u21B3-Coin-ATM-Radar",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"operator-info_v4-CAR#1",transform:"translate(-832.000000, -608.000000)",fill:"#FF584A",fillRule:"nonzero"},a.createElement("g",{id:"Group",transform:"translate(832.000000, 608.000000)"},a.createElement("polygon",{id:"Line-7",points:"13.0484874 0 16 2.95151255 2.95151255 16 0 13.0484874"}),a.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 sR(e,t){var n=e.title,r=e.titleId,i=lR(e,["title","titleId"]);return a.createElement("svg",oR({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":r},i),void 0===n?a.createElement("title",{id:r},"Group"):n?a.createElement("title",{id:r},n):null,cR)}var dR=a.forwardRef(sR);n.p;function uR(){return(uR=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function mR(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var hR=a.createElement("desc",null,"Created with Sketch."),pR=a.createElement("g",{id:"icon/table/true",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.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 bR(e,t){var n=e.title,r=e.titleId,i=mR(e,["title","titleId"]);return a.createElement("svg",uR({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":r},i),void 0===n?a.createElement("title",{id:r},"icon/table/true"):n?a.createElement("title",{id:r},n):null,hR,pR)}var fR,jR,gR,OR,xR,vR,yR=a.forwardRef(bR),wR=(n.p,{booleanPropertiesTableWrapper:{display:"flex",flexDirection:"column",width:396},tableRow:{display:"flex",alignItems:"center",justifyContent:"space-between","&:nth-child(even)":{backgroundColor:ae},"&: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:yf.fillColumn,popoverContent:{width:272,padding:[[10,15]]}}),CR=Object(f.a)(wR),kR=function(e){var t=e.name;return"true"===Object(mn.f)().values[t]?Object(qe.jsx)(yR,{}):Object(qe.jsx)(dR,{})},ER=Object(a.memo)((function(e){var t=e.title,n=e.disabled,r=e.data,i=e.elements,o=e.save,c=e.forcedEditing,s=void 0!==c&&c,d=Gc.a(i.map((function(e){var t,n;return[e.name,null!==(t=null===(n=r[e.name])||void 0===n?void 0:n.toString())&&void 0!==t?t:null]}))),u=Gc.a(i.map((function(e){return[e.name,xn.b().required()]}))),m=Object(a.useState)(s),h=Object(l.a)(m,2),p=h[0],b=h[1],f=CR(),j=function(){var e=Object(Al.a)(Bl.a.mark((function e(t){var n;return Bl.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=function(e,t){return gn.a(e,"true")},o(iR.a(n,M.a(Hr.a(D.a))(t))),b(!1);case 3: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(qe.jsx)("div",{className:f.booleanPropertiesTableWrapper,children:Object(qe.jsx)(mn.e,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,onSubmit:j,initialValues:d,schemaValidation:u,children:function(e){var a=e.resetForm;return Object(qe.jsxs)(mn.d,{children:[Object(qe.jsxs)("div",{className:f.rowWrapper,children:[Object(qe.jsx)(_e,{children:t}),p?Object(qe.jsxs)("div",{className:f.rightAligned,children:[Object(qe.jsx)(oa,{type:"submit",color:"primary",children:"Save"}),Object(qe.jsx)(oa,{type:"reset",className:f.rightLink,onClick:function(){a(),b(!1)},color:"secondary",children:"Cancel"})]}):Object(qe.jsx)(ta,{className:f.transparentButton,onClick:function(){return b(!0)},children:n?Object(qe.jsx)(kh,{}):Object(qe.jsx)(Ph,{})})]}),Object(qe.jsx)(pm,{}),Object(qe.jsx)(Is,{className:f.fillColumn,children:Object(qe.jsx)(Ls,{className:f.fillColumn,children:i.map((function(e,t){return Object(qe.jsxs)(zs,{size:"sm",className:f.tableRow,children:[Object(qe.jsx)(Fs,{className:f.leftTableCell,children:e.display}),Object(qe.jsxs)(Fs,{className:f.rightTableCell,children:[p&&Object(qe.jsx)(mn.b,{component:ci,name:e.name,options:g,className:I()(f.radioButtons,f.rightTableCell)}),!p&&Object(qe.jsx)(kR,{name:e.name})]})]},t)}))})})]})}})})})),NR={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]]}},SR=Object(f.a)(NR),IR=x()(fR||(fR=Object(c.a)(["\n query getData {\n config\n }\n"]))),LR=x()(jR||(jR=Object(c.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),PR=Object(a.memo)((function(e){var t=e.title,n=e.disabled,a=void 0!==n&&n,r=e.checked,i=e.save,o=e.label,l=SR();return Object(qe.jsxs)("div",{className:l.switchRow,children:[Object(qe.jsx)(Ke,{children:t}),Object(qe.jsxs)("div",{className:l.switch,children:[Object(qe.jsx)(Lr,{disabled:a,checked:r,onChange:function(e){return i&&i(e.target.checked)}}),o&&Object(qe.jsx)(rt,{children:o})]})]})})),FR=Object(a.memo)((function(e){var t=e.wizard,n=SR(),a=Object(u.c)(IR).data,r=Object(u.b)(LR,{refetchQueries:["getData"]}),i=Object(l.a)(r,1)[0],o=function(e){return i({variables:{config:us(rs,e)}})},c=(null===a||void 0===a?void 0:a.config)&&ds(rs,a.config);return c?Object(qe.jsx)("div",{className:n.content,children:Object(qe.jsxs)("div",{children:[Object(qe.jsxs)("div",{className:n.header,children:[Object(qe.jsx)(_e,{children:"Coin ATM Radar share settings"}),Object(qe.jsx)(Np,{width:304,children:Object(qe.jsxs)(Ke,{children:["For details on configuring this panel, please read the relevant knowledgebase article"," ",Object(qe.jsx)("a",{target:"_blank",rel:"noopener noreferrer",href:"https://support.lamassu.is/hc/en-us/articles/360023720472-Coin-ATM-Radar",children:"here"}),"."]})})]}),Object(qe.jsx)(PR,{title:"Share information?",checked:c.active,save:function(e){return o({active:e})},label:c.active?"Yes":"No"}),Object(qe.jsx)(ER,{editing:t,title:"Machine info",data:c,elements:[{name:"commissions",display:"Commissions"},{name:"limitsAndVerification",display:"Limits and verification"}],save:o})]})}):null})),DR={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:Ce,transformOrigin:"left",paddingLeft:0,margin:[[3,0,3,0]]},"& > p:last-child":{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",margin:0}}},TR=Object(f.a)(DR),RR=function(e){var t,n=e.editing,a=e.field,r=e.displayValue,i=Object(q.a)(e,["editing","field","displayValue"]),o=TR(),l=(t={},Object(z.a)(t,o.field,!0),Object(z.a)(t,o.notEditing,!n),t);return Object(qe.jsxs)("div",{className:I()(l),children:[!n&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(it,{children:a.label}),Object(qe.jsx)(Je,{children:r(a.value)})]}),n&&Object(qe.jsx)(mn.b,Object(s.a)({id:a.name,name:a.name,component:a.component,placeholder:a.placeholder,type:a.type,label:a.label,width:280},i))]})},BR=x()(gR||(gR=Object(c.a)(["\n query getData {\n config\n }\n"]))),AR=x()(OR||(OR=Object(c.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),MR=Object(f.a)(NR),WR=function(e){var t,n,r,i,o=e.wizard,c=MR(),s=Object(a.useState)(o||!1),d=Object(l.a)(s,2),m=d[0],h=d[1],p=Object(a.useState)(null),b=Object(l.a)(p,2),f=b[0],j=b[1],g=Object(u.b)(AR,{onCompleted:function(){return h(!1)},refetchQueries:function(){return["getData"]},onError:function(e){return j(e)}}),O=Object(l.a)(g,1)[0],x=Object(u.c)(BR).data,v=function(e){return O({variables:{config:us(Jc,e)}})},y=(null===x||void 0===x?void 0:x.config)&&ds(Jc,x.config);if(!y)return null;var w=xn.f().shape({active:xn.b(),name:xn.h(),phone:xn.h(),email:xn.h().email("Please enter a valid email address").required("An email is required"),website:xn.h(),companyNumber:xn.h()}),C=[{name:"name",label:"Full name",value:null!==(t=y.name)&&void 0!==t?t:"",component:di},{name:"phone",label:"Phone number",value:y.phone,component:di},{name:"email",label:"Email",value:null!==(n=y.email)&&void 0!==n?n:"",component:di},{name:"website",label:"Website",value:null!==(r=y.website)&&void 0!==r?r:"",component:di},{name:"companyNumber",label:"Company number",value:null!==(i=y.companyNumber)&&void 0!==i?i:"",component:di}],k=function(e){return Aa.a(W.a("name",e))(C)},E=function(e){return k(e).value},N=function(e){return e},S={initialValues:{active:y.active,name:E("name"),phone:E("phone"),email:E("email"),website:E("website"),companyNumber:E("companyNumber")}},L=function(e){return D.a(e.email)?null:e.email};return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)("div",{className:c.header,children:Object(qe.jsx)(_e,{children:"Contact information"})}),Object(qe.jsxs)("div",{className:c.switchRow,children:[Object(qe.jsx)(Ke,{children:"Info card enabled?"}),Object(qe.jsxs)("div",{className:c.switch,children:[Object(qe.jsx)(Lr,{checked:y.active,onChange:function(e){return v({active:e.target.checked})}}),Object(qe.jsx)(rt,{children:y.active?"Yes":"No"})]})]}),Object(qe.jsxs)("div",{className:c.section,children:[Object(qe.jsxs)("div",{className:c.header,children:[Object(qe.jsx)(_e,{children:"Info card"}),!m&&Object(qe.jsx)(ta,{className:c.transparentButton,onClick:function(){return h(!0)},children:Object(qe.jsx)(Ph,{})})]}),Object(qe.jsx)(mn.e,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,initialValues:S.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(qe.jsxs)(mn.d,{children:[Object(qe.jsx)(pm,{}),Object(qe.jsxs)("div",{className:c.row,children:[Object(qe.jsx)(RR,{field:k("name"),editing:m,displayValue:N,onFocus:function(){return j(null)}}),Object(qe.jsx)(RR,{field:k("phone"),editing:m,displayValue:N,onFocus:function(){return j(null)}})]}),Object(qe.jsxs)("div",{className:c.row,children:[Object(qe.jsx)(RR,{field:k("email"),editing:m,displayValue:N,onFocus:function(){return j(null)}}),Object(qe.jsx)(RR,{field:k("website"),editing:m,displayValue:N,onFocus:function(){return j(null)}})]}),Object(qe.jsx)("div",{className:c.row,children:Object(qe.jsx)(RR,{field:k("companyNumber"),editing:m,displayValue:N,onFocus:function(){return j(null)}})}),m&&!!L(t)&&Object(qe.jsx)(il,{className:c.formErrorMsg,children:L(t)}),Object(qe.jsx)("div",{className:I()(c.row,c.submit),children:m&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(oa,{color:"primary",type:"submit",children:"Save"}),Object(qe.jsx)(oa,{color:"secondary",type:"reset",children:"Cancel"}),f&&Object(qe.jsx)(il,{children:"Failed to save changes"})]})})]})}})]}),!o&&Object(qe.jsxs)("div",{className:I()(c.section,c.infoMessage),children:[Object(qe.jsx)(ir,{}),Object(qe.jsx)(at,{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."})]})]})},zR=Object(f.a)(NR),qR=x()(xR||(xR=Object(c.a)(["\n query getData {\n config\n }\n"]))),$R=x()(vR||(vR=Object(c.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),HR=Object(a.memo)((function(e){var t=e.wizard,n=zR(),a=Object(u.c)(qR).data,r=Object(u.b)($R,{refetchQueries:function(){return["getData"]}}),i=Object(l.a)(r,1)[0],o=(null===a||void 0===a?void 0:a.config)&&ds(as,a.config);return o?Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)("div",{className:n.header,children:Object(qe.jsx)(_e,{children:"Receipt options"})}),Object(qe.jsxs)("div",{className:n.switchRow,children:[Object(qe.jsx)(Ke,{children:"Enable receipt printing"}),Object(qe.jsxs)("div",{className:n.switch,children:[Object(qe.jsx)(Lr,{checked:o.active,onChange:function(e){return i({variables:{config:us(as,Gn.a(o,{active:e.target.checked}))}})}}),Object(qe.jsx)(rt,{children:o.active?"Yes":"No"})]})]}),Object(qe.jsxs)("div",{className:n.switchRow,children:[Object(qe.jsx)(Ke,{children:"Offer SMS receipt"}),Object(qe.jsxs)("div",{className:n.switch,children:[Object(qe.jsx)(Lr,{checked:o.sms,onChange:function(e){return i({variables:{config:us(as,Gn.a(o,{sms:e.target.checked}))}})}}),Object(qe.jsx)(rt,{children:o.sms?"Yes":"No"})]})]}),Object(qe.jsx)(ER,{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:us(as,e)}})}})]}):null}));function VR(){return(VR=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function UR(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var GR=a.createElement("desc",null,"Created with Sketch."),XR=a.createElement("defs",null,a.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"})),_R=a.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"nav-/-primary-/-1440",transform:"translate(-128.000000, -14.000000)"},a.createElement("g",{id:"icon/lamassu-logo",transform:"translate(128.000000, 14.000000)"},a.createElement("g",{id:"color/amaz/default"},a.createElement("mask",{id:"mask-2",fill:"white"},a.createElement("use",{xlinkHref:"#path-1"})),a.createElement("use",{id:"Mask",fill:"#FFFFFF",xlinkHref:"#path-1"})))));function ZR(e,t){var n=e.title,r=e.titleId,i=UR(e,["title","titleId"]);return a.createElement("svg",VR({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":r},i),n?a.createElement("title",{id:r},n):null,GR,XR,_R)}var KR=a.forwardRef(ZR),QR=(n.p,{header:{display:"flex",position:"relative",alignItems:"center",justifyContent:"space-between",width:800},form:{"& > *":{marginTop:20},display:"flex",flexDirection:"column",height:"100%"},footer:{display:"flex",flexDirection:"row",margin:[["auto",0,24,0]]},submit:{margin:[["auto",0,0,"auto"]]},smsPreview:{position:"absolute",left:function(e){return e.x},bottom:function(e){return e.y},width:350,overflow:"visible"},smsPreviewContainer:{display:"flex",flexDirection:"row",alignItems:"flex-end","& > *":{marginRight:10}},smsPreviewIcon:{display:"flex",width:36,height:36,borderRadius:18,backgroundColor:"#16D6D3",alignItems:"center",justifyContent:"center"},smsPreviewContent:{width:225,padding:15,borderRadius:"15px 15px 15px 0px"},chipButtons:{width:480,display:"flex",flexDirection:"column",alignItems:"space-between","& > div":{marginTop:15},"& > div:first-child":{marginTop:0},"& > div > div":{margin:[[0,5,0,5]]},"& > div > div > span":{lineHeight:"120%",color:ce,fontSize:Ce,fontFamily:Oe,fontWeight:500},marginLeft:"auto",marginRight:"auto"},resetToDefault:{width:145},messageWithTooltip:{display:"flex",flexDirection:"row",alignItems:"center"}}),YR=n(1107);function JR(){return(JR=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function eB(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var tB=a.createElement("desc",null,"Created with Sketch."),nB=a.createElement("g",{id:"icon/button/retry/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"Group-7",stroke:"#FFFFFF"},a.createElement("path",{d:"M7.1942452e-14,9.603 L0.002,3.598 C0.003,1.611 1.614,-5.86197757e-14 3.602,-5.86197757e-14 L8.4,-5.86197757e-14 C10.39,-5.86197757e-14 12.001,1.613 12,3.601 L11.998,7.205 C11.998,9.192 10.386,10.803 8.398,10.803 L3,10.803",id:"Stroke-1"}),a.createElement("polyline",{id:"Stroke-3",points:"4.2002 9.601 3.0002 10.8 4.2002 12"})));function aB(e,t){var n=e.title,r=e.titleId,i=eB(e,["title","titleId"]);return a.createElement("svg",JR({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":r},i),n?a.createElement("title",{id:r},n):null,tB,nB)}var rB=a.forwardRef(aB);n.p;function iB(){return(iB=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function oB(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var lB=a.createElement("desc",null,"Created with Sketch."),cB=a.createElement("g",{id:"icon/button/retry/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{id:"Group-7",stroke:"#1B2559"},a.createElement("path",{d:"M7.1942452e-14,9.603 L0.002,3.598 C0.003,1.611 1.614,-5.86197757e-14 3.602,-5.86197757e-14 L8.4,-5.86197757e-14 C10.39,-5.86197757e-14 12.001,1.613 12,3.601 L11.998,7.205 C11.998,9.192 10.386,10.803 8.398,10.803 L3,10.803",id:"Stroke-1"}),a.createElement("polyline",{id:"Stroke-3",points:"4.2002 9.601 3.0002 10.8 4.2002 12"})));function sB(e,t){var n=e.title,r=e.titleId,i=oB(e,["title","titleId"]);return a.createElement("svg",iB({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":r},i),n?a.createElement("title",{id:r},n):null,lB,cB)}var dB,uB,mB,hB,pB,bB,fB,jB,gB,OB,xB,vB,yB,wB,CB=a.forwardRef(sB),kB=(n.p,Object(f.a)(QR)),EB=function(e,t,n){return e&&t?n?"Internal server error":e.event&&t.event?e.event:e.message&&t.message?e.message:null:null},NB={smsCode:{validator:xn.h().required("The message content is required!").trim().test({name:"has-code",message:"The confirmation code is missing from the message!",exclusive:!1,test:function(e){var t;return(null===e||void 0===e||null===(t=e.match(/#code/g))||void 0===t?void 0:t.length)>0}}).test({name:"has-single-code",message:"There should be a single confirmation code!",exclusive:!1,test:function(e){var t;return 1===(null===e||void 0===e||null===(t=e.match(/#code/g))||void 0===t?void 0:t.length)}})},cashOutDispenseReady:{validator:xn.h().required("The message content is required!").trim()},smsReceipt:{validator:xn.h().trim()}},SB={smsCode:[{code:"#code",display:"Confirmation code",obligatory:!0},{code:"#timestamp",display:"Timestamp",obligatory:!1}],cashOutDispenseReady:[{code:"#timestamp",display:"Timestamp",obligatory:!1}],smsReceipt:[{code:"#timestamp",display:"Timestamp",obligatory:!1}]},IB={smsCode:"Your cryptomat code: #code",cashOutDispenseReady:"Your cash is waiting! Go to the Cryptomat and press Redeem within 24 hours. [#timestamp]",smsReceipt:""},LB=function(e){var t,n,a=e.showModal,r=e.onClose,i=e.sms,o=e.creationError,l=e.submit,c=kB(),s={event:D.a(i)?"":i.event,message:D.a(i)?"":i.message},d=xn.f().shape({event:xn.h().required("An event is required!"),message:null!==(t=null===(n=NB[null===i||void 0===i?void 0:i.event])||void 0===n?void 0:n.validator)&&void 0!==t?t:xn.h().required("The message content is required!").trim()});return Object(qe.jsx)(qe.Fragment,{children:a&&Object(qe.jsx)(Kh,{title:"SMS notice - ".concat(null===i||void 0===i?void 0:i.messageName),closeOnBackdropClick:!0,width:600,height:500,open:!0,handleClose:r,children:Object(qe.jsx)(mn.e,{validateOnBlur:!1,validateOnChange:!1,initialValues:s,validationSchema:d,onSubmit:function(e,t,n){return function(e){l(i?{variables:{id:i.id,event:e.event,message:e.message}}:{variables:{event:e.event,message:e.message}}),r()}(e)},children:function(e){var t=e.values,n=e.errors,a=e.touched,r=e.setFieldValue;return Object(qe.jsxs)(mn.d,{id:"sms-notice",className:c.form,children:[Object(qe.jsx)(He,{color:"primary",Icon:CB,InverseIcon:rB,className:c.resetToDefault,type:"button",onClick:function(){return r("message",IB[null===i||void 0===i?void 0:i.event])},children:"Reset to default"}),Object(qe.jsx)(mn.b,{name:"message",label:"Message content",fullWidth:!0,multiline:!0,rows:6,component:di}),bn.a(SB[null===i||void 0===i?void 0:i.event])>0&&Object(qe.jsx)(Ye,{noMargin:!0,children:"Values to attach"}),Object(qe.jsx)("div",{className:c.chipButtons,children:T.a((function(e){return Object(qe.jsx)("div",{children:T.a((function(e){return Object(qe.jsx)(Ar.a,{label:e.display,size:"small",style:{backgroundColor:G},disabled:L.a(e.code,t.message),className:c.chip,onClick:function(){r("message",t.message.concat(" "===PC.a(t.message)?"":" ",e.code))}})}),e)})}),YR.a(3,SB[null===i||void 0===i?void 0:i.event]))}),Object(qe.jsxs)("div",{className:c.footer,children:[EB(n,a,o)&&Object(qe.jsx)(il,{children:EB(n,a,o)}),Object(qe.jsx)(An,{type:"submit",form:"sms-notice",className:c.submit,children:"Confirm"})]})]})}})})})},PB=Object(f.a)(QR),FB=x()(dB||(dB=Object(c.a)(["\n query SMSNotices {\n SMSNotices {\n id\n event\n message\n messageName\n enabled\n allowToggle\n }\n config\n }\n"]))),DB=x()(uB||(uB=Object(c.a)(["\n mutation editSMSNotice($id: ID!, $event: SMSNoticeEvent!, $message: String!) {\n editSMSNotice(id: $id, event: $event, message: $message) {\n id\n }\n }\n"]))),TB=x()(mB||(mB=Object(c.a)(["\n mutation enableSMSNotice($id: ID!) {\n enableSMSNotice(id: $id) {\n id\n }\n }\n"]))),RB=x()(hB||(hB=Object(c.a)(["\n mutation disableSMSNotice($id: ID!) {\n disableSMSNotice(id: $id) {\n id\n }\n }\n"]))),BB=function(e,t){var n=new RegExp(Object.keys(t).join("|"),"gi");return e.replace(n,(function(e){return t[e.toLowerCase()]}))},AB=function(e){var t=rS.a(/\n/)(e);return T.a((function(e,n){return n===t.length?Object(qe.jsx)(qe.Fragment,{children:e}):Object(qe.jsxs)(qe.Fragment,{children:[e,Object(qe.jsx)("br",{})]})}),t)},MB={smsCode:"",cashOutDispenseReady:"",smsReceipt:AB("The contents of this notice will be appended to the end of the SMS receipt sent, and not replace it.\n\n To edit the contents of the SMS receipt, please go to the 'Receipt' tab")},WB=function(e){var t=e.sms,n=e.coords,a=e.timezone,r=PB(n),i={"#code":123,"#timestamp":fd(new Date,a,"HH:mm")};return Object(qe.jsx)("div",{className:r.smsPreview,children:Object(qe.jsxs)("div",{className:r.smsPreviewContainer,children:[Object(qe.jsx)("div",{className:r.smsPreviewIcon,children:Object(qe.jsx)(KR,{width:22,height:22})}),Object(qe.jsx)(Un.a,{className:r.smsPreviewContent,children:Object(qe.jsx)(Ke,{noMargin:!0,children:Wa.a(null===t||void 0===t?void 0:t.message)?Object(qe.jsx)("i",{children:"No content available"}):AB(BB(null===t||void 0===t?void 0:t.message,i))})}),Object(qe.jsx)(it,{children:fd(new Date,a,"HH:mm")})]})})},zB=function(){var e=PB(),t=Object(a.useState)(!1),n=Object(l.a)(t,2),r=n[0],i=n[1],o=Object(a.useState)(null),c=Object(l.a)(o,2),s=c[0],d=c[1],m=Object(a.useState)(!1),h=Object(l.a)(m,2),p=h[0],b=h[1],f=Object(a.useState)({x:0,y:0}),j=Object(l.a)(f,2),g=j[0],O=j[1],x=Object(a.useState)(""),v=Object(l.a)(x,2),y=v[0],w=v[1],C=Object(u.c)(FB),k=C.data,E=C.loading,N=A.a(["config","locale_timezone"])(k),S=Object(u.b)(DB,{onError:function(e){var t=e.msg;return w(t)},refetchQueries:function(){return["SMSNotices"]}}),I=Object(l.a)(S,1)[0],L=Object(u.b)(TB,{onError:function(e){var t=e.msg;return w(t)},refetchQueries:function(){return["SMSNotices"]}}),P=Object(l.a)(L,1)[0],F=Object(u.b)(RB,{onError:function(e){var t=e.msg;return w(t)},refetchQueries:function(){return["SMSNotices"]}}),D=Object(l.a)(F,1)[0],T=E,B=[{header:"Message name",width:500,size:"sm",textAlign:"left",view:function(t){return Wa.a(MB[t.event])?R.a("messageName",t):Object(qe.jsxs)("div",{className:e.messageWithTooltip,children:[R.a("messageName",t),Object(qe.jsx)(Np,{width:250,children:Object(qe.jsx)(Ke,{children:MB[t.event]})})]})}},{header:"Edit",width:100,size:"sm",textAlign:"center",view:function(e){return Object(qe.jsx)(ta,{onClick:function(){b(!1),d(e),i(!0)},children:Object(qe.jsx)(Ph,{})})}},{header:"Enable",width:100,size:"sm",textAlign:"center",view:function(e){return Object(qe.jsx)(Lr,{disabled:!e.allowToggle,onClick:function(){e.enabled?D({variables:{id:e.id}}):P({variables:{id:e.id}})},checked:e.enabled})}},{header:"",width:100,size:"sm",textAlign:"center",view:function(e){return Object(qe.jsx)(ta,{onClick:function(t){d(e),O({x:t.currentTarget.getBoundingClientRect().right+50,y:window.innerHeight-5-t.currentTarget.getBoundingClientRect().bottom}),gn.a(s,e)?b(!p):b(!0)},children:gn.a(s,e)&&p?Object(qe.jsx)(Cg,{}):Object(qe.jsx)(hg,{})})}}];return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)("div",{className:e.header,children:Object(qe.jsx)(_e,{children:"SMS notices"})}),r&&Object(qe.jsx)(LB,{showModal:r,onClose:function(){i(!1),d(null)},sms:s,creationError:y,submit:I}),p&&Object(qe.jsx)(WB,{sms:s,coords:g,timezone:N}),Object(qe.jsx)(Ay,{emptyText:"No SMS notices so far",elements:B,loading:T,data:A.a(["SMSNotices"])(k)})]})},qB=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}}}),$B=function(e){var t,n=e.editing,a=e.name,r=e.width,i=e.placeholder,o=e.label,l=e.value,c=e.multiline,d=void 0!==c&&c,u=e.rows,m=e.onFocus,h=Object(q.a)(e,["editing","name","width","placeholder","label","value","multiline","rows","onFocus"]),p=qB(),b=(t={},Object(z.a)(t,p.field,!0),Object(z.a)(t,p.notEditing,!n),Object(z.a)(t,p.notEditingSingleLine,!n&&!d),Object(z.a)(t,p.notEditingMultiline,!n&&d),t);return Object(qe.jsxs)("div",{className:I()(b),children:[!n&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(it,{children:o}),Object(qe.jsx)(Je,{children:l})]}),n&&Object(qe.jsx)(mn.b,Object(s.a)({id:a,name:a,component:di,width:r,placeholder:i,type:"text",label:o,multiline:d,rows:u,rowsMax:"6",onFocus:m},h))]})},HB=x()(pB||(pB=Object(c.a)(["\n query getData {\n config\n }\n"]))),VB=x()(bB||(bB=Object(c.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),UB=Object(f.a)(NR),GB=function(){var e,t,n,r,i,o,c,s=Object(a.useState)(null),d=Object(l.a)(s,2),m=d[0],h=d[1],p=Object(a.useState)(!1),b=Object(l.a)(p,2),f=b[0],j=b[1],g=Object(u.b)(VB,{onCompleted:function(){h(null),j(!1)},refetchQueries:function(){return["getData"]},onError:function(e){return h(e)}}),O=Object(l.a)(g,1)[0],x=UB(),v=Object(u.c)(HB).data,y=(null===v||void 0===v?void 0:v.config)&&ds(is,v.config),w=null!==y&&void 0!==y?y:{},C=null!==(e=null===y||void 0===y?void 0:y.active)&&void 0!==e&&e,k=null!==(t=null===y||void 0===y?void 0:y.delay)&&void 0!==t&&t,E=null!==(n=null===y||void 0===y?void 0:y.tcPhoto)&&void 0!==n&&n,N=function(e){return O({variables:{config:us(is,e)}})},S=[{name:"title",label:"Screen title",value:null!==(r=w.title)&&void 0!==r?r:"",width:282},{name:"text",label:"Text content",value:null!==(i=w.text)&&void 0!==i?i:"",width:502,multiline:!0,rows:6},{name:"acceptButtonText",label:"Accept button text",value:null!==(o=w.acceptButtonText)&&void 0!==o?o:"",placeholder:"I accept",width:282},{name:"cancelButtonText",label:"Cancel button text",value:null!==(c=w.cancelButtonText)&&void 0!==c?c:"",placeholder:"Cancel",width:282}],L=function(e){return function(e){return Aa.a(W.a("name",e))(S)}(e).value},P={title:L("title"),text:L("text"),acceptButtonText:L("acceptButtonText"),cancelButtonText:L("cancelButtonText")},F=xn.f().shape({title:xn.h("The screen title must be a string").required("The screen title is required").max(50,"Too long"),text:xn.h("The text content must be a string").required("The text content is required"),acceptButtonText:xn.h("The accept button text must be a string").required("The accept button text is required").max(50,"The accept button text is too long"),cancelButtonText:xn.h("The cancel button text must be a string").required("The cancel button text is required").max(50,"The cancel button text is too long")});return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)("div",{className:x.header,children:Object(qe.jsx)(_e,{children:"Terms & Conditions"})}),Object(qe.jsxs)("div",{className:x.switchRow,children:[Object(qe.jsx)(Ke,{children:"Show on screen"}),Object(qe.jsxs)("div",{className:x.switch,children:[Object(qe.jsx)(Lr,{checked:C,onChange:function(e){return N({active:e.target.checked})}}),Object(qe.jsx)(rt,{children:C?"Yes":"No"})]})]}),Object(qe.jsxs)("div",{className:x.switchRow,children:[Object(qe.jsxs)(Ke,{children:["Capture customer photo on acceptance ",Object(qe.jsx)("br",{})," of Terms & Conditions screen"]}),Object(qe.jsxs)("div",{className:x.switch,children:[Object(qe.jsx)(Lr,{checked:E,onChange:function(e){return N({tcPhoto:e.target.checked})}}),Object(qe.jsx)(rt,{children:E?"Yes":"No"})]})]}),Object(qe.jsxs)("div",{className:x.switchRow,children:[Object(qe.jsx)(Ke,{children:"Add 7 seconds delay on screen"}),Object(qe.jsxs)("div",{className:x.switch,children:[Object(qe.jsx)(Lr,{checked:k,onChange:function(e){return N({delay:e.target.checked})}}),Object(qe.jsx)(rt,{children:k?"Yes":"No"})]})]}),Object(qe.jsxs)("div",{className:x.header,children:[Object(qe.jsx)(Ye,{children:"Info card"}),!f&&Object(qe.jsx)(ta,{className:x.transparentButton,onClick:function(){return j(!0)},children:Object(qe.jsx)(Ph,{})})]}),Object(qe.jsx)(mn.e,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,initialValues:P,validationSchema:F,onSubmit:function(e){return N(e)},onReset:function(){j(!1),h(null)},children:function(e){var t=e.errors;return Object(qe.jsxs)(mn.d,{children:[Object(qe.jsx)(pm,{}),S.map((function(e,t){return Object(qe.jsx)("div",{className:x.row,children:Object(qe.jsx)($B,{editing:f,name:e.name,width:e.width,placeholder:e.placeholder,label:e.label,value:e.value,multiline:e.multiline,rows:e.rows,onFocus:function(){return h(null)}})},t)})),Object(qe.jsx)("div",{className:I()(x.row,x.submit),children:f&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(oa,{color:"primary",type:"submit",children:"Save"}),Object(qe.jsx)(oa,{color:"secondary",type:"reset",children:"Cancel"}),!Wa.a(t)&&Object(qe.jsx)(il,{children:op.a(yd.a(t))}),m&&Object(qe.jsx)(il,{children:"Failed to save changes"})]})})]})}})]})},XB={running:ne,notRunning:pe},_B={running:"#ecfbef",notRunning:he},ZB={uptimeContainer:{display:"inline-block",minWidth:104,margin:[[0,20]]},name:{extend:Me.label1,paddingLeft:4,color:se}},KB=Object(f.a)(ZB),QB=Object(f.a)({root:{borderRadius:4,marginTop:4,marginRight:2,marginBottom:4,marginLeft:2,height:24,backgroundColor:function(e){var t=e.type;return _B[t]}},label:{fontSize:ke,fontWeight:Ie,fontFamily:Le,padding:[[4,8]],color:function(e){var t=e.type;return XB[t]}}}),YB=function(e){var t,n=e.process,a=(Object(q.a)(e,["process"]),KB());return Object(qe.jsxs)("div",{className:a.uptimeContainer,children:[Object(qe.jsx)("div",{className:a.name,children:On.a(n.name)}),Object(qe.jsx)(Ar.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"))):Mm(n.state),classes:QB({type:"RUNNING"===n.state?"running":"notRunning"})})]})},JB={serverTableWrapper:{extend:yf.tableWrapper,maxWidth:"100%",marginLeft:0},serverVersion:{extend:Me.p,color:se,margin:"auto 0 auto 0"},headerLine2:{display:"flex",justifyContent:"space-between",marginBottom:24},uptimeContainer:{margin:"auto 0 auto 0"}},eA=Gn.a(yf,JB),tA=Object(f.a)(eA),nA={code:"SHOW_ALL",display:"Show all"},aA=x()(fB||(fB=Object(c.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"]))),rA=x()(jB||(jB=Object(c.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"]))),iA=x()(gB||(gB=Object(c.a)(["\n query getData {\n config\n }\n"]))),oA=function(){var e,t,n=tA(),r=Object(a.useRef)(),i=Object(a.useState)(null),o=Object(l.a)(i,2),c=o[0],s=o[1],d=Object(a.useState)(nA),m=Object(l.a)(d,2),h=m[0],p=m[1],b=Object(u.c)(rA,{onCompleted:function(){return s("")},variables:{limit:500}}),f=b.data,j=b.loading,g=Object(u.c)(iA),O=g.data,x=g.loading,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=P.a(sm.a(nA),Ag.a,hl.a([{code:"error",display:"Error"},{code:"info",display:"Info"},{code:"debug",display:"Debug"}]),T.a((function(e){return{code:A.a(["logLevel"])(e),display:zm(A.a(["logLevel"])(e))}})),A.a(["serverLogs"])),k=j||x;return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsxs)("div",{className:n.titleWrapper,children:[Object(qe.jsxs)("div",{className:n.titleAndButtonsContainer,children:[Object(qe.jsx)(yn,{children:"Server"}),f&&Object(qe.jsxs)("div",{className:n.buttonsWrapper,children:[Object(qe.jsx)(sD,{title:"Download logs",name:"server-logs",query:aA,args:{timezone:v},logs:f.serverLogs,getLogs:function(e){return A.a(["serverLogsCsv"])(e)},timezone:v}),Object(qe.jsx)(Je,{children:c})]})]}),Object(qe.jsx)("div",{className:n.serverVersion,children:y&&Object(qe.jsxs)("span",{children:["Server version: v",y]})})]}),Object(qe.jsxs)("div",{className:n.headerLine2,children:[f&&Object(qe.jsx)(lh,{onSelectedItemChange:function(e){r.current&&r.current.scrollTo(0,0),p(e)},label:"Level",items:C(f),default:nA,selectedItem:h}),Object(qe.jsx)("div",{className:n.uptimeContainer,children:w&&w.map((function(e,t){return Object(qe.jsx)(YB,{process:e},t)}))})]}),Object(qe.jsx)("div",{className:n.wrapper,children:Object(qe.jsxs)("div",{ref:r,className:n.serverTableWrapper,children:[Object(qe.jsxs)(Is,{className:n.table,children:[Object(qe.jsx)(Ds,{children:Object(qe.jsxs)(zs,{header:!0,children:[Object(qe.jsx)(Bs,{className:n.dateColumn,children:"Date"}),Object(qe.jsx)(Bs,{className:n.levelColumn,children:"Level"}),Object(qe.jsx)(Bs,{className:n.fillColumn})]})}),Object(qe.jsx)(Ls,{children:f&&f.serverLogs.filter((function(e){return h===nA||e.logLevel===h.code})).map((function(e,t){return Object(qe.jsxs)(zs,{size:"sm",children:[Object(qe.jsx)(Fs,{children:v&&fd(e.timestamp,v,"yyyy-MM-dd HH:mm")}),Object(qe.jsx)(Fs,{children:e.logLevel}),Object(qe.jsx)(Fs,{children:e.message})]},t)}))})]}),k&&Object(qe.jsx)(_e,{children:"Loading..."}),!k&&!(null===f||void 0===f||null===(t=f.serverLogs)||void 0===t?void 0:t.length)&&Object(qe.jsx)(_e,{children:"No activity so far"})]})})]})},lA=n(1139),cA=n(1108),sA={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:Me.label1,color:se,marginBottom:4},item:{extend:Me.p,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},dA=Object(f.a)(sA),uA=function(e){var t=e.width,n=void 0===t?378:t,a=e.height,r=void 0===a?128:a,i=e.title,o=e.items,l=e.onEdit,c=e.className,s=dA({width:n,height:r});return Object(qe.jsx)(qe.Fragment,{children:Object(qe.jsxs)(vm,{className:I()(c,s.table),children:[Object(qe.jsx)(ym,{children:Object(qe.jsxs)(Em,{className:s.head,children:[i,Object(qe.jsx)(ta,{onClick:l,className:s.button,children:Object(qe.jsx)(dN,{})})]})}),Object(qe.jsx)(Cm,{children:Object(qe.jsx)(Sm,{className:s.tr,children:Object(qe.jsx)(km,{width:n,children:o&&Object(qe.jsxs)(qe.Fragment,{children:[o[0]&&Object(qe.jsxs)("div",{className:s.itemWrapper,children:[Object(qe.jsx)("div",{className:s.label,children:o[0].label}),Object(qe.jsx)("div",{className:s.item,children:o[0].value})]}),o[1]&&Object(qe.jsxs)("div",{className:s.itemWrapper,children:[Object(qe.jsx)("div",{className:s.label,children:o[1].label}),Object(qe.jsx)("div",{className:s.item,children:o[1].value})]})]})})})})]})})},mA=x()(OB||(OB=Object(c.a)(["\n query getData {\n accounts\n config\n }\n"]))),hA=x()(xB||(xB=Object(c.a)(["\n mutation Save($accounts: JSONObject) {\n saveAccounts(accounts: $accounts)\n }\n"]))),pA=Object(f.a)({wrapper:{marginLeft:1}}),bA=function(){var e,t=Object(a.useState)(null),n=Object(l.a)(t,2),r=n[0],i=n[1],o=Object(u.c)(mA).data,c=Object(u.b)(hA,{onCompleted:function(){return i(null)},refetchQueries:["getData"]}),d=Object(l.a)(c,1)[0],m=pA(),p=null!==(e=null===o||void 0===o?void 0:o.accounts)&&void 0!==e?e:{},b=function(e,t){var n=M.a(R.a("face"))(t),a=p[e]||{};return T.a((function(e){var t,n=e.display,r=e.code;return{label:n,value:e.long?(t=a[r],!t||t.length<=20?t:"".concat(t.slice(0,8),"(...)").concat(t.slice(t.length-8,t.length))):a[r]}}))(n)};return Object(qe.jsxs)("div",{className:m.wrapper,children:[Object(qe.jsx)(cl,{title:"3rd Party Services"}),Object(qe.jsx)(h.a,{container:!0,spacing:4,children:yd.a($x).map((function(e){return Object(qe.jsx)(h.a,{item:!0,children:Object(qe.jsx)(uA,{editMessage:"Configure "+e.title,title:e.title,onEdit:function(){return i(e)},items:b(e.code,e.elements)})},e.code)}))}),r&&Object(qe.jsx)(Kh,{title:"Edit ".concat(r.name),width:525,handleClose:function(){return i(null)},open:!0,children:Object(qe.jsx)(ax,{save:function(e){return d({variables:{accounts:Object(z.a)({},r.code,e)}})},elements:function(e){var t=e.code,n=e.elements;return T.a((function(e){return e.component===ii?function(e){var t=e.settings,n=lA.a(["config",t.field]),a=!!D.a(t.requirement)||gn.a(cA.a(n,o),t.requirement);return t.enabled=a,e}(e):e.component!==si?e:Object(s.a)(Object(s.a)({},e),{},{inputProps:{isPasswordFilled:!D.a(p[t])&&!D.a(A.a([e.code],p[t]))}})}),n)}(r),validationSchema:function(e){var t=e.code,n=e.getValidationSchema;return n(p[t])}(r),value:function(e){var t=e.elements,n=e.code,a=p[n],r=M.a(W.a("component",si)),i=T.a(R.a(["code"])),o=P.a(i,r)(t);return iR.a((function(e,t){return L.a(t,o)?"":e}),a)}(r)})})]})},fA=n(565),jA=n.n(fA),gA=x()(vB||(vB=Object(c.a)(["\n query sessions {\n sessions {\n sid\n sess\n expire\n }\n }\n"]))),OA=x()(yB||(yB=Object(c.a)(["\n mutation deleteSession($sid: String!) {\n deleteSession(sid: $sid) {\n sid\n }\n }\n"]))),xA=x()(wB||(wB=Object(c.a)(["\n query getData {\n config\n }\n"]))),vA=function(){var e=Object(u.c)(gA),t=e.data,n=e.loading,a=Object(u.b)(OA,{refetchQueries:function(){return["sessions"]}}),r=Object(l.a)(a,1)[0],i=Object(u.c)(xA),o=i.data,c=i.loading,s=A.a(["config","locale_timezone"],o),d=n||c,m=[{header:"Login",width:207,textAlign:"left",size:"sm",view:function(e){return e.sess.user.username}},{header:"Last known use",width:305,textAlign:"left",size:"sm",view:function(e){if(D.a(e.sess.ua))return"No Record";var t=jA()(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:"left",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",width:290,textAlign:"right",size:"sm",view:function(e){return"".concat(fd(e.expire,s,"yyyy-MM-dd")," ").concat(fd(e.expire,s,"HH:mm:ss"))}},{header:"",width:80,textAlign:"center",size:"sm",view:function(e){return Object(qe.jsx)(ta,{onClick:function(){r({variables:{sid:e.sid}})},children:Object(qe.jsx)(Oh,{})})}}];return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(cl,{title:"Session Management"}),Object(qe.jsx)(Ay,{loading:d,elements:m,data:A.a(["sessions"])(t)})]})};function yA(){return(yA=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function wA(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var CA=a.createElement("defs",null,a.createElement("circle",{id:"path-1-right",cx:10,cy:10,r:10})),kA=a.createElement("g",{id:"Symbols",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"pop-up/action/download-logs/date-range-copy-2",transform:"translate(-232.000000, -187.000000)"},a.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)"},a.createElement("mask",{id:"mask-2",fill:"white"},a.createElement("use",{xlinkHref:"#path-1-right"})),a.createElement("use",{id:"Mask",fill:"#FFFFFF",fillRule:"nonzero",xlinkHref:"#path-1-right"}),a.createElement("g",{id:"icon/sf-small/wizzard",mask:"url(#mask-2)",strokeLinecap:"round",strokeLinejoin:"round"},a.createElement("g",{transform:"translate(6.666667, 6.000000)",id:"Group"},a.createElement("g",null,a.createElement("polyline",{id:"Path-3",stroke:"#1B2559",strokeWidth:2,points:"0 4.83333333 3.33333333 8.16666667 6.66666667 4.83333333"}),a.createElement("line",{x1:3.33333333,y1:.25,x2:3.33333333,y2:6.5,id:"Path-4",stroke:"#1B2559",strokeWidth:2})))))));function EA(e,t){var n=e.title,r=e.titleId,i=wA(e,["title","titleId"]);return a.createElement("svg",yA({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":r},i),n?a.createElement("title",{id:r},n):null,CA,kA)}var NA,SA,IA,LA,PA=a.forwardRef(EA),FA=(n.p,Object(f.a)(Nf)),DA=1e3,TA=x()(NA||(NA=Object(c.a)(["\n query getData {\n config\n }\n"]))),RA=x()(SA||(SA=Object(c.a)(["\n query transactions(\n $simplified: Boolean\n $limit: Int\n $from: Date\n $until: Date\n $timezone: String\n $excludeTestingCustomers: Boolean\n ) {\n transactionsCsv(\n simplified: $simplified\n limit: $limit\n from: $from\n until: $until\n timezone: $timezone\n excludeTestingCustomers: $excludeTestingCustomers\n )\n }\n"]))),BA=x()(IA||(IA=Object(c.a)(["\n query filters {\n transactionFilters {\n type\n value\n }\n }\n"]))),AA=x()(LA||(LA=Object(c.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 $swept: Boolean\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 swept: $swept\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 errorCode\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 txCustomerPhotoPath\n customerPhone\n discount\n customerId\n isAnonymous\n batched\n batchTime\n rawTickerPrice\n batchError\n walletScore\n profit\n swept\n }\n }\n"]))),MA=function(e){return gs.a((function(e,t){return Object(s.a)(Object(s.a)({},e),{},Object(z.a)({},t.type,t.value))}),{},e)},WA=function(){var e,t=FA(),n=Object(w.h)(),r=Object(a.useState)([]),i=Object(l.a)(r,2),o=i[0],c=i[1],s=Object(u.c)(BA),d=s.data,m=s.loading,h=Object(a.useState)({limit:DA}),p=Object(l.a)(h,2),b=p[0],f=p[1],j=Object(u.c)(AA,{variables:b}),g=j.data,O=j.loading,x=j.refetch,v=j.startPolling,y=j.stopPolling;Object(a.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)(TA),E=k.data,N=k.configLoading,S=A.a(["config","locale_timezone"],E),I=[{header:"",width:32,size:"sm",view:function(e){return"cashOut"===e.txClass?Object(qe.jsx)(zc,{}):Object(qe.jsx)(Dc,{})}},{header:"Machine",name:"machineName",width:160,size:"sm",view:A.a(["machineName"])},{header:"Customer",width:202,size:"sm",view:function(e){return Object(qe.jsxs)("div",{className:t.flexWrapper,children:[Object(qe.jsx)("div",{className:t.overflowTd,children:_j(e)}),!e.isAnonymous&&Object(qe.jsx)("div",{onClick:function(){return t=e.customerId,n.push("/compliance/customer/".concat(t));var t},children:e.hasError||e.batchError?Object(qe.jsx)(PA,{className:t.customerLinkIcon}):Object(qe.jsx)(fu,{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(Ff.utils.toUnit(new Hc.a(e.cryptoAtoms),e.cryptoCode)," ").concat(e.cryptoCode)}},{header:"Address",view:function(e){return Ff.utils.formatCryptoAddress(e.cryptoCode,e.toAddress)},className:t.overflowTd,size:"sm",width:140},{header:"Date",view:function(e){return S&&fd(e.created,S,"yyyy-MM-dd HH:mm")},textAlign:"right",size:"sm",width:195},{header:"Status",view:function(e){return Kj(e)},textAlign:"left",size:"sm",width:80}],L=A.a(["transactionFilters"])(d),P=O||m||N,F=Object(qe.jsx)("svg",{width:12,height:12,children:Object(qe.jsx)("rect",{width:12,height:12,rx:3,fill:he})});return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsxs)("div",{className:t.titleWrapper,children:[Object(qe.jsxs)("div",{className:t.titleAndButtonsContainer,children:[Object(qe.jsx)(yn,{children:"Transactions"}),Object(qe.jsx)("div",{className:t.buttonsWrapper,children:Object(qe.jsx)(kI,{loading:m,filters:o,options:L,inputPlaceholder:"Search Transactions",onChange:function(e){var t=MA(e);c(e),f({limit:DA,txClass:t.type,machineName:t.machine,customerName:t.customer,fiatCode:t.fiat,cryptoCode:t.crypto,toAddress:t.address,status:t.status,swept:"Swept"===t.swept}),x&&x()}})}),C&&Object(qe.jsx)("div",{className:t.buttonsWrapper,children:Object(qe.jsx)(sD,{title:"Download logs",name:"transactions",query:RA,getLogs:function(e){return A.a(["transactionsCsv"])(e)},simplified:!0,timezone:S,args:{timezone:S}})})]}),Object(qe.jsxs)("div",{className:t.headerLabels,children:[Object(qe.jsxs)("div",{children:[Object(qe.jsx)(Dc,{}),Object(qe.jsx)("span",{children:"Cash-in"})]}),Object(qe.jsxs)("div",{children:[Object(qe.jsx)(zc,{}),Object(qe.jsx)("span",{children:"Cash-out"})]}),Object(qe.jsxs)("div",{children:[F,Object(qe.jsx)("span",{children:"Transaction error"})]})]})]}),o.length>0&&Object(qe.jsx)(VI,{entries:C.length,filters:o,onFilterDelete:function(e){var t=M.a((function(t){return!fI.a(Vm.a(["type","value"],t),e)}))(o);c(t);var n=MA(t);f({limit:DA,txClass:n.type,machineName:n.machine,customerName:n.customer,fiatCode:n.fiat,cryptoCode:n.crypto,toAddress:n.address,status:n.status,swept:"Swept"===n.swept}),x&&x()},deleteAllFilters:function(){c([]);var e=MA([]);f({limit:DA,txClass:e.type,machineName:e.machine,customerName:e.customer,fiatCode:e.fiat,cryptoCode:e.crypto,toAddress:e.address,status:e.status,swept:"Swept"===e.swept}),x&&x()}}),Object(qe.jsx)(Ay,{loading:P,emptyText:"No transactions so far",elements:I,data:C,Details:ig,expandable:!0,rowSize:"sm",timezone:S})]})};function zA(){return(zA=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function qA(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var $A=a.createElement("desc",null,"Created with Sketch."),HA=a.createElement("g",{id:"icon/sf-small/filter/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("path",{d:"M19,2.5 C19,1.11909091 17.8809091,0 16.5,0 C15.1190909,0 14,1.11909091 14,2.5 C14,3.88090909 15.1190909,5 16.5,5 C17.8809091,5 19,3.88090909 19,2.5 Z",id:"Stroke-1",stroke:"#FFFFFF",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),a.createElement("path",{d:"M5,9.5 C5,8.11909091 3.88090909,7 2.5,7 C1.11909091,7 0,8.11909091 0,9.5 C0,10.8818182 1.11909091,12 2.5,12 C3.88090909,12 5,10.8818182 5,9.5 Z",id:"Stroke-7",stroke:"#FFFFFF",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),a.createElement("path",{d:"M19,17.5 C19,16.1190909 17.8809091,15 16.5,15 C15.1190909,15 14,16.1190909 14,17.5 C14,18.8809091 15.1190909,20 16.5,20 C17.8809091,20 19,18.8809091 19,17.5 Z",id:"Stroke-9",stroke:"#FFFFFF",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),a.createElement("line",{x1:14,y1:2.5,x2:.498999482,y2:2.5,id:"Line-3",stroke:"#FFFFFF",strokeWidth:2,strokeLinecap:"square"}),a.createElement("line",{x1:20,y1:9.5,x2:6.49899948,y2:9.5,id:"Line-3-Copy",stroke:"#FFFFFF",strokeWidth:2,strokeLinecap:"square"}),a.createElement("line",{x1:14,y1:17.5,x2:.498999482,y2:17.5,id:"Line-3-Copy-2",stroke:"#FFFFFF",strokeWidth:2,strokeLinecap:"square"}));function VA(e,t){var n=e.title,r=e.titleId,i=qA(e,["title","titleId"]);return a.createElement("svg",zA({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":r},i),n?a.createElement("title",{id:r},n):null,$A,HA)}var UA=a.forwardRef(VA);n.p;function GA(){return(GA=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function XA(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var _A=a.createElement("desc",null,"Created with Sketch."),ZA=a.createElement("g",{id:"icon/sf-small/filter/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("path",{d:"M19,2.5 C19,1.11909091 17.8809091,0 16.5,0 C15.1190909,0 14,1.11909091 14,2.5 C14,3.88090909 15.1190909,5 16.5,5 C17.8809091,5 19,3.88090909 19,2.5 Z",id:"Stroke-1",stroke:"#1B2559",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),a.createElement("path",{d:"M5,9.5 C5,8.11909091 3.88090909,7 2.5,7 C1.11909091,7 0,8.11909091 0,9.5 C0,10.8818182 1.11909091,12 2.5,12 C3.88090909,12 5,10.8818182 5,9.5 Z",id:"Stroke-7",stroke:"#1B2559",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),a.createElement("path",{d:"M19,17.5 C19,16.1190909 17.8809091,15 16.5,15 C15.1190909,15 14,16.1190909 14,17.5 C14,18.8809091 15.1190909,20 16.5,20 C17.8809091,20 19,18.8809091 19,17.5 Z",id:"Stroke-9",stroke:"#1B2559",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),a.createElement("line",{x1:14,y1:2.5,x2:.498999482,y2:2.5,id:"Line-3",stroke:"#1B2559",strokeWidth:2,strokeLinecap:"square"}),a.createElement("line",{x1:20,y1:9.5,x2:6.49899948,y2:9.5,id:"Line-3-Copy",stroke:"#1B2559",strokeWidth:2,strokeLinecap:"square"}),a.createElement("line",{x1:14,y1:17.5,x2:.498999482,y2:17.5,id:"Line-3-Copy-2",stroke:"#1B2559",strokeWidth:2,strokeLinecap:"square"}));function KA(e,t){var n=e.title,r=e.titleId,i=XA(e,["title","titleId"]);return a.createElement("svg",GA({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":r},i),n?a.createElement("title",{id:r},n):null,_A,ZA)}var QA=a.forwardRef(KA);n.p;function YA(){return(YA=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function JA(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var eM=a.createElement("desc",null,"Created with Sketch."),tM=a.createElement("g",{id:"icon/sf-small/settings/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinejoin:"round"},a.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 nM(e,t){var n=e.title,r=e.titleId,i=JA(e,["title","titleId"]);return a.createElement("svg",YA({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":r},i),n?a.createElement("title",{id:r},n):null,eM,tM)}var aM=a.forwardRef(nM);n.p;function rM(){return(rM=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function iM(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var oM=a.createElement("desc",null,"Created with Sketch."),lM=a.createElement("g",{id:"icon/sf-small/settings/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinejoin:"round"},a.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 cM(e,t){var n=e.title,r=e.titleId,i=iM(e,["title","titleId"]);return a.createElement("svg",rM({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":r},i),n?a.createElement("title",{id:r},n):null,oM,lM)}var sM=a.forwardRef(cM),dM=(n.p,Object(f.a)({flex:{display:"flex"},column:{flexDirection:"column"},halfWidth:{width:"50%",marginBottom:15,marginRight:50},marginTop:{marginTop:20},marginBottom:{marginBottom:20}})),uM=function(e){var t=e.it.customRequest,n=dM();return Object(qe.jsxs)("div",{children:[Object(qe.jsxs)("div",{className:I()(n.flex,n.row,n.marginTop),children:[Object(qe.jsxs)("div",{className:n.halfWidth,children:[Object(qe.jsx)(Ye,{children:"Screen 1 title"}),Object(qe.jsx)(at,{children:t.screen1.title})]}),Object(qe.jsx)("div",{className:I()(n.halfWidth,n.flex),children:function(){var e="spaceSeparation"===t.input.constraintType?"First word label":"Text entry label";switch(t.input.type){case"text":return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsxs)("div",{className:n.halfWidth,children:[Object(qe.jsx)(Ye,{children:e}),Object(qe.jsx)(at,{children:t.input.label1})]}),"spaceSeparation"===t.input.constraintType&&Object(qe.jsxs)("div",{className:n.halfWidth,children:[Object(qe.jsx)(Ye,{children:"Second word label"}),Object(qe.jsx)(at,{children:t.input.label2})]})]});default:return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsxs)("div",{className:n.halfWidth,children:[Object(qe.jsx)(Ye,{children:"Screen 2 input title"}),Object(qe.jsx)(at,{children:t.screen2.title})]}),Object(qe.jsxs)("div",{className:n.halfWidth,children:[Object(qe.jsx)(Ye,{children:"Screen 2 input description"}),Object(qe.jsx)(at,{children:t.screen2.text})]})]})}}()})]}),Object(qe.jsxs)("div",{className:I()(n.flex,n.row,n.marginBottom),children:[Object(qe.jsxs)("div",{className:n.halfWidth,children:[Object(qe.jsx)(Ye,{children:"Screen 1 text"}),Object(qe.jsx)(at,{children:t.screen1.text})]}),Object(qe.jsx)("div",{className:n.halfWidth,children:Object(qe.jsxs)(qe.Fragment,{children:[t.input.choiceList&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(Ye,{children:"Choices"}),t.input.choiceList.map((function(e,t){return Object(qe.jsx)(at,{children:e},t)}))]}),t.input.numDigits&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(Ye,{children:"Number of digits"}),Object(qe.jsx)(at,{children:t.input.numDigits})]})]})})]})]})},mM=n(571),hM=n(1109),pM=Object(a.memo)((function(e){var t=e.enforceValueSet,n=void 0===t||t,a=Object(q.a)(e,["enforceValueSet"]),r=a.field,i=r.name,o=r.value,l=a.form.setFieldValue;return Object(qe.jsx)(Rr,Object(s.a)({name:i,value:o,options:a.options,ariaLabel:i,onChange:function(e,t){if(n&&!t)return null;l(i,t),a.resetError&&a.resetError()},className:a.className},a))}));function bM(){return(bM=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function fM(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var jM=a.createElement("g",{id:"entry-icon/keyboard",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"Group-2-Copy-2",transform:"translate(0.000000, 6.000000)",fill:"#1B2559"},a.createElement("rect",{id:"Rectangle",x:0,y:0,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-5",x:0,y:12,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-8",x:0,y:24,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-3",x:12,y:113686838e-21,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-6",x:12,y:12,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-9",x:12,y:24,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-11",x:64,y:24,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-32",x:52,y:24,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-4",x:24,y:113686838e-21,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-26",x:36,y:113686838e-21,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-27",x:48,y:113686838e-21,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-28",x:60,y:113686838e-21,width:12,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-7",x:24,y:12,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-29",x:36,y:12,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-30",x:48,y:12,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-31",x:60,y:12,width:12,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-10",x:24,y:24,width:24,height:8,rx:2})));function gM(e,t){var n=e.title,r=e.titleId,i=fM(e,["title","titleId"]);return a.createElement("svg",bM({width:"72px",height:"44px",viewBox:"0 0 72 44",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),void 0===n?a.createElement("title",{id:r},"entry-icon/keyboard"):n?a.createElement("title",{id:r},n):null,jM)}var OM=a.forwardRef(gM);n.p;function xM(){return(xM=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function vM(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var yM=a.createElement("g",{id:"entry-icon/keypad",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"Group",transform:"translate(20.000000, 0.000000)",fill:"#1B2559"},a.createElement("rect",{id:"Rectangle",x:0,y:0,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-5",x:0,y:12,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-8",x:0,y:24,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-3",x:12,y:0,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-6",x:12,y:12,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-9",x:12,y:24,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-11",x:12,y:36,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-4",x:24,y:0,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-7",x:24,y:12,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-10",x:24,y:24,width:8,height:8,rx:2})));function wM(e,t){var n=e.title,r=e.titleId,i=vM(e,["title","titleId"]);return a.createElement("svg",xM({width:"72px",height:"44px",viewBox:"0 0 72 44",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),void 0===n?a.createElement("title",{id:r},"entry-icon/keypad"):n?a.createElement("title",{id:r},n):null,yM)}var CM=a.forwardRef(wM);n.p;function kM(){return(kM=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function EM(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var NM=a.createElement("g",{id:"entry-icon/list",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"Group-4",transform:"translate(8.000000, 0.000000)",fill:"#1B2559"},a.createElement("rect",{id:"Rectangle-Copy-33",x:0,y:0,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-35",x:0,y:12,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-37",x:0,y:24,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-39",x:0,y:36,width:8,height:8,rx:2}),a.createElement("rect",{id:"Rectangle-Copy-34",x:12,y:2,width:44,height:4,rx:1}),a.createElement("rect",{id:"Rectangle-Copy-36",x:12,y:14,width:44,height:4,rx:1}),a.createElement("rect",{id:"Rectangle-Copy-38",x:12,y:26,width:44,height:4,rx:1}),a.createElement("rect",{id:"Rectangle-Copy-40",x:12,y:38,width:44,height:4,rx:1})));function SM(e,t){var n=e.title,r=e.titleId,i=EM(e,["title","titleId"]);return a.createElement("svg",kM({width:"72px",height:"44px",viewBox:"0 0 72 44",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",ref:t,"aria-labelledby":r},i),void 0===n?a.createElement("title",{id:r},"entry-icon/list"):n?a.createElement("title",{id:r},n):null,NM)}var IM=a.forwardRef(SM),LM=(n.p,function(e){return Object(qe.jsx)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:G,borderRadius:4,maxWidth:104,maxHeight:64,minWidth:104,minHeight:64},children:Object(qe.jsx)(e,{style:{maxWidth:80}})})}),PM=xn.f().shape({inputType:xn.h().required()}),FM={inputType:""},DM=function(){var e=[{value:"numerical",title:"Numerical entry",description:"User will enter information with a keypad. Good for dates, ID numbers, etc.",icon:function(){return LM(CM)}},{value:"text",title:"Text entry",description:"User will entry information with a keyboard. Good for names, email, address, etc.",icon:function(){return LM(OM)}},{value:"choiceList",title:"Choice list",description:"Gives user multiple options to choose from.",icon:function(){return LM(IM)}}];return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(_e,{children:"Choose the type of data entry"}),Object(qe.jsx)(mn.b,{name:"inputType",component:pM,orientation:"vertical",exclusive:!0,options:e})]})},TM=function(e){return xn.f().shape({requirementName:xn.h().required("A requirement name is required").test("unique-name","A custom information requirement with that name already exists",(function(t,n){return!jn.a((function(e){return gn.a(On.a(e),On.a(t))}),T.a((function(e){return e.customRequest.name}),e))}))})},RM={requirementName:""},BM=function(){return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(_e,{children:"Name of the requirement"})," ",Object(qe.jsx)(Ke,{children:"The name of the requirement will only be visible to you on the dashboard on the requirement list, as well as on the custom information request list. The user won't see this name. Make sure to make it distinguishable and short."}),Object(qe.jsx)(mn.b,{component:di,label:"Requirement name",name:"requirementName",fullWidth:!0})]})},AM=xn.f().shape({screen1Title:xn.h().required(),screen1Text:xn.h().required()}),MM={screen1Title:"",screen1Text:""},WM=function(){return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(_e,{children:"Screen 1 Information"})," ",Object(qe.jsx)(Ke,{children:"On screen 1 you will request the user if he agrees on providing this information, or if he wishes to terminate the transaction instead."}),Object(qe.jsx)(mn.b,{component:di,label:"Screen title",name:"screen1Title",fullWidth:!0}),Object(qe.jsx)(mn.b,{component:di,label:"Screen text",name:"screen1Text",multiline:!0,fullWidth:!0,rows:5})]})},zM=xn.f().shape({screen2Title:xn.h().required(),screen2Text:xn.h().required()}),qM={screen2Title:"",screen2Text:""},$M=function(){return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(_e,{children:"Screen 2 Information"})," ",Object(qe.jsx)(Ke,{children:"If the user agrees, on screen 2 is where the user will enter the custom information."}),Object(qe.jsx)(mn.b,{component:di,label:"Screen 2 input title",name:"screen2Title",fullWidth:!0}),Object(qe.jsx)(mn.b,{component:di,label:"Screen 2 input description",name:"screen2Text",fullWidth:!0})]})},HM={flex:{display:"flex"},column:{flexDirection:"column"},choiceList:{display:"flex",flexDirection:"column",maxHeight:240,overflowY:"auto"},button:{width:120,height:28,marginTop:28},textInput:{width:420},row:{flexDirection:"row"},subtitle:{marginBottom:0},radioSubtitle:{marginBottom:0},error:{color:he},tl1:{marginLeft:8,marginTop:25},numberField:{marginTop:109,maxWidth:115},label:{width:200,marginRight:8}},VM=Object(f.a)(HM),UM=function(e){return e.text&&e.text.length},GM=[{display:"Select just one",code:"selectOne"},{display:"Select multiple",code:"selectMultiple"}],XM=function(){var e,t,n,r=VM(),i=Object(mn.f)(),o=Object(a.useRef)(null),l=null!==(e=A.a(["values","listChoices"])(i))&&void 0!==e?e:[],c=null!==(t=A.a(["errors","listChoices"])(i))&&void 0!==t&&t,s=(n={},Object(z.a)(n,r.radioSubtitle,!0),Object(z.a)(n,r.error,!A.a(["values","constraintType"])(i)&&A.a(["errors","constraintType"])(i)),n),d=function(e){return c&&M.a(UM)(l).length<2&&0===e.text.length};Object(a.useEffect)((function(){u()}),[l.length]);var u=function(){var e;null===(e=o.current)||void 0===e||e.scrollIntoView()};return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(_e,{className:I()(s),children:"Choice list constraints"}),Object(qe.jsx)(mn.b,{component:ci,options:GM,className:r.row,name:"constraintType"}),Object(qe.jsx)(mn.c,{name:"listChoices",children:function(e){var t=e.push;return Object(qe.jsxs)("div",{className:I()(r.flex,r.column),children:[Object(qe.jsx)(_e,{className:r.subtitle,children:"Choices"}),Object(qe.jsx)("div",{className:r.choiceList,children:l.map((function(e,t){return Object(qe.jsx)("div",{ref:o,children:Object(qe.jsx)(mn.b,{className:r.textInput,error:d(e),component:di,name:"listChoices[".concat(t,"].text"),label:"Choice ".concat(t+1)})},t)}))}),Object(qe.jsx)(He,{Icon:Sn,color:"primary",InverseIcon:po,className:r.button,onClick:function(e){return e.preventDefault(),t({text:""})},children:"Add choice"})]})}})]})},_M=Object(f.a)(HM),ZM=[{display:"None",code:"none"},{display:"Date",code:"date"},{display:"Length",code:"length"}],KM=function(){var e,t,n=_M(),a=Object(mn.f)(),r="length"===(null!==(e=A.a(["values","constraintType"])(Object(mn.f)()))&&void 0!==e?e:null),i=(t={},Object(z.a)(t,n.radioSubtitle,!0),Object(z.a)(t,n.error,!A.a(["values","constraintType"])(a)&&A.a(["errors","constraintType"])(a)),t);return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(_e,{className:I()(i),children:"Numerical entry constraints"}),Object(qe.jsx)(mn.b,{className:n.row,component:ci,options:ZM,name:"constraintType"}),r&&Object(qe.jsxs)("div",{className:I()(n.flex,n.numberField),children:[Object(qe.jsx)(mn.b,{component:li,name:"inputLength",label:"Length",decimalPlaces:0,allowNegative:!1}),Object(qe.jsx)(tt,{className:n.tl1,children:"digits"})]})]})},QM=Object(f.a)(HM),YM=[{display:"None",code:"none"},{display:"Email",code:"email"},{display:"Space separation",subtitle:"(e.g. first and last name)",code:"spaceSeparation"}],JM=function(){var e,t=QM(),n=Object(mn.f)(),a=(e={},Object(z.a)(e,t.radioSubtitle,!0),Object(z.a)(e,t.error,!A.a(["values","constraintType"])(n)&&A.a(["errors","constraintType"])(n)),e);return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(_e,{className:I()(a),children:"Text entry constraints"}),Object(qe.jsx)(mn.b,{className:t.row,component:ci,options:YM,name:"constraintType"}),function(){switch(n.values.constraintType){case"spaceSeparation":return Object(qe.jsxs)("div",{className:t.flex,children:[Object(qe.jsx)(mn.b,{className:t.label,component:di,name:"inputLabel1",label:"First word label"}),Object(qe.jsx)(mn.b,{className:t.label,component:di,name:"inputLabel2",label:"Second word label"})]});default:return Object(qe.jsx)(mn.b,{className:t.label,component:di,name:"inputLabel1",label:"Text entry label"})}}()]})},eW=function(e){return e.text&&e.text.length},tW={constraintType:"",inputLength:"",inputLabel1:"",inputLabel2:"",listChoices:[{text:""},{text:""}]},nW=xn.c((function(e){switch(e.inputType){case"numerical":return xn.f({constraintType:xn.h().required(),inputLength:xn.e().when("constraintType",{is:"length",then:xn.e().min(0).required(),else:xn.d().notRequired()})});case"text":return xn.f({constraintType:xn.h().required(),inputLabel1:xn.h().required(),inputLabel2:xn.h().when("constraintType",{is:"spaceSeparation",then:xn.h().required(),else:xn.d().notRequired()})});case"choiceList":return xn.f({constraintType:xn.h().required(),listChoices:xn.a().test("has-2-or-more","Choice list needs to have two or more non empty fields",(function(e,t){return M.a(eW)(e).length>1}))});default:return xn.d().notRequired()}})),aW=function(){var e,t=null!==(e=A.a(["values","inputType"])(Object(mn.f)()))&&void 0!==e?e:null,n=function(e){switch(e){case"numerical":return KM;case"text":return JM;case"choiceList":return XM;default:return KM}}(t);return t&&Object(qe.jsx)(n,{})};function rW(){return(rW=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function iW(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var oW=a.createElement("defs",null,a.createElement("style",null,".cls-1,.cls-9{fill:#dee5fc;}.cls-2,.cls-9{opacity:0.8;}.cls-3{isolation:isolate;}.cls-4{clip-path:url(#clip-path);}.cls-5{clip-path:url(#clip-path-2);}.cls-6{fill:#ccd8ff;opacity:0.74;}.cls-7{clip-path:url(#clip-path-3);}.cls-8{fill:#ebefff;}.cls-10{clip-path:url(#clip-path-4);}.cls-11{clip-path:url(#clip-path-5);}.cls-12{clip-path:url(#clip-path-6);}.cls-13{clip-path:url(#clip-path-7);}.cls-14{clip-path:url(#clip-path-8);}.cls-15{clip-path:url(#clip-path-9);}.cls-16{clip-path:url(#clip-path-10);}.cls-17{clip-path:url(#clip-path-11);}.cls-18{clip-path:url(#clip-path-12);}.cls-19{clip-path:url(#clip-path-13);}.cls-20{clip-path:url(#clip-path-14);}.cls-21{clip-path:url(#clip-path-15);}.cls-22{clip-path:url(#clip-path-16);}.cls-23{clip-path:url(#clip-path-17);}.cls-24{clip-path:url(#clip-path-18);}.cls-25{clip-path:url(#clip-path-19);}.cls-26{clip-path:url(#clip-path-20);}.cls-27{clip-path:url(#clip-path-21);}.cls-28{clip-path:url(#clip-path-22);}.cls-29{clip-path:url(#clip-path-23);}.cls-30{clip-path:url(#clip-path-24);}.cls-31{clip-path:url(#clip-path-25);}.cls-32{clip-path:url(#clip-path-26);}.cls-33{clip-path:url(#clip-path-27);}.cls-34{clip-path:url(#clip-path-28);}.cls-35{clip-path:url(#clip-path-29);}.cls-36{clip-path:url(#clip-path-30);}.cls-37{clip-path:url(#clip-path-31);}.cls-38{clip-path:url(#clip-path-32);}.cls-39{clip-path:url(#clip-path-33);}.cls-40{clip-path:url(#clip-path-34);}.cls-41{clip-path:url(#clip-path-35);}.cls-42{clip-path:url(#clip-path-36);}.cls-43{clip-path:url(#clip-path-37);}.cls-44{clip-path:url(#clip-path-38);}.cls-45{clip-path:url(#clip-path-39);}.cls-46{clip-path:url(#clip-path-40);}.cls-47{clip-path:url(#clip-path-41);}.cls-48{clip-path:url(#clip-path-42);}.cls-49{clip-path:url(#clip-path-43);}.cls-50{clip-path:url(#clip-path-44);}.cls-51{clip-path:url(#clip-path-45);}.cls-52{clip-path:url(#clip-path-46);}.cls-53{clip-path:url(#clip-path-47);}.cls-54{clip-path:url(#clip-path-48);}.cls-55{clip-path:url(#clip-path-49);}.cls-56{clip-path:url(#clip-path-50);}.cls-57{clip-path:url(#clip-path-51);}.cls-58{clip-path:url(#clip-path-52);}.cls-59{clip-path:url(#clip-path-53);}.cls-60{clip-path:url(#clip-path-54);}.cls-61{clip-path:url(#clip-path-55);}.cls-62{clip-path:url(#clip-path-56);}.cls-63{clip-path:url(#clip-path-57);}.cls-64{clip-path:url(#clip-path-58);}.cls-65{clip-path:url(#clip-path-59);}.cls-66{clip-path:url(#clip-path-60);}.cls-67{clip-path:url(#clip-path-61);}.cls-68{clip-path:url(#clip-path-62);}.cls-69{clip-path:url(#clip-path-63);}.cls-70{clip-path:url(#clip-path-64);}.cls-71{clip-path:url(#clip-path-65);}.cls-72{clip-path:url(#clip-path-66);}.cls-73{clip-path:url(#clip-path-69);}.cls-74{clip-path:url(#clip-path-70);}.cls-75{clip-path:url(#clip-path-71);}.cls-76{clip-path:url(#clip-path-72);}.cls-77{clip-path:url(#clip-path-73);}.cls-78{clip-path:url(#clip-path-74);}.cls-79{clip-path:url(#clip-path-75);}.cls-80{clip-path:url(#clip-path-76);}.cls-81{clip-path:url(#clip-path-77);}.cls-82{clip-path:url(#clip-path-78);}.cls-83{clip-path:url(#clip-path-79);}.cls-84{clip-path:url(#clip-path-80);}.cls-85{clip-path:url(#clip-path-81);}.cls-86{clip-path:url(#clip-path-82);}.cls-87{fill:#4b5fef;}.cls-88{clip-path:url(#clip-path-83);}.cls-89{fill:#5a67ff;}.cls-90{fill:#7687ff;}"),a.createElement("clipPath",{id:"clip-path"},a.createElement("polygon",{className:"cls-1",points:"58.25 54.32 77.66 65.53 77.66 87.95 58.25 76.74 58.25 54.32"})),a.createElement("clipPath",{id:"clip-path-2"},a.createElement("polygon",{className:"cls-1",points:"77.66 65.53 77.66 87.95 58.25 99.16 58.25 76.74 77.66 65.53"})),a.createElement("clipPath",{id:"clip-path-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 76.74 58.25 99.16 38.83 87.95 38.83 65.53 58.25 76.74"})),a.createElement("clipPath",{id:"clip-path-4"},a.createElement("polygon",{className:"cls-1",points:"77.66 65.53 97.08 76.74 97.08 99.16 77.66 87.95 77.66 65.53"})),a.createElement("clipPath",{id:"clip-path-5"},a.createElement("polygon",{className:"cls-1",points:"97.08 76.74 97.08 99.16 77.66 110.37 77.66 87.95 97.08 76.74"})),a.createElement("clipPath",{id:"clip-path-6"},a.createElement("polygon",{className:"cls-1",points:"77.66 87.95 77.66 110.37 58.25 99.16 58.25 76.74 77.66 87.95"})),a.createElement("clipPath",{id:"clip-path-7"},a.createElement("polygon",{className:"cls-1",points:"58.25 76.74 77.66 87.95 77.66 110.37 58.25 99.16 58.25 76.74"})),a.createElement("clipPath",{id:"clip-path-8"},a.createElement("polygon",{className:"cls-1",points:"77.66 87.95 77.66 110.37 58.25 121.58 58.25 99.16 77.66 87.95"})),a.createElement("clipPath",{id:"clip-path-9"},a.createElement("polygon",{className:"cls-1",points:"58.25 99.16 58.25 121.58 38.83 110.37 38.83 87.95 58.25 99.16"})),a.createElement("clipPath",{id:"clip-path-10"},a.createElement("polygon",{className:"cls-1",points:"38.83 65.53 58.25 76.74 58.25 99.16 38.83 87.95 38.83 65.53"})),a.createElement("clipPath",{id:"clip-path-11"},a.createElement("polygon",{className:"cls-1",points:"58.25 76.74 58.25 99.16 38.83 110.37 38.83 87.95 58.25 76.74"})),a.createElement("clipPath",{id:"clip-path-12"},a.createElement("polygon",{className:"cls-1",points:"38.83 87.95 38.83 110.37 19.42 99.16 19.42 76.74 38.83 87.95"})),a.createElement("clipPath",{id:"clip-path-13"},a.createElement("polygon",{className:"cls-1",points:"19.42 76.74 38.83 87.95 38.83 110.37 19.42 99.16 19.42 76.74"})),a.createElement("clipPath",{id:"clip-path-14"},a.createElement("polygon",{className:"cls-1",points:"38.83 87.95 38.83 110.37 19.42 121.58 19.42 99.16 38.83 87.95"})),a.createElement("clipPath",{id:"clip-path-15"},a.createElement("polygon",{className:"cls-1",points:"19.42 99.16 19.42 121.58 0 110.37 0 87.95 19.42 99.16"})),a.createElement("clipPath",{id:"clip-path-16"},a.createElement("polygon",{className:"cls-1",points:"38.83 87.95 58.25 99.16 58.25 121.58 38.83 110.37 38.83 87.95"})),a.createElement("clipPath",{id:"clip-path-17"},a.createElement("polygon",{className:"cls-1",points:"58.25 99.16 58.25 121.58 38.83 132.79 38.83 110.37 58.25 99.16"})),a.createElement("clipPath",{id:"clip-path-18"},a.createElement("polygon",{className:"cls-1",points:"38.83 110.37 38.83 132.79 19.42 121.58 19.42 99.16 38.83 110.37"})),a.createElement("clipPath",{id:"clip-path-19"},a.createElement("polygon",{className:"cls-1",points:"97.08 76.74 116.5 87.95 116.5 110.37 97.08 99.16 97.08 76.74"})),a.createElement("clipPath",{id:"clip-path-20"},a.createElement("polygon",{className:"cls-1",points:"116.5 87.95 116.5 110.37 97.08 121.58 97.08 99.16 116.5 87.95"})),a.createElement("clipPath",{id:"clip-path-21"},a.createElement("polygon",{className:"cls-1",points:"97.08 99.16 97.08 121.58 77.66 110.37 77.66 87.95 97.08 99.16"})),a.createElement("clipPath",{id:"clip-path-22"},a.createElement("polygon",{className:"cls-1",points:"77.66 87.95 97.08 99.16 97.08 121.58 77.66 110.37 77.66 87.95"})),a.createElement("clipPath",{id:"clip-path-23"},a.createElement("polygon",{className:"cls-1",points:"97.08 99.16 97.08 121.58 77.66 132.79 77.66 110.37 97.08 99.16"})),a.createElement("clipPath",{id:"clip-path-24"},a.createElement("polygon",{className:"cls-1",points:"77.66 110.37 77.66 132.79 58.25 121.58 58.25 99.16 77.66 110.37"})),a.createElement("clipPath",{id:"clip-path-25"},a.createElement("polygon",{className:"cls-1",points:"58.25 99.16 77.66 110.37 77.66 132.79 58.25 121.58 58.25 99.16"})),a.createElement("clipPath",{id:"clip-path-26"},a.createElement("polygon",{className:"cls-1",points:"77.66 110.37 77.66 132.79 58.25 144 58.25 121.58 77.66 110.37"})),a.createElement("clipPath",{id:"clip-path-27"},a.createElement("polygon",{className:"cls-1",points:"58.25 121.58 58.25 144 38.83 132.79 38.83 110.37 58.25 121.58"})),a.createElement("clipPath",{id:"clip-path-28"},a.createElement("polygon",{className:"cls-1",points:"58.25 31.9 77.66 43.11 77.66 65.53 58.25 54.32 58.25 31.9"})),a.createElement("clipPath",{id:"clip-path-29"},a.createElement("polygon",{className:"cls-1",points:"77.66 43.11 77.66 65.53 58.25 76.74 58.25 54.32 77.66 43.11"})),a.createElement("clipPath",{id:"clip-path-30"},a.createElement("polygon",{className:"cls-1",points:"58.25 54.32 58.25 76.74 38.83 65.53 38.83 43.11 58.25 54.32"})),a.createElement("clipPath",{id:"clip-path-31"},a.createElement("polygon",{className:"cls-1",points:"77.66 43.11 97.08 54.32 97.08 76.74 77.66 65.53 77.66 43.11"})),a.createElement("clipPath",{id:"clip-path-32"},a.createElement("polygon",{className:"cls-1",points:"97.08 54.32 97.08 76.74 77.66 87.95 77.66 65.53 97.08 54.32"})),a.createElement("clipPath",{id:"clip-path-33"},a.createElement("polygon",{className:"cls-1",points:"77.66 65.53 77.66 87.95 58.25 76.74 58.25 54.32 77.66 65.53"})),a.createElement("clipPath",{id:"clip-path-34"},a.createElement("polygon",{className:"cls-1",points:"97.08 54.32 116.5 65.53 116.5 87.95 97.08 76.74 97.08 54.32"})),a.createElement("clipPath",{id:"clip-path-35"},a.createElement("polygon",{className:"cls-1",points:"116.5 65.53 116.5 87.95 97.08 99.16 97.08 76.74 116.5 65.53"})),a.createElement("clipPath",{id:"clip-path-36"},a.createElement("polygon",{className:"cls-1",points:"97.08 76.74 97.08 99.16 77.66 87.95 77.66 65.53 97.08 76.74"})),a.createElement("clipPath",{id:"clip-path-37"},a.createElement("polygon",{className:"cls-1",points:"58.25 54.32 77.66 65.53 77.66 87.95 58.25 76.74 58.25 54.32"})),a.createElement("clipPath",{id:"clip-path-38"},a.createElement("polygon",{className:"cls-1",points:"77.66 65.53 77.66 87.95 58.25 99.16 58.25 76.74 77.66 65.53"})),a.createElement("clipPath",{id:"clip-path-39"},a.createElement("polygon",{className:"cls-1",points:"58.25 76.74 58.25 99.16 38.83 87.95 38.83 65.53 58.25 76.74"})),a.createElement("clipPath",{id:"clip-path-40"},a.createElement("polygon",{className:"cls-1",points:"38.83 43.11 58.25 54.32 58.25 76.74 38.83 65.53 38.83 43.11"})),a.createElement("clipPath",{id:"clip-path-41"},a.createElement("polygon",{className:"cls-1",points:"58.25 54.32 58.25 76.74 38.83 87.95 38.83 65.53 58.25 54.32"})),a.createElement("clipPath",{id:"clip-path-42"},a.createElement("polygon",{className:"cls-1",points:"38.83 65.53 38.83 87.95 19.42 76.74 19.42 54.32 38.83 65.53"})),a.createElement("clipPath",{id:"clip-path-43"},a.createElement("polygon",{className:"cls-1",points:"77.66 65.53 97.08 76.74 97.08 99.16 77.66 87.95 77.66 65.53"})),a.createElement("clipPath",{id:"clip-path-44"},a.createElement("polygon",{className:"cls-1",points:"97.08 76.74 97.08 99.16 77.66 110.37 77.66 87.95 97.08 76.74"})),a.createElement("clipPath",{id:"clip-path-45"},a.createElement("polygon",{className:"cls-1",points:"77.66 87.95 77.66 110.37 58.25 99.16 58.25 76.74 77.66 87.95"})),a.createElement("clipPath",{id:"clip-path-46"},a.createElement("polygon",{className:"cls-1",points:"19.42 54.32 38.83 65.53 38.83 87.95 19.42 76.74 19.42 54.32"})),a.createElement("clipPath",{id:"clip-path-47"},a.createElement("polygon",{className:"cls-1",points:"38.83 65.53 38.83 87.95 19.42 99.16 19.42 76.74 38.83 65.53"})),a.createElement("clipPath",{id:"clip-path-48"},a.createElement("polygon",{className:"cls-1",points:"19.42 76.74 19.42 99.16 0 87.95 0 65.53 19.42 76.74"})),a.createElement("clipPath",{id:"clip-path-49"},a.createElement("polygon",{className:"cls-1",points:"38.83 65.53 58.25 76.74 58.25 99.16 38.83 87.95 38.83 65.53"})),a.createElement("clipPath",{id:"clip-path-50"},a.createElement("polygon",{className:"cls-1",points:"58.25 76.74 58.25 99.16 38.83 110.37 38.83 87.95 58.25 76.74"})),a.createElement("clipPath",{id:"clip-path-51"},a.createElement("polygon",{className:"cls-1",points:"38.83 87.95 38.83 110.37 19.42 99.16 19.42 76.74 38.83 87.95"})),a.createElement("clipPath",{id:"clip-path-52"},a.createElement("polygon",{className:"cls-1",points:"58.25 76.74 77.66 87.95 77.66 110.37 58.25 99.16 58.25 76.74"})),a.createElement("clipPath",{id:"clip-path-53"},a.createElement("polygon",{className:"cls-1",points:"77.66 87.95 77.66 110.37 58.25 121.58 58.25 99.16 77.66 87.95"})),a.createElement("clipPath",{id:"clip-path-54"},a.createElement("polygon",{className:"cls-1",points:"58.25 99.16 58.25 121.58 38.83 110.37 38.83 87.95 58.25 99.16"})),a.createElement("clipPath",{id:"clip-path-55"},a.createElement("polygon",{className:"cls-1",points:"58.25 9.48 77.66 20.69 77.66 43.11 58.25 31.9 58.25 9.48"})),a.createElement("clipPath",{id:"clip-path-56"},a.createElement("polygon",{className:"cls-1",points:"77.66 20.69 77.66 43.11 58.25 54.32 58.25 31.9 77.66 20.69"})),a.createElement("clipPath",{id:"clip-path-57"},a.createElement("polygon",{className:"cls-1",points:"58.25 31.9 58.25 54.32 38.83 43.11 38.83 20.69 58.25 31.9"})),a.createElement("clipPath",{id:"clip-path-58"},a.createElement("polygon",{className:"cls-1",points:"58.25 31.9 77.66 43.11 77.66 65.53 58.25 54.32 58.25 31.9"})),a.createElement("clipPath",{id:"clip-path-59"},a.createElement("polygon",{className:"cls-1",points:"77.66 43.11 77.66 65.53 58.25 76.74 58.25 54.32 77.66 43.11"})),a.createElement("clipPath",{id:"clip-path-60"},a.createElement("polygon",{className:"cls-1",points:"58.25 54.32 58.25 76.74 38.83 65.53 38.83 43.11 58.25 54.32"})),a.createElement("clipPath",{id:"clip-path-61"},a.createElement("polygon",{className:"cls-1",points:"77.66 20.69 97.08 31.9 97.08 54.32 77.66 43.11 77.66 20.69"})),a.createElement("clipPath",{id:"clip-path-62"},a.createElement("polygon",{className:"cls-1",points:"97.08 31.9 97.08 54.32 77.66 65.53 77.66 43.11 97.08 31.9"})),a.createElement("clipPath",{id:"clip-path-63"},a.createElement("polygon",{className:"cls-1",points:"77.66 43.11 77.66 65.53 58.25 54.32 58.25 31.9 77.66 43.11"})),a.createElement("clipPath",{id:"clip-path-64"},a.createElement("polygon",{className:"cls-1",points:"38.83 20.69 58.25 31.9 58.25 54.32 38.83 43.11 38.83 20.69"})),a.createElement("clipPath",{id:"clip-path-65"},a.createElement("polygon",{className:"cls-1",points:"58.25 31.9 58.25 54.32 38.83 65.53 38.83 43.11 58.25 31.9"})),a.createElement("clipPath",{id:"clip-path-66"},a.createElement("polygon",{className:"cls-1",points:"38.83 43.11 38.83 65.53 19.42 54.32 19.42 31.9 38.83 43.11"})),a.createElement("clipPath",{id:"clip-path-69"},a.createElement("polygon",{className:"cls-1",points:"19.42 31.9 38.83 43.11 38.83 65.53 19.42 54.32 19.42 31.9"})),a.createElement("clipPath",{id:"clip-path-70"},a.createElement("polygon",{className:"cls-1",points:"38.83 43.11 38.83 65.53 19.42 76.74 19.42 54.32 38.83 43.11"})),a.createElement("clipPath",{id:"clip-path-71"},a.createElement("polygon",{className:"cls-1",points:"19.42 54.32 19.42 76.74 0 65.53 0 43.11 19.42 54.32"})),a.createElement("clipPath",{id:"clip-path-72"},a.createElement("polygon",{className:"cls-1",points:"38.83 43.11 58.25 54.32 58.25 76.74 38.83 65.53 38.83 43.11"})),a.createElement("clipPath",{id:"clip-path-73"},a.createElement("polygon",{className:"cls-1",points:"58.25 54.32 58.25 76.74 38.83 87.95 38.83 65.53 58.25 54.32"})),a.createElement("clipPath",{id:"clip-path-74"},a.createElement("polygon",{className:"cls-1",points:"38.83 65.53 38.83 87.95 19.42 76.74 19.42 54.32 38.83 65.53"})),a.createElement("clipPath",{id:"clip-path-75"},a.createElement("polygon",{className:"cls-1",points:"97.08 31.9 116.5 43.11 116.5 65.53 97.08 54.32 97.08 31.9"})),a.createElement("clipPath",{id:"clip-path-76"},a.createElement("polygon",{className:"cls-1",points:"116.5 43.11 116.5 65.53 97.08 76.74 97.08 54.32 116.5 43.11"})),a.createElement("clipPath",{id:"clip-path-77"},a.createElement("polygon",{className:"cls-1",points:"97.08 54.32 97.08 76.74 77.66 65.53 77.66 43.11 97.08 54.32"})),a.createElement("clipPath",{id:"clip-path-78"},a.createElement("polygon",{className:"cls-1",points:"77.66 43.11 97.08 54.32 97.08 76.74 77.66 65.53 77.66 43.11"})),a.createElement("clipPath",{id:"clip-path-79"},a.createElement("polygon",{className:"cls-1",points:"97.08 54.32 97.08 76.74 77.66 87.95 77.66 65.53 97.08 54.32"})),a.createElement("clipPath",{id:"clip-path-80"},a.createElement("polygon",{className:"cls-1",points:"77.66 65.53 77.66 87.95 58.25 76.74 58.25 54.32 77.66 65.53"})),a.createElement("clipPath",{id:"clip-path-81"},a.createElement("polygon",{className:"cls-1",points:"58.25 0 77.66 11.21 77.66 33.63 58.25 22.42 58.25 0"})),a.createElement("clipPath",{id:"clip-path-82"},a.createElement("polygon",{className:"cls-1",points:"77.66 11.21 77.66 33.63 58.25 44.84 58.25 22.42 77.66 11.21"})),a.createElement("clipPath",{id:"clip-path-83"},a.createElement("polygon",{className:"cls-1",points:"58.25 22.42 58.25 44.84 38.83 33.63 38.83 11.21 58.25 22.42"}))),lW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 54.32 77.66 65.53 77.66 87.95 58.25 76.74 58.25 54.32"}),a.createElement("g",{className:"cls-4"},a.createElement("polygon",{className:"cls-1",points:"58.25 54.32 77.66 65.53 77.66 87.95 58.25 76.74 58.25 54.32"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 65.53 77.66 87.95 58.25 99.16 58.25 76.74 77.66 65.53"}),a.createElement("g",{className:"cls-5"},a.createElement("polygon",{className:"cls-6",points:"77.66 65.53 77.66 87.95 58.25 99.16 58.25 76.74 77.66 65.53"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 76.74 58.25 99.16 38.83 87.95 38.83 65.53 58.25 76.74"}),a.createElement("g",{className:"cls-7"},a.createElement("polygon",{className:"cls-8",points:"58.25 76.74 58.25 99.16 38.83 87.95 38.83 65.53 58.25 76.74"}))))),cW=a.createElement("polygon",{className:"cls-9",points:"38.83 65.53 58.25 54.32 77.66 65.53 58.25 76.74 38.83 65.53"}),sW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 65.53 97.08 76.74 97.08 99.16 77.66 87.95 77.66 65.53"}),a.createElement("g",{className:"cls-10"},a.createElement("polygon",{className:"cls-1",points:"77.66 65.53 97.08 76.74 97.08 99.16 77.66 87.95 77.66 65.53"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"97.08 76.74 97.08 99.16 77.66 110.37 77.66 87.95 97.08 76.74"}),a.createElement("g",{className:"cls-11"},a.createElement("polygon",{className:"cls-6",points:"97.08 76.74 97.08 99.16 77.66 110.37 77.66 87.95 97.08 76.74"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 87.95 77.66 110.37 58.25 99.16 58.25 76.74 77.66 87.95"}),a.createElement("g",{className:"cls-12"},a.createElement("polygon",{className:"cls-8",points:"77.66 87.95 77.66 110.37 58.25 99.16 58.25 76.74 77.66 87.95"}))))),dW=a.createElement("polygon",{className:"cls-9",points:"58.25 76.74 77.66 65.53 97.08 76.74 77.66 87.95 58.25 76.74"}),uW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 76.74 77.66 87.95 77.66 110.37 58.25 99.16 58.25 76.74"}),a.createElement("g",{className:"cls-13"},a.createElement("polygon",{className:"cls-1",points:"58.25 76.74 77.66 87.95 77.66 110.37 58.25 99.16 58.25 76.74"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 87.95 77.66 110.37 58.25 121.58 58.25 99.16 77.66 87.95"}),a.createElement("g",{className:"cls-14"},a.createElement("polygon",{className:"cls-6",points:"77.66 87.95 77.66 110.37 58.25 121.58 58.25 99.16 77.66 87.95"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 99.16 58.25 121.58 38.83 110.37 38.83 87.95 58.25 99.16"}),a.createElement("g",{className:"cls-15"},a.createElement("polygon",{className:"cls-8",points:"58.25 99.16 58.25 121.58 38.83 110.37 38.83 87.95 58.25 99.16"}))))),mW=a.createElement("polygon",{className:"cls-9",points:"38.83 87.95 58.25 76.74 77.66 87.95 58.25 99.16 38.83 87.95"}),hW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"38.83 65.53 58.25 76.74 58.25 99.16 38.83 87.95 38.83 65.53"}),a.createElement("g",{className:"cls-16"},a.createElement("polygon",{className:"cls-1",points:"38.83 65.53 58.25 76.74 58.25 99.16 38.83 87.95 38.83 65.53"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 76.74 58.25 99.16 38.83 110.37 38.83 87.95 58.25 76.74"}),a.createElement("g",{className:"cls-17"},a.createElement("polygon",{className:"cls-6",points:"58.25 76.74 58.25 99.16 38.83 110.37 38.83 87.95 58.25 76.74"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"38.83 87.95 38.83 110.37 19.42 99.16 19.42 76.74 38.83 87.95"}),a.createElement("g",{className:"cls-18"},a.createElement("polygon",{className:"cls-8",points:"38.83 87.95 38.83 110.37 19.42 99.16 19.42 76.74 38.83 87.95"}))))),pW=a.createElement("polygon",{className:"cls-9",points:"19.42 76.74 38.83 65.53 58.25 76.74 38.83 87.95 19.42 76.74"}),bW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"19.42 76.74 38.83 87.95 38.83 110.37 19.42 99.16 19.42 76.74"}),a.createElement("g",{className:"cls-19"},a.createElement("polygon",{className:"cls-1",points:"19.42 76.74 38.83 87.95 38.83 110.37 19.42 99.16 19.42 76.74"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"38.83 87.95 38.83 110.37 19.42 121.58 19.42 99.16 38.83 87.95"}),a.createElement("g",{className:"cls-20"},a.createElement("polygon",{className:"cls-6",points:"38.83 87.95 38.83 110.37 19.42 121.58 19.42 99.16 38.83 87.95"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"19.42 99.16 19.42 121.58 0 110.37 0 87.95 19.42 99.16"}),a.createElement("g",{className:"cls-21"},a.createElement("polygon",{className:"cls-8",points:"19.42 99.16 19.42 121.58 0 110.37 0 87.95 19.42 99.16"}))))),fW=a.createElement("polygon",{className:"cls-9",points:"0 87.95 19.42 76.74 38.83 87.95 19.42 99.16 0 87.95"}),jW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"38.83 87.95 58.25 99.16 58.25 121.58 38.83 110.37 38.83 87.95"}),a.createElement("g",{className:"cls-22"},a.createElement("polygon",{className:"cls-1",points:"38.83 87.95 58.25 99.16 58.25 121.58 38.83 110.37 38.83 87.95"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 99.16 58.25 121.58 38.83 132.79 38.83 110.37 58.25 99.16"}),a.createElement("g",{className:"cls-23"},a.createElement("polygon",{className:"cls-6",points:"58.25 99.16 58.25 121.58 38.83 132.79 38.83 110.37 58.25 99.16"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"38.83 110.37 38.83 132.79 19.42 121.58 19.42 99.16 38.83 110.37"}),a.createElement("g",{className:"cls-24"},a.createElement("polygon",{className:"cls-8",points:"38.83 110.37 38.83 132.79 19.42 121.58 19.42 99.16 38.83 110.37"}))))),gW=a.createElement("polygon",{className:"cls-9",points:"19.42 99.16 38.83 87.95 58.25 99.16 38.83 110.37 19.42 99.16"}),OW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"97.08 76.74 116.5 87.95 116.5 110.37 97.08 99.16 97.08 76.74"}),a.createElement("g",{className:"cls-25"},a.createElement("polygon",{className:"cls-1",points:"97.08 76.74 116.5 87.95 116.5 110.37 97.08 99.16 97.08 76.74"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"116.5 87.95 116.5 110.37 97.08 121.58 97.08 99.16 116.5 87.95"}),a.createElement("g",{className:"cls-26"},a.createElement("polygon",{className:"cls-6",points:"116.5 87.95 116.5 110.37 97.08 121.58 97.08 99.16 116.5 87.95"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"97.08 99.16 97.08 121.58 77.66 110.37 77.66 87.95 97.08 99.16"}),a.createElement("g",{className:"cls-27"},a.createElement("polygon",{className:"cls-8",points:"97.08 99.16 97.08 121.58 77.66 110.37 77.66 87.95 97.08 99.16"}))))),xW=a.createElement("polygon",{className:"cls-9",points:"77.66 87.95 97.08 76.74 116.5 87.95 97.08 99.16 77.66 87.95"}),vW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 87.95 97.08 99.16 97.08 121.58 77.66 110.37 77.66 87.95"}),a.createElement("g",{className:"cls-28"},a.createElement("polygon",{className:"cls-1",points:"77.66 87.95 97.08 99.16 97.08 121.58 77.66 110.37 77.66 87.95"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"97.08 99.16 97.08 121.58 77.66 132.79 77.66 110.37 97.08 99.16"}),a.createElement("g",{className:"cls-29"},a.createElement("polygon",{className:"cls-6",points:"97.08 99.16 97.08 121.58 77.66 132.79 77.66 110.37 97.08 99.16"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 110.37 77.66 132.79 58.25 121.58 58.25 99.16 77.66 110.37"}),a.createElement("g",{className:"cls-30"},a.createElement("polygon",{className:"cls-8",points:"77.66 110.37 77.66 132.79 58.25 121.58 58.25 99.16 77.66 110.37"}))))),yW=a.createElement("polygon",{className:"cls-9",points:"58.25 99.16 77.66 87.95 97.08 99.16 77.66 110.37 58.25 99.16"}),wW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 99.16 77.66 110.37 77.66 132.79 58.25 121.58 58.25 99.16"}),a.createElement("g",{className:"cls-31"},a.createElement("polygon",{className:"cls-1",points:"58.25 99.16 77.66 110.37 77.66 132.79 58.25 121.58 58.25 99.16"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 110.37 77.66 132.79 58.25 144 58.25 121.58 77.66 110.37"}),a.createElement("g",{className:"cls-32"},a.createElement("polygon",{className:"cls-6",points:"77.66 110.37 77.66 132.79 58.25 144 58.25 121.58 77.66 110.37"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 121.58 58.25 144 38.83 132.79 38.83 110.37 58.25 121.58"}),a.createElement("g",{className:"cls-33"},a.createElement("polygon",{className:"cls-8",points:"58.25 121.58 58.25 144 38.83 132.79 38.83 110.37 58.25 121.58"}))))),CW=a.createElement("polygon",{className:"cls-9",points:"38.83 110.37 58.25 99.16 77.66 110.37 58.25 121.58 38.83 110.37"}),kW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 31.9 77.66 43.11 77.66 65.53 58.25 54.32 58.25 31.9"}),a.createElement("g",{className:"cls-34"},a.createElement("polygon",{className:"cls-1",points:"58.25 31.9 77.66 43.11 77.66 65.53 58.25 54.32 58.25 31.9"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 43.11 77.66 65.53 58.25 76.74 58.25 54.32 77.66 43.11"}),a.createElement("g",{className:"cls-35"},a.createElement("polygon",{className:"cls-6",points:"77.66 43.11 77.66 65.53 58.25 76.74 58.25 54.32 77.66 43.11"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 54.32 58.25 76.74 38.83 65.53 38.83 43.11 58.25 54.32"}),a.createElement("g",{className:"cls-36"},a.createElement("polygon",{className:"cls-8",points:"58.25 54.32 58.25 76.74 38.83 65.53 38.83 43.11 58.25 54.32"}))))),EW=a.createElement("polygon",{className:"cls-9",points:"38.83 43.11 58.25 31.9 77.66 43.11 58.25 54.32 38.83 43.11"}),NW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 43.11 97.08 54.32 97.08 76.74 77.66 65.53 77.66 43.11"}),a.createElement("g",{className:"cls-37"},a.createElement("polygon",{className:"cls-1",points:"77.66 43.11 97.08 54.32 97.08 76.74 77.66 65.53 77.66 43.11"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"97.08 54.32 97.08 76.74 77.66 87.95 77.66 65.53 97.08 54.32"}),a.createElement("g",{className:"cls-38"},a.createElement("polygon",{className:"cls-6",points:"97.08 54.32 97.08 76.74 77.66 87.95 77.66 65.53 97.08 54.32"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 65.53 77.66 87.95 58.25 76.74 58.25 54.32 77.66 65.53"}),a.createElement("g",{className:"cls-39"},a.createElement("polygon",{className:"cls-8",points:"77.66 65.53 77.66 87.95 58.25 76.74 58.25 54.32 77.66 65.53"}))))),SW=a.createElement("polygon",{className:"cls-9",points:"58.25 54.32 77.66 43.11 97.08 54.32 77.66 65.53 58.25 54.32"}),IW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"97.08 54.32 116.5 65.53 116.5 87.95 97.08 76.74 97.08 54.32"}),a.createElement("g",{className:"cls-40"},a.createElement("polygon",{className:"cls-1",points:"97.08 54.32 116.5 65.53 116.5 87.95 97.08 76.74 97.08 54.32"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"116.5 65.53 116.5 87.95 97.08 99.16 97.08 76.74 116.5 65.53"}),a.createElement("g",{className:"cls-41"},a.createElement("polygon",{className:"cls-6",points:"116.5 65.53 116.5 87.95 97.08 99.16 97.08 76.74 116.5 65.53"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"97.08 76.74 97.08 99.16 77.66 87.95 77.66 65.53 97.08 76.74"}),a.createElement("g",{className:"cls-42"},a.createElement("polygon",{className:"cls-8",points:"97.08 76.74 97.08 99.16 77.66 87.95 77.66 65.53 97.08 76.74"}))))),LW=a.createElement("polygon",{className:"cls-9",points:"77.66 65.53 97.08 54.32 116.5 65.53 97.08 76.74 77.66 65.53"}),PW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 54.32 77.66 65.53 77.66 87.95 58.25 76.74 58.25 54.32"}),a.createElement("g",{className:"cls-43"},a.createElement("polygon",{className:"cls-1",points:"58.25 54.32 77.66 65.53 77.66 87.95 58.25 76.74 58.25 54.32"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 65.53 77.66 87.95 58.25 99.16 58.25 76.74 77.66 65.53"}),a.createElement("g",{className:"cls-44"},a.createElement("polygon",{className:"cls-6",points:"77.66 65.53 77.66 87.95 58.25 99.16 58.25 76.74 77.66 65.53"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 76.74 58.25 99.16 38.83 87.95 38.83 65.53 58.25 76.74"}),a.createElement("g",{className:"cls-45"},a.createElement("polygon",{className:"cls-8",points:"58.25 76.74 58.25 99.16 38.83 87.95 38.83 65.53 58.25 76.74"}))))),FW=a.createElement("polygon",{className:"cls-9",points:"38.83 65.53 58.25 54.32 77.66 65.53 58.25 76.74 38.83 65.53"}),DW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"38.83 43.11 58.25 54.32 58.25 76.74 38.83 65.53 38.83 43.11"}),a.createElement("g",{className:"cls-46"},a.createElement("polygon",{className:"cls-1",points:"38.83 43.11 58.25 54.32 58.25 76.74 38.83 65.53 38.83 43.11"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 54.32 58.25 76.74 38.83 87.95 38.83 65.53 58.25 54.32"}),a.createElement("g",{className:"cls-47"},a.createElement("polygon",{className:"cls-6",points:"58.25 54.32 58.25 76.74 38.83 87.95 38.83 65.53 58.25 54.32"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"38.83 65.53 38.83 87.95 19.42 76.74 19.42 54.32 38.83 65.53"}),a.createElement("g",{className:"cls-48"},a.createElement("polygon",{className:"cls-8",points:"38.83 65.53 38.83 87.95 19.42 76.74 19.42 54.32 38.83 65.53"}))))),TW=a.createElement("polygon",{className:"cls-9",points:"19.42 54.32 38.83 43.11 58.25 54.32 38.83 65.53 19.42 54.32"}),RW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 65.53 97.08 76.74 97.08 99.16 77.66 87.95 77.66 65.53"}),a.createElement("g",{className:"cls-49"},a.createElement("polygon",{className:"cls-1",points:"77.66 65.53 97.08 76.74 97.08 99.16 77.66 87.95 77.66 65.53"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"97.08 76.74 97.08 99.16 77.66 110.37 77.66 87.95 97.08 76.74"}),a.createElement("g",{className:"cls-50"},a.createElement("polygon",{className:"cls-6",points:"97.08 76.74 97.08 99.16 77.66 110.37 77.66 87.95 97.08 76.74"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 87.95 77.66 110.37 58.25 99.16 58.25 76.74 77.66 87.95"}),a.createElement("g",{className:"cls-51"},a.createElement("polygon",{className:"cls-8",points:"77.66 87.95 77.66 110.37 58.25 99.16 58.25 76.74 77.66 87.95"}))))),BW=a.createElement("polygon",{className:"cls-9",points:"58.25 76.74 77.66 65.53 97.08 76.74 77.66 87.95 58.25 76.74"}),AW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"19.42 54.32 38.83 65.53 38.83 87.95 19.42 76.74 19.42 54.32"}),a.createElement("g",{className:"cls-52"},a.createElement("polygon",{className:"cls-1",points:"19.42 54.32 38.83 65.53 38.83 87.95 19.42 76.74 19.42 54.32"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"38.83 65.53 38.83 87.95 19.42 99.16 19.42 76.74 38.83 65.53"}),a.createElement("g",{className:"cls-53"},a.createElement("polygon",{className:"cls-6",points:"38.83 65.53 38.83 87.95 19.42 99.16 19.42 76.74 38.83 65.53"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"19.42 76.74 19.42 99.16 0 87.95 0 65.53 19.42 76.74"}),a.createElement("g",{className:"cls-54"},a.createElement("polygon",{className:"cls-8",points:"19.42 76.74 19.42 99.16 0 87.95 0 65.53 19.42 76.74"}))))),MW=a.createElement("polygon",{className:"cls-9",points:"0 65.53 19.42 54.32 38.83 65.53 19.42 76.74 0 65.53"}),WW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"38.83 65.53 58.25 76.74 58.25 99.16 38.83 87.95 38.83 65.53"}),a.createElement("g",{className:"cls-55"},a.createElement("polygon",{className:"cls-1",points:"38.83 65.53 58.25 76.74 58.25 99.16 38.83 87.95 38.83 65.53"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 76.74 58.25 99.16 38.83 110.37 38.83 87.95 58.25 76.74"}),a.createElement("g",{className:"cls-56"},a.createElement("polygon",{className:"cls-6",points:"58.25 76.74 58.25 99.16 38.83 110.37 38.83 87.95 58.25 76.74"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"38.83 87.95 38.83 110.37 19.42 99.16 19.42 76.74 38.83 87.95"}),a.createElement("g",{className:"cls-57"},a.createElement("polygon",{className:"cls-8",points:"38.83 87.95 38.83 110.37 19.42 99.16 19.42 76.74 38.83 87.95"}))))),zW=a.createElement("polygon",{className:"cls-9",points:"19.42 76.74 38.83 65.53 58.25 76.74 38.83 87.95 19.42 76.74"}),qW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 76.74 77.66 87.95 77.66 110.37 58.25 99.16 58.25 76.74"}),a.createElement("g",{className:"cls-58"},a.createElement("polygon",{className:"cls-1",points:"58.25 76.74 77.66 87.95 77.66 110.37 58.25 99.16 58.25 76.74"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 87.95 77.66 110.37 58.25 121.58 58.25 99.16 77.66 87.95"}),a.createElement("g",{className:"cls-59"},a.createElement("polygon",{className:"cls-6",points:"77.66 87.95 77.66 110.37 58.25 121.58 58.25 99.16 77.66 87.95"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 99.16 58.25 121.58 38.83 110.37 38.83 87.95 58.25 99.16"}),a.createElement("g",{className:"cls-60"},a.createElement("polygon",{className:"cls-8",points:"58.25 99.16 58.25 121.58 38.83 110.37 38.83 87.95 58.25 99.16"}))))),$W=a.createElement("polygon",{className:"cls-9",points:"38.83 87.95 58.25 76.74 77.66 87.95 58.25 99.16 38.83 87.95"}),HW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 9.48 77.66 20.69 77.66 43.11 58.25 31.9 58.25 9.48"}),a.createElement("g",{className:"cls-61"},a.createElement("polygon",{className:"cls-1",points:"58.25 9.48 77.66 20.69 77.66 43.11 58.25 31.9 58.25 9.48"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 20.69 77.66 43.11 58.25 54.32 58.25 31.9 77.66 20.69"}),a.createElement("g",{className:"cls-62"},a.createElement("polygon",{className:"cls-6",points:"77.66 20.69 77.66 43.11 58.25 54.32 58.25 31.9 77.66 20.69"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 31.9 58.25 54.32 38.83 43.11 38.83 20.69 58.25 31.9"}),a.createElement("g",{className:"cls-63"},a.createElement("polygon",{className:"cls-8",points:"58.25 31.9 58.25 54.32 38.83 43.11 38.83 20.69 58.25 31.9"}))))),VW=a.createElement("polygon",{className:"cls-9",points:"38.83 20.69 58.25 9.48 77.66 20.69 58.25 31.9 38.83 20.69"}),UW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 31.9 77.66 43.11 77.66 65.53 58.25 54.32 58.25 31.9"}),a.createElement("g",{className:"cls-64"},a.createElement("polygon",{className:"cls-1",points:"58.25 31.9 77.66 43.11 77.66 65.53 58.25 54.32 58.25 31.9"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 43.11 77.66 65.53 58.25 76.74 58.25 54.32 77.66 43.11"}),a.createElement("g",{className:"cls-65"},a.createElement("polygon",{className:"cls-6",points:"77.66 43.11 77.66 65.53 58.25 76.74 58.25 54.32 77.66 43.11"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 54.32 58.25 76.74 38.83 65.53 38.83 43.11 58.25 54.32"}),a.createElement("g",{className:"cls-66"},a.createElement("polygon",{className:"cls-8",points:"58.25 54.32 58.25 76.74 38.83 65.53 38.83 43.11 58.25 54.32"}))))),GW=a.createElement("polygon",{className:"cls-9",points:"38.83 43.11 58.25 31.9 77.66 43.11 58.25 54.32 38.83 43.11"}),XW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 20.69 97.08 31.9 97.08 54.32 77.66 43.11 77.66 20.69"}),a.createElement("g",{className:"cls-67"},a.createElement("polygon",{className:"cls-1",points:"77.66 20.69 97.08 31.9 97.08 54.32 77.66 43.11 77.66 20.69"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"97.08 31.9 97.08 54.32 77.66 65.53 77.66 43.11 97.08 31.9"}),a.createElement("g",{className:"cls-68"},a.createElement("polygon",{className:"cls-6",points:"97.08 31.9 97.08 54.32 77.66 65.53 77.66 43.11 97.08 31.9"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 43.11 77.66 65.53 58.25 54.32 58.25 31.9 77.66 43.11"}),a.createElement("g",{className:"cls-69"},a.createElement("polygon",{className:"cls-8",points:"77.66 43.11 77.66 65.53 58.25 54.32 58.25 31.9 77.66 43.11"}))))),_W=a.createElement("polygon",{className:"cls-9",points:"58.25 31.9 77.66 20.69 97.08 31.9 77.66 43.11 58.25 31.9"}),ZW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"38.83 20.69 58.25 31.9 58.25 54.32 38.83 43.11 38.83 20.69"}),a.createElement("g",{className:"cls-70"},a.createElement("polygon",{className:"cls-1",points:"38.83 20.69 58.25 31.9 58.25 54.32 38.83 43.11 38.83 20.69"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 31.9 58.25 54.32 38.83 65.53 38.83 43.11 58.25 31.9"}),a.createElement("g",{className:"cls-71"},a.createElement("polygon",{className:"cls-6",points:"58.25 31.9 58.25 54.32 38.83 65.53 38.83 43.11 58.25 31.9"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"38.83 43.11 38.83 65.53 19.42 54.32 19.42 31.9 38.83 43.11"}),a.createElement("g",{className:"cls-72"},a.createElement("polygon",{className:"cls-8",points:"38.83 43.11 38.83 65.53 19.42 54.32 19.42 31.9 38.83 43.11"}))))),KW=a.createElement("polygon",{className:"cls-9",points:"19.42 31.9 38.83 20.69 58.25 31.9 38.83 43.11 19.42 31.9"}),QW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 43.11 77.66 65.53 58.25 76.74 58.25 54.32 77.66 43.11"}),a.createElement("g",{className:"cls-35"},a.createElement("polygon",{className:"cls-6",points:"77.66 43.11 77.66 65.53 58.25 76.74 58.25 54.32 77.66 43.11"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 54.32 58.25 76.74 38.83 65.53 38.83 43.11 58.25 54.32"}),a.createElement("g",{className:"cls-36"},a.createElement("polygon",{className:"cls-8",points:"58.25 54.32 58.25 76.74 38.83 65.53 38.83 43.11 58.25 54.32"}))),a.createElement("polygon",{className:"cls-1",points:"38.83 43.11 58.25 31.9 77.66 43.11 58.25 54.32 38.83 43.11"}))),YW=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"19.42 31.9 38.83 43.11 38.83 65.53 19.42 54.32 19.42 31.9"}),a.createElement("g",{className:"cls-73"},a.createElement("polygon",{className:"cls-1",points:"19.42 31.9 38.83 43.11 38.83 65.53 19.42 54.32 19.42 31.9"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"38.83 43.11 38.83 65.53 19.42 76.74 19.42 54.32 38.83 43.11"}),a.createElement("g",{className:"cls-74"},a.createElement("polygon",{className:"cls-6",points:"38.83 43.11 38.83 65.53 19.42 76.74 19.42 54.32 38.83 43.11"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"19.42 54.32 19.42 76.74 0 65.53 0 43.11 19.42 54.32"}),a.createElement("g",{className:"cls-75"},a.createElement("polygon",{className:"cls-8",points:"19.42 54.32 19.42 76.74 0 65.53 0 43.11 19.42 54.32"}))))),JW=a.createElement("polygon",{className:"cls-9",points:"0 43.11 19.42 31.9 38.83 43.11 19.42 54.32 0 43.11"}),ez=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"38.83 43.11 58.25 54.32 58.25 76.74 38.83 65.53 38.83 43.11"}),a.createElement("g",{className:"cls-76"},a.createElement("polygon",{className:"cls-1",points:"38.83 43.11 58.25 54.32 58.25 76.74 38.83 65.53 38.83 43.11"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 54.32 58.25 76.74 38.83 87.95 38.83 65.53 58.25 54.32"}),a.createElement("g",{className:"cls-77"},a.createElement("polygon",{className:"cls-6",points:"58.25 54.32 58.25 76.74 38.83 87.95 38.83 65.53 58.25 54.32"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"38.83 65.53 38.83 87.95 19.42 76.74 19.42 54.32 38.83 65.53"}),a.createElement("g",{className:"cls-78"},a.createElement("polygon",{className:"cls-8",points:"38.83 65.53 38.83 87.95 19.42 76.74 19.42 54.32 38.83 65.53"}))))),tz=a.createElement("polygon",{className:"cls-9",points:"19.42 54.32 38.83 43.11 58.25 54.32 38.83 65.53 19.42 54.32"}),nz=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"97.08 31.9 116.5 43.11 116.5 65.53 97.08 54.32 97.08 31.9"}),a.createElement("g",{className:"cls-79"},a.createElement("polygon",{className:"cls-1",points:"97.08 31.9 116.5 43.11 116.5 65.53 97.08 54.32 97.08 31.9"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"116.5 43.11 116.5 65.53 97.08 76.74 97.08 54.32 116.5 43.11"}),a.createElement("g",{className:"cls-80"},a.createElement("polygon",{className:"cls-6",points:"116.5 43.11 116.5 65.53 97.08 76.74 97.08 54.32 116.5 43.11"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"97.08 54.32 97.08 76.74 77.66 65.53 77.66 43.11 97.08 54.32"}),a.createElement("g",{className:"cls-81"},a.createElement("polygon",{className:"cls-8",points:"97.08 54.32 97.08 76.74 77.66 65.53 77.66 43.11 97.08 54.32"}))))),az=a.createElement("polygon",{className:"cls-9",points:"77.66 43.11 97.08 31.9 116.5 43.11 97.08 54.32 77.66 43.11"}),rz=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 43.11 97.08 54.32 97.08 76.74 77.66 65.53 77.66 43.11"}),a.createElement("g",{className:"cls-82"},a.createElement("polygon",{className:"cls-1",points:"77.66 43.11 97.08 54.32 97.08 76.74 77.66 65.53 77.66 43.11"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"97.08 54.32 97.08 76.74 77.66 87.95 77.66 65.53 97.08 54.32"}),a.createElement("g",{className:"cls-83"},a.createElement("polygon",{className:"cls-6",points:"97.08 54.32 97.08 76.74 77.66 87.95 77.66 65.53 97.08 54.32"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 65.53 77.66 87.95 58.25 76.74 58.25 54.32 77.66 65.53"}),a.createElement("g",{className:"cls-84"},a.createElement("polygon",{className:"cls-8",points:"77.66 65.53 77.66 87.95 58.25 76.74 58.25 54.32 77.66 65.53"}))))),iz=a.createElement("polygon",{className:"cls-9",points:"58.25 54.32 77.66 43.11 97.08 54.32 77.66 65.53 58.25 54.32"}),oz=a.createElement("g",{className:"cls-2"},a.createElement("g",{className:"cls-3"},a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 0 77.66 11.21 77.66 33.63 58.25 22.42 58.25 0"}),a.createElement("g",{className:"cls-85"},a.createElement("polygon",{className:"cls-1",points:"58.25 0 77.66 11.21 77.66 33.63 58.25 22.42 58.25 0"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"77.66 11.21 77.66 33.63 58.25 44.84 58.25 22.42 77.66 11.21"}),a.createElement("g",{className:"cls-86"},a.createElement("polygon",{className:"cls-87",points:"77.66 11.21 77.66 33.63 58.25 44.84 58.25 22.42 77.66 11.21"}))),a.createElement("g",{className:"cls-3"},a.createElement("polygon",{className:"cls-1",points:"58.25 22.42 58.25 44.84 38.83 33.63 38.83 11.21 58.25 22.42"}),a.createElement("g",{className:"cls-88"},a.createElement("polygon",{className:"cls-89",points:"58.25 22.42 58.25 44.84 38.83 33.63 38.83 11.21 58.25 22.42"}))))),lz=a.createElement("polygon",{className:"cls-90",points:"38.83 11.21 58.25 0 77.66 11.21 58.25 22.42 38.83 11.21"});function cz(e,t){var n=e.title,r=e.titleId,i=iW(e,["title","titleId"]);return a.createElement("svg",rW({id:"Layer_1","data-name":"Layer 1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 116.5 144",ref:t,"aria-labelledby":r},i),n?a.createElement("title",{id:r},n):null,oW,lW,cW,sW,dW,uW,mW,hW,pW,bW,fW,jW,gW,OW,xW,vW,yW,wW,CW,kW,EW,NW,SW,IW,LW,PW,FW,DW,TW,RW,BW,AW,MW,WW,zW,qW,$W,HW,VW,UW,GW,XW,_W,ZW,KW,QW,YW,JW,ez,tz,nz,az,rz,iz,oz,lz)}var sz,dz,uz,mz,hz,pz,bz,fz,jz,gz,Oz,xz,vz,yz=a.forwardRef(cz),wz=(n.p,Object(f.a)({logo:{maxHeight:150,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}})),Cz=function(e){var t=e.onContinue,n=wz();return Object(qe.jsxs)("div",{className:n.modalContent,children:[Object(qe.jsx)(yz,{className:n.logo}),Object(qe.jsx)(Ue,{className:n.title,children:"Custom information request"}),Object(qe.jsx)(Ke,{className:n.text,children:"A custom information request allows you to have an extra option to ask specific information about your customers when adding a trigger that isn't an option on the default requirements list."}),Object(qe.jsx)(Ke,{children:"Note that adding a custom information request isn't the same as adding triggers. You will still need to add a trigger with the new requirement to get this information from your customers."}),Object(qe.jsx)(An,{className:n.button,onClick:t,children:"Get started"})]})},kz=Object(f.a)({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"}}),Ez=function(e){return e.text&&e.text.length},Nz=function(e,t){var n,a="choiceList"===e.inputType,r=a?t?A.a(["listChoices"])(e):T.a((function(e){return e.text}))(null!==(n=M.a(Ez)(e.listChoices))&&void 0!==n?n:[]):[],i="length"===e.constraintType,o=i?e.inputLength:"",l={name:e.requirementName,screen1:{text:e.screen1Text,title:e.screen1Title},screen2:{title:e.screen2Title,text:e.screen2Text},input:{type:e.inputType,constraintType:e.constraintType}};return a&&(l=mM.a(["input","choiceList"],r,l)),i&&(l=mM.a(["input","numDigits"],o,l)),e.inputLabel1&&(l=mM.a(["input","label1"],e.inputLabel1,l)),e.inputLabel2&&(l=mM.a(["input","label2"],e.inputLabel2,l)),t&&(l=mM.a(["id"],e.id,l)),l},Sz=function(e,t){return D.a(t)?e:t},Iz=function(e){var t=e.onClose,n=(e.error,e.toBeEdited),r=e.onSave,i=e.hasError,o=e.existingRequirements,c=kz(),d=!D.a(n),u=Object(a.useState)(d?1:0),m=Object(l.a)(u,2),h=m[0],p=m[1],b=d?M.a((function(e){return e.id!==n.id}),o):o,f=function(e,t){switch(e){case 1:return{schema:TM(t),Component:BM};case 2:return{schema:AM,Component:WM};case 3:return{schema:PM,Component:DM};case 4:return{schema:zM,Component:$M};case 5:return{schema:nW,Component:aW};default:return{schema:{},Component:function(){return Object(qe.jsx)("h1",{children:"Default component step"})}}}}(h,b),j=5===h,g=function(e,t){var n="numerical"===e.inputType||"choiceList"===e.inputType;return d&&2===h?n?p(4):r(Nz(e,d),d):d&&4===h?r(Nz(e,d),d):3===h?p(n?h+1:h+2):j?r(Nz(e,d),d):p(h+1)},O=d?function(e){var t=e.customRequest;return{id:e.id,requirementName:t.name,screen1Title:t.screen1.title,screen1Text:t.screen1.text,screen2Title:t.screen2.title,screen2Text:t.screen2.text,inputType:t.input.type,inputLabel1:t.input.label1,inputLabel2:t.input.label2,listChoices:t.input.choiceList,constraintType:t.input.constraintType,inputLength:t.input.numDigits}}(n):{},x=d?"Editing custom requirement":"New custom requirement";return Object(qe.jsxs)(Kh,{title:h>0?x:"",handleClose:t,width:520,height:620,open:!0,children:[h>0&&Object(qe.jsx)(bp,{className:c.stepper,steps:5,currentStep:h}),0===h&&!d&&Object(qe.jsx)(Cz,{onContinue:g}),h>0&&Object(qe.jsx)(mn.e,{validateOnBlur:!1,validateOnChange:!1,enableReinitialize:!0,onSubmit:g,initialValues:hM.a(Sz,Object(s.a)(Object(s.a)(Object(s.a)(Object(s.a)(Object(s.a)({},RM),MM),qM),FM),tW),O),validationSchema:f.schema,children:function(e){var t,n=e.errors;return Object(qe.jsxs)(mn.d,{className:c.form,id:"custom-requirement-form",children:[Object(qe.jsx)(f.Component,{}),Object(qe.jsxs)("div",{className:c.submit,children:[(i||!Wa.a(n))&&Object(qe.jsx)(il,{children:null!==(t=op.a(yd.a(n)))&&void 0!==t?t:"Failed to save"}),Object(qe.jsx)(An,{className:c.button,type:"submit",children:j?"Save":"Next"})]})]})}})]})},Lz=Object(f.a)({m0:{margin:0},mb10:{marginBottom:10},centerItems:{display:"flex",flexDirection:"column",alignItems:"center",height:"50%",justifyContent:"center"},alignWithTitleSection:{marginTop:-47,display:"flex"}}),Pz={numerical:"Numerical",text:"Text",choiceList:"Choice list"},Fz={date:"Date",none:"None",email:"Email",length:"Length",selectOne:"Select one",selectMultiple:"Select multiple",spaceSeparation:"Space separation"},Dz=x()(sz||(sz=Object(c.a)(["\n query getData {\n config\n }\n"]))),Tz=x()(dz||(dz=Object(c.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),Rz=x()(uz||(uz=Object(c.a)(["\n mutation insertCustomInfoRequest($customRequest: CustomRequestInput!) {\n insertCustomInfoRequest(customRequest: $customRequest) {\n id\n }\n }\n"]))),Bz=x()(mz||(mz=Object(c.a)(["\n mutation editCustomInfoRequest(\n $id: ID!\n $customRequest: CustomRequestInput!\n ) {\n editCustomInfoRequest(id: $id, customRequest: $customRequest) {\n id\n }\n }\n"]))),Az=x()(hz||(hz=Object(c.a)(["\n mutation removeCustomInfoRequest($id: ID!) {\n removeCustomInfoRequest(id: $id) {\n id\n }\n }\n"]))),Mz=function(e){var t,n=e.showWizard,r=e.toggleWizard,i=e.data,o=Lz(),c=Object(a.useState)(),d=Object(l.a)(c,2),m=d[0],h=d[1],p=Object(a.useState)(),b=Object(l.a)(p,2),f=b[0],j=b[1],g=Object(a.useState)(!1),O=Object(l.a)(g,2),x=O[0],v=O[1],y=Object(a.useState)(!1),w=Object(l.a)(y,2),C=w[0],k=w[1],E=Object(u.c)(Dz),N=E.data,S=E.loading,L=Object(u.b)(Tz,{refetchQueries:function(){return["getData"]},onError:function(){return k(!0)}}),P=Object(l.a)(L,1)[0],F=Object(u.b)(Rz,{onError:function(){console.log("Error while adding custom info request"),k(!0)},onCompleted:function(){k(!1),r()},refetchQueries:function(){return["customInfoRequests"]}}),D=Object(l.a)(F,1)[0],T=Object(u.b)(Bz,{onError:function(){console.log("Error while editing custom info request"),k(!0)},onCompleted:function(){k(!1),j(null),r()},refetchQueries:function(){return["getData","customInfoRequests"]}}),R=Object(l.a)(T,1)[0],B=Object(u.b)(Az,{onError:function(){console.log("Error while removing custom info request"),k(!0)},onCompleted:function(){v(!1),k(!1)},refetchQueries:function(){return["getData","customInfoRequests"]}}),M=Object(l.a)(B,1)[0],W=null!==(t=A.a(["config"])(N))&&void 0!==t?t:[],z=function(e,t){return t?R({variables:{id:e.id,customRequest:lm.a(["id"])(e)}}):D({variables:{customRequest:Object(s.a)({},e)}})},q=Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(Ke,{noMargin:!0,children:"Deleting this item will result in the triggers using it to be removed, together with the advanced trigger overrides you defined for this item."}),Object(qe.jsxs)(Ke,{noMargin:!0,children:["This action is ",Object(qe.jsx)("b",{children:"permanent"}),"."]})]});return!S&&Object(qe.jsxs)(qe.Fragment,{children:[i.length>0&&Object(qe.jsx)(Ay,{emptyText:"No custom info requests so far",elements:[{header:"Requirement name",width:300,textAlign:"left",size:"sm",view:function(e){return e.customRequest.name}},{header:"Data entry type",width:300,textAlign:"left",size:"sm",view:function(e){return Pz[e.customRequest.input.type]}},{header:"Constraints",width:300,textAlign:"left",size:"sm",view:function(e){return Fz[e.customRequest.input.constraintType]}},{header:"Edit",width:100,textAlign:"center",size:"sm",view:function(e){return Object(qe.jsx)(ta,{onClick:function(){return j(e),r()},children:Object(qe.jsx)(Ph,{})})}},{header:"Delete",width:100,textAlign:"center",size:"sm",view:function(e){return Object(qe.jsx)(ta,{onClick:function(){return h(e.id),v(!0)},children:Object(qe.jsx)(Oh,{})})}}],data:i,Details:uM,expandable:!0,rowSize:"sm"}),!i.length&&Object(qe.jsxs)("div",{className:o.centerItems,children:[Object(qe.jsx)(Qe,{className:I()(o.m0,o.mb10),children:"It seems you haven't added any custom information requests yet."}),Object(qe.jsxs)(Je,{className:I()(o.m0,o.mb10),children:["Please read our"," ",Object(qe.jsx)("a",{href:"https://support.lamassu.is/hc/en-us/sections/115000817232-Compliance",children:Object(qe.jsx)(oa,{children:"Support Article"})})," ","on Compliance before adding new information requests."]}),Object(qe.jsx)(An,{onClick:function(){return r()},children:"Add custom information request"})]}),n&&Object(qe.jsx)(Iz,{hasError:C,onClose:function(){j(null),k(!1),r()},toBeEdited:f,onSave:function(){return z.apply(void 0,arguments)},existingRequirements:i}),Object(qe.jsx)(_m,{errorMessage:C?"Failed to delete":"",open:x,onDismissed:function(){v(!1),k(!1)},item:"custom information request",extraMessage:q,onConfirmed:function(){var e;M({variables:{id:e=m}}).then((function(){var t,n=null!==(t=W&&ds(os)(W))&&void 0!==t?t:[],a={overrides:dm.a((function(t){return t.requirement===e}),n.overrides)},r=us(os)(a);P({variables:{config:r}})}))}})]})},Wz={switchLabel:{margin:6,width:24},tableRadioGroup:{flexDirection:"row",justifyContent:"space-between"},tableRadioLabel:{marginRight:0},tableWidth:{width:918}},zz=n(1110),qz=Object(f.a)({radioLabel:{height:40,padding:[[0,10]]},radio:{padding:4,margin:4},radioGroup:{flexDirection:"row"},error:{color:he},specialLabel:{height:40,padding:0},specialGrid:{display:"grid",gridTemplateColumns:[[182,162,181]]},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},dropdownField:{marginTop:16,minWidth:155}}),$z=xn.h().required(),Hz=xn.f().shape({threshold:xn.e().nullable().transform(Ur).label("Invalid threshold"),thresholdDays:xn.e().transform(Ur).nullable().label("Invalid threshold days")}),Vz=xn.f().shape({requirement:xn.h().required(),suspensionDays:xn.e().transform(Ur).nullable()}),Uz=xn.f().shape({triggerType:$z,requirement:Vz,threshold:Hz}).test((function(e,t){var n=e.threshold,a=e.triggerType;if(!a||!{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}}[a](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"}}[a](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"})})),Gz=xn.f().shape({triggerType:xn.h("The trigger type must be a string").required("The trigger type is required"),threshold:xn.f({threshold:xn.e().transform(Ur).nullable(),thresholdDays:xn.e().transform(Ur).nullable()})}).test((function(e,t){var n=e.threshold,a=e.triggerType;if(a&&(!a||!{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}}[a](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"}}[a](n)})})),Xz=[{display:"Transaction amount",code:"txAmount"},{display:"Transaction volume",code:"txVolume"},{display:"Transaction velocity",code:"txVelocity"},{display:"Consecutive days",code:"consecutiveDays"}],_z=function(e){var t,n,a,r,i,o,l=Object.assign({},e),c=qz(),s=Object(mn.f)(),d=s.errors,u=s.touched,m=s.values,h=s.setTouched,p=s.handleChange,b=Object(z.a)({},c.error,d.triggerType&&u.triggerType),f=fl.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===(a=m.threshold)||void 0===a?void 0:a.threshold)<0),y=!!d.threshold&&!!(null===(r=u.threshold)||void 0===r?void 0:r.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)({},c.error,w);return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(nl.a,{display:"flex",alignItems:"center",children:Object(qe.jsx)(_e,{className:I()(b),children:"Choose trigger type"})}),Object(qe.jsx)(mn.b,{component:ci,name:"triggerType",options:Xz,labelClassName:c.radioLabel,radioClassName:c.radio,className:c.radioGroup,onChange:function(e){p(e),h({threshold:!1,thresholdDays:!1})}}),Object(qe.jsxs)("div",{className:c.thresholdWrapper,children:[(j||g||O||x)&&Object(qe.jsx)(_e,{className:I()(C,c.thresholdTitle),children:"Threshold"}),Object(qe.jsxs)("div",{className:c.thresholdContentWrapper,children:[j&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(mn.b,{className:c.thresholdField,component:li,size:"lg",name:"threshold.threshold",error:v}),Object(qe.jsx)(Qe,{className:I()(c.description),children:l.currency})]}),g&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(mn.b,{className:c.thresholdField,component:li,size:"lg",name:"threshold.threshold",error:v}),Object(qe.jsx)(Qe,{className:I()(c.description),children:"transactions"})]}),O&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(Qe,{className:I()(b,c.space,c.description),children:"in"}),Object(qe.jsx)(mn.b,{className:c.thresholdField,component:li,size:"lg",name:"threshold.thresholdDays",error:y}),Object(qe.jsx)(Qe,{className:I()(c.description),children:"days"})]}),x&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(mn.b,{className:c.thresholdField,component:li,size:"lg",name:"threshold.thresholdDays",error:y}),Object(qe.jsx)(Qe,{className:I()(c.description),children:"consecutive days"})]})]})]})]})},Zz=xn.f().shape({requirement:xn.f({requirement:xn.h().required(),suspensionDays:xn.e().when("requirement",{is:function(e){return"suspend"===e},then:xn.e().nullable().transform(Ur),otherwise:xn.e().nullable().transform((function(){return null}))}),customInfoRequestId:xn.h().when("requirement",{is:function(e){return"custom"===e},then:xn.h(),otherwise:xn.h().nullable().transform((function(){return""}))})}).required()}).test((function(e,t){var n=e.requirement,a=function(e,t){switch(t){case"suspend":return e.requirement!==t||e.suspensionDays>0;case"custom":return e.requirement!==t||!D.a(e.customInfoRequestId);default:return!0}};return n&&!a(n,"suspend")?t.createError({path:"requirement",message:"Suspension days must be greater than 0"}):n&&!a(n,"custom")?t.createError({path:"requirement",message:"You must select an item"}):void 0})),Kz=[{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"}],Qz=function(e,t,n){var a,r,i;return!!e.requirement&&!!(null===(a=t.requirement)||void 0===a?void 0:a.suspensionDays)&&(!(null===(r=n.requirement)||void 0===r?void 0:r.suspensionDays)||(null===(i=n.requirement)||void 0===i?void 0:i.suspensionDays)<0)},Yz=function(e,t,n){var a,r,i;return!!e.requirement&&!!(null===(a=t.requirement)||void 0===a?void 0:a.customInfoRequestId)&&(!(null===(r=n.requirement)||void 0===r?void 0:r.customInfoRequestId)||!D.a(null===(i=n.requirement)||void 0===i?void 0:i.customInfoRequestId))},Jz=function(e){var t,n,a=e.customInfoRequests,r=qz(),i=Object(mn.f)(),o=i.touched,l=i.errors,c=i.values,s=i.handleChange,d=i.setTouched,u="suspend"===(null===c||void 0===c||null===(t=c.requirement)||void 0===t?void 0:t.requirement),m="custom"===(null===c||void 0===c||null===(n=c.requirement)||void 0===n?void 0:n.requirement),h=(null===a||void 0===a?void 0:a.length)>0?[].concat(Kz,[{display:"Custom information requirement",code:"custom"}]):[].concat(Kz),p=Object(z.a)({},r.error,!!l.requirement&&!u&&!m||u&&Qz(l,o,c)||m&&Yz(l,o,c));return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(nl.a,{display:"flex",alignItems:"center",children:Object(qe.jsx)(_e,{className:I()(p),children:"Choose a requirement"})}),Object(qe.jsx)(mn.b,{component:ci,name:"requirement.requirement",options:h,labelClassName:r.specialLabel,radioClassName:r.radio,className:I()(r.radioGroup,r.specialGrid),onChange:function(e){s(e),d({suspensionDays:!1})}}),u&&Object(qe.jsx)(mn.b,{className:r.thresholdField,component:li,label:"Days",size:"lg",name:"requirement.suspensionDays",error:Qz(l,o,c)}),m&&Object(qe.jsx)("div",{children:Object(qe.jsx)(mn.b,{className:r.dropdownField,component:oi,label:"Available requests",name:"requirement.customInfoRequestId",options:a.map((function(e){return{value:e.id,display:e.customRequest.name}}))})})]})},eq=function(e){return{schema:Zz,options:Kz,Component:Jz,props:{customInfoRequests:e},hasRequirementError:Qz,hasCustomRequirementError:Yz,initialValues:{requirement:{requirement:"",suspensionDays:"",customInfoRequestId:""}}}},tq=function(e,t,n){return function(a){return e?P.a(R.a(t),Aa.a(W.a(null!==n&&void 0!==n?n:"code",a)))(e):""}},nq=function(e){return function(t){return t.id===e}},aq=function(e){var t,n,a,r=e.customInfoRequests,i=Object(mn.f)().values,o=qz(),l=null===i||void 0===i||null===(t=i.requirement)||void 0===t?void 0:t.requirement,c=null!==(n=A.a(["requirement","customInfoRequestId"])(i))&&void 0!==n?n:"",s="suspend"===l,d=c?null!==(a=A.a(["customRequest","name"])(Aa.a(nq(c))(r)))&&void 0!==a?a:"":tq(Kz,"display")(l);return Object(qe.jsxs)(nl.a,{display:"flex",alignItems:"baseline",children:["".concat(d," ").concat(s?"for":""),s&&Object(qe.jsx)(mn.b,{bold:!0,className:o.suspensionDays,name:"requirement.suspensionDays",component:li,textAlign:"center"}),s&&"days"]})},rq=function(e){var t,n=e.requirement,a=e.suspensionDays,r=e.customInfoRequestId,i=e.customInfoRequests,o=qz(),l="custom"===n?null!==(t=A.a(["customRequest","name"])(Aa.a(nq(r))(i)))&&void 0!==t?t:"":tq(Kz,"display")(n),c="suspend"===n;return Object(qe.jsxs)(nl.a,{display:"flex",alignItems:"baseline",children:["".concat(l," ").concat(c?"for":""),c&&Object(qe.jsx)(Ye,{className:o.space,noMargin:!0,children:a}),c&&"days"]})},iq=function(e){var t,n,a,r=e.config,i=e.currency,o=e.isEdit,l=qz(),c=(t={},Object(z.a)(t,l.input,!0),Object(z.a)(t,l.limitedInput,"txVelocity"===(null===r||void 0===r?void 0:r.triggerType)),Object(z.a)(t,l.daysInput,"consecutiveDays"===(null===r||void 0===r?void 0:r.triggerType)),t),s=null===r||void 0===r||null===(n=r.threshold)||void 0===n?void 0:n.threshold,d=null===r||void 0===r||null===(a=r.threshold)||void 0===a?void 0:a.thresholdDays,u=o?Object(qe.jsx)(mn.b,{bold:!0,className:I()(c),name:"threshold.threshold",component:li,textAlign:"right"}):Object(qe.jsx)(Ye,{noMargin:!0,children:s}),m=o?Object(qe.jsx)(mn.b,{bold:!0,className:I()(c),name:"threshold.thresholdDays",component:li,textAlign:"right"}):Object(qe.jsx)(Ye,{noMargin:!0,children:d});switch(null===r||void 0===r?void 0:r.triggerType){case"txAmount":return Object(qe.jsxs)(nl.a,{display:"flex",alignItems:"baseline",justifyContent:"right",children:[u,Object(qe.jsx)(rt,{noMargin:!0,className:l.lastSpace,children:i})]});case"txVolume":return Object(qe.jsxs)(nl.a,{display:"flex",alignItems:"baseline",justifyContent:"right",children:[u,Object(qe.jsx)(rt,{noMargin:!0,className:l.lastSpace,children:i}),Object(qe.jsx)(at,{noMargin:!0,className:l.space,children:"in"}),m,Object(qe.jsx)(at,{noMargin:!0,className:l.lastSpace,children:"days"})]});case"txVelocity":return Object(qe.jsxs)(nl.a,{display:"flex",alignItems:"baseline",justifyContent:"right",children:[u,Object(qe.jsx)(at,{className:l.space,noMargin:!0,children:"transactions in"}),m,Object(qe.jsx)(at,{className:l.lastSpace,noMargin:!0,children:"days"})]});case"consecutiveDays":return Object(qe.jsxs)(nl.a,{display:"flex",alignItems:"baseline",justifyContent:"right",children:[m,Object(qe.jsx)(at,{className:l.lastSpace,noMargin:!0,children:"days"})]});default:return""}},oq=Object(a.memo)((function(e){var t=e.currency,n=Object(mn.f)().values;return Object(qe.jsx)(iq,{isEdit:!0,config:n,currency:t})})),lq=function(e){var t=e.config,n=e.currency;return Object(qe.jsx)(iq,{config:t,currency:n})},cq=function(e,t,n){return[{name:"triggerType",size:"sm",width:230,input:function(e){var t=e.field.value;return Object(qe.jsx)(qe.Fragment,{children:tq(Xz,"display")(t)})},view:tq(Xz,"display"),inputProps:{options:Xz,valueProp:"code",labelProp:"display",optionsLimit:null}},{name:"requirement",size:"sm",width:230,bypassField:!0,input:function(){return Object(qe.jsx)(aq,{customInfoRequests:n})},view:function(e){return Object(qe.jsx)(rq,Object(s.a)(Object(s.a)({},e),{},{customInfoRequests:n}))}},{name:"threshold",size:"sm",width:284,textAlign:"right",input:function(){return Object(qe.jsx)(oq,{currency:e})},view:function(t,n){return Object(qe.jsx)(lq,{config:n,currency:e})}}]},sq=T.a(R.a("code"))(Xz),dq=[zz.a((function(e,t){return sq.indexOf(e.triggerType)<sq.indexOf(t.triggerType)}))],uq=function(e){return T.a((function(e){var t=e.requirement,n=e.threshold,a=Object(q.a)(e,["requirement","threshold"]);return Object(s.a)({requirement:t.requirement,suspensionDays:t.suspensionDays,threshold:n.threshold,thresholdDays:n.thresholdDays,customInfoRequestId:t.customInfoRequestId},a)}))(e)},mq={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:$},blankSpace:{padding:[[0,30]],margin:[[0,4,0,2]],borderBottom:"1px solid ".concat($),display:"inline-block"}},hq=Object(f.a)(mq),pq=function(e,t,n){switch(e){case 1:return function(e){return{schema:Gz,options:Xz,Component:_z,props:{currency:e},initialValues:{triggerType:"",threshold:{threshold:"",thresholdDays:""}}}}(t);case 2:return eq(n);default:return a.Fragment}},bq=function(e,t,n,a){switch(e){case 1:return Object(qe.jsxs)(qe.Fragment,{children:["If the user ",jq(t,n,a)]});case 2:return Object(qe.jsxs)(qe.Fragment,{children:["the user will be ",gq(t,a),"."]});default:return Object(qe.jsx)(qe.Fragment,{})}},fq=function(e,t){var n=Object(qe.jsx)("span",{className:t.blankSpace});return Wa.a(e)||D.a(e)?n:e},jq=function(e,t,n){switch(e.triggerType){case"txAmount":return Object(qe.jsxs)(qe.Fragment,{children:["makes a single transaction over"," ",fq(e.threshold.threshold,n)," ",t]});case"txVolume":return Object(qe.jsxs)(qe.Fragment,{children:["makes more than ",fq(e.threshold.threshold,n)," ",t," worth of transactions within"," ",fq(e.threshold.thresholdDays,n)," ",qm(e.threshold.thresholdDays,"day","days")]});case"txVelocity":return Object(qe.jsxs)(qe.Fragment,{children:["makes more than ",fq(e.threshold.threshold,n)," ",qm(e.threshold.threshold,"transaction","transactions")," ","in ",fq(e.threshold.thresholdDays,n)," ",qm(e.threshold.thresholdDays,"day","days")]});case"consecutiveDays":return Object(qe.jsxs)(qe.Fragment,{children:["at least one transaction every day for"," ",fq(e.threshold.thresholdDays,n)," ",qm(e.threshold.thresholdDays,"day","days")]});default:return Object(qe.jsx)(qe.Fragment,{})}},gq=function(e,t){var n;switch(null===(n=e.requirement)||void 0===n?void 0:n.requirement){case"sms":return Object(qe.jsx)(qe.Fragment,{children:"asked to enter code provided through SMS verification"});case"idCardPhoto":return Object(qe.jsx)(qe.Fragment,{children:"asked to scan a ID with photo"});case"idCardData":return Object(qe.jsx)(qe.Fragment,{children:"asked to scan a ID"});case"facephoto":return Object(qe.jsx)(qe.Fragment,{children:"asked to have a photo taken"});case"usSsn":return Object(qe.jsx)(qe.Fragment,{children:"asked to input his social security number"});case"sanctions":return Object(qe.jsx)(qe.Fragment,{children:"matched against the OFAC sanctions list"});case"superuser":return Object(qe.jsx)(qe.Fragment,{});case"suspend":return Object(qe.jsxs)(qe.Fragment,{children:["suspended for"," ",fq(e.requirement.suspensionDays,t)," ",qm(e.requirement.suspensionDays,"day","days")]});case"block":return Object(qe.jsx)(qe.Fragment,{children:"blocked"});case"custom":return Object(qe.jsx)(qe.Fragment,{children:"asked to fulfill a custom requirement"});default:return fq(null,t)}},Oq=function(e){var t=e.step,n=e.config,a=void 0===n?{}:n,i=e.liveValues,o=void 0===i?{}:i,l=e.currency,c=hq(),s=Du.a(1,t).map((function(e,t){return Object(qe.jsx)(r.a.Fragment,{children:bq(e,a,l,c)},t)})),d=bq(t,o,l,c),u=2===t;return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(Ze,{className:c.infoTitle,children:"Trigger overview so far"}),Object(qe.jsxs)(Je,{noMargin:!0,children:[s,1!==t&&", ",Object(qe.jsx)("span",{className:c.infoCurrentText,children:d}),!u&&"..."]})]})},xq=function(e){var t=e.setValues,n=Object(mn.f)().values;return Object(a.useEffect)((function(){t&&n&&t(n)}),[t,n]),null},vq=function(e){var t=e.onClose,n=e.save,r=e.error,i=e.currency,o=e.customInfoRequests,c=hq(),d=Object(a.useState)({}),u=Object(l.a)(d,2),m=u[0],h=u[1],p=Object(a.useState)({step:1}),b=Object(l.a)(p,2),f=b[0],j=f.step,g=f.config,O=b[1],x=2===j,v=pq(j,i,o),y=function(){var e=Object(Al.a)(Bl.a.mark((function e(t){var a;return Bl.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=Gn.a(g,v.schema.cast(t)),!x){e.next=3;break}return e.abrupt("return",n(a));case 3:O({step:j+1,config:a});case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),w=function(e,t,n){var a,r,i,o,l,c,s,d,u=null===n||void 0===n?void 0:n.triggerType,m=fl.a(u),h="suspend"===(null===n||void 0===n||null===(a=n.requirement)||void 0===a?void 0:a.requirement),p="custom"===(null===n||void 0===n||null===(r=n.requirement)||void 0===r?void 0:r.requirement),b=eq().hasRequirementError(e,t,n),f=eq().hasCustomRequirementError(e,t,n),j=!!e.threshold&&!!(null===(i=t.threshold)||void 0===i?void 0:i.threshold)&&!m(["consecutiveDays"])&&(!(null===(o=n.threshold)||void 0===o?void 0:o.threshold)||(null===(l=n.threshold)||void 0===l?void 0:l.threshold)<0),g=!!e.threshold&&!!(null===(c=t.threshold)||void 0===c?void 0:c.thresholdDays)&&!m(["txAmount"])&&(!(null===(s=n.threshold)||void 0===s?void 0:s.thresholdDays)||(null===(d=n.threshold)||void 0===d?void 0:d.thresholdDays)<0);return m(["txAmount","txVolume","txVelocity"])&&j||m(["txVolume","txVelocity","consecutiveDays"])&&g?e.threshold:h&&b||p&&f?e.requirement:void 0};return Object(qe.jsx)(qe.Fragment,{children:Object(qe.jsxs)(Kh,{title:"New compliance trigger",handleClose:t,width:560,height:520,infoPanel:Object(qe.jsx)(Oq,{currency:i,step:j,config:g,liveValues:m}),infoPanelHeight:172,open:!0,children:[Object(qe.jsx)(bp,{className:c.stepper,steps:2,currentStep:j}),Object(qe.jsx)(mn.e,{validateOnBlur:!1,validateOnChange:!0,enableReinitialize:!0,onSubmit:y,initialValues:v.initialValues,validationSchema:v.schema,children:function(e){var t=e.errors,n=e.touched,a=e.values;return Object(qe.jsxs)(mn.d,{className:c.form,children:[Object(qe.jsx)(xq,{setValues:h}),Object(qe.jsx)(v.Component,Object(s.a)({},v.props)),Object(qe.jsxs)("div",{className:c.submit,children:[r&&Object(qe.jsx)(il,{children:"Failed to save"}),w(t,n,a)&&Object(qe.jsx)(il,{children:w(t,n,a)}),Object(qe.jsx)(An,{className:c.button,type:"submit",children:x?"Finish":"Next"})]})]})}})]})})},yq=Object(f.a)(Wz),wq=x()(pz||(pz=Object(c.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),Cq=function(e){var t=e.triggers,n=e.showWizard,r=e.config,i=e.toggleWizard,o=e.addNewTriger,c=e.customInfoRequests,d=A.a(["fiatCurrency"])(ds(ts)(r)),m=(yq(),Object(a.useState)(null)),h=Object(l.a)(m,2),p=h[0],b=h[1],f=Object(u.b)(wq,{onCompleted:function(){return i(!0)},refetchQueries:function(){return["getData"]},onError:function(e){return b(e)}}),j=Object(l.a)(f,1)[0];return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(Gh,{data:t,name:"triggers",enableEdit:!0,sortBy:dq,groupBy:"triggerType",enableDelete:!0,error:null===p||void 0===p?void 0:p.message,save:function(e){return b(null),j({variables:{config:{triggers:uq(e.triggers)}}})},validationSchema:Uz,elements:cq(d,0,c)}),n&&Object(qe.jsx)(vq,{currency:d,error:null===p||void 0===p?void 0:p.message,save:function(e){var n=hl.a([Object(s.a)({id:Object(mm.a)(),direction:"both"},e)])(t);return j({variables:{config:{triggers:uq(n)}}})},onClose:function(){return i(!0)},customInfoRequests:c}),Wa.a(t)&&Object(qe.jsxs)(nl.a,{display:"flex",alignItems:"center",flexDirection:"column",mt:15,children:[Object(qe.jsx)(Ge,{children:"It seems there are no active compliance triggers on your network"}),Object(qe.jsx)(An,{onClick:o,children:"Add first trigger"})]})]})},kq=function(e){var t=T.a((function(e){return{display:e.customRequest.name,code:e.id}}))(e);return hl.a([{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"}],t)},Eq=function(e,t){return R.a("display",Aa.a(W.a("code",e))(kq(t)))},Nq=xn.f().shape({expirationTime:xn.h().label("Expiration time").required(),automation:xn.h().label("Automation").matches(/(Manual|Automatic)/).required()}),Sq=function(e,t){return xn.f().shape({id:xn.h().label("Requirement").required().test({test:function(){var n=this.parent,a=n.id,r=n.requirement,i=M.a((function(e){return e.id!==a}),e);return!Aa.a(W.a("requirement",r))(i)||this.createError({message:"Requirement '".concat(Eq(r,t),"' already overridden")})}}),expirationTime:xn.h().label("Expiration time").required(),automation:xn.h().label("Automation").matches(/(Manual|Automatic)/).required()})},Iq=function(e){return[{name:"requirement",header:"Requirement",width:196,size:"sm",view:tq(kq(e),"display"),input:Br,inputProps:{options:kq(e),labelProp:"display",valueProp:"code"}},{name:"expirationTime",header:"Expiration time",width:196,size:"sm",editable:!1},{name:"automation",header:"Automation",width:196,size:"sm",input:Br,inputProps:{options:[{code:"Automatic",display:"Automatic"},{code:"Manual",display:"Manual"}],labelProp:"display",valueProp:"code"}}]},Lq=[{expirationTime:"Forever",automation:"Automatic"}],Pq={requirement:"",expirationTime:"Forever",automation:"Automatic"},Fq=x()(bz||(bz=Object(c.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),Dq=x()(fz||(fz=Object(c.a)(["\n query getData {\n config\n }\n"]))),Tq=x()(jz||(jz=Object(c.a)(["\n query customInfoRequests {\n customInfoRequests {\n id\n customRequest\n enabled\n }\n }\n"]))),Rq=Object(a.memo)((function(){var e,t,n=os,r=Object(a.useState)(null),i=Object(l.a)(r,2),o=i[0],c=i[1],s=Object(a.useState)(!1),d=Object(l.a)(s,2),m=d[0],h=d[1],p=Object(a.useState)(!1),b=Object(l.a)(p,2),f=b[0],j=b[1],g=Object(u.c)(Dq),O=g.data,x=g.loading,v=Object(u.c)(Tq),y=v.data,w=v.loading,C=null!==(e=A.a(["customInfoRequests"])(y))&&void 0!==e?e:[],k=M.a(W.a("enabled",!0))(C),E=x||w,N=Object(u.b)(Fq,{refetchQueries:function(){return["getData"]},onError:function(e){return c(e)}}),S=Object(l.a)(N,1)[0],I=(null===O||void 0===O?void 0:O.config)&&ds(n)(null===O||void 0===O?void 0:O.config),L=I&&!Wa.a(I)?I:Lq,P=null!==(t=null===I||void 0===I?void 0:I.overrides)&&void 0!==t?t:[];return!E&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(AO,{children:Object(qe.jsx)(Gh,{title:"Default requirement settings",error:null===o||void 0===o?void 0:o.message,titleLg:!0,name:"triggersConfig",enableEdit:!0,initialValues:L,save:function(e){var t=us(n)(e.triggersConfig[0]);return c(null),S({variables:{config:t}})},validationSchema:Nq,data:Fw.a(L),elements:[{name:"expirationTime",header:"Expiration time",width:196,size:"sm",editable:!1},{name:"automation",header:"Automation",width:196,size:"sm",input:Br,inputProps:{options:[{code:"Automatic",display:"Automatic"},{code:"Manual",display:"Manual"}],labelProp:"display",valueProp:"code"}}],setEditing:function(e,t){return h(t)},forceDisable:f})}),Object(qe.jsx)(AO,{children:Object(qe.jsx)(Gh,{error:null===o||void 0===o?void 0:o.message,title:"Overrides",titleLg:!0,name:"overrides",enableDelete:!0,enableEdit:!0,enableCreate:!0,initialValues:Pq,save:function(e){var t=us(n)(e);return c(null),S({variables:{config:t}})},validationSchema:Sq(P,k),data:P,elements:Iq(k),setEditing:function(e,t){return j(t)},forceDisable:m})})]})})),Bq=Object(f.a)(Wz),Aq=x()(gz||(gz=Object(c.a)(["\n mutation Save($accounts: JSONObject) {\n saveAccounts(accounts: $accounts)\n }\n"]))),Mq=x()(Oz||(Oz=Object(c.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),Wq=x()(xz||(xz=Object(c.a)(["\n query getData {\n config\n accounts\n }\n"]))),zq=x()(vz||(vz=Object(c.a)(["\n query customInfoRequests {\n customInfoRequests {\n id\n customRequest\n enabled\n }\n }\n"]))),qq=function(){var e,t,n,r,i,o=Bq(),c=Object(a.useState)(!1),d=Object(l.a)(c,2),m=d[0],h=d[1],p=Object(u.c)(Wq),b=p.data,f=p.loading,j=Object(u.c)(zq),g=j.data,O=j.loading,x=Object(a.useState)(null),v=Object(l.a)(x,2),y=v[0],w=v[1],C=Object(a.useState)(!1),k=Object(l.a)(C,2),E=k[0],N=k[1],S=Object(a.useState)(!1),L=Object(l.a)(S,2),P=L[0],F=L[1],D=null!==(e=A.a(["customInfoRequests"])(g))&&void 0!==e?e:[],R=M.a(W.a("enabled",!0))(D),B=function(e,t){return T.a((function(e){var t=e.requirement,n=e.suspensionDays,a=e.threshold,r=e.thresholdDays,i=e.customInfoRequestId,o=Object(q.a)(e,["requirement","suspensionDays","threshold","thresholdDays","customInfoRequestId"]);return Object(s.a)({requirement:{requirement:t,suspensionDays:n,customInfoRequestId:i},threshold:{threshold:a,thresholdDays:r}},o)}))(e)}(null!==(t=null===b||void 0===b||null===(n=b.config)||void 0===n?void 0:n.triggers)&&void 0!==t?t:[]),$=(null===b||void 0===b?void 0:b.config)&&ds("compliance")(b.config),H=null!==(r=null===$||void 0===$?void 0:$.rejectAddressReuse)&&void 0!==r&&r,V=Object(u.b)(Mq,{onCompleted:function(){return h(!1)},refetchQueries:function(){return["getData"]},onError:function(e){return w(e)}}),U=Object(l.a)(V,1)[0],G=Object(u.b)(Aq,{onCompleted:function(){F(!1),K("newTrigger")()},refetchQueries:function(){return["getData"]},onError:function(e){return w(e)}}),X=Object(l.a)(G,1)[0],_=Object(z.a)({},o.tableWidth,"customInfoRequests"===!E),Z=function(e){return e?document.querySelector("#root").classList.add("root-blur"):document.querySelector("#root").classList.remove("root-blur")},K=function(e){return function(t){return m===e||t?(Z(!1),h(null)):(Z(!0),h(e))}},Q=f||O,Y=function(){ul.a("twilio",(null===b||void 0===b?void 0:b.accounts)||{})?K("newTrigger")():F(!0)};return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsxs)(cl,{title:"Compliance Triggers",buttons:[{text:"Advanced settings",icon:sM,inverseIcon:aM,forceDisable:!("advancedSettings"===E),toggle:function(e){N(!!e&&"advancedSettings")}},{text:"Custom info requests",icon:QA,inverseIcon:UA,forceDisable:!("customInfoRequests"===E),toggle:function(e){N(!!e&&"customInfoRequests")}}],className:I()(_),children:[!E&&Object(qe.jsx)(nl.a,{display:"flex",alignItems:"center",children:Object(qe.jsxs)(nl.a,{display:"flex",alignItems:"center",justifyContent:"flex-end",mr:"-5px",children:[Object(qe.jsx)(Ke,{children:"Reject reused addresses"}),Object(qe.jsx)(Lr,{checked:H,onChange:function(e){!function(e){var t=us("compliance")(e);U({variables:{config:t}})}({rejectAddressReuse:e.target.checked})},value:H}),Object(qe.jsx)(rt,{className:o.switchLabel,children:H?"On":"Off"}),Object(qe.jsx)(Np,{width:304,children:Object(qe.jsx)(Ke,{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"})})]})}),"customInfoRequests"===E&&!Wa.a(R)&&Object(qe.jsx)(nl.a,{display:"flex",justifyContent:"flex-end",children:Object(qe.jsx)(oa,{color:"primary",onClick:function(){return K("newCustomRequest")()},children:"+ Add new custom info request"})}),!Q&&!E&&!Wa.a(B)&&Object(qe.jsx)(nl.a,{display:"flex",justifyContent:"flex-end",children:Object(qe.jsx)(oa,{color:"primary",onClick:Y,children:"+ Add new trigger"})})]}),!Q&&"customInfoRequests"===E&&Object(qe.jsx)(Mz,{data:R,showWizard:"newCustomRequest"===m,toggleWizard:K("newCustomRequest")}),!Q&&!E&&Object(qe.jsx)(Cq,{triggers:B,showWizard:"newTrigger"===m,config:null!==(i=null===b||void 0===b?void 0:b.config)&&void 0!==i?i:{},toggleWizard:K("newTrigger"),addNewTriger:Y,customInfoRequests:R}),!Q&&"advancedSettings"===E&&Object(qe.jsx)(Rq,{error:y,save:U,data:b}),P&&Object(qe.jsxs)(Kh,{title:"Configure SMS",width:478,handleClose:function(){return F(!1)},open:!0,children:[Object(qe.jsx)(Ke,{children:"In order for compliance triggers to work, you'll first need to configure Twilio."}),Object(qe.jsx)(Da,{link:"https://support.lamassu.is/hc/en-us/articles/115001203951-Twilio-for-SMS",label:"Lamassu Support Article"}),Object(qe.jsx)(ax,{save:function(e){return w(null),X({variables:{accounts:{twilio:e}}})},elements:ox.elements,validationSchema:ox.getValidationSchema})]})]})};function $q(){return($q=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Hq(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Vq=a.createElement("g",{id:"icon/button/key/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"Group",transform:"translate(0.500000, 0.500000)",stroke:"#FFFFFF"},a.createElement("circle",{id:"Oval",cx:2.75,cy:8.25,r:2.75}),a.createElement("line",{x1:5.04166667,y1:5.95833333,x2:11,y2:0,id:"Path-13",strokeLinecap:"round",strokeLinejoin:"round"}),a.createElement("line",{x1:8.25,y1:3.66666667,x2:10.5416667,y2:1.375,id:"Path-13-Copy",strokeWidth:2,strokeLinejoin:"round"})));function Uq(e,t){var n=e.title,r=e.titleId,i=Hq(e,["title","titleId"]);return a.createElement("svg",$q({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":r},i),void 0===n?a.createElement("title",{id:r},"icon/button/key/white"):n?a.createElement("title",{id:r},n):null,Vq)}var Gq=a.forwardRef(Uq);n.p;function Xq(){return(Xq=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function _q(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var Zq=a.createElement("g",{id:"icon/button/key/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"Group",transform:"translate(0.500000, 0.500000)",stroke:"#1B2559"},a.createElement("circle",{id:"Oval",cx:2.75,cy:8.25,r:2.75}),a.createElement("line",{x1:5.04166667,y1:5.95833333,x2:11,y2:0,id:"Path-13",strokeLinecap:"round",strokeLinejoin:"round"}),a.createElement("line",{x1:8.25,y1:3.66666667,x2:10.5416667,y2:1.375,id:"Path-13-Copy",strokeWidth:2,strokeLinejoin:"round"})));function Kq(e,t){var n=e.title,r=e.titleId,i=_q(e,["title","titleId"]);return a.createElement("svg",Xq({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":r},i),void 0===n?a.createElement("title",{id:r},"icon/button/key/zodiac"):n?a.createElement("title",{id:r},n):null,Zq)}var Qq=a.forwardRef(Kq);n.p;function Yq(){return(Yq=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Jq(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var e$=a.createElement("g",{id:"icon/button/lock/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"Lock-Icon-White",transform:"translate(0.500000, 0.500000)"},a.createElement("path",{d:"M7.98058644,2.48058644 C7.98058644,1.11059638 6.86999006,0 5.5,0 C4.13000994,0 3.01941356,1.11059638 3.01941356,2.48058644 C3.01941356,3.39391315 3.01941356,4.09482878 3.01941356,4.58333333 L7.98058644,4.58333333 C7.98058644,4.09482878 7.98058644,3.39391315 7.98058644,2.48058644 Z",id:"Lock",stroke:"#FFFFFF",strokeLinejoin:"round"}),a.createElement("rect",{id:"Body",stroke:"#FFFFFF",strokeLinejoin:"round",x:0,y:4.58333333,width:11,height:6.41666667}),a.createElement("circle",{id:"Key-Hole",fill:"#FFFFFF",cx:5.5,cy:7.33333333,r:1})));function t$(e,t){var n=e.title,r=e.titleId,i=Jq(e,["title","titleId"]);return a.createElement("svg",Yq({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":r},i),void 0===n?a.createElement("title",{id:r},"icon/button/lock/white"):n?a.createElement("title",{id:r},n):null,e$)}var n$=a.forwardRef(t$);n.p;function a$(){return(a$=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function r$(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var i$=a.createElement("g",{id:"icon/button/lock/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},a.createElement("g",{id:"Lock-Icon-Zodiac",transform:"translate(0.500000, 0.500000)"},a.createElement("path",{d:"M7.98058644,2.48058644 C7.98058644,1.11059638 6.86999006,0 5.5,0 C4.13000994,0 3.01941356,1.11059638 3.01941356,2.48058644 C3.01941356,3.39391315 3.01941356,4.09482878 3.01941356,4.58333333 L7.98058644,4.58333333 C7.98058644,4.09482878 7.98058644,3.39391315 7.98058644,2.48058644 Z",id:"Lock",stroke:"#1B2559",strokeLinejoin:"round"}),a.createElement("rect",{id:"Body",stroke:"#1B2559",strokeLinejoin:"round",x:0,y:4.58333333,width:11,height:6.41666667}),a.createElement("circle",{id:"Key-Hole",fill:"#1B2559",cx:5.5,cy:7.33333333,r:1})));function o$(e,t){var n=e.title,r=e.titleId,i=r$(e,["title","titleId"]);return a.createElement("svg",a$({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":r},i),void 0===n?a.createElement("title",{id:r},"icon/button/lock/zodiac"):n?a.createElement("title",{id:r},n):null,i$)}var l$=a.forwardRef(o$);n.p;function c$(){return(c$=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function s$(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var d$=a.createElement("g",{id:"icon/button/user-role/white",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinejoin:"round"},a.createElement("g",{id:"User-Role-Icon-White",transform:"translate(2.500000, 0.500000)",stroke:"#FFFFFF"},a.createElement("path",{d:"M5.50008791,6.84274776 L5.5,11 L3.66666667,9.35927189 L1.83333333,11 L1.83223109,6.84216075 C2.37179795,7.15453375 2.99835187,7.33333333 3.66666667,7.33333333 C4.33456272,7.33333333 4.96075021,7.15475774 5.50008791,6.84274776 Z",id:"Bottom"}),a.createElement("circle",{id:"Top",cx:3.66666667,cy:3.66666667,r:3.66666667})));function u$(e,t){var n=e.title,r=e.titleId,i=s$(e,["title","titleId"]);return a.createElement("svg",c$({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":r},i),void 0===n?a.createElement("title",{id:r},"icon/button/user-role/white"):n?a.createElement("title",{id:r},n):null,d$)}var m$=a.forwardRef(u$);n.p;function h$(){return(h$=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function p$(e,t){if(null==e)return{};var n,a,r=function(e,t){if(null==e)return{};var n,a,r={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var b$=a.createElement("g",{id:"icon/button/user-role/zodiac",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",strokeLinejoin:"round"},a.createElement("g",{id:"User-Role-Icon-Zodiac",transform:"translate(2.500000, 0.500000)",stroke:"#1B2559"},a.createElement("path",{d:"M5.50008791,6.84274776 L5.5,11 L3.66666667,9.35927189 L1.83333333,11 L1.83223109,6.84216075 C2.37179795,7.15453375 2.99835187,7.33333333 3.66666667,7.33333333 C4.33456272,7.33333333 4.96075021,7.15475774 5.50008791,6.84274776 Z",id:"Bottom"}),a.createElement("circle",{id:"Top",cx:3.66666667,cy:3.66666667,r:3.66666667})));function f$(e,t){var n=e.title,r=e.titleId,i=p$(e,["title","titleId"]);return a.createElement("svg",h$({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":r},i),void 0===n?a.createElement("title",{id:r},"icon/button/user-role/zodiac"):n?a.createElement("title",{id:r},n):null,b$)}var j$,g$,O$,x$,v$,y$,w$,C$,k$,E$,N$,S$,I$,L$,P$,F$,D$,T$,R$,B$,A$,M$=a.forwardRef(f$),W$=(n.p,{footer:{display:"flex",flexDirection:"row",margin:[["auto",0,24,0]]},modalTitle:{marginTop:-5,color:J,fontFamily:je},modalLabel1:{marginTop:20},modalLabel2:{marginTop:40},inputLabel:{color:J,fontFamily:je,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:re,fontFamily:je,marginLeft:10},info:{fontFamily:ge,textAlign:"justify"},addressWrapper:{backgroundColor:re,marginTop:8,height:35},address:{margin:"0px ".concat(16,"px 0px ").concat(16,"px"),paddingRight:-15},errorMessage:{fontFamily:ge,color:he},codeContainer:{marginTop:15,marginBottom:15},form:{display:"flex",flexDirection:"column",height:"100%"},submit:{margin:[["auto",0,0,"auto"]]},error:{color:he},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"},loginWrapper:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},username:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",width:"100%"},roleSwitch:{marginLeft:15},actionButtonWrapper:{display:"flex",gap:12},enterButton:{display:"none"}}),z$=Object(f.a)(W$),q$=x()(j$||(j$=Object(c.a)(["\n query confirm2FA($code: String!) {\n confirm2FA(code: $code)\n }\n"]))),$$=function(e){var t=e.showModal,n=e.handleClose,r=e.setConfirmation,i=z$(),o=Object(a.useState)(""),c=Object(l.a)(o,2),s=c[0],d=c[1],m=Object(a.useState)(!1),h=Object(l.a)(m,2),p=h[0],b=h[1],f=Object(u.a)(q$,{onCompleted:function(e){return e.confirm2FA?(r(s),d(""),void b(!1)):b(!0)}}),j=Object(l.a)(f,2),g=j[0],O=j[1].error,x=function(){return O?"Internal server error":6!==s.length&&p?"The code should have 6 characters!":p?"Code is invalid. Please try again.":null},v=function(){6===s.length?g({variables:{code:s}}):b(!0)};return t&&Object(qe.jsxs)(Kh,{closeOnBackdropClick:!0,width:500,height:350,handleClose:n,open:!0,children:[Object(qe.jsx)(Ye,{className:i.modalTitle,children:"Confirm action"}),Object(qe.jsx)(Ke,{className:i.info,children:"To make changes on this user, please confirm this action by entering your two-factor authentication code below."}),Object(qe.jsx)(mn.e,{onSubmit:function(){},initialValues:{},children:Object(qe.jsxs)(mn.d,{children:[Object(qe.jsx)(hr,{name:"2fa",value:s,onChange:function(e){d(e),b(!1)},numInputs:6,error:p,containerStyle:i.codeContainer,shouldAutoFocus:!0}),Object(qe.jsx)("button",{onClick:v,className:i.enterButton})]})}),x()&&Object(qe.jsx)(Ke,{className:i.errorMessage,children:x()}),Object(qe.jsx)("div",{className:i.footer,children:Object(qe.jsx)(An,{className:i.submit,onClick:v,children:"Confirm"})})]})},H$=x()(g$||(g$=Object(c.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"]))),V$=Object(f.a)(W$),U$=function(e){var t=e.state,n=e.dispatch,r=e.user,i=e.requiresConfirmation,o=V$(),c=Object(u.b)(H$,{onCompleted:function(){return j()},refetchQueries:function(){return["users"]}}),s=Object(l.a)(c,2),d=s[0],m=s[1].error,h=Object(a.useState)(null),p=Object(l.a)(h,2),b=p[0],f=p[1],j=function(){f(null),n({type:"close",payload:"showRoleModal"})};return t.showRoleModal&&i&&!b&&Object(qe.jsx)($$,{showModal:t.showRoleModal,handleClose:j,setConfirmation:f})||t.showRoleModal&&Object(qe.jsxs)(Kh,{closeOnBackdropClick:!0,width:450,height:250,handleClose:j,open:!0,children:[Object(qe.jsxs)(Ye,{className:o.modalTitle,children:["Change ",r.username,"'s role?"]}),Object(qe.jsxs)(Ke,{className:o.info,children:["You are about to alter ",r.username,"'s role. This will change this user's permission to access certain resources."]}),Object(qe.jsx)(Ke,{className:o.info,children:"Do you wish to proceed?"}),Object(qe.jsxs)("div",{className:o.footer,children:[m&&Object(qe.jsx)(il,{children:m}),Object(qe.jsx)(An,{className:o.submit,onClick:function(){d({variables:{confirmationCode:b,id:r.id,newRole:"superuser"===r.role?"user":"superuser"}})},children:"Confirm"})]})]})},G$="https://".concat(window.location.hostname),X$=function(e){return"".concat(G$).concat(e)},_$=Object(f.a)(W$),Z$=x()(O$||(O$=Object(c.a)(["\n mutation createRegisterToken($username: String!, $role: String!) {\n createRegisterToken(username: $username, role: $role) {\n token\n expire\n }\n }\n"]))),K$=xn.f().shape({username:xn.h().email("Username field should be in an email format!").required("Username field is required!"),role:xn.h().required("Role field is required!")}),Q$={username:"",role:""},Y$=[{code:"user",display:"Regular user"},{code:"superuser",display:"Superuser"}],J$=function(e,t,n){return e&&t?n?"Internal server error":e.username&&t.username?e.username:null:null},eH=function(e){var t=e.state,n=e.dispatch,r=_$(),i=Object(a.useState)(""),o=Object(l.a)(i,2),c=o[0],s=o[1],d=Object(a.useState)(null),m=Object(l.a)(d,2),h=m[0],p=m[1],b=function(){p(null),n({type:"close",payload:"showCreateUserModal"})},f=Object(u.b)(Z$,{onCompleted:function(e){var t=e.createRegisterToken,n="t=".concat(t.token);p(X$("/register?".concat(n)))}}),j=Object(l.a)(f,2),g=j[0],O=j[1].error;return Object(qe.jsxs)(qe.Fragment,{children:[t.showCreateUserModal&&!h&&Object(qe.jsx)(Kh,{closeOnBackdropClick:!0,width:600,height:400,handleClose:b,open:!0,children:Object(qe.jsx)(mn.e,{validationSchema:K$,initialValues:Q$,onSubmit:function(e){s(e.username),g({variables:{username:e.username,role:e.role}})},children:function(e){var t,n,a=e.errors,i=e.touched;return Object(qe.jsxs)(mn.d,{id:"register-user-form",className:r.form,children:[Object(qe.jsx)(Ue,{className:r.modalTitle,children:"Create new user"}),Object(qe.jsx)(mn.b,{component:di,name:"username",width:338,autoFocus:!0,label:"User login"}),Object(qe.jsx)(Xe,{className:I()((t=a,n=i,Object(z.a)({},r.error,t.role&&n.role)),r.modalLabel2),children:"Role"}),Object(qe.jsx)(mn.b,{component:ci,name:"role",labelClassName:r.radioLabel,className:r.radioGroup,options:Y$}),Object(qe.jsxs)("div",{className:r.footer,children:[J$(a,i,O)&&Object(qe.jsx)(il,{children:J$(a,i,O)}),Object(qe.jsx)(An,{type:"submit",form:"register-user-form",className:r.submit,children:"Finish"})]})]})}})}),t.showCreateUserModal&&h&&Object(qe.jsxs)(Kh,{closeOnBackdropClick:!0,width:500,height:200,handleClose:b,open:!0,children:[Object(qe.jsxs)(Ye,{className:r.modalTitle,children:["Creating ",c,"..."]}),Object(qe.jsxs)(Ke,{className:r.info,children:["Safely share this link with ",c," to finish the registration process."]}),Object(qe.jsx)("div",{className:r.addressWrapper,children:Object(qe.jsx)(et,{className:r.address,children:Object(qe.jsx)("strong",{children:Object(qe.jsx)(If,{className:r.link,buttonClassname:r.copyToClipboard,wrapperClassname:r.linkWrapper,children:h})})})})]})]})},tH=x()(x$||(x$=Object(c.a)(["\n mutation enableUser($confirmationCode: String, $id: ID!) {\n enableUser(confirmationCode: $confirmationCode, id: $id) {\n id\n }\n }\n"]))),nH=x()(v$||(v$=Object(c.a)(["\n mutation disableUser($confirmationCode: String, $id: ID!) {\n disableUser(confirmationCode: $confirmationCode, id: $id) {\n id\n }\n }\n"]))),aH=Object(f.a)(W$),rH=function(e){var t=e.state,n=e.dispatch,r=e.user,i=e.requiresConfirmation,o=aH(),c=Object(u.b)(tH,{onCompleted:function(){return y()},refetchQueries:function(){return["users"]}}),s=Object(l.a)(c,2),d=s[0],m=s[1].error,h=Object(u.b)(nH,{onCompleted:function(){return y()},refetchQueries:function(){return["users"]}}),p=Object(l.a)(h,2),b=p[0],f=p[1].error,j=Object(a.useState)(null),g=Object(l.a)(j,2),O=g[0],x=g[1],v=function(){(null===r||void 0===r?void 0:r.enabled)?b({variables:{confirmationCode:O,id:r.id}}):d({variables:{confirmationCode:O,id:r.id}})},y=function(){x(null),n({type:"close",payload:"showEnableUserModal"})};return t.showEnableUserModal&&i&&!O&&Object(qe.jsx)($$,{showModal:t.showEnableUserModal,handleClose:y,setConfirmation:x})||t.showEnableUserModal&&Object(qe.jsxs)(Kh,{closeOnBackdropClick:!0,width:450,height:275,handleClose:y,open:!0,children:[!r.enabled&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsxs)(Ye,{className:o.modalTitle,children:["Enable ",r.username,"?"]}),Object(qe.jsxs)(Ke,{className:o.info,children:["You are about to enable ",r.username," into the system, activating previous eligible sessions and grant permissions to access the system."]}),Object(qe.jsx)(Ke,{className:o.info,children:"Do you wish to proceed?"})]}),r.enabled&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsxs)(Ye,{className:o.modalTitle,children:["Disable ",r.username,"?"]}),Object(qe.jsxs)(Ke,{className:o.info,children:["You are about to disable ",r.username," from the system, deactivating previous eligible sessions and removing permissions to access the system."]}),Object(qe.jsx)(Ke,{className:o.info,children:"Do you wish to proceed?"})]}),Object(qe.jsxs)("div",{className:o.footer,children:[f&&Object(qe.jsx)(il,{children:f}),m&&Object(qe.jsx)(il,{children:m}),Object(qe.jsx)(An,{className:o.submit,onClick:function(){return v()},children:"Confirm"})]})]})},iH=Object(f.a)(W$),oH=function(e){var t=e.state,n=e.dispatch,a=iH(),r=function(){n({type:"close",payload:"showFIDOModal"})};return Object(qe.jsxs)(Kh,{closeOnBackdropClick:!0,width:450,height:275,handleClose:r,open:t.showFIDOModal,children:[Object(qe.jsx)(Ye,{className:a.modalTitle,children:"About FIDO authentication"}),Object(qe.jsx)(Ke,{className:a.info,children:"This feature is only available for websites with configured domains, and we detected that a domain is not configured at the moment."}),Object(qe.jsx)(Ke,{children:"Make sure that a domain is configured for this website and try again later."}),Object(qe.jsx)("div",{className:a.footer,children:Object(qe.jsx)(An,{className:a.submit,onClick:function(){return r()},children:"Confirm"})})]})},lH=x()(y$||(y$=Object(c.a)(["\n mutation createReset2FAToken($confirmationCode: String, $userID: ID!) {\n createReset2FAToken(confirmationCode: $confirmationCode, userID: $userID) {\n token\n user_id\n expire\n }\n }\n"]))),cH=Object(f.a)(W$),sH=function(e){var t=e.state,n=e.dispatch,r=e.user,i=e.requiresConfirmation,o=cH(),c=Object(a.useState)(""),s=Object(l.a)(c,2),d=s[0],m=s[1],h=Object(u.b)(lH,{onCompleted:function(e){var t=e.createReset2FAToken;m(X$("/reset2fa?t=".concat(t.token)))}}),p=Object(l.a)(h,2),b=p[0],f=p[1],j=f.loading,g=f.error,O=Object(a.useState)(null),x=Object(l.a)(O,2),v=x[0],y=x[1];Object(a.useEffect)((function(){t.showReset2FAModal&&(v||!i)&&b({variables:{confirmationCode:v,userID:null===r||void 0===r?void 0:r.id}})}),[v,b,i,t.showReset2FAModal,null===r||void 0===r?void 0:r.id]);var w=function(){y(null),n({type:"close",payload:"showReset2FAModal"})};return t.showReset2FAModal&&i&&!v&&Object(qe.jsx)($$,{showModal:t.showReset2FAModal,handleClose:w,setConfirmation:y})||t.showReset2FAModal&&(v||!i)&&!j&&Object(qe.jsxs)(Kh,{closeOnBackdropClick:!0,width:500,height:200,handleClose:w,open:!0,children:[Object(qe.jsxs)(Ye,{className:o.modalTitle,children:["Reset 2FA for ",r.username]}),Object(qe.jsxs)(Ke,{className:o.info,children:["Safely share this link with ",r.username," for a two-factor authentication reset."]}),!g&&Object(qe.jsx)("div",{className:o.addressWrapper,children:Object(qe.jsx)(et,{className:o.address,children:Object(qe.jsx)("strong",{children:Object(qe.jsx)(If,{className:o.link,buttonClassname:o.copyToClipboard,wrapperClassname:o.linkWrapper,children:d})})})}),g&&Object(qe.jsx)(il,{children:g})]})},dH=x()(w$||(w$=Object(c.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"]))),uH=Object(f.a)(W$),mH=function(e){var t=e.state,n=e.dispatch,r=e.user,i=e.requiresConfirmation,o=uH(),c=Object(a.useState)(""),s=Object(l.a)(c,2),d=s[0],m=s[1],h=Object(u.b)(dH,{onCompleted:function(e){var t=e.createResetPasswordToken;m(X$("/resetpassword?t=".concat(t.token)))}}),p=Object(l.a)(h,2),b=p[0],f=p[1],j=f.loading,g=f.error,O=Object(a.useState)(null),x=Object(l.a)(O,2),v=x[0],y=x[1];Object(a.useEffect)((function(){t.showResetPasswordModal&&(v||!i)&&b({variables:{confirmationCode:v,userID:null===r||void 0===r?void 0:r.id}})}),[v,b,i,t.showResetPasswordModal,null===r||void 0===r?void 0:r.id]);var w=function(){y(null),n({type:"close",payload:"showResetPasswordModal"})};return t.showResetPasswordModal&&i&&!v&&Object(qe.jsx)($$,{showModal:t.showResetPasswordModal,handleClose:w,setConfirmation:y})||t.showResetPasswordModal&&(v||!i)&&!j&&Object(qe.jsxs)(Kh,{closeOnBackdropClick:!0,width:500,height:180,handleClose:w,open:!0,children:[Object(qe.jsxs)(Ye,{className:o.modalTitle,children:["Reset password for ",r.username]}),Object(qe.jsxs)(Ke,{className:o.info,children:["Safely share this link with ",r.username," for a password reset."]}),!g&&Object(qe.jsx)("div",{className:o.addressWrapper,children:Object(qe.jsx)(et,{className:o.address,children:Object(qe.jsx)("strong",{children:Object(qe.jsx)(If,{className:o.link,buttonClassname:o.copyToClipboard,wrapperClassname:o.linkWrapper,children:d})})})}),g&&Object(qe.jsx)(il,{children:g})]})},hH=Object(f.a)(W$),pH=x()(C$||(C$=Object(c.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"]))),bH=x()(k$||(k$=Object(c.a)(["\n query generateAttestationOptions($userID: ID!, $domain: String!) {\n generateAttestationOptions(userID: $userID, domain: $domain)\n }\n"]))),fH=x()(E$||(E$=Object(c.a)(["\n mutation validateAttestation(\n $userID: ID!\n $attestationResponse: JSONObject!\n $domain: String!\n ) {\n validateAttestation(\n userID: $userID\n attestationResponse: $attestationResponse\n domain: $domain\n )\n }\n"]))),jH={showCreateUserModal:!1,showResetPasswordModal:!1,showReset2FAModal:!1,showRoleModal:!1,showEnableUserModal:!1},gH=function(e,t){var n=t.type,a=t.payload;switch(n){case"close":return jH;case"open":return Object(s.a)(Object(s.a)({},jH),{},Object(z.a)({},a,!0));default:return jH}},OH={user:"Regular",superuser:"Superuser"},xH=function(){var e=hH(),t=Object(a.useContext)(k).userData,n=Object(u.c)(pH).data,r=Object(a.useReducer)(gH,jH),i=Object(l.a)(r,2),o=i[0],c=i[1],s=Object(a.useState)(null),d=Object(l.a)(s,2),m=d[0],h=d[1],p=Object(u.b)(fH,{onCompleted:function(e){}}),b=Object(l.a)(p,1)[0],f=Object(u.a)(bH,{onCompleted:function(e){var t=e.generateAttestationOptions;return Object(Il.b)(t).then((function(e){b({variables:{userID:m.id,attestationResponse:e,domain:window.location.hostname}})}))}}),j=Object(l.a)(f,1)[0],g=[{header:"Login",width:307,textAlign:"left",size:"sm",view:function(n){return t.id===n.id?Object(qe.jsxs)("div",{className:e.loginWrapper,children:[Object(qe.jsx)("span",{className:e.username,children:n.username}),Object(qe.jsx)(Ar.a,{size:"small",label:"You",className:e.chip})]}):Object(qe.jsx)("span",{className:e.username,children:n.username})}},{header:"Role",width:160,textAlign:"left",size:"sm",view:function(n){return Object(qe.jsxs)("div",{className:e.loginWrapper,children:[Object(qe.jsx)("span",{children:OH[n.role]}),Object(qe.jsx)(Lr,{className:e.roleSwitch,disabled:t.id===n.id,checked:"superuser"===n.role,onClick:function(){h(n),c({type:"open",payload:"showRoleModal"})},value:"superuser"===n.role})]})}},{header:"Actions",width:565,textAlign:"left",size:"sm",view:function(t){return Object(qe.jsxs)("div",{className:e.actionButtonWrapper,children:[Object(qe.jsx)(He,{Icon:Qq,InverseIcon:Gq,color:"primary",onClick:function(){h(t),c({type:"open",payload:"showResetPasswordModal"})},children:"Reset password"}),Object(qe.jsx)(He,{Icon:l$,InverseIcon:n$,color:"primary",onClick:function(){h(t),c({type:"open",payload:"showReset2FAModal"})},children:"Reset 2FA"}),Object(qe.jsx)(He,{Icon:M$,InverseIcon:m$,color:"primary",onClick:function(){Jh.test(window.location.hostname)?c({type:"open",payload:"showFIDOModal"}):(h(t),j({variables:{userID:t.id,domain:window.location.hostname}}))},children:"Add FIDO"})]})}},{header:"Enabled",width:100,textAlign:"center",size:"sm",view:function(e){return Object(qe.jsx)(Lr,{disabled:t.id===e.id,checked:e.enabled,onClick:function(){h(e),c({type:"open",payload:"showEnableUserModal"})},value:e.enabled})}}];return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(cl,{title:"User Management"}),Object(qe.jsx)(nl.a,{marginBottom:3,marginTop:-5,className:e.tableWidth,display:"flex",justifyContent:"flex-end",children:Object(qe.jsx)(oa,{color:"primary",onClick:function(){c({type:"open",payload:"showCreateUserModal"})},children:"Add new user"})}),Object(qe.jsx)(Ay,{elements:g,data:A.a(["users"])(n)}),Object(qe.jsx)(eH,{state:o,dispatch:c}),Object(qe.jsx)(mH,{state:o,dispatch:c,user:m,requiresConfirmation:"superuser"===(null===m||void 0===m?void 0:m.role)}),Object(qe.jsx)(sH,{state:o,dispatch:c,user:m,requiresConfirmation:"superuser"===(null===m||void 0===m?void 0:m.role)}),Object(qe.jsx)(U$,{state:o,dispatch:c,user:m,requiresConfirmation:"superuser"===(null===m||void 0===m?void 0:m.role)}),Object(qe.jsx)(rH,{state:o,dispatch:c,user:m,requiresConfirmation:"superuser"===(null===m||void 0===m?void 0:m.role)}),Object(qe.jsx)(oH,{state:o,dispatch:c})]})},vH=x()(N$||(N$=Object(c.a)(["\n mutation Save($config: JSONObject) {\n saveConfig(config: $config)\n }\n"]))),yH=x()(S$||(S$=Object(c.a)(["\n query getData {\n config\n cryptoCurrencies {\n code\n display\n }\n }\n"]))),wH=function(){var e,t,n=Kc,r=Yc,i=Object(u.c)(yH).data,o=Object(a.useState)(!1),c=Object(l.a)(o,2),s=c[0],d=c[1],m=Object(a.useState)(!1),h=Object(l.a)(m,2),p=h[0],b=h[1],f=Object(u.b)(vH,{refetchQueries:function(){return["getData"]}}),j=Object(l.a)(f,2),g=j[0],O=j[1].error,x=null!==(e=null===i||void 0===i?void 0:i.cryptoCurrencies)&&void 0!==e?e:[],v=ds(n)(ds(r)(null===i||void 0===i?void 0:i.config)),y=null!==(t=v.overrides)&&void 0!==t?t:[],w=T.a(R.a("cryptoCurrency"))(y),C=M.a((function(e){return!fl.a(e.code,w)}))(x);return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(AO,{children:Object(qe.jsx)(Gh,{name:"wallets",data:Fw.a(v),error:null===O||void 0===O?void 0:O.message,enableEdit:!0,editWidth:174,save:function(e){var t=us(r)(us(n)(e.wallets[0]));return g({variables:{config:t}})},stripeWhen:function(e){return!CO.isValidSync(e)},inialValues:Fw.a(v),validationSchema:CO,elements:(Ff.utils,[{name:"cryptoUnits",size:"sm",stripe:!0,width:190,input:Br,inputProps:{options:IO,valueProp:"code",labelProp:"display"}},{name:"allowTransactionBatching",header:"Allow BTC Transaction Batching",size:"sm",stripe:!0,width:260,view:function(e,t){return t.allowTransactionBatching?"Yes":"No"},input:ii},{name:"feeMultiplier",header:"BTC Miner's Fee",size:"sm",stripe:!0,width:250,view:NO,input:Br,inputProps:{options:SO,valueProp:"code",labelProp:"display"}}]),setEditing:function(e,t){return d(t)},forceDisable:p})}),Object(qe.jsx)(AO,{children:Object(qe.jsx)(Gh,{error:null===O||void 0===O?void 0:O.message,title:"Overrides",titleLg:!0,name:"overrides",enableDelete:!0,enableEdit:!0,enableCreate:!0,inialValues:EO,save:function(e){var t=us(r)(us(n)(e));return g({variables:{config:t}})},validationSchema:kO,data:null!==y&&void 0!==y?y:[],elements:PO(C,(function(e){var t=P.a(Aa.a(W.a("code",null===e||void 0===e?void 0:e.cryptoCurrency)))(x);return t?[t]:[]}),Ff.utils),disableAdd:!(null===C||void 0===C?void 0:C.length),setEditing:function(e,t){return b(t)},forceDisable:s})})]})},CH=x()(I$||(I$=Object(c.a)(["\n mutation Save($config: JSONObject, $accounts: JSONObject) {\n saveConfig(config: $config)\n saveAccounts(accounts: $accounts)\n }\n"]))),kH=x()(L$||(L$=Object(c.a)(["\n mutation Save($accounts: JSONObject) {\n saveAccounts(accounts: $accounts)\n }\n"]))),EH=x()(P$||(P$=Object(c.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"]))),NH=Object(f.a)({header:{display:"flex",alignItems:"center",justifyContent:"space-between"}}),SH=function(e){var t,n,r,i=e.name,o=NH(),c=Object(a.useState)(null),s=Object(l.a)(c,2),d=s[0],m=s[1],h=Object(a.useState)(null),p=Object(l.a)(h,2),b=p[0],f=p[1],j=Object(a.useState)(!1),g=Object(l.a)(j,2),O=g[0],x=g[1],v=Object(a.useState)(!1),y=Object(l.a)(v,2),w=y[0],C=y[1],k=Object(u.c)(EH).data,E=Object(u.b)(CH,{onCompleted:function(){return x(!1)},refetchQueries:function(){return["getData"]}}),N=Object(l.a)(E,2),S=N[0],I=N[1].error,L=Object(u.b)(kH,{onCompleted:function(){return m(null)},refetchQueries:function(){return["getData"]}}),P=Object(l.a)(L,1)[0],F=function(e,t){var n=us(i)(e);return S({variables:{config:n,accounts:t}})},D=(null===k||void 0===k?void 0:k.config)&&ds("locale")(k.config).fiatCurrency,R=(null===k||void 0===k?void 0:k.config)&&ds(i)(k.config),B=null===k||void 0===k?void 0:k.accountsConfig,M=null!==(t=null===k||void 0===k?void 0:k.cryptoCurrencies)&&void 0!==t?t:[],q=null!==(n=null===k||void 0===k?void 0:k.accounts)&&void 0!==n?n:[];return Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)("div",{className:o.header,children:Object(qe.jsx)(cl,{title:"Wallet Settings",buttons:[{text:"Advanced settings",icon:sM,inverseIcon:aM,toggle:C}]})}),!w&&Object(qe.jsxs)(qe.Fragment,{children:[Object(qe.jsx)(Xh,{name:"test",namespaces:T.a(A.a(["code"]))(M),data:R,error:null===I||void 0===I?void 0:I.message,stripeWhen:function(e){return!wO.isValidSync(e)},enableEdit:!0,shouldOverrideEdit:function(e){var t=ds(e)(R);return!wO.isValidSync(t)},editOverride:x,editWidth:174,save:F,validationSchema:wO,elements:DO(M,B,(function(e,t,n){return t?!q[t]&&$x[t]?(m($x[t]),void f((function(){return function(){return n(t)}}))):void n(t):n(t)}))}),O&&Object(qe.jsx)(AP,{coin:Aa.a(W.a("code",O))(M),onClose:function(){return x(!1)},save:F,error:null===I||void 0===I?void 0:I.message,cryptoCurrencies:M,fiatCurrency:D,userAccounts:null===k||void 0===k||null===(r=k.config)||void 0===r?void 0:r.accounts,accounts:q,accountsConfig:B}),d&&Object(qe.jsx)(Kh,{title:"Edit ".concat(d.name),width:478,handleClose:function(){return m(null)},open:!0,children:Object(qe.jsx)(ax,{save:function(e){return P({variables:{accounts:Object(z.a)({},d.code,e)}}).then((function(e){return b(),f(null),e}))},elements:d.elements,validationSchema:d.validationSchema,value:q[d.code]})})]}),w&&Object(qe.jsx)(wH,{})]})},IH=function(){return[{key:"transactions",label:"Transactions",route:"/transactions",allowedRoles:[Wv,zv],component:WA},{key:"maintenance",label:"Maintenance",route:"/maintenance",allowedRoles:[Wv,zv],get component(){var e=this;return function(){return Object(qe.jsx)(w.b,{to:e.children[0].route})}},children:[{key:"cash_cassettes",label:"Cash Cassettes",route:"/maintenance/cash-cassettes",allowedRoles:[Wv,zv],component:XD},{key:"funding",label:"Funding",route:"/maintenance/funding",allowedRoles:[Wv,zv],component:yL},{key:"logs",label:"Machine Logs",route:"/maintenance/logs",allowedRoles:[Wv,zv],component:bD},{key:"machine-status",label:"Machine Status",route:"/maintenance/machine-status",allowedRoles:[Wv,zv],component:OT},{key:"server-logs",label:"Server",route:"/maintenance/server-logs",allowedRoles:[Wv,zv],component:oA}]},{key:"analytics",label:"Analytics",route:"/analytics",allowedRoles:[Wv,zv],component:Ly},{key:"settings",label:"Settings",route:"/settings",allowedRoles:[Wv,zv],get component(){var e=this;return function(){return Object(qe.jsx)(w.b,{to:e.children[0].route})}},children:[{key:ns,label:"Commissions",route:"/settings/commissions",allowedRoles:[Wv,zv],component:Uw},{key:ts,label:"Locales",route:"/settings/locale",allowedRoles:[Wv,zv],component:$P},{key:Qc,label:"Cash-out",route:"/settings/cash-out",allowedRoles:[Wv,zv],component:dw},{key:es,label:"Notifications",route:"/settings/notifications",allowedRoles:[Wv,zv],component:rR},{key:"services",label:"3rd Party Services",route:"/settings/3rd-party-services",allowedRoles:[Wv,zv],component:bA},{key:Yc,label:"Wallet",route:"/settings/wallet-settings",allowedRoles:[Wv,zv],component:SH},{key:Jc,label:"Operator Info",route:"/settings/operator-info",title:"Operator Information",allowedRoles:[Wv,zv],get component(){var e=this;return function(){var t;return Object(qe.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:[Wv,zv],component:WR},{key:"receipt-printing",label:"Receipt",route:"/settings/operator-info/receipt-printing",allowedRoles:[Wv,zv],component:HR},{key:"sms-notices",label:"SMS notices",route:"/settings/operator-info/sms-notices",allowedRoles:[Wv,zv],component:zB},{key:"coin-atm-radar",label:"Coin ATM Radar",route:"/settings/operator-info/coin-atm-radar",allowedRoles:[Wv,zv],component:FR},{key:"terms-conditions",label:"Terms & Conditions",route:"/settings/operator-info/terms-conditions",allowedRoles:[Wv,zv],component:GB}]}]},{key:"compliance",label:"Compliance",route:"/compliance",allowedRoles:[Wv,zv],get component(){var e=this;return function(){return Object(qe.jsx)(w.b,{to:e.children[0].route})}},children:[{key:"triggers",label:"Triggers",route:"/compliance/triggers",allowedRoles:[Wv,zv],component:qq},{key:"customers",label:"Customers",route:"/compliance/customers",allowedRoles:[Wv,zv],component:oL},{key:"blacklist",label:"Blacklist",route:"/compliance/blacklist",allowedRoles:[Wv,zv],component:_y},{key:"loyalty",label:"Loyalty",route:"/compliance/loyalty",title:"Loyalty Panel",allowedRoles:[Wv,zv],get component(){var e=this;return function(){var t;return Object(qe.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:[Wv,zv],component:eF},{key:"promo-codes",label:"Promo Codes",route:"/compliance/loyalty/codes",allowedRoles:[Wv,zv],component:uF}]},{key:"customer",route:"/compliance/customer/:id",allowedRoles:[Wv,zv],component:pI}]},{key:"system",label:"System",route:"/system",allowedRoles:[zv],get component(){var e=this;return function(){return Object(qe.jsx)(w.b,{to:e.children[0].route})}},children:[{key:"user-management",label:"User Management",route:"/system/user-management",allowedRoles:[zv],component:xH},{key:"session-management",label:"Session Management",route:"/system/session-management",allowedRoles:[zv],component:vA}]}]},LH=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}}},PH=(Object(f.a)(LH),x()(F$||(F$=Object(c.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 assets\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"}}}),FH=(Object(f.a)(PH),x()(D$||(D$=Object(c.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 assets\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"]))),x()(T$||(T$=Object(c.a)(["\n query getData {\n config\n }\n"]))),function(){return{card:{wordWrap:"break-word",boxShadow:"0 0 4px 0 rgba(0, 0, 0, 0.08)",borderRadius:12,padding:24,backgroundColor:K},h4:{marginTop:0},label:{margin:0,color:se},asset:{float:"left"},amount:{float:"right"},row:{backgroundColor:ae,borderBottom:"none"},totalRow:{backgroundColor:re,borderBottom:"none"},leftSide:{margin:[[0,10,20,0]]},rightSide:{margin:[[0,0,0,10]]}}}),DH=(Object(f.a)(FH),x()(R$||(R$=Object(c.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 assets\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}),TH=(Object(Mr.a)({root:DH})(Eu.a),Object(Mr.a)({root:Object(s.a)(Object(s.a)({},DH),{},{backgroundColor:"white"})})(Eu.a),Object(f.a)({wrapper:{flex:1,display:"flex",flexDirection:"column",height:"100%"}})),RH=IH(),BH=T.a(dl.a(ul.a("children"),R.a("children"))),AH=P.a(ml.a,BH)(RH),MH=M.a(ul.a("children"))(AH).concat(M.a(ul.a("children"))(RH)),WH=P.a(ml.a,BH)(AH),zH=hl.a(WH,MH),qH=function(){var e=TH(),t=Object(w.h)(),n=Object(w.i)(),r=Object(a.useContext)(k),i=r.wizardTested,o=r.userData;if(!i&&!fl.a(n.pathname)(["/404","/register","/wizard","/login","/register","/resetpassword","/reset2fa"]))return t.push("/wizard"),null;var l=n.state?p.a:sl.a,c=l===p.a?{direction:jl.a(W.a("route",n.state.prev))(WH)>jl.a(W.a("route",n.pathname))(WH)?"right":"left"}:{timeout:400};return Object(qe.jsxs)(w.e,{children:[Object(qe.jsx)(qv,{exact:!0,path:"/",children:Object(qe.jsx)(w.b,{to:{pathname:"/dashboard"}})}),Object(qe.jsx)(qv,{path:"/dashboard",children:Object(qe.jsx)(l,Object(s.a)(Object(s.a)({className:e.wrapper},c),{},{in:!0,mountOnEnter:!0,unmountOnExit:!0,children:Object(qe.jsx)("div",{className:e.wrapper,children:Object(qe.jsx)(Ju,{})})}))}),Object(qe.jsx)(qv,{path:"/machines",component:Rg}),Object(qe.jsx)(qv,{path:"/wizard",component:Av}),Object(qe.jsx)($v,{path:"/register",component:pc}),Object(qe.jsx)($v,{path:"/login",restricted:!0,component:rc}),Object(qe.jsx)($v,{path:"/resetpassword",component:Nc}),Object(qe.jsx)($v,{path:"/reset2fa",component:xc}),(o?zH.filter((function(e){var t=e.allowedRoles;return L.a(o.role,t)})):[]).map((function(t){var a=t.route,r=t.component,i=t.key;return Object(qe.jsx)(qv,{path:a,children:Object(qe.jsx)(l,Object(s.a)(Object(s.a)({className:e.wrapper},c),{},{in:!!Object(w.g)(n.pathname,{path:a}),mountOnEnter:!0,unmountOnExit:!0,children:Object(qe.jsx)("div",{className:e.wrapper,children:Object(qe.jsx)(qv,{path:a,children:Object(qe.jsx)(r,{name:i})},i)})}))},i)})),Object(qe.jsx)($v,{path:"/404"}),Object(qe.jsx)($v,{path:"*",children:Object(qe.jsx)(w.b,{to:{pathname:"/404"}})})]})},$H="100%",HH={"@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"}]}),{},(B$={"#root":{width:$H,minHeight:$H},".root-notifcenter-open":{overflowY:"auto",position:"absolute",top:0,bottom:0,left:0},".body-notifcenter-open":{overflow:"hidden"},".root-blur":{filter:"blur(1px)",pointerEvents:"none"},html:{height:$H,"@media screen and (max-height: 900px)":{scrollbarGutter:"stable"}},body:{width:be,display:"flex",minHeight:$H,"@media screen and (min-width: 1200px)":{width:"auto"}}},Object(z.a)(B$,'a::-moz-focus-inner,\n \'input[type="submit"]::-moz-focus-inner,\n input[type="button"]::-moz-focus-inner',{border:0}),Object(z.a)(B$,'a::-moz-focus-inner,\n input[type="submit"]::-moz-focus-inner,\n input[type="button"]::-moz-focus-inner',{border:0}),Object(z.a)(B$,"a,\n a:visited,\n a:focus,\n a:active,\n a:hover",{outline:"0 none"}),Object(z.a)(B$,"button::-moz-focus-inner",{border:0}),Object(z.a)(B$,".ReactVirtualized__Grid__innerScrollContainer",{overflow:"inherit !important"}),B$))},VH=n(208),UH=Me.p,GH=Object(VH.a)({typography:{fontFamily:Le,body1:Object(s.a)({},UH)},MuiButtonBase:{disableRipple:!0},palette:{primary:{light:ee,dark:ee,main:ee},secondary:{light:ee,dark:ee,main:ee},background:{default:ae}},overrides:{MuiRadio:{colorSecondary:{color:ee}},MuiAutocomplete:{root:{color:ce},noOptions:{padding:[[6,16]]},option:{'&[data-focus="true"]':{backgroundColor:re}},paper:{color:ce,margin:0},listbox:{padding:0},tag:{'&[data-tag-index="0"]':{marginLeft:0},margin:2,backgroundColor:re,borderRadius:4,height:18}},MuiChip:{label:{paddingLeft:4,paddingRight:4,color:ce,fontSize:Ce}},MuiInput:{root:{color:ce},underline:{"&:before":{borderBottom:[[2,"solid",ce]]}}},MuiInputLabel:{root:{font:"inherit",fontSize:ye,color:se},shrink:{color:ce,transform:"translate(0, 1.7px) scale(0.83)"}},MuiFormLabel:{root:{"&$focused":{color:ce}}},MuiListItem:{root:{"&:nth-of-type(odd)":{backgroundColor:ae}}},MuiToggleButton:{root:{"&$selected":{backgroundColor:G,borderColor:J,borderTopColor:[J,"!important"],"&:hover":{backgroundColor:X}},"&:hover":{backgroundColor:X}}},MuiToggleButtonGroup:{groupedVertical:{borderRadius:8,border:"1px solid",borderColor:G,"&:not(:first-child)":{borderTop:"1px solid",borderTopColor:G,borderTopRightRadius:8,borderTopLeftRadius:8,borderBottomRightRadius:8,borderBottomLeftRadius:8},"&:not(:last-child)":{borderTop:"1px solid",borderTopColor:G,borderTopRightRadius:8,borderTopLeftRadius:8,borderBottomRightRadius:8,borderBottomLeftRadius:8}}}}}),XH=Object(v.c)({plugins:[Object(y.a)()].concat(Object(d.a)(Object(b.a)().plugins))}),_H="100%",ZH="column",KH=Object(f.a)(Object(s.a)(Object(s.a)({},HH),{},{root:{backgroundColor:ae,width:_H,minHeight:_H,display:"flex",flexDirection:ZH},wrapper:{width:be,height:_H,margin:"0 auto",flex:1,display:"flex",flexDirection:ZH},grid:{flex:1,height:"100%"},contentWithSidebar:{flex:1,marginLeft:48,paddingTop:15},contentWithoutSidebar:{width:be}})),QH=x()(A$||(A$=Object(c.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"]))),YH=function(){var e=KH(),t=Object(w.i)(),n=Object(w.h)(),r=Object(a.useContext)(k),i=r.wizardTested,o=r.userData,l=r.setUserData,c=Object(u.c)(QH,{onCompleted:function(e){!o&&(null===e||void 0===e?void 0:e.userData)&&l(e.userData)}}).loading,s=t.pathname,d=function(e){return jn.a((function(t){return t.route===e}))(P.a(ml.a,T.a(R.a("children")),M.a(ul.a("children")))(AH))}(s),m=d?function(e){return Aa.a(W.a("route",pl.a(1,bl.a((function(e){return"/"!==e}),e))))(zH)}(s):{},b="/404"===t.pathname,f=d?e.contentWithSidebar:e.contentWithoutSidebar;return Object(qe.jsxs)("div",{className:e.root,children:[!b&&i&&o&&Object(qe.jsx)(tl,{tree:RH,user:o}),Object(qe.jsxs)("main",{className:e.wrapper,children:[d&&!b&&i&&Object(qe.jsx)(p.a,{direction:"left",in:!0,mountOnEnter:!0,unmountOnExit:!0,children:Object(qe.jsx)("div",{children:Object(qe.jsx)(cl,{title:m.title})})}),Object(qe.jsxs)(h.a,{container:!0,className:e.grid,children:[d&&!b&&i&&Object(qe.jsx)(Ii,{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(qe.jsx)("div",{className:f,children:!c&&Object(qe.jsx)(qH,{})})]})]})]})},JH=function(){var e=Object(a.useState)(!1),t=Object(l.a)(e,2),n=t[0],r=t[1],i=Object(a.useState)(null),o=Object(l.a)(i,2),c=o[0],d=o[1];return Object(qe.jsx)(k.Provider,{value:{wizardTested:n,setWizardTested:r,userData:c,setUserData:d,setRole:function(e){c&&e&&c.role!==e&&d(Object(s.a)(Object(s.a)({},c),{},{role:e}))}},children:Object(qe.jsx)(C.a,{children:Object(qe.jsx)($j,{children:Object(qe.jsx)(j.b,{jss:XH,children:Object(qe.jsxs)(g.a,{theme:GH,children:[Object(qe.jsx)(m.a,{}),Object(qe.jsx)(YH,{})]})})})})})};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(qe.jsx)(r.a.StrictMode,{children:Object(qe.jsx)(JH,{})}),document.getElementById("root"))})),"serviceWorker"in navigator&&navigator.serviceWorker.ready.then((function(e){e.unregister()}))}},[[968,1,2]]]);
//# sourceMappingURL=main.900511f9.chunk.js.map