diff --git a/VERSION b/VERSION
index 3b14cef3a..35fd8acbe 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.9.5-beta.9
+0.9.5-beta.10
diff --git a/frontend/build/asset-manifest.json b/frontend/build/asset-manifest.json
index 66c22cf67..deeb40796 100644
--- a/frontend/build/asset-manifest.json
+++ b/frontend/build/asset-manifest.json
@@ -1,8 +1,8 @@
{
"files": {
"main.css": "./static/css/main.2f23c279.chunk.css",
- "main.js": "./static/js/main.05a5c2ae.chunk.js",
- "main.js.map": "./static/js/main.05a5c2ae.chunk.js.map",
+ "main.js": "./static/js/main.e2f02423.chunk.js",
+ "main.js.map": "./static/js/main.e2f02423.chunk.js.map",
"runtime-main.js": "./static/js/runtime-main.28e08986.js",
"runtime-main.js.map": "./static/js/runtime-main.28e08986.js.map",
"static/css/2.ac9f8359.chunk.css": "./static/css/2.ac9f8359.chunk.css",
@@ -19,6 +19,6 @@
"static/css/2.ac9f8359.chunk.css",
"static/js/2.9209745f.chunk.js",
"static/css/main.2f23c279.chunk.css",
- "static/js/main.05a5c2ae.chunk.js"
+ "static/js/main.e2f02423.chunk.js"
]
}
\ No newline at end of file
diff --git a/frontend/build/index.html b/frontend/build/index.html
index ce6ce6a9f..7856575e3 100644
--- a/frontend/build/index.html
+++ b/frontend/build/index.html
@@ -1 +1 @@
-
Bazarr
\ No newline at end of file
+Bazarr
\ No newline at end of file
diff --git a/frontend/build/static/js/main.05a5c2ae.chunk.js b/frontend/build/static/js/main.e2f02423.chunk.js
similarity index 76%
rename from frontend/build/static/js/main.05a5c2ae.chunk.js
rename to frontend/build/static/js/main.e2f02423.chunk.js
index bae969ef3..0fe74e090 100644
--- a/frontend/build/static/js/main.05a5c2ae.chunk.js
+++ b/frontend/build/static/js/main.e2f02423.chunk.js
@@ -1,2 +1,2 @@
-(this.webpackJsonpbazarr=this.webpackJsonpbazarr||[]).push([[0],{330:function(e,t,n){},333:function(e,t,n){},335:function(e,t,n){},346:function(e,t,n){},347:function(e,t,n){},349:function(e,t,n){},350:function(e,t,n){},351:function(e,t,n){},482:function(e,t,n){},483:function(e,t,n){},484:function(e,t,n){},485:function(e,t,n){"use strict";n.r(t);n(300);var r,a=n(0),c=n.n(a),i=n(32),s=n.n(i),o=n(93),l=n(35),u=n(30),d=n(98),j=(n(309),n(263)),b=n.n(j),O=n(264),h=n(25),f=n(3),p=n(507),x="UPDATE_PROVIDER_LIST",v="UPDATE_ALL_LANGUAGES_LIST",m="UPDATE_LANGUAGES_PROFILE_LIST",g="UPDATE_SYSTEM_STATUS",y="UPDATE_SYSTEM_TASKS",k="UPDATE_SYSTEM_LOGS",w="SYSTEM_UPDATE_RELEASES",S="UPDATE_SYSTEM_SETTINGS",C="SYSTEM_RUN_TASK",N="SERIES_UPDATE_WANTED_RANGE",I="UPDATE_SERIES_WANTED_LIST",P="UPDATE_SERIES_EPISODE_LIST",A="UPDATE_SERIES_HISTORY_LIST",T="UPDATE_SEIRES_INFO",E="SERIES_UPDATE_RANGE",M="UPDATE_SERIES_BLACKLIST",K="MOVIES_UPDATE_WANTED_RANGE",B="UPDATE_MOVIE_WANTED_LIST",D="UPDATE_MOVIE_HISTORY_LIST",z="UPDATE_MOVIE_INFO",R="MOVIES_UPDATE_RANGE",L="UPDATE_MOVIES_BLACKLIST",_="SITE_NEED_AUTH",H="SITE_SYSTEM_INITIALIZED",U="SITE_INITIALIZE_FAILED",F="SITE_SAVE_LOCALSTORAGE",G="SITE_NOTIFICATIONS_ADD",q="SITE_NOTIFICATIONS_REMOVE",W="SITE_NOTIFICATIONS_REMOVE_BY_TIMESTAMP",Y="SITE_SIDEBAR_UPDATE",V="SITE_BADGE_UPDATE",Q="SITE_OFFLINE_UPDATE",X=n(22),J=n(5),Z=n(15);function $(e){return Object(Z.isString)(e)||Object(Z.isNumber)(e)}function ee(e){return Object(Z.isNull)(e)||Object(Z.isUndefined)(e)}function te(e){return!ee(e)}function ne(e){return"radarrId"in e}function re(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=null!==(e=window.Bazarr.baseUrl)&&void 0!==e?e:"/";return t&&!n.endsWith("/")&&(n+="/"),n}function ae(){var e=Object(l.h)();return Object(a.useCallback)((function(){return e.push("/")}),[e])}function ce(e,t){Object(a.useEffect)((function(){e();var n=null;return void 0!==t&&(n=setInterval(e,t)),function(){null!==n&&clearInterval(n)}}),[e,t])}function ie(e,t){return function(e,t,n,r){var c=Object(a.useState)(e),i=Object(J.a)(c,2)[1];Object(a.useEffect)((function(){i((function(a){return a!==e&&(e!==t?r&&r():n&&n()),e}))}),[e,t,r,n])}(e.updating,!0,void 0,t)}function se(e,t,n){t({updating:!0,data:n}),e.then((function(e){t({updating:!1,data:e})})).catch((function(e){t({updating:!1,error:e,data:n})}))}function oe(e){return ne(e)?e.radarrId:"sonarrEpisodeId"in e?e.sonarrEpisodeId:function(e){return"episodeFileCount"in e}(e)?e.sonarrSeriesId:-1}function le(e){var t=e.items;return e.order.flatMap((function(e){return null!==e&&e in t?[t[e]]:[]}))}function ue(e,t,n){var r=Object(X.a)(e);return t.filter((function(e){return!ee(e)})).forEach((function(e){var t=r.findIndex((function(t,r){return!ee(t)&&n(t,e)}));-1!==t?r[t]=e:r.push(e)})),r}function de(){for(var e=arguments.length,t=new Array(e),n=0;n0?(r=O).push.apply(r,Object(X.a)(Array(h).fill(null))):h<0&&(O=Array(s).fill(null),b=Object(f.a)({},d)),"number"===typeof l&&"number"===typeof u?(a=O).splice.apply(a,[l,u].concat(Object(X.a)(j))):void 0===l&&(O=j),{updating:!1,data:{items:b,order:O}}}var fe,pe=Object(p.a)((r={},Object(h.a)(r,B,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{wantedMovieList:he(t,e.wantedMovieList,"radarrId")})})),Object(h.a)(r,K,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{wantedMovieList:he(t,e.wantedMovieList,"radarrId")})})),Object(h.a)(r,D,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{historyList:Oe(t,e.historyList.data)})})),Object(h.a)(r,z,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{movieList:he(t,e.movieList,"radarrId")})})),Object(h.a)(r,R,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{movieList:he(t,e.movieList,"radarrId")})})),Object(h.a)(r,L,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{blacklist:Oe(t,e.blacklist.data)})})),r),{movieList:{updating:!0,data:{items:{},order:[]}},wantedMovieList:{updating:!0,data:{items:{},order:[]}},historyList:{updating:!0,data:[]},blacklist:{updating:!0,data:[]}}),xe=Object(p.a)((fe={},Object(h.a)(fe,I,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{wantedEpisodesList:he(t,e.wantedEpisodesList,"sonarrEpisodeId")})})),Object(h.a)(fe,N,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{wantedEpisodesList:he(t,e.wantedEpisodesList,"sonarrEpisodeId")})})),Object(h.a)(fe,P,(function(e,t){var n=Oe(t,[]),r=n.updating,a=n.error,c=n.data,i=Object(f.a)({},e.episodeList.data);c.length>0&&(i[c[0].sonarrSeriesId]=c);return Object(f.a)(Object(f.a)({},e),{},{episodeList:{updating:r,error:a,data:i}})})),Object(h.a)(fe,A,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{historyList:Oe(t,e.historyList.data)})})),Object(h.a)(fe,T,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{seriesList:he(t,e.seriesList,"sonarrSeriesId")})})),Object(h.a)(fe,E,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{seriesList:he(t,e.seriesList,"sonarrSeriesId")})})),Object(h.a)(fe,M,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{blacklist:Oe(t,e.blacklist.data)})})),fe),{seriesList:{updating:!0,data:{items:{},order:[]}},wantedEpisodesList:{updating:!0,data:{items:{},order:[]}},episodeList:{updating:!0,data:{}},historyList:{updating:!0,data:[]},blacklist:{updating:!0,data:[]}}),ve="storage-ui-pageSize",me={get pageSize(){var e;return parseInt(null!==(e=localStorage.getItem(ve))&&void 0!==e?e:"50")},set pageSize(e){localStorage.setItem(ve,e.toString())}},ge=n(44),ye=n(45),ke=n(211),we=n.n(ke);var Se=new Map,Ce=new Map;function Ne(e,t,n){return function(r){var a=Ce.get(t),c=new Date;if(Object(Z.isEqual)(a,n)){var i=Se.get(t);if(i)if(c.getTime()-i.getTime()<200)return Promise.resolve()}else Ce.set(t,n);return Se.set(t,c),r({type:e,payload:{loading:!0,parameters:n}}),new Promise((function(a,c){t.apply(void 0,Object(X.a)(n)).then((function(t){r({type:e,payload:{loading:!1,item:t,parameters:n}}),a()})).catch((function(t){r({type:e,error:!0,payload:{loading:!1,item:t,parameters:n}}),c(t)}))}))}}function Ie(e,t){return function(){for(var n=arguments.length,r=new Array(n),a=0;a0?r.forEach((function(e){return t.append(n,e)})):t.append(n,""):t.append(n,e[n])};for(var r in e)n(r);return{v:t}}();return"object"===typeof t?t.v:void 0}}},{key:"get",value:function(e,t){return _t.axios.get(this.prefix+e,{params:t})}},{key:"post",value:function(e,t,n){var r=this.createFormdata(t);return _t.axios.post(this.prefix+e,r,{params:n})}},{key:"patch",value:function(e,t,n){var r=this.createFormdata(t);return _t.axios.patch(this.prefix+e,r,{params:n})}},{key:"delete",value:function(e,t,n){var r=this.createFormdata(t);return _t.axios.delete(this.prefix+e,{params:n,data:r})}}]),e}(),Tt=new(function(e){Object(It.a)(n,e);var t=Object(Pt.a)(n);function n(){return Object(ge.a)(this,n),t.call(this,"/episodes")}return Object(ye.a)(n,[{key:"bySeriesId",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t){var n=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.get("",{seriesid:t}).then((function(t){e(t.data.data)})).catch((function(e){r(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"wanted",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t,n){var r=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,a){r.get("/wanted",{start:t,length:n}).then((function(t){e(t.data)})).catch((function(e){a(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"wantedBy",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t){var n=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.get("/wanted",{episodeid:t}).then((function(t){e(t.data)})).catch((function(e){r(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"byEpisodeId",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t){var n=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.get("",{episodeid:t}).then((function(t){e(t.data.data)})).catch((function(e){r(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"history",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t){var n=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.get("/history",{episodeid:t}).then((function(t){e(t.data.data)})).catch((function(e){r(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"downloadSubtitles",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t,n,r){var a=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,c){a.patch("/subtitles",r,{seriesid:t,episodeid:n}).then((function(){return e()})).catch(c)})));case 1:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}()},{key:"uploadSubtitles",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t,n,r){var a=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,c){a.post("/subtitles",r,{seriesid:t,episodeid:n}).then((function(){return e()})).catch(c)})));case 1:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}()},{key:"deleteSubtitles",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t,n,r){var a=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,c){a.delete("/subtitles",r,{seriesid:t,episodeid:n}).then((function(){return e()})).catch(c)})));case 1:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}()},{key:"blacklist",value:function(){var e=Object(Ct.a)(St.a.mark((function e(){var t=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){t.get("/blacklist").then((function(t){e(t.data.data)})).catch(n)})));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"addBlacklist",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t,n,r){var a=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,c){a.post("/blacklist",r,{seriesid:t,episodeid:n}).then((function(){return e()})).catch(c)})));case 1:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}()},{key:"deleteBlacklist",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t,n){var r=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,a){r.delete("/blacklist",n,{all:t}).then((function(){return e()})).catch(a)})));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()}]),n}(At)),Et=new(function(e){Object(It.a)(n,e);var t=Object(Pt.a)(n);function n(){return Object(ge.a)(this,n),t.call(this,"/files")}return Object(ye.a)(n,[{key:"browse",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t,n){var r=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,a){r.get(t,{path:n}).then((function(t){return e(t.data)})).catch(a)})));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"bazarr",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t){return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.browse("",t));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"sonarr",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t){return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.browse("/sonarr",t));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"radarr",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t){return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.browse("/radarr",t));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),n}(At)),Mt=new(function(e){Object(It.a)(n,e);var t=Object(Pt.a)(n);function n(){return Object(ge.a)(this,n),t.call(this,"/history")}return Object(ye.a)(n,[{key:"stats",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t,n,r,a){var c=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,i){c.get("/stats",{timeframe:t,action:n,provider:r,language:a}).then((function(t){return e(t.data)})).catch(i)})));case 1:case"end":return e.stop()}}),e)})));return function(t,n,r,a){return e.apply(this,arguments)}}()}]),n}(At)),Kt=new(function(e){Object(It.a)(n,e);var t=Object(Pt.a)(n);function n(){return Object(ge.a)(this,n),t.call(this,"/movies")}return Object(ye.a)(n,[{key:"blacklist",value:function(){var e=Object(Ct.a)(St.a.mark((function e(){var t=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){t.get("/blacklist").then((function(t){e(t.data.data)})).catch(n)})));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"addBlacklist",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t,n){var r=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,a){r.post("/blacklist",n,{radarrid:t}).then((function(){return e()})).catch(a)})));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"deleteBlacklist",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t,n){var r=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,a){r.delete("/blacklist",n,{all:t}).then((function(){return e()})).catch(a)})));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"movies",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t){var n=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.get("",{radarrid:t}).then((function(t){e(t.data)})).catch((function(e){r(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"moviesBy",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t,n){var r=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,a){r.get("",{start:t,length:n}).then((function(t){e(t.data)})).catch((function(e){a(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"modify",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t){var n=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.post("",{radarrid:t.id,profileid:t.profileid}).then((function(){return e()})).catch((function(e){return r(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"wanted",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t,n){var r=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,a){r.get("/wanted",{start:t,length:n}).then((function(t){e(t.data)})).catch((function(e){a(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"wantedBy",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t){var n=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.get("/wanted",{radarrid:t}).then((function(t){e(t.data)})).catch((function(e){r(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"history",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t){var n=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.get("/history",{radarrid:t}).then((function(t){e(t.data.data)})).catch((function(e){r(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"action",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t){var n=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.patch("",t).then((function(){return e()})).catch(r)})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"downloadSubtitles",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t,n){var r=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,a){r.patch("/subtitles",n,{radarrid:t}).then((function(){return e()})).catch(a)})));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"uploadSubtitles",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t,n){var r=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,a){r.post("/subtitles",n,{radarrid:t}).then((function(){return e()})).catch(a)})));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"deleteSubtitles",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t,n){var r=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,a){r.delete("/subtitles",n,{radarrid:t}).then((function(){return e()})).catch(a)})));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()}]),n}(At)),Bt=new(function(e){Object(It.a)(n,e);var t=Object(Pt.a)(n);function n(){return Object(ge.a)(this,n),t.call(this,"/providers")}return Object(ye.a)(n,[{key:"providers",value:function(){var e=Object(Ct.a)(St.a.mark((function e(){var t=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){t.get("").then((function(t){e(t.data.data)})).catch(n)})));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"reset",value:function(){var e=Object(Ct.a)(St.a.mark((function e(){var t=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){t.post("",{action:"reset"}).then((function(){return e()})).catch(n)})));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"movies",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t){var n=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.get("/movies",{radarrid:t}).then((function(t){return e(t.data.data)})).catch(r)})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"downloadMovieSubtitle",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t,n){var r=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,a){r.post("/movies",n,{radarrid:t}).then((function(){return e()})).catch(a)})));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"episodes",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t){var n=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.get("/episodes",{episodeid:t}).then((function(t){return e(t.data.data)})).catch(r)})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"downloadEpisodeSubtitle",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t,n,r){var a=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,c){a.post("/episodes",r,{seriesid:t,episodeid:n}).then((function(){return e()})).catch(c)})));case 1:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}()}]),n}(At)),Dt=new(function(e){Object(It.a)(n,e);var t=Object(Pt.a)(n);function n(){return Object(ge.a)(this,n),t.call(this,"/series")}return Object(ye.a)(n,[{key:"series",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t){var n=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.get("",{seriesid:t}).then((function(t){e(t.data)})).catch((function(e){r(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"seriesBy",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t,n){var r=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,a){r.get("",{start:t,length:n}).then((function(t){e(t.data)})).catch((function(e){a(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"modify",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t){var n=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.post("",{seriesid:t.id,profileid:t.profileid}).then((function(){return e()})).catch((function(e){return r(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"action",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t){var n=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.patch("",t).then((function(){return e()})).catch(r)})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}]),n}(At)),zt=new(function(e){Object(It.a)(n,e);var t=Object(Pt.a)(n);function n(){return Object(ge.a)(this,n),t.call(this,"/subtitles")}return Object(ye.a)(n,[{key:"info",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t){var n=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.get("/info",{filenames:t}).then((function(t){return e(t.data.data)})).catch(r)})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"modify",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t,n){var r=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,a){r.patch("",n,{action:t}).then((function(){return e()})).catch(a)})));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()}]),n}(At)),Rt=new(function(e){Object(It.a)(n,e);var t=Object(Pt.a)(n);function n(){return Object(ge.a)(this,n),t.call(this,"/system")}return Object(ye.a)(n,[{key:"performAction",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t){var n=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.post("",void 0,{action:t}).then(e).catch(r)})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"login",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t,n){var r=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,a){r.post("/account",{username:t,password:n},{action:"login"}).then(e).catch(a)})));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"logout",value:function(){var e=Object(Ct.a)(St.a.mark((function e(){var t=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){t.post("/account",void 0,{action:"logout"}).then(e).catch(n)})));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"shutdown",value:function(){var e=Object(Ct.a)(St.a.mark((function e(){return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.performAction("shutdown"));case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"restart",value:function(){var e=Object(Ct.a)(St.a.mark((function e(){return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.performAction("restart"));case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"settings",value:function(){var e=Object(Ct.a)(St.a.mark((function e(){var t=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){t.get("/settings").then((function(t){e(t.data)})).catch(n)})));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"setSettings",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t){var n=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.post("/settings",t).then((function(t){e()})).catch(r)})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"languages",value:function(){var e=Object(Ct.a)(St.a.mark((function e(){var t=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){t.get("/languages").then((function(t){e(t.data)})).catch((function(e){n(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"languagesProfileList",value:function(){var e=Object(Ct.a)(St.a.mark((function e(){var t=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){t.get("/languages/profiles").then((function(t){return e(t.data)})).catch(n)})));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"status",value:function(){var e=Object(Ct.a)(St.a.mark((function e(){var t=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){t.get("/status").then((function(t){e(t.data.data)})).catch((function(e){n(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"logs",value:function(){var e=Object(Ct.a)(St.a.mark((function e(){var t=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){t.get("/logs").then((function(t){return e(t.data.data)})).catch((function(e){return n(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"releases",value:function(){var e=Object(Ct.a)(St.a.mark((function e(){var t=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){t.get("/releases").then((function(t){return e(t.data.data)})).catch(n)})));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"deleteLogs",value:function(){var e=Object(Ct.a)(St.a.mark((function e(){var t=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){t.delete("/logs").then((function(){return e()})).catch((function(e){return n(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"getTasks",value:function(){var e=Object(Ct.a)(St.a.mark((function e(){var t=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){t.get("/tasks").then((function(t){e(t.data.data)})).catch((function(e){n(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"runTask",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t){var n=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.post("/tasks",{taskid:t}).then((function(){e()})).catch((function(e){r(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"testNotification",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t){var n=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.patch("/notifications",{url:t}).then((function(){return e()})).catch(r)})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"search",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t){var n=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.get("/searches",{query:t}).then((function(t){return e(t.data)})).catch(r)})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}]),n}(At)),Lt=new(function(){function e(){Object(ge.a)(this,e)}return Object(ye.a)(e,[{key:"urlTest",value:function(e,t,n){return new Promise((function(r,a){_t.axios.get("../test/".concat(e,"/").concat(t,"api/system/status"),{params:n}).then((function(e){return r(e.data)})).catch(a)}))}}]),e}()),_t=new(function(){function e(){Object(ge.a)(this,e),this.axios=void 0,this.source=void 0;var t="/"===window.Bazarr.baseUrl?"/api/":"".concat(window.Bazarr.baseUrl,"/api/");this.initialize(t,window.Bazarr.apiKey)}return Object(ye.a)(e,[{key:"initialize",value:function(e,t){var n=this;this.axios=we.a.create({baseURL:e}),this.axios.defaults.headers.post["Content-Type"]="application/json",this.axios.defaults.headers.common["X-API-KEY"]=null!==t&&void 0!==t?t:"AUTH_NEEDED",this.source=we.a.CancelToken.source(),this.axios.interceptors.request.use((function(e){return e.cancelToken=n.source.token,e})),this.axios.interceptors.response.use((function(e){return n.onOnline(),e.status>=200&&e.status<300?Promise.resolve(e):(n.handleError(e.status),Promise.reject(e))}),(function(e){if(e.response){var t=e.response;n.handleError(t.status),n.onOnline()}else n.onOffline(),e.message="You have disconnected to Bazarr backend";return Promise.reject(e)}))}},{key:"danger_resetApi",value:function(e){this.axios.defaults.headers.common["X-API-KEY"]=e}},{key:"onOnline",value:function(){Yt.getState().site.offline&&Yt.dispatch(rt(!1))}},{key:"onOffline",value:function(){Yt.dispatch(rt(!0))}},{key:"handleError",value:function(e){switch(e){case 401:Yt.dispatch(Xe())}}}]),e}());function Ht(){return{pageSize:me.pageSize}}var Ut,Ft=Object(p.a)((Ue={},Object(h.a)(Ue,_,(function(e){return _t.danger_resetApi("NEED_AUTH"),Object(f.a)(Object(f.a)({},e),{},{auth:!1})})),Object(h.a)(Ue,H,(function(e){return Object(f.a)(Object(f.a)({},e),{},{initialized:!0})})),Object(h.a)(Ue,U,(function(e){return Object(f.a)(Object(f.a)({},e),{},{initialized:"An Error Occurred When Initializing Bazarr UI"})})),Object(h.a)(Ue,F,(function(e,t){var n=t.payload;for(var r in n){var a=n[r];localStorage.setItem(r,a)}return Object(f.a)(Object(f.a)({},e),Ht())})),Object(h.a)(Ue,G,(function(e,t){var n=[].concat(Object(X.a)(e.notifications.filter((function(e){return e.id!==t.payload.id}))),[t.payload]);return Object(f.a)(Object(f.a)({},e),{},{notifications:n})})),Object(h.a)(Ue,q,(function(e,t){var n=e.notifications.filter((function(e){return e.id!==t.payload}));return Object(f.a)(Object(f.a)({},e),{},{notifications:n})})),Object(h.a)(Ue,W,(function(e,t){var n=e.notifications.filter((function(e){return e.timestamp!==t.payload}));return Object(f.a)(Object(f.a)({},e),{},{notifications:n})})),Object(h.a)(Ue,Y,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{sidebar:t.payload})})),Object(h.a)(Ue,V,{next:function(e,t){var n=t.payload.item;return n&&!0!==t.error?Object(f.a)(Object(f.a)({},e),{},{badges:n}):e},throw:function(e){return e}}),Object(h.a)(Ue,Q,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{offline:t.payload})})),Ue),Object(f.a)({initialized:!1,auth:!0,pageSize:50,notifications:[],sidebar:"",badges:{movies:0,episodes:0,providers:0},offline:!1},Ht())),Gt=Object(p.a)((Ut={},Object(h.a)(Ut,v,(function(e,t){var n=Oe(t,[]),r=Object(f.a)(Object(f.a)({},n),{},{data:n.data.filter((function(e){return e.enabled}))});return Object(f.a)(Object(f.a)({},e),{},{languages:n,enabledLanguage:r})})),Object(h.a)(Ut,m,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{languagesProfiles:Oe(t,[])})})),Object(h.a)(Ut,g,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{status:Oe(t,e.status.data)})})),Object(h.a)(Ut,y,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{tasks:Oe(t,e.tasks.data)})})),Object(h.a)(Ut,C,(function(e,t){var n=t.payload,r=e.tasks,a=Object(X.a)(r.data),c=a.findIndex((function(e){return e.job_id===n}));return-1!==c&&(a[c].job_running=!0),Object(f.a)(Object(f.a)({},e),{},{tasks:Object(f.a)(Object(f.a)({},r),{},{data:a})})})),Object(h.a)(Ut,x,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{providers:Oe(t,e.providers.data)})})),Object(h.a)(Ut,k,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{logs:Oe(t,e.logs.data)})})),Object(h.a)(Ut,w,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{releases:Oe(t,e.releases.data)})})),Object(h.a)(Ut,S,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{settings:Oe(t,e.settings.data)})})),Ut),{languages:{updating:!0,data:[]},enabledLanguage:{updating:!0,data:[]},languagesProfiles:{updating:!0,data:[]},status:{updating:!0,data:void 0},tasks:{updating:!0,data:[]},providers:{updating:!0,data:[]},logs:{updating:!0,data:[]},releases:{updating:!0,data:[]},settings:{updating:!0,data:void 0}}),qt=Object(d.c)({system:Gt,series:xe,movie:pe,site:Ft}),Wt=[b.a,O.a];var Yt=Object(d.d)(qt,d.a.apply(void 0,Wt)),Vt=(n(330),n(495));function Qt(e){return Object(o.c)(e)}function Xt(e){var t=Object(o.b)();return Object(a.useCallback)((function(){return t(e.apply(void 0,arguments))}),[e,t])}function Jt(e,t){var n=Object(o.b)();return Object(a.useCallback)((function(){for(var r=arguments.length,a=new Array(r),c=0;c0&&void 0!==arguments[0]&&arguments[0],t=Xt(ze),n=Qt((function(t){return e?t.system.enabledLanguage.data:t.system.languages.data}));return Zt(n,t)}function rn(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=nn(e),n=Object(J.a)(t,1),r=n[0];return Object(a.useCallback)((function(e){return void 0===e?void 0:r.find((function(t){return t.code2===e}))}),[r])}function an(e){var t=rn(!0);return Object(a.useMemo)((function(){var n;return null!==(n=null===e||void 0===e?void 0:e.items.map((function(e){var n,r,a=e.language;return{hi:"True"===e.hi,forced:"True"===e.forced,code2:a,name:null!==(n=null===(r=t(a))||void 0===r?void 0:r.name)&&void 0!==n?n:""}})))&&void 0!==n?n:[]}),[t,null===e||void 0===e?void 0:e.items])}function cn(){var e=Xt(yt);return Zt(Qt((function(e){return e.series.seriesList})),e)}function sn(e){var t=cn(),n=Object(J.a)(t,2),r=n[0],c=n[1],i=Xt(mt);return Zt(Object(a.useMemo)((function(){var t=r.data.items,n=null;return e&&!isNaN(e)&&e in t&&(n=t[e]),Object(f.a)(Object(f.a)({},r),{},{data:n})}),[e,r]),Object(a.useCallback)((function(){e&&!isNaN(e)&&(c([e]),i(e))}),[e,c,i]))}function on(e){var t=Xt(mt),n=Object(a.useCallback)((function(){void 0===e||isNaN(e)||t(e)}),[t,e]),r=Qt((function(e){return e.series.episodeList})),c=Object(a.useMemo)((function(){return void 0===e||isNaN(e)?[]:null!==(t=r.data[e])&&void 0!==t?t:[];var t}),[e,r.data]);return Zt(Object(f.a)(Object(f.a)({},r),{},{data:c}),n)}function ln(){var e=Xt(ut);return Zt(Qt((function(e){return e.movie.movieList})),e)}function un(e){var t=ln(),n=Object(J.a)(t,2),r=n[0],c=n[1];return Zt(Object(a.useMemo)((function(){var t=r.data.items,n=null;return e&&!isNaN(e)&&e in t&&(n=t[e]),Object(f.a)(Object(f.a)({},r),{},{data:n})}),[e,r]),Object(a.useCallback)((function(){e&&!isNaN(e)&&c([e])}),[e,c]))}function dn(){var e=Xt(bt);return Zt(Qt((function(e){return e.system.providers})),e)}function jn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5,n=Xt($e),r=Xt(tt);return Object(a.useCallback)((function(a){var c=Object(f.a)(Object(f.a)({},a),{},{id:e,timestamp:new Date});n(c),setTimeout((function(){return r(c.timestamp)}),1e3*t)}),[n,r,t,e])}function bn(){var e,t,n=$t();return null===(e=null===(t=Object(J.a)(n,1)[0].data)||void 0===t?void 0:t.general.use_sonarr)||void 0===e||e}function On(){var e,t,n=$t();return null===(e=null===(t=Object(J.a)(n,1)[0].data)||void 0===t?void 0:t.general.use_radarr)||void 0===e||e}var hn=n(26),fn=n(7),pn=n(12),xn=n(512),vn=n(513),mn=n(491),gn=n(1),yn=n(492),kn=n(493),wn=n(267),Sn=(n(333),["Tab","Enter"," ",",",";","."]),Cn=function(e){var t=e.defaultValue,n=e.disabled,r=e.onChange,c=Object(a.useState)(null!==t&&void 0!==t?t:[]),i=Object(J.a)(c,2),s=i[0],o=i[1],l=Object(a.useRef)(null),u=Object(a.useCallback)((function(e){var t=Object(X.a)(s);t.push(e),o(t),r&&r(t)}),[s,r]),d=Object(a.useCallback)((function(e){var t;if(-1!==(e=null!==(t=e)&&void 0!==t?t:s.length-1)){var n=Object(X.a)(s);n.splice(e,1),o(n),r&&r(n)}}),[s,r]),j=Object(a.useCallback)((function(){l.current&&(l.current.value="")}),[l]),b=Object(a.useCallback)((function(e){var t=e.key,n=e.currentTarget.value;Sn.includes(t)&&0!==n.length?(e.preventDefault(),u(n),j()):"Backspace"===t&&0===n.length&&(e.preventDefault(),d())}),[u,d,j]),O=Object(a.useCallback)((function(e){var t=e.key,n=e.currentTarget.value;Sn.includes(t)&&0!==n.length&&e.preventDefault()}),[]),h=Object(a.useCallback)((function(e){var t=e.currentTarget.value;0!==t.length&&(e.preventDefault(),u(t),j())}),[u,j]),f=Object(a.useMemo)((function(){return s.map((function(e,t){return Object(gn.jsx)("span",{title:e,className:"custom-chip ".concat(n?"":"active"),onClick:function(){n||d(t)},children:e},t)}))}),[s,d,n]);return Object(gn.jsxs)("div",{className:"form-control custom-chip-input d-flex",children:[Object(gn.jsx)("div",{className:"chip-container",children:f}),Object(gn.jsx)("input",{disabled:n,className:"main-input p-0",ref:l,onKeyUp:b,onKeyDown:O,onBlur:h})]})},Nn=n(51),In=n(508),Pn=n(506),An="--back--";function Tn(e){var t=e.lastIndexOf("/");return-1===t&&(t=e.lastIndexOf("\\")),t}function En(e){if(e.endsWith("/")||e.endsWith("\\"))return e;var t=Tn(e);return e.slice(0,t+1)}var Mn=function(e){var t=e.defaultValue,n=e.onChange,r=e.load,c=e.drop,i=Object(a.useState)(!1),s=Object(J.a)(i,2),o=s[0],l=s[1],u=Object(a.useState)(null!==t&&void 0!==t?t:""),d=Object(J.a)(u,2),j=d[0],b=d[1],O=Object(a.useState)((function(){return En(j)})),h=Object(J.a)(O,2),f=h[0],p=h[1],x=Object(a.useState)(!0),v=Object(J.a)(x,2),m=v[0],g=v[1],y=Object(a.useMemo)((function(){var e=Tn(j);return j.slice(e+1)}),[j]),k=Object(a.useMemo)((function(){var e=Tn(f.slice(0,-1));return f.slice(0,e+1)}),[f]),w=Object(a.useState)([]),S=Object(J.a)(w,2),C=S[0],N=S[1],I=Object(a.useMemo)((function(){if(m)return Object(gn.jsx)(In.a.Item,{children:Object(gn.jsx)(mn.a,{size:"sm",animation:"border"})});var e=[];return e.push.apply(e,Object(X.a)(C.filter((function(e){return e.name.startsWith(y)})).map((function(e){return Object(gn.jsxs)(In.a.Item,{eventKey:e.path,children:[Object(gn.jsx)(pn.a,{icon:e.children?Nn.e:Nn.d,className:"mr-2"}),Object(gn.jsx)("span",{children:e.name})]},e.name)})))),0===e.length&&e.push(Object(gn.jsx)(In.a.Header,{children:"No Files"},"no-files")),0!==k.length?[Object(gn.jsxs)(In.a.Item,{eventKey:An,children:[Object(gn.jsx)(pn.a,{icon:fn.P,className:"mr-2"}),Object(gn.jsx)("span",{children:"Back"})]},"back"),Object(gn.jsx)(In.a.Divider,{},"back-divider")].concat(e):e}),[C,y,k,m]);Object(a.useEffect)((function(){if(j!==f){var e=En(j);e!==f&&(p(e),n&&n(e))}}),[f,j,n]);var P=Object(a.useRef)(null);return Object(a.useEffect)((function(){o&&(g(!0),r(f).then((function(e){N(e)})).finally((function(){return g(!1)})))}),[f,r,o]),Object(gn.jsxs)(In.a,{show:o,drop:c,onSelect:function(e){var t;e&&(b(e!==An?e:k),null===(t=P.current)||void 0===t||t.focus())},onToggle:function(e,t,n){e||"select"===n.source?e&&l(!0):l(!1)},children:[Object(gn.jsx)(In.a.Toggle,{as:Pn.a.Control,placeholder:"Click to start",type:"text",value:j,onChange:function(e){b(e.currentTarget.value)},ref:P}),Object(gn.jsx)(In.a.Menu,{className:"w-100",style:{maxHeight:256,overflowY:"auto"},children:I})]})},Kn=n(42),Bn=function(e){var t=e.value,n=e.emptyText,r=e.multiple,c=e.disabled,i=e.onChange,s=Object(a.useState)([]),o=Object(J.a)(s,2),l=o[0],u=o[1],d=Object(a.useRef)(null);Object(a.useEffect)((function(){t&&(u(t),0===t.length&&d.current&&(d.current.value=""))}),[t]);var j=Object(a.useMemo)((function(){return 0===l.length?n:r?"".concat(l.length," Files"):l[0].name}),[l,n,r]);return Object(gn.jsx)(Pn.a.File,{disabled:c,custom:!0,label:j,multiple:r,ref:d,onChange:function(e){var t=e.target.files;if(t){var n,r=[],a=Object(Kn.a)(t);try{for(a.s();!(n=a.n()).done;){var c=n.value;r.push(c)}}catch(s){a.e(s)}finally{a.f()}u(r),i&&i(r)}}})},Dn=n(207);n(335);function zn(e){var t=e.className,n=e.placeholder,r=e.label,c=e.disabled,i=e.clearable,s=e.loading,o=e.options,l=e.multiple,u=e.onChange,d=e.defaultValue,j=e.components,b=e.value,O=Object(a.useCallback)((function(e){var t;return null===(t=o.find((function(t){return t.value===e})))||void 0===t?void 0:t.label}),[o]),h=Object(a.useCallback)((function(e){if(null!==e&&void 0!==e){if(l)return e.map((function(e){var t;return{label:r?r(e):null!==(t=O(e))&&void 0!==t?t:"Unknown",value:e}}));var t,n=e;return{label:r?r(n):null!==(t=O(n))&&void 0!==t?t:"Unknown",value:n}}return e}),[r,l,O]),f=Object(a.useMemo)((function(){return h(d)}),[d,h]),p=Object(a.useMemo)((function(){return h(b)}),[h,b]);return Object(gn.jsx)(Dn.a,{isLoading:s,placeholder:n,isSearchable:o.length>=10,isMulti:l,closeMenuOnSelect:!l,defaultValue:f,value:p,isClearable:i,isDisabled:c,options:o,components:j,className:"custom-selector w-100 ".concat(null!==t&&void 0!==t?t:""),classNamePrefix:"selector",onChange:function(e){if(u){var t,n=null;if(Object(Z.isArray)(e))n=e.map((function(e){return e.value}));else n=null!==(t=null===e||void 0===e?void 0:e.value)&&void 0!==t?t:null;u(n)}}})}var Rn,Ln=n(292),_n=(n(345),n(346),function(e){var t=e.min,n=e.max,r=e.tooltips,a=e.defaultValue,c=e.onChange,i=e.onAfterChange;return Object(gn.jsxs)("div",{className:"d-flex flex-row align-items-center py-2",children:[Object(gn.jsx)("span",{className:"text-muted pr-3",children:null!==t&&void 0!==t?t:0}),Object(gn.jsx)(Ln.a,{min:null!==t&&void 0!==t?t:0,max:null!==n&&void 0!==n?n:100,className:"custom-rc-slider",step:1,defaultValue:a,onChange:c,onAfterChange:i,handle:function(e){return Object(gn.jsx)("div",{className:"rc-slider-handle",style:{left:"".concat(e.offset,"%")},children:Object(gn.jsx)(Hn,{tooltips:r,value:e.value})})}}),Object(gn.jsx)("span",{className:"text-muted pl-3",children:null!==n&&void 0!==n?n:100})]})}),Hn=function(e){var t=e.tooltips,n=e.value,r=Object(a.useMemo)((function(){var e=["rc-slider-handle-tips"];return void 0!==t&&("string"===typeof t?e.push("rc-slider-handle-tips-always"):!1===t&&e.push("rc-slider-handle-tips-hidden")),e.join(" ")}),[t]);return Object(gn.jsx)("span",{className:r,children:n})};function Un(e){var t,n=e.exist,r=e.state,c=e.children,i=n?!n(r.data):!((t=r.data)instanceof Array?0!==t.length:null!==t&&void 0!==t),s=jn("async-overlay");if(Object(a.useEffect)((function(){r.updating||void 0===r.error||i||s({type:"error",message:r.error.message})}),[r,s,i]),r.updating){if(i)return Object(gn.jsx)(ja,{})}else if(r.error&&i)return Object(gn.jsx)(yn.a,{children:Object(gn.jsxs)(kn.a,{variant:"danger",className:"my-4",children:[Object(gn.jsxs)(kn.a.Heading,{children:[Object(gn.jsx)(pn.a,{className:"mr-2",icon:fn.t}),Object(gn.jsx)("span",{children:"Ouch! You got an error"})]}),Object(gn.jsx)("p",{children:r.error.message}),Object(gn.jsx)("hr",{}),Object(gn.jsx)("div",{className:"d-flex justify-content-end",children:Object(gn.jsx)(wn.a,{variant:"outline-danger",onClick:je,children:"Reload"})})]})});return c?c(r.data,r.error):null}function Fn(e){var t=e.promise,n=e.children,r=Object(a.useState)(null),c=Object(J.a)(r,2),i=c[0],s=c[1];return Object(a.useEffect)((function(){t().then((function(e){return s(e)})).catch((function(){}))}),[t]),null===i?Object(gn.jsx)(ja,{}):n(i)}function Gn(e){var t=e.label,n=e.state,r=Object(hn.a)(e,["label","state"]),c=Object(a.useMemo)((function(){return n.data.map((function(e){return{label:t(e),value:e}}))}),[n,t]);return Object(gn.jsx)(zn,Object(f.a)({loading:n.updating,options:c,label:t},r))}function qn(e){var t=e.children,n=e.className,r=e.promise,c=e.onSuccess,i=e.noReset,s=e.error,o=e.onChange,l=e.disabled,u=Object(hn.a)(e,["children","className","promise","onSuccess","noReset","error","onChange","disabled"]),d=Object(a.useState)(!1),j=Object(J.a)(d,2),b=j[0],O=j[1],h=Object(a.useState)(Rn.Invalid),p=Object(J.a)(h,2),x=p[0],v=p[1],m=Object(a.useState)(null),g=Object(J.a)(m,2)[1];Object(a.useEffect)((function(){if(!i){if(x===Rn.Error||x===Rn.Success){var e=setTimeout((function(){return v(Rn.Invalid)}),2e3);g(e)}return function(){g((function(e){return e&&clearTimeout(e),null}))}}}),[x,i]);var y=Object(a.useCallback)((function(){if(x===Rn.Invalid){var e=r();e&&(O(!0),o&&o(!0),e.then((function(e){v(Rn.Success),c&&c(e)})).catch((function(){v(Rn.Error),s&&s()})).finally((function(){O(!1),o&&o(!1)})))}}),[s,o,r,c,x]),k=t;return b&&(k=Object(gn.jsx)(pn.a,{icon:fn.j,spin:!0})),x===Rn.Success?k=Object(gn.jsx)(pn.a,{icon:fn.h}):x===Rn.Error&&(k=Object(gn.jsx)(pn.a,{icon:fn.X})),Object(gn.jsx)(wn.a,Object(f.a)(Object(f.a)({className:n,disabled:b||l||x!==Rn.Invalid},u),{},{onClick:y,children:k}))}!function(e){e[e.Success=0]="Success",e[e.Error=1]="Error",e[e.Invalid=2]="Invalid"}(Rn||(Rn={}));var Wn=n(494),Yn=function(e){var t=e.icon,n=e.onClick;return Object(gn.jsx)(wn.a,{as:Wn.a,className:"mx-1 p-1",variant:"secondary",onClick:n,children:Object(gn.jsx)(pn.a,{icon:t})})},Vn=function(e){var t=e.onClick,n=(e.destructive,e.disabled),r=e.variant,a=e.className,c=e.size,i=Object(hn.a)(e,["onClick","destructive","disabled","variant","className","size"]);return Object(gn.jsx)(wn.a,{disabled:i.loading||n,size:null!==c&&void 0!==c?c:"sm",variant:null!==r&&void 0!==r?r:"light",className:"text-nowrap ".concat(null!==a&&void 0!==a?a:""),onClick:t,children:Object(gn.jsx)(Qn,Object(f.a)({},i))})},Qn=function(e){var t=e.icon,n=e.children,r=e.loading;return Object(gn.jsxs)(c.a.Fragment,{children:[Object(gn.jsx)(pn.a,{style:{width:"1rem"},icon:r?fn.j:t,spin:r}),n&&!r?Object(gn.jsx)("span",{className:"ml-2 font-weight-bold",children:n}):null]})},Xn=function(e){var t=e.children,n=e.icon,r=e.disabled,a=e.updating,c=e.updatingIcon,i=e.onClick,s=n;return a&&(s=c||fn.S),Object(gn.jsxs)(wn.a,{variant:"dark",className:"d-flex flex-column text-nowrap py-1",disabled:r||a,onClick:i,children:[Object(gn.jsx)(pn.a,{className:"mx-auto my-1",icon:s,spin:a}),Object(gn.jsx)("span",{className:"align-bottom text-themecolor small text-center",children:t})]})};var Jn=Xn,Zn=function(e){var t=e.children,n=e.pos,r="d-flex flex-grow-1 align-items-center justify-content-".concat(n);return Object(gn.jsx)("div",{className:r,children:t})},$n=(n(347),function(e){var t,n=e.children,r=e.scroll,c=e.className,i=Object(a.useMemo)((function(){var e=["content-header","bg-dark","p-2"];return void 0!==c&&e.push(c),!1!==r&&e.push("scroll"),e.join(" ")}),[r,c]);return t=!1!==r?Object(gn.jsx)("div",{className:"d-flex flex-nowrap flex-grow-1",children:n}):n,Object(gn.jsx)(Vt.a,{className:i,children:t})});$n.Button=Jn,$n.Group=Zn,$n.AsyncButton=function(e){var t=e.promise,n=e.onSuccess,r=Object(hn.a)(e,["promise","onSuccess"]),c=Object(a.useState)(!1),i=Object(J.a)(c,2),s=i[0],o=i[1],l=Object(a.useCallback)((function(){o(!0),t().then((function(e){o(!1),n&&n(e)}))}),[n,t]);return Object(gn.jsx)(Xn,Object(f.a)({updating:s,onClick:l},r))};function er(e){return e.name}function tr(e){var t=e.options,n=Object(hn.a)(e,["options"]),r=Object(a.useMemo)((function(){return t.map((function(e){return{label:e.name,value:e}}))}),[t]);return Object(gn.jsx)(zn,Object(f.a)({placeholder:"Language...",options:r,label:er},n))}var nr=n(505),rr=c.a.createContext([[],function(e){}]),ar=c.a.createContext([[],function(e){}]);function cr(){var e=Object(a.useContext)(rr),t=Object(J.a)(e,2),n=t[0],r=t[1],c=Object(a.useContext)(ar),i=Object(J.a)(c,2),s=i[0],o=i[1];return Object(a.useCallback)((function(e,t){"modal ".concat(e," sending payload"),r([].concat(Object(X.a)(n),[e])),o([].concat(Object(X.a)(s),[null!==t&&void 0!==t?t:null]))}),[n,s,r,o])}function ir(){var e=Object(a.useContext)(rr),t=Object(J.a)(e,2),n=t[0],r=t[1],c=Object(a.useContext)(ar),i=Object(J.a)(c,2),s=i[0],o=i[1];return Object(a.useCallback)((function(){var e=Object(X.a)(n);e.pop();var t=Object(X.a)(s);t.pop(),r(e),o(t)}),[n,s,r,o])}function sr(e){var t=Object(a.useContext)(rr)[0];return e===t[t.length-1]}function or(e,t){var n=sr(e);Object(a.useEffect)((function(){n&&t()}),[n,t])}function lr(e){var t=Object(a.useContext)(ar)[0],n=Object(a.useContext)(rr)[0];return Object(a.useMemo)((function(){var r=n.findIndex((function(t){return t===e}));return-1!==r?t[r]:null}),[n,t,e])}var ur,dr=function(e){var t=e.children,n=Object(a.useState)([]),r=Object(J.a)(n,2),c=r[0],i=r[1],s=Object(a.useState)([]),o=Object(J.a)(s,2),l=o[0],u=o[1];return Object(gn.jsx)(rr.Provider,{value:[c,i],children:Object(gn.jsx)(ar.Provider,{value:[l,u],children:t})})},jr=function(e){var t=e.size,n=e.closeable,r=e.modalKey,a=e.title,c=e.children,i=e.footer,s=sr(r),o=ir(),l=!1!==n;return Object(gn.jsxs)(nr.a,{centered:!0,size:t,show:s,onHide:o,backdrop:l?void 0:"static",children:[Object(gn.jsx)(nr.a.Header,{closeButton:l,children:a}),Object(gn.jsx)(nr.a.Body,{children:c}),Object(gn.jsx)(nr.a.Footer,{hidden:void 0===i,children:i})]})},br=jr,Or=function(e){var t=e.history,n=e.update,r=e.promise,a=t.provider,c=t.subs_id,i=t.language,s=t.subtitles_path,o=t.blacklisted;return c&&a&&i?Object(gn.jsx)(qn,{size:"sm",variant:"light",noReset:!0,disabled:o,promise:function(){var e=i.code2;return r({provider:a,subs_id:c,subtitles_path:s,language:e})},onSuccess:n,children:Object(gn.jsx)(pn.a,{icon:fn.u})}):null},hr=function(e){var t,n=Object.assign({},e),r=lr(n.modalKey),c=Object(a.useState)({updating:!1,data:[]}),i=Object(J.a)(c,2),s=i[0],o=i[1],l=Object(a.useCallback)((function(){r&&se(Kt.history(r.radarrId),o,[])}),[r]);Object(a.useEffect)((function(){l()}),[l]);var u=Object(a.useMemo)((function(){return[{accessor:"action",className:"text-center",Cell:function(e){return Object(gn.jsx)(ua,{action:e.value})}},{Header:"Language",accessor:"language",Cell:function(e){var t=e.value;return t?Object(gn.jsx)(ba,{text:t,long:!0}):null}},{Header:"Provider",accessor:"provider"},{Header:"Score",accessor:"score"},{Header:"Date",accessor:"timestamp",Cell:function(e){return e.value?Object(gn.jsx)(Oa,{text:e.row.original.parsed_timestamp,delay:1,children:Object(gn.jsx)("span",{children:e.value})}):null}},{accessor:"blacklisted",Cell:function(e){var t=e.row.original;return Object(gn.jsx)(Or,{update:l,promise:function(e){return Kt.addBlacklist(t.radarrId,e)},history:t})}}]}),[l]);return Object(gn.jsx)(br,Object(f.a)(Object(f.a)({title:"History - ".concat(null!==(t=null===r||void 0===r?void 0:r.title)&&void 0!==t?t:"")},n),{},{children:Object(gn.jsx)(Un,{state:s,children:function(e){return Object(gn.jsx)(la,{emptyText:"No History Found",columns:u,data:e})}})}))},fr=function(e){var t,n=lr(e.modalKey),r=Object(a.useState)({updating:!1,data:[]}),c=Object(J.a)(r,2),i=c[0],s=c[1],o=Object(a.useCallback)((function(){n&&se(Tt.history(n.sonarrEpisodeId),s,[])}),[n]);Object(a.useEffect)((function(){return o()}),[o]);var l=Object(a.useMemo)((function(){return[{accessor:"action",className:"text-center",Cell:function(e){return Object(gn.jsx)(ua,{action:e.value})}},{Header:"Language",accessor:"language",Cell:function(e){var t=e.value;return t?Object(gn.jsx)(ba,{text:t,long:!0}):null}},{Header:"Provider",accessor:"provider"},{Header:"Score",accessor:"score"},{Header:"Date",accessor:"timestamp",Cell:function(e){return e.value?Object(gn.jsx)(Oa,{text:e.row.original.parsed_timestamp,delay:1,children:Object(gn.jsx)("span",{children:e.value})}):null}},{accessor:"blacklisted",Cell:function(e){var t=e.row.original,n=t.sonarrSeriesId,r=t.sonarrEpisodeId;return Object(gn.jsx)(Or,{history:t,update:o,promise:function(e){return Tt.addBlacklist(n,r,e)}})}}]}),[o]);return Object(gn.jsx)(br,Object(f.a)(Object(f.a)({title:"History - ".concat(null!==(t=null===n||void 0===n?void 0:n.title)&&void 0!==t?t:"")},e),{},{children:Object(gn.jsx)(Un,{state:i,children:function(e){return Object(gn.jsx)(la,{emptyText:"No History Found",columns:l,data:e})}})}))},pr=function(e){var t=e.onSuccess,n=e.submit,r=Object(hn.a)(e,["onSuccess","submit"]),c=en(),i=Object(J.a)(c,1)[0],s=lr(r.modalKey),o=ir(),l=Object(a.useMemo)((function(){return i.map((function(e){return{label:e.name,value:e.profileId}}))}),[i]),u=Object(a.useState)(null),d=Object(J.a)(u,2),j=d[0],b=d[1],O=Object(a.useState)(!1),h=Object(J.a)(O,2),p=h[0],x=h[1],v=Object(a.useMemo)((function(){return Object(gn.jsx)(qn,{noReset:!0,onChange:x,promise:function(){if(s){var e=oe(s);return n({id:[e],profileid:[j]})}return null},onSuccess:function(){o(),t&&s&&t(s)},children:"Save"})}),[o,j,s,t,n]);return Object(gn.jsx)(br,Object(f.a)(Object(f.a)({closeable:!p,footer:v,title:null===s||void 0===s?void 0:s.title},r),{},{children:Object(gn.jsx)(yn.a,{fluid:!0,children:Object(gn.jsxs)(Pn.a,{children:[Object(gn.jsxs)(Pn.a.Group,{children:[Object(gn.jsx)(Pn.a.Label,{children:"Audio"}),Object(gn.jsx)(Pn.a.Control,{type:"text",disabled:!0,defaultValue:null===s||void 0===s?void 0:s.audio_language.map((function(e){return e.name})).join(", ")})]}),Object(gn.jsxs)(Pn.a.Group,{children:[Object(gn.jsx)(Pn.a.Label,{children:"Languages Profiles"}),Object(gn.jsx)(zn,{clearable:!0,options:l,defaultValue:null===s||void 0===s?void 0:s.profileId,onChange:function(e){return b(void 0===e?null:e)}})]})]})})}))},xr=function(e){var t,n=e,r=nn(!0),c=Object(J.a)(r,1)[0],i=lr(n.modalKey),s=un(null===i||void 0===i?void 0:i.radarrId),o=Object(J.a)(s,2)[1],l=ir(),u=Object(a.useState)(!1),d=Object(J.a)(u,2),j=d[0],b=d[1],O=Object(a.useState)(null),h=Object(J.a)(O,2),p=h[0],x=h[1],v=tn(null===i||void 0===i?void 0:i.profileId),m=function(e){var t=rn();return Object(a.useMemo)((function(){return t(e)}),[e,t])}(null===v||void 0===v||null===(t=v.items[0])||void 0===t?void 0:t.language);Object(a.useEffect)((function(){return x(null!==m&&void 0!==m?m:null)}),[m]);var g=Object(a.useState)(null),y=Object(J.a)(g,2),k=y[0],w=y[1],S=Object(a.useState)(!1),C=Object(J.a)(S,2),N=C[0],I=C[1],P=Object(a.useMemo)((function(){return null!==k&&(null===p||void 0===p?void 0:p.code2)}),[p,k]),A=Object(gn.jsx)(qn,{noReset:!0,disabled:!P,onChange:b,promise:function(){return k&&i&&p?Kt.uploadSubtitles(i.radarrId,{file:k,forced:N,hi:!1,language:p.code2}):null},onSuccess:function(){l(),o()},children:"Upload"});return Object(gn.jsx)(br,Object(f.a)(Object(f.a)({title:"Upload - ".concat(null===i||void 0===i?void 0:i.title),closeable:!j,footer:A},n),{},{children:Object(gn.jsx)(yn.a,{fluid:!0,children:Object(gn.jsxs)(Pn.a,{children:[Object(gn.jsxs)(Pn.a.Group,{children:[Object(gn.jsx)(Pn.a.Label,{children:"Language"}),Object(gn.jsx)(tr,{options:c,value:p,onChange:function(e){e&&x(e)}})]}),Object(gn.jsxs)(Pn.a.Group,{children:[Object(gn.jsx)(Pn.a.Label,{children:"Subtitle File"}),Object(gn.jsx)(Bn,{emptyText:"Select...",onChange:function(e){w(e[0])}})]}),Object(gn.jsx)(Pn.a.Group,{children:Object(gn.jsx)(Pn.a.Check,{custom:!0,id:"forced-checkbox",defaultChecked:N,onChange:function(e){return I(e.target.checked)},label:"Forced"})})]})})}))};!function(e){e[e.Update=0]="Update",e[e.Valid=1]="Valid",e[e.Warning=2]="Warning",e[e.Error=3]="Error"}(ur||(ur={}));var vr=function(e){var t=lr(e.modalKey),n=on(null===t||void 0===t?void 0:t.sonarrSeriesId),r=Object(J.a)(n,2),c=r[0],i=r[1],s=Object(a.useState)(!1),o=Object(J.a)(s,2),l=o[0],u=o[1],d=ir(),j=Object(a.useState)([]),b=Object(J.a)(j,2),O=b[0],p=b[1],x=Object(a.useState)({}),v=Object(J.a)(x,2),m=v[0],g=v[1],y=an(tn(null===t||void 0===t?void 0:t.profileId)),k=Object(a.useMemo)((function(){return O.map((function(e){return e.form.file}))}),[O]);Object(a.useEffect)((function(){var e=O.reduce((function(e,t){var n={state:ur.Valid,infos:[]},r=t.form,a=t.instance;return t.didCheck?a?void 0!==a.subtitles.find((function(e){return e.code2===r.language}))&&(n.infos.push("Overwrite existing subtitle"),n.state=ur.Warning):(n.infos.push("Season or episode info is missing"),n.state=ur.Error):n.state=ur.Update,e[r.file.name]=n,e}),{});g(e)}),[O]);var w=Object(a.useCallback)(function(){var e=Object(Ct.a)(St.a.mark((function e(t){var n,r,a;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!((n=t.map((function(e){return e.form.file.name}))).length>0)){e.next=7;break}return e.next=4,zt.info(n);case 4:r=e.sent,a=r.reduce((function(e,t){var n=c.data.find((function(e){return e.season===t.season&&e.episode===t.episode}));return n&&(e[t.filename]=n),e}),{}),p((function(e){return e.map((function(e){return Object(f.a)(Object(f.a)({},e),{},{didCheck:!0,instance:a[e.form.file.name]})}))}));case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[c.data]),S=Object(a.useCallback)((function(e){if(e){var t=O.map((function(t){var n,r,a=t.form;return Object(f.a)(Object(f.a)({},t),{},{form:Object(f.a)(Object(f.a)({},a),{},{language:e.code2,hi:null!==(n=e.hi)&&void 0!==n&&n,forced:null!==(r=e.forced)&&void 0!==r&&r})})}));p(t)}}),[O]),C=Object(a.useCallback)((function(e){var t=y[0],n=e.map((function(e){var n,r;return{form:{file:e,language:t.code2,hi:null!==(n=t.hi)&&void 0!==n&&n,forced:null!==(r=t.forced)&&void 0!==r&&r},didCheck:!1}}));p(n);var r=e.reduce((function(e,t){return Object(f.a)(Object(f.a)({},e),{},Object(h.a)({},t.name,{state:ur.Update,infos:[]}))}),{});g(r),w(n)}),[y,w]),N=Object(a.useCallback)(Object(Ct.a)(St.a.mark((function e(){var n,r,a,c,i,s;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t){e.next=2;break}return e.abrupt("return");case 2:n=t.sonarrSeriesId,r=O.reduce((function(e,t){return e[t.form.file.name]={state:ur.Update,infos:[]},e}),{}),g(r),a=Object(Kn.a)(O),e.prev=6,a.s();case 8:if((c=a.n()).done){e.next=18;break}if(!(i=c.value).instance){e.next=16;break}return s=i.instance.sonarrEpisodeId,e.next=14,Tt.uploadSubtitles(n,s,i.form);case 14:r=Object(f.a)(Object(f.a)({},r),{},Object(h.a)({},i.form.file.name,{state:ur.Valid,infos:[]})),g(r);case 16:e.next=8;break;case 18:e.next=23;break;case 20:e.prev=20,e.t0=e.catch(6),a.e(e.t0);case 23:return e.prev=23,a.f(),e.finish(23);case 26:case"end":return e.stop()}}),e,null,[[6,20,23,26]])}))),[t,O]),I=Object(a.useMemo)((function(){return O.length>0&&O.every((function(e){return void 0!==e.instance}))}),[O]),P=O.length>0,A=Object(a.useMemo)((function(){return[{id:"Icon",accessor:"instance",className:"text-center",Cell:function(e){var t=e.row,n=e.loose,r=t.original.form.file.name,a=n[1],c=fn.j,i=void 0,s=!1,o=[];if(r in a){var l=a[r];switch(o=l.infos,l.state){case ur.Error:c=fn.t,i="var(--danger)";break;case ur.Valid:c=fn.h,i="var(--success)";break;case ur.Warning:c=fn.A,i="var(--warning)";break;case ur.Update:s=!0}}return Object(gn.jsx)(da,{messages:o,color:i,icon:c,spin:s})}},{Header:"File",accessor:function(e){return e.form.file.name}},{Header:"Episode",accessor:"instance",className:"vw-1",Cell:function(e){var t=e.value,n=e.loose,r=e.row,c=e.externalUpdate,i=n[2].map((function(e){return{label:"(".concat(e.season,"x").concat(e.episode,") ").concat(e.title),value:e}})),s=Object(a.useCallback)((function(e){if(e){var t=Object(f.a)({},r.original);t.instance=e,c&&c(r,t)}}),[r,c]);return Object(gn.jsx)(zn,{options:i,value:null!==t&&void 0!==t?t:null,onChange:s})}},{accessor:"form",Cell:function(e){var t=e.row,n=e.externalUpdate,r=e.loose,a=Object(J.a)(r,1)[0];return Object(gn.jsx)(wn.a,{size:"sm",variant:"light",disabled:a,onClick:function(){n&&n(t)},children:Object(gn.jsx)(pn.a,{icon:fn.Z})})}}]}),[]),T=Object(a.useCallback)((function(e,t){p((function(n){var r=Object(X.a)(n);return t?r[e.index]=t:r.splice(e.index,1),r}))}),[]),E=Object(gn.jsxs)("div",{className:"d-flex flex-row flex-grow-1 justify-content-between",children:[Object(gn.jsx)("div",{className:"w-25",children:Object(gn.jsx)(tr,{disabled:l,options:y,defaultValue:y.length>0?y[0]:void 0,onChange:S})}),Object(gn.jsxs)("div",{children:[Object(gn.jsx)(wn.a,{hidden:l,disabled:0===O.length,variant:"outline-secondary",className:"mr-2",onClick:function(){return C([])},children:"Clean"}),Object(gn.jsx)(qn,{noReset:!0,disabled:!I,onChange:u,promise:N,onSuccess:function(){d(),C([]),i()},children:"Upload"})]})]});return Object(gn.jsx)(br,Object(f.a)(Object(f.a)({size:"lg",title:"Upload Subtitles",closeable:!l,footer:E},e),{},{children:Object(gn.jsxs)(yn.a,{fluid:!0,className:"flex-column",children:[Object(gn.jsx)(Pn.a,{children:Object(gn.jsx)(Pn.a.Group,{children:Object(gn.jsx)(Bn,{emptyText:"Select...",disabled:P||0===y.length,multiple:!0,value:k,onChange:C})})}),Object(gn.jsx)("div",{hidden:!P,children:Object(gn.jsx)(ea,{columns:A,data:O,loose:[l,m,c.data],responsive:!1,externalUpdate:T})})]})}))},mr=n(496),gr=n(497),yr=n(57),kr="useAsyncPagination",wr="loading-change";function Sr(e){e.stateReducers.push(Cr),e.useInstance.push(Ir),e.useOptions.push(Nr)}function Cr(e,t,n,r){if(t.type===wr&&r){var a=t.pageToLoad,c=!1,i=r.asyncState,s=e.pageIndex,o=e.pageSize,l=s;"prev"===a?l-=1:"next"===a?l+=1:"number"===typeof a&&(l=a);var u=l*o,d=u+o;if(i){var j=i.error,b=i.data.order.slice(u,d),O=0===b.length&&void 0!==j,h=0!==b.length&&b.every(Z.isNull);O||h?c=!0:b.every(te)&&(a=void 0)}return Object(f.a)(Object(f.a)({},e),{},{pageToLoad:a,needLoadingScreen:c})}return e}function Nr(e){return e.manualPagination=!0,void 0===e.initialState&&(e.initialState={}),e.initialState.pageToLoad=0,e.initialState.needLoadingScreen=!0,e}function Ir(e){var t,n=e.plugins,r=e.asyncLoader,c=e.dispatch,i=e.asyncState,s=e.asyncId,o=e.rows,l=e.nextPage,u=e.previousPage,d=e.gotoPage,j=e.state,b=j.pageIndex,O=j.pageSize,h=j.pageToLoad;Object(yr.ensurePluginOrder)(n,["usePagination"],kr);var f=null!==(t=null===i||void 0===i?void 0:i.data.order.length)&&void 0!==t?t:0,p=Math.ceil(f/O),x=b*O,v=x+O;Object(a.useEffect)((function(){void 0!==h&&r&&r(x,O)}),[r,x,O,h]);var m=Object(a.useCallback)((function(e){c({type:wr,pageToLoad:e})}),[c]);Object(a.useEffect)((function(){!1===(null===i||void 0===i?void 0:i.updating)&&m()}),[null===i||void 0===i?void 0:i.updating,m]);var g=Object(a.useCallback)((function(e){var t;(t="number"===typeof e?e:e(b))!==b&&(m(t),d(t))}),[b,m,d]),y=Object(a.useCallback)((function(){0!==b&&(m("prev"),u())}),[m,u,b]),k=Object(a.useCallback)((function(){b!==p&&(m("next"),l())}),[m,l,p,b]),w=Object(a.useMemo)((function(){var e;return(null!==(e=null===i||void 0===i?void 0:i.data.order.slice(x,v).filter(te))&&void 0!==e?e:[]).flatMap((function(e){var t=o.find((function(t){return s&&s(t.original)===e}));return t?[t]:[]}))}),[x,v,s,null===i||void 0===i?void 0:i.data.order,o]);Object.assign(e,{previousPage:y,nextPage:k,gotoPage:g,page:w,pageCount:p})}Sr.pluginName=kr;var Pr=Sr,Ar="useCustomSelection",Tr=Object(a.forwardRef)((function(e,t){var n=e.indeterminate,r=e.idIn,c=Object(hn.a)(e,["indeterminate","idIn"]),i=Object(a.useRef)(null),s=t||i;return Object(a.useEffect)((function(){"object"===typeof s&&s.current&&(s.current.indeterminate=null!==n&&void 0!==n&&n)}),[s,n]),Object(gn.jsx)(Pn.a.Check,Object(f.a)({custom:!0,id:r,ref:s},c))}));function Er(e){e.visibleColumnsDeps.push((function(e,t){var n=t.instance;return[].concat(Object(X.a)(e),[n.isSelecting])})),e.visibleColumns.push(Kr),e.useInstance.push(Mr)}function Mr(e){var t=e.plugins,n=e.rows,r=e.onSelect,c=e.isSelecting,i=e.state.selectedRowIds;Object(yr.ensurePluginOrder)(t,["useRowSelect"],Ar),Object(a.useEffect)((function(){if(c){var e=Object.keys(i).flatMap((function(e){var t,r;return null!==(t=null===(r=n.find((function(t){return t.id===e})))||void 0===r?void 0:r.original)&&void 0!==t?t:[]}));r&&r(e)}}),[i,r,n,c])}function Kr(e,t){return t.instance.isSelecting?[{id:"---selection---",Header:function(e){var t=e.getToggleAllRowsSelectedProps;return Object(gn.jsx)(Tr,Object(f.a)({idIn:"table-header-selection"},t()))},Cell:function(e){var t=e.row;return Object(gn.jsx)(Tr,Object(f.a)({idIn:"table-cell-".concat(t.index)},t.getToggleRowSelectedProps()))}}].concat(Object(X.a)(e.filter((function(e){return!0!==e.selectHide})))):e}Er.pluginName=Ar;var Br=Er;function Dr(e){e.useOptions.push(zr)}function zr(e){var t=Qt((function(e){return e.site})).pageSize;return void 0===e.autoResetPage&&(e.autoResetPage=!1),void 0===e.autoResetExpanded&&(e.autoResetExpanded=!1),void 0===e.initialState&&(e.initialState={}),e.initialState.needLoadingScreen=!1,void 0===e.initialState.pageSize&&(e.initialState.pageSize=t),void 0===e.asyncLoader&&(e.initialState.pageToLoad=void 0),e}Dr.pluginName="useLocalSettings";var Rr,Lr=Dr,_r={af:"afrikaans",sq:"albanian",am:"amharic",ar:"arabic",hy:"armenian",az:"azerbaijani",eu:"basque",be:"belarusian",bn:"bengali",bs:"bosnian",bg:"bulgarian",ca:"catalan",ceb:"cebuano",ny:"chichewa","zh-cn":"chinese (simplified)","zh-tw":"chinese (traditional)",co:"corsican",hr:"croatian",cs:"czech",da:"danish",nl:"dutch",en:"english",eo:"esperanto",et:"estonian",tl:"filipino",fi:"finnish",fr:"french",fy:"frisian",gl:"galician",ka:"georgian",de:"german",el:"greek",gu:"gujarati",ht:"haitian creole",ha:"hausa",haw:"hawaiian",iw:"hebrew",hi:"hindi",hmn:"hmong",hu:"hungarian",is:"icelandic",ig:"igbo",id:"indonesian",ga:"irish",it:"italian",ja:"japanese",jw:"javanese",kn:"kannada",kk:"kazakh",km:"khmer",ko:"korean",ku:"kurdish (kurmanji)",ky:"kyrgyz",lo:"lao",la:"latin",lv:"latvian",lt:"lithuanian",lb:"luxembourgish",mk:"macedonian",mg:"malagasy",ms:"malay",ml:"malayalam",mt:"maltese",mi:"maori",mr:"marathi",mn:"mongolian",my:"myanmar (burmese)",ne:"nepali",no:"norwegian",ps:"pashto",fa:"persian",pl:"polish",pt:"portuguese",pa:"punjabi",ro:"romanian",ru:"russian",sm:"samoan",gd:"scots gaelic",sr:"serbian",st:"sesotho",sn:"shona",sd:"sindhi",si:"sinhala",sk:"slovak",sl:"slovenian",so:"somali",es:"spanish",su:"sundanese",sw:"swahili",sv:"swedish",tg:"tajik",ta:"tamil",te:"telugu",th:"thai",tr:"turkish",uk:"ukrainian",ur:"urdu",uz:"uzbek",vi:"vietnamese",cy:"welsh",xh:"xhosa",yi:"yiddish",yo:"yoruba",zu:"zulu",fil:"Filipino",he:"Hebrew"},Hr=[{label:"White",value:"white"},{label:"Light Gray",value:"lightgray"},{label:"Red",value:"red"},{label:"Green",value:"green"},{label:"Yellow",value:"yellow"},{label:"Blue",value:"blue"},{label:"Magenta",value:"magenta"},{label:"Cyan",value:"cyan"},{label:"Black",value:"black"},{label:"Dark Red",value:"darkred"},{label:"Dark Green",value:"darkgreen"},{label:"Dark Yellow",value:"darkyellow"},{label:"Dark Blue",value:"darkblue"},{label:"Dark Magenta",value:"darkmagenta"},{label:"Dark Cyan",value:"darkcyan"},{label:"Dark Grey",value:"darkgrey"}];!function(e){e[e.Pending=0]="Pending",e[e.Processing=1]="Processing",e[e.Done=2]="Done"}(Rr||(Rr={}));var Ur=function(e){var t=e.state,n=Nn.f;switch(t){case Rr.Pending:n=fn.l;break;case Rr.Processing:n=fn.j;break;case Rr.Done:n=fn.h}return Object(gn.jsx)(pn.a,{icon:n,spin:t===Rr.Processing})};var Fr=function(e){var t=e.process,n=Object(hn.a)(e,["process"]),r=Object(a.useState)(null),c=Object(J.a)(r,2),i=c[0],s=c[1],o=Object(a.useCallback)((function(){if(i){var e="color(name=".concat(i,")");t(e)}}),[i,t]),l=Object(a.useMemo)((function(){return Object(gn.jsx)(wn.a,{disabled:null===i,onClick:o,children:"Save"})}),[i,o]);return Object(gn.jsx)(br,Object(f.a)(Object(f.a)({title:"Choose Color",footer:l},n),{},{children:Object(gn.jsx)(zn,{options:Hr,onChange:s})}))},Gr=function(e){var t=e.process,n=Object(hn.a)(e,["process"]),r=Object(a.useState)(null),c=Object(J.a)(r,2),i=c[0],s=c[1],o=Object(a.useState)(null),l=Object(J.a)(o,2),u=l[0],d=l[1],j=null!==i&&null!==u&&i!==u,b=Object(a.useCallback)((function(){if(j){var e=function(e,t){return"change_FPS(from=".concat(e,",to=").concat(t,")")}(i,u);t(e)}}),[j,i,u,t]),O=Object(a.useMemo)((function(){return Object(gn.jsx)(wn.a,{disabled:!j,onClick:b,children:"Save"})}),[b,j]);return Object(gn.jsx)(br,Object(f.a)(Object(f.a)({title:"Change Frame Rate",footer:O},n),{},{children:Object(gn.jsxs)(mr.a,{className:"px-2",children:[Object(gn.jsx)(Pn.a.Control,{placeholder:"From",type:"number",onChange:function(e){var t=parseFloat(e.currentTarget.value);isNaN(t)?s(null):s(t)}}),Object(gn.jsx)(Pn.a.Control,{placeholder:"To",type:"number",onChange:function(e){var t=parseFloat(e.currentTarget.value);isNaN(t)?d(null):d(t)}})]})}))},qr=function(e){var t=e.process,n=Object(hn.a)(e,["process"]),r=Object(a.useState)(!0),c=Object(J.a)(r,2),i=c[0],s=c[1],o=Object(a.useState)([0,0,0,0]),l=Object(J.a)(o,2),u=l[0],d=l[1],j=Object(a.useCallback)((function(e){return function(t){var n=parseFloat(t.currentTarget.value);isNaN(n)&&(n=0);var r=Object(X.a)(u);r[e]=n,d(r)}}),[u]),b=u.some((function(e){return 0!==e})),O=Object(a.useCallback)((function(){if(b){var e=u.map((function(e){return i?e:-e})),n=(r=e[0],a=e[1],c=e[2],s=e[3],"shift_offset(h=".concat(r,",m=").concat(a,",s=").concat(c,",ms=").concat(s,")"));t(n)}var r,a,c,s}),[t,b,u,i]),h=Object(a.useMemo)((function(){return Object(gn.jsx)(wn.a,{disabled:!b,onClick:O,children:"Save"})}),[O,b]);return Object(gn.jsx)(br,Object(f.a)(Object(f.a)({title:"Adjust Times",footer:h},n),{},{children:Object(gn.jsxs)(mr.a,{children:[Object(gn.jsx)(mr.a.Prepend,{children:Object(gn.jsx)(wn.a,{variant:"secondary",title:i?"Later":"Earlier",onClick:function(){return s(!i)},children:Object(gn.jsx)(pn.a,{icon:i?fn.M:fn.G})})}),Object(gn.jsx)(Pn.a.Control,{type:"number",placeholder:"hour",onChange:j(0)}),Object(gn.jsx)(Pn.a.Control,{type:"number",placeholder:"min",onChange:j(1)}),Object(gn.jsx)(Pn.a.Control,{type:"number",placeholder:"sec",onChange:j(2)}),Object(gn.jsx)(Pn.a.Control,{type:"number",placeholder:"ms",onChange:j(3)})]})}))},Wr=function(e){var t=e.process,n=Object(hn.a)(e,["process"]),r=nn(!0),c=Object(J.a)(r,1)[0],i=Object(a.useMemo)((function(){return c.filter((function(e){return e.code2 in _r}))}),[c]),s=Object(a.useState)(null),o=Object(J.a)(s,2),l=o[0],u=o[1],d=Object(a.useCallback)((function(){l&&t("translate",{language:l.code2})}),[l,t]),j=Object(a.useMemo)((function(){return Object(gn.jsx)(wn.a,{disabled:!l,onClick:d,children:"Translate"})}),[d,l]);return Object(gn.jsxs)(br,Object(f.a)(Object(f.a)({title:"Translate to",footer:j},n),{},{children:[Object(gn.jsx)(Pn.a.Label,{children:"Enabled languages not listed here are unsupported by Google Translate."}),Object(gn.jsx)(tr,{options:i,onChange:u})]}))},Yr=function(e){var t=e.update,n=Object(hn.a)(e,["update"]),r=lr(n.modalKey),i=Object(a.useState)(!1),s=Object(J.a)(i,2),o=s[0],l=s[1],u=Object(a.useState)({}),d=Object(J.a)(u,2),j=d[0],b=d[1],O=Object(a.useState)([]),p=Object(J.a)(O,2),x=p[0],v=p[1],m=function(e){var t=Object(a.useContext)(rr),n=Object(J.a)(t,2),r=n[0],c=n[1],i=Object(a.useContext)(ar),s=Object(J.a)(i,2),o=s[0],l=s[1];return Object(a.useCallback)((function(){var t=r.findIndex((function(t){return t===e}));if(-1!==t){var n=r.slice(0,t+1),a=o.slice(0,t+1);c(n),l(a)}}),[r,o,c,l,e])}(n.modalKey),g=Object(a.useCallback)(function(){var e=Object(Ct.a)(St.a.mark((function e(n,r){var a,c,i,s,o;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:m(),l(!0),a=x.reduce((function(e,t){return Object(f.a)(Object(h.a)({},t.path,Rr.Pending),e)}),{}),b(a),c=Object(Kn.a)(x),e.prev=6,c.s();case 8:if((i=c.n()).done){e.next=19;break}return s=i.value,a=Object(f.a)(Object(f.a)({},a),{},Object(h.a)({},s.path,Rr.Processing)),b(a),o=Object(f.a)({id:s.id,type:s.type,language:s.language,path:s.path},r),e.next=15,zt.modify(n,o);case 15:a=Object(f.a)(Object(f.a)({},a),{},Object(h.a)({},s.path,Rr.Done)),b(a);case 17:e.next=8;break;case 19:e.next=24;break;case 21:e.prev=21,e.t0=e.catch(6),c.e(e.t0);case 24:return e.prev=24,c.f(),e.finish(24);case 27:l(!1),t();case 29:case"end":return e.stop()}}),e,null,[[6,21,24,27]])})));return function(t,n){return e.apply(this,arguments)}}(),[m,x,t]),y=cr(),k=Object(a.useMemo)((function(){return[{id:"state",accessor:"path",selectHide:!0,Cell:function(e){var t=e.value,n=e.loose;if(n){var r=n[0];if(t in r){var a=r[t];return Object(gn.jsx)(Ur,{state:a})}}return null}},{Header:"Language",accessor:"_language",Cell:function(e){var t=e.value;return Object(gn.jsx)(Wn.a,{variant:"secondary",children:Object(gn.jsx)(ba,{text:t,long:!0})})}},{id:"file",Header:"File",accessor:"path",Cell:function(e){var t=e.value,n=t.lastIndexOf("/");return-1===n&&(n=t.lastIndexOf("\\")),-1!==n?t.slice(n+1):t}}]}),[]),w=Object(a.useMemo)((function(){var e;return null!==(e=null===r||void 0===r?void 0:r.flatMap((function(e){var t=function(e){return ne(e)?[e.radarrId,"movie"]:[e.sonarrEpisodeId,"episode"]}(e),n=Object(J.a)(t,2),r=n[0],a=n[1];return e.subtitles.flatMap((function(e){return null!==e.path?[{id:r,type:a,language:e.code2,path:e.path,_language:e}]:[]}))})))&&void 0!==e?e:[]}),[r]),S=[yr.useRowSelect,Br],C=Object(a.useMemo)((function(){return Object(gn.jsxs)(In.a,{as:gr.a,onSelect:function(e){return e&&g(e)},children:[Object(gn.jsx)(Vn,{size:"sm",loading:o,disabled:0===x.length,icon:fn.L,onClick:function(){return g("sync")},children:"Sync"}),Object(gn.jsx)(In.a.Toggle,{disabled:o||0===x.length,split:!0,variant:"light",size:"sm",className:"px-2"}),Object(gn.jsxs)(In.a.Menu,{children:[Object(gn.jsx)(In.a.Item,{eventKey:"remove_HI",children:Object(gn.jsx)(Qn,{icon:fn.p,children:"Remove HI Tags"})}),Object(gn.jsx)(In.a.Item,{eventKey:"remove_tags",children:Object(gn.jsx)(Qn,{icon:fn.n,children:"Remove Style Tags"})}),Object(gn.jsx)(In.a.Item,{eventKey:"OCR_fixes",children:Object(gn.jsx)(Qn,{icon:fn.z,children:"OCR Fixes"})}),Object(gn.jsx)(In.a.Item,{eventKey:"common",children:Object(gn.jsx)(Qn,{icon:fn.F,children:"Common Fixes"})}),Object(gn.jsx)(In.a.Item,{eventKey:"fix_uppercase",children:Object(gn.jsx)(Qn,{icon:fn.W,children:"Fix Uppercase"})}),Object(gn.jsx)(In.a.Item,{eventKey:"reverse_rtl",children:Object(gn.jsx)(Qn,{icon:fn.r,children:"Reverse RTL"})}),Object(gn.jsx)(In.a.Item,{onSelect:function(){return y("add-color")},children:Object(gn.jsx)(Qn,{icon:fn.J,children:"Add Color"})}),Object(gn.jsx)(In.a.Item,{onSelect:function(){return y("change-frame-rate")},children:Object(gn.jsx)(Qn,{icon:fn.v,children:"Change Frame Rate"})}),Object(gn.jsx)(In.a.Item,{onSelect:function(){return y("adjust-times")},children:Object(gn.jsx)(Qn,{icon:fn.l,children:"Adjust Times"})}),Object(gn.jsx)(In.a.Item,{onSelect:function(){return y("translate-sub")},children:Object(gn.jsx)(Qn,{icon:fn.B,children:"Translate"})})]})]})}),[y,o,x.length,g]);return Object(gn.jsxs)(c.a.Fragment,{children:[Object(gn.jsx)(br,Object(f.a)(Object(f.a)({title:"Subtitle Tools",footer:C,closeable:!o},n),{},{children:Object(gn.jsx)(ea,{isSelecting:!o&&0!==w.length,emptyText:"No External Subtitles Found",plugins:S,columns:k,onSelect:v,data:w,loose:[j]})})),Object(gn.jsx)(Fr,{process:g,modalKey:"add-color"}),Object(gn.jsx)(Gr,{process:g,modalKey:"change-frame-rate"}),Object(gn.jsx)(qr,{process:g,modalKey:"adjust-times"}),Object(gn.jsx)(Wr,{process:g,modalKey:"translate-sub"})]})},Vr=function(e){var t=e.onSearch,n=e.onFocus,r=e.onBlur,c=e.className,i=Object(a.useState)(""),s=Object(J.a)(i,2),o=s[0],u=s[1],d=Object(a.useState)([]),j=Object(J.a)(d,2),b=j[0],O=j[1],h=Object(l.h)(),f=Object(a.useCallback)((function(e){""===e?O([]):t(e).then((function(e){return O(e)}))}),[t]),p=Object(a.useMemo)((function(){return Object(Z.throttle)(f,500)}),[f]);Object(a.useEffect)((function(){p(o)}),[o,p]);var x=Object(a.useCallback)((function(){u(""),O([])}),[]),v=Object(a.useMemo)((function(){var e=b.map((function(e){return Object(gn.jsx)(In.a.Item,{eventKey:e.link,disabled:void 0===e.link,children:Object(gn.jsx)("span",{children:e.name})},e.name)}));return 0===e.length&&e.push(Object(gn.jsx)(In.a.Header,{children:"No Found"},"notify")),e}),[b]);return Object(gn.jsxs)(In.a,{show:0!==o.length,className:c,onFocus:n,onBlur:r,onSelect:function(e){e&&(x(),h.push(e))},children:[Object(gn.jsx)(Pn.a.Control,{type:"text",size:"sm",placeholder:"Search...",value:o,onChange:function(e){return u(e.currentTarget.value)}}),Object(gn.jsx)(In.a.Menu,{style:{maxHeight:256,overflowY:"auto"},children:v})]})},Qr=n(498);function Xr(e){return{style:{emptyText:e.emptyText,responsive:e.responsive,hoverable:e.hoverable,striped:e.striped,borderless:e.borderless,small:e.small,hideHeader:e.hideHeader,headersRenderer:e.headersRenderer,rowRenderer:e.rowRenderer},options:Object(hn.a)(e,["emptyText","responsive","hoverable","striped","borderless","small","hideHeader","headersRenderer","rowRenderer"])}}function Jr(e){return e.map((function(e){return Object(gn.jsx)("th",Object(f.a)(Object(f.a)({},e.getHeaderProps()),{},{children:e.render("Header")}))}))}function Zr(e){return Object(gn.jsx)("tr",Object(f.a)(Object(f.a)({},e.getRowProps()),{},{children:e.cells.map((function(e){return Object(gn.jsx)("td",Object(f.a)(Object(f.a)({className:e.column.className},e.getCellProps()),{},{children:e.render("Cell")}))}))}))}function $r(e){var t=e.emptyText,n=e.responsive,r=e.hoverable,c=e.striped,i=e.borderless,s=e.small,o=e.hideHeader,l=e.headers,u=e.rows,d=e.headersRenderer,j=e.rowRenderer,b=e.prepareRow,O=e.tableProps,h=e.tableBodyProps,p=Object(a.useMemo)((function(){return l.reduce((function(e,t){return t.headers.length>e?t.headers.length:e}),0)}),[l]),x=0===u.length,v=null!==d&&void 0!==d?d:Jr,m=null!==j&&void 0!==j?j:Zr;return Object(gn.jsxs)(Qr.a,Object(f.a)(Object(f.a)({size:s?"sm":void 0,striped:null===c||void 0===c||c,borderless:null===i||void 0===i||i,hover:r,responsive:null===n||void 0===n||n},O),{},{children:[Object(gn.jsx)("thead",{hidden:o,children:l.map((function(e){return Object(gn.jsx)("tr",Object(f.a)(Object(f.a)({},e.getHeaderGroupProps()),{},{children:v(e.headers)}))}))}),Object(gn.jsx)("tbody",Object(f.a)(Object(f.a)({},h),{},{children:t&&x?Object(gn.jsx)("tr",{children:Object(gn.jsx)("td",{colSpan:p,className:"text-center",children:t})}):u.map((function(e){return b(e),m(e)}))}))]}))}function ea(e){var t=e.plugins,n=Xr(Object(hn.a)(e,["plugins"])),r=n.style,a=n.options,c=yr.useTable.apply(void 0,[a,Lr].concat(Object(X.a)(null!==t&&void 0!==t?t:[]))),i=c.getTableProps,s=c.getTableBodyProps,o=c.headerGroups,l=c.rows,u=c.prepareRow;return Object(gn.jsx)($r,Object(f.a)(Object(f.a)({},r),{},{headers:o,rows:l,prepareRow:u,tableProps:i(),tableBodyProps:s()}))}function ta(e,t){return e.isGrouped?Object(gn.jsx)("span",Object(f.a)(Object(f.a)({},t.getToggleRowExpandedProps()),{},{children:e.render("Cell")})):t.canExpand||e.isAggregated?null:e.render("Cell")}function na(e){if(e.canExpand){var t=e.cells.find((function(e){return e.isGrouped}));if(t){var n=e.isExpanded?90:void 0;return Object(gn.jsx)("tr",Object(f.a)(Object(f.a)({},e.getRowProps()),{},{children:Object(gn.jsx)("td",Object(f.a)(Object(f.a)({className:"p-0"},t.getCellProps()),{},{colSpan:e.cells.length,children:Object(gn.jsxs)("span",Object(f.a)(Object(f.a)({},e.getToggleRowExpandedProps()),{},{className:"d-flex align-items-center p-2",children:[t.render("Cell"),Object(gn.jsx)(pn.a,{className:"mx-2",icon:fn.i,rotation:n})]}))}))}))}return null}return Object(gn.jsx)("tr",Object(f.a)(Object(f.a)({},e.getRowProps()),{},{children:e.cells.filter((function(e){return!e.isPlaceholder})).map((function(t){return Object(gn.jsx)("td",Object(f.a)(Object(f.a)({className:t.column.className},t.getCellProps()),{},{children:ta(t,e)}))}))}))}function ra(e){return e.filter((function(e){return!e.isGrouped})).map((function(e){return Object(gn.jsx)("th",Object(f.a)(Object(f.a)({},e.getHeaderProps()),{},{children:e.render("Header")}))}))}var aa,ca=function(e){var t=[yr.useGroupBy,yr.useSortBy,yr.useExpanded];return Object(gn.jsx)(ea,Object(f.a)(Object(f.a)({},e),{},{plugins:t,headersRenderer:ra,rowRenderer:na}))},ia=n(516),sa=n(268),oa=function(e){var t=e.count,n=e.index,r=e.size,c=e.total,i=e.canPrevious,s=e.previous,o=e.canNext,l=e.next,u=e.goto,d=e.loadState,j=0===c?0:r*n+1,b=Math.min(r*(n+1),c),O=void 0!==d,h=Object(a.useMemo)((function(){return Object(X.a)(Array(t).keys()).map((function(e){return Math.abs(e-n)>=4&&0!==e&&e!==t-1?null:Object(gn.jsx)(ia.a.Item,{disabled:O,active:n===e,onClick:function(){return u(e)},children:e+1},e)})).flatMap((function(e,t,n){return null===e?null===n[t+1]?[]:Object(gn.jsx)(ia.a.Ellipsis,{disabled:!0},t):[e]}))}),[t,n,u,O]);return Object(gn.jsx)(yn.a,{fluid:!0,className:"mb-3",children:Object(gn.jsxs)(Vt.a,{children:[Object(gn.jsx)(sa.a,{className:"d-flex align-items-center justify-content-start",children:Object(gn.jsxs)("span",{children:["Show ",j," to ",b," of ",c," entries"]})}),Object(gn.jsx)(sa.a,{className:"d-flex justify-content-end",children:Object(gn.jsxs)(ia.a,{className:"m-0",hidden:t<=1,children:[Object(gn.jsx)(ia.a.Prev,{onClick:s,disabled:!i&&O}),h,Object(gn.jsx)(ia.a.Next,{onClick:l,disabled:!o&&O})]})})]})})};function la(e){var t=e.async,n=e.autoScroll,r=e.canSelect,i=e.plugins,s=Xr(Object(hn.a)(e,["async","autoScroll","canSelect","plugins"])),o=s.style,l=s.options,u=[Lr,yr.usePagination];t&&u.push(Pr),r&&u.push(yr.useRowSelect,Br),i&&u.push.apply(u,Object(X.a)(i));var d=yr.useTable.apply(void 0,[l].concat(u)),j=d.getTableProps,b=d.getTableBodyProps,O=d.headerGroups,h=d.rows,p=d.prepareRow,x=d.page,v=d.canNextPage,m=d.canPreviousPage,g=d.pageCount,y=d.gotoPage,k=d.nextPage,w=d.previousPage,S=d.setPageSize,C=d.state,N=C.pageIndex,I=C.pageSize,P=C.pageToLoad,A=C.needLoadingScreen,T=Qt((function(e){return e.site.pageSize}));Object(a.useEffect)((function(){n&&be()}),[N,n]),Object(a.useEffect)((function(){var e=l.isSelecting;r&&!Object(Z.isUndefined)(e)&&S(e?h.length:T)}),[r,T,l.isSelecting,h.length,S]);var E=l.asyncState?l.asyncState.data.order.length:h.length,M=Object(a.useCallback)((function(e){var t=N*I,n=t+I;return!1===e.order.slice(t,n).every(Z.isNull)}),[N,I]);return A&&l.asyncState?Object(gn.jsx)(Un,{state:l.asyncState,exist:M}):Object(gn.jsxs)(c.a.Fragment,{children:[Object(gn.jsx)($r,Object(f.a)(Object(f.a)({},o),{},{headers:O,rows:x,prepareRow:p,tableProps:j(),tableBodyProps:b()})),Object(gn.jsx)(oa,{loadState:P,count:g,index:N,size:I,total:E,canPrevious:m,canNext:v,previous:w,next:k,goto:y})]})}!function(e){e[e.Delete=0]="Delete",e[e.Download=1]="Download",e[e.Manual=2]="Manual",e[e.Upgrade=3]="Upgrade",e[e.Upload=4]="Upload",e[e.Sync=5]="Sync"}(aa||(aa={}));var ua=function(e){var t=e.action,n=e.title,r=null;switch(t){case aa.Delete:r=fn.Z;break;case aa.Download:r=fn.q;break;case aa.Manual:r=fn.bb;break;case aa.Sync:r=fn.l;break;case aa.Upgrade:r=fn.O;break;case aa.Upload:r=fn.m}return r?Object(gn.jsx)(pn.a,{title:n,icon:r}):null},da=function(e){var t=e.messages,n=Object(hn.a)(e,["messages"]),r=Object(gn.jsx)(xn.a,{hidden:0===t.length,id:"overlay-icon",children:Object(gn.jsx)(xn.a.Content,{children:t.map((function(e){return Object(gn.jsx)("li",{children:e},e)}))})});return Object(gn.jsx)(vn.a,{overlay:r,children:Object(gn.jsx)(pn.a,Object(f.a)({},n))})},ja=function(e){var t=e.children,n=e.animation;return Object(gn.jsxs)("div",{className:"d-flex flex-column flex-grow-1 align-items-center py-5",children:[Object(gn.jsx)(mn.a,{animation:null!==n&&void 0!==n?n:"border",className:"mb-2"}),t]})},ba=function(e){var t=e.text,n=e.className,r=e.long,c=Object(a.useMemo)((function(){var e=t.code2,n=":HI",a=":Forced";r&&(e=t.name,n=" HI",a=" Forced");var c=e;return t.hi?c+=n:t.forced&&(c+=a),c}),[t,r]);return Object(gn.jsx)("span",{title:t.name,className:n,children:c})},Oa=function(e){var t=e.children,n=e.text,r=e.placement,a=e.delay;if(Object(Z.isNull)(n)||Object(Z.isUndefined)(n))return t;var c=Object(gn.jsx)(xn.a,{className:"mw-100 py-1",id:n,children:Object(gn.jsx)("span",{className:"mx-2",children:n})});return Object(gn.jsx)(vn.a,{delay:a,overlay:c,placement:r,children:t})},ha=n(499),fa=n(514),pa="data:image/png;base64,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",xa=n(295),va=n(270),ma=c.a.createContext([]),ga=c.a.createContext({}),ya=function(e){var t=e.link,n=e.name,r=e.icon,c=Object(a.useContext)(ga),i=Object(a.useContext)(Is),s=Object(a.useMemo)((function(){var e=null;if(n in c){var t=c[n];"number"===typeof t&&(e=t)}return e}),[c,n]);return Object(gn.jsx)(u.c,{activeClassName:"sb-active",className:"list-group-item list-group-item-action sidebar-button",to:t,onClick:i,children:Object(gn.jsx)(wa,{badge:null!==s&&void 0!==s?s:void 0,name:n,icon:r})})},ka=function(e){var t=e.icon,n=e.name,r=e.children,c=Object(a.useContext)(ga),i=Object(a.useContext)(ma),s=Object(a.useContext)(Is),o=n.toLowerCase(),l=Qt((function(e){return e.site.sidebar})),d=Ia(),j=Object(a.useMemo)((function(){var e=null,t=null;if(n in c){var r=c[n];if("number"===typeof r)e=r;else if("object"===typeof r)for(var a in e=0,t=r,r)e+=r[a]}return[e,t]}),[c,n]),b=Object(J.a)(j,2),O=b[0],h=b[1],f=Object(a.useMemo)((function(){return l===o}),[l,o]),p=Object(a.useMemo)((function(){return"sidebar-collapse-box ".concat(f?"active":"")}),[f]),x=Object(a.useMemo)((function(){return r.filter((function(e){var t;return!i.includes(null!==(t=e.hiddenKey)&&void 0!==t?t:"")})).map((function(e){var t,n=null;return h&&e.name in h&&(n=h[e.name]),Object(gn.jsx)(u.c,{activeClassName:"sb-active",className:"list-group-item list-group-item-action sidebar-button sb-collapse",to:e.link,onClick:s,children:Object(gn.jsx)(wa,{badge:0===n?void 0:null!==(t=n)&&void 0!==t?t:void 0,name:e.name})},e.name)}))}),[r,i,h,s]);return 0===x.length?null:Object(gn.jsxs)("div",{className:p,children:[Object(gn.jsx)(xa.a,{action:!0,className:"sidebar-button",onClick:function(){d(f?"":o)},children:Object(gn.jsx)(wa,{badge:0===O?void 0:null!==O&&void 0!==O?O:void 0,icon:t,name:n})}),Object(gn.jsx)(va.a,{in:f,children:Object(gn.jsx)("div",{className:"sidebar-collapse",children:x})})]})},wa=function(e){var t=e.name,n=e.icon,r=e.badge;return Object(gn.jsxs)(c.a.Fragment,{children:[n&&Object(gn.jsx)(pn.a,{size:"1x",className:"icon",icon:n}),Object(gn.jsxs)("span",{className:"d-flex flex-grow-1 justify-content-between",children:[t," ",Object(gn.jsx)(Wn.a,{variant:"secondary",children:r})]})]})},Sa="sonarr-disabled",Ca="radarr-disabled",Na=[{icon:fn.L,name:"Series",link:"/series",hiddenKey:Sa},{icon:fn.v,name:"Movies",link:"/movies",hiddenKey:Ca},{icon:fn.l,name:"History",children:[{name:"Series",link:"/history/series",hiddenKey:Sa},{name:"Movies",link:"/history/movies",hiddenKey:Ca},{name:"Statistics",link:"/history/stats"}]},{icon:fn.u,name:"Blacklist",children:[{name:"Series",link:"/blacklist/series",hiddenKey:Sa},{name:"Movies",link:"/blacklist/movies",hiddenKey:Ca}]},{icon:fn.t,name:"Wanted",children:[{name:"Series",link:"/wanted/series",hiddenKey:Sa},{name:"Movies",link:"/wanted/movies",hiddenKey:Ca}]},{icon:fn.o,name:"Settings",children:[{name:"General",link:"/settings/general"},{name:"Languages",link:"/settings/languages"},{name:"Providers",link:"/settings/providers"},{name:"Subtitles",link:"/settings/subtitles"},{name:"Sonarr",link:"/settings/sonarr"},{name:"Radarr",link:"/settings/radarr"},{name:"Notifications",link:"/settings/notifications"},{name:"Scheduler",link:"/settings/scheduler"},{name:"UI",link:"/settings/ui"}]},{icon:fn.C,name:"System",children:[{name:"Tasks",link:"/system/tasks"},{name:"Logs",link:"/system/logs"},{name:"Providers",link:"/system/providers"},{name:"Status",link:"/system/status"},{name:"Releases",link:"/system/releases"}]}];n(349);function Ia(){return Xt(nt)}var Pa=function(e){var t=e.open;ce(Xt(Je));var n=Object(a.useContext)(Is),r=Qt((function(e){return e.site.badges})),i=r.movies,s=r.episodes,o=r.providers,u=bn(),d=On(),j=Object(a.useMemo)((function(){return{Wanted:{Series:u?s:0,Movies:d?i:0},System:{Providers:o}}}),[i,s,o,u,d]),b=Object(a.useMemo)((function(){var e=[];return u||e.push(Sa),d||e.push(Ca),e}),[u,d]),O=Object(l.h)(),h=Ia();Object(a.useEffect)((function(){var e=O.location.pathname.split("/"),t=e.length;h(t>=3?e[t-2]:e[t-1])}),[O.location.pathname,h]);var p=["sidebar-container"],x=["sidebar-overlay"];!0===t&&(p.push("open"),x.push("open"));var v=Object(a.useMemo)((function(){return Na.map((function(e){var t;return b.includes(null!==(t=e.hiddenKey)&&void 0!==t?t:"")?null:"children"in e?Object(gn.jsx)(ka,Object(f.a)({},e),e.name):Object(gn.jsx)(ya,Object(f.a)({},e),e.link)}))}),[b]),m=ae();return Object(gn.jsxs)(c.a.Fragment,{children:[Object(gn.jsxs)("aside",{className:p.join(" "),children:[Object(gn.jsx)(yn.a,{className:"sidebar-title d-flex align-items-center d-md-none",children:Object(gn.jsx)(ha.a,{alt:"brand",src:pa,width:"32",height:"32",onClick:m,className:"cursor-pointer"})}),Object(gn.jsx)(ma.Provider,{value:b,children:Object(gn.jsx)(ga.Provider,{value:j,children:Object(gn.jsx)(fa.a,{variant:"flush",children:v})})})]}),Object(gn.jsx)("div",{className:x.join(" "),onClick:n})]})},Aa=function(e){var t=e.children;return Object(gn.jsx)(yn.a,{className:"my-3",children:Object(gn.jsxs)(kn.a,{className:"d-flex flex-nowrap justify-content-between align-items-center",variant:"danger",children:[Object(gn.jsxs)("div",{children:[Object(gn.jsx)(pn.a,{className:"mr-2",icon:fn.t}),Object(gn.jsx)("span",{children:t})]}),Object(gn.jsx)(wn.a,{variant:"outline-danger",onClick:je,children:"Reload"})]})})},Ta="https://github.com/morpheus65535/bazarr",Ea=function(e){var t=e.error;return Object(gn.jsxs)(yn.a,{className:"d-flex flex-column align-items-center my-5",children:[Object(gn.jsxs)("h1",{children:[Object(gn.jsx)(pn.a,{className:"mr-2",icon:Nn.g}),"Ouch! UI is crashed!"]}),Object(gn.jsx)("p",{children:t.message}),Object(gn.jsxs)("div",{className:"d-flex flex-row",children:[Object(gn.jsx)(wn.a,{className:"mx-1",href:"".concat(Ta,"/issues/new/choose"),target:"_blank",variant:"warning",children:"Report Issue"}),Object(gn.jsx)(wn.a,{className:"mx-1",onClick:je,variant:"light",children:"Reload Page"})]})]})},Ma=n(510);n(350);function Ka(e){return Ba.apply(this,arguments)}function Ba(){return(Ba=Object(Ct.a)(St.a.mark((function e(t){var n;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Rt.search(t);case 2:return n=e.sent,e.abrupt("return",n.map((function(e){var t;return t=e.sonarrSeriesId?"/series/".concat(e.sonarrSeriesId):e.radarrId?"/movies/".concat(e.radarrId):"",{name:"".concat(e.title," (").concat(e.year,")"),link:t}})));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Da=function(){var e,t,n=Xt(Xe),r=$t(),c="form"===(null!==(e=null===(t=Object(J.a)(r,1)[0].data)||void 0===t?void 0:t.auth.type)&&void 0!==e?e:"none"),i=Object(a.useContext)(Is),s=Qt((function(e){return e.site.offline})),o=Object(a.useMemo)((function(){return Object(gn.jsxs)(In.a,{alignRight:!0,children:[Object(gn.jsx)(In.a.Toggle,{className:"dropdown-hidden",as:wn.a,children:Object(gn.jsx)(pn.a,{icon:fn.bb})}),Object(gn.jsxs)(In.a.Menu,{children:[Object(gn.jsx)(In.a.Item,{onClick:function(){Rt.restart()},children:"Restart"}),Object(gn.jsx)(In.a.Item,{onClick:function(){Rt.shutdown()},children:"Shutdown"}),Object(gn.jsx)(In.a.Divider,{hidden:!c}),Object(gn.jsx)(In.a.Item,{hidden:!c,onClick:function(){Rt.logout().then((function(){return n()}))},children:"Logout"})]})]})}),[c,n]),l=Object(a.useState)(!1),u=Object(J.a)(l,2),d=u[0],j=u[1],b=Object(a.useCallback)((function(){j(!0),Rt.status().finally((function(){return j(!1)}))}),[]),O=ae();return Object(gn.jsxs)(Ma.a,{bg:"primary",className:"flex-grow-1 px-0",children:[Object(gn.jsx)("div",{className:"header-icon px-3 m-0 d-none d-md-block",children:Object(gn.jsx)(ha.a,{alt:"brand",src:pa,width:"32",height:"32",onClick:O,className:"cursor-pointer"})}),Object(gn.jsx)(wn.a,{className:"mx-2 m-0 d-md-none",onClick:i,children:Object(gn.jsx)(pn.a,{icon:fn.c})}),Object(gn.jsx)(yn.a,{fluid:!0,children:Object(gn.jsxs)(Vt.a,{noGutters:!0,className:"flex-grow-1",children:[Object(gn.jsx)(sa.a,{xs:6,sm:4,className:"d-flex align-items-center",children:Object(gn.jsx)(Vr,{onSearch:Ka})}),Object(gn.jsxs)(sa.a,{className:"d-flex flex-row align-items-center justify-content-end pr-2",children:[Object(gn.jsx)(wn.a,{href:"https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=XHHRWXT9YB7WE&source=url",target:"_blank",children:Object(gn.jsx)(pn.a,{icon:fn.x})}),s?Object(gn.jsx)(Vn,{loading:d,className:"ml-2",variant:"warning",icon:fn.I,onClick:b,children:"Reconnect"}):o]})]})})]})},za=n(511);n(351);var Ra=function(e){var t=e.message,n=e.id,r=e.type,c=Xt(et),i=Object(a.useCallback)((function(){return c(n)}),[c,n]);return Object(gn.jsxs)(za.a,{onClose:i,animation:!1,children:[Object(gn.jsxs)(za.a.Header,{children:[Object(gn.jsx)(pn.a,{className:"mr-1",icon:fn.t}),Object(gn.jsx)("strong",{className:"mr-auto",children:Object(Z.capitalize)(r)})]}),Object(gn.jsx)(za.a.Body,{children:t})]})},La=function(){var e=Qt((function(e){return e.site.notifications})),t=Object(a.useMemo)((function(){return e.map((function(e,t){return Object(gn.jsx)(Ra,Object(f.a)({},e),e.id)}))}),[e]);return Object(gn.jsx)("div",{className:"alert-container",children:Object(gn.jsx)("div",{className:"toast-container",children:t})})},_a="/empty-page",Ha=function(){return Object(gn.jsxs)(yn.a,{className:"d-flex flex-column align-items-center my-5",children:[Object(gn.jsxs)("h1",{children:[Object(gn.jsx)(pn.a,{className:"mr-2",icon:Nn.c}),"404"]}),Object(gn.jsx)("p",{children:"The Request URL No Found"})]})},Ua=n(38),Fa=function(e){var t=e.blacklist,n=e.update,r=Object(a.useMemo)((function(){return[{Header:"Name",accessor:"title",className:"text-nowrap",Cell:function(e){var t="/movies/".concat(e.row.original.radarrId);return Object(gn.jsx)(u.b,{to:t,children:Object(gn.jsx)("span",{children:e.value})})}},{Header:"Language",accessor:"language",Cell:function(e){var t=e.value;return t?Object(gn.jsx)(ba,{text:t,long:!0}):null}},{Header:"Provider",accessor:"provider"},{Header:"Date",accessor:"timestamp",Cell:function(e){return e.value?Object(gn.jsx)(Oa,{text:e.row.original.parsed_timestamp,delay:1,children:Object(gn.jsx)("span",{children:e.value})}):null}},{accessor:"subs_id",Cell:function(e){var t=e.value;return Object(gn.jsx)(qn,{size:"sm",variant:"light",noReset:!0,promise:function(){return Kt.deleteBlacklist(!1,{provider:e.row.original.provider,subs_id:t})},onSuccess:n,children:Object(gn.jsx)(pn.a,{icon:fn.Z})})}}]}),[n]);return Object(gn.jsx)(la,{emptyText:"No Blacklisted Movies Subtitles",columns:r,data:t})},Ga=function(){var e=function(){var e=Xt(dt);return Zt(Qt((function(e){return e.movie.blacklist})),e)}(),t=Object(J.a)(e,2),n=t[0],r=t[1];return ce(r),Object(gn.jsx)(Un,{state:n,children:function(e){return Object(gn.jsxs)(yn.a,{fluid:!0,children:[Object(gn.jsx)(Ua.a,{children:Object(gn.jsx)("title",{children:"Movies Blacklist - Bazarr"})}),Object(gn.jsx)($n,{children:Object(gn.jsx)($n.AsyncButton,{icon:fn.Z,disabled:0===e.length,promise:function(){return Kt.deleteBlacklist(!0)},onSuccess:r,children:"Remove All"})}),Object(gn.jsx)(Vt.a,{children:Object(gn.jsx)(Fa,{blacklist:e,update:r})})]})}})},qa=function(e){var t=e.blacklist,n=e.update,r=Object(a.useMemo)((function(){return[{Header:"Series",accessor:"seriesTitle",className:"text-nowrap",Cell:function(e){var t="/series/".concat(e.row.original.sonarrSeriesId);return Object(gn.jsx)(u.b,{to:t,children:Object(gn.jsx)("span",{children:e.value})})}},{Header:"Episode",accessor:"episode_number"},{accessor:"episodeTitle"},{Header:"Language",accessor:"language",Cell:function(e){var t=e.value;return t?Object(gn.jsx)(ba,{text:t,long:!0}):null}},{Header:"Provider",accessor:"provider"},{Header:"Date",accessor:"timestamp",Cell:function(e){return e.value?Object(gn.jsx)(Oa,{text:e.row.original.parsed_timestamp,delay:1,children:Object(gn.jsx)("span",{children:e.value})}):null}},{accessor:"subs_id",Cell:function(e){var t=e.value;return Object(gn.jsx)(qn,{size:"sm",variant:"light",noReset:!0,promise:function(){return Tt.deleteBlacklist(!1,{provider:e.row.original.provider,subs_id:t})},onSuccess:n,children:Object(gn.jsx)(pn.a,{icon:fn.Z})})}}]}),[n]);return Object(gn.jsx)(la,{emptyText:"No Blacklisted Series Subtitles",columns:r,data:t})},Wa=function(){var e=function(){var e=Xt(kt);return Zt(Qt((function(e){return e.series.blacklist})),e)}(),t=Object(J.a)(e,2),n=t[0],r=t[1];return ce(r),Object(gn.jsx)(Un,{state:n,children:function(e){return Object(gn.jsxs)(yn.a,{fluid:!0,children:[Object(gn.jsx)(Ua.a,{children:Object(gn.jsx)("title",{children:"Series Blacklist - Bazarr"})}),Object(gn.jsx)($n,{children:Object(gn.jsx)($n.AsyncButton,{icon:fn.Z,disabled:0===e.length,promise:function(){return Tt.deleteBlacklist(!0)},onSuccess:r,children:"Remove All"})}),Object(gn.jsx)(Vt.a,{children:Object(gn.jsx)(qa,{blacklist:e,update:r})})]})}})},Ya=function(){var e=bn(),t=On();return Object(gn.jsxs)(l.e,{children:[e&&Object(gn.jsx)(l.c,{exact:!0,path:"/blacklist/series",children:Object(gn.jsx)(Wa,{})}),t&&Object(gn.jsx)(l.c,{path:"/blacklist/movies",children:Object(gn.jsx)(Ga,{})}),Object(gn.jsx)(l.c,{path:"/blacklist/*",children:Object(gn.jsx)(l.b,{to:_a})})]})},Va=function(e){var t=e.state,n=e.columns,r=e.type,a=e.tableUpdater,c=Object(Z.capitalize)(r);return Object(gn.jsxs)(yn.a,{fluid:!0,children:[Object(gn.jsx)(Ua.a,{children:Object(gn.jsxs)("title",{children:[c," History - Bazarr"]})}),Object(gn.jsx)(Vt.a,{children:Object(gn.jsx)(Un,{state:t,children:function(e){return Object(gn.jsx)(la,{emptyText:"Nothing Found in ".concat(c," History"),columns:n,data:e,externalUpdate:a})}})})]})},Qa=function(){var e=function(){var e=Xt(st);return Zt(Qt((function(e){return e.movie.historyList})),e)}(),t=Object(J.a)(e,2),n=t[0],r=t[1];ce(r);var c=Object(a.useCallback)((function(e){return r()}),[r]),i=Object(a.useMemo)((function(){return[{accessor:"action",className:"text-center",Cell:function(e){return Object(gn.jsx)(ua,{action:e.value})}},{Header:"Name",accessor:"title",className:"text-nowrap",Cell:function(e){var t="/movies/".concat(e.row.original.radarrId);return Object(gn.jsx)(u.b,{to:t,children:Object(gn.jsx)("span",{children:e.value})})}},{Header:"Language",accessor:"language",Cell:function(e){var t=e.value;return t?Object(gn.jsx)(Wn.a,{variant:"secondary",children:Object(gn.jsx)(ba,{text:t,long:!0})}):null}},{Header:"Score",accessor:"score"},{Header:"Date",accessor:"timestamp",Cell:function(e){return e.value?Object(gn.jsx)(Oa,{text:e.row.original.parsed_timestamp,delay:1,children:Object(gn.jsx)("span",{children:e.value})}):null}},{accessor:"description",Cell:function(e){var t=e.row,n=e.value,r=Object(gn.jsx)(xn.a,{id:"description-".concat(t.id),children:Object(gn.jsx)(xn.a.Content,{children:n})});return Object(gn.jsx)(vn.a,{overlay:r,children:Object(gn.jsx)(pn.a,{size:"sm",icon:fn.A})})}},{accessor:"upgradable",Cell:function(e){var t=Object(gn.jsx)(xn.a,{id:"description-".concat(e.row.id),children:Object(gn.jsx)(xn.a.Content,{children:"This Subtitles File Is Eligible For An Upgrade."})});return e.value?Object(gn.jsx)(vn.a,{overlay:t,children:Object(gn.jsx)(pn.a,{size:"sm",icon:fn.O})}):null}},{accessor:"blacklisted",Cell:function(e){var t=e.row,n=e.externalUpdate,r=t.original;return Object(gn.jsx)(Or,{history:r,update:function(){return n&&n(t)},promise:function(e){return Kt.addBlacklist(r.radarrId,e)}})}}]}),[]);return Object(gn.jsx)(Va,{type:"movies",state:n,columns:i,tableUpdater:c})},Xa=function(){var e=function(){var e=Xt(gt);return Zt(Qt((function(e){return e.series.historyList})),e)}(),t=Object(J.a)(e,2),n=t[0],r=t[1];ce(r);var c=Object(a.useCallback)((function(e){return r()}),[r]),i=Object(a.useMemo)((function(){return[{accessor:"action",className:"text-center",Cell:function(e){var t=e.value;return Object(gn.jsx)(ua,{action:t})}},{Header:"Series",accessor:"seriesTitle",Cell:function(e){var t="/series/".concat(e.row.original.sonarrSeriesId);return Object(gn.jsx)(u.b,{to:t,children:Object(gn.jsx)("span",{children:e.value})})}},{Header:"Episode",accessor:"episode_number"},{Header:"Title",accessor:"episodeTitle"},{Header:"Language",accessor:"language",Cell:function(e){var t=e.value;return t?Object(gn.jsx)(Wn.a,{variant:"secondary",children:Object(gn.jsx)(ba,{text:t,long:!0})}):null}},{Header:"Score",accessor:"score"},{Header:"Date",accessor:"timestamp",Cell:function(e){return e.value?Object(gn.jsx)(Oa,{text:e.row.original.parsed_timestamp,delay:1,children:Object(gn.jsx)("span",{children:e.value})}):null}},{accessor:"description",Cell:function(e){var t=e.row,n=e.value,r=Object(gn.jsx)(xn.a,{id:"description-".concat(t.id),children:Object(gn.jsx)(xn.a.Content,{children:n})});return Object(gn.jsx)(vn.a,{overlay:r,children:Object(gn.jsx)(pn.a,{size:"sm",icon:fn.A})})}},{accessor:"upgradable",Cell:function(e){var t=Object(gn.jsx)(xn.a,{id:"description-".concat(e.row.id),children:Object(gn.jsx)(xn.a.Content,{children:"This Subtitles File Is Eligible For An Upgrade."})});return e.value?Object(gn.jsx)(vn.a,{overlay:t,children:Object(gn.jsx)(pn.a,{size:"sm",icon:fn.O})}):null}},{accessor:"blacklisted",Cell:function(e){var t=e.row,n=e.externalUpdate,r=t.original,a=r.sonarrEpisodeId,c=r.sonarrSeriesId;return Object(gn.jsx)(Or,{history:r,update:function(){return n&&n(t)},promise:function(e){return Tt.addBlacklist(c,a,e)}})}}]}),[]);return Object(gn.jsx)(Va,{type:"series",state:n,columns:i,tableUpdater:c})},Ja=n(519),Za=n(500),$a=n(504),ec=n(290),tc=n(291),nc=n(146),rc=n(142),ac=n(294),cc=[{label:"Automatically Downloaded",value:0},{label:"Manually Downloaded",value:1},{label:"Upgraded",value:2}],ic=[{label:"Last Week",value:"week"},{label:"Last Month",value:"month"},{label:"Last Trimester",value:"trimester"},{label:"Last Year",value:"year"}];function sc(e){var t=e.movies.map((function(e){return{date:e.date,movies:e.count}})),n=e.series.map((function(e){return{date:e.date,series:e.count}}));return Object(Z.merge)(t,n)}var oc=function(e){return e.name},lc=function(e){var t=e.children;return Object(gn.jsx)(sa.a,{xs:6,lg:3,className:"p-1",children:t})},uc=function(){var e=nn(!0),t=Object(J.a)(e,1)[0],n=dn(),r=Object(J.a)(n,2),i=r[0];ce(r[1]);var s=Object(a.useState)("month"),o=Object(J.a)(s,2),l=o[0],u=o[1],d=Object(a.useState)(null),j=Object(J.a)(d,2),b=j[0],O=j[1],h=Object(a.useState)(null),f=Object(J.a)(h,2),p=f[0],x=f[1],v=Object(a.useState)(null),m=Object(J.a)(v,2),g=m[0],y=m[1],k=Object(a.useCallback)((function(){return Mt.stats(l,null!==b&&void 0!==b?b:void 0,null===g||void 0===g?void 0:g.name,null===p||void 0===p?void 0:p.code2)}),[l,null===p||void 0===p?void 0:p.code2,b,g]);return Object(gn.jsxs)(yn.a,{fluid:!0,className:"vh-75",children:[Object(gn.jsx)(Ua.a,{children:Object(gn.jsx)("title",{children:"History Statistics - Bazarr"})}),Object(gn.jsx)(Fn,{promise:k,children:function(e){return Object(gn.jsxs)(c.a.Fragment,{children:[Object(gn.jsxs)($n,{scroll:!1,children:[Object(gn.jsx)(lc,{children:Object(gn.jsx)(zn,{placeholder:"Time...",options:ic,value:l,onChange:function(e){return u(null!==e&&void 0!==e?e:"month")}})}),Object(gn.jsx)(lc,{children:Object(gn.jsx)(zn,{placeholder:"Action...",clearable:!0,options:cc,value:b,onChange:O})}),Object(gn.jsx)(lc,{children:Object(gn.jsx)(Gn,{placeholder:"Provider...",clearable:!0,state:i,label:oc,onChange:y})}),Object(gn.jsx)(lc,{children:Object(gn.jsx)(tr,{clearable:!0,options:t,value:p,onChange:x})})]}),Object(gn.jsx)(Ja.a,{height:"100%",children:Object(gn.jsxs)(Za.a,{data:sc(e),children:[Object(gn.jsx)($a.a,{strokeDasharray:"4 2"}),Object(gn.jsx)(ec.a,{dataKey:"date"}),Object(gn.jsx)(tc.a,{allowDecimals:!1}),Object(gn.jsx)(nc.a,{}),Object(gn.jsx)(rc.a,{verticalAlign:"top"}),Object(gn.jsx)(ac.a,{name:"Series",dataKey:"series",fill:"#2493B6"}),Object(gn.jsx)(ac.a,{name:"Movies",dataKey:"movies",fill:"#FFC22F"})]})})]})}})]})},dc=function(){var e=bn(),t=On();return Object(gn.jsxs)(l.e,{children:[e&&Object(gn.jsx)(l.c,{exact:!0,path:"/history/series",children:Object(gn.jsx)(Xa,{})}),t&&Object(gn.jsx)(l.c,{exact:!0,path:"/history/movies",children:Object(gn.jsx)(Qa,{})}),Object(gn.jsx)(l.c,{exact:!0,path:"/history/stats",children:Object(gn.jsx)(uc,{})}),Object(gn.jsx)(l.c,{path:"/history/*",children:Object(gn.jsx)(l.b,{to:_a})})]})},jc=function(e){var t,n,r,i=e.state,s=e.dirtyItems,o=e.update,l=e.modify,u=e.editMode,d=e.select,j=e.columns,b=e.loader,O=e.name,h=cr(),f=Object(a.useCallback)((function(e,t){h(t,e.original)}),[h]),p=i.data,x=Object(a.useMemo)((function(){return le(p)}),[p]),v=(t=x,n=s,r=bc,Object(a.useMemo)((function(){return ue(t,n,r)}),[t,n,r])),m=en(),g=Object(J.a)(m,1)[0];return Object(gn.jsxs)(c.a.Fragment,{children:[Object(gn.jsx)(la,{async:!0,autoScroll:!0,canSelect:!0,columns:j,data:v,asyncState:i,asyncId:oe,asyncLoader:b,loose:[g],isSelecting:u,onSelect:d,emptyText:"No ".concat(O," Found"),externalUpdate:f}),Object(gn.jsx)(pr,{modalKey:"edit",submit:l,onSuccess:function(e){var t=oe(e);o([t])}})]})};function bc(e,t){return oe(e)===oe(t)}var Oc,hc=function(e){var t=e.updateAction,n=Object(hn.a)(e,["updateAction"]),r=n.state,i=Object(a.useState)(!1),s=Object(J.a)(i,2),o=s[0],l=s[1],u=Object(a.useState)(!1),d=Object(J.a)(u,2),j=d[0],b=d[1],O=Jt(t,Object(a.useCallback)((function(){l((function(e){return b(e),e})),k([])}),[])),h=Object(a.useState)([]),p=Object(J.a)(h,2),x=p[0],v=p[1],m=Object(a.useState)([]),g=Object(J.a)(m,2),y=g[0],k=g[1],w=en(),S=Object(J.a)(w,1)[0],C=Object(a.useMemo)((function(){var e=[];return e.push(Object(gn.jsx)(In.a.Item,{children:"Clear Profile"},"clear-profile")),e.push(Object(gn.jsx)(In.a.Divider,{},"dropdown-divider")),e.push.apply(e,Object(X.a)(S.map((function(e){return Object(gn.jsx)(In.a.Item,{eventKey:e.profileId.toString(),children:e.name},e.profileId)})))),e}),[S]),N=Object(a.useCallback)((function(e){var t=e?parseInt(e):null,n=x.map((function(e){var n=Object(f.a)({},e);return n.profileId=t,n})),r=ue(y,n,bc);k(r)}),[x,y]),I=Object(a.useCallback)((function(){n.state.data.order.every(te)?b(!0):O(),l(!0)}),[n.state.data.order,O]),P=Object(a.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!e&&y.length>0){var t=y.map(oe);O(t)}else b(!1),k([]);l(!1),v([])}),[y,O]),A=Object(a.useCallback)((function(){var e={id:[],profileid:[]};return y.forEach((function(t){var n=oe(t);e.id.push(n),e.profileid.push(t.profileId)})),n.modify(e)}),[y,n]);return Object(gn.jsxs)(yn.a,{fluid:!0,children:[Object(gn.jsx)(Ua.a,{children:Object(gn.jsxs)("title",{children:[n.name," - Bazarr"]})}),Object(gn.jsx)($n,{scroll:!1,children:j?Object(gn.jsxs)(c.a.Fragment,{children:[Object(gn.jsx)($n.Group,{pos:"start",children:Object(gn.jsxs)(In.a,{onSelect:N,children:[Object(gn.jsx)(In.a.Toggle,{disabled:0===x.length,variant:"light",children:"Change Profile"}),Object(gn.jsx)(In.a.Menu,{children:C})]})}),Object(gn.jsxs)($n.Group,{pos:"end",children:[Object(gn.jsx)($n.Button,{icon:fn.ab,onClick:function(){return P(!0)},children:"Cancel"}),Object(gn.jsx)($n.AsyncButton,{icon:fn.h,disabled:0===y.length,promise:A,onSuccess:function(){return P()},children:"Save"})]})]}):Object(gn.jsx)($n.Button,{updating:o!==j,disabled:0===r.data.order.length&&r.updating,icon:fn.E,onClick:I,children:"Mass Edit"})}),Object(gn.jsx)(Vt.a,{children:Object(gn.jsx)(jc,Object(f.a)(Object(f.a)({},n),{},{update:O,dirtyItems:y,editMode:j,select:v}))})]})},fc=function(){var e=ln(),t=Object(J.a)(e,1)[0],n=Xt(ot),r=Object(a.useMemo)((function(){return[{accessor:"monitored",selectHide:!0,Cell:function(e){var t=e.value;return Object(gn.jsx)(pn.a,{title:t?"monitored":"unmonitored",icon:t?fn.d:Nn.a})}},{Header:"Name",accessor:"title",className:"text-nowrap",Cell:function(e){var t=e.row,n=e.value;if(e.isSelecting)return n;var r="/movies/".concat(t.original.radarrId);return Object(gn.jsx)(Oa,{text:t.original.sceneName,delay:1,children:Object(gn.jsx)(u.b,{to:r,children:Object(gn.jsx)("span",{children:n})})})}},{Header:"Exist",accessor:"exist",selectHide:!0,Cell:function(e){var t=e.row,n=e.value,r=t.original.path;return Object(gn.jsx)(pn.a,{title:r,icon:n?fn.h:fn.t})}},{Header:"Audio",accessor:"audio_language",Cell:function(e){return e.value.map((function(e){return Object(gn.jsx)(Wn.a,{variant:"secondary",className:"mr-2",children:e.name},de(e.code2,e.code2,e.hi))}))}},{Header:"Languages Profile",accessor:"profileId",Cell:function(e){var t,n,r=e.value,a=e.loose;return a&&null!==(t=null===(n=a[0].find((function(e){return e.profileId===r})))||void 0===n?void 0:n.name)&&void 0!==t?t:null}},{Header:"Missing Subtitles",accessor:"missing_subtitles",selectHide:!0,Cell:function(e){return e.value.map((function(e){return Object(gn.jsx)(Wn.a,{className:"mx-2",variant:"warning",children:e.code2},de(e.code2,e.hi,e.forced))}))}},{accessor:"radarrId",selectHide:!0,Cell:function(e){var t=e.row,n=e.externalUpdate;return Object(gn.jsx)(Yn,{icon:fn.cb,onClick:function(){return n&&n(t,"edit")}})}}]}),[]);return Object(gn.jsx)(hc,{state:t,name:"Movies",loader:n,updateAction:ut,columns:r,modify:function(e){return Kt.modify(e)}})};n(482);!function(e){e[e.Ready=0]="Ready",e[e.Searching=1]="Searching",e[e.Finished=2]="Finished"}(Oc||(Oc={}));var pc=function(e){var t=e.onSelect,n=e.onDownload,r=Object(hn.a)(e,["onSelect","onDownload"]),i=Object(a.useState)([]),s=Object(J.a)(i,2),o=s[0],l=s[1],u=Object(a.useState)(Oc.Ready),d=Object(J.a)(u,2),j=d[0],b=d[1],O=lr(r.modalKey),h=Object(a.useCallback)(Object(Ct.a)(St.a.mark((function e(){var t;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!O){e.next=14;break}if(b(Oc.Searching),t=[],!ne(O)){e.next=9;break}return e.next=6,Bt.movies(O.radarrId);case 6:t=e.sent,e.next=12;break;case 9:return e.next=11,Bt.episodes(O.sonarrEpisodeId);case 11:t=e.sent;case 12:l(t),b(Oc.Finished);case 14:case"end":return e.stop()}}),e)}))),[O]);Object(a.useEffect)((function(){null!==O&&b(Oc.Ready)}),[O]);var p=Object(a.useMemo)((function(){return[{Header:"Score",accessor:function(e){return"".concat(e.score,"%")}},{accessor:"language",Cell:function(e){var t=e.row.original,n={code2:e.value,hi:"True"===t.hearing_impaired,forced:"True"===t.forced,name:""};return Object(gn.jsx)(Wn.a,{variant:"secondary",children:Object(gn.jsx)(ba,{text:n})})}},{Header:"Provider",accessor:"provider",Cell:function(e){var t=e.value,n=e.row.original.url;return n?Object(gn.jsx)("a",{href:n,target:"_blank",rel:"noopener noreferrer",children:t}):t}},{Header:"Release",accessor:"release_info",className:"text-nowrap",Cell:function(e){var t=e.value,n=Object(a.useState)(!1),r=Object(J.a)(n,2),c=r[0],i=r[1],s=Object(a.useMemo)((function(){return t.slice(1).map((function(e,t){return Object(gn.jsx)("span",{className:"release-text hidden-item",children:e},t)}))}),[t]);if(0===t.length)return Object(gn.jsx)("span",{className:"text-muted",children:"Cannot get release info"});var o=["release-container","d-flex","justify-content-between","align-items-center"];return t.length>1&&o.push("release-multi"),Object(gn.jsxs)("div",{className:o.join(" "),onClick:function(){return i((function(e){return!e}))},children:[Object(gn.jsxs)("div",{className:"text-container",children:[Object(gn.jsx)("span",{className:"release-text",children:t[0]}),Object(gn.jsx)(va.a,{in:c,children:Object(gn.jsx)("div",{children:s})})]}),t.length>1&&Object(gn.jsx)(pn.a,{className:"release-icon",icon:fn.g,rotation:c?180:void 0})]})}},{Header:"Upload",accessor:function(e){var t;return null!==(t=e.uploader)&&void 0!==t?t:"-"}},{accessor:"matches",Cell:function(e){var t=e.row.original,n=t.matches,r=t.dont_matches;return Object(gn.jsx)(xc,{matches:n,dont:r})}},{accessor:"subtitle",Cell:function(e){var n=e.row,r=e.externalUpdate,a=n.original;return Object(gn.jsx)(qn,{size:"sm",variant:"light",noReset:!0,promise:function(){return t(O,a)},onSuccess:function(){return r&&r(n)},children:Object(gn.jsx)(pn.a,{icon:fn.q})})}}]}),[t,O]),x=Object(a.useMemo)((function(){var e,t;return j===Oc.Ready?Object(gn.jsxs)("div",{className:"px-4 py-5",children:[Object(gn.jsx)("p",{className:"mb-3 small",children:null!==(e=null===O||void 0===O?void 0:O.path)&&void 0!==e?e:""}),Object(gn.jsx)(wn.a,{variant:"primary",block:!0,onClick:h,children:"Start Search"})]}):j===Oc.Searching?Object(gn.jsx)(ja,{animation:"grow"}):Object(gn.jsxs)(c.a.Fragment,{children:[Object(gn.jsx)("p",{className:"mb-3 small",children:null!==(t=null===O||void 0===O?void 0:O.path)&&void 0!==t?t:""}),Object(gn.jsx)(la,{emptyText:"No Result",columns:p,data:o,externalUpdate:n})]})}),[j,p,o,h,null===O||void 0===O?void 0:O.path,n]),v=Object(a.useMemo)((function(){return Object(gn.jsx)(wn.a,{variant:"light",hidden:j!==Oc.Finished,onClick:h,children:"Search Again"})}),[j,h]),m=Object(a.useMemo)((function(){var e="Unknown";return O&&(e=O.sceneName?O.sceneName:(ne(O),O.title)),"Search - ".concat(e)}),[O]);return Object(gn.jsx)(jr,Object(f.a)(Object(f.a)({closeable:j!==Oc.Searching,size:"xl",title:m,footer:v},r),{},{children:x}))},xc=function(e){var t=e.matches,n=e.dont,r=fn.h,c="var(--success)";n.length>0&&(r=fn.A,c="var(--warning)");var i=Object(a.useMemo)((function(){return t.map((function(e,t){return Object(gn.jsx)("p",{className:"text-nowrap m-0",children:e},"match-".concat(t))}))}),[t]),s=Object(a.useMemo)((function(){return n.map((function(e,t){return Object(gn.jsx)("p",{className:"text-nowrap m-0",children:e},"dont-".concat(t))}))}),[n]),o=Object(a.useMemo)((function(){return Object(gn.jsx)(xn.a,{className:"w-100",id:"manual-search-matches-info",children:Object(gn.jsx)(xn.a.Content,{children:Object(gn.jsx)(yn.a,{fluid:!0,children:Object(gn.jsxs)(Vt.a,{children:[Object(gn.jsxs)(sa.a,{xs:6,children:[Object(gn.jsx)(pn.a,{color:"var(--success)",icon:fn.h}),i]}),Object(gn.jsxs)(sa.a,{xs:6,children:[Object(gn.jsx)(pn.a,{color:"var(--danger)",icon:fn.X}),s]})]})})})})}),[i,s]);return Object(gn.jsx)(vn.a,{overlay:o,placement:"left",children:Object(gn.jsx)(pn.a,{icon:r,color:c})})},vc=function(e){var t=e.icon,n=e.desc,r=e.children;return Object(gn.jsxs)(Wn.a,{title:n,variant:"secondary",className:"mr-2 my-1 text-truncate",children:[Object(gn.jsx)(pn.a,{icon:t}),Object(gn.jsx)("span",{className:"ml-1",children:r})]})},mc=function(e){var t=e.item,n=e.details,r=Object(a.useMemo)((function(){var e,r=[];return r.push(Object(gn.jsx)(vc,{icon:Nn.e,desc:"File Path",children:t.path},"file-path")),r.push.apply(r,Object(X.a)(null!==(e=null===n||void 0===n?void 0:n.map((function(e,t){return Object(gn.jsx)(vc,{icon:e.icon,children:e.text},de(t,"detail",e.text))})))&&void 0!==e?e:[])),t.tags.length>0&&r.push(Object(gn.jsx)(vc,{icon:fn.V,desc:"Tags",children:t.tags.join("|")},"tags")),r}),[n,t.path,t.tags]),c=Object(a.useMemo)((function(){return t.audio_language.map((function(e,t){return Object(gn.jsx)(vc,{icon:fn.H,desc:"Audio Language",children:e.name},de(t,"audio",e.code2))}))}),[t.audio_language]),i=tn(t.profileId),s=an(i),o=Object(a.useMemo)((function(){var e=[];return i&&(e.push(Object(gn.jsx)(vc,{icon:fn.T,desc:"Languages Profile",children:i.name},"language-profile")),e.push.apply(e,Object(X.a)(s.map((function(e,t){return Object(gn.jsx)(vc,{icon:fn.B,desc:"Language",children:Object(gn.jsx)(ba,{long:!0,text:e})},de(t,"lang",e.code2))}))))),e}),[i,s]),l=Object(a.useMemo)((function(){return Object(gn.jsxs)(xn.a,{id:"item-overview-alternative",children:[Object(gn.jsx)(xn.a.Title,{children:"Alternate Titles"}),Object(gn.jsx)(xn.a.Content,{children:t.alternativeTitles.map((function(e,t){return Object(gn.jsx)("li",{children:e},t)}))})]})}),[t.alternativeTitles]);return Object(gn.jsx)(yn.a,{fluid:!0,style:{backgroundRepeat:"no-repeat",backgroundSize:"cover",backgroundPosition:"top center",backgroundImage:"url('".concat(t.fanart,"')")},children:Object(gn.jsxs)(Vt.a,{className:"p-4 pb-4",style:{backgroundColor:"rgba(0,0,0,0.7)"},children:[Object(gn.jsx)(sa.a,{sm:"auto",children:Object(gn.jsx)(ha.a,{className:"d-none d-sm-block my-2",style:{maxHeight:250},src:t.poster})}),Object(gn.jsx)(sa.a,{children:Object(gn.jsxs)(yn.a,{fluid:!0,className:"text-white",children:[Object(gn.jsxs)(Vt.a,{children:[ne(t)?Object(gn.jsx)(pn.a,{className:"mx-2 mt-2",title:t.monitored?"monitored":"unmonitored",icon:t.monitored?fn.d:Nn.a,size:"2x"}):null,Object(gn.jsx)("h1",{children:t.title}),Object(gn.jsx)("span",{hidden:0===t.alternativeTitles.length,children:Object(gn.jsx)(vn.a,{overlay:l,children:Object(gn.jsx)(pn.a,{className:"mx-2",icon:Nn.b})})})]}),Object(gn.jsx)(Vt.a,{children:r}),Object(gn.jsx)(Vt.a,{children:c}),Object(gn.jsx)(Vt.a,{children:o}),Object(gn.jsx)(Vt.a,{children:Object(gn.jsx)("span",{children:t.overview})})]})})]})})},gc="Missing Subtitles",yc=function(e){var t=e.movie,n=e.update,r=Object(a.useMemo)((function(){return[{Header:"Subtitle Path",accessor:"path",Cell:function(e){return null===e.value||0===e.value.length?"Video File Subtitle Track":e.value===gc?Object(gn.jsx)("span",{className:"text-muted",children:e.value}):e.value}},{Header:"Language",accessor:"name",Cell:function(e){var t=e.row;return t.original.path===gc?Object(gn.jsx)(Wn.a,{variant:"primary",children:Object(gn.jsx)(ba,{text:t.original,long:!0})}):Object(gn.jsx)(Wn.a,{variant:"secondary",children:Object(gn.jsx)(ba,{text:t.original,long:!0})})}},{accessor:"code2",Cell:function(e){var r=e.row.original;return null===r.path||0===r.path.length?null:r.path===gc?Object(gn.jsx)(qn,{promise:function(){return Kt.downloadSubtitles(t.radarrId,{language:r.code2,hi:r.hi,forced:r.forced})},onSuccess:function(){return n(t.radarrId)},variant:"light",size:"sm",children:Object(gn.jsx)(pn.a,{icon:fn.R})}):Object(gn.jsx)(qn,{variant:"light",size:"sm",promise:function(){var e;return Kt.deleteSubtitles(t.radarrId,{language:r.code2,hi:r.hi,forced:r.forced,path:null!==(e=r.path)&&void 0!==e?e:""})},onSuccess:function(){return n(t.radarrId)},children:Object(gn.jsx)(pn.a,{icon:fn.Z})})}}]}),[t,n]),c=Object(a.useMemo)((function(){var e=t.missing_subtitles.map((function(e){return e.path=gc,e}));return t.subtitles.concat(e)}),[t.missing_subtitles,t.subtitles]);return Object(gn.jsx)(ea,{columns:r,data:c,emptyText:"No Subtitles Found For This Movie"})},kc=function(e,t){e=e;var n=t.language,r=t.hearing_impaired,a=t.forced,c=t.provider,i=t.subtitle;return Bt.downloadMovieSubtitle(e.radarrId,{language:n,hi:r,forced:a,provider:c,subtitle:i})},wc=Object(l.i)((function(e){var t=e.match,n=Number.parseInt(t.params.id),r=un(n),c=Object(J.a)(r,2),i=c[0],s=c[1];ce(s);var o=i.data,u=cr(),d=Object(a.useState)(!0),j=Object(J.a)(d,2),b=j[0],O=j[1],h=Object(a.useCallback)((function(){null===i.data&&O(!1)}),[i.data]);if(ie(i,h),isNaN(n)||!b)return Object(gn.jsx)(l.b,{to:_a});if(!o)return Object(gn.jsx)(ja,{});var f=void 0!==o.profileId;return Object(gn.jsxs)(yn.a,{fluid:!0,children:[Object(gn.jsx)(Ua.a,{children:Object(gn.jsxs)("title",{children:[o.title," - Bazarr (Movies)"]})}),Object(gn.jsxs)($n,{children:[Object(gn.jsxs)($n.Group,{pos:"start",children:[Object(gn.jsx)($n.AsyncButton,{icon:fn.U,promise:function(){return Kt.action({action:"scan-disk",radarrid:o.radarrId})},onSuccess:s,children:"Scan Disk"}),Object(gn.jsx)($n.AsyncButton,{icon:fn.R,disabled:null===o.profileId,promise:function(){return Kt.action({action:"search-missing",radarrid:o.radarrId})},onSuccess:s,children:"Search"}),Object(gn.jsx)($n.Button,{icon:fn.bb,disabled:null===o.profileId,onClick:function(){return u("manual-search",o)},children:"Manual"}),Object(gn.jsx)($n.Button,{icon:fn.y,onClick:function(){return u("history",o)},children:"History"}),Object(gn.jsx)($n.Button,{icon:fn.Y,onClick:function(){return u("tools",[o])},children:"Tools"})]}),Object(gn.jsxs)($n.Group,{pos:"end",children:[Object(gn.jsx)($n.Button,{disabled:!f||null===o.profileId,icon:fn.m,onClick:function(){return u("upload",o)},children:"Upload"}),Object(gn.jsx)($n.Button,{icon:fn.cb,onClick:function(){return u("edit",o)},children:"Edit Movie"})]})]}),Object(gn.jsx)(Vt.a,{children:Object(gn.jsx)(mc,{item:o,details:[]})}),Object(gn.jsx)(Vt.a,{children:Object(gn.jsx)(yc,{movie:o,update:s})}),Object(gn.jsx)(pr,{modalKey:"edit",submit:function(e){return Kt.modify(e)},onSuccess:s}),Object(gn.jsx)(Yr,{modalKey:"tools",size:"lg",update:s}),Object(gn.jsx)(hr,{modalKey:"history",size:"lg"}),Object(gn.jsx)(xr,{modalKey:"upload",size:"lg"}),Object(gn.jsx)(pc,{modalKey:"manual-search",onDownload:s,onSelect:kc})]})})),Sc=function(){return Object(gn.jsxs)(l.e,{children:[Object(gn.jsx)(l.c,{exact:!0,path:"/movies",children:Object(gn.jsx)(fc,{})}),Object(gn.jsx)(l.c,{path:"/movies/:id",children:Object(gn.jsx)(wc,{})})]})},Cc=n(517),Nc=function(){var e=cn(),t=Object(J.a)(e,1)[0],n=Xt(pt),r=Object(a.useMemo)((function(){return[{Header:"Name",accessor:"title",className:"text-nowrap",Cell:function(e){var t=e.row,n=e.value;if(e.isSelecting)return n;var r="/series/".concat(t.original.sonarrSeriesId);return Object(gn.jsx)(u.b,{to:r,children:Object(gn.jsx)("span",{children:n})})}},{Header:"Exist",accessor:"exist",selectHide:!0,Cell:function(e){var t=e.value,n=e.row.original.path;return Object(gn.jsx)(pn.a,{title:n,icon:t?fn.h:fn.t})}},{Header:"Audio",accessor:"audio_language",Cell:function(e){return e.value.map((function(e){return Object(gn.jsx)(Wn.a,{variant:"secondary",className:"mr-2",children:e.name},de(e.code2,e.forced,e.hi))}))}},{Header:"Languages Profile",accessor:"profileId",Cell:function(e){var t,n,r=e.value,a=e.loose;return a&&null!==(t=null===(n=a[0].find((function(e){return e.profileId===r})))||void 0===n?void 0:n.name)&&void 0!==t?t:null}},{Header:"Episodes",accessor:"episodeFileCount",selectHide:!0,Cell:function(e){var t=e.row.original,n=t.episodeFileCount,r=t.episodeMissingCount,a=t.profileId,c=0,i="";0!==n&&a?(c=n-r,i="".concat(n-r,"/").concat(n)):c=0;var s=0===r?"primary":"warning";return Object(gn.jsx)(Cc.a,{className:"my-a",variant:s,min:0,max:n,now:c,label:i})}},{accessor:"sonarrSeriesId",selectHide:!0,Cell:function(e){var t=e.row,n=e.externalUpdate;return Object(gn.jsx)(Yn,{icon:fn.cb,onClick:function(){n&&n(t,"edit")}})}}]}),[]);return Object(gn.jsx)(hc,{state:t,name:"Series",updateAction:yt,loader:n,columns:r,modify:function(e){return Dt.modify(e)}})},Ic=function(e){var t=e.seriesid,n=e.episodeid,r=e.missing,a=e.subtitle,c=a.hi,i=a.forced,s=sn(t),o=Object(J.a)(s,2)[1],l=a.path;return r||l?Object(gn.jsxs)(qn,{promise:function(){return r?Tt.downloadSubtitles(t,n,{hi:c,forced:i,language:a.code2}):l?Tt.deleteSubtitles(t,n,{hi:c,forced:i,path:l,language:a.code2}):null},onSuccess:o,as:Wn.a,className:"mr-1",variant:r?"primary":"secondary",children:[Object(gn.jsx)(ba,{className:"pr-1",text:a}),Object(gn.jsx)(pn.a,{size:"sm",icon:r?fn.R:fn.Z})]}):Object(gn.jsx)(Wn.a,{className:"mr-1",variant:"secondary",children:Object(gn.jsx)(ba,{text:a,long:!1})})},Pc=function(e,t){e=e;var n=t.language,r=t.hearing_impaired,a=t.forced,c=t.provider,i=t.subtitle;return Bt.downloadEpisodeSubtitle(e.sonarrSeriesId,e.sonarrEpisodeId,{language:n,hi:r,forced:a,provider:c,subtitle:i})},Ac=function(e){var t=e.episodes,n=e.update,r=cr(),i=Object(a.useMemo)((function(){return[{accessor:"monitored",Cell:function(e){return Object(gn.jsx)(pn.a,{title:e.value?"monitored":"unmonitored",icon:e.value?fn.d:Nn.a})}},{accessor:"season",Cell:function(e){return"Season ".concat(e.value)}},{Header:"Episode",accessor:"episode"},{Header:"Title",accessor:"title",className:"text-nowrap",Cell:function(e){var t=e.value,n=e.row;return Object(gn.jsx)(Oa,{text:n.original.sceneName,delay:1,children:Object(gn.jsx)("span",{children:t})})}},{Header:"Audio",accessor:"audio_language",Cell:function(e){return e.value.map((function(e){return Object(gn.jsx)(Wn.a,{variant:"secondary",children:e.name},e.code2)}))}},{Header:"Subtitles",accessor:"missing_subtitles",Cell:function(e){var t=e.row.original,n=t.sonarrSeriesId;return Object(a.useMemo)((function(){var e=t.sonarrEpisodeId,r=t.missing_subtitles.map((function(t,r){return Object(gn.jsx)(Ic,{missing:!0,seriesid:n,episodeid:e,subtitle:t},de(r,t.code2,"missing"))})),a=t.subtitles.map((function(t,r){return Object(gn.jsx)(Ic,{seriesid:n,episodeid:e,subtitle:t},de(r,t.code2,"valid"))}));return[].concat(Object(X.a)(r),Object(X.a)(a))}),[t,n])}},{Header:"Actions",accessor:"sonarrEpisodeId",Cell:function(e){var t,n=e.row,r=e.externalUpdate,a=sn(n.original.sonarrSeriesId),c=Object(J.a)(a,1)[0];return Object(gn.jsxs)(gr.a,{children:[Object(gn.jsx)(Vn,{icon:fn.bb,disabled:null===(null===(t=c.data)||void 0===t?void 0:t.profileId),onClick:function(){r&&r(n,"manual-search")}}),Object(gn.jsx)(Vn,{icon:fn.y,onClick:function(){r&&r(n,"history")}}),Object(gn.jsx)(Vn,{icon:fn.e,onClick:function(){r&&r(n,"tools")}})]})}}]}),[]),s=Object(a.useCallback)((function(e,t){r(t,"tools"===t?[e.original]:e.original)}),[r]),o=Object(a.useMemo)((function(){return t.data.reduce((function(e,t){return Math.max(e,t.season)}),0)}),[t]),l=Object(a.useMemo)((function(){return{columns:i,data:t.data,externalUpdate:s,initialState:{sortBy:[{id:"season",desc:!0},{id:"episode",desc:!0}],groupBy:["season"],expanded:Object(h.a)({},"season:".concat(o),!0)}}}),[t,i,o,s]);return Object(gn.jsxs)(c.a.Fragment,{children:[Object(gn.jsx)(Un,{state:t,children:function(){return Object(gn.jsx)(ca,Object(f.a)({emptyText:"No Episode Found For This Series"},l))}}),Object(gn.jsx)(Yr,{modalKey:"tools",size:"lg",update:n}),Object(gn.jsx)(fr,{modalKey:"history",size:"lg"}),Object(gn.jsx)(pc,{modalKey:"manual-search",onDownload:n,onSelect:Pc})]})},Tc=Object(l.i)((function(e){var t,n=e.match,r=Number.parseInt(n.params.id),c=sn(r),i=Object(J.a)(c,2),s=i[0],o=i[1],u=s.data,d=on(null===(t=s.data)||void 0===t?void 0:t.sonarrSeriesId),j=Object(J.a)(d,1)[0];ce(o);var b=0!==j.data.length,O=Object(a.useMemo)((function(){var e;return[{icon:fn.w,text:"".concat(null===u||void 0===u?void 0:u.episodeFileCount," files")},{icon:fn.a,text:null!==(e=null===u||void 0===u?void 0:u.seriesType)&&void 0!==e?e:""}]}),[u]),h=cr(),f=Object(a.useState)(!0),p=Object(J.a)(f,2),x=p[0],v=p[1],m=Object(a.useCallback)((function(){null===s.data&&v(!1)}),[s.data]);return ie(s,m),isNaN(r)||!x?Object(gn.jsx)(l.b,{to:_a}):u?Object(gn.jsxs)(yn.a,{fluid:!0,children:[Object(gn.jsx)(Ua.a,{children:Object(gn.jsxs)("title",{children:[u.title," - Bazarr (Series)"]})}),Object(gn.jsxs)($n,{children:[Object(gn.jsxs)($n.Group,{pos:"start",children:[Object(gn.jsx)($n.AsyncButton,{icon:fn.U,disabled:!b,promise:function(){return Dt.action({action:"scan-disk",seriesid:r})},onSuccess:o,children:"Scan Disk"}),Object(gn.jsx)($n.AsyncButton,{icon:fn.R,promise:function(){return Dt.action({action:"search-missing",seriesid:r})},onSuccess:o,disabled:0===u.episodeFileCount||null===u.profileId||!b,children:"Search"})]}),Object(gn.jsxs)($n.Group,{pos:"end",children:[Object(gn.jsx)($n.Button,{disabled:0===u.episodeFileCount||!b,icon:fn.e,onClick:function(){return h("tools",j.data)},children:"Tools"}),Object(gn.jsx)($n.Button,{disabled:0===u.episodeFileCount||null===u.profileId||!b,icon:fn.m,onClick:function(){return h("upload",u)},children:"Upload"}),Object(gn.jsx)($n.Button,{icon:fn.cb,onClick:function(){return h("edit",u)},children:"Edit Series"})]})]}),Object(gn.jsx)(Vt.a,{children:Object(gn.jsx)(mc,{item:u,details:O})}),Object(gn.jsx)(Vt.a,{children:Object(gn.jsx)(Ac,{episodes:j,update:o})}),Object(gn.jsx)(pr,{modalKey:"edit",submit:function(e){return Dt.modify(e)},onSuccess:o}),Object(gn.jsx)(vr,{modalKey:"upload"})]}):Object(gn.jsx)(ja,{})})),Ec=function(){return Object(gn.jsxs)(l.e,{children:[Object(gn.jsx)(l.c,{exact:!0,path:"/series",children:Object(gn.jsx)(Nc,{})}),Object(gn.jsx)(l.c,{path:"/series/:id",children:Object(gn.jsx)(Tc,{})})]})},Mc="languages-enabled",Kc="languages-profiles",Bc="notifications-providers",Dc="settings-general-use_sonarr",zc="settings-general-use_radarr",Rc=c.a.createContext([{},function(){}]);var Lc=function(e){var t=e.children,n=e.title,r=Xt(Ze),c=Object(a.useState)({}),i=Object(J.a)(c,2),s=i[0],o=i[1],u=Object(a.useState)(!1),d=Object(J.a)(u,2),j=d[0],b=d[1],O=Object(a.useState)({}),f=Object(J.a)(O,2),p=f[0],x=f[1],v=Object(a.useCallback)((function(){o({}),b(!1)}),[]),m=Jt(We,v),g=Object(a.useCallback)((function(e){!function(e){if(Kc in e){var t=e[Kc];e[Kc]=JSON.stringify(t)}if(Mc in e){var n=e[Mc];e[Mc]=n.map((function(e){return e.code2}))}if(Bc in e){var r=e[Bc];e[Bc]=r.map((function(e){return JSON.stringify(e)}))}}(e),b(!0),Rt.setSettings(e).finally(m)}),[m]),y=Object(a.useCallback)((function(e){r(e),o({})}),[r]);Object(a.useEffect)((function(){var e={};e.__default__=g,e.storage=y,x(e)}),[g,y]);var k=Object(a.useMemo)((function(){return p.__default__}),[p]),w=Object(a.useCallback)((function(){var e=new Map;for(var t in s){var n=t.split("-")[0];if(0!==n.length){var r=e.get(n);r?r[t]=s[t]:e.set(n,Object(h.a)({},t,s[t]))}}var a={};e.forEach((function(e,t){t in p?p[t](e):a=Object(Z.merge)(a,e)})),k(a)}),[s,p,k]);return Object(gn.jsxs)(yn.a,{fluid:!0,children:[Object(gn.jsx)(Ua.a,{children:Object(gn.jsx)("title",{children:n})}),Object(gn.jsx)(l.a,{when:Object.keys(s).length>0,message:"You have unsaved changes, are you sure you want to leave?"}),Object(gn.jsx)($n,{children:Object(gn.jsx)($n.Button,{icon:fn.Q,updating:j,disabled:0===Object.keys(s).length,onClick:w,children:"Save"})}),Object(gn.jsx)(Rc.Provider,{value:[s,o],children:Object(gn.jsx)(Vt.a,{className:"p-4",children:Object(gn.jsx)(yn.a,{children:t})})})]})};function _c(){var e=Object(a.useContext)(Rc);return Object(J.a)(e,1)[0]}function Hc(){var e=Object(a.useContext)(Rc),t=Object(J.a)(e,2)[1];return Object(a.useCallback)((function(e,n){t((function(t){var r=Object(f.a)({},t);return r[n]=e,r}))}),[t])}function Uc(e,t,n){var r=$t(),c=Object(J.a)(r,1)[0].data,i=Object(o.d)(),s=Object(a.useMemo)((function(){var n=null;if(void 0===c)return n;var r=e.split("-");if("settings"!==r[0])return null;r=r.slice(0);var a,i=c,s=Object(Kn.a)(r);try{for(s.s();!(a=s.n()).done;){var o=a.value;if(o in i&&(i=i[o]),t(i)){n=i;break}}}catch(l){s.e(l)}finally{s.f()}return n}),[e,c,t]);return n&&void 0!==c?n(c,i.getState()):s}function Fc(e,t,n){var r=Uc(e,t,n),a=_c();return e in a?a[e]:r}var Gc=c.a.createContext(["",function(e){}]),qc=c.a.createContext((function(e){}));function Wc(){return Object(a.useContext)(qc)}var Yc=function(e){var t=e.children,n=Object(a.useState)(!1);return Object(gn.jsx)(Gc.Provider,{value:n,children:t})};Yc.Control=function(e){var t=e.children,n=Object(a.useContext)(Gc);return Object(gn.jsx)(qc.Provider,{value:n[1],children:t})},Yc.Content=function(e){var t=e.on,n=e.eventKey,r=e.indent,c=e.children,i=Object(a.useContext)(Gc),s=Object(J.a)(i,1)[0],o=Object(a.useMemo)((function(){return t&&"string"===typeof s?t(s):n?s===n:!0===s}),[t,s,n]);return Object(gn.jsx)(va.a,{in:o,className:!1===r?void 0:"pl-4",children:Object(gn.jsx)("div",{children:c})})};var Vc=Yc,Qc=n(515),Xc=(n(483),function(e){var t=e.header,n=e.hidden,r=e.children;return Object(gn.jsxs)(Vt.a,{hidden:n,className:"flex-column mt-3",children:[Object(gn.jsxs)(sa.a,{children:[Object(gn.jsx)("h4",{children:t}),Object(gn.jsx)("hr",{})]}),Object(gn.jsx)(sa.a,{children:r})]})}),Jc=function(e){var t=e.children,n=e.name,r=e.hidden;return Object(gn.jsxs)(Pn.a.Group,{hidden:r,children:[n&&Object(gn.jsx)(Pn.a.Label,{children:n}),t]})},Zc=function(e){return Object(gn.jsx)(sa.a,{className:"p-2",xs:6,lg:4,children:Object(gn.jsx)($c,Object(f.a)({},e))})},$c=function(e){var t=e.header,n=e.subheader,r=e.plus,a=e.onClick;return Object(gn.jsx)(Qc.a,{className:"settings-card",onClick:function(){return a&&a()},children:r?Object(gn.jsx)(Qc.a.Body,{className:"d-flex justify-content-center align-items-center",children:Object(gn.jsx)(pn.a,{size:"2x",icon:fn.M})}):Object(gn.jsxs)(Qc.a.Body,{children:[Object(gn.jsx)(Qc.a.Title,{className:"text-nowrap text-truncate",children:t}),Object(gn.jsx)(Qc.a.Subtitle,{hidden:void 0===n,className:"small text-nowrap text-truncate",children:n})]})})},ei=function(e){var t=e.type,n=e.children,r=["pr-4"];return r.push("warning"===t?"text-warning":"text-muted"),Object(gn.jsx)(Pn.a.Text,{className:r.join(" "),children:n})},ti=function(e){var t=e.placeholder,n=e.disabled,r=e.beforeStaged,a=e.controlled,c=e.override,i=e.password,s=e.settingKey,o=Fc(s,$,c),l=Hc(),u=Wc();return Object(gn.jsx)(Pn.a.Control,{type:i?"password":"text",placeholder:null===t||void 0===t?void 0:t.toString(),disabled:n,defaultValue:a?void 0:null!==o&&void 0!==o?o:void 0,value:a&&null!==o&&void 0!==o?o:void 0,onChange:function(e){var t=e.currentTarget.value;u(t.toString());var n=r?r(t):t;l(n,s)}})},ni=function(e){var t=e.label,n=e.inline,r=e.override,c=e.disabled,i=e.settingKey,s=Hc(),o=Wc(),l=Fc(i,Z.isBoolean,r);return Object(a.useEffect)((function(){return o(null!==l&&void 0!==l&&l)}),[o,l]),Object(gn.jsx)(Pn.a.Check,{custom:!0,type:"checkbox",id:i,inline:n,label:t,onChange:function(e){var t=e.currentTarget.checked;s(t,i)},disabled:c,checked:null!==l&&void 0!==l?l:void 0})};function ri(e){return Object(Z.isString)(e)||Object(Z.isNumber)(e)||Object(Z.isArray)(e)}function ai(e){var t=Hc(),n=Wc(),r=e.settingKey,c=e.override,i=e.beforeStaged,s=Object(hn.a)(e,["settingKey","override","beforeStaged"]),o=Fc(r,ri,c);return Object(a.useEffect)((function(){(Object(Z.isString)(o)||Object(Z.isNull)(o))&&n(null!==o&&void 0!==o?o:"")})),Object(gn.jsx)(zn,Object(f.a)(Object(f.a)({},s),{},{defaultValue:o,onChange:function(e){e=i?i(e):e,t(e,r)}}))}var ci=function(e){var t=e.settingKey,n=e.override,r=Object(hn.a)(e,["settingKey","override"]),a=Hc(),c=Fc(t,Z.isNumber,n);return Object(gn.jsx)(_n,Object(f.a)({onAfterChange:function(e){a(e,t)},defaultValue:null!==c&&void 0!==c?c:void 0},r))},ii=function(e){var t=e.settingKey,n=e.override,r=Object(hn.a)(e,["settingKey","override"]),a=Hc(),c=Fc(t,Z.isArray,n);return Object(gn.jsx)(Cn,Object(f.a)({defaultValue:null!==c&&void 0!==c?c:void 0,onChange:function(e){a(e,t)}},r))},si=function(e){var t=e.onClick,n=e.settingKey,r=Object(hn.a)(e,["onClick","settingKey"]),a=Fc(n,Z.isString),c=Hc();return Object(gn.jsx)(wn.a,Object(f.a)({onClick:function(){t&&t(c,n,null!==a&&void 0!==a?a:void 0)}},r))},oi=function(e){var t=e.category,n=Object(a.useState)("Test"),r=Object(J.a)(n,2),c=r[0],i=r[1],s=Object(a.useState)("primary"),o=Object(J.a)(s,2),l=o[0],u=o[1],d=Fc("settings-".concat(t,"-ip"),Z.isString),j=Fc("settings-".concat(t,"-port"),Z.isNumber),b=Fc("settings-".concat(t,"-base_url"),Z.isString),O=Fc("settings-".concat(t,"-apikey"),Z.isString),h=Fc("settings-".concat(t,"-ssl"),Z.isBoolean),f=Object(a.useCallback)((function(){if(d&&O&&null!==h){var e;e=j?"".concat(d,":").concat(j).concat(null!==b&&void 0!==b?b:""):"".concat(d).concat(null!==b&&void 0!==b?b:"");var t={protocol:h?"https":"http",url:e,params:{apikey:O}};t.url.endsWith("/")||(t.url+="/"),Lt.urlTest(t.protocol,t.url,t.params).then((function(e){e.status?(i("Version: ".concat(e.version)),u("success")):(i(e.error),u("danger"))}))}}),[d,j,b,O,h]);return Object(gn.jsx)(wn.a,{onClick:f,variant:l,title:c,className:"text-truncate text-nowrap",children:c})},li=[{label:"Basic",value:"basic"},{label:"Form",value:"form"}],ui=[{label:"Socks5",value:"socks5"},{label:"HTTP(S)",value:"http"}],di=[{label:"master",value:"master"},{label:"development",value:"development"}],ji="abcdef0123456789",bi="settings-auth-apikey",Oi=function(e){var t,n;return null!==(t=null===(n=e.general.base_url)||void 0===n?void 0:n.slice(1))&&void 0!==t?t:""},hi=function(){var e=Object(a.useState)(!1),t=Object(J.a)(e,2),n=t[0],r=t[1],c=window.Bazarr.canUpdate;return Object(gn.jsxs)(Lc,{title:"General - Bazarr (Settings)",children:[Object(gn.jsxs)(Xc,{header:"Host",children:[Object(gn.jsxs)(Jc,{name:"Address",children:[Object(gn.jsx)(ti,{placeholder:"0.0.0.0",settingKey:"settings-general-ip"}),Object(gn.jsx)(ei,{children:"Valid IPv4 address or '0.0.0.0' for all interfaces"})]}),Object(gn.jsx)(Jc,{name:"Port",children:Object(gn.jsx)(ti,{placeholder:6767,settingKey:"settings-general-port"})}),Object(gn.jsxs)(Jc,{name:"Base URL",children:[Object(gn.jsxs)(mr.a,{children:[Object(gn.jsx)(mr.a.Prepend,{children:Object(gn.jsx)(mr.a.Text,{children:"/"})}),Object(gn.jsx)(ti,{settingKey:"settings-general-base_url",override:Oi,beforeStaged:function(e){return"/"+e}})]}),Object(gn.jsx)(ei,{children:"Reverse proxy support"})]})]}),Object(gn.jsxs)(Xc,{header:"Security",children:[Object(gn.jsxs)(Vc,{children:[Object(gn.jsx)(Vc.Control,{children:Object(gn.jsx)(Jc,{name:"Authentication",children:Object(gn.jsx)(ai,{clearable:!0,options:li,settingKey:"settings-auth-type",beforeStaged:function(e){return null===e?"None":e}})})}),Object(gn.jsxs)(Vc.Content,{on:function(e){return""!==e&&"None"!==e},children:[Object(gn.jsx)(Jc,{name:"Username",children:Object(gn.jsx)(ti,{settingKey:"settings-auth-username"})}),Object(gn.jsx)(Jc,{name:"Password",children:Object(gn.jsx)(ti,{password:!0,settingKey:"settings-auth-password"})})]})]}),Object(gn.jsx)(Jc,{name:"API Key",children:Object(gn.jsxs)(mr.a,{children:[Object(gn.jsx)(ti,{disabled:!0,controlled:!0,settingKey:bi}),Object(gn.jsxs)(mr.a.Append,{children:[Object(gn.jsx)(si,{variant:n?"success":"light",settingKey:bi,onClick:function(e,t,n){n&&(function(e){var t=document.createElement("textarea");t.innerText=e,document.body.appendChild(t),t.select(),t.setSelectionRange(0,9999),document.execCommand("copy"),t.remove()}(n),function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];e(!n),setTimeout((function(){return e(n)}),t)}(r,1500))},children:Object(gn.jsx)(pn.a,{icon:n?fn.h:fn.k})}),Object(gn.jsx)(si,{variant:"danger",settingKey:bi,onClick:function(e,t){e(Array(32).fill(null).map((function(){return ji.charAt(Math.floor(Math.random()*ji.length))})).join(""),t)},children:Object(gn.jsx)(pn.a,{icon:fn.U})})]})]})})]}),Object(gn.jsx)(Xc,{header:"Proxy",children:Object(gn.jsxs)(Vc,{children:[Object(gn.jsx)(Vc.Control,{children:Object(gn.jsx)(Jc,{children:Object(gn.jsx)(ai,{clearable:!0,settingKey:"settings-proxy-type",options:ui,beforeStaged:function(e){return null===e?"None":e}})})}),Object(gn.jsxs)(Vc.Content,{on:function(e){return""!==e&&"None"!==e},children:[Object(gn.jsx)(Jc,{name:"Host",children:Object(gn.jsx)(ti,{settingKey:"settings-proxy-url"})}),Object(gn.jsx)(Jc,{name:"Port",children:Object(gn.jsx)(ti,{settingKey:"settings-proxy-port"})}),Object(gn.jsx)(Jc,{name:"Username",children:Object(gn.jsx)(ti,{settingKey:"settings-proxy-username"})}),Object(gn.jsxs)(Jc,{name:"Password",children:[Object(gn.jsx)(ti,{password:!0,settingKey:"settings-proxy-password"}),Object(gn.jsx)(ei,{children:"You only need to enter a username and password if one is required. Leave them blank otherwise"})]}),Object(gn.jsxs)(Jc,{name:"Ignored Addresses",children:[Object(gn.jsx)(ii,{settingKey:"settings-proxy-exclude"}),Object(gn.jsx)(ei,{children:"'*.' as a wildcard for subdomains"})]})]})]})}),Object(gn.jsxs)(Xc,{header:"Updates",hidden:!c,children:[Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{label:"Automatic",settingKey:"settings-general-auto_update"}),Object(gn.jsx)(ei,{children:"Automatically download and install updates"})]}),Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ai,{options:di,settingKey:"settings-general-branch"}),Object(gn.jsx)(ei,{children:"Branch used by update mechanism"})]})]}),Object(gn.jsx)(Xc,{header:"Logging",children:Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{label:"Debug",settingKey:"settings-general-debug"}),Object(gn.jsx)(ei,{children:"Debug logging should only be enabled temporarily"})]})}),Object(gn.jsx)(Xc,{header:"Analytics",children:Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{label:"Enable",settingKey:"settings-analytics-enabled"}),Object(gn.jsx)(ei,{children:"Send anonymous usage information, nothing that can identify you. This includes information on which providers you use, what languages you search for, Bazarr, Python, Sonarr, Radarr and what OS version you are using. We will use this information to prioritize features and bug fixes. Please, keep this enabled as this is the only way we have to better understand how you use Bazarr."})]})})]})},fi=function(e){var t=e.settingKey,n=e.options,r=Si(),a=Hc();return Object(gn.jsx)(tr,{multiple:!0,value:r,options:n,onChange:function(e){a(e,t)}})},pi=function(e){var t=e.settingKey,n=Ci(),r=Object(a.useMemo)((function(){return n.map((function(e){return{label:e.name,value:e.profileId}}))}),[n]);return Object(gn.jsx)(ai,{clearable:!0,options:r,settingKey:t,beforeStaged:function(e){return null===e?"":e}})},xi=[{label:"Any",value:65535}];function vi(){return{profileId:-1,name:"",items:[],cutoff:null}}var mi=function(e){var t=e.update,n=Object(hn.a)(e,["update"]),r=lr(n.modalKey),c=ir(),i=Si(),s=Object(a.useState)(vi),o=Object(J.a)(s,2),l=o[0],u=o[1];Object(a.useEffect)((function(){u(r||vi)}),[r]);var d=Object(a.useMemo)((function(){var e=Object(X.a)(xi),t=l.items.map((function(e){return{label:"ID ".concat(e.id," (").concat(e.language,")"),value:e.id}}));return e.push.apply(e,Object(X.a)(t)),e}),[l.items]),j=Object(a.useCallback)((function(e,t){var n=Object(f.a)({},l);n[e]=t,u(n)}),[l]),b=Object(a.useCallback)((function(e,t){var n=Object(X.a)(l.items);t?n[e.index]=t:n.splice(e.index,1),j("items",n)}),[l.items,j]),O=Object(a.useCallback)((function(){var e=1+l.items.reduce((function(e,t){return Math.max(t.id,e)}),0);if(i.length>0){var t={id:e,language:i[0].code2,audio_exclude:"False",hi:"False",forced:"False"},n=Object(X.a)(l.items);n.push(t),j("items",n)}}),[l.items,j,i]),h=l.name.length>0&&l.items.length>0,p=Object(gn.jsx)(wn.a,{disabled:!h,onClick:function(){c(),t(l)},children:"Save"}),x=Object(a.useMemo)((function(){return[{Header:"ID",accessor:"id"},{Header:"Language",accessor:"language",Cell:function(e){var t=e.value,n=e.row,r=e.externalUpdate,c=t,s=n.original,o=Object(a.useMemo)((function(){var e;return null!==(e=i.find((function(e){return e.code2===c})))&&void 0!==e?e:null}),[c]);return Object(gn.jsx)("div",{style:{width:"8rem"},children:Object(gn.jsx)(tr,{options:i,value:o,onChange:function(e){e&&(s.language=e.code2,r&&r(n,s))}})})}},{Header:"Forced",accessor:"forced",Cell:function(e){var t=e.row,n=e.value,r=e.externalUpdate,a=t.original;return Object(gn.jsx)(Pn.a.Check,{custom:!0,id:de(a.id,a.language,"forced"),checked:"True"===n,onChange:function(e){a.forced=e.target.checked?"True":"False",r&&r(t,a)}})}},{Header:"HI",accessor:"hi",Cell:function(e){var t=e.row,n=e.value,r=e.externalUpdate,a=t.original;return Object(gn.jsx)(Pn.a.Check,{custom:!0,id:de(a.id,a.language,"hi"),checked:"True"===n,onChange:function(e){a.hi=e.target.checked?"True":"False",r&&r(t,a)}})}},{Header:"Exclude Audio",accessor:"audio_exclude",Cell:function(e){var t=e.row,n=e.value,r=e.externalUpdate,a=t.original;return Object(gn.jsx)(Pn.a.Check,{custom:!0,id:de(a.id,a.language,"audio"),checked:"True"===n,onChange:function(e){a.audio_exclude=e.target.checked?"True":"False",r&&r(t,a)}})}},{id:"action",accessor:"id",Cell:function(e){var t=e.row,n=e.externalUpdate;return Object(gn.jsx)(Vn,{icon:fn.Z,onClick:function(){return n&&n(t)}})}}]}),[i]);return Object(gn.jsxs)(jr,Object(f.a)(Object(f.a)({size:"lg",title:"Languages Profile",footer:p},n),{},{children:[Object(gn.jsx)(Jc,{children:Object(gn.jsx)(Pn.a.Control,{type:"text",placeholder:"Name",value:l.name,onChange:function(e){j("name",e.target.value)}})}),Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ea,{responsive:!1,columns:x,data:l.items,externalUpdate:b}),Object(gn.jsx)(wn.a,{block:!0,variant:"light",onClick:O,children:"Add"})]}),Object(gn.jsxs)(Jc,{name:"Cutoff",children:[Object(gn.jsx)(zn,{clearable:!0,options:d,value:l.cutoff,onChange:function(e){return j("cutoff",e)}}),Object(gn.jsx)(ei,{children:"Ignore others if existing"})]})]}))},gi=function(e){var t=e.cutoff,n=e.item,r=e.className,c=Object(a.useMemo)((function(){var e=n.language;return"True"===n.hi?e+=":HI":"True"===n.forced&&(e+=":Forced"),e}),[n.hi,n.forced,n.language]);return Object(gn.jsx)(Wn.a,{className:r,title:t?"Ignore others if this one is available":void 0,variant:t?"primary":"secondary",children:c})},yi=function(){var e=Ci(),t=Si(),n=Object(a.useState)((function(){return Object(Z.cloneDeep)(e)})),r=Object(J.a)(n,2),i=r[0],s=r[1],o=Object(a.useMemo)((function(){return 1+i.reduce((function(e,t){return Math.max(t.profileId,e)}),0)}),[i]),l=Hc(),u=cr(),d=Object(a.useCallback)((function(e){l(e,Kc),s(e)}),[l]),j=Object(a.useCallback)((function(e){var t=Object(X.a)(i),n=t.findIndex((function(t){return t.profileId===e.profileId}));-1!==n?t[n]=e:t.push(e),d(t)}),[i,d]),b=Object(a.useCallback)((function(e,t){if(t)u("profile",Object(Z.cloneDeep)(t));else{var n=Object(X.a)(i);n.splice(e.index,1),d(n)}}),[d,u,i]),O=Object(a.useMemo)((function(){return[{Header:"Name",accessor:"name"},{Header:"Languages",accessor:"items",Cell:function(e){var t=e.value,n=e.row.original.cutoff;return t.map((function(e){var t=e.id===n||65535===n;return Object(gn.jsx)(gi,{cutoff:t,className:"mx-1",item:e},e.id)}))}},{accessor:"profileId",Cell:function(e){var t=e.row,n=e.externalUpdate,r=t.original;return Object(gn.jsxs)(gr.a,{children:[Object(gn.jsx)(Vn,{icon:fn.cb,onClick:function(){n&&n(t,r)}}),Object(gn.jsx)(Vn,{icon:fn.Z,onClick:function(){return n&&n(t)}})]})}}]}),[]),h=0!==t.length;return Object(gn.jsxs)(c.a.Fragment,{children:[Object(gn.jsx)(ea,{columns:O,data:i,externalUpdate:b}),Object(gn.jsx)(wn.a,{block:!0,disabled:!h,variant:"light",onClick:function(){u("profile",{profileId:o,name:"",items:[],cutoff:null})},children:h?"Add New Profile":"No Enabled Languages"}),Object(gn.jsx)(mi,{update:j,modalKey:"profile"})]})},ki=c.a.createContext([]),wi=c.a.createContext([]);function Si(){var e=Object(a.useContext)(ki),t=Fc(Mc,Z.isArray);return t||e}function Ci(){var e=Object(a.useContext)(wi),t=Fc(Kc,Z.isArray);return t||e}var Ni=function(){var e=nn(!1),t=Object(J.a)(e,1)[0],n=nn(!0),r=Object(J.a)(n,1)[0],a=en(),c=Object(J.a)(a,1)[0];return Object(gn.jsx)(Lc,{title:"Languages - Bazarr (Settings)",children:Object(gn.jsx)(ki.Provider,{value:r,children:Object(gn.jsxs)(wi.Provider,{value:c,children:[Object(gn.jsxs)(Xc,{header:"Subtitles Language",children:[Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{label:"Single Language",settingKey:"settings-general-single_language"}),Object(gn.jsx)(ei,{children:"Download a single Subtitles file without adding the language code to the filename."}),Object(gn.jsx)(ei,{type:"warning",children:"We don't recommend enabling this option unless absolutely required (ie: media player not supporting language code in subtitles filename). Results may vary."})]}),Object(gn.jsx)(Jc,{name:"Languages Filter",children:Object(gn.jsx)(fi,{settingKey:Mc,options:t})})]}),Object(gn.jsx)(Xc,{header:"Languages Profiles",children:Object(gn.jsx)(yi,{})}),Object(gn.jsxs)(Xc,{header:"Default Settings",children:[Object(gn.jsxs)(Vc,{children:[Object(gn.jsx)(Vc.Control,{children:Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{label:"Series",settingKey:"settings-general-serie_default_enabled"}),Object(gn.jsx)(ei,{children:"Apply only to Series added to Bazarr after enabling this option."})]})}),Object(gn.jsx)(Vc.Content,{indent:!0,children:Object(gn.jsx)(Jc,{name:"Profile",children:Object(gn.jsx)(pi,{settingKey:"settings-general-serie_default_profile"})})})]}),Object(gn.jsxs)(Vc,{children:[Object(gn.jsx)(Vc.Control,{children:Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{label:"Movies",settingKey:"settings-general-movie_default_enabled"}),Object(gn.jsx)(ei,{children:"Apply only to Movies added to Bazarr after enabling this option."})]})}),Object(gn.jsx)(Vc.Content,{children:Object(gn.jsx)(Jc,{name:"Profile",children:Object(gn.jsx)(pi,{settingKey:"settings-general-movie_default_profile"})})})]})]})]})})})},Ii=function(e,t){return e.name===t.name},Pi=function(e){var t,n=e.selections,r=Object(hn.a)(e,["selections"]),i=Object(a.useMemo)((function(){return n.filter((function(e){return!e.enabled})).map((function(e){return{label:e.name,value:e}}))}),[n]),s=function(e,t){var n=Hc(),r=_c();void 0===t&&(t=Z.isEqual);var c=Object(a.useMemo)((function(){return e in r?r[e]:[]}),[e,r]);return Object(a.useCallback)((function(r){var a=Object(X.a)(c),i=a.findIndex((function(e){return t(e,r)}));-1!==i?a[i]=r:a.push(r),n(a,e)}),[t,c,e,n])}(Bc,Ii),o=lr(r.modalKey),l=Object(a.useState)(null!==o&&void 0!==o?o:null),u=Object(J.a)(l,2),d=u[0],j=u[1],b=Object(a.useCallback)((function(){return j(null!==o&&void 0!==o?o:null)}),[o]);or(r.modalKey,b);var O=Object(a.useCallback)((function(e){if(d){var t=Object(f.a)({},d);t.url=e,j(t)}}),[d]),h=ir(),p=null!==d&&null!==(null===d||void 0===d?void 0:d.url)&&0!==(null===d||void 0===d?void 0:d.url.length),x=Object(a.useMemo)((function(){return Object(gn.jsxs)(c.a.Fragment,{children:[Object(gn.jsx)(qn,{className:"mr-auto",disabled:!p,variant:"outline-secondary",promise:function(){return d&&d.url?Rt.testNotification(d.url):null},children:"Test"}),Object(gn.jsx)(wn.a,{hidden:null===o,variant:"danger",onClick:function(){d&&(d.enabled=!1,s(d)),h()},children:"Remove"}),Object(gn.jsx)(wn.a,{disabled:!p,onClick:function(){d&&(d.enabled=!0,s(d)),h()},children:"Save"})]})}),[p,h,d,s,o]),v=Object(a.useCallback)((function(e){return e.name}),[]);return Object(gn.jsx)(jr,Object(f.a)(Object(f.a)({title:"Notification",footer:x},r),{},{children:Object(gn.jsx)(yn.a,{fluid:!0,children:Object(gn.jsxs)(Vt.a,{children:[Object(gn.jsx)(sa.a,{xs:12,children:Object(gn.jsx)(zn,{disabled:null!==o,options:i,value:d,onChange:j,label:v})}),Object(gn.jsx)(sa.a,{hidden:null===d,children:Object(gn.jsx)(Pn.a.Group,{className:"mt-4",children:Object(gn.jsx)(Pn.a.Control,{as:"textarea",rows:4,placeholder:"URL",value:null!==(t=null===d||void 0===d?void 0:d.url)&&void 0!==t?t:"",onChange:function(e){var t=e.currentTarget.value;O(t)}})})})]})})}))},Ai=function(){var e=function(e,t,n){var r=Uc(e,Z.isArray,n),c=_c();void 0===t&&(t=Z.isEqual);var i=void 0;return e in c&&(i=c[e]),Object(a.useMemo)((function(){return void 0!==i&&r?ue(r,i,t):r}),[r,i,t])}(Bc,Ii,(function(e){return e.notifications.providers})),t=cr(),n=Object(a.useMemo)((function(){return null===e||void 0===e?void 0:e.filter((function(e){return e.enabled})).map((function(e,n){return Object(gn.jsx)(Zc,{header:e.name,onClick:function(){return t("notifications",e)}},de(n,e.name))}))}),[e,t]);return Object(gn.jsxs)(yn.a,{fluid:!0,children:[Object(gn.jsxs)(Vt.a,{children:[n," ",Object(gn.jsx)(Zc,{plus:!0,onClick:function(){return t("notifications")}})]}),Object(gn.jsx)(Pi,{selections:null!==e&&void 0!==e?e:[],modalKey:"notifications"})]})},Ti=function(){return Object(gn.jsxs)(Lc,{title:"Notifications - Bazarr (Settings)",children:[Object(gn.jsxs)(kn.a,{variant:"secondary",children:["Thanks to caronc for his work on"," ",Object(gn.jsx)("a",{href:"https://github.com/caronc/apprise",target:"_blank",rel:"noopener noreferrer",children:"apprise"}),", the core of the Bazarr notification system."]}),Object(gn.jsxs)(kn.a,{variant:"secondary",children:["Please follow instructions on his"," ",Object(gn.jsx)("a",{href:"https://github.com/caronc/apprise/wiki",target:"_blank",rel:"noopener noreferrer",children:"Wiki"})," ","to configure your notification providers."]}),Object(gn.jsx)(Xc,{header:"Notifications",children:Object(gn.jsx)(Ai,{})}),Object(gn.jsx)(Xc,{header:"Options",children:Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{label:"Silent for Manual Actions",settingKey:"settings-general-dont_notify_manual_actions"}),Object(gn.jsx)(ei,{children:"Suppress notifications when manually download/upload subtitles."})]})})]})},Ei=n(24),Mi=[{key:"addic7ed",description:"Requires Anti-Captcha Provider",defaultKey:{username:"",password:""}},{key:"argenteam",description:"Spanish Subtitles Provider"},{key:"assrt",description:"Chinese Subtitles Provider",defaultKey:{token:""}},{key:"betaseries",name:"BetaSeries",description:"French / English Provider for TV Shows Only",defaultKey:{token:""},keyNameOverride:{token:"API KEY"}},{key:"bsplayer",name:"BSplayer"},{key:"greeksubs",name:"GreekSubs",description:"Greek Subtitles Provider"},{key:"greeksubtitles",name:"GreekSubtitles",description:"Greek Subtitles Provider"},{key:"hosszupuska",description:"Hungarian Subtitles Provider"},{key:"legendasdivx",name:"LegendasDivx",description:"Brazilian / Portuguese Subtitles Provider",defaultKey:{username:"",password:"",skip_wrong_fps:!1},keyNameOverride:{skip_wrong_fps:"Skip Wrong FPS"}},{key:"legendastv",name:"LegendasTV",description:"Brazilian / Portuguese Subtitles Provider",defaultKey:{username:"",password:""}},{key:"napiprojekt",description:"Polish Subtitles Provider"},{key:"napisy24",description:"Polish Subtitles Provider",message:"The provided credentials must have API access. Leave empty to use the defaults.",defaultKey:{username:"",password:""}},{key:"nekur",description:"Latvian Subtitles Provider"},{key:"opensubtitles",name:"OpenSubtitles.org",defaultKey:{username:"",password:"",vip:!1,ssl:!1,skip_wrong_fps:!1},keyNameOverride:{vip:"VIP",ssl:"Use SSL",skip_wrong_fps:"Skip Wrong FPS"}},{key:"opensubtitlescom",name:"OpenSubtitles.com",defaultKey:{username:"",password:"",use_hash:!1},keyNameOverride:{use_hash:"Use Hash"}},{key:"podnapisi"},{key:"regielive",name:"RegieLive",description:"Romanian Subtitles Provider"},{key:"soustitreseu",name:"Sous-Titres.eu",description:"Mostly French Subtitles Provider"},{key:"subdivx",description:"Spanish Subtitles Provider"},{key:"subssabbz",name:"Subs.sab.bz",description:"Bulgarian Subtitles Provider"},{key:"subs4free",name:"Subs4Free",description:"Greek Subtitles Provider"},{key:"subs4series",name:"Subs4Series",description:"Greek Subtitles Provider"},{key:"subscene",description:"Requires Anti-Captcha Provider",defaultKey:{username:"",password:""}},{key:"subscenter"},{key:"subsunacs",name:"Subsunacs.net",description:"Bulgarian Subtitles Provider"},{key:"subsynchro",description:"French Subtitles Provider"},{key:"subtitriid",name:"subtitri.id.lv",description:"Latvian Subtitles Provider"},{key:"subtitulamos",name:"Subtitulamos.tv",description:"Spanish Subtitles Provider"},{key:"sucha",description:"Spanish Subtitles Provider"},{key:"supersubtitles"},{key:"titlovi",defaultKey:{username:"",password:""}},{key:"titrari",name:"Titrari.ro"},{key:"tusubtitulo",name:"Tusubtitulo.com",description:"Spanish / English Subtitles Provider for TV Shows"},{key:"tvsubtitles",name:"TVSubtitles"},{key:"wizdom",description:"Wizdom.xyz Subtitles Provider."},{key:"xsubs",name:"XSubs",description:"Greek Subtitles Provider",defaultKey:{username:"",password:""}},{key:"yavkanet",name:"Yavka.net",description:"Bulgarian Subtitles Provider"},{key:"yifysubtitles",name:"YIFY Subtitles"},{key:"zimuku",description:"Chinese Subtitles Provider"}],Ki="provider-modal",Bi="settings-general-enabled_providers",Di=function(){var e=Fc(Bi,Z.isArray),t=cr(),n=Object(a.useCallback)((function(e){t(Ki,null!==e&&void 0!==e?e:null)}),[t]),r=Object(a.useMemo)((function(){return e?e.flatMap((function(e){var t=Mi.find((function(t){return t.key===e}));return t||[]})).map((function(e,t){var r;return Object(gn.jsx)(Zc,{header:null!==(r=e.name)&&void 0!==r?r:Object(Z.capitalize)(e.key),subheader:e.description,onClick:function(){return n(e)}},de(t,e.name))})):[]}),[e,n]);return Object(gn.jsx)(yn.a,{fluid:!0,children:Object(gn.jsxs)(Vt.a,{children:[r,Object(gn.jsx)(Zc,{plus:!0,onClick:n},"add-card")]})})},zi=function(){var e=lr(Ki),t=Object(a.useState)({}),n=Object(J.a)(t,2),r=n[0],i=n[1],s=Object(a.useState)(null!==e&&void 0!==e?e:null),o=Object(J.a)(s,2),l=o[0],u=o[1],d=Object(a.useCallback)((function(){return u(null!==e&&void 0!==e?e:null)}),[e]);or(Ki,d);var j=Fc(Bi,Z.isArray),b=ir(),O=function(){var e=Object(a.useContext)(Rc),t=Object(J.a)(e,2)[1];return Object(a.useCallback)((function(e){t((function(t){return Object(f.a)(Object(f.a)({},t),e)}))}),[t])}(),p=Object(a.useCallback)((function(){if(e&&j){var t=j.findIndex((function(t){return t===e.key}));if(-1!==t){var n=Object(X.a)(j);n.splice(t,1),O(Object(h.a)({},Bi,n)),b()}}}),[e,j,O,b]),x=Object(a.useCallback)((function(){if(l&&j){var e=Object(f.a)({},r);if(void 0===j.find((function(e){return e===l.key}))){var t=[].concat(Object(X.a)(j),[l.key]);e[Bi]=t}O(e),b()}}),[l,j,r,b,O]),v=null!==l,m=Object(a.useMemo)((function(){return Object(gn.jsxs)(c.a.Fragment,{children:[Object(gn.jsx)(wn.a,{hidden:!e,variant:"danger",onClick:p,children:"Delete"}),Object(gn.jsx)(wn.a,{disabled:!v,onClick:x,children:"Save"})]})}),[v,e,p,x]),g=Object(a.useCallback)((function(e){u(e||{key:"",description:"Unknown Provider"})}),[]),y=Object(a.useMemo)((function(){return Mi.filter((function(e){return void 0===(null===j||void 0===j?void 0:j.find((function(t){return t===e.key})))})).map((function(e){var t;return{label:null!==(t=e.name)&&void 0!==t?t:Object(Z.capitalize)(e.key),value:e}}))}),[j]),k=Object(a.useMemo)((function(){var e;if(null===l)return null;var t=l.defaultKey,n=null!==(e=l.keyNameOverride)&&void 0!==e?e:{};if(void 0===t)return null;var r=l.key,a=[],c=[];for(var i in t){var s=t[i],o=i;o=o in n?n[o]:Object(Z.capitalize)(i),$(s)?a.push(Object(gn.jsx)(sa.a,{xs:12,className:"mt-2",children:Object(gn.jsx)(ti,{password:"password"===i,placeholder:o,settingKey:"settings-".concat(r,"-").concat(i)})},i)):Object(Z.isBoolean)(s)&&c.push(Object(gn.jsx)(ni,{inline:!0,label:o,settingKey:"settings-".concat(r,"-").concat(i)},i))}return Object(gn.jsxs)(Vt.a,{children:[a,Object(gn.jsx)(sa.a,{hidden:0===c.length,className:"mt-2",children:c})]})}),[l]),w=Object(a.useMemo)((function(){return{Option:function(e){var t=e.data,n=Object(hn.a)(e,["data"]),r=t,a=r.label,c=r.value;return Object(gn.jsxs)(Ei.l.Option,Object(f.a)(Object(f.a)({data:t},n),{},{children:[a,Object(gn.jsx)("p",{className:"small m-0 text-muted",children:c.description})]}))}}}),[]),S=Object(a.useCallback)((function(e){var t;return null!==(t=e.name)&&void 0!==t?t:Object(Z.capitalize)(e.key)}),[]);return Object(gn.jsx)(jr,{title:"Provider",footer:m,modalKey:Ki,children:Object(gn.jsx)(Rc.Provider,{value:[r,i],children:Object(gn.jsxs)(yn.a,{children:[Object(gn.jsx)(Vt.a,{children:Object(gn.jsx)(sa.a,{children:Object(gn.jsx)(zn,{components:w,disabled:null!==e,options:y,value:l,label:S,onChange:g})})}),Object(gn.jsx)(Vt.a,{children:Object(gn.jsx)(sa.a,{className:"mb-2",children:Object(gn.jsx)(ei,{children:null===l||void 0===l?void 0:l.description})})}),k,Object(gn.jsx)(Vt.a,{hidden:void 0===(null===l||void 0===l?void 0:l.message),children:Object(gn.jsx)(sa.a,{children:Object(gn.jsx)(ei,{children:null===l||void 0===l?void 0:l.message})})})]})})})},Ri=function(){return Object(gn.jsxs)(Lc,{title:"Providers - Bazarr (Settings)",children:[Object(gn.jsx)(Xc,{header:"Providers",children:Object(gn.jsx)(Jc,{children:Object(gn.jsx)(Di,{})})}),Object(gn.jsx)(zi,{})]})};var Li=function(e){var t=e.type,n=function(e){return"sonarr"===e?"settings-general-path_mappings":"settings-general-path_mappings_movie"}(t),r=Fc(n,Z.isArray),i=Uc(function(e){return"sonarr"===e?Dc:zc}(t),Z.isBoolean),s=Hc(),o=Object(a.useCallback)((function(e){s(e.map((function(e){return[e.from,e.to]})),n)}),[n,s]),l=Object(a.useCallback)((function(){if(r){var e=[].concat(Object(X.a)(r),[["",""]]);s(e,n)}}),[r,n,s]),u=Object(a.useMemo)((function(){var e;return null!==(e=null===r||void 0===r?void 0:r.map((function(e){return{from:e[0],to:e[1]}})))&&void 0!==e?e:[]}),[r]),d=Object(a.useMemo)((function(){return"sonarr"===t?function(e){return Et.sonarr(e)}:function(e){return Et.radarr(e)}}),[t]),j=Object(a.useCallback)((function(e,t){var n=Object(X.a)(u);t?n[e.index]=t:n.splice(e.index,1),o(n)}),[u,o]),b=Object(a.useMemo)((function(){return[{Header:Object(Z.capitalize)(t),accessor:"from",Cell:function(e){var t=e.value,n=e.row,r=e.externalUpdate;return Object(gn.jsx)(Mn,{drop:"up",defaultValue:t,load:d,onChange:function(e){var t=Object(f.a)({},n.original);t.from=e,r&&r(n,t)}})}},{id:"arrow",className:"text-center",Cell:function(){return Object(gn.jsx)(pn.a,{icon:fn.b})}},{Header:"Bazarr",accessor:"to",Cell:function(e){var t=e.value,n=e.row,r=e.externalUpdate;return Object(gn.jsx)(Mn,{drop:"up",defaultValue:t,load:function(e){return Et.bazarr(e)},onChange:function(e){var t=Object(f.a)({},n.original);t.to=e,r&&r(n,t)}})}},{id:"action",accessor:"to",Cell:function(e){var t=e.row,n=e.externalUpdate;return Object(gn.jsx)(Vn,{icon:fn.Z,onClick:function(){n&&n(t)}})}}]}),[t,d]);return i?Object(gn.jsxs)(c.a.Fragment,{children:[Object(gn.jsx)(ea,{emptyText:"No Mapping",responsive:!1,columns:b,data:u,externalUpdate:j}),Object(gn.jsx)(wn.a,{block:!0,variant:"light",onClick:l,children:"Add"})]}):Object(gn.jsx)(ei,{children:"Path Mappings will be available after staged changes are saved"})},_i=function(){var e=Object(a.useCallback)((function(e){var t,n;return null!==(t=null===(n=e.radarr.base_url)||void 0===n?void 0:n.slice(1))&&void 0!==t?t:""}),[]);return Object(gn.jsx)(Lc,{title:"Radarr - Bazarr (Settings)",children:Object(gn.jsxs)(Vc,{children:[Object(gn.jsx)(Vc.Control,{children:Object(gn.jsx)(Xc,{header:"Use Radarr",children:Object(gn.jsx)(Jc,{children:Object(gn.jsx)(ni,{label:"Enabled",settingKey:zc})})})}),Object(gn.jsxs)(Vc.Content,{indent:!1,children:[Object(gn.jsxs)(Xc,{header:"Host",children:[Object(gn.jsxs)(Jc,{name:"Address",children:[Object(gn.jsx)(ti,{settingKey:"settings-radarr-ip"}),Object(gn.jsx)(ei,{children:"Hostname or IPv4 Address"})]}),Object(gn.jsx)(Jc,{name:"Port",children:Object(gn.jsx)(ti,{settingKey:"settings-radarr-port"})}),Object(gn.jsx)(Jc,{name:"Base URL",children:Object(gn.jsxs)(mr.a,{children:[Object(gn.jsx)(mr.a.Prepend,{children:Object(gn.jsx)(mr.a.Text,{children:"/"})}),Object(gn.jsx)(ti,{settingKey:"settings-radarr-base_url",override:e,beforeStaged:function(e){return"/"+e}})]})}),Object(gn.jsx)(Jc,{name:"API Key",children:Object(gn.jsx)(ti,{settingKey:"settings-radarr-apikey"})}),Object(gn.jsx)(Jc,{children:Object(gn.jsx)(ni,{label:"SSL",settingKey:"settings-radarr-ssl"})}),Object(gn.jsx)(Jc,{children:Object(gn.jsx)(oi,{category:"radarr"})})]}),Object(gn.jsxs)(Xc,{header:"Options",children:[Object(gn.jsx)(Jc,{name:"Minimum Score",children:Object(gn.jsx)(ci,{settingKey:"settings-general-minimum_score_movie"})}),Object(gn.jsxs)(Jc,{name:"Excluded Tags",children:[Object(gn.jsx)(ii,{settingKey:"settings-radarr-excluded_tags"}),Object(gn.jsx)(ei,{children:"Movies with those tags (case sensitive) in Radarr will be excluded from automatic download of subtitles."})]}),Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{label:"Download Only Monitored",settingKey:"settings-radarr-only_monitored"}),Object(gn.jsx)(ei,{children:"Automatic download of subtitles will only happen for monitored movies in Radarr."})]})]}),Object(gn.jsx)(Xc,{header:"Path Mappings",children:Object(gn.jsx)(Li,{type:"radarr"})})]})]})})},Hi=[{label:"1 Minute",value:1},{label:"5 Minutes",value:5},{label:"15 Minutes",value:15},{label:"1 Hour",value:60},{label:"3 Hours",value:180}],Ui=[{label:"5 Minutes",value:5},{label:"15 Minutes",value:15},{label:"1 Hour",value:60},{label:"3 Hours",value:180},{label:"6 Hours",value:360}],Fi=Ui,Gi=[{label:"Manually",value:"Manually"},{label:"Daily",value:"Daily"},{label:"Weekly",value:"Weekly"}],qi=[{label:"Monday",value:0},{label:"Tuesday",value:1},{label:"Wednesday",value:2},{label:"Thursday",value:3},{label:"Friday",value:4},{label:"Saturday",value:5},{label:"Sunday",value:6}],Wi=[{label:"3 Hours",value:3},{label:"6 Hours",value:6},{label:"12 Hours",value:12},{label:"24 Hours",value:24}],Yi=function(){var e=Object(a.useMemo)((function(){return Array(24).fill(null).map((function(e,t){return{label:"".concat(t,":00"),value:t}}))}),[]);return Object(gn.jsxs)(Lc,{title:"Scheduler - Bazarr (Settings)",children:[Object(gn.jsxs)(Xc,{header:"Sonarr/Radarr Sync",children:[Object(gn.jsx)(Jc,{name:"Update Series List from Sonarr",children:Object(gn.jsx)(ai,{options:Hi,settingKey:"settings-sonarr-series_sync"})}),Object(gn.jsx)(Jc,{name:"Update Episodes List from Sonarr",children:Object(gn.jsx)(ai,{options:Ui,settingKey:"settings-sonarr-episodes_sync"})}),Object(gn.jsx)(Jc,{name:"Update Movies List from Radarr",children:Object(gn.jsx)(ai,{options:Fi,settingKey:"settings-radarr-movies_sync"})})]}),Object(gn.jsxs)(Xc,{header:"Disk Indexing",children:[Object(gn.jsxs)(Vc,{children:[Object(gn.jsx)(Vc.Control,{children:Object(gn.jsx)(Jc,{name:"Update all Episode Subtitles from Disk",children:Object(gn.jsx)(ai,{settingKey:"settings-sonarr-full_update",options:Gi})})}),Object(gn.jsx)(Vc.Content,{on:function(e){return"Weekly"===e},children:Object(gn.jsx)(Jc,{name:"Day of The Week",children:Object(gn.jsx)(ai,{settingKey:"settings-sonarr-full_update_day",options:qi})})}),Object(gn.jsx)(Vc.Content,{on:function(e){return"Daily"===e||"Weekly"===e},children:Object(gn.jsx)(Jc,{name:"Time of The Day",children:Object(gn.jsx)(ai,{settingKey:"settings-sonarr-full_update_hour",options:e})})})]}),Object(gn.jsxs)(Vc,{children:[Object(gn.jsx)(Vc.Control,{children:Object(gn.jsx)(Jc,{name:"Update all Movie Subtitles from Disk",children:Object(gn.jsx)(ai,{settingKey:"settings-radarr-full_update",options:Gi})})}),Object(gn.jsx)(Vc.Content,{on:function(e){return"Weekly"===e},children:Object(gn.jsx)(Jc,{name:"Day of The Week",children:Object(gn.jsx)(ai,{settingKey:"settings-radarr-full_update_day",options:qi})})}),Object(gn.jsx)(Vc.Content,{on:function(e){return"Daily"===e||"Weekly"===e},children:Object(gn.jsx)(Jc,{name:"Time of The Day",children:Object(gn.jsx)(ai,{settingKey:"settings-radarr-full_update_hour",options:e})})})]})]}),Object(gn.jsxs)(Xc,{header:"Search and Upgrade Subtitles",children:[Object(gn.jsx)(Jc,{name:"Search for Missing Series Subtitles",children:Object(gn.jsx)(ai,{settingKey:"settings-general-wanted_search_frequency",options:Wi})}),Object(gn.jsx)(Jc,{name:"Search for Missing Movies Subtitles",children:Object(gn.jsx)(ai,{options:Wi,settingKey:"settings-general-wanted_search_frequency_movie"})}),Object(gn.jsx)(Jc,{name:"Upgrade Previously Downloaded Subtitles",children:Object(gn.jsx)(ai,{options:Wi,settingKey:"settings-general-upgrade_frequency"})})]})]})},Vi=[{label:"Standard",value:"standard"},{label:"Anime",value:"anime"},{label:"Daily",value:"daily"}],Qi=function(){var e=Object(a.useCallback)((function(e){var t,n;return null!==(t=null===(n=e.sonarr.base_url)||void 0===n?void 0:n.slice(1))&&void 0!==t?t:""}),[]);return Object(gn.jsx)(Lc,{title:"Sonarr - Bazarr (Settings)",children:Object(gn.jsxs)(Vc,{children:[Object(gn.jsx)(Vc.Control,{children:Object(gn.jsx)(Xc,{header:"Use Sonarr",children:Object(gn.jsx)(Jc,{children:Object(gn.jsx)(ni,{label:"Enabled",settingKey:Dc})})})}),Object(gn.jsxs)(Vc.Content,{indent:!1,children:[Object(gn.jsxs)(Xc,{header:"Host",children:[Object(gn.jsxs)(Jc,{name:"Address",children:[Object(gn.jsx)(ti,{settingKey:"settings-sonarr-ip"}),Object(gn.jsx)(ei,{children:"Hostname or IPv4 Address"})]}),Object(gn.jsx)(Jc,{name:"Port",children:Object(gn.jsx)(ti,{settingKey:"settings-sonarr-port"})}),Object(gn.jsx)(Jc,{name:"Base URL",children:Object(gn.jsxs)(mr.a,{children:[Object(gn.jsx)(mr.a.Prepend,{children:Object(gn.jsx)(mr.a.Text,{children:"/"})}),Object(gn.jsx)(ti,{settingKey:"settings-sonarr-base_url",override:e,beforeStaged:function(e){return"/"+e}})]})}),Object(gn.jsx)(Jc,{name:"API Key",children:Object(gn.jsx)(ti,{settingKey:"settings-sonarr-apikey"})}),Object(gn.jsx)(Jc,{children:Object(gn.jsx)(ni,{label:"SSL",settingKey:"settings-sonarr-ssl"})}),Object(gn.jsx)(Jc,{children:Object(gn.jsx)(oi,{category:"sonarr"})})]}),Object(gn.jsxs)(Xc,{header:"Options",children:[Object(gn.jsx)(Jc,{name:"Minimum Score",children:Object(gn.jsx)(ci,{settingKey:"settings-general-minimum_score"})}),Object(gn.jsxs)(Jc,{name:"Excluded Tags",children:[Object(gn.jsx)(ii,{settingKey:"settings-sonarr-excluded_tags"}),Object(gn.jsx)(ei,{children:"Episodes from series with those tags (case sensitive) in Sonarr will be excluded from automatic download of subtitles."})]}),Object(gn.jsxs)(Jc,{name:"Excluded Series Types",children:[Object(gn.jsx)(ai,{settingKey:"settings-sonarr-excluded_series_types",multiple:!0,options:Vi}),Object(gn.jsx)(ei,{children:"Episodes from series with those types in Sonarr will be excluded from automatic download of subtitles."})]}),Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{label:"Download Only Monitored",settingKey:"settings-sonarr-only_monitored"}),Object(gn.jsx)(ei,{children:"Automatic download of subtitles will only happen for monitored episodes in Sonarr."})]})]}),Object(gn.jsx)(Xc,{header:"Path Mappings",children:Object(gn.jsx)(Li,{type:"sonarr"})})]})]})})},Xi=[{label:"AlongSide Media File",value:"current"},{label:"Relative Path to Media File",value:"relative"},{label:"Absolute Path",value:"absolute"}],Ji=[{label:"Anti-Captcha",value:"anti-captcha"},{label:"Death by Captcha",value:"death-by-captcha"}];function Zi(e){return"color(name=".concat(e,")")}var $i=[{label:"White",value:Zi("white")},{label:"Light Gray",value:Zi("lightgray")},{label:"Red",value:Zi("red")},{label:"Green",value:Zi("green")},{label:"Yellow",value:Zi("yellow")},{label:"Blue",value:Zi("blue")},{label:"Magenta",value:Zi("magenta")},{label:"Cyan",value:Zi("cyan")},{label:"Black",value:Zi("black")},{label:"Dark Red",value:Zi("darkred")},{label:"Dark Green",value:Zi("darkgreen")},{label:"Dark Yellow",value:Zi("darkyellow")},{label:"Dark Blue",value:Zi("darkblue")},{label:"Dark Magenta",value:Zi("darkmagenta")},{label:"Dark Cyan",value:Zi("darkcyan")},{label:"Dark Grey",value:Zi("darkgrey")}],es=function(e){return function(t){var n,r;return null!==(n=null===(r=t.general.subzero_mods)||void 0===r?void 0:r.includes(e))&&void 0!==n&&n}},ts=function(e){var t,n;return null!==(t=null===(n=e.general.subzero_mods)||void 0===n?void 0:n.find((function(e){return e.startsWith("color")})))&&void 0!==t?t:null},ns=function(){return Object(gn.jsxs)(Lc,{title:"Subtitles - Bazarr (Settings)",children:[Object(gn.jsxs)(Xc,{header:"Subtitles Options",children:[Object(gn.jsxs)(Vc,{children:[Object(gn.jsx)(Vc.Control,{children:Object(gn.jsxs)(Jc,{name:"Subtitle Folder",children:[Object(gn.jsx)(ai,{options:Xi,settingKey:"settings-general-subfolder"}),Object(gn.jsx)(ei,{children:"Choose the folder you wish to store/read the subtitles"})]})}),Object(gn.jsx)(Vc.Content,{on:function(e){return""!==e&&"current"!==e},children:Object(gn.jsx)(Jc,{name:"Custom Subtitles Folder",children:Object(gn.jsx)(ti,{settingKey:"settings-general-subfolder_custom"})})})]}),Object(gn.jsxs)(Vc,{children:[Object(gn.jsx)(Vc.Control,{children:Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{label:"Upgrade Previously Downloaded Subtitles",settingKey:"settings-general-upgrade_subs"}),Object(gn.jsx)(ei,{children:"Schedule a task to upgrade subtitles previously downloaded by Bazarr."})]})}),Object(gn.jsxs)(Vc.Content,{children:[Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ci,{settingKey:"settings-general-days_to_upgrade_subs",max:30}),Object(gn.jsx)(ei,{children:"Number of days to go back in history to upgrade subtitles"})]}),Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{label:"Upgrade Manually Downloaded or Translated Subtitles",settingKey:"settings-general-upgrade_manual"}),Object(gn.jsx)(ei,{children:"Enable or disable upgrade of manually downloaded or translated subtitles."})]})]})]})]}),Object(gn.jsx)(Xc,{header:"Anti-Captcha Options",children:Object(gn.jsxs)(Vc,{children:[Object(gn.jsx)(Vc.Control,{children:Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ai,{clearable:!0,settingKey:"settings-general-anti_captcha_provider",beforeStaged:function(e){return void 0===e?"None":e},options:Ji}),Object(gn.jsx)(ei,{children:"Choose the anti-captcha provider you want to use"})]})}),Object(gn.jsxs)(Vc.Content,{eventKey:"anti-captcha",children:[Object(gn.jsx)(Jc,{children:Object(gn.jsx)("a",{href:"http://getcaptchasolution.com/eixxo1rsnw",children:"Anti-Captcha.com"})}),Object(gn.jsx)(Jc,{name:"Account Key",children:Object(gn.jsx)(ti,{settingKey:"settings-anticaptcha-anti_captcha_key"})})]}),Object(gn.jsxs)(Vc.Content,{eventKey:"death-by-captcha",children:[Object(gn.jsx)(Jc,{children:Object(gn.jsx)("a",{href:"https://www.deathbycaptcha.com",children:"DeathByCaptcha.com"})}),Object(gn.jsx)(Jc,{name:"Username",children:Object(gn.jsx)(ti,{settingKey:"settings-deathbycaptcha-username"})}),Object(gn.jsx)(Jc,{name:"Password",children:Object(gn.jsx)(ti,{password:!0,settingKey:"settings-deathbycaptcha-password"})})]})]})}),Object(gn.jsxs)(Xc,{header:"Performance / Optimization",children:[Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{label:"Adaptive Searching",settingKey:"settings-general-adaptive_searching"}),Object(gn.jsx)(ei,{children:"When searching for subtitles, Bazarr will search less frequently to limit call to providers."})]}),Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{label:"Search Enabled Providers Simultaneously",settingKey:"settings-general-multithreading"}),Object(gn.jsx)(ei,{children:"Search multiple providers at once (Don't choose this on low powered devices)"})]}),Object(gn.jsxs)(Vc,{children:[Object(gn.jsx)(Vc.Control,{children:Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{label:"Use Embedded Subtitles",settingKey:"settings-general-use_embedded_subs"}),Object(gn.jsx)(ei,{children:"Use embedded subtitles in media files when determining missing ones."})]})}),Object(gn.jsxs)(Vc.Content,{children:[Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{label:"Ignore Embedded PGS Subtitles",settingKey:"settings-general-ignore_pgs_subs"}),Object(gn.jsx)(ei,{children:"Ignores PGS Subtitles in Embedded Subtitles detection."})]}),Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{label:"Ignore Embedded VobSub Subtitles",settingKey:"settings-general-ignore_vobsub_subs"}),Object(gn.jsx)(ei,{children:"Ignores VobSub Subtitles in Embedded Subtitles detection."})]}),Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{label:"Show Only Desired Languages",settingKey:"settings-general-embedded_subs_show_desired"}),Object(gn.jsx)(ei,{children:"Hide embedded subtitles for languages that are not currently desired."})]})]})]})]}),Object(gn.jsxs)(Xc,{header:"Post-Processing",children:[Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{label:"Encode Subtitles To UTF8",settingKey:"settings-general-utf8_encode"}),Object(gn.jsx)(ei,{children:"Re-encode downloaded Subtitles to UTF8. Should be left enabled in most case."})]}),Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{label:"Hearing Impaired",override:es("remove_HI"),settingKey:"subzero-remove_HI"}),Object(gn.jsx)(ei,{children:"Removes tags, text and characters from subtitles that are meant for hearing impaired people."})]}),Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{label:"Remove Tags",override:es("remove_tags"),settingKey:"subzero-remove_tags"}),Object(gn.jsx)(ei,{children:"Removes all possible style tags from the subtitle, such as font, bold, color etc."})]}),Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{label:"OCR Fixes",override:es("OCR_fixes"),settingKey:"subzero-OCR_fixes"}),Object(gn.jsx)(ei,{children:"Fix issues that happen when a subtitle gets converted from bitmap to text through OCR."})]}),Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{label:"Common Fixes",override:es("common"),settingKey:"subzero-common"}),Object(gn.jsx)(ei,{children:"Fix common and whitespace/punctuation issues in subtitles."})]}),Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{label:"Fix Uppercase",override:es("fix_uppercase"),settingKey:"subzero-fix_uppercase"}),Object(gn.jsx)(ei,{children:"Tries to make subtitles that are completely uppercase readable."})]}),Object(gn.jsxs)(Jc,{name:"Color",children:[Object(gn.jsx)(ai,{clearable:!0,options:$i,override:ts,settingKey:"subzero-color"}),Object(gn.jsx)(ei,{children:"Adds color to your subtitles (for playback devices/software that don't ship their own color modes; only works for players that support color tags)."})]}),Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{label:"Reverse RTL",override:es("reverse_rtl"),settingKey:"subzero-reverse_rtl"}),Object(gn.jsx)(ei,{children:"Reverses the punctuation in right-to-left subtitles for problematic playback devices."})]}),Object(gn.jsxs)(Vc,{children:[Object(gn.jsx)(Vc.Control,{children:Object(gn.jsx)(Jc,{children:Object(gn.jsx)(ni,{label:"Permission (chmod)",settingKey:"settings-general-chmod_enabled"})})}),Object(gn.jsx)(Vc.Content,{children:Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ti,{placeholder:"0777",settingKey:"settings-general-chmod"}),Object(gn.jsx)(ei,{children:"Must be 4 digit octal"})]})})]}),Object(gn.jsxs)(Vc,{children:[Object(gn.jsx)(Vc.Control,{children:Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{label:"Automatic Subtitles Synchronization",settingKey:"settings-subsync-use_subsync"}),Object(gn.jsx)(ei,{children:"Enable the automatic subtitles synchronization after downloading a subtitles."})]})}),Object(gn.jsxs)(Vc.Content,{children:[Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{label:"Debug",settingKey:"settings-subsync-debug"}),Object(gn.jsx)(ei,{children:"Do not actually sync the subtitles but generate a .tar.gz file to be able to open an issue for ffsubsync. This file will reside alongside the media file."})]}),Object(gn.jsxs)(Vc,{children:[Object(gn.jsx)(Vc.Control,{children:Object(gn.jsx)(Jc,{children:Object(gn.jsx)(ni,{label:"Series Score Threshold",settingKey:"settings-subsync-use_subsync_threshold"})})}),Object(gn.jsx)(Vc.Content,{indent:!1,children:Object(gn.jsx)(Jc,{children:Object(gn.jsx)(ci,{settingKey:"settings-subsync-subsync_threshold"})})})]}),Object(gn.jsxs)(Vc,{children:[Object(gn.jsx)(Vc.Control,{children:Object(gn.jsx)(Jc,{children:Object(gn.jsx)(ni,{label:"Movies Score Threshold",settingKey:"settings-subsync-use_subsync_movie_threshold"})})}),Object(gn.jsx)(Vc.Content,{indent:!1,children:Object(gn.jsx)(Jc,{children:Object(gn.jsx)(ci,{settingKey:"settings-subsync-subsync_movie_threshold"})})})]})]})]}),Object(gn.jsxs)(Vc,{children:[Object(gn.jsx)(Vc.Control,{children:Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{settingKey:"settings-general-use_postprocessing",label:"Custom Post-Processing"}),Object(gn.jsx)(ei,{children:"Enable the post-processing execution after downloading a subtitles."})]})}),Object(gn.jsxs)(Vc.Content,{children:[Object(gn.jsxs)(Vc,{children:[Object(gn.jsx)(Vc.Control,{children:Object(gn.jsx)(Jc,{children:Object(gn.jsx)(ni,{settingKey:"settings-general-use_postprocessing_threshold",label:"Series Score Threshold"})})}),Object(gn.jsx)(Vc.Content,{indent:!1,children:Object(gn.jsx)(Jc,{children:Object(gn.jsx)(ci,{settingKey:"settings-general-postprocessing_threshold"})})})]}),Object(gn.jsxs)(Vc,{children:[Object(gn.jsx)(Vc.Control,{children:Object(gn.jsx)(Jc,{children:Object(gn.jsx)(ni,{settingKey:"settings-general-use_postprocessing_threshold_movie",label:"Movies Score Threshold"})})}),Object(gn.jsx)(Vc.Content,{indent:!1,children:Object(gn.jsx)(Jc,{children:Object(gn.jsx)(ci,{settingKey:"settings-general-postprocessing_threshold_movie"})})})]}),Object(gn.jsx)(Jc,{name:"Command",children:Object(gn.jsx)(ti,{settingKey:"settings-general-postprocessing_cmd"})}),Object(gn.jsx)(ei,{children:"Variables you can use in your command"}),Object(gn.jsxs)(ei,{children:[Object(gn.jsx)("b",{children:"{{directory}}"})," Full path of the episode file parent directory"]}),Object(gn.jsxs)(ei,{children:[Object(gn.jsx)("b",{children:"{{episode}}"})," Full path of the episode file"]}),Object(gn.jsxs)(ei,{children:[Object(gn.jsx)("b",{children:"{{episode_name}}"})," Filename of the episode without parent directory or extension"]}),Object(gn.jsxs)(ei,{children:[Object(gn.jsx)("b",{children:"{{subtitles}}"})," Full path of the subtitles file"]}),Object(gn.jsxs)(ei,{children:[Object(gn.jsx)("b",{children:"{{subtitles_language}}"})," Language of the subtitles file"]}),Object(gn.jsxs)(ei,{children:[Object(gn.jsx)("b",{children:"{{subtitles_language_code2}}"})," 2-letter ISO-639 language code of the subtitles language"]}),Object(gn.jsxs)(ei,{children:[Object(gn.jsx)("b",{children:"{{subtitles_language_code3}}"})," 3-letter ISO-639 language code of the subtitles language"]}),Object(gn.jsxs)(ei,{children:[Object(gn.jsx)("b",{children:"{{episode_language}}"})," Audio language of the episode file"]}),Object(gn.jsxs)(ei,{children:[Object(gn.jsx)("b",{children:"{{episode_language_code2}}"})," 2-letter ISO-639 language code of the episode audio language"]}),Object(gn.jsxs)(ei,{children:[Object(gn.jsx)("b",{children:"{{episode_language_code3}}"})," 3-letter ISO-639 language code of the episode audio language"]}),Object(gn.jsxs)(ei,{children:[Object(gn.jsx)("b",{children:"{{score}}"})," Score of the subtitle file"]}),Object(gn.jsxs)(ei,{children:[Object(gn.jsx)("b",{children:"{{subtitle_id}}"})," Provider ID of the subtitle file"]}),Object(gn.jsxs)(ei,{children:[Object(gn.jsx)("b",{children:"{{series_id}}"})," Sonarr series ID (Empty if movie)"]}),Object(gn.jsxs)(ei,{children:[Object(gn.jsx)("b",{children:"{{episode_id}}"})," Sonarr episode ID or Radarr movie ID"]})]})]})]})]})},rs=[{label:"25",value:25},{label:"50",value:50},{label:"100",value:100},{label:"250",value:250},{label:"500",value:500},{label:"1000",value:1e3}],as=function(){return Object(gn.jsx)(Lc,{title:"Interface - Bazarr (Settings)",children:Object(gn.jsx)(Xc,{header:"UI",children:Object(gn.jsx)(Jc,{name:"Page Size",children:Object(gn.jsx)(ai,{options:rs,settingKey:ve,override:function(e,t){return t.site.pageSize}})})})})},cs=function(){return ce(Xt(qe)),Object(gn.jsxs)(l.e,{children:[Object(gn.jsx)(l.c,{exact:!0,path:"/settings",children:Object(gn.jsx)(l.b,{exact:!0,to:"/settings/general"})}),Object(gn.jsx)(l.c,{exact:!0,path:"/settings/general",children:Object(gn.jsx)(hi,{})}),Object(gn.jsx)(l.c,{exact:!0,path:"/settings/ui",children:Object(gn.jsx)(as,{})}),Object(gn.jsx)(l.c,{exact:!0,path:"/settings/sonarr",children:Object(gn.jsx)(Qi,{})}),Object(gn.jsx)(l.c,{exact:!0,path:"/settings/radarr",children:Object(gn.jsx)(_i,{})}),Object(gn.jsx)(l.c,{exact:!0,path:"/settings/languages",children:Object(gn.jsx)(Ni,{})}),Object(gn.jsx)(l.c,{exact:!0,path:"/settings/subtitles",children:Object(gn.jsx)(ns,{})}),Object(gn.jsx)(l.c,{exact:!0,path:"/settings/scheduler",children:Object(gn.jsx)(Yi,{})}),Object(gn.jsx)(l.c,{exact:!0,path:"/settings/providers",children:Object(gn.jsx)(Ri,{})}),Object(gn.jsx)(l.c,{exact:!0,path:"/settings/notifications",children:Object(gn.jsx)(Ti,{})}),Object(gn.jsx)(l.c,{path:"/settings/*",children:Object(gn.jsx)(l.b,{to:_a})})]})},is=function(e){var t=Object.assign({},e),n=lr(t.modalKey),r=Object(a.useMemo)((function(){return null===n||void 0===n?void 0:n.split("\\n").map((function(e,t){return Object(gn.jsx)("p",{className:"text-nowrap my-1",children:e},t)}))}),[n]);return Object(gn.jsx)(jr,Object(f.a)(Object(f.a)({title:"Stack traceback"},t),{},{children:Object(gn.jsx)("pre",{children:Object(gn.jsx)("code",{className:"zmdi-language-python-alt",children:r})})}))};function ss(e){switch(e){case"DEBUG":return fn.n;case"ERROR":return fn.f;case"INFO":return fn.A;case"WARNING":return fn.s;default:return fn.N}}var os=function(e){var t=e.logs,n=cr(),r=Object(a.useCallback)((function(e,t){return n("system-log",t)}),[n]),i=Object(a.useMemo)((function(){return[{accessor:"type",Cell:function(e){return Object(gn.jsx)(pn.a,{icon:ss(e.value)})}},{Header:"Message",accessor:"message"},{Header:"Date",accessor:"timestamp",className:"text-nowrap"},{accessor:"exception",Cell:function(e){var t=e.row,n=e.value,r=e.externalUpdate;return Object(Z.isUndefined)(n)?null:Object(gn.jsx)(Vn,{icon:fn.D,onClick:function(){return r&&r(t,n)}})}}]}),[]);return Object(gn.jsxs)(c.a.Fragment,{children:[Object(gn.jsx)(la,{columns:i,data:t,externalUpdate:r}),Object(gn.jsx)(is,{size:"xl",modalKey:"system-log"})]})},ls=function(){var e=Qt((function(e){return e.system.logs})),t=Xt(Fe);ce(t);var n=Object(a.useState)(!1),r=Object(J.a)(n,2),c=r[0],i=r[1],s=re(!0),o=Object(a.useCallback)((function(){window.open("".concat(s,"bazarr.log"))}),[s]);return Object(gn.jsx)(Un,{state:e,children:function(n){return Object(gn.jsxs)(yn.a,{fluid:!0,children:[Object(gn.jsx)(Ua.a,{children:Object(gn.jsx)("title",{children:"Logs - Bazarr (System)"})}),Object(gn.jsxs)($n,{children:[Object(gn.jsx)($n.Button,{updating:e.updating,icon:fn.U,onClick:t,children:"Refresh"}),Object(gn.jsx)($n.Button,{icon:fn.q,onClick:o,children:"Download"}),Object(gn.jsx)($n.Button,{updating:c,icon:fn.Z,onClick:function(){i(!0),Rt.deleteLogs().finally((function(){i(!1),t()}))},children:"Empty"})]}),Object(gn.jsx)(Vt.a,{children:Object(gn.jsx)(os,{logs:n})})]})}})},us=function(e){var t=Object(a.useMemo)((function(){return[{Header:"Name",accessor:"name"},{Header:"Status",accessor:"status"},{Header:"Next Retry",accessor:"retry"}]}),[]);return Object(gn.jsx)(ea,{columns:t,data:e.providers})},ds=function(){var e=dn(),t=Object(J.a)(e,2),n=t[0],r=t[1];return ce(r),Object(gn.jsx)(Un,{state:n,children:function(e){return Object(gn.jsxs)(yn.a,{fluid:!0,children:[Object(gn.jsx)(Ua.a,{children:Object(gn.jsx)("title",{children:"Providers - Bazarr (System)"})}),Object(gn.jsxs)($n,{children:[Object(gn.jsx)($n.Button,{updating:n.updating,icon:fn.U,onClick:r,children:"Refresh"}),Object(gn.jsx)($n.AsyncButton,{icon:fn.Z,promise:function(){return Bt.reset()},onSuccess:r,children:"Reset"})]}),Object(gn.jsx)(Vt.a,{children:Object(gn.jsx)(us,{providers:e})})]})}})},js="mr-2",bs=function(e){var t=e.name,n=e.body,r=e.date,c=e.prerelease,i=e.current,s=Object(a.useMemo)((function(){return n.map((function(e){return e.replace(/(\s\[.*?\])\(.*?\)/,"")}))}),[n]);return Object(gn.jsxs)(Qc.a,{className:"mb-4 mx-3 d-flex flex-grow-1",children:[Object(gn.jsxs)(Qc.a.Header,{children:[Object(gn.jsx)("span",{className:js,children:t}),Object(gn.jsx)(Wn.a,{className:js,variant:"info",children:r}),Object(gn.jsx)(Wn.a,{className:js,variant:c?"danger":"success",children:c?"Development":"Master"}),Object(gn.jsx)(Wn.a,{className:js,hidden:!i,variant:"primary",children:"Installed"})]}),Object(gn.jsx)(Qc.a.Body,{children:Object(gn.jsxs)(Qc.a.Text,{children:["From newest to oldest:",s.map((function(e,t){return Object(gn.jsx)("li",{children:e},t)}))]})})]})},Os=function(){var e=Qt((function(e){return e.system.releases}));return ce(Xt(Ge)),Object(gn.jsx)(Un,{state:e,children:function(e){return Object(gn.jsxs)(yn.a,{fluid:!0,className:"px-5 py-4 bg-light",children:[Object(gn.jsx)(Ua.a,{children:Object(gn.jsx)("title",{children:"Releases - Bazarr (System)"})}),Object(gn.jsx)(Vt.a,{children:e.map((function(e,t){return Object(gn.jsx)(sa.a,{xs:12,children:Object(gn.jsx)(bs,Object(f.a)({},e))},de(t,e.date))}))})]})}})},hs=n(178);function fs(e){var t=e.title,n=e.children;return Object(gn.jsxs)(Vt.a,{children:[Object(gn.jsx)(sa.a,{sm:4,children:Object(gn.jsx)("b",{children:t})}),Object(gn.jsx)(sa.a,{children:n})]})}function ps(e){var t=e.icon,n=e.link,r=e.children;return Object(gn.jsxs)(c.a.Fragment,{children:[Object(gn.jsx)(pn.a,{icon:t,style:{width:"2rem"}}),Object(gn.jsx)("a",{href:n,target:"_blank",rel:"noopener noreferrer",children:r})]})}var xs=function(e){var t=e.title,n=e.children;return Object(gn.jsxs)(yn.a,{className:"py-3",children:[Object(gn.jsx)("h4",{children:t}),Object(gn.jsx)("hr",{}),n]})},vs=function(){var e=Qt((function(e){return e.system.status.data}));return ce(Xt(Le)),Object(gn.jsxs)(yn.a,{className:"p-5",children:[Object(gn.jsx)(Ua.a,{children:Object(gn.jsx)("title",{children:"Status - Bazarr (System)"})}),Object(gn.jsx)(Vt.a,{children:Object(gn.jsxs)(xs,{title:"About",children:[Object(gn.jsx)(fs,{title:"Bazarr Version",children:Object(gn.jsx)("span",{children:null===e||void 0===e?void 0:e.bazarr_version})}),Object(gn.jsx)(fs,{title:"Sonarr Version",children:Object(gn.jsx)("span",{children:null===e||void 0===e?void 0:e.sonarr_version})}),Object(gn.jsx)(fs,{title:"Radarr Version",children:Object(gn.jsx)("span",{children:null===e||void 0===e?void 0:e.radarr_version})}),Object(gn.jsx)(fs,{title:"Operating System",children:Object(gn.jsx)("span",{children:null===e||void 0===e?void 0:e.operating_system})}),Object(gn.jsx)(fs,{title:"Python Version",children:Object(gn.jsx)("span",{children:null===e||void 0===e?void 0:e.python_version})}),Object(gn.jsx)(fs,{title:"Bazarr Directory",children:Object(gn.jsx)("span",{children:null===e||void 0===e?void 0:e.bazarr_directory})}),Object(gn.jsx)(fs,{title:"Bazarr Config Directory",children:Object(gn.jsx)("span",{children:null===e||void 0===e?void 0:e.bazarr_config_directory})})]})}),Object(gn.jsx)(Vt.a,{children:Object(gn.jsxs)(xs,{title:"More Info",children:[Object(gn.jsx)(fs,{title:"Home Page",children:Object(gn.jsx)(ps,{icon:fn.K,link:"https://www.bazarr.media/",children:"Bazarr Website"})}),Object(gn.jsx)(fs,{title:"Source",children:Object(gn.jsx)(ps,{icon:hs.b,link:Ta,children:"Bazarr on Github"})}),Object(gn.jsx)(fs,{title:"Wiki",children:Object(gn.jsx)(ps,{icon:hs.c,link:"https://wiki.bazarr.media",children:"Bazarr Wiki"})}),Object(gn.jsx)(fs,{title:"Discord",children:Object(gn.jsx)(ps,{icon:hs.a,link:"https://discord.gg/MH2e2eb",children:"Bazarr on Discord"})})]})})]})},ms=function(e){var t=e.tasks,n=Xt(He),r=Object(a.useMemo)((function(){return[{Header:"Name",accessor:"name",className:"text-nowrap"},{Header:"Interval",accessor:"interval",className:"text-nowrap"},{Header:"Next Execution",accessor:"next_run_in",className:"text-nowrap"},{accessor:"job_running",Cell:function(e){var t=e.row.original.job_id;return Object(gn.jsx)(qn,{promise:function(){return Rt.runTask(t)},onSuccess:function(){return n(t)},variant:"light",size:"sm",disabled:e.value,children:Object(gn.jsx)(pn.a,{icon:fn.U,spin:e.value})})}}]}),[n]);return Object(gn.jsx)(ea,{columns:r,data:t})},gs=function(){var e=Qt((function(e){return e.system.tasks})),t=Xt(_e);return ce(t,1e4),Object(gn.jsx)(Un,{state:e,children:function(n){return Object(gn.jsxs)(yn.a,{fluid:!0,children:[Object(gn.jsx)(Ua.a,{children:Object(gn.jsx)("title",{children:"Tasks - Bazarr (System)"})}),Object(gn.jsx)($n,{children:Object(gn.jsx)($n.Button,{updating:e.updating,icon:fn.U,onClick:t,children:"Refresh"})}),Object(gn.jsx)(Vt.a,{children:Object(gn.jsx)(ms,{tasks:n})})]})}})},ys=function(){return Object(gn.jsxs)(l.e,{children:[Object(gn.jsx)(l.c,{exact:!0,path:"/system/tasks",children:Object(gn.jsx)(gs,{})}),Object(gn.jsx)(l.c,{exact:!0,path:"/system/status",children:Object(gn.jsx)(vs,{})}),Object(gn.jsx)(l.c,{exact:!0,path:"/system/providers",children:Object(gn.jsx)(ds,{})}),Object(gn.jsx)(l.c,{exact:!0,path:"/system/logs",children:Object(gn.jsx)(ls,{})}),Object(gn.jsx)(l.c,{exact:!0,path:"/system/releases",children:Object(gn.jsx)(Os,{})}),Object(gn.jsx)(l.c,{path:"/system/*",children:Object(gn.jsx)(l.b,{to:_a})})]})},ks=function(e){var t=e.type,n=e.columns,r=e.state,c=e.update,i=e.loader,s=e.searchAll,o=Object(Z.capitalize)(t),l=Object(a.useMemo)((function(){return le(r.data)}),[r.data]),u=Object(a.useCallback)((function(e,t){c(t)}),[c]);return Object(gn.jsxs)(yn.a,{fluid:!0,children:[Object(gn.jsx)(Ua.a,{children:Object(gn.jsxs)("title",{children:["Wanted ",o," - Bazarr"]})}),Object(gn.jsx)($n,{children:Object(gn.jsx)($n.AsyncButton,{disabled:0===l.length,promise:s,onSuccess:c,icon:fn.R,children:"Search All"})}),Object(gn.jsx)(Vt.a,{children:Object(gn.jsx)(la,{async:!0,asyncState:r,asyncId:oe,asyncLoader:i,emptyText:"No Missing ".concat(o," Subtitles"),columns:n,externalUpdate:u,data:l})})]})},ws=function(){var e=function(){var e=Xt(it);return Zt(Qt((function(e){return e.movie.wantedMovieList})),e)}(),t=Object(J.a)(e,2),n=t[0],r=t[1],c=Xt(ct),i=Object(a.useCallback)((function(){return Kt.action({action:"search-wanted"})}),[]),s=Object(a.useMemo)((function(){return[{Header:"Name",accessor:"title",Cell:function(e){var t="/movies/".concat(e.row.original.radarrId);return Object(gn.jsx)(u.b,{to:t,children:Object(gn.jsx)("span",{children:e.value})})}},{Header:"Missing",accessor:"missing_subtitles",Cell:function(e){var t=e.row,n=e.value,r=e.externalUpdate,a=t.original,c=a.hearing_impaired,i=a.radarrId;return n.map((function(e,n){return Object(gn.jsxs)(qn,{as:Wn.a,className:"mx-1 mr-2",variant:"secondary",promise:function(){return Kt.downloadSubtitles(i,{language:e.code2,hi:c,forced:!1})},onSuccess:function(){return r&&r(t,i)},children:[Object(gn.jsx)(ba,{className:"pr-1",text:e}),Object(gn.jsx)(pn.a,{size:"sm",icon:fn.R})]},de(n,e.code2))}))}}]}),[]);return Object(gn.jsx)(ks,{type:"movies",columns:s,state:n,update:r,loader:c,searchAll:i})},Ss=function(){var e=function(){var e=Xt(vt);return Zt(Qt((function(e){return e.series.wantedEpisodesList})),e)}(),t=Object(J.a)(e,2),n=t[0],r=t[1],c=Xt(xt),i=Object(a.useCallback)((function(){return Dt.action({action:"search-wanted"})}),[]),s=Object(a.useMemo)((function(){return[{Header:"Name",accessor:"seriesTitle",Cell:function(e){var t="/series/".concat(e.row.original.sonarrSeriesId);return Object(gn.jsx)(u.b,{to:t,children:Object(gn.jsx)("span",{children:e.value})})}},{Header:"Episode",accessor:"episode_number"},{accessor:"episodeTitle"},{Header:"Missing",accessor:"missing_subtitles",Cell:function(e){var t=e.row,n=e.externalUpdate,r=e.value,a=t.original,c=a.hearing_impaired,i=a.sonarrSeriesId,s=a.sonarrEpisodeId;return r.map((function(e,r){return Object(gn.jsxs)(qn,{as:Wn.a,className:"mx-1 mr-2",variant:"secondary",promise:function(){return Tt.downloadSubtitles(i,s,{language:e.code2,hi:c,forced:!1})},onSuccess:function(){return n&&n(t,s)},children:[Object(gn.jsx)(ba,{className:"pr-1",text:e}),Object(gn.jsx)(pn.a,{size:"sm",icon:fn.R})]},de(r,e.code2))}))}}]}),[]);return Object(gn.jsx)(ks,{type:"series",columns:s,state:n,update:r,loader:c,searchAll:i})},Cs=function(){var e=bn(),t=On();return Object(gn.jsxs)(l.e,{children:[e&&Object(gn.jsx)(l.c,{exact:!0,path:"/wanted/series",children:Object(gn.jsx)(Ss,{})}),t&&Object(gn.jsx)(l.c,{exact:!0,path:"/wanted/movies",children:Object(gn.jsx)(ws,{})}),Object(gn.jsx)(l.c,{path:"/wanted/*",children:Object(gn.jsx)(l.b,{to:_a})})]})},Ns=function(e){var t=e.className,n=bn(),r=On(),c=Object(a.useMemo)((function(){return n?"/series":r?"/movies":"/settings"}),[n,r]),i=Object(l.h)();return Object(a.useEffect)((function(){be()}),[i.location]),Object(gn.jsx)("div",{className:t,children:Object(gn.jsxs)(l.e,{children:[Object(gn.jsx)(l.c,{exact:!0,path:"/",children:Object(gn.jsx)(l.b,{exact:!0,to:c})}),n&&Object(gn.jsx)(l.c,{path:"/series",children:Object(gn.jsx)(Ec,{})}),r&&Object(gn.jsx)(l.c,{path:"/movies",children:Object(gn.jsx)(Sc,{})}),Object(gn.jsx)(l.c,{path:"/wanted",children:Object(gn.jsx)(Cs,{})}),Object(gn.jsx)(l.c,{path:"/history",children:Object(gn.jsx)(dc,{})}),Object(gn.jsx)(l.c,{path:"/blacklist",children:Object(gn.jsx)(Ya,{})}),Object(gn.jsx)(l.c,{path:"/settings",children:Object(gn.jsx)(cs,{})}),Object(gn.jsx)(l.c,{path:"/system",children:Object(gn.jsx)(ys,{})}),Object(gn.jsx)(l.c,{exact:!0,path:_a,children:Object(gn.jsx)(Ha,{})}),Object(gn.jsx)(l.c,{path:"*",children:Object(gn.jsx)(l.b,{to:_a})})]})})},Is=c.a.createContext((function(){})),Ps=function(){var e=Xt(Ye),t=Qt((function(e){return e.site})),n=t.initialized,r=t.auth,c=jn("has-update",10),i=window.Bazarr.hasUpdate;Object(a.useEffect)((function(){n&&i&&c({type:"info",message:"A new version of Bazarr is ready, restart is required"})}),[n,i,c]),Object(a.useEffect)((function(){e()}),[e]);var s=Object(a.useState)(!1),o=Object(J.a)(s,2),u=o[0],d=o[1],j=Object(a.useCallback)((function(){return d(!u)}),[u]);if(!r)return Object(gn.jsx)(l.b,{to:"/login"});if("boolean"===typeof n&&!1===n)return Object(gn.jsx)(ja,{children:Object(gn.jsx)("span",{children:"Please wait"})});if("string"===typeof n)return Object(gn.jsx)(Aa,{children:n});try{return Object(gn.jsxs)(Is.Provider,{value:j,children:[Object(gn.jsx)(Vt.a,{noGutters:!0,className:"header-container",children:Object(gn.jsx)(Da,{})}),Object(gn.jsxs)(Vt.a,{noGutters:!0,className:"flex-nowrap",children:[Object(gn.jsx)(Pa,{open:u}),Object(gn.jsx)(dr,{children:Object(gn.jsx)(Ns,{className:"d-flex flex-row flex-grow-1 main-router"})})]}),Object(gn.jsx)(La,{})]})}catch(b){return Object(gn.jsx)(Ea,{error:b})}},As=(n(484),function(){var e=Object(a.useState)(""),t=Object(J.a)(e,2),n=t[0],r=t[1],c=Object(a.useState)(""),i=Object(J.a)(c,2),s=i[0],o=i[1],u=Object(a.useState)(""),d=Object(J.a)(u,2),j=d[0],b=d[1],O=Object(a.useState)(!1),h=Object(J.a)(O,2),f=h[0],p=h[1],x=Object(a.useCallback)((function(e){b(e),setTimeout((function(){return b("")}),2e3)}),[]),v=Object(a.useCallback)((function(){return window.location.reload()}),[]),m=Qt((function(e){return e.site.auth})),g=Object(a.useCallback)((function(){p(!1),x("Login Failed")}),[x]);return m?Object(gn.jsx)(l.b,{to:"/"}):Object(gn.jsx)("div",{className:"d-flex bg-light vh-100 justify-content-center align-items-center",children:Object(gn.jsx)(Qc.a,{className:"auth-card shadow",children:Object(gn.jsxs)(Pn.a,{onSubmit:function(e){e.preventDefault(),f||(p(!0),Rt.login(n,s).then(v).catch(g))},children:[Object(gn.jsxs)(Qc.a.Body,{children:[Object(gn.jsx)(Pn.a.Group,{className:"mb-5 d-flex justify-content-center",children:Object(gn.jsx)(ha.a,{width:"64",height:"64",src:"data:image/png;base64,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"})}),Object(gn.jsx)(Pn.a.Group,{children:Object(gn.jsx)(Pn.a.Control,{disabled:f,name:"username",type:"text",placeholder:"Username",required:!0,onChange:function(e){return r(e.currentTarget.value)}})}),Object(gn.jsx)(Pn.a.Group,{children:Object(gn.jsx)(Pn.a.Control,{disabled:f,name:"password",type:"password",placeholder:"Password",required:!0,onChange:function(e){return o(e.currentTarget.value)}})}),Object(gn.jsx)(va.a,{in:0!==j.length,children:Object(gn.jsx)("div",{children:Object(gn.jsx)(kn.a,{variant:"danger",className:"m-0",children:j})})})]}),Object(gn.jsx)(Qc.a.Footer,{children:Object(gn.jsx)(wn.a,{type:"submit",disabled:f,block:!0,children:f?Object(gn.jsx)(mn.a,{size:"sm",animation:"border"}):"LOGIN"})})]})})})}),Ts=function(){var e=re();return Object(gn.jsx)(u.a,{basename:e,children:Object(gn.jsxs)(l.e,{children:[Object(gn.jsx)(l.c,{exact:!0,path:"/login",children:Object(gn.jsx)(As,{})}),Object(gn.jsx)(l.c,{path:"/",children:Object(gn.jsx)(Ps,{})})]})})};s.a.render(Object(gn.jsx)(o.a,{store:Yt,children:Object(gn.jsx)(Ts,{})}),document.getElementById("root"))}},[[485,1,2]]]);
-//# sourceMappingURL=main.05a5c2ae.chunk.js.map
\ No newline at end of file
+(this.webpackJsonpbazarr=this.webpackJsonpbazarr||[]).push([[0],{330:function(e,t,n){},333:function(e,t,n){},335:function(e,t,n){},346:function(e,t,n){},347:function(e,t,n){},349:function(e,t,n){},350:function(e,t,n){},351:function(e,t,n){},482:function(e,t,n){},483:function(e,t,n){},484:function(e,t,n){},485:function(e,t,n){"use strict";n.r(t);n(300);var r,a=n(0),c=n.n(a),i=n(32),s=n.n(i),o=n(93),l=n(35),u=n(30),d=n(98),j=(n(309),n(263)),b=n.n(j),O=n(264),h=n(25),f=n(3),p=n(507),x="UPDATE_PROVIDER_LIST",v="UPDATE_ALL_LANGUAGES_LIST",m="UPDATE_LANGUAGES_PROFILE_LIST",g="UPDATE_SYSTEM_STATUS",y="UPDATE_SYSTEM_TASKS",k="UPDATE_SYSTEM_LOGS",w="SYSTEM_UPDATE_RELEASES",S="UPDATE_SYSTEM_SETTINGS",C="SYSTEM_RUN_TASK",N="SERIES_UPDATE_WANTED_RANGE",I="UPDATE_SERIES_WANTED_LIST",P="UPDATE_SERIES_EPISODE_LIST",A="UPDATE_SERIES_HISTORY_LIST",T="UPDATE_SEIRES_INFO",E="SERIES_UPDATE_RANGE",M="UPDATE_SERIES_BLACKLIST",K="MOVIES_UPDATE_WANTED_RANGE",B="UPDATE_MOVIE_WANTED_LIST",D="UPDATE_MOVIE_HISTORY_LIST",z="UPDATE_MOVIE_INFO",R="MOVIES_UPDATE_RANGE",L="UPDATE_MOVIES_BLACKLIST",_="SITE_NEED_AUTH",H="SITE_SYSTEM_INITIALIZED",U="SITE_INITIALIZE_FAILED",F="SITE_SAVE_LOCALSTORAGE",G="SITE_NOTIFICATIONS_ADD",q="SITE_NOTIFICATIONS_REMOVE",W="SITE_NOTIFICATIONS_REMOVE_BY_TIMESTAMP",Y="SITE_SIDEBAR_UPDATE",V="SITE_BADGE_UPDATE",Q="SITE_OFFLINE_UPDATE",X=n(22),J=n(5),Z=n(15);function $(e){return Object(Z.isString)(e)||Object(Z.isNumber)(e)}function ee(e){return Object(Z.isNull)(e)||Object(Z.isUndefined)(e)}function te(e){return!ee(e)}function ne(e){return"radarrId"in e}function re(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=null!==(e=window.Bazarr.baseUrl)&&void 0!==e?e:"/";return t&&!n.endsWith("/")&&(n+="/"),n}function ae(){var e=Object(l.h)();return Object(a.useCallback)((function(){return e.push("/")}),[e])}function ce(e,t){Object(a.useEffect)((function(){e();var n=null;return void 0!==t&&(n=setInterval(e,t)),function(){null!==n&&clearInterval(n)}}),[e,t])}function ie(e,t){return function(e,t,n,r){var c=Object(a.useState)(e),i=Object(J.a)(c,2)[1];Object(a.useEffect)((function(){i((function(a){return a!==e&&(e!==t?r&&r():n&&n()),e}))}),[e,t,r,n])}(e.updating,!0,void 0,t)}function se(e,t,n){t({updating:!0,data:n}),e.then((function(e){t({updating:!1,data:e})})).catch((function(e){t({updating:!1,error:e,data:n})}))}function oe(e){return ne(e)?e.radarrId:"sonarrEpisodeId"in e?e.sonarrEpisodeId:function(e){return"episodeFileCount"in e}(e)?e.sonarrSeriesId:-1}function le(e){var t=e.items;return e.order.flatMap((function(e){return null!==e&&e in t?[t[e]]:[]}))}function ue(e,t,n){var r=Object(X.a)(e);return t.filter((function(e){return!ee(e)})).forEach((function(e){var t=r.findIndex((function(t,r){return!ee(t)&&n(t,e)}));-1!==t?r[t]=e:r.push(e)})),r}function de(){for(var e=arguments.length,t=new Array(e),n=0;n0?(r=O).push.apply(r,Object(X.a)(Array(h).fill(null))):h<0&&(O=Array(s).fill(null),b=Object(f.a)({},d)),"number"===typeof l&&"number"===typeof u?(a=O).splice.apply(a,[l,u].concat(Object(X.a)(j))):void 0===l&&(O=j),{updating:!1,data:{items:b,order:O}}}var fe,pe=Object(p.a)((r={},Object(h.a)(r,B,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{wantedMovieList:he(t,e.wantedMovieList,"radarrId")})})),Object(h.a)(r,K,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{wantedMovieList:he(t,e.wantedMovieList,"radarrId")})})),Object(h.a)(r,D,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{historyList:Oe(t,e.historyList.data)})})),Object(h.a)(r,z,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{movieList:he(t,e.movieList,"radarrId")})})),Object(h.a)(r,R,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{movieList:he(t,e.movieList,"radarrId")})})),Object(h.a)(r,L,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{blacklist:Oe(t,e.blacklist.data)})})),r),{movieList:{updating:!0,data:{items:{},order:[]}},wantedMovieList:{updating:!0,data:{items:{},order:[]}},historyList:{updating:!0,data:[]},blacklist:{updating:!0,data:[]}}),xe=Object(p.a)((fe={},Object(h.a)(fe,I,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{wantedEpisodesList:he(t,e.wantedEpisodesList,"sonarrEpisodeId")})})),Object(h.a)(fe,N,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{wantedEpisodesList:he(t,e.wantedEpisodesList,"sonarrEpisodeId")})})),Object(h.a)(fe,P,(function(e,t){var n=Oe(t,[]),r=n.updating,a=n.error,c=n.data,i=Object(f.a)({},e.episodeList.data);c.length>0&&(i[c[0].sonarrSeriesId]=c);return Object(f.a)(Object(f.a)({},e),{},{episodeList:{updating:r,error:a,data:i}})})),Object(h.a)(fe,A,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{historyList:Oe(t,e.historyList.data)})})),Object(h.a)(fe,T,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{seriesList:he(t,e.seriesList,"sonarrSeriesId")})})),Object(h.a)(fe,E,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{seriesList:he(t,e.seriesList,"sonarrSeriesId")})})),Object(h.a)(fe,M,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{blacklist:Oe(t,e.blacklist.data)})})),fe),{seriesList:{updating:!0,data:{items:{},order:[]}},wantedEpisodesList:{updating:!0,data:{items:{},order:[]}},episodeList:{updating:!0,data:{}},historyList:{updating:!0,data:[]},blacklist:{updating:!0,data:[]}}),ve="storage-ui-pageSize",me={get pageSize(){var e;return parseInt(null!==(e=localStorage.getItem(ve))&&void 0!==e?e:"50")},set pageSize(e){localStorage.setItem(ve,e.toString())}},ge=n(44),ye=n(45),ke=n(211),we=n.n(ke);var Se=new Map,Ce=new Map;function Ne(e,t,n){return function(r){var a=Ce.get(t),c=new Date;if(Object(Z.isEqual)(a,n)){var i=Se.get(t);if(i)if(c.getTime()-i.getTime()<200)return Promise.resolve()}else Ce.set(t,n);return Se.set(t,c),r({type:e,payload:{loading:!0,parameters:n}}),new Promise((function(a,c){t.apply(void 0,Object(X.a)(n)).then((function(t){r({type:e,payload:{loading:!1,item:t,parameters:n}}),a()})).catch((function(t){r({type:e,error:!0,payload:{loading:!1,item:t,parameters:n}}),c(t)}))}))}}function Ie(e,t){return function(){for(var n=arguments.length,r=new Array(n),a=0;a0?r.forEach((function(e){return t.append(n,e)})):t.append(n,""):t.append(n,e[n])};for(var r in e)n(r);return{v:t}}();return"object"===typeof t?t.v:void 0}}},{key:"get",value:function(e,t){return _t.axios.get(this.prefix+e,{params:t})}},{key:"post",value:function(e,t,n){var r=this.createFormdata(t);return _t.axios.post(this.prefix+e,r,{params:n})}},{key:"patch",value:function(e,t,n){var r=this.createFormdata(t);return _t.axios.patch(this.prefix+e,r,{params:n})}},{key:"delete",value:function(e,t,n){var r=this.createFormdata(t);return _t.axios.delete(this.prefix+e,{params:n,data:r})}}]),e}(),Tt=new(function(e){Object(It.a)(n,e);var t=Object(Pt.a)(n);function n(){return Object(ge.a)(this,n),t.call(this,"/episodes")}return Object(ye.a)(n,[{key:"bySeriesId",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t){var n=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.get("",{seriesid:t}).then((function(t){e(t.data.data)})).catch((function(e){r(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"wanted",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t,n){var r=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,a){r.get("/wanted",{start:t,length:n}).then((function(t){e(t.data)})).catch((function(e){a(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"wantedBy",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t){var n=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.get("/wanted",{episodeid:t}).then((function(t){e(t.data)})).catch((function(e){r(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"byEpisodeId",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t){var n=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.get("",{episodeid:t}).then((function(t){e(t.data.data)})).catch((function(e){r(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"history",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t){var n=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.get("/history",{episodeid:t}).then((function(t){e(t.data.data)})).catch((function(e){r(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"downloadSubtitles",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t,n,r){var a=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,c){a.patch("/subtitles",r,{seriesid:t,episodeid:n}).then((function(){return e()})).catch(c)})));case 1:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}()},{key:"uploadSubtitles",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t,n,r){var a=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,c){a.post("/subtitles",r,{seriesid:t,episodeid:n}).then((function(){return e()})).catch(c)})));case 1:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}()},{key:"deleteSubtitles",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t,n,r){var a=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,c){a.delete("/subtitles",r,{seriesid:t,episodeid:n}).then((function(){return e()})).catch(c)})));case 1:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}()},{key:"blacklist",value:function(){var e=Object(Ct.a)(St.a.mark((function e(){var t=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){t.get("/blacklist").then((function(t){e(t.data.data)})).catch(n)})));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"addBlacklist",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t,n,r){var a=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,c){a.post("/blacklist",r,{seriesid:t,episodeid:n}).then((function(){return e()})).catch(c)})));case 1:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}()},{key:"deleteBlacklist",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t,n){var r=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,a){r.delete("/blacklist",n,{all:t}).then((function(){return e()})).catch(a)})));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()}]),n}(At)),Et=new(function(e){Object(It.a)(n,e);var t=Object(Pt.a)(n);function n(){return Object(ge.a)(this,n),t.call(this,"/files")}return Object(ye.a)(n,[{key:"browse",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t,n){var r=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,a){r.get(t,{path:n}).then((function(t){return e(t.data)})).catch(a)})));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"bazarr",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t){return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.browse("",t));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"sonarr",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t){return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.browse("/sonarr",t));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"radarr",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t){return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.browse("/radarr",t));case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),n}(At)),Mt=new(function(e){Object(It.a)(n,e);var t=Object(Pt.a)(n);function n(){return Object(ge.a)(this,n),t.call(this,"/history")}return Object(ye.a)(n,[{key:"stats",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t,n,r,a){var c=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,i){c.get("/stats",{timeframe:t,action:n,provider:r,language:a}).then((function(t){return e(t.data)})).catch(i)})));case 1:case"end":return e.stop()}}),e)})));return function(t,n,r,a){return e.apply(this,arguments)}}()}]),n}(At)),Kt=new(function(e){Object(It.a)(n,e);var t=Object(Pt.a)(n);function n(){return Object(ge.a)(this,n),t.call(this,"/movies")}return Object(ye.a)(n,[{key:"blacklist",value:function(){var e=Object(Ct.a)(St.a.mark((function e(){var t=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){t.get("/blacklist").then((function(t){e(t.data.data)})).catch(n)})));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"addBlacklist",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t,n){var r=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,a){r.post("/blacklist",n,{radarrid:t}).then((function(){return e()})).catch(a)})));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"deleteBlacklist",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t,n){var r=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,a){r.delete("/blacklist",n,{all:t}).then((function(){return e()})).catch(a)})));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"movies",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t){var n=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.get("",{radarrid:t}).then((function(t){e(t.data)})).catch((function(e){r(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"moviesBy",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t,n){var r=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,a){r.get("",{start:t,length:n}).then((function(t){e(t.data)})).catch((function(e){a(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"modify",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t){var n=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.post("",{radarrid:t.id,profileid:t.profileid}).then((function(){return e()})).catch((function(e){return r(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"wanted",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t,n){var r=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,a){r.get("/wanted",{start:t,length:n}).then((function(t){e(t.data)})).catch((function(e){a(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"wantedBy",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t){var n=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.get("/wanted",{radarrid:t}).then((function(t){e(t.data)})).catch((function(e){r(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"history",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t){var n=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.get("/history",{radarrid:t}).then((function(t){e(t.data.data)})).catch((function(e){r(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"action",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t){var n=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.patch("",t).then((function(){return e()})).catch(r)})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"downloadSubtitles",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t,n){var r=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,a){r.patch("/subtitles",n,{radarrid:t}).then((function(){return e()})).catch(a)})));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"uploadSubtitles",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t,n){var r=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,a){r.post("/subtitles",n,{radarrid:t}).then((function(){return e()})).catch(a)})));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"deleteSubtitles",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t,n){var r=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,a){r.delete("/subtitles",n,{radarrid:t}).then((function(){return e()})).catch(a)})));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()}]),n}(At)),Bt=new(function(e){Object(It.a)(n,e);var t=Object(Pt.a)(n);function n(){return Object(ge.a)(this,n),t.call(this,"/providers")}return Object(ye.a)(n,[{key:"providers",value:function(){var e=Object(Ct.a)(St.a.mark((function e(){var t=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){t.get("").then((function(t){e(t.data.data)})).catch(n)})));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"reset",value:function(){var e=Object(Ct.a)(St.a.mark((function e(){var t=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){t.post("",{action:"reset"}).then((function(){return e()})).catch(n)})));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"movies",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t){var n=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.get("/movies",{radarrid:t}).then((function(t){return e(t.data.data)})).catch(r)})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"downloadMovieSubtitle",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t,n){var r=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,a){r.post("/movies",n,{radarrid:t}).then((function(){return e()})).catch(a)})));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"episodes",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t){var n=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.get("/episodes",{episodeid:t}).then((function(t){return e(t.data.data)})).catch(r)})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"downloadEpisodeSubtitle",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t,n,r){var a=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,c){a.post("/episodes",r,{seriesid:t,episodeid:n}).then((function(){return e()})).catch(c)})));case 1:case"end":return e.stop()}}),e)})));return function(t,n,r){return e.apply(this,arguments)}}()}]),n}(At)),Dt=new(function(e){Object(It.a)(n,e);var t=Object(Pt.a)(n);function n(){return Object(ge.a)(this,n),t.call(this,"/series")}return Object(ye.a)(n,[{key:"series",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t){var n=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.get("",{seriesid:t}).then((function(t){e(t.data)})).catch((function(e){r(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"seriesBy",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t,n){var r=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,a){r.get("",{start:t,length:n}).then((function(t){e(t.data)})).catch((function(e){a(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"modify",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t){var n=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.post("",{seriesid:t.id,profileid:t.profileid}).then((function(){return e()})).catch((function(e){return r(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"action",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t){var n=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.patch("",t).then((function(){return e()})).catch(r)})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}]),n}(At)),zt=new(function(e){Object(It.a)(n,e);var t=Object(Pt.a)(n);function n(){return Object(ge.a)(this,n),t.call(this,"/subtitles")}return Object(ye.a)(n,[{key:"info",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t){var n=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.get("/info",{filenames:t}).then((function(t){return e(t.data.data)})).catch(r)})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"modify",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t,n){var r=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,a){r.patch("",n,{action:t}).then((function(){return e()})).catch(a)})));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()}]),n}(At)),Rt=new(function(e){Object(It.a)(n,e);var t=Object(Pt.a)(n);function n(){return Object(ge.a)(this,n),t.call(this,"/system")}return Object(ye.a)(n,[{key:"performAction",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t){var n=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.post("",void 0,{action:t}).then(e).catch(r)})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"login",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t,n){var r=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,a){r.post("/account",{username:t,password:n},{action:"login"}).then(e).catch(a)})));case 1:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"logout",value:function(){var e=Object(Ct.a)(St.a.mark((function e(){var t=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){t.post("/account",void 0,{action:"logout"}).then(e).catch(n)})));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"shutdown",value:function(){var e=Object(Ct.a)(St.a.mark((function e(){return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.performAction("shutdown"));case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"restart",value:function(){var e=Object(Ct.a)(St.a.mark((function e(){return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.performAction("restart"));case 1:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"settings",value:function(){var e=Object(Ct.a)(St.a.mark((function e(){var t=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){t.get("/settings").then((function(t){e(t.data)})).catch(n)})));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"setSettings",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t){var n=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.post("/settings",t).then((function(t){e()})).catch(r)})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"languages",value:function(){var e=Object(Ct.a)(St.a.mark((function e(){var t=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){t.get("/languages").then((function(t){e(t.data)})).catch((function(e){n(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"languagesProfileList",value:function(){var e=Object(Ct.a)(St.a.mark((function e(){var t=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){t.get("/languages/profiles").then((function(t){return e(t.data)})).catch(n)})));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"status",value:function(){var e=Object(Ct.a)(St.a.mark((function e(){var t=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){t.get("/status").then((function(t){e(t.data.data)})).catch((function(e){n(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"logs",value:function(){var e=Object(Ct.a)(St.a.mark((function e(){var t=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){t.get("/logs").then((function(t){return e(t.data.data)})).catch((function(e){return n(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"releases",value:function(){var e=Object(Ct.a)(St.a.mark((function e(){var t=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){t.get("/releases").then((function(t){return e(t.data.data)})).catch(n)})));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"deleteLogs",value:function(){var e=Object(Ct.a)(St.a.mark((function e(){var t=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){t.delete("/logs").then((function(){return e()})).catch((function(e){return n(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"getTasks",value:function(){var e=Object(Ct.a)(St.a.mark((function e(){var t=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){t.get("/tasks").then((function(t){e(t.data.data)})).catch((function(e){n(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()},{key:"runTask",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t){var n=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.post("/tasks",{taskid:t}).then((function(){e()})).catch((function(e){r(e)}))})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"testNotification",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t){var n=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.patch("/notifications",{url:t}).then((function(){return e()})).catch(r)})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"search",value:function(){var e=Object(Ct.a)(St.a.mark((function e(t){var n=this;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,r){n.get("/searches",{query:t}).then((function(t){return e(t.data)})).catch(r)})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}]),n}(At)),Lt=new(function(){function e(){Object(ge.a)(this,e)}return Object(ye.a)(e,[{key:"urlTest",value:function(e,t,n){return new Promise((function(r,a){_t.axios.get("../test/".concat(e,"/").concat(t,"api/system/status"),{params:n}).then((function(e){return r(e.data)})).catch(a)}))}}]),e}()),_t=new(function(){function e(){Object(ge.a)(this,e),this.axios=void 0,this.source=void 0;var t="/"===window.Bazarr.baseUrl?"/api/":"".concat(window.Bazarr.baseUrl,"/api/");this.initialize(t,window.Bazarr.apiKey)}return Object(ye.a)(e,[{key:"initialize",value:function(e,t){var n=this;this.axios=we.a.create({baseURL:e}),this.axios.defaults.headers.post["Content-Type"]="application/json",this.axios.defaults.headers.common["X-API-KEY"]=null!==t&&void 0!==t?t:"AUTH_NEEDED",this.source=we.a.CancelToken.source(),this.axios.interceptors.request.use((function(e){return e.cancelToken=n.source.token,e})),this.axios.interceptors.response.use((function(e){return n.onOnline(),e.status>=200&&e.status<300?Promise.resolve(e):(n.handleError(e.status),Promise.reject(e))}),(function(e){if(e.response){var t=e.response;n.handleError(t.status),n.onOnline()}else n.onOffline(),e.message="You have disconnected to Bazarr backend";return Promise.reject(e)}))}},{key:"danger_resetApi",value:function(e){this.axios.defaults.headers.common["X-API-KEY"]=e}},{key:"onOnline",value:function(){Yt.getState().site.offline&&Yt.dispatch(rt(!1))}},{key:"onOffline",value:function(){Yt.dispatch(rt(!0))}},{key:"handleError",value:function(e){switch(e){case 401:Yt.dispatch(Xe())}}}]),e}());function Ht(){return{pageSize:me.pageSize}}var Ut,Ft=Object(p.a)((Ue={},Object(h.a)(Ue,_,(function(e){return _t.danger_resetApi("NEED_AUTH"),Object(f.a)(Object(f.a)({},e),{},{auth:!1})})),Object(h.a)(Ue,H,(function(e){return Object(f.a)(Object(f.a)({},e),{},{initialized:!0})})),Object(h.a)(Ue,U,(function(e){return Object(f.a)(Object(f.a)({},e),{},{initialized:"An Error Occurred When Initializing Bazarr UI"})})),Object(h.a)(Ue,F,(function(e,t){var n=t.payload;for(var r in n){var a=n[r];localStorage.setItem(r,a)}return Object(f.a)(Object(f.a)({},e),Ht())})),Object(h.a)(Ue,G,(function(e,t){var n=[].concat(Object(X.a)(e.notifications.filter((function(e){return e.id!==t.payload.id}))),[t.payload]);return Object(f.a)(Object(f.a)({},e),{},{notifications:n})})),Object(h.a)(Ue,q,(function(e,t){var n=e.notifications.filter((function(e){return e.id!==t.payload}));return Object(f.a)(Object(f.a)({},e),{},{notifications:n})})),Object(h.a)(Ue,W,(function(e,t){var n=e.notifications.filter((function(e){return e.timestamp!==t.payload}));return Object(f.a)(Object(f.a)({},e),{},{notifications:n})})),Object(h.a)(Ue,Y,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{sidebar:t.payload})})),Object(h.a)(Ue,V,{next:function(e,t){var n=t.payload.item;return n&&!0!==t.error?Object(f.a)(Object(f.a)({},e),{},{badges:n}):e},throw:function(e){return e}}),Object(h.a)(Ue,Q,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{offline:t.payload})})),Ue),Object(f.a)({initialized:!1,auth:!0,pageSize:50,notifications:[],sidebar:"",badges:{movies:0,episodes:0,providers:0},offline:!1},Ht())),Gt=Object(p.a)((Ut={},Object(h.a)(Ut,v,(function(e,t){var n=Oe(t,[]),r=Object(f.a)(Object(f.a)({},n),{},{data:n.data.filter((function(e){return e.enabled}))});return Object(f.a)(Object(f.a)({},e),{},{languages:n,enabledLanguage:r})})),Object(h.a)(Ut,m,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{languagesProfiles:Oe(t,[])})})),Object(h.a)(Ut,g,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{status:Oe(t,e.status.data)})})),Object(h.a)(Ut,y,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{tasks:Oe(t,e.tasks.data)})})),Object(h.a)(Ut,C,(function(e,t){var n=t.payload,r=e.tasks,a=Object(X.a)(r.data),c=a.findIndex((function(e){return e.job_id===n}));return-1!==c&&(a[c].job_running=!0),Object(f.a)(Object(f.a)({},e),{},{tasks:Object(f.a)(Object(f.a)({},r),{},{data:a})})})),Object(h.a)(Ut,x,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{providers:Oe(t,e.providers.data)})})),Object(h.a)(Ut,k,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{logs:Oe(t,e.logs.data)})})),Object(h.a)(Ut,w,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{releases:Oe(t,e.releases.data)})})),Object(h.a)(Ut,S,(function(e,t){return Object(f.a)(Object(f.a)({},e),{},{settings:Oe(t,e.settings.data)})})),Ut),{languages:{updating:!0,data:[]},enabledLanguage:{updating:!0,data:[]},languagesProfiles:{updating:!0,data:[]},status:{updating:!0,data:void 0},tasks:{updating:!0,data:[]},providers:{updating:!0,data:[]},logs:{updating:!0,data:[]},releases:{updating:!0,data:[]},settings:{updating:!0,data:void 0}}),qt=Object(d.c)({system:Gt,series:xe,movie:pe,site:Ft}),Wt=[b.a,O.a];var Yt=Object(d.d)(qt,d.a.apply(void 0,Wt)),Vt=(n(330),n(495));function Qt(e){return Object(o.c)(e)}function Xt(e){var t=Object(o.b)();return Object(a.useCallback)((function(){return t(e.apply(void 0,arguments))}),[e,t])}function Jt(e,t){var n=Object(o.b)();return Object(a.useCallback)((function(){for(var r=arguments.length,a=new Array(r),c=0;c0&&void 0!==arguments[0]&&arguments[0],t=Xt(ze),n=Qt((function(t){return e?t.system.enabledLanguage.data:t.system.languages.data}));return Zt(n,t)}function rn(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=nn(e),n=Object(J.a)(t,1),r=n[0];return Object(a.useCallback)((function(e){return void 0===e?void 0:r.find((function(t){return t.code2===e}))}),[r])}function an(e){var t=rn(!0);return Object(a.useMemo)((function(){var n;return null!==(n=null===e||void 0===e?void 0:e.items.map((function(e){var n,r,a=e.language;return{hi:"True"===e.hi,forced:"True"===e.forced,code2:a,name:null!==(n=null===(r=t(a))||void 0===r?void 0:r.name)&&void 0!==n?n:""}})))&&void 0!==n?n:[]}),[t,null===e||void 0===e?void 0:e.items])}function cn(){var e=Xt(yt);return Zt(Qt((function(e){return e.series.seriesList})),e)}function sn(e){var t=cn(),n=Object(J.a)(t,2),r=n[0],c=n[1],i=Xt(mt);return Zt(Object(a.useMemo)((function(){var t=r.data.items,n=null;return e&&!isNaN(e)&&e in t&&(n=t[e]),Object(f.a)(Object(f.a)({},r),{},{data:n})}),[e,r]),Object(a.useCallback)((function(){e&&!isNaN(e)&&(c([e]),i(e))}),[e,c,i]))}function on(e){var t=Xt(mt),n=Object(a.useCallback)((function(){void 0===e||isNaN(e)||t(e)}),[t,e]),r=Qt((function(e){return e.series.episodeList})),c=Object(a.useMemo)((function(){return void 0===e||isNaN(e)?[]:null!==(t=r.data[e])&&void 0!==t?t:[];var t}),[e,r.data]);return Zt(Object(f.a)(Object(f.a)({},r),{},{data:c}),n)}function ln(){var e=Xt(ut);return Zt(Qt((function(e){return e.movie.movieList})),e)}function un(e){var t=ln(),n=Object(J.a)(t,2),r=n[0],c=n[1];return Zt(Object(a.useMemo)((function(){var t=r.data.items,n=null;return e&&!isNaN(e)&&e in t&&(n=t[e]),Object(f.a)(Object(f.a)({},r),{},{data:n})}),[e,r]),Object(a.useCallback)((function(){e&&!isNaN(e)&&c([e])}),[e,c]))}function dn(){var e=Xt(bt);return Zt(Qt((function(e){return e.system.providers})),e)}function jn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5,n=Xt($e),r=Xt(tt);return Object(a.useCallback)((function(a){var c=Object(f.a)(Object(f.a)({},a),{},{id:e,timestamp:new Date});n(c),setTimeout((function(){return r(c.timestamp)}),1e3*t)}),[n,r,t,e])}function bn(){var e,t,n=$t();return null===(e=null===(t=Object(J.a)(n,1)[0].data)||void 0===t?void 0:t.general.use_sonarr)||void 0===e||e}function On(){var e,t,n=$t();return null===(e=null===(t=Object(J.a)(n,1)[0].data)||void 0===t?void 0:t.general.use_radarr)||void 0===e||e}var hn=n(26),fn=n(7),pn=n(12),xn=n(512),vn=n(513),mn=n(491),gn=n(1),yn=n(492),kn=n(493),wn=n(267),Sn=(n(333),["Tab","Enter"," ",",",";","."]),Cn=function(e){var t=e.defaultValue,n=e.disabled,r=e.onChange,c=Object(a.useState)(null!==t&&void 0!==t?t:[]),i=Object(J.a)(c,2),s=i[0],o=i[1],l=Object(a.useRef)(null),u=Object(a.useCallback)((function(e){var t=Object(X.a)(s);t.push(e),o(t),r&&r(t)}),[s,r]),d=Object(a.useCallback)((function(e){var t;if(-1!==(e=null!==(t=e)&&void 0!==t?t:s.length-1)){var n=Object(X.a)(s);n.splice(e,1),o(n),r&&r(n)}}),[s,r]),j=Object(a.useCallback)((function(){l.current&&(l.current.value="")}),[l]),b=Object(a.useCallback)((function(e){var t=e.key,n=e.currentTarget.value;Sn.includes(t)&&0!==n.length?(e.preventDefault(),u(n),j()):"Backspace"===t&&0===n.length&&(e.preventDefault(),d())}),[u,d,j]),O=Object(a.useCallback)((function(e){var t=e.key,n=e.currentTarget.value;Sn.includes(t)&&0!==n.length&&e.preventDefault()}),[]),h=Object(a.useCallback)((function(e){var t=e.currentTarget.value;0!==t.length&&(e.preventDefault(),u(t),j())}),[u,j]),f=Object(a.useMemo)((function(){return s.map((function(e,t){return Object(gn.jsx)("span",{title:e,className:"custom-chip ".concat(n?"":"active"),onClick:function(){n||d(t)},children:e},t)}))}),[s,d,n]);return Object(gn.jsxs)("div",{className:"form-control custom-chip-input d-flex",children:[Object(gn.jsx)("div",{className:"chip-container",children:f}),Object(gn.jsx)("input",{disabled:n,className:"main-input p-0",ref:l,onKeyUp:b,onKeyDown:O,onBlur:h})]})},Nn=n(51),In=n(508),Pn=n(506),An="--back--";function Tn(e){var t=e.lastIndexOf("/");return-1===t&&(t=e.lastIndexOf("\\")),t}function En(e){if(e.endsWith("/")||e.endsWith("\\"))return e;var t=Tn(e);return e.slice(0,t+1)}var Mn=function(e){var t=e.defaultValue,n=e.onChange,r=e.load,c=e.drop,i=Object(a.useState)(!1),s=Object(J.a)(i,2),o=s[0],l=s[1],u=Object(a.useState)(null!==t&&void 0!==t?t:""),d=Object(J.a)(u,2),j=d[0],b=d[1],O=Object(a.useState)((function(){return En(j)})),h=Object(J.a)(O,2),f=h[0],p=h[1],x=Object(a.useState)(!0),v=Object(J.a)(x,2),m=v[0],g=v[1],y=Object(a.useMemo)((function(){var e=Tn(j);return j.slice(e+1)}),[j]),k=Object(a.useMemo)((function(){var e=Tn(f.slice(0,-1));return f.slice(0,e+1)}),[f]),w=Object(a.useState)([]),S=Object(J.a)(w,2),C=S[0],N=S[1],I=Object(a.useMemo)((function(){if(m)return Object(gn.jsx)(In.a.Item,{children:Object(gn.jsx)(mn.a,{size:"sm",animation:"border"})});var e=[];return e.push.apply(e,Object(X.a)(C.filter((function(e){return e.name.startsWith(y)})).map((function(e){return Object(gn.jsxs)(In.a.Item,{eventKey:e.path,children:[Object(gn.jsx)(pn.a,{icon:e.children?Nn.e:Nn.d,className:"mr-2"}),Object(gn.jsx)("span",{children:e.name})]},e.name)})))),0===e.length&&e.push(Object(gn.jsx)(In.a.Header,{children:"No Files"},"no-files")),0!==k.length?[Object(gn.jsxs)(In.a.Item,{eventKey:An,children:[Object(gn.jsx)(pn.a,{icon:fn.P,className:"mr-2"}),Object(gn.jsx)("span",{children:"Back"})]},"back"),Object(gn.jsx)(In.a.Divider,{},"back-divider")].concat(e):e}),[C,y,k,m]);Object(a.useEffect)((function(){if(j!==f){var e=En(j);e!==f&&(p(e),n&&n(e))}}),[f,j,n]);var P=Object(a.useRef)(null);return Object(a.useEffect)((function(){o&&(g(!0),r(f).then((function(e){N(e)})).finally((function(){return g(!1)})))}),[f,r,o]),Object(gn.jsxs)(In.a,{show:o,drop:c,onSelect:function(e){var t;e&&(b(e!==An?e:k),null===(t=P.current)||void 0===t||t.focus())},onToggle:function(e,t,n){e||"select"===n.source?e&&l(!0):l(!1)},children:[Object(gn.jsx)(In.a.Toggle,{as:Pn.a.Control,placeholder:"Click to start",type:"text",value:j,onChange:function(e){b(e.currentTarget.value)},ref:P}),Object(gn.jsx)(In.a.Menu,{className:"w-100",style:{maxHeight:256,overflowY:"auto"},children:I})]})},Kn=n(42),Bn=function(e){var t=e.value,n=e.emptyText,r=e.multiple,c=e.disabled,i=e.onChange,s=Object(a.useState)([]),o=Object(J.a)(s,2),l=o[0],u=o[1],d=Object(a.useRef)(null);Object(a.useEffect)((function(){t&&(u(t),0===t.length&&d.current&&(d.current.value=""))}),[t]);var j=Object(a.useMemo)((function(){return 0===l.length?n:r?"".concat(l.length," Files"):l[0].name}),[l,n,r]);return Object(gn.jsx)(Pn.a.File,{disabled:c,custom:!0,label:j,multiple:r,ref:d,onChange:function(e){var t=e.target.files;if(t){var n,r=[],a=Object(Kn.a)(t);try{for(a.s();!(n=a.n()).done;){var c=n.value;r.push(c)}}catch(s){a.e(s)}finally{a.f()}u(r),i&&i(r)}}})},Dn=n(207);n(335);function zn(e){var t=e.className,n=e.placeholder,r=e.label,c=e.disabled,i=e.clearable,s=e.loading,o=e.options,l=e.multiple,u=e.onChange,d=e.defaultValue,j=e.components,b=e.value,O=Object(a.useCallback)((function(e){var t;return null===(t=o.find((function(t){return t.value===e})))||void 0===t?void 0:t.label}),[o]),h=Object(a.useCallback)((function(e){if(null!==e&&void 0!==e){if(l)return e.map((function(e){var t;return{label:r?r(e):null!==(t=O(e))&&void 0!==t?t:"Unknown",value:e}}));var t,n=e;return{label:r?r(n):null!==(t=O(n))&&void 0!==t?t:"Unknown",value:n}}return e}),[r,l,O]),f=Object(a.useMemo)((function(){return h(d)}),[d,h]),p=Object(a.useMemo)((function(){return h(b)}),[h,b]);return Object(gn.jsx)(Dn.a,{isLoading:s,placeholder:n,isSearchable:o.length>=10,isMulti:l,closeMenuOnSelect:!l,defaultValue:f,value:p,isClearable:i,isDisabled:c,options:o,components:j,className:"custom-selector w-100 ".concat(null!==t&&void 0!==t?t:""),classNamePrefix:"selector",onChange:function(e){if(u){var t,n=null;if(Object(Z.isArray)(e))n=e.map((function(e){return e.value}));else n=null!==(t=null===e||void 0===e?void 0:e.value)&&void 0!==t?t:null;u(n)}}})}var Rn,Ln=n(292),_n=(n(345),n(346),function(e){var t=e.min,n=e.max,r=e.tooltips,a=e.defaultValue,c=e.onChange,i=e.onAfterChange;return Object(gn.jsxs)("div",{className:"d-flex flex-row align-items-center py-2",children:[Object(gn.jsx)("span",{className:"text-muted pr-3",children:null!==t&&void 0!==t?t:0}),Object(gn.jsx)(Ln.a,{min:null!==t&&void 0!==t?t:0,max:null!==n&&void 0!==n?n:100,className:"custom-rc-slider",step:1,defaultValue:a,onChange:c,onAfterChange:i,handle:function(e){return Object(gn.jsx)("div",{className:"rc-slider-handle",style:{left:"".concat(e.offset,"%")},children:Object(gn.jsx)(Hn,{tooltips:r,value:e.value})})}}),Object(gn.jsx)("span",{className:"text-muted pl-3",children:null!==n&&void 0!==n?n:100})]})}),Hn=function(e){var t=e.tooltips,n=e.value,r=Object(a.useMemo)((function(){var e=["rc-slider-handle-tips"];return void 0!==t&&("string"===typeof t?e.push("rc-slider-handle-tips-always"):!1===t&&e.push("rc-slider-handle-tips-hidden")),e.join(" ")}),[t]);return Object(gn.jsx)("span",{className:r,children:n})};function Un(e){var t,n=e.exist,r=e.state,c=e.children,i=n?!n(r.data):!((t=r.data)instanceof Array?0!==t.length:null!==t&&void 0!==t),s=jn("async-overlay");if(Object(a.useEffect)((function(){r.updating||void 0===r.error||i||s({type:"error",message:r.error.message})}),[r,s,i]),r.updating){if(i)return Object(gn.jsx)(ja,{})}else if(r.error&&i)return Object(gn.jsx)(yn.a,{children:Object(gn.jsxs)(kn.a,{variant:"danger",className:"my-4",children:[Object(gn.jsxs)(kn.a.Heading,{children:[Object(gn.jsx)(pn.a,{className:"mr-2",icon:fn.t}),Object(gn.jsx)("span",{children:"Ouch! You got an error"})]}),Object(gn.jsx)("p",{children:r.error.message}),Object(gn.jsx)("hr",{}),Object(gn.jsx)("div",{className:"d-flex justify-content-end",children:Object(gn.jsx)(wn.a,{variant:"outline-danger",onClick:je,children:"Reload"})})]})});return c?c(r.data,r.error):null}function Fn(e){var t=e.promise,n=e.children,r=Object(a.useState)(null),c=Object(J.a)(r,2),i=c[0],s=c[1];return Object(a.useEffect)((function(){t().then((function(e){return s(e)})).catch((function(){}))}),[t]),null===i?Object(gn.jsx)(ja,{}):n(i)}function Gn(e){var t=e.label,n=e.state,r=Object(hn.a)(e,["label","state"]),c=Object(a.useMemo)((function(){return n.data.map((function(e){return{label:t(e),value:e}}))}),[n,t]);return Object(gn.jsx)(zn,Object(f.a)({loading:n.updating,options:c,label:t},r))}function qn(e){var t=e.children,n=e.className,r=e.promise,c=e.onSuccess,i=e.noReset,s=e.error,o=e.onChange,l=e.disabled,u=Object(hn.a)(e,["children","className","promise","onSuccess","noReset","error","onChange","disabled"]),d=Object(a.useState)(!1),j=Object(J.a)(d,2),b=j[0],O=j[1],h=Object(a.useState)(Rn.Invalid),p=Object(J.a)(h,2),x=p[0],v=p[1],m=Object(a.useState)(null),g=Object(J.a)(m,2)[1];Object(a.useEffect)((function(){if(!i){if(x===Rn.Error||x===Rn.Success){var e=setTimeout((function(){return v(Rn.Invalid)}),2e3);g(e)}return function(){g((function(e){return e&&clearTimeout(e),null}))}}}),[x,i]);var y=Object(a.useCallback)((function(){if(x===Rn.Invalid){var e=r();e&&(O(!0),o&&o(!0),e.then((function(e){v(Rn.Success),c&&c(e)})).catch((function(){v(Rn.Error),s&&s()})).finally((function(){O(!1),o&&o(!1)})))}}),[s,o,r,c,x]),k=t;return b&&(k=Object(gn.jsx)(pn.a,{icon:fn.j,spin:!0})),x===Rn.Success?k=Object(gn.jsx)(pn.a,{icon:fn.h}):x===Rn.Error&&(k=Object(gn.jsx)(pn.a,{icon:fn.X})),Object(gn.jsx)(wn.a,Object(f.a)(Object(f.a)({className:n,disabled:b||l||x!==Rn.Invalid},u),{},{onClick:y,children:k}))}!function(e){e[e.Success=0]="Success",e[e.Error=1]="Error",e[e.Invalid=2]="Invalid"}(Rn||(Rn={}));var Wn=n(494),Yn=function(e){var t=e.icon,n=e.onClick;return Object(gn.jsx)(wn.a,{as:Wn.a,className:"mx-1 p-1",variant:"secondary",onClick:n,children:Object(gn.jsx)(pn.a,{icon:t})})},Vn=function(e){var t=e.onClick,n=(e.destructive,e.disabled),r=e.variant,a=e.className,c=e.size,i=Object(hn.a)(e,["onClick","destructive","disabled","variant","className","size"]);return Object(gn.jsx)(wn.a,{disabled:i.loading||n,size:null!==c&&void 0!==c?c:"sm",variant:null!==r&&void 0!==r?r:"light",className:"text-nowrap ".concat(null!==a&&void 0!==a?a:""),onClick:t,children:Object(gn.jsx)(Qn,Object(f.a)({},i))})},Qn=function(e){var t=e.icon,n=e.children,r=e.loading;return Object(gn.jsxs)(c.a.Fragment,{children:[Object(gn.jsx)(pn.a,{style:{width:"1rem"},icon:r?fn.j:t,spin:r}),n&&!r?Object(gn.jsx)("span",{className:"ml-2 font-weight-bold",children:n}):null]})},Xn=function(e){var t=e.children,n=e.icon,r=e.disabled,a=e.updating,c=e.updatingIcon,i=e.onClick,s=n;return a&&(s=c||fn.S),Object(gn.jsxs)(wn.a,{variant:"dark",className:"d-flex flex-column text-nowrap py-1",disabled:r||a,onClick:i,children:[Object(gn.jsx)(pn.a,{className:"mx-auto my-1",icon:s,spin:a}),Object(gn.jsx)("span",{className:"align-bottom text-themecolor small text-center",children:t})]})};var Jn=Xn,Zn=function(e){var t=e.children,n=e.pos,r="d-flex flex-grow-1 align-items-center justify-content-".concat(n);return Object(gn.jsx)("div",{className:r,children:t})},$n=(n(347),function(e){var t,n=e.children,r=e.scroll,c=e.className,i=Object(a.useMemo)((function(){var e=["content-header","bg-dark","p-2"];return void 0!==c&&e.push(c),!1!==r&&e.push("scroll"),e.join(" ")}),[r,c]);return t=!1!==r?Object(gn.jsx)("div",{className:"d-flex flex-nowrap flex-grow-1",children:n}):n,Object(gn.jsx)(Vt.a,{className:i,children:t})});$n.Button=Jn,$n.Group=Zn,$n.AsyncButton=function(e){var t=e.promise,n=e.onSuccess,r=Object(hn.a)(e,["promise","onSuccess"]),c=Object(a.useState)(!1),i=Object(J.a)(c,2),s=i[0],o=i[1],l=Object(a.useCallback)((function(){o(!0),t().then((function(e){o(!1),n&&n(e)}))}),[n,t]);return Object(gn.jsx)(Xn,Object(f.a)({updating:s,onClick:l},r))};function er(e){return e.name}function tr(e){var t=e.options,n=Object(hn.a)(e,["options"]),r=Object(a.useMemo)((function(){return t.map((function(e){return{label:e.name,value:e}}))}),[t]);return Object(gn.jsx)(zn,Object(f.a)({placeholder:"Language...",options:r,label:er},n))}var nr=n(505),rr=c.a.createContext([[],function(e){}]),ar=c.a.createContext([[],function(e){}]);function cr(){var e=Object(a.useContext)(rr),t=Object(J.a)(e,2),n=t[0],r=t[1],c=Object(a.useContext)(ar),i=Object(J.a)(c,2),s=i[0],o=i[1];return Object(a.useCallback)((function(e,t){"modal ".concat(e," sending payload"),r([].concat(Object(X.a)(n),[e])),o([].concat(Object(X.a)(s),[null!==t&&void 0!==t?t:null]))}),[n,s,r,o])}function ir(){var e=Object(a.useContext)(rr),t=Object(J.a)(e,2),n=t[0],r=t[1],c=Object(a.useContext)(ar),i=Object(J.a)(c,2),s=i[0],o=i[1];return Object(a.useCallback)((function(){var e=Object(X.a)(n);e.pop();var t=Object(X.a)(s);t.pop(),r(e),o(t)}),[n,s,r,o])}function sr(e){var t=Object(a.useContext)(rr)[0];return e===t[t.length-1]}function or(e,t){var n=sr(e);Object(a.useEffect)((function(){n&&t()}),[n,t])}function lr(e){var t=Object(a.useContext)(ar)[0],n=Object(a.useContext)(rr)[0];return Object(a.useMemo)((function(){var r=n.findIndex((function(t){return t===e}));return-1!==r?t[r]:null}),[n,t,e])}var ur,dr=function(e){var t=e.children,n=Object(a.useState)([]),r=Object(J.a)(n,2),c=r[0],i=r[1],s=Object(a.useState)([]),o=Object(J.a)(s,2),l=o[0],u=o[1];return Object(gn.jsx)(rr.Provider,{value:[c,i],children:Object(gn.jsx)(ar.Provider,{value:[l,u],children:t})})},jr=function(e){var t=e.size,n=e.closeable,r=e.modalKey,a=e.title,c=e.children,i=e.footer,s=sr(r),o=ir(),l=!1!==n;return Object(gn.jsxs)(nr.a,{centered:!0,size:t,show:s,onHide:o,backdrop:l?void 0:"static",children:[Object(gn.jsx)(nr.a.Header,{closeButton:l,children:a}),Object(gn.jsx)(nr.a.Body,{children:c}),Object(gn.jsx)(nr.a.Footer,{hidden:void 0===i,children:i})]})},br=jr,Or=function(e){var t=e.history,n=e.update,r=e.promise,a=t.provider,c=t.subs_id,i=t.language,s=t.subtitles_path,o=t.blacklisted;return c&&a&&i?Object(gn.jsx)(qn,{size:"sm",variant:"light",noReset:!0,disabled:o,promise:function(){var e=i.code2;return r({provider:a,subs_id:c,subtitles_path:s,language:e})},onSuccess:n,children:Object(gn.jsx)(pn.a,{icon:fn.u})}):null},hr=function(e){var t,n=Object.assign({},e),r=lr(n.modalKey),c=Object(a.useState)({updating:!1,data:[]}),i=Object(J.a)(c,2),s=i[0],o=i[1],l=Object(a.useCallback)((function(){r&&se(Kt.history(r.radarrId),o,[])}),[r]);Object(a.useEffect)((function(){l()}),[l]);var u=Object(a.useMemo)((function(){return[{accessor:"action",className:"text-center",Cell:function(e){return Object(gn.jsx)(ua,{action:e.value})}},{Header:"Language",accessor:"language",Cell:function(e){var t=e.value;return t?Object(gn.jsx)(ba,{text:t,long:!0}):null}},{Header:"Provider",accessor:"provider"},{Header:"Score",accessor:"score"},{Header:"Date",accessor:"timestamp",Cell:function(e){return e.value?Object(gn.jsx)(Oa,{text:e.row.original.parsed_timestamp,delay:1,children:Object(gn.jsx)("span",{children:e.value})}):null}},{accessor:"blacklisted",Cell:function(e){var t=e.row.original;return Object(gn.jsx)(Or,{update:l,promise:function(e){return Kt.addBlacklist(t.radarrId,e)},history:t})}}]}),[l]);return Object(gn.jsx)(br,Object(f.a)(Object(f.a)({title:"History - ".concat(null!==(t=null===r||void 0===r?void 0:r.title)&&void 0!==t?t:"")},n),{},{children:Object(gn.jsx)(Un,{state:s,children:function(e){return Object(gn.jsx)(la,{emptyText:"No History Found",columns:u,data:e})}})}))},fr=function(e){var t,n=lr(e.modalKey),r=Object(a.useState)({updating:!1,data:[]}),c=Object(J.a)(r,2),i=c[0],s=c[1],o=Object(a.useCallback)((function(){n&&se(Tt.history(n.sonarrEpisodeId),s,[])}),[n]);Object(a.useEffect)((function(){return o()}),[o]);var l=Object(a.useMemo)((function(){return[{accessor:"action",className:"text-center",Cell:function(e){return Object(gn.jsx)(ua,{action:e.value})}},{Header:"Language",accessor:"language",Cell:function(e){var t=e.value;return t?Object(gn.jsx)(ba,{text:t,long:!0}):null}},{Header:"Provider",accessor:"provider"},{Header:"Score",accessor:"score"},{Header:"Date",accessor:"timestamp",Cell:function(e){return e.value?Object(gn.jsx)(Oa,{text:e.row.original.parsed_timestamp,delay:1,children:Object(gn.jsx)("span",{children:e.value})}):null}},{accessor:"blacklisted",Cell:function(e){var t=e.row.original,n=t.sonarrSeriesId,r=t.sonarrEpisodeId;return Object(gn.jsx)(Or,{history:t,update:o,promise:function(e){return Tt.addBlacklist(n,r,e)}})}}]}),[o]);return Object(gn.jsx)(br,Object(f.a)(Object(f.a)({title:"History - ".concat(null!==(t=null===n||void 0===n?void 0:n.title)&&void 0!==t?t:"")},e),{},{children:Object(gn.jsx)(Un,{state:i,children:function(e){return Object(gn.jsx)(la,{emptyText:"No History Found",columns:l,data:e})}})}))},pr=function(e){var t=e.onSuccess,n=e.submit,r=Object(hn.a)(e,["onSuccess","submit"]),c=en(),i=Object(J.a)(c,1)[0],s=lr(r.modalKey),o=ir(),l=Object(a.useMemo)((function(){return i.map((function(e){return{label:e.name,value:e.profileId}}))}),[i]),u=Object(a.useState)(null),d=Object(J.a)(u,2),j=d[0],b=d[1],O=Object(a.useState)(!1),h=Object(J.a)(O,2),p=h[0],x=h[1],v=Object(a.useMemo)((function(){return Object(gn.jsx)(qn,{noReset:!0,onChange:x,promise:function(){if(s){var e=oe(s);return n({id:[e],profileid:[j]})}return null},onSuccess:function(){o(),t&&s&&t(s)},children:"Save"})}),[o,j,s,t,n]);return Object(gn.jsx)(br,Object(f.a)(Object(f.a)({closeable:!p,footer:v,title:null===s||void 0===s?void 0:s.title},r),{},{children:Object(gn.jsx)(yn.a,{fluid:!0,children:Object(gn.jsxs)(Pn.a,{children:[Object(gn.jsxs)(Pn.a.Group,{children:[Object(gn.jsx)(Pn.a.Label,{children:"Audio"}),Object(gn.jsx)(Pn.a.Control,{type:"text",disabled:!0,defaultValue:null===s||void 0===s?void 0:s.audio_language.map((function(e){return e.name})).join(", ")})]}),Object(gn.jsxs)(Pn.a.Group,{children:[Object(gn.jsx)(Pn.a.Label,{children:"Languages Profiles"}),Object(gn.jsx)(zn,{clearable:!0,options:l,defaultValue:null===s||void 0===s?void 0:s.profileId,onChange:function(e){return b(void 0===e?null:e)}})]})]})})}))},xr=function(e){var t,n=e,r=nn(!0),c=Object(J.a)(r,1)[0],i=lr(n.modalKey),s=un(null===i||void 0===i?void 0:i.radarrId),o=Object(J.a)(s,2)[1],l=ir(),u=Object(a.useState)(!1),d=Object(J.a)(u,2),j=d[0],b=d[1],O=Object(a.useState)(null),h=Object(J.a)(O,2),p=h[0],x=h[1],v=tn(null===i||void 0===i?void 0:i.profileId),m=function(e){var t=rn();return Object(a.useMemo)((function(){return t(e)}),[e,t])}(null===v||void 0===v||null===(t=v.items[0])||void 0===t?void 0:t.language);Object(a.useEffect)((function(){return x(null!==m&&void 0!==m?m:null)}),[m]);var g=Object(a.useState)(null),y=Object(J.a)(g,2),k=y[0],w=y[1],S=Object(a.useState)(!1),C=Object(J.a)(S,2),N=C[0],I=C[1],P=Object(a.useMemo)((function(){return null!==k&&(null===p||void 0===p?void 0:p.code2)}),[p,k]),A=Object(gn.jsx)(qn,{noReset:!0,disabled:!P,onChange:b,promise:function(){return k&&i&&p?Kt.uploadSubtitles(i.radarrId,{file:k,forced:N,hi:!1,language:p.code2}):null},onSuccess:function(){l(),o()},children:"Upload"});return Object(gn.jsx)(br,Object(f.a)(Object(f.a)({title:"Upload - ".concat(null===i||void 0===i?void 0:i.title),closeable:!j,footer:A},n),{},{children:Object(gn.jsx)(yn.a,{fluid:!0,children:Object(gn.jsxs)(Pn.a,{children:[Object(gn.jsxs)(Pn.a.Group,{children:[Object(gn.jsx)(Pn.a.Label,{children:"Language"}),Object(gn.jsx)(tr,{options:c,value:p,onChange:function(e){e&&x(e)}})]}),Object(gn.jsxs)(Pn.a.Group,{children:[Object(gn.jsx)(Pn.a.Label,{children:"Subtitle File"}),Object(gn.jsx)(Bn,{emptyText:"Select...",onChange:function(e){w(e[0])}})]}),Object(gn.jsx)(Pn.a.Group,{children:Object(gn.jsx)(Pn.a.Check,{custom:!0,id:"forced-checkbox",defaultChecked:N,onChange:function(e){return I(e.target.checked)},label:"Forced"})})]})})}))};!function(e){e[e.Update=0]="Update",e[e.Valid=1]="Valid",e[e.Warning=2]="Warning",e[e.Error=3]="Error"}(ur||(ur={}));var vr=function(e){var t=lr(e.modalKey),n=on(null===t||void 0===t?void 0:t.sonarrSeriesId),r=Object(J.a)(n,2),c=r[0],i=r[1],s=Object(a.useState)(!1),o=Object(J.a)(s,2),l=o[0],u=o[1],d=ir(),j=Object(a.useState)([]),b=Object(J.a)(j,2),O=b[0],p=b[1],x=Object(a.useState)({}),v=Object(J.a)(x,2),m=v[0],g=v[1],y=an(tn(null===t||void 0===t?void 0:t.profileId)),k=Object(a.useMemo)((function(){return O.map((function(e){return e.form.file}))}),[O]);Object(a.useEffect)((function(){var e=O.reduce((function(e,t){var n={state:ur.Valid,infos:[]},r=t.form,a=t.instance;return t.didCheck?a?void 0!==a.subtitles.find((function(e){return e.code2===r.language}))&&(n.infos.push("Overwrite existing subtitle"),n.state=ur.Warning):(n.infos.push("Season or episode info is missing"),n.state=ur.Error):n.state=ur.Update,e[r.file.name]=n,e}),{});g(e)}),[O]);var w=Object(a.useCallback)(function(){var e=Object(Ct.a)(St.a.mark((function e(t){var n,r,a;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!((n=t.map((function(e){return e.form.file.name}))).length>0)){e.next=7;break}return e.next=4,zt.info(n);case 4:r=e.sent,a=r.reduce((function(e,t){var n=c.data.find((function(e){return e.season===t.season&&e.episode===t.episode}));return n&&(e[t.filename]=n),e}),{}),p((function(e){return e.map((function(e){return Object(f.a)(Object(f.a)({},e),{},{didCheck:!0,instance:a[e.form.file.name]})}))}));case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),[c.data]),S=Object(a.useCallback)((function(e){if(e){var t=O.map((function(t){var n,r,a=t.form;return Object(f.a)(Object(f.a)({},t),{},{form:Object(f.a)(Object(f.a)({},a),{},{language:e.code2,hi:null!==(n=e.hi)&&void 0!==n&&n,forced:null!==(r=e.forced)&&void 0!==r&&r})})}));p(t)}}),[O]),C=Object(a.useCallback)((function(e){var t=y[0],n=e.map((function(e){var n,r;return{form:{file:e,language:t.code2,hi:null!==(n=t.hi)&&void 0!==n&&n,forced:null!==(r=t.forced)&&void 0!==r&&r},didCheck:!1}}));p(n);var r=e.reduce((function(e,t){return Object(f.a)(Object(f.a)({},e),{},Object(h.a)({},t.name,{state:ur.Update,infos:[]}))}),{});g(r),w(n)}),[y,w]),N=Object(a.useCallback)(Object(Ct.a)(St.a.mark((function e(){var n,r,a,c,i,s;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t){e.next=2;break}return e.abrupt("return");case 2:n=t.sonarrSeriesId,r=O.reduce((function(e,t){return e[t.form.file.name]={state:ur.Update,infos:[]},e}),{}),g(r),a=Object(Kn.a)(O),e.prev=6,a.s();case 8:if((c=a.n()).done){e.next=18;break}if(!(i=c.value).instance){e.next=16;break}return s=i.instance.sonarrEpisodeId,e.next=14,Tt.uploadSubtitles(n,s,i.form);case 14:r=Object(f.a)(Object(f.a)({},r),{},Object(h.a)({},i.form.file.name,{state:ur.Valid,infos:[]})),g(r);case 16:e.next=8;break;case 18:e.next=23;break;case 20:e.prev=20,e.t0=e.catch(6),a.e(e.t0);case 23:return e.prev=23,a.f(),e.finish(23);case 26:case"end":return e.stop()}}),e,null,[[6,20,23,26]])}))),[t,O]),I=Object(a.useMemo)((function(){return O.length>0&&O.every((function(e){return void 0!==e.instance}))}),[O]),P=O.length>0,A=Object(a.useMemo)((function(){return[{id:"Icon",accessor:"instance",className:"text-center",Cell:function(e){var t=e.row,n=e.loose,r=t.original.form.file.name,a=n[1],c=fn.j,i=void 0,s=!1,o=[];if(r in a){var l=a[r];switch(o=l.infos,l.state){case ur.Error:c=fn.t,i="var(--danger)";break;case ur.Valid:c=fn.h,i="var(--success)";break;case ur.Warning:c=fn.A,i="var(--warning)";break;case ur.Update:s=!0}}return Object(gn.jsx)(da,{messages:o,color:i,icon:c,spin:s})}},{Header:"File",accessor:function(e){return e.form.file.name}},{Header:"Episode",accessor:"instance",className:"vw-1",Cell:function(e){var t=e.value,n=e.loose,r=e.row,c=e.externalUpdate,i=n[2].map((function(e){return{label:"(".concat(e.season,"x").concat(e.episode,") ").concat(e.title),value:e}})),s=Object(a.useCallback)((function(e){if(e){var t=Object(f.a)({},r.original);t.instance=e,c&&c(r,t)}}),[r,c]);return Object(gn.jsx)(zn,{options:i,value:null!==t&&void 0!==t?t:null,onChange:s})}},{accessor:"form",Cell:function(e){var t=e.row,n=e.externalUpdate,r=e.loose,a=Object(J.a)(r,1)[0];return Object(gn.jsx)(wn.a,{size:"sm",variant:"light",disabled:a,onClick:function(){n&&n(t)},children:Object(gn.jsx)(pn.a,{icon:fn.Z})})}}]}),[]),T=Object(a.useCallback)((function(e,t){p((function(n){var r=Object(X.a)(n);return t?r[e.index]=t:r.splice(e.index,1),r}))}),[]),E=Object(gn.jsxs)("div",{className:"d-flex flex-row flex-grow-1 justify-content-between",children:[Object(gn.jsx)("div",{className:"w-25",children:Object(gn.jsx)(tr,{disabled:l,options:y,defaultValue:y.length>0?y[0]:void 0,onChange:S})}),Object(gn.jsxs)("div",{children:[Object(gn.jsx)(wn.a,{hidden:l,disabled:0===O.length,variant:"outline-secondary",className:"mr-2",onClick:function(){return C([])},children:"Clean"}),Object(gn.jsx)(qn,{noReset:!0,disabled:!I,onChange:u,promise:N,onSuccess:function(){d(),C([]),i()},children:"Upload"})]})]});return Object(gn.jsx)(br,Object(f.a)(Object(f.a)({size:"lg",title:"Upload Subtitles",closeable:!l,footer:E},e),{},{children:Object(gn.jsxs)(yn.a,{fluid:!0,className:"flex-column",children:[Object(gn.jsx)(Pn.a,{children:Object(gn.jsx)(Pn.a.Group,{children:Object(gn.jsx)(Bn,{emptyText:"Select...",disabled:P||0===y.length,multiple:!0,value:k,onChange:C})})}),Object(gn.jsx)("div",{hidden:!P,children:Object(gn.jsx)(ea,{columns:A,data:O,loose:[l,m,c.data],responsive:!1,externalUpdate:T})})]})}))},mr=n(496),gr=n(497),yr=n(57),kr="useAsyncPagination",wr="loading-change";function Sr(e){e.stateReducers.push(Cr),e.useInstance.push(Ir),e.useOptions.push(Nr)}function Cr(e,t,n,r){if(t.type===wr&&r){var a=t.pageToLoad,c=!1,i=r.asyncState,s=e.pageIndex,o=e.pageSize,l=s;"prev"===a?l-=1:"next"===a?l+=1:"number"===typeof a&&(l=a);var u=l*o,d=u+o;if(i){var j=i.error,b=i.data.order.slice(u,d),O=0===b.length&&void 0!==j,h=0!==b.length&&b.every(Z.isNull);O||h?c=!0:b.every(te)&&(a=void 0)}return Object(f.a)(Object(f.a)({},e),{},{pageToLoad:a,needLoadingScreen:c})}return e}function Nr(e){return e.manualPagination=!0,void 0===e.initialState&&(e.initialState={}),e.initialState.pageToLoad=0,e.initialState.needLoadingScreen=!0,e}function Ir(e){var t,n=e.plugins,r=e.asyncLoader,c=e.dispatch,i=e.asyncState,s=e.asyncId,o=e.rows,l=e.nextPage,u=e.previousPage,d=e.gotoPage,j=e.state,b=j.pageIndex,O=j.pageSize,h=j.pageToLoad;Object(yr.ensurePluginOrder)(n,["usePagination"],kr);var f=null!==(t=null===i||void 0===i?void 0:i.data.order.length)&&void 0!==t?t:0,p=Math.ceil(f/O),x=b*O,v=x+O;Object(a.useEffect)((function(){void 0!==h&&r&&r(x,O)}),[r,x,O,h]);var m=Object(a.useCallback)((function(e){c({type:wr,pageToLoad:e})}),[c]);Object(a.useEffect)((function(){!1===(null===i||void 0===i?void 0:i.updating)&&m()}),[null===i||void 0===i?void 0:i.updating,m]);var g=Object(a.useCallback)((function(e){var t;(t="number"===typeof e?e:e(b))!==b&&(m(t),d(t))}),[b,m,d]),y=Object(a.useCallback)((function(){0!==b&&(m("prev"),u())}),[m,u,b]),k=Object(a.useCallback)((function(){b!==p&&(m("next"),l())}),[m,l,p,b]),w=Object(a.useMemo)((function(){var e;return(null!==(e=null===i||void 0===i?void 0:i.data.order.slice(x,v).filter(te))&&void 0!==e?e:[]).flatMap((function(e){var t=o.find((function(t){return s&&s(t.original)===e}));return t?[t]:[]}))}),[x,v,s,null===i||void 0===i?void 0:i.data.order,o]);Object.assign(e,{previousPage:y,nextPage:k,gotoPage:g,page:w,pageCount:p})}Sr.pluginName=kr;var Pr=Sr,Ar="useCustomSelection",Tr=Object(a.forwardRef)((function(e,t){var n=e.indeterminate,r=e.idIn,c=Object(hn.a)(e,["indeterminate","idIn"]),i=Object(a.useRef)(null),s=t||i;return Object(a.useEffect)((function(){"object"===typeof s&&s.current&&(s.current.indeterminate=null!==n&&void 0!==n&&n)}),[s,n]),Object(gn.jsx)(Pn.a.Check,Object(f.a)({custom:!0,id:r,ref:s},c))}));function Er(e){e.visibleColumnsDeps.push((function(e,t){var n=t.instance;return[].concat(Object(X.a)(e),[n.isSelecting])})),e.visibleColumns.push(Kr),e.useInstance.push(Mr)}function Mr(e){var t=e.plugins,n=e.rows,r=e.onSelect,c=e.isSelecting,i=e.state.selectedRowIds;Object(yr.ensurePluginOrder)(t,["useRowSelect"],Ar),Object(a.useEffect)((function(){if(c){var e=Object.keys(i).flatMap((function(e){var t,r;return null!==(t=null===(r=n.find((function(t){return t.id===e})))||void 0===r?void 0:r.original)&&void 0!==t?t:[]}));r&&r(e)}}),[i,r,n,c])}function Kr(e,t){return t.instance.isSelecting?[{id:"---selection---",Header:function(e){var t=e.getToggleAllRowsSelectedProps;return Object(gn.jsx)(Tr,Object(f.a)({idIn:"table-header-selection"},t()))},Cell:function(e){var t=e.row;return Object(gn.jsx)(Tr,Object(f.a)({idIn:"table-cell-".concat(t.index)},t.getToggleRowSelectedProps()))}}].concat(Object(X.a)(e.filter((function(e){return!0!==e.selectHide})))):e}Er.pluginName=Ar;var Br=Er;function Dr(e){e.useOptions.push(zr)}function zr(e){var t=Qt((function(e){return e.site})).pageSize;return void 0===e.autoResetPage&&(e.autoResetPage=!1),void 0===e.autoResetExpanded&&(e.autoResetExpanded=!1),void 0===e.initialState&&(e.initialState={}),e.initialState.needLoadingScreen=!1,void 0===e.initialState.pageSize&&(e.initialState.pageSize=t),void 0===e.asyncLoader&&(e.initialState.pageToLoad=void 0),e}Dr.pluginName="useLocalSettings";var Rr,Lr=Dr,_r={af:"afrikaans",sq:"albanian",am:"amharic",ar:"arabic",hy:"armenian",az:"azerbaijani",eu:"basque",be:"belarusian",bn:"bengali",bs:"bosnian",bg:"bulgarian",ca:"catalan",ceb:"cebuano",ny:"chichewa","zh-cn":"chinese (simplified)","zh-tw":"chinese (traditional)",co:"corsican",hr:"croatian",cs:"czech",da:"danish",nl:"dutch",en:"english",eo:"esperanto",et:"estonian",tl:"filipino",fi:"finnish",fr:"french",fy:"frisian",gl:"galician",ka:"georgian",de:"german",el:"greek",gu:"gujarati",ht:"haitian creole",ha:"hausa",haw:"hawaiian",iw:"hebrew",hi:"hindi",hmn:"hmong",hu:"hungarian",is:"icelandic",ig:"igbo",id:"indonesian",ga:"irish",it:"italian",ja:"japanese",jw:"javanese",kn:"kannada",kk:"kazakh",km:"khmer",ko:"korean",ku:"kurdish (kurmanji)",ky:"kyrgyz",lo:"lao",la:"latin",lv:"latvian",lt:"lithuanian",lb:"luxembourgish",mk:"macedonian",mg:"malagasy",ms:"malay",ml:"malayalam",mt:"maltese",mi:"maori",mr:"marathi",mn:"mongolian",my:"myanmar (burmese)",ne:"nepali",no:"norwegian",ps:"pashto",fa:"persian",pl:"polish",pt:"portuguese",pa:"punjabi",ro:"romanian",ru:"russian",sm:"samoan",gd:"scots gaelic",sr:"serbian",st:"sesotho",sn:"shona",sd:"sindhi",si:"sinhala",sk:"slovak",sl:"slovenian",so:"somali",es:"spanish",su:"sundanese",sw:"swahili",sv:"swedish",tg:"tajik",ta:"tamil",te:"telugu",th:"thai",tr:"turkish",uk:"ukrainian",ur:"urdu",uz:"uzbek",vi:"vietnamese",cy:"welsh",xh:"xhosa",yi:"yiddish",yo:"yoruba",zu:"zulu",fil:"Filipino",he:"Hebrew"},Hr=[{label:"White",value:"white"},{label:"Light Gray",value:"lightgray"},{label:"Red",value:"red"},{label:"Green",value:"green"},{label:"Yellow",value:"yellow"},{label:"Blue",value:"blue"},{label:"Magenta",value:"magenta"},{label:"Cyan",value:"cyan"},{label:"Black",value:"black"},{label:"Dark Red",value:"darkred"},{label:"Dark Green",value:"darkgreen"},{label:"Dark Yellow",value:"darkyellow"},{label:"Dark Blue",value:"darkblue"},{label:"Dark Magenta",value:"darkmagenta"},{label:"Dark Cyan",value:"darkcyan"},{label:"Dark Grey",value:"darkgrey"}];!function(e){e[e.Pending=0]="Pending",e[e.Processing=1]="Processing",e[e.Done=2]="Done"}(Rr||(Rr={}));var Ur=function(e){var t=e.state,n=Nn.f;switch(t){case Rr.Pending:n=fn.l;break;case Rr.Processing:n=fn.j;break;case Rr.Done:n=fn.h}return Object(gn.jsx)(pn.a,{icon:n,spin:t===Rr.Processing})};var Fr=function(e){var t=e.process,n=Object(hn.a)(e,["process"]),r=Object(a.useState)(null),c=Object(J.a)(r,2),i=c[0],s=c[1],o=Object(a.useCallback)((function(){if(i){var e="color(name=".concat(i,")");t(e)}}),[i,t]),l=Object(a.useMemo)((function(){return Object(gn.jsx)(wn.a,{disabled:null===i,onClick:o,children:"Save"})}),[i,o]);return Object(gn.jsx)(br,Object(f.a)(Object(f.a)({title:"Choose Color",footer:l},n),{},{children:Object(gn.jsx)(zn,{options:Hr,onChange:s})}))},Gr=function(e){var t=e.process,n=Object(hn.a)(e,["process"]),r=Object(a.useState)(null),c=Object(J.a)(r,2),i=c[0],s=c[1],o=Object(a.useState)(null),l=Object(J.a)(o,2),u=l[0],d=l[1],j=null!==i&&null!==u&&i!==u,b=Object(a.useCallback)((function(){if(j){var e=function(e,t){return"change_FPS(from=".concat(e,",to=").concat(t,")")}(i,u);t(e)}}),[j,i,u,t]),O=Object(a.useMemo)((function(){return Object(gn.jsx)(wn.a,{disabled:!j,onClick:b,children:"Save"})}),[b,j]);return Object(gn.jsx)(br,Object(f.a)(Object(f.a)({title:"Change Frame Rate",footer:O},n),{},{children:Object(gn.jsxs)(mr.a,{className:"px-2",children:[Object(gn.jsx)(Pn.a.Control,{placeholder:"From",type:"number",onChange:function(e){var t=parseFloat(e.currentTarget.value);isNaN(t)?s(null):s(t)}}),Object(gn.jsx)(Pn.a.Control,{placeholder:"To",type:"number",onChange:function(e){var t=parseFloat(e.currentTarget.value);isNaN(t)?d(null):d(t)}})]})}))},qr=function(e){var t=e.process,n=Object(hn.a)(e,["process"]),r=Object(a.useState)(!0),c=Object(J.a)(r,2),i=c[0],s=c[1],o=Object(a.useState)([0,0,0,0]),l=Object(J.a)(o,2),u=l[0],d=l[1],j=Object(a.useCallback)((function(e){return function(t){var n=parseFloat(t.currentTarget.value);isNaN(n)&&(n=0);var r=Object(X.a)(u);r[e]=n,d(r)}}),[u]),b=u.some((function(e){return 0!==e})),O=Object(a.useCallback)((function(){if(b){var e=u.map((function(e){return i?e:-e})),n=(r=e[0],a=e[1],c=e[2],s=e[3],"shift_offset(h=".concat(r,",m=").concat(a,",s=").concat(c,",ms=").concat(s,")"));t(n)}var r,a,c,s}),[t,b,u,i]),h=Object(a.useMemo)((function(){return Object(gn.jsx)(wn.a,{disabled:!b,onClick:O,children:"Save"})}),[O,b]);return Object(gn.jsx)(br,Object(f.a)(Object(f.a)({title:"Adjust Times",footer:h},n),{},{children:Object(gn.jsxs)(mr.a,{children:[Object(gn.jsx)(mr.a.Prepend,{children:Object(gn.jsx)(wn.a,{variant:"secondary",title:i?"Later":"Earlier",onClick:function(){return s(!i)},children:Object(gn.jsx)(pn.a,{icon:i?fn.M:fn.G})})}),Object(gn.jsx)(Pn.a.Control,{type:"number",placeholder:"hour",onChange:j(0)}),Object(gn.jsx)(Pn.a.Control,{type:"number",placeholder:"min",onChange:j(1)}),Object(gn.jsx)(Pn.a.Control,{type:"number",placeholder:"sec",onChange:j(2)}),Object(gn.jsx)(Pn.a.Control,{type:"number",placeholder:"ms",onChange:j(3)})]})}))},Wr=function(e){var t=e.process,n=Object(hn.a)(e,["process"]),r=nn(!0),c=Object(J.a)(r,1)[0],i=Object(a.useMemo)((function(){return c.filter((function(e){return e.code2 in _r}))}),[c]),s=Object(a.useState)(null),o=Object(J.a)(s,2),l=o[0],u=o[1],d=Object(a.useCallback)((function(){l&&t("translate",{language:l.code2})}),[l,t]),j=Object(a.useMemo)((function(){return Object(gn.jsx)(wn.a,{disabled:!l,onClick:d,children:"Translate"})}),[d,l]);return Object(gn.jsxs)(br,Object(f.a)(Object(f.a)({title:"Translate to",footer:j},n),{},{children:[Object(gn.jsx)(Pn.a.Label,{children:"Enabled languages not listed here are unsupported by Google Translate."}),Object(gn.jsx)(tr,{options:i,onChange:u})]}))},Yr=function(e){var t=e.update,n=Object(hn.a)(e,["update"]),r=lr(n.modalKey),i=Object(a.useState)(!1),s=Object(J.a)(i,2),o=s[0],l=s[1],u=Object(a.useState)({}),d=Object(J.a)(u,2),j=d[0],b=d[1],O=Object(a.useState)([]),p=Object(J.a)(O,2),x=p[0],v=p[1],m=function(e){var t=Object(a.useContext)(rr),n=Object(J.a)(t,2),r=n[0],c=n[1],i=Object(a.useContext)(ar),s=Object(J.a)(i,2),o=s[0],l=s[1];return Object(a.useCallback)((function(){var t=r.findIndex((function(t){return t===e}));if(-1!==t){var n=r.slice(0,t+1),a=o.slice(0,t+1);c(n),l(a)}}),[r,o,c,l,e])}(n.modalKey),g=Object(a.useCallback)(function(){var e=Object(Ct.a)(St.a.mark((function e(n,r){var a,c,i,s,o;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:m(),l(!0),a=x.reduce((function(e,t){return Object(f.a)(Object(h.a)({},t.path,Rr.Pending),e)}),{}),b(a),c=Object(Kn.a)(x),e.prev=6,c.s();case 8:if((i=c.n()).done){e.next=19;break}return s=i.value,a=Object(f.a)(Object(f.a)({},a),{},Object(h.a)({},s.path,Rr.Processing)),b(a),o=Object(f.a)({id:s.id,type:s.type,language:s.language,path:s.path},r),e.next=15,zt.modify(n,o);case 15:a=Object(f.a)(Object(f.a)({},a),{},Object(h.a)({},s.path,Rr.Done)),b(a);case 17:e.next=8;break;case 19:e.next=24;break;case 21:e.prev=21,e.t0=e.catch(6),c.e(e.t0);case 24:return e.prev=24,c.f(),e.finish(24);case 27:l(!1),t();case 29:case"end":return e.stop()}}),e,null,[[6,21,24,27]])})));return function(t,n){return e.apply(this,arguments)}}(),[m,x,t]),y=cr(),k=Object(a.useMemo)((function(){return[{id:"state",accessor:"path",selectHide:!0,Cell:function(e){var t=e.value,n=e.loose;if(n){var r=n[0];if(t in r){var a=r[t];return Object(gn.jsx)(Ur,{state:a})}}return null}},{Header:"Language",accessor:"_language",Cell:function(e){var t=e.value;return Object(gn.jsx)(Wn.a,{variant:"secondary",children:Object(gn.jsx)(ba,{text:t,long:!0})})}},{id:"file",Header:"File",accessor:"path",Cell:function(e){var t=e.value,n=t.lastIndexOf("/");return-1===n&&(n=t.lastIndexOf("\\")),-1!==n?t.slice(n+1):t}}]}),[]),w=Object(a.useMemo)((function(){var e;return null!==(e=null===r||void 0===r?void 0:r.flatMap((function(e){var t=function(e){return ne(e)?[e.radarrId,"movie"]:[e.sonarrEpisodeId,"episode"]}(e),n=Object(J.a)(t,2),r=n[0],a=n[1];return e.subtitles.flatMap((function(e){return null!==e.path?[{id:r,type:a,language:e.code2,path:e.path,_language:e}]:[]}))})))&&void 0!==e?e:[]}),[r]),S=[yr.useRowSelect,Br],C=Object(a.useMemo)((function(){return Object(gn.jsxs)(In.a,{as:gr.a,onSelect:function(e){return e&&g(e)},children:[Object(gn.jsx)(Vn,{size:"sm",loading:o,disabled:0===x.length,icon:fn.L,onClick:function(){return g("sync")},children:"Sync"}),Object(gn.jsx)(In.a.Toggle,{disabled:o||0===x.length,split:!0,variant:"light",size:"sm",className:"px-2"}),Object(gn.jsxs)(In.a.Menu,{children:[Object(gn.jsx)(In.a.Item,{eventKey:"remove_HI",children:Object(gn.jsx)(Qn,{icon:fn.p,children:"Remove HI Tags"})}),Object(gn.jsx)(In.a.Item,{eventKey:"remove_tags",children:Object(gn.jsx)(Qn,{icon:fn.n,children:"Remove Style Tags"})}),Object(gn.jsx)(In.a.Item,{eventKey:"OCR_fixes",children:Object(gn.jsx)(Qn,{icon:fn.z,children:"OCR Fixes"})}),Object(gn.jsx)(In.a.Item,{eventKey:"common",children:Object(gn.jsx)(Qn,{icon:fn.F,children:"Common Fixes"})}),Object(gn.jsx)(In.a.Item,{eventKey:"fix_uppercase",children:Object(gn.jsx)(Qn,{icon:fn.W,children:"Fix Uppercase"})}),Object(gn.jsx)(In.a.Item,{eventKey:"reverse_rtl",children:Object(gn.jsx)(Qn,{icon:fn.r,children:"Reverse RTL"})}),Object(gn.jsx)(In.a.Item,{onSelect:function(){return y("add-color")},children:Object(gn.jsx)(Qn,{icon:fn.J,children:"Add Color"})}),Object(gn.jsx)(In.a.Item,{onSelect:function(){return y("change-frame-rate")},children:Object(gn.jsx)(Qn,{icon:fn.v,children:"Change Frame Rate"})}),Object(gn.jsx)(In.a.Item,{onSelect:function(){return y("adjust-times")},children:Object(gn.jsx)(Qn,{icon:fn.l,children:"Adjust Times"})}),Object(gn.jsx)(In.a.Item,{onSelect:function(){return y("translate-sub")},children:Object(gn.jsx)(Qn,{icon:fn.B,children:"Translate"})})]})]})}),[y,o,x.length,g]);return Object(gn.jsxs)(c.a.Fragment,{children:[Object(gn.jsx)(br,Object(f.a)(Object(f.a)({title:"Subtitle Tools",footer:C,closeable:!o},n),{},{children:Object(gn.jsx)(ea,{isSelecting:!o&&0!==w.length,emptyText:"No External Subtitles Found",plugins:S,columns:k,onSelect:v,data:w,loose:[j]})})),Object(gn.jsx)(Fr,{process:g,modalKey:"add-color"}),Object(gn.jsx)(Gr,{process:g,modalKey:"change-frame-rate"}),Object(gn.jsx)(qr,{process:g,modalKey:"adjust-times"}),Object(gn.jsx)(Wr,{process:g,modalKey:"translate-sub"})]})},Vr=function(e){var t=e.onSearch,n=e.onFocus,r=e.onBlur,c=e.className,i=Object(a.useState)(""),s=Object(J.a)(i,2),o=s[0],u=s[1],d=Object(a.useState)([]),j=Object(J.a)(d,2),b=j[0],O=j[1],h=Object(l.h)(),f=Object(a.useCallback)((function(e){""===e?O([]):t(e).then((function(e){return O(e)}))}),[t]),p=Object(a.useMemo)((function(){return Object(Z.throttle)(f,500)}),[f]);Object(a.useEffect)((function(){p(o)}),[o,p]);var x=Object(a.useCallback)((function(){u(""),O([])}),[]),v=Object(a.useMemo)((function(){var e=b.map((function(e){return Object(gn.jsx)(In.a.Item,{eventKey:e.link,disabled:void 0===e.link,children:Object(gn.jsx)("span",{children:e.name})},e.name)}));return 0===e.length&&e.push(Object(gn.jsx)(In.a.Header,{children:"No Found"},"notify")),e}),[b]);return Object(gn.jsxs)(In.a,{show:0!==o.length,className:c,onFocus:n,onBlur:r,onSelect:function(e){e&&(x(),h.push(e))},children:[Object(gn.jsx)(Pn.a.Control,{type:"text",size:"sm",placeholder:"Search...",value:o,onChange:function(e){return u(e.currentTarget.value)}}),Object(gn.jsx)(In.a.Menu,{style:{maxHeight:256,overflowY:"auto"},children:v})]})},Qr=n(498);function Xr(e){return{style:{emptyText:e.emptyText,responsive:e.responsive,hoverable:e.hoverable,striped:e.striped,borderless:e.borderless,small:e.small,hideHeader:e.hideHeader,headersRenderer:e.headersRenderer,rowRenderer:e.rowRenderer},options:Object(hn.a)(e,["emptyText","responsive","hoverable","striped","borderless","small","hideHeader","headersRenderer","rowRenderer"])}}function Jr(e){return e.map((function(e){return Object(gn.jsx)("th",Object(f.a)(Object(f.a)({},e.getHeaderProps()),{},{children:e.render("Header")}))}))}function Zr(e){return Object(gn.jsx)("tr",Object(f.a)(Object(f.a)({},e.getRowProps()),{},{children:e.cells.map((function(e){return Object(gn.jsx)("td",Object(f.a)(Object(f.a)({className:e.column.className},e.getCellProps()),{},{children:e.render("Cell")}))}))}))}function $r(e){var t=e.emptyText,n=e.responsive,r=e.hoverable,c=e.striped,i=e.borderless,s=e.small,o=e.hideHeader,l=e.headers,u=e.rows,d=e.headersRenderer,j=e.rowRenderer,b=e.prepareRow,O=e.tableProps,h=e.tableBodyProps,p=Object(a.useMemo)((function(){return l.reduce((function(e,t){return t.headers.length>e?t.headers.length:e}),0)}),[l]),x=0===u.length,v=null!==d&&void 0!==d?d:Jr,m=null!==j&&void 0!==j?j:Zr;return Object(gn.jsxs)(Qr.a,Object(f.a)(Object(f.a)({size:s?"sm":void 0,striped:null===c||void 0===c||c,borderless:null===i||void 0===i||i,hover:r,responsive:null===n||void 0===n||n},O),{},{children:[Object(gn.jsx)("thead",{hidden:o,children:l.map((function(e){return Object(gn.jsx)("tr",Object(f.a)(Object(f.a)({},e.getHeaderGroupProps()),{},{children:v(e.headers)}))}))}),Object(gn.jsx)("tbody",Object(f.a)(Object(f.a)({},h),{},{children:t&&x?Object(gn.jsx)("tr",{children:Object(gn.jsx)("td",{colSpan:p,className:"text-center",children:t})}):u.map((function(e){return b(e),m(e)}))}))]}))}function ea(e){var t=e.plugins,n=Xr(Object(hn.a)(e,["plugins"])),r=n.style,a=n.options,c=yr.useTable.apply(void 0,[a,Lr].concat(Object(X.a)(null!==t&&void 0!==t?t:[]))),i=c.getTableProps,s=c.getTableBodyProps,o=c.headerGroups,l=c.rows,u=c.prepareRow;return Object(gn.jsx)($r,Object(f.a)(Object(f.a)({},r),{},{headers:o,rows:l,prepareRow:u,tableProps:i(),tableBodyProps:s()}))}function ta(e,t){return e.isGrouped?Object(gn.jsx)("span",Object(f.a)(Object(f.a)({},t.getToggleRowExpandedProps()),{},{children:e.render("Cell")})):t.canExpand||e.isAggregated?null:e.render("Cell")}function na(e){if(e.canExpand){var t=e.cells.find((function(e){return e.isGrouped}));if(t){var n=e.isExpanded?90:void 0;return Object(gn.jsx)("tr",Object(f.a)(Object(f.a)({},e.getRowProps()),{},{children:Object(gn.jsx)("td",Object(f.a)(Object(f.a)({className:"p-0"},t.getCellProps()),{},{colSpan:e.cells.length,children:Object(gn.jsxs)("span",Object(f.a)(Object(f.a)({},e.getToggleRowExpandedProps()),{},{className:"d-flex align-items-center p-2",children:[t.render("Cell"),Object(gn.jsx)(pn.a,{className:"mx-2",icon:fn.i,rotation:n})]}))}))}))}return null}return Object(gn.jsx)("tr",Object(f.a)(Object(f.a)({},e.getRowProps()),{},{children:e.cells.filter((function(e){return!e.isPlaceholder})).map((function(t){return Object(gn.jsx)("td",Object(f.a)(Object(f.a)({className:t.column.className},t.getCellProps()),{},{children:ta(t,e)}))}))}))}function ra(e){return e.filter((function(e){return!e.isGrouped})).map((function(e){return Object(gn.jsx)("th",Object(f.a)(Object(f.a)({},e.getHeaderProps()),{},{children:e.render("Header")}))}))}var aa,ca=function(e){var t=[yr.useGroupBy,yr.useSortBy,yr.useExpanded];return Object(gn.jsx)(ea,Object(f.a)(Object(f.a)({},e),{},{plugins:t,headersRenderer:ra,rowRenderer:na}))},ia=n(516),sa=n(268),oa=function(e){var t=e.count,n=e.index,r=e.size,c=e.total,i=e.canPrevious,s=e.previous,o=e.canNext,l=e.next,u=e.goto,d=e.loadState,j=0===c?0:r*n+1,b=Math.min(r*(n+1),c),O=void 0!==d,h=Object(a.useMemo)((function(){return Object(X.a)(Array(t).keys()).map((function(e){return Math.abs(e-n)>=4&&0!==e&&e!==t-1?null:Object(gn.jsx)(ia.a.Item,{disabled:O,active:n===e,onClick:function(){return u(e)},children:e+1},e)})).flatMap((function(e,t,n){return null===e?null===n[t+1]?[]:Object(gn.jsx)(ia.a.Ellipsis,{disabled:!0},t):[e]}))}),[t,n,u,O]);return Object(gn.jsx)(yn.a,{fluid:!0,className:"mb-3",children:Object(gn.jsxs)(Vt.a,{children:[Object(gn.jsx)(sa.a,{className:"d-flex align-items-center justify-content-start",children:Object(gn.jsxs)("span",{children:["Show ",j," to ",b," of ",c," entries"]})}),Object(gn.jsx)(sa.a,{className:"d-flex justify-content-end",children:Object(gn.jsxs)(ia.a,{className:"m-0",hidden:t<=1,children:[Object(gn.jsx)(ia.a.Prev,{onClick:s,disabled:!i&&O}),h,Object(gn.jsx)(ia.a.Next,{onClick:l,disabled:!o&&O})]})})]})})};function la(e){var t=e.async,n=e.autoScroll,r=e.canSelect,i=e.plugins,s=Xr(Object(hn.a)(e,["async","autoScroll","canSelect","plugins"])),o=s.style,l=s.options,u=[Lr,yr.usePagination];t&&u.push(Pr),r&&u.push(yr.useRowSelect,Br),i&&u.push.apply(u,Object(X.a)(i));var d=yr.useTable.apply(void 0,[l].concat(u)),j=d.getTableProps,b=d.getTableBodyProps,O=d.headerGroups,h=d.rows,p=d.prepareRow,x=d.page,v=d.canNextPage,m=d.canPreviousPage,g=d.pageCount,y=d.gotoPage,k=d.nextPage,w=d.previousPage,S=d.setPageSize,C=d.state,N=C.pageIndex,I=C.pageSize,P=C.pageToLoad,A=C.needLoadingScreen,T=Qt((function(e){return e.site.pageSize}));Object(a.useEffect)((function(){n&&be()}),[N,n]),Object(a.useEffect)((function(){var e=l.isSelecting;r&&!Object(Z.isUndefined)(e)&&S(e?h.length:T)}),[r,T,l.isSelecting,h.length,S]);var E=l.asyncState?l.asyncState.data.order.length:h.length,M=Object(a.useCallback)((function(e){var t=N*I,n=t+I;return!1===e.order.slice(t,n).every(Z.isNull)}),[N,I]);return A&&l.asyncState?Object(gn.jsx)(Un,{state:l.asyncState,exist:M}):Object(gn.jsxs)(c.a.Fragment,{children:[Object(gn.jsx)($r,Object(f.a)(Object(f.a)({},o),{},{headers:O,rows:x,prepareRow:p,tableProps:j(),tableBodyProps:b()})),Object(gn.jsx)(oa,{loadState:P,count:g,index:N,size:I,total:E,canPrevious:m,canNext:v,previous:w,next:k,goto:y})]})}!function(e){e[e.Delete=0]="Delete",e[e.Download=1]="Download",e[e.Manual=2]="Manual",e[e.Upgrade=3]="Upgrade",e[e.Upload=4]="Upload",e[e.Sync=5]="Sync"}(aa||(aa={}));var ua=function(e){var t=e.action,n=e.title,r=null;switch(t){case aa.Delete:r=fn.Z;break;case aa.Download:r=fn.q;break;case aa.Manual:r=fn.bb;break;case aa.Sync:r=fn.l;break;case aa.Upgrade:r=fn.O;break;case aa.Upload:r=fn.m}return r?Object(gn.jsx)(pn.a,{title:n,icon:r}):null},da=function(e){var t=e.messages,n=Object(hn.a)(e,["messages"]),r=Object(gn.jsx)(xn.a,{hidden:0===t.length,id:"overlay-icon",children:Object(gn.jsx)(xn.a.Content,{children:t.map((function(e){return Object(gn.jsx)("li",{children:e},e)}))})});return Object(gn.jsx)(vn.a,{overlay:r,children:Object(gn.jsx)(pn.a,Object(f.a)({},n))})},ja=function(e){var t=e.children,n=e.animation;return Object(gn.jsxs)("div",{className:"d-flex flex-column flex-grow-1 align-items-center py-5",children:[Object(gn.jsx)(mn.a,{animation:null!==n&&void 0!==n?n:"border",className:"mb-2"}),t]})},ba=function(e){var t=e.text,n=e.className,r=e.long,c=Object(a.useMemo)((function(){var e=t.code2,n=":HI",a=":Forced";r&&(e=t.name,n=" HI",a=" Forced");var c=e;return t.hi?c+=n:t.forced&&(c+=a),c}),[t,r]);return Object(gn.jsx)("span",{title:t.name,className:n,children:c})},Oa=function(e){var t=e.children,n=e.text,r=e.placement,a=e.delay;if(Object(Z.isNull)(n)||Object(Z.isUndefined)(n))return t;var c=Object(gn.jsx)(xn.a,{className:"mw-100 py-1",id:n,children:Object(gn.jsx)("span",{className:"mx-2",children:n})});return Object(gn.jsx)(vn.a,{delay:a,overlay:c,placement:r,children:t})},ha=n(499),fa=n(514),pa="data:image/png;base64,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",xa=n(295),va=n(270),ma=c.a.createContext([]),ga=c.a.createContext({}),ya=function(e){var t=e.link,n=e.name,r=e.icon,c=Object(a.useContext)(ga),i=Object(a.useContext)(Is),s=Object(a.useMemo)((function(){var e=null;if(n in c){var t=c[n];"number"===typeof t&&(e=t)}return e}),[c,n]);return Object(gn.jsx)(u.c,{activeClassName:"sb-active",className:"list-group-item list-group-item-action sidebar-button",to:t,onClick:i,children:Object(gn.jsx)(wa,{badge:null!==s&&void 0!==s?s:void 0,name:n,icon:r})})},ka=function(e){var t=e.icon,n=e.name,r=e.children,c=Object(a.useContext)(ga),i=Object(a.useContext)(ma),s=Object(a.useContext)(Is),o=n.toLowerCase(),l=Qt((function(e){return e.site.sidebar})),d=Ia(),j=Object(a.useMemo)((function(){var e=null,t=null;if(n in c){var r=c[n];if("number"===typeof r)e=r;else if("object"===typeof r)for(var a in e=0,t=r,r)e+=r[a]}return[e,t]}),[c,n]),b=Object(J.a)(j,2),O=b[0],h=b[1],f=Object(a.useMemo)((function(){return l===o}),[l,o]),p=Object(a.useMemo)((function(){return"sidebar-collapse-box ".concat(f?"active":"")}),[f]),x=Object(a.useMemo)((function(){return r.filter((function(e){var t;return!i.includes(null!==(t=e.hiddenKey)&&void 0!==t?t:"")})).map((function(e){var t,n=null;return h&&e.name in h&&(n=h[e.name]),Object(gn.jsx)(u.c,{activeClassName:"sb-active",className:"list-group-item list-group-item-action sidebar-button sb-collapse",to:e.link,onClick:s,children:Object(gn.jsx)(wa,{badge:0===n?void 0:null!==(t=n)&&void 0!==t?t:void 0,name:e.name})},e.name)}))}),[r,i,h,s]);return 0===x.length?null:Object(gn.jsxs)("div",{className:p,children:[Object(gn.jsx)(xa.a,{action:!0,className:"sidebar-button",onClick:function(){d(f?"":o)},children:Object(gn.jsx)(wa,{badge:0===O?void 0:null!==O&&void 0!==O?O:void 0,icon:t,name:n})}),Object(gn.jsx)(va.a,{in:f,children:Object(gn.jsx)("div",{className:"sidebar-collapse",children:x})})]})},wa=function(e){var t=e.name,n=e.icon,r=e.badge;return Object(gn.jsxs)(c.a.Fragment,{children:[n&&Object(gn.jsx)(pn.a,{size:"1x",className:"icon",icon:n}),Object(gn.jsxs)("span",{className:"d-flex flex-grow-1 justify-content-between",children:[t," ",Object(gn.jsx)(Wn.a,{variant:"secondary",children:r})]})]})},Sa="sonarr-disabled",Ca="radarr-disabled",Na=[{icon:fn.L,name:"Series",link:"/series",hiddenKey:Sa},{icon:fn.v,name:"Movies",link:"/movies",hiddenKey:Ca},{icon:fn.l,name:"History",children:[{name:"Series",link:"/history/series",hiddenKey:Sa},{name:"Movies",link:"/history/movies",hiddenKey:Ca},{name:"Statistics",link:"/history/stats"}]},{icon:fn.u,name:"Blacklist",children:[{name:"Series",link:"/blacklist/series",hiddenKey:Sa},{name:"Movies",link:"/blacklist/movies",hiddenKey:Ca}]},{icon:fn.t,name:"Wanted",children:[{name:"Series",link:"/wanted/series",hiddenKey:Sa},{name:"Movies",link:"/wanted/movies",hiddenKey:Ca}]},{icon:fn.o,name:"Settings",children:[{name:"General",link:"/settings/general"},{name:"Languages",link:"/settings/languages"},{name:"Providers",link:"/settings/providers"},{name:"Subtitles",link:"/settings/subtitles"},{name:"Sonarr",link:"/settings/sonarr"},{name:"Radarr",link:"/settings/radarr"},{name:"Notifications",link:"/settings/notifications"},{name:"Scheduler",link:"/settings/scheduler"},{name:"UI",link:"/settings/ui"}]},{icon:fn.C,name:"System",children:[{name:"Tasks",link:"/system/tasks"},{name:"Logs",link:"/system/logs"},{name:"Providers",link:"/system/providers"},{name:"Status",link:"/system/status"},{name:"Releases",link:"/system/releases"}]}];n(349);function Ia(){return Xt(nt)}var Pa=function(e){var t=e.open;ce(Xt(Je));var n=Object(a.useContext)(Is),r=Qt((function(e){return e.site.badges})),i=r.movies,s=r.episodes,o=r.providers,u=bn(),d=On(),j=Object(a.useMemo)((function(){return{Wanted:{Series:u?s:0,Movies:d?i:0},System:{Providers:o}}}),[i,s,o,u,d]),b=Object(a.useMemo)((function(){var e=[];return u||e.push(Sa),d||e.push(Ca),e}),[u,d]),O=Object(l.h)(),h=Ia();Object(a.useEffect)((function(){var e=O.location.pathname.split("/"),t=e.length;h(t>=3?e[t-2]:e[t-1])}),[O.location.pathname,h]);var p=["sidebar-container"],x=["sidebar-overlay"];!0===t&&(p.push("open"),x.push("open"));var v=Object(a.useMemo)((function(){return Na.map((function(e){var t;return b.includes(null!==(t=e.hiddenKey)&&void 0!==t?t:"")?null:"children"in e?Object(gn.jsx)(ka,Object(f.a)({},e),e.name):Object(gn.jsx)(ya,Object(f.a)({},e),e.link)}))}),[b]),m=ae();return Object(gn.jsxs)(c.a.Fragment,{children:[Object(gn.jsxs)("aside",{className:p.join(" "),children:[Object(gn.jsx)(yn.a,{className:"sidebar-title d-flex align-items-center d-md-none",children:Object(gn.jsx)(ha.a,{alt:"brand",src:pa,width:"32",height:"32",onClick:m,className:"cursor-pointer"})}),Object(gn.jsx)(ma.Provider,{value:b,children:Object(gn.jsx)(ga.Provider,{value:j,children:Object(gn.jsx)(fa.a,{variant:"flush",children:v})})})]}),Object(gn.jsx)("div",{className:x.join(" "),onClick:n})]})},Aa=function(e){var t=e.children;return Object(gn.jsx)(yn.a,{className:"my-3",children:Object(gn.jsxs)(kn.a,{className:"d-flex flex-nowrap justify-content-between align-items-center",variant:"danger",children:[Object(gn.jsxs)("div",{children:[Object(gn.jsx)(pn.a,{className:"mr-2",icon:fn.t}),Object(gn.jsx)("span",{children:t})]}),Object(gn.jsx)(wn.a,{variant:"outline-danger",onClick:je,children:"Reload"})]})})},Ta="https://github.com/morpheus65535/bazarr",Ea=function(e){var t=e.error;return Object(gn.jsxs)(yn.a,{className:"d-flex flex-column align-items-center my-5",children:[Object(gn.jsxs)("h1",{children:[Object(gn.jsx)(pn.a,{className:"mr-2",icon:Nn.g}),"Ouch! UI is crashed!"]}),Object(gn.jsx)("p",{children:t.message}),Object(gn.jsxs)("div",{className:"d-flex flex-row",children:[Object(gn.jsx)(wn.a,{className:"mx-1",href:"".concat(Ta,"/issues/new/choose"),target:"_blank",variant:"warning",children:"Report Issue"}),Object(gn.jsx)(wn.a,{className:"mx-1",onClick:je,variant:"light",children:"Reload Page"})]})]})},Ma=n(510);n(350);function Ka(e){return Ba.apply(this,arguments)}function Ba(){return(Ba=Object(Ct.a)(St.a.mark((function e(t){var n;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Rt.search(t);case 2:return n=e.sent,e.abrupt("return",n.map((function(e){var t;return t=e.sonarrSeriesId?"/series/".concat(e.sonarrSeriesId):e.radarrId?"/movies/".concat(e.radarrId):"",{name:"".concat(e.title," (").concat(e.year,")"),link:t}})));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Da=function(){var e,t,n=Xt(Xe),r=$t(),c="form"===(null!==(e=null===(t=Object(J.a)(r,1)[0].data)||void 0===t?void 0:t.auth.type)&&void 0!==e?e:"none"),i=Object(a.useContext)(Is),s=Qt((function(e){return e.site.offline})),o=Object(a.useMemo)((function(){return Object(gn.jsxs)(In.a,{alignRight:!0,children:[Object(gn.jsx)(In.a.Toggle,{className:"dropdown-hidden",as:wn.a,children:Object(gn.jsx)(pn.a,{icon:fn.bb})}),Object(gn.jsxs)(In.a.Menu,{children:[Object(gn.jsx)(In.a.Item,{onClick:function(){Rt.restart()},children:"Restart"}),Object(gn.jsx)(In.a.Item,{onClick:function(){Rt.shutdown()},children:"Shutdown"}),Object(gn.jsx)(In.a.Divider,{hidden:!c}),Object(gn.jsx)(In.a.Item,{hidden:!c,onClick:function(){Rt.logout().then((function(){return n()}))},children:"Logout"})]})]})}),[c,n]),l=Object(a.useState)(!1),u=Object(J.a)(l,2),d=u[0],j=u[1],b=Object(a.useCallback)((function(){j(!0),Rt.status().finally((function(){return j(!1)}))}),[]),O=ae();return Object(gn.jsxs)(Ma.a,{bg:"primary",className:"flex-grow-1 px-0",children:[Object(gn.jsx)("div",{className:"header-icon px-3 m-0 d-none d-md-block",children:Object(gn.jsx)(ha.a,{alt:"brand",src:pa,width:"32",height:"32",onClick:O,className:"cursor-pointer"})}),Object(gn.jsx)(wn.a,{className:"mx-2 m-0 d-md-none",onClick:i,children:Object(gn.jsx)(pn.a,{icon:fn.c})}),Object(gn.jsx)(yn.a,{fluid:!0,children:Object(gn.jsxs)(Vt.a,{noGutters:!0,className:"flex-grow-1",children:[Object(gn.jsx)(sa.a,{xs:6,sm:4,className:"d-flex align-items-center",children:Object(gn.jsx)(Vr,{onSearch:Ka})}),Object(gn.jsxs)(sa.a,{className:"d-flex flex-row align-items-center justify-content-end pr-2",children:[Object(gn.jsx)(wn.a,{href:"https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=XHHRWXT9YB7WE&source=url",target:"_blank",children:Object(gn.jsx)(pn.a,{icon:fn.x})}),s?Object(gn.jsx)(Vn,{loading:d,className:"ml-2",variant:"warning",icon:fn.I,onClick:b,children:"Reconnect"}):o]})]})})]})},za=n(511);n(351);var Ra=function(e){var t=e.message,n=e.id,r=e.type,c=Xt(et),i=Object(a.useCallback)((function(){return c(n)}),[c,n]);return Object(gn.jsxs)(za.a,{onClose:i,animation:!1,children:[Object(gn.jsxs)(za.a.Header,{children:[Object(gn.jsx)(pn.a,{className:"mr-1",icon:fn.t}),Object(gn.jsx)("strong",{className:"mr-auto",children:Object(Z.capitalize)(r)})]}),Object(gn.jsx)(za.a.Body,{children:t})]})},La=function(){var e=Qt((function(e){return e.site.notifications})),t=Object(a.useMemo)((function(){return e.map((function(e,t){return Object(gn.jsx)(Ra,Object(f.a)({},e),e.id)}))}),[e]);return Object(gn.jsx)("div",{className:"alert-container",children:Object(gn.jsx)("div",{className:"toast-container",children:t})})},_a="/empty-page",Ha=function(){return Object(gn.jsxs)(yn.a,{className:"d-flex flex-column align-items-center my-5",children:[Object(gn.jsxs)("h1",{children:[Object(gn.jsx)(pn.a,{className:"mr-2",icon:Nn.c}),"404"]}),Object(gn.jsx)("p",{children:"The Request URL No Found"})]})},Ua=n(38),Fa=function(e){var t=e.blacklist,n=e.update,r=Object(a.useMemo)((function(){return[{Header:"Name",accessor:"title",className:"text-nowrap",Cell:function(e){var t="/movies/".concat(e.row.original.radarrId);return Object(gn.jsx)(u.b,{to:t,children:Object(gn.jsx)("span",{children:e.value})})}},{Header:"Language",accessor:"language",Cell:function(e){var t=e.value;return t?Object(gn.jsx)(ba,{text:t,long:!0}):null}},{Header:"Provider",accessor:"provider"},{Header:"Date",accessor:"timestamp",Cell:function(e){return e.value?Object(gn.jsx)(Oa,{text:e.row.original.parsed_timestamp,delay:1,children:Object(gn.jsx)("span",{children:e.value})}):null}},{accessor:"subs_id",Cell:function(e){var t=e.value;return Object(gn.jsx)(qn,{size:"sm",variant:"light",noReset:!0,promise:function(){return Kt.deleteBlacklist(!1,{provider:e.row.original.provider,subs_id:t})},onSuccess:n,children:Object(gn.jsx)(pn.a,{icon:fn.Z})})}}]}),[n]);return Object(gn.jsx)(la,{emptyText:"No Blacklisted Movies Subtitles",columns:r,data:t})},Ga=function(){var e=function(){var e=Xt(dt);return Zt(Qt((function(e){return e.movie.blacklist})),e)}(),t=Object(J.a)(e,2),n=t[0],r=t[1];return ce(r),Object(gn.jsx)(Un,{state:n,children:function(e){return Object(gn.jsxs)(yn.a,{fluid:!0,children:[Object(gn.jsx)(Ua.a,{children:Object(gn.jsx)("title",{children:"Movies Blacklist - Bazarr"})}),Object(gn.jsx)($n,{children:Object(gn.jsx)($n.AsyncButton,{icon:fn.Z,disabled:0===e.length,promise:function(){return Kt.deleteBlacklist(!0)},onSuccess:r,children:"Remove All"})}),Object(gn.jsx)(Vt.a,{children:Object(gn.jsx)(Fa,{blacklist:e,update:r})})]})}})},qa=function(e){var t=e.blacklist,n=e.update,r=Object(a.useMemo)((function(){return[{Header:"Series",accessor:"seriesTitle",className:"text-nowrap",Cell:function(e){var t="/series/".concat(e.row.original.sonarrSeriesId);return Object(gn.jsx)(u.b,{to:t,children:Object(gn.jsx)("span",{children:e.value})})}},{Header:"Episode",accessor:"episode_number"},{accessor:"episodeTitle"},{Header:"Language",accessor:"language",Cell:function(e){var t=e.value;return t?Object(gn.jsx)(ba,{text:t,long:!0}):null}},{Header:"Provider",accessor:"provider"},{Header:"Date",accessor:"timestamp",Cell:function(e){return e.value?Object(gn.jsx)(Oa,{text:e.row.original.parsed_timestamp,delay:1,children:Object(gn.jsx)("span",{children:e.value})}):null}},{accessor:"subs_id",Cell:function(e){var t=e.value;return Object(gn.jsx)(qn,{size:"sm",variant:"light",noReset:!0,promise:function(){return Tt.deleteBlacklist(!1,{provider:e.row.original.provider,subs_id:t})},onSuccess:n,children:Object(gn.jsx)(pn.a,{icon:fn.Z})})}}]}),[n]);return Object(gn.jsx)(la,{emptyText:"No Blacklisted Series Subtitles",columns:r,data:t})},Wa=function(){var e=function(){var e=Xt(kt);return Zt(Qt((function(e){return e.series.blacklist})),e)}(),t=Object(J.a)(e,2),n=t[0],r=t[1];return ce(r),Object(gn.jsx)(Un,{state:n,children:function(e){return Object(gn.jsxs)(yn.a,{fluid:!0,children:[Object(gn.jsx)(Ua.a,{children:Object(gn.jsx)("title",{children:"Series Blacklist - Bazarr"})}),Object(gn.jsx)($n,{children:Object(gn.jsx)($n.AsyncButton,{icon:fn.Z,disabled:0===e.length,promise:function(){return Tt.deleteBlacklist(!0)},onSuccess:r,children:"Remove All"})}),Object(gn.jsx)(Vt.a,{children:Object(gn.jsx)(qa,{blacklist:e,update:r})})]})}})},Ya=function(){var e=bn(),t=On();return Object(gn.jsxs)(l.e,{children:[e&&Object(gn.jsx)(l.c,{exact:!0,path:"/blacklist/series",children:Object(gn.jsx)(Wa,{})}),t&&Object(gn.jsx)(l.c,{path:"/blacklist/movies",children:Object(gn.jsx)(Ga,{})}),Object(gn.jsx)(l.c,{path:"/blacklist/*",children:Object(gn.jsx)(l.b,{to:_a})})]})},Va=function(e){var t=e.state,n=e.columns,r=e.type,a=e.tableUpdater,c=Object(Z.capitalize)(r);return Object(gn.jsxs)(yn.a,{fluid:!0,children:[Object(gn.jsx)(Ua.a,{children:Object(gn.jsxs)("title",{children:[c," History - Bazarr"]})}),Object(gn.jsx)(Vt.a,{children:Object(gn.jsx)(Un,{state:t,children:function(e){return Object(gn.jsx)(la,{emptyText:"Nothing Found in ".concat(c," History"),columns:n,data:e,externalUpdate:a})}})})]})},Qa=function(){var e=function(){var e=Xt(st);return Zt(Qt((function(e){return e.movie.historyList})),e)}(),t=Object(J.a)(e,2),n=t[0],r=t[1];ce(r);var c=Object(a.useCallback)((function(e){return r()}),[r]),i=Object(a.useMemo)((function(){return[{accessor:"action",className:"text-center",Cell:function(e){return Object(gn.jsx)(ua,{action:e.value})}},{Header:"Name",accessor:"title",className:"text-nowrap",Cell:function(e){var t="/movies/".concat(e.row.original.radarrId);return Object(gn.jsx)(u.b,{to:t,children:Object(gn.jsx)("span",{children:e.value})})}},{Header:"Language",accessor:"language",Cell:function(e){var t=e.value;return t?Object(gn.jsx)(Wn.a,{variant:"secondary",children:Object(gn.jsx)(ba,{text:t,long:!0})}):null}},{Header:"Score",accessor:"score"},{Header:"Date",accessor:"timestamp",Cell:function(e){return e.value?Object(gn.jsx)(Oa,{text:e.row.original.parsed_timestamp,delay:1,children:Object(gn.jsx)("span",{children:e.value})}):null}},{accessor:"description",Cell:function(e){var t=e.row,n=e.value,r=Object(gn.jsx)(xn.a,{id:"description-".concat(t.id),children:Object(gn.jsx)(xn.a.Content,{children:n})});return Object(gn.jsx)(vn.a,{overlay:r,children:Object(gn.jsx)(pn.a,{size:"sm",icon:fn.A})})}},{accessor:"upgradable",Cell:function(e){var t=Object(gn.jsx)(xn.a,{id:"description-".concat(e.row.id),children:Object(gn.jsx)(xn.a.Content,{children:"This Subtitles File Is Eligible For An Upgrade."})});return e.value?Object(gn.jsx)(vn.a,{overlay:t,children:Object(gn.jsx)(pn.a,{size:"sm",icon:fn.O})}):null}},{accessor:"blacklisted",Cell:function(e){var t=e.row,n=e.externalUpdate,r=t.original;return Object(gn.jsx)(Or,{history:r,update:function(){return n&&n(t)},promise:function(e){return Kt.addBlacklist(r.radarrId,e)}})}}]}),[]);return Object(gn.jsx)(Va,{type:"movies",state:n,columns:i,tableUpdater:c})},Xa=function(){var e=function(){var e=Xt(gt);return Zt(Qt((function(e){return e.series.historyList})),e)}(),t=Object(J.a)(e,2),n=t[0],r=t[1];ce(r);var c=Object(a.useCallback)((function(e){return r()}),[r]),i=Object(a.useMemo)((function(){return[{accessor:"action",className:"text-center",Cell:function(e){var t=e.value;return Object(gn.jsx)(ua,{action:t})}},{Header:"Series",accessor:"seriesTitle",Cell:function(e){var t="/series/".concat(e.row.original.sonarrSeriesId);return Object(gn.jsx)(u.b,{to:t,children:Object(gn.jsx)("span",{children:e.value})})}},{Header:"Episode",accessor:"episode_number"},{Header:"Title",accessor:"episodeTitle"},{Header:"Language",accessor:"language",Cell:function(e){var t=e.value;return t?Object(gn.jsx)(Wn.a,{variant:"secondary",children:Object(gn.jsx)(ba,{text:t,long:!0})}):null}},{Header:"Score",accessor:"score"},{Header:"Date",accessor:"timestamp",Cell:function(e){return e.value?Object(gn.jsx)(Oa,{text:e.row.original.parsed_timestamp,delay:1,children:Object(gn.jsx)("span",{children:e.value})}):null}},{accessor:"description",Cell:function(e){var t=e.row,n=e.value,r=Object(gn.jsx)(xn.a,{id:"description-".concat(t.id),children:Object(gn.jsx)(xn.a.Content,{children:n})});return Object(gn.jsx)(vn.a,{overlay:r,children:Object(gn.jsx)(pn.a,{size:"sm",icon:fn.A})})}},{accessor:"upgradable",Cell:function(e){var t=Object(gn.jsx)(xn.a,{id:"description-".concat(e.row.id),children:Object(gn.jsx)(xn.a.Content,{children:"This Subtitles File Is Eligible For An Upgrade."})});return e.value?Object(gn.jsx)(vn.a,{overlay:t,children:Object(gn.jsx)(pn.a,{size:"sm",icon:fn.O})}):null}},{accessor:"blacklisted",Cell:function(e){var t=e.row,n=e.externalUpdate,r=t.original,a=r.sonarrEpisodeId,c=r.sonarrSeriesId;return Object(gn.jsx)(Or,{history:r,update:function(){return n&&n(t)},promise:function(e){return Tt.addBlacklist(c,a,e)}})}}]}),[]);return Object(gn.jsx)(Va,{type:"series",state:n,columns:i,tableUpdater:c})},Ja=n(519),Za=n(500),$a=n(504),ec=n(290),tc=n(291),nc=n(146),rc=n(142),ac=n(294),cc=[{label:"Automatically Downloaded",value:0},{label:"Manually Downloaded",value:1},{label:"Upgraded",value:2}],ic=[{label:"Last Week",value:"week"},{label:"Last Month",value:"month"},{label:"Last Trimester",value:"trimester"},{label:"Last Year",value:"year"}];function sc(e){var t=e.movies.map((function(e){return{date:e.date,movies:e.count}})),n=e.series.map((function(e){return{date:e.date,series:e.count}}));return Object(Z.merge)(t,n)}var oc=function(e){return e.name},lc=function(e){var t=e.children;return Object(gn.jsx)(sa.a,{xs:6,lg:3,className:"p-1",children:t})},uc=function(){var e=nn(!0),t=Object(J.a)(e,1)[0],n=dn(),r=Object(J.a)(n,2),i=r[0];ce(r[1]);var s=Object(a.useState)("month"),o=Object(J.a)(s,2),l=o[0],u=o[1],d=Object(a.useState)(null),j=Object(J.a)(d,2),b=j[0],O=j[1],h=Object(a.useState)(null),f=Object(J.a)(h,2),p=f[0],x=f[1],v=Object(a.useState)(null),m=Object(J.a)(v,2),g=m[0],y=m[1],k=Object(a.useCallback)((function(){return Mt.stats(l,null!==b&&void 0!==b?b:void 0,null===g||void 0===g?void 0:g.name,null===p||void 0===p?void 0:p.code2)}),[l,null===p||void 0===p?void 0:p.code2,b,g]);return Object(gn.jsxs)(yn.a,{fluid:!0,className:"vh-75",children:[Object(gn.jsx)(Ua.a,{children:Object(gn.jsx)("title",{children:"History Statistics - Bazarr"})}),Object(gn.jsx)(Fn,{promise:k,children:function(e){return Object(gn.jsxs)(c.a.Fragment,{children:[Object(gn.jsxs)($n,{scroll:!1,children:[Object(gn.jsx)(lc,{children:Object(gn.jsx)(zn,{placeholder:"Time...",options:ic,value:l,onChange:function(e){return u(null!==e&&void 0!==e?e:"month")}})}),Object(gn.jsx)(lc,{children:Object(gn.jsx)(zn,{placeholder:"Action...",clearable:!0,options:cc,value:b,onChange:O})}),Object(gn.jsx)(lc,{children:Object(gn.jsx)(Gn,{placeholder:"Provider...",clearable:!0,state:i,label:oc,onChange:y})}),Object(gn.jsx)(lc,{children:Object(gn.jsx)(tr,{clearable:!0,options:t,value:p,onChange:x})})]}),Object(gn.jsx)(Ja.a,{height:"100%",children:Object(gn.jsxs)(Za.a,{data:sc(e),children:[Object(gn.jsx)($a.a,{strokeDasharray:"4 2"}),Object(gn.jsx)(ec.a,{dataKey:"date"}),Object(gn.jsx)(tc.a,{allowDecimals:!1}),Object(gn.jsx)(nc.a,{}),Object(gn.jsx)(rc.a,{verticalAlign:"top"}),Object(gn.jsx)(ac.a,{name:"Series",dataKey:"series",fill:"#2493B6"}),Object(gn.jsx)(ac.a,{name:"Movies",dataKey:"movies",fill:"#FFC22F"})]})})]})}})]})},dc=function(){var e=bn(),t=On();return Object(gn.jsxs)(l.e,{children:[e&&Object(gn.jsx)(l.c,{exact:!0,path:"/history/series",children:Object(gn.jsx)(Xa,{})}),t&&Object(gn.jsx)(l.c,{exact:!0,path:"/history/movies",children:Object(gn.jsx)(Qa,{})}),Object(gn.jsx)(l.c,{exact:!0,path:"/history/stats",children:Object(gn.jsx)(uc,{})}),Object(gn.jsx)(l.c,{path:"/history/*",children:Object(gn.jsx)(l.b,{to:_a})})]})},jc=function(e){var t,n,r,i=e.state,s=e.dirtyItems,o=e.update,l=e.modify,u=e.editMode,d=e.select,j=e.columns,b=e.loader,O=e.name,h=cr(),f=Object(a.useCallback)((function(e,t){h(t,e.original)}),[h]),p=i.data,x=Object(a.useMemo)((function(){return le(p)}),[p]),v=(t=x,n=s,r=bc,Object(a.useMemo)((function(){return ue(t,n,r)}),[t,n,r])),m=en(),g=Object(J.a)(m,1)[0];return Object(gn.jsxs)(c.a.Fragment,{children:[Object(gn.jsx)(la,{async:!0,autoScroll:!0,canSelect:!0,columns:j,data:v,asyncState:i,asyncId:oe,asyncLoader:b,loose:[g],isSelecting:u,onSelect:d,emptyText:"No ".concat(O," Found"),externalUpdate:f}),Object(gn.jsx)(pr,{modalKey:"edit",submit:l,onSuccess:function(e){var t=oe(e);o([t])}})]})};function bc(e,t){return oe(e)===oe(t)}var Oc,hc=function(e){var t=e.updateAction,n=Object(hn.a)(e,["updateAction"]),r=n.state,i=Object(a.useState)(!1),s=Object(J.a)(i,2),o=s[0],l=s[1],u=Object(a.useState)(!1),d=Object(J.a)(u,2),j=d[0],b=d[1],O=Jt(t,Object(a.useCallback)((function(){l((function(e){return b(e),e})),k([])}),[])),h=Object(a.useState)([]),p=Object(J.a)(h,2),x=p[0],v=p[1],m=Object(a.useState)([]),g=Object(J.a)(m,2),y=g[0],k=g[1],w=en(),S=Object(J.a)(w,1)[0],C=Object(a.useMemo)((function(){var e=[];return e.push(Object(gn.jsx)(In.a.Item,{children:"Clear Profile"},"clear-profile")),e.push(Object(gn.jsx)(In.a.Divider,{},"dropdown-divider")),e.push.apply(e,Object(X.a)(S.map((function(e){return Object(gn.jsx)(In.a.Item,{eventKey:e.profileId.toString(),children:e.name},e.profileId)})))),e}),[S]),N=Object(a.useCallback)((function(e){var t=e?parseInt(e):null,n=x.map((function(e){var n=Object(f.a)({},e);return n.profileId=t,n})),r=ue(y,n,bc);k(r)}),[x,y]),I=Object(a.useCallback)((function(){n.state.data.order.every(te)?b(!0):O(),l(!0)}),[n.state.data.order,O]),P=Object(a.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!e&&y.length>0){var t=y.map(oe);O(t)}else b(!1),k([]);l(!1),v([])}),[y,O]),A=Object(a.useCallback)((function(){var e={id:[],profileid:[]};return y.forEach((function(t){var n=oe(t);e.id.push(n),e.profileid.push(t.profileId)})),n.modify(e)}),[y,n]);return Object(gn.jsxs)(yn.a,{fluid:!0,children:[Object(gn.jsx)(Ua.a,{children:Object(gn.jsxs)("title",{children:[n.name," - Bazarr"]})}),Object(gn.jsx)($n,{scroll:!1,children:j?Object(gn.jsxs)(c.a.Fragment,{children:[Object(gn.jsx)($n.Group,{pos:"start",children:Object(gn.jsxs)(In.a,{onSelect:N,children:[Object(gn.jsx)(In.a.Toggle,{disabled:0===x.length,variant:"light",children:"Change Profile"}),Object(gn.jsx)(In.a.Menu,{children:C})]})}),Object(gn.jsxs)($n.Group,{pos:"end",children:[Object(gn.jsx)($n.Button,{icon:fn.ab,onClick:function(){return P(!0)},children:"Cancel"}),Object(gn.jsx)($n.AsyncButton,{icon:fn.h,disabled:0===y.length,promise:A,onSuccess:function(){return P()},children:"Save"})]})]}):Object(gn.jsx)($n.Button,{updating:o!==j,disabled:0===r.data.order.length&&r.updating,icon:fn.E,onClick:I,children:"Mass Edit"})}),Object(gn.jsx)(Vt.a,{children:Object(gn.jsx)(jc,Object(f.a)(Object(f.a)({},n),{},{update:O,dirtyItems:y,editMode:j,select:v}))})]})},fc=function(){var e=ln(),t=Object(J.a)(e,1)[0],n=Xt(ot),r=Object(a.useMemo)((function(){return[{accessor:"monitored",selectHide:!0,Cell:function(e){var t=e.value;return Object(gn.jsx)(pn.a,{title:t?"monitored":"unmonitored",icon:t?fn.d:Nn.a})}},{Header:"Name",accessor:"title",className:"text-nowrap",Cell:function(e){var t=e.row,n=e.value;if(e.isSelecting)return n;var r="/movies/".concat(t.original.radarrId);return Object(gn.jsx)(Oa,{text:t.original.sceneName,delay:1,children:Object(gn.jsx)(u.b,{to:r,children:Object(gn.jsx)("span",{children:n})})})}},{Header:"Exist",accessor:"exist",selectHide:!0,Cell:function(e){var t=e.row,n=e.value,r=t.original.path;return Object(gn.jsx)(pn.a,{title:r,icon:n?fn.h:fn.t})}},{Header:"Audio",accessor:"audio_language",Cell:function(e){return e.value.map((function(e){return Object(gn.jsx)(Wn.a,{variant:"secondary",className:"mr-2",children:e.name},de(e.code2,e.code2,e.hi))}))}},{Header:"Languages Profile",accessor:"profileId",Cell:function(e){var t,n,r=e.value,a=e.loose;return a&&null!==(t=null===(n=a[0].find((function(e){return e.profileId===r})))||void 0===n?void 0:n.name)&&void 0!==t?t:null}},{Header:"Missing Subtitles",accessor:"missing_subtitles",selectHide:!0,Cell:function(e){return e.value.map((function(e){return Object(gn.jsx)(Wn.a,{className:"mx-2",variant:"warning",children:e.code2},de(e.code2,e.hi,e.forced))}))}},{accessor:"radarrId",selectHide:!0,Cell:function(e){var t=e.row,n=e.externalUpdate;return Object(gn.jsx)(Yn,{icon:fn.cb,onClick:function(){return n&&n(t,"edit")}})}}]}),[]);return Object(gn.jsx)(hc,{state:t,name:"Movies",loader:n,updateAction:ut,columns:r,modify:function(e){return Kt.modify(e)}})};n(482);!function(e){e[e.Ready=0]="Ready",e[e.Searching=1]="Searching",e[e.Finished=2]="Finished"}(Oc||(Oc={}));var pc=function(e){var t=e.onSelect,n=e.onDownload,r=Object(hn.a)(e,["onSelect","onDownload"]),i=Object(a.useState)([]),s=Object(J.a)(i,2),o=s[0],l=s[1],u=Object(a.useState)(Oc.Ready),d=Object(J.a)(u,2),j=d[0],b=d[1],O=lr(r.modalKey),h=Object(a.useCallback)(Object(Ct.a)(St.a.mark((function e(){var t;return St.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!O){e.next=14;break}if(b(Oc.Searching),t=[],!ne(O)){e.next=9;break}return e.next=6,Bt.movies(O.radarrId);case 6:t=e.sent,e.next=12;break;case 9:return e.next=11,Bt.episodes(O.sonarrEpisodeId);case 11:t=e.sent;case 12:l(t),b(Oc.Finished);case 14:case"end":return e.stop()}}),e)}))),[O]);Object(a.useEffect)((function(){null!==O&&b(Oc.Ready)}),[O]);var p=Object(a.useMemo)((function(){return[{Header:"Score",accessor:function(e){return"".concat(e.score,"%")}},{accessor:"language",Cell:function(e){var t=e.row.original,n={code2:e.value,hi:"True"===t.hearing_impaired,forced:"True"===t.forced,name:""};return Object(gn.jsx)(Wn.a,{variant:"secondary",children:Object(gn.jsx)(ba,{text:n})})}},{Header:"Provider",accessor:"provider",Cell:function(e){var t=e.value,n=e.row.original.url;return n?Object(gn.jsx)("a",{href:n,target:"_blank",rel:"noopener noreferrer",children:t}):t}},{Header:"Release",accessor:"release_info",className:"text-nowrap",Cell:function(e){var t=e.value,n=Object(a.useState)(!1),r=Object(J.a)(n,2),c=r[0],i=r[1],s=Object(a.useMemo)((function(){return t.slice(1).map((function(e,t){return Object(gn.jsx)("span",{className:"release-text hidden-item",children:e},t)}))}),[t]);if(0===t.length)return Object(gn.jsx)("span",{className:"text-muted",children:"Cannot get release info"});var o=["release-container","d-flex","justify-content-between","align-items-center"];return t.length>1&&o.push("release-multi"),Object(gn.jsxs)("div",{className:o.join(" "),onClick:function(){return i((function(e){return!e}))},children:[Object(gn.jsxs)("div",{className:"text-container",children:[Object(gn.jsx)("span",{className:"release-text",children:t[0]}),Object(gn.jsx)(va.a,{in:c,children:Object(gn.jsx)("div",{children:s})})]}),t.length>1&&Object(gn.jsx)(pn.a,{className:"release-icon",icon:fn.g,rotation:c?180:void 0})]})}},{Header:"Upload",accessor:function(e){var t;return null!==(t=e.uploader)&&void 0!==t?t:"-"}},{accessor:"matches",Cell:function(e){var t=e.row.original,n=t.matches,r=t.dont_matches;return Object(gn.jsx)(xc,{matches:n,dont:r})}},{accessor:"subtitle",Cell:function(e){var n=e.row,r=e.externalUpdate,a=n.original;return Object(gn.jsx)(qn,{size:"sm",variant:"light",noReset:!0,promise:function(){return t(O,a)},onSuccess:function(){return r&&r(n)},children:Object(gn.jsx)(pn.a,{icon:fn.q})})}}]}),[t,O]),x=Object(a.useMemo)((function(){var e,t;return j===Oc.Ready?Object(gn.jsxs)("div",{className:"px-4 py-5",children:[Object(gn.jsx)("p",{className:"mb-3 small",children:null!==(e=null===O||void 0===O?void 0:O.path)&&void 0!==e?e:""}),Object(gn.jsx)(wn.a,{variant:"primary",block:!0,onClick:h,children:"Start Search"})]}):j===Oc.Searching?Object(gn.jsx)(ja,{animation:"grow"}):Object(gn.jsxs)(c.a.Fragment,{children:[Object(gn.jsx)("p",{className:"mb-3 small",children:null!==(t=null===O||void 0===O?void 0:O.path)&&void 0!==t?t:""}),Object(gn.jsx)(la,{emptyText:"No Result",columns:p,data:o,externalUpdate:n})]})}),[j,p,o,h,null===O||void 0===O?void 0:O.path,n]),v=Object(a.useMemo)((function(){return Object(gn.jsx)(wn.a,{variant:"light",hidden:j!==Oc.Finished,onClick:h,children:"Search Again"})}),[j,h]),m=Object(a.useMemo)((function(){var e="Unknown";return O&&(e=O.sceneName?O.sceneName:(ne(O),O.title)),"Search - ".concat(e)}),[O]);return Object(gn.jsx)(jr,Object(f.a)(Object(f.a)({closeable:j!==Oc.Searching,size:"xl",title:m,footer:v},r),{},{children:x}))},xc=function(e){var t=e.matches,n=e.dont,r=fn.h,c="var(--success)";n.length>0&&(r=fn.A,c="var(--warning)");var i=Object(a.useMemo)((function(){return t.map((function(e,t){return Object(gn.jsx)("p",{className:"text-nowrap m-0",children:e},"match-".concat(t))}))}),[t]),s=Object(a.useMemo)((function(){return n.map((function(e,t){return Object(gn.jsx)("p",{className:"text-nowrap m-0",children:e},"dont-".concat(t))}))}),[n]),o=Object(a.useMemo)((function(){return Object(gn.jsx)(xn.a,{className:"w-100",id:"manual-search-matches-info",children:Object(gn.jsx)(xn.a.Content,{children:Object(gn.jsx)(yn.a,{fluid:!0,children:Object(gn.jsxs)(Vt.a,{children:[Object(gn.jsxs)(sa.a,{xs:6,children:[Object(gn.jsx)(pn.a,{color:"var(--success)",icon:fn.h}),i]}),Object(gn.jsxs)(sa.a,{xs:6,children:[Object(gn.jsx)(pn.a,{color:"var(--danger)",icon:fn.X}),s]})]})})})})}),[i,s]);return Object(gn.jsx)(vn.a,{overlay:o,placement:"left",children:Object(gn.jsx)(pn.a,{icon:r,color:c})})},vc=function(e){var t=e.icon,n=e.desc,r=e.children;return Object(gn.jsxs)(Wn.a,{title:n,variant:"secondary",className:"mr-2 my-1 text-truncate",children:[Object(gn.jsx)(pn.a,{icon:t}),Object(gn.jsx)("span",{className:"ml-1",children:r})]})},mc=function(e){var t=e.item,n=e.details,r=Object(a.useMemo)((function(){var e,r=[];return r.push(Object(gn.jsx)(vc,{icon:Nn.e,desc:"File Path",children:t.path},"file-path")),r.push.apply(r,Object(X.a)(null!==(e=null===n||void 0===n?void 0:n.map((function(e,t){return Object(gn.jsx)(vc,{icon:e.icon,children:e.text},de(t,"detail",e.text))})))&&void 0!==e?e:[])),t.tags.length>0&&r.push(Object(gn.jsx)(vc,{icon:fn.V,desc:"Tags",children:t.tags.join("|")},"tags")),r}),[n,t.path,t.tags]),c=Object(a.useMemo)((function(){return t.audio_language.map((function(e,t){return Object(gn.jsx)(vc,{icon:fn.H,desc:"Audio Language",children:e.name},de(t,"audio",e.code2))}))}),[t.audio_language]),i=tn(t.profileId),s=an(i),o=Object(a.useMemo)((function(){var e=[];return i&&(e.push(Object(gn.jsx)(vc,{icon:fn.T,desc:"Languages Profile",children:i.name},"language-profile")),e.push.apply(e,Object(X.a)(s.map((function(e,t){return Object(gn.jsx)(vc,{icon:fn.B,desc:"Language",children:Object(gn.jsx)(ba,{long:!0,text:e})},de(t,"lang",e.code2))}))))),e}),[i,s]),l=Object(a.useMemo)((function(){return Object(gn.jsxs)(xn.a,{id:"item-overview-alternative",children:[Object(gn.jsx)(xn.a.Title,{children:"Alternate Titles"}),Object(gn.jsx)(xn.a.Content,{children:t.alternativeTitles.map((function(e,t){return Object(gn.jsx)("li",{children:e},t)}))})]})}),[t.alternativeTitles]);return Object(gn.jsx)(yn.a,{fluid:!0,style:{backgroundRepeat:"no-repeat",backgroundSize:"cover",backgroundPosition:"top center",backgroundImage:"url('".concat(t.fanart,"')")},children:Object(gn.jsxs)(Vt.a,{className:"p-4 pb-4",style:{backgroundColor:"rgba(0,0,0,0.7)"},children:[Object(gn.jsx)(sa.a,{sm:"auto",children:Object(gn.jsx)(ha.a,{className:"d-none d-sm-block my-2",style:{maxHeight:250},src:t.poster})}),Object(gn.jsx)(sa.a,{children:Object(gn.jsxs)(yn.a,{fluid:!0,className:"text-white",children:[Object(gn.jsxs)(Vt.a,{children:[ne(t)?Object(gn.jsx)(pn.a,{className:"mx-2 mt-2",title:t.monitored?"monitored":"unmonitored",icon:t.monitored?fn.d:Nn.a,size:"2x"}):null,Object(gn.jsx)("h1",{children:t.title}),Object(gn.jsx)("span",{hidden:0===t.alternativeTitles.length,children:Object(gn.jsx)(vn.a,{overlay:l,children:Object(gn.jsx)(pn.a,{className:"mx-2",icon:Nn.b})})})]}),Object(gn.jsx)(Vt.a,{children:r}),Object(gn.jsx)(Vt.a,{children:c}),Object(gn.jsx)(Vt.a,{children:o}),Object(gn.jsx)(Vt.a,{children:Object(gn.jsx)("span",{children:t.overview})})]})})]})})},gc="Missing Subtitles",yc=function(e){var t=e.movie,n=e.update,r=Object(a.useMemo)((function(){return[{Header:"Subtitle Path",accessor:"path",Cell:function(e){return null===e.value||0===e.value.length?"Video File Subtitle Track":e.value===gc?Object(gn.jsx)("span",{className:"text-muted",children:e.value}):e.value}},{Header:"Language",accessor:"name",Cell:function(e){var t=e.row;return t.original.path===gc?Object(gn.jsx)(Wn.a,{variant:"primary",children:Object(gn.jsx)(ba,{text:t.original,long:!0})}):Object(gn.jsx)(Wn.a,{variant:"secondary",children:Object(gn.jsx)(ba,{text:t.original,long:!0})})}},{accessor:"code2",Cell:function(e){var r=e.row.original;return null===r.path||0===r.path.length?null:r.path===gc?Object(gn.jsx)(qn,{promise:function(){return Kt.downloadSubtitles(t.radarrId,{language:r.code2,hi:r.hi,forced:r.forced})},onSuccess:function(){return n(t.radarrId)},variant:"light",size:"sm",children:Object(gn.jsx)(pn.a,{icon:fn.R})}):Object(gn.jsx)(qn,{variant:"light",size:"sm",promise:function(){var e;return Kt.deleteSubtitles(t.radarrId,{language:r.code2,hi:r.hi,forced:r.forced,path:null!==(e=r.path)&&void 0!==e?e:""})},onSuccess:function(){return n(t.radarrId)},children:Object(gn.jsx)(pn.a,{icon:fn.Z})})}}]}),[t,n]),c=Object(a.useMemo)((function(){var e=t.missing_subtitles.map((function(e){return e.path=gc,e}));return t.subtitles.concat(e)}),[t.missing_subtitles,t.subtitles]);return Object(gn.jsx)(ea,{columns:r,data:c,emptyText:"No Subtitles Found For This Movie"})},kc=function(e,t){e=e;var n=t.language,r=t.hearing_impaired,a=t.forced,c=t.provider,i=t.subtitle;return Bt.downloadMovieSubtitle(e.radarrId,{language:n,hi:r,forced:a,provider:c,subtitle:i})},wc=Object(l.i)((function(e){var t=e.match,n=Number.parseInt(t.params.id),r=un(n),c=Object(J.a)(r,2),i=c[0],s=c[1];ce(s);var o=i.data,u=cr(),d=Object(a.useState)(!0),j=Object(J.a)(d,2),b=j[0],O=j[1],h=Object(a.useCallback)((function(){null===i.data&&O(!1)}),[i.data]);if(ie(i,h),isNaN(n)||!b)return Object(gn.jsx)(l.b,{to:_a});if(!o)return Object(gn.jsx)(ja,{});var f=void 0!==o.profileId;return Object(gn.jsxs)(yn.a,{fluid:!0,children:[Object(gn.jsx)(Ua.a,{children:Object(gn.jsxs)("title",{children:[o.title," - Bazarr (Movies)"]})}),Object(gn.jsxs)($n,{children:[Object(gn.jsxs)($n.Group,{pos:"start",children:[Object(gn.jsx)($n.AsyncButton,{icon:fn.U,promise:function(){return Kt.action({action:"scan-disk",radarrid:o.radarrId})},onSuccess:s,children:"Scan Disk"}),Object(gn.jsx)($n.AsyncButton,{icon:fn.R,disabled:null===o.profileId,promise:function(){return Kt.action({action:"search-missing",radarrid:o.radarrId})},onSuccess:s,children:"Search"}),Object(gn.jsx)($n.Button,{icon:fn.bb,disabled:null===o.profileId,onClick:function(){return u("manual-search",o)},children:"Manual"}),Object(gn.jsx)($n.Button,{icon:fn.y,onClick:function(){return u("history",o)},children:"History"}),Object(gn.jsx)($n.Button,{icon:fn.Y,onClick:function(){return u("tools",[o])},children:"Tools"})]}),Object(gn.jsxs)($n.Group,{pos:"end",children:[Object(gn.jsx)($n.Button,{disabled:!f||null===o.profileId,icon:fn.m,onClick:function(){return u("upload",o)},children:"Upload"}),Object(gn.jsx)($n.Button,{icon:fn.cb,onClick:function(){return u("edit",o)},children:"Edit Movie"})]})]}),Object(gn.jsx)(Vt.a,{children:Object(gn.jsx)(mc,{item:o,details:[]})}),Object(gn.jsx)(Vt.a,{children:Object(gn.jsx)(yc,{movie:o,update:s})}),Object(gn.jsx)(pr,{modalKey:"edit",submit:function(e){return Kt.modify(e)},onSuccess:s}),Object(gn.jsx)(Yr,{modalKey:"tools",size:"lg",update:s}),Object(gn.jsx)(hr,{modalKey:"history",size:"lg"}),Object(gn.jsx)(xr,{modalKey:"upload",size:"lg"}),Object(gn.jsx)(pc,{modalKey:"manual-search",onDownload:s,onSelect:kc})]})})),Sc=function(){return Object(gn.jsxs)(l.e,{children:[Object(gn.jsx)(l.c,{exact:!0,path:"/movies",children:Object(gn.jsx)(fc,{})}),Object(gn.jsx)(l.c,{path:"/movies/:id",children:Object(gn.jsx)(wc,{})})]})},Cc=n(517),Nc=function(){var e=cn(),t=Object(J.a)(e,1)[0],n=Xt(pt),r=Object(a.useMemo)((function(){return[{Header:"Name",accessor:"title",className:"text-nowrap",Cell:function(e){var t=e.row,n=e.value;if(e.isSelecting)return n;var r="/series/".concat(t.original.sonarrSeriesId);return Object(gn.jsx)(u.b,{to:r,children:Object(gn.jsx)("span",{children:n})})}},{Header:"Exist",accessor:"exist",selectHide:!0,Cell:function(e){var t=e.value,n=e.row.original.path;return Object(gn.jsx)(pn.a,{title:n,icon:t?fn.h:fn.t})}},{Header:"Audio",accessor:"audio_language",Cell:function(e){return e.value.map((function(e){return Object(gn.jsx)(Wn.a,{variant:"secondary",className:"mr-2",children:e.name},de(e.code2,e.forced,e.hi))}))}},{Header:"Languages Profile",accessor:"profileId",Cell:function(e){var t,n,r=e.value,a=e.loose;return a&&null!==(t=null===(n=a[0].find((function(e){return e.profileId===r})))||void 0===n?void 0:n.name)&&void 0!==t?t:null}},{Header:"Episodes",accessor:"episodeFileCount",selectHide:!0,Cell:function(e){var t=e.row.original,n=t.episodeFileCount,r=t.episodeMissingCount,a=t.profileId,c=0,i="";0!==n&&a?(c=n-r,i="".concat(n-r,"/").concat(n)):c=0;var s=0===r?"primary":"warning";return Object(gn.jsx)(Cc.a,{className:"my-a",variant:s,min:0,max:n,now:c,label:i})}},{accessor:"sonarrSeriesId",selectHide:!0,Cell:function(e){var t=e.row,n=e.externalUpdate;return Object(gn.jsx)(Yn,{icon:fn.cb,onClick:function(){n&&n(t,"edit")}})}}]}),[]);return Object(gn.jsx)(hc,{state:t,name:"Series",updateAction:yt,loader:n,columns:r,modify:function(e){return Dt.modify(e)}})},Ic=function(e){var t=e.seriesid,n=e.episodeid,r=e.missing,a=e.subtitle,c=a.hi,i=a.forced,s=sn(t),o=Object(J.a)(s,2)[1],l=a.path;return r||l?Object(gn.jsxs)(qn,{promise:function(){return r?Tt.downloadSubtitles(t,n,{hi:c,forced:i,language:a.code2}):l?Tt.deleteSubtitles(t,n,{hi:c,forced:i,path:l,language:a.code2}):null},onSuccess:o,as:Wn.a,className:"mr-1",variant:r?"primary":"secondary",children:[Object(gn.jsx)(ba,{className:"pr-1",text:a}),Object(gn.jsx)(pn.a,{size:"sm",icon:r?fn.R:fn.Z})]}):Object(gn.jsx)(Wn.a,{className:"mr-1",variant:"secondary",children:Object(gn.jsx)(ba,{text:a,long:!1})})},Pc=function(e,t){e=e;var n=t.language,r=t.hearing_impaired,a=t.forced,c=t.provider,i=t.subtitle;return Bt.downloadEpisodeSubtitle(e.sonarrSeriesId,e.sonarrEpisodeId,{language:n,hi:r,forced:a,provider:c,subtitle:i})},Ac=function(e){var t=e.episodes,n=e.update,r=cr(),i=Object(a.useMemo)((function(){return[{accessor:"monitored",Cell:function(e){return Object(gn.jsx)(pn.a,{title:e.value?"monitored":"unmonitored",icon:e.value?fn.d:Nn.a})}},{accessor:"season",Cell:function(e){return"Season ".concat(e.value)}},{Header:"Episode",accessor:"episode"},{Header:"Title",accessor:"title",className:"text-nowrap",Cell:function(e){var t=e.value,n=e.row;return Object(gn.jsx)(Oa,{text:n.original.sceneName,delay:1,children:Object(gn.jsx)("span",{children:t})})}},{Header:"Audio",accessor:"audio_language",Cell:function(e){return e.value.map((function(e){return Object(gn.jsx)(Wn.a,{variant:"secondary",children:e.name},e.code2)}))}},{Header:"Subtitles",accessor:"missing_subtitles",Cell:function(e){var t=e.row.original,n=t.sonarrSeriesId;return Object(a.useMemo)((function(){var e=t.sonarrEpisodeId,r=t.missing_subtitles.map((function(t,r){return Object(gn.jsx)(Ic,{missing:!0,seriesid:n,episodeid:e,subtitle:t},de(r,t.code2,"missing"))})),a=t.subtitles.map((function(t,r){return Object(gn.jsx)(Ic,{seriesid:n,episodeid:e,subtitle:t},de(r,t.code2,"valid"))}));return[].concat(Object(X.a)(r),Object(X.a)(a))}),[t,n])}},{Header:"Actions",accessor:"sonarrEpisodeId",Cell:function(e){var t,n=e.row,r=e.externalUpdate,a=sn(n.original.sonarrSeriesId),c=Object(J.a)(a,1)[0];return Object(gn.jsxs)(gr.a,{children:[Object(gn.jsx)(Vn,{icon:fn.bb,disabled:null===(null===(t=c.data)||void 0===t?void 0:t.profileId),onClick:function(){r&&r(n,"manual-search")}}),Object(gn.jsx)(Vn,{icon:fn.y,onClick:function(){r&&r(n,"history")}}),Object(gn.jsx)(Vn,{icon:fn.e,onClick:function(){r&&r(n,"tools")}})]})}}]}),[]),s=Object(a.useCallback)((function(e,t){r(t,"tools"===t?[e.original]:e.original)}),[r]),o=Object(a.useMemo)((function(){return t.data.reduce((function(e,t){return Math.max(e,t.season)}),0)}),[t]),l=Object(a.useMemo)((function(){return{columns:i,data:t.data,externalUpdate:s,initialState:{sortBy:[{id:"season",desc:!0},{id:"episode",desc:!0}],groupBy:["season"],expanded:Object(h.a)({},"season:".concat(o),!0)}}}),[t,i,o,s]);return Object(gn.jsxs)(c.a.Fragment,{children:[Object(gn.jsx)(Un,{state:t,children:function(){return Object(gn.jsx)(ca,Object(f.a)({emptyText:"No Episode Found For This Series"},l))}}),Object(gn.jsx)(Yr,{modalKey:"tools",size:"lg",update:n}),Object(gn.jsx)(fr,{modalKey:"history",size:"lg"}),Object(gn.jsx)(pc,{modalKey:"manual-search",onDownload:n,onSelect:Pc})]})},Tc=Object(l.i)((function(e){var t,n=e.match,r=Number.parseInt(n.params.id),c=sn(r),i=Object(J.a)(c,2),s=i[0],o=i[1],u=s.data,d=on(null===(t=s.data)||void 0===t?void 0:t.sonarrSeriesId),j=Object(J.a)(d,1)[0];ce(o);var b=0!==j.data.length,O=Object(a.useMemo)((function(){var e;return[{icon:fn.w,text:"".concat(null===u||void 0===u?void 0:u.episodeFileCount," files")},{icon:fn.a,text:null!==(e=null===u||void 0===u?void 0:u.seriesType)&&void 0!==e?e:""}]}),[u]),h=cr(),f=Object(a.useState)(!0),p=Object(J.a)(f,2),x=p[0],v=p[1],m=Object(a.useCallback)((function(){null===s.data&&v(!1)}),[s.data]);return ie(s,m),isNaN(r)||!x?Object(gn.jsx)(l.b,{to:_a}):u?Object(gn.jsxs)(yn.a,{fluid:!0,children:[Object(gn.jsx)(Ua.a,{children:Object(gn.jsxs)("title",{children:[u.title," - Bazarr (Series)"]})}),Object(gn.jsxs)($n,{children:[Object(gn.jsxs)($n.Group,{pos:"start",children:[Object(gn.jsx)($n.AsyncButton,{icon:fn.U,disabled:!b,promise:function(){return Dt.action({action:"scan-disk",seriesid:r})},onSuccess:o,children:"Scan Disk"}),Object(gn.jsx)($n.AsyncButton,{icon:fn.R,promise:function(){return Dt.action({action:"search-missing",seriesid:r})},onSuccess:o,disabled:0===u.episodeFileCount||null===u.profileId||!b,children:"Search"})]}),Object(gn.jsxs)($n.Group,{pos:"end",children:[Object(gn.jsx)($n.Button,{disabled:0===u.episodeFileCount||!b,icon:fn.e,onClick:function(){return h("tools",j.data)},children:"Tools"}),Object(gn.jsx)($n.Button,{disabled:0===u.episodeFileCount||null===u.profileId||!b,icon:fn.m,onClick:function(){return h("upload",u)},children:"Upload"}),Object(gn.jsx)($n.Button,{icon:fn.cb,onClick:function(){return h("edit",u)},children:"Edit Series"})]})]}),Object(gn.jsx)(Vt.a,{children:Object(gn.jsx)(mc,{item:u,details:O})}),Object(gn.jsx)(Vt.a,{children:Object(gn.jsx)(Ac,{episodes:j,update:o})}),Object(gn.jsx)(pr,{modalKey:"edit",submit:function(e){return Dt.modify(e)},onSuccess:o}),Object(gn.jsx)(vr,{modalKey:"upload"})]}):Object(gn.jsx)(ja,{})})),Ec=function(){return Object(gn.jsxs)(l.e,{children:[Object(gn.jsx)(l.c,{exact:!0,path:"/series",children:Object(gn.jsx)(Nc,{})}),Object(gn.jsx)(l.c,{path:"/series/:id",children:Object(gn.jsx)(Tc,{})})]})},Mc="languages-enabled",Kc="languages-profiles",Bc="notifications-providers",Dc="settings-general-use_sonarr",zc="settings-general-use_radarr",Rc=c.a.createContext([{},function(){}]);var Lc=function(e){var t=e.children,n=e.title,r=Xt(Ze),c=Object(a.useState)({}),i=Object(J.a)(c,2),s=i[0],o=i[1],u=Object(a.useState)(!1),d=Object(J.a)(u,2),j=d[0],b=d[1],O=Object(a.useState)({}),f=Object(J.a)(O,2),p=f[0],x=f[1],v=Object(a.useCallback)((function(){o({}),b(!1)}),[]),m=Jt(We,v),g=Object(a.useCallback)((function(e){!function(e){if(Kc in e){var t=e[Kc];e[Kc]=JSON.stringify(t)}if(Mc in e){var n=e[Mc];e[Mc]=n.map((function(e){return e.code2}))}if(Bc in e){var r=e[Bc];e[Bc]=r.map((function(e){return JSON.stringify(e)}))}}(e),b(!0),Rt.setSettings(e).finally(m)}),[m]),y=Object(a.useCallback)((function(e){r(e),o({})}),[r]);Object(a.useEffect)((function(){var e={};e.__default__=g,e.storage=y,x(e)}),[g,y]);var k=Object(a.useMemo)((function(){return p.__default__}),[p]),w=Object(a.useCallback)((function(){var e=new Map;for(var t in s){var n=t.split("-")[0];if(0!==n.length){var r=e.get(n);r?r[t]=s[t]:e.set(n,Object(h.a)({},t,s[t]))}}var a={};e.forEach((function(e,t){t in p?p[t](e):a=Object(Z.merge)(a,e)})),k(a)}),[s,p,k]);return Object(gn.jsxs)(yn.a,{fluid:!0,children:[Object(gn.jsx)(Ua.a,{children:Object(gn.jsx)("title",{children:n})}),Object(gn.jsx)(l.a,{when:Object.keys(s).length>0,message:"You have unsaved changes, are you sure you want to leave?"}),Object(gn.jsx)($n,{children:Object(gn.jsx)($n.Button,{icon:fn.Q,updating:j,disabled:0===Object.keys(s).length,onClick:w,children:"Save"})}),Object(gn.jsx)(Rc.Provider,{value:[s,o],children:Object(gn.jsx)(Vt.a,{className:"p-4",children:Object(gn.jsx)(yn.a,{children:t})})})]})};function _c(){var e=Object(a.useContext)(Rc);return Object(J.a)(e,1)[0]}function Hc(){var e=Object(a.useContext)(Rc),t=Object(J.a)(e,2)[1];return Object(a.useCallback)((function(e,n){t((function(t){var r=Object(f.a)({},t);return r[n]=e,r}))}),[t])}function Uc(e,t,n){var r=$t(),c=Object(J.a)(r,1)[0].data,i=Object(o.d)(),s=Object(a.useMemo)((function(){var n=null;if(void 0===c)return n;var r=e.split("-");if("settings"!==r[0])return null;r=r.slice(0);var a,i=c,s=Object(Kn.a)(r);try{for(s.s();!(a=s.n()).done;){var o=a.value;if(o in i&&(i=i[o]),t(i)){n=i;break}}}catch(l){s.e(l)}finally{s.f()}return n}),[e,c,t]);return n&&void 0!==c?n(c,i.getState()):s}function Fc(e,t,n){var r=Uc(e,t,n),a=_c();return e in a?a[e]:r}var Gc=c.a.createContext(["",function(e){}]),qc=c.a.createContext((function(e){}));function Wc(){return Object(a.useContext)(qc)}var Yc=function(e){var t=e.children,n=Object(a.useState)(!1);return Object(gn.jsx)(Gc.Provider,{value:n,children:t})};Yc.Control=function(e){var t=e.children,n=Object(a.useContext)(Gc);return Object(gn.jsx)(qc.Provider,{value:n[1],children:t})},Yc.Content=function(e){var t=e.on,n=e.eventKey,r=e.indent,c=e.children,i=Object(a.useContext)(Gc),s=Object(J.a)(i,1)[0],o=Object(a.useMemo)((function(){return t&&"string"===typeof s?t(s):n?s===n:!0===s}),[t,s,n]);return Object(gn.jsx)(va.a,{in:o,className:!1===r?void 0:"pl-4",children:Object(gn.jsx)("div",{children:c})})};var Vc=Yc,Qc=n(515),Xc=(n(483),function(e){var t=e.header,n=e.hidden,r=e.children;return Object(gn.jsxs)(Vt.a,{hidden:n,className:"flex-column mt-3",children:[Object(gn.jsxs)(sa.a,{children:[Object(gn.jsx)("h4",{children:t}),Object(gn.jsx)("hr",{})]}),Object(gn.jsx)(sa.a,{children:r})]})}),Jc=function(e){var t=e.children,n=e.name,r=e.hidden;return Object(gn.jsxs)(Pn.a.Group,{hidden:r,children:[n&&Object(gn.jsx)(Pn.a.Label,{children:n}),t]})},Zc=function(e){return Object(gn.jsx)(sa.a,{className:"p-2",xs:6,lg:4,children:Object(gn.jsx)($c,Object(f.a)({},e))})},$c=function(e){var t=e.header,n=e.subheader,r=e.plus,a=e.onClick;return Object(gn.jsx)(Qc.a,{className:"settings-card",onClick:function(){return a&&a()},children:r?Object(gn.jsx)(Qc.a.Body,{className:"d-flex justify-content-center align-items-center",children:Object(gn.jsx)(pn.a,{size:"2x",icon:fn.M})}):Object(gn.jsxs)(Qc.a.Body,{children:[Object(gn.jsx)(Qc.a.Title,{className:"text-nowrap text-truncate",children:t}),Object(gn.jsx)(Qc.a.Subtitle,{hidden:void 0===n,className:"small text-nowrap text-truncate",children:n})]})})},ei=function(e){var t=e.type,n=e.children,r=["pr-4"];return r.push("warning"===t?"text-warning":"text-muted"),Object(gn.jsx)(Pn.a.Text,{className:r.join(" "),children:n})},ti=function(e){var t=e.placeholder,n=e.disabled,r=e.beforeStaged,a=e.controlled,c=e.override,i=e.password,s=e.settingKey,o=Fc(s,$,c),l=Hc(),u=Wc();return Object(gn.jsx)(Pn.a.Control,{type:i?"password":"text",placeholder:null===t||void 0===t?void 0:t.toString(),disabled:n,defaultValue:a?void 0:null!==o&&void 0!==o?o:void 0,value:a&&null!==o&&void 0!==o?o:void 0,onChange:function(e){var t=e.currentTarget.value;u(t.toString());var n=r?r(t):t;l(n,s)}})},ni=function(e){var t=e.label,n=e.inline,r=e.override,c=e.disabled,i=e.settingKey,s=Hc(),o=Wc(),l=Fc(i,Z.isBoolean,r);return Object(a.useEffect)((function(){return o(null!==l&&void 0!==l&&l)}),[o,l]),Object(gn.jsx)(Pn.a.Check,{custom:!0,type:"checkbox",id:i,inline:n,label:t,onChange:function(e){var t=e.currentTarget.checked;s(t,i)},disabled:c,checked:null!==l&&void 0!==l?l:void 0})};function ri(e){return Object(Z.isString)(e)||Object(Z.isNumber)(e)||Object(Z.isArray)(e)}function ai(e){var t=Hc(),n=Wc(),r=e.settingKey,c=e.override,i=e.beforeStaged,s=Object(hn.a)(e,["settingKey","override","beforeStaged"]),o=Fc(r,ri,c);return Object(a.useEffect)((function(){(Object(Z.isString)(o)||Object(Z.isNull)(o))&&n(null!==o&&void 0!==o?o:"")})),Object(gn.jsx)(zn,Object(f.a)(Object(f.a)({},s),{},{defaultValue:o,onChange:function(e){e=i?i(e):e,t(e,r)}}))}var ci=function(e){var t=e.settingKey,n=e.override,r=Object(hn.a)(e,["settingKey","override"]),a=Hc(),c=Fc(t,Z.isNumber,n);return Object(gn.jsx)(_n,Object(f.a)({onAfterChange:function(e){a(e,t)},defaultValue:null!==c&&void 0!==c?c:void 0},r))},ii=function(e){var t=e.settingKey,n=e.override,r=Object(hn.a)(e,["settingKey","override"]),a=Hc(),c=Fc(t,Z.isArray,n);return Object(gn.jsx)(Cn,Object(f.a)({defaultValue:null!==c&&void 0!==c?c:void 0,onChange:function(e){a(e,t)}},r))},si=function(e){var t=e.onClick,n=e.settingKey,r=Object(hn.a)(e,["onClick","settingKey"]),a=Fc(n,Z.isString),c=Hc();return Object(gn.jsx)(wn.a,Object(f.a)({onClick:function(){t&&t(c,n,null!==a&&void 0!==a?a:void 0)}},r))},oi=function(e){var t=e.category,n=Object(a.useState)("Test"),r=Object(J.a)(n,2),c=r[0],i=r[1],s=Object(a.useState)("primary"),o=Object(J.a)(s,2),l=o[0],u=o[1],d=Fc("settings-".concat(t,"-ip"),Z.isString),j=Fc("settings-".concat(t,"-port"),Z.isNumber),b=Fc("settings-".concat(t,"-base_url"),Z.isString),O=Fc("settings-".concat(t,"-apikey"),Z.isString),h=Fc("settings-".concat(t,"-ssl"),Z.isBoolean),f=Object(a.useCallback)((function(){if(d&&O&&null!==h){var e;e=j?"".concat(d,":").concat(j).concat(null!==b&&void 0!==b?b:""):"".concat(d).concat(null!==b&&void 0!==b?b:"");var t={protocol:h?"https":"http",url:e,params:{apikey:O}};t.url.endsWith("/")||(t.url+="/"),Lt.urlTest(t.protocol,t.url,t.params).then((function(e){e.status?(i("Version: ".concat(e.version)),u("success")):(i(e.error),u("danger"))}))}}),[d,j,b,O,h]);return Object(gn.jsx)(wn.a,{onClick:f,variant:l,title:c,className:"text-truncate text-nowrap",children:c})},li=[{label:"Basic",value:"basic"},{label:"Form",value:"form"}],ui=[{label:"Socks5",value:"socks5"},{label:"HTTP(S)",value:"http"}],di=[{label:"master",value:"master"},{label:"development",value:"development"}],ji="abcdef0123456789",bi="settings-auth-apikey",Oi=function(e){var t,n;return null!==(t=null===(n=e.general.base_url)||void 0===n?void 0:n.slice(1))&&void 0!==t?t:""},hi=function(){var e=Object(a.useState)(!1),t=Object(J.a)(e,2),n=t[0],r=t[1],c=window.Bazarr.canUpdate;return Object(gn.jsxs)(Lc,{title:"General - Bazarr (Settings)",children:[Object(gn.jsxs)(Xc,{header:"Host",children:[Object(gn.jsxs)(Jc,{name:"Address",children:[Object(gn.jsx)(ti,{placeholder:"0.0.0.0",settingKey:"settings-general-ip"}),Object(gn.jsx)(ei,{children:"Valid IPv4 address or '0.0.0.0' for all interfaces"})]}),Object(gn.jsx)(Jc,{name:"Port",children:Object(gn.jsx)(ti,{placeholder:6767,settingKey:"settings-general-port"})}),Object(gn.jsxs)(Jc,{name:"Base URL",children:[Object(gn.jsxs)(mr.a,{children:[Object(gn.jsx)(mr.a.Prepend,{children:Object(gn.jsx)(mr.a.Text,{children:"/"})}),Object(gn.jsx)(ti,{settingKey:"settings-general-base_url",override:Oi,beforeStaged:function(e){return"/"+e}})]}),Object(gn.jsx)(ei,{children:"Reverse proxy support"})]})]}),Object(gn.jsxs)(Xc,{header:"Security",children:[Object(gn.jsxs)(Vc,{children:[Object(gn.jsx)(Vc.Control,{children:Object(gn.jsx)(Jc,{name:"Authentication",children:Object(gn.jsx)(ai,{clearable:!0,options:li,settingKey:"settings-auth-type",beforeStaged:function(e){return null===e?"None":e}})})}),Object(gn.jsxs)(Vc.Content,{on:function(e){return""!==e&&"None"!==e},children:[Object(gn.jsx)(Jc,{name:"Username",children:Object(gn.jsx)(ti,{settingKey:"settings-auth-username"})}),Object(gn.jsx)(Jc,{name:"Password",children:Object(gn.jsx)(ti,{password:!0,settingKey:"settings-auth-password"})})]})]}),Object(gn.jsx)(Jc,{name:"API Key",children:Object(gn.jsxs)(mr.a,{children:[Object(gn.jsx)(ti,{disabled:!0,controlled:!0,settingKey:bi}),Object(gn.jsxs)(mr.a.Append,{children:[Object(gn.jsx)(si,{variant:n?"success":"light",settingKey:bi,onClick:function(e,t,n){n&&(function(e){var t=document.createElement("textarea");t.innerText=e,document.body.appendChild(t),t.select(),t.setSelectionRange(0,9999),document.execCommand("copy"),t.remove()}(n),function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];e(!n),setTimeout((function(){return e(n)}),t)}(r,1500))},children:Object(gn.jsx)(pn.a,{icon:n?fn.h:fn.k})}),Object(gn.jsx)(si,{variant:"danger",settingKey:bi,onClick:function(e,t){e(Array(32).fill(null).map((function(){return ji.charAt(Math.floor(Math.random()*ji.length))})).join(""),t)},children:Object(gn.jsx)(pn.a,{icon:fn.U})})]})]})})]}),Object(gn.jsx)(Xc,{header:"Proxy",children:Object(gn.jsxs)(Vc,{children:[Object(gn.jsx)(Vc.Control,{children:Object(gn.jsx)(Jc,{children:Object(gn.jsx)(ai,{clearable:!0,settingKey:"settings-proxy-type",options:ui,beforeStaged:function(e){return null===e?"None":e}})})}),Object(gn.jsxs)(Vc.Content,{on:function(e){return""!==e&&"None"!==e},children:[Object(gn.jsx)(Jc,{name:"Host",children:Object(gn.jsx)(ti,{settingKey:"settings-proxy-url"})}),Object(gn.jsx)(Jc,{name:"Port",children:Object(gn.jsx)(ti,{settingKey:"settings-proxy-port"})}),Object(gn.jsx)(Jc,{name:"Username",children:Object(gn.jsx)(ti,{settingKey:"settings-proxy-username"})}),Object(gn.jsxs)(Jc,{name:"Password",children:[Object(gn.jsx)(ti,{password:!0,settingKey:"settings-proxy-password"}),Object(gn.jsx)(ei,{children:"You only need to enter a username and password if one is required. Leave them blank otherwise"})]}),Object(gn.jsxs)(Jc,{name:"Ignored Addresses",children:[Object(gn.jsx)(ii,{settingKey:"settings-proxy-exclude"}),Object(gn.jsx)(ei,{children:"'*.' as a wildcard for subdomains"})]})]})]})}),Object(gn.jsxs)(Xc,{header:"Updates",hidden:!c,children:[Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{label:"Automatic",settingKey:"settings-general-auto_update"}),Object(gn.jsx)(ei,{children:"Automatically download and install updates"})]}),Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ai,{options:di,settingKey:"settings-general-branch"}),Object(gn.jsx)(ei,{children:"Branch used by update mechanism"})]})]}),Object(gn.jsx)(Xc,{header:"Logging",children:Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{label:"Debug",settingKey:"settings-general-debug"}),Object(gn.jsx)(ei,{children:"Debug logging should only be enabled temporarily"})]})}),Object(gn.jsx)(Xc,{header:"Analytics",children:Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{label:"Enable",settingKey:"settings-analytics-enabled"}),Object(gn.jsx)(ei,{children:"Send anonymous usage information, nothing that can identify you. This includes information on which providers you use, what languages you search for, Bazarr, Python, Sonarr, Radarr and what OS version you are using. We will use this information to prioritize features and bug fixes. Please, keep this enabled as this is the only way we have to better understand how you use Bazarr."})]})})]})},fi=function(e){var t=e.settingKey,n=e.options,r=Si(),a=Hc();return Object(gn.jsx)(tr,{multiple:!0,value:r,options:n,onChange:function(e){a(e,t)}})},pi=function(e){var t=e.settingKey,n=Ci(),r=Object(a.useMemo)((function(){return n.map((function(e){return{label:e.name,value:e.profileId}}))}),[n]);return Object(gn.jsx)(ai,{clearable:!0,options:r,settingKey:t,beforeStaged:function(e){return null===e?"":e}})},xi=[{label:"Any",value:65535}];function vi(){return{profileId:-1,name:"",items:[],cutoff:null}}var mi=function(e){var t=e.update,n=Object(hn.a)(e,["update"]),r=lr(n.modalKey),c=ir(),i=Si(),s=Object(a.useState)(vi),o=Object(J.a)(s,2),l=o[0],u=o[1];Object(a.useEffect)((function(){u(r||vi)}),[r]);var d=Object(a.useMemo)((function(){var e=Object(X.a)(xi),t=l.items.map((function(e){return{label:"ID ".concat(e.id," (").concat(e.language,")"),value:e.id}}));return e.push.apply(e,Object(X.a)(t)),e}),[l.items]),j=Object(a.useCallback)((function(e,t){var n=Object(f.a)({},l);n[e]=t,u(n)}),[l]),b=Object(a.useCallback)((function(e,t){var n=Object(X.a)(l.items);t?n[e.index]=t:n.splice(e.index,1),j("items",n)}),[l.items,j]),O=Object(a.useCallback)((function(){var e=1+l.items.reduce((function(e,t){return Math.max(t.id,e)}),0);if(i.length>0){var t={id:e,language:i[0].code2,audio_exclude:"False",hi:"False",forced:"False"},n=Object(X.a)(l.items);n.push(t),j("items",n)}}),[l.items,j,i]),h=l.name.length>0&&l.items.length>0,p=Object(gn.jsx)(wn.a,{disabled:!h,onClick:function(){c(),t(l)},children:"Save"}),x=Object(a.useMemo)((function(){return[{Header:"ID",accessor:"id"},{Header:"Language",accessor:"language",Cell:function(e){var t=e.value,n=e.row,r=e.externalUpdate,c=t,s=n.original,o=Object(a.useMemo)((function(){var e;return null!==(e=i.find((function(e){return e.code2===c})))&&void 0!==e?e:null}),[c]);return Object(gn.jsx)("div",{style:{width:"8rem"},children:Object(gn.jsx)(tr,{options:i,value:o,onChange:function(e){e&&(s.language=e.code2,r&&r(n,s))}})})}},{Header:"Forced",accessor:"forced",Cell:function(e){var t=e.row,n=e.value,r=e.externalUpdate,a=t.original;return Object(gn.jsx)(Pn.a.Check,{custom:!0,id:de(a.id,a.language,"forced"),checked:"True"===n,onChange:function(e){a.forced=e.target.checked?"True":"False",r&&r(t,a)}})}},{Header:"HI",accessor:"hi",Cell:function(e){var t=e.row,n=e.value,r=e.externalUpdate,a=t.original;return Object(gn.jsx)(Pn.a.Check,{custom:!0,id:de(a.id,a.language,"hi"),checked:"True"===n,onChange:function(e){a.hi=e.target.checked?"True":"False",r&&r(t,a)}})}},{Header:"Exclude Audio",accessor:"audio_exclude",Cell:function(e){var t=e.row,n=e.value,r=e.externalUpdate,a=t.original;return Object(gn.jsx)(Pn.a.Check,{custom:!0,id:de(a.id,a.language,"audio"),checked:"True"===n,onChange:function(e){a.audio_exclude=e.target.checked?"True":"False",r&&r(t,a)}})}},{id:"action",accessor:"id",Cell:function(e){var t=e.row,n=e.externalUpdate;return Object(gn.jsx)(Vn,{icon:fn.Z,onClick:function(){return n&&n(t)}})}}]}),[i]);return Object(gn.jsxs)(jr,Object(f.a)(Object(f.a)({size:"lg",title:"Languages Profile",footer:p},n),{},{children:[Object(gn.jsx)(Jc,{children:Object(gn.jsx)(Pn.a.Control,{type:"text",placeholder:"Name",value:l.name,onChange:function(e){j("name",e.target.value)}})}),Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ea,{responsive:!1,columns:x,data:l.items,externalUpdate:b}),Object(gn.jsx)(wn.a,{block:!0,variant:"light",onClick:O,children:"Add"})]}),Object(gn.jsxs)(Jc,{name:"Cutoff",children:[Object(gn.jsx)(zn,{clearable:!0,options:d,value:l.cutoff,onChange:function(e){return j("cutoff",e)}}),Object(gn.jsx)(ei,{children:"Ignore others if existing"})]})]}))},gi=function(e){var t=e.cutoff,n=e.item,r=e.className,c=Object(a.useMemo)((function(){var e=n.language;return"True"===n.hi?e+=":HI":"True"===n.forced&&(e+=":Forced"),e}),[n.hi,n.forced,n.language]);return Object(gn.jsx)(Wn.a,{className:r,title:t?"Ignore others if this one is available":void 0,variant:t?"primary":"secondary",children:c})},yi=function(){var e=Ci(),t=Si(),n=Object(a.useState)((function(){return Object(Z.cloneDeep)(e)})),r=Object(J.a)(n,2),i=r[0],s=r[1],o=Object(a.useMemo)((function(){return 1+i.reduce((function(e,t){return Math.max(t.profileId,e)}),0)}),[i]),l=Hc(),u=cr(),d=Object(a.useCallback)((function(e){l(e,Kc),s(e)}),[l]),j=Object(a.useCallback)((function(e){var t=Object(X.a)(i),n=t.findIndex((function(t){return t.profileId===e.profileId}));-1!==n?t[n]=e:t.push(e),d(t)}),[i,d]),b=Object(a.useCallback)((function(e,t){if(t)u("profile",Object(Z.cloneDeep)(t));else{var n=Object(X.a)(i);n.splice(e.index,1),d(n)}}),[d,u,i]),O=Object(a.useMemo)((function(){return[{Header:"Name",accessor:"name"},{Header:"Languages",accessor:"items",Cell:function(e){var t=e.value,n=e.row.original.cutoff;return t.map((function(e){var t=e.id===n||65535===n;return Object(gn.jsx)(gi,{cutoff:t,className:"mx-1",item:e},e.id)}))}},{accessor:"profileId",Cell:function(e){var t=e.row,n=e.externalUpdate,r=t.original;return Object(gn.jsxs)(gr.a,{children:[Object(gn.jsx)(Vn,{icon:fn.cb,onClick:function(){n&&n(t,r)}}),Object(gn.jsx)(Vn,{icon:fn.Z,onClick:function(){return n&&n(t)}})]})}}]}),[]),h=0!==t.length;return Object(gn.jsxs)(c.a.Fragment,{children:[Object(gn.jsx)(ea,{columns:O,data:i,externalUpdate:b}),Object(gn.jsx)(wn.a,{block:!0,disabled:!h,variant:"light",onClick:function(){u("profile",{profileId:o,name:"",items:[],cutoff:null})},children:h?"Add New Profile":"No Enabled Languages"}),Object(gn.jsx)(mi,{update:j,modalKey:"profile"})]})},ki=c.a.createContext([]),wi=c.a.createContext([]);function Si(){var e=Object(a.useContext)(ki),t=Fc(Mc,Z.isArray);return t||e}function Ci(){var e=Object(a.useContext)(wi),t=Fc(Kc,Z.isArray);return t||e}var Ni=function(){var e=nn(!1),t=Object(J.a)(e,1)[0],n=nn(!0),r=Object(J.a)(n,1)[0],a=en(),c=Object(J.a)(a,1)[0];return Object(gn.jsx)(Lc,{title:"Languages - Bazarr (Settings)",children:Object(gn.jsx)(ki.Provider,{value:r,children:Object(gn.jsxs)(wi.Provider,{value:c,children:[Object(gn.jsxs)(Xc,{header:"Subtitles Language",children:[Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{label:"Single Language",settingKey:"settings-general-single_language"}),Object(gn.jsx)(ei,{children:"Download a single Subtitles file without adding the language code to the filename."}),Object(gn.jsx)(ei,{type:"warning",children:"We don't recommend enabling this option unless absolutely required (ie: media player not supporting language code in subtitles filename). Results may vary."})]}),Object(gn.jsx)(Jc,{name:"Languages Filter",children:Object(gn.jsx)(fi,{settingKey:Mc,options:t})})]}),Object(gn.jsx)(Xc,{header:"Languages Profiles",children:Object(gn.jsx)(yi,{})}),Object(gn.jsxs)(Xc,{header:"Default Settings",children:[Object(gn.jsxs)(Vc,{children:[Object(gn.jsx)(Vc.Control,{children:Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{label:"Series",settingKey:"settings-general-serie_default_enabled"}),Object(gn.jsx)(ei,{children:"Apply only to Series added to Bazarr after enabling this option."})]})}),Object(gn.jsx)(Vc.Content,{indent:!0,children:Object(gn.jsx)(Jc,{name:"Profile",children:Object(gn.jsx)(pi,{settingKey:"settings-general-serie_default_profile"})})})]}),Object(gn.jsxs)(Vc,{children:[Object(gn.jsx)(Vc.Control,{children:Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{label:"Movies",settingKey:"settings-general-movie_default_enabled"}),Object(gn.jsx)(ei,{children:"Apply only to Movies added to Bazarr after enabling this option."})]})}),Object(gn.jsx)(Vc.Content,{children:Object(gn.jsx)(Jc,{name:"Profile",children:Object(gn.jsx)(pi,{settingKey:"settings-general-movie_default_profile"})})})]})]})]})})})},Ii=function(e,t){return e.name===t.name},Pi=function(e){var t,n=e.selections,r=Object(hn.a)(e,["selections"]),i=Object(a.useMemo)((function(){return n.filter((function(e){return!e.enabled})).map((function(e){return{label:e.name,value:e}}))}),[n]),s=function(e,t){var n=Hc(),r=_c();void 0===t&&(t=Z.isEqual);var c=Object(a.useMemo)((function(){return e in r?r[e]:[]}),[e,r]);return Object(a.useCallback)((function(r){var a=Object(X.a)(c),i=a.findIndex((function(e){return t(e,r)}));-1!==i?a[i]=r:a.push(r),n(a,e)}),[t,c,e,n])}(Bc,Ii),o=lr(r.modalKey),l=Object(a.useState)(null!==o&&void 0!==o?o:null),u=Object(J.a)(l,2),d=u[0],j=u[1],b=Object(a.useCallback)((function(){return j(null!==o&&void 0!==o?o:null)}),[o]);or(r.modalKey,b);var O=Object(a.useCallback)((function(e){if(d){var t=Object(f.a)({},d);t.url=e,j(t)}}),[d]),h=ir(),p=null!==d&&null!==(null===d||void 0===d?void 0:d.url)&&0!==(null===d||void 0===d?void 0:d.url.length),x=Object(a.useMemo)((function(){return Object(gn.jsxs)(c.a.Fragment,{children:[Object(gn.jsx)(qn,{className:"mr-auto",disabled:!p,variant:"outline-secondary",promise:function(){return d&&d.url?Rt.testNotification(d.url):null},children:"Test"}),Object(gn.jsx)(wn.a,{hidden:null===o,variant:"danger",onClick:function(){d&&(d.enabled=!1,s(d)),h()},children:"Remove"}),Object(gn.jsx)(wn.a,{disabled:!p,onClick:function(){d&&(d.enabled=!0,s(d)),h()},children:"Save"})]})}),[p,h,d,s,o]),v=Object(a.useCallback)((function(e){return e.name}),[]);return Object(gn.jsx)(jr,Object(f.a)(Object(f.a)({title:"Notification",footer:x},r),{},{children:Object(gn.jsx)(yn.a,{fluid:!0,children:Object(gn.jsxs)(Vt.a,{children:[Object(gn.jsx)(sa.a,{xs:12,children:Object(gn.jsx)(zn,{disabled:null!==o,options:i,value:d,onChange:j,label:v})}),Object(gn.jsx)(sa.a,{hidden:null===d,children:Object(gn.jsx)(Pn.a.Group,{className:"mt-4",children:Object(gn.jsx)(Pn.a.Control,{as:"textarea",rows:4,placeholder:"URL",value:null!==(t=null===d||void 0===d?void 0:d.url)&&void 0!==t?t:"",onChange:function(e){var t=e.currentTarget.value;O(t)}})})})]})})}))},Ai=function(){var e=function(e,t,n){var r=Uc(e,Z.isArray,n),c=_c();void 0===t&&(t=Z.isEqual);var i=void 0;return e in c&&(i=c[e]),Object(a.useMemo)((function(){return void 0!==i&&r?ue(r,i,t):r}),[r,i,t])}(Bc,Ii,(function(e){return e.notifications.providers})),t=cr(),n=Object(a.useMemo)((function(){return null===e||void 0===e?void 0:e.filter((function(e){return e.enabled})).map((function(e,n){return Object(gn.jsx)(Zc,{header:e.name,onClick:function(){return t("notifications",e)}},de(n,e.name))}))}),[e,t]);return Object(gn.jsxs)(yn.a,{fluid:!0,children:[Object(gn.jsxs)(Vt.a,{children:[n," ",Object(gn.jsx)(Zc,{plus:!0,onClick:function(){return t("notifications")}})]}),Object(gn.jsx)(Pi,{selections:null!==e&&void 0!==e?e:[],modalKey:"notifications"})]})},Ti=function(){return Object(gn.jsxs)(Lc,{title:"Notifications - Bazarr (Settings)",children:[Object(gn.jsxs)(kn.a,{variant:"secondary",children:["Thanks to caronc for his work on"," ",Object(gn.jsx)("a",{href:"https://github.com/caronc/apprise",target:"_blank",rel:"noopener noreferrer",children:"apprise"}),", the core of the Bazarr notification system."]}),Object(gn.jsxs)(kn.a,{variant:"secondary",children:["Please follow instructions on his"," ",Object(gn.jsx)("a",{href:"https://github.com/caronc/apprise/wiki",target:"_blank",rel:"noopener noreferrer",children:"Wiki"})," ","to configure your notification providers."]}),Object(gn.jsx)(Xc,{header:"Notifications",children:Object(gn.jsx)(Ai,{})}),Object(gn.jsx)(Xc,{header:"Options",children:Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{label:"Silent for Manual Actions",settingKey:"settings-general-dont_notify_manual_actions"}),Object(gn.jsx)(ei,{children:"Suppress notifications when manually download/upload subtitles."})]})})]})},Ei=n(24),Mi=[{key:"addic7ed",description:"Requires Anti-Captcha Provider",defaultKey:{username:"",password:""}},{key:"argenteam",description:"Spanish Subtitles Provider"},{key:"assrt",description:"Chinese Subtitles Provider",defaultKey:{token:""}},{key:"betaseries",name:"BetaSeries",description:"French / English Provider for TV Shows Only",defaultKey:{token:""},keyNameOverride:{token:"API KEY"}},{key:"bsplayer",name:"BSplayer"},{key:"greeksubs",name:"GreekSubs",description:"Greek Subtitles Provider"},{key:"greeksubtitles",name:"GreekSubtitles",description:"Greek Subtitles Provider"},{key:"hosszupuska",description:"Hungarian Subtitles Provider"},{key:"legendasdivx",name:"LegendasDivx",description:"Brazilian / Portuguese Subtitles Provider",defaultKey:{username:"",password:"",skip_wrong_fps:!1},keyNameOverride:{skip_wrong_fps:"Skip Wrong FPS"}},{key:"legendastv",name:"LegendasTV",description:"Brazilian / Portuguese Subtitles Provider",defaultKey:{username:"",password:""}},{key:"napiprojekt",description:"Polish Subtitles Provider"},{key:"napisy24",description:"Polish Subtitles Provider",message:"The provided credentials must have API access. Leave empty to use the defaults.",defaultKey:{username:"",password:""}},{key:"nekur",description:"Latvian Subtitles Provider"},{key:"opensubtitles",name:"OpenSubtitles.org",defaultKey:{username:"",password:"",vip:!1,ssl:!1,skip_wrong_fps:!1},keyNameOverride:{vip:"VIP",ssl:"Use SSL",skip_wrong_fps:"Skip Wrong FPS"}},{key:"opensubtitlescom",name:"OpenSubtitles.com",defaultKey:{username:"",password:"",use_hash:!1},keyNameOverride:{use_hash:"Use Hash"}},{key:"podnapisi"},{key:"regielive",name:"RegieLive",description:"Romanian Subtitles Provider"},{key:"soustitreseu",name:"Sous-Titres.eu",description:"Mostly French Subtitles Provider"},{key:"subdivx",description:"Spanish Subtitles Provider"},{key:"subssabbz",name:"Subs.sab.bz",description:"Bulgarian Subtitles Provider"},{key:"subs4free",name:"Subs4Free",description:"Greek Subtitles Provider"},{key:"subs4series",name:"Subs4Series",description:"Greek Subtitles Provider"},{key:"subscene",description:"Requires Anti-Captcha Provider",defaultKey:{username:"",password:""}},{key:"subscenter"},{key:"subsunacs",name:"Subsunacs.net",description:"Bulgarian Subtitles Provider"},{key:"subsynchro",description:"French Subtitles Provider"},{key:"subtitriid",name:"subtitri.id.lv",description:"Latvian Subtitles Provider"},{key:"subtitulamostv",name:"Subtitulamos.tv",description:"Spanish Subtitles Provider"},{key:"sucha",description:"Spanish Subtitles Provider"},{key:"supersubtitles"},{key:"titlovi",defaultKey:{username:"",password:""}},{key:"titrari",name:"Titrari.ro"},{key:"tusubtitulo",name:"Tusubtitulo.com",description:"Spanish / English Subtitles Provider for TV Shows"},{key:"tvsubtitles",name:"TVSubtitles"},{key:"wizdom",description:"Wizdom.xyz Subtitles Provider."},{key:"xsubs",name:"XSubs",description:"Greek Subtitles Provider",defaultKey:{username:"",password:""}},{key:"yavkanet",name:"Yavka.net",description:"Bulgarian Subtitles Provider"},{key:"yifysubtitles",name:"YIFY Subtitles"},{key:"zimuku",description:"Chinese Subtitles Provider"}],Ki="provider-modal",Bi="settings-general-enabled_providers",Di=function(){var e=Fc(Bi,Z.isArray),t=cr(),n=Object(a.useCallback)((function(e){t(Ki,null!==e&&void 0!==e?e:null)}),[t]),r=Object(a.useMemo)((function(){return e?e.flatMap((function(e){var t=Mi.find((function(t){return t.key===e}));return t||[]})).map((function(e,t){var r;return Object(gn.jsx)(Zc,{header:null!==(r=e.name)&&void 0!==r?r:Object(Z.capitalize)(e.key),subheader:e.description,onClick:function(){return n(e)}},de(t,e.name))})):[]}),[e,n]);return Object(gn.jsx)(yn.a,{fluid:!0,children:Object(gn.jsxs)(Vt.a,{children:[r,Object(gn.jsx)(Zc,{plus:!0,onClick:n},"add-card")]})})},zi=function(){var e=lr(Ki),t=Object(a.useState)({}),n=Object(J.a)(t,2),r=n[0],i=n[1],s=Object(a.useState)(null!==e&&void 0!==e?e:null),o=Object(J.a)(s,2),l=o[0],u=o[1],d=Object(a.useCallback)((function(){return u(null!==e&&void 0!==e?e:null)}),[e]);or(Ki,d);var j=Fc(Bi,Z.isArray),b=ir(),O=function(){var e=Object(a.useContext)(Rc),t=Object(J.a)(e,2)[1];return Object(a.useCallback)((function(e){t((function(t){return Object(f.a)(Object(f.a)({},t),e)}))}),[t])}(),p=Object(a.useCallback)((function(){if(e&&j){var t=j.findIndex((function(t){return t===e.key}));if(-1!==t){var n=Object(X.a)(j);n.splice(t,1),O(Object(h.a)({},Bi,n)),b()}}}),[e,j,O,b]),x=Object(a.useCallback)((function(){if(l&&j){var e=Object(f.a)({},r);if(void 0===j.find((function(e){return e===l.key}))){var t=[].concat(Object(X.a)(j),[l.key]);e[Bi]=t}O(e),b()}}),[l,j,r,b,O]),v=null!==l,m=Object(a.useMemo)((function(){return Object(gn.jsxs)(c.a.Fragment,{children:[Object(gn.jsx)(wn.a,{hidden:!e,variant:"danger",onClick:p,children:"Delete"}),Object(gn.jsx)(wn.a,{disabled:!v,onClick:x,children:"Save"})]})}),[v,e,p,x]),g=Object(a.useCallback)((function(e){u(e||{key:"",description:"Unknown Provider"})}),[]),y=Object(a.useMemo)((function(){return Mi.filter((function(e){return void 0===(null===j||void 0===j?void 0:j.find((function(t){return t===e.key})))})).map((function(e){var t;return{label:null!==(t=e.name)&&void 0!==t?t:Object(Z.capitalize)(e.key),value:e}}))}),[j]),k=Object(a.useMemo)((function(){var e;if(null===l)return null;var t=l.defaultKey,n=null!==(e=l.keyNameOverride)&&void 0!==e?e:{};if(void 0===t)return null;var r=l.key,a=[],c=[];for(var i in t){var s=t[i],o=i;o=o in n?n[o]:Object(Z.capitalize)(i),$(s)?a.push(Object(gn.jsx)(sa.a,{xs:12,className:"mt-2",children:Object(gn.jsx)(ti,{password:"password"===i,placeholder:o,settingKey:"settings-".concat(r,"-").concat(i)})},i)):Object(Z.isBoolean)(s)&&c.push(Object(gn.jsx)(ni,{inline:!0,label:o,settingKey:"settings-".concat(r,"-").concat(i)},i))}return Object(gn.jsxs)(Vt.a,{children:[a,Object(gn.jsx)(sa.a,{hidden:0===c.length,className:"mt-2",children:c})]})}),[l]),w=Object(a.useMemo)((function(){return{Option:function(e){var t=e.data,n=Object(hn.a)(e,["data"]),r=t,a=r.label,c=r.value;return Object(gn.jsxs)(Ei.l.Option,Object(f.a)(Object(f.a)({data:t},n),{},{children:[a,Object(gn.jsx)("p",{className:"small m-0 text-muted",children:c.description})]}))}}}),[]),S=Object(a.useCallback)((function(e){var t;return null!==(t=e.name)&&void 0!==t?t:Object(Z.capitalize)(e.key)}),[]);return Object(gn.jsx)(jr,{title:"Provider",footer:m,modalKey:Ki,children:Object(gn.jsx)(Rc.Provider,{value:[r,i],children:Object(gn.jsxs)(yn.a,{children:[Object(gn.jsx)(Vt.a,{children:Object(gn.jsx)(sa.a,{children:Object(gn.jsx)(zn,{components:w,disabled:null!==e,options:y,value:l,label:S,onChange:g})})}),Object(gn.jsx)(Vt.a,{children:Object(gn.jsx)(sa.a,{className:"mb-2",children:Object(gn.jsx)(ei,{children:null===l||void 0===l?void 0:l.description})})}),k,Object(gn.jsx)(Vt.a,{hidden:void 0===(null===l||void 0===l?void 0:l.message),children:Object(gn.jsx)(sa.a,{children:Object(gn.jsx)(ei,{children:null===l||void 0===l?void 0:l.message})})})]})})})},Ri=function(){return Object(gn.jsxs)(Lc,{title:"Providers - Bazarr (Settings)",children:[Object(gn.jsx)(Xc,{header:"Providers",children:Object(gn.jsx)(Jc,{children:Object(gn.jsx)(Di,{})})}),Object(gn.jsx)(zi,{})]})};var Li=function(e){var t=e.type,n=function(e){return"sonarr"===e?"settings-general-path_mappings":"settings-general-path_mappings_movie"}(t),r=Fc(n,Z.isArray),i=Uc(function(e){return"sonarr"===e?Dc:zc}(t),Z.isBoolean),s=Hc(),o=Object(a.useCallback)((function(e){s(e.map((function(e){return[e.from,e.to]})),n)}),[n,s]),l=Object(a.useCallback)((function(){if(r){var e=[].concat(Object(X.a)(r),[["",""]]);s(e,n)}}),[r,n,s]),u=Object(a.useMemo)((function(){var e;return null!==(e=null===r||void 0===r?void 0:r.map((function(e){return{from:e[0],to:e[1]}})))&&void 0!==e?e:[]}),[r]),d=Object(a.useMemo)((function(){return"sonarr"===t?function(e){return Et.sonarr(e)}:function(e){return Et.radarr(e)}}),[t]),j=Object(a.useCallback)((function(e,t){var n=Object(X.a)(u);t?n[e.index]=t:n.splice(e.index,1),o(n)}),[u,o]),b=Object(a.useMemo)((function(){return[{Header:Object(Z.capitalize)(t),accessor:"from",Cell:function(e){var t=e.value,n=e.row,r=e.externalUpdate;return Object(gn.jsx)(Mn,{drop:"up",defaultValue:t,load:d,onChange:function(e){var t=Object(f.a)({},n.original);t.from=e,r&&r(n,t)}})}},{id:"arrow",className:"text-center",Cell:function(){return Object(gn.jsx)(pn.a,{icon:fn.b})}},{Header:"Bazarr",accessor:"to",Cell:function(e){var t=e.value,n=e.row,r=e.externalUpdate;return Object(gn.jsx)(Mn,{drop:"up",defaultValue:t,load:function(e){return Et.bazarr(e)},onChange:function(e){var t=Object(f.a)({},n.original);t.to=e,r&&r(n,t)}})}},{id:"action",accessor:"to",Cell:function(e){var t=e.row,n=e.externalUpdate;return Object(gn.jsx)(Vn,{icon:fn.Z,onClick:function(){n&&n(t)}})}}]}),[t,d]);return i?Object(gn.jsxs)(c.a.Fragment,{children:[Object(gn.jsx)(ea,{emptyText:"No Mapping",responsive:!1,columns:b,data:u,externalUpdate:j}),Object(gn.jsx)(wn.a,{block:!0,variant:"light",onClick:l,children:"Add"})]}):Object(gn.jsx)(ei,{children:"Path Mappings will be available after staged changes are saved"})},_i=function(){var e=Object(a.useCallback)((function(e){var t,n;return null!==(t=null===(n=e.radarr.base_url)||void 0===n?void 0:n.slice(1))&&void 0!==t?t:""}),[]);return Object(gn.jsx)(Lc,{title:"Radarr - Bazarr (Settings)",children:Object(gn.jsxs)(Vc,{children:[Object(gn.jsx)(Vc.Control,{children:Object(gn.jsx)(Xc,{header:"Use Radarr",children:Object(gn.jsx)(Jc,{children:Object(gn.jsx)(ni,{label:"Enabled",settingKey:zc})})})}),Object(gn.jsxs)(Vc.Content,{indent:!1,children:[Object(gn.jsxs)(Xc,{header:"Host",children:[Object(gn.jsxs)(Jc,{name:"Address",children:[Object(gn.jsx)(ti,{settingKey:"settings-radarr-ip"}),Object(gn.jsx)(ei,{children:"Hostname or IPv4 Address"})]}),Object(gn.jsx)(Jc,{name:"Port",children:Object(gn.jsx)(ti,{settingKey:"settings-radarr-port"})}),Object(gn.jsx)(Jc,{name:"Base URL",children:Object(gn.jsxs)(mr.a,{children:[Object(gn.jsx)(mr.a.Prepend,{children:Object(gn.jsx)(mr.a.Text,{children:"/"})}),Object(gn.jsx)(ti,{settingKey:"settings-radarr-base_url",override:e,beforeStaged:function(e){return"/"+e}})]})}),Object(gn.jsx)(Jc,{name:"API Key",children:Object(gn.jsx)(ti,{settingKey:"settings-radarr-apikey"})}),Object(gn.jsx)(Jc,{children:Object(gn.jsx)(ni,{label:"SSL",settingKey:"settings-radarr-ssl"})}),Object(gn.jsx)(Jc,{children:Object(gn.jsx)(oi,{category:"radarr"})})]}),Object(gn.jsxs)(Xc,{header:"Options",children:[Object(gn.jsx)(Jc,{name:"Minimum Score",children:Object(gn.jsx)(ci,{settingKey:"settings-general-minimum_score_movie"})}),Object(gn.jsxs)(Jc,{name:"Excluded Tags",children:[Object(gn.jsx)(ii,{settingKey:"settings-radarr-excluded_tags"}),Object(gn.jsx)(ei,{children:"Movies with those tags (case sensitive) in Radarr will be excluded from automatic download of subtitles."})]}),Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{label:"Download Only Monitored",settingKey:"settings-radarr-only_monitored"}),Object(gn.jsx)(ei,{children:"Automatic download of subtitles will only happen for monitored movies in Radarr."})]})]}),Object(gn.jsx)(Xc,{header:"Path Mappings",children:Object(gn.jsx)(Li,{type:"radarr"})})]})]})})},Hi=[{label:"1 Minute",value:1},{label:"5 Minutes",value:5},{label:"15 Minutes",value:15},{label:"1 Hour",value:60},{label:"3 Hours",value:180}],Ui=[{label:"5 Minutes",value:5},{label:"15 Minutes",value:15},{label:"1 Hour",value:60},{label:"3 Hours",value:180},{label:"6 Hours",value:360}],Fi=Ui,Gi=[{label:"Manually",value:"Manually"},{label:"Daily",value:"Daily"},{label:"Weekly",value:"Weekly"}],qi=[{label:"Monday",value:0},{label:"Tuesday",value:1},{label:"Wednesday",value:2},{label:"Thursday",value:3},{label:"Friday",value:4},{label:"Saturday",value:5},{label:"Sunday",value:6}],Wi=[{label:"3 Hours",value:3},{label:"6 Hours",value:6},{label:"12 Hours",value:12},{label:"24 Hours",value:24}],Yi=function(){var e=Object(a.useMemo)((function(){return Array(24).fill(null).map((function(e,t){return{label:"".concat(t,":00"),value:t}}))}),[]);return Object(gn.jsxs)(Lc,{title:"Scheduler - Bazarr (Settings)",children:[Object(gn.jsxs)(Xc,{header:"Sonarr/Radarr Sync",children:[Object(gn.jsx)(Jc,{name:"Update Series List from Sonarr",children:Object(gn.jsx)(ai,{options:Hi,settingKey:"settings-sonarr-series_sync"})}),Object(gn.jsx)(Jc,{name:"Update Episodes List from Sonarr",children:Object(gn.jsx)(ai,{options:Ui,settingKey:"settings-sonarr-episodes_sync"})}),Object(gn.jsx)(Jc,{name:"Update Movies List from Radarr",children:Object(gn.jsx)(ai,{options:Fi,settingKey:"settings-radarr-movies_sync"})})]}),Object(gn.jsxs)(Xc,{header:"Disk Indexing",children:[Object(gn.jsxs)(Vc,{children:[Object(gn.jsx)(Vc.Control,{children:Object(gn.jsx)(Jc,{name:"Update all Episode Subtitles from Disk",children:Object(gn.jsx)(ai,{settingKey:"settings-sonarr-full_update",options:Gi})})}),Object(gn.jsx)(Vc.Content,{on:function(e){return"Weekly"===e},children:Object(gn.jsx)(Jc,{name:"Day of The Week",children:Object(gn.jsx)(ai,{settingKey:"settings-sonarr-full_update_day",options:qi})})}),Object(gn.jsx)(Vc.Content,{on:function(e){return"Daily"===e||"Weekly"===e},children:Object(gn.jsx)(Jc,{name:"Time of The Day",children:Object(gn.jsx)(ai,{settingKey:"settings-sonarr-full_update_hour",options:e})})})]}),Object(gn.jsxs)(Vc,{children:[Object(gn.jsx)(Vc.Control,{children:Object(gn.jsx)(Jc,{name:"Update all Movie Subtitles from Disk",children:Object(gn.jsx)(ai,{settingKey:"settings-radarr-full_update",options:Gi})})}),Object(gn.jsx)(Vc.Content,{on:function(e){return"Weekly"===e},children:Object(gn.jsx)(Jc,{name:"Day of The Week",children:Object(gn.jsx)(ai,{settingKey:"settings-radarr-full_update_day",options:qi})})}),Object(gn.jsx)(Vc.Content,{on:function(e){return"Daily"===e||"Weekly"===e},children:Object(gn.jsx)(Jc,{name:"Time of The Day",children:Object(gn.jsx)(ai,{settingKey:"settings-radarr-full_update_hour",options:e})})})]})]}),Object(gn.jsxs)(Xc,{header:"Search and Upgrade Subtitles",children:[Object(gn.jsx)(Jc,{name:"Search for Missing Series Subtitles",children:Object(gn.jsx)(ai,{settingKey:"settings-general-wanted_search_frequency",options:Wi})}),Object(gn.jsx)(Jc,{name:"Search for Missing Movies Subtitles",children:Object(gn.jsx)(ai,{options:Wi,settingKey:"settings-general-wanted_search_frequency_movie"})}),Object(gn.jsx)(Jc,{name:"Upgrade Previously Downloaded Subtitles",children:Object(gn.jsx)(ai,{options:Wi,settingKey:"settings-general-upgrade_frequency"})})]})]})},Vi=[{label:"Standard",value:"standard"},{label:"Anime",value:"anime"},{label:"Daily",value:"daily"}],Qi=function(){var e=Object(a.useCallback)((function(e){var t,n;return null!==(t=null===(n=e.sonarr.base_url)||void 0===n?void 0:n.slice(1))&&void 0!==t?t:""}),[]);return Object(gn.jsx)(Lc,{title:"Sonarr - Bazarr (Settings)",children:Object(gn.jsxs)(Vc,{children:[Object(gn.jsx)(Vc.Control,{children:Object(gn.jsx)(Xc,{header:"Use Sonarr",children:Object(gn.jsx)(Jc,{children:Object(gn.jsx)(ni,{label:"Enabled",settingKey:Dc})})})}),Object(gn.jsxs)(Vc.Content,{indent:!1,children:[Object(gn.jsxs)(Xc,{header:"Host",children:[Object(gn.jsxs)(Jc,{name:"Address",children:[Object(gn.jsx)(ti,{settingKey:"settings-sonarr-ip"}),Object(gn.jsx)(ei,{children:"Hostname or IPv4 Address"})]}),Object(gn.jsx)(Jc,{name:"Port",children:Object(gn.jsx)(ti,{settingKey:"settings-sonarr-port"})}),Object(gn.jsx)(Jc,{name:"Base URL",children:Object(gn.jsxs)(mr.a,{children:[Object(gn.jsx)(mr.a.Prepend,{children:Object(gn.jsx)(mr.a.Text,{children:"/"})}),Object(gn.jsx)(ti,{settingKey:"settings-sonarr-base_url",override:e,beforeStaged:function(e){return"/"+e}})]})}),Object(gn.jsx)(Jc,{name:"API Key",children:Object(gn.jsx)(ti,{settingKey:"settings-sonarr-apikey"})}),Object(gn.jsx)(Jc,{children:Object(gn.jsx)(ni,{label:"SSL",settingKey:"settings-sonarr-ssl"})}),Object(gn.jsx)(Jc,{children:Object(gn.jsx)(oi,{category:"sonarr"})})]}),Object(gn.jsxs)(Xc,{header:"Options",children:[Object(gn.jsx)(Jc,{name:"Minimum Score",children:Object(gn.jsx)(ci,{settingKey:"settings-general-minimum_score"})}),Object(gn.jsxs)(Jc,{name:"Excluded Tags",children:[Object(gn.jsx)(ii,{settingKey:"settings-sonarr-excluded_tags"}),Object(gn.jsx)(ei,{children:"Episodes from series with those tags (case sensitive) in Sonarr will be excluded from automatic download of subtitles."})]}),Object(gn.jsxs)(Jc,{name:"Excluded Series Types",children:[Object(gn.jsx)(ai,{settingKey:"settings-sonarr-excluded_series_types",multiple:!0,options:Vi}),Object(gn.jsx)(ei,{children:"Episodes from series with those types in Sonarr will be excluded from automatic download of subtitles."})]}),Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{label:"Download Only Monitored",settingKey:"settings-sonarr-only_monitored"}),Object(gn.jsx)(ei,{children:"Automatic download of subtitles will only happen for monitored episodes in Sonarr."})]})]}),Object(gn.jsx)(Xc,{header:"Path Mappings",children:Object(gn.jsx)(Li,{type:"sonarr"})})]})]})})},Xi=[{label:"AlongSide Media File",value:"current"},{label:"Relative Path to Media File",value:"relative"},{label:"Absolute Path",value:"absolute"}],Ji=[{label:"Anti-Captcha",value:"anti-captcha"},{label:"Death by Captcha",value:"death-by-captcha"}];function Zi(e){return"color(name=".concat(e,")")}var $i=[{label:"White",value:Zi("white")},{label:"Light Gray",value:Zi("lightgray")},{label:"Red",value:Zi("red")},{label:"Green",value:Zi("green")},{label:"Yellow",value:Zi("yellow")},{label:"Blue",value:Zi("blue")},{label:"Magenta",value:Zi("magenta")},{label:"Cyan",value:Zi("cyan")},{label:"Black",value:Zi("black")},{label:"Dark Red",value:Zi("darkred")},{label:"Dark Green",value:Zi("darkgreen")},{label:"Dark Yellow",value:Zi("darkyellow")},{label:"Dark Blue",value:Zi("darkblue")},{label:"Dark Magenta",value:Zi("darkmagenta")},{label:"Dark Cyan",value:Zi("darkcyan")},{label:"Dark Grey",value:Zi("darkgrey")}],es=function(e){return function(t){var n,r;return null!==(n=null===(r=t.general.subzero_mods)||void 0===r?void 0:r.includes(e))&&void 0!==n&&n}},ts=function(e){var t,n;return null!==(t=null===(n=e.general.subzero_mods)||void 0===n?void 0:n.find((function(e){return e.startsWith("color")})))&&void 0!==t?t:null},ns=function(){return Object(gn.jsxs)(Lc,{title:"Subtitles - Bazarr (Settings)",children:[Object(gn.jsxs)(Xc,{header:"Subtitles Options",children:[Object(gn.jsxs)(Vc,{children:[Object(gn.jsx)(Vc.Control,{children:Object(gn.jsxs)(Jc,{name:"Subtitle Folder",children:[Object(gn.jsx)(ai,{options:Xi,settingKey:"settings-general-subfolder"}),Object(gn.jsx)(ei,{children:"Choose the folder you wish to store/read the subtitles"})]})}),Object(gn.jsx)(Vc.Content,{on:function(e){return""!==e&&"current"!==e},children:Object(gn.jsx)(Jc,{name:"Custom Subtitles Folder",children:Object(gn.jsx)(ti,{settingKey:"settings-general-subfolder_custom"})})})]}),Object(gn.jsxs)(Vc,{children:[Object(gn.jsx)(Vc.Control,{children:Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{label:"Upgrade Previously Downloaded Subtitles",settingKey:"settings-general-upgrade_subs"}),Object(gn.jsx)(ei,{children:"Schedule a task to upgrade subtitles previously downloaded by Bazarr."})]})}),Object(gn.jsxs)(Vc.Content,{children:[Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ci,{settingKey:"settings-general-days_to_upgrade_subs",max:30}),Object(gn.jsx)(ei,{children:"Number of days to go back in history to upgrade subtitles"})]}),Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{label:"Upgrade Manually Downloaded or Translated Subtitles",settingKey:"settings-general-upgrade_manual"}),Object(gn.jsx)(ei,{children:"Enable or disable upgrade of manually downloaded or translated subtitles."})]})]})]})]}),Object(gn.jsx)(Xc,{header:"Anti-Captcha Options",children:Object(gn.jsxs)(Vc,{children:[Object(gn.jsx)(Vc.Control,{children:Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ai,{clearable:!0,settingKey:"settings-general-anti_captcha_provider",beforeStaged:function(e){return void 0===e?"None":e},options:Ji}),Object(gn.jsx)(ei,{children:"Choose the anti-captcha provider you want to use"})]})}),Object(gn.jsxs)(Vc.Content,{eventKey:"anti-captcha",children:[Object(gn.jsx)(Jc,{children:Object(gn.jsx)("a",{href:"http://getcaptchasolution.com/eixxo1rsnw",children:"Anti-Captcha.com"})}),Object(gn.jsx)(Jc,{name:"Account Key",children:Object(gn.jsx)(ti,{settingKey:"settings-anticaptcha-anti_captcha_key"})})]}),Object(gn.jsxs)(Vc.Content,{eventKey:"death-by-captcha",children:[Object(gn.jsx)(Jc,{children:Object(gn.jsx)("a",{href:"https://www.deathbycaptcha.com",children:"DeathByCaptcha.com"})}),Object(gn.jsx)(Jc,{name:"Username",children:Object(gn.jsx)(ti,{settingKey:"settings-deathbycaptcha-username"})}),Object(gn.jsx)(Jc,{name:"Password",children:Object(gn.jsx)(ti,{password:!0,settingKey:"settings-deathbycaptcha-password"})})]})]})}),Object(gn.jsxs)(Xc,{header:"Performance / Optimization",children:[Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{label:"Adaptive Searching",settingKey:"settings-general-adaptive_searching"}),Object(gn.jsx)(ei,{children:"When searching for subtitles, Bazarr will search less frequently to limit call to providers."})]}),Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{label:"Search Enabled Providers Simultaneously",settingKey:"settings-general-multithreading"}),Object(gn.jsx)(ei,{children:"Search multiple providers at once (Don't choose this on low powered devices)"})]}),Object(gn.jsxs)(Vc,{children:[Object(gn.jsx)(Vc.Control,{children:Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{label:"Use Embedded Subtitles",settingKey:"settings-general-use_embedded_subs"}),Object(gn.jsx)(ei,{children:"Use embedded subtitles in media files when determining missing ones."})]})}),Object(gn.jsxs)(Vc.Content,{children:[Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{label:"Ignore Embedded PGS Subtitles",settingKey:"settings-general-ignore_pgs_subs"}),Object(gn.jsx)(ei,{children:"Ignores PGS Subtitles in Embedded Subtitles detection."})]}),Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{label:"Ignore Embedded VobSub Subtitles",settingKey:"settings-general-ignore_vobsub_subs"}),Object(gn.jsx)(ei,{children:"Ignores VobSub Subtitles in Embedded Subtitles detection."})]}),Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{label:"Show Only Desired Languages",settingKey:"settings-general-embedded_subs_show_desired"}),Object(gn.jsx)(ei,{children:"Hide embedded subtitles for languages that are not currently desired."})]})]})]})]}),Object(gn.jsxs)(Xc,{header:"Post-Processing",children:[Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{label:"Encode Subtitles To UTF8",settingKey:"settings-general-utf8_encode"}),Object(gn.jsx)(ei,{children:"Re-encode downloaded Subtitles to UTF8. Should be left enabled in most case."})]}),Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{label:"Hearing Impaired",override:es("remove_HI"),settingKey:"subzero-remove_HI"}),Object(gn.jsx)(ei,{children:"Removes tags, text and characters from subtitles that are meant for hearing impaired people."})]}),Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{label:"Remove Tags",override:es("remove_tags"),settingKey:"subzero-remove_tags"}),Object(gn.jsx)(ei,{children:"Removes all possible style tags from the subtitle, such as font, bold, color etc."})]}),Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{label:"OCR Fixes",override:es("OCR_fixes"),settingKey:"subzero-OCR_fixes"}),Object(gn.jsx)(ei,{children:"Fix issues that happen when a subtitle gets converted from bitmap to text through OCR."})]}),Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{label:"Common Fixes",override:es("common"),settingKey:"subzero-common"}),Object(gn.jsx)(ei,{children:"Fix common and whitespace/punctuation issues in subtitles."})]}),Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{label:"Fix Uppercase",override:es("fix_uppercase"),settingKey:"subzero-fix_uppercase"}),Object(gn.jsx)(ei,{children:"Tries to make subtitles that are completely uppercase readable."})]}),Object(gn.jsxs)(Jc,{name:"Color",children:[Object(gn.jsx)(ai,{clearable:!0,options:$i,override:ts,settingKey:"subzero-color"}),Object(gn.jsx)(ei,{children:"Adds color to your subtitles (for playback devices/software that don't ship their own color modes; only works for players that support color tags)."})]}),Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{label:"Reverse RTL",override:es("reverse_rtl"),settingKey:"subzero-reverse_rtl"}),Object(gn.jsx)(ei,{children:"Reverses the punctuation in right-to-left subtitles for problematic playback devices."})]}),Object(gn.jsxs)(Vc,{children:[Object(gn.jsx)(Vc.Control,{children:Object(gn.jsx)(Jc,{children:Object(gn.jsx)(ni,{label:"Permission (chmod)",settingKey:"settings-general-chmod_enabled"})})}),Object(gn.jsx)(Vc.Content,{children:Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ti,{placeholder:"0777",settingKey:"settings-general-chmod"}),Object(gn.jsx)(ei,{children:"Must be 4 digit octal"})]})})]}),Object(gn.jsxs)(Vc,{children:[Object(gn.jsx)(Vc.Control,{children:Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{label:"Automatic Subtitles Synchronization",settingKey:"settings-subsync-use_subsync"}),Object(gn.jsx)(ei,{children:"Enable the automatic subtitles synchronization after downloading a subtitles."})]})}),Object(gn.jsxs)(Vc.Content,{children:[Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{label:"Debug",settingKey:"settings-subsync-debug"}),Object(gn.jsx)(ei,{children:"Do not actually sync the subtitles but generate a .tar.gz file to be able to open an issue for ffsubsync. This file will reside alongside the media file."})]}),Object(gn.jsxs)(Vc,{children:[Object(gn.jsx)(Vc.Control,{children:Object(gn.jsx)(Jc,{children:Object(gn.jsx)(ni,{label:"Series Score Threshold",settingKey:"settings-subsync-use_subsync_threshold"})})}),Object(gn.jsx)(Vc.Content,{indent:!1,children:Object(gn.jsx)(Jc,{children:Object(gn.jsx)(ci,{settingKey:"settings-subsync-subsync_threshold"})})})]}),Object(gn.jsxs)(Vc,{children:[Object(gn.jsx)(Vc.Control,{children:Object(gn.jsx)(Jc,{children:Object(gn.jsx)(ni,{label:"Movies Score Threshold",settingKey:"settings-subsync-use_subsync_movie_threshold"})})}),Object(gn.jsx)(Vc.Content,{indent:!1,children:Object(gn.jsx)(Jc,{children:Object(gn.jsx)(ci,{settingKey:"settings-subsync-subsync_movie_threshold"})})})]})]})]}),Object(gn.jsxs)(Vc,{children:[Object(gn.jsx)(Vc.Control,{children:Object(gn.jsxs)(Jc,{children:[Object(gn.jsx)(ni,{settingKey:"settings-general-use_postprocessing",label:"Custom Post-Processing"}),Object(gn.jsx)(ei,{children:"Enable the post-processing execution after downloading a subtitles."})]})}),Object(gn.jsxs)(Vc.Content,{children:[Object(gn.jsxs)(Vc,{children:[Object(gn.jsx)(Vc.Control,{children:Object(gn.jsx)(Jc,{children:Object(gn.jsx)(ni,{settingKey:"settings-general-use_postprocessing_threshold",label:"Series Score Threshold"})})}),Object(gn.jsx)(Vc.Content,{indent:!1,children:Object(gn.jsx)(Jc,{children:Object(gn.jsx)(ci,{settingKey:"settings-general-postprocessing_threshold"})})})]}),Object(gn.jsxs)(Vc,{children:[Object(gn.jsx)(Vc.Control,{children:Object(gn.jsx)(Jc,{children:Object(gn.jsx)(ni,{settingKey:"settings-general-use_postprocessing_threshold_movie",label:"Movies Score Threshold"})})}),Object(gn.jsx)(Vc.Content,{indent:!1,children:Object(gn.jsx)(Jc,{children:Object(gn.jsx)(ci,{settingKey:"settings-general-postprocessing_threshold_movie"})})})]}),Object(gn.jsx)(Jc,{name:"Command",children:Object(gn.jsx)(ti,{settingKey:"settings-general-postprocessing_cmd"})}),Object(gn.jsx)(ei,{children:"Variables you can use in your command"}),Object(gn.jsxs)(ei,{children:[Object(gn.jsx)("b",{children:"{{directory}}"})," Full path of the episode file parent directory"]}),Object(gn.jsxs)(ei,{children:[Object(gn.jsx)("b",{children:"{{episode}}"})," Full path of the episode file"]}),Object(gn.jsxs)(ei,{children:[Object(gn.jsx)("b",{children:"{{episode_name}}"})," Filename of the episode without parent directory or extension"]}),Object(gn.jsxs)(ei,{children:[Object(gn.jsx)("b",{children:"{{subtitles}}"})," Full path of the subtitles file"]}),Object(gn.jsxs)(ei,{children:[Object(gn.jsx)("b",{children:"{{subtitles_language}}"})," Language of the subtitles file"]}),Object(gn.jsxs)(ei,{children:[Object(gn.jsx)("b",{children:"{{subtitles_language_code2}}"})," 2-letter ISO-639 language code of the subtitles language"]}),Object(gn.jsxs)(ei,{children:[Object(gn.jsx)("b",{children:"{{subtitles_language_code3}}"})," 3-letter ISO-639 language code of the subtitles language"]}),Object(gn.jsxs)(ei,{children:[Object(gn.jsx)("b",{children:"{{episode_language}}"})," Audio language of the episode file"]}),Object(gn.jsxs)(ei,{children:[Object(gn.jsx)("b",{children:"{{episode_language_code2}}"})," 2-letter ISO-639 language code of the episode audio language"]}),Object(gn.jsxs)(ei,{children:[Object(gn.jsx)("b",{children:"{{episode_language_code3}}"})," 3-letter ISO-639 language code of the episode audio language"]}),Object(gn.jsxs)(ei,{children:[Object(gn.jsx)("b",{children:"{{score}}"})," Score of the subtitle file"]}),Object(gn.jsxs)(ei,{children:[Object(gn.jsx)("b",{children:"{{subtitle_id}}"})," Provider ID of the subtitle file"]}),Object(gn.jsxs)(ei,{children:[Object(gn.jsx)("b",{children:"{{series_id}}"})," Sonarr series ID (Empty if movie)"]}),Object(gn.jsxs)(ei,{children:[Object(gn.jsx)("b",{children:"{{episode_id}}"})," Sonarr episode ID or Radarr movie ID"]})]})]})]})]})},rs=[{label:"25",value:25},{label:"50",value:50},{label:"100",value:100},{label:"250",value:250},{label:"500",value:500},{label:"1000",value:1e3}],as=function(){return Object(gn.jsx)(Lc,{title:"Interface - Bazarr (Settings)",children:Object(gn.jsx)(Xc,{header:"UI",children:Object(gn.jsx)(Jc,{name:"Page Size",children:Object(gn.jsx)(ai,{options:rs,settingKey:ve,override:function(e,t){return t.site.pageSize}})})})})},cs=function(){return ce(Xt(qe)),Object(gn.jsxs)(l.e,{children:[Object(gn.jsx)(l.c,{exact:!0,path:"/settings",children:Object(gn.jsx)(l.b,{exact:!0,to:"/settings/general"})}),Object(gn.jsx)(l.c,{exact:!0,path:"/settings/general",children:Object(gn.jsx)(hi,{})}),Object(gn.jsx)(l.c,{exact:!0,path:"/settings/ui",children:Object(gn.jsx)(as,{})}),Object(gn.jsx)(l.c,{exact:!0,path:"/settings/sonarr",children:Object(gn.jsx)(Qi,{})}),Object(gn.jsx)(l.c,{exact:!0,path:"/settings/radarr",children:Object(gn.jsx)(_i,{})}),Object(gn.jsx)(l.c,{exact:!0,path:"/settings/languages",children:Object(gn.jsx)(Ni,{})}),Object(gn.jsx)(l.c,{exact:!0,path:"/settings/subtitles",children:Object(gn.jsx)(ns,{})}),Object(gn.jsx)(l.c,{exact:!0,path:"/settings/scheduler",children:Object(gn.jsx)(Yi,{})}),Object(gn.jsx)(l.c,{exact:!0,path:"/settings/providers",children:Object(gn.jsx)(Ri,{})}),Object(gn.jsx)(l.c,{exact:!0,path:"/settings/notifications",children:Object(gn.jsx)(Ti,{})}),Object(gn.jsx)(l.c,{path:"/settings/*",children:Object(gn.jsx)(l.b,{to:_a})})]})},is=function(e){var t=Object.assign({},e),n=lr(t.modalKey),r=Object(a.useMemo)((function(){return null===n||void 0===n?void 0:n.split("\\n").map((function(e,t){return Object(gn.jsx)("p",{className:"text-nowrap my-1",children:e},t)}))}),[n]);return Object(gn.jsx)(jr,Object(f.a)(Object(f.a)({title:"Stack traceback"},t),{},{children:Object(gn.jsx)("pre",{children:Object(gn.jsx)("code",{className:"zmdi-language-python-alt",children:r})})}))};function ss(e){switch(e){case"DEBUG":return fn.n;case"ERROR":return fn.f;case"INFO":return fn.A;case"WARNING":return fn.s;default:return fn.N}}var os=function(e){var t=e.logs,n=cr(),r=Object(a.useCallback)((function(e,t){return n("system-log",t)}),[n]),i=Object(a.useMemo)((function(){return[{accessor:"type",Cell:function(e){return Object(gn.jsx)(pn.a,{icon:ss(e.value)})}},{Header:"Message",accessor:"message"},{Header:"Date",accessor:"timestamp",className:"text-nowrap"},{accessor:"exception",Cell:function(e){var t=e.row,n=e.value,r=e.externalUpdate;return Object(Z.isUndefined)(n)?null:Object(gn.jsx)(Vn,{icon:fn.D,onClick:function(){return r&&r(t,n)}})}}]}),[]);return Object(gn.jsxs)(c.a.Fragment,{children:[Object(gn.jsx)(la,{columns:i,data:t,externalUpdate:r}),Object(gn.jsx)(is,{size:"xl",modalKey:"system-log"})]})},ls=function(){var e=Qt((function(e){return e.system.logs})),t=Xt(Fe);ce(t);var n=Object(a.useState)(!1),r=Object(J.a)(n,2),c=r[0],i=r[1],s=re(!0),o=Object(a.useCallback)((function(){window.open("".concat(s,"bazarr.log"))}),[s]);return Object(gn.jsx)(Un,{state:e,children:function(n){return Object(gn.jsxs)(yn.a,{fluid:!0,children:[Object(gn.jsx)(Ua.a,{children:Object(gn.jsx)("title",{children:"Logs - Bazarr (System)"})}),Object(gn.jsxs)($n,{children:[Object(gn.jsx)($n.Button,{updating:e.updating,icon:fn.U,onClick:t,children:"Refresh"}),Object(gn.jsx)($n.Button,{icon:fn.q,onClick:o,children:"Download"}),Object(gn.jsx)($n.Button,{updating:c,icon:fn.Z,onClick:function(){i(!0),Rt.deleteLogs().finally((function(){i(!1),t()}))},children:"Empty"})]}),Object(gn.jsx)(Vt.a,{children:Object(gn.jsx)(os,{logs:n})})]})}})},us=function(e){var t=Object(a.useMemo)((function(){return[{Header:"Name",accessor:"name"},{Header:"Status",accessor:"status"},{Header:"Next Retry",accessor:"retry"}]}),[]);return Object(gn.jsx)(ea,{columns:t,data:e.providers})},ds=function(){var e=dn(),t=Object(J.a)(e,2),n=t[0],r=t[1];return ce(r),Object(gn.jsx)(Un,{state:n,children:function(e){return Object(gn.jsxs)(yn.a,{fluid:!0,children:[Object(gn.jsx)(Ua.a,{children:Object(gn.jsx)("title",{children:"Providers - Bazarr (System)"})}),Object(gn.jsxs)($n,{children:[Object(gn.jsx)($n.Button,{updating:n.updating,icon:fn.U,onClick:r,children:"Refresh"}),Object(gn.jsx)($n.AsyncButton,{icon:fn.Z,promise:function(){return Bt.reset()},onSuccess:r,children:"Reset"})]}),Object(gn.jsx)(Vt.a,{children:Object(gn.jsx)(us,{providers:e})})]})}})},js="mr-2",bs=function(e){var t=e.name,n=e.body,r=e.date,c=e.prerelease,i=e.current,s=Object(a.useMemo)((function(){return n.map((function(e){return e.replace(/(\s\[.*?\])\(.*?\)/,"")}))}),[n]);return Object(gn.jsxs)(Qc.a,{className:"mb-4 mx-3 d-flex flex-grow-1",children:[Object(gn.jsxs)(Qc.a.Header,{children:[Object(gn.jsx)("span",{className:js,children:t}),Object(gn.jsx)(Wn.a,{className:js,variant:"info",children:r}),Object(gn.jsx)(Wn.a,{className:js,variant:c?"danger":"success",children:c?"Development":"Master"}),Object(gn.jsx)(Wn.a,{className:js,hidden:!i,variant:"primary",children:"Installed"})]}),Object(gn.jsx)(Qc.a.Body,{children:Object(gn.jsxs)(Qc.a.Text,{children:["From newest to oldest:",s.map((function(e,t){return Object(gn.jsx)("li",{children:e},t)}))]})})]})},Os=function(){var e=Qt((function(e){return e.system.releases}));return ce(Xt(Ge)),Object(gn.jsx)(Un,{state:e,children:function(e){return Object(gn.jsxs)(yn.a,{fluid:!0,className:"px-5 py-4 bg-light",children:[Object(gn.jsx)(Ua.a,{children:Object(gn.jsx)("title",{children:"Releases - Bazarr (System)"})}),Object(gn.jsx)(Vt.a,{children:e.map((function(e,t){return Object(gn.jsx)(sa.a,{xs:12,children:Object(gn.jsx)(bs,Object(f.a)({},e))},de(t,e.date))}))})]})}})},hs=n(178);function fs(e){var t=e.title,n=e.children;return Object(gn.jsxs)(Vt.a,{children:[Object(gn.jsx)(sa.a,{sm:4,children:Object(gn.jsx)("b",{children:t})}),Object(gn.jsx)(sa.a,{children:n})]})}function ps(e){var t=e.icon,n=e.link,r=e.children;return Object(gn.jsxs)(c.a.Fragment,{children:[Object(gn.jsx)(pn.a,{icon:t,style:{width:"2rem"}}),Object(gn.jsx)("a",{href:n,target:"_blank",rel:"noopener noreferrer",children:r})]})}var xs=function(e){var t=e.title,n=e.children;return Object(gn.jsxs)(yn.a,{className:"py-3",children:[Object(gn.jsx)("h4",{children:t}),Object(gn.jsx)("hr",{}),n]})},vs=function(){var e=Qt((function(e){return e.system.status.data}));return ce(Xt(Le)),Object(gn.jsxs)(yn.a,{className:"p-5",children:[Object(gn.jsx)(Ua.a,{children:Object(gn.jsx)("title",{children:"Status - Bazarr (System)"})}),Object(gn.jsx)(Vt.a,{children:Object(gn.jsxs)(xs,{title:"About",children:[Object(gn.jsx)(fs,{title:"Bazarr Version",children:Object(gn.jsx)("span",{children:null===e||void 0===e?void 0:e.bazarr_version})}),Object(gn.jsx)(fs,{title:"Sonarr Version",children:Object(gn.jsx)("span",{children:null===e||void 0===e?void 0:e.sonarr_version})}),Object(gn.jsx)(fs,{title:"Radarr Version",children:Object(gn.jsx)("span",{children:null===e||void 0===e?void 0:e.radarr_version})}),Object(gn.jsx)(fs,{title:"Operating System",children:Object(gn.jsx)("span",{children:null===e||void 0===e?void 0:e.operating_system})}),Object(gn.jsx)(fs,{title:"Python Version",children:Object(gn.jsx)("span",{children:null===e||void 0===e?void 0:e.python_version})}),Object(gn.jsx)(fs,{title:"Bazarr Directory",children:Object(gn.jsx)("span",{children:null===e||void 0===e?void 0:e.bazarr_directory})}),Object(gn.jsx)(fs,{title:"Bazarr Config Directory",children:Object(gn.jsx)("span",{children:null===e||void 0===e?void 0:e.bazarr_config_directory})})]})}),Object(gn.jsx)(Vt.a,{children:Object(gn.jsxs)(xs,{title:"More Info",children:[Object(gn.jsx)(fs,{title:"Home Page",children:Object(gn.jsx)(ps,{icon:fn.K,link:"https://www.bazarr.media/",children:"Bazarr Website"})}),Object(gn.jsx)(fs,{title:"Source",children:Object(gn.jsx)(ps,{icon:hs.b,link:Ta,children:"Bazarr on Github"})}),Object(gn.jsx)(fs,{title:"Wiki",children:Object(gn.jsx)(ps,{icon:hs.c,link:"https://wiki.bazarr.media",children:"Bazarr Wiki"})}),Object(gn.jsx)(fs,{title:"Discord",children:Object(gn.jsx)(ps,{icon:hs.a,link:"https://discord.gg/MH2e2eb",children:"Bazarr on Discord"})})]})})]})},ms=function(e){var t=e.tasks,n=Xt(He),r=Object(a.useMemo)((function(){return[{Header:"Name",accessor:"name",className:"text-nowrap"},{Header:"Interval",accessor:"interval",className:"text-nowrap"},{Header:"Next Execution",accessor:"next_run_in",className:"text-nowrap"},{accessor:"job_running",Cell:function(e){var t=e.row.original.job_id;return Object(gn.jsx)(qn,{promise:function(){return Rt.runTask(t)},onSuccess:function(){return n(t)},variant:"light",size:"sm",disabled:e.value,children:Object(gn.jsx)(pn.a,{icon:fn.U,spin:e.value})})}}]}),[n]);return Object(gn.jsx)(ea,{columns:r,data:t})},gs=function(){var e=Qt((function(e){return e.system.tasks})),t=Xt(_e);return ce(t,1e4),Object(gn.jsx)(Un,{state:e,children:function(n){return Object(gn.jsxs)(yn.a,{fluid:!0,children:[Object(gn.jsx)(Ua.a,{children:Object(gn.jsx)("title",{children:"Tasks - Bazarr (System)"})}),Object(gn.jsx)($n,{children:Object(gn.jsx)($n.Button,{updating:e.updating,icon:fn.U,onClick:t,children:"Refresh"})}),Object(gn.jsx)(Vt.a,{children:Object(gn.jsx)(ms,{tasks:n})})]})}})},ys=function(){return Object(gn.jsxs)(l.e,{children:[Object(gn.jsx)(l.c,{exact:!0,path:"/system/tasks",children:Object(gn.jsx)(gs,{})}),Object(gn.jsx)(l.c,{exact:!0,path:"/system/status",children:Object(gn.jsx)(vs,{})}),Object(gn.jsx)(l.c,{exact:!0,path:"/system/providers",children:Object(gn.jsx)(ds,{})}),Object(gn.jsx)(l.c,{exact:!0,path:"/system/logs",children:Object(gn.jsx)(ls,{})}),Object(gn.jsx)(l.c,{exact:!0,path:"/system/releases",children:Object(gn.jsx)(Os,{})}),Object(gn.jsx)(l.c,{path:"/system/*",children:Object(gn.jsx)(l.b,{to:_a})})]})},ks=function(e){var t=e.type,n=e.columns,r=e.state,c=e.update,i=e.loader,s=e.searchAll,o=Object(Z.capitalize)(t),l=Object(a.useMemo)((function(){return le(r.data)}),[r.data]),u=Object(a.useCallback)((function(e,t){c(t)}),[c]);return Object(gn.jsxs)(yn.a,{fluid:!0,children:[Object(gn.jsx)(Ua.a,{children:Object(gn.jsxs)("title",{children:["Wanted ",o," - Bazarr"]})}),Object(gn.jsx)($n,{children:Object(gn.jsx)($n.AsyncButton,{disabled:0===l.length,promise:s,onSuccess:c,icon:fn.R,children:"Search All"})}),Object(gn.jsx)(Vt.a,{children:Object(gn.jsx)(la,{async:!0,asyncState:r,asyncId:oe,asyncLoader:i,emptyText:"No Missing ".concat(o," Subtitles"),columns:n,externalUpdate:u,data:l})})]})},ws=function(){var e=function(){var e=Xt(it);return Zt(Qt((function(e){return e.movie.wantedMovieList})),e)}(),t=Object(J.a)(e,2),n=t[0],r=t[1],c=Xt(ct),i=Object(a.useCallback)((function(){return Kt.action({action:"search-wanted"})}),[]),s=Object(a.useMemo)((function(){return[{Header:"Name",accessor:"title",Cell:function(e){var t="/movies/".concat(e.row.original.radarrId);return Object(gn.jsx)(u.b,{to:t,children:Object(gn.jsx)("span",{children:e.value})})}},{Header:"Missing",accessor:"missing_subtitles",Cell:function(e){var t=e.row,n=e.value,r=e.externalUpdate,a=t.original,c=a.hearing_impaired,i=a.radarrId;return n.map((function(e,n){return Object(gn.jsxs)(qn,{as:Wn.a,className:"mx-1 mr-2",variant:"secondary",promise:function(){return Kt.downloadSubtitles(i,{language:e.code2,hi:c,forced:!1})},onSuccess:function(){return r&&r(t,i)},children:[Object(gn.jsx)(ba,{className:"pr-1",text:e}),Object(gn.jsx)(pn.a,{size:"sm",icon:fn.R})]},de(n,e.code2))}))}}]}),[]);return Object(gn.jsx)(ks,{type:"movies",columns:s,state:n,update:r,loader:c,searchAll:i})},Ss=function(){var e=function(){var e=Xt(vt);return Zt(Qt((function(e){return e.series.wantedEpisodesList})),e)}(),t=Object(J.a)(e,2),n=t[0],r=t[1],c=Xt(xt),i=Object(a.useCallback)((function(){return Dt.action({action:"search-wanted"})}),[]),s=Object(a.useMemo)((function(){return[{Header:"Name",accessor:"seriesTitle",Cell:function(e){var t="/series/".concat(e.row.original.sonarrSeriesId);return Object(gn.jsx)(u.b,{to:t,children:Object(gn.jsx)("span",{children:e.value})})}},{Header:"Episode",accessor:"episode_number"},{accessor:"episodeTitle"},{Header:"Missing",accessor:"missing_subtitles",Cell:function(e){var t=e.row,n=e.externalUpdate,r=e.value,a=t.original,c=a.hearing_impaired,i=a.sonarrSeriesId,s=a.sonarrEpisodeId;return r.map((function(e,r){return Object(gn.jsxs)(qn,{as:Wn.a,className:"mx-1 mr-2",variant:"secondary",promise:function(){return Tt.downloadSubtitles(i,s,{language:e.code2,hi:c,forced:!1})},onSuccess:function(){return n&&n(t,s)},children:[Object(gn.jsx)(ba,{className:"pr-1",text:e}),Object(gn.jsx)(pn.a,{size:"sm",icon:fn.R})]},de(r,e.code2))}))}}]}),[]);return Object(gn.jsx)(ks,{type:"series",columns:s,state:n,update:r,loader:c,searchAll:i})},Cs=function(){var e=bn(),t=On();return Object(gn.jsxs)(l.e,{children:[e&&Object(gn.jsx)(l.c,{exact:!0,path:"/wanted/series",children:Object(gn.jsx)(Ss,{})}),t&&Object(gn.jsx)(l.c,{exact:!0,path:"/wanted/movies",children:Object(gn.jsx)(ws,{})}),Object(gn.jsx)(l.c,{path:"/wanted/*",children:Object(gn.jsx)(l.b,{to:_a})})]})},Ns=function(e){var t=e.className,n=bn(),r=On(),c=Object(a.useMemo)((function(){return n?"/series":r?"/movies":"/settings"}),[n,r]),i=Object(l.h)();return Object(a.useEffect)((function(){be()}),[i.location]),Object(gn.jsx)("div",{className:t,children:Object(gn.jsxs)(l.e,{children:[Object(gn.jsx)(l.c,{exact:!0,path:"/",children:Object(gn.jsx)(l.b,{exact:!0,to:c})}),n&&Object(gn.jsx)(l.c,{path:"/series",children:Object(gn.jsx)(Ec,{})}),r&&Object(gn.jsx)(l.c,{path:"/movies",children:Object(gn.jsx)(Sc,{})}),Object(gn.jsx)(l.c,{path:"/wanted",children:Object(gn.jsx)(Cs,{})}),Object(gn.jsx)(l.c,{path:"/history",children:Object(gn.jsx)(dc,{})}),Object(gn.jsx)(l.c,{path:"/blacklist",children:Object(gn.jsx)(Ya,{})}),Object(gn.jsx)(l.c,{path:"/settings",children:Object(gn.jsx)(cs,{})}),Object(gn.jsx)(l.c,{path:"/system",children:Object(gn.jsx)(ys,{})}),Object(gn.jsx)(l.c,{exact:!0,path:_a,children:Object(gn.jsx)(Ha,{})}),Object(gn.jsx)(l.c,{path:"*",children:Object(gn.jsx)(l.b,{to:_a})})]})})},Is=c.a.createContext((function(){})),Ps=function(){var e=Xt(Ye),t=Qt((function(e){return e.site})),n=t.initialized,r=t.auth,c=jn("has-update",10),i=window.Bazarr.hasUpdate;Object(a.useEffect)((function(){n&&i&&c({type:"info",message:"A new version of Bazarr is ready, restart is required"})}),[n,i,c]),Object(a.useEffect)((function(){e()}),[e]);var s=Object(a.useState)(!1),o=Object(J.a)(s,2),u=o[0],d=o[1],j=Object(a.useCallback)((function(){return d(!u)}),[u]);if(!r)return Object(gn.jsx)(l.b,{to:"/login"});if("boolean"===typeof n&&!1===n)return Object(gn.jsx)(ja,{children:Object(gn.jsx)("span",{children:"Please wait"})});if("string"===typeof n)return Object(gn.jsx)(Aa,{children:n});try{return Object(gn.jsxs)(Is.Provider,{value:j,children:[Object(gn.jsx)(Vt.a,{noGutters:!0,className:"header-container",children:Object(gn.jsx)(Da,{})}),Object(gn.jsxs)(Vt.a,{noGutters:!0,className:"flex-nowrap",children:[Object(gn.jsx)(Pa,{open:u}),Object(gn.jsx)(dr,{children:Object(gn.jsx)(Ns,{className:"d-flex flex-row flex-grow-1 main-router"})})]}),Object(gn.jsx)(La,{})]})}catch(b){return Object(gn.jsx)(Ea,{error:b})}},As=(n(484),function(){var e=Object(a.useState)(""),t=Object(J.a)(e,2),n=t[0],r=t[1],c=Object(a.useState)(""),i=Object(J.a)(c,2),s=i[0],o=i[1],u=Object(a.useState)(""),d=Object(J.a)(u,2),j=d[0],b=d[1],O=Object(a.useState)(!1),h=Object(J.a)(O,2),f=h[0],p=h[1],x=Object(a.useCallback)((function(e){b(e),setTimeout((function(){return b("")}),2e3)}),[]),v=Object(a.useCallback)((function(){return window.location.reload()}),[]),m=Qt((function(e){return e.site.auth})),g=Object(a.useCallback)((function(){p(!1),x("Login Failed")}),[x]);return m?Object(gn.jsx)(l.b,{to:"/"}):Object(gn.jsx)("div",{className:"d-flex bg-light vh-100 justify-content-center align-items-center",children:Object(gn.jsx)(Qc.a,{className:"auth-card shadow",children:Object(gn.jsxs)(Pn.a,{onSubmit:function(e){e.preventDefault(),f||(p(!0),Rt.login(n,s).then(v).catch(g))},children:[Object(gn.jsxs)(Qc.a.Body,{children:[Object(gn.jsx)(Pn.a.Group,{className:"mb-5 d-flex justify-content-center",children:Object(gn.jsx)(ha.a,{width:"64",height:"64",src:"data:image/png;base64,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"})}),Object(gn.jsx)(Pn.a.Group,{children:Object(gn.jsx)(Pn.a.Control,{disabled:f,name:"username",type:"text",placeholder:"Username",required:!0,onChange:function(e){return r(e.currentTarget.value)}})}),Object(gn.jsx)(Pn.a.Group,{children:Object(gn.jsx)(Pn.a.Control,{disabled:f,name:"password",type:"password",placeholder:"Password",required:!0,onChange:function(e){return o(e.currentTarget.value)}})}),Object(gn.jsx)(va.a,{in:0!==j.length,children:Object(gn.jsx)("div",{children:Object(gn.jsx)(kn.a,{variant:"danger",className:"m-0",children:j})})})]}),Object(gn.jsx)(Qc.a.Footer,{children:Object(gn.jsx)(wn.a,{type:"submit",disabled:f,block:!0,children:f?Object(gn.jsx)(mn.a,{size:"sm",animation:"border"}):"LOGIN"})})]})})})}),Ts=function(){var e=re();return Object(gn.jsx)(u.a,{basename:e,children:Object(gn.jsxs)(l.e,{children:[Object(gn.jsx)(l.c,{exact:!0,path:"/login",children:Object(gn.jsx)(As,{})}),Object(gn.jsx)(l.c,{path:"/",children:Object(gn.jsx)(Ps,{})})]})})};s.a.render(Object(gn.jsx)(o.a,{store:Yt,children:Object(gn.jsx)(Ts,{})}),document.getElementById("root"))}},[[485,1,2]]]);
+//# sourceMappingURL=main.e2f02423.chunk.js.map
\ No newline at end of file