=r;n-=1){let s=n-1,o=t[c.charAt(s)];if(H&&(v[s]=+!!o),m[n]=(m[n+1]<<1|1)&o,i&&(m[n]|=(V[n+1]|V[n])<<1|1|V[n+1]),m[n]&C&&(g=x(e,{errors:i,currentLocation:s,expectedLocation:p,distance:a,ignoreLocation:l}))<=d){if(d=g,(z=s)<=p)break;r=Math.max(1,2*p-z)}}let M=x(e,{errors:i+1,currentLocation:p,expectedLocation:p,distance:a,ignoreLocation:l});if(M>d)break;V=m}let y={isMatch:z>=0,score:Math.max(.001,g)};if(H){let c=function(c=[],e=M.minMatchCharLength){let t=[],i=-1,a=-1,n=0;for(let s=c.length;n=e&&t.push([i,a]),i=-1)}return c[n-1]&&n-i>=e&&t.push([i,n-1]),t}(v,o);c.length?r&&(y.indices=c):y.isMatch=!1}return y}(c,e,u,{location:i+p,distance:a,threshold:n,findAllMatches:s,minMatchCharLength:o,includeMatches:t,ignoreLocation:r});d&&(h=!0),f+=z,d&&H&&(l=[...l,...H])});let u={isMatch:h,score:h?f/this.chunks.length:1};return h&&t&&(u.indices=l),u}}class b{constructor(c){this.pattern=c}static isMultiMatch(c){return N(c,this.multiRegex)}static isSingleMatch(c){return N(c,this.singleRegex)}search(){}}function N(c,e){let t=c.match(e);return t?t[1]:null}class w extends b{constructor(c,{location:e=M.location,threshold:t=M.threshold,distance:i=M.distance,includeMatches:a=M.includeMatches,findAllMatches:n=M.findAllMatches,minMatchCharLength:s=M.minMatchCharLength,isCaseSensitive:o=M.isCaseSensitive,ignoreLocation:r=M.ignoreLocation}={}){super(c),this._bitapSearch=new y(c,{location:e,threshold:t,distance:i,includeMatches:a,findAllMatches:n,minMatchCharLength:s,isCaseSensitive:o,ignoreLocation:r})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(c){return this._bitapSearch.searchIn(c)}}class S extends b{constructor(c){super(c)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(c){let e,t=0,i=[],a=this.pattern.length;for(;(e=c.indexOf(this.pattern,t))>-1;)t=e+a,i.push([e,t-1]);let n=!!i.length;return{isMatch:n,score:n?0:1,indices:i}}}let k=[class extends b{constructor(c){super(c)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(c){let e=c===this.pattern;return{isMatch:e,score:e?0:1,indices:[0,this.pattern.length-1]}}},S,class extends b{constructor(c){super(c)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(c){let e=c.startsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,this.pattern.length-1]}}},class extends b{constructor(c){super(c)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(c){let e=!c.startsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,c.length-1]}}},class extends b{constructor(c){super(c)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(c){let e=!c.endsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,c.length-1]}}},class extends b{constructor(c){super(c)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(c){let e=c.endsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[c.length-this.pattern.length,c.length-1]}}},class extends b{constructor(c){super(c)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(c){let e=c.indexOf(this.pattern),t=-1===e;return{isMatch:t,score:t?0:1,indices:[0,c.length-1]}}},w],A=k.length,P=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,T=new Set([w.type,S.type]),E=[];function O(c,e){for(let t=0,i=E.length;t!!(c[I.AND]||c[I.OR]),R=c=>!!c[B.PATH],F=c=>!i(c)&&o(c)&&!D(c),j=c=>({[I.AND]:Object.keys(c).map(e=>({[e]:c[e]}))});function Z(c,e,{auto:t=!0}={}){let a=c=>{let s=Object.keys(c),o=R(c);if(!o&&s.length>1&&!D(c))return a(j(c));if(F(c)){let i=o?c[B.PATH]:s[0],a=o?c[B.PATTERN]:c[i];if(!n(a))throw Error(h(i));let r={keyId:V(i),pattern:a};return t&&(r.searcher=O(a,e)),r}let r={children:[],operator:s[0]};return s.forEach(e=>{let t=c[e];i(t)&&t.forEach(c=>{r.children.push(a(c))})}),r};return D(c)||(c=j(c)),a(c)}function q(c,e){let t=c.matches;e.matches=[],r(t)&&t.forEach(c=>{if(!r(c.indices)||!c.indices.length)return;let{indices:t,value:i}=c,a={indices:t,value:i};c.key&&(a.key=c.key.src),c.idx>-1&&(a.refIndex=c.idx),e.matches.push(a)})}function U(c,e){e.score=c.score}class W{constructor(c,e={},t){this.options={...M,...e},this.options.useExtendedSearch,this._keyStore=new z(this.options.keys),this.setCollection(c,t)}setCollection(c,e){if(this._docs=c,e&&!(e instanceof _))throw Error("Incorrect 'index' type");this._myIndex=e||C(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(c){r(c)&&(this._docs.push(c),this._myIndex.add(c))}remove(c=()=>!1){let e=[];for(let t=0,i=this._docs.length;t{let t=1;c.matches.forEach(({key:c,norm:i,score:a})=>{let n=c?c.weight:null;t*=Math.pow(0===a&&n?Number.EPSILON:a,(n||1)*(e?1:i))}),c.score=t})}(l,{ignoreFieldNorm:r}),a&&l.sort(o),s(e)&&e>-1&&(l=l.slice(0,e)),function(c,e,{includeMatches:t=M.includeMatches,includeScore:i=M.includeScore}={}){let a=[];return t&&a.push(q),i&&a.push(U),c.map(c=>{let{idx:t}=c,i={item:e[t],refIndex:t};return a.length&&a.forEach(e=>{e(c,i)}),i})}(l,this._docs,{includeMatches:t,includeScore:i})}_searchStringList(c){let e=O(c,this.options),{records:t}=this._myIndex,i=[];return t.forEach(({v:c,i:t,n:a})=>{if(!r(c))return;let{isMatch:n,score:s,indices:o}=e.searchIn(c);n&&i.push({item:c,idx:t,matches:[{score:s,value:c,norm:a,indices:o}]})}),i}_searchLogical(c){let e=Z(c,this.options),t=(c,e,i)=>{if(!c.children){let{keyId:t,searcher:a}=c,n=this._findMatches({key:this._keyStore.get(t),value:this._myIndex.getValueForItemAtKeyId(e,t),searcher:a});return n&&n.length?[{idx:i,item:e,matches:n}]:[]}let a=[];for(let n=0,s=c.children.length;n{if(r(c)){let s=t(e,c,i);s.length&&(a[i]||(a[i]={idx:i,item:c,matches:[]},n.push(a[i])),s.forEach(({matches:c})=>{a[i].matches.push(...c)}))}}),n}_searchObjectList(c){let e=O(c,this.options),{keys:t,records:i}=this._myIndex,a=[];return i.forEach(({$:c,i:i})=>{if(!r(c))return;let n=[];t.forEach((t,i)=>{n.push(...this._findMatches({key:t,value:c[i],searcher:e}))}),n.length&&a.push({idx:i,item:c,matches:n})}),a}_findMatches({key:c,value:e,searcher:t}){if(!r(e))return[];let a=[];if(i(e))e.forEach(({v:e,i:i,n:n})=>{if(!r(e))return;let{isMatch:s,score:o,indices:l}=t.searchIn(e);s&&a.push({score:o,key:c,value:e,idx:i,norm:n,indices:l})});else{let{v:i,n:n}=e,{isMatch:s,score:o,indices:r}=t.searchIn(i);s&&a.push({score:o,key:c,value:i,norm:n,indices:r})}return a}}W.version="6.6.2",W.createIndex=C,W.parseIndex=function(c,{getFn:e=M.getFn,fieldNormWeight:t=M.fieldNormWeight}={}){let{keys:i,records:a}=c,n=new _({getFn:e,fieldNormWeight:t});return n.setKeys(i),n.setIndexRecords(a),n},W.config=M,W.parseQuery=Z,function(...c){E.push(...c)}(class{constructor(c,{isCaseSensitive:e=M.isCaseSensitive,includeMatches:t=M.includeMatches,minMatchCharLength:i=M.minMatchCharLength,ignoreLocation:a=M.ignoreLocation,findAllMatches:n=M.findAllMatches,location:s=M.location,threshold:o=M.threshold,distance:r=M.distance}={}){this.query=null,this.options={isCaseSensitive:e,includeMatches:t,minMatchCharLength:i,findAllMatches:n,ignoreLocation:a,location:s,threshold:o,distance:r},this.pattern=e?c:c.toLowerCase(),this.query=function(c,e={}){return c.split("|").map(c=>{let t=c.trim().split(P).filter(c=>c&&!!c.trim()),i=[];for(let c=0,a=t.length;c{let a=new Set(t.getValue(!0));if(a.size>0)return a.has(c);let n=(c,t)=>{let i=e[t].split(",").map(c=>c.trim()),a=new Set(Array.from(document.querySelectorAll(`input[type=checkbox][name=${c}]`)).filter(c=>c.checked).map(c=>c.parentElement.textContent.trim()));return i.some(c=>a.has(c))},s=n("scope","report_magnitude"),o=n("policy-change","report_type"),r=n("land-use","land_uses"),l=n("implementation-stage","report_status"),f=document.getElementById("no-requirements-toggle"),h=!f.checked||"1"===e.is_no_mandate_city,m=parseInt(e.population),[u,p]=i.getCurrentIndexes(),d=m>=lr[u][1]&&m<=lr[p][1];return s&&o&&r&&l&&h&&d},lf=(c,e,t,i,a)=>{let n=0;Object.entries(e).forEach(([e,s])=>{ll(e,t[e],i,a)?(s.addTo(c),n++):s.removeFrom(c)}),document.getElementById("counter-numerator").innerText=n.toString()},lh=(c,e,t,i,a)=>{let n=Object.keys(e).length;document.getElementById("counter-denominator").innerText=n.toString(),document.querySelectorAll("input[type=checkbox]").forEach(n=>{n.addEventListener("change",()=>{lf(c,e,t,i,a)})})},lm=c=>{var e;let t=c.map(c=>({value:c,label:c})),i=document.querySelector(".city-search");return new((e=lo)&&e.__esModule?e.default:e)(i,{choices:t,placeholderValue:"City search",removeItemButton:!0,allowHTML:!1,itemSelectText:"Select"})},lu=(c,e,t,i,a)=>{document.querySelector(".city-search").addEventListener("change",()=>lf(c,e,t,i,a))},lp=async c=>{try{await navigator.clipboard.writeText(c)}catch(c){console.error("Failed to write to clipboard: ",c)}},ld=c=>{let e=c.querySelector("svg.share-link-icon"),t=c.querySelector("svg.share-check-icon");e.style.display="none",t.style.display="inline-block",setTimeout(()=>{e.style.display="inline-block",t.style.display="none"},1e3)},lz=()=>{let c=document.querySelector(".share-icon");c.addEventListener("click",async()=>{await lp("https://parkingreform.org/resources/mandates-map"),ld(c)})};var lH=()=>{let c=document.querySelector(".about-popup"),e=document.querySelector(".info-icon");e.addEventListener("click",()=>{c.style.display="block"!==c.style.display?"block":"none"}),window.addEventListener("click",t=>{t.target instanceof Node&&!e.contains(t.target)&&"block"===c.style.display&&!c.contains(t.target)&&(c.style.display="none",e.classList.toggle("active"))}),document.querySelector(".about-popup-close-icon").addEventListener("click",()=>{c.style.display="none",e.classList.toggle("active")})};const lv=(c,e)=>{let t=c[e];return`
Detailed Information and Citations
${t.report_summary}
Population: ${parseInt(t.population).toLocaleString()}
Type of Reform: ${t.report_type}
Reform Status: ${t.report_status}
Scope of Reform: ${t.report_magnitude}
Land Uses: ${t.land_uses}
`};var lV=(c,e)=>{let t=document.querySelector(".city-details-popup");c.on("click",c=>{let i=c.sourceTarget.getTooltip().getContent(),a=lv(e,i);document.querySelector(".city-details-text").innerHTML=a,t.style.display="block"}),window.addEventListener("click",c=>{!(c.target instanceof Node)||c.target instanceof SVGPathElement||"block"!==t.style.display||t.contains(c.target)||(t.style.display="none")}),document.querySelector(".city-details-popup-close-icon").addEventListener("click",()=>{t.style.display="none"})};class lM{constructor(c,e,t){this.controls=c,this.left=e,this.right=t}getCurrentIndexes(){return[Math.floor(parseFloat(this.left.value)),Math.ceil(parseFloat(this.right.value))]}}const lg=lr.length-1,lL=(c,e,t)=>{let i=(t-e)/2,a=e+i,n=t-i;c.left.setAttribute("max",a.toString()),c.right.setAttribute("min",n.toString()),c.left.setAttribute("value",e.toString()),c.right.setAttribute("value",t.toString());let s=Math.round((c.controls.offsetWidth+7)/lr.length),o=a*s,r=(lg-n)*s;c.left.style.width=`${o+7}px`,c.right.style.width=`${r+7}px`,c.right.style.left=`${o+14}px`;let l=(c,e)=>{document.querySelector(c).innerHTML=lr[e][0]};l(".population-slider-label-min",e),l(".population-slider-label-max",t)},l_=()=>{let c=new lM(document.querySelector(".population-slider-controls"),document.querySelector(".population-slider-left"),document.querySelector(".population-slider-right"));c.left.setAttribute("max",lg.toString()),c.right.setAttribute("max",lg.toString()),c.right.setAttribute("value",lg.toString());let e=document.querySelector(".population-slider-legend");return lr.forEach(([c])=>{let t=document.createElement("span");t.appendChild(document.createTextNode(c)),e.appendChild(t)}),c},lC=(c,e,t,i,a)=>{lL(a,0,lg);let n=()=>{let[n,s]=a.getCurrentIndexes();a.left.value=n.toString(),a.right.value=s.toString(),lL(a,n,s),lf(c,e,t,i,a)};a.left.addEventListener("input",n),a.right.addEventListener("input",n)};var lx=(c,e,t,i,a)=>{let n=document.querySelector(".filters-popup-window"),s=document.querySelector(".filters-popup-icon");s.addEventListener("click",()=>{n.style.display="block"!==n.style.display?"block":"none"}),s.addEventListener("click",()=>{lC(c,e,t,i,a)},{once:!0}),window.addEventListener("click",c=>{c.target instanceof Node&&!s.contains(c.target)&&"block"===n.style.display&&!n.contains(c.target)&&(n.style.display="none",s.classList.toggle("active"))})},ly=()=>{document.getElementById("no-requirements-toggle").addEventListener("change",c=>{let e=c.target,t=document.getElementById("no-requirements-alert");e.checked?t.style.display="block":t.style.display="none"})};const lb=new m.TileLayer("https://tiles.stadiamaps.com/tiles/stamen_toner_lite/{z}/{x}/{y}{r}.png",{attribution:`Map tiles: © Stadia Maps
© Stamen Design
© OpenMapTiles`,subdomains:"abcd",minZoom:0,maxZoom:10}),lN={Regional:"#7b3294","City Center":"#fdae61",Citywide:"#d7191c","Main Street":"#abdda4",TOD:"#2b83ba"},lw=()=>{let c=new m.Map("map",{layers:[lb]});return c.setView([43.2796758,-96.7449732],4),c.attributionControl.setPrefix('Map data: © OpenStreetMap'),c},lS=async()=>{let c=await h("1FNiV");return c.reduce((c,e)=>{let t=`${e.city}, ${e.state}`;return c[t]=e,c},{})},lk=(c,e)=>Object.entries(c).reduce((c,[t,i])=>{let a=new m.CircleMarker([i.lat,i.long],{radius:7,stroke:!0,weight:.9,color:"#FFFFFF",fillColor:lN[i.magnitude_encoded],fillOpacity:1});return c[t]=a,a.bindTooltip(t),a.addTo(e),c},{}),lA=async()=>{ln(),lH(),lz(),ly();let c=lw(),e=new m.FeatureGroup,t=l_();ls(c,lN);let i=await lS(),a=lm(Object.keys(i)),n=lk(i,e);lV(e,i),lu(e,n,i,a,t),lh(e,n,i,a,t),lx(e,n,i,a,t),lf(e,n,i,a,t),e.addTo(c)};window.onload=async()=>{await lA()};