(window.webpackJsonp=window.webpackJsonp||[]).push([[85],{1123:function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return q}));var i=n(0),s=n(1),a=n.n(s),c=n(3),o=n.n(c),d=n(16),r=n.n(d),l=n(12),u=n(18),b=n(4),j=n(40),p=n(143),O=n(1433);var h=Object(b.g)(Object(l.connect)((()=>{const e=Object(p.e)();return(t,n)=>{let{accountId:i,added:s}=n;return{account:e(t,i),added:void 0===s?t.getIn(["listEditor","accounts","items"]).includes(i):s}}}),((e,t)=>{let{accountId:n}=t;return{onRemove:()=>e(Object(j.K)(n)),onAdd:()=>e(Object(j.B)(n))}}))(O.a)),m=n(1434);var g,v=Object(b.g)(Object(l.connect)((e=>({value:e.getIn(["listEditor","suggestions","value"])})),(e=>({onSubmit:t=>e(Object(j.H)(t)),onClear:()=>e(Object(j.E)()),onChange:t=>e(Object(j.D)(t))})))(m.a)),I=n(45);const C=Object(b.f)({title:{id:"lists.edit.submit",defaultMessage:"Change title"}});let f=Object(l.connect)((e=>({value:e.getIn(["listEditor","title"]),disabled:!e.getIn(["listEditor","isChanged"])||!e.getIn(["listEditor","title"])})),(e=>({onChange:t=>e(Object(j.C)(t)),onSubmit:()=>e(Object(j.P)(!1))})))(g=Object(b.g)(g=class extends a.a.PureComponent{constructor(){super(...arguments),this.handleChange=e=>{this.props.onChange(e.target.value)},this.handleSubmit=e=>{e.preventDefault(),this.props.onSubmit()},this.handleClick=()=>{this.props.onSubmit()}}render(){const{value:e,disabled:t,intl:n}=this.props,s=n.formatMessage(C.title);return Object(i.a)("form",{className:"column-inline-form",onSubmit:this.handleSubmit},void 0,Object(i.a)("input",{className:"setting-text",value:e,onChange:this.handleChange}),Object(i.a)(I.a,{disabled:t,icon:"check",title:s,onClick:this.handleClick}))}})||g)||g;var R,_,w=n(227),k=n(26),E=n.n(k);let q=Object(l.connect)((e=>({accountIds:e.getIn(["listEditor","accounts","items"]),searchAccountIds:e.getIn(["listEditor","suggestions","items"])})),(e=>({onInitialize:t=>e(Object(j.O)(t)),onClear:()=>e(Object(j.E)()),onReset:()=>e(Object(j.M)())})))(R=Object(b.g)(((_=class extends u.a{componentDidMount(){const{onInitialize:e,listId:t}=this.props;e(t)}componentWillUnmount(){const{onReset:e}=this.props;e()}render(){const{accountIds:e,searchAccountIds:t,onClear:n}=this.props,s=t.size>0;return Object(i.a)("div",{className:"modal-root__modal list-editor"},void 0,Object(i.a)(f,{}),Object(i.a)(v,{}),Object(i.a)("div",{className:"drawer__pager"},void 0,Object(i.a)("div",{className:"drawer__inner list-editor__accounts"},void 0,e.map((e=>Object(i.a)(h,{accountId:e,added:!0},e)))),s&&Object(i.a)("div",{role:"button",tabIndex:"-1",className:"drawer__backdrop",onClick:n}),Object(i.a)(w.a,{defaultStyle:{x:-100},style:{x:E()(s?0:-100,{stiffness:210,damping:20})}},void 0,(e=>{let{x:n}=e;return Object(i.a)("div",{className:"drawer__inner backdrop",style:{transform:0===n?null:"translateX("+n+"%)",visibility:-100===n?"hidden":"visible"}},void 0,t.map((e=>Object(i.a)(h,{accountId:e},e))))}))))}}).propTypes={listId:o.a.string.isRequired,onClose:o.a.func.isRequired,intl:o.a.object.isRequired,onInitialize:o.a.func.isRequired,onClear:o.a.func.isRequired,onReset:o.a.func.isRequired,accountIds:r.a.list.isRequired,searchAccountIds:r.a.list.isRequired},R=_))||R)||R}}]);
//# sourceMappingURL=list_editor-aaf4cfceb483f7bed497.chunk.js.map