PageSourceSearch

https://www.artconnect.com/_next/static/chunks/1126-35dd6ed94c7f70e6.js

js artconnect.com collected 2026-09-25 02:57:17 UTC 25,347 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1126],{6438:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(92068).A)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},11126:(e,t,l)=>{l.d(t,{default:()=>eC});var r=l(93278),i=l(9894),n=l(49211);let a=e=>{let t=e?new Date(e).valueOf():NaN;return Number.isNaN(t)?null:t},o=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now();return 2===((e,t)=>{let l=a(e.deadline);if(null!==l)return 2*(l<t);let r=a(e.postLifetime);return null!==r&&r<t?2:1})(e,t)};var s=l(89691),c=l(36237);let d=e=>(0,r.Y)(n.$,{variant:"ghost",size:"sm",onClick:e.onClick,children:"Clear filters"});var u=l(13448),p=l(41987);let m=e=>(0,r.FD)("div",{className:"flex flex-1 flex-col gap-3 pb-4 lg:pb-0",children:[e.title,e.children]});var h=l(19593),f=l(25267);let y=e=>{let{showTitle:t=!1,roomy:l=!1,visible:i,setVisible:a}=e,{artisticFields:o,pushQuery:s,currentQuery:c}=(0,f.rw)(),d=(null==o?void 0:o.split(","))||[void 0],[y,v]=(0,p.useState)(d),[g,b]=(0,p.useState)("");(0,p.useEffect)(()=>{if(null==c?void 0:c.artisticFields){var e;v(null==c||null==(e=c.artisticFields)?void 0:e.split(","))}},[c]),(0,p.useEffect)(()=>{var e;o!=((null==y||null==(e=y.join(","))?void 0:e.length)?null==y?void 0:y.join(","):void 0)&&(null==s||s({artisticFields:null==y?void 0:y.join(","),page:"1"}))},[y]);let x=(0,p.useMemo)(()=>(e=>Object.keys(e).sort().reduce((t,l)=>(t[l]=e[l],t),{}))(u.ArtisticFields),[]),Y=(0,p.useMemo)(()=>{let e=g.trim().toLowerCase();return e?Object.fromEntries(Object.entries(x).filter(t=>{let[,l]=t;return l.toLowerCase().includes(e)})):x},[x,g]);return l?(0,r.FD)("div",{className:"flex flex-col",children:[(0,r.Y)("input",{className:"w-full border-b bg-transparent px-4 py-3 text-[15px] outline-none placeholder:text-muted-foreground",onChange:e=>b(e.target.value),placeholder:"Search artistic field...",value:g}),(0,r.Y)("div",{className:"max-h-[60vh] overflow-y-auto lg:max-h-80",children:Object.keys(Y).length?(0,r.Y)(h.A,{motionKey:"artistic-field",multiSelect:!0,roomy:!0,values:Y,selectedValues:y,setValues:v}):(0,r.FD)("p",{className:"px-4 py-4 text-sm text-muted-foreground",children:["No artistic field matches “",g,"”."]})})]}):(0,r.FD)(m,{title:t?"Artistic field":"",children:[(0,r.Y)(h.A,{motionKey:"artistic-field",values:x,multiSelect:!0,mosaic:!0,selectedValues:y,setValues:v,className:"group/mosaic"}),(0,r.FD)("div",{className:"mt-3 hidden flex-1 justify-between gap-4 lg:flex",children:[(0,r.Y)(n.$,{onClick:()=>v([""]),className:"flex-1 py-2",variant:"outline",children:"Clear"}),(0,r.Y)(n.$,{onClick:()=>{null==a||a(!i)},className:"flex-1 py-2",children:"Apply"})]})]})},v=e=>{let{showTitle:t=!1}=e,{fees:l,pushQuery:i,currentQuery:n}=(0,f.rw)(),[a,o]=(0,p.useState)((null==l?void 0:l.length)?[l]:void 0);return(0,p.useEffect)(()=>{let e=null==a?void 0:a.join(",");(null==n?void 0:n.fees)!=e&&(null==i||i({fees:e,page:"1"}))},[a]),(0,p.useEffect)(()=>{if(null==n?void 0:n.fees){var e;o(null==n||null==(e=n.fees)?void 0:e.split(","))}},[n]),(0,r.Y)(m,{title:t?"Fees":"",children:(0,r.Y)(h.A,{values:f.LC,selectedValues:a,setValues:o})})};var g=l(51718),b=l(26806);let x=e=>{let{showTitle:t=!1,roomy:l=!1}=e,{rewards:i,pushQuery:n,currentQuery:a}=(0,f.rw)(),o=null==i?void 0:i.trim().split(","),[s,c]=(0,p.useState)(o||[void 0]);return(0,p.useEffect)(()=>{let e=null==s?void 0:s.join(",");(null==a?void 0:a.rewards)!==((null==e?void 0:e.length)?e:void 0)&&(null==n||n({rewards:null==s?void 0:s.join(","),page:"1"}))},[s]),(0,p.useEffect)(()=>{if(null==a?void 0:a.rewards){var e;c(null==a||null==(e=a.rewards)?void 0:e.split(","))}},[a]),(0,r.Y)(m,{title:t?"Rewards":"",children:(0,r.Y)(h.A,{multiSelect:!0,values:g.D,iconMap:b.A,roomy:l,selectedValues:s,setValues:c})})},Y=e=>{let{showTitle:t=!1,roomy:l=!1}=e,{pushQuery:i,currentQuery:n}=(0,f.rw)(),[a,o]=(0,p.useState)([null==n?void 0:n.sortBy]);return(0,p.useEffect)(()=>{let e=null==a?void 0:a.join(",");(null==n?void 0:n.sortBy)!==e&&(null==i||i({sortBy:e}))},[a]),(0,r.Y)(m,{title:t?"Sort By":"",children:(0,r.Y)(h.A,{values:C,roomy:l,selectedValues:a,setValues:o})})};var w=l(10286);let N=e=>{let{showTitle:t=!1,roomy:l=!1}=e,{types:i,pushQuery:n,currentQuery:a}=(0,f.rw)(),o=null==i?void 0:i.trim().split(","),[s,c]=(0,p.useState)(o);(0,p.useEffect)(()=>{let e=null==s?void 0:s.join(",");(null==a?void 0:a.types)!==e&&(null==n||n({types:e,page:"1"}))},[s]),(0,p.useEffect)(()=>{(null==a?void 0:a.types)&&c(null==a?void 0:a.types.split(","))},[a]);let d=(0,p.useMemo)(()=>Object.fromEntries(Object.keys(u.OpportunityTypesPlural).map(e=>[e,(0,r.Y)("span",{className:"block size-3.5 rounded",style:{backgroundColor:w.w[e]}},e)])),[]);return(0,r.Y)(m,{title:t?"Types":"",children:(0,r.Y)(h.A,{values:u.OpportunityTypesPlural,multiSelect:!0,iconMap:l?d:void 0,roomy:l,selectedValues:s,setValues:c})})};var k=function(e){return e[e.sortBy=0]="sortBy",e[e.artisticFields=1]="artisticFields",e[e.types=2]="types",e[e.rewards=3]="rewards",e[e.fees=4]="fees",e[e.location=5]="location",e}({});let S={4:"Fees",1:"Artistic field",2:"Type",3:"Reward",5:null,0:"Sort by"},F={4:()=>(0,r.Y)(v,{}),1:()=>(0,r.Y)(y,{roomy:!0}),2:()=>(0,r.Y)(N,{roomy:!0}),3:()=>(0,r.Y)(x,{roomy:!0}),0:()=>(0,r.Y)(Y,{roomy:!0}),5:null},C={relevance:"Recommended","-deadline":"Deadline soonest",createdAt:"Newest opportunities"},D="-deadline",A=e=>{var t;return null!=(t=C[e])?t:C[D]};var E=l(39109),O=l(1459),j=l(32536),R=l(27541);let T=["Photography open calls with no application fee","Art residencies in Spain with accommodation and a stipend","Painting grants for emerging artists","Sculpture exhibitions in Berlin this autumn","Curatorial jobs at museums in Europe"],I="relevance",P=()=>{let e=(0,R.useSearchParams)(),{pushQuery:t}=(0,f.rw)(),[l,i]=(0,p.useState)(""),[a,o]=(0,p.useState)(0);(0,p.useEffect)(()=>{var t;i(null!=(t=null==e?void 0:e.get("search"))?t:"")},[e]),(0,p.useEffect)(()=>
1{if(l)return;let e=setInterval(()=>o(e=>(e+1)%T.length),3500);return()=>clearInterval(e)},[l]);let s=()=>{let r=l.trim();null==t||t({search:r||void 0,page:"1",sortBy:((e,t)=>e?t&&t!==D?t:I:t===I?void 0:null!=t?t:void 0)(r,null==e?void 0:e.get("sortBy"))})};return(0,r.FD)("div",{className:"w-full",children:[(0,r.FD)("div",{className:"flex h-12 w-full items-center gap-3 rounded-[7px] border border-input bg-background pl-3 pr-[5px] shadow-sm transition-colors focus-within:border-primary lg:h-16 lg:px-4",children:[(0,r.Y)(j.default,{alt:"","aria-hidden":!0,className:"size-5 shrink-0",height:48,src:"/search-icon.png",width:48}),(0,r.FD)("div",{className:"relative flex h-full flex-1 items-center",children:[(0,r.Y)("input",{"aria-label":"Search opportunities",className:"h-full w-full bg-transparent text-base outline-none focus:outline-none",onChange:e=>i(e.target.value),onKeyDown:e=>{"Enter"===e.key&&s()},value:l}),!l&&(0,r.Y)(E.N,{mode:"wait",children:(0,r.Y)(O.P.span,{animate:{opacity:1},"aria-hidden":!0,className:"pointer-events-none absolute inset-0 flex items-center truncate text-base text-muted-foreground",exit:{opacity:0},initial:{opacity:0}
1,transition:{duration:.35},children:T[a]},a)})]}),(0,r.Y)(n.$,{"aria-label":"Search",className:"size-9 shrink-0 rounded-[7px] p-0 lg:hidden",onClick:s,variant:"outline",children:(0,r.Y)("span",{"aria-hidden":!0,children:"→"})}),(0,r.FD)(n.$,{className:"hidden h-10 shrink-0 rounded-[7px] border-gray-400 px-5 font-normal lg:inline-flex",onClick:s,variant:"outline",children:["Search ",(0,r.Y)("span",{"aria-hidden":!0,children:"→"})]})]}),(0,r.Y)("p",{className:"mt-2 ml-1 hidden text-xs text-muted-foreground lg:block",children:"Describe what you're looking for and we'll find the best matches."})]})};var B=l(58429);let z=e=>{let{counts:t,large:l}=e,[i,n]=(0,p.useState)(!1);return(0,r.Y)(B.A,{pill:!0,large:l||!1,label:"Artistic field",classNameChildren:"w-80",count:null==t?void 0:t[k.artisticFields],visible:i,setVisible:n,children:(0,r.Y)(y,{roomy:!0,visible:i,setVisible:n})})};var _=l(72902);let L="border-ac-green bg-ac-green text-white",M={label:"Free to apply",param:"noApplicationFee",value:"true",activeClassName:L},U={label:"No fees",param:"fees",value:"FREE",activeClassName:L},K={label:"Rolling deadline",param:"rollingDeadline",value:"true"},$=[M,U,K],J=e=>{let{param:t,value:l}=e,r=(0,R.useSearchParams)(),{pushQuery:i}=(0,f.rw)(),n=(null==r?void 0:r.get(t))===l;return{active:n,toggle:()=>null==i?void 0:i({[t]:n?void 0:l,page:"1"})}},q=e=>{var t;let{active:l,toggle:i}=J(e);return(0,r.Y)("button",{"aria-pressed":l,className:(0,_.A)("flex h-10 shrink-0 items-center rounded-[7px] border px-4 text-xs font-normal shadow-sm transition-colors md:text-sm",l?null!=(t=e.activeClassName)?t:"border-primary bg-primary text-primary-foreground":"bg-transparent"),onClick:i,type:"button",children:e.label})},Q=()=>(0,r.Y)(q,{...M}),V=()=>(0,r.Y)(q,{...U}),W=()=>(0,r.Y)(q,{...K}),Z=e=>{var t;return(0,r.Y)(B.A,{pill:!0,count:null==(t=e.counts)?void 0:t[k.rewards],classNameChildren:"w-60",label:"Reward",children:(0,r.Y)(x,{immediatelyApply:!0,roomy:!0})})},G=e=>{var t;return(0,r.Y)(B.A,{pill:!0,count:null==(t=e.counts)?void 0:t[k.types],classNameChildren:"w-72",label:"Type",children:(0,r.Y)(N,{immediatelyApply:!0,roomy:!0})})},H=e=>(0,r.FD)("div",{className:"flex flex-1 flex-wrap items-center gap-2",children:[(0,r.Y)(G,{counts:e.counts}),(0,r.Y)(z,{counts:e.counts}),(0,r.Y)(Z,{counts:e.counts}),(0,r.Y)(Q,{}),(0,r.Y)(V,{}),(0,r.Y)(W,{})]});var X=l(23414),ee=l(73254),et=l(6438),el=l(54850),er=l(14486);let ei="flex h-12 w-full items-center justify-between rounded-[7px] border bg-background px-4 text-sm font-medium",en=e=>{let t=(0,R.usePathname)(),{currentQuery:l}=(0,f.rw)();return(0,r.FD)(E.N,{children:[e.title&&(0,r.Y)("div",{className:"font-medium",children:e.title},1),(0,r.Y)(O.P.div,{initial:"offscreen",whileInView:"onscreen",viewport:{once:!0,amount:.8},className:"space-y-3",children:e.content.map(i=>{if(null===S[i])return null;let n=i===k.sortBy,a=n?A((null==l?void 0:l.sortBy)||((t||"").includes("dashboard")?"createdAt":D)):S[i],o=null==l?void 0:l[k[i]],s=!n&&o?o.split(",").length:0;return(0,r.FD)("button",{className:ei,onClick:()=>{var t;e.setSideBar(!0),null==(t=e.setContentType)||t.call(e,i)},type:"button",children:[(0,r.FD)("span",{className:"flex",children:[a,s>0&&(0,r.Y)(el.A,{count:s})]}),(0,r.Y)(er.A,{className:"size-5"})]},i)})},2)]})},ea=e=>{let{active:t,toggle:l}=J(e);return(0,r.FD)("button",{"aria-pressed":t,className:ei,onClick:l,type:"button",children:[e.label,(0,r.Y)("span",{"aria-hidden":!0,className:(0,_.A)("flex size-[18px] items-center justify-center rounded-[3px] border border-primary",t&&"bg-primary text-primary-foreground"),children:t&&(0,r.Y)(et.A,{className:"size-3.5",strokeWidth:3})})]})},eo=e=>{let{sideBar:t,setSideBar:l,setContentType:i,setShow:a,totalResults:o}=e,s={sideBar:t,setSideBar:l,setContentType:i};return(0,r.Y)(E.N,{children:!t&&(0,r.FD)(O.P.div,{layout:!0,initial:{opacity:0,x:0,scale:.8},exit:{opacity:0,scale:.8},transition:{type:"spring",bounce:.2,duration:.8},animate:{opacity:1,x:0,scale:1},className:"flex flex-1 flex-col",children:[(0,r.FD)("div",{className:"scrollbar-hide mb-4 space-y-3 pt-4",children:[(0,r.Y)(en,{title:"Sort by",content:[k.sortBy],...s}),(0,r.Y)(en,{title:"Filter by",content:[k.artisticFields,k.types,k.rewards],...s}),$.map(e=>(0,r.Y)(ea,{...e},e.param))]}),(0,r.Y)("div",{className:"mt-auto pb-4",children:(0,r.FD)(n.$,{className:"h-11 w-full rounded-[7px]",onClick:()=>a(!1),children:["See opportunities",void 0!==o&&" (".concat(o.toLocaleStr
1ing("en-US"),")")]})})]})})};var es=l(73373);let ec=e=>{var t;let{show:l,setShow:i,totalResults:n}=e,[a,o]=p.useState(!1),[s,c]=(0,p.useState)(k.sortBy),d=(0,r.FD)("div",{className:"flex w-full flex-col gap-3",children:[(0,r.Y)("h2",{className:"font-medium",children:S[s]}),null==(t=F[s])?void 0:t.call(F)]});return(0,r.FD)(X.default,{full:!0,header:(0,r.Y)(ee.A,{show:l,setShow:i,sideBar:a,setSideBar:o}),children:[(0,r.Y)(eo,{sideBar:a,setSideBar:o,setContentType:c,contentType:s,show:l,setShow:i,totalResults:n}),(0,r.Y)(es.A,{sideBar:a,setSideBar:o,activeContent:d})]})},ed=(0,l(92068).A)("sliders-horizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);var eu=l(21281),ep=l(88934),em=l(86405);let eh=e=>{let{totalResults:t}=e,[l,i]=(0,p.useState)(!1),{limitReached:n}=(0,em.v)(),{isSignedIn:a}=(0,ep.xc)(),o=(0,p.useMemo)(()=>!(!a||n),[a,n]);return(0,p.useEffect)(()=>(document.body.style.overflow=l?"hidden":"",()=>{document.body.style.overflow=""}),[l]),(0,r.FD)(r.FK,{children:[(0,r.Y)(eu.c,{promptId:"opportunity_filters_drawer",disabled:o,requiredSubscription:c.SubscriptionTypes.ARTIST_OPPORTUNITIES,children:(0,r.Y)("button",{"aria-label":"Filters",className:"flex size-12 shrink-0 items-center justify-center rounded-[7px] border border-input bg-background shadow-sm lg:hidden",onClick:()=>i(!0),type:"button",children:(0,r.Y)(ed,{className:"size-5"})})}),(0,r.Y)(E.N,{children:l&&(0,r.Y)(O.P.div,{initial:"hidden",animate:"enter",exit:"exit",transition:{type:"linear",default:{duration:.2}},variants:{hidden:{opacity:0,y:50},enter:{opacity:1,y:0},exit:{opacity:0,y:50}},className:"fixed bottom-0 z-10",children:(0,r.Y)(ec,{setShow:i,show:l,totalResults:t})},"MODAL")})]})};var ef=l(72634),ey=l(72116);let ev={hidden:{opacity:0,y:-50,x:0},enter:{opacity:1,y:0,x:0},exit:{opacity:0,y:-50,x:0}},eg=()=>{let e=(0,R.usePathname)(),t=(0,R.useSearchParams)(),{currentQuery:l}=(0,f.rw)(),{ref:i,isComponentVisible:n,setIsComponentVisible:a}=(0,ef.A)(!1),[o,s]=(0,p.useState)(A((null==l?void 0:l.sortBy)||((e||"").includes("dashboard")?"createdAt":"-deadline")));return(0,p.useEffect)(()=>{n&&(null==t?void 0:t.get("sortBy"))&&a(!n)},[null==t?void 0:t.get("sortBy")]),(0,p.useEffect)(()=>{(null==t?void 0:t.get("sortBy"))&&s(A(t.get("sortBy")))},[t]),(0,r.Y)("div",{className:"relative",children:(0,r.FD)("div",{ref:i,className:"flex flex-1",children:[(0,r.FD)("div",{className:"flex flex-row items-center gap-1 text-xs font-normal hover:cursor-pointer",onClick:()=>a(!n),children:[(0,r.Y)("span",{className:"text-muted-foreground",children:"Sort:"}),(0,r.Y)("span",{children:o}),(0,r.Y)(ey.A,{className:"size-4 text-muted-foreground"})]}),(0,r.Y)("div",{children:n&&(0,r.Y)(E.N,{children:(0,r.Y)(O.P.div,{initial:"hidden",animate:"enter",exit:"exit",transition:{duration:.41},variants:ev,className:"absolute bg-background right-0 top-6 z-50 w-56 rounded-xl border shadow-lg",children:(0,r.Y)(Y,{immediatelyApply:!0,roomy:!0})})})})]})})};var eb=l(23534),ex=l(26020);let eY=e=>{let{total:t}=e,l=(0,R.useSearchParams)(),i=null==l?void 0:l.get("search");return(0,r.Y)("span",{className:"text-sm text-muted-foreground",children:void 0!==t&&(0,r.FD)(r.FK,{children:[(0,r.Y)("span",{className:"font-medium",children:t.toLocaleString("en-US")})," ",1===t?"opportunity":"opportunities",i&&(0,r.FD)(r.FK,{children:[" matching “",i,"”"]})]})})},ew=e=>{let{title:t,subtitle:l,showPageTitle:i,totalResults:a}=e,{isSignedIn:o}=(0,ep.xc)(),{limitReached:s}=(0,em.v)(),{counts:u,hasFilter:m,clearFilters:h}=(()=>{let e=(0,R.useSearchParams)(),{currentQuery:t,pushQuery:l,clearQuery:r}=(0,f.rw)(),[i,n]=(0,p.useState)(""),[a,o]=(0,p.useState)({[k.types]:0,[k.fees]:0,[k.rewards]:0,[k.artisticFields]:0,[k.location]:0}),s=(0,p.useMemo)(()=>["noApplicationFee","rollingDeadline"].filter(t=>(null==e?void 0:e.get(t))==="true").length,[e]),c=(0,p.useMemo)(()=>Object.values(a).filter(e=>e>0).length+s,[a,s]);(0,p.useEffect)(()=>{let t=[null==e?void 0:e.get("organizationCity"),null==e?void 0:e.get("organizationCountry")].filter(e=>!!e).map(e=>decodeURIComponent("".concat(ex.J[e]?ex.J[e]:e))).join(", ");n(t);let l={[k.types]:0,[k.fees]:0,[k.rewards]:0,[k.artisticFields]:0,[k.location]:+(t.length>0)},r=null==e?void 0:e.get("types");
1r&&(l[k.types]=r.split(",").filter(Boolean).length);let i=null==e?void 0:e.get("fees");i&&(l[k.fees]=i.split(",").filter(Boolean).length);let a=null==e?void 0:e.get("rewards");a&&(l[k.rewards]=a.split(",").filter(Boolean).length);let s=null==e?void 0:e.get("artisticFields");s&&(l[k.artisticFields]=s.split(",").filter(Boolean).length),o(l)},[e,t]);let d=(0,p.useCallback)(e=>{let t=(0,eb.A)(e);null==l||l({organizationCountry:(null==t?void 0:t.country)?encodeURIComponent(t.country):void 0,organizationCity:(null==t?void 0:t.city)?encodeURIComponent(t.city):void 0,page:"1"})},[l]),u=(0,p.useCallback)(()=>{null==r||r(),n("")},[r]),m=(0,p.useCallback)((e,t)=>{null==l||l({[e]:t,page:"1"})},[l]),h=(0,p.useCallback)((t,r)=>{let i,n=(null==e?void 0:e.get(t))||"",a=n?n.split(","):[];i=a.includes(r)?a.filter(e=>e!==r):[...a,r],null==l||l({[t]:i.length>0?i.join(","):void 0,page:"1"})},[e,l]);return{counts:a,hasFilter:c,locationStringValue:i,handleLocationSelected:d,currentQuery:t,pushQuery:l,clearQuery:r,clearFilters:u,updateFilter:m,toggleFilterValue:h}})(),y=(0,p.useMemo)(()=>!o||s?"block":"allow",[o,s]);return(0,r.FD)(r.FK,{children:[i&&(0,r.FD)("div",{className:"flex flex-row items-start justify-between gap-8 px-1 pt-6 lg:px-0",children:[(0,r.FD)("div",{className:"flex flex-col gap-3",children:[(0,r.Y)("h1",{className:"text-3xl font-medium lg:text-4xl",children:t}),!o&&(0,r.Y)("p",{className:"max-w-[36rem] text-sm text-muted-foreground",children:l})]}),!o&&(0,r.Y)("div",{className:"hidden lg:block",children:(0,r.Y)(eu.c,{promptId:"opportunity_add_button",requiredSubscription:c.SubscriptionTypes.ARTIST_OPPORTUNITIES,children:(0,r.Y)(n.$,{className:"min-w-[160px]",children:"+ Add opportunity"})})})]}),(0,r.Y)("div",{className:"mt-6 hidden w-full lg:block",children:(0,r.Y)(eu.c,{promptId:"opportunity_filters",fallbackBehavior:y,className:"w-full",children:(0,r.Y)("div",{className:"w-full",children:(0,r.Y)(P,{})})})}),(0,r.FD)("div",{className:"mt-4 flex items-center gap-2 px-1 lg:hidden",children:[(0,r.Y)(eh,{totalResults:a}),(0,r.Y)("div",{className:"min-w-0 flex-1",children:(0,r.Y)(eu.c,{promptId:"opportunity_filters",fallbackBehavior:y,className:"w-full",children:(0,r.Y)("div",{className:"w-full",children:(0,r.Y)(P,{})})})})]}),(0,r.FD)("div",{className:"mt-4 flex min-h-8 items-center justify-between px-1 lg:hidden",children:[(0,r.Y)(eY,{total:a}),m>0&&(0,r.Y)(d,{onClick:h})]}),(0,r.FD)("div",{className:"sticky top-[calc(4rem+var(--ac-banner-h,0px))] z-20 hidden space-y-4 bg-background bg-opacity-70 py-4 backdrop-blur lg:block",children:[(0,r.Y)(eu.c,{promptId:"opportunity_filters",fallbackBehavior:y,className:"w-full",children:(0,r.FD)("div",{className:"flex w-full items-center justify-between gap-4",children:[(0,r.Y)(H,{counts:u}),m>0&&(0,r.Y)(d,{onClick:h})]})}),(0,r.Y)("div",{className:"w-full border-t"}),(0,r.FD)("div",{className:"flex w-full items-center justify-between",children:[(0,r.Y)(eY,{total:a}),(0,r.Y)(eg,{})]})]})]})};var eN=l(73787),ek=l(19664),eS=l.n(ek),eF=l(79985);let eC=e=>{var t;let{opportunities:l,showFilters:a=!0,showSearchBar:c,showEmptyState:d=!1,pageInfo:u,totalResults:m,expiredSectionLabel:h,activeSectionLabel:f}=e,[y,v]=(0,p.useState)((null==u?void 0:u.pageTitle)&&u.pageDescription?{title:u.pageTitle,subtitle:u.pageDescription}:{title:"Artist Opportunities",subtitle:"Discover open calls, art residencies, exhibitions opportunities, grants, awards, art jobs and more by leading art organizations and institutions around the world."}),[g,b]=(0,p.useState)(),{bookmark:x,bookmarks:Y}=(0,eN.A)(),{observeCard:w}=function(){let e=(0,p.useRef)(new Set),t=(0,p.useRef)(new Set),l=(0,p.useRef)(new Map),r=(0,p.useRef)(new Map),i=(0,p.useRef)(null),n=(0,p.useRef)(null),a=(0,p.useCallback)(()=>{i.current&&(clearTimeout(i.current),i.current=null),0!==t.current.size&&((0,eF.OO)(Array.from(t.current)),t.current.clear())},[]),o=(0,p.useCallback)(()=>n.current?n.current:"undefined"==typeof IntersectionObserver?null:(n.current=new IntersectionObserver(n=>{for(let o of n){let n=l.current.get(o.target);if(n){if(!o.isIntersecting){let e=r.current.get(o.target);e&&(clearTimeout(e),r.current.delete(o.target));continue}e.current.has(n)||r.current.has(o.target)||r.current.set(o.target,setTimeout(()=>{r.current.delete(o.target),!e.current.has(n)&&(e.current.add(n),t.current.add(n),i.current||(i.current=setTimeout(a,2e3)))},500))}}},{threshold:.5}),n.current),[a]),s=(0,p.useCallback)((e,t)=>{var r;e&&t&&(l.current.set(e,t),null==(r=o())||r.observe(e))},[o]);return(0,p.useEffect)(()=>{let e=()=>{"hidden"===document.visibilityState&&a()};return document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)},[a]),(0,p.useEffect)(()=>()=>{var e;null==(e=n.current)||e.disconnect(),n.current=null,r.current.forEach(e
1=>{clearTimeout(e)}),r.current.clear(),a()},[a]),{observeCard:s}}(),[N,k]=(0,p.useState)(!1),S=(h||f)&&null!=(t=null==l?void 0:l.findIndex(e=>o(e)))?t:-1,F=S>0;return(0,p.useEffect)(()=>{u&&v({title:null==u?void 0:u.pageTitle,subtitle:u.pageDescription})},[u]),(0,p.useEffect)(()=>{l&&(null==l?void 0:l.length)<1&&!d?i.QO.random().then(e=>{if("error"in e){console.error("Error fetching random opportunities:",e.error),b([]);return}b(e.data)}).catch(e=>{console.error("Error fetching random opportunities:",e),b([])}):(b([]),d&&k(!!(null==l?void 0:l.length)&&l.every(e=>o(e))))},[null==l?void 0:l.length]),(0,r.FD)("div",{className:"".concat(l&&(null==l?void 0:l.length)>20||(null==g?void 0:g.length)?"mb-28":""),children:[a&&(0,r.Y)(ew,{title:y.title,subtitle:y.subtitle,totalResults:m,showPageTitle:c}),d&&(N||!(null==l?void 0:l.length))&&(0,r.FD)("div",{className:"flex min-h-[188px] w-full flex-col items-center justify-center rounded border border-dashed border-gray-300 p-8",children:[(0,r.Y)("span",{children:"It appears that you currently don't have any active opportunities. Let's post one!"}),(0,r.Y)(eS(),{prefetch:!0,href:"/opportunities/new",children:(0,r.Y)(n.$,{className:"mt-3",children:"+ Add an Opportunity"})})]}),l&&l.length>0?l.map((e,t)=>(0,r.FD)(p.Fragment,{children:[0===t&&F&&f,t===S&&h,(0,r.FD)("div",{children:[(0,r.Y)("span",{className:"anchor-with-header-and-filters",id:"opportunity-".concat(e.id)}),new Date(e.deadline)<new Date&&(0,r.Y)("div",{className:"absolute top-0 left-0 z-20 h-full w-full",style:{backgroundRepeat:"no-repeat",backgroundPosition:"center",display:"block",pointerEvents:"none"}}),(0,r.Y)(s.A,{bookmark:x,bookmarks:Y,opportunity:e,onImpressionRef:t=>w(t,e.id)})]})]},t)):d?(0,r.Y)(r.FK,{}):(0,r.FD)("div",{children:[(0,r.Y)("div",{className:"my-20 mx-4 flex items-center justify-center text-xl md:mx-0 md:mt-20 md:mb-32",children:"Sorry, no results matching your criteria. Maybe you find these interesting"}),g&&g.map((e,t)=>(0,r.Y)(s.A,{bookmark:x,bookmarks:Y,opportunity:e,onImpressionRef:t=>w(t,e.id)},t))]})]})}},25267:(e,t,l)=>{l.d(t,{LC:()=>d,NN:()=>m,rw:()=>p});var r=l(93278),i=l(13448),n=l(36237),a=l(4081),o=l(88934),s=l(27541),c=l(41987);let d={FEES:"Yes",FREE:"No"},u=(0,c.createContext)({}),p=()=>(0,c.useContext)(u);function m(e){let{children:t}=e,l=(0,s.useRouter)(),d=(0,s.useSearchParams)(),p=(0,s.usePathname)(),[m,h]=(0,c.useState)(),{acToken:f}=(0,o.xc)(),y=(0,c.useRef)();(0,c.useEffect)(()=>{let e=(null==p?void 0:p.split("/"))||[],t={};null==d||d.forEach((e,l)=>{t[l]=e}),e.includes("residencies")?t.types=i.TypOfOpportunity.ART_RESIDENCY:e.includes("opencalls")?t.types=i.TypOfOpportunity.OPEN_CALL:e.includes("jobs")&&(t.types=i.TypOfOpportunity.JOB),h(t)},[p,d]),(0,c.useEffect)(()=>{if(d){var e;let t={};d.forEach((e,l)=>{t[l]=e}),!(!t||!localStorage||JSON.stringify(t)==localStorage.getItem("opportunityFilters")||"ART_RESIDENCY"===t.types||(null==p?void 0:p.startsWith("/opportunities/")))&&localStorage&&(null==p?void 0:p.includes("dashboard"))&&(null==(e=Object.keys(t))?void 0:e.length)&&(localStorage.setItem("opportunityFilters",JSON.stringify(t)),f&&(y.current&&clearTimeout(y.current),y.current=setTimeout(()=>{let e=Intl.DateTimeFormat().resolvedOptions().timeZone||"";(0,n.saveOpportunityFilters)(t,e,f).catch(()=>{})},2e3)))}},[d,p,f]);let v={...m,currentQuery:m,setCurrentQuery:h,pushQuery:(e,t)=>{let r={...m,...e},{noHistoryEntry:i=!1}=t||{},n=new URLSearchParams;Object.entries(r).forEach(e=>{let[t,l]=e;null!=l&&""!==l&&n.set(t,String(l))});let o="".concat(p,"?").concat(n.toString());i?l.replace(o):(l.push(o,{scroll:!1}),(0,a.N)())},clearQuery:()=>{let e=new URLSearchParams;(null==m?void 0:m.organizationCountry)&&e.set("city",m.organizationCountry),(null==m?void 0:m.organizationCity)&&e.set("country",m.organizationCity),l.push("".concat(p).concat(e.toString()?"?".concat(e.toString()):""),{scroll:!1}),(0,a.N)(),(null==p?void 0:p.includes("dashboard"))&&localStorage&&localStorage.removeItem("opportunityFilters")},routerPath:p,getCurrentPage:()=>Number.parseInt((null==m?void 0:m.page)||"1"),mergeQuery:e=>{h({...m,...e})}};return(0,r.Y)(u.Provider,{value:v,children:t})}},72116:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(92068).A)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])}}]);

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.