_N_E=(window.webpackJsonp_N_E=window.webpackJsonp_N_E||[]).push([[49],{B5hm:function(t,e,n){"use strict";n.r(e);var r=n("rePB"),c=n("nKUr"),o=n("Ff2n"),a=(n("q1tI"),n("20a2")),i=n("eHHv"),u=n("yE/o"),s=n("gaPq"),b=n("wx14"),f=n("KQm4"),l=n("h4VS"),O=n("UYTu"),p=n("JznV"),j=n("hePV"),y=n.n(j),m=n("gmoh"),d=n.n(m),v=n("fjVX"),h=n.n(v),w=n("oB+O"),g=n.n(w),P=n("7zkD"),S=n("PaXs");function _(){var t=Object(l.a)(["\n    mutation create($filter: CreateFilterInput!) {\n      createFilter(filter: $filter) {\n        _id\n      }\n    }\n  "]);return _=function(){return t},t}function x(){var t=Object(l.a)(['\n    query getFilterTypes {\n      uniforms: __type(name: "FilterType") {\n        options: enumValues {\n          value: name\n          label: description\n        }\n      }\n    }\n  ']);return x=function(){return t},t}function D(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function E(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?D(Object(n),!0).forEach((function(e){Object(r.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):D(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var A=Object(i.a)(Object(p.a)(Object(O.a)(x())),Object(p.a)(Object(O.a)(_())),Object(P.a)((function(t){var e=t.data,n=(e=void 0===e?{}:e).uniforms,r=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(f.a)(r.options))}}}})),Object(i.f)({onSubmitSuccess:function(t){var e=t.onSuccess;return function(t){var n=t.data.createFilter;e(n._id)}},onSubmit:function(t){var e=t.mutate,n=t.schema;return function(t){var r=Object(b.a)({},t);return e({variables:{filter:n.clean(r)}})}}}),S.a,Object(i.d)((function(t){t.onSuccess,t.mutate;return E({},Object(o.a)(t,["onSuccess","mutate"]))})),i.e)((function(t){return Object(c.jsxs)(g.a,E(E({},t),{},{children:[Object(c.jsx)(y.a,{name:"title"}),Object(c.jsx)(y.a,{name:"key"}),Object(c.jsx)(y.a,{name:"type"}),Object(c.jsx)(h.a,{}),Object(c.jsx)(d.a,{value:"Add filter",className:"primary"})]}))})),N=n("PZVx");function T(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function k(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?T(Object(n),!0).forEach((function(e){Object(r.a)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):T(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}e.default=Object(N.a)(Object(i.a)(a.withRouter,Object(i.f)({onSuccess:function(t){var e=t.router;return function(t){e.push({pathname:"/filters/edit",query:{_id:t}})}}}))((function(t){var e=t.onSuccess,n=Object(o.a)(t,["onSuccess"]);return Object(c.jsx)(s.a,k(k({},n),{},{children:Object(c.jsxs)(u.a,{children:[Object(c.jsx)("p",{children:"New filter"}),Object(c.jsx)(A,{onSuccess:e})]})}))})))},BsWD:function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var r=n("a3WO");function c(t,e){if(t){if("string"===typeof t)return Object(r.a)(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(r.a)(t,e):void 0}}},KQm4:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n("a3WO");var c=n("BsWD");function o(t){return function(t){if(Array.isArray(t))return Object(r.a)(t)}(t)||function(t){if("undefined"!==typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Object(c.a)(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},a3WO:function(t,e,n){"use strict";function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}n.d(e,"a",(function(){return r}))},hUop:function(t,e,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/filters/new",function(){return n("B5hm")}])}},[["hUop",0,2,3,1,4,5,6,7]]]);