(this.webpackJsonp=this.webpackJsonp||[]).push([[7],{1137:function(e,t,r){"use strict";r.r(t);var n,o,i=r(0),a=r(980),u=r(105),c=r(91);!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(930);function s(e,t,r,n,o,i,a){try{var u=e[i](a),c=u.value}catch(e){return void r(e)}u.done?t(c):Promise.resolve(c).then(n,o)}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(n=(a=u.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){o=!0,i=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return b(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return b(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function v(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?v(Object(r),!0).forEach((function(t){m(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):v(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 y(e,t){var r=f(Object(u.b)(e,t),2),n=r[0],o=r[1];return[n,Object(i.useCallback)(function(){var e,t=(e=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)})),function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(e){s(i,n,o,a,u,"next",e)}function u(e){s(i,n,o,a,u,"throw",e)}a(void 0)}))});return function(){return t.apply(this,arguments)}}(),[o])]}var O=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"},{label:"Movie Year",name:"movieYear",type:"number"}]}),[]),api:{list:{useGet:function(){return Object(u.b)("/movie_list")},useAdd:function(){return Object(u.b)("/movie_list",c.a.Post)},useRemove:function(e){return Object(u.b)("/movie_list/".concat(e),c.a.Delete)}},entry:{useGet:function(e,t){return y("/movie_list/".concat(e,"/movies?").concat(t))},useAdd:function(e){return y("/movie_list/".concat(e,"/movies"),c.a.Post)},useRemove:function(e,t){return Object(u.b)("/movie_list/".concat(e,"/movies/").concat(t),c.a.Delete)},useRemoveBulk:function(e){return Object(u.b)("/movie_list/".concat(e,"/movies/batch"),c.a.Delete)}}}}})),j=r(5);t.default=function(){return Object(j.e)(O.Provider,null,Object(j.e)(a.a,{title:"Movie List"}))}}}]);
//# sourceMappingURL=MovieListPlugin.17e519c9d031c1cd9477.js.map