PageSourceSearch

https://www.locize.com/assets/entries/pages_blog_index.Dr3RPwjD.js

js locize.com collected 2026-09-25 18:46:27 UTC 7,813 bytes, 1 lines download raw bytes

1import{E as e,T as t}from"../chunks/chunk-ClQpuiDQ.js";import{C as n,E as r,T as i,c as a,n as o,t as s}from"../chunks/chunk-B8-tRes9.js";import{i as c,r as l}from"../chunks/chunk-DOUT0IPv.js";import{t as u}from"../chunks/chunk-xowZR1RF.js";import{t as d}from"../chunks/chunk-DnLOkfeq.js";import{t as f}from"../chunks/chunk-DjF0vTT6.js";import{t as p}from"../chunks/chunk-G_R8sG3e.js";var m=t({default:()=>C}),h=e(c(),1),g=l(),_=9;function v(e){let t=String(e||``).trim();if(!t)return``;let n=new Date(`${t}T00:00:00Z`);return Number.isNaN(n.getTime())?t:new Intl.DateTimeFormat(`en-US`,{year:`numeric`,month:`long`,day:`numeric`}).format(n)}function y(e){return String(e||``).trim()}function b(){if(typeof window>`u`)return new URLSearchParams;try{return new URLSearchParams(window.location.search)}catch{return new URLSearchParams}}function x({category:e,q:t}){let n=new URLSearchParams;e&&e!==`all`&&n.set(`category`,e),t&&t.trim()&&n.set(`q`,t.trim());let r=n.toString();return r?`/blog?${r}`:`/blog`}function S(e){if(typeof window<`u`)try{window.history.replaceState({},``,e)}catch{d(e)}}function C(){let{posts:e}=u(),[t,n]=(0,h.useState)(1),[r,i]=(0,h.useState)(()=>y(b().get(`category`))||`all`),[o,s]=(0,h.useState)(()=>{let e=b();return String(e.get(`q`)||``)});(0,h.useEffect)(()=>{if(typeof window>`u`)return;let e=()=>{let e=b(),t=y(e.get(`category`))||`all`,r=String(e.get(`q`)||``);i(t),s(r),n(1)};return window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]);let c=(0,h.useMemo)(()=>{let t=new Set(e.map(e=>e.category).filter(Boolean));return[`all`,...Array.from(t).sort((e,t)=>String(e).localeCompare(String(t)))]},[e]),l=(0,h.useMemo)(()=>
1{let t=o.trim();return t?e.map(e=>({p:e,score:f({title:e.title,href:`/blog/${e.slug}`,description:e.description,category:e.category,searchText:e.searchText},t)})).filter(e=>e.score>0).sort((e,t)=>t.score===e.score?(e.p.title||``).localeCompare(t.p.title||``):t.score-e.score).map(e=>e.p):e},[e,o]),p=(0,h.useMemo)(()=>r===`all`?l:l.filter(e=>e.category===r),[l,r]),m=Math.max(1,Math.ceil(p.length/_)),C=Math.min(t,m),T=(C-1)*_,E=p.slice(T,T+_),D=e=>{let t=y(e)||`all`;i(t),n(1),d(x({category:t,q:o}))},O=e=>{s(e),n(1),S(x({category:r,q:e}))};return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(`div`,{className:`max-w-3xl`,children:[(0,g.jsx)(`h1`,{className:`text-4xl md:text-5xl leading-[1.05] tracking-tight`,children:`Blog`}),(0,g.jsx)(`p`,{className:`mt-3 text-base-content/70`,children:`Product updates, guides, and customer stories.`})]}),(0,g.jsxs)(`div`,{className:`mt-8 max-w-xl`,children:[(0,g.jsx)(`label`,{className:`text-sm font-medium mb-1 block`,htmlFor:`blog-search`,children:`Search`}),(0,g.jsx)(`input`,{id:`blog-search`,type:`search`,value:o,onChange:e=>O(e.target.value),placeholder:`Search posts…`,className:`input input-bordered w-full`})]}),(0,g.jsx)(`div`,{className:`mt-5 flex flex-wrap gap-2`,children:c.map(e=>{let t=r===e,n=e===`all`?l.length:l.filter(t=>t.category===e).length;return(0,g.jsxs)(`button`,{type:`button`,onClick:()=>D(e),className:`btn btn-sm no-underline `+(t?`brand-btn`:`btn-ghost border border-base-200`),children:[e===`all`?`ALL`:String(e).toUpperCase(),(0,g.jsxs)(`span`,{className:`ml-1 text-gray-500`,children:[`(`,n,`)`]})]},e)})}),(0,g.jsxs)(`div`,{className:`mt-8 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8`,children:[E.map(e=>(0,g.jsxs)(a,{href:`/blog/${e.slug}`,"aria-label":e.title,className:`brand-card brand-card-hover flex flex-col h-full p-0 overflow-hidden no-underline group focus:outline-none focus:ring-2 focus:ring-[var(--brand-primary)]`,tabIndex:0,style:{position:`relative`},children:[(0,g.jsxs)(`div`,{style:{width:`100%`,height:`192px`,position:`relative`},children:[(0,g.jsx)(`img`,{src:e.thumbnail||e.image||`/img/blog/blog-default.png`,alt:e.title,style:{display:`block`,width:`100%`,height:`100%`,objectFit:`cover`,borderTopLeftRadius:`inherit`,borderTopRightRadius:`inherit`},loading:`lazy`}),!!e.category&&(0,g.jsx)(`span`,{className:`blog-badge blog-badge-right`,style:{position:`absolute`,top:0,right:0,zIndex:10,margin:0},children:e.category})]}),(0,g.jsxs)(`div`,{className:`flex flex-col flex-1 p-6`,children:[(0,g.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight mb-2 group-hover:underline`,children:e.title}),!!e.description&&(0,g.jsx)(`p`,{className:`text-sm text-base-content/70 mb-4 leading-relaxed line-clamp-3`,children:e.description}),(0,g.jsxs)(`div`,{className:`mt-auto flex flex-wrap items-center gap-2 text-xs text-base-content/60`,children:[!!e.date&&(0,g.jsx)(`span`,{children:v(e.date)}),!!e.readTime&&(0,g.jsxs)(`span`,{children:[`• `,e.readTime]})]})]})]},e.slug)),p.length===0&&(0,g.jsx)(`div`,{className:`text-sm text-base-content/60`,children:`No matches.`})]}),p.length>0&&m>1&&(0,g.jsx)(w,{currentPage:C,totalPages:m,onPageChange:n})]})}function w({currentPage:e,totalPages:t,onPageChange:n}){let r=Array.from({length:t},(e,t)=>t+1);return(0,g.jsxs)(`div`,{className:`mt-10 flex items-center gap-3`,children:[(0,g.jsx)(`button`,{type:`button`,className:`btn btn-sm btn-ghost border border-base-200 disabled:opacity-50`,onClick:()=>n(Math.max(1,e-1)),disabled:e===1,children:`← Previous`}),(0,g.jsx)(`div`,{className:`flex items-center gap-1 flex-wrap`,children:r.map(t=>(0,g.jsx)(`button`,{type:`button`,className:`btn btn-sm w-10 h-10 px-0 `+(t===e?`brand-btn`:`btn-ghost border border-base-200`),onClick:()=>n(t),children:t},t))}),(0,g.jsx)(`button`,{type:`button`,className:`btn btn-sm btn-ghost border border-base-200 disabled:opacity-50`,onClick:()=>n(Math.min(t,e+1)),disabled:e===t,children:`Next →`})]})}var T={hasServerOnlyHook:{type:`computed`,definedAtData:null,valueSerialized:{type:`js-serialized`,value:!0}},isClientRuntimeLoaded:{type:`computed`,definedAtData:null,valueSerialized:{type:`js-serialized`,value:!0}},onBeforeRenderEnv:{type:`computed`,definedAtData:null,valueSerialized:{type:`js-serialized`,value:null}},dataEnv:{type:`computed`,definedAtData:null,valueSerialized:{type:`js-serialized`,value:{server:!0}}},guardEnv:{type:`computed`,definedAtData:null,valueSerialized:{type:`js-serialized`,value:null}},onRenderClient:{type:`standard`,definedAtData:{filePathToShowToUser:`vike-react/__internal/integration/onRenderClient`,fileExportPathToShowToUser:[]},valueSerialized:{type:`pointer-import`,value:r}},onPageTransitionStart:{type:`standard`,definedAtData:{filePathToShowToUser:`/pages/+onPageTransitionStart.js`,fileExportPathToShowToUser:[]},valueSerialized:{type:`plus-file`,exportValues:i}},onPageTransitionEnd:{type:`standard`,definedAtData:{filePathToShowToUser:`/pages/+onPageTransitionEnd.js`,fileExportPathToShowToUser:[]},valueSerialized:{type:`plus-file`,exportValues:n}},Page:{type:`standard`,definedAtData:{filePathToShowToUser:`/pages/blog/index/+Page.jsx`,fileExportPathToShowToUser:[]},valueSerialized:{type:`plus-file`,exportValues:m}},hydrationCanBeAborted:{type:`standard`,definedAtData:{filePathToShowToUser:`vike-react/config`,fileExportPathToShowToUser:[`default`,`hydrationCanBeAborted`]},valueSerialized:{type:`js-serialized`,value:!0}},Layout:{type:`cumulative`,definedAtData:[{filePathToShowToUser:`/pages/blog/+Layout.jsx`,fileExportPathToShowToUser:[]},{filePathToShowToUser:`/pages/+Layout.jsx`,fileExportPathToShowToUser:[]}],valueSerialized:[{type:`plus-file`,exportValues:p},{type:`plus-file`,exportValues:o}]},title:{type:`standard`,definedAtData:{filePathToShowToUser:`/pages/blog/index/+config.js`,fileExportPathToShowToUser:[`default`,`title`]},valueSerialized:{type:`js-serialized`,value:`Blog - Locize`}},Loading:{type:`standard`,definedAtData:{filePathToShowToUser:`vike-react/__internal/integration/Loading`,fileExportPathToShowToUser:[]},valueSerialized:{type:`pointer-import`,value:s}}};export{T as configValuesSerialized};

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.