(this.webpackJsonp=this.webpackJsonp||[]).push([[8],{1166:function(e,t,r){"use strict";r.r(t);var n,o,i=r(1),u=r(928),a=r(145),c=r(137);!function(e){e.Added="added",e.Title="title",e.URL="original_url"}(n||(n={})),function(e){e.Trakt="trakt_movie_id",e.TMDB="tmdb_id",e.IMDB="imdb_id"}(o||(o={}));var l=r(862);function s(e,t,r,n,o,i,u){try{var a=e[i](u),c=a.value}catch(e){return void r(e)}a.done?t(c):Promise.resolve(c).then(n,o)}function b(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function u(e){s(i,n,o,u,a,"next",e)}function a(e){s(i,n,o,u,a,"throw",e)}u(void 0)}))}}function v(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var u,a=e[Symbol.iterator]();!(n=(u=a.next()).done)&&(r.push(u.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return r}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?f(Object(r),!0).forEach((function(t){m(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function m(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var p=function(e){var t;return d({},e,{entry:Object(c.b)(null===(t=e.moviesListIds)||void 0===t?void 0:t.reduce((function(e,t){return d({},e,m({},t.idName,t.idValue))}),{movieName:e.title,movieYear:e.year}))})};function O(e,t){var r=v(Object(a.b)(e,t),2),n=r[0],o=r[1];return[n,Object(i.useCallback)(b(regeneratorRuntime.mark((function e(){var t,r=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.apply(void 0,r);case 2:return(t=e.sent).ok&&(t.data=Array.isArray(t.data)?t.data.map(p):p(t.data)),e.abrupt("return",t);case 5:case"end":return e.stop()}}),e)}))),[o])]}var y=Object(l.a)((function(){return{sortByOptions:Object(i.useMemo)((function(){return[{value:n.Added,label:"Date Added"},{value:n.Title,label:"Title"},{value:n.URL,label:"URL"}]}),[]),addEntryProps:Object(i.useMemo)((function(){return[{label:"Movie Name",name:"movieName"}]}),[]),api:{list:{useGet:function(){return Object(a.b)("/movie_list")},useAdd:function(){return Object(a.b)("/movie_list",c.a.Post)},useRemove:function(e){return Object(a.b)("/movie_list/".concat(e),c.a.Delete)}},entry:{useGet:function(e,t){return O("/movie_list/".concat(e,"/movies?").concat(t))},useAdd:function(e){return O("/movie_list/".concat(e,"/movies"),c.a.Post)},useRemove:function(e,t){return Object(a.b)("/movie_list/".concat(e,"/movies/").concat(t),c.a.Delete)},useRemoveBulk:function(e){return Object(a.b)("/movie_list/".concat(e,"/movies/batch"),c.a.Delete)}}}}})),j=r(14);t.default=function(){return Object(j.e)(y.Provider,null,Object(j.e)(u.a,{title:"Movie List"}))}}}]);
//# sourceMappingURL=MovieListPlugin.e78c5e8e762980a4cc95.js.map