diff --git a/assets/index-2b998e2d.js b/assets/index-a36bf07a.js similarity index 99% rename from assets/index-2b998e2d.js rename to assets/index-a36bf07a.js index c0b9eb0..4a644cc 100644 --- a/assets/index-2b998e2d.js +++ b/assets/index-a36bf07a.js @@ -253,6 +253,6 @@ Created 'C:\\Users\\User\\Desktop\\foobar.json'.`})})]}),Q("hr",{}),j(Me,{childr "autoupdate": { "url": "https://gif.ski/gifski-$version.zip" } -}`})}),Q(de,{lg:6,children:"Scoop manifests are simple JSON files, which can be optionally complemented with inline PowerShell statements."})]}),Q("h3",{className:"mt-5 mb-4 text-center fw-normal",children:"Documentation"}),j("p",{className:"text-center",children:["Looking for something specific, or ready to dive into Scoop internals? Check out"," ",Q("a",{href:"https://github.com/ScoopInstaller/Scoop#readme",children:"Scoop's Readme"})," or refer to the"," ",Q("a",{href:"https://github.com/ScoopInstaller/Scoop/wiki",children:"Wiki"}),"."]})]})})},b2=Z.memo(M2),O2=()=>j(Yr,{className:"footer text-lg-center",children:[Q("hr",{}),j(Me,{className:"mb-3",children:[j(de,{md:4,className:"mb-2",children:[Q(Xd,{className:"footer-icon"})," ",Q("a",{href:"https://github.com/ScoopInstaller",children:"Scoop"})," created by"," ",Q("a",{href:"https://github.com/lukesampson",children:"lukesampson"})]}),j(de,{md:4,className:"mb-2",children:[Q(Xd,{className:"footer-icon"})," ",Q("a",{href:"https://github.com/ScoopInstaller/scoopinstaller.github.io",children:"Website"})," created by"," ",Q("a",{href:"https://github.com/gpailler",children:"gpailler"})," - ","0.2.0","/",Q("a",{href:`https://github.com/ScoopInstaller/scoopinstaller.github.io/commit/9f1c307 -`,children:`9f1c307 +}`})}),Q(de,{lg:6,children:"Scoop manifests are simple JSON files, which can be optionally complemented with inline PowerShell statements."})]}),Q("h3",{className:"mt-5 mb-4 text-center fw-normal",children:"Documentation"}),j("p",{className:"text-center",children:["Looking for something specific, or ready to dive into Scoop internals? Check out"," ",Q("a",{href:"https://github.com/ScoopInstaller/Scoop#readme",children:"Scoop's Readme"})," or refer to the"," ",Q("a",{href:"https://github.com/ScoopInstaller/Scoop/wiki",children:"Wiki"}),"."]})]})})},b2=Z.memo(M2),O2=()=>j(Yr,{className:"footer text-lg-center",children:[Q("hr",{}),j(Me,{className:"mb-3",children:[j(de,{md:4,className:"mb-2",children:[Q(Xd,{className:"footer-icon"})," ",Q("a",{href:"https://github.com/ScoopInstaller",children:"Scoop"})," created by"," ",Q("a",{href:"https://github.com/lukesampson",children:"lukesampson"})]}),j(de,{md:4,className:"mb-2",children:[Q(Xd,{className:"footer-icon"})," ",Q("a",{href:"https://github.com/ScoopInstaller/scoopinstaller.github.io",children:"Website"})," created by"," ",Q("a",{href:"https://github.com/gpailler",children:"gpailler"})," - ","0.2.0","/",Q("a",{href:`https://github.com/ScoopInstaller/scoopinstaller.github.io/commit/243d046 +`,children:`243d046 `})]}),j(de,{md:4,className:"mb-2",children:[Q(G2,{className:"footer-icon"})," Maintained by the"," ",Q("a",{href:"https://github.com/orgs/ScoopInstaller/people",children:"community"})]})]})]}),x2=Z.memo(O2);function LC(e){return qe({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 15A7 7 0 1 0 8 1v14zm0 1A8 8 0 1 1 8 0a8 8 0 0 1 0 16z"}}]})(e)}function FC(e){return qe({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M6 .278a.768.768 0 0 1 .08.858 7.208 7.208 0 0 0-.878 3.46c0 4.021 3.278 7.277 7.318 7.277.527 0 1.04-.055 1.533-.16a.787.787 0 0 1 .81.316.733.733 0 0 1-.031.893A8.349 8.349 0 0 1 8.344 16C3.734 16 0 12.286 0 7.71 0 4.266 2.114 1.312 5.124.06A.752.752 0 0 1 6 .278zM4.858 1.311A7.269 7.269 0 0 0 1.025 7.71c0 4.02 3.279 7.276 7.319 7.276a7.316 7.316 0 0 0 5.205-2.162c-.337.042-.68.063-1.029.063-4.61 0-8.343-3.714-8.343-8.29 0-1.167.242-2.278.681-3.286z"}}]})(e)}function MC(e){return qe({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 11a3 3 0 1 1 0-6 3 3 0 0 1 0 6zm0 1a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM8 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 0zm0 13a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 13zm8-5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2a.5.5 0 0 1 .5.5zM3 8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2A.5.5 0 0 1 3 8zm10.657-5.657a.5.5 0 0 1 0 .707l-1.414 1.415a.5.5 0 1 1-.707-.708l1.414-1.414a.5.5 0 0 1 .707 0zm-9.193 9.193a.5.5 0 0 1 0 .707L3.05 13.657a.5.5 0 0 1-.707-.707l1.414-1.414a.5.5 0 0 1 .707 0zm9.193 2.121a.5.5 0 0 1-.707 0l-1.414-1.414a.5.5 0 0 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .707zM4.464 4.465a.5.5 0 0 1-.707 0L2.343 3.05a.5.5 0 1 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .708z"}}]})(e)}const Y2=()=>{const{preferedColorScheme:e,browserColorScheme:t,toggleColorScheme:A}=C.useContext(Os);return Q($i,{expand:"sm",bg:"dark",variant:"dark",children:j(Yr,{children:[j($i.Brand,{as:Br,to:"/",children:[Q("img",{alt:"",src:"https://avatars.githubusercontent.com/u/16618068?s=30",width:"30",height:"30",className:"d-inline-block align-top rounded me-2"}),"Scoop"]}),Q($i.Toggle,{"aria-controls":"responsive-navbar-nav"}),j($i.Collapse,{id:"responsive-navbar-nav",children:[j(Er,{className:"me-auto",children:[Q(Er.Link,{as:Br,to:"/apps",children:"Apps"}),Q(Er.Link,{as:Br,to:"/buckets",children:"Buckets"})]}),j(Qn,{onClick:A,size:"sm",variant:"secondary",children:[e==Be.Auto&&(t==Be.Light?Q(LC,{title:"Auto mode. Click to switch to dark mode"}):Q(LC,{title:"Auto mode. Click to switch to light mode"})),e==Be.Light&&(t==Be.Light?Q(MC,{title:"Light mode. Click to switch to OS/browser preferred mode"}):Q(MC,{title:"Light mode. Click to switch to dark mode"})),e==Be.Dark&&(t==Be.Light?Q(FC,{title:"Dark mode. Click to switch to light mode"}):Q(FC,{title:"Dark mode. Click to switch to OS/browser preferred mode"}))]})]})]})})},U2=Z.memo(Y2),T2=e=>{const t="light",A="dark",n="preferred-color-scheme",[r,o]=C.useState(vh),[i,a]=C.useState(),[s,l]=C.useState(),c=C.useCallback(()=>{switch(s){case Be.Auto:l(i===Be.Light?Be.Dark:Be.Light);break;case Be.Light:l(i===Be.Light?Be.Auto:Be.Dark);break;case Be.Dark:l(i===Be.Dark?Be.Auto:Be.Light);break}},[s,i]),u=I=>I===null?Be.Auto:typeof I=="boolean"?I?Be.Dark:Be.Light:parseInt(I),g=I=>{const h=document.getElementsByTagName("html")[0];I===Be.Dark?(h.classList.remove(t),h.classList.add(A)):(h.classList.remove(A),h.classList.add(t))};return C.useLayoutEffect(()=>{if(s===void 0||i===void 0)return;let I;s===Be.Auto?(I=i,localStorage.removeItem(n)):(I=s,localStorage.setItem(n,s.toString())),g(I),o({preferedColorScheme:s,browserColorScheme:i,isDarkMode:I===Be.Dark,toggleColorScheme:c})},[i,s,c]),C.useLayoutEffect(()=>{const I=window.matchMedia("(prefers-color-scheme: dark)");I.addEventListener("change",h=>{a(u(h.matches))}),a(u(I.matches)),l(u(localStorage.getItem(n)))},[]),Q(Os.Provider,{value:r,children:e.children})},q2=()=>Q("div",{children:Q(Dc.Provider,{value:{className:"react-icon"},children:j(T2,{children:[Q(U2,{}),Q(mv,{}),Q(x2,{})]})})}),ao=2,P2=e=>{const{currentPage:t,resultsCount:A,resultsPerPage:n,onPageChange:r}=e,o=i=>{const a=Math.ceil(A/n),s=Math.max(1,Math.min(i,a));r(s)};if(A>0){const i=Math.ceil(A/n);if(t>i&&r(i),i>1){const a=[];let s=Math.max(2,t-ao),l=Math.min(i-1,t+ao);const c=ao*2-(l-s),u=l-(l+c);l=Math.min(i-1,l+c),s=Math.max(2,s+u);for(let g=s;g<=l;g+=1)g===t-ao+u||g===t+ao+c?a.push(Q(gn.Ellipsis,{disabled:!0},g)):a.push(Q(gn.Item,{active:g===t,onClick:()=>o(g),children:g},g));return j(gn,{size:"sm",children:[Q(gn.Prev,{onClick:()=>o(t-1)},"prev"),Q(gn.Item,{active:t===1,onClick:()=>o(1),children:1},1),a,Q(gn.Item,{active:i===t,onClick:()=>o(i),children:i},i),Q(gn.Next,{onClick:()=>o(t+1)},"next")]})}}return Q(Qt,{})},H2=Z.memo(P2);var J2=Object.defineProperty,$2=Object.getOwnPropertyDescriptor,K2=(e,t,A,n)=>{for(var r=n>1?void 0:n?$2(t,A):t,o=e.length-1,i;o>=0;o--)(i=e[o])&&(r=(n?i(t,A,r):i(r))||r);return n&&r&&J2(t,A,r),r};let Uc=class{serialize(e){throw new Error("Conversion not supported")}deserialize(e){return new Date(e)}};Uc=K2([yS],Uc);const j2=Uc;var z2=Object.defineProperty,_2=Object.getOwnPropertyDescriptor,ln=(e,t,A,n)=>{for(var r=n>1?void 0:n?_2(t,A):t,o=e.length-1,i;o>=0;o--)(i=e[o])&&(r=(n?i(t,A,r):i(r))||r);return n&&r&&z2(t,A,r),r};let oA=class{constructor(){this.repository="",this.repositoryOfficial=!1,this.stars=0,this.branchName="",this.filePath="",this.committed=new Date,this.sha=""}};ln([Ne("Repository",String)],oA.prototype,"repository",2);ln([Ne("OfficialRepository",Boolean)],oA.prototype,"repositoryOfficial",2);ln([Ne("RepositoryStars",Number)],oA.prototype,"stars",2);ln([Ne("BranchName",String,!0)],oA.prototype,"branchName",2);ln([Ne("FilePath",String)],oA.prototype,"filePath",2);ln([Ne("Committed",j2)],oA.prototype,"committed",2);ln([Ne("Sha",String)],oA.prototype,"sha",2);oA=ln([Rs("MetadataJson")],oA);const Vh=oA;var W2=Object.defineProperty,X2=Object.getOwnPropertyDescriptor,vt=(e,t,A,n)=>{for(var r=n>1?void 0:n?X2(t,A):t,o=e.length-1,i;o>=0;o--)(i=e[o])&&(r=(n?i(t,A,r):i(r))||r);return n&&r&&W2(t,A,r),r};let rt=class{constructor(){this.id="",this.score=0,this.name="",this.namePartial="",this.nameSuffix="",this.description=void 0,this.notes=void 0,this.homepage=void 0,this.license=void 0,this.version="",this.metadata=new Vh,this.highlights=void 0}get highlightedName(){return this.tryGetHighlights(["NamePartial","Name","NameSuffix"],this.name)}get highlightedLicense(){return this.tryGetHighlight("License",this.license)}get highlightedRepository(){return this.tryGetHighlight("Metadata/Repository",this.metadata.repository)}get highlightedDescription(){return this.tryGetHighlight("Description",this.description)}get highlightedVersion(){return this.tryGetHighlight("Version",this.version.length?this.version:"Unknown")}get favicon(){if(this.homepage){const e=document.createElement("a");return e.href=this.homepage,`${e.origin}/favicon.ico`}}tryGetHighlight(e,t){return this.tryGetHighlights([e],t)}tryGetHighlights(e,t){const A=e.find(n=>this.highlights&&this.highlights[n]);return A&&this.highlights?this.highlights[A].join(" "):t}};vt([Ne("Id",String)],rt.prototype,"id",2);vt([Ne("@search.score",Number)],rt.prototype,"score",2);vt([Ne("Name",String)],rt.prototype,"name",2);vt([Ne("NamePartial",String)],rt.prototype,"namePartial",2);vt([Ne("NameSuffix",String)],rt.prototype,"nameSuffix",2);vt([Ne("Description",String,!0)],rt.prototype,"description",2);vt([Ne("Notes",String,!0)],rt.prototype,"notes",2);vt([Ne("Homepage",String,!0)],rt.prototype,"homepage",2);vt([Ne("License",String,!0)],rt.prototype,"license",2);vt([Ne("Version",String,!0)],rt.prototype,"version",2);vt([Ne("Metadata",Vh)],rt.prototype,"metadata",2);vt([Ne("@search.highlights",Wa,!0)],rt.prototype,"highlights",2);rt=vt([Rs("ManifestJson")],rt);const Z2=rt;var eM=Object.defineProperty,tM=Object.getOwnPropertyDescriptor,$g=(e,t,A,n)=>{for(var r=n>1?void 0:n?tM(t,A):t,o=e.length-1,i;o>=0;o--)(i=e[o])&&(r=(n?i(t,A,r):i(r))||r);return n&&r&&eM(t,A,r),r};let tn=class{constructor(){this.count=0,this.results=Array()}static Create(e){return tn.jsonConvert.deserializeObject(e,tn)}};tn.jsonConvert=new vQ;$g([Ne("@odata.count",Number)],tn.prototype,"count",2);$g([Ne("value",[Z2])],tn.prototype,"results",2);tn=$g([Rs("SearchResultsJson")],tn);const AM=tn,_n=[{DisplayName:"Best match",DefaultSortDirection:1,OrderBy:{0:["search.score() asc","Metadata/OfficialRepositoryNumber asc","NameSortable desc"],1:["search.score() desc","Metadata/OfficialRepositoryNumber desc","NameSortable asc"]}},{DisplayName:"Name",DefaultSortDirection:0,OrderBy:{0:["NameSortable asc","Metadata/OfficialRepositoryNumber desc","Metadata/RepositoryStars desc","Metadata/Committed desc"],1:["NameSortable desc","Metadata/OfficialRepositoryNumber asc","Metadata/RepositoryStars asc","Metadata/Committed asc"]}},{DisplayName:"Newest",DefaultSortDirection:1,OrderBy:{0:["Metadata/Committed asc","Metadata/OfficialRepositoryNumber asc","Metadata/RepositoryStars asc"],1:["Metadata/Committed desc","Metadata/OfficialRepositoryNumber desc","Metadata/RepositoryStars desc"]}}],{VITE_APP_AZURESEARCH_URL:bC,VITE_APP_AZURESEARCH_KEY:OC}={VITE_APP_AZURESEARCH_URL:"https://scoopsearch.search.windows.net/indexes/apps/docs",VITE_APP_AZURESEARCH_KEY:"DC6D2BBE65FC7313F2C52BBD2B0286ED",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1},nM=e=>{const[t,A]=C.useState(0),[n,r]=C.useState(!1),o=C.useRef(new AbortController),{query:i,page:a,resultsPerPage:s,sortIndex:l,sortDirection:c,officialOnly:u,onOfficialOnlyChange:g,distinctManifestsOnly:I,onDistinctManifestsOnlyChange:h,installBucketName:y,onInstallBucketName:d,onResultsChange:E,onSortChange:f}=e,B=C.useCallback((G,L)=>{f(G,L)},[f]),p=C.useCallback(G=>{G.currentTarget.blur(),g(!u)},[u,g]),v=C.useCallback(G=>{G.currentTarget.blur(),h(!I)},[I,h]),m=C.useCallback(G=>{G.currentTarget.blur(),d(!y)},[y,d]),w=C.useCallback((G,L)=>{G.currentTarget.blur(),B(L,L===l?(c+1)%2:_n[L].DefaultSortDirection)},[l,c,B]);C.useEffect(()=>(o.current.abort(),o.current=new AbortController,(L=>{if(r(!0),!bC)throw new Error("VITE_APP_AZURESEARCH_URL is not defined");if(!OC)throw new Error("VITE_APP_AZURESEARCH_KEY is not defined");const O=[];u&&O.push("Metadata/OfficialRepositoryNumber eq 1"),I&&O.push("Metadata/DuplicateOf eq null");const U=`${bC}/search?api-version=2020-06-30`;fetch(U,{method:"POST",body:JSON.stringify({count:!0,search:i.trim(),searchMode:"all",filter:O.join(" and "),orderby:_n[l].OrderBy[c].join(", "),skip:(a-1)*s,top:s,select:["Id","Name","NamePartial","NameSuffix","Description","Notes","Homepage","License","Version","Metadata/Repository","Metadata/FilePath","Metadata/OfficialRepository","Metadata/RepositoryStars","Metadata/Committed","Metadata/Sha"].join(","),highlight:["Name","NamePartial","NameSuffix","Description","Version","License","Metadata/Repository"].join(","),highlightPreTag:"",highlightPostTag:""}),headers:{"api-key":OC,"Content-Type":"application/json"},signal:L}).then(F=>{if(!F.ok)throw new Error(`${F.status} ${F.statusText}`);return F.json()}).then(F=>{const N=AM.Create(F);r(!1),A(N.count),E(N)}).catch(F=>{F.name!=="AbortError"&&(r(!1),A(0),E(void 0))})})(o.current.signal),()=>o.current.abort()),[i,a,l,c,u,I,s,E]);const V=G=>{const{currentSortIndex:L,...O}=G;return l===L?c===_n[L].DefaultSortDirection?Q(GC,{...O}):Q(k2,{...O}):Q(GC,{...O,visibility:"hidden"})},D=()=>`${_n[l].DisplayName}, ${u?"Official buckets only":"All buckets"}`;return Q(ct,{children:j(Me,{children:[Q(de,{xs:8,className:"my-auto",children:Q(yQ,{query:i,resultsCount:t,searching:n,type:Ig.Applications,officialOnly:u})}),Q(de,{xs:4,className:"text-end",children:j(Vt,{autoClose:"outside",align:"end",drop:"end",className:"sorting-filtering-button",children:[j(Vt.Toggle,{size:"sm",variant:"secondary",children:[Q(gS,{className:"me-2"}),Q("span",{className:"d-none d-sm-inline",children:D()})]}),j(Vt.Menu,{className:"sorting-filtering-menu",children:[Q(Vt.Header,{children:"Sorting"}),_n.map((G,L)=>j(Vt.Item,{as:Qn,onClick:O=>w(O,L),children:[Q(V,{currentSortIndex:L,className:"me-2"}),G.DisplayName]},G.DisplayName)),Q(Vt.Divider,{}),Q(Vt.Header,{children:"Filtering"}),Q(Vt.Item,{as:Qn,onClick:G=>p(G),children:j(ct.Switch,{className:"form-switch-sm",children:[Q(ct.Switch.Input,{checked:u}),j(ct.Switch.Label,{children:["Official buckets only ",Q(Cg,{className:"ms-1",official:!0,showTooltip:!1})]})]})}),Q(Vt.Item,{as:Qn,onClick:G=>v(G),children:j(ct.Switch,{className:"form-switch-sm",children:[Q(ct.Switch.Input,{checked:I}),Q(ct.Switch.Label,{children:"Distinct manifests only"})]})}),Q(Vt.Divider,{}),Q(Vt.Header,{children:"Option"}),Q(Vt.Item,{as:Qn,onClick:G=>m(G),children:j(ct.Switch,{className:"form-switch-sm",children:[Q(ct.Switch.Input,{checked:y}),Q(ct.Switch.Label,{children:"Show bucket name"})]})})]})]})})]})})},rM=Z.memo(nM);var Dh={exports:{}};(function(e,t){(function(A,n){e.exports=n()})(Vn,function(){var A=1e3,n=6e4,r=36e5,o="millisecond",i="second",a="minute",s="hour",l="day",c="week",u="month",g="quarter",I="year",h="date",y="Invalid Date",d=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,E=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,f={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(F){var N=["th","st","nd","rd"],S=F%100;return"["+F+(N[(S-20)%10]||N[S]||N[0])+"]"}},B=function(F,N,S){var M=String(F);return!M||M.length>=N?F:""+Array(N+1-M.length).join(S)+F},p={s:B,z:function(F){var N=-F.utcOffset(),S=Math.abs(N),M=Math.floor(S/60),R=S%60;return(N<=0?"+":"-")+B(M,2,"0")+":"+B(R,2,"0")},m:function F(N,S){if(N.date()1)return F(Y[0])}else{var k=N.name;m[k]=N,R=k}return!M&&R&&(v=R),R||!M&&v},G=function(F,N){if(V(F))return F.clone();var S=typeof N=="object"?N:{};return S.date=F,S.args=arguments,new O(S)},L=p;L.l=D,L.i=V,L.w=function(F,N){return G(F,{locale:N.$L,utc:N.$u,x:N.$x,$offset:N.$offset})};var O=function(){function F(S){this.$L=D(S.locale,null,!0),this.parse(S),this.$x=this.$x||S.x||{},this[w]=!0}var N=F.prototype;return N.parse=function(S){this.$d=function(M){var R=M.date,b=M.utc;if(R===null)return new Date(NaN);if(L.u(R))return new Date;if(R instanceof Date)return new Date(R);if(typeof R=="string"&&!/Z$/i.test(R)){var Y=R.match(d);if(Y){var k=Y[2]-1||0,x=(Y[7]||"0").substring(0,3);return b?new Date(Date.UTC(Y[1],k,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,x)):new Date(Y[1],k,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,x)}}return new Date(R)}(S),this.init()},N.init=function(){var S=this.$d;this.$y=S.getFullYear(),this.$M=S.getMonth(),this.$D=S.getDate(),this.$W=S.getDay(),this.$H=S.getHours(),this.$m=S.getMinutes(),this.$s=S.getSeconds(),this.$ms=S.getMilliseconds()},N.$utils=function(){return L},N.isValid=function(){return this.$d.toString()!==y},N.isSame=function(S,M){var R=G(S);return this.startOf(M)<=R&&R<=this.endOf(M)},N.isAfter=function(S,M){return G(S)0,m<=v.r||!v.r){m<=1&&p>0&&(v=f[p-1]);var w=E[v.l];I&&(m=I(""+m)),y=typeof w=="string"?w.replace("%d",m):w(m,c,v.l,d);break}}if(c)return y;var V=d?E.future:E.past;return typeof V=="function"?V(y):V.replace("%s",y)},o.to=function(l,c){return a(l,c,this,!0)},o.from=function(l,c){return a(l,c,this)};var s=function(l){return l.$u?r.utc():r()};o.toNow=function(l){return this.to(s(this),l)},o.fromNow=function(l){return this.from(s(this),l)}}})})(Nh);var sM=Nh.exports;const lM=It(sM);var kh=function(e){var t=e.decode,A=t===void 0?!0:t,n=e.crossOrigin,r=n===void 0?"":n;return function(o){return new Promise(function(i,a){var s=new Image;r&&(s.crossOrigin=r),s.onload=function(){A&&s.decode?s.decode().then(i).catch(a):i()},s.onerror=a,s.src=o})}};function xC(e,t){var A=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),A.push.apply(A,n)}return A}function Zi(e){for(var t=1;t{const[A,n]=C.useState(!1),{onClick:r,...o}=e;C.useEffect(()=>{A&&setTimeout(()=>{n(!1)},pM)},[A]);const i=C.useCallback(a=>{r==null||r.call(void 0,a),n(!0)},[r]);return Q(Qn,{...o,onClick:i,disabled:A,ref:t,children:A?Q(S2,{}):Q(R2,{})})});Rh.displayName="CopyToClipboardButton";const QM=Z.memo(Rh),hM=EM.concat(BM);as.extend(aM);as.extend(lM);const mM=e=>{const{result:t,officialRepositories:A,installBucketName:n,onCopyToClipbard:r,onResultSelected:o,cardRef:i}=e,a=C.useRef(null),[s,l]=C.useState(!1),c=C.useCallback(R=>{r(R)},[r]),u=C.useCallback(()=>{o==null||o.call(void 0,t)},[o,t]),g=R=>R&&Q("span",{dangerouslySetInnerHTML:{__html:R}}),I=R=>{const{value:b,...Y}=R,k=C.useRef(null),x=()=>{var q;(q=k.current)==null||q.click()};return j(Sr,{size:"sm",className:"copy-command-group",...Y,children:[Q(Sr.Text,{className:"border-end-0 copy-command-prefix",children:">"}),Q(ct.Control,{className:"border-start-0 copy-command-text",readOnly:!0,title:"Copy to clipboard",type:"text",value:b,onClick:x}),Q(QM,{className:"copy-command-button",ref:k,title:"Copy to clipboard",variant:"outline-secondary",onClick:()=>c(b)})]})},h=()=>{a.current&&l(a.current.offsetWidth>=a.current.scrollWidth)},{id:y,name:d,favicon:E,highlightedName:f,highlightedDescription:B,notes:p,highlightedLicense:v,highlightedRepository:m,highlightedVersion:w,metadata:V,homepage:D,version:G,license:L}=t,O=(D??"").replace(/^(?:\w+:\/\/)(.+?)\/*$/,"$1"),U=V.repositoryOfficial?m==null?void 0:m.toString().replace(V.repository,A[V.repository]):m==null?void 0:m.toString().replace(/^(|)(?:.*?\/){3}(.+)$/,"$1$2"),F=G.length>0&&/^\d/.test(G)&&"v",N=V.repositoryOfficial?A[V.repository]||V.repository.substring(V.repository.lastIndexOf("/")+1).toLowerCase():`${Eg.extractPathFromUrl(V.repository,"_")}`,S=V.repositoryOfficial?"":`${V.repository}`,M=`${N} ${S}`.trim();return j(ul,{className:"mb-2",ref:i,children:[Q(ul.Header,{children:j(Me,{children:[j(de,{lg:7,className:"valign-items",children:[E&&Q(IM,{className:"me-2",src:E,width:20,height:20}),Q("span",{className:"fw-bold",role:o?"button":void 0,onClick:u,children:g(f)}),Q("span",{className:"me-1 ms-1",children:"in"}),Q("a",{href:V.repository,children:g(U)}),Q(Cg,{className:"ms-1",official:V.repositoryOfficial,stars:V.stars})]}),j(de,{lg:5,className:"text-lg-end text-truncate",children:[Q(sS,{title:"Updated",className:"me-1"}),Q("a",{href:`${V.repository}/commit/${V.sha}`,title:`Diff (${as(V.committed).format("LLL")})`,children:as(V.committed).fromNow()}),Q("span",{className:"ms-1 me-1",children:"|"}),Q(uS,{title:"Version",className:"me-1"}),j("a",{href:`${V.repository}/blob/master/${V.filePath.replace("#","%23")}`,title:"Manifest file",children:[F,g(w)]})]})]})}),Q(ul.Body,{children:Q(Yr,{className:"p-0",children:j(Me,{children:[j(de,{lg:6,children:[Q(Me,{children:B&&g(B)}),j(Me,{className:"mt-2",children:[D&&j("span",{className:"text-truncate",ref:a,children:[Q(cS,{title:"Homepage",className:"me-1"}),Q("a",{href:D,onMouseOver:h,title:s?"":D,children:Q("span",{children:g(O)})})]}),L&&j("span",{children:[Q(lS,{title:"License",className:"me-1"}),L&&hM.includes(L)&&Q("a",{href:`https://spdx.org/licenses/${L}.html`,children:g(v)})||g(v)]}),p&&j("span",{children:[Q(aS,{title:"Notes",className:"me-1"}),p]})]})]}),j(de,{lg:6,className:"mt-4 mt-lg-0",children:[Q(Me,{children:Q(I,{value:`scoop bucket add ${M}`,id:"bucket-command"})}),Q(Me,{className:"mt-2",children:Q(I,{value:`scoop install ${n?N+"/":""}${d}`,id:"app-command"})})]})]})})})]},y)},UC=Z.memo(mM),yM=window.requestIdleCallback||function(t){const A=Date.now();return setTimeout(()=>{t({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-A))}})},1)},TC=20,qC="q",PC="p",HC="s",JC="d",$C="o",KC="dm",jC="n",zC="id",vM=500;function wM(e,t){const[A,n]=C.useState(e);return C.useEffect(()=>{const r=setTimeout(()=>n(e),t||vM);return()=>{clearTimeout(r)}},[e,t]),A}const VM=()=>{const[e,t]=bv(),A=C.useCallback(()=>e.get(qC)??"",[e]),n=C.useCallback(()=>parseInt(e.get(PC)||"1"),[e]),r=C.useCallback((T,$)=>{const te=e.get(T)||localStorage.getItem(T);if(te)switch(typeof $){case"number":return parseInt(te);case"boolean":return te==="true";case"string":return te}return $},[e]),o=C.useCallback(()=>r(HC,0),[r]),i=C.useCallback(T=>r(JC,_n[T].DefaultSortDirection),[r]),a=C.useCallback(()=>r($C,!0),[r]),s=C.useCallback(()=>r(KC,!0),[r]),l=C.useCallback(()=>r(jC,!0),[r]),c=C.useCallback(()=>r(zC,""),[r]),u=C.useCallback((T,$,te)=>{$?(e.set(T,$),te&&localStorage.setItem(T,$)):(e.delete(T),te&&localStorage.removeItem(T)),t(e,{replace:!0})},[e,t]),[g,I]=C.useState(A),[h,y]=C.useState(A),d=wM(h),[E,f]=C.useState(n),[B,p]=C.useState(o),[v,m]=C.useState(i(B)),[w,V]=C.useState(a),[D,G]=C.useState(s()),[L,O]=C.useState(l()),[U,F]=C.useState(),[N,S]=C.useState({}),[M,R]=C.useState(),[b,Y]=C.useState(c),k=C.useRef(null);C.useEffect(()=>{const T=A();I(T),y(T)},[A]),C.useEffect(()=>{f(n())},[n]),o()!==B&&p(o()),i(o())!==v&&p(i(o())),a()!==w&&V(a()),s()!==D&&G(s()),l()!==L&&O(l()),C.useEffect(()=>{var T;if(U!=null&&U.results&&b){const $=U.results.find(te=>te.id===b);$&&(R($),(T=k.current)==null||T.scrollIntoView())}else R(void 0);u(zC,b,!1)},[b,U,u]),C.useEffect(()=>{fetch("https://cdn.jsdelivr.net/gh/ScoopInstaller/Scoop/buckets.json").then(T=>T.json()).then(T=>{const $=T,te={};Object.keys($).forEach(Ce=>{te[$[Ce]]=Ce}),S(te)}).catch(T=>console.log(T))},[]);const x=C.useCallback(T=>{u(qC,T,!1),I(T),f(1)},[u]),q=C.useCallback(()=>{y(g)},[g]),P=C.useRef(-1),z=C.useCallback(T=>{P.current=yM(()=>F(T))},[]);C.useEffect(()=>()=>cancelIdleCallback(P.current),[P]);const ee=C.useCallback(T=>{u(PC,T.toString(),!1),f(T),window.scrollTo(0,0)},[u]),ne=C.useCallback((T,$)=>{u(HC,T.toString(),!0),u(JC,$.toString(),!0),p(T),m($)},[u]),se=C.useCallback(T=>{u($C,T.toString(),!0),V(T)},[u]),ue=C.useCallback(T=>{u(KC,T.toString(),!0),G(T)},[u]),le=C.useCallback(T=>{(async te=>{await navigator.clipboard.writeText(te)})(T).finally(()=>{})},[]),Ie=C.useCallback(T=>{Y(T.id)},[]),ye=C.useCallback(()=>{Y("")},[]),J=C.useCallback(T=>{u(jC,T.toString(),!0),O(T)},[u]);return j(Qt,{children:[Q(ti,{children:j("title",{children:["Apps",h&&` (${h})`]})}),j(Yr,{className:"mt-5 mb-5",children:[Q(Me,{className:"justify-content-center",children:Q(de,{sm:8,children:Q(wh,{query:g,onQueryChange:x,onSubmit:q})})}),Q(Me,{className:"mt-5 mb-1",children:Q(de,{children:Q(rM,{resultsPerPage:TC,page:E,query:d,sortIndex:B,sortDirection:v,officialOnly:w,onOfficialOnlyChange:se,distinctManifestsOnly:D,onDistinctManifestsOnlyChange:ue,onResultsChange:z,onSortChange:ne,installBucketName:L,onInstallBucketName:J})})}),Q(Me,{className:"mt-2",children:Q(de,{children:U==null?void 0:U.results.map(T=>Q(UC,{cardRef:T.id==b?k:void 0,result:T,officialRepositories:N,installBucketName:L,onCopyToClipbard:le,onResultSelected:Ie},T.id))})}),Q(Me,{children:Q(de,{className:"d-flex justify-content-center",children:Q(H2,{resultsPerPage:TC,currentPage:E,resultsCount:(U==null?void 0:U.count)??0,onPageChange:ee})})})]}),Q(jd,{show:M!==void 0,onHide:ye,restoreFocus:!1,size:"xl",centered:!0,className:"modal-selected-result",children:Q(jd.Body,{children:M&&Q(UC,{result:M,officialRepositories:N,installBucketName:L,onCopyToClipbard:le})})})]})},DM=Z.memo(VM),SM=()=>j(Qt,{children:[Q(ti,{defaultTitle:"Scoop",titleTemplate:"Scoop - %s"}),Q(Gv,{children:Q(vv,{children:j(fo,{path:"/",element:Q(q2,{}),children:[Q(fo,{path:"apps",element:Q(DM,{})}),Q(fo,{path:"buckets",element:Q(NS,{})}),Q(fo,{index:!0,element:Q(b2,{})})]})})})]}),NM=e=>{e&&e instanceof Function&&tN(()=>import("./web-vitals-60d3425a.js"),[]).then(({getCLS:t,getFID:A,getFCP:n,getLCP:r,getTTFB:o})=>{t(e),A(e),n(e),r(e),o(e)})};MA.render(Q(Z.StrictMode,{children:Q(SM,{})}),document.getElementById("root"));NM()});export default kM(); diff --git a/index.html b/index.html index 266ea5d..d95557c 100644 --- a/index.html +++ b/index.html @@ -22,7 +22,7 @@ href="https://cdn.jsdelivr.net/npm/bootstrap-dark-5@1.1.3/dist/css/bootstrap-nightshade.min.css" rel="stylesheet" /> - +