text: (window.webpackJsonp=window.webpackJsonp||[]).push([[84],{1501:function(e,t,n){"use strict";n.r(t);var a=n(24),r=n.n(a),o=n(25),s=n.n(o),c=n(26),i=n.n(c),l=n(27),u=n.n(l),m=n(16),d=n.n(m),p=n(0),f=n.n(p),E=n(32),g=n(198),N=n(716),h=n(22),v=n.n(h),y=n(6),b=n.n(y),C=n(4),A=n(7),I=n.n(A),O=n(108),R=n(696),T=n(723),D=n(692),k=n(694);function S(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 _(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?S(Object(n),!0).forEach((function(t){b()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function P(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=d()(e);if(t){var r=d()(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return u()(this,n)}}I.a.locale("nl");var L=function(e){i()(n,e);var t=P(n);function n(e){var a;return r()(this,n),a=t.call(this,e),b()(v()(a),"handleInputChange",(function(e){var t=e.target,n="checkbox"===t.type?t.checked:t.value,r=t.name;a.setState(_(_({},a.state),{},{intake:_(_({},a.state.intake),{},b()({},r,n))}))})),b()(v()(a),"handleSourceIds",(function(e){a.setState(_(_({},a.state),{},{intake:_(_({},a.state.intake),{},{sourceIds:e})}))})),b()(v()(a),"handleIntakeReasonsIds",(function(e){a.setState(_(_({},a.state),{},{intake:_(_({},a.state.intake),{},{intakeReasonIds:e})}))})),b()(v()(a),"handleSubmit",(function(e){e.preventDefault();var t=a.state.intake;t.intakeReasonIds.length>0&&(t.intakeReasonIds=t.intakeReasonIds.split(",")),t.sourceIds.length>0&&(t.sourceIds=t.sourceIds.split(",")),O.a.newIntake(t).then((function(e){C.f.push("/intake/".concat(e.data.id))}))})),a.state={intake:{contactId:e.contactId,addressId:e.addressId,campaignId:e.campaigns[0].id,statusId:"1",sourceIds:"",intakeReasonIds:"",note:""}},a}return s()(n,[{key:"render",value:function(){var e=this.state.intake,t=e.addressId,n=e.statusId,a=e.sourceIds,r=e.campaignId,o=e.intakeReasonIds,s=e.note,c=this.props.contactDetails,i=c.addresses,l=void 0===i?[]:i,u=c.fullName;return f.a.createElement("form",{className:"form-horizontal",onSubmit:this.handleSubmit},f.a.createElement("div",{className:"row"},f.a.createElement(k.a,{name:"contact",label:"Contact",value:u,readOnly:!0}),f.a.createElement("div",{className:"form-group col-sm-6"},f.a.createElement("label",{htmlFor:"addressId",className:"col-sm-6"},"Adres"),f.a.createElement("div",{className:"col-sm-6"},f.a.createElement("select",{className:"form-control input-sm",id:"addressId",name:"addressId",value:t,onChange:this.handleInputChange},l.map((function(e,t){return f.a.createElement("option",{key:t,value:e.id},e.street+" "+e.number+", "+e.city)})))))),f.a.createElement("div",{className:"row"},f.a.createElement(R.a,{label:"Campagne",name:"campaignId",value:r,options:this.props.campaigns,onChangeAction:this.handleInputChange,required:!0,emptyOption:!1}),f.a.createElement(R.a,{label:"Status",size:"col-sm-6",name:"statusId",value:n,options:this.props.intakeStatuses,onChangeAction:this.handleInputChange})),f.a.createElement("div",{className:"row"},f.a.createElement(T.a,{label:"Aanmeldingsbron",name:"sourceIds",value:a,options:this.props.intakeSources.sort((function(e,t){var n=e.name.toLowerCase(),a=t.name.toLowerCase(),r=0;return n>a?r=1:n<a&&(r=-1),r})),onChangeAction:this.handleSourceIds}),f.a.createElement(T.a,{label:"Wat is belangrijk",name:"intakeReasonIds",value:o,options:this.props.intakeReasons,onChangeAction:this.handleIntakeReasonsIds})),f.a.createElement("div",{className:"row"},f.a.createElement("div",{className:"form-group col-sm-12"},f.a.createElement("div",{className:"row"},f.a.createElement("div",{className:"col-sm-3"},f.a.createElement("label",{htmlFor:"note",className:"col-sm-12"},"Opmerking van bewoner")),f.a.createElement("div",{className:"col-sm-8"},f.a.createElement("textarea",{name:"note",value:s,onChange:this.handleInputChange,className:"form-control input-sm"}))))),f.a.createElement("div",{className:"panel-footer"},f.a.createElement("div",{className:"pull-right btn-group",role:"group"},f.a.createElement(D.a,{buttonText:"Opslaan",onClickAction:this.handleSubmit}))))}}]),n}(p.Component),w=Object(E.b)((function(e){return{intakeStatuses:e.systemData.intakeStatuses,intakeSources:e.systemData.intakeSources,intakeReasons:e.systemData.intakeReasons,campaigns:e.systemData.campaigns,buildingTypes:e.systemData.buildingTypes,contactDetails:e.contactDetails}}),null)(L),M=n(690),x=n(691),U=function(e){return f.a.createElement("div",null,f.a.createElement(M.a,null,f.a.createElement(x.a,null,f.a.createElement(w,{contactId:e.contactId,addressId:e.addressId}))))},q=n(693),j=function(e){return f.a.createElement("div",{className:"row"},f.a.createElement("div",{className:"col-md-4"},f.a.createElement("div",{className:"btn-group",role:"group"},f.a.createElement(q.a,{iconName:"glyphicon-arrow-left",onClickAction:C.e.goBack}))),f.a.createElement("div",{className:"col-md-4"},f.a.createElement("h4",{className:"text-center"},"Nieuwe intake")),f.a.createElement("div",{className:"col-md-4"}))};function z(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,a=d()(e);if(t){var r=d()(this).constructor;n=Reflect.construct(a,arguments,r)}else n=a.apply(this,arguments);return u()(this,n)}}var B=function(e){i()(n,e);var t=z(n);function n(e){return r()(this,n),t.call(this,e)}return s()(n,[{key:"componentDidMount",value:function(){Object(g.isEmpty)(this.props.contactDetails)&&this.props.fetchContactDetails(this.props.params.contactId)}},{key:"render",value:function(){return f.a.createElement("div",{className:"row"},f.a.createElement("div",{className:"col-md-9"},f.a.createElement("div",{className:"col-md-12 margin-10-top"},f.a.createElement(j,{contactId:this.props.params.contactId})),f.a.createElement("div",{className:"col-md-12 margin-10-top"},f.a.createElement(U,{contactId:this.props.params.contactId,addressId:this.props.params.addressId}))),f.a.createElement("div",{className:"col-md-3"}))}}]),n}(p.Component);t.default=Object(E.b)((function(e){return{contactDetails:e.contactDetails}}),(function(e){return{fetchContactDetails:function(t){e(Object(N.h)(t))}}}))(B)},690:function(e,t,n){"use strict";var a=n(0),r=n.n(a),o=n(8),s=n.n(o),c=function(e){var t=e.children,n=e.className,a=e.onMouseEnter,o=e.onMouseLeave;return r.a.createElement("div",{className:"panel panel-default ".concat(n),onMouseEnter:a,onMouseLeave:o},t)};c.defaultProps={className:"",onMouseEnter:function(){},onMouseLeave:function(){}},c.propTypes={className:s.a.string,onMouseEnter:s.a.func,onMouseLeave:s.a.func},t.a=c},691:function(e,t,n){"use strict";var a=n(0),r=n.n(a),o=n(8),s=n.n(o),c=function(e){var t=e.className,n=e.children;return r.a.createElement("div",{className:"panel-body ".concat(t)},n)};c.defaultProps={className:""},c.propTypes={className:s.a.string},t.a=c},692:function(e,t,n){"use strict";var a=n(0),r=n.n(a),o=n(8),s=n.n(o),c=function(e){var t=e.buttonClassName,n=e.buttonText,a=e.onClickAction,o=e.type,s=e.value,c=e.loading,i=e.loadText,l=e.disabled;return c?r.a.createElement("button",{type:o,className:"btn btn-sm btn-loading ".concat(t),value:s,disabled:c},r.a.createElement("span",{className:"glyphicon glyphicon-refresh glyphicon-refresh-animate"})," ",i):r.a.createElement("button",{type:o,className:"btn btn-sm ".concat(t),onClick:a,value:s,disabled:l},n)};c.defaultProps={buttonClassName:"btn-success",type:"button",value:"",loading:!1,loadText:"Aan het laden",disabled:!1},c.propTypes={buttonClassName:s.a.string,buttonText:s.a.string.isRequired,onClickAction:s.a.func,type:s.a.string,value:s.a.string,loading:s.a.bool,loadText:s.a.string,disabled:s.a.bool},t.a=c},693:function(e,t,n){"use strict";var a=n(0),r=n.n(a),o=n(8),s=n.n(o),c=function(e){var t=e.buttonClassName,n=e.iconName,a=e.onClickAction,o=e.title,s=e.disabled;return r.a.createElement("button",{type:"button",className:"btn ".concat(t),onClick:a,disabled:s,title:o},r.a.createElement("span",{className:"glyphicon ".concat(n)}))};c.defaultProps={buttonClassName:"btn-success btn-sm",title:"",disabled:!1},c.propTypes={buttonClassName:s.a.string,iconName:s.a.string.isRequired,onClickAction:s.a.func,title:s.a.string,disabled:s.a.bool},t.a=c},694:function(e,t,n){"use strict";var a=n(0),r=n.n(a),o=n(8),s=n.n(o),c=function(e){var t=e.label,n=e.type,a=e.className,o=e.size,s=e.id,c=e.placeholder,i=e.name,l=e.value,u=e.onClickAction,m=e.onChangeAction,d=e.onBlurAction,p=e.required,f=e.readOnly,E=e.maxLength,g=e.error,N=e.min,h=e.max,v=e.step,y=e.errorMessage,b=e.divSize,C=e.divClassName,A=e.autoComplete;return r.a.createElement("div",{className:"form-group ".concat(b," ").concat(C)},r.a.createElement("label",{htmlFor:s,className:"col-sm-6 ".concat(p)},t),r.a.createElement("div",{className:"".concat(o)},r.a.createElement("input",{type:n,className:"form-control input-sm ".concat(a)+(g?"has-error":""),id:s,placeholder:c,name:i,value:l,onClick:u,onChange:m,onBlur:d,readOnly:f,maxLength:E,min:N,max:h,autoComplete:A,step:v})),g&&r.a.createElement("div",{className:"col-sm-offset-6 col-sm-6"},r.a.createElement("span",{className:"has-error-message"}," ",y)))};c.defaultProps={divClassName:"",className:"",size:"col-sm-6",divSize:"col-sm-6",name:"",type:"text",value:"",required:"",readOnly:!1,maxLength:null,error:!1,min:"",max:"",step:"",errorMessage:"",autoComplete:"off",onBlurAction:function(){},onClickAction:function(){},onChangeAction:function(){}},c.propTypes={label:s.a.oneOfType([s.a.string,s.a.object]).isRequired,type:s.a.string,className:s.a.string,divClassName:s.a.string,size:s.a.string,divSize:s.a.string,id:s.a.string,placeholder:s.a.string,name:s.a.string.isRequired,value:s.a.oneOfType([s.a.string,s.a.number]),onClickAction:s.a.func,onChangeAction:s.a.func,onBlurAction:s.a.func,required:s.a.string,readOnly:s.a.bool,maxLength:s.a.string,error:s.a.bool,min:s.a.string,max:s.a.string,step:s.a.string,errorMessage:s.a.string,autoComplete:s.a.string},t.a=c},696:function(e,t,n){"use strict";var a=n(0),r=n.n(a),o=n(8),s=n.n(o),c=function(e){var t=e.label,n=e.className,a=e.size,o=e.id,s=e.name,c=e.value,i=e.options,l=e.onChangeAction,u=e.onBlurAction,m=e.required,d=e.error,p=e.errorMessage,f=e.optionValue,E=e.optionName,g=e.readOnly,N=e.placeholder,h=e.divClassName,v=e.emptyOption;return r.a.createElement("div",{className:"form-group ".concat(a," ").concat(h)},r.a.createElement("label",{htmlFor:o,className:"col-sm-6 ".concat(m)},t),r.a.createElement("div",{className:"col-sm-6"},r.a.createElement("select",{className:"form-control input-sm ".concat(n)+(d&&" has-error"),id:o,name:s,value:c,onChange:l,onBlur:u,readOnly:g},v&&r.a.createElement("option",{value:""},N),i.map((function(e){return r.a.createElement("option",{key:e[f],value:e[f]},e[E])})))),d&&r.a.createElement("div",{className:"col-sm-offset-6 col-sm-6"},r.a.createElement("span",{className:"has-error-message"}," ",p)))};c.defaultProps={divClassName:"",className:"",size:"col-sm-6",readOnly:!1,required:"",error:!1,errorMessage:"",value:"",optionValue:"id",optionName:"name",placeholder:"",emptyOption:!0},c.propTypes={label:s.a.string.isRequired,className:s.a.string,size:s.a.string,id:s.a.string,name:s.a.string.isRequired,options:s.a.array,value:s.a.oneOfType([s.a.string,s.a.number]),onChangeAction:s.a.func,onBlurAction:s.a.func,required:s.a.string,readOnly:s.a.bool,error:s.a.bool,errorMessage:s.a.string,emptyOption:s.a.bool,optionValue:s.a.string,optionName:s.a.string,placeholder:s.a.string},t.a=c},716:function(e,t,n){"use strict";n.d(t,"h",(function(){return a})),n.d(t,"b",(function(){return r})),n.d(t,"v",(function(){return o})),n.d(t,"u",(function(){return s})),n.d(t,"x",(function(){return c})),n.d(t,"g",(function(){return i})),n.d(t,"i",(function(){return l})),n.d(t,"q",(function(){return u})),n.d(t,"a",(function(){return m})),n.d(t,"m",(function(){return d})),n.d(t,"w",(function(){return p})),n.d(t,"f",(function(){return f})),n.d(t,"k",(function(){return E})),n.d(t,"s",(function(){return g})),n.d(t,"d",(function(){return N})),n.d(t,"l",(function(){return h})),n.d(t,"t",(function(){return v})),n.d(t,"e",(function(){return y})),n.d(t,"n",(function(){return b})),n.d(t,"p",(function(){return C})),n.d(t,"o",(function(){return A})),n.d(t,"j",(function(){return I})),n.d(t,"r",(function(){return O})),n.d(t,"c",(function(){return R}));var a=function(e){return{type:"FETCH_CONTACT_DETAILS",payload:e}},r=function(e){return{type:"DELETE_CONTACT",id:e}},o=function(e){return{type:"UPDATE_PERSON",contactDetails:e}},s=function(e){return{type:"UPDATE_ORGANISATION",contactDetails:e}},c=function(e){return{type:"UPDATE_PORTAL_USER",portalUser:e}},i=function(e){return{type:"DELETE_PORTAL_USER",id:e}},l=function(e){return{type:"NEW_ADDRESS",address:e}},u=function(e){return{type:"UPDATE_ADDRESS",address:e}},m=function(e){return{type:"DELETE_ADDRESS",id:e}},d=function(e){return{type:"NEW_PHONE_NUMBER",phoneNumber:e}},p=function(e){return{type:"UPDATE_PHONE_NUMBER",phoneNumber:e}},f=function(e){return{type:"DELETE_PHONE_NUMBER",id:e}},E=function(e){return{type:"NEW_EMAIL_ADDRESS",emailAddress:e}},g=function(e){return{type:"UPDATE_EMAIL_ADDRESS",emailAddress:e}},N=function(e){return{type:"DELETE_EMAIL_ADDRESS",id:e}},h=function(e){return{type:"NEW_CONTACT_NOTE",note:e}},v=function(e){return{type:"UPDATE_CONTACT_NOTE",note:e}},y=function(e){return{type:"DELETE_CONTACT_NOTE",id:e}},b=function(){return{type:"UNSET_PRIMARY_ADDRESSES"}},C=function(){return{type:"UNSET_PRIMARY_PHONE_NUMBERS"}},A=function(){return{type:"UNSET_PRIMARY_EMAIL_ADDRESSES"}},I=function(e){return{type:"NEW_CONTACT_ENERGY_SUPPLIER",contactEnergySupplier:e}},O=function(e){return{type:"UPDATE_CONTACT_ENERGY_SUPPLIER",contactEnergySupplier:e}},R=function(e){return{type:"DELETE_CONTACT_ENERGY_SUPPLIER",id:e}}},723:function(e,t,n){"use strict";var a=n(0),r=n.n(a),o=n(8),s=n.n(o),c=n(714),i=(n(715),function(e){var t=e.label,n=(e.className,e.size),a=e.id,o=e.name,s=e.value,i=e.options,l=e.optionId,u=e.optionName,m=e.onChangeAction,d=e.required,p=e.multi,f=e.error;return r.a.createElement("div",{className:"form-group col-sm-6"},r.a.createElement("label",{htmlFor:a,className:"col-sm-6 ".concat(d)},t),r.a.createElement("div",{className:"".concat(n)},r.a.createElement(c.a,{id:a,name:o,value:s,onChange:m,options:i,valueKey:l,labelKey:u,placeholder:"",noResultsText:"Geen resultaat gevonden",multi:p,simpleValue:!0,removeSelected:!0,className:f?" has-error":""})))});i.defaultProps={className:"",size:"col-sm-6",optionId:"id",optionName:"name",readOnly:!1,required:"",error:!1,value:"",multi:!0},i.propTypes={label:s.a.string.isRequired,className:s.a.string,size:s.a.string,id:s.a.string,name:s.a.string.isRequired,options:s.a.array,optionId:s.a.string,optionName:s.a.string,value:s.a.string,onChangeAction:s.a.func,onBlurAction:s.a.func,required:s.a.string,readOnly:s.a.bool,error:s.a.bool,multi:s.a.bool},t.a=i}}]);