(window.webpackJsonp=window.webpackJsonp||[]).push([[40],{YRLc:function(e,a,n){"use strict";n.d(a,"b",(function(){return w}));var t=n("KQm4"),r=n("rePB"),l=n("wx14"),i=n("Ff2n"),o=n("eHHv"),c=n("0dmp"),u=n("q1tI"),s=n.n(u),g=n("ikXu"),d=n("QetY"),f=n("D1pA"),b=n("RotF"),p=n.n(b),O=n("YFqc"),m=n.n(O),h=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 v(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,o=e.createPath,c=(e.data,e.children),u=e.loadMoreEntries,s=(e.loading,e.limit),b=Object(i.a)(e,["items","cols","rowRenderer","createPath","data","children","loadMoreEntries","loading","limit"]);return h(g.a,Object(l.a)({celled:!0},b),h(g.a.Header,null,h(g.a.Row,null,h(g.a.HeaderCell,{colSpan:t},o&&h(m.a,{href:o},h(d.a,{floated:"right",icon:!0,labelPosition:"left",primary:!0,size:"small",href:o},h(f.a,{name:"plus"}),"Add")))),c),a&&h(p.a,{pageStart:0,element:"tbody",loadMore:u,hasMore:null===s||void 0===s||s},a.map(r)),h(g.a.Footer,{fullWidth:!0},h(g.a.Row,null,h(g.a.HeaderCell,{colSpan:t},o&&h(m.a,{href:o},h(d.a,{floated:"right",icon:!0,labelPosition:"left",primary:!0,size:"small",href:o},h(f.a,{name:"plus"})," Add"))))))};var w=function(e){var a=e.query,n=e.queryName,l=e.itemsPerPage,u=void 0===l?5:l;return Object(o.a)(Object(c.a)(a,{options:function(e){var a=e.queryOptions,n=Object(i.a)(e,["queryOptions"]);return v({variables:v({offset:0,limit:u},n)},a)},props:function(e){var a=e.data,l=a.loading,o=a.fetchMore,c=a.stopPolling,u=Object(i.a)(a,["loading","fetchMore","stopPolling"]);return{loading:l,items:u[n],loadMoreEntries:function(){return c(),o({variables:{offset:u[n].length},updateQuery:function(e,a){var l=a.fetchMoreResult;return l?v(v({},e),{},Object(r.a)({},n,[].concat(Object(t.a)(e[n]),Object(t.a)(l[n])))):e}})}}}}))}},hkxl:function(e,a,n){"use strict";n.r(a);var t=n("wx14"),r=n("q1tI"),l=n.n(r),i=n("yE/o"),o=n("gaPq"),c=n("h4VS"),u=n("Ff2n"),s=n("eHHv"),g=n("lTCR"),d=n.n(g),f=n("0dmp"),b=n("ikXu"),p=n("D1pA"),O=n("QetY"),m=n("YFqc"),h=n.n(m),j=n("YRLc"),v=l.a.createElement;function w(){var e=Object(c.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(c.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 P=Object(s.a)(Object(j.b)({queryName:"languages",query:d()(y())}),Object(f.a)(d()(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(u.a)(e,["changeBaseLanguage"]);return v(j.a,Object(t.a)({},n,{cols:3,createPath:"/languages/new",rowRenderer:function(e){return v(b.a.Row,{key:e._id},v(b.a.Cell,null,v(h.a,{href:"/languages/edit?_id=".concat(e._id)},v("a",{href:"/languages/edit?_id=".concat(e._id)},e.isoCode))),v(b.a.Cell,null,e.isActive&&v(p.a,{color:"green",name:"checkmark",size:"large"})),v(b.a.Cell,null,e.isBase?v("b",null,"Base language"):v(O.a,{basic:!0,name:e._id,onClick:a},"Set as base language")))}}),v(b.a.Row,null,v(b.a.HeaderCell,null,"Name"),v(b.a.HeaderCell,null,"Activated?"),v(b.a.HeaderCell,null)))})),_=n("PZVx"),q=l.a.createElement;a.default=Object(_.a)((function(e){var a=Object(t.a)({},e);return q(o.a,a,q(i.a,null,q("h2",null,"Languages"),q(P,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]]]);