PageSourceSearch

https://secure.columbiagames.com/assets/LibraryPage-iIEbYpzA.js

js columbiagames.com collected 2026-09-24 10:00:40 UTC 9,511 bytes, 1 lines download raw bytes

1import{r as l,j as e,L as w,J as T,_ as R}from"./index-W04rzwDS.js";import{r as B}from"./ProductImage-DxdKdEFd.js";import{S as P}from"./StartCollectionCard-B8V4pb5G.js";const E=[{value:"updated_desc",label:"Last updated · newest first"},{value:"updated_asc",label:"Last updated · oldest first"},{value:"name_asc",label:"Title · A–Z"},{value:"name_desc",label:"Title · Z–A"},{value:"sku_asc",label:"Product ID · ascending"},{value:"sku_desc",label:"Product ID · descending"}];function $(t){return[t.category,t.subCategory].filter(Boolean).join(" / ")}function i(t){if(!t)return"";const n=new Date(t);return Number.isNaN(n.getTime())?t:new Intl.DateTimeFormat(void 0,{year:"numeric",month:"short",day:"numeric"}).format(n)}function M(t){return[t.status,t.lastUpdatedAt?`Updated: ${i(t.lastUpdatedAt)}`:"",t.lastDownloadedAt?`Last downloaded: ${i(t.lastDownloadedAt)}`:"",t.releaseDate?`Release: ${i(t.releaseDate)}`:""].filter(Boolean).join(" · ")}function q(t,n){if(!t)return!1;const o=new Date(t).getTime();return Number.isNaN(o)?!1:o>=Date.now()-n*24*60*60*1e3}function Q(){const[t,n]=l.useState(null),[o,m]=l.useState(!0),[v,N]=l.useState(null),[U,g]=l.useState(!1),[j,D]=l.useState("updated_desc"),[b,S]=l.useState(""),[d,C]=l.useState(""),[u,x]=l.useState(""),[p,L]=l.useState("all"),[h,A]=l.useState("all"),[c,I]=l.useState("all");async function k(a){m(!0),N(null);try{const r=await R({sort:a});if(!r.ok){g(!0),n(null);return}g(!1),n(r.data??null)}catch(r){g(!1),N(r instanceof Error?r.message:"Library request failed")}finally{m(!1)}}l.useEffect(()=>{k(j)},[j]);const F=l.useMemo(()=>t?Array.from(new Set(t.items.map(a=>a.category).filter(Boolean))).sort((a,r)=>a.localeCompare(r)):[],[t]),O=l.useMemo(()=>t?Array.from(new Set(t.items.filter(a=>!d||a.category===d).map(a=>a.subCategory).filter(Boolean))).sort((a,r)=>a.localeCompare(r)):[],[t,d]),y=l.useMemo(()=>{if(!t)return[];const a=b.trim().toLocaleLowerCase(),r=h==="all"?null:Number(h);return t.items.filter(s=>!(a&&![s.description,s.productId,s.category,s.subCategory,s.status,s.downloadableFilename].filter(Boolean).join(" ").toLocaleLowerCase().includes(a)||d&&s.category!==d||u&&s.subCategory!==u||p==="ready"&&!s.hasDownloadFile||p==="pending"&&s.hasDownloadFile||r!==null&&!q(s.lastUpdatedAt,r)||c==="updated"&&s.downloadState!=="updated_since_download"||c==="current"&&s.downloadState!=="up_to_date"||c==="unrecorded"&&s.downloadState!=="no_recorded_download"))},[t,b,d,u,p,h,c]);function _(){S(""),C(""),x(""),L("all"),A("all"),I("all"),D("updated_desc")}if(o&&!t)return e.jsx("p",{className:"start-muted",children:"Loading library…"});if(v)return e.jsx("p",{className:"start-error",children:v});if(U)return e.jsxs("section",{className:"start-page start-stack",children:[e.jsxs("div",{className:"start-card",children:[e.jsx("h1",{children:"Digital library"}),e.jsx("p",{className:"start-muted",children:"Please sign in to access your owned downloads."})]}),e.jsxs("div",{className:"start-card",children:[e.jsx("p",{className:"start-error",children:"Please log in to view owned downloads."}),e.jsx(w,{className:"start-button-link",to:"/account",children:"Go to account login"})]})]});if(!t||!t.meta.hasItems)return e.jsx("section",{className:"start-page start-stack",children:e.jsxs("div",{className:"start-card",children:[e.jsx("div",{className:"start-page-header",children:e.jsxs("div",{children:[e.jsx("h1",{children:"Digital library"}),e.jsx("p",{className:"start-muted",children:"Owned downloadable titles will appear here after purchase. This page is your download center: open purchased digital products, check file availability, and download ready files again whenever you need them."})]})}),e.jsxs("div",{className:"start-card start-empty-state",children:[e.jsx("p",{children:"No downloadable purchases were found for this account yet."}),e.jsx(w,{to:"/products",children:"Browse products"})]})]})});const f=t.meta.updatedSinceLastDownloadCount??0;return e.jsxs("section",{className:"start-page start-library-page start-stack",children:[e.jsx("div",{className:"start-card",children:e.jsx("div",{className:"start-page-header",children:e.jsxs("div",{children:[e.jsx("h1",{children:"Digital library"}),e.jsxs("p",{className:"start-muted",children:[t.meta.count," owned download",t.meta.count===1?"":"s"," in your library."]}),e.jsx("p",{className:"start-muted start-compact-copy",children:"Search your collection, filter it, and sort by actual downloadable-file update time, title, or product ID."}),t.meta.downloadHistoryAvailable&&f>0?e.jsxs("p",{className:"start-muted start-compact-copy",children:[f," title",f===1?" has":"s have"," been updated since your last recorded download."]}):null]})})}),e.jsxs("section",{className:"start-catalog-filters start-card","aria-label":"Digital library filters",children:[e.jsxs("div",{className:"start-section-heading-row",children:[e.jsxs("div",{children:[e.jsx("h3",{children:"Find a download"}),e.jsxs("p",{className:"start-muted start-compact-copy","aria-live":"polite",children:["Showing ",y.length," of ",t.meta.count," title",t.meta.count===1?"":"s",".",o?" Updating sort…":""]})]}),e.jsx("button",{type:"button",className:"start-button-secondary",onClick:_,children:"Reset"})]}),e.jsxs("div",{className:"start-catalog-filter-grid",children:[e.jsxs("label",{children:[e.jsx("span",{children:"Search"}),e.jsx("input",{type:"search",value:b,onChange:a=>S(a.target.value),placeholder:"Title, product ID, category…","aria-label":"Search digital library"})]}),e.jsxs("label",{children:[e.jsx("span",{children:"Category"}),e.jsxs("select",{value:d,onChange:a=>{C(a.target.value),x("")},children:[e.jsx("option",{value:"",children:"All categories"}),F.map(a=>e.jsx("option",{value:a,children:a},a))]})]}),e.jsxs("label",{children:[e.jsx("span",{children:"Subcategory"}),e.jsxs("select",{value:u,onChange:a=>x(a.target.value),children:[e.jsx("option",{value:"",children:"All subcategories"}),O.map(a=>e.jsx("option",{value:a,children:a},a))]})]}),e.jsxs("label",{children:[e.jsx("span",{children:"Files"}),e.jsxs("select",{value:p,onChange:a=>L(a.target.value),children:[e.jsx("option",{value:"all",children:"All files"}),e.jsx("option",{value:"ready",children:"Ready to download"}),e.jsx("option",{value:"pending",children:"File pending"})]})]}),e.jsxs("label",{children:[e.jsx("span",{children:"Updated"}),e.jsxs("select",{value:h,onChange:a=>A(a.target.value),children:[e.jsx("option",{value:"all",children:"Anytime"}),e.jsx("option",{value:"7",children:"Last 7 days"}),e.jsx("option",{value:"30",children:"Last 30 days"}),e.jsx("option",{value:"90",children:"Last 90 days"})]})]}),e.jsxs("label",{children:[e.jsx("span",{children:"Download history"}),e.jsxs("select",{value:c,onChange:a=>I(a.target.value),children:[e.jsx("option",{value:"all",children:"All titles"}),e.jsx("option",{value:"updated",children:"Updated since last download"}),e.jsx("option",{value:"current",children:"Downloaded · up to date"}),e.jsx("option",{value:"unrecorded",children:"No recorded download"})]})]}),e.jsxs("label",{children:[e.jsx("span",{children:"Sort by"}),e.jsx("select",{value:j,onChange:a=>D(a.target.value),children:E.map(a=>e.jsx("option",{value:a.value,children:a.label},a.value))})]})]})]}),y.length===0?e.jsxs("div",{className:"start-card start-empty-state",children:[e.jsx("p",{children:"No downloads match the current filters."}),e.jsx("button",{type:"button",className:"start-button-secondary",onClick:_,children:"Clear filters"})]}):e.jsx("div",{className:"start-product-grid start-library-grid",children:y.map(a=>{var r,s;return e.jsx(P,{href:`/products/${encodeURIComponent(a.productId)}`,title:a.description,productId:a.productId,categoryLabel:$(a),priceLabel:a.price||"—",summary:M(a),imageUrl:B(a.image,{width:360,format:"webp"}),imageAlt:a.description,cornerBadge:a.updatedSinceLastDownload?"Update available":a.hasDownloadFile?"Owned download":"Owned item",badges:e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"start-badge",children:["Owned × ",a.quantity]}),a.hasDownloadFile?e.jsx("span",{className:"start-badge start-badge-accent",children:"Ready to download"}):e.jsx("span",{className:"start-badge",children:"File pending"}),a.updatedSinceLastDownload?e.jsx("span",{className:"start-badge start-badge-accent",children:"Updated since your last download"}):null,a.downloadState==="up_to_date"?e.jsx("span",{className:"start-badge",children:"Downloaded · up to date"}):null,a.downloadState==="no_recorded_download"?e.jsx("span",{className:"start-badge",children:"No recorded download"}):null,a.lastDownloadedAt?e.jsxs("span",{className:"start-badge",children:["Last downloaded ",i(a.lastDownloadedAt)]}):null,a.lastUpdatedAt?e.jsxs("span",{className:"start-badge",children:["Updated ",i(a.lastUpdatedAt)]}):null,a.downloadableFilename?e.jsx("span",{className:"start-badge",children:a.downloadableFilename}):null,(r=a.latestOrder)!=null&&r.orderId?e.jsxs("span",{className:"start-badge",children:["Order ",a.latestOrder.orderId]}):null]}),actions:e.jsxs(e.Fragment,{children:[e.jsx(w,{className:"start-button-link start-button-secondary",to:`/products/${encodeURIComponent(a.productId)}`,children:"View product"}),a.hasDownloadFile?e.jsx("a",{className:"start-button-link",href:T(a.productId,(s=a.latestOrder)==null?void 0:s.orderId),children:"Download now"}):e.jsx("span",{className:"start-button-link start-button-secondary start-disabled-action","aria-disabled":"true",children:"Download pending"})]})},a.productId)})})]})}export{Q as LibraryPage};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.