(window.webpackJsonp=window.webpackJsonp||[]).push([[34],{m3tS:function(e,t,n){"use strict";n.r(t);var r=n("q1tI"),l=n.n(r),a=n("yE/o"),i=n("gaPq"),o=n("KQm4"),c=n("rePB"),s=n("h4VS"),f=n("eHHv"),u=n("lTCR"),d=n.n(u),p=n("0dmp"),b=n("ikXu"),h=n("QetY"),w=n("D1pA"),O=n("NrgV"),m=n("RotF"),y=n.n(m),v=n("YFqc"),j=n.n(v),g=l.a.createElement;function P(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?P(Object(n),!0).forEach((function(t){Object(c.a)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function C(){var e=Object(s.a)(["\n  query filters($offset: Int, $limit: Int) {\n    filters(offset: $offset, limit: $limit, includeInactive: true) {\n      _id\n      isActive\n      key\n      type\n      texts {\n        _id\n        title\n      }\n      options {\n        _id\n        value\n      }\n    }\n  }\n"]);return C=function(){return e},e}var H=d()(C()),k=Object(f.a)(Object(f.h)("hasMore","updateHasMore",!0),Object(p.a)(H,{options:function(){return{variables:{offset:0,limit:10}}},props:function(e){var t=e.data,n=t.loading,r=t.filters,l=t.fetchMore,a=e.ownProps.updateHasMore;return{loading:n,filters:r,loadMoreEntries:function(){return l({variables:{offset:r.length,limit:10},updateQuery:function(e,t){var n=t.fetchMoreResult;if(!n||0===n.filters.length)return a(!1),e;var r=n.filters[0]._id;return e.filters.reduce((function(e,t){return t._id===r||e}),!1)?(a(!1),e):_(_({},e),{},{filters:[].concat(Object(o.a)(e.filters),Object(o.a)(n.filters))})}})}}}}),f.e)((function(e){var t=e.filters,n=e.loadMoreEntries,r=e.hasMore;return g(b.a,{celled:!0},g(b.a.Header,null,g(b.a.Row,null,g(b.a.HeaderCell,{colSpan:"4"},g(j.a,{href:"/filters/new"},g(h.a,{floated:"right",icon:!0,labelPosition:"left",primary:!0,size:"small",href:"/filters/new"},g(w.a,{name:"plus"}),"Add")))),g(b.a.Row,null,g(b.a.HeaderCell,null,"Key (Name)"),g(b.a.HeaderCell,null,"Type"),g(b.a.HeaderCell,null,"Active?"),g(b.a.HeaderCell,null,"Options"))),t&&g(y.a,{element:"tbody",loadMore:n,hasMore:r,loader:g(b.a.Row,{key:"filter-loader"},g(b.a.Cell,{colSpan:"4"},g(O.a,{active:!0,inline:"centered"})))},t.map((function(e){return g(b.a.Row,{key:e._id},g(b.a.Cell,null,g(j.a,{href:"/filters/edit?_id=".concat(e._id)},g("a",{href:"/filters/edit?_id=".concat(e._id)},e.key,"\xa0",e.texts?"( ".concat(e.texts.title," )"):""))),g(b.a.Cell,null,e.type),g(b.a.Cell,null,e.isActive&&g(w.a,{color:"green",name:"checkmark",size:"large"})),g(b.a.Cell,null,e.options&&e.options.length))}))),g(b.a.Footer,{fullWidth:!0},g(b.a.Row,null,g(b.a.HeaderCell,{colSpan:"4"},g(j.a,{href:"/filters/new"},g(h.a,{floated:"right",icon:!0,labelPosition:"left",primary:!0,size:"small",href:"/filters/new"},g(w.a,{name:"plus"}),"Add"))))))})),M=n("PZVx"),E=l.a.createElement;t.default=Object(M.a)((function(e){return E(i.a,e,E(a.a,null,E("h2",null,"Filters"),E(k,null)))}))},rn2o:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/filters",function(){return n("m3tS")}])}},[["rn2o",0,2,5,1,3,4,7]]]);