(self.webpackChunk=self.webpackChunk||[]).push([[9968],{45105:function(e,t,a){"use strict";a.r(t),a(61013),a(63238),a(61418),a(5769);var n=a(28469),i=a(6594),l=a(83094),s=a(53754),o=(a(78066),a(56346)),r=a(76543);function d(e){i.ZP.show(),ApiClient.getJSON(ApiClient.getUrl("Auth/Keys")).then((function(t){!function(e,t){var a=t.map((function(e){var t="";t+='<tr class="detailTableBodyRow detailTableBodyRow-shaded">',t+='<td class="detailTableBodyCell">',t+='<button type="button" is="emby-button" data-token="'+e.AccessToken+'" class="raised raised-mini btnRevoke" data-mini="true" title="'+s.ZP.translate("ButtonRevoke")+'" style="margin:0;">'+s.ZP.translate("ButtonRevoke")+"</button>",t+="</td>",t+='<td class="detailTableBodyCell" style="vertical-align:middle;">',t+=e.AccessToken,t+="</td>",t+='<td class="detailTableBodyCell" style="vertical-align:middle;">',t+=e.AppName||"",t+="</td>",t+='<td class="detailTableBodyCell" style="vertical-align:middle;">';var a=n.ZP.parseISO8601Date(e.DateCreated,!0);return t+=n.ZP.toLocaleDateString(a)+" "+n.ZP.getDisplayTime(a),(t+="</td>")+"</tr>"})).join("");e.querySelector(".resultBody").innerHTML=a,i.ZP.hide()}(e,t.Items)}))}(0,r.Xz)("pageinit","apiKeysPage",(function(){var e=this;e.querySelector(".btnNewKey").addEventListener("click",(function(){!function(e){a.e(5506).then(a.bind(a,95506)).then((function(t){(0,t.default)({title:s.ZP.translate("HeaderNewApiKey"),label:s.ZP.translate("LabelAppName"),description:s.ZP.translate("LabelAppNameExample")}).then((function(t){ApiClient.ajax({type:"POST",url:ApiClient.getUrl("Auth/Keys",{App:t})}).then((function(){d(e)}))}))}))}(e)})),e.querySelector(".tblApiKeys").addEventListener("click",(function(t){var a=l.ZP.parentWithClass(t.target,"btnRevoke");a&&function(e,t){(0,o.Z)(s.ZP.translate("MessageConfirmRevokeApiKey"),s.ZP.translate("HeaderConfirmRevokeApiKey")).then((function(){i.ZP.show(),ApiClient.ajax({type:"DELETE",url:ApiClient.getUrl("Auth/Keys/"+t)}).then((function(){d(e)}))}))}(e,a.getAttribute("data-token"))}))})),(0,r.Xz)("pagebeforeshow","apiKeysPage",(function(){d(this)}))}}]);