"use strict";var e=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))((function(r,o){function s(e){try{c(i.next(e))}catch(e){o(e)}}function a(e){try{c(i.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((i=i.apply(e,t||[])).next())}))},t=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.info=void 0;const n=t(require("../../log")),i=require("./infoView"),r=t(require("semver")),o=require("../../common/Constants"),s=require("../../util"),a=require("../dependency/dep-fetcher"),c=require("../dependency/util");exports.info=function(t){return e(this,void 0,void 0,(function*(){n.default.setup("warn");const u=s.PackageUtil.parse(t);if(u.name){const t=u.version||"",s=(0,c.isStandardTagDependency)(t)?t:r.default.valid(u.version)||"";return yield function(t,s){return e(this,void 0,void 0,(function*(){const e=new a.RegistryMetaDataFetcherImpl,u=yield e.fetchMetaDataFromRegistry(t,s),{versions:f,time:d,"dist-tags":l,maintainers:p}=u;(0,c.isTagDependency)(s)&&(s=(0,c.getVersionByDistTags)(s,u)||"");const h=[];Object.keys(f).forEach((e=>{h.push(e)}));const y=h.indexOf(s);let v={};if(!s){const e=h.sort(r.default.compareLoose);v=f[e[e.length-1]]}s&&-1!==y&&(v=f[h[y]]),e.checkRegistry(v.name,v.version,{versions:f},u.responsePkgType),s&&-1===y?n.default.error("",`${t}@${s} is not in the ${o.Constants.PM} registry.`):(0,i.infoView)(v,d,l,h,p)}))}(u.name,s),!0}return n.default.error("","The package name cannot be empty."),!1}))};