1import{u as E,v as B,r as l,j as e,at as z,B as c,x as I,F as R,t as _}from"./index-Cc22E_SZ.js";import{B as q}from"./BackButton-BpfIQ3IB.js";import{u as H,A as M}from"./useCompareProducts-LMdy46Nf.js";import{C as O}from"./CompareToolkit-W1khZxiq.js";import{S as a}from"./skeleton-CLXAFIn4.js";import{S as U,a as V,b as $,c as D,d as y}from"./select-BrejtzdR.js";import{F as S}from"./filter-CvqPc46h.js";import{R as p}from"./rotate-ccw-BwuAp97s.js";import{S as G}from"./sparkles-cjtM71xh.js";import{C as J}from"./circle-alert-D9qzgnZe.js";import"./checkbox-Bi8Yhg8U.js";import"./index-Bd8z6f4h.js";import"./QuickProfileDialog-Bt3udf6V.js";import"./GoltCoinRewardModal-DGMJ6b9c.js";import"./golt-coin-BL7ket45.js";import"./useGoltCoins-BJZEf3O5.js";import"./useSearchQuota-BI0XIKFV.js";import"./input-DgPuEPGg.js";import"./label-BzIo4Sxj.js";import"./textarea-C1EAiW1k.js";import"./circle-check-JLC-OZ6g.js";import"./coins-CjVArs7x.js";import"./UserCompleteProfileDialog-KLHln3Zi.js";import"./progress-DpaX0wdK.js";import"./rawData-CiloecjC.js";import"./command-D83Z6mlP.js";import"./popover-DPO91zR4.js";import"./chevrons-up-down-BuUK1g3b.js";import"./building-DLAQMFxQ.js";import"./map-pin-DSBGbelt.js";import"./settings-_Edfw7bV.js";import"./ellipsis-BliGPUdU.js";import"./loader-circle-Cl7UrnHV.js";import"./index-BdQq_4o_.js";function Pe(){const d=E(),C=B(),u="https://goltprodapi-ehecb3h9h5ebbkam.northeurope-01.azurewebsites.net",A="https://goltaiqa.blob.core.windows.net/prodgoltai",[o,k]=l.useState([]),[h,g]=l.useState(!0),[f,j]=l.useState(null),[t,m]=l.useState("all"),{compareProducts:b,toggleCompare:P,removeProduct:F,clearAll:L}=H(),N=async()=>{g(!0),j(null);try{const s=await C(`${u}/api/singapore-products`);if(s&&s.ok){const r=await s.json();k(Array.isArray(r)?r:[])}else throw new Error("Failed to load products from server")}catch(s){console.error("Error loading Singapore products:",s),j("Unable to load Singapore products. Please check your connection and try again."),_.error("Failed to load Singapore products")}finally{g(!1)}};l.useEffect(()=>{N()},[u]);const v=l.useMemo(()=>{const s=new Set;return o.forEach(r=>{const i=r.category||r.product_category||"";i&&(Array.isArray(i)?i:String(i).split(/[;,|]/)).forEach(T=>{const w=T.trim();w&&s.add(w)})}),Array.from(s).sort()},[o]),x=l.useMemo(()=>t==="all"?o:o.filter(s=>{const r=s.category||s.product_category||"";return(Array.isArray(r)?r:String(r).split(/[;,|]/).map(n=>n.trim().toLowerCase())).some(n=>n.toLowerCase()===t.toLowerCase())}),[o,t]);return e.jsxs("div",{className:"min-h-screen flex flex-col bg-background text-foreground",children:[e.jsx(z,{}),e.jsx("main",{className:"flex-1 pt-20 pb-20",children:e.jsxs("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8 max-w-6xl",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 py-3 mb-6 border-b border-border/40",children:[e.jsx(q,{label:"Back to AI Search",to:"/ai-search"}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[e.jsx("button",{type:"button",onClick:()=>d("/ai-search"),className:"hover:text-primary transition-colors cursor-pointer",children:"AI Search"}),e.jsx("span",{children:"/"}),e.jsx("span",{className:"text-foreground font-medium",children:"Singapore Products"})]})]}),e.jsxs("div",{className:"relative overflow-hidden rounded-2xl border border-border/80 bg-gradient-to-br from-card via-card/90 to-primary/5 p-6 sm:p-8 mb-8 shadow-sm",children:[e.jsx("div",{className:"absolute top-0 right-0 -mt-8 -mr-8 w-64 h-64 bg-primary/10 rounded-full blur-3xl pointer-events-none"}),e.jsxs("div",{className:"relative z-10 flex flex-col md:flex-row md:items-center justify-between gap-6",children:[e.jsxs("div",{className:"max-w-2xl",children:[e.jsx("div",{className:"inline-flex items-center gap-2 px-3 py-1 rounded-full border border-primary/30 bg-primary/10 text-primary text-xs font-semibold uppercase tracking-wider mb-3",children:e.jsx("span",{children:"Singapore LegalTech Hub"})}),e.jsx("h1",{className:"text-2xl sm:text-3xl lg:text-4xl font-bold tracking-tight text-foreground",children:"Singapore LegalTech Products"}),e.jsx("p",{className:"mt-2 text-sm sm:text-base text-muted-foreground leading-relaxed",children:"Discover verified LegalTech vendors and s
1oftware solutions headquartered or founded in Singapore. Compare features, capabilities, and explore in-depth profiles."})]}),e.jsx("div",{className:"flex md:flex-col items-start md:items-end justify-between md:justify-center gap-2 shrink-0",children:e.jsxs("div",{className:"text-left md:text-right",children:[e.jsx("span",{className:"text-3xl sm:text-4xl font-extrabold text-foreground",children:h?"...":o.length}),e.jsx("p",{className:"text-xs text-muted-foreground font-medium uppercase tracking-wider",children:"Total Products"})]})})]}),v.length>0&&e.jsxs("div",{className:"mt-6 pt-6 border-t border-border/60 flex flex-col sm:flex-row sm:items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-3 w-full sm:w-auto",children:[e.jsxs("label",{className:"text-xs font-medium text-muted-foreground flex items-center gap-1.5 shrink-0",children:[e.jsx(S,{className:"h-3.5 w-3.5 text-primary"})," Filter by Category:"]}),e.jsx("div",{className:"w-full sm:w-72",children:e.jsxs(U,{value:t,onValueChange:s=>m(s),children:[e.jsx(V,{className:"h-9 text-xs bg-background/90 border-border/80 w-full",children:e.jsx($,{placeholder:"All Categories"})}),e.jsxs(D,{className:"max-h-72",children:[e.jsx(y,{value:"all",className:"text-xs font-medium",children:"All Categories"}),v.map(s=>e.jsx(y,{value:s,className:"text-xs",children:s},s))]})]})})]}),t!=="all"&&e.jsxs(c,{variant:"outline",size:"sm",onClick:()=>m("all"),className:"h-8 text-xs gap-1.5 shrink-0 self-start sm:self-auto",children:[e.jsx(p,{className:"h-3 w-3"}),"Reset Filter"]})]})]}),e.jsxs("div",{className:"flex items-center justify-between mb-4 px-1",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsxs("span",{children:["Showing ",e.jsx("strong",{className:"text-foreground",children:x.length})," of"," ",e.jsx("strong",{className:"text-foreground",children:o.length})," products"]}),t!=="all"&&e.jsxs(I,{variant:"outline",className:"text-xs",children:["Category: ",t]})]}),e.jsxs(c,{variant:"outline",size:"sm",onClick:()=>d("/ai-search"),className:"text-xs h-8 gap-1.5 hidden sm:inline-flex",children:[e.jsx(G,{className:"h-3.5 w-3.5 text-primary"}),"Ask AI about these products"]})]}),h?e.jsx("div",{className:"space-y-4",children:[1,2,3,4].map(s=>e.jsxs("div",{className:"rounded-xl border border-border/70 p-5 bg-card space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(a,{className:"h-12 w-12 rounded-lg"}),e.jsxs("div",{className:"space-y-2 flex-1",children:[e.jsx(a,{className:"h-5 w-1/3"}),e.jsx(a,{className:"h-4 w-1/4"})]})]}),e.jsx(a,{className:"h-4 w-full"}),e.jsx(a,{className:"h-4 w-3/4"}),e.jsxs("div",{className:"flex gap-2 pt-2",children:[e.jsx(a,{className:"h-6 w-20 rounded-full"}),e.jsx(a,{className:"h-6 w-24 rounded-full"}),e.jsx(a,{className:"h-6 w-16 rounded-full"})]})]},s))}):f?e.jsxs("div",{className:"rounded-2xl border border-destructive/30 bg-destructive/5 p-8 text-center space-y-4 max-w-md mx-auto my-12",children:[e.jsx(J,{className:"h-10 w-10 text-destructive mx-auto"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("h3",{className:"text-base font-semibold text-foreground",children:"Could not load products"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:f})]}),e.jsxs("div",{className:"flex items-center justify-center gap-3 pt-2",children:[e.jsxs(c,{variant:"outline",size:"sm",onClick:N,children:[e.jsx(p,{className:"h-4 w-4 mr-2"}),"Try Again"]}),e.jsx(c,{size:"sm",onClick:()=>d("/ai-search"),children:"Return to AI Search"})]})]}):x.length===0?e.jsxs("div",{className:"rounded-2xl border border-border/80 bg-card p-12 text-center space-y-4 my-8",children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-muted flex items-center justify-center mx-auto text-muted-foreground",children:e.jsx(S,{className:"h-6 w-6"})}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("h3",{className:"text-lg font-semibold text-foreground",children:"No Singapore products found"}),e.jsx("p",{className:"text-sm text-muted-foreground max-w-md mx-auto",children:t!=="all"?`No products matched the "${t}" category.`:"No Singapore-based LegalTech products were found in the directory."})]}),t!=="all"&&e.jsxs(c,{variant:"outline",size:"sm",onClick:()=>m("all"),className:"mt-2",children:[e.jsx(p,{className:"h-4 w-4 mr-2"}),"Clear Category Filter"]})]}):e.jsx("div",{className:"space-y-4",children:x.map(s=>e.jsx(M,{product:s,query:"singapore",logoPath:A,navState:{from:"/singapore-products"},selectable:!0,compareLabel:"Compare",isCompareSelected:b.some(r=>r.id===(s.product_id||s.id)),onToggleCompare:P},s.product_id||s.id))})]})}),e.jsx(O,{selectedProducts:b,onRemoveProduct:F,onClearAll:L}),e.jsx(R,{})]})}
1export{Pe as default};
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.