1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,143280,e=>{"use strict";var t=e.i(591255);e.s(["XIcon",()=>t.default])},919825,e=>{"use strict";let t=(0,e.i(498180).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeftIcon",0,t],919825)},716842,584648,78901,e=>{"use strict";var t=e.i(26863),a=e.i(322009),i=e.i(265468),r=e.i(122525),s=e.i(633578),l=e.i(279044);let n=e=>e.thumbnail||`https://${s.DOMAIN}/media/tiles/${e.value}/thumbnail.jpg`;e.s(["MarkerSelector",0,({siteId:e,value:s,onChange:o,excludedIds:d=[]})=>{let[c,u]=(0,r.useState)(!1),h=async t=>{u(!0);let{hits:a}=await (0,i.searchWithQuery)({q:t,prefix:!0,filter_by:`type:=\`Marker\` && site:=\`${e}\``,query_by:"title,artistsString,address",include_fields:"entityId,title,artistsString,address,thumbnail",limit:30});return u(!1),a?.filter(({document:e})=>!d.includes(e.entityId)).map(({document:e})=>({value:e.entityId,label:e.title||"Untitled",artistsString:e.artistsString,address:e.address,thumbnail:e.thumbnail}))||[]};return(0,t.jsx)(a.default,{cacheOptions:!0,defaultOptions:!0,isLoading:c,loadOptions:h,placeholder:"Search for a marker...",value:s,components:{ClearIndicator:()=>null,IndicatorSeparator:()=>null,DropdownIndicator:()=>(0,t.jsx)(l.ChevronDownIcon,{className:"size-3.5 mx-2.5"})},className:"react-select",classNames:{option:({isFocused:e})=>e?"option-focussed":""},onChange:e=>o(e),formatOptionLabel:e=>(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"size-8 shrink-0 rounded-md bg-zinc-100 dark:bg-zinc-800 bg-cover bg-center",style:{backgroundImage:`url(${n(e)})`}}),(0,t.jsxs)("div",{className:"flex flex-col min-w-0",children:[(0,t.jsx)("span",{className:"truncate",children:e.label}),(e.artistsString||e.address)&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground truncate",children:[e.artistsString,e.address].filter(Boolean).join(" · ")})]})]})})},"markerThumbnailUrl",0,n],716842);var o=e.i(174785),d=e.i(746234),c=e.i(509239);e.s(["NearbyMarkerList",0,({siteId:e,origin:a,onSelect:i,selectedId:r,excludedIds:s=[],markerType:l,limit:u=12})=>{let{hits:h,error:m}=(0,o.useSearchWithQuery)({q:"*",filter_by:["type:=`Marker`",`site:=\`${e}\``,"status:=`active`",`geoLocation:(${a.lat}, ${a.lng}, 20 km)`,l&&`markerType:=\`${l}\``,s.length&&`entityId:!=[${s.map(e=>`\`${e}\``).join(",")}]`].filter(Boolean).join(" && "),sort_by:`geoLocation(${a.lat}, ${a.lng}):asc`,include_fields:"entityId,title,artistsString,address,thumbnail",limit:u});return m||!h?.length?null:(0,t.jsxs)("div",{className:"mt-3",children:[(0,t.jsx)("p",{className:"text-xs font-medium text-zinc-500 dark:text-zinc-400 mb-1.5",children:"Or pick one nearby:"}),(0,t.jsx)("div",{className:"grid grid-cols-3 md:grid-cols-4 gap-1.5",children:h.map(({document:e,geo_distance_meters:a})=>{let s={value:e.entityId,label:e.title||"Untitled",artistsString:e.artistsString,address:e.address,thumbnail:e.thumbnail},l=a?.geoLocation;return(0,t.jsxs)("button",{type:"button",onClick:()=>i(s),title:[s.label,s.artistsString,s.address].filter(Boolean).join(" · "),className:(0,c.cn)("rounded-lg border p-1 text-left",r===s.value?"border-zinc-900 dark:border-zinc-100":"border-zinc-200 dark:border-zinc-700 hover:bg-zinc-50 dark:hover:bg-zinc-800"),children:[(0,t.jsx)("div",{className:"aspect-square w-full rounded-md bg-zinc-100 dark:bg-zinc-800 bg-cover bg-center",style:{backgroundImage:`url(${n(s)})`}}),(0,t.jsx)("div",{className:"text-xs truncate mt-1",children:s.label}),(0,t.jsx)("div",{className:"text-[11px] text-zinc-500 dark:text-zinc-400 truncate",children:[void 0!==l&&(0,d.formatDistance)(l),s.artistsString].filter(Boolean).join(" · ")})]},s.value)})})]})}],584648);let u=(0,e.i(498180).default)("type",[["path",{d:"M12 4v16",key:"1654pz"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2",key:"e0r10z"}],["path",{d:"M9 20h6",key:"s66wpe"}]]);e.s(["TypeIcon",0,u],78901)},39890,e=>{"use strict";let t=(0,e.i(498180).default)("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]);e.s(["UsersIcon",0,t],39890)},453162,e=>{"use strict";var t=e.i(26863),a=e.i(122525),i=e.i(420194),r=e.i(613284),s=e.i(469452),l=e.i(716842),n=e.i(584648),o=e.i(963613),d=e.i(78901),c=e.i(39890),u=e.i(614063),h=e.i(906176),m=e.i(498180);let p=(0,m.default)("text-align-start",[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 19H3",key:"z6ezky"}]]);var g=e.i(352339),b=e.i(610315);
1let v=(0,m.default)("circle-dot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);var x=e.i(66774),y=e.i(669197),f=e.i(607487),j=e.i(265468),k=e.i(279044);let w=e=>"string"==typeof e?e.trim():e,N=({attribute:e,value:i,setValue:r})=>{let[s,l]=(0,a.useState)(!1),n=async t=>{if("multi_text"===e.fieldType)return[];l(!0);let{hits:a}=await (0,j.searchWithQuery)({q:t,prefix:!0,filter_by:`type:=\`AttributeTagValue\` && attributeFieldName:=\`${e.id}\``,query_by:"title",include_fields:"attributeTagValue",limit:40});return l(!1),(a||[]).map(({document:e})=>({value:e.attributeTagValue,label:e.attributeTagValue}))};return(0,t.jsx)(f.default,{placeholder:"multi_text"===e.fieldType?"Enter value...":e.allowNewValues?"Search or enter new....":"Select option...",isMulti:!0,isValidNewOption:t=>("multi_text"===e.fieldType||e.allowNewValues)&&t?.length>0,noOptionsMessage:()=>"Enter a value...",defaultOptions:"multi_text"!==e.fieldType,isLoading:s,loadOptions:n,formatCreateLabel:e=>`Use "${e}"`,components:{ClearIndicator:()=>null,IndicatorSeparator:()=>null,DropdownIndicator:()=>(0,t.jsx)(k.ChevronDownIcon,{className:"size-3.5 mx-2.5"})},className:"react-select",onChange:t=>r(e.allowMultipleValues||"multi_text"===e.fieldType?t?.map(e=>w(e.value)):t.length?w(t[t.length-1].value):""),value:(i?Array.isArray(i)?i:[i]:[]).map(e=>({value:e,label:e}))})};var S=e.i(972326),I=e.i(524595),C=e.i(376304);let M=(e,t)=>{let a=Array.isArray(e)?e:[e].filter(Boolean);return Array.isArray(t)?{$add:t.filter(e=>!a.includes(e)),$remove:a.filter(e=>!t.includes(e))}:t},z={inProgress:"In progress (unfinished)",active:"Active (finished)",removed:"Removed"},T={active:"Active (open)",removed:"Closed down"},L=[{id:"title",icon:d.TypeIcon,shortLabel:"Title",label:e=>e.title&&"untitled"!==e.title.toLowerCase().trim()?"Edit title":"Add a title",subtitle:e=>e.title&&"untitled"!==e.title.toLowerCase().trim()?e.title:"No title yet",component:({entity:e,update:i})=>{let[r,s]=(0,a.useState)(e.title&&"untitled"!==e.title.toLowerCase().trim()?e.title:"");return(0,t.jsx)("input",{className:"w-full border border-zinc-300 dark:border-zinc-700 dark:bg-transparent dark:text-white rounded-lg text-sm px-3 h-10 mt-2",placeholder:"Title of the artwork",maxLength:60,value:r,onChange:e=>{s(e.target.value),i({title:e.target.value})}})}},{id:"description",icon:p,shortLabel:"Description",label:e=>e.htmlDescription?"Edit description":"Add a description",subtitle:e=>e.htmlDescription?"Edit the description":"No description yet",component:({entity:e,update:a})=>(0,t.jsxs)("div",{children:[(0,t.jsxs)("p",{className:"prose prose-sm dark:prose-invert mb-2",children:["Write a description of this"," ","artwork"===e.type?"artwork":"place"," in English."]}),(0,t.jsx)(I.RichTextEditor,{value:e.htmlDescription||"",onChange:e=>a({description:e})})]})},{id:"date_created",icon:g.CalendarIcon,shortLabel:"Creation date",isAvailable:e=>"artwork"===e.type,label:e=>e.attributes?.date_created?"Edit creation date":"Add a creation date",subtitle:e=>e.attributes?.date_created?new Date(e.attributes.date_created).toLocaleDateString("en-us",{month:"long",day:"numeric",year:"numeric"}):"When was this artwork created?",component:({entity:e,update:i})=>{let[r,s]=(0,a.useState)(e.attributes?.date_created||null);return(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"prose prose-sm dark:prose-invert mb-2",children:"Pick the date this artwork was created."}),(0,t.jsx)(S.DateSelector,{value:r,setValue:e=>{let t=e instanceof Date?e.toISOString():e||null;s(t),i({"attributes.date_created":t})},placeholderText:"Select a creation date..."})]})}},{id:"artists",icon:c.UsersIcon,shortLabel:"Artists",isAvailable:e=>"artwork"===e.type,label:e=>e.artists?.length?"Edit artists":"Add artists",subtitle:e=>e.artistsString||"No artists yet",component:({entity:e,update:i})=>{let r=(e.artists||[]).map(({id:e,title:t})=>({id:e,title:t})),[l,n]=(0,a.useState)(r);return(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"prose prose-sm dark:prose-invert mb-2",children:"Add or remove the artists behind this artwork."}),(0,t.jsx)(s.ArtistSelector,{allowNew:!0,allowMultiple:!0,value:l,onCh
1ange:e=>{n(e),i({artists:(0,C.artistDelta)(r,e)})}})]})}},{id:"location",icon:b.MapPinIcon,shortLabel:"Location",label:()=>"Move the location",subtitle:e=>e.location?.address||"Put the pin in the right spot",component:({entity:e,update:r})=>{let[s,l]=(0,a.useState)({address:e.location?.address||"",lat:e.location?.lat,lng:e.location?.lng,country:e.cityCountryShort||"",city:e.cityName||""});return(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"prose prose-sm dark:prose-invert mb-2",children:"Search an address or drag the pin to the right spot."}),(0,t.jsx)(i.ErrorBoundary,{children:(0,t.jsx)(y.default,{city:e.cityCountryShort?{title:e.cityName,country_short:e.cityCountryShort}:null,value:s,onChange:e=>{l(e),r({address:e.address,lat:e.lat,lng:e.lng,...e.country&&"string"==typeof e.country?{country:e.country}:{},...e.city?{cityName:e.city}:{}})}})})]})}},{id:"status",icon:v,shortLabel:"Status",requiresReason:!0,label:()=>"Change status",subtitle:e=>("artwork"===e.type?z[e.status]:T[e.status])||`Is this ${"artwork"===e.type?"artwork":"place"} still there?`,component:({entity:e,update:i})=>{let[r,s]=(0,a.useState)(e.status||"active");return(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"prose prose-sm dark:prose-invert mb-2",children:"artwork"===e.type?"Mark this artwork as removed if it's no longer visible on the streets.":"Mark this place as closed down if it no longer exists."}),(0,t.jsx)("select",{"aria-label":"Status",className:"w-full border border-zinc-300 dark:border-zinc-700 dark:bg-transparent dark:text-white rounded-lg text-sm px-3 h-10",value:r,onChange:e=>{s(e.target.value),i({status:e.target.value})},children:"artwork"===e.type?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("option",{value:"inProgress",children:"In progress (unfinished)"}),(0,t.jsx)("option",{value:"active",children:"Active (finished)"}),(0,t.jsx)("option",{value:"removed",children:"Removed"})]}):(0,t.jsxs)(t.Fragment,{children:["inProgress"===r&&(0,t.jsx)("option",{value:"inProgress",disabled:!0,children:"In progress"}),(0,t.jsx)("option",{value:"active",children:"Active (open)"}),(0,t.jsx)("option",{value:"removed",children:"Closed down"})]})})]})}},{id:"attributes",icon:u.TagIcon,shortLabel:"Tags",hidden:!0,singleMode:!0,label:(e,t)=>t.attribute?.name||"Edit tags",subtitle:(e,t)=>"Edit the tags associated with this marker",component:({meta:e,update:i})=>{let[r,s]=(0,a.useState)(e.value||[]);return(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"prose prose-sm dark:prose-invert mb-2",children:"Edit the tags associated with this marker."}),(0,t.jsx)(N,{attribute:e.attribute,value:r,setValue:t=>{s(t),i({[`attributes.${e.attribute.id}`]:M(e.value||[],t)})}})]})}},{id:"site",icon:o.Building2Icon,singleMode:!0,shortLabel:"City",label:()=>"Move to other city",subtitle:e=>e.cityName,component:({entity:e,update:i})=>{let[s,l]=(0,a.useState)({value:e.siteId,label:e.cityName});return(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"prose prose-sm dark:prose-invert mb-2",children:"Select a new city to move this marker to."}),(0,t.jsx)(r.CitySelector,{onChange:e=>{e&&(l(e),i({site:e.value}))},value:s,isClearable:!1})]})}},{id:"merge",icon:h.CopyIcon,singleMode:!0,shortLabel:"Merge",label:()=>"Merge into another marker",subtitle:()=>"Mark as duplicate",isAvailable:e=>!!e.siteId&&"no-site"!==e.siteId,component:({entity:e,update:i})=>{let[r,s]=(0,a.useState)(null);return(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"prose prose-sm dark:prose-invert mb-2",children:"This marker will be merged into the one you pick, and then removed."}),(0,t.jsx)("p",{className:"prose prose-sm dark:prose-invert mb-2",children:"Select the marker to merge into (in the same city):"}),(0,t.jsx)(l.MarkerSelector,{siteId:e.siteId,excludedIds:[e.id],value:r,onChange:e=>{s(e),e&&i({$mergeInto:e.value})}}),!r&&e.location?.lat&&e.location?.lng&&(0,t.jsx)(n.NearbyMarkerList,{siteId:e.siteId,origin:{lat:e.location.lat,lng:e.location.lng},excludedIds:[e.id],markerType:e.type,onSelect:e=>{s(e),i({$mergeInto:e.value})}})]})}},{id:"remove",icon:x.Trash2Icon,singleMode:!0,shortLabel:"Remove",requiresReason:!0,label:()=>
1"Request deletion",editorLabel:()=>"Permanently remove",subtitle:()=>"Mistake or doesn't belong here",editorSubtitle:()=>"Only for duplicates and mistakes",component:({entity:e,update:i})=>((0,a.useEffect)(()=>(i({$delete:!0}),()=>i({$delete:void 0})),[]),(0,t.jsxs)("div",{className:"prose prose-sm dark:prose-invert mt-1",children:[(0,t.jsxs)("p",{children:["This ","artwork"===e.type?"artwork":"place"," and all of its details will be removed completely. This can't be undone, so only do this for low-quality submissions or mistakes."]}),(0,t.jsx)("p",{children:"artwork"===e.type?'Is the artwork just no longer visible on the streets? Then change its status to "Removed" instead, so it stays part of the archive. If it\'s a duplicate, use the "Merge" option to combine it with the other marker.':'Has this place closed down? Then change its status to "Closed down" instead, so it stays part of the archive.'})]}))}],A=(0,m.default)("signature",[["path",{d:"m21 17-2.156-1.868A.5.5 0 0 0 18 15.5v.5a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1c0-2.545-3.991-3.97-8.5-4a1 1 0 0 0 0 5c4.153 0 4.745-11.295 5.708-13.5a2.5 2.5 0 1 1 3.31 3.284",key:"y32ogt"}],["path",{d:"M3 21h18",key:"itz85i"}]]),$=e=>e.attributes?.alternative_titles||e.alternativeTitles||[],E=e=>!e.verified&&!e.claimed,R=[{id:"title",icon:d.TypeIcon,shortLabel:"Name",isAvailable:E,label:()=>"Edit name",subtitle:e=>e.title||"No name yet",component:({entity:e,update:i})=>{let[r,s]=(0,a.useState)(e.title||"");return(0,t.jsx)("input",{className:"w-full border border-zinc-300 rounded-lg text-sm px-3 h-10 mt-2",placeholder:"Name of the artist",maxLength:80,value:r,onChange:e=>{s(e.target.value),i({title:e.target.value.trim()})},onBlur:e=>s(e.target.value.trim())})}},{id:"alternativeTitles",icon:A,shortLabel:"Other names",label:e=>$(e).length?"Edit other names":"Add other names",subtitle:e=>$(e).join(", ")||"Aliases and different spellings",component:({entity:e,update:i})=>{let r=$(e),[s,l]=(0,a.useState)(r);return(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"prose prose-sm dark:prose-invert mb-2",children:"Add any other names, aliases or spellings this artist is known by."}),(0,t.jsx)(N,{attribute:{id:"alternative_titles",fieldType:"multi_text"},value:s,setValue:e=>{l(e),i({"attributes.alternative_titles":M(r,e)})}})]})}},{id:"bio",icon:p,shortLabel:"Bio",isAvailable:E,label:e=>e.bio&&!e.bioGenerated?"Edit bio":"Add a bio",subtitle:e=>e.bio&&!e.bioGenerated?e.bio:"No bio yet",component:({entity:e,update:i})=>{let[r,s]=(0,a.useState)(e.bioGenerated?"":e.bio||"");return(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"prose prose-sm dark:prose-invert mb-2",children:"Write a short bio about this artist in English."}),(0,t.jsx)("textarea",{className:"w-full border border-zinc-300 dark:border-zinc-700 dark:bg-transparent dark:text-white rounded-lg text-sm px-3 py-2",placeholder:"Who is this artist and what is their work about?",rows:5,maxLength:1e3,value:r,onChange:e=>{s(e.target.value),i({bio:e.target.value})}})]})}},{id:"attributes",icon:u.TagIcon,shortLabel:"Tags",hidden:!0,singleMode:!0,label:(e,t)=>t.attribute?.name||"Edit tags",subtitle:()=>"Edit the tags associated with this artist",component:({meta:e,update:i})=>{let[r,s]=(0,a.useState)(e.value||[]);return(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"prose prose-sm dark:prose-invert mb-2",children:"Edit the tags associated with this artist."}),(0,t.jsx)(N,{attribute:e.attribute,value:r,setValue:t=>{s(t),i({[`attributes.${e.attribute.id}`]:M(e.value||[],t)})}})]})}},{id:"merge",icon:h.CopyIcon,singleMode:!0,shortLabel:"Merge",label:()=>"Merge into another artist",subtitle:()=>"Mark as duplicate",component:({entity:e,update:i})=>{let[r,l]=(0,a.useState)([]);return(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"prose prose-sm mb-2",children:"This artist and all artworks will be merged into the selected artist."}),(0,t.jsx)(s.ArtistSelector,{value:r,allowNew:!1,allowMultiple:!1,excludedIds:[e.id],onChange:e=>{l(e),e[0]?.id&&i({$mergeInto:e[0].id})}})]})}},{id:"delete",icon:x.Trash2Icon,singleMode:!0,shortLabel:"Delete",label:()=>
1"Delete this artist",subtitle:()=>"Remove them completely",isAvailable:e=>!e.artworksCount&&E(e),component:({entity:e,update:i})=>((0,a.useEffect)(()=>(i({$delete:!0}),()=>i({$delete:void 0})),[]),(0,t.jsxs)("p",{className:"prose prose-sm dark:prose-invert mt-1",children:[e.title||"This artist"," will be removed completely. This only works if there are no artworks or accounts linked to them, and it can't be undone."]}))}],_=[{id:"rename",icon:e.i(109949).PencilLineIcon,singleMode:!0,shortLabel:"Rename",label:()=>"Rename this tag",subtitle:e=>`Give "${e.value}" a new name`,component:({entity:e,update:i})=>{let[r,s]=(0,a.useState)(e.value);return(0,t.jsxs)("div",{children:[(0,t.jsxs)("p",{className:"prose prose-sm mb-2",children:["Everything tagged â",e.value,"â will use the new name instead."]}),(0,t.jsx)("input",{className:"w-full border border-zinc-300 dark:border-zinc-700 dark:bg-transparent dark:text-white rounded-lg text-sm px-3 h-10",placeholder:"New tag name",maxLength:80,value:r,onChange:t=>{s(t.target.value);let a=t.target.value.trim();i({$renameTo:a&&a!==e.value?a:void 0})}})]})}},{id:"merge",icon:h.CopyIcon,singleMode:!0,shortLabel:"Merge",label:()=>"Merge into another tag",subtitle:e=>`Combine "${e.value}" with another tag`,component:({entity:e,meta:i,update:r})=>{let[s,l]=(0,a.useState)("");return(0,t.jsxs)("div",{children:[(0,t.jsxs)("p",{className:"prose prose-sm mb-2",children:["Everything tagged â",e.value,"â will be re-tagged with the tag you pick, and this one will disappear."]}),(0,t.jsx)(N,{attribute:{...i.attribute,allowNewValues:!1,allowMultipleValues:!1},value:s,setValue:t=>{let a=Array.isArray(t)?t[0]:t;l(a||""),a&&a!==e.value&&r({$mergeInto:`${e.attributeId}:${a}`})}})]})}}];var O=e.i(932554),P=e.i(62106);let D=({city:e,update:i})=>{let r=e.zoom??13,{isLoaded:s}=(0,y.useGoogleMapsLoader)(),l=(0,a.useRef)(s);l.current=s;let[n,o]=(0,a.useState)(e.location?.address);return(0,a.useEffect)(()=>()=>i({lat:void 0,lng:void 0,zoom:void 0,address:void 0,country:void 0}),[]),(0,t.jsxs)("div",{children:[(0,t.jsxs)("p",{className:"prose prose-sm dark:prose-invert mb-2",children:["Move and zoom the map until it shows ",e.title," the way it should when people open it."]}),(0,t.jsxs)("div",{className:"relative overflow-hidden rounded-lg",children:[(0,t.jsx)(P.MapBase,{style:{height:240},centerPoint:[e.location?.lat??0,e.location?.lng??0],zoom:r,noRecenter:!0,onLoad:t=>t.on("moveend",()=>{var a;let{lat:s,lng:n}=t.getCenter();i({lat:s,lng:n,zoom:(a=Math.round(t.getZoom()))!==Math.round(r)?a:void 0}),l.current&&(0,y.geocodeCoordinates)(s,n,(t,a)=>{a&&(o(t),i({address:t!==e.location?.address?t:void 0,country:a!==e.country_short?a:void 0}))})})}),(0,t.jsx)(b.MapPinIcon,{className:"pointer-events-none absolute left-1/2 top-1/2 size-8 -translate-x-1/2 -translate-y-full fill-red-600 text-white"})]}),n&&(0,t.jsx)("p",{className:"text-xs text-zinc-500 mt-2",children:n})]})};var U=e.i(99461),V=e.i(34485);let B=e=>["tags","multi_text"].includes(e.fieldType)&&"alternative_titles"!==e.id,q=({city:e,update:i})=>{let{data:r}=(0,V.useData)("attributes?entityType=site"),[s,l]=(0,a.useState)(e.attributes||{});return r?(0,t.jsx)("div",{className:"flex flex-col gap-4 mt-2",children:r.filter(B).map(a=>(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm font-medium mb-1",children:a.name}),(0,t.jsx)(N,{attribute:a,value:s[a.id],setValue:t=>{l(e=>({...e,[a.id]:t})),i({[`attributes.${a.id}`]:M(e.attributes?.[a.id]||[],t)})}})]},a.id))}):(0,t.jsx)(U.Loader2Icon,{className:"size-4 animate-spin text-zinc-500 mt-2"})},H=e=>e.attributes?.alternative_titles||[],F=[{id:"title",icon:d.TypeIcon,shortLabel:"Name",label:()=>"Rename this city",subtitle:e=>e.title,component:({entity:e,update:i})=>{let[r,s]=(0,a.useState)(e.title||"");return(0,t.jsx)("input",{className:"w-full border border-zinc-300 dark:border-zinc-700 dark:bg-transparent dark:text-white rounded-lg text-sm px-3 h-10 mt-2",placeholder:"Name of the city",maxLength:80,value:r,onChange:t=>{s(t.target.value);let a=t.target.value.trim();i({title:a&&a!==e.title?a:void 0})},onBlur:e=>s(e.target.value.trim())})}},{id:"map",icon:O.MapIcon,shortLabel:"Map",label:()=>"Adjust the map",subtitle:()=>"Change the center, zoom level and address",component:({entity:e,update:a})=>(0,t.jsx)(D,{city:e,update:a})},{id:"alternativeTitles",icon:A,shortLabel:"Other names",label:e=>
1H(e).length?"Edit other names":"Add other names",subtitle:e=>H(e).join(", ")||"Local names and other spellings",component:({entity:e,update:i})=>{let r=H(e),[s,l]=(0,a.useState)(r);return(0,t.jsxs)("div",{children:[(0,t.jsxs)("p",{className:"prose prose-sm dark:prose-invert mb-2",children:["Add any other names or spellings ",e.title," is known by, so people can find it when searching."]}),(0,t.jsx)(N,{attribute:{id:"alternative_titles",fieldType:"multi_text"},value:s,setValue:e=>{l(e),i({"attributes.alternative_titles":M(r,e),alternativeTitles:e})}})]})}},{id:"tags",icon:u.TagIcon,shortLabel:"Tags",label:()=>"Edit tags",subtitle:()=>"Other details about this city",component:({entity:e,update:a})=>(0,t.jsx)(q,{city:e,update:a})},{id:"merge",icon:h.CopyIcon,singleMode:!0,shortLabel:"Merge",label:()=>"Merge into another city",subtitle:()=>"Mark as duplicate",component:({entity:e,update:i})=>{let[s,l]=(0,a.useState)(null);return(0,t.jsxs)("div",{children:[(0,t.jsxs)("p",{className:"prose prose-sm dark:prose-invert mb-2",children:["All artworks, routes and hunters of ",e.title," will be moved to the city you pick, and this one will disappear."]}),(0,t.jsx)(r.CitySelector,{value:s,onChange:t=>{l(t),i({$mergeInto:t?.value&&t.value!==e.id?t.value:void 0})}})]})}},{id:"delete",icon:x.Trash2Icon,singleMode:!0,shortLabel:"Delete",label:()=>"Delete this city",subtitle:()=>"Remove it completely",isAvailable:e=>!e.artworksCount&&!e.team?.length,component:({entity:e,update:i})=>((0,a.useEffect)(()=>(i({$delete:!0}),()=>i({$delete:void 0})),[]),(0,t.jsxs)("p",{className:"prose prose-sm dark:prose-invert mt-1",children:[e.title||"This city"," will be removed completely. This only works if there are no artworks, routes or hunters linked to it, and it can't be undone."]}))}];e.s(["editConfig",0,{marker:{options:L,cachePaths:e=>[`markers/${e.id}`,`cities/${e.siteId}/markers/${e.id}`]},artist:{options:R,cachePaths:e=>[`artists/${e.id}`]},site:{options:F,cachePaths:e=>[`cities/${e.id}`]},tag:{options:_,cachePaths:e=>[`tags/${e.attributeId}`,`tags/${e.attributeId}/${encodeURIComponent(e.value)}`]}}],453162)},838719,e=>{"use strict";let t=(0,e.i(498180).default)("camera",[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);e.s(["CameraIcon",0,t],838719)},405029,230823,e=>{"use strict";var t=e.i(26863),a=e.i(122525),i=e.i(919825),r=e.i(99461),s=e.i(83089),l=e.i(979077),n=e.i(509239),o=e.i(713341),d=e.i(988405),c=e.i(15783),u=e.i(453162),h=e.i(686250),m=e.i(838719),p=e.i(143280),g=e.i(633578);let b=["image/jpeg","image/png"],v=async e=>{if(!(e.type?b.includes(e.type):/\.(jpe?g|png)$/i.test(e.name)))throw Error("Only JPG and PNG images can be attached");if(e.size>25e6)throw Error("That image is too big (25MB max)");let t=await fetch(`https://${g.DOMAIN}/api/media/upload?filename=${encodeURIComponent(e.name)}&contentType=${encodeURIComponent(e.type||"image/jpeg")}`);if(!t.ok)throw Error("Could not get an upload link");let{url:a,publicUrl:i}=await t.json();if(!(await fetch(a,{method:"PUT",body:e,headers:{"Content-Type":e.type||"image/jpeg","Cache-Control":"max-age=31536000, immutable"}})).ok)throw Error("Could not upload that image");return i},x=e=>e.flatMap(e=>e.url?[e.url]:[]),y=e=>e.some(e=>!e.url),f=({value:e,onChange:i,attachments:l,onAttachmentsChange:o,className:d,textareaClassName:c,showButton:u=!0,disabled:h,textareaRef:g,...b})=>{let x=(0,a.useRef)(null),y=(0,a.useRef)(l);y.current=l;let f=e=>{y.current=e,o(e)},j=(0,a.useRef)(new Set);(0,a.useEffect)(()=>{let e=new Set(l.map(({previewUrl:e})=>e));for(let t of j.current)e.has(t)||(URL.revokeObjectURL(t),j.current.delete(t))},[l]),(0,a.useEffect)(()=>{let e=j.current;return()=>{e.forEach(e=>URL.revokeObjectURL(e)),e.clear()}},[]);let k=async e=>{let t=Array.from(e.target.files||[]);e.target.value="",await Promise.all(t.map(async e=>{let t=Math.random().toString(36).substring(2,15),a=URL.createObjectURL(e);j.current.add(a),f([...y.current,{id:t,previewUrl:a}]);try{let a=await v(e);f(y.current.map(e=>e.id===t?{...e,url:a}:e))}catch(e){s.default.error(e.message||"Sorry, we couldn't add that image"),f(y.current.filter(e=>e.id!==t))}}))};return(0,t.jsxs)("div",{className:(0,n.cn)("relative rounded-lg border border-zinc-300 dark:border-zinc-700",d),children:[(0,t.jsx)("textarea",{...b,ref:g,className:(0,n.cn)("w-full resize-none border-0 bg-transparent p-3 pr-10 text-sm r
1ing-0! shadow-none! focus:outline-none dark:text-white",c),value:e,onChange:e=>i(e.target.value),disabled:h}),(0,t.jsxs)("button",{type:"button",className:(0,n.cn)("absolute top-1.5 right-2 cursor-pointer rounded-md p-1 text-zinc-400 hover:text-zinc-600 disabled:opacity-50 dark:hover:text-zinc-200 transition",u?"opacity-100":"opacity-0 pointer-events-none"),title:"Attach a picture",onClick:()=>x.current?.click(),disabled:h,children:[(0,t.jsx)(m.CameraIcon,{className:"size-4.5"}),(0,t.jsx)("span",{className:"sr-only",children:"Attach a picture"})]}),(0,t.jsx)("input",{ref:x,type:"file",accept:"image/jpeg,image/png",multiple:!0,className:"hidden",onChange:k}),l.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap gap-2 px-3 pb-3",children:l.map(e=>(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("img",{src:e.previewUrl||e.url,alt:"",className:(0,n.cn)("size-16 rounded-lg bg-zinc-100 object-cover dark:bg-zinc-800",!e.url&&"opacity-50")}),!e.url&&(0,t.jsx)(r.Loader2Icon,{className:"absolute inset-0 m-auto size-5 animate-spin text-zinc-600 dark:text-zinc-300"}),(0,t.jsxs)("button",{type:"button",className:"absolute -top-1.5 -right-1.5 cursor-pointer rounded-full bg-zinc-700 p-0.5 text-white hover:bg-zinc-900",onClick:()=>f(y.current.filter(t=>t.id!==e.id)),children:[(0,t.jsx)(p.XIcon,{className:"size-3"}),(0,t.jsx)("span",{className:"sr-only",children:"Remove picture"})]})]},e.id))})]})};e.s(["TextareaWithAttachment",0,f,"attachmentUrls",0,x,"isUploadingAttachments",0,y],230823),e.s(["SuggestEditForm",0,({entityType:e,entity:m,variant:p="dialog",initialSelectedOptions:g,initialMeta:b,onClose:v})=>{let j="page"===p,[k,w]=(0,a.useState)(g||[]),[N]=(0,a.useState)(b||{}),[S,I]=(0,a.useState)({}),[C,M]=(0,a.useState)(null),[z,T]=(0,a.useState)("options"),[L,A]=(0,a.useState)(""),[$,E]=(0,a.useState)([]),[R,_]=(0,a.useState)(!1),[O,P]=(0,a.useState)(""),D=u.editConfig[e]?.options||[];(0,a.useEffect)(()=>{let t=!1;return(async()=>{try{let{data:a}=await l.default.post("/edits/evaluate-permissions",{entityType:e,entityId:m.id});if(t)return;M(!!a.autoAccept),a.autoAccept&&"marker"===e&&!g?.length&&T("editor")}catch(e){console.log(e),t||M(!1)}})(),()=>{t=!0}},[e,m?.id]);let U=(0,a.useMemo)(()=>m?D.filter(e=>(!e.isAvailable||e.isAvailable(m,N))&&!e.hidden):[],[m,D,N]),V=()=>{w([]),I({}),A(""),E([])},B=(0,a.useCallback)(t=>{let a="accepted"===t.status;if(a){let t=u.editConfig[e]?.cachePaths?.(m)||[];(async()=>{try{await Promise.all(t.map(e=>fetch("/api/frontend/reset-cache",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})})))}catch(e){console.log(e)}})()}j?P(a?"accepted":"pending"):(s.default.success(a?"Your edit has been processed. It might take a little bit of time to show up.":"Your edit suggestion has been submitted and is pending review by our moderators. Thank you for helping improve our content!"),v?.(),V())},[e,m,j,v]),q=(0,a.useCallback)(async()=>{_(!0);try{let{data:t}=await l.default.post("/edits",{entityType:e,entityId:m.id,actions:S,editComment:L,editAttachments:x($)});B(t.edit)}catch(e){s.default.error(e?.response?.data?.error||"Failed to submit edit suggestion. Please try again.")}_(!1)},[S,e,m,L,$,B]),H=(0,a.useMemo)(()=>{if(0===k.length)return!1;let e=D.find(e=>e.id===k[0]);return e?.singleMode||!1},[k,D]),F=e=>(C&&e.editorLabel||e.label)(m,N),G=(0,a.useMemo)(()=>k.some(e=>D.find(t=>t.id===e)?.requiresReason),[k,D]);if(O)return(0,t.jsxs)("div",{className:"p-6 flex flex-col items-center text-center",children:[(0,t.jsx)("h2",{className:"text-2xl font-heading font-semibold mb-4",children:"accepted"===O?"Your edit has been saved!":"Thank you for your suggestion!"}),(0,t.jsx)("div",{className:"prose prose-sm dark:prose-invert",children:(0,t.jsx)("p",{children:"accepted"===O?"It might take a little bit of time for your changes to show up everywhere.":"Your suggestion has been submitted and is now pending review by our moderators. Thanks for helping improve our content!"})})]});let W=j?"h2":d.SheetTitle,Q=j?"-mx-4":"-mx-6",Y=j?"px-4":"px-6";if(null===C)return(0,t.jsxs)("div",{className:"flex min-h-48 flex-1 items-center justify-center",children:[!j&&(0,t.jsx)(d.SheetTitle,{className:"sr-only",children:"Edit"}
1),(0,t.jsx)(r.Loader2Icon,{className:"size-5 animate-spin text-muted-foreground"})]});let J="marker"===e&&C,K="editor"===z&&J,X=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(d.SheetHeader,{children:[(0,t.jsxs)(W,{className:(0,n.cn)("flex items-center gap-2 p-0 m-0",j&&"font-heading h-9 text-lg leading-none font-semibold"),children:[!K&&k.length>0&&(0,t.jsx)("button",{onClick:V,children:(0,t.jsx)(i.ArrowLeftIcon,{className:"size-4 hover:opacity-60 cursor-pointer"})}),C?"Edit information":"Suggest an edit"]}),J&&(0,t.jsx)(h.Tooltipped,{text:K?"Edit specific fields instead":"Show full editor",placement:"bottom",asChild:!0,children:(0,t.jsx)(o.Button,{variant:"secondary",size:"sm",className:(0,n.cn)("absolute","page"===p?"top-4 right-4":"top-3 right-12"),onClick:()=>T(K?"options":"editor"),children:K?"Quick actions":"Show editor"})})]}),K?(0,t.jsx)(c.MarkerEditor,{marker:m,onSuccess:B}):0===k.length?(0,t.jsx)("div",{className:"grid grid-cols-1 @md:grid-cols-2 gap-2",children:U.map(e=>(0,t.jsxs)("button",{className:"border rounded-lg p-4 py-3 text-left flex flex-col cursor-pointer hover:bg-muted dark:border-zinc-700",onClick:()=>w(t=>[...t,e.id]),children:[(0,t.jsxs)("span",{className:"flex items-center gap-1 text-sm font-medium",children:[(0,t.jsx)(e.icon,{className:"size-3.5 shrink-0"}),F(e)]}),(0,t.jsx)("span",{className:"text-xs text-muted-foreground truncate",children:(C&&e.editorSubtitle||e.subtitle)(m,N)})]},e.id))}):(0,t.jsxs)(t.Fragment,{children:[!H&&(0,t.jsx)("div",{className:(0,n.cn)("overflow-x-auto -mt-2 no-scrollbar",Q),children:(0,t.jsx)("div",{className:(0,n.cn)("flex gap-1.5 shrink-0",Y),children:U.filter(e=>!e.singleMode).map(e=>(0,t.jsxs)("button",{className:(0,n.cn)("border rounded-3xl p-3 py-1.5 whitespace-nowrap text-left flex items-center gap-1 text-xs font-medium cursor-pointer",k.includes(e.id)?"bg-primary text-primary-foreground border-primary":"hover:bg-muted"),onClick:()=>{k.includes(e.id)?w(t=>t.filter(t=>t!==e.id)):w(t=>[...t,e.id])},children:[(0,t.jsx)(e.icon,{className:"size-3 shrink-0"}),e.shortLabel]},e.id))})}),(0,t.jsx)("div",{className:"flex flex-col gap-7 mt-2",children:k.map(e=>{let a=D.find(t=>t.id===e),i=a.component;return(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"font-heading font-semibold",children:F(a)}),(0,t.jsx)(i,{entity:m,meta:N,update:e=>{I(t=>{let a={...t,...e};for(let e of Object.keys(a))void 0===a[e]&&delete a[e];return a})}})]},e)})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"font-heading font-semibold mb-2",children:G?"Reason":"Comment for reviewer"}),(0,t.jsx)(f,{placeholder:G?"Explain why you're making this change...":C?"Give a reason for your edit (optional)...":"Add a comment to help moderators review your suggestion...",rows:3,value:L,onChange:A,attachments:$,onAttachmentsChange:E,disabled:R})]}),(0,t.jsx)(d.SheetFooter,{className:(0,n.cn)(j&&"mt-2"),children:(0,t.jsx)("div",{className:(0,n.cn)("flex items-center gap-4 w-full",j?"flex-col-reverse":"justify-end"),children:(0,t.jsx)(o.Button,{className:(0,n.cn)(j&&"w-full"),disabled:R||Object.keys(S).length<1||y($)||G&&!L.trim(),onClick:q,children:"Submit"})})})]})]});return j?(0,t.jsx)("div",{className:"@container flex flex-col gap-6 p-4",children:X}):X}],405029)}]);
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.