(this["webpackJsonpgonzo-test-client"]=this["webpackJsonpgonzo-test-client"]||[]).push([[41],{"/Har":function(e,t,a){"use strict";var n=a("q1tI"),r=a.n(n),c=(a("xuHI"),a("17x9")),s=a.n(c),o=a("3Z9Z"),l=a("JI6e");class i extends n.Component{render(){const{data:e}=this.props;return r.a.createElement("div",{className:"checker-container"},e.map((e,t)=>r.a.createElement(o.a,{className:"justify-content-center w-100",key:t},r.a.createElement(l.a,{xs:6},e.label,":"),r.a.createElement(l.a,{xs:6,className:e.valueClassName},e.value))))}}i.propTypes={data:s.a.arrayOf(s.a.shape({label:s.a.string.isRequired,value:s.a.node.isRequired,valueClassName:s.a.string})).isRequired},t.a=i},"5mIH":function(e,t,a){},HrsL:function(e,t,a){},JPoY:function(e,t,a){"use strict";var n=a("Y+p1"),r=a.n(n),c=a("q1tI"),s=a.n(c),o=a("17x9"),l=a.n(o),i=a("uSQv"),m=a("PkbN"),h=(a("lK8g"),a("yLV6")),u=a.n(h);class p extends c.Component{constructor(...e){super(...e),this.state={maxPage:p.getMaxPage(this.props.children)},this.carousel=s.a.createRef()}static getMaxPage(e){let t=s.a.Children.count((Array.isArray(e)?e:[e]).filter(e=>e))-1;return t<0?0:t}static getDerivedStateFromProps(e,t){return{maxPage:p.getMaxPage(e.children)}}componentDidMount(){let e=new u.a(this.carousel.current);e.on("swipeleft",e=>{const{page:t}=this.props,{maxPage:a}=this.state;t!==a&&this.onPageChange(t+1)}),e.on("swiperight",e=>{const{page:t}=this.props;0!==t&&this.onPageChange(t-1)})}shouldComponentUpdate(e,t,a){return this.props.page!==e.page||(!r()(this.props.children,e.children)||!r()(this.state,t))}onPageChange(e){this.props.onPageChange(e)}render(){const{page:e,title:t,children:a}=this.props,{maxPage:n}=this.state;return s.a.createElement("div",{className:"carousel",ref:this.carousel},s.a.createElement("div",{className:"icon-container"},s.a.createElement(i.a,{buttonStyle:"text",disabled:0===e,onClick:()=>this.onPageChange(e-1),type:"button"},s.a.createElement("span",{className:"fa-stack"},s.a.createElement("i",{className:"far fa-chevron-circle-left fa-stack-2x"})))),s.a.createElement("div",{className:"carousel-container"},t&&s.a.createElement("div",{className:"title"},t),s.a.createElement("ul",{className:"carousel-list"},s.a.Children.map((Array.isArray(a)?a:[a]).filter(e=>e),(t,a)=>t&&s.a.cloneElement(t,{page:e,key:a,show:e===a},t.props.children)))),s.a.createElement("div",{className:"icon-container"},s.a.createElement(i.a,{buttonStyle:"text",disabled:e===n,onClick:()=>this.onPageChange(e+1),type:"button"},s.a.createElement("span",{className:"fa-stack"},s.a.createElement("i",{className:"far fa-chevron-circle-right fa-stack-2x"})))))}}p.propTypes={page:l.a.number.isRequired,children:l.a.oneOfType([l.a.arrayOf(l.a.instanceOf(m.a)),l.a.instanceOf(m.a)]).isRequired,onPageChange:l.a.func.isRequired,title:l.a.node},t.a=p},PFzG:function(e,t,a){"use strict";var n=a("q1tI"),r=a.n(n),c=a("17x9"),s=a.n(c),o=a("JPoY"),l=a("PkbN");a("V40o");class i extends n.Component{constructor(...e){super(...e),this.state={page:0},this.onPageChange=e=>{this.setState({page:e})}}onClick(e){this.props.input.onChange(e)}isSelected(e){return this.props.input.value===e}render(){const{data:e,label:t}=this.props,{page:a}=this.state;return r.a.createElement(o.a,{page:a,onPageChange:this.onPageChange,title:t},e.map((e,t)=>r.a.createElement(l.a,{key:t},e.map((e,t)=>r.a.createElement("div",{className:"data-item".concat(this.isSelected(e.value)?" selected":""),key:t,onClick:()=>this.onClick(e.value)},e.name)))))}}i.propTypes={data:s.a.arrayOf(s.a.arrayOf(s.a.shape({name:s.a.string,value:s.a.node}))).isRequired,label:s.a.string},t.a=i},PkbN:function(e,t,a){"use strict";var n=a("q1tI"),r=a.n(n),c=a("17x9"),s=a.n(c),o=a("pQ8y");class l extends n.Component{render(){const{children:e,show:t}=this.props;return r.a.createElement(o.a,{in:t,unmountOnExit:!0,mountOnEnter:!0,timeout:200,appear:!0},r.a.createElement("li",null,e))}}l.propTypes={children:s.a.node,page:s.a.number,show:s.a.bool},t.a=l},SobL:function(e,t,a){"use strict";var n=a("q1tI"),r=a.n(n),c=a("17x9"),s=a.n(c);a("HrsL");class o extends n.Component{constructor(...e){super(...e),this.state={value:0}}getValue(e){const{columns:t,input:{value:a}}=this.props;return+(a+"").padStart(t,"0")[e]}setValue(e,t){const{columns:a,input:{value:n,onChange:r}}=this.props;let c=(n+"").padStart(a,"0").split("");c[e]=t+"",r(+c.join(""))}incrementValue(e){let t=this.getValue(e)+1;10===t&&(t=0),this.setValue(e,t)}decrementValue(e){let t=this.getValue(e)-1;-1===t&&(t=9),this.setValue(e,t)}renderColumns(){const{columns:e}=this.props;let t=[];for(let a=0;athis.incrementValue(a)},r.a.createElement("i",{className:"far fa-plus"}))))),r.a.createElement("div",{className:"value-container"},this.getValue(a)),r.a.createElement("div",{className:"button-container"},r.a.createElement("div",{className:"data-input-button"},r.a.createElement("div",null,r.a.createElement("button",{type:"button",onClick:()=>this.decrementValue(a)},r.a.createElement("i",{className:"far fa-minus"})))))));return t}render(){const{label:e}=this.props;return r.a.createElement("div",{className:"data-input-container"},r.a.createElement("label",null,e),r.a.createElement("div",{className:"data-input big"},this.renderColumns()))}}o.propTypes={columns:s.a.number,label:s.a.string},o.defaultProps={columns:4},t.a=o},V40o:function(e,t,a){},hQYu:function(e,t,a){"use strict";var n=a("q1tI"),r=a.n(n),c=a("3Z9Z"),s=a("JI6e"),o=a("17x9"),l=a.n(o),i=(a("HrsL"),a("wd/R")),m=a.n(i);const h=200,u=100,p=50;class d extends n.Component{constructor(...e){super(...e),this.holdStart=null,this.timeout=null,this.type=null,this.increaseValue=()=>{const{input:{value:e},step:t,max:a,date:n}=this.props;if(n){let n=m()(e).add(t,"day");return n.toDate().getTime()>a&&(n=m()(a)),void this.changeValue(n.format(m.a.HTML5_FMT.DATE))}let r=e+t;r>a&&(r=a),this.changeValue(r)},this.decreaseValue=()=>{const{input:{value:e},step:t,min:a,date:n}=this.props;if(n){let n=m()(e).subtract(t,"day");return n.toDate().getTime(){this.holdStart=null,this.type=null,clearTimeout(this.timeout)},this.onIncrementTouchStart=()=>{this.type="+",this.onTouchStart()},this.onDecrementTouchStart=()=>{this.type="-",this.onTouchStart()},this.disableContextMenu=e=>(e.preventDefault(),!1)}changeValue(e){const{input:{onChange:t},date:a}=this.props;t(a?e:+e.toFixed(1))}getTimoutTime(){let e=(new Date).getTime();return e-this.holdStart<2e3?h:e-this.holdStart<4e3?u:p}startTimeout(){this.timeout=setTimeout(()=>{"+"===this.type?this.increaseValue():this.decreaseValue(),this.startTimeout()},this.getTimoutTime())}onTouchStart(){this.holdStart=(new Date).getTime(),this.startTimeout()}disableMaxValue(){const{input:{value:e},max:t,date:a}=this.props;return a?m()(t).isSame(e,"day"):e===t}render(){const{label:e}=this.props,{input:{value:t},min:a,step:n,valueFormatter:o,date:l}=this.props;return r.a.createElement(c.a,{className:"data-input"},r.a.createElement(s.a,{xs:3,className:"label-container"},e,":"),r.a.createElement(s.a,{xs:3,className:"button-container"},r.a.createElement("div",{className:"data-input-button"},r.a.createElement("div",null,r.a.createElement("button",{onClick:this.decreaseValue,disabled:t===a,type:"button",onTouchStart:this.onDecrementTouchStart,onTouchEnd:this.onTouchEnd,onContextMenu:this.disableContextMenu},r.a.createElement("i",{className:"far fa-minus"}))))),r.a.createElement(s.a,{xs:3,className:"value-container"},r.a.createElement("span",null,o?o(t):l?m()(t).format("DD.MM.YYYY"):t.toFixed(n<1?1:0))),r.a.createElement(s.a,{xs:3,className:"button-container"},r.a.createElement("div",{className:"data-input-button"},r.a.createElement("div",null,r.a.createElement("button",{onClick:this.increaseValue,disabled:this.disableMaxValue(),type:"button",onTouchStart:this.onIncrementTouchStart,onTouchEnd:this.onTouchEnd,onContextMenu:this.disableContextMenu},r.a.createElement("i",{className:"far fa-plus"}))))))}}d.propTypes={label:l.a.string.isRequired,step:l.a.number,min:l.a.number,max:l.a.number,valueFormatter:l.a.func,date:l.a.bool},d.defaultProps={step:1,min:0,max:100},t.a=d},lK8g:function(e,t,a){},w8T5:function(e,t,a){"use strict";var n=a("q1tI"),r=a.n(n),c=a("/MKj"),s=a("UNta"),o=a("3Z9Z"),l=a("JI6e"),i=a("uSQv"),m=(a("5mIH"),a("n7pt")),h=a("vzZS"),u=a("JPoY"),p=a("PkbN"),d=a("msTn"),b=a("55Ip"),f=a("Qn1X"),E=a("ANjH"),g=a("LCzB");function y(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function v(e){for(var t=1;t{this.setState({page:e})},this.onSearchClick=()=>{this.setState({showSearch:!0})},this.hideSearch=()=>{this.setState({showSearch:!1})};const{farm:t,location:{state:a}}=this.props;if(a&&a.locations)return void(this.state=v({},this.state,{chambers:a.locations,filteredChambers:a.locations}));let n=m.a.getAllBuildingsForFarm(t),c=[];for(let r of n)for(let e of r.Sectors)for(let t of e.Chambers)c.push({name:t.CName,value:t,type:e.SType});c.sort((e,t)=>e.type-t.type);let s=c.slice(0);if(a){const{sectorType:e,standsChooser:t,sectorTypes:n}=a;void 0!==e&&(s=s.filter(t=>t.type===e)),n&&(s=s.filter(e=>n.includes(e.type))),t&&(s=s.filter(e=>e.value.Boxes))}this.state=v({},this.state,{chambers:c,filteredChambers:s})}componentDidMount(){const{location:{state:e},history:t,farm:a}=this.props;e||t.push("/".concat(a,"/mobile"))}getClassName(e){switch(e){case d.a.DELIVERY:return"birth";case d.a.MATING:return"mating";case d.a.SOWS:return"sows";case d.a.PIGLET_HOUSE:return"piglets";default:return"other"}}renderCarousel(){const{filteredChambers:e,page:t}=this.state,{farm:a,location:{state:n},t:c}=this.props;let s=[];for(let r=0;rr.a.createElement(p.a,{key:t},r.a.createElement("div",{className:"building-list"},e.map((e,t)=>r.a.createElement(b.Link,{to:{pathname:n.standsChooser?"/".concat(a,"/mobile/standsChooser/").concat(e.value.CID):n.locationNextPath||"/".concat(a,"/mobile/events/").concat(n.eventType,"/").concat(n.status),state:v({},n,{[n.saveName||"location"]:e.value})},className:"building-item ".concat(this.getClassName(e.type)),key:t},r.a.createElement("span",null,e.name))))))))}onFilterClick(e){const{chambers:t}=this.state;let a=void 0===e?t.filter(e=>![d.a.DELIVERY,d.a.MATING,d.a.SOWS,d.a.PIGLET_HOUSE].includes(e.type)):t.filter(t=>t.type===e);const{standsChooser:n}=this.props.location.state;n&&(a=a.filter(e=>e.value.Boxes)),this.setState({filteredChambers:a,page:0})}render(){const{location:{state:e},t:t}=this.props;if(!e)return null;const{breadcrumbs:a}=e,{showSearch:n}=this.state;return r.a.createElement("div",{className:"chooser"},r.a.createElement("div",{className:"h-100 d-flex flex-column ".concat(n?" no-pointer-events":"")},r.a.createElement(s.a,{breadcrumbs:a,back:!0}),r.a.createElement(o.a,{className:"button-container"},r.a.createElement(l.a,{xs:2},r.a.createElement(i.a,{buttonStyle:"text",onClick:this.onSearchClick},r.a.createElement("span",{className:"fa-stack"},r.a.createElement("i",{className:"far fa-circle fa-stack-2x"}),r.a.createElement("i",{className:"far fa-search fa-stack-1x"}))))),this.renderCarousel()),r.a.createElement(f.a,{onCloseClick:this.hideSearch,show:n},r.a.createElement("div",{className:"building-list"},r.a.createElement("div",{className:"building-item birth",onClick:()=>this.onFilterClick(d.a.DELIVERY)},t("SType.3")),r.a.createElement("div",{className:"building-item mating",onClick:()=>this.onFilterClick(d.a.MATING)},t("SType.0")),r.a.createElement("div",{className:"building-item sows",onClick:()=>this.onFilterClick(d.a.SOWS)},t("SType.1")),r.a.createElement("div",{className:"building-item piglets",onClick:()=>this.onFilterClick(d.a.PIGLET_HOUSE)},t("SType.6")),r.a.createElement("div",{className:"building-item other",onClick:()=>this.onFilterClick()},t("modals.feedingExtraFeedingModal.other")))))}}t.a=Object(E.d)(Object(c.connect)((function(e){return{farm:e.location.farm}})),Object(g.a)())(x)},xIcE:function(e,t,a){"use strict";a.r(t);var n=a("q1tI"),r=a.n(n),c=a("/MKj"),s=a("Ty5D"),o=a("kfzW"),l=a("cIZt"),i=a("WHtF"),m=(a("yCfq"),a("UNta")),h=(a("5mIH"),a("i8MS")),u=a("O7Gx"),p=a("vzZS"),d=a("JPoY"),b=a("PkbN"),f=a("uSQv"),E=a("3Z9Z"),g=a("JI6e"),y=a("Qn1X"),v=a("kCVf"),O=a("0MVo"),x=a("ANjH"),C=a("LCzB");function S(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function N(e){for(var t=1;t{this.setState({page:e})},this.onSearchClick=()=>{this.setState({showSearch:!0})},this.hideSearch=()=>{this.setState({showSearch:!1})},this.onKeyboardChange=e=>{let t=this.state.animals.slice(0);e&&(t=t.filter(t=>t.AnmNo1&&t.AnmNo1.includes(e))),t.sort((e,t)=>Object(O.b)(e.AnmNo1,t.AnmNo1,{numeric:!0})),this.setState({filteredAnimals:t,page:0})},this.onSaveClick=()=>{const{location:{state:e},history:t,farm:a}=this.props,{eventType:n,status:r,animalScannerNextPath:c,insertAs:s,insertAsObject:o,additionalState:l}=e,{selectedAnimals:i}=this.state;t.push({pathname:c||"/".concat(a,"/mobile/events/").concat(n,"/").concat(r),state:N({},e,{},l,{[s||"animals"]:o?i[0]:i})})};const{farm:t,location:{state:a}}=this.props;let n=a?a.animalType:void 0,r=a?a.location:void 0,c=[];if(Array.isArray(n))for(let s of n)c=[...c,...h.a.getAllAnimals(t,s,!1,!1)];else c=h.a.getAllAnimals(t,n,!1,!1);if(r){console.log(r);let e=Object(v.j)(r);c=c.filter(t=>Array.isArray(t.PlcmntID)?!!t.PlcmntID.find(t=>t.PlcmntID===e):t.PlcmntID===e)}c.sort((e,t)=>Object(O.b)(e.AnmNo1,t.AnmNo1,{numeric:!0})),this.state=N({},this.state,{animals:c,filteredAnimals:c})}componentDidMount(){const{location:{state:e},history:t,farm:a}=this.props;e||t.push("/".concat(a,"/mobile"))}onAnimalClick(e){const{location:{state:{singleSelect:t}}}=this.props;if(t)this.setState({selectedAnimals:[e]});else{let t=this.state.selectedAnimals.slice(0);t.includes(e)?t=t.filter(t=>t.AnmID!==e.AnmID):t.push(e),this.setState({selectedAnimals:t})}}isSelected(e){return this.state.selectedAnimals.includes(e)}renderAnimals(){const{location:{state:{singleSelect:e}},t:t}=this.props,{filteredAnimals:a,page:n}=this.state;let c=[];for(let r=0;rr.a.createElement(b.a,null,r.a.createElement("ul",null,e.map((e,t)=>r.a.createElement("li",{key:t,onClick:()=>this.onAnimalClick(e)},r.a.createElement("div",{className:"animal-item".concat(this.isSelected(e)?" selected":"")},r.a.createElement("div",null,e.AnmNo1))))))))}render(){const{location:{state:e}}=this.props;if(!e)return null;const{breadcrumbs:t}=e,{showSearch:a,selectedAnimals:n}=this.state;return r.a.createElement("div",{className:"chooser"},r.a.createElement("div",{className:"h-100 d-flex flex-column ".concat(a?" no-pointer-events":"")},r.a.createElement(m.a,{breadcrumbs:t,back:!0}),r.a.createElement(E.a,{className:"button-container"},r.a.createElement(g.a,{xs:2},r.a.createElement(f.a,{buttonStyle:"text",onClick:this.onSearchClick},r.a.createElement("span",{className:"fa-stack"},r.a.createElement("i",{className:"far fa-circle fa-stack-2x"}),r.a.createElement("i",{className:"far fa-search fa-stack-1x"})))),r.a.createElement(g.a,{xs:2},r.a.createElement(f.a,{buttonStyle:"text",disabled:0===n.length,onClick:this.onSaveClick},r.a.createElement("span",{className:"fa-stack"},r.a.createElement("i",{className:"far fa-check-circle fa-stack-2x"}))))),this.renderAnimals()),r.a.createElement(y.a,{show:a,onCloseClick:this.hideSearch},r.a.createElement(u.a,{onChange:this.onKeyboardChange})))}}var k=Object(x.d)(Object(c.connect)((function(e){return{farm:e.location.farm}})),Object(C.a)())(P),w=a("y56K"),T=a("nvgG"),D=a("z8nH"),A=a("QlZX"),I=a("D/Sb"),G=a("N/7s"),F=a("IpKG"),M=a("Yt9o"),V=a("coZU"),L=a("BjAU"),H=a("rNy8"),q=a("Ans+"),z=a("jcAX"),R=a("q3Os"),B=a("TfRj"),W=a("0hjh"),Y=a("xKf4"),_=a("w8T5"),K=a("n7pt"),Z=a("55Ip");function Q(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function U(e){for(var t=1;t{this.setState({page:e})},this.onSearchClick=()=>{this.setState({showSearch:!0})},this.hideSearch=()=>{this.setState({showSearch:!1})},this.onKeyboardChange=e=>{let t=this.state.stands.slice(0);e&&(t=t.filter(t=>t.BoxesName.includes(e))),this.setState({filteredStands:t,page:0})};const{match:{params:{CID:t}}}=this.props;let a=K.a.getTreeByLocationID(t).chamber;this.state=U({},this.state,{stands:a.Boxes,filteredStands:a.Boxes})}componentDidMount(){const{location:{state:e},history:t,farm:a}=this.props;e||t.push("/".concat(a,"/mobile"))}renderCarousel(){const{filteredStands:e,page:t}=this.state,{farm:a,location:{state:n},t:c}=this.props;let s=[];for(let r=0;rr.a.createElement(b.a,{key:t},r.a.createElement("ul",null,e.map((e,t)=>r.a.createElement("li",{key:t},r.a.createElement(Z.Link,{className:"animal-item",to:{pathname:n.locationNextPath||"/".concat(a,"/mobile/events/").concat(n.eventType,"/").concat(n.status),state:U({},n,{stand:e})}},r.a.createElement("div",null,e.BoxesName))))))))}render(){const{location:{state:e}}=this.props;if(!e)return null;const{breadcrumbs:t}=e,{showSearch:a}=this.state;return console.log(this.state),r.a.createElement("div",{className:"chooser"},r.a.createElement("div",{className:"h-100 d-flex flex-column ".concat(a?" no-pointer-events":"")},r.a.createElement(m.a,{breadcrumbs:t,back:!0}),r.a.createElement(E.a,{className:"button-container"},r.a.createElement(g.a,{xs:2},r.a.createElement(f.a,{buttonStyle:"text",onClick:this.onSearchClick},r.a.createElement("span",{className:"fa-stack"},r.a.createElement("i",{className:"far fa-circle fa-stack-2x"}),r.a.createElement("i",{className:"far fa-search fa-stack-1x"}))))),this.renderCarousel()),r.a.createElement(y.a,{onCloseClick:this.hideSearch,show:a},r.a.createElement(u.a,{onChange:this.onKeyboardChange})))}}var $=Object(x.d)(Object(c.connect)((function(e){return{farm:e.location.farm}})),Object(C.a)())(X),ee=a("Wgxh"),te=a("X73m"),ae=a("aIXM"),ne=a("msTn"),re=a("I8zd");function ce(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function se(e){for(var t=1;t0===h.a.getAllAnimalsForLocation(e,re.a.CHAMBER).length).length>0},this.changePage=e=>{this.setState({page:e})},this.onSearchClick=()=>{this.setState({showSearch:!0})},this.hideSearch=()=>{this.setState({showSearch:!1})},this.onKeyboardChange=e=>{let t=this.state.groups.slice(0);e&&(t=t.filter(t=>t.GrNo1.includes(e))),this.setState({filteredGroups:t,page:0})};const{farm:t}=this.props;let a=ae.a.getAllGroups(t).sort((e,t)=>e.GrNo1.localeCompare(t.GrNo1,void 0,{numeric:!0}));this.state=se({},this.state,{groups:a,filteredGroups:a})}componentDidMount(){const{location:{state:e},history:t,farm:a}=this.props;e||t.push("/".concat(a,"/mobile"))}renderGroups(){const{page:e,hasEmptyChambers:t}=this.state,{location:{state:a},farm:n,t:c}=this.props,{eventType:s,status:o,groupsNextPath:l}=a;let i=[],m=this.state.filteredGroups.slice(0);t&&m.unshift({newGroup:!0});for(let r=0;rr.a.createElement(b.a,{key:t},r.a.createElement("ul",null,e.map((e,t)=>r.a.createElement("li",{key:t},r.a.createElement(Z.Link,{className:"animal-item",to:{pathname:e.newGroup?"/".concat(n,"/mobile/groupChooser/newGroup"):l||"/".concat(n,"/mobile/events/").concat(s,"/").concat(o),state:se({},a,{group:e})}},r.a.createElement("div",null,e.newGroup?c("new"):e.GrNo1))))))))}render(){const{location:{state:e}}=this.props;if(!e)return null;const{breadcrumbs:t}=e,{showSearch:a}=this.state;return r.a.createElement("div",{className:"chooser"},r.a.createElement("div",{className:"h-100 d-flex flex-column ".concat(a?" no-pointer-events":"")},r.a.createElement(m.a,{breadcrumbs:[...t.map(t=>se({},t,{link:se({},t.link,{state:e})})),{name:"Grupa"}],back:!0}),r.a.createElement(E.a,{className:"button-container"},r.a.createElement(g.a,{xs:2},r.a.createElement(f.a,{buttonStyle:"text",onClick:this.onSearchClick},r.a.createElement("span",{className:"fa-stack"},r.a.createElement("i",{className:"far fa-circle fa-stack-2x"}),r.a.createElement("i",{className:"far fa-search fa-stack-1x"}))))),this.renderGroups()),r.a.createElement(y.a,{onCloseClick:this.hideSearch,show:a},r.a.createElement(u.a,{onChange:this.onKeyboardChange})))}}var ie=Object(x.d)(Object(c.connect)((function(e){return{farm:e.location.farm}})),Object(C.a)())(le),me=a("wQmL"),he=a("d/v1"),ue=a("pJVQ"),pe=a("SobL"),de=(a("Q+eR"),a("jjk5"));function be(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function fe(e){for(var t=1;t{this.props.dispatch(Object(me.b)("newGroup"))};const{location:{state:t},history:a,farm:n}=this.props;t?this.props.initialize({GrNo1:0}):a.push("/".concat(n,"/mobile"))}render(){const{location:{state:e},handleSubmit:t,error:a,submitFailed:n,submitting:c,t:s}=this.props;if(!e)return null;const{breadcrumbs:o}=e;return r.a.createElement("div",{className:"event-status-view"},r.a.createElement(m.a,{breadcrumbs:[...o.map(t=>ve({},t,{link:ve({},t.link,{state:e})})),{name:"Grupa"}],back:!0}),r.a.createElement("form",{onSubmit:t},r.a.createElement("div",{className:"submit"},r.a.createElement(f.a,{buttonStyle:"text"},r.a.createElement("span",{className:"fa-stack"},r.a.createElement("i",{className:"far fa-circle fa-stack-2x"}),r.a.createElement("i",{className:"far fa-chevron-right fa-stack-1x"})))),r.a.createElement(E.a,{className:"justify-content-center h-100"},r.a.createElement(g.a,{xs:8},r.a.createElement(he.a,{name:"GrNo1",component:pe.a,label:s("rfidApp.newGroupNumber")+":",columns:5}))),r.a.createElement(ge.a,{onCloseClick:this.onCloseClick,error:a,show:n&&!c})))}}xe=Object(ue.a)({form:"newGroup",onSubmit:function(e,t,a){let n=function(e,t){const a={};0===e.GrNo1?a._error="Numer grupy musi by\u0107 wi\u0119kszy od 1":ae.a.checkIfGroupExistsOnFarm(e.GrNo1+"",t.farm)&&(a._error="Podany numer grupy ju\u017c istnieje");return a}(e,a);if(n._error)throw new de.a(n);const{farm:r,location:{state:c}}=a,{eventType:s,status:o,groupsNextPath:l}=c,{GrNo1:i}=e;a.history.push({pathname:l||"/".concat(r,"/mobile/events/").concat(s,"/").concat(o),state:fe({},c,{groupNumber:i,group:null})})}})(xe);var Ce=Object(x.d)(Object(c.connect)((function(e){return{farm:e.location.farm}})),Object(C.a)())(xe),Se=a("xYWq"),Ne=a("i2bF"),je=a("ZGuV"),Pe=a("wb+A"),ke=a("R02O"),we=a("BVRj"),Te=a("Y+p1"),De=a.n(Te);function Ae(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function Ie(e){for(var t=1;t{this.setState({page:e})}}static getMedicines(e){let t=[];const{medicines:a,location:{state:n}}=e;let r=a.slice(0);n&&void 0!==n.medicineType&&(r=r.filter(e=>e.WData.Type===n.medicineType));for(let c=0;cr.a.createElement(b.a,{key:n},r.a.createElement("ul",null,a.map((a,n)=>r.a.createElement("li",{key:n},r.a.createElement(Z.Link,{to:{pathname:"/".concat(t,"/mobile/events/").concat(c,"/").concat(s),state:Ie({},e,{medicine:a})},className:"animal-item"},r.a.createElement("div",null,a.WData.Name),r.a.createElement("div",{className:"color",style:{background:a.WData.Color||"#FFFFFF"}})))))))))}}var Me=Object(x.d)(Object(c.connect)((function(e){return{farm:e.location.farm,medicines:e.dictionary.medicine}})),Object(C.a)())(Fe),Ve=a("q4jl"),Le=a("4Wsv"),He=a("BmzB"),qe=a("HUiU"),ze=a("ghmW"),Re=a("HeQI"),Be=a("y1NX"),We=a("xsWg"),Ye=a("pIGC"),_e=a("0Ogf"),Ke=a("u07V"),Ze=a("1F3U"),Qe=a("ZeZ+"),Ue=a("6m9I"),Je=a("WaAb"),Xe=a("QOjb"),$e=a("05li"),et=a("XwIL"),tt=a("Qjbh"),at=a("HdSz"),nt=a("r183"),rt=a("VeD8"),ct=a("pQ8y");function st(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function ot(e){for(var t=1;t{this.props.dispatch(Object(me.b)("newGroup"))};const{location:{state:t},history:a,farm:n}=this.props;t?this.props.initialize({AnmNo1:0}):a.push("/".concat(n,"/mobile"))}render(){const{location:{state:e},handleSubmit:t,error:a,submitFailed:n,submitting:c,t:s}=this.props;if(!e)return null;const{breadcrumbs:o}=e;return r.a.createElement("div",{className:"event-status-view"},r.a.createElement(m.a,{breadcrumbs:o,back:!0}),r.a.createElement("form",{onSubmit:t},r.a.createElement("div",{className:"submit"},r.a.createElement(f.a,{buttonStyle:"text"},r.a.createElement("span",{className:"fa-stack"},r.a.createElement("i",{className:"far fa-circle fa-stack-2x"}),r.a.createElement("i",{className:"far fa-chevron-right fa-stack-1x"})))),r.a.createElement(E.a,{className:"justify-content-center h-100"},r.a.createElement(g.a,{xs:8},r.a.createElement(he.a,{name:"AnmNo1",component:pe.a,label:s("rfidApp.newAnimalNumber")+":",columns:5}))),r.a.createElement(ge.a,{onCloseClick:this.onCloseClick,error:a,show:n&&!c})))}}it=Object(ue.a)({form:"newGroup",onSubmit:function(e,t,a){let n=function(e,t){const a={};0===e.GrNo1?a._error="Numer zwierz\u0119cia musi by\u0107 wi\u0119kszy od 1":h.a.checkIfAnimalExistOnFarm(e.AnmNo1+"",t.farm)&&(a._error="Podany numer zwierz\u0119cia ju\u017c istnieje");return a}(e,a);if(n._error)throw new de.a(n);const{farm:r,location:{state:c}}=a,{eventType:s,status:o}=c,{AnmNo1:l}=e;a.history.push({pathname:"/".concat(r,"/mobile/events/").concat(s,"/").concat(o),state:ot({},c,{animalNumber:l})})}})(it);var mt=Object(x.d)(Object(c.connect)((function(e){return{farm:e.location.farm}})),Object(C.a)())(it),ht=a("hJU4"),ut=a("I+i7"),pt=a("JxIW"),dt=a("hnqp"),bt=a("Yp4W"),ft=a("Ccvl"),Et=a("KaR+"),gt=a("Dda9"),yt=a("5axh"),vt=a("7zge"),Ot=a("Lu3o"),xt=a("x6gN"),Ct=a("x5BS"),St=a.n(Ct),Nt=a("KExv"),jt=a("C2jH"),Pt=a("HBNl"),kt=a("hTRX"),wt=a("jGfq"),Tt=a("cr+I"),Dt=a.n(Tt),At=a("9MCJ"),It=a("XO5I"),Gt=a("VesG"),Ft=a("Iw7P");class Mt extends n.Component{constructor(e){super(e),this.state={showFullScreen:!0},this.interval=null,this.fullScreenChangeListener=()=>{this.setState({showFullScreen:!!document.fullscreenElement})},this.onEnableFullScreenClick=async()=>{try{await document.documentElement.requestFullscreen(),await screen.orientation.lock("landscape")}catch(e){console.error(e)}};const{dispatch:t,location:a}=this.props;let n=Dt.a.parse(a.search);t({type:"HIDE_SIDE_NAVIGATION"}),t({type:"MOBILE_SET_SHOW_BREEDING",payload:"true"===n.breeding})}async registerSync(){try{let e=await navigator.serviceWorker.ready;await e.sync.register("fetura-sync")}catch(e){console.error("Error while registering background sync",e)}}async componentDidMount(){document.getElementsByTagName("body")[0].classList.add("rfid-app");try{document.addEventListener("fullscreenchange",this.fullScreenChangeListener),await document.documentElement.requestFullscreen(),await screen.orientation.lock("landscape")}catch(e){console.error(e)}await St()()||this.registerSync(),this.interval=setInterval(async()=>{await St()()||this.registerSync()},1e4)}async componentWillUnmount(){clearInterval(this.interval);try{document.removeEventListener("fullscreenchange",this.fullScreenChangeListener),await document.exitFullscreen(),await screen.orientation.unlock()}catch(e){console.error(e)}}render(){const{farm:e,location:t,t:a}=this.props,{showFullScreen:n}=this.state;return r.a.createElement(r.a.Fragment,null,r.a.createElement(rt.a,{className:"rfid-scanner-main-view"+(n?"":" blur")},r.a.createElement(ct.a,{key:t.key,classNames:"fade",timeout:300},r.a.createElement(s.g,{location:t},r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/parturition"),render:e=>r.a.createElement(l.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/parturition/start"),render:e=>r.a.createElement(w.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/parturition/status"),render:e=>r.a.createElement(T.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/parturition/end"),render:e=>r.a.createElement(D.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/insemination"),render:e=>r.a.createElement(A.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/insemination/status"),render:e=>r.a.createElement(M.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/insemination/end"),render:e=>r.a.createElement(I.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/insemination/end/info"),render:e=>r.a.createElement(V.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/usg"),render:e=>r.a.createElement(L.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/usg/result"),render:e=>r.a.createElement(H.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/usg/check"),render:e=>r.a.createElement(q.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/usg/result/:status"),render:e=>r.a.createElement(z.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/usg/repeat"),render:e=>r.a.createElement(R.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/noPregnancy"),render:e=>r.a.createElement(B.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/noPregnancy/:reasonID"),render:e=>r.a.createElement(W.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/separationToPigletHouse"),render:e=>r.a.createElement(Gt.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/separationToPigletHouse/location"),render:e=>r.a.createElement(nt.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/separationToPigletHouse/single"),render:e=>r.a.createElement(Ft.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/separationToPigletHouse/chamber"),render:e=>r.a.createElement(ee.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/mommy"),render:e=>r.a.createElement(Se.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/mommy/get"),render:e=>r.a.createElement(Ne.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/mommy/add"),render:e=>r.a.createElement(je.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/grafting"),render:e=>r.a.createElement(Pe.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/grafting/dosatron"),render:e=>r.a.createElement(ke.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/grafting/vaccine"),render:e=>r.a.createElement(we.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/grafting/forage"),render:e=>r.a.createElement(Ve.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/grafting/:medicineType/add"),render:e=>r.a.createElement(Le.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/grafting/:medicineType/end"),render:e=>r.a.createElement(bt.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/grafting/:medicineType/unfinished"),render:e=>r.a.createElement(ft.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/checkGrafting/animal"),render:e=>r.a.createElement(At.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/fallPiglets"),render:e=>r.a.createElement(He.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/fallPiglets/:reasonID"),render:e=>r.a.createElement(qe.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/fall"),render:e=>r.a.createElement(ze.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/fall/:reasonID"),render:e=>r.a.createElement(Re.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/selection"),render:e=>r.a.createElement(Be.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/selection/:reasonID"),render:e=>r.a.createElement(We.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/weighting"),render:e=>r.a.createElement(Ye.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/weighting/:reasonID"),render:e=>r.a.createElement(_e.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/activeNipples/add"),render:e=>r.a.createElement(Ke.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/graftingPiglets"),render:e=>r.a.createElement(Ze.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/graftingPiglets/vaccine"),render:e=>r.a.createElement(Qe.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/graftingPiglets/forage"),render:e=>r.a.createElement(Ue.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/graftingPiglets/castration"),render:e=>r.a.createElement(Je.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/graftingPiglets/castration/add"),render:e=>r.a.createElement(Xe.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/graftingPiglets/:medicineType/add"),render:e=>r.a.createElement($e.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/transfer"),render:e=>r.a.createElement(et.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/transfer/stand"),render:e=>r.a.createElement(tt.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/transfer/chamber"),render:e=>r.a.createElement(at.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/sell"),render:e=>r.a.createElement(ht.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/sell/animal"),render:e=>r.a.createElement(ut.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/sell/location"),render:e=>r.a.createElement(pt.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/insertion"),render:e=>r.a.createElement(Et.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/insertion/:animalKind"),render:e=>r.a.createElement(gt.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/reclassify/add"),render:e=>r.a.createElement(yt.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/treatment/medicine"),render:e=>r.a.createElement(vt.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/treatment/reason"),render:e=>r.a.createElement(It.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/treatment/add"),render:e=>r.a.createElement(Ot.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/heat"),render:e=>r.a.createElement(xt.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/heat/toInsemination"),render:e=>r.a.createElement(G.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/heat/heatExamination"),render:e=>r.a.createElement(F.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/search"),render:e=>r.a.createElement(jt.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/search/:type"),render:e=>r.a.createElement(Pt.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/events/change/rfid"),render:e=>r.a.createElement(kt.a,e),exact:!0}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/scanner"),exact:!0,render:e=>r.a.createElement(i.a,e)}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/locationScanner"),exact:!0,render:e=>r.a.createElement(Y.a,e)}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/groupScanner"),exact:!0,render:e=>r.a.createElement(te.a,e)}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/animalChooser"),exact:!0,render:e=>r.a.createElement(k,e)}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/locationChooser"),exact:!0,render:e=>r.a.createElement(_.a,e)}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/groupChooser"),exact:!0,render:e=>r.a.createElement(ie,e)}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/groupChooser/newGroup"),exact:!0,render:e=>r.a.createElement(Ce,e)}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/animalChooser/newAnimal"),exact:!0,render:e=>r.a.createElement(mt,e)}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/standsChooser/:CID"),exact:!0,render:e=>r.a.createElement($,e)}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/medicineChooser"),exact:!0,render:e=>r.a.createElement(Me,e)}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/information/:AnmID"),exact:!0,render:e=>r.a.createElement(dt.a,e)}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/locationInformation/:locationID"),exact:!0,render:e=>r.a.createElement(wt.a,e)}),r.a.createElement(s.d,{path:"/".concat(e,"/mobile/history"),exact:!0,render:e=>r.a.createElement(Nt.a,e)}),r.a.createElement(s.d,{render:e=>r.a.createElement(o.a,e)})))),!n&&r.a.createElement("div",{className:"no-fullscreen"},r.a.createElement("span",{className:"fa-stack"},r.a.createElement("i",{className:"far fa-expand fa-stack-1x"}),r.a.createElement("i",{className:"far fa-ban fa-stack-2x"})),r.a.createElement("div",null,a("rfidApp.fullScreenRequired")),r.a.createElement(f.a,{buttonColor:"success",icon:r.a.createElement("i",{className:"far fa-expand"}),onClick:this.onEnableFullScreenClick,type:"button"},a("rfidApp.turnFullScreenOn"))))}}t.default=Object(x.d)(Object(C.a)(),Object(c.connect)((function(e){return{farm:e.location.farm}})))(Mt)},xuHI:function(e,t,a){},yCfq:function(e,t,a){}}]); //# sourceMappingURL=main~6b3b7103.f9b8766e.chunk.js.map