PageSourceSearch

https://agda.com.au/wp-content/themes/agda/dist/frontend/assets/template-find-a-designer-DbIPExTe.js

js agda.com.au collected 2026-10-02 03:40:22 UTC 7,108 bytes, 2 lines download raw bytes

1import{l as C,by as R,e as y,j as e,L as P,b1 as B,V as _,W as L,t as I,C as E}from"./entry.client-BF1tJIhu.js";import{R as v}from"./RichSelect-Bpdg6iaB.js";import{D as F}from"./DirectoryHeader-7ahek64K.js";import{L as H}from"./LoadingSensor-BfQ9saTp.js";import{S as D}from"./Transition-BTIyssUe.js";import{C as T}from"./installGutenbergHooks-CakaDxut.js";import{u as U}from"./useSearchParams-eEjfaWaP.js";import{L as V}from"./LoadingResults-BL-vfXql.js";import{N as A}from"./NoResults-B0C5vLHC.js";import{H as G}from"./HR-B6amvMOY.js";import{P as k}from"./ProfileGalleryImage-DcEFkLQL.js";import"./react-icons.esm-BrOTrqLX.js";import"./index-CWWd72kg.js";import"./index-CCDKe8Fw.js";import"./floating-ui.dom-D0RElrgj.js";import"./index-Btu-ytwD.js";import"./Toggle-DAyqQddl.js";import"./ResponsiveImage-CSPuaRWh.js";function $(l){var x,u,h,f,t,p,N;const b=C(),o=(x=l.branches)==null?void 0:x.nodes.sort((a,c)=>{var i;return((i=a.name)==null?void 0:i.localeCompare(c.name))||0}).filter(a=>a.slug!=="national"),d=(u=l.expertiseItems)==null?void 0:u.nodes.sort((a,c)=>{var i;return((i=a.name)==null?void 0:i.localeCompare(c.name))||0}),[s,n]=U({mode:"directory",type:"anyone",branch:"",expertise:"",keywords:""}),r=R({type:s.type,branch:s.branch,expertise:s.expertise,keywords:s.keywords,limit:16}),[m,g]=y.useState(!1);y.useEffect(()=>{(s.type!=="anyone"||s.branch!==""||s.expertise!==""||s.keywords!=="")&&g(!0)},[s.type,s.branch,s.expertise,s.keywords]);const[w,j]=y.useState(!1);return y.useEffect(()=>{if(r.data){const a=setTimeout(()=>{j(!0)},1e3);return()=>clearTimeout(a)}},[r.data]),e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-grid mx-auto pt-6",children:e.jsxs(D,{children:[e.jsx("div",{"data-transition":"fade",children:e.jsx("ul",{className:"stack-x-5 border-b border-none pb-1",children:[{label:"Directory",value:"directory"},{label:"How to choose a designer",value:"how"}].map(a=>e.jsx(P,{href:b.pathname+"?mode="+a.value,className:"cursor-pointer opacity-50 hover:opacity-60 _active:!opacity-100 transition-opacity inline-flex","data-active":s.mode===a.value?"":void 0,children:e.jsx("span",{className:"type-title-l-medium leading-none",children:a.label})},a.value))})}),e.jsx("div",{"data-transition":"children/fade",className:"pt-3 pb-4 sm:py-4",children:e.jsx(G,{})})]},"main")}),e.jsx("div",{className:"grid w-grid h-full mx-auto items-center mb-7",children:e.jsxs(D,{children:[s.mode==="directory"&&e.jsxs("div",{children:[e.jsx(F,{heading:null,tags:e.jsx(e.Fragment,{children:e.jsxs("div",{className:"flex gap-6 md:gap-4 items-center flex-wrap w-full md:w-auto",children:[e.jsxs("div",{className:"flex gap-2 md:gap-4 flex-col w-full md:w-auto md:flex-row md:items-center",children:[e.jsx("p",{className:"type-title-xs-roman",children:"I'm looking for"}),e.jsx(v,{options:[{label:"anyone",value:"anyone"},{label:"a practicing designer",value:"professional"},{label:"an merging designer",value:"student"},{label:"a design business",value:"business"}],className:"w-full md:w-auto",placeholder:"",onChange:n.setter("type"),value:s.type})]}),e.jsxs("div",{className:"flex gap-2 md:gap-4 flex-col w-full md:w-auto md:flex-row md:items-center",children:[e.jsx("p",{className:"type-title-xs-roman",children:"based in"}),e.jsx(v,{options:[{label:"anywhere",value:"none"},...(o==null?void 0:o.map(a=>({label:a.name||"",value:a.slug||""})))||[]],className:"w-full md:w-auto",placeholder:"anywhere",onChange:n.setter("branch"),value:s.branch})]}),e.jsxs("div",{className:"flex gap-2 md:gap-4 flex-col w-full md:w-auto md:flex-row md:items-center",children:[e.jsx("p",{className:"type-title-xs-roman",children:"with skills in"}),e.jsx(v,{options:[{label:"anything",value:"none"},...(d==null?void 0:d.map(a=>({label:a.name||"",value:a.slug||""})))||[]],className:"w-full md:w-auto",placeholder:"anything",onChange:n.setter("expertise"),value:s.expertise})]})]})}),search:e.jsx(B,{onSearch:n.setter("keywords"),placeholder:"Search by name..."}),resultsTotal:(h=r.data)!=null&&h.total&&m?`Results (${(f=r.data)==null?void 0:f.total})`:""}),m&&e.jsxs("div",{className:"mb-8",children:[e.jsx(_,{children:r.isLoading?e.jsx(V,{}):(t=r.data)!=null&&t.nodes.length?r.data.nodes.map((a,c)=>(a==null?void 0:a.__typename)==="User"||(a==null?void 0:a.__typename)==="Business"?e.jsx(S,{item:a},a.databaseId):null):e.jsx(A,{})}),r.hasNextPage&&e.jsx("div",{"data-transition":"fade",children:e.jsx(H,{delay:1e3,loading:r.isFetchingNextPage,onSensed:()=>{var a;return(a=r.fetchNextPage)==null?void 0:a.call(r)}})})]}),!m&&e.jsx("div",{className:"mb-8",children:e.jsx(_,{children:(p=l.random)==null?void 0:p.nodes.map((a,c)=>(a==null?void 0:a.__typename)==="User"||(a==null?void 0:a.__typename)==="Business"?e.jsx(S,{item:a},a.databaseId):null)})})]}),s.mode==="how"&&e.jsx("div",{className:"grid-auto",children:e.jsx("div",{className:"col-span-12 sm:col-start-1 sm:col-span-9 lg:col-start-4 lg:col-span-6 pt-2",children:e.jsx(T,{blocks:(N=l.page)==null?void 0:N.contentBlocks,wrapBlock:(a,c)=>{var i;return(i=c.current.flags)!=null&&i.selfAnimates?a:e.jsx("div",{"data-transition":"fade",children:a})}})})})]},s.mode)})]})}$.displayName="View(template-find-a-designer)";function S({item:l,className:b}){var r,m,g,w,j,x,u,h,f;const o=l.selectedGalleryItems??[];let d="",s="",n=[];
1return l.__typename==="User"?(d=l.firstName+" "+l.lastName,s=l.isStudent?"Emerging Designer":"Professional",n=(m=(r=l.memberData)==null?void 0:r.branch)!=null&&m.shortName?[(w=(g=l.memberData)==null?void 0:g.branch)==null?void 0:w.shortName]:[]):(d=l.title,n=((x=(j=l.businessData)==null?void 0:j.branch)==null?void 0:x.map(t=>t==null?void 0:t.shortName).filter(Boolean))??[],s=((u=l.publicProfileData)==null?void 0:u.title)??"Design Business"),e.jsx(L.div,{"data-transition":"fade",initial:{opacity:0},animate:{opacity:1},children:e.jsxs(P,{href:l.uri,className:I("grid-auto w-full items-start gap-y-6 border-b pb-4 mb-4",b),children:[e.jsxs("div",{className:"flex flex-col gap-2 justify-between items-stretch h-full col-span-8 md:col-span-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"type-title-s-medium",children:`${d}`}),((h=l.publicProfileData)==null?void 0:h.title)&&e.jsx("p",{className:"type-title-s-light whitespace-nowrap truncate",children:(f=l.publicProfileData)==null?void 0:f.title})]}),e.jsxs("div",{className:"flex flex-col md:flex-row md:justify-between md:items-center",children:[e.jsx("p",{className:"type-body-s-roman mt-3",children:s}),e.jsx("span",{className:"-order-2 md:order-1 flex flex-wrap gap-1",children:n.map((t,p)=>e.jsx(E,{variant:"outline",children:t},p))})]})]}),e.jsx("div",{className:"col-span-4 md:col-span-8",children:e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex md:hidden flex-wrap min-h-[100px] overflow-hidden gap-4",children:o.length>0&&e.jsx(k,{item:o[0],className:"w-full"})}),e.jsx("div",{className:"hidden md:flex flex-wrap h-10 overflow-hidden gap-4",children:o.slice(0,10).map((t,p)=>e.jsx(k,{item:t,className:"h-full"},p))})]})})]})},l.databaseId)}export{S as DirectoryResult,$ as default};
2//# sourceMappingURL=template-find-a-designer-DbIPExTe.js.map

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.