(window.webpackJsonp=window.webpackJsonp||[]).push([[40],{YRLc:function(e,a,n){"use strict";n.d(a,"b",(function(){return y}));var t=n("KQm4"),r=n("rePB"),o=n("wx14"),l=n("Ff2n"),i=n("eHHv"),u=n("0dmp"),c=n("q1tI"),s=n.n(c),d=n("ikXu"),f=n("QetY"),g=n("D1pA"),p=n("NrgV"),h=n("RotF"),b=n.n(h),O=n("YFqc"),m=n.n(O),v=s.a.createElement;function j(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);a&&(t=t.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,t)}return n}function w(e){for(var a=1;a<arguments.length;a++){var n=null!=arguments[a]?arguments[a]:{};a%2?j(Object(n),!0).forEach((function(a){Object(r.a)(e,a,n[a])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach((function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(n,a))}))}return e}a.a=function(e){var a=e.items,n=e.cols,t=void 0===n?4:n,r=e.rowRenderer,i=e.createPath,u=(e.data,e.children),c=e.loadMoreEntries,s=(e.updateHasMore,e.hasMore),h=(e.loading,Object(l.a)(e,["items","cols","rowRenderer","createPath","data","children","loadMoreEntries","updateHasMore","hasMore","loading"]));return v(d.a,Object(o.a)({celled:!0},h),v(d.a.Header,null,v(d.a.Row,null,v(d.a.HeaderCell,{colSpan:t},i&&v(m.a,{href:i},v(f.a,{floated:"right",icon:!0,labelPosition:"left",primary:!0,size:"small",href:i},v(g.a,{name:"plus"}),"Add")))),u),a&&v(b.a,{pageStart:0,element:"tbody",loadMore:c,hasMore:s,loader:v(d.a.Row,null,v(d.a.Cell,{colSpan:t},v(p.a,{active:!0,inline:"centered"})))},a.map(r)),v(d.a.Footer,{fullWidth:!0},v(d.a.Row,null,v(d.a.HeaderCell,{colSpan:t},i&&v(m.a,{href:i},v(f.a,{floated:"right",icon:!0,labelPosition:"left",primary:!0,size:"small",href:i},v(g.a,{name:"plus"})," Add"))))))},Array.prototype.diff=function(e){return this.filter((function(a){return-1!==e.indexOf(a)}))};var y=function(e){var a=e.query,n=e.queryName,r=e.queryOptions,o=e.itemsPerPage,c=void 0===o?5:o;return Object(i.a)(Object(i.h)("hasMore","updateHasMore",!0),Object(u.a)(a,{options:function(e){e.hasMore,e.updateHasMore;var a=Object(l.a)(e,["hasMore","updateHasMore"]);return w({variables:w({offset:0,limit:c},a)},r)},props:function(e){var a=e.data,r=a.loading,o=a.fetchMore,i=Object(l.a)(a,["loading","fetchMore"]),u=e.ownProps,s=u.updateHasMore,d=u.hasMore;return{loading:r,hasMore:!(i[n]&&c>i[n].length)&&d,items:i[n],loadMoreEntries:function(){return o({variables:{offset:Math.floor(i[n].length/c)*c,limit:c},updateQuery:function(e,a){var r=a.fetchMoreResult;if(!r||0===r[n].length)return s(!1),e;var o=e[n].map((function(e){return e._id})),l=r[n].filter((function(e){return-1===o.indexOf(e._id)}));if(0===l.length)return s(!1),e;var i={};return i[n]=[].concat(Object(t.a)(e[n]),Object(t.a)(l)),w({},e,{},i)}})}}}}))}},hkxl:function(e,a,n){"use strict";n.r(a);var t=n("wx14"),r=n("q1tI"),o=n.n(r),l=n("yE/o"),i=n("gaPq"),u=n("h4VS"),c=n("Ff2n"),s=n("eHHv"),d=n("lTCR"),f=n.n(d),g=n("0dmp"),p=n("ikXu"),h=n("D1pA"),b=n("QetY"),O=n("YFqc"),m=n.n(O),v=n("YRLc"),j=o.a.createElement;function w(){var e=Object(u.a)(["\n      mutation changeBaseLanguage($languageId: ID!) {\n        setBaseLanguage(languageId: $languageId) {\n          _id\n          isBase\n        }\n      }\n    "]);return w=function(){return e},e}function y(){var e=Object(u.a)(["\n      query languages($offset: Int, $limit: Int) {\n        languages(offset: $offset, limit: $limit, includeInactive: true) {\n          _id\n          isoCode\n          isActive\n          isBase\n          name\n        }\n      }\n    "]);return y=function(){return e},e}var M=Object(s.a)(Object(v.b)({queryName:"languages",query:f()(y())}),Object(g.a)(f()(w()),{options:{refetchQueries:["languages"]}}),Object(s.f)({changeBaseLanguage:function(e){var a=e.mutate;return function(e,n){return a({variables:{languageId:n.name}})}}}),s.e)((function(e){var a=e.changeBaseLanguage,n=Object(c.a)(e,["changeBaseLanguage"]);return j(v.a,Object(t.a)({},n,{cols:3,createPath:"/languages/new",rowRenderer:function(e){return j(p.a.Row,{key:e._id},j(p.a.Cell,null,j(m.a,{href:"/languages/edit?_id=".concat(e._id)},j("a",{href:"/languages/edit?_id=".concat(e._id)},e.isoCode))),j(p.a.Cell,null,e.isActive&&j(h.a,{color:"green",name:"checkmark",size:"large"})),j(p.a.Cell,null,e.isBase?j("b",null,"Base language"):j(b.a,{basic:!0,name:e._id,onClick:a},"Set as base language")))}}),j(p.a.Row,null,j(p.a.HeaderCell,null,"Name"),j(p.a.HeaderCell,null,"Activated?"),j(p.a.HeaderCell,null)))})),P=n("PZVx"),H=o.a.createElement;a.default=Object(P.a)((function(e){var a=Object(t.a)({},e);return H(i.a,a,H(l.a,null,H("h2",null,"Languages"),H(M,null)))}))},nB9K:function(e,a,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/languages",function(){return n("hkxl")}])}},[["nB9K",0,2,5,1,3,4,7]]]);