var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; if (document.querySelector("#data-feed-source-endpoint").getAttribute("data-trainers").toLowerCase() == "true") { document.addEventListener("DOMContentLoaded", () => __awaiter(this, void 0, void 0, function* () { let data = yield DataFeedApp.getUnprocessedData("trainers"); DataFeedApp.initialRender(data); let countries = data["countryFilters"].map(country => new DataFeedApp.DynamicFilter(country.key, country.label)); DataFeedApp.generateDynamicFilter("countriesDynamicFilter", { filters: countries }); DataFeedApp.initializeFilters(); const urlParams = new URL(window.location.href).searchParams; const countryParam = urlParams.get("countries"); if (countryParam !== null) return; const region = document.body.getAttribute("data-region"); const $countryOption = document.querySelector(`#countries-target > li[data-value="${region}"]`); if ($countryOption === null) return; const $input = $countryOption.querySelector("input"); $input.click(); })); } class Country { }