"use strict";(self["webpackChunk_quetz_frontend_main_app"]=self["webpackChunk_quetz_frontend_main_app"]||[]).push([[7013,3765],{47013:(e,a,n)=>{n.r(a);n.d(a,{CommandIDs:()=>k,default:()=>w});var r=n(34494);var t=n.n(r);var c=n(85168);var s=n.n(c);var o=n(79450);var l=n.n(o);var i=n(18303);var m=n.n(i);var u=n(98078);var d=n.n(u);var h=n(26074);var v=n.n(h);var g=n(71993);var p=n.n(g);var _=n(2411);var E=n.n(_);var k;(function(e){e.open="@quetz-frontend/search-extension:open"})(k||(k={}));const f={id:"@quetz-frontend/search-extension:plugin",autoStart:true,requires:[c.IRouter],activate:(e,a)=>{const{shell:n,commands:r}=e;r.addCommand(k.open,{execute:()=>{n.add(new C(a),"main")}});a.register({pattern:/^\/search.*/,command:k.open})}};const w=f;class C extends o.ReactWidget{constructor(e){super();this.id=o.DOMUtils.createDomID();this.title.label="Search page";this._router=e}render(){const e=new URLSearchParams(window.location.search).get("q");const a=u.ServerConnection.makeSettings();const n=i.URLExt.join(a.baseUrl,`/api/packages/search/?q=${e}`);const t=[{text:"Home",onClick:()=>{this._route("/")}},{text:`Search for "${e}"`}];const c=[{Header:"Name",accessor:"name",Cell:({row:e})=>_.createElement(r.Breadcrumb,null,_.createElement(r.BreadcrumbItem,null,_.createElement(r.Button,{appearance:"lightweight",onClick:()=>this._route(`/channels/${e.original.channel_name}`)},e.original.channel_name)),_.createElement(r.BreadcrumbItem,null,_.createElement(r.Button,{appearance:"lightweight",onClick:()=>this._route(`/channels/${e.original.channel_name}/packages/${e.values.name}`)},e.values.name)))},{Header:"Summary",accessor:"summary"},{Header:"Version",accessor:"current_version",Cell:({row:e})=>e.values.current_version||_.createElement("i",null,"n/a")}];return _.createElement("div",{className:"page-contents-width-limit"},_.createElement("h2",{className:"heading2"},"Packages"),_.createElement("div",{className:"flex"},_.createElement(h.Breadcrumbs,{items:t})),_.createElement("div",{className:"padding-side"},_.createElement(h.FetchHoc,{url:n,loadingMessage:"Searching for packages",genericErrorMessage:"Error fetching API keys"},(e=>_.createElement(g.Table,{columns:c,data:e||[]})))))}_route(e){this._router.navigate(e)}}}}]);