(window.webpackJsonp=window.webpackJsonp||[]).push([[59],{"2te/":function(e,n,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/currencies/edit",function(){var e=r("hZL9");return{page:e.default||e}}])},"3oBh":function(e,n,r){"use strict";var t=r("pLtp"),c=r.n(t),u=r("eHHv");n.a=function(e){return Object(u.g)(function(n){return{model:function e(n){var r={};return c()(n).forEach(function(t){var c=n[t];c&&"object"===typeof c&&(r[t]=e(c)),null!==c&&(r[t]=c)}),r}(e(n))}})}},hZL9:function(e,n,r){"use strict";r.r(n);var t=r("qNsG"),c=r("q1tI"),u=r.n(c),a=r("nOHt"),o=r("yE/o"),i=r("gaPq"),d=r("zrwo"),y=r("kOwS"),l=r("ln6h"),s=r.n(l),f=r("O40h"),v=r("rt45"),m=r("GGqY"),p=r("eHHv"),b=r("3mGJ"),O=r("QetY"),j=r("lTCR"),C=r.n(j),h=r("4KRT"),I=r("hePV"),E=r.n(I),w=r("gmoh"),S=r.n(w),_=r("fjVX"),$=r.n(_),g=r("oB+O"),P=r.n(g),k=r("7zkD"),q=r("3oBh"),D=r("PaXs");function A(){var e=Object(v.a)(["\n      mutation removeCurrency($currencyId: ID!) {\n        removeCurrency(currencyId: $currencyId) {\n          _id\n        }\n      }\n    "]);return A=function(){return e},e}function H(){var e=Object(v.a)(["\n      mutation updateCurrency(\n        $currency: UpdateCurrencyInput!\n        $currencyId: ID!\n      ) {\n        updateCurrency(currency: $currency, currencyId: $currencyId) {\n          _id\n          isoCode\n          isActive\n        }\n      }\n    "]);return H=function(){return e},e}function T(){var e=Object(v.a)(["\n    query currency($currencyId: ID!) {\n      currency(currencyId: $currencyId) {\n        _id\n        isoCode\n        isActive\n        name\n      }\n    }\n  "]);return T=function(){return e},e}var B=Object(p.a)(a.withRouter,Object(h.c)(C()(T())),Object(h.c)(C()(H()),{name:"updateCurrency",options:{refetchQueries:["currency","currencies"]}}),Object(h.c)(C()(A()),{name:"removeCurrency",options:{refetchQueries:["currencies"]}}),Object(k.a)({isoCode:{type:String,optional:!1,label:"ISO W\xe4hrungscode"},isActive:{type:Boolean,optional:!1,label:"Active?"}}),Object(q.a)(function(e){var n=e.data.currency;return void 0===n?{}:n}),Object(p.f)({onSubmitSuccess:function(){return function(){Object(m.b)("Currency saved",{type:m.b.TYPE.SUCCESS})}},removeCurrency:function(e){var n=e.router,r=e.currencyId,t=e.removeCurrency;return function(){var e=Object(f.default)(s.a.mark(function e(c){return s.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return c.preventDefault(),n.replace({pathname:"/currencies"}),e.next=4,t({variables:{currencyId:r}});case 4:case"end":return e.stop()}},e)}));return function(n){return e.apply(this,arguments)}}()},onSubmit:function(e){var n=e.currencyId,r=e.updateCurrency,t=e.schema;return function(e){var c=Object(y.a)({},e);return r({variables:{currency:t.clean(c),currencyId:n}})}}}),D.a,Object(p.d)(function(e){e.currencyId,e.updateCurrency,e.data;var n=Object(t.a)(e,["currencyId","updateCurrency","data"]);return Object(d.a)({},n)}))(function(e){var n=e.removeCurrency,r=Object(t.a)(e,["removeCurrency"]);return u.a.createElement(o.a,null,u.a.createElement(P.a,r,u.a.createElement(b.a,{attached:"bottom"},u.a.createElement(E.a,{name:"isoCode"}),u.a.createElement(E.a,{name:"isActive"}),u.a.createElement($.a,null),u.a.createElement(S.a,{value:"Save",className:"primary"}),u.a.createElement(O.a,{type:"normal",secondary:!0,floated:"right",onClick:n},"Delete"))))}),G=r("PZVx");n.default=Object(G.a)(Object(a.withRouter)(function(e){var n=e.router,r=Object(t.a)(e,["router"]);return u.a.createElement(i.a,r,u.a.createElement(o.a,null,u.a.createElement(B,{currencyId:n.query._id})))}))}},[["2te/",1,0]]]);