"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[54131],{54131:(i,e,a)=>{a.r(e),a.d(e,{AddonModWikiPageOrMapLinkHandler:()=>y,AddonModWikiPageOrMapLinkHandlerLazyService:()=>u});var d=a(10467),n=a(44682),r=a(15324),t=a(79555),o=a(91768),s=a(67981),p=a(51069),c=a(63036),l=a(33014),k=a(25572),g=a(54438);let u=(()=>{var i;class AddonModWikiPageOrMapLinkHandlerLazyService extends c.c{handleAction(i,e,a){return(0,d.A)((function*(){const d=yield l.CoreLoadings.show(),c=parseInt(a.pageid,10),g=-1!=i.indexOf("mod/wiki/map.php")?"map":"page";try{const i=yield s.N.getPageContents(c,{siteId:e}),a=yield n.CoreCourse.getModuleBasicInfoByInstance(i.wikiid,p.Pe,{siteId:e,readingStrategy:1}),d=o.VV.hashAsciiStr(JSON.stringify({pageId:i.id,pageTitle:i.title,subwikiId:i.subwikiid,action:g,timestamp:Date.now()}));yield r.CoreNavigator.navigateToSitePath(`${p.Jb}/${a.course}/${a.id}/page/${d}`,{params:{module:a,pageId:i.id,pageTitle:i.title,subwikiId:i.subwikiid,action:g},siteId:e})}catch(i){k.CoreAlerts.showError(i,{default:t.HT.instant("addon.mod_wiki.errorloadingpage")})}finally{d.dismiss()}}))()}isEnabled(i,e,a){return(0,d.A)((function*(){const i=-1!=e.indexOf("mod/wiki/map.php");return!(a.id&&!i)&&(!i||void 0===a.option||"5"==a.option)}))()}}return(i=AddonModWikiPageOrMapLinkHandlerLazyService).ɵfac=(()=>{let e;return function AddonModWikiPageOrMapLinkHandlerLazyService_Factory(a){return(e||(e=g.xGo(i)))(a||i)}})(),i.ɵprov=g.jDH({token:i,factory:i.ɵfac,providedIn:"root"}),AddonModWikiPageOrMapLinkHandlerLazyService})();const y=(0,t.Qd)(u)}}]);