1import{j as m,A as Re,m as Se}from"./motion-C7b1aktH.js";import{r as C}from"./vendor-CDaM45aE.js";import{G as $e}from"./StarterSelectionCapture-rdcGgtDO.js";import{u as Pe,a as ze}from"./index-BbrwqEOg.js";import{p as He}from"./projects-CSEw8caP.js";import{P as We}from"./PageMeta-vwUbBb0t.js";const Ke=t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Ve=t=>/^https:\/\/btuckerc\.dev(\/|$)/.test(t),Qe=(t=[])=>{const e=t.filter(s=>s&&s.length>=3).sort((s,r)=>r.length-s.length);return e.length===0?null:{pattern:new RegExp(`(${e.map(Ke).join("|")})`,"ig"),terms:e.map(s=>s.toLowerCase())}},H=({text:t,highlightConfig:e})=>{const s=String(t??"");return!s||!e?s:s.split(e.pattern).map((n,c)=>e.terms.some(o=>n.toLowerCase()===o)?m.jsx("mark",{className:"tui-search-mark",children:n},`${n}-${c}`):m.jsx(C.Fragment,{children:n},`${n}-${c}`))},Ge=({project:t,focusProps:e={},searchMeta:s=null,searchTerms:r=[]})=>{var f;const[n,c]=C.useState(!1),i=C.useMemo(()=>Object.entries(t.links||{}).filter(([,d])=>!!d),[t.links]),o=C.useId(),l=((f=s==null?void 0:s.matchedFields)==null?void 0:f.filter(Boolean))||[],h=C.useMemo(()=>Qe(r),[r]),u=t.overview||t.media||t.stack&&t.stack.length>0||t.features&&t.features.length>0||i.length>0;return m.jsxs("li",{className:`tui-project-row font-mono${n?" is-open":""}`,children:[m.jsxs("button",{type:"button",onClick:()=>u&&c(!n),className:"tui-project-trigger",disabled:!u,"aria-expanded":u?n:void 0,"aria-controls":u?o:void 0,...e,children:[u?m.jsx("span",{className:"tui-disclosure tui-project-mark","aria-hidden":"true"}):m.jsx("span",{className:"tui-project-mark","aria-hidden":"true"}),m.jsxs("span",{className:"tui-project-title",children:[m.jsx(H,{text:t.title,highlightConfig:h}),t.fork&&m.jsx("span",{className:"tui-project-label",children:"fork"}),t.source==="local"&&m.jsx("span",{className:"tui-project-label",children:"local"})]}),t.blurb&&m.jsx("span",{className:"tui-project-blurb",children:m.jsx(H,{text:t.blurb,highlightConfig:h})}),m.jsx("span",{className:"tui-project-year",children:t.year}),l.length>0&&m.jsxs("span",{className:"tui-project-match tui-result-meta",children:[m.jsx("span",{className:"text-accent",children:"match"})," ",l.join(" · ")]})]}),m.jsx(Re,{initial:!1,children:n&&m.jsxs(Se.div,{id:o,initial:{opacity:0,y:-4},animate:{opacity:1,y:0},exit:{opacity:0,y:-3},transition:{duration:.14,ease:[.4,0,.2,1]},className:"tui-project-detail",children:[t.media&&m.jsx($e,{className:`project-capture${t.media.height>t.media.width?" project-capture-portrait":""}`,src:t.media.video,poster:t.media.poster,downloadSrc:null,width:t.media.width,height:t.media.height,label:"preview",title:t.media.title,alt:t.media.alt,caption:t.media.caption,captureNote:null}),m.jsxs("dl",{className:"tui-project-facts",children:[t.overview&&m.jsxs("div",{className:"tui-project-fact",children:[m.jsx("dt",{children:"overview"}),m.jsx("dd",{children:m.jsx(H,{text:t.overview,highlightConfig:h})})]}),t.stack&&t.stack.length>0&&m.jsxs("div",{className:"tui-project-fact",children:[m.jsx("dt",{children:"stack"}),m.jsx("dd",{children:t.stack.map((d,a)=>m.jsxs(C.Fragment,{children:[a>0&&", ",m.jsx(H,{text:d,highlightConfig:h})]},d))})]}),t.features&&t.features.length>0&&m.jsxs("div",{className:"tui-project-fact",children:[m.jsx("dt",{children:"features"}),m.jsx("dd",{children:m.jsx("ul",{className:"tui-project-features",children:t.features.map(d=>m.jsx("li",{children:m.jsx(H,{text:d,highlightConfig:h})},d))})})]}),i.length>0&&m.jsxs("div",{className:"tui-project-fact",children:[m.jsx("dt",{children:"links"}),m.jsx("dd",{className:"tui-project-links",children:i.map(([d,a])=>m.jsx("a",{href:a,...Ve(a)?{}:{target:"_blank",rel:"noopener noreferrer","aria-describedby":"new-tab-note"},className:"tui-link-chip",children:d},d))})]})]})]},"project-content")})]})},Ue=C.memo(Ge,(t,e)=>{var s,r,n,c;return t.project===e.project&&t.searchMeta===e.searchMeta&&t.searchTerms===e.searchTerms&&((s=t.focusProps)==null?void 0:s.tabIndex)===((r=e.focusProps)==null?void 0:r.tabIndex)&&((n=t.focusProps)==null?void 0:n["aria-selected"])===((c=e.focusProps)==null?void 0:c["aria-selected"])});function B(t){return Array.isArray?Array.isArray(t):we(t)==="[object Array]"}function Ye(t){if(typeof t=="string")return t;if(typeof t=="bigint")return t.toString();const e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function q(t){return t==null?"":Ye(t)}function w(t){return typeof t=="string"}function Y(t){return typeof t=="number"}function Ze(t){return t===!0||t===!1||Xe(t)&&we(t)=="[object Boolean]"}function Me(t){return typeof t=="object"}function Xe(t){return Me(t)&&t!==null}function _(t){return t!=null}function U(t){return!t.trim().length}
1function we(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const Je="Incorrect 'index' type",qe=t=>`Invalid value for key ${t}`,et=t=>`Pattern length exceeds max of ${t}.`,tt=t=>`Missing ${t} property in key`,st=t=>`Property 'weight' in key '${t}' must be a positive integer`,pe=Object.prototype.hasOwnProperty;class rt{constructor(e){this._keys=[],this._keyMap={};let s=0;e.forEach(r=>{const n=ke(r);this._keys.push(n),this._keyMap[n.id]=n,s+=n.weight}),this._keys.forEach(r=>{r.weight/=s})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function ke(t){let e=null,s=null,r=null,n=1,c=null;if(w(t)||B(t))r=t,e=xe(t),s=ee(t);else{if(!pe.call(t,"name"))throw new Error(tt("name"));const i=t.name;if(r=i,pe.call(t,"weight")&&(n=t.weight,n<=0))throw new Error(st(i));e=xe(i),s=ee(i),c=t.getFn}return{path:e,id:s,weight:n,src:r,getFn:c}}function xe(t){return B(t)?t:t.split(".")}function ee(t){return B(t)?t.join("."):t}function nt(t,e){const s=[];let r=!1;const n=(c,i,o,l)=>{if(_(c))if(!i[o])s.push(l!==void 0?{v:c,i:l}:c);else{const h=i[o],u=c[h];if(!_(u))return;if(o===i.length-1&&(w(u)||Y(u)||Ze(u)||typeof u=="bigint"))s.push(l!==void 0?{v:q(u),i:l}:q(u));else if(B(u)){r=!0;for(let f=0,d=u.length;f<d;f+=1)n(u[f],i,o+1,f)}else i.length&&n(u,i,o+1,l)}};return n(t,w(e)?e.split("."):e,0),r?s:s[0]}const it={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},ct={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(t,e)=>t.score===e.score?t.idx<e.idx?-1:1:t.score<e.score?-1:1},at={location:0,threshold:.6,distance:100},ot={useExtendedSearch:!1,useTokenSearch:!1,getFn:nt,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},x=Object.freeze({...ct,...it,...at,...ot}),ut=/[^ ]+/g;function lt(t=1,e=3){const s=new Map,r=Math.pow(10,e);return{get(n){const c=n.match(ut).length;if(s.has(c))return s.get(c);const i=1/Math.pow(c,.5*t),o=parseFloat(Math.round(i*r)/r);return s.set(c,o),o},clear(){s.clear()}}}class oe{constructor({getFn:e=x.getFn,fieldNormWeight:s=x.fieldNormWeight}={}){this.norm=lt(s,3),this.getFn=e,this.isCreated=!1,this.docs=[],this.keys=[],this._keysMap={},this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((s,r)=>{this._keysMap[s.id]=r})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,w(this.docs[0])?this.docs.forEach((e,s)=>{this._addString(e,s)}):this.docs.forEach((e,s)=>{this._addObject(e,s)}),this.norm.clear())}add(e){const s=this.size();w(e)?this._addString(e,s):this._addObject(e,s)}removeAt(e){this.records.splice(e,1);for(let s=e,r=this.size();s<r;s+=1)this.records[s].i-=1}removeAll(e){for(let s=e.length-1;s>=0;s-=1)this.records.splice(e[s],1);for(let s=0,r=this.records.length;s<r;s+=1)this.records[s].i=s}
1getValueForItemAtKeyId(e,s){return e[this._keysMap[s]]}size(){return this.records.length}_addString(e,s){if(!_(e)||U(e))return;const r={v:e,i:s,n:this.norm.get(e)};this.records.push(r)}_addObject(e,s){const r={i:s,$:{}};this.keys.forEach((n,c)=>{const i=n.getFn?n.getFn(e):this.getFn(e,n.path);if(_(i)){if(B(i)){const o=[];for(let l=0,h=i.length;l<h;l+=1){const u=i[l];if(_(u)){if(w(u)){if(!U(u)){const f={v:u,i:l,n:this.norm.get(u)};o.push(f)}}else if(_(u.v)){const f=w(u.v)?u.v:q(u.v);if(!U(f)){const d={v:f,i:u.i,n:this.norm.get(f)};o.push(d)}}}}r.$[c]=o}else if(w(i)&&!U(i)){const o={v:i,n:this.norm.get(i)};r.$[c]=o}}}),this.records.push(r)}toJSON(){return{keys:this.keys.map(({getFn:e,...s})=>s),records:this.records}}}function _e(t,e,{getFn:s=x.getFn,fieldNormWeight:r=x.fieldNormWeight}={}){const n=new oe({getFn:s,fieldNormWeight:r});return n.setKeys(t.map(ke)),n.setSources(e),n.create(),n}function ht(t,{getFn:e=x.getFn,fieldNormWeight:s=x.fieldNormWeight}={}){const{keys:r,records:n}=t,c=new oe({getFn:e,fieldNormWeight:s});return c.setKeys(r),c.setIndexRecords(n),c}function dt(t=[],e=x.minMatchCharLength){const s=[];let r=-1,n=-1,c=0;for(let i=t.length;c<i;c+=1){const o=t[c];o&&r===-1?r=c:!o&&r!==-1&&(n=c-1,n-r+1>=e&&s.push([r,n]),r=-1)}return t[c-1]&&c-r>=e&&s.push([r,c-1]),s}const L=32;function ft(t,e,s,{location:r=x.location,distance:n=x.distance,threshold:c=x.threshold,findAllMatches:i=x.findAllMatches,minMatchCharLength:o=x.minMatchCharLength,includeMatches:l=x.includeMatches,ignoreLocation:h=x.ignoreLocation}={}){if(e.length>L)throw new Error(et(L));const u=e.length,f=t.length,d=Math.max(0,Math.min(r,f));let a=c,g=d;const p=(k,D)=>{const F=k/u;if(h)return F;const z=Math.abs(d-D);return n?F+z/n:z?1:F},b=o>1||l,y=b?Array(f):[];let M;for(;(M=t.indexOf(e,g))>-1;){const k=p(0,M);if(a=Math.min(k,a),g=M+u,b){let D=0;for(;D<u;)y[M+D]=1,D+=1}}g=-1;let v=[],A=1,E=u+f;const I=1<<u-1;for(let k=0;k<u;k+=1){let D=0,F=E;for(;D<F;)p(k,d+F)<=a?D=F:E=F,F=Math.floor((E-D)/2+D);E=F;let z=Math.max(1,d-F+1);const J=i?f:Math.min(d+F,f)+u,R=Array(J+2);R[J+1]=(1<<k)-1;for(let j=J;j>=z;j-=1){const G=j-1,ge=s[t[G]];if(b&&(y[G]=+!!ge),R[j]=(R[j+1]<<1|1)&ge,k&&(R[j]|=(v[j+1]|v[j])<<1|1|v[j+1]),R[j]&I&&(A=p(k,G),A<=a)){if(a=A,g=G,g<=d)break;z=Math.max(1,2*d-g)}}if(p(k+1,d)>a)break;v=R}const P={isMatch:g>=0,score:Math.max(.001,A)};if(b){const k=dt(y,o);k.length?l&&(P.indices=k):P.isMatch=!1}return P}function mt(t){const e={};for(let s=0,r=t.length;s<r;s+=1){const n=t.charAt(s);e[n]=(e[n]||0)|1<<r-s-1}return e}function ue(t){if(t.length<=1)return t;t.sort((s,r)=>s[0]-r[0]||s[1]-r[1]);const e=[t[0]];for(let s=1,r=t.length;s<r;s+=1){const n=e[e.length-1],c=t[s];c[0]<=n[1]+1?n[1]=Math.max(n[1],c[1]):e.push(c)}return e}const ve={Å:"l",Å:"L",Ä:"d",Ä:"D",ø:"o",Ã:"O",ħ:"h",Ħ:"H",ŧ:"t",Ŧ:"T",ı:"i",Ã:"ss"},gt=new RegExp("["+Object.keys(ve).join("")+"]","g"),V=String.prototype.normalize?t=>t.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D
17F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"").replace(gt,e=>ve[e]):t=>t;class le{constructor(e,{location:s=x.location,threshold:r=x.threshold,distance:n=x.distance,includeMatches:c=x.includeMatches,findAllMatches:i=x.findAllMatches,minMatchCharLength:o=x.minMatchCharLength,isCaseSensitive:l=x.isCaseSensitive,ignoreDiacritics:h=x.ignoreDiacritics,ignoreLocation:u=x.ignoreLocation}={}){if(this.options={location:s,threshold:r,distance:n,includeMatches:c,findAllMatches:i,minMatchCharLength:o,isCaseSensitive:l,ignoreDiacritics:h,ignoreLocation:u},e=l?e:e.toLowerCase(),e=h?V(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const f=(a,g)=>{this.chunks.push({pattern:a,alphabet:mt(a),startIndex:g})},d=this.pattern.length;if(d>L){let a=0;const g=d%L,p=d-g;for(;a<p;)f(this.pattern.substr(a,L),a),a+=L;if(g){const b=d-L;f(this.pattern.substr(b),b)}}else f(this.pattern,0)}searchIn(e){const{isCaseSensitive:s,ignoreDiacritics:r,includeMatches:n}=this.options;if(e=s?e:e.toLowerCase(),e=r?V(e):e,this.pattern===e){const p={isMatch:!0,score:0};return n&&(p.indices=[[0,e.length-1]]),p}const{location:c,distance:i,threshold:o,findAllMatches:l,minMatchCharLength:h,ignoreLocation:u}=this.options,f=[];let d=0,a=!1;this.chunks.forEach(({pattern:p,alphabet:b,startIndex:y})=>{const{isMatch:M,score:v,indices:A}=ft(e,p,b,{location:c+y,distance:i,threshold:o,findAllMatches:l,minMatchCharLength:h,includeMatches:n,ignoreLocation:u});M&&(a=!0),d+=v,M&&A&&f.push(...A)});const g={isMatch:a,score:a?d/this.chunks.length:1};return a&&n&&(g.indices=ue(f)),g}}class N{constructor(e){this.pattern=e}static isMultiMatch(e){return Ae(e,this.multiRegex)}static isSingleMatch(e){return Ae(e,this.singleRegex)}search(e){return{isMatch:!1,score:1}}}function Ae(t,e){const s=t.match(e);return s?s[1]:null}class pt extends N{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const s=e===this.pattern;return{isMatch:s,score:s?0:1,indices:[0,this.pattern.length-1]}}}class xt extends N{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const r=e.indexOf(this.pattern)===-1;return{isMatch:r,score:r?0:1,indices:[0,e.length-1]}}}class At extends N{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const s=e.startsWith(this.pattern);return{isMatch:s,score:s?0:1,indices:[0,this.pattern.length-1]}}}class bt extends N{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const s=!e.startsWith(this.pattern);return{isMatch:s,score:s?0:1,indices:[0,e.length-1]}}}class yt extends N{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const s=e.endsWith(this.pattern);return{isMatch:s,score:s?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}class Et extends N{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const s=!e.endsWith(this.pattern);return{isMatch:s,score:s?0:1,indices:[0,e.length-1]}}}class Fe extends N{constructor(e,{location:s=x.location,threshold:r=x.threshold,distance:n=x.distance,includeMatches:c=x.includeMatches,findAllMatches:i=x.findAllMatches,minMatchCharLength:o=x.minMatchCharLength,isCaseSensitive:l=x.isCaseSensitive,ignoreDiacritics:
1h=x.ignoreDiacritics,ignoreLocation:u=x.ignoreLocation}={}){super(e),this._bitapSearch=new le(e,{location:s,threshold:r,distance:n,includeMatches:c,findAllMatches:i,minMatchCharLength:o,isCaseSensitive:l,ignoreDiacritics:h,ignoreLocation:u})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class je extends N{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let s=0,r;const n=[],c=this.pattern.length;for(;(r=e.indexOf(this.pattern,s))>-1;)s=r+c,n.push([r,s-1]);const i=!!n.length;return{isMatch:i,score:i?0:1,indices:n}}}const te=[pt,je,At,bt,Et,yt,xt,Fe],be=te.length,Ct="\0",St="|";function Mt(t){const e=[],s=t.length;let r=0;for(;r<s;){for(;r<s&&t[r]===" ";)r++;if(r>=s)break;let n=r;for(;n<s&&t[n]!==" "&&t[n]!=='"';)n++;if(n<s&&t[n]==='"'){for(n++;n<s;){if(t[n]==='"'){const c=n+1;if(c>=s||t[c]===" "){n++;break}if(t[c]==="$"&&(c+1>=s||t[c+1]===" ")){n+=2;break}}n++}e.push(t.substring(r,n)),r=n}else{for(;n<s&&t[n]!==" ";)n++;e.push(t.substring(r,n)),r=n}}return e}function wt(t,e={}){return t.replace(/\\\|/g,Ct).split(St).map(r=>{const n=r.replace(/\u0000/g,"|"),c=Mt(n.trim()).filter(o=>o&&!!o.trim()),i=[];for(let o=0,l=c.length;o<l;o+=1){const h=c[o];let u=!1,f=-1;for(;!u&&++f<be;){const d=te[f],a=d.isMultiMatch(h);a&&(i.push(new d(a,e)),u=!0)}if(!u)for(f=-1;++f<be;){const d=te[f],a=d.isSingleMatch(h);if(a){i.push(new d(a,e));break}}}return i})}const kt=new Set([Fe.type,je.type]);class _t{constructor(e,{isCaseSensitive:s=x.isCaseSensitive,ignoreDiacritics:r=x.ignoreDiacritics,includeMatches:n=x.includeMatches,minMatchCharLength:c=x.minMatchCharLength,ignoreLocation:i=x.ignoreLocation,findAllMatches:o=x.findAllMatches,location:l=x.location,threshold:h=x.threshold,distance:u=x.distance}={}){this.query=null,this.options={isCaseSensitive:s,ignoreDiacritics:r,includeMatches:n,minMatchCharLength:c,findAllMatches:o,ignoreLocation:i,location:l,threshold:h,distance:u},e=s?e:e.toLowerCase(),e=r?V(e):e,this.pattern=e,this.query=wt(this.pattern,this.options)}static condition(e,s){return s.useExtendedSearch}searchIn(e){const s=this.query;if(!s)return{isMatch:!1,score:1};const{includeMatches:r,isCaseSensitive:n,ignoreDiacritics:c}=this.options;e=n?e:e.toLowerCase(),e=c?V(e):e;let i=0;const o=[];let l=0,h=!1;for(let u=0,f=s.length;u<f;u+=1){const d=s[u];o.length=0,i=0,h=!1;for(let a=0,g=d.length;a<g;a+=1){const p=d[a],{isMatch:b,indices:y,score:M}=p.search(e);if(b){i+=1,l+=M;const v=p.constructor.type;v.startsWith("inverse")&&(h=!0),r&&(kt.has(v)?o.push(...y):o.push(y))}else{l=0,i=0,o.length=0,h=!1;break}}if(i){const a={isMatch:!0,score:l/i};return h&&(a.hasInverse=!0),r&&(a.indices=ue(o)),a}}return{isMatch:!1,score:1}}}const se=[];function he(...t){se.push(...t)}function Z(t,e){for(let s=0,r=se.length;s<r;s+=1){const n=se[s];if(n.condition(t,e))return new n(t,e)}return new le(t,e)}const X={AND:"$and",OR:"$or"},re={PATH:"$path",PATTERN:"$val"},ne=t=>!!(t[X.AND]||t[X.OR]),vt=t=>!!t[re.PATH],Ft=t=>!B(t)&&Me(t)&&!ne(t),ye=t=>({[X.AND]:Object.keys(t).map(e=>({[e]:t[e]}))});function De(t,e,{auto:s=!0}={}){const r=n=>{if(w(n)){const l={keyId:null,pattern:n};return s&&(l.searcher=Z(n,e)),l}const c=Object.keys(n),i=vt(n);if(!i&&c.length>1&&!ne(n))return r(ye(n));if(Ft(n)){const l=i?n[re.PATH]:c[0],h=i?n[re.PATTERN]:n[l];if(!w(h))throw new Error(qe(l));const u={keyId:ee(l),pattern:h};return s&&(u.searcher=Z(h,e)),u}const o={children:[],operator:c[0]};return c.forEach(l=>{const h=n[l];B(h)&&h.forEach(u=>
1{o.children.push(r(u))})}),o};return ne(t)||(t=ye(t)),r(t)}function ie(t,{ignoreFieldNorm:e=x.ignoreFieldNorm}){let s=1;return t.forEach(({key:r,norm:n,score:c})=>{const i=r?r.weight:null;s*=Math.pow(c===0&&i?Number.EPSILON:c,(i||1)*(e?1:n))}),s}function jt(t,{ignoreFieldNorm:e=x.ignoreFieldNorm}){t.forEach(s=>{s.score=ie(s.matches,{ignoreFieldNorm:e})})}class Dt{constructor(e){this.limit=e,this.heap=[]}get size(){return this.heap.length}shouldInsert(e){return this.size<this.limit||e<this.heap[0].score}insert(e){this.size<this.limit?(this.heap.push(e),this._bubbleUp(this.size-1)):e.score<this.heap[0].score&&(this.heap[0]=e,this._sinkDown(0))}extractSorted(e){return this.heap.sort(e)}_bubbleUp(e){const s=this.heap;for(;e>0;){const r=e-1>>1;if(s[e].score<=s[r].score)break;const n=s[e];s[e]=s[r],s[r]=n,e=r}}_sinkDown(e){const s=this.heap,r=s.length;let n=e;do{e=n;const c=2*e+1,i=2*e+2;if(c<r&&s[c].score>s[n].score&&(n=c),i<r&&s[i].score>s[n].score&&(n=i),n!==e){const o=s[e];s[e]=s[n],s[n]=o}}while(n!==e)}}function It(t,e){const s=t.matches;e.matches=[],_(s)&&s.forEach(r=>{if(!_(r.indices)||!r.indices.length)return;const{indices:n,value:c}=r,i={indices:n,value:c};r.key&&(i.key=r.key.src),r.idx>-1&&(i.refIndex=r.idx),e.matches.push(i)})}function Bt(t,e){e.score=t.score}function Nt(t,e,{includeMatches:s=x.includeMatches,includeScore:r=x.includeScore}={}){const n=[];return s&&n.push(It),r&&n.push(Bt),t.map(c=>{const{idx:i}=c,o={item:e[i],refIndex:i};return n.length&&n.forEach(l=>{l(c,o)}),o})}const Tt=/\b\w+\b/g;function ce({isCaseSensitive:t=!1,ignoreDiacritics:e=!1}={}){return{tokenize(s){return t||(s=s.toLowerCase()),e&&(s=V(s)),s.match(Tt)||[]}}}function Lt(t,e,s){const r=new Map,n=new Map;let c=0;function i(o,l,h,u){const f=s.tokenize(o);if(!f.length)return;c++;const d=new Map;for(const a of f)d.set(a,(d.get(a)||0)+1);for(const[a,g]of d){const p={docIdx:l,keyIdx:h,subIdx:u,tf:g};let b=r.get(a);b||(b=[],r.set(a,b)),b.push(p),n.set(a,(n.get(a)||0)+1)}}for(const o of t){const{i:l,v:h,$:u}=o;
1if(h!==void 0){i(h,l,-1,-1);continue}if(u)for(let f=0;f<e;f++){const d=u[f];if(d)if(Array.isArray(d))for(const a of d)i(a.v,l,f,a.i??-1);else i(d.v,l,f,-1)}}return{terms:r,fieldCount:c,df:n}}function Ot(t,e,s,r){const{i:n,v:c,$:i}=e;function o(l,h,u){const f=r.tokenize(l);if(!f.length)return;t.fieldCount++;const d=new Map;for(const a of f)d.set(a,(d.get(a)||0)+1);for(const[a,g]of d){const p={docIdx:n,keyIdx:h,subIdx:u,tf:g};let b=t.terms.get(a);b||(b=[],t.terms.set(a,b)),b.push(p),t.df.set(a,(t.df.get(a)||0)+1)}}if(c!==void 0){o(c,-1,-1);return}if(i)for(let l=0;l<s;l++){const h=i[l];if(h)if(Array.isArray(h))for(const u of h)o(u.v,l,u.i??-1);else o(h.v,l,-1)}}function Ee(t,e){for(const[s,r]of t.terms){const n=r.filter(i=>i.docIdx!==e),c=r.length-n.length;c>0&&(t.fieldCount-=c,t.df.set(s,(t.df.get(s)||0)-c),n.length===0?(t.terms.delete(s),t.df.delete(s)):t.terms.set(s,n))}}class T{constructor(e,s,r){this.options={...x,...s},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new rt(this.options.keys),this._docs=e,this._myIndex=null,this._invertedIndex=null,this.setCollection(e,r),this._lastQuery=null,this._lastSearcher=null}_getSearcher(e){if(this._lastQuery===e)return this._lastSearcher;const s=this._invertedIndex?{...this.options,_invertedIndex:this._invertedIndex}:this.options,r=Z(e,s);return this._lastQuery=e,this._lastSearcher=r,r}setCollection(e,s){if(this._docs=e,s&&!(s instanceof oe))throw new Error(Je);if(this._myIndex=s||_e(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){const r=ce({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics});this._invertedIndex=Lt(this._myIndex.records,this._myIndex.keys.length,r)}}add(e){if(_(e)&&(this._docs.push(e),this._myIndex.add(e),this._invertedIndex)){const s=this._myIndex.records[this._myIndex.records.length-1],r=ce({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics});Ot(this._invertedIndex,s,this._myIndex.keys.length,r)}}remove(e=()=>!1){const s=[],r=[];for(let n=0,c=this._docs.length;n<c;n+=1)e(this._docs[n],n)&&(s.push(this._docs[n]),r.push(n));if(r.length){if(this._invertedIndex)for(const n of r)Ee(this._invertedIndex,n);for(let n=r.length-1;n>=0;n-=1)this._docs.splice(r[n],1);this._myIndex.removeAll(r)}return s}removeAt(e){this._invertedIndex&&Ee(this._invertedIndex,e);const s=this._docs.splice(e,1)[0];return this._myIndex.removeAt(e),s}getIndex(){return this._myIndex}search(e,s){const{limit:r=-1}=s||{},{includeMatches:n,includeScore:c,shouldSort:i,sortFn:o,ignoreFieldNorm:l}=this.options;if(w(e)&&!e.trim()){let f=this._docs.map((d,a)=>({item:d,refIndex:a}));return Y(r)&&r>-1&&(f=f.slice(0,r)),f}const h=Y(r)&&r>0&&w(e);let u;if(h){const f=new Dt(r);w(this._docs[0])?this._searchStringList(e,{heap:f,ignoreFieldNorm:l}):this._searchObjectList(e,{heap:f,ignoreFieldNorm:l}),u=f.extractSorted(o)}else u=w(e)?w(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),jt(u,{ignoreFieldNorm:l}),i&&u.sort(o),Y(r)&&r>-1&&(u=u.slice(0,r));return Nt(u,this._docs,{includeMatches:n,includeScore:c})}_searchStringList(e,{heap:s,ignoreFieldNorm:r}={}){const n=this._getSearcher(e),{records:c}=this._myIndex,i=s?null:[];return c.forEach(({v:o,i:l,n:h})=>{if(!_(o))return;const{isMatch:u,score:f,indices:d}=n.searchIn(o);if(u){const a={item:o,idx:l,matches:[{score:f,value:o,norm:h,indices:d}]};s?(a.score=ie(a.matches,{ignoreFieldNorm:r}),s.shouldInsert(a.score)&&s.insert(a)):i.push(a)}}),i}_searchLogical(e){const s=De(e,this.options),r=(o,l,h)=>{if(!("children"in o)){const{keyId:a,searcher:g}=o;let p;return a===null?(p=[],this._myIndex.keys.forEach((b,y)=>{p.push(...this._findMatches({key:b,value:l[y],searcher:g}))})):p=this._findMatches({key:this._keyStore.get(a),value:this._myIndex.getValueForItemAtKeyId(l,a),searcher:g}),p&&p.length?[{idx:h,item:l,matches:p}]:[]}const{children:u,operator:f}=o,d=[];for(let a=0,g=u.length;a<g;a+=1){const p=u[a],b=r(p,l,h);if(b.length)d.push(...b);else if(f===X.AND)return[]}return d},n=this._myIndex.records,c=new Map,i=[];
1return n.forEach(({$:o,i:l})=>{if(_(o)){const h=r(s,o,l);h.length&&(c.has(l)||(c.set(l,{idx:l,item:o,matches:[]}),i.push(c.get(l))),h.forEach(({matches:u})=>{c.get(l).matches.push(...u)}))}}),i}_searchObjectList(e,{heap:s,ignoreFieldNorm:r}={}){const n=this._getSearcher(e),{keys:c,records:i}=this._myIndex,o=s?null:[];return i.forEach(({$:l,i:h})=>{if(!_(l))return;const u=[];let f=!1,d=!1;if(c.forEach((a,g)=>{const p=this._findMatches({key:a,value:l[g],searcher:n});p.length?(u.push(...p),p[0].hasInverse&&(d=!0)):f=!0}),!(d&&f)&&u.length){const a={idx:h,item:l,matches:u};s?(a.score=ie(a.matches,{ignoreFieldNorm:r}),s.shouldInsert(a.score)&&s.insert(a)):o.push(a)}}),o}_findMatches({key:e,value:s,searcher:r}){if(!_(s))return[];const n=[];if(B(s))s.forEach(({v:c,i,n:o})=>{if(!_(c))return;const{isMatch:l,score:h,indices:u,hasInverse:f}=r.searchIn(c);l&&n.push({score:h,key:e,value:c,idx:i,norm:o,indices:u,hasInverse:f})});else{const{v:c,n:i}=s,{isMatch:o,score:l,indices:h,hasInverse:u}=r.searchIn(c);o&&n.push({score:l,key:e,value:c,norm:i,indices:h,hasInverse:u})}return n}}class Rt{static condition(e,s){return s.useTokenSearch}constructor(e,s){this.options=s,this.analyzer=ce({isCaseSensitive:s.isCaseSensitive,ignoreDiacritics:s.ignoreDiacritics});const r=this.analyzer.tokenize(e),n=s._invertedIndex,{df:c,fieldCount:i}=n;this.termSearchers=[],this.idfWeights=[];for(const o of r){this.termSearchers.push(new le(o,{location:s.location,threshold:s.threshold,distance:s.distance,includeMatches:s.includeMatches,findAllMatches:s.findAllMatches,minMatchCharLength:s.minMatchCharLength,isCaseSensitive:s.isCaseSensitive,ignoreDiacritics:s.ignoreDiacritics,ignoreLocation:!0}));const l=c.get(o)||0,h=Math.log(1+(i-l+.5)/(l+.5));this.idfWeights.push(h)}}searchIn(e){if(!this.termSearchers.length)return{isMatch:!1,score:1};const s=[];let r=0,n=0,c=0;for(let l=0;l<this.termSearchers.length;l++){const h=this.termSearchers[l].searchIn(e),u=this.idfWeights[l];n+=u,h.isMatch&&(c++,r+=u*(1-h.score),h.indices&&s.push(...h.indices))}if(c===0)return{isMatch:!1,score:1};const i=n>0?1-r/n:0,o={isMatch:!0,score:Math.max(.001,i)};return this.options.includeMatches&&s.length&&(o.indices=ue(s)),o}}T.version="7.3.0";T.createIndex=_e;T.parseIndex=ht;T.config=x;T.match=function(t,e,s){return Z(t,{...x,...s}).searchIn(e)};T.parseQuery=De;he(_t);he(Rt);T.use=function(...t){t.forEach(e=>he(e))};const de=new Set(["ai","ml","ui","ux"]),Ie=new Set(["a","an","and","app","for","in","of","on","or","the","to","with"]),Q=[{key:"title",label:"title",weight:.32},{key:"aliases",label:"aliases",weight:.24},{key:"tags",label:"tags",weight:.18},{key:"stack",label:"stack",weight:.14},{key:"blurb",label:"summary",weight:.1},{key:"source",label:"source",weight:.08},{key:"overview",label:"overview",weight:.05},{key:"features",label:"features",weight:.04}],$t=new Set(["title","aliases","tags","stack","blurb"]),Be=[["ai","agent","model","assistant"],["dotfiles","chezmoi","mise","bootstrap","dev environment"],["ios","iphone","swift","mobile"],["vision","computer vision","image","scanner"],["music","spotify","playlist","audio"],["github","public","repo","repository"],["rss","feed","news","summarizer"],["terminal","cli","shell","console"]],Pt=[{pattern:/comic.*scanner/,aliases:["comic scanner","barcode scanning","comic catalog"]},{pattern:/trivrdy|jeopardy|trivia/,aliases:["trivia","quiz","jeopardy practice","study platform"]},{pattern:/boilerplate|dotfiles|chezmoi/,aliases:["dotfiles","workspace setup","dev environment"]},{pattern:/audio|audiobook/,aliases:["audiobook","audio reader","captions"]},{pattern:/spotify|playlist|music/,aliases:["spotify","playlist ordering","music analysis"]},{pattern:/center.*seat/,aliases:["movie seats","movie theater","showtimes"]}],Ne=["movie seats","swift ios","dotfiles","playlist ordering","computer vision","audiobook","github public"],zt=42,Ht=5,Wt=64,Kt=24,S=(t="")=>(Array.isArray(t)?t.join(" "):String(t??"")).replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/&/g," and ").replace(/['â]/g,"").replace(/[^a-zA-Z0-9#+.]+/g," ").replace(/\s+/g," ").trim().toLowerCase(),O=(t="")=>S(t).replace(/[^a-z0-9]+/g,""),Vt={includeScore:!0,includeMatches:!1,shouldSort:!0,threshold:.36,ignoreLocation:!0,findAllMatches:!1,minMatchCharLength:2,keys:Q.filter(t=>$t.has(t.key)).map(t=>({name:`search.${t.key}`,weight:t.weight}))},Qt=Be.reduce((t,e)=>(e.forEach(s=>{const r=S(s);t.set(r,e.map(S).filter(n=>n&&n!==r))}),t),new Map),fe=t=>Array.from(new Set(t.filter(Boolean))),me=(t="")=>fe(S(t).split(" ").map(e=>e.trim()).filter(e=>e&&(e.length>1||de.has(e))).filter(e=>!Ie.has(e))),Gt=t=>fe(t.flatMap(e=>[e,...Qt.get(e)||[]])),Te=(t,e)=>!t||!e?!1:t.includes(` ${e} `),ae=(t,e,s)=>(t.set(e,s),t.size>Wt&&t.delete(t.keys().next().value),s),Ut=t=>{const e=t.year?`${t.year}-01-01`:"1970-01-01",s=new Date(t.date||t.dateModified||e).getTime();return Number.isFinite(s)?s:0},W=(t,e)=>{const s=S(e);if(!s)return;t.add(s);const r=O(s);r&&r!==s&&t.add(r)},Yt=t=>{var n;const e=new Set,s=[t.id,t.title,t.source,t.activity,t.visibility,t.blurb,...t.tags||[],...t.stack||[]],r=S(s.join(" "));return W(e,(n=t.id)==null?void 0:n.replace(/[-_]/g," ")),W(e,t.title),s.forEac
1h(c=>W(e,c)),Be.forEach(c=>{c.some(i=>r.includes(S(i)))&&c.forEach(i=>W(e,i))}),Pt.forEach(c=>{c.pattern.test(r)&&c.aliases.forEach(i=>W(e,i))}),Array.from(e)},Zt=t=>{const e=Yt(t),s={title:S(t.title),aliases:e.join(" "),tags:S(t.tags||[]),stack:S(t.stack||[]),blurb:S(t.blurb),source:S([t.source,t.activity,t.visibility]),overview:S(t.overview),features:S(t.features||[])},r=Q.reduce((c,i)=>(c[i.key]=O(s[i.key]||""),c),{}),n=Q.reduce((c,i)=>(c[i.key]=` ${s[i.key]||""} `,c),{});return{project:t,aliases:e,search:s,searchCompact:r,searchBounded:n,dateValue:Ut(t)}},Xt=t=>{const e=t.map(Zt);return{records:e,fuse:new T(e,Vt),searchCache:new Map,suggestionCache:new Map,suggestionPhrases:Oe(e)}},Le=t=>({project:t.project,dateValue:t.dateValue,score:0,fuzzyScore:0,exactScore:0,matchedFields:new Set,matchedOriginalTerms:new Set,matchedExpandedTerms:new Set}),Ce=(t,e,s,r=[],n=[],c=[])=>{if(s<=0)return;const i=e.project.id,o=t.get(i)||Le(e);o.score+=s,r.forEach(l=>o.matchedFields.add(l)),n.forEach(l=>o.matchedExpandedTerms.add(l)),c.forEach(l=>o.matchedOriginalTerms.add(l)),t.set(i,o)},Jt=(t="")=>{var s;const e=t.replace(/^search\./,"");return((s=Q.find(r=>r.key===e))==null?void 0:s.label)||e},qt=(t,e)=>{const{normalizedQuery:s,compactQuery:r,originalTerms:n,expandedTermMeta:c}=e,i=Le(t);return Q.forEach(o=>{const l=t.search[o.key]||"",h=t.searchCompact[o.key]||"",u=t.searchBounded[o.key]||"";let f=0;s.length>=2&&l.includes(s)&&(f+=o.weight*28,i.matchedFields.add(o.label),n.forEach(d=>{l.includes(d)&&i.matchedOriginalTerms.add(d)})),r.length>=3&&h.includes(r)&&(f+=o.weight*20,i.matchedFields.add(o.label),n.forEach(d=>{h.includes(O(d))&&i.matchedOriginalTerms.add(d)})),c.forEach(({term:d,compactTerm:a,isOriginalTerm:g})=>{const p=g?1:.42;Te(u,d)?(f+=o.weight*10*p,i.matchedFields.add(o.label),i.matchedExpandedTerms.add(d),g&&i.matchedOriginalTerms.add(d)):d.length>=3&&l.includes(d)?(f+=o.weight*5.5*p,i.matchedFields.add(o.label),i.matchedExpandedTerms.add(d),g&&i.matchedOriginalTerms.add(d)):a.length>=4&&h.includes(a)&&(f+=o.weight*4.5*p,i.matchedFields.add(o.label),i.matchedExpandedTerms.add(d),g&&i.matchedOriginalTerms.add(d))}),i.score+=f,i.exactScore+=f}),i},es=(t,e)=>{const s=S(e),r=t.searchCache.get(s);if(r)return r;const n=me(s);if(!s||n.length===0)return ae(t.searchCache,s,t.records.map(a=>({project:a.project,score:0,searchMeta:null})));const c=Gt(n),i=new Set(n),o=O(s),l=c.map(a=>({term:a,compactTerm:O(a),isOriginalTerm:i.has(a)})),h=fe([s,...n]).filter(a=>a.length>1||de.has(a)),u=new Map;h.forEach(a=>{const g=a===s,p=n.includes(a),b=g?9:p?5:2.1;t.fuse.search(a,{limit:Kt}
1).forEach(y=>{const M=Math.max(0,1-(y.score??1)),v=(y.matches||[]).map(P=>Jt(P.key)),A=M*b,E=p?[a]:[];Ce(u,y.item,A,v,[a],E);const I=u.get(y.item.project.id);I&&(I.fuzzyScore+=A)})}),t.records.forEach(a=>{const g=qt(a,{normalizedQuery:s,compactQuery:o,originalTerms:n,expandedTermMeta:l});Ce(u,a,g.score,Array.from(g.matchedFields),Array.from(g.matchedExpandedTerms),Array.from(g.matchedOriginalTerms));const p=u.get(a.project.id);p&&(p.exactScore+=g.exactScore)});const f=n.length<=2?n.length:Math.ceil(n.length*.75),d=Array.from(u.values()).map(a=>{const p=a.matchedOriginalTerms.size/n.length,b=(a.project.featured||0)*.06,y=a.dateValue/1e14,M=a.score+p*10+b+y;return{project:a.project,dateValue:a.dateValue,score:M,searchMeta:{matchedFields:Array.from(a.matchedFields).slice(0,4),matchedTerms:Array.from(a.matchedOriginalTerms),expandedTerms:Array.from(a.matchedExpandedTerms),coverage:p,exactScore:a.exactScore,fuzzyScore:a.fuzzyScore}}}).filter(a=>{const g=a.searchMeta.matchedTerms.length,p=a.searchMeta.exactScore,b=a.searchMeta.fuzzyScore;return n.length===1?p>0||b>=2.2:g>=f&&p>=2||g>=f&&b>=5&&a.score>=14}).sort((a,g)=>{if(g.score!==a.score)return g.score-a.score;const p=(g.project.featured||0)-(a.project.featured||0);return p!==0?p:g.dateValue-a.dateValue});return ae(t.searchCache,s,d)},K=(t,e,s=1)=>{const r=S(e);if(!r||Ie.has(r)||r.length<3&&!de.has(r)||!r.includes(" ")&&r.length>22||r.length>zt||r.split(" ").length>Ht)return;const n=t.get(r);t.set(r,{label:r,score:((n==null?void 0:n.score)||0)+s})};function Oe(t){const e=new Map;return Ne.forEach(s=>{K(e,s,8)}),t.forEach(s=>{K(e,s.project.title,(s.project.featured||0)/2),(s.project.tags||[]).forEach(r=>K(e,r,3)),(s.project.stack||[]).forEach(r=>K(e,r,2)),s.aliases.forEach(r=>K(e,r,1.4))}),Array.from(e.values()).map(s=>({...s,normalizedLabel:s.label,compactLabel:O(s.label),boundedLabel:` ${s.label} `}))}const ts=(t,e="",s=8)=>{var l;const r=S(e),n=me(r),c=O(r),i=`${r||"__default__"}:${s}`;if((l=t.suggestionCache)!=null&&l.has(i))return t.suggestionCache.get(i);const o=(t.suggestionPhrases||Oe(t.records)).map(h=>{const u=h.normalizedLabel,f=h.compactLabel;let d=h.score,a=!1;return r?(u.startsWith(r)&&(d+=18,a=!0),u.includes(r)&&(d+=10,a=!0),c&&f.includes(c)&&(d+=8,a=!0),n.forEach(g=>{Te(h.boundedLabel,g)?(d+=7,a=!0):u.includes(g)&&(d+=4,a=!0)}),{...h,matchesQuery:a,score:d}):{...h,score:d}}).filter(h=>r?h.matchesQuery&&h.score>4:Ne.includes(h.label)).sort((h,u)=>u.score-h.score||h.label.localeCompare(u.label)).slice(0,s);return ae(t.suggestionCache,i,o)},ss=(t="")=>me(t).filter(e=>e.length>=3),rs=[{id:"featured",label:"featured"},{id:"recent",label:"recent"},{id:"oldest",label:"oldest"}],ns=Xt(He),$=(t,e="12-31")=>t.date||`${t.year}-${e}`,is=(t,e)=>[...t].sort((s,r)=>{const n=s.project,c=r.project;switch(e){case"featured":{const i=(c.featured||0)-(n.featured||0);return i!==0?i:new Date($(c))-new Date($(n))}case"recent":return new Date($(c))-new Date($(n));case"oldest":return new Date($(n,"01-01"))-new Date($(c,"01-01"));default:return 0}}),fs=()=>{const[t,e]=C.useState(""),[s,r]=C.useState("featured"),n=C.useRef(null),c=Pe(),i=C.useDeferredValue(t),o=i.trim().length>0,l=ns;C.useEffect(()=>{var A;(A=c.state)!=null&&A.focusSearch&&window.requestAnimationFrame(()=>{var E,I;(E=n.current)==null||E.focus(),(I=n.current)==null||I.select()})},[c.state]);const h=C.useMemo(()=>es(l,i),[i,l]),u=C.useMemo(()=>o?h:is(h,s),[h,o,s]),f=C.useMemo(()=>ts(l,i,o?6:8),[i,o,l]),d=C.useMemo(()=>ss(i),[i]),a=C.useMemo(()=>u.map(({project:A})=>({id:A.id,...A})),[u]),{getItemProps:g}=ze("projects-list",a),p=A=>{e(A),window.requestAnimationFrame(()=>{var E;(E=n.current)==null||E.focus()})},b=()=>{e(""),window.requestAnimationFrame(()=>{var A;(A=n.current)==null||A.focus()})},y=A=>{var E;A.key==="Escape"&&(A.stopPropagation(),t?e(""):(E=n.current)==null||E.blur())},M=o?`${u.length} result${u.length===1?"":"s"} for "${i}"`:`${u.length} project${u.length===1?"":"s"}`,v=A=>m.jsx("button",{type:"button",onClick:()=>r(A.id),"aria-pressed":s===A.id,className:`tui-filter-option${s===A.id?" tui-filter-option-active":""}`,children:A.label},A.id);return m.jsxs(m.Fragment,{children:[m.jsx(We,{title:"Projects â Tucker Craig",description:"Things Tucker Craig has built, big and small: Inkjoin, Pace Bar, Herdwick, Dictation, CenterSeat, and more.",url:"https://btuckerc.dev/projects",image:"https://btuckerc.dev/og/projects.jpg",imageAlt:"Tucker Craig, projects: Inkjoin, Pace Bar, Herdwick, Dictation, CenterSeat, and more."}),m.jsx("div",{className:"projects-page tui-page-shell min-h-svh pb-28 px-4",children:m.jsxs("div",{className:"container mx-auto max-w-6xl",children:[m.jsx("div",{className:"tui-page-header mb-6",children:m.jsxs("h1",{className:"tui-page-title text-center text-xl font-bold text-fg font-mono",children:[m.jsx("span",{className:"text-accent",children:"["})," projects ",m.jsx("span",{className:"text-accent",children:"]"})]})}),m.jsxs("search",{className:"tui-control-panel mb-4 block border border-line bg-card-bg p-3 font-mono","aria-label":"Projects",children:[m.jsxs("div",{className:"tui-search-field",children:[m.jsx("label",{htmlFor:"project-search",className:"sr-only",children:"Find projects"}),m.jsx("span",{className:"tui-search-prefix","aria-hidden":"true",children:"/"}),m.jsx("input",{ref:n,id:"project-search",type:"text",role:"searchbox",inputMode:"search",enterKeyHint:"search",value:t,onChange:A=>e(A.target.value),onKeyDown:y,placeholder:"macos, menu bar, python, agentsâ¦","data-search-input":!0,"aria-describedby":"projects-results-summary",autoComplete:"off",spellCheck:"true",className:"tui-input tui-search-input h-10 w-full border border-line py-2 text-sm text-fg focus:border-accent focus:outline-none"}),t&&m.jsx("button",{type:"button",onClick:b,className:"tui-clear-button tui-search-clear text-muted","aria-label":"Clear project search",children:m.jsx("span",{"aria-hidden":"true",className:"tui-search-clear-glyph",children:"x"})})]}),m.jsxs("div",{className:"tui-filter-bar mt-2 text-xs text-muted",children:[m.jsx("span",{id:"projects-results-summary",className:"tui-result-count","aria-live":"polite","aria-atomic":"true",children:M}),!o&&m.jsxs("div",{className:"tui-sort-group",role:"group","aria-label":"Sort projects",children:[m.jsx("span",{className:"tui-refine-label","aria-hidden":"true",children:"sort"}),rs.map(v)]})]}),o&&f.length>0&&m.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-xs",children:[m.jsx("span",{className:"text-muted",children:"related:"}),f.map(A=>m.jsx("button",{type:"button",onClick:()=>p(A.label),className:"tui-chip border border-line/80 px-2 py-0.5 text-muted hover:text-fg",children:m.jsx("span",{children:A.label})},A.label))]})]}),u.length>0?m.jsx("ul",{className:"tui-project-list mb-10","aria-label":"Projects",children:u.map(({project:A,searchMeta:E},I)=>m.jsx(Ue,{project:A,searchMeta:E,searchTerms:d,focusProps:g(A,I)},A.id))}):m.jsx(Se.div,{initial:{opacity:0}
1,animate:{opacity:1},transition:{duration:.12},className:"tui-panel border border-line bg-card-bg px-5 py-10 text-center mb-12 font-mono",children:m.jsxs("div",{className:"text-muted",children:[m.jsxs("div",{className:"text-sm",children:['No projects found for "',i,'".']}),m.jsx("div",{className:"mt-2 text-xs",children:"Try fewer words or a different stack."}),t&&m.jsx("div",{className:"mt-5 flex justify-center",children:m.jsx("button",{type:"button",onClick:b,className:"tui-link-chip",children:"clear search"})})]})}),(!o||u.length>0)&&m.jsx("div",{className:"border-t border-line pt-6",children:m.jsx("div",{className:"text-xs font-mono text-muted",children:m.jsxs("div",{className:"mb-2",children:[m.jsx("span",{className:"text-accent",children:"â¸"})," more public work on ",m.jsx("a",{href:"https://github.com/btuckerc",target:"_blank",rel:"noopener noreferrer","aria-describedby":"new-tab-note",className:"text-accent hover:text-fg transition-colors",children:"github"})]})})})]})})]})};export{fs 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.