1 line
28 KiB
JavaScript
1 line
28 KiB
JavaScript
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[33796,40501,62882,66884,73567],{13478:function(e,t,n){var r=n(62540),i=(n(63696),n(92779)),o=n(10822),a=n(89348);t.A=function(e){var t=e.task.CurrentProgressPercentage;return(0,r.jsx)(i.A,{sx:{display:"flex",alignItems:"center",height:"1.2rem",mr:2,minWidth:"170px"},children:null!=t?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.A,{sx:{width:"100%",mr:1},children:(0,r.jsx)(o.A,{variant:"determinate",value:t})}),(0,r.jsx)(i.A,{children:(0,r.jsx)(a.A,{variant:"body1",children:"".concat(Math.round(t),"%")})})]}):(0,r.jsx)(i.A,{sx:{width:"100%"},children:(0,r.jsx)(o.A,{})})})}},22204:function(e,t,n){n.d(t,{V:function(){return s}});var r=n(53875),i=n(38596),o=n(69410),a=n(31297),l=n(71607),s=function(){var e=(0,o.gf)().api;return(0,i.n)({mutationFn:function(t){return(0,r.g)(e).startTask(t)},onSuccess:function(){a.q.invalidateQueries({queryKey:[l.t]})}})}},54861:function(e,t,n){var r=n(63696),i=n(69410),o=n(71607),a=n(31297),l=n(44797),s=n(10736),c=n(10749);t.A=function(e){var t=(0,i.gf)().__legacyApiClient__,n=(0,o.s)(e);return(0,r.useEffect)((function(){var e=function(e,t,n){a.q.setQueryData([o.t],n)},n=setInterval((function(){(null==t?void 0:t.isMessageChannelOpen())||a.q.invalidateQueries({queryKey:[o.t]})}),1e4);return null==t||t.sendMessage(c.Y.ScheduledTasksInfoStart,"1000,1000"),l.A.on(s.default,c.Y.ScheduledTasksInfo,e),function(){clearInterval(n),null==t||t.sendMessage(c.Y.ScheduledTasksInfoStop,null),l.A.off(s.default,c.Y.ScheduledTasksInfo,e)}}),[t]),n}},57807:function(e,t,n){var r=n(62540),i=n(63703),o=n(62010),a=n(98756),l=n(37793),s=n(75720),c=n(9042),u=(n(63696),n(5898)),d=function(){return d=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},d.apply(this,arguments)};t.A=function(e){var t=e.confirmButtonColor,n=void 0===t?"primary":t,f=e.confirmButtonText,h=e.title,v=e.text,p=e.onCancel,y=e.onConfirm,m=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["confirmButtonColor","confirmButtonText","title","text","onCancel","onConfirm"]);return(0,r.jsxs)(o.A,d({onClose:p},m,{children:[(0,r.jsx)(c.A,{children:h}),(0,r.jsx)(l.A,{children:(0,r.jsx)(s.A,{sx:{whiteSpace:"pre-wrap"},children:v})}),(0,r.jsxs)(a.A,{children:[(0,r.jsx)(i.A,{variant:"text",onClick:p,children:u.Ay.translate("ButtonCancel")}),(0,r.jsx)(i.A,{color:n,onClick:y,children:f||u.Ay.translate("ButtonOk")})]})]}))}},62882:function(e,t,n){n.r(t),n.d(t,{show:function(){return d}});var r=n(22696),i=n.n(r),o=n(79754),a=n(46782),l=n(5898),s=n(36300),c=(n(10353),function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")});function u(e,t,r){Promise.resolve().then(n.bind(n,10838)).then((function(n){var i=r?"on":"off";n.centerFocus[i](e,t)})).catch((function(e){console.warn("Error in centerFocus",e)}))}function d(e){var t,n,r,d={removeOnClose:!0,enableHistory:e.enableHistory,scrollY:!1};a.A.tv?(d.size="fullscreen",r=!0,d.autoFocus=!0):(d.modal=!1,d.entryAnimation=e.entryAnimation,d.exitAnimation=e.exitAnimation,d.entryAnimationDuration=e.entryAnimationDuration||140,d.exitAnimationDuration=e.exitAnimationDuration||100,d.autoFocus=!1);var f=o.default.createDialog(d);r?f.classList.add("actionsheet-fullscreen"):f.classList.add("actionsheet-not-fullscreen"),f.classList.add("actionSheet"),e.dialogClass&&f.classList.add(e.dialogClass);var h="",v=a.A.tv?"scrollY smoothScrollY hiddenScrollY":"scrollY",p="";e.items.length>20&&(p+="min-width:"+(s.Ay.getWindowSize().innerWidth>=300?240:200)+"px;");var y,m=!1,x=[];try{for(var b=c(e.items),A=b.next();!A.done;A=b.next())(y=(S=A.value).icon||(S.selected?"check":null))&&(m=!0),x.push(y||"")}catch(e){t={error:e}}finally{try{A&&!A.done&&(n=b.return)&&n.call(b)}finally{if(t)throw t.error}}a.A.tv&&(h+='<button is="paper-icon-button-light" class="btnCloseActionSheet hide-mouse-idle-tv" tabindex="-1" title="'.concat(l.Ay.translate("ButtonBack"),'">\n <span class="material-icons arrow_back" aria-hidden="true"></span>\n </button>'));var g=e.title&&!m;g||a.A.tv?h+='<div class="actionSheetContent actionSheetContent-centered">':h+='<div class="actionSheetContent">',e.title&&(h+='<h1 class="actionSheetTitle">'+i()(e.title)+"</h1>"),e.text&&(h+='<p class="actionSheetText">'+i()(e.text)+"</p>");var j="actionSheetScroller";a.A.tv&&(j+=" actionSheetScroller-tv focuscontainer-x focuscontainer-y"),h+='<div class="'+j+" "+v+'" style="'+p+'">';var C="listItem listItem-button actionSheetMenuItem";(e.border||e.shaded)&&(C+=" listItem-border"),e.menuItemClass&&(C+=" "+e.menuItemClass),a.A.tv&&(C+=" listItem-focusscale"),a.A.mobile&&(C+=" actionsheet-xlargeFont");for(var w=0;w<e.items.length;w++){var S;(S=e.items[w]).divider?h+='<div class="actionsheetDivider"></div>':(h+="<button"+(S.selected&&a.A.tv?" autoFocus":"")+' is="emby-button" type="button" class="'+C+'" data-id="'+(null==S.id||""===S.id?S.value:S.id)+'">',(y=x[w])?h+='<span class="actionsheetMenuItemIcon listItemIcon listItemIcon-transparent material-icons '.concat(y,'" aria-hidden="true"></span>'):m&&!g&&(h+='<span class="actionsheetMenuItemIcon listItemIcon listItemIcon-transparent material-icons check" aria-hidden="true" style="visibility:hidden;"></span>'),h+='<div class="listItemBody actionsheetListItemBody">',h+='<div class="listItemBodyText actionSheetItemText">',h+=i()(S.name||S.textContent||S.innerText),h+="</div>",S.secondaryText&&(h+='<div class="listItemBodyText secondary">'.concat(i()(S.secondaryText),"</div>")),h+="</div>",S.asideText&&(h+='<div class="listItemAside actionSheetItemAsideText">'.concat(i()(S.asideText),"</div>")),h+="</button>")}if(e.showCancel&&(h+='<div class="buttons">',h+='<button is="emby-button" type="button" class="btnCloseActionSheet">'.concat(l.Ay.translate("ButtonCancel"),"</button>"),h+="</div>"),h+="</div>",f.innerHTML=h,a.A.tv){var I=f.querySelector(".actionSheetScroller");I&&u(I,!1,!0)}var k=f.querySelector(".btnCloseActionSheet");k&&k.addEventListener("click",(function(){o.default.close(f)}));var T,P=null;return e.timeout&&(T=setTimeout((function(){o.default.close(f)}),e.timeout)),new Promise((function(t,n){var r=!1;f.addEventListener("click",(function(n){var i=s.Ay.parentWithClass(n.target,"actionSheetMenuItem");i&&(P=i.getAttribute("data-id"),e.resolveOnClick&&(Array.isArray(e.resolveOnClick)?-1!==e.resolveOnClick.indexOf(P)&&(t(P),r=!0):(t(P),r=!0)),o.default.close(f))})),f.addEventListener("close",(function(){if(a.A.tv){var i=f.querySelector(".actionSheetScroller");i&&u(i,!1,!1)}T&&(clearTimeout(T),T=void 0),r||(null!=P?(e.callback&&e.callback(P),t(P)):n(new Error("ActionSheet closed without resolving")))})),o.default.open(f).catch((function(e){console.warn("DialogHelper.open error",e)}));var i=e.positionTo&&"fullscreen"!==d.size?function(e,t,n){var r=s.Ay.getWindowSize(),i=r.innerHeight,o=r.innerWidth,a=function(e){var t,n,r=[];if(!document)return r;try{for(var i=c(e),o=i.next();!o.done;o=i.next()){var a=o.value.getBoundingClientRect();r.push({top:a.top,left:a.left,width:a.width,height:a.height})}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r}([e])[0];"top"!==t.positionY&&(a.top+=(a.height||0)/2),a.left+=(a.width||0)/2;var l=n.offsetHeight||300,u=n.offsetWidth||160;a.top-=l/2,a.left-=u/2;var d=a.left+u-o,f=a.top+l-i;return d>0&&(a.left-=d+20),f>0&&(a.top-=f+20),a.top+=t.offsetTop||0,a.left+=t.offsetLeft||0,a.top=Math.max(a.top,10),a.left=Math.max(a.left,10),a}(e.positionTo,e,f):null;i&&(f.style.position="fixed",f.style.margin="0",f.style.left=i.left+"px",f.style.top=i.top+"px")}))}t.default={show:d}},69880:function(e,t,n){var r=n(62540),i=(n(63696),n(92779)),o=n(13786),a=n(91520),l=n(47587),s=n(75487),c=n(89348),u=n(15723),d=n(36645),f=n(42087),h=n(70140),v=n(9055),p=function(){return p=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},p.apply(this,arguments)};t.A=function(e){var t=e.title,n=e.text,y=e.image,m=e.icon,x=e.to,b=e.onClick,A=e.action,g=e.actionRef,j=e.onActionClick,C=e.height,w=e.width;return(0,r.jsxs)(o.A,{sx:{display:"flex",flexDirection:"column",height:C||240,width:w},children:[(0,r.jsx)(f.A,p({},x&&{component:v.N_,to:x},{onClick:b,sx:{display:"flex",flexGrow:1,alignItems:"stretch"},children:y?(0,r.jsx)(l.A,{sx:{flexGrow:1},image:y,title:t}):(0,r.jsx)(i.A,{className:(0,d.Qp)(t),sx:{flexGrow:1,display:"flex",alignItems:"center",justifyContent:"center"},children:m})})),(0,r.jsx)(a.A,{sx:{minHeight:50,"&:last-child":{paddingBottom:2,paddingRight:1}},children:(0,r.jsxs)(h.A,{flexGrow:1,direction:"row",children:[(0,r.jsxs)(h.A,{flexGrow:1,sx:{overflow:"hidden"},children:[(0,r.jsx)(c.A,{gutterBottom:!0,sx:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},children:t}),n&&(0,r.jsx)(c.A,{variant:"body2",color:"text.secondary",sx:{lineBreak:"anywhere"},children:n})]}),(0,r.jsx)(i.A,{children:A?(0,r.jsx)(s.A,{ref:g,onClick:j,children:(0,r.jsx)(u.A,{})}):null})]})})]})}},71607:function(e,t,n){n.d(t,{s:function(){return l},t:function(){return a}});var r=n(53875),i=n(80401),o=n(69410),a="Tasks",l=function(e){var t=(0,o.gf)().api;return(0,i.I)({queryKey:[a],queryFn:function(n){var i=n.signal;return function(e,t,n){return i=void 0,o=void 0,l=function(){return function(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=l(0),a.throw=l(1),a.return=l(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(s){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&l[0]?r.return:l[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,l[1])).done)return i;switch(r=0,i&&(l=[2&l[0],i.value]),l[0]){case 0:case 1:i=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,r=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]<i[3])){o.label=l[1];break}if(6===l[0]&&o.label<i[1]){o.label=i[1],i=l;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(l);break}i[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],r=0}finally{n=i=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,s])}}}(this,(function(i){switch(i.label){case 0:return[4,(0,r.g)(e).getTasks(t,n)];case 1:return[2,i.sent().data]}}))},new((a=void 0)||(a=Promise))((function(e,t){function n(e){try{s(l.next(e))}catch(e){t(e)}}function r(e){try{s(l.throw(e))}catch(e){t(e)}}function s(t){var i;t.done?e(t.value):(i=t.value,i instanceof a?i:new a((function(e){e(i)}))).then(n,r)}s((l=l.apply(i,o||[])).next())}));var i,o,a,l}(t,e,{signal:i})},enabled:!!t})}},78397:function(e,t,n){n.d(t,{M:function(){return l},t:function(){return a}});var r=n(94732),i=n(80401),o=n(69410),a="NamedConfiguration",l=function(e){var t=(0,o.gf)().api;return(0,i.I)({queryKey:[a,e],queryFn:function(n){var i=n.signal;return function(e,t,n){return i=void 0,o=void 0,l=function(){return function(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=l(0),a.throw=l(1),a.return=l(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(s){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&l[0]?r.return:l[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,l[1])).done)return i;switch(r=0,i&&(l=[2&l[0],i.value]),l[0]){case 0:case 1:i=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,r=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]<i[3])){o.label=l[1];break}if(6===l[0]&&o.label<i[1]){o.label=i[1],i=l;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(l);break}i[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],r=0}finally{n=i=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,s])}}}(this,(function(i){switch(i.label){case 0:return[4,(0,r.T)(e).getNamedConfiguration({key:t},n)];case 1:return[2,i.sent().data]}}))},new((a=void 0)||(a=Promise))((function(e,t){function n(e){try{s(l.next(e))}catch(e){t(e)}}function r(e){try{s(l.throw(e))}catch(e){t(e)}}function s(t){var i;t.done?e(t.value):(i=t.value,i instanceof a?i:new a((function(e){e(i)}))).then(n,r)}s((l=l.apply(i,o||[])).next())}));var i,o,a,l}(t,e,{signal:i})},enabled:!!t})}},86548:function(e,t,n){n.r(t);var r=n(62540),i=(n(63696),n(37632)),o=n(65242),a=n(99883),l=n(46850),s=n(4672),c={viewType:l.D.SeriesTimers,isPaginationEnabled:!1,isBtnFilterEnabled:!1,isBtnGridListEnabled:!1,isBtnSortEnabled:!1,isAlphabetPickerEnabled:!1},u={viewType:l.D.Schedule,sectionsView:s.jB},d={viewType:l.D.Recordings,sectionsView:s.wd},f={viewType:l.D.Channels,isBtnGridListEnabled:!1,isBtnSortEnabled:!1,isAlphabetPickerEnabled:!1},h={0:{viewType:l.D.Programs,sectionsView:s.qb},1:{viewType:l.D.Guide},2:f,3:d,4:u,5:c};t.default=function(){var e=(0,i.A)(),t=e.libraryId,n=e.activeTab,l=h[n];return(0,r.jsx)(o.A,{id:"liveTvPage",className:"mainAnimatedPage libraryPage collectionEditorPage pageWithAbsoluteTabs withTabs",children:(0,r.jsx)(a.A,{currentTab:l,parentId:t},"".concat(l.viewType," - ").concat(t))})}},87759:function(e,t,n){n.r(t),n.d(t,{Component:function(){return ue}});var r=n(62540),i=n(63696),o=n(92779),a=n(65242),l=n(78397),s=n(5898),c=n(70140),u=n(89348),d=n(84849),f=n(69880),h=n(56465),v=function(e){switch(null==e?void 0:e.toLowerCase()){case"m3u":return"M3U";case"hdhomerun":return"HDHomeRun";case"hauppauge":return"Hauppauge";case"satip":return"DVB";default:return"Unknown"}},p=n(48402),y=n(85637),m=n(44790),x=n(31858),b=n(17997),A=n(60434),g=n(87404),j=n(57807),C=n(38596),w=n(69410),S=n(31297),I=n(45659),k=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},T=function(e){var t,n=e.tunerHost,o=(0,g.Zp)(),a=(0,i.useRef)(null),l=k((0,i.useState)(null),2),c=l[0],u=l[1],d=k((0,i.useState)(!1),2),T=d[0],P=d[1],O=k((0,i.useState)(!1),2),D=O[0],L=O[1],B=(t=(0,w.gf)().api,(0,C.n)({mutationFn:function(e){return(0,I.t)(t).deleteTunerHost(e)},onSuccess:function(){S.q.invalidateQueries({queryKey:["NamedConfiguration","livetv"]})}})),E=(0,i.useCallback)((function(){o("/dashboard/livetv/tuner?id=".concat(n.Id))}),[o,n]),M=(0,i.useCallback)((function(){n.Id&&B.mutate({id:n.Id},{onSettled:function(){L(!1)}})}),[B,n]),H=(0,i.useCallback)((function(){u(null),P(!1),L(!0)}),[]),N=(0,i.useCallback)((function(){L(!1)}),[]),q=(0,i.useCallback)((function(){u(a.current),P(!0)}),[]),F=(0,i.useCallback)((function(){u(null),P(!1)}),[]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(j.A,{open:D,title:s.Ay.translate("HeaderDeleteDevice"),text:s.Ay.translate("MessageConfirmDeleteTunerDevice"),onCancel:N,onConfirm:M,confirmButtonColor:"error",confirmButtonText:s.Ay.translate("Delete")}),(0,r.jsx)(f.A,{title:n.FriendlyName||v(n.Type)||"",text:n.Url||"",icon:(0,r.jsx)(h.A,{sx:{fontSize:70}}),action:!0,actionRef:a,onActionClick:q,onClick:E}),(0,r.jsxs)(p.A,{anchorEl:c,open:T,onClose:F,children:[(0,r.jsxs)(y.A,{onClick:E,children:[(0,r.jsx)(m.A,{children:(0,r.jsx)(b.A,{})}),(0,r.jsx)(A.A,{children:s.Ay.translate("Edit")})]}),(0,r.jsxs)(y.A,{onClick:H,children:[(0,r.jsx)(m.A,{children:(0,r.jsx)(x.A,{})}),(0,r.jsx)(A.A,{children:s.Ay.translate("Delete")})]})]})]})},P=n(54861),O=n(63703),D=n(67702),L=n(30374),B=n(9055),E=n(22204),M=n(50909),H=n(13478),N=n(47891),q=n(28335),F=n(69018),G=n(35117),R=n(73828),Y=n(95858),W=n(15723),_=function(e){switch(null==e?void 0:e.toLowerCase()){case"xmltv":return"/dashboard/livetv/guide?type=xmltv";case"schedulesdirect":return"/dashboard/livetv/guide?type=schedulesdirect"}},z=function(e){switch(null==e?void 0:e.toLowerCase()){case"schedulesdirect":return"Schedules Direct";case"xmltv":return"XMLTV";default:return"Unknown"}},V=n(75487),K=n(47788),U=(n(29305),n(32733),n(84701),n(81678),n(24776),n(44962),n(86584),n(26448),n(4754),n(94),n(36947),n(78557),n(90076),n(83994),n(82367),n(22696)),Q=n.n(U),J=n(36300),X=n(79754),Z=n(8566),$=n(67430),ee=n(62882);function te(e){return te="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},te(e)}function ne(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ie(r.key),r)}}function re(e,t,n){return t&&ne(e.prototype,t),n&&ne(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ie(e){var t=function(e){if("object"!=te(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=te(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==te(t)?t:t+""}n(98959),n(15453),n(10353);var oe=re((function e(t){function n(e){var n=J.Ay.parentWithClass(e.target,"btnMap");if(n){var o=n.getAttribute("data-id"),a=n.getAttribute("data-providerid"),l=i.ProviderChannels.map((function(e){return{name:e.Name,id:e.Id,selected:e.Id.toLowerCase()===a.toLowerCase()}})).sort((function(e,t){return e.name.localeCompare(t.name)}));ee.default.show({positionTo:n,items:l}).then((function(e){!function(e,n,o){Z.Ay.show();var a=t.providerId;$.tF.getApiClient(t.serverId).ajax({type:"POST",url:ApiClient.getUrl("LiveTv/ChannelMappings"),data:JSON.stringify({providerId:a,tunerChannelId:n,providerChannelId:o}),contentType:"application/json",dataType:"json"}).then((function(t){var n=J.Ay.parentWithClass(e,"listItem");e.setAttribute("data-providerid",t.ProviderChannelId),n.querySelector(".secondary").innerText=r(t,i.ProviderName),Z.Ay.hide()}))}(n,o,e)}))}}function r(e,t){return"".concat(e.ProviderChannelName||""," - ").concat(t)}var i;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.show=function(){var e=X.default.createDialog({removeOnClose:!0,size:"small"});e.classList.add("formDialog"),e.classList.add("ui-body-a"),e.classList.add("background-theme-a");var o="",a=s.Ay.translate("MapChannels");return o+='<div class="formDialogHeader">',o+='<button is="paper-icon-button-light" class="btnCancel autoSize" tabindex="-1" title="'.concat(s.Ay.translate("ButtonBack"),'"><span class="material-icons arrow_back" aria-hidden="true"></span></button>'),o+='<h3 class="formDialogHeaderTitle">',o+=a,o+="</h3>",o+="</div>",o+=function(){var e="";return e+='<div class="formDialogContent smoothScrollY">',e+='<div class="dialogContentInner dialog-content-centered">',e+='<form style="margin:auto;">',e+="<h1>".concat(s.Ay.translate("Channels"),"</h1>"),e+='<div class="channels paperList">',e+="</div>",e+="</form>",(e+="</div>")+"</div>"}(),e.innerHTML=o,function(e,t){var o,a,l;(o=t.serverId,a=t.providerId,l=$.tF.getApiClient(o),l.getJSON(l.getUrl("LiveTv/ChannelMappingOptions",{providerId:a}))).then((function(t){i=t;var o=e.querySelector(".channels");o.innerHTML=t.TunerChannels.map((function(e){return function(e,t){var n="";return n+='<div class="listItem">',n+='<span class="material-icons listItemIcon dvr" aria-hidden="true"></span>',n+='<div class="listItemBody two-line">',n+='<h3 class="listItemBodyText">',n+=Q()(e.Name),n+="</h3>",n+='<div class="secondary listItemBodyText">',e.ProviderChannelName&&(n+=Q()(r(e,t))),n+="</div>",n+="</div>",(n+='<button class="btnMap autoSize" is="paper-icon-button-light" type="button" data-id="'.concat(e.Id,'" data-providerid="').concat(e.ProviderChannelId,'"><span class="material-icons mode_edit" aria-hidden="true"></span></button>'))+"</div>"}(e,t.ProviderName)})).join(""),o.addEventListener("click",n)}))}(e,t),e.querySelector(".btnCancel").addEventListener("click",(function(){X.default.close(e)})),new Promise((function(t){e.addEventListener("close",t),X.default.open(e)}))}})),ae=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},le=function(e){var t,n=e.provider,o=ae((0,i.useState)(!1),2),a=o[0],l=o[1],c=(0,i.useRef)(null),u=ae((0,i.useState)(null),2),d=u[0],f=u[1],v=ae((0,i.useState)(!1),2),b=v[0],g=v[1],k=(t=(0,w.gf)().api,(0,C.n)({mutationFn:function(e){return(0,I.t)(t).deleteListingProvider(e)},onSuccess:function(){S.q.invalidateQueries({queryKey:["NamedConfiguration","livetv"]})}})),T=(0,i.useCallback)((function(){var e;f(null),g(!1),new oe({serverId:null===(e=$.tF.currentApiClient())||void 0===e?void 0:e.serverId(),providerId:n.Id}).show()}),[n]),P=(0,i.useCallback)((function(){f(c.current),g(!0)}),[]),O=(0,i.useCallback)((function(){f(null),g(!1),l(!0)}),[]),D=(0,i.useCallback)((function(){l(!1)}),[]),L=(0,i.useCallback)((function(){f(null),g(!1)}),[]),B=(0,i.useCallback)((function(){n.Id&&k.mutate({id:n.Id},{onSettled:function(){l(!1)}})}),[k,n]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(j.A,{open:a,title:s.Ay.translate("HeaderDeleteProvider"),text:s.Ay.translate("MessageConfirmDeleteGuideProvider"),onCancel:D,onConfirm:B,confirmButtonText:s.Ay.translate("Delete"),confirmButtonColor:"error"}),(0,r.jsx)(G.Ay,{disablePadding:!0,secondaryAction:(0,r.jsx)(V.A,{ref:c,onClick:P,children:(0,r.jsx)(W.A,{})}),children:(0,r.jsxs)(Y.A,{to:_(n.Type||"")+"&id="+n.Id,children:[(0,r.jsx)(R.A,{children:(0,r.jsx)(F.A,{sx:{bgcolor:"primary.main"},children:(0,r.jsx)(h.A,{sx:{color:"#fff"}})})}),(0,r.jsx)(A.A,{primary:z(n.Type),secondary:n.Path||n.ListingsId,slotProps:{primary:{variant:"h3"},secondary:{variant:"body1"}}})]})},n.Id),(0,r.jsxs)(p.A,{anchorEl:d,open:b,onClose:L,children:[(0,r.jsxs)(y.A,{onClick:T,children:[(0,r.jsx)(m.A,{children:(0,r.jsx)(K.A,{})}),(0,r.jsx)(A.A,{children:s.Ay.translate("MapChannels")})]}),(0,r.jsxs)(y.A,{onClick:O,children:[(0,r.jsx)(m.A,{children:(0,r.jsx)(x.A,{})}),(0,r.jsx)(A.A,{children:s.Ay.translate("Delete")})]})]})]})},se=n(57962),ce=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},ue=function(){var e,t,n,f=(0,g.Zp)(),h=(0,l.M)("livetv"),v=h.data,m=h.isPending,x=h.isError,b=(0,P.A)({isHidden:!1}),j=b.data,C=b.isPending,w=b.isError,S=(0,i.useRef)(null),I=ce((0,i.useState)(null),2),k=I[0],F=I[1],G=ce((0,i.useState)(!1),2),R=G[0],Y=G[1],W=(0,E.V)(),_=(0,i.useCallback)((function(){f("/dashboard/livetv/guide?type=schedulesdirect")}),[f]),z=(0,i.useCallback)((function(){f("/dashboard/livetv/guide?type=xmltv")}),[f]),V=(0,i.useCallback)((function(){F(S.current),Y(!0)}),[]),K=(0,i.useCallback)((function(){F(null),Y(!1)}),[]),U=(0,i.useMemo)((function(){return null==j?void 0:j.find((function(e){return"RefreshGuide"===e.Key}))}),[j]),Q=(0,i.useCallback)((function(){(null==U?void 0:U.Id)&&W.mutate({taskId:U.Id})}),[W,U]);return m||C?(0,r.jsx)(d.A,{}):(0,r.jsx)(a.A,{id:"liveTvStatusPage",title:s.Ay.translate("LiveTV"),className:"mainAnimatedPage type-interior",children:(0,r.jsx)(o.A,{className:"content-primary",children:x||w?(0,r.jsx)(N.A,{severity:"error",children:s.Ay.translate("HeaderError")}):(0,r.jsxs)(c.A,{spacing:3,children:[(0,r.jsx)(u.A,{variant:"h2",children:s.Ay.translate("HeaderTunerDevices")}),(0,r.jsx)(O.A,{sx:{alignSelf:"flex-start"},startIcon:(0,r.jsx)(L.A,{}),component:B.N_,to:"/dashboard/livetv/tuner",children:s.Ay.translate("ButtonAddTunerDevice")}),(0,r.jsx)(o.A,{children:(0,r.jsx)(se.Ay,{container:!0,spacing:2,children:null===(e=v.TunerHosts)||void 0===e?void 0:e.map((function(e){return(0,r.jsx)(se.Ay,{item:!0,xs:12,sm:6,md:3,lg:2.4,children:(0,r.jsx)(T,{tunerHost:e},e.Id)},e.Id)}))})}),(0,r.jsx)(u.A,{variant:"h2",children:s.Ay.translate("HeaderGuideProviders")}),(0,r.jsxs)(c.A,{sx:{alignSelf:"flex-start"},spacing:2,children:[(0,r.jsxs)(c.A,{direction:"row",spacing:1.5,children:[(0,r.jsx)(O.A,{sx:{alignSelf:"flex-start"},startIcon:(0,r.jsx)(L.A,{}),onClick:V,ref:S,children:s.Ay.translate("ButtonAddProvider")}),(0,r.jsx)(O.A,{sx:{alignSelf:"flex-start"},startIcon:(0,r.jsx)(D.A,{}),variant:"outlined",onClick:Q,loading:U&&U.State===M.D.Running,loadingPosition:"start",children:s.Ay.translate("ButtonRefreshGuideData")})]}),U&&U.State===M.D.Running&&(0,r.jsx)(H.A,{task:U})]}),(0,r.jsxs)(p.A,{anchorEl:k,open:R,onClose:K,children:[(0,r.jsx)(y.A,{onClick:_,children:(0,r.jsx)(A.A,{children:"Schedules Direct"})}),(0,r.jsx)(y.A,{onClick:z,children:(0,r.jsx)(A.A,{children:"XMLTV"})})]}),v.ListingProviders&&(null===(t=v.ListingProviders)||void 0===t?void 0:t.length)>0&&(0,r.jsx)(q.A,{sx:{backgroundColor:"background.paper"},children:null===(n=v.ListingProviders)||void 0===n?void 0:n.map((function(e){return(0,r.jsx)(le,{provider:e},e.Id)}))})]})})})};ue.displayName="LiveTvPage"},95858:function(e,t,n){var r=n(62540),i=n(79772),o=(n(63696),n(87404)),a=n(9055),l=function(){return l=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},l.apply(this,arguments)},s=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a};t.A=function(e){var t=e.children,n=e.to,c=e.includePaths,u=void 0===c?[]:c,d=e.excludePaths,f=void 0===d?[]:d,h=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,["children","to","includePaths","excludePaths"]),v=(0,o.zy)(),p=s((0,a.ok)(),1)[0],y=s(n.split("?"),2),m=y[0],x=y[1],b=new URLSearchParams("?".concat(x)),A=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}([m],s(u),!1).includes(v.pathname)&&!f.includes(v.pathname+v.search)&&(!x||function(e,t){var n,r;try{for(var i=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(e),o=i.next();!o.done;o=i.next()){var a=o.value;if(t.get(a[0])!==a[1])return!1}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return!0}(b,p));return(0,r.jsx)(i.A,l({component:a.N_,to:n,selected:A},h,{children:t}))}}}]); |