PageSourceSearch

https://www.burton.com/cdn/shop/t/83/assets/burton-forms-subdivisi…?v=63258098114125725781789049272

js burton.com collected 2026-09-24 15:21:01 UTC 3,875 bytes, 2 lines download raw bytes

1const SHIPPABLE_SUBDIVISIONS={US:["Alabama","Alaska","Arizona","Arkansas","California","Colorado","Connecticut","Delaware","District of Columbia","Florida","Georgia","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico","New York","North Carolina","North Dakota","Ohio","Oklahoma","Oregon","Pennsylvania","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virginia","Washington","West Virginia","Wisconsin","Wyoming"]};function filterToShippable(countryCode,provinces){const allowed=SHIPPABLE_SUBDIVISIONS[String(countryCode||"").toUpperCase()];return allowed?provinces.filter(([canonicalName])=>allowed.indexOf(canonicalName)>-1):provinces}class BurtonSubdivisionOptions extends window.BAO.Forms.Validate{setupListeners(){super.setupListeners(),customElements.whenDefined("burton-form").then(()=>{this.subscribeToCountry(),this.populate()})}subscribeToCountry(){const state=this.form&&this.form.state;if(!state||typeof state.subscribe!="function"){console.error("[burton-subdivision-options] parent <burton-form> exposes no reactive state \u2014 the field will not repopulate when the country changes",this);return}state.subscribe("country",()=>this.populate())}populate(){const select=this.controls&&this.controls[0];if(!select)return;const subdivisions=this.subdivisions()||[],previousValue=select.value,placeholder=select.querySelector('option[value=""]');select.replaceChildren(),placeholder&&select.appendChild(placeholder),subdivisions.forEach(([canonicalName,localizedLabel])=>{const option=document.createElement("option");option.value=canonicalName,option.textContent=localizedLabel,select.appendChild(option)});const stillValid=subdivisions.some(([canonicalName])=>canonicalName===previousValue);select.value=stillValid?previousValue:"",this.style.display=subdivisions.length>0?"":"none",this.validity&&this.validity.state!=="pending"&&this.validate()}subdivisions(){const sourceId=this.getAttribute("data-country-source"),source=sourceId?document.getElementById(sourceId):null;if(!source)return console.error(`[burton-subdivision-options] no country source "${sourceId}" in the DOM \u2014 is country_option_tags rendered on this page?`),null;const countryName=this.countryName();if(!countryName)return[];const option=Array.from(source.options).find(candidate=>candidate.textContent.trim()===countryName);if(!option)return console.error(`[burton-subdivision-options] no country option labelled "${countryName}" in "${sourceId}" \u2014 either it's outside this store's shipping zones, or the name doesn't match Shopify's localized name`),null;const provinces=JSON.parse(option.dataset.provinces||"[]");return this.hasAttribute("data-shippable-only")?filterToShippable(this.form&&this.form.country,provinces):provinces}countryName(){const country=this.form&&this.form.country;if(!country)return"";const mapId=this.getAttribute("data-country-names"),mapEl=mapId?document.getElementById(mapId):null;if(!mapEl)return console.error(`[burton-subdivision-options] no ISO\u2192name map "${mapId}" in the DOM \u2014 cannot translate "${country}" into a payload lookup key`),"";const names=JSON.parse(mapEl.textContent||"{}"),name=names[String(country).toUpperCase()];return name||(console.error(`[burton-subdivision-options] "${country}" is not in the ISO\u2192name map \u2014 is it in this store's markets?`,names),"")}}customElements.get("burton-subdivision-options")||customElements.define("burton-subdivision-options",BurtonSubdivisionOptions),window.BAO.Forms.SubdivisionOptions=window.BAO.Forms.SubdivisionOptions||BurtonSubdivisionOptions;
2//# sourceMappingURL=/cdn/shop/t/83/assets/burton-forms-subdivision-options.js.map?v=63258098114125725781789049272

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.