(this["webpackJsonpgonzo-test-client"]=this["webpackJsonpgonzo-test-client"]||[]).push([[53],{"/AjM":function(e,t,n){},"/rum":function(e,t,n){},"0PSs":function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var a=n("mwIZ"),s=n.n(a),o=n("Z0cm"),r=n.n(o),i=n("q1tI"),l=n.n(i),c=n("17x9"),u=n.n(c),h=(n("/AjM"),n("4XXU"));class p extends l.a.Component{render(){const{className:e,data:t,background:n,color:a,dataKey:o,width:i,height:c,selected:u}=this.props;let p=r()(u)?u:[u],d=[];return t&&t.forEach(e=>{d.push({value:o?s()(e,o):o})}),l.a.createElement(l.a.Fragment,null,l.a.createElement(h.i,{width:i,height:c,className:"fetura-monochart ".concat(a," ").concat(e)},l.a.createElement(h.b,{data:d,className:"".concat(n?"with-background":"")},l.a.createElement(h.a,{isAnimationActive:!1,type:"linear",dataKey:"value",fill:"#dddddd",stroke:0,fillOpacity:1,connectNulls:!0}),p.map(e=>l.a.createElement(h.h,{x:e.selected,stroke:"green",label:{value:e.label,dx:60},isFront:!0})))))}}p.propTypes={color:u.a.oneOf(["primary","secondary","success","info","warning","error",""]),background:u.a.bool,dataKey:u.a.string.isRequired,className:u.a.string,width:u.a.string,height:u.a.string,data:u.a.array.isRequired,selected:u.a.oneOf([u.a.shape({selected:u.a.number,label:u.a.string}),u.a.array]),selectedLabel:u.a.string},p.defaultProps={className:"",data:[],dataKey:"",color:"",background:!1,width:"100%",height:"100%",selected:[]}},"0ajJ":function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var a=n("q1tI"),s=n.n(a),o=n("17x9"),r=n.n(o),i=(n("J1h9"),n("9jj8")),l=n("XzT5");class c extends s.a.Component{constructor(...e){super(...e),this.showGrouped=e=>{let t=[];for(const[n,a]of e)t.push(s.a.createElement("div",{className:"list-separator"},s.a.createElement("h5",null,n))),t=[...t,...a];return t}}static groupByProperty(e,t){const n=new Map;return e.forEach(e=>{const a=t(e),s=n.get(a);s?s.push(e):n.set(a,[e])}),new Map([...n].sort((e,t)=>+(e[0]===l.a.t("grid.rest"))-+(t[0]===l.a.t("grid.rest"))))}render(){const{selectable:e,striped:t,children:n,className:a,style:o,showNumber:r,id:i,useFlexLayout:l,itemRef:u,property:h}=this.props;let p=n;const d=h&&Array.isArray(n[0]);d&&(p=c.groupByProperty(n[0],e=>e.props[h]));let m="fetura-list";return m+=e?" selectable":"",m+=t?" striped":"",m+=r?" show-number":"",m+=l?" flex-layout":"",m+=a?" "+a:"",s.a.createElement("div",{ref:u,id:i,style:o,className:m},!d&&p,d&&this.showGrouped(p))}}c.propTypes={selectable:r.a.bool,striped:r.a.bool,id:r.a.string,showNumber:r.a.bool,children:(e,t,n)=>{const a=e[t];let o=null;return s.a.Children.forEach(a,e=>{e.type!==i.a&&(o=new Error("`"+n+"` children should be of type `ListItem`."))}),o},className:r.a.string,useFlexLayout:r.a.bool,property:r.a.string},c.defaultProps={selectable:!0,striped:!0,className:"",style:{},useFlexLayout:!0,property:""}},"1Exf":function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var a=n("q1tI"),s=n.n(a),o=n("hw2D"),r=n("17x9"),i=n.n(r);class l extends s.a.PureComponent{constructor(...e){super(...e),this.onChange=e=>{this.props.input.onChange(e)},this.onBlur=e=>{this.props.input.onBlur(e)}}render(){const{showIconOnErrorOnWarning:e,meta:{touched:t,error:n},options:a,input:{value:r},clearButton:i}=this.props;return s.a.createElement(o.a,{options:a,onChange:this.onChange,showIconOnErrorOnWarning:e,error:t&&n?n:"",value:r,clearButton:i,onBlur:this.onBlur})}}l.propTypes={options:i.a.arrayOf(i.a.shape({name:i.a.oneOfType([i.a.string,i.a.number]),value:i.a.oneOfType([i.a.number,i.a.string,i.a.object]).isRequired})).isRequired,showIconOnErrorOnWarning:i.a.bool}},"1Rtv":function(e,t,n){},"4huo":function(e,t,n){"use strict";n.d(t,"a",(function(){return v})),n.d(t,"b",(function(){return E}));var a=n("Y+p1"),s=n.n(a),o=n("BkRI"),r=n.n(o),i=n("mwIZ"),l=n.n(i),c=n("J2iB"),u=n.n(c),h=n("GoyQ"),p=n.n(h),d=n("q1tI"),m=n.n(d),f=n("17x9"),g=n.n(f),b=n("RFJ0");const v={ADDRESS:"DevAdr"};class E extends m.a.PureComponent{constructor(e){super(e),this.onChange=e=>{this.props.input.onChange(e)},this.onBlur=e=>{this.props.input.onBlur(e)},this.state={options:[]}}setInitialValue(e,{find:t=!1,object:n={}}){const{options:a}=this.state;if(a&&a.length>0&&!e.input.value)if(t){const e=a.find(e=>e.value===n.value);this.onChange(e.value)}else this.onChange(a[0].value)}componentDidMount(){const{options:e,init:t,disableSort:n}=this.props;this.setState({options:n?e:this.sortValues(e)},()=>{p()(t)?this.setInitialValue(this.props,{find:!0,object:t}):t&&this.setInitialValue(this.props,{find:!1})})}UNSAFE_componentWillReceiveProps(e,t){s()(this.props.options,e.options)||this.setState({options:e.disableSort?e.options:this.sortValues(e.options)})}sortValues(e){const{sortKey:t="name"}=this.props;return r()(e).sort((e,n)=>{const a="name"!==t?l()(e.value,t):l()(e,t),s="name"!==t?l()(n.value,t):l()(n,t),o=e=>(u()(e)?0:p()(e)?JSON.stringify(e):e).toString();return o(a).localeCompare(o(s),void 0,{numeric:!0,sensitivity:"base"})})}render(){const{label:e,options:t,id:n,input:{value:a},meta:{touched:s,error:o,warning:r},required:i,disabled:l,clearButton:c,disableSort:u,onSearchChange:h,initialSearch:p,autofocus:d,placeholder:f}=this.props;return m.a.createElement(b.a,{required:i,label:e,options:u?t:this.sortValues(t),onChange:e=>this.onChange(e),warning:r||"",onSearchChange:h,placeholder:f,initialSearch:p,autofocus:d,id:n,value:a,error:s&&o?o:"",disabled:l,onBlur:this.onBlur,clearButton:c})}}E.propTypes={label:g.a.string.isRequired,options:g.a.arrayOf(g.a.shape({name:g.a.string,value:g.a.oneOfType([g.a.number,g.a.string,g.a.object]).isRequired})).isRequired,id:g.a.string,required:g.a.bool,disabled:g.a.bool,clearButton:g.a.bool,disableSort:g.a.bool,onSearchChange:g.a.func}},"5Plf":function(e,t,n){"use strict";var a=n("q1tI"),s=n.n(a),o=(n("DT0T"),n("ANjH")),r=n("LCzB");class i extends s.a.Component{render(){const{t:e}=this.props;return s.a.createElement("div",{className:"required-container"},s.a.createElement("span",null,s.a.createElement("b",null,e("basics.requiredText.title"))))}}t.a=Object(o.d)(Object(r.a)())(i)},"6qI1":function(e,t,n){"use strict";var a=n("q1tI"),s=n.n(a),o=n("17x9"),r=n.n(o),i=n("vzZS"),l=(n("eTMi"),n("I02p")),c=n("udB/"),u=n("LCzB");class h extends a.Component{constructor(...e){super(...e),this.state={permissionDenied:!1,foundSource:!1,error:!1},this.video=s.a.createRef(),this.canvas=s.a.createRef(),this.interval=null,this.qr=new l.a,this.lastValue=null,this.stream=null,this.qrCallback=(e,t)=>{t&&this.lastValue!==t.result&&(this.lastValue=t.result,this.props.onFound(t.result))},this.onVideoLoadedMetadata=()=>{this.canvas.current.width=this.video.current.videoWidth,this.canvas.current.height=this.video.current.videoHeight,this.interval=setInterval(()=>{this.analyzePhoto()},500)}}componentDidMount(){this.qr.callback=this.qrCallback,"mediaDevices"in navigator&&navigator.mediaDevices.getUserMedia({video:{facingMode:"environment",focusMode:"continuous"}}).then(e=>{this.stream=e,this.video.current.srcObject=e,this.setState({foundSource:!0})}).catch(e=>{console.error(e,e.code,e.message),"Permission denied"===e.message?this.setState({permissionDenied:!0,foundSource:!0}):this.setState({foundSource:!0,error:!0})})}componentWillUnmount(){if(clearInterval(this.interval),this.stream)for(let e of this.stream.getTracks())e.stop()}analyzePhoto(){let e=this.video.current.videoWidth,t=this.video.current.videoHeight,n=this.canvas.current.getContext("2d");n.fillRect(0,0,e,t),n.drawImage(this.video.current,0,0,e,t);let a=n.getImageData(0,0,e,t);this.qr.decode(a)}render(){const{permissionDenied:e,foundSource:t,error:n}=this.state,{t:a}=this.props;return s.a.createElement("div",{className:"fetura-qr"},s.a.createElement(c.a,{isLoading:!t}),e&&s.a.createElement(i.a,{boxColor:"error"},a("qrScanner.permissionDenied")),n&&s.a.createElement(i.a,{boxColor:"error"},a("qrScanner.error")),!e&&!n&&s.a.createElement(s.a.Fragment,null,s.a.createElement("video",{autoPlay:!0,ref:this.video,onLoadedMetadata:this.onVideoLoadedMetadata}),s.a.createElement("canvas",{ref:this.canvas})))}}h.propTypes={onFound:r.a.func.isRequired},t.a=Object(u.a)()(h)},"9D2Z":function(e,t,n){"use strict";n.d(t,"a",(function(){return g}));var a=n("Z0cm"),s=n.n(a),o=n("Y+p1"),r=n.n(o),i=n("q1tI"),l=n.n(i),c=n("i8i4"),u=n.n(c),h=n("17x9"),p=n.n(h),d=(n("DRPN"),n("wQVC")),m=n("pQ8y"),f=n("ujxO");class g extends l.a.Component{constructor(e){super(e),this.calculatePosition=()=>{if(this.state.event){const e=this.getSource(),t=[[!0,!0],[!1,!0],[!1,!1],[!0,!1]],n=[!1,!1,!1,!1],a=this.menu.clientWidth,s=this.menu.clientHeight,o=window.innerHeight,r=window.innerWidth,{clientY:i,clientX:l,pageX:c,pageY:u}=this.state.event;if(t.forEach(([e,t],c)=>{a<=(e?l:r-l)&&s<=(t?i:o-i)&&(n[c]=!0)}),!n.reduce((e,t)=>+e+ +t,0)||r{Object(d.d)(d.a.MENU),e&&(e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation(),this.setState({isOpen:!1}))},this.getSource=()=>{const{event:e}=this.props;if(e&&e.target&&s()(e.target.className))return!(!e.target.className.includes("fetura-button round info")&&!e.target.className.includes("fas fa-ellipsis-v"))},this.state={isOpen:!!e.event}}static getDerivedStateFromProps(e,t){return e.event&&!r()(t.event,e.event)?{isOpen:!0,event:e.event}:null}componentDidUpdate(e,t,n){e.isOpen!==this.state.isOpen&&(this.state.isOpen?document.addEventListener("click",this.onClickOutside):document.removeEventListener("click",this.onClickOutside))}componentWillUnmount(){Object(d.d)(d.a.MENU),document.removeEventListener("click",this.onClickOutside)}render(){const{children:e}=this.props,{isOpen:t}=this.state;return u.a.createPortal(l.a.createElement(m.a,{in:t,unmountOnExit:!0,onEnter:this.calculatePosition},l.a.createElement("div",{className:"menu-container",ref:e=>this.menu=e},l.a.createElement("ul",null,e))),document.getElementById("root")||document.createElement("div"))}}g.propTypes={event:p.a.object,cornerRadius:p.a.bool},g.defaultProps={cornerRadius:!0}},"9jj8":function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var a=n("q1tI"),s=n.n(a),o=n("17x9"),r=n.n(o);function i(){return(i=Object.assign||function(e){for(var t=1;t{this.props.onContextMenu&&(e.persist(),e.preventDefault(),this.props.onContextMenu(e))}}render(){const{className:e,children:t,selected:n,index:a,lp:o,color:r,disableHover:l,onClick:c,itemRef:u,showNumber:h}=this.props;let p="fetura-list-item";return p+=e?" ".concat(e):"",p+=n?" selected":"",p+=h?" show-number":"",p+=void 0!==a&&a%2===0?" odd":" even",p+=l?" disable-hover":"",s.a.createElement("div",i({},this.props,{ref:u,className:p,"data-lp":o,onContextMenu:this.onContextMenu,onClick:c}),t,!!r&&s.a.createElement("div",{className:"fetura-list-item-color",style:{background:r}}))}}l.propTypes={children:r.a.any.isRequired,className:r.a.string,selected:r.a.bool,style:r.a.object,color:r.a.string,disableHover:r.a.bool,onContextMenu:r.a.func,onClick:r.a.func,showNumber:r.a.bool},l.defaultProps={className:"",style:{}}},"9oM0":function(e,t,n){},AsM4:function(e,t,n){"use strict";var a=n("UB5X"),s=n.n(a),o=n("4qC0"),r=n.n(o),i=n("q1tI"),l=n.n(i),c=n("wQVC"),u=n("n/3K"),h=n.n(u),p=n("17x9"),d=n.n(p);class m extends l.a.PureComponent{constructor(e){super(e),this.state={height:m.calculateHeight(this.props)}}static getDerivedStateFromProps(e,t){const n=m.calculateHeight(e);return n!==t.height?{height:n}:null}render(){const{children:e}=this.props,{height:t}=this.state;return e({rowHeight:t||150})}}m.getHeight=e=>r()(e)?Object(c.f)(parseInt(e,10)):s()(e)?e:150,m.calculateHeight=({windowWidth:e,breakPoints:t,defaultHeight:n})=>{let a;t.sort((e,t)=>t.max-e.max);for(let s of t)if(e<=s.max){a=m.getHeight(s.height||n);break}return a||m.getHeight(n)},m.propTypes={breakPoints:d.a.array.isRequired,defaultValue:d.a.string,children:d.a.func.isRequired},m.defaultProps={breakPoints:[],defaultValue:150},t.a=h()(m)},DRPN:function(e,t,n){},DT0T:function(e,t,n){},HZNq:function(e,t,n){},J1h9:function(e,t,n){},MAs2:function(e,t,n){"use strict";var a=n("q1tI"),s=n.n(a),o=n("17x9"),r=n.n(o),i=n("55Ip");n("x2Ff");class l extends a.Component{render(){const{name:e,href:t,state:n,selected:a,children:o}=this.props;return s.a.createElement(i.Link,{to:{pathname:t,state:n},className:"fetura-mobile-link".concat(a?" selected":"")},e,o)}}l.propTypes={name:r.a.string.isRequired,href:r.a.string.isRequired,state:r.a.object,selected:r.a.bool},t.a=l},NAMD:function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var a=n("q1tI"),s=n.n(a),o=n("17x9"),r=n.n(o),i=n("i8i4"),l=n.n(i),c=(n("ehBd"),n("39gQ")),u=n("sgBY"),h=n("v9qu"),p=n("AAik");class d extends s.a.Component{constructor(e){super(e),this.state={printing:!1}}componentDidMount(){this.props.printing&&this.print()}UNSAFE_componentWillReceiveProps(e,t){this.props.printing!==e.printing&&e.printing&&this.print()}componentWillUnmount(){this.setState({printing:!1})}print(){this.setState({printing:!0},()=>{setTimeout(()=>{window.onafterprint=()=>{Object(h.a)()||setTimeout(()=>{this.setState({printing:!1})})},window.print(),this.props.onPrintEnd()},1e3)})}getPrintChildren(){return(Array.isArray(this.props.children)?this.props.children:[this.props.children]).map(e=>e.type===p.a?s.a.createElement(u.a,e.props):e)}render(){const{children:e,name:t,additionalText:n}=this.props,{printing:a}=this.state;return console.log(this.getPrintChildren()),s.a.createElement(s.a.Fragment,null,e,a&&l.a.createPortal(s.a.createElement("div",{className:"printable"},s.a.createElement("img",{src:c.a,alt:"logo"}),s.a.createElement("div",{className:"printable-title"},s.a.createElement("h2",null,t),n&&s.a.createElement("h5",null,n)),this.getPrintChildren()),document.getElementById("root")))}}d.propTypes={printing:r.a.bool.isRequired,name:r.a.string.isRequired,onPrintEnd:r.a.func.isRequired,horizontal:r.a.bool,additionalText:r.a.node},d.defaultProps={horizontal:!1}},NMoN:function(e,t,n){},OtO2:function(e,t,n){"use strict";var a,s=n("q1tI"),o=n.n(s),r=n("/MKj"),i=n("4huo"),l=n("17x9"),c=n.n(l),u=n("Akpi"),h=n("LCzB"),p=n("wd8a");function d(){return(d=Object.assign||function(e){for(var t=1;t({user:e.user.user,employees:e.user.employees,fetching:e.user.fetching,fetched:e.user.fetched}))(a=class extends o.a.Component{createOptions(e){let t=[];return t.push({name:e.t("eventGrid.me"),value:e.user.LocalUserID}),[...t,...e.employees.filter(t=>t.LocalUserID!==e.user.LocalUserID).map(e=>({name:e.userName,value:e.LocalUserID}))]}componentDidMount(){this.props.input.onChange(this.props.user.LocalUserID),this.checkUserType()&&!this.props.fetched&&this.props.dispatch(Object(u.f)(this.props.user.ClientID))}checkUserType(e=this.props){return e.user.UserType===p.SERVICE||e.user.UserType===p.OWNER}render(){if(!this.checkUserType())return null;const e=this.createOptions(this.props);return o.a.createElement("div",{className:"operator-chooser"},o.a.createElement(i.b,d({options:e},this.props)))}})||a;t.a=Object(h.a)()(m),m.propTypes={label:c.a.node.isRequired}},QF1E:function(e,t,n){},QWcO:function(e,t,n){"use strict";var a=n("lSCD"),s=n.n(a),o=n("q1tI"),r=n.n(o),i=n("n/3K"),l=n.n(i);class c extends o.Component{constructor(...e){super(...e),this.renderChildren=()=>{const{children:e,windowWidth:t,windowHeight:n}=this.props;return e?s()(e)?e({windowWidth:t,windowHeight:n}):r.a.cloneElement(e,{windowWidth:t,windowHeight:n},e.props.children):null}}render(){return r.a.createElement(r.a.Fragment,null,this.renderChildren())}}t.a=l()(c)},RFJ0:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var a=n("q1tI"),s=n.n(a),o=n("hw2D"),r=n("17x9"),i=n.n(r);class l extends s.a.PureComponent{constructor(...e){super(...e),this.onChange=e=>{this.props.onChange(e)}}render(){const{options:e,label:t,error:n,warning:a,initialValue:r,required:i,value:l,disabled:c,clearButton:u,onBlur:h,onSearchChange:p,initialSearch:d,autofocus:m,placeholder:f}=this.props;return s.a.createElement(s.a.Fragment,null,s.a.createElement("label",null,t,i&&s.a.createElement("sup",null,"*")),s.a.createElement(o.a,{options:e,onChange:this.onChange,error:n,warning:a,initialValue:r,onSearchChange:p,initialSearch:d,ref:e=>this.select=e,value:l,disabled:c,clearButton:u,onBlur:h,autofocus:m,placeholder:f}))}}l.propTypes={label:i.a.node.isRequired,options:i.a.arrayOf(i.a.shape({name:i.a.string,value:i.a.oneOfType([i.a.number,i.a.string,i.a.object]).isRequired})).isRequired,onChange:i.a.func,onSearchChange:i.a.func,error:i.a.string,initialValue:i.a.oneOfType([i.a.number,i.a.string,i.a.object]),value:i.a.oneOfType([i.a.number,i.a.string,i.a.object]),disabled:i.a.bool,clearButton:i.a.bool,onBlur:i.a.func},l.defaultProps={onChange:()=>{},onSearchChange:()=>{}}},U4G4:function(e,t,n){"use strict";var a=n("mwIZ"),s=n.n(a),o=n("q1tI"),r=n.n(o),i=n("17x9"),l=n.n(i);n("p0Eu");class c extends o.Component{constructor(...e){super(...e),this.onChange=e=>{const{onChange:t}=this.props;t(s()(e,"target.value",""))},this.onKeyUp=e=>{const{value:t,onEnter:n,onClear:a}=this.props;console.log(e.keyCode),13===e.keyCode?n({value:t}):27===e.keyCode&&a({value:t})}}render(){const{value:e,placeholder:t,className:n,id:a}=this.props,s=["fetura-search-input",n].filter(e=>!!e).join(" ");return r.a.createElement("div",{className:s},r.a.createElement("i",{className:"fas fa-search"}),r.a.createElement("input",{id:a,onKeyUp:this.onKeyUp,type:"text",placeholder:t,onChange:this.onChange,value:e,autoFocus:!0}))}}c.propTypes={value:l.a.string.isRequired,onChange:l.a.func.isRequired,onEnter:l.a.func,onClear:l.a.func,placeholder:l.a.string,className:l.a.string},c.defaultProps={value:"",onChange:()=>{},onEnter:()=>{},onClear:()=>{},placeholder:"",className:""},t.a=c},Uh9e:function(e,t,n){"use strict";var a=n("RBan"),s=n.n(a),o=n("J2iB"),r=n.n(o),i=n("Y+p1"),l=n.n(i),c=n("Z0cm"),u=n.n(c),h=n("afOK"),p=n.n(h),d=n("siax"),m=n("q1tI"),f=n.n(m),g=n("17x9"),b=n.n(g),v=(n("9oM0"),n("uSQv")),E=n("JI6e"),C=n("3Z9Z");const y=Object(d.b)(d.c),x=Object(d.b)(d.a),w=0,O=1,N=200,S=100,T=50;class k extends f.a.Component{constructor(e){super(e),this.holdStart=null,this.timeout=null,this.type=null,this.getValue=e=>{const{isRange:t,min:n,max:a,value:s}=e;let o;const i=e=>{let t;return t=r()(e)?n:Math.min(Math.max(e,n),a),t};return o=t?[i(s?s[0]:null),i(s?s[1]:null)]:i(s),o},this.onChange=e=>{const{state:{value:t}}=this;l()(e,t)||this.setState({value:e})},this.onAfterChange=e=>{const{props:{onChange:t,value:n}}=this;l()(e,n)||t(e)},this.handleButtonClickRight=(e,t)=>{e.persist();const{value:n}=this.state,{step:a,onChange:o,max:r,min:i}=this.props;if(u()(n)){let e=n.slice(0);if(t===w){let t=+(p()(e)+a).toFixed(2);e.shift(),e.unshift(t)}else{let t=+(s()(e)+a).toFixed(2);e.pop(),e.push(t)}s()(e)<=r&&p()(e)<=r&&p()(e)>=i&&s()(e)>=i&&!l()(e,n)?this.setState({value:e},()=>o(e)):this.onTouchEnd()}else{let e=+(n+a).toFixed(2);e<=r&&e>=i&&!l()(e,n)?this.setState({value:e},()=>o(e)):this.onTouchEnd()}},this.handleButtonClickLeft=(e,t)=>{e.persist();const{value:n}=this.state,{step:a,onChange:o,max:r,min:i}=this.props;if(u()(n)){let e=n.slice(0);if(t===w){let t=+(p()(e)-a).toFixed(2);e.shift(),e.unshift(t)}else{let t=+(s()(e)-a).toFixed(2);e.pop(),e.push(t)}s()(e)<=r&&p()(e)<=r&&p()(e)>=i&&s()(e)>=i&&!l()(e,n)?this.setState({value:e},()=>o(e)):this.onTouchEnd()}else{let e=+(n-a).toFixed(2);e<=r&&e>=i&&!l()(e,n)?this.setState({value:e},()=>o(e)):this.onTouchEnd()}},this.onIncrementTouchStart=(e,t)=>{this.type="+",this.onTouchStart(e,t)},this.onDecrementTouchStart=(e,t)=>{this.type="-",this.onTouchStart(e,t)},this.onTouchEnd=()=>{this.holdStart=null,this.type=null,clearTimeout(this.timeout)},this.disableContextMenu=e=>(e.preventDefault(),!1),this.renderButtons=e=>{const{isRange:t,disabled:n,max:a,min:s}=e,{value:o}=this.state;let r=f.a.createElement(E.a,null,f.a.createElement(C.a,{className:"justify-content-center mr-1"},f.a.createElement(v.a,{className:"left",buttonStyle:"bordered",icon:f.a.createElement("i",{className:"fas fa-minus"}),onClick:e=>this.handleButtonClickLeft(e,w),disabled:n||o<=s,onTouchStart:e=>this.onDecrementTouchStart(e,w),onTouchEnd:this.onTouchEnd,onContextMenu:this.disableContextMenu,onMouseDown:e=>this.onDecrementTouchStart(e,w),onMouseUp:this.onTouchEnd,onMouseLeave:this.onTouchEnd,type:"button"}))),i=f.a.createElement(E.a,null,f.a.createElement(C.a,{className:"justify-content-center ml-1"},f.a.createElement(v.a,{className:"right",buttonStyle:"bordered",icon:f.a.createElement("i",{className:"fas fa-plus"}),onClick:e=>this.handleButtonClickRight(e,O),disabled:n||o>=a,onTouchStart:e=>this.onIncrementTouchStart(e,O),onTouchEnd:this.onTouchEnd,onContextMenu:this.disableContextMenu,onMouseUp:this.onTouchEnd,onMouseLeave:this.onTouchEnd,onMouseDown:e=>this.onIncrementTouchStart(e,O),type:"button"}))),l=f.a.createElement(E.a,null,f.a.createElement(C.a,{className:"flex-column justify-content-center mr-1"},f.a.createElement(v.a,{className:"right",buttonStyle:"bordered",icon:f.a.createElement("i",{className:"fas fa-plus"}),onClick:e=>this.handleButtonClickRight(e,w),disabled:n||o[0]>=a,onTouchStart:e=>this.onIncrementTouchStart(e,w),onTouchEnd:this.onTouchEnd,onContextMenu:this.disableContextMenu,onMouseDown:e=>this.onIncrementTouchStart(e,w),onMouseLeave:this.onTouchEnd,onMouseUp:this.onTouchEnd,type:"button"}),f.a.createElement(v.a,{className:"left",buttonStyle:"bordered",icon:f.a.createElement("i",{className:"fas fa-minus"}),onClick:e=>this.handleButtonClickLeft(e,w),disabled:n||o[0]<=s,onTouchStart:e=>this.onDecrementTouchStart(e,w),onTouchEnd:this.onTouchEnd,onContextMenu:this.disableContextMenu,onMouseDown:e=>this.onDecrementTouchStart(e,w),onMouseUp:this.onTouchEnd,onMouseLeave:this.onTouchEnd,type:"button"}))),c=f.a.createElement(E.a,null,f.a.createElement(C.a,{className:"flex-column justify-content-center ml-1"},f.a.createElement(v.a,{className:"right",buttonStyle:"bordered",icon:f.a.createElement("i",{className:"fas fa-plus"}),onClick:e=>this.handleButtonClickRight(e,O),disabled:n||o[1]>=a,onTouchStart:e=>this.onIncrementTouchStart(e,O),onTouchEnd:this.onTouchEnd,onContextMenu:this.disableContextMenu,onMouseDown:e=>this.onIncrementTouchStart(e,O),onMouseUp:this.onTouchEnd,onMouseLeave:this.onTouchEnd,type:"button"}),f.a.createElement(v.a,{className:"left",buttonStyle:"bordered",icon:f.a.createElement("i",{className:"fas fa-minus"}),onClick:e=>this.handleButtonClickLeft(e,O),disabled:n||o[1]<=s,onTouchStart:e=>this.onDecrementTouchStart(e,O),onTouchEnd:this.onTouchEnd,onContextMenu:this.disableContextMenu,onMouseDown:e=>this.onDecrementTouchStart(e,O),onMouseUp:this.onTouchEnd,onMouseLeave:this.onTouchEnd,type:"button"})));return t?[l,c]:[r,i]},this.state={value:this.getValue(e)}}UNSAFE_componentWillReceiveProps(e,t){if(!l()(e.value,this.state.value)||e.min!==this.props.min||e.max!==this.props.max||e.step!==this.props.step){const t=this.getValue(e);this.onChange(t),this.onAfterChange(t)}}shouldComponentUpdate(e,t,n){return!l()(this.props,e)||!l()(this.state,t)}getTimeoutTime(){let e=+new Date;return e-this.holdStart<2e3?N:e-this.holdStart<4e3?S:T}startTimeout(e,t){this.timeout=setTimeout(()=>{"+"===this.type?this.handleButtonClickRight(e,t):"-"===this.type&&this.handleButtonClickLeft(e,t),this.startTimeout(e,t)},this.getTimeoutTime())}onTouchStart(e,t){this.holdStart=+new Date,this.startTimeout(e,t)}render(){const{disabled:e,isRange:t,valueFormatter:n,tipFormatter:a}=this.props,{value:s}=this.state,o=this.renderButtons(this.props);let{max:r,min:i,step:l=1}=this.props;return Number.isInteger(l)||(r=r&&r+l/100,i=i&&i-l/100),f.a.createElement("div",{className:"fetura-slider"},o[0],!!t&&f.a.createElement(x,{onChange:this.onChange,onAfterChange:this.onAfterChange,disabled:e,min:i,max:r,value:s,tipFormatter:a,step:l}),!t&&f.a.createElement(y,{onChange:this.onChange,onAfterChange:this.onAfterChange,disabled:e,min:i,max:r,value:s,tipFormatter:n,step:l}),o[1])}}k.propTypes={onChange:b.a.func,id:b.a.string,min:b.a.number.isRequired,max:b.a.number.isRequired,step:b.a.number,value:b.a.oneOfType([b.a.number,b.a.array]).isRequired,isRange:b.a.bool,disabled:b.a.bool,valueFormatter:b.a.func,tipFormatter:b.a.func},k.defaultProps={onChange:e=>{},disabled:!1,step:1,min:0,max:100,isRange:!1,valueFormatter:e=>e,tipFormatter:e=>e},t.a=k},Vv3o:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var a=n("q1tI"),s=n.n(a),o=n("17x9"),r=n.n(o),i=n("OwcS"),l=n("Uh9e");class c extends s.a.Component{render(){const{label:e,value:t,valueFormatter:n,required:a}=this.props;return s.a.createElement(s.a.Fragment,null,s.a.createElement("label",null,e,a&&s.a.createElement("sup",null,"*"),s.a.createElement("strong",{style:{float:"right"}},n(t))),s.a.createElement(l.a,this.props))}}c.propTypes={label:r.a.string.isRequired,valueFormatter:r.a.func,onChange:r.a.func,id:r.a.string,min:r.a.number.isRequired,max:r.a.number.isRequired,step:r.a.number,value:r.a.oneOfType([r.a.number,r.a.array]).isRequired,isRange:r.a.bool,disabled:r.a.bool},c.defaultProps={onChange:()=>{},id:Object(i.a)(),disabled:!1,step:1,min:0,max:100,valueFormatter:e=>e}},XEBk:function(e,t,n){"use strict";var a=n("q1tI"),s=n.n(a),o=n("17x9"),r=n.n(o),i=n("y6dH"),l=(n("aKjw"),n("CuyV"));const c=s.a.memo(({style:e,icon:t})=>s.a.createElement(i.a,{style:e,className:"icon",loading:()=>s.a.createElement("svg",{viewBox:"0 0 270.93334 270.93334"}),src:t}));class u extends a.Component{render(){const{icon:e,title:t,unit:n,value:a,valueFormatter:o,show:r,small:i,color:u}=this.props,h=u?{color:u}:void 0;return s.a.createElement(l.a,{tooltipContent:t},s.a.createElement("div",{className:"fetura-icon-value-new",title:t},!!r&&s.a.createElement(s.a.Fragment,null,s.a.createElement(c,{style:h,icon:e}),s.a.createElement("div",{className:i?"value-small":"value"},o(a)||"-",n))))}}u.propTypes={icon:r.a.object.isRequired,name:r.a.string.isRequired,value:r.a.number.isRequired,showWhenValueNotFound:r.a.bool,disabledTooltip:r.a.bool},u.defaultProps={valueFormatter:e=>e,unit:""},t.a=u},XoCd:function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var a=n("q1tI"),s=n.n(a),o=n("17x9"),r=n.n(o),i=n("OwcS"),l=n("Uh9e");class c extends s.a.Component{constructor(...e){super(...e),this.onChange=e=>{this.props.input.onChange(e)}}render(){const{min:e,max:t,step:n,disabled:a,input:{value:o},isRange:r,valueFormatter:i,tipFormatter:c}=this.props;return s.a.createElement(l.a,{tipFormatter:c,valueFormatter:i,min:e,max:t,step:n,disabled:a,value:o,isRange:r,onChange:e=>this.onChange(e)})}}function u(){return(u=Object.assign||function(e){for(var t=1;t{},id:Object(i.a)(),disabled:!1,step:1,min:0,max:100};class h extends s.a.Component{render(){const{label:e,input:{value:t},valueFormatter:n,required:a}=this.props;return s.a.createElement(s.a.Fragment,null,s.a.createElement("label",null,e,a&&s.a.createElement("sup",null,"*"),s.a.createElement("strong",{style:{float:"right"}},n(t))),s.a.createElement(c,u({},this.props,{valueFormatter:n})))}}h.propTypes={id:r.a.string,min:r.a.number.isRequired,max:r.a.number.isRequired,step:r.a.number,value:r.a.oneOfType([r.a.number,r.a.array]).isRequired,isRange:r.a.bool,disabled:r.a.bool,valueFormatter:r.a.func,tipFormatter:r.a.func,showButtons:r.a.bool},h.defaultProps={onChange:e=>{},id:Object(i.a)(),disabled:!1,step:1,min:0,max:100,valueFormatter:e=>e,showButtons:!1}},"Y/op":function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var a=n("q1tI"),s=n.n(a);n("u86x");function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class i extends s.a.Component{onClick(e){this.props.input.onChange(e)}render(){const{children:e,input:{value:t}}=this.props;return console.log(this.props),s.a.createElement("div",{className:"button-picker"},e.map((e,n)=>s.a.cloneElement(e,function(e){for(var t=1;tthis.onClick(e.props.value)}),e.props.children)))}}},ZwF7:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var a=n("q1tI"),s=n.n(a),o=n("17x9"),r=n.n(o),i=(n("bb0v"),n("yLV6")),l=n.n(i);class c extends s.a.Component{constructor(e){super(e),this.container=s.a.createRef()}componentDidMount(){let e=this.container.current;if(e){let t=new l.a(e);t.get("swipe").set({direction:l.a.DIRECTION_RIGHT}),t.on("swiperight",()=>{this.props.onHide()})}}getClassName(){const{show:e}=this.props;let t="fetura-mobile-info";return e&&(t+=" show"),t}render(){const{children:e,onHide:t,name:n}=this.props;return s.a.createElement("div",{className:this.getClassName(),ref:this.container},s.a.createElement("div",{className:"fetura-mobile-info-header"},s.a.createElement("i",{className:"fas fa-chevron-left pointer",onClick:t}),s.a.createElement("h4",null,n)),e)}}c.propTypes={show:r.a.bool,onHide:r.a.func,children:r.a.oneOfType([r.a.node,r.a.array]),name:r.a.string}},aG8S:function(e,t,n){"use strict";var a,s=n("q1tI"),o=n.n(s),r=n("v9qu"),i=n("JI6e"),l=n("7xGa"),c=n("3Z9Z"),u=n("t9uZ"),h=n("/MKj"),p=n("y6dH"),d=n("gt5e"),m=n("/71m"),f=n("Sa/u"),g=n("8l2w"),b=n("vzZS"),v=n("I0mP"),E=n("wQVC"),C=n("pBTy"),y=n("LCzB");function x(){return(x=Object.assign||function(e){for(var t=1;t({farm:e.location.farm,farmMaps:e.settings.farmMap,farms:e.farms.farms}))(a=class extends o.a.Component{constructor(e){super(e),this.handleEnter=()=>{this.setState({showMenu:!0})},this.handleExit=()=>{this.setState({showMenu:!1})},this.onOnlineChange=e=>{this.setState({online:e})},this.renderActionButton=({icon:e,name:t,action:n})=>o.a.createElement(i.a,{xl:2,lg:3,md:4,sm:6,xs:12,onClick:n},o.a.createElement("i",{className:"fa-fw ".concat(e)}),o.a.createElement("a",null,t)),this.state={showMenu:!1,online:!0}}componentDidUpdate(e,t,n){this.state.showMenu!==e.showMenu&&(this.state.showMenu?Object(E.c)(E.a.LEFT_BAR):Object(E.d)(E.a.LEFT_BAR))}componentWillUnmount(){Object(E.d)(E.a.LEFT_BAR)}render(){const{farmChooser:e,devicesMenuItems:t,breedingMenuItems:n,bottomMenuItems:a,showBadge:s,footer:r,t:h,generalMenuItems:E}=this.props,{online:y,showMenu:w}=this.state;return o.a.createElement(o.a.Fragment,null,o.a.createElement("div",{className:"left-bar-mobile",onClick:this.handleEnter},o.a.createElement(p.a,{className:"logo-container",src:d.a,loading:()=>o.a.createElement("svg",{viewBox:"0 0 270.93334 270.93334"})}),o.a.createElement(v.a,{show:s}),o.a.createElement(m.a,null),o.a.createElement(g.a,{onOnlineChange:this.onOnlineChange})),o.a.createElement(l.a,{in:w,unmountOnExit:!0},o.a.createElement("div",{className:"left-bar-mobile-menu justify-content-center"},o.a.createElement("div",{className:"left-bar-mobile-menu-close",onClick:this.handleExit},o.a.createElement("i",{className:"fas fa-times"})),o.a.createElement("div",null,o.a.createElement(f.a,null)),!y&&o.a.createElement(b.a,{boxColor:"error"},h("leftBar.noConnection")," ",o.a.createElement("i",{className:"fas fa-wifi-slash"})),o.a.createElement(i.a,{xs:12,className:"left-bar-mobile-menu-pos"},o.a.createElement(c.a,{className:"justify-content-center mb-3"},o.a.createElement("h5",null,h("general"))),o.a.createElement(c.a,null,E.map((e,t)=>e.hide?null:o.a.createElement(u.a,x({key:"m_".concat(t)},e,{handleHide:this.handleExit,handleShow:this.handleEnter})))),o.a.createElement(c.a,{className:"justify-content-center mb-3"},o.a.createElement("h5",null,h("devices"))),o.a.createElement(c.a,null,t.map((e,t)=>e.hide?null:o.a.createElement(u.a,x({key:"m_".concat(t)},e,{handleHide:this.handleExit,handleShow:this.handleEnter})))),o.a.createElement(c.a,{className:"justify-content-center m-3"},o.a.createElement("h5",null,h("breeding"))),o.a.createElement(c.a,null,n.map((e,t)=>e.hide?null:o.a.createElement(u.a,x({key:"m_".concat(t)},e,{handleHide:this.handleExit,handleShow:this.handleEnter})))),o.a.createElement("hr",null),o.a.createElement(c.a,null,a.map((e,t)=>e.hide?null:o.a.createElement(u.a,x({key:"m_".concat(t)},e,{handleHide:this.handleExit,handleShow:this.handleEnter})))),o.a.createElement(c.a,null,e.map(e=>{if(!e.hide)return o.a.createElement(u.a,x({},e,{onClick:this.onClick}))}),r.map(e=>this.renderActionButton(e)))),o.a.createElement(C.a,null))))}})||a;var O=Object(y.a)()(w),N=n("55Ip"),S=n("Ty5D"),T=n("hJZc"),k=n("uSQv"),M=n("MMk1"),q=n("17x9"),R=n.n(q),j=n("2HEh"),I=n("9D2Z"),P=n("uqr+"),B=n.n(P),F=n("kG49"),D=n("8Fj4"),L=n("JFDi"),U=(n("1Rtv"),n("s506")),H=n("fAk8");function V(){return(V=Object.assign||function(e){for(var t=1;t{let e=[];return B.a.getLanguage().map(t=>{t.lang!==this.props.selectedLang&&e.push(o.a.createElement(F.a,{key:t.lang,onClick:()=>this.switchLanguage(t.lang)},t.lang.toUpperCase()))}),e},this.handleOnClick=()=>{const{dispatch:e}=this.props;e(Object(D.b)(""))},this.switchLanguage=async e=>{const{dispatch:t,i18n:n}=this.props;await n.changeLanguage(e),await t(Object(H.b)(e))},this.logout=()=>{Object(L.b)()},this.onExpandClick=()=>{const{expanded:e}=this.state,{cookies:t}=this.props;t.set("expanded",!e),this.setState({expanded:!e})},this.onLangClick=e=>{console.log(e),e.persist(),this.setState({event:e})},this.footerData=()=>[{action:this.onLangClick,icon:"fas fa-language",name:this.props.t("language")},{action:this.logout,icon:"fas fa-power-off",name:this.props.t("logout")}],this.renderFooter=(e=[])=>{let t={type:"button",buttonColor:"white",className:"round",buttonStyle:"text"};return o.a.createElement("div",{className:"footer"},o.a.createElement("div",{className:"footer-buttons"},e.map(e=>o.a.createElement(k.a,V({},t,{onClick:e.action,icon:o.a.createElement("i",{className:e.icon})})))))};const{cookies:t}=e;let n=t.get("expanded");this.state={expanded:void 0===n||"true"===n,event:void 0,noConnection:{loading:!0}}}render(){const{expanded:e,event:t}=this.state,{showBadge:n,menuItems:a,showPing:s,devicesMenuItems:i,breedingMenuItems:l,bottomMenuItems:c,user:{attributes:{login:u}},generalMenuItems:h}=this.props,f=[{icon:"fas fa-list",locations:["farmChooser"],href:"/farmChooser",name:this.props.t("leftBar.farmChooser"),disRedirect:!0,isShowing:"farm",roles:[U.c._GENERAL_READ]}];return Object(r.a)()?o.a.createElement(o.a.Fragment,null,o.a.createElement(O,{showBadge:n,devicesMenuItems:i,breedingMenuItems:l,bottomMenuItems:c,farmChooser:f,footer:this.footerData(),generalMenuItems:h}),o.a.createElement(I.a,{event:t},this.getLanguages())):o.a.createElement("div",{className:"left-bar ".concat(e?"expanded":"")},o.a.createElement("div",{className:"header"},o.a.createElement(N.Link,{to:"/",id:"logo-link",onClick:this.handleOnClick},o.a.createElement(p.a,{className:"logo-container ".concat(n?"show-badge":""),src:d.a,loading:()=>o.a.createElement("svg",{viewBox:"0 0 270.93334 270.93334"})}),e&&o.a.createElement(T.a,{format:"HH:mm:ss"}),s&&o.a.createElement(o.a.Fragment,null,o.a.createElement(m.a,null),o.a.createElement(v.a,{show:n}),o.a.createElement(g.a,null))),o.a.createElement("div",{className:"expand"},o.a.createElement(k.a,{type:"button",onClick:this.onExpandClick,icon:o.a.createElement("i",{className:"fas fa-bars"}),buttonStyle:"text"}))),o.a.createElement("div",{className:"fetura-user"},o.a.createElement("i",{className:"fa fa-user","aria-hidden":"true"}),o.a.createElement("b",null,u)),o.a.createElement("div",{className:"menu"},o.a.createElement("div",{className:"align-self-center"},o.a.createElement(M.a,{menuItems:a,expanded:e}),o.a.createElement("hr",null),o.a.createElement(M.a,{menuItems:f,expanded:e}))),this.renderFooter(this.footerData()),o.a.createElement(C.a,null),o.a.createElement(I.a,{event:t},this.getLanguages()))}}A.propTypes={menuItems:R.a.array.isRequired,showBadge:R.a.bool,showPing:R.a.bool},A.defaultProps={showPing:!0},A=Object(h.connect)(e=>({selectedLang:e.language.locale,farm:e.location.farm,user:e.user}))(A),A=Object(j.a)(A),A=Object(S.o)(A);t.a=Object(y.a)()(A)},aKjw:function(e,t,n){},bb0v:function(e,t,n){},dVhv:function(e,t,n){"use strict";var a=n("q1tI"),s=n.n(a),o=n("17x9"),r=n.n(o);n("HZNq");class i extends a.Component{render(){const{expanded:e,color:t,text:n,icon:a,description:o,onClick:r}=this.props,i=["fetura-resizable-jumbotron",t,e?"expanded":""].filter(e=>!!e).join(" ");return s.a.createElement("div",{className:i},s.a.createElement("div",{className:"resizable-body"},s.a.createElement("div",null,!!a&&s.a.createElement("i",{className:"opacity-75 pointer fa-fw mr-1 ".concat(a)}),s.a.createElement("strong",{className:"pointer",onClick:r},n),!!o&&s.a.createElement(s.a.Fragment,null,!e&&s.a.createElement("strong",{className:"ml-1 opacity-75 mr-1"},"|"),s.a.createElement("span",{className:"desc opacity-75"},o)))))}}i.propTypes={text:r.a.string.isRequired,onClick:r.a.func.isRequired,expanded:r.a.bool,description:r.a.string,icon:r.a.string,color:r.a.string},t.a=i},eTMi:function(e,t,n){},ehBd:function(e,t,n){},gNnm:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var a=n("q1tI"),s=n.n(a),o=n("17x9"),r=n.n(o),i=n("OwcS");n("NMoN");class l extends s.a.Component{constructor(...e){super(...e),this.onChange=e=>{this.props.onChange(e.target.checked,this.props,e)}}render(){const{label:e,id:t=Object(i.a)(),disabled:n,checked:a,readOnly:o,required:r,divRef:l,name:c,value:u}=this.props;return s.a.createElement("div",{className:"fetura-radio",ref:l},s.a.createElement("input",{disabled:n,type:"radio",id:t,onChange:this.onChange,checked:a,readOnly:o,name:c,value:u}),s.a.createElement("label",{style:o?{pointerEvent:"none"}:{},htmlFor:t},"\xa0",e,r&&s.a.createElement("sup",null,"*")))}}l.propTypes={label:r.a.string.isRequired,checked:r.a.bool,onChange:r.a.func,id:r.a.string,readOnly:r.a.bool,disable:r.a.bool,required:r.a.bool,divRef:r.a.object,name:r.a.string,value:r.a.string},l.defaultProps={onChange:()=>{},required:!1,disabled:!1}},gTmc:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var a=n("q1tI"),s=n.n(a);n("QF1E");class o extends s.a.PureComponent{render(){const{size:e}=this.props;let t=["fetura-loading loading-bull"];return t.push("size-".concat(e)),s.a.createElement("span",{className:t.join(" ")},s.a.createElement("div",null,s.a.createElement("i",{className:"fas fa-circle"})),s.a.createElement("div",null,s.a.createElement("i",{className:"fas fa-circle"})),s.a.createElement("div",null,s.a.createElement("i",{className:"fas fa-circle"})))}}o.defaultProps={size:1}},hw2D:function(e,t,n){"use strict";var a=n("UfWW"),s=n.n(a),o=n("mwIZ"),r=n.n(o),i=n("Y+p1"),l=n.n(i),c=n("q1tI"),u=n.n(c),h=n("i8i4"),p=n.n(h),d=n("17x9"),m=n.n(d),f=(n("v3Gq"),n("2dKy")),g=n("7xGa"),b=n("v9qu");class v extends u.a.PureComponent{constructor(...e){super(...e),this.onSelect=()=>{this.props.onSelect(this.props.option)},this.getText=()=>this.props.option.name?r()("object"===typeof this.props.option.value?this.props.option.value:this.props.option,this.props.option.name,this.props.option.name||""):"object"===typeof this.props.option.value?"":this.props.option.value||"",this.onMouseEnter=()=>{this.props.onHoverChange(this.props.index)}}getClassName(){const{active:e,hovered:t}=this.props;let n="select-item";return e&&(n+=" active"),t&&(n+=" hovered"),n}render(){const{index:e}=this.props;return Object(b.a)()?u.a.createElement("option",{value:e},this.getText()):u.a.createElement("div",{className:this.getClassName(),onClick:this.onSelect,onMouseEnter:this.onMouseEnter},this.getText()||"")}}v.propTypes={option:m.a.shape({name:m.a.oneOfType([m.a.string,m.a.number]),value:m.a.oneOfType([m.a.number,m.a.string,m.a.object]).isRequired}),onSelect:m.a.func,active:m.a.bool,index:m.a.number,hovered:m.a.bool,onHoverChange:m.a.func},v.defaultProps={onSelect:()=>{},active:!1,hovered:!1,onHoverChange:()=>{}};var E=n("CuyV"),C=n("LCzB");class y extends u.a.Component{constructor(e){super(e),this.onSearchChange=e=>{this.setState({search:e,menuOpened:!0}),this.generateOptions(e),this.props.onSearchChange(e)},this.onHoverChange=e=>{this.setState({hovered:e},()=>{this.generateOptions(this.state.search)})},this.generateOptions=(e="",t=this.props)=>{const{options:n,value:a}=t,{hovered:s}=this.state;let o=this.filterOptions(n,e).map((e,t)=>u.a.createElement(v,{option:e,onSelect:this.onChange,key:t,active:l()(e.value,a),index:t,hovered:s===t,onHoverChange:this.onHoverChange}));this.setState({options:o})},this.onChange=e=>{e?(this.setState({menuOpened:!1,hovered:null}),this.props.onChange(e.value)):this.props.onChange(null)},this.onExited=()=>{this.generateOptions()},this.onExit=()=>{this.setState({search:""})},this.clearValue=()=>{this.setState({placeholder:"",selectedOption:void 0})},this.getPlaceholder=()=>{const{value:e,placeholder:t,options:n}=this.props;let a=n.find(t=>l()(t.value,e));return a?r()("object"===typeof a.value?a.value:a,a.name,a.name):t||""},this.onMobileSelectChange=e=>{let t=+e.target.value,n=this.props.options[t];this.onChange(n)},this.onFocusInput=()=>{this.setState({menuOpened:!0})},this.onBlurInput=e=>{e.relatedTarget===this.caret.current||this.selectContainer.contains(e.relatedTarget)||this.setState({menuOpened:!1,hovered:null}),this.props.onBlur(this.props.value)},this.onCaretClick=()=>{if(this.state.menuOpened)this.setState({menuOpened:!1});else{this.select.getElementsByClassName("fetura-input")[0].getElementsByTagName("input")[0].focus()}},this.onRemoveValueClick=()=>{this.onChange(null)},this.onKeyDownInput=e=>{const{hovered:t,options:n}=this.state;if(n.length){if(38===e.which||40===e.which){let a=0;40===e.which&&(a=t===n.length-1?t:null===t?0:t+1),38===e.which&&(a=t?t-1:0),this.onHoverChange(a);let s=this.selectContainer.children[a];s&&s.scrollIntoView({block:"nearest"})}if(13===e.which){const{insertFirstOnNoSelected:n}=this.props;e.stopPropagation();let a=this.filterOptions(this.props.options,this.state.search);if(this.onChange(a[t]||(this.state.search||n?a[0]:null)),this.select){this.select.getElementsByClassName("fetura-input")[0].getElementsByTagName("input")[0].blur()}}return!1}return!0},this.getPropertiesBasedOnParent=e=>{if(e&&e.parentNode){const t=e.parentNode.className;if(e.parentNode&&t&&(t.match(new RegExp("view-container-modal","g"))||t.match(new RegExp("modal show","g")))){const t=e.parentNode,n=t.getBoundingClientRect(),a=this.select.getBoundingClientRect();return{widthOfMenu:a.width,menuLeft:a.left-n.left,menuTop:a.top+t.scrollTop+a.height,parentName:t.className}}return this.getPropertiesBasedOnParent(e.parentNode)}return!1};const{initialSearch:t}=e;this.state={search:t||"",options:[],menuOpened:!1,hovered:null},this.caret=u.a.createRef(),this.mobileSelect=u.a.createRef()}componentDidMount(){const{search:e}=this.state;""!==e?this.onSearchChange(e):this.generateOptions()}UNSAFE_componentWillReceiveProps(e,t){const{options:n,value:a}=this.props,{search:s}=this.state;l()(n,e.options)&&l()(a,e.value)||this.generateOptions(s,e)}shouldComponentUpdate(e,t,n){const{options:a,error:s,value:o}=this.props;return!l()(a,e.options)||(!l()(s,e.error)||(!l()(o,e.value)||(this.props.disabled!==e.disabled||!l()(this.state,t))))}filterOptions(e,t){return e.filter(e=>{let n=e.name?r()(e.value,e.name,e.name):"object"!==typeof e.value?e.value:"";return n+="",!t||(n.toLowerCase().includes(t.toLowerCase())||n.toLocaleLowerCase().includes("+"))})}getMobileSelectValue(){const{value:e,options:t}=this.props;return s()(t,t=>l()(e,t.value))}getSelectMenuClassName(e,t){let n="select-menu";return e&&(n+=" mobile"),t||(n+=" static"),n}createSelectMenu(e){const{options:t,menuOpened:n}=this.state,{t:a,renderInPortal:s}=this.props;let o=0,r=0,i=0;if(this.select){let e=this.getPropertiesBasedOnParent(this.select);if(e)o=e.widthOfMenu,r=e.menuLeft,i=e.menuTop;else{let e=this.select.getBoundingClientRect();o=e.width,r=e.left,i=e.top+e.height+window.scrollY}}return u.a.createElement(g.a,{in:n,unmountOnExit:!0,onExited:this.onExited,onExit:this.onExit},u.a.createElement("div",{className:this.getSelectMenuClassName(e,s),style:!e&&s?{width:o,left:r,top:i}:{},ref:e=>this.selectContainer=e,tabIndex:1},!e&&u.a.createElement(u.a.Fragment,null,t,0===t.length&&u.a.createElement("p",{className:"empty-list"},u.a.createElement("i",null,a("select.noRecords"))))))}render(){const{search:e,menuOpened:t,options:n}=this.state,{error:a,showIconOnErrorOnWarning:s,warning:o,disabled:r,clearButton:i,renderInPortal:l,autofocus:c}=this.props;let h=this.getPlaceholder(),d=Object(b.a)(),m=this.getPropertiesBasedOnParent(this.select);return u.a.createElement("div",{className:d?"fetura-select mobile":"fetura-select",ref:e=>this.select=e},u.a.createElement(f.a,{type:"search",value:e,onChange:this.onSearchChange,disabled:r,placeholder:h,readOnly:d,error:a,warning:o,onFocus:r?null:this.onFocusInput,onBlur:this.onBlurInput,autofocus:c,onKeyDown:this.onKeyDownInput}),u.a.createElement("div",{className:"fetura-select-icons"},u.a.createElement("i",{className:t?"fas fa-caret-up pointer":"fas fa-caret-down pointer",onClick:d?null:this.onCaretClick,tabIndex:0,ref:this.caret})),d&&u.a.createElement("select",{onChange:this.onMobileSelectChange,value:this.getMobileSelectValue(),ref:this.mobileSelect,disabled:r},u.a.createElement("option",null),n),i&&u.a.createElement("div",{className:"fetura-select-icons clear-button"},u.a.createElement("i",{className:"fas fa-times pointer",onClick:this.onRemoveValueClick})),l&&!m&&p.a.createPortal(this.createSelectMenu(d),document.getElementById("root")||document.createElement("div")),l&&!!m&&!!document.getElementsByClassName(m.parentName)[0]&&p.a.createPortal(this.createSelectMenu(d),document.getElementsByClassName(m.parentName)[0]||document.createElement("div")),s&&(a||o)&&u.a.createElement(E.a,{tooltipContent:a||o,type:a?"error":"warning"},u.a.createElement("div",{className:"input-icon"},u.a.createElement("i",{className:a?"fas fa-exclamation-circle error":"fas fa-exclamation-circle warning"}))))}}y.propTypes={options:m.a.arrayOf(m.a.shape({name:m.a.oneOfType([m.a.string,m.a.number]),value:m.a.oneOfType([m.a.number,m.a.string,m.a.object]).isRequired})).isRequired,onChange:m.a.func,onSearchChange:m.a.func,error:m.a.string,showIconOnErrorOnWarning:m.a.bool,warning:m.a.string,value:m.a.oneOfType([m.a.number,m.a.string,m.a.object]).isRequired,placeholder:m.a.string,clearButton:m.a.bool,disabled:m.a.bool,onBlur:m.a.func,renderInPortal:m.a.bool,initialSearch:m.a.string,autofocus:m.a.bool,insertFirstOnNoSelected:m.a.bool},y.defaultProps={onChange:()=>{},onSearchChange:()=>{},placeholder:"",clearButton:!0,onBlur:()=>{},renderInPortal:!0,insertFirstOnNoSelected:!0};t.a=Object(C.a)()(y)},kG49:function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var a=n("GoyQ"),s=n.n(a),o=n("q1tI"),r=n.n(o),i=n("17x9"),l=n.n(i),c=n("uSQv");function u(){return(u=Object.assign||function(e){for(var t=1;t{return s.a.createElement("text",l({},(n=t,c?{textAnchor:"end",transform:"rotate(-45,".concat(40*n,",140)")}:{}),{fill:"currentColor",fillOpacity:.5,x:40*t+15,y:150}),e);var n}),t.map((e,t)=>s.a.createElement(s.a.Fragment,null,s.a.createElement("rect",{className:Object(i.e)(e),rx:5,ry:5,x:40*t,y:120-(Math.min(e,100)||1),width:"30",height:Math.min(e,100)||1}),r&&s.a.createElement("text",{fill:"currentColor",x:40*t,y:Math.max(120-(Math.min(e,100)||0),20)},e,"%"))))}}c.propTypes={color:r.a.oneOf(["primary","secondary","multi"]),className:r.a.string,values:r.a.array.isRequired,labels:r.a.array,showLabels:r.a.bool,showValue:r.a.bool,skew:r.a.bool},c.defaultProps={color:"multi",className:"",skew:!1,labels:[],showLabels:!1,showValue:!1}},p0Eu:function(e,t,n){},sPOc:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var a=n("q1tI"),s=n.n(a),o=n("VyNe"),r=(n("xOQq"),n("17x9")),i=n.n(r);class l extends s.a.Component{constructor(...e){super(...e),this.onClick=e=>{this.props.onClick()}}render(){const{children:e,fixedWidth:t,className:n,color:a,inactive:r,onContextMenu:i,style:l}=this.props;let c="fetura-row";return c+=t?" fixed-width":"",c+=" "+n,c+=a?" ".concat(a):"",c+=r?" inactive":"",s.a.createElement(o.a,{style:l,className:c,type:"container",colorDensity:50,onClick:this.onClick,onContextMenu:i},e)}}l.propTypes={children:i.a.node.isRequired,fixedWidth:i.a.bool,className:i.a.string,onClick:i.a.func,color:i.a.string,type:i.a.oneOf(["basic","list"]),inactive:i.a.bool,onContextMenu:i.a.func},l.defaultProps={onClick:()=>{},className:"",color:"",type:"basic",inactive:!1}},u86x:function(e,t,n){},v3Gq:function(e,t,n){},x2Ff:function(e,t,n){},xOQq:function(e,t,n){}}]); //# sourceMappingURL=main~830706f4.e2a48f83.chunk.js.map