(window.webpackJsonp=window.webpackJsonp||[]).push([[20],{B5hm:function(e,t,n){"use strict";n.r(t);var a=n("qNsG"),r=n("q1tI"),c=n.n(r),u=n("nOHt"),i=n("eHHv"),o=n("yE/o"),l=n("gaPq"),s=n("zrwo"),f=n("kOwS"),m=n("dfwq"),p=n("rt45"),b=n("lTCR"),d=n.n(b),v=n("4KRT"),O=n("hePV"),j=n.n(O),y=n("gmoh"),w=n.n(y),S=n("fjVX"),h=n.n(S),E=n("oB+O"),_=n.n(E),T=n("7zkD"),g=n("PaXs");function k(){var e=Object(p.a)(["\n    mutation create($filter: CreateFilterInput!) {\n      createFilter(filter: $filter) {\n        _id\n      }\n    }\n  "]);return k=function(){return e},e}function q(){var e=Object(p.a)(['\n    query getFilterTypes {\n      uniforms: __type(name: "FilterType") {\n        options: enumValues {\n          value: name\n          label: description\n        }\n      }\n    }\n  ']);return q=function(){return e},e}var N=Object(i.a)(Object(v.c)(d()(q())),Object(v.c)(d()(k())),Object(T.a)(function(e){var t=e.data,n=(t=void 0===t?{}:t).uniforms,a=void 0===n?{options:[]}:n;return{title:{type:String,optional:!1,label:"Name"},key:{type:String,optional:!1,label:"Key"},type:{type:String,optional:!1,label:"Type",uniforms:{options:[{label:"Choose Type",value:null}].concat(Object(m.default)(a.options))}}}}),Object(i.f)({onSubmitSuccess:function(e){var t=e.onSuccess;return function(e){var n=e.data.createFilter;t(n._id)}},onSubmit:function(e){var t=e.mutate,n=e.schema;return function(e){var a=Object(f.a)({},e);return t({variables:{filter:n.clean(a)}})}}}),g.a,Object(i.d)(function(e){e.onSuccess,e.mutate;var t=Object(a.a)(e,["onSuccess","mutate"]);return Object(s.a)({},t)}),i.e)(function(e){return c.a.createElement(_.a,e,c.a.createElement(j.a,{name:"title"}),c.a.createElement(j.a,{name:"key"}),c.a.createElement(j.a,{name:"type"}),c.a.createElement(h.a,null),c.a.createElement(w.a,{value:"Add filter",className:"primary"}))}),P=n("PZVx");t.default=Object(P.a)(Object(i.a)(u.withRouter,Object(i.f)({onSuccess:function(e){var t=e.router;return function(e){t.push({pathname:"/filters/edit",query:{_id:e}})}}}))(function(e){var t=e.onSuccess,n=Object(a.a)(e,["onSuccess"]);return c.a.createElement(l.a,n,c.a.createElement(o.a,null,c.a.createElement("p",null,"New filter"),c.a.createElement(N,{onSuccess:t})))}))},hUop:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/filters/new",function(){var e=n("B5hm");return{page:e.default||e}}])}},[["hUop",1,0]]]);