Files
parts_website/static/dist/js/main.bundle.js

5301 lines
229 KiB
JavaScript

/******/ (() => { // webpackBootstrap
/******/ "use strict";
// This entry needs to be wrapped in an IIFE because it needs to be isolated against other entry modules.
(() => {
// UNUSED EXPORTS: default
;// ./static/js/lib/validation.js
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
var Validation = /*#__PURE__*/function () {
function Validation() {
_classCallCheck(this, Validation);
}
return _createClass(Validation, null, [{
key: "isEmpty",
value:
/*
isNullOrWhitespace(v) {
let txt = JSON.stringify(v).replace('/\s\g', '');
return (txt == '' || 'null');
}
*/
function isEmpty(object) {
var isEmpty = true;
if (object !== null && object !== "null" && object !== undefined && object !== "undefined") {
if (object.length == undefined) {
isEmpty = false; // object exists but isn't a collection
} else if (typeof object === "function") {
isEmpty = false; // object is reference
} else {
// string or collection
var isString = typeof object == "string";
if (isString) object = object.trim();
if (object.length > 0) {
if (isString) {
isEmpty = false; // String greater than length 0
} else {
if (typeof object[0] != "string") {
isEmpty = false;
} else {
for (var i = 0; i < object.length; i++) {
if (object[i] != "") {
isEmpty = false;
break;
}
}
}
}
}
}
}
return isEmpty;
}
}, {
key: "isValidNumber",
value: function isValidNumber(value, positiveOnly) {
return !Validation.isEmpty(value) && !isNaN(value) && (!positiveOnly || parseFloat(value) > 0);
}
}, {
key: "getDataContentType",
value: function getDataContentType(params) {
var data = null;
var contentType = '';
if (!Validation.isEmpty(params)) {
if (typeof params === "string") {
data = params;
contentType = "application/x-www-form-urlencoded; charset=UTF-8";
} else {
data = JSON.stringify(params);
contentType = "application/json; charset=UTF-8";
}
}
return {
Data: data,
ContentType: contentType
};
}
}, {
key: "arrayContainsItem",
value: function arrayContainsItem(array, itemValue) {
var hasItem = false;
if (!Validation.isEmpty(array) && !Validation.isEmpty(itemValue)) {
var isJQueryElementArray = array[0] instanceof jQuery;
if (isJQueryElementArray) {
for (var i = 0; i < array.length; i++) {
if (document.querySelectorAll(array[i]).is(itemValue)) {
hasItem = true;
break;
}
}
} else {
var isDate = array[0] instanceof Date;
if (isDate) {
for (var _i = 0; _i < array.length; _i++) {
if (array[_i].getTime() === itemValue.getTime()) {
hasItem = true;
break;
}
}
} else {
for (var _i2 = 0; _i2 < array.length; _i2++) {
if (array[_i2] == itemValue) {
hasItem = true;
break;
}
}
}
}
}
return hasItem;
}
}, {
key: "dictHasKey",
value: function dictHasKey(d, k) {
return k in d;
}
}, {
key: "areEqualDicts",
value: function areEqualDicts(dict1, dict2) {
var keys1 = Object.keys(dict1);
var keys2 = Object.keys(dict2);
if (keys1.length !== keys2.length) {
return false;
}
for (var _i3 = 0, _keys = keys1; _i3 < _keys.length; _i3++) {
var key = _keys[_i3];
if (dict1[key] !== dict2[key]) {
return false;
}
}
return true;
}
}, {
key: "imageExists",
value: function imageExists(url, callback) {
var img = new Image();
img.onload = function () {
callback(true);
};
img.onerror = function () {
callback(false);
};
img.src = url;
}
}, {
key: "toFixedOrDefault",
value: function toFixedOrDefault(value, decimalPlaces) {
var defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
return Validation.isValidNumber(value) ? parseFloat(value).toFixed(decimalPlaces) : defaultValue;
}
}]);
}();
;// ./static/js/dom.js
function dom_typeof(o) { "@babel/helpers - typeof"; return dom_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, dom_typeof(o); }
function _defineProperty(e, r, t) { return (r = dom_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function dom_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
function dom_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, dom_toPropertyKey(o.key), o); } }
function dom_createClass(e, r, t) { return r && dom_defineProperties(e.prototype, r), t && dom_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
function dom_toPropertyKey(t) { var i = dom_toPrimitive(t, "string"); return "symbol" == dom_typeof(i) ? i : i + ""; }
function dom_toPrimitive(t, r) { if ("object" != dom_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != dom_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
var DOM = /*#__PURE__*/function () {
function DOM() {
dom_classCallCheck(this, DOM);
}
return dom_createClass(DOM, null, [{
key: "setElementAttributesValuesCurrentAndPrevious",
value: function setElementAttributesValuesCurrentAndPrevious(element, data) {
DOM.setElementAttributeValueCurrent(element, data);
DOM.setElementAttributeValuePrevious(element, data);
}
}, {
key: "setElementAttributeValueCurrent",
value: function setElementAttributeValueCurrent(element, data) {
element.setAttribute(attrValueCurrent, data);
}
}, {
key: "setElementAttributeValuePrevious",
value: function setElementAttributeValuePrevious(element, data) {
element.setAttribute(attrValuePrevious, data);
}
}, {
key: "setElementValuesCurrentAndPrevious",
value: function setElementValuesCurrentAndPrevious(element, data) {
DOM.setElementValueCurrent(element, data);
DOM.setElementAttributeValuePrevious(element, data);
}
}, {
key: "setElementValueCurrent",
value: function setElementValueCurrent(element, data) {
DOM.setElementAttributeValueCurrent(element, data);
if (element.type === "checkbox") {
element.checked = data;
} else if (element.tagName === 'INPUT' || element.tagName === 'TEXTAREA' || element.tagName === 'SELECT') {
element.value = data;
} else {
element.textContent = data;
}
}
}, {
key: "setElementValueCurrentIfEmpty",
value: function setElementValueCurrentIfEmpty(element, data) {
if (Validation.isEmpty(DOM.getElementValueCurrent(element))) {
DOM.setElementValueCurrent(element, data);
}
}
}, {
key: "getCellFromElement",
value: function getCellFromElement(element) {
return element.closest('td');
}
}, {
key: "getRowFromElement",
value: function getRowFromElement(element, flagRow) {
var selector = Validation.isEmpty(flagRow) ? 'tr' : 'tr.' + flagRow;
return element.closest(selector);
}
}, {
key: "getClosestParent",
value: function getClosestParent(element, selector) {
var parent = element.parentElement;
while (parent) {
if (parent.matches(selector)) {
return parent;
}
parent = parent.parentElement;
}
return null;
}
}, {
key: "convertForm2JSON",
value: function convertForm2JSON(elementForm) {
var dataForm = {};
if (Validation.isEmpty(elementForm)) {
return dataForm;
}
var containersFilter = elementForm.querySelectorAll('.' + flagContainerInput + '.' + flagFilter);
var containerFilter, labelFilter, keyFilter, filter;
for (var indexFilter = 0; indexFilter < containersFilter.length; indexFilter++) {
containerFilter = containersFilter[indexFilter];
labelFilter = containerFilter.querySelector('label');
keyFilter = labelFilter.getAttribute('for');
filter = containerFilter.querySelector("#".concat(keyFilter));
dataForm[keyFilter] = DOM.getElementValueCurrent(filter);
}
return dataForm;
}
}, {
key: "loadPageBody",
value: function loadPageBody(contentNew) {
var pageBody = document.querySelector(idPageBody);
pageBody.innerHTML = contentNew;
}
}, {
key: "getHashPageCurrent",
value: function getHashPageCurrent() {
var hashPageCurrent = document.body.dataset.page;
return hashPageCurrent;
}
}, {
key: "updateAndCheckIsElementDirty",
value: function updateAndCheckIsElementDirty(element) {
element.setAttribute(attrValueCurrent, DOM.getElementValueCurrent(element));
return DOM.isElementDirty(element);
}
}, {
key: "isElementDirty",
value: function isElementDirty(element) {
var isDirty = element.getAttribute(attrValuePrevious) != element.getAttribute(attrValueCurrent);
DOM.handleDirtyElement(element, isDirty);
return isDirty;
}
}, {
key: "handleDirtyElement",
value: function handleDirtyElement(element, isDirty) {
DOM.toggleElementHasClassnameFlag(element, isDirty, flagDirty);
}
}, {
key: "toggleElementHasClassnameFlag",
value: function toggleElementHasClassnameFlag(element, elementHasFlag, flag) {
var elementAlreadyHasFlag = element.classList.contains(flag);
if (elementHasFlag == elementAlreadyHasFlag) return;
if (elementHasFlag) {
element.classList.add(flag);
} else {
element.classList.remove(flag);
}
}
}, {
key: "hasDirtyChildrenContainer",
value: function hasDirtyChildrenContainer(container) {
if (container == null) return false;
return container.querySelector('.' + flagDirty) != null;
}
}, {
key: "hasDirtyChildrenNotDeletedContainer",
value: function hasDirtyChildrenNotDeletedContainer(container) {
if (container == null || container.classList.contains(flagDelete)) return false;
return container.querySelector('.' + flagDirty + ':not(.' + flagDelete + ', .' + flagDelete + ' *)') != null;
}
}, {
key: "getElementValueCurrent",
value: function getElementValueCurrent(element) {
var returnVal = '';
if (!Validation.isEmpty(element)) {
if (element.type === "checkbox") {
returnVal = element.checked;
}
/*
else if (element.classList.contains(flagIsDatePicker)) {
returnVal = getDatePickerDate(element, adjust4DayLightSavings);
}
*/else if (element.tagName === 'INPUT' || element.tagName === 'TEXTAREA' || element.tagName === 'SELECT') {
returnVal = element.value;
} else if (element.tagName === 'BUTTON' && element.classList.contains(flagActive)) {
returnVal = element.classList.contains(flagDelete);
} else if (element.tagName === 'TD') {
returnVal = DOM.getElementAttributeValueCurrent(element);
} else {
returnVal = element.textContent;
}
}
if (Validation.isEmpty(returnVal)) returnVal = '';
return returnVal;
}
}, {
key: "getElementAttributeValueCurrent",
value: function getElementAttributeValueCurrent(element) {
debugger;
if (Validation.isEmpty(element)) return null;
return element.getAttribute(attrValueCurrent);
if (!Validation.isEmpty(value) && element.type === "checkbox") {
value = value === 'true';
}
return value;
}
}, {
key: "getElementAttributeValuePrevious",
value: function getElementAttributeValuePrevious(element) {
if (Validation.isEmpty(element)) return null;
return element.getAttribute(attrValuePrevious);
if (!Validation.isEmpty(value) && element.type === "checkbox") {
value = value === 'true';
}
return value;
}
/* base_table.handleChangeElementCellTable
static updateAndCheckIsTableElementDirty(element) {
let wasDirty = DOM.isElementDirty(element);
let row = DOM.getRowFromElement(element);
let wasDirtyRow = DOM.hasDirtyChildrenNotDeletedContainer(row);
let isDirty = DOM.updateAndCheckIsElementDirty(element);
let cell = DOM.getCellFromElement(element);
console.log({element, row, cell, isDirty, wasDirty});
if (isDirty != wasDirty) {
DOM.handleDirtyElement(cell, isDirty);
let isDirtyRow = DOM.hasDirtyChildrenNotDeletedContainer(row);
console.log({isDirtyRow, wasDirtyRow});
if (isDirtyRow != wasDirtyRow) {
DOM.handleDirtyElement(row, isDirtyRow);
}
}
}
*/
/*
static updateElement(id, data) {
const element = document.getElementById(id);
if (element) {
element.textContent = data;
}
}
*/
/* non-static method on page object to use
static handleChangeElement(element) {}
*/
}, {
key: "scrollToElement",
value: function scrollToElement(parent, element) {
// REQUIRED: parent has scroll-bar
parent.scrollTop(parent.scrollTop() + (element.offset().top - parent.offset().top));
}
}, {
key: "isElementInContainer",
value: function isElementInContainer(container, element) {
if (typeof jQuery === 'function') {
if (container instanceof jQuery) container = container[0];
if (element instanceof jQuery) element = element[0];
}
var containerBounds = container.getBoundingClientRect();
var elementBounds = element.getBoundingClientRect();
return containerBounds.top <= elementBounds.top && containerBounds.left <= elementBounds.left && elementBounds.top + elementBounds.height <= containerBounds.top + containerBounds.height && elementBounds.left + elementBounds.width <= containerBounds.left + containerBounds.width;
}
}, {
key: "alertError",
value: function alertError(errorType, errorText) {
alert(errorType + '\n' + errorText);
}
}, {
key: "createOptionUnselectedProductVariation",
value: function createOptionUnselectedProductVariation() {
return _defineProperty(_defineProperty({}, flagProductVariationType, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, flagNameAttrOptionText, [flagName]), flagNameAttrOptionValue, [attrIdProductVariationType]), flagName, 'Select Variation Type'), attrIdProductVariationType, 0)), flagProductVariation, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, flagNameAttrOptionText, [flagName]), flagNameAttrOptionValue, [attrIdProductVariation]), flagName, 'Select Variation'), attrIdProductVariation, 0));
}
}, {
key: "createOption",
value: function createOption(optionJson) {
if (Validation.isEmpty(optionJson)) optionJson = {
text: 'Select',
value: 0
};
var option = document.createElement('option');
option.value = optionJson.value;
option.textContent = optionJson.text;
option.selected = optionJson.selected;
return option;
}
}]);
}();
;// ./static/js/lib/events.js
function events_typeof(o) { "@babel/helpers - typeof"; return events_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, events_typeof(o); }
function events_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
function events_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, events_toPropertyKey(o.key), o); } }
function events_createClass(e, r, t) { return r && events_defineProperties(e.prototype, r), t && events_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
function events_toPropertyKey(t) { var i = events_toPrimitive(t, "string"); return "symbol" == events_typeof(i) ? i : i + ""; }
function events_toPrimitive(t, r) { if ("object" != events_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != events_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
var Events = /*#__PURE__*/function () {
function Events() {
events_classCallCheck(this, Events);
}
return events_createClass(Events, null, [{
key: "initialiseEventHandler",
value: function initialiseEventHandler(selectorElement, classInitialised, eventHandler) {
document.querySelectorAll(selectorElement).forEach(function (element) {
if (element.classList.contains(classInitialised)) return;
element.classList.add(classInitialised);
eventHandler(element);
});
}
}]);
}();
;// ./static/js/lib/local_storage.js
function local_storage_typeof(o) { "@babel/helpers - typeof"; return local_storage_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, local_storage_typeof(o); }
function local_storage_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
function local_storage_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, local_storage_toPropertyKey(o.key), o); } }
function local_storage_createClass(e, r, t) { return r && local_storage_defineProperties(e.prototype, r), t && local_storage_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
function local_storage_toPropertyKey(t) { var i = local_storage_toPrimitive(t, "string"); return "symbol" == local_storage_typeof(i) ? i : i + ""; }
function local_storage_toPrimitive(t, r) { if ("object" != local_storage_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != local_storage_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
var LocalStorage = /*#__PURE__*/function () {
function LocalStorage() {
local_storage_classCallCheck(this, LocalStorage);
}
return local_storage_createClass(LocalStorage, null, [{
key: "getLocalStorage",
value:
/*
function getPageLocalStorage(pageHash) {
let ls;
try {
ls = JSON.parse(localStorage.getItem(pageHash));
} catch {
}
if (Validation.isEmpty(ls)) return {}
return ls;
}
function getPageLocalStorageCurrent() {
return JSON.parse(localStorage.getItem(hashPageCurrent));
}
function setPageLocalStorage(pageHash, newLS) {
localStorage.setItem(pageHash, JSON.stringify(newLS));
}
function clearPageLocalStorage(pageHash) {
localStorage.removeItem(pageHash);
}
function setupPageLocalStorage(pageHash) {
let ls = getPageLocalStorage(pageHash);
if (Validation.isEmpty(ls)) ls = {};
setPageLocalStorage(pageHash, ls);
}
*/
function getLocalStorage(key) {
return JSON.parse(localStorage.getItem(key));
}
}, {
key: "setLocalStorage",
value: function setLocalStorage(key, newLS) {
localStorage.setItem(key, JSON.stringify(newLS));
}
/*
function setupPageLocalStorageNext(pageHashNext) {
let lsOld = getPageLocalStorage(hashPageCurrent);
hashPageCurrent = pageHashNext;
clearPageLocalStorage(hashPageCurrent);
setupPageLocalStorage(hashPageCurrent);
let lsNew = getPageLocalStorage(hashPageCurrent);
lsNew[keyBasket] = (keyBasket in lsOld) ? lsOld[keyBasket] : {'items': []};
setPageLocalStorage(hashPageCurrent, lsNew);
}
*/
}]);
}();
;// ./static/js/components/common/temporary/overlay_confirm.js
function overlay_confirm_typeof(o) { "@babel/helpers - typeof"; return overlay_confirm_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, overlay_confirm_typeof(o); }
function overlay_confirm_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
function overlay_confirm_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, overlay_confirm_toPropertyKey(o.key), o); } }
function overlay_confirm_createClass(e, r, t) { return r && overlay_confirm_defineProperties(e.prototype, r), t && overlay_confirm_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
function overlay_confirm_toPropertyKey(t) { var i = overlay_confirm_toPrimitive(t, "string"); return "symbol" == overlay_confirm_typeof(i) ? i : i + ""; }
function overlay_confirm_toPrimitive(t, r) { if ("object" != overlay_confirm_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != overlay_confirm_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
var OverlayConfirm = /*#__PURE__*/function () {
function OverlayConfirm() {
overlay_confirm_classCallCheck(this, OverlayConfirm);
}
return overlay_confirm_createClass(OverlayConfirm, null, [{
key: "hookup",
value: function hookup(callbackSuccess) {
Events.initialiseEventHandler(idOverlayConfirm + ' button.' + flagCancel, flagInitialised, function (buttonCancel) {
buttonCancel.addEventListener('click', function () {
var overlay = document.querySelector(idOverlayConfirm);
overlay.style.visibility = 'hidden';
});
});
Events.initialiseEventHandler(idOverlayConfirm + ' button.' + flagSubmit, flagInitialised, function (buttonConfirm) {
buttonConfirm.addEventListener('click', function () {
var overlay = document.querySelector(idOverlayConfirm);
var textarea = overlay.querySelector('textarea');
overlay.style.visibility = 'hidden';
callbackSuccess(textarea.value);
});
});
}
}, {
key: "show",
value: function show() {
var overlay = document.querySelector(idOverlayConfirm);
overlay.classList.remove(flagCollapsed);
overlay.style.visibility = 'visible';
}
}]);
}();
;// ./static/js/pages/base.js
function base_typeof(o) { "@babel/helpers - typeof"; return base_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, base_typeof(o); }
function base_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
function base_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, base_toPropertyKey(o.key), o); } }
function base_createClass(e, r, t) { return r && base_defineProperties(e.prototype, r), t && base_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
function base_toPropertyKey(t) { var i = base_toPrimitive(t, "string"); return "symbol" == base_typeof(i) ? i : i + ""; }
function base_toPrimitive(t, r) { if ("object" != base_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != base_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
var BasePage = /*#__PURE__*/function () {
function BasePage(router) {
base_classCallCheck(this, BasePage);
if (!router) {
throw new Error("Router is required");
} else {
if (_verbose) {
console.log("initialising with router: ", router);
}
}
this.router = router;
this.title = titlePageCurrent;
// this.hash = hashPageCurrent;
if (this.constructor === BasePage) {
throw new Error("Cannot instantiate abstract class");
}
if (!this.constructor.hash) {
throw new Error("Class ".concat(this.constructor.name, " must have a static hash attribute."));
}
}
return base_createClass(BasePage, [{
key: "initialize",
value: function initialize() {
throw new Error("Method 'initialize()' must be implemented.");
}
}, {
key: "sharedInitialize",
value: function sharedInitialize() {
this.logInitialisation();
this.hookupCommonElements();
}
}, {
key: "logInitialisation",
value: function logInitialisation() {
if (_verbose) {
console.log('Initializing ' + this.title + ' page');
}
}
}, {
key: "hookupCommonElements",
value: function hookupCommonElements() {
// hookupVideos();
this.hookupLogos();
this.hookupOverlays();
}
}, {
key: "hookupEventHandler",
value: function hookupEventHandler(eventType, selector, callback) {
Events.initialiseEventHandler(selector, flagInitialised, function (element) {
element.addEventListener(eventType, function (event) {
event.stopPropagation();
callback(event, element);
});
});
}
}, {
key: "hookupLogos",
value: function hookupLogos() {
var _this = this;
this.hookupEventHandler("click", "." + flagImageLogo + "," + "." + flagLogo, function (event, element) {
if (_verbose) {
console.log('clicking logo');
}
_this.router.navigateToHash(hashPageHome);
});
}
}, {
key: "hookupOverlays",
value: function hookupOverlays() {
this.hookupOverlayFromId(idOverlayConfirm);
this.hookupOverlayFromId(idOverlayError);
}
}, {
key: "hookupOverlayFromId",
value: function hookupOverlayFromId(idOverlay) {
Events.initialiseEventHandler(idOverlay, flagInitialised, function (overlay) {
overlay.querySelector('button.' + flagCancel).addEventListener("click", function (event) {
event.stopPropagation();
overlay.style.display = 'none';
});
});
}
}, {
key: "hookupButtonSave",
value: function hookupButtonSave() {
var _this2 = this;
Events.initialiseEventHandler('form.' + flagFilter + ' button.' + flagSave, flagInitialised, function (button) {
button.addEventListener("click", function (event) {
event.stopPropagation();
if (_verbose) {
console.log('saving page: ', _this2.title);
}
OverlayConfirm.show();
});
// button.classList.add(flagCollapsed);
});
}
}, {
key: "leave",
value: function leave() {
if (_verbose) {
console.log('Leaving ' + this.title + ' page');
}
if (this.constructor === BasePage) {
throw new Error("Must implement leave() method.");
}
}
}, {
key: "setLocalStoragePage",
value: function setLocalStoragePage(dataPage) {
LocalStorage.setLocalStorage(this.hash, dataPage);
}
}, {
key: "getLocalStoragePage",
value: function getLocalStoragePage() {
return LocalStorage.getLocalStorage(this.hash);
}
}, {
key: "toggleShowButtonsSaveCancel",
value: function toggleShowButtonsSaveCancel(show) {
// , buttonSave = null, buttonCancel = null
var buttonSave = document.querySelector('form.' + flagFilter + ' button.' + flagSave);
var buttonCancel = document.querySelector('form.' + flagFilter + ' button.' + flagCancel);
if (show) {
buttonCancel.classList.remove(flagCollapsed);
buttonSave.classList.remove(flagCollapsed);
if (_verbose) {
console.log('showing buttons');
}
} else {
buttonCancel.classList.add(flagCollapsed);
buttonSave.classList.add(flagCollapsed);
if (_verbose) {
console.log('hiding buttons');
}
}
}
}], [{
key: "isDirtyFilter",
value: function isDirtyFilter(filter) {
var isDirty = DOM.updateAndCheckIsElementDirty(filter);
if (isDirty) document.querySelectorAll(idTableMain + ' tbody tr').remove();
return isDirty;
}
}]);
}();
;// ./static/js/pages/core/home.js
function home_typeof(o) { "@babel/helpers - typeof"; return home_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, home_typeof(o); }
function home_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
function home_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, home_toPropertyKey(o.key), o); } }
function home_createClass(e, r, t) { return r && home_defineProperties(e.prototype, r), t && home_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
function _possibleConstructorReturn(t, e) { if (e && ("object" == home_typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
function _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
function _get() { return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); }
function _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; }
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
function home_defineProperty(e, r, t) { return (r = home_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function home_toPropertyKey(t) { var i = home_toPrimitive(t, "string"); return "symbol" == home_typeof(i) ? i : i + ""; }
function home_toPrimitive(t, r) { if ("object" != home_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != home_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
// internal
// external
var PageHome = /*#__PURE__*/function (_BasePage) {
function PageHome(router) {
home_classCallCheck(this, PageHome);
return _callSuper(this, PageHome, [router]);
}
_inherits(PageHome, _BasePage);
return home_createClass(PageHome, [{
key: "initialize",
value: function initialize() {
this.sharedInitialize();
this.hookupButtonsNavContact();
}
}, {
key: "leave",
value: function leave() {
_superPropGet(PageHome, "leave", this, 3)([]);
}
}]);
}(BasePage);
home_defineProperty(PageHome, "hash", hashPageHome);
;// ./static/js/vendor/altcha.js
var _Qr$v, _window$__svelte;
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == altcha_typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(altcha_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
function altcha_callSuper(t, o, e) { return o = altcha_getPrototypeOf(o), altcha_possibleConstructorReturn(t, altcha_isNativeReflectConstruct() ? Reflect.construct(o, e || [], altcha_getPrototypeOf(t).constructor) : o.apply(t, e)); }
function altcha_possibleConstructorReturn(t, e) { if (e && ("object" == altcha_typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return altcha_assertThisInitialized(t); }
function altcha_assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
function altcha_superPropGet(t, o, e, r) { var p = altcha_get(altcha_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
function altcha_get() { return altcha_get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = altcha_superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, altcha_get.apply(null, arguments); }
function altcha_superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = altcha_getPrototypeOf(t));); return t; }
function altcha_inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && altcha_setPrototypeOf(t, e); }
function _wrapNativeSuper(t) { var r = "function" == typeof Map ? new Map() : void 0; return _wrapNativeSuper = function _wrapNativeSuper(t) { if (null === t || !_isNativeFunction(t)) return t; if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function"); if (void 0 !== r) { if (r.has(t)) return r.get(t); r.set(t, Wrapper); } function Wrapper() { return _construct(t, arguments, altcha_getPrototypeOf(this).constructor); } return Wrapper.prototype = Object.create(t.prototype, { constructor: { value: Wrapper, enumerable: !1, writable: !0, configurable: !0 } }), altcha_setPrototypeOf(Wrapper, t); }, _wrapNativeSuper(t); }
function _construct(t, e, r) { if (altcha_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments); var o = [null]; o.push.apply(o, e); var p = new (t.bind.apply(t, o))(); return r && altcha_setPrototypeOf(p, r.prototype), p; }
function altcha_isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (altcha_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
function _isNativeFunction(t) { try { return -1 !== Function.toString.call(t).indexOf("[native code]"); } catch (n) { return "function" == typeof t; } }
function altcha_setPrototypeOf(t, e) { return altcha_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, altcha_setPrototypeOf(t, e); }
function altcha_getPrototypeOf(t) { return altcha_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, altcha_getPrototypeOf(t); }
function altcha_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
function altcha_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, altcha_toPropertyKey(o.key), o); } }
function altcha_createClass(e, r, t) { return r && altcha_defineProperties(e.prototype, r), t && altcha_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { altcha_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function altcha_defineProperty(e, r, t) { return (r = altcha_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function altcha_toPropertyKey(t) { var i = altcha_toPrimitive(t, "string"); return "symbol" == altcha_typeof(i) ? i : i + ""; }
function altcha_toPrimitive(t, r) { if ("object" != altcha_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != altcha_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
function _toArray(r) { return _arrayWithHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableRest(); }
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n2 = 0, F = function F() {}; return { s: F, n: function n() { return _n2 >= r.length ? { done: !0 } : { done: !1, value: r[_n2++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
function altcha_typeof(o) { "@babel/helpers - typeof"; return altcha_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, altcha_typeof(o); }
var hi = Object.defineProperty;
var Or = function Or(e) {
throw TypeError(e);
};
var gi = function gi(e, t, r) {
return t in e ? hi(e, t, {
enumerable: !0,
configurable: !0,
writable: !0,
value: r
}) : e[t] = r;
};
var ne = function ne(e, t, r) {
return gi(e, altcha_typeof(t) != "symbol" ? t + "" : t, r);
},
zr = function zr(e, t, r) {
return t.has(e) || Or("Cannot " + r);
};
var H = function H(e, t, r) {
return zr(e, t, "read from private field"), r ? r.call(e) : t.get(e);
},
Mt = function Mt(e, t, r) {
return t.has(e) ? Or("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, r);
},
Ut = function Ut(e, t, r, l) {
return zr(e, t, "write to private field"), l ? l.call(e, r) : t.set(e, r), r;
};
var en = "(function(){\"use strict\";const d=new TextEncoder;function p(e){return[...new Uint8Array(e)].map(t=>t.toString(16).padStart(2,\"0\")).join(\"\")}async function b(e,t,r){if(typeof crypto>\"u\"||!(\"subtle\"in crypto)||!(\"digest\"in crypto.subtle))throw new Error(\"Web Crypto is not available. Secure context is required (https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts).\");return p(await crypto.subtle.digest(r.toUpperCase(),d.encode(e+t)))}function w(e,t,r=\"SHA-256\",n=1e6,s=0){const o=new AbortController,a=Date.now();return{promise:(async()=>{for(let c=s;c<=n;c+=1){if(o.signal.aborted)return null;if(await b(t,c,r)===e)return{number:c,took:Date.now()-a}}return null})(),controller:o}}function h(e){const t=atob(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}function g(e,t=12){const r=new Uint8Array(t);for(let n=0;n<t;n++)r[n]=e%256,e=Math.floor(e/256);return r}async function m(e,t=\"\",r=1e6,n=0){const s=\"AES-GCM\",o=new AbortController,a=Date.now(),l=async()=>{for(let u=n;u<=r;u+=1){if(o.signal.aborted||!c||!y)return null;try{const f=await crypto.subtle.decrypt({name:s,iv:g(u)},c,y);if(f)return{clearText:new TextDecoder().decode(f),took:Date.now()-a}}catch{}}return null};let c=null,y=null;try{y=h(e);const u=await crypto.subtle.digest(\"SHA-256\",d.encode(t));c=await crypto.subtle.importKey(\"raw\",u,s,!1,[\"decrypt\"])}catch{return{promise:Promise.reject(),controller:o}}return{promise:l(),controller:o}}let i;onmessage=async e=>{const{type:t,payload:r,start:n,max:s}=e.data;let o=null;if(t===\"abort\")i==null||i.abort(),i=void 0;else if(t===\"work\"){if(\"obfuscated\"in r){const{key:a,obfuscated:l}=r||{};o=await m(l,a,s,n)}else{const{algorithm:a,challenge:l,salt:c}=r||{};o=w(l,c,a,s,n)}i=o.controller,o.promise.then(a=>{self.postMessage(a&&{...a,worker:!0})})}}})();\n",
Fr = (typeof self === "undefined" ? "undefined" : altcha_typeof(self)) < "u" && self.Blob && new Blob([en], {
type: "text/javascript;charset=utf-8"
});
function _i(e) {
var t;
try {
if (t = Fr && (self.URL || self.webkitURL).createObjectURL(Fr), !t) throw "";
var r = new Worker(t, {
name: e == null ? void 0 : e.name
});
return r.addEventListener("error", function () {
(self.URL || self.webkitURL).revokeObjectURL(t);
}), r;
} catch (_unused) {
return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(en), {
name: e == null ? void 0 : e.name
});
} finally {
t && (self.URL || self.webkitURL).revokeObjectURL(t);
}
}
var mi = "5";
var Qr;
(typeof window === "undefined" ? "undefined" : altcha_typeof(window)) < "u" && ((_Qr$v = (Qr = (_window$__svelte = window.__svelte) !== null && _window$__svelte !== void 0 ? _window$__svelte : window.__svelte = {}).v) !== null && _Qr$v !== void 0 ? _Qr$v : Qr.v = /* @__PURE__ */new Set()).add(mi);
var wi = 1,
pi = 4,
yi = 8,
bi = 16,
Ei = 1,
xi = 2,
Wt = "[",
tn = "[!",
rn = "]",
Je = {},
W = Symbol(),
$i = "http://www.w3.org/1999/xhtml",
Mr = !1,
oe = 2,
nn = 4,
It = 8,
Yt = 16,
pe = 32,
ze = 64,
yt = 128,
re = 256,
bt = 512,
K = 1024,
ye = 2048,
et = 4096,
Ke = 8192,
St = 16384,
ki = 32768,
Zt = 65536,
Ci = 1 << 19,
ln = 1 << 20,
ut = Symbol("$state"),
an = Symbol("legacy props"),
Ai = Symbol("");
var on = Array.isArray,
Ri = Array.prototype.indexOf,
Ii = Array.from,
Et = Object.keys,
xt = Object.defineProperty,
Pe = Object.getOwnPropertyDescriptor,
Si = Object.getOwnPropertyDescriptors,
Ti = Object.prototype,
Ni = Array.prototype,
sn = Object.getPrototypeOf;
function fn(e) {
for (var t = 0; t < e.length; t++) e[t]();
}
var Li = (typeof requestIdleCallback === "undefined" ? "undefined" : altcha_typeof(requestIdleCallback)) > "u" ? function (e) {
return setTimeout(e, 1);
} : requestIdleCallback;
var dt = [],
vt = [];
function un() {
var e = dt;
dt = [], fn(e);
}
function cn() {
var e = vt;
vt = [], fn(e);
}
function Gt(e) {
dt.length === 0 && queueMicrotask(un), dt.push(e);
}
function Di(e) {
vt.length === 0 && Li(cn), vt.push(e);
}
function Ur() {
dt.length > 0 && un(), vt.length > 0 && cn();
}
function dn(e) {
return e === this.v;
}
function Pi(e, t) {
return e != e ? t == t : e !== t || e !== null && altcha_typeof(e) == "object" || typeof e == "function";
}
function vn(e) {
return !Pi(e, this.v);
}
function Oi(e) {
throw new Error("https://svelte.dev/e/effect_in_teardown");
}
function zi() {
throw new Error("https://svelte.dev/e/effect_in_unowned_derived");
}
function Fi(e) {
throw new Error("https://svelte.dev/e/effect_orphan");
}
function Mi() {
throw new Error("https://svelte.dev/e/effect_update_depth_exceeded");
}
function Ui() {
throw new Error("https://svelte.dev/e/hydration_failed");
}
function ji(e) {
throw new Error("https://svelte.dev/e/props_invalid_value");
}
function Vi() {
throw new Error("https://svelte.dev/e/state_descriptors_fixed");
}
function Bi() {
throw new Error("https://svelte.dev/e/state_prototype_fixed");
}
function qi() {
throw new Error("https://svelte.dev/e/state_unsafe_local_read");
}
function Hi() {
throw new Error("https://svelte.dev/e/state_unsafe_mutation");
}
var Wi = !1;
function ue(e, t) {
var r = {
f: 0,
// TODO ideally we could skip this altogether, but it causes type errors
v: e,
reactions: null,
equals: dn,
rv: 0,
wv: 0
};
return r;
}
function He(e) {
return /* @__PURE__ */Yi(ue(e));
}
// @__NO_SIDE_EFFECTS__
function hn(e) {
var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
var r = ue(e);
return t || (r.equals = vn), r;
}
// @__NO_SIDE_EFFECTS__
function Yi(e) {
return k !== null && !ae && (k.f & oe) !== 0 && (ce === null ? Qi([e]) : ce.push(e)), e;
}
function P(e, t) {
return k !== null && !ae && Dn() && (k.f & (oe | Yt)) !== 0 && (
// If the source was created locally within the current derived, then
// we allow the mutation.
ce === null || !ce.includes(e)) && Hi(), Zi(e, t);
}
function Zi(e, t) {
return e.equals(t) || (e.v, e.v = t, e.wv = En(), gn(e, ye), A !== null && (A.f & K) !== 0 && (A.f & (pe | ze)) === 0 && (ge === null ? el([e]) : ge.push(e))), t;
}
function gn(e, t) {
var r = e.reactions;
if (r !== null) for (var l = r.length, i = 0; i < l; i++) {
var a = r[i],
o = a.f;
(o & ye) === 0 && (de(a, t), (o & (K | re)) !== 0 && ((o & oe) !== 0 ? gn(/** @type {Derived} */
a, et) : Lt(/** @type {Effect} */
a)));
}
}
// @__NO_SIDE_EFFECTS__
function De(e) {
var t = oe | ye,
r = k !== null && (k.f & oe) !== 0 ? (/** @type {Derived} */
k) : null;
return A === null || r !== null && (r.f & re) !== 0 ? t |= re : A.f |= ln, {
ctx: B,
deps: null,
effects: null,
equals: dn,
f: t,
fn: e,
reactions: null,
rv: 0,
v: (/** @type {V} */
null),
wv: 0,
parent: r !== null && r !== void 0 ? r : A
};
}
function _n(e) {
var t = e.effects;
if (t !== null) {
e.effects = null;
for (var r = 0; r < t.length; r += 1) we(/** @type {Effect} */
t[r]);
}
}
function Gi(e) {
for (var t = e.parent; t !== null;) {
if ((t.f & oe) === 0) return /** @type {Effect} */t;
t = t.parent;
}
return null;
}
function Ji(e) {
var t,
r = A;
Se(Gi(e));
try {
_n(e), t = $n(e);
} finally {
Se(r);
}
return t;
}
function mn(e) {
var t = Ji(e),
r = (Ce || (e.f & re) !== 0) && e.deps !== null ? et : K;
de(e, r), e.equals(t) || (e.v = t, e.wv = En());
}
function Tt(e) {
console.warn("https://svelte.dev/e/hydration_mismatch");
}
var D = !1;
function Ge(e) {
D = e;
}
var O;
function Re(e) {
if (e === null) throw Tt(), Je;
return O = e;
}
function Xe() {
return Re(/** @type {TemplateNode} */
/* @__PURE__ */Te(O));
}
function Z(e) {
if (D) {
if (/* @__PURE__ */Te(O) !== null) throw Tt(), Je;
O = e;
}
}
function Ki() {
for (var e = 0, t = O;;) {
if (t.nodeType === 8) {
var r = /** @type {Comment} */
t.data;
if (r === rn) {
if (e === 0) return t;
e -= 1;
} else (r === Wt || r === tn) && (e += 1);
}
var l = /** @type {TemplateNode} */
/* @__PURE__ */Te(t);
t.remove(), t = l;
}
}
function le(e) {
var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
var r = arguments.length > 2 ? arguments[2] : undefined;
if (altcha_typeof(e) != "object" || e === null || ut in e) return e;
var l = sn(e);
if (l !== Ti && l !== Ni) return e;
var i = /* @__PURE__ */new Map(),
a = on(e),
o = ue(0);
a && i.set("length", ue(/** @type {any[]} */
e.length));
var f;
return new Proxy(/** @type {any} */
e, {
defineProperty: function defineProperty(s, c, v) {
(!("value" in v) || v.configurable === !1 || v.enumerable === !1 || v.writable === !1) && Vi();
var h = i.get(c);
return h === void 0 ? (h = ue(v.value), i.set(c, h)) : P(h, le(v.value, f)), !0;
},
deleteProperty: function deleteProperty(s, c) {
var v = i.get(c);
if (v === void 0) c in s && i.set(c, ue(W));else {
if (a && typeof c == "string") {
var h = /** @type {Source<number>} */
i.get("length"),
g = Number(c);
Number.isInteger(g) && g < h.v && P(h, g);
}
P(v, W), jr(o);
}
return !0;
},
get: function get(s, c, v) {
var w;
if (c === ut) return e;
var h = i.get(c),
g = c in s;
if (h === void 0 && (!g || (w = Pe(s, c)) != null && w.writable) && (h = ue(le(g ? s[c] : W, f)), i.set(c, h)), h !== void 0) {
var m = d(h);
return m === W ? void 0 : m;
}
return Reflect.get(s, c, v);
},
getOwnPropertyDescriptor: function getOwnPropertyDescriptor(s, c) {
var v = Reflect.getOwnPropertyDescriptor(s, c);
if (v && "value" in v) {
var h = i.get(c);
h && (v.value = d(h));
} else if (v === void 0) {
var g = i.get(c),
m = g == null ? void 0 : g.v;
if (g !== void 0 && m !== W) return {
enumerable: !0,
configurable: !0,
value: m,
writable: !0
};
}
return v;
},
has: function has(s, c) {
var m;
if (c === ut) return !0;
var v = i.get(c),
h = v !== void 0 && v.v !== W || Reflect.has(s, c);
if (v !== void 0 || A !== null && (!h || (m = Pe(s, c)) != null && m.writable)) {
v === void 0 && (v = ue(h ? le(s[c], f) : W), i.set(c, v));
var g = d(v);
if (g === W) return !1;
}
return h;
},
set: function set(s, c, v, h) {
var F;
var g = i.get(c),
m = c in s;
if (a && c === "length") for (var w = v; w < /** @type {Source<number>} */
g.v; w += 1) {
var z = i.get(w + "");
z !== void 0 ? P(z, W) : w in s && (z = ue(W), i.set(w + "", z));
}
g === void 0 ? (!m || (F = Pe(s, c)) != null && F.writable) && (g = ue(void 0), P(g, le(v, f)), i.set(c, g)) : (m = g.v !== W, P(g, le(v, f)));
var T = Reflect.getOwnPropertyDescriptor(s, c);
if (T != null && T.set && T.set.call(h, v), !m) {
if (a && typeof c == "string") {
var Y = /** @type {Source<number>} */
i.get("length"),
M = Number(c);
Number.isInteger(M) && M >= Y.v && P(Y, M + 1);
}
jr(o);
}
return !0;
},
ownKeys: function ownKeys(s) {
d(o);
var c = Reflect.ownKeys(s).filter(function (g) {
var m = i.get(g);
return m === void 0 || m.v !== W;
});
var _iterator = _createForOfIteratorHelper(i),
_step;
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var _step$value = _slicedToArray(_step.value, 2),
v = _step$value[0],
h = _step$value[1];
h.v !== W && !(v in s) && c.push(v);
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
return c;
},
setPrototypeOf: function setPrototypeOf() {
Bi();
}
});
}
function jr(e) {
var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
P(e, e.v + t);
}
var Vr, wn, pn, yn;
function jt() {
if (Vr === void 0) {
Vr = window, wn = /Firefox/.test(navigator.userAgent);
var e = Element.prototype,
t = Node.prototype;
pn = Pe(t, "firstChild").get, yn = Pe(t, "nextSibling").get, e.__click = void 0, e.__className = void 0, e.__attributes = null, e.__style = void 0, e.__e = void 0, Text.prototype.__t = void 0;
}
}
function Jt() {
var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
return document.createTextNode(e);
}
// @__NO_SIDE_EFFECTS__
function me(e) {
return pn.call(e);
}
// @__NO_SIDE_EFFECTS__
function Te(e) {
return yn.call(e);
}
function G(e, t) {
if (!D) return /* @__PURE__ */me(e);
var r = /** @type {TemplateNode} */
/* @__PURE__ */me(O);
return r === null && (r = O.appendChild(Jt())), Re(r), r;
}
function Br(e, t) {
if (!D) {
var r = /** @type {DocumentFragment} */
/* @__PURE__ */me(/** @type {Node} */
e);
return r instanceof Comment && r.data === "" ? /* @__PURE__ */Te(r) : r;
}
return O;
}
function he(e) {
var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
var r = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !1;
var l = D ? O : e;
for (var i; t--;) i = l, l = /** @type {TemplateNode} */
/* @__PURE__ */Te(l);
if (!D) return l;
var a = l == null ? void 0 : l.nodeType;
if (r && a !== 3) {
var o = Jt();
return l === null ? i == null || i.after(o) : l.before(o), Re(o), o;
}
return Re(l), /** @type {TemplateNode} */
l;
}
function Xi(e) {
e.textContent = "";
}
var wt = !1,
$t = !1,
kt = null,
Oe = !1,
Kt = !1;
function qr(e) {
Kt = e;
}
var ct = [];
var k = null,
ae = !1;
function Ie(e) {
k = e;
}
var A = null;
function Se(e) {
A = e;
}
var ce = null;
function Qi(e) {
ce = e;
}
var V = null,
J = 0,
ge = null;
function el(e) {
ge = e;
}
var bn = 1,
Ct = 0,
Ce = !1;
function En() {
return ++bn;
}
function ht(e) {
var h;
var t = e.f;
if ((t & ye) !== 0) return !0;
if ((t & et) !== 0) {
var r = e.deps,
l = (t & re) !== 0;
if (r !== null) {
var i,
a,
o = (t & bt) !== 0,
f = l && A !== null && !Ce,
s = r.length;
if (o || f) {
var c = /** @type {Derived} */
e,
v = c.parent;
for (i = 0; i < s; i++) {
var _a$reactions;
a = r[i], (o || !((h = a == null ? void 0 : a.reactions) != null && h.includes(c))) && ((_a$reactions = a.reactions) !== null && _a$reactions !== void 0 ? _a$reactions : a.reactions = []).push(c);
}
o && (c.f ^= bt), f && v !== null && (v.f & re) === 0 && (c.f ^= re);
}
for (i = 0; i < s; i++) if (a = r[i], ht(/** @type {Derived} */
a) && mn(/** @type {Derived} */
a), a.wv > e.wv) return !0;
}
(!l || A !== null && !Ce) && de(e, K);
}
return !1;
}
function tl(e, t) {
for (var r = t; r !== null;) {
if ((r.f & yt) !== 0) try {
r.fn(e);
return;
} catch (_unused2) {
r.f ^= yt;
}
r = r.parent;
}
throw wt = !1, e;
}
function rl(e) {
return (e.f & St) === 0 && (e.parent === null || (e.parent.f & yt) === 0);
}
function Nt(e, t, r, l) {
if (wt) {
if (r === null && (wt = !1), rl(t)) throw e;
return;
}
r !== null && (wt = !0);
{
tl(e, t);
return;
}
}
function xn(e, t) {
var r = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : !0;
var l = e.reactions;
if (l !== null) for (var i = 0; i < l.length; i++) {
var a = l[i];
(a.f & oe) !== 0 ? xn(/** @type {Derived} */
a, t, !1) : t === a && (r ? de(a, ye) : (a.f & K) !== 0 && de(a, et), Lt(/** @type {Effect} */
a));
}
}
function $n(e) {
var m;
var t = V,
r = J,
l = ge,
i = k,
a = Ce,
o = ce,
f = B,
s = ae,
c = e.f;
V = /** @type {null | Value[]} */
null, J = 0, ge = null, Ce = (c & re) !== 0 && (ae || !Oe || k === null), k = (c & (pe | ze)) === 0 ? e : null, ce = null, Wr(e.ctx), ae = !1, Ct++;
try {
var v = /** @type {Function} */
(0, e.fn)(),
h = e.deps;
if (V !== null) {
var g;
if (At(e, J), h !== null && J > 0) for (h.length = J + V.length, g = 0; g < V.length; g++) h[J + g] = V[g];else e.deps = h = V;
if (!Ce) for (g = J; g < h.length; g++) {
var _m$reactions;
((_m$reactions = (m = h[g]).reactions) !== null && _m$reactions !== void 0 ? _m$reactions : m.reactions = []).push(e);
}
} else h !== null && J < h.length && (At(e, J), h.length = J);
if (Dn() && ge !== null && !ae && h !== null && (e.f & (oe | et | ye)) === 0) for (g = 0; g < /** @type {Source[]} */
ge.length; g++) xn(ge[g], /** @type {Effect} */
e);
return i !== null && Ct++, v;
} finally {
V = t, J = r, ge = l, k = i, Ce = a, ce = o, Wr(f), ae = s;
}
}
function nl(e, t) {
var r = t.reactions;
if (r !== null) {
var l = Ri.call(r, e);
if (l !== -1) {
var i = r.length - 1;
i === 0 ? r = t.reactions = null : (r[l] = r[i], r.pop());
}
}
r === null && (t.f & oe) !== 0 && (
// Destroying a child effect while updating a parent effect can cause a dependency to appear
// to be unused, when in fact it is used by the currently-updating parent. Checking `new_deps`
// allows us to skip the expensive work of disconnecting and immediately reconnecting it
V === null || !V.includes(t)) && (de(t, et), (t.f & (re | bt)) === 0 && (t.f ^= bt), _n(/** @type {Derived} **/
t), At(/** @type {Derived} **/
t, 0));
}
function At(e, t) {
var r = e.deps;
if (r !== null) for (var l = t; l < r.length; l++) nl(e, r[l]);
}
function Xt(e) {
var t = e.f;
if ((t & St) === 0) {
de(e, K);
var r = A,
l = B,
i = Oe;
A = e, Oe = !0;
try {
(t & Yt) !== 0 ? hl(e) : An(e), Cn(e);
var a = $n(e);
e.teardown = typeof a == "function" ? a : null, e.wv = bn;
var o = e.deps,
f;
Mr && Wi && e.f & ye;
} catch (s) {
Nt(s, e, r, l || e.ctx);
} finally {
Oe = i, A = r;
}
}
}
function il() {
try {
Mi();
} catch (e) {
if (kt !== null) Nt(e, kt, null);else throw e;
}
}
function kn() {
var e = Oe;
try {
var t = 0;
for (Oe = !0; ct.length > 0;) {
t++ > 1e3 && il();
var r = ct,
l = r.length;
ct = [];
for (var i = 0; i < l; i++) {
var a = al(r[i]);
ll(a);
}
}
} finally {
$t = !1, Oe = e, kt = null;
}
}
function ll(e) {
var t = e.length;
if (t !== 0) for (var r = 0; r < t; r++) {
var l = e[r];
if ((l.f & (St | Ke)) === 0) try {
ht(l) && (Xt(l), l.deps === null && l.first === null && l.nodes_start === null && (l.teardown === null ? Rn(l) : l.fn = null));
} catch (i) {
Nt(i, l, null, l.ctx);
}
}
}
function Lt(e) {
$t || ($t = !0, queueMicrotask(kn));
for (var t = kt = e; t.parent !== null;) {
t = t.parent;
var r = t.f;
if ((r & (ze | pe)) !== 0) {
if ((r & K) === 0) return;
t.f ^= K;
}
}
ct.push(t);
}
function al(e) {
for (var t = [], r = e; r !== null;) {
var l = r.f,
i = (l & (pe | ze)) !== 0,
a = i && (l & K) !== 0;
if (!a && (l & Ke) === 0) {
if ((l & nn) !== 0) t.push(r);else if (i) r.f ^= K;else {
var o = k;
try {
k = r, ht(r) && Xt(r);
} catch (c) {
Nt(c, r, null, r.ctx);
} finally {
k = o;
}
}
var f = r.first;
if (f !== null) {
r = f;
continue;
}
}
var s = r.parent;
for (r = r.next; r === null && s !== null;) r = s.next, s = s.parent;
}
return t;
}
function $(e) {
var t;
for (Ur(); ct.length > 0;) $t = !0, kn(), Ur();
return /** @type {T} */t;
}
function ol() {
return _ol.apply(this, arguments);
}
function _ol() {
_ol = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
while (1) switch (_context9.prev = _context9.next) {
case 0:
_context9.next = 2;
return Promise.resolve();
case 2:
$();
case 3:
case "end":
return _context9.stop();
}
}, _callee9);
}));
return _ol.apply(this, arguments);
}
function d(e) {
var t = e.f,
r = (t & oe) !== 0;
if (k !== null && !ae) {
ce !== null && ce.includes(e) && qi();
var l = k.deps;
e.rv < Ct && (e.rv = Ct, V === null && l !== null && l[J] === e ? J++ : V === null ? V = [e] : (!Ce || !V.includes(e)) && V.push(e));
} else if (r && /** @type {Derived} */
e.deps === null && /** @type {Derived} */
e.effects === null) {
var i = /** @type {Derived} */
e,
a = i.parent;
a !== null && (a.f & re) === 0 && (i.f ^= re);
}
return r && (i = /** @type {Derived} */
e, ht(i) && mn(i)), e.v;
}
function Qe(e) {
var t = ae;
try {
return ae = !0, e();
} finally {
ae = t;
}
}
var sl = -7169;
function de(e, t) {
e.f = e.f & sl | t;
}
function fl(e) {
A === null && k === null && Fi(), k !== null && (k.f & re) !== 0 && A === null && zi(), Kt && Oi();
}
function ul(e, t) {
var r = t.last;
r === null ? t.last = t.first = e : (r.next = e, e.prev = r, t.last = e);
}
function Fe(e, t, r) {
var l = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !0;
var i = A,
a = {
ctx: B,
deps: null,
nodes_start: null,
nodes_end: null,
f: e | ye,
first: null,
fn: t,
last: null,
next: null,
parent: i,
prev: null,
teardown: null,
transitions: null,
wv: 0
};
if (r) try {
Xt(a), a.f |= ki;
} catch (s) {
throw we(a), s;
} else t !== null && Lt(a);
var o = r && a.deps === null && a.first === null && a.nodes_start === null && a.teardown === null && (a.f & (ln | yt)) === 0;
if (!o && l && (i !== null && ul(a, i), k !== null && (k.f & oe) !== 0)) {
var _f$effects;
var f = /** @type {Derived} */
k;
((_f$effects = f.effects) !== null && _f$effects !== void 0 ? _f$effects : f.effects = []).push(a);
}
return a;
}
function cl(e) {
var t = Fe(It, null, !1);
return de(t, K), t.teardown = e, t;
}
function Vt(e) {
fl();
var t = A !== null && (A.f & pe) !== 0 && B !== null && !B.m;
if (t) {
var _r$e;
var r = /** @type {ComponentContext} */
B;
((_r$e = r.e) !== null && _r$e !== void 0 ? _r$e : r.e = []).push({
fn: e,
effect: A,
reaction: k
});
} else {
var l = Qt(e);
return l;
}
}
function dl(e) {
var t = Fe(ze, e, !0);
return function () {
we(t);
};
}
function vl(e) {
var t = Fe(ze, e, !0);
return function () {
var r = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
return new Promise(function (l) {
r.outro ? Bt(t, function () {
we(t), l(void 0);
}) : (we(t), l(void 0));
});
};
}
function Qt(e) {
return Fe(nn, e, !1);
}
function er(e) {
return Fe(It, e, !0);
}
function We(e) {
var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
var r = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : De;
var l = t.map(r);
return tr(function () {
return e.apply(void 0, _toConsumableArray(l.map(d)));
});
}
function tr(e) {
var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
return Fe(It | Yt | t, e, !0);
}
function Rt(e) {
var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
return Fe(It | pe, e, !0, t);
}
function Cn(e) {
var t = e.teardown;
if (t !== null) {
var r = Kt,
l = k;
qr(!0), Ie(null);
try {
t.call(null);
} finally {
qr(r), Ie(l);
}
}
}
function An(e) {
var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
var r = e.first;
for (e.first = e.last = null; r !== null;) {
var l = r.next;
(r.f & ze) !== 0 ? r.parent = null : we(r, t), r = l;
}
}
function hl(e) {
for (var t = e.first; t !== null;) {
var r = t.next;
(t.f & pe) === 0 && we(t), t = r;
}
}
function we(e) {
var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
var r = !1;
if ((t || (e.f & Ci) !== 0) && e.nodes_start !== null) {
for (var l = e.nodes_start, i = e.nodes_end; l !== null;) {
var a = l === i ? null : (/** @type {TemplateNode} */
/* @__PURE__ */Te(l));
l.remove(), l = a;
}
r = !0;
}
An(e, t && !r), At(e, 0), de(e, St);
var o = e.transitions;
if (o !== null) {
var _iterator2 = _createForOfIteratorHelper(o),
_step2;
try {
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
var s = _step2.value;
s.stop();
}
} catch (err) {
_iterator2.e(err);
} finally {
_iterator2.f();
}
}
Cn(e);
var f = e.parent;
f !== null && f.first !== null && Rn(e), e.next = e.prev = e.teardown = e.ctx = e.deps = e.fn = e.nodes_start = e.nodes_end = null;
}
function Rn(e) {
var t = e.parent,
r = e.prev,
l = e.next;
r !== null && (r.next = l), l !== null && (l.prev = r), t !== null && (t.first === e && (t.first = l), t.last === e && (t.last = r));
}
function Bt(e, t) {
var r = [];
In(e, r, !0), gl(r, function () {
we(e), t && t();
});
}
function gl(e, t) {
var r = e.length;
if (r > 0) {
var l = function l() {
return --r || t();
};
var _iterator3 = _createForOfIteratorHelper(e),
_step3;
try {
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
var i = _step3.value;
i.out(l);
}
} catch (err) {
_iterator3.e(err);
} finally {
_iterator3.f();
}
} else t();
}
function In(e, t, r) {
if ((e.f & Ke) === 0) {
if (e.f ^= Ke, e.transitions !== null) {
var _iterator4 = _createForOfIteratorHelper(e.transitions),
_step4;
try {
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
var o = _step4.value;
(o.is_global || r) && t.push(o);
}
} catch (err) {
_iterator4.e(err);
} finally {
_iterator4.f();
}
}
for (var l = e.first; l !== null;) {
var i = l.next,
a = (l.f & Zt) !== 0 || (l.f & pe) !== 0;
In(l, t, a ? r : !1), l = i;
}
}
}
function Hr(e) {
Sn(e, !0);
}
function Sn(e, t) {
if ((e.f & Ke) !== 0) {
e.f ^= Ke, (e.f & K) === 0 && (e.f ^= K), ht(e) && (de(e, ye), Lt(e));
for (var r = e.first; r !== null;) {
var l = r.next,
i = (r.f & Zt) !== 0 || (r.f & pe) !== 0;
Sn(r, i ? t : !1), r = l;
}
if (e.transitions !== null) {
var _iterator5 = _createForOfIteratorHelper(e.transitions),
_step5;
try {
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
var a = _step5.value;
(a.is_global || t) && a["in"]();
}
} catch (err) {
_iterator5.e(err);
} finally {
_iterator5.f();
}
}
}
}
function Tn(e) {
throw new Error("https://svelte.dev/e/lifecycle_outside_component");
}
var B = null;
function Wr(e) {
B = e;
}
function Nn(e) {
var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !1;
var r = arguments.length > 2 ? arguments[2] : undefined;
B = {
p: B,
c: null,
e: null,
m: !1,
s: e,
x: null,
l: null
};
}
function Ln(e) {
var t = B;
if (t !== null) {
e !== void 0 && (t.x = e);
var o = t.e;
if (o !== null) {
var r = A,
l = k;
t.e = null;
try {
for (var i = 0; i < o.length; i++) {
var a = o[i];
Se(a.effect), Ie(a.reaction), Qt(a.fn);
}
} finally {
Se(r), Ie(l);
}
}
B = t.p, t.m = !0;
}
return e || /** @type {T} */
{};
}
function Dn() {
return !0;
}
var _l = ["touchstart", "touchmove"];
function ml(e) {
return _l.includes(e);
}
var Yr = !1;
function Pn() {
Yr || (Yr = !0, document.addEventListener("reset", function (e) {
Promise.resolve().then(function () {
var t;
if (!e.defaultPrevented) {
var _iterator6 = _createForOfIteratorHelper(/**@type {HTMLFormElement} */
e.target.elements),
_step6;
try {
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
var r = _step6.value;
(t = r.__on_r) == null || t.call(r);
}
} catch (err) {
_iterator6.e(err);
} finally {
_iterator6.f();
}
}
});
},
// In the capture phase to guarantee we get noticed of it (no possiblity of stopPropagation)
{
capture: !0
}));
}
function On(e) {
var t = k,
r = A;
Ie(null), Se(null);
try {
return e();
} finally {
Ie(t), Se(r);
}
}
function wl(e, t, r) {
var l = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : r;
e.addEventListener(t, function () {
return On(r);
});
var i = e.__on_r;
i ? e.__on_r = function () {
i(), l(!0);
} : e.__on_r = function () {
return l(!0);
}, Pn();
}
var zn = /* @__PURE__ */new Set(),
qt = /* @__PURE__ */new Set();
function pl(e, t, r) {
var l = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
function i(a) {
var _this = this;
if (l.capture || ft.call(t, a), !a.cancelBubble) return On(function () {
return r == null ? void 0 : r.call(_this, a);
});
}
return e.startsWith("pointer") || e.startsWith("touch") || e === "wheel" ? Gt(function () {
t.addEventListener(e, i, l);
}) : t.addEventListener(e, i, l), i;
}
function yl(e, t, r, l, i) {
var a = {
capture: l,
passive: i
},
o = pl(e, t, r, a);
(t === document.body || t === window || t === document) && cl(function () {
t.removeEventListener(e, o, a);
});
}
function bl(e) {
for (var t = 0; t < e.length; t++) zn.add(e[t]);
var _iterator7 = _createForOfIteratorHelper(qt),
_step7;
try {
for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
var r = _step7.value;
r(e);
}
} catch (err) {
_iterator7.e(err);
} finally {
_iterator7.f();
}
}
function ft(e) {
var M;
var t = this,
r = /** @type {Node} */
t.ownerDocument,
l = e.type,
i = ((M = e.composedPath) == null ? void 0 : M.call(e)) || [],
a = /** @type {null | Element} */
i[0] || e.target,
o = 0,
f = e.__root;
if (f) {
var s = i.indexOf(f);
if (s !== -1 && (t === document || t === /** @type {any} */
window)) {
e.__root = t;
return;
}
var c = i.indexOf(t);
if (c === -1) return;
s <= c && (o = s);
}
if (a = /** @type {Element} */
i[o] || e.target, a !== t) {
xt(e, "currentTarget", {
configurable: !0,
get: function get() {
return a || r;
}
});
var v = k,
h = A;
Ie(null), Se(null);
try {
for (var g, m = []; a !== null;) {
var w = a.assignedSlot || a.parentNode || /** @type {any} */
a.host || null;
try {
var z = a["__" + l];
if (z != null && (! /** @type {any} */
a.disabled ||
// DOM could've been updated already by the time this is reached, so we check this as well
// -> the target could not have been disabled because it emits the event in the first place
e.target === a)) if (on(z)) {
var _z = z,
_z2 = _toArray(_z),
T = _z2[0],
Y = _z2.slice(1);
T.apply(a, [e].concat(_toConsumableArray(Y)));
} else z.call(a, e);
} catch (F) {
g ? m.push(F) : g = F;
}
if (e.cancelBubble || w === t || w === null) break;
a = w;
}
if (g) {
var _iterator8 = _createForOfIteratorHelper(m),
_step8;
try {
var _loop = function _loop() {
var F = _step8.value;
queueMicrotask(function () {
throw F;
});
};
for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
_loop();
}
} catch (err) {
_iterator8.e(err);
} finally {
_iterator8.f();
}
throw g;
}
} finally {
e.__root = t, delete e.currentTarget, Ie(v), Se(h);
}
}
}
function rr(e) {
var t = document.createElement("template");
return t.innerHTML = e, t.content;
}
function Ae(e, t) {
var r = /** @type {Effect} */
A;
r.nodes_start === null && (r.nodes_start = e, r.nodes_end = t);
}
// @__NO_SIDE_EFFECTS__
function ve(e, t) {
var r = (t & Ei) !== 0,
l = (t & xi) !== 0,
i,
a = !e.startsWith("<!>");
return function () {
if (D) return Ae(O, null), O;
i === void 0 && (i = rr(a ? e : "<!>" + e), r || (i = /** @type {Node} */
/* @__PURE__ */me(i)));
var o = /** @type {TemplateNode} */
l || wn ? document.importNode(i, !0) : i.cloneNode(!0);
if (r) {
var f = /** @type {TemplateNode} */
/* @__PURE__ */me(o),
s = /** @type {TemplateNode} */
o.lastChild;
Ae(f, s);
} else Ae(o, o);
return o;
};
}
// @__NO_SIDE_EFFECTS__
function El(e, t) {
var r = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "svg";
var l = !e.startsWith("<!>"),
i = "<".concat(r, ">").concat(l ? e : "<!>" + e, "</").concat(r, ">"),
a;
return function () {
if (D) return Ae(O, null), O;
if (!a) {
var o = /** @type {DocumentFragment} */
rr(i),
f = /** @type {Element} */
/* @__PURE__ */me(o);
a = /** @type {Element} */
/* @__PURE__ */me(f);
}
var s = /** @type {TemplateNode} */
a.cloneNode(!0);
return Ae(s, s), s;
};
}
function ee(e, t) {
if (D) {
A.nodes_end = O, Xe();
return;
}
e !== null && e.before(/** @type {Node} */
t);
}
function Fn(e, t) {
return Mn(e, t);
}
function xl(e, t) {
var _t$intro;
jt(), t.intro = (_t$intro = t.intro) !== null && _t$intro !== void 0 ? _t$intro : !1;
var r = t.target,
l = D,
i = O;
try {
for (var a = /** @type {TemplateNode} */
/* @__PURE__ */me(r); a && (a.nodeType !== 8 || /** @type {Comment} */
a.data !== Wt);) a = /** @type {TemplateNode} */
/* @__PURE__ */Te(a);
if (!a) throw Je;
Ge(!0), Re(/** @type {Comment} */
a), Xe();
var o = Mn(e, _objectSpread(_objectSpread({}, t), {}, {
anchor: a
}));
if (O === null || O.nodeType !== 8 || /** @type {Comment} */
O.data !== rn) throw Tt(), Je;
return Ge(!1), /** @type {Exports} */
o;
} catch (o) {
if (o === Je) return t.recover === !1 && Ui(), jt(), Xi(r), Ge(!1), Fn(e, t);
throw o;
} finally {
Ge(l), Re(i);
}
}
var Ye = /* @__PURE__ */new Map();
function Mn(e, _ref) {
var t = _ref.target,
r = _ref.anchor,
_ref$props = _ref.props,
l = _ref$props === void 0 ? {} : _ref$props,
i = _ref.events,
a = _ref.context,
_ref$intro = _ref.intro,
o = _ref$intro === void 0 ? !0 : _ref$intro;
jt();
var f = /* @__PURE__ */new Set(),
s = function s(h) {
for (var g = 0; g < h.length; g++) {
var m = h[g];
if (!f.has(m)) {
f.add(m);
var w = ml(m);
t.addEventListener(m, ft, {
passive: w
});
var z = Ye.get(m);
z === void 0 ? (document.addEventListener(m, ft, {
passive: w
}), Ye.set(m, 1)) : Ye.set(m, z + 1);
}
}
};
s(Ii(zn)), qt.add(s);
var c = void 0,
v = vl(function () {
var h = r !== null && r !== void 0 ? r : t.appendChild(Jt());
return Rt(function () {
if (a) {
Nn({});
var g = /** @type {ComponentContext} */
B;
g.c = a;
}
i && (l.$$events = i), D && Ae(/** @type {TemplateNode} */
h, null), c = e(h, l) || {}, D && (A.nodes_end = O), a && Ln();
}), function () {
var w;
var _iterator9 = _createForOfIteratorHelper(f),
_step9;
try {
for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
var g = _step9.value;
t.removeEventListener(g, ft);
var m = /** @type {number} */
Ye.get(g);
--m === 0 ? (document.removeEventListener(g, ft), Ye["delete"](g)) : Ye.set(g, m);
}
} catch (err) {
_iterator9.e(err);
} finally {
_iterator9.f();
}
qt["delete"](s), h !== r && ((w = h.parentNode) == null || w.removeChild(h));
};
});
return Ht.set(c, v), c;
}
var Ht = /* @__PURE__ */new WeakMap();
function $l(e, t) {
var r = Ht.get(e);
return r ? (Ht["delete"](e), r(t)) : Promise.resolve();
}
function ke(e, t) {
var _ref2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [0, 0],
_ref3 = _slicedToArray(_ref2, 2),
r = _ref3[0],
l = _ref3[1];
D && r === 0 && Xe();
var i = e,
a = null,
o = null,
f = W,
s = r > 0 ? Zt : 0,
c = !1;
var v = function v(g) {
var m = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !0;
c = !0, h(m, g);
},
h = function h(g, m) {
if (f === (f = g)) return;
var w = !1;
if (D && l !== -1) {
if (r === 0) {
var T = /** @type {Comment} */
i.data;
T === Wt ? l = 0 : T === tn ? l = 1 / 0 : (l = parseInt(T.substring(1)), l !== l && (l = f ? 1 / 0 : -1));
}
var z = l > r;
!!f === z && (i = Ki(), Re(i), Ge(!1), w = !0, l = -1);
}
f ? (a ? Hr(a) : m && (a = Rt(function () {
return m(i);
})), o && Bt(o, function () {
o = null;
})) : (o ? Hr(o) : m && (o = Rt(function () {
return m(i, [r + 1, l]);
})), a && Bt(a, function () {
a = null;
})), w && Ge(!0);
};
tr(function () {
c = !1, t(v), c || h(null, null);
}, s), D && (i = O);
}
function Ze(e, t, r, l, i) {
var a = e,
o = "",
f;
tr(function () {
var _t2;
if (o === (o = (_t2 = t()) !== null && _t2 !== void 0 ? _t2 : "")) {
D && Xe();
return;
}
f !== void 0 && (we(f), f = void 0), o !== "" && (f = Rt(function () {
if (D) {
O.data;
for (var s = Xe(), c = s; s !== null && (s.nodeType !== 8 || /** @type {Comment} */
s.data !== "");) c = s, s = /** @type {TemplateNode} */
/* @__PURE__ */Te(s);
if (s === null) throw Tt(), Je;
Ae(O, c), a = Re(s);
return;
}
var v = o + "",
h = rr(v);
Ae(/** @type {TemplateNode} */
/* @__PURE__ */me(h), /** @type {TemplateNode} */
h.lastChild), a.before(h);
}));
});
}
function kl(e, t, r, l, i) {
var f;
D && Xe();
var a = (f = t.$$slots) == null ? void 0 : f[r],
o = !1;
a === !0 && (a = t.children, o = !0), a === void 0 || a(e, o ? function () {
return l;
} : l);
}
function Cl(e, t) {
Gt(function () {
var _r$head;
var r = e.getRootNode(),
l = /** @type {ShadowRoot} */
r.host ? (/** @type {ShadowRoot} */
r) : /** @type {Document} */(_r$head = r.head) !== null && _r$head !== void 0 ? _r$head : /** @type {Document} */
r.ownerDocument.head;
if (!l.querySelector("#" + t.hash)) {
var i = document.createElement("style");
i.id = t.hash, i.textContent = t.code, l.appendChild(i);
}
});
}
var Zr = _toConsumableArray(" \t\n\r\f\xA0\x0B\uFEFF");
function Al(e, t, r) {
var l = "" + e;
if (r) {
for (var i in r) if (r[i]) l = l ? l + " " + i : i;else if (l.length) for (var a = i.length, o = 0; (o = l.indexOf(i, o)) >= 0;) {
var f = o + a;
(o === 0 || Zr.includes(l[o - 1])) && (f === l.length || Zr.includes(l[f])) ? l = (o === 0 ? "" : l.substring(0, o)) + l.substring(f + 1) : o = f;
}
}
return l === "" ? null : l;
}
function Rl(e, t, r, l, i, a) {
var o = e.__className;
if (D || o !== r) {
var f = Al(r, l, a);
(!D || f !== e.getAttribute("class")) && (f == null ? e.removeAttribute("class") : e.className = f), e.__className = r;
} else if (a && i !== a) for (var s in a) {
var c = !!a[s];
(i == null || c !== !!i[s]) && e.classList.toggle(s, c);
}
return a;
}
var Il = Symbol("is custom element"),
Sl = Symbol("is html");
function Gr(e) {
if (D) {
var t = !1,
r = function r() {
if (!t) {
if (t = !0, e.hasAttribute("value")) {
var l = e.value;
ie(e, "value", null), e.value = l;
}
if (e.hasAttribute("checked")) {
var i = e.checked;
ie(e, "checked", null), e.checked = i;
}
}
};
e.__on_r = r, Di(r), Pn();
}
}
function Tl(e, t) {
var r = Un(e);
r.value === (r.value = // treat null and undefined the same for the initial value
t !== null && t !== void 0 ? t : void 0) ||
// @ts-expect-error
// `progress` elements always need their value set when it's `0`
e.value === t && (t !== 0 || e.nodeName !== "PROGRESS") || (e.value = t !== null && t !== void 0 ? t : "");
}
function ie(e, t, r, l) {
var i = Un(e);
D && (i[t] = e.getAttribute(t), t === "src" || t === "srcset" || t === "href" && e.nodeName === "LINK") || i[t] !== (i[t] = r) && (t === "loading" && (e[Ai] = r), r == null ? e.removeAttribute(t) : typeof r != "string" && Nl(e).includes(t) ? e[t] = r : e.setAttribute(t, r));
}
function Un(e) {
var _e$__attributes;
return (
/** @type {Record<string | symbol, unknown>} **/
// @ts-expect-error
(_e$__attributes = e.__attributes) !== null && _e$__attributes !== void 0 ? _e$__attributes : e.__attributes = altcha_defineProperty(altcha_defineProperty({}, Il, e.nodeName.includes("-")), Sl, e.namespaceURI === $i)
);
}
var Jr = /* @__PURE__ */new Map();
function Nl(e) {
var t = Jr.get(e.nodeName);
if (t) return t;
Jr.set(e.nodeName, t = []);
for (var r, l = e, i = Element.prototype; i !== l;) {
r = Si(l);
for (var a in r) r[a].set && t.push(a);
l = sn(l);
}
return t;
}
function Ll(e, t) {
var r = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : t;
wl(e, "change", function (l) {
var i = l ? e.defaultChecked : e.checked;
r(i);
}),
// If we are hydrating and the value has since changed,
// then use the update value from the input instead.
(D && e.defaultChecked !== e.checked ||
// If defaultChecked is set, then checked == defaultChecked
Qe(t) == null) && r(e.checked), er(function () {
var l = t();
e.checked = !!l;
});
}
function Kr(e, t) {
return e === t || (e == null ? void 0 : e[ut]) === t;
}
function Xr() {
var e = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var t = arguments.length > 1 ? arguments[1] : undefined;
var r = arguments.length > 2 ? arguments[2] : undefined;
var l = arguments.length > 3 ? arguments[3] : undefined;
return Qt(function () {
var i, a;
return er(function () {
i = a, a = [], Qe(function () {
e !== r.apply(void 0, _toConsumableArray(a)) && (t.apply(void 0, [e].concat(_toConsumableArray(a))), i && Kr(r.apply(void 0, _toConsumableArray(i)), e) && t.apply(void 0, [null].concat(_toConsumableArray(i))));
});
}), function () {
Gt(function () {
a && Kr(r.apply(void 0, _toConsumableArray(a)), e) && t.apply(void 0, [null].concat(_toConsumableArray(a)));
});
};
}), e;
}
function jn(e) {
B === null && Tn(), Vt(function () {
var t = Qe(e);
if (typeof t == "function") return /** @type {() => void} */t;
});
}
function Dl(e) {
B === null && Tn(), jn(function () {
return function () {
return Qe(e);
};
});
}
var mt = !1;
function Pl(e) {
var t = mt;
try {
return mt = !1, [e(), mt];
} finally {
mt = t;
}
}
function C(e, t, r, l) {
var _Pl, _Pl2, _ref4;
var be;
var i = (r & wi) !== 0,
a = !0,
o = (r & yi) !== 0,
f = (r & bi) !== 0,
s = !1,
c;
o ? (_Pl = Pl(function () {
return /** @type {V} */e[t];
}), _Pl2 = _slicedToArray(_Pl, 2), c = _Pl2[0], s = _Pl2[1], _Pl) : c = /** @type {V} */
e[t];
var v = ut in e || an in e,
h = o && ((_ref4 = (be = Pe(e, t)) == null ? void 0 : be.set) !== null && _ref4 !== void 0 ? _ref4 : v && t in e && function (N) {
return e[t] = N;
}) || void 0,
g = /** @type {V} */
l,
m = !0,
w = !1,
z = function z() {
return w = !0, m && (m = !1, f ? g = Qe(/** @type {() => V} */
l) : g = /** @type {V} */
l), g;
};
c === void 0 && l !== void 0 && (h && a && ji(), c = z(), h && h(c));
var T;
if (T = function T() {
var N = /** @type {V} */
e[t];
return N === void 0 ? z() : (m = !0, w = !1, N);
}, (r & pi) === 0) return T;
if (h) {
var Y = e.$$legacy;
return function (N, X) {
return arguments.length > 0 ? ((!X || Y || s) && h(X ? T() : N), N) : T();
};
}
var M = !1,
F = /* @__PURE__ */hn(c),
se = /* @__PURE__ */De(function () {
var N = T(),
X = d(F);
return M ? (M = !1, X) : F.v = N;
});
return i || (se.equals = vn), function (N, X) {
if (arguments.length > 0) {
var U = X ? d(se) : o ? le(N) : N;
return se.equals(U) || (M = !0, P(F, U), w && g !== void 0 && (g = U), Qe(function () {
return d(se);
})), N;
}
return d(se);
};
}
function Ol(e) {
return new zl(e);
}
var _e, te;
var zl = /*#__PURE__*/function () {
/**
* @param {ComponentConstructorOptions & {
* component: any;
* }} options
*/
function zl(t) {
var _t$intro2,
_this2 = this;
altcha_classCallCheck(this, zl);
/** @type {any} */
Mt(this, _e);
/** @type {Record<string, any>} */
Mt(this, te);
var a;
var r = /* @__PURE__ */new Map(),
l = function l(o, f) {
var s = /* @__PURE__ */hn(f);
return r.set(o, s), s;
};
var i = new Proxy(_objectSpread(_objectSpread({}, t.props || {}), {}, {
$$events: {}
}), {
get: function get(o, f) {
var _r$get;
return d((_r$get = r.get(f)) !== null && _r$get !== void 0 ? _r$get : l(f, Reflect.get(o, f)));
},
has: function has(o, f) {
var _r$get2;
return f === an ? !0 : (d((_r$get2 = r.get(f)) !== null && _r$get2 !== void 0 ? _r$get2 : l(f, Reflect.get(o, f))), Reflect.has(o, f));
},
set: function set(o, f, s) {
var _r$get3;
return P((_r$get3 = r.get(f)) !== null && _r$get3 !== void 0 ? _r$get3 : l(f, s), s), Reflect.set(o, f, s);
}
});
Ut(this, te, (t.hydrate ? xl : Fn)(t.component, {
target: t.target,
anchor: t.anchor,
props: i,
context: t.context,
intro: (_t$intro2 = t.intro) !== null && _t$intro2 !== void 0 ? _t$intro2 : !1,
recover: t.recover
})), (!((a = t == null ? void 0 : t.props) != null && a.$$host) || t.sync === !1) && $(), Ut(this, _e, i.$$events);
var _loop2 = function _loop2() {
var o = _Object$keys[_i2];
o === "$set" || o === "$destroy" || o === "$on" || xt(_this2, o, {
get: function get() {
return H(this, te)[o];
},
/** @param {any} value */set: function set(f) {
H(this, te)[o] = f;
},
enumerable: !0
});
};
for (var _i2 = 0, _Object$keys = Object.keys(H(this, te)); _i2 < _Object$keys.length; _i2++) {
_loop2();
}
H(this, te).$set = /** @param {Record<string, any>} next */
function (o) {
Object.assign(i, o);
}, H(this, te).$destroy = function () {
$l(H(_this2, te));
};
}
/** @param {Record<string, any>} props */
return altcha_createClass(zl, [{
key: "$set",
value: function $set(t) {
H(this, te).$set(t);
}
/**
* @param {string} event
* @param {(...args: any[]) => any} callback
* @returns {any}
*/
}, {
key: "$on",
value: function $on(t, r) {
var _this3 = this;
H(this, _e)[t] = H(this, _e)[t] || [];
var l = function l() {
for (var _len = arguments.length, i = new Array(_len), _key = 0; _key < _len; _key++) {
i[_key] = arguments[_key];
}
return r.call.apply(r, [_this3].concat(i));
};
return H(this, _e)[t].push(l), function () {
H(_this3, _e)[t] = H(_this3, _e)[t].filter(/** @param {any} fn */
function (i) {
return i !== l;
});
};
}
}, {
key: "$destroy",
value: function $destroy() {
H(this, te).$destroy();
}
}]);
}();
_e = new WeakMap(), te = new WeakMap();
var Vn;
typeof HTMLElement == "function" && (Vn = /*#__PURE__*/function (_HTMLElement) {
/**
* @param {*} $$componentCtor
* @param {*} $$slots
* @param {*} use_shadow_dom
*/
function Vn(t, r, l) {
var _this4;
altcha_classCallCheck(this, Vn);
_this4 = altcha_callSuper(this, Vn);
/** The Svelte component constructor */
ne(_this4, "$$ctor");
/** Slots */
ne(_this4, "$$s");
/** @type {any} The Svelte component instance */
ne(_this4, "$$c");
/** Whether or not the custom element is connected */
ne(_this4, "$$cn", !1);
/** @type {Record<string, any>} Component props data */
ne(_this4, "$$d", {});
/** `true` if currently in the process of reflecting component props back to attributes */
ne(_this4, "$$r", !1);
/** @type {Record<string, CustomElementPropDefinition>} Props definition (name, reflected, type etc) */
ne(_this4, "$$p_d", {});
/** @type {Record<string, EventListenerOrEventListenerObject[]>} Event listeners */
ne(_this4, "$$l", {});
/** @type {Map<EventListenerOrEventListenerObject, Function>} Event listener unsubscribe functions */
ne(_this4, "$$l_u", /* @__PURE__ */new Map());
/** @type {any} The managed render effect for reflecting attributes */
ne(_this4, "$$me");
_this4.$$ctor = t, _this4.$$s = r, l && _this4.attachShadow({
mode: "open"
});
return _this4;
}
/**
* @param {string} type
* @param {EventListenerOrEventListenerObject} listener
* @param {boolean | AddEventListenerOptions} [options]
*/
altcha_inherits(Vn, _HTMLElement);
return altcha_createClass(Vn, [{
key: "addEventListener",
value: function addEventListener(t, r, l) {
if (this.$$l[t] = this.$$l[t] || [], this.$$l[t].push(r), this.$$c) {
var i = this.$$c.$on(t, r);
this.$$l_u.set(r, i);
}
altcha_superPropGet(Vn, "addEventListener", this, 3)([t, r, l]);
}
/**
* @param {string} type
* @param {EventListenerOrEventListenerObject} listener
* @param {boolean | AddEventListenerOptions} [options]
*/
}, {
key: "removeEventListener",
value: function removeEventListener(t, r, l) {
if (altcha_superPropGet(Vn, "removeEventListener", this, 3)([t, r, l]), this.$$c) {
var i = this.$$l_u.get(r);
i && (i(), this.$$l_u["delete"](r));
}
}
}, {
key: "connectedCallback",
value: function () {
var _connectedCallback = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
var _this5 = this;
var t, r, l, _iterator10, _step10, _i4, _iterator11, _step11, _i5, _a, i, _i3, _iterator13, _step13, a, o;
return _regeneratorRuntime().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
if (!(this.$$cn = !0, !this.$$c)) {
_context.next = 15;
break;
}
t = function t(i) {
return function (a) {
var o = document.createElement("slot");
i !== "default" && (o.name = i), ee(a, o);
};
};
_context.next = 4;
return Promise.resolve();
case 4:
if (!(!this.$$cn || this.$$c)) {
_context.next = 6;
break;
}
return _context.abrupt("return");
case 6:
r = {}, l = Fl(this);
_iterator10 = _createForOfIteratorHelper(this.$$s);
try {
for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
_i4 = _step10.value;
_i4 in l && (_i4 === "default" && !this.$$d.children ? (this.$$d.children = t(_i4), r["default"] = !0) : r[_i4] = t(_i4));
}
} catch (err) {
_iterator10.e(err);
} finally {
_iterator10.f();
}
_iterator11 = _createForOfIteratorHelper(this.attributes);
try {
for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
_i5 = _step11.value;
_a = this.$$g_p(_i5.name);
_a in this.$$d || (this.$$d[_a] = pt(_a, _i5.value, this.$$p_d, "toProp"));
}
} catch (err) {
_iterator11.e(err);
} finally {
_iterator11.f();
}
for (i in this.$$p_d) !(i in this.$$d) && this[i] !== void 0 && (this.$$d[i] = this[i], delete this[i]);
this.$$c = Ol({
component: this.$$ctor,
target: this.shadowRoot || this,
props: _objectSpread(_objectSpread({}, this.$$d), {}, {
$$slots: r,
$$host: this
})
}), this.$$me = dl(function () {
er(function () {
var i;
_this5.$$r = !0;
var _iterator12 = _createForOfIteratorHelper(Et(_this5.$$c)),
_step12;
try {
for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
var a = _step12.value;
if (!((i = _this5.$$p_d[a]) != null && i.reflect)) continue;
_this5.$$d[a] = _this5.$$c[a];
var o = pt(a, _this5.$$d[a], _this5.$$p_d, "toAttribute");
o == null ? _this5.removeAttribute(_this5.$$p_d[a].attribute || a) : _this5.setAttribute(_this5.$$p_d[a].attribute || a, o);
}
} catch (err) {
_iterator12.e(err);
} finally {
_iterator12.f();
}
_this5.$$r = !1;
});
});
for (_i3 in this.$$l) {
_iterator13 = _createForOfIteratorHelper(this.$$l[_i3]);
try {
for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
a = _step13.value;
o = this.$$c.$on(_i3, a);
this.$$l_u.set(a, o);
}
} catch (err) {
_iterator13.e(err);
} finally {
_iterator13.f();
}
}
this.$$l = {};
case 15:
case "end":
return _context.stop();
}
}, _callee, this);
}));
function connectedCallback() {
return _connectedCallback.apply(this, arguments);
}
return connectedCallback;
}() // We don't need this when working within Svelte code, but for compatibility of people using this outside of Svelte
// and setting attributes through setAttribute etc, this is helpful
/**
* @param {string} attr
* @param {string} _oldValue
* @param {string} newValue
*/
}, {
key: "attributeChangedCallback",
value: function attributeChangedCallback(t, r, l) {
var i;
this.$$r || (t = this.$$g_p(t), this.$$d[t] = pt(t, l, this.$$p_d, "toProp"), (i = this.$$c) == null || i.$set(altcha_defineProperty({}, t, this.$$d[t])));
}
}, {
key: "disconnectedCallback",
value: function disconnectedCallback() {
var _this6 = this;
this.$$cn = !1, Promise.resolve().then(function () {
!_this6.$$cn && _this6.$$c && (_this6.$$c.$destroy(), _this6.$$me(), _this6.$$c = void 0);
});
}
/**
* @param {string} attribute_name
*/
}, {
key: "$$g_p",
value: function $$g_p(t) {
var _this7 = this;
return Et(this.$$p_d).find(function (r) {
return _this7.$$p_d[r].attribute === t || !_this7.$$p_d[r].attribute && r.toLowerCase() === t;
}) || t;
}
}]);
}(/*#__PURE__*/_wrapNativeSuper(HTMLElement)));
function pt(e, t, r, l) {
var a;
var i = (a = r[e]) == null ? void 0 : a.type;
if (t = i === "Boolean" && typeof t != "boolean" ? t != null : t, !l || !r[e]) return t;
if (l === "toAttribute") switch (i) {
case "Object":
case "Array":
return t == null ? null : JSON.stringify(t);
case "Boolean":
return t ? "" : null;
case "Number":
return t !== null && t !== void 0 ? t : null;
default:
return t;
} else switch (i) {
case "Object":
case "Array":
return t && JSON.parse(t);
case "Boolean":
return t;
// conversion already handled above
case "Number":
return t != null ? +t : t;
default:
return t;
}
}
function Fl(e) {
var t = {};
return e.childNodes.forEach(function (r) {
t[/** @type {Element} node */
r.slot || "default"] = !0;
}), t;
}
function Ml(e, t, r, l, i, a) {
var o = /*#__PURE__*/function (_Vn) {
function o() {
var _this8;
altcha_classCallCheck(this, o);
_this8 = altcha_callSuper(this, o, [e, r, i]), _this8.$$p_d = t;
return _this8;
}
altcha_inherits(o, _Vn);
return altcha_createClass(o, null, [{
key: "observedAttributes",
get: function get() {
return Et(t).map(function (f) {
return (t[f].attribute || f).toLowerCase();
});
}
}]);
}(Vn);
return Et(t).forEach(function (f) {
xt(o.prototype, f, {
get: function get() {
return this.$$c && f in this.$$c ? this.$$c[f] : this.$$d[f];
},
set: function set(s) {
var h;
s = pt(f, s, t), this.$$d[f] = s;
var c = this.$$c;
if (c) {
var v = (h = Pe(c, f)) == null ? void 0 : h.get;
v ? c[f] = s : c.$set(altcha_defineProperty({}, f, s));
}
}
});
}), l.forEach(function (f) {
xt(o.prototype, f, {
get: function get() {
var s;
return (s = this.$$c) == null ? void 0 : s[f];
}
});
}), e.element = /** @type {any} */
o, o;
}
var Bn = new TextEncoder();
function Ul(e) {
return _toConsumableArray(new Uint8Array(e)).map(function (t) {
return t.toString(16).padStart(2, "0");
}).join("");
}
function jl(_x) {
return _jl.apply(this, arguments);
}
function _jl() {
_jl = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee10(e) {
var t,
r,
l,
i,
_args10 = arguments;
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
while (1) switch (_context10.prev = _context10.next) {
case 0:
t = _args10.length > 1 && _args10[1] !== undefined ? _args10[1] : "SHA-256";
r = _args10.length > 2 && _args10[2] !== undefined ? _args10[2] : 1e5;
l = Date.now().toString(16);
e || (e = Math.round(Math.random() * r));
_context10.next = 6;
return qn(l, e, t);
case 6:
i = _context10.sent;
return _context10.abrupt("return", {
algorithm: t,
challenge: i,
salt: l,
signature: ""
});
case 8:
case "end":
return _context10.stop();
}
}, _callee10);
}));
return _jl.apply(this, arguments);
}
function qn(_x2, _x3, _x4) {
return _qn.apply(this, arguments);
}
function _qn() {
_qn = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee11(e, t, r) {
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
while (1) switch (_context11.prev = _context11.next) {
case 0:
if (!((typeof crypto === "undefined" ? "undefined" : altcha_typeof(crypto)) > "u" || !("subtle" in crypto) || !("digest" in crypto.subtle))) {
_context11.next = 2;
break;
}
throw new Error("Web Crypto is not available. Secure context is required (https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts).");
case 2:
_context11.t0 = Ul;
_context11.next = 5;
return crypto.subtle.digest(r.toUpperCase(), Bn.encode(e + t));
case 5:
_context11.t1 = _context11.sent;
return _context11.abrupt("return", (0, _context11.t0)(_context11.t1));
case 7:
case "end":
return _context11.stop();
}
}, _callee11);
}));
return _qn.apply(this, arguments);
}
function Vl(e, t) {
var r = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "SHA-256";
var l = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1e6;
var i = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
var a = new AbortController(),
o = Date.now();
return {
promise: _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
var s;
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
s = i;
case 1:
if (!(s <= l)) {
_context2.next = 13;
break;
}
if (!a.signal.aborted) {
_context2.next = 4;
break;
}
return _context2.abrupt("return", null);
case 4:
_context2.next = 6;
return qn(t, s, r);
case 6:
_context2.t0 = _context2.sent;
_context2.t1 = e;
if (!(_context2.t0 === _context2.t1)) {
_context2.next = 10;
break;
}
return _context2.abrupt("return", {
number: s,
took: Date.now() - o
});
case 10:
s += 1;
_context2.next = 1;
break;
case 13:
return _context2.abrupt("return", null);
case 14:
case "end":
return _context2.stop();
}
}, _callee2);
}))(),
controller: a
};
}
function Bl() {
try {
return Intl.DateTimeFormat().resolvedOptions().timeZone;
} catch (_unused3) {}
}
function ql(e) {
var t = atob(e),
r = new Uint8Array(t.length);
for (var l = 0; l < t.length; l++) r[l] = t.charCodeAt(l);
return r;
}
function Hl(e) {
var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 12;
var r = new Uint8Array(t);
for (var l = 0; l < t; l++) r[l] = e % 256, e = Math.floor(e / 256);
return r;
}
function Wl(_x5) {
return _Wl.apply(this, arguments);
}
function _Wl() {
_Wl = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee13(e) {
var t,
r,
l,
i,
a,
o,
f,
s,
c,
v,
_args13 = arguments;
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
while (1) switch (_context13.prev = _context13.next) {
case 0:
t = _args13.length > 1 && _args13[1] !== undefined ? _args13[1] : "";
r = _args13.length > 2 && _args13[2] !== undefined ? _args13[2] : 1e6;
l = _args13.length > 3 && _args13[3] !== undefined ? _args13[3] : 0;
i = "AES-GCM", a = new AbortController(), o = Date.now(), f = /*#__PURE__*/function () {
var _ref7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
var v, h;
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
while (1) switch (_context12.prev = _context12.next) {
case 0:
v = l;
case 1:
if (!(v <= r)) {
_context12.next = 17;
break;
}
if (!(a.signal.aborted || !s || !c)) {
_context12.next = 4;
break;
}
return _context12.abrupt("return", null);
case 4:
_context12.prev = 4;
_context12.next = 7;
return crypto.subtle.decrypt({
name: i,
iv: Hl(v)
}, s, c);
case 7:
h = _context12.sent;
if (!h) {
_context12.next = 10;
break;
}
return _context12.abrupt("return", {
clearText: new TextDecoder().decode(h),
took: Date.now() - o
});
case 10:
_context12.next = 14;
break;
case 12:
_context12.prev = 12;
_context12.t0 = _context12["catch"](4);
case 14:
v += 1;
_context12.next = 1;
break;
case 17:
return _context12.abrupt("return", null);
case 18:
case "end":
return _context12.stop();
}
}, _callee12, null, [[4, 12]]);
}));
return function f() {
return _ref7.apply(this, arguments);
};
}();
s = null, c = null;
_context13.prev = 5;
c = ql(e);
_context13.next = 9;
return crypto.subtle.digest("SHA-256", Bn.encode(t));
case 9:
v = _context13.sent;
_context13.next = 12;
return crypto.subtle.importKey("raw", v, i, !1, ["decrypt"]);
case 12:
s = _context13.sent;
_context13.next = 18;
break;
case 15:
_context13.prev = 15;
_context13.t0 = _context13["catch"](5);
return _context13.abrupt("return", {
promise: Promise.reject(),
controller: a
});
case 18:
return _context13.abrupt("return", {
promise: f(),
controller: a
});
case 19:
case "end":
return _context13.stop();
}
}, _callee13, null, [[5, 15]]);
}));
return _Wl.apply(this, arguments);
}
var E = /* @__PURE__ */function (e) {
return e.ERROR = "error", e.VERIFIED = "verified", e.VERIFYING = "verifying", e.UNVERIFIED = "unverified", e.EXPIRED = "expired", e;
}(E || {}),
Yl = /* @__PURE__ */El('<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" class="svelte-ddsc3z"><path d="M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z" fill="currentColor" opacity=".25" class="svelte-ddsc3z"></path><path d="M12,4a8,8,0,0,1,7.89,6.7A1.53,1.53,0,0,0,21.38,12h0a1.5,1.5,0,0,0,1.48-1.75,11,11,0,0,0-21.72,0A1.5,1.5,0,0,0,2.62,12h0a1.53,1.53,0,0,0,1.49-1.3A8,8,0,0,1,12,4Z" fill="currentColor" class="altcha-spinner svelte-ddsc3z"></path></svg>'),
Zl = /* @__PURE__ */ve('<span role="status" aria-live="polite" class="svelte-ddsc3z"><!></span> <input type="hidden" class="svelte-ddsc3z">', 1),
Gl = /* @__PURE__ */ve('<span role="status" aria-live="polite" class="svelte-ddsc3z"><!></span>'),
Jl = /* @__PURE__ */ve('<label class="svelte-ddsc3z"><!></label>'),
Kl = /* @__PURE__ */ve('<div class="svelte-ddsc3z"><a target="_blank" class="altcha-logo svelte-ddsc3z"><svg width="22" height="22" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" class="svelte-ddsc3z"><path d="M2.33955 16.4279C5.88954 20.6586 12.1971 21.2105 16.4279 17.6604C18.4699 15.947 19.6548 13.5911 19.9352 11.1365L17.9886 10.4279C17.8738 12.5624 16.909 14.6459 15.1423 16.1284C11.7577 18.9684 6.71167 18.5269 3.87164 15.1423C1.03163 11.7577 1.4731 6.71166 4.8577 3.87164C8.24231 1.03162 13.2883 1.4731 16.1284 4.8577C16.9767 5.86872 17.5322 7.02798 17.804 8.2324L19.9522 9.01429C19.7622 7.07737 19.0059 5.17558 17.6604 3.57212C14.1104 -0.658624 7.80283 -1.21043 3.57212 2.33956C-0.658625 5.88958 -1.21046 12.1971 2.33955 16.4279Z" fill="currentColor" class="svelte-ddsc3z"></path><path d="M3.57212 2.33956C1.65755 3.94607 0.496389 6.11731 0.12782 8.40523L2.04639 9.13961C2.26047 7.15832 3.21057 5.25375 4.8577 3.87164C8.24231 1.03162 13.2883 1.4731 16.1284 4.8577L13.8302 6.78606L19.9633 9.13364C19.7929 7.15555 19.0335 5.20847 17.6604 3.57212C14.1104 -0.658624 7.80283 -1.21043 3.57212 2.33956Z" fill="currentColor" class="svelte-ddsc3z"></path><path d="M7 10H5C5 12.7614 7.23858 15 10 15C12.7614 15 15 12.7614 15 10H13C13 11.6569 11.6569 13 10 13C8.3431 13 7 11.6569 7 10Z" fill="currentColor" class="svelte-ddsc3z"></path></svg></a></div>'),
Xl = /* @__PURE__ */ve('<div class="svelte-ddsc3z"><!></div>'),
Ql = /* @__PURE__ */ve('<div class="svelte-ddsc3z"><!></div>'),
ea = /* @__PURE__ */ve('<div class="altcha-error svelte-ddsc3z"><svg width="14" height="14" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="svelte-ddsc3z"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" class="svelte-ddsc3z"></path></svg> <!></div>'),
ta = /* @__PURE__ */ve('<div class="altcha-footer svelte-ddsc3z"><div class="svelte-ddsc3z"><!></div></div>'),
ra = /* @__PURE__ */ve('<div class="altcha-anchor-arrow svelte-ddsc3z"></div>'),
na = /* @__PURE__ */ve('<!> <div class="altcha svelte-ddsc3z"><div class="altcha-main svelte-ddsc3z"><!> <div><input type="checkbox" class="svelte-ddsc3z"></div> <div class="altcha-label svelte-ddsc3z"><!></div> <!></div> <!> <!> <!></div>', 1);
var ia = {
hash: "svelte-ddsc3z",
code: ".altcha.svelte-ddsc3z {background:var(--altcha-color-base, transparent);border:var(--altcha-border-width, 1px) solid var(--altcha-color-border, #a0a0a0);border-radius:var(--altcha-border-radius, 3px);color:var(--altcha-color-text, currentColor);display:flex;flex-direction:column;max-width:var(--altcha-max-width, 260px);position:relative;text-align:left;}.altcha.svelte-ddsc3z:focus-within {border-color:var(--altcha-color-border-focus, currentColor);}.altcha[data-floating].svelte-ddsc3z {background:var(--altcha-color-base, white);display:none;filter:drop-shadow(3px 3px 6px rgba(0, 0, 0, 0.2));left:-100%;position:fixed;top:-100%;width:var(--altcha-max-width, 260px);z-index:999999;}.altcha[data-floating=top].svelte-ddsc3z .altcha-anchor-arrow:where(.svelte-ddsc3z) {border-bottom-color:transparent;border-top-color:var(--altcha-color-border, #a0a0a0);bottom:-12px;top:auto;}.altcha[data-floating=bottom].svelte-ddsc3z:focus-within::after {border-bottom-color:var(--altcha-color-border-focus, currentColor);}.altcha[data-floating=top].svelte-ddsc3z:focus-within::after {border-top-color:var(--altcha-color-border-focus, currentColor);}.altcha[data-floating].svelte-ddsc3z:not([data-state=unverified]) {display:block;}.altcha-anchor-arrow.svelte-ddsc3z {border:6px solid transparent;border-bottom-color:var(--altcha-color-border, #a0a0a0);content:\"\";height:0;left:12px;position:absolute;top:-12px;width:0;}.altcha-main.svelte-ddsc3z {align-items:center;display:flex;gap:0.4rem;padding:0.7rem;}.altcha-label.svelte-ddsc3z {flex-grow:1;}.altcha-label.svelte-ddsc3z label:where(.svelte-ddsc3z) {cursor:pointer;}.altcha-logo.svelte-ddsc3z {color:currentColor;opacity:0.3;}.altcha-logo.svelte-ddsc3z:hover {opacity:1;}.altcha-error.svelte-ddsc3z {color:var(--altcha-color-error-text, #f23939);display:flex;font-size:0.85rem;gap:0.3rem;padding:0 0.7rem 0.7rem;}.altcha-footer.svelte-ddsc3z {align-items:center;background-color:var(--altcha-color-footer-bg, transparent);display:flex;font-size:0.75rem;opacity:0.4;padding:0.2rem 0.7rem;text-align:right;}.altcha-footer.svelte-ddsc3z:hover {opacity:1;}.altcha-footer.svelte-ddsc3z > :where(.svelte-ddsc3z):first-child {flex-grow:1;}.altcha-footer.svelte-ddsc3z a {color:currentColor;}.altcha-checkbox.svelte-ddsc3z {display:flex;align-items:center;height:24px;width:24px;}.altcha-checkbox.svelte-ddsc3z input:where(.svelte-ddsc3z) {width:18px;height:18px;margin:0;}.altcha-hidden.svelte-ddsc3z {display:none;}.altcha-spinner.svelte-ddsc3z {\n animation: svelte-ddsc3z-altcha-spinner 0.75s infinite linear;transform-origin:center;}\n\n@keyframes svelte-ddsc3z-altcha-spinner {\n 100% {\n transform: rotate(360deg);\n }\n}"
};
function la(e, t) {
var Lr, Dr;
Nn(t, !0), Cl(e, ia);
var r = C(t, "auto", 7, void 0),
l = C(t, "blockspam", 7, void 0),
i = C(t, "challengeurl", 7, void 0),
a = C(t, "challengejson", 7, void 0),
o = C(t, "customfetch", 7, void 0),
f = C(t, "debug", 7, !1),
s = C(t, "delay", 7, 0),
c = C(t, "expire", 7, void 0),
v = C(t, "floating", 7, void 0),
h = C(t, "floatinganchor", 7, void 0),
g = C(t, "floatingoffset", 7, void 0),
m = C(t, "hidefooter", 7, !1),
w = C(t, "hidelogo", 7, !1),
z = C(t, "id", 7, void 0),
T = C(t, "name", 7, "altcha"),
Y = C(t, "maxnumber", 7, 1e6),
M = C(t, "mockerror", 7, !1),
F = C(t, "obfuscated", 7, void 0),
se = C(t, "plugins", 7, void 0),
be = C(t, "refetchonexpire", 7, !0),
N = C(t, "spamfilter", 7, !1),
X = C(t, "strings", 7, void 0),
U = C(t, "test", 7, !1),
Ee = C(t, "verifyurl", 7, void 0),
Me = C(t, "workers", 23, function () {
return Math.min(16, navigator.hardwareConcurrency || 8);
}),
tt = C(t, "workerurl", 7, void 0);
var nr = ["SHA-256", "SHA-384", "SHA-512"],
ir = "Visit Altcha.org",
lr = "https://altcha.org/",
rt = function rt(n, u) {
t.$$host.dispatchEvent(new CustomEvent(n, {
detail: u
}));
},
ar = (Dr = (Lr = document.documentElement.lang) == null ? void 0 : Lr.split("-")) == null ? void 0 : Dr[0],
Dt = /* @__PURE__ */De(function () {
var n;
return i() && new URL(i(), location.origin).host.endsWith(".altcha.org") && !!((n = i()) != null && n.includes("apiKey=ckey_"));
}),
Pt = /* @__PURE__ */De(function () {
return a() ? wr(a()) : void 0;
}),
or = /* @__PURE__ */De(function () {
return X() ? wr(X()) : {};
}),
Q = /* @__PURE__ */De(function () {
var n;
return _objectSpread({
ariaLinkLabel: ir,
error: "Verification failed. Try again later.",
expired: "Verification expired. Try again.",
footer: "Protected by <a href=\"".concat(lr, "\" target=\"_blank\" aria-label=\"").concat(((n = d(or)) == null ? void 0 : n.ariaLinkLabel) || ir, "\">ALTCHA</a>"),
label: "I'm not a robot",
verified: "Verified",
verifying: "Verifying...",
waitAlert: "Verifying... please wait."
}, d(or));
}),
sr = /* @__PURE__ */De(function () {
return z() || "".concat(T(), "_checkbox");
});
var Ue = He(!1),
R = He(le(E.UNVERIFIED)),
j = He(void 0),
nt = He(null),
je = null,
y = null,
Ve = He(null),
fe = null,
xe = [],
Ne = He(null);
Vt(function () {
Xn(d(Ve));
}), Vt(function () {
Qn(d(R));
}), Dl(function () {
Hn(), y && (y.removeEventListener("submit", hr), y.removeEventListener("reset", gr), y.removeEventListener("focusin", vr), y = null), fe && (clearTimeout(fe), fe = null), document.removeEventListener("click", cr), document.removeEventListener("scroll", dr), window.removeEventListener("resize", mr);
}), jn(function () {
var n;
I("mounted", "1.3.0"), I("workers", Me()), Jn(), I("plugins", xe.length ? xe.map(function (u) {
return u.constructor.pluginName;
}).join(", ") : "none"), U() && I("using test mode"), c() && Ot(c()), r() !== void 0 && I("auto", r()), v() !== void 0 && pr(v()), y = (n = d(j)) == null ? void 0 : n.closest("form"), y && (y.addEventListener("submit", hr, {
capture: !0
}), y.addEventListener("reset", gr), r() === "onfocus" && y.addEventListener("focusin", vr)), r() === "onload" && (F() ? it() : $e()), d(Dt) && (m() || w()) && I("Attributes hidefooter and hidelogo ignored because usage with free API Keys requires attribution."), requestAnimationFrame(function () {
rt("load");
});
});
function fr(n, u) {
return btoa(JSON.stringify({
algorithm: n.algorithm,
challenge: n.challenge,
number: u.number,
salt: n.salt,
signature: n.signature,
test: U() ? !0 : void 0,
took: u.took
}));
}
function Hn() {
for (var _i6 = 0, _xe = xe; _i6 < _xe.length; _i6++) {
var n = _xe[_i6];
n.destroy();
}
}
function ur() {
i() && be() && d(R) === E.VERIFIED ? $e() : lt(E.EXPIRED, d(Q).expired);
}
function Wn() {
return _Wn.apply(this, arguments);
}
function _Wn() {
_Wn = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
var n, L, u, _, b, S, x, p, q, _L, qe, _L2;
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
while (1) switch (_context3.prev = _context3.next) {
case 0:
if (!M()) {
_context3.next = 2;
break;
}
throw I("mocking error"), new Error("Mocked error.");
case 2:
if (!d(Pt)) {
_context3.next = 4;
break;
}
return _context3.abrupt("return", (I("using provided json data"), d(Pt)));
case 4:
if (!U()) {
_context3.next = 6;
break;
}
return _context3.abrupt("return", (I("generating test challenge", {
test: U()
}), jl(typeof U() != "boolean" ? +U() : void 0)));
case 6:
if (!i() && y) {
L = y.getAttribute("action");
L != null && L.includes("/form/") && i(L + "/altcha");
}
if (i()) {
_context3.next = 9;
break;
}
throw new Error("Attribute challengeurl not set.");
case 9:
I("fetching challenge from", i());
u = null, _ = null;
if (!o()) {
_context3.next = 18;
break;
}
if (!(I("using customfetch"), typeof o() == "string")) {
_context3.next = 17;
break;
}
if (!(u = globalThis[o()] || null, !u)) {
_context3.next = 15;
break;
}
throw new Error("Custom fetch function not found: ".concat(o()));
case 15:
_context3.next = 18;
break;
case 17:
u = o();
case 18:
b = {
headers: N() !== !1 ? {
"x-altcha-spam-filter": "1"
} : {}
};
if (!u) {
_context3.next = 27;
break;
}
_context3.next = 22;
return u(i(), b);
case 22:
_ = _context3.sent;
if (!(!_ || !(_ instanceof Response))) {
_context3.next = 25;
break;
}
throw new Error("Custom fetch function did not return a response.");
case 25:
_context3.next = 30;
break;
case 27:
_context3.next = 29;
return fetch(i(), b);
case 29:
_ = _context3.sent;
case 30:
if (!(_.status !== 200)) {
_context3.next = 32;
break;
}
throw new Error("Server responded with ".concat(_.status, "."));
case 32:
S = _.headers.get("X-Altcha-Config");
_context3.next = 35;
return _.json();
case 35:
x = _context3.sent;
p = new URLSearchParams((n = x.salt.split("?")) == null ? void 0 : n[1]);
q = p.get("expires") || p.get("expire");
if (q) {
_L = new Date(+q * 1e3), qe = isNaN(_L.getTime()) ? 0 : _L.getTime() - Date.now();
qe > 0 && Ot(qe);
}
if (S) try {
_L2 = JSON.parse(S);
_L2 && altcha_typeof(_L2) == "object" && (_L2.verifyurl && (_L2.verifyurl = new URL(_L2.verifyurl, new URL(i())).toString()), Er(_L2));
} catch (L) {
I("unable to configure from X-Altcha-Config", L);
}
return _context3.abrupt("return", x);
case 41:
case "end":
return _context3.stop();
}
}, _callee3);
}));
return _Wn.apply(this, arguments);
}
function Yn(n) {
var _;
var u = y == null ? void 0 : y.querySelector(typeof n == "string" ? "input[name=\"".concat(n, "\"]") : 'input[type="email"]:not([data-no-spamfilter])');
return ((_ = u == null ? void 0 : u.value) == null ? void 0 : _.slice(u.value.indexOf("@"))) || void 0;
}
function Zn() {
return N() === "ipAddress" ? {
blockedCountries: void 0,
classifier: void 0,
disableRules: void 0,
email: !1,
expectedCountries: void 0,
expectedLanguages: void 0,
fields: !1,
ipAddress: void 0,
text: void 0,
timeZone: void 0
} : altcha_typeof(N()) == "object" ? N() : {
blockedCountries: void 0,
classifier: void 0,
disableRules: void 0,
email: void 0,
expectedCountries: void 0,
expectedLanguages: void 0,
fields: void 0,
ipAddress: void 0,
text: void 0,
timeZone: void 0
};
}
function Gn(n) {
return _toConsumableArray((y == null ? void 0 : y.querySelectorAll(n != null && n.length ? n.map(function (_) {
return "input[name=\"".concat(_, "\"]");
}).join(", ") : 'input[type="text"]:not([data-no-spamfilter]), textarea:not([data-no-spamfilter])')) || []).reduce(function (_, b) {
var S = b.name,
x = b.value;
return S && x && (_[S] = /\n/.test(x) ? x.replace(new RegExp("(?<!\\r)\\n", "g"), "\r\n") : x), _;
}, {});
}
function Jn() {
var n = se() !== void 0 ? se().split(",") : void 0;
var _iterator14 = _createForOfIteratorHelper(globalThis.altchaPlugins),
_step14;
try {
for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) {
var u = _step14.value;
(!n || n.includes(u.pluginName)) && xe.push(new u({
el: d(j),
clarify: it,
dispatch: rt,
getConfiguration: xr,
getFloatingAnchor: $r,
getState: kr,
log: I,
reset: lt,
solve: br,
setState: Le,
setFloatingAnchor: Cr,
verify: $e
}));
}
} catch (err) {
_iterator14.e(err);
} finally {
_iterator14.f();
}
}
function I() {
var _console;
for (var _len2 = arguments.length, n = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
n[_key2] = arguments[_key2];
}
(f() || n.some(function (u) {
return u instanceof Error;
})) && (_console = console)[n[0] instanceof Error ? "error" : "log"].apply(_console, ["ALTCHA", "[name=".concat(T(), "]")].concat(n));
}
function Kn() {
[E.UNVERIFIED, E.ERROR, E.EXPIRED].includes(d(R)) ? N() !== !1 && (y == null ? void 0 : y.reportValidity()) === !1 ? P(Ue, !1) : F() ? it() : $e() : P(Ue, !0);
}
function cr(n) {
var u = n.target;
v() && u && !d(j).contains(u) && (d(R) === E.VERIFIED || r() === "off" && d(R) === E.UNVERIFIED) && (d(j).style.display = "none");
}
function dr() {
v() && d(R) !== E.UNVERIFIED && gt();
}
function Xn(n) {
for (var _i7 = 0, _xe2 = xe; _i7 < _xe2.length; _i7++) {
var u = _xe2[_i7];
typeof u.onErrorChange == "function" && u.onErrorChange(d(Ve));
}
}
function vr(n) {
d(R) === E.UNVERIFIED && $e();
}
function hr(n) {
y && r() === "onsubmit" ? d(R) === E.UNVERIFIED ? (n.preventDefault(), n.stopPropagation(), $e().then(function () {
y == null || y.requestSubmit();
})) : d(R) !== E.VERIFIED && (n.preventDefault(), n.stopPropagation(), d(R) === E.VERIFYING && _r()) : y && v() && r() === "off" && d(R) === E.UNVERIFIED && (n.preventDefault(), n.stopPropagation(), d(j).style.display = "block", gt());
}
function gr() {
lt();
}
function _r() {
d(R) === E.VERIFYING && d(Q).waitAlert && alert(d(Q).waitAlert);
}
function Qn(n) {
for (var _i8 = 0, _xe3 = xe; _i8 < _xe3.length; _i8++) {
var u = _xe3[_i8];
typeof u.onStateChange == "function" && u.onStateChange(d(R));
}
v() && d(R) !== E.UNVERIFIED && requestAnimationFrame(function () {
gt();
}), P(Ue, d(R) === E.VERIFIED);
}
function mr() {
v() && gt();
}
function wr(n) {
return JSON.parse(n);
}
function gt() {
var n = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 20;
if (d(j)) if (je || (je = (h() ? document.querySelector(h()) : y == null ? void 0 : y.querySelector('input[type="submit"], button[type="submit"], button:not([type="button"]):not([type="reset"])')) || y), je) {
var u = parseInt(g(), 10) || 12,
_ = je.getBoundingClientRect(),
b = d(j).getBoundingClientRect(),
S = document.documentElement.clientHeight,
x = document.documentElement.clientWidth,
p = v() === "auto" ? _.bottom + b.height + u + n > S : v() === "top",
q = Math.max(n, Math.min(x - n - b.width, _.left + _.width / 2 - b.width / 2));
if (p ? d(j).style.top = "".concat(_.top - (b.height + u), "px") : d(j).style.top = "".concat(_.bottom + u, "px"), d(j).style.left = "".concat(q, "px"), d(j).setAttribute("data-floating", p ? "top" : "bottom"), d(nt)) {
var L = d(nt).getBoundingClientRect();
d(nt).style.left = _.left - q + _.width / 2 - L.width / 2 + "px";
}
} else I("unable to find floating anchor element");
}
function ei(_x6) {
return _ei.apply(this, arguments);
}
function _ei() {
_ei = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(n) {
var u, _Zn, S, x, p, q, L, qe, ot, st, vi, Pr, _, b;
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
while (1) switch (_context4.prev = _context4.next) {
case 0:
if (Ee()) {
_context4.next = 2;
break;
}
throw new Error("Attribute verifyurl not set.");
case 2:
I("requesting server verification from", Ee());
u = {
payload: n
};
if (N() !== !1) {
_Zn = Zn(), S = _Zn.blockedCountries, x = _Zn.classifier, p = _Zn.disableRules, q = _Zn.email, L = _Zn.expectedLanguages, qe = _Zn.expectedCountries, ot = _Zn.fields, st = _Zn.ipAddress, vi = _Zn.text, Pr = _Zn.timeZone;
u.blockedCountries = S, u.classifier = x, u.disableRules = p, u.email = q === !1 ? void 0 : Yn(q), u.expectedCountries = qe, u.expectedLanguages = L || (ar ? [ar] : void 0), u.fields = ot === !1 ? void 0 : Gn(ot), u.ipAddress = st === !1 ? void 0 : st || "auto", u.text = vi, u.timeZone = Pr === !1 ? void 0 : Pr || Bl();
}
_context4.next = 7;
return fetch(Ee(), {
body: JSON.stringify(u),
headers: {
"content-type": "application/json"
},
method: "POST"
});
case 7:
_ = _context4.sent;
if (!(_.status !== 200)) {
_context4.next = 10;
break;
}
throw new Error("Server responded with ".concat(_.status, "."));
case 10:
_context4.next = 12;
return _.json();
case 12:
b = _context4.sent;
if (!(b != null && b.payload && P(Ne, le(b.payload)), rt("serververification", b), l() && b.classification === "BAD")) {
_context4.next = 15;
break;
}
throw new Error("SpamFilter returned negative classification.");
case 15:
case "end":
return _context4.stop();
}
}, _callee4);
}));
return _ei.apply(this, arguments);
}
function Ot(n) {
I("expire", n), fe && (clearTimeout(fe), fe = null), n < 1 ? ur() : fe = setTimeout(ur, n);
}
function pr(n) {
I("floating", n), v() !== n && (d(j).style.left = "", d(j).style.top = ""), v(n === !0 || n === "" ? "auto" : n === !1 || n === "false" ? void 0 : v()), v() ? (r() || r("onsubmit"), document.addEventListener("scroll", dr), document.addEventListener("click", cr), window.addEventListener("resize", mr)) : r() === "onsubmit" && r(void 0);
}
function yr(n) {
if (!n.algorithm) throw new Error("Invalid challenge. Property algorithm is missing.");
if (n.signature === void 0) throw new Error("Invalid challenge. Property signature is missing.");
if (!nr.includes(n.algorithm.toUpperCase())) throw new Error("Unknown algorithm value. Allowed values: ".concat(nr.join(", ")));
if (!n.challenge || n.challenge.length < 40) throw new Error("Challenge is too short. Min. 40 chars.");
if (!n.salt || n.salt.length < 10) throw new Error("Salt is too short. Min. 10 chars.");
}
function br(_x7) {
return _br.apply(this, arguments);
}
function _br() {
_br = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(n) {
var u, _;
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
while (1) switch (_context5.prev = _context5.next) {
case 0:
u = null;
if (!("Worker" in window)) {
_context5.next = 13;
break;
}
_context5.prev = 2;
_context5.next = 5;
return ti(n, n.maxnumber);
case 5:
u = _context5.sent;
_context5.next = 11;
break;
case 8:
_context5.prev = 8;
_context5.t0 = _context5["catch"](2);
I(_context5.t0);
case 11:
if (!((u == null ? void 0 : u.number) !== void 0 || "obfuscated" in n)) {
_context5.next = 13;
break;
}
return _context5.abrupt("return", {
data: n,
solution: u
});
case 13:
if (!("obfuscated" in n)) {
_context5.next = 22;
break;
}
_context5.next = 16;
return Wl(n.obfuscated, n.key, n.maxnumber);
case 16:
_ = _context5.sent;
_context5.t1 = n;
_context5.next = 20;
return _.promise;
case 20:
_context5.t2 = _context5.sent;
return _context5.abrupt("return", {
data: _context5.t1,
solution: _context5.t2
});
case 22:
_context5.t3 = n;
_context5.next = 25;
return Vl(n.challenge, n.salt, n.algorithm, n.maxnumber || Y()).promise;
case 25:
_context5.t4 = _context5.sent;
return _context5.abrupt("return", {
data: _context5.t3,
solution: _context5.t4
});
case 27:
case "end":
return _context5.stop();
}
}, _callee5, null, [[2, 8]]);
}));
return _br.apply(this, arguments);
}
function ti(_x8) {
return _ti.apply(this, arguments);
}
function _ti() {
_ti = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(n) {
var u,
_,
b,
p,
S,
x,
_i10,
_b2,
_p,
_args6 = arguments;
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
while (1) switch (_context6.prev = _context6.next) {
case 0:
u = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : typeof U() == "number" ? U() : Y();
_ = _args6.length > 2 && _args6[2] !== undefined ? _args6[2] : Math.ceil(Me());
b = [];
_ = Math.min(16, Math.max(1, _));
for (p = 0; p < _; p++) b.push(altchaCreateWorker(tt()));
S = Math.ceil(u / _);
_context6.next = 8;
return Promise.all(b.map(function (p, q) {
var L = q * S;
return new Promise(function (qe) {
p.addEventListener("message", function (ot) {
if (ot.data) for (var _i9 = 0, _b = b; _i9 < _b.length; _i9++) {
var st = _b[_i9];
st !== p && st.postMessage({
type: "abort"
});
}
qe(ot.data);
}), p.postMessage({
payload: n,
max: L + S,
start: L,
type: "work"
});
});
}));
case 8:
x = _context6.sent;
for (_i10 = 0, _b2 = b; _i10 < _b2.length; _i10++) {
_p = _b2[_i10];
_p.terminate();
}
return _context6.abrupt("return", x.find(function (p) {
return !!p;
}) || null);
case 11:
case "end":
return _context6.stop();
}
}, _callee6);
}));
return _ti.apply(this, arguments);
}
function it() {
return _it.apply(this, arguments);
}
function _it() {
_it = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
var n;
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
while (1) switch (_context7.prev = _context7.next) {
case 0:
if (F()) {
_context7.next = 3;
break;
}
Le(E.ERROR);
return _context7.abrupt("return");
case 3:
n = xe.find(function (u) {
return u.constructor.pluginName === "obfuscation";
});
if (!(!n || !("clarify" in n))) {
_context7.next = 7;
break;
}
Le(E.ERROR), I("Plugin `obfuscation` not found. Import `altcha/plugins/obfuscation` to load it.");
return _context7.abrupt("return");
case 7:
if (!("clarify" in n && typeof n.clarify == "function")) {
_context7.next = 9;
break;
}
return _context7.abrupt("return", n.clarify());
case 9:
case "end":
return _context7.stop();
}
}, _callee7);
}));
return _it.apply(this, arguments);
}
function Er(n) {
n.obfuscated !== void 0 && F(n.obfuscated), n.auto !== void 0 && (r(n.auto), r() === "onload" && (F() ? it() : $e())), n.blockspam !== void 0 && l(!!n.blockspam), n.customfetch !== void 0 && o(n.customfetch), n.floatinganchor !== void 0 && h(n.floatinganchor), n.delay !== void 0 && s(n.delay), n.floatingoffset !== void 0 && g(n.floatingoffset), n.floating !== void 0 && pr(n.floating), n.expire !== void 0 && (Ot(n.expire), c(n.expire)), n.challenge && (a(typeof n.challenge == "string" ? n.challenge : JSON.stringify(n.challenge)), yr(d(Pt))), n.challengeurl !== void 0 && i(n.challengeurl), n.debug !== void 0 && f(!!n.debug), n.hidefooter !== void 0 && m(!!n.hidefooter), n.hidelogo !== void 0 && w(!!n.hidelogo), n.maxnumber !== void 0 && Y(+n.maxnumber), n.mockerror !== void 0 && M(!!n.mockerror), n.name !== void 0 && T(n.name), n.refetchonexpire !== void 0 && be(!!n.refetchonexpire), n.spamfilter !== void 0 && N(altcha_typeof(n.spamfilter) == "object" ? n.spamfilter : !!n.spamfilter), n.strings && X(typeof n.strings == "string" ? n.strings : JSON.stringify(n.strings)), n.test !== void 0 && U(typeof n.test == "number" ? n.test : !!n.test), n.verifyurl !== void 0 && Ee(n.verifyurl), n.workers !== void 0 && Me(+n.workers), n.workerurl !== void 0 && tt(n.workerurl);
}
function xr() {
return {
auto: r(),
blockspam: l(),
challengeurl: i(),
debug: f(),
delay: s(),
expire: c(),
floating: v(),
floatinganchor: h(),
floatingoffset: g(),
hidefooter: m(),
hidelogo: w(),
name: T(),
maxnumber: Y(),
mockerror: M(),
obfuscated: F(),
refetchonexpire: be(),
spamfilter: N(),
strings: d(Q),
test: U(),
verifyurl: Ee(),
workers: Me(),
workerurl: tt()
};
}
function $r() {
return je;
}
function ri(n) {
return xe.find(function (u) {
return u.constructor.pluginName === n;
});
}
function kr() {
return d(R);
}
function lt() {
var n = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : E.UNVERIFIED;
var u = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
fe && (clearTimeout(fe), fe = null), P(Ue, !1), P(Ne, null), Le(n, u);
}
function Cr(n) {
je = n;
}
function Le(n) {
var u = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
P(R, le(n)), P(Ve, le(u)), rt("statechange", {
payload: d(Ne),
state: d(R)
});
}
function $e() {
return _$e.apply(this, arguments);
}
function _$e() {
_$e = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
while (1) switch (_context8.prev = _context8.next) {
case 0:
lt(E.VERIFYING);
_context8.next = 3;
return new Promise(function (n) {
return setTimeout(n, s() || 0);
});
case 3:
return _context8.abrupt("return", Wn().then(function (n) {
return yr(n), I("challenge", n), br(n);
}).then(function (_ref6) {
var n = _ref6.data,
u = _ref6.solution;
if (I("solution", u), "challenge" in n && u && !("clearText" in u)) if ((u == null ? void 0 : u.number) !== void 0) {
if (Ee()) return ei(fr(n, u));
P(Ne, le(fr(n, u))), I("payload", d(Ne));
} else throw I("Unable to find a solution. Ensure that the 'maxnumber' attribute is greater than the randomly generated number."), new Error("Unexpected result returned.");
}).then(function () {
Le(E.VERIFIED), I("verified"), ol().then(function () {
rt("verified", {
payload: d(Ne)
});
});
})["catch"](function (n) {
I(n), Le(E.ERROR, n.message);
}));
case 4:
case "end":
return _context8.stop();
}
}, _callee8);
}));
return _$e.apply(this, arguments);
}
var Ar = na(),
Rr = Br(Ar);
kl(Rr, t, "default", {});
var at = he(Rr, 2),
zt = G(at),
Ir = G(zt);
{
var ni = function ni(n) {
var u = Yl();
ee(n, u);
};
ke(Ir, function (n) {
d(R) === E.VERIFYING && n(ni);
});
}
var _t = he(Ir, 2);
var Sr;
var Be = G(_t);
Gr(Be), Be.__change = Kn, Z(_t);
var Ft = he(_t, 2),
ii = G(Ft);
{
var li = function li(n) {
var u = Zl(),
_ = Br(u),
b = G(_);
Ze(b, function () {
return d(Q).verified;
}), Z(_);
var S = he(_, 2);
Gr(S), We(function () {
ie(S, "name", T()), Tl(S, d(Ne));
}), ee(n, u);
},
ai = function ai(n, u) {
{
var _ = function _(S) {
var x = Gl(),
p = G(x);
Ze(p, function () {
return d(Q).verifying;
}), Z(x), ee(S, x);
},
b = function b(S) {
var x = Jl(),
p = G(x);
Ze(p, function () {
return d(Q).label;
}), Z(x), We(function () {
return ie(x, "for", d(sr));
}), ee(S, x);
};
ke(n, function (S) {
d(R) === E.VERIFYING ? S(_) : S(b, !1);
}, u);
}
};
ke(ii, function (n) {
d(R) === E.VERIFIED ? n(li) : n(ai, !1);
});
}
Z(Ft);
var oi = he(Ft, 2);
{
var si = function si(n) {
var u = Kl(),
_ = G(u);
ie(_, "href", lr), Z(u), We(function () {
return ie(_, "aria-label", d(Q).ariaLinkLabel);
}), ee(n, u);
};
ke(oi, function (n) {
(w() !== !0 || d(Dt)) && n(si);
});
}
Z(zt);
var Tr = he(zt, 2);
{
var fi = function fi(n) {
var u = ea(),
_ = he(G(u), 2);
{
var b = function b(x) {
var p = Xl(),
q = G(p);
Ze(q, function () {
return d(Q).expired;
}), Z(p), We(function () {
return ie(p, "title", d(Ve));
}), ee(x, p);
},
S = function S(x) {
var p = Ql(),
q = G(p);
Ze(q, function () {
return d(Q).error;
}), Z(p), We(function () {
return ie(p, "title", d(Ve));
}), ee(x, p);
};
ke(_, function (x) {
d(R) === E.EXPIRED ? x(b) : x(S, !1);
});
}
Z(u), ee(n, u);
};
ke(Tr, function (n) {
(d(Ve) || d(R) === E.EXPIRED) && n(fi);
});
}
var Nr = he(Tr, 2);
{
var ui = function ui(n) {
var u = ta(),
_ = G(u),
b = G(_);
Ze(b, function () {
return d(Q).footer;
}), Z(_), Z(u), ee(n, u);
};
ke(Nr, function (n) {
d(Q).footer && (m() !== !0 || d(Dt)) && n(ui);
});
}
var ci = he(Nr, 2);
{
var di = function di(n) {
var u = ra();
Xr(u, function (_) {
return P(nt, _);
}, function () {
return d(nt);
}), ee(n, u);
};
ke(ci, function (n) {
v() && n(di);
});
}
return Z(at), Xr(at, function (n) {
return P(j, n);
}, function () {
return d(j);
}), We(function (n) {
ie(at, "data-state", d(R)), ie(at, "data-floating", v()), Sr = Rl(_t, 1, "altcha-checkbox svelte-ddsc3z", null, Sr, n), ie(Be, "id", d(sr)), Be.required = r() !== "onsubmit" && (!v() || r() !== "off");
}, [function () {
return {
"altcha-hidden": d(R) === E.VERIFYING
};
}]), yl("invalid", Be, _r), Ll(Be, function () {
return d(Ue);
}, function (n) {
return P(Ue, n);
}), ee(e, Ar), Ln({
clarify: it,
configure: Er,
getConfiguration: xr,
getFloatingAnchor: $r,
getPlugin: ri,
getState: kr,
reset: lt,
setFloatingAnchor: Cr,
setState: Le,
verify: $e,
get auto() {
return r();
},
set auto(n) {
if (n === void 0) {
n = void 0;
}
r(n), $();
},
get blockspam() {
return l();
},
set blockspam(n) {
if (n === void 0) {
n = void 0;
}
l(n), $();
},
get challengeurl() {
return i();
},
set challengeurl(n) {
if (n === void 0) {
n = void 0;
}
i(n), $();
},
get challengejson() {
return a();
},
set challengejson(n) {
if (n === void 0) {
n = void 0;
}
a(n), $();
},
get customfetch() {
return o();
},
set customfetch(n) {
if (n === void 0) {
n = void 0;
}
o(n), $();
},
get debug() {
return f();
},
set debug(n) {
if (n === void 0) {
n = !1;
}
f(n), $();
},
get delay() {
return s();
},
set delay(n) {
if (n === void 0) {
n = 0;
}
s(n), $();
},
get expire() {
return c();
},
set expire(n) {
if (n === void 0) {
n = void 0;
}
c(n), $();
},
get floating() {
return v();
},
set floating(n) {
if (n === void 0) {
n = void 0;
}
v(n), $();
},
get floatinganchor() {
return h();
},
set floatinganchor(n) {
if (n === void 0) {
n = void 0;
}
h(n), $();
},
get floatingoffset() {
return g();
},
set floatingoffset(n) {
if (n === void 0) {
n = void 0;
}
g(n), $();
},
get hidefooter() {
return m();
},
set hidefooter(n) {
if (n === void 0) {
n = !1;
}
m(n), $();
},
get hidelogo() {
return w();
},
set hidelogo(n) {
if (n === void 0) {
n = !1;
}
w(n), $();
},
get id() {
return z();
},
set id(n) {
if (n === void 0) {
n = void 0;
}
z(n), $();
},
get name() {
return T();
},
set name(n) {
if (n === void 0) {
n = "altcha";
}
T(n), $();
},
get maxnumber() {
return Y();
},
set maxnumber(n) {
if (n === void 0) {
n = 1e6;
}
Y(n), $();
},
get mockerror() {
return M();
},
set mockerror(n) {
if (n === void 0) {
n = !1;
}
M(n), $();
},
get obfuscated() {
return F();
},
set obfuscated(n) {
if (n === void 0) {
n = void 0;
}
F(n), $();
},
get plugins() {
return se();
},
set plugins(n) {
if (n === void 0) {
n = void 0;
}
se(n), $();
},
get refetchonexpire() {
return be();
},
set refetchonexpire(n) {
if (n === void 0) {
n = !0;
}
be(n), $();
},
get spamfilter() {
return N();
},
set spamfilter(n) {
if (n === void 0) {
n = !1;
}
N(n), $();
},
get strings() {
return X();
},
set strings(n) {
if (n === void 0) {
n = void 0;
}
X(n), $();
},
get test() {
return U();
},
set test(n) {
if (n === void 0) {
n = !1;
}
U(n), $();
},
get verifyurl() {
return Ee();
},
set verifyurl(n) {
if (n === void 0) {
n = void 0;
}
Ee(n), $();
},
get workers() {
return Me();
},
set workers(n) {
if (n === void 0) {
n = Math.min(16, navigator.hardwareConcurrency || 8);
}
Me(n), $();
},
get workerurl() {
return tt();
},
set workerurl(n) {
if (n === void 0) {
n = void 0;
}
tt(n), $();
}
});
}
bl(["change"]);
customElements.define("altcha-widget", Ml(la, {
blockspam: {
type: "Boolean"
},
debug: {
type: "Boolean"
},
delay: {
type: "Number"
},
expire: {
type: "Number"
},
floatingoffset: {
type: "Number"
},
hidefooter: {
type: "Boolean"
},
hidelogo: {
type: "Boolean"
},
maxnumber: {
type: "Number"
},
mockerror: {
type: "Boolean"
},
refetchonexpire: {
type: "Boolean"
},
test: {
type: "Boolean"
},
workers: {
type: "Number"
},
auto: {},
challengeurl: {},
challengejson: {},
customfetch: {},
floating: {},
floatinganchor: {},
id: {},
name: {},
obfuscated: {},
plugins: {},
spamfilter: {},
strings: {},
verifyurl: {},
workerurl: {}
}, ["default"], ["clarify", "configure", "getConfiguration", "getFloatingAnchor", "getPlugin", "getState", "reset", "setFloatingAnchor", "setState", "verify"], !1));
globalThis.altchaCreateWorker = function (e) {
return e ? new Worker(new URL(e)) : new _i();
};
globalThis.altchaPlugins = globalThis.altchaPlugins || [];
;// ./static/js/pages/core/contact.js
function contact_typeof(o) { "@babel/helpers - typeof"; return contact_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, contact_typeof(o); }
function contact_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
function contact_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, contact_toPropertyKey(o.key), o); } }
function contact_createClass(e, r, t) { return r && contact_defineProperties(e.prototype, r), t && contact_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
function contact_callSuper(t, o, e) { return o = contact_getPrototypeOf(o), contact_possibleConstructorReturn(t, contact_isNativeReflectConstruct() ? Reflect.construct(o, e || [], contact_getPrototypeOf(t).constructor) : o.apply(t, e)); }
function contact_possibleConstructorReturn(t, e) { if (e && ("object" == contact_typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return contact_assertThisInitialized(t); }
function contact_assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
function contact_isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (contact_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
function contact_getPrototypeOf(t) { return contact_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, contact_getPrototypeOf(t); }
function contact_inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && contact_setPrototypeOf(t, e); }
function contact_setPrototypeOf(t, e) { return contact_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, contact_setPrototypeOf(t, e); }
function contact_defineProperty(e, r, t) { return (r = contact_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function contact_toPropertyKey(t) { var i = contact_toPrimitive(t, "string"); return "symbol" == contact_typeof(i) ? i : i + ""; }
function contact_toPrimitive(t, r) { if ("object" != contact_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != contact_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
// internal
// vendor
var PageContact = /*#__PURE__*/function (_BasePage) {
function PageContact(router) {
contact_classCallCheck(this, PageContact);
return contact_callSuper(this, PageContact, [router]);
}
contact_inherits(PageContact, _BasePage);
return contact_createClass(PageContact, [{
key: "initialize",
value: function initialize() {
this.sharedInitialize();
// this.hookupALTCHAByLocalServer();
this.hookupButtonSubmitFormContactUs();
}
/*
hookupALTCHAByAPI() {
const form = document.querySelector(idContactForm);
const altchaWidget = form.querySelector('altcha-widget');
// Listen for verification events from the ALTCHA widget
if (altchaWidget) {
altchaWidget.addEventListener('serververification', function(event) {
// Create or update the hidden input for ALTCHA
let altchaInput = form.querySelector('input[name="altcha"]');
if (!altchaInput) {
altchaInput = document.createElement('input');
altchaInput.type = 'hidden';
altchaInput.name = 'altcha';
form.appendChild(altchaInput);
}
// Set the verification payload
altchaInput.value = event.detail.payload;
});
}
}
*/
}, {
key: "hookupALTCHAByLocalServer",
value: function hookupALTCHAByLocalServer() {
window.ALTCHA = {
init: function init(config) {
document.querySelectorAll(config.selector).forEach(function (el) {
new la({
target: el,
props: {
challengeurl: config.challenge.url,
auto: 'onload'
}
}).$on('verified', function (e) {
config.challenge.onSuccess(e.detail.payload, el);
});
});
}
};
}
}, {
key: "hookupButtonSubmitFormContactUs",
value: function hookupButtonSubmitFormContactUs() {
var button = document.querySelector('form input[type="submit"]');
button.classList.add(flagButton);
button.classList.add(flagButtonPrimary);
}
}]);
}(BasePage);
contact_defineProperty(PageContact, "hash", hashPageContact);
;// ./static/js/pages/legal/accessibility_report.js
function accessibility_report_typeof(o) { "@babel/helpers - typeof"; return accessibility_report_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, accessibility_report_typeof(o); }
function accessibility_report_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
function accessibility_report_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, accessibility_report_toPropertyKey(o.key), o); } }
function accessibility_report_createClass(e, r, t) { return r && accessibility_report_defineProperties(e.prototype, r), t && accessibility_report_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
function accessibility_report_callSuper(t, o, e) { return o = accessibility_report_getPrototypeOf(o), accessibility_report_possibleConstructorReturn(t, accessibility_report_isNativeReflectConstruct() ? Reflect.construct(o, e || [], accessibility_report_getPrototypeOf(t).constructor) : o.apply(t, e)); }
function accessibility_report_possibleConstructorReturn(t, e) { if (e && ("object" == accessibility_report_typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return accessibility_report_assertThisInitialized(t); }
function accessibility_report_assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
function accessibility_report_isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (accessibility_report_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
function accessibility_report_superPropGet(t, o, e, r) { var p = accessibility_report_get(accessibility_report_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
function accessibility_report_get() { return accessibility_report_get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = accessibility_report_superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, accessibility_report_get.apply(null, arguments); }
function accessibility_report_superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = accessibility_report_getPrototypeOf(t));); return t; }
function accessibility_report_getPrototypeOf(t) { return accessibility_report_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, accessibility_report_getPrototypeOf(t); }
function accessibility_report_inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && accessibility_report_setPrototypeOf(t, e); }
function accessibility_report_setPrototypeOf(t, e) { return accessibility_report_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, accessibility_report_setPrototypeOf(t, e); }
function accessibility_report_defineProperty(e, r, t) { return (r = accessibility_report_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function accessibility_report_toPropertyKey(t) { var i = accessibility_report_toPrimitive(t, "string"); return "symbol" == accessibility_report_typeof(i) ? i : i + ""; }
function accessibility_report_toPrimitive(t, r) { if ("object" != accessibility_report_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != accessibility_report_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
var PageAccessibilityReport = /*#__PURE__*/function (_BasePage) {
function PageAccessibilityReport(router) {
accessibility_report_classCallCheck(this, PageAccessibilityReport);
return accessibility_report_callSuper(this, PageAccessibilityReport, [router]);
}
accessibility_report_inherits(PageAccessibilityReport, _BasePage);
return accessibility_report_createClass(PageAccessibilityReport, [{
key: "initialize",
value: function initialize() {
this.sharedInitialize();
}
}, {
key: "leave",
value: function leave() {
accessibility_report_superPropGet(PageAccessibilityReport, "leave", this, 3)([]);
}
}]);
}(BasePage);
accessibility_report_defineProperty(PageAccessibilityReport, "hash", hashPageAccessibilityReport);
;// ./static/js/pages/legal/accessibility_statement.js
function accessibility_statement_typeof(o) { "@babel/helpers - typeof"; return accessibility_statement_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, accessibility_statement_typeof(o); }
function accessibility_statement_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
function accessibility_statement_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, accessibility_statement_toPropertyKey(o.key), o); } }
function accessibility_statement_createClass(e, r, t) { return r && accessibility_statement_defineProperties(e.prototype, r), t && accessibility_statement_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
function accessibility_statement_callSuper(t, o, e) { return o = accessibility_statement_getPrototypeOf(o), accessibility_statement_possibleConstructorReturn(t, accessibility_statement_isNativeReflectConstruct() ? Reflect.construct(o, e || [], accessibility_statement_getPrototypeOf(t).constructor) : o.apply(t, e)); }
function accessibility_statement_possibleConstructorReturn(t, e) { if (e && ("object" == accessibility_statement_typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return accessibility_statement_assertThisInitialized(t); }
function accessibility_statement_assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
function accessibility_statement_isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (accessibility_statement_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
function accessibility_statement_superPropGet(t, o, e, r) { var p = accessibility_statement_get(accessibility_statement_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
function accessibility_statement_get() { return accessibility_statement_get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = accessibility_statement_superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, accessibility_statement_get.apply(null, arguments); }
function accessibility_statement_superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = accessibility_statement_getPrototypeOf(t));); return t; }
function accessibility_statement_getPrototypeOf(t) { return accessibility_statement_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, accessibility_statement_getPrototypeOf(t); }
function accessibility_statement_inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && accessibility_statement_setPrototypeOf(t, e); }
function accessibility_statement_setPrototypeOf(t, e) { return accessibility_statement_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, accessibility_statement_setPrototypeOf(t, e); }
function accessibility_statement_defineProperty(e, r, t) { return (r = accessibility_statement_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function accessibility_statement_toPropertyKey(t) { var i = accessibility_statement_toPrimitive(t, "string"); return "symbol" == accessibility_statement_typeof(i) ? i : i + ""; }
function accessibility_statement_toPrimitive(t, r) { if ("object" != accessibility_statement_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != accessibility_statement_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
var PageAccessibilityStatement = /*#__PURE__*/function (_BasePage) {
function PageAccessibilityStatement(router) {
accessibility_statement_classCallCheck(this, PageAccessibilityStatement);
return accessibility_statement_callSuper(this, PageAccessibilityStatement, [router]);
}
accessibility_statement_inherits(PageAccessibilityStatement, _BasePage);
return accessibility_statement_createClass(PageAccessibilityStatement, [{
key: "initialize",
value: function initialize() {
this.sharedInitialize();
}
}, {
key: "leave",
value: function leave() {
accessibility_statement_superPropGet(PageAccessibilityStatement, "leave", this, 3)([]);
}
}]);
}(BasePage);
accessibility_statement_defineProperty(PageAccessibilityStatement, "hash", hashPageAccessibilityStatement);
;// ./static/js/pages/legal/license.js
function license_typeof(o) { "@babel/helpers - typeof"; return license_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, license_typeof(o); }
function license_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
function license_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, license_toPropertyKey(o.key), o); } }
function license_createClass(e, r, t) { return r && license_defineProperties(e.prototype, r), t && license_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
function license_callSuper(t, o, e) { return o = license_getPrototypeOf(o), license_possibleConstructorReturn(t, license_isNativeReflectConstruct() ? Reflect.construct(o, e || [], license_getPrototypeOf(t).constructor) : o.apply(t, e)); }
function license_possibleConstructorReturn(t, e) { if (e && ("object" == license_typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return license_assertThisInitialized(t); }
function license_assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
function license_isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (license_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
function license_superPropGet(t, o, e, r) { var p = license_get(license_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
function license_get() { return license_get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = license_superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, license_get.apply(null, arguments); }
function license_superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = license_getPrototypeOf(t));); return t; }
function license_getPrototypeOf(t) { return license_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, license_getPrototypeOf(t); }
function license_inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && license_setPrototypeOf(t, e); }
function license_setPrototypeOf(t, e) { return license_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, license_setPrototypeOf(t, e); }
function license_defineProperty(e, r, t) { return (r = license_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function license_toPropertyKey(t) { var i = license_toPrimitive(t, "string"); return "symbol" == license_typeof(i) ? i : i + ""; }
function license_toPrimitive(t, r) { if ("object" != license_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != license_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
var PageLicense = /*#__PURE__*/function (_BasePage) {
function PageLicense(router) {
license_classCallCheck(this, PageLicense);
return license_callSuper(this, PageLicense, [router]);
}
license_inherits(PageLicense, _BasePage);
return license_createClass(PageLicense, [{
key: "initialize",
value: function initialize() {
this.sharedInitialize();
}
}, {
key: "leave",
value: function leave() {
license_superPropGet(PageLicense, "leave", this, 3)([]);
}
}]);
}(BasePage);
license_defineProperty(PageLicense, "hash", hashPageLicense);
;// ./static/js/api.js
function api_typeof(o) { "@babel/helpers - typeof"; return api_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, api_typeof(o); }
function api_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ api_regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == api_typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(api_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
function api_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function api_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? api_ownKeys(Object(t), !0).forEach(function (r) { api_defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : api_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
function api_defineProperty(e, r, t) { return (r = api_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function api_asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
function api_asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { api_asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { api_asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
function api_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
function api_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, api_toPropertyKey(o.key), o); } }
function api_createClass(e, r, t) { return r && api_defineProperties(e.prototype, r), t && api_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
function api_toPropertyKey(t) { var i = api_toPrimitive(t, "string"); return "symbol" == api_typeof(i) ? i : i + ""; }
function api_toPrimitive(t, r) { if ("object" != api_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != api_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
var API = /*#__PURE__*/function () {
function API() {
api_classCallCheck(this, API);
}
return api_createClass(API, null, [{
key: "getCsrfToken",
value: function getCsrfToken() {
return document.querySelector(idCSRFToken).getAttribute('content');
}
}, {
key: "request",
value: function () {
var _request = api_asyncToGenerator(/*#__PURE__*/api_regeneratorRuntime().mark(function _callee(hashEndpoint) {
var method,
data,
params,
url,
csrfToken,
options,
response,
_args = arguments;
return api_regeneratorRuntime().wrap(function _callee$(_context) {
while (1) switch (_context.prev = _context.next) {
case 0:
method = _args.length > 1 && _args[1] !== undefined ? _args[1] : 'GET';
data = _args.length > 2 && _args[2] !== undefined ? _args[2] : null;
params = _args.length > 3 && _args[3] !== undefined ? _args[3] : null;
url = API.getUrlFromHash(hashEndpoint, params);
csrfToken = API.getCsrfToken();
options = {
method: method,
headers: api_defineProperty({
'Content-Type': 'application/json'
}, flagCsrfToken, csrfToken)
};
if (data && (method === 'POST' || method === 'PUT' || method === 'PATCH')) {
data = api_objectSpread(api_objectSpread({}, data), {}, api_defineProperty({}, flagCsrfToken, csrfToken));
options.body = JSON.stringify(data);
}
_context.prev = 7;
_context.next = 10;
return fetch(url, options);
case 10:
response = _context.sent;
if (response.ok) {
_context.next = 13;
break;
}
throw new Error("HTTP error! status: ".concat(response.status));
case 13:
_context.next = 15;
return response.json();
case 15:
return _context.abrupt("return", _context.sent);
case 18:
_context.prev = 18;
_context.t0 = _context["catch"](7);
console.error('API request failed:', _context.t0);
throw _context.t0;
case 22:
case "end":
return _context.stop();
}
}, _callee, null, [[7, 18]]);
}));
function request(_x) {
return _request.apply(this, arguments);
}
return request;
}()
}, {
key: "getUrlFromHash",
value: function getUrlFromHash(hash) {
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
if (hash == null) hash = hashPageHome;
var url = API.parameteriseUrl(_pathHost + hash, params);
return url;
}
}, {
key: "parameteriseUrl",
value: function parameteriseUrl(url, params) {
if (params) {
url += '?' + new URLSearchParams(params).toString();
}
return url;
}
}, {
key: "goToUrl",
value: function goToUrl(url) {
window.location.href = url;
}
}, {
key: "goToHash",
value: function goToHash(hash) {
var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
var url = API.getUrlFromHash(hash, params);
API.goToUrl(url);
}
// specific api calls
/* Example:
getUsers: () => request('/users'),
getUserById: (id) => request(`/users/${id}`),
createUser: (userData) => request('/users', 'POST', userData),
updateUser: (id, userData) => request(`/users/${id}`, 'PUT', userData),
deleteUser: (id) => request(`/users/${id}`, 'DELETE'),
*/
}, {
key: "loginUser",
value: function () {
var _loginUser = api_asyncToGenerator(/*#__PURE__*/api_regeneratorRuntime().mark(function _callee2() {
var callback;
return api_regeneratorRuntime().wrap(function _callee2$(_context2) {
while (1) switch (_context2.prev = _context2.next) {
case 0:
callback = {};
callback[flagCallback] = DOM.getHashPageCurrent();
_context2.next = 4;
return API.request(hashPageUserLogin, 'POST', callback);
case 4:
return _context2.abrupt("return", _context2.sent);
case 5:
case "end":
return _context2.stop();
}
}, _callee2);
}));
function loginUser() {
return _loginUser.apply(this, arguments);
}
return loginUser;
}() // store
// product categories
}, {
key: "saveCategories",
value: function () {
var _saveCategories = api_asyncToGenerator(/*#__PURE__*/api_regeneratorRuntime().mark(function _callee3(categories, formFilters, comment) {
var dataRequest;
return api_regeneratorRuntime().wrap(function _callee3$(_context3) {
while (1) switch (_context3.prev = _context3.next) {
case 0:
dataRequest = {};
dataRequest[flagFormFilters] = DOM.convertForm2JSON(formFilters);
dataRequest[flagProductCategory] = categories;
dataRequest[flagComment] = comment;
_context3.next = 6;
return API.request(hashSaveStoreProductCategory, 'POST', dataRequest);
case 6:
return _context3.abrupt("return", _context3.sent);
case 7:
case "end":
return _context3.stop();
}
}, _callee3);
}));
function saveCategories(_x2, _x3, _x4) {
return _saveCategories.apply(this, arguments);
}
return saveCategories;
}() // products
}, {
key: "saveProducts",
value: function () {
var _saveProducts = api_asyncToGenerator(/*#__PURE__*/api_regeneratorRuntime().mark(function _callee4(products, formFilters, comment) {
var dataRequest;
return api_regeneratorRuntime().wrap(function _callee4$(_context4) {
while (1) switch (_context4.prev = _context4.next) {
case 0:
dataRequest = {};
dataRequest[flagFormFilters] = DOM.convertForm2JSON(formFilters);
dataRequest[flagProduct] = products;
dataRequest[flagComment] = comment;
_context4.next = 6;
return API.request(hashSaveStoreProduct, 'POST', dataRequest);
case 6:
return _context4.abrupt("return", _context4.sent);
case 7:
case "end":
return _context4.stop();
}
}, _callee4);
}));
function saveProducts(_x5, _x6, _x7) {
return _saveProducts.apply(this, arguments);
}
return saveProducts;
}() // product permutations
}, {
key: "saveProductPermutations",
value: function () {
var _saveProductPermutations = api_asyncToGenerator(/*#__PURE__*/api_regeneratorRuntime().mark(function _callee5(permutations, formFilters, comment) {
var dataRequest;
return api_regeneratorRuntime().wrap(function _callee5$(_context5) {
while (1) switch (_context5.prev = _context5.next) {
case 0:
dataRequest = {};
dataRequest[flagFormFilters] = DOM.convertForm2JSON(formFilters);
dataRequest[flagProductPermutation] = permutations;
dataRequest[flagComment] = comment;
_context5.next = 6;
return API.request(hashSaveStoreProductPermutation, 'POST', dataRequest);
case 6:
return _context5.abrupt("return", _context5.sent);
case 7:
case "end":
return _context5.stop();
}
}, _callee5);
}));
function saveProductPermutations(_x8, _x9, _x10) {
return _saveProductPermutations.apply(this, arguments);
}
return saveProductPermutations;
}() // product variations
}, {
key: "saveProductVariations",
value: function () {
var _saveProductVariations = api_asyncToGenerator(/*#__PURE__*/api_regeneratorRuntime().mark(function _callee6(variationTypes, formFilters, comment) {
var dataRequest;
return api_regeneratorRuntime().wrap(function _callee6$(_context6) {
while (1) switch (_context6.prev = _context6.next) {
case 0:
dataRequest = {};
dataRequest[flagFormFilters] = DOM.convertForm2JSON(formFilters);
dataRequest[flagProductVariationType] = variationTypes;
dataRequest[flagComment] = comment;
_context6.next = 6;
return API.request(hashSaveStoreProductVariation, 'POST', dataRequest);
case 6:
return _context6.abrupt("return", _context6.sent);
case 7:
case "end":
return _context6.stop();
}
}, _callee6);
}));
function saveProductVariations(_x11, _x12, _x13) {
return _saveProductVariations.apply(this, arguments);
}
return saveProductVariations;
}() // stock items
}, {
key: "saveStockItems",
value: function () {
var _saveStockItems = api_asyncToGenerator(/*#__PURE__*/api_regeneratorRuntime().mark(function _callee7(stockItems, formFilters, comment) {
var dataRequest;
return api_regeneratorRuntime().wrap(function _callee7$(_context7) {
while (1) switch (_context7.prev = _context7.next) {
case 0:
dataRequest = {};
dataRequest[flagFormFilters] = DOM.convertForm2JSON(formFilters);
dataRequest[flagStockItem] = stockItems;
dataRequest[flagComment] = comment;
_context7.next = 6;
return API.request(hashSaveStoreStockItem, 'POST', dataRequest);
case 6:
return _context7.abrupt("return", _context7.sent);
case 7:
case "end":
return _context7.stop();
}
}, _callee7);
}));
function saveStockItems(_x14, _x15, _x16) {
return _saveStockItems.apply(this, arguments);
}
return saveStockItems;
}() // suppliers
}, {
key: "saveSuppliers",
value: function () {
var _saveSuppliers = api_asyncToGenerator(/*#__PURE__*/api_regeneratorRuntime().mark(function _callee8(suppliers, formFilters, comment) {
var dataRequest;
return api_regeneratorRuntime().wrap(function _callee8$(_context8) {
while (1) switch (_context8.prev = _context8.next) {
case 0:
dataRequest = {};
dataRequest[flagFormFilters] = DOM.convertForm2JSON(formFilters);
dataRequest[flagSupplier] = suppliers;
dataRequest[flagComment] = comment;
_context8.next = 6;
return API.request(hashSaveStoreSupplier, 'POST', dataRequest);
case 6:
return _context8.abrupt("return", _context8.sent);
case 7:
case "end":
return _context8.stop();
}
}, _callee8);
}));
function saveSuppliers(_x17, _x18, _x19) {
return _saveSuppliers.apply(this, arguments);
}
return saveSuppliers;
}() // supplier purchase orders
}, {
key: "saveSupplierPurchaseOrders",
value: function () {
var _saveSupplierPurchaseOrders = api_asyncToGenerator(/*#__PURE__*/api_regeneratorRuntime().mark(function _callee9(supplierPurchaseOrders, formFilters, comment) {
var dataRequest;
return api_regeneratorRuntime().wrap(function _callee9$(_context9) {
while (1) switch (_context9.prev = _context9.next) {
case 0:
dataRequest = {};
dataRequest[flagFormFilters] = DOM.convertForm2JSON(formFilters);
dataRequest[flagSupplierPurchaseOrder] = supplierPurchaseOrders;
dataRequest[flagComment] = comment;
_context9.next = 6;
return API.request(hashSaveStoreSupplierPurchaseOrder, 'POST', dataRequest);
case 6:
return _context9.abrupt("return", _context9.sent);
case 7:
case "end":
return _context9.stop();
}
}, _callee9);
}));
function saveSupplierPurchaseOrders(_x20, _x21, _x22) {
return _saveSupplierPurchaseOrders.apply(this, arguments);
}
return saveSupplierPurchaseOrders;
}() // manufacturing purchase orders
}, {
key: "saveManufacturingPurchaseOrders",
value: function () {
var _saveManufacturingPurchaseOrders = api_asyncToGenerator(/*#__PURE__*/api_regeneratorRuntime().mark(function _callee10(manufacturingPurchaseOrders, formFilters, comment) {
var dataRequest;
return api_regeneratorRuntime().wrap(function _callee10$(_context10) {
while (1) switch (_context10.prev = _context10.next) {
case 0:
dataRequest = {};
dataRequest[flagFormFilters] = DOM.convertForm2JSON(formFilters);
dataRequest[flagManufacturingPurchaseOrder] = manufacturingPurchaseOrders;
dataRequest[flagComment] = comment;
_context10.next = 6;
return API.request(hashSaveStoreManufacturingPurchaseOrder, 'POST', dataRequest);
case 6:
return _context10.abrupt("return", _context10.sent);
case 7:
case "end":
return _context10.stop();
}
}, _callee10);
}));
function saveManufacturingPurchaseOrders(_x23, _x24, _x25) {
return _saveManufacturingPurchaseOrders.apply(this, arguments);
}
return saveManufacturingPurchaseOrders;
}()
}]);
}();
/*
const api = new API();
export default api;
document.addEventListener('DOMContentLoaded', () => {
initializeApp();
setupEventListeners();
initializeComponents();
// Example of using the API
API.getData('/some-endpoint')
.then(data => console.log('Data received:', data))
.catch(error => console.error('Error:', error));
});
*/
;// ./static/js/pages/legal/privacy_policy.js
function privacy_policy_typeof(o) { "@babel/helpers - typeof"; return privacy_policy_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, privacy_policy_typeof(o); }
function privacy_policy_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
function privacy_policy_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, privacy_policy_toPropertyKey(o.key), o); } }
function privacy_policy_createClass(e, r, t) { return r && privacy_policy_defineProperties(e.prototype, r), t && privacy_policy_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
function privacy_policy_callSuper(t, o, e) { return o = privacy_policy_getPrototypeOf(o), privacy_policy_possibleConstructorReturn(t, privacy_policy_isNativeReflectConstruct() ? Reflect.construct(o, e || [], privacy_policy_getPrototypeOf(t).constructor) : o.apply(t, e)); }
function privacy_policy_possibleConstructorReturn(t, e) { if (e && ("object" == privacy_policy_typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return privacy_policy_assertThisInitialized(t); }
function privacy_policy_assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
function privacy_policy_isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (privacy_policy_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
function privacy_policy_superPropGet(t, o, e, r) { var p = privacy_policy_get(privacy_policy_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
function privacy_policy_get() { return privacy_policy_get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = privacy_policy_superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, privacy_policy_get.apply(null, arguments); }
function privacy_policy_superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = privacy_policy_getPrototypeOf(t));); return t; }
function privacy_policy_getPrototypeOf(t) { return privacy_policy_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, privacy_policy_getPrototypeOf(t); }
function privacy_policy_inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && privacy_policy_setPrototypeOf(t, e); }
function privacy_policy_setPrototypeOf(t, e) { return privacy_policy_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, privacy_policy_setPrototypeOf(t, e); }
function privacy_policy_defineProperty(e, r, t) { return (r = privacy_policy_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function privacy_policy_toPropertyKey(t) { var i = privacy_policy_toPrimitive(t, "string"); return "symbol" == privacy_policy_typeof(i) ? i : i + ""; }
function privacy_policy_toPrimitive(t, r) { if ("object" != privacy_policy_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != privacy_policy_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
var PagePrivacyPolicy = /*#__PURE__*/function (_BasePage) {
function PagePrivacyPolicy(router) {
privacy_policy_classCallCheck(this, PagePrivacyPolicy);
return privacy_policy_callSuper(this, PagePrivacyPolicy, [router]);
}
privacy_policy_inherits(PagePrivacyPolicy, _BasePage);
return privacy_policy_createClass(PagePrivacyPolicy, [{
key: "initialize",
value: function initialize() {
this.sharedInitialize();
}
}, {
key: "leave",
value: function leave() {
privacy_policy_superPropGet(PagePrivacyPolicy, "leave", this, 3)([]);
}
}]);
}(BasePage);
privacy_policy_defineProperty(PagePrivacyPolicy, "hash", hashPagePrivacyPolicy);
;// ./static/js/pages/legal/retention_schedule.js
function retention_schedule_typeof(o) { "@babel/helpers - typeof"; return retention_schedule_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, retention_schedule_typeof(o); }
function retention_schedule_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
function retention_schedule_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, retention_schedule_toPropertyKey(o.key), o); } }
function retention_schedule_createClass(e, r, t) { return r && retention_schedule_defineProperties(e.prototype, r), t && retention_schedule_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
function retention_schedule_callSuper(t, o, e) { return o = retention_schedule_getPrototypeOf(o), retention_schedule_possibleConstructorReturn(t, retention_schedule_isNativeReflectConstruct() ? Reflect.construct(o, e || [], retention_schedule_getPrototypeOf(t).constructor) : o.apply(t, e)); }
function retention_schedule_possibleConstructorReturn(t, e) { if (e && ("object" == retention_schedule_typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return retention_schedule_assertThisInitialized(t); }
function retention_schedule_assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
function retention_schedule_isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (retention_schedule_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
function retention_schedule_superPropGet(t, o, e, r) { var p = retention_schedule_get(retention_schedule_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
function retention_schedule_get() { return retention_schedule_get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = retention_schedule_superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, retention_schedule_get.apply(null, arguments); }
function retention_schedule_superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = retention_schedule_getPrototypeOf(t));); return t; }
function retention_schedule_getPrototypeOf(t) { return retention_schedule_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, retention_schedule_getPrototypeOf(t); }
function retention_schedule_inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && retention_schedule_setPrototypeOf(t, e); }
function retention_schedule_setPrototypeOf(t, e) { return retention_schedule_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, retention_schedule_setPrototypeOf(t, e); }
function retention_schedule_defineProperty(e, r, t) { return (r = retention_schedule_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function retention_schedule_toPropertyKey(t) { var i = retention_schedule_toPrimitive(t, "string"); return "symbol" == retention_schedule_typeof(i) ? i : i + ""; }
function retention_schedule_toPrimitive(t, r) { if ("object" != retention_schedule_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != retention_schedule_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
var PageRetentionSchedule = /*#__PURE__*/function (_BasePage) {
function PageRetentionSchedule(router) {
retention_schedule_classCallCheck(this, PageRetentionSchedule);
return retention_schedule_callSuper(this, PageRetentionSchedule, [router]);
}
retention_schedule_inherits(PageRetentionSchedule, _BasePage);
return retention_schedule_createClass(PageRetentionSchedule, [{
key: "initialize",
value: function initialize() {
this.sharedInitialize();
}
}, {
key: "leave",
value: function leave() {
retention_schedule_superPropGet(PageRetentionSchedule, "leave", this, 3)([]);
}
}]);
}(BasePage);
retention_schedule_defineProperty(PageRetentionSchedule, "hash", hashPageDataRetentionSchedule);
;// ./static/js/router.js
function router_typeof(o) { "@babel/helpers - typeof"; return router_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, router_typeof(o); }
function router_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
function router_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, router_toPropertyKey(o.key), o); } }
function router_createClass(e, r, t) { return r && router_defineProperties(e.prototype, r), t && router_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
function router_toPropertyKey(t) { var i = router_toPrimitive(t, "string"); return "symbol" == router_typeof(i) ? i : i + ""; }
function router_toPrimitive(t, r) { if ("object" != router_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != router_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
// Pages
// Core
// Legal
// User
// import PageUserLogin from './pages/user/login.js';
// import PageUserLogout from './pages/user/logout.js';
// import PageUserAccount from './pages/user/account.js';
var Router = /*#__PURE__*/function () {
function Router() {
var _this = this;
router_classCallCheck(this, Router);
// Pages
this.pages = {};
// Core
this.pages[hashPageHome] = {
name: 'PageHome',
module: PageHome
}; // importModule: () => import(/* webpackChunkName: "page_core_home" */ './pages/core/home.js') , pathModule: './pages/core/home.js'
this.pages[hashPageContact] = {
name: 'PageContact',
module: PageContact
}; // pathModule: './pages/core/contact.js' };
// Legal
this.pages[hashPageAccessibilityStatement] = {
name: 'PageAccessibilityStatement',
module: PageAccessibilityStatement
}; // pathModule: '../../static/js/pages/legal/accessibility_statement.js' }; // , page: PageAccessibilityStatement
this.pages[hashPageDataRetentionSchedule] = {
name: 'PageDataRetentionSchedule',
module: PageRetentionSchedule
}; // pathModule: './pages/legal/data_retention_schedule.js' };
this.pages[hashPageLicense] = {
name: 'PageLicense',
module: PageLicense
}; // pathModule: './pages/legal/license.js' };
this.pages[hashPagePrivacyPolicy] = {
name: 'PagePrivacyPolicy',
module: PagePrivacyPolicy
}; // pathModule: './pages/legal/privacy_policy.js' }; // importModule: () => {return import(/* webpackChunkName: "page_privacy_policy" */ './pages/legal/privacy_policy.js'); }
// User
// this.pages[hashPageUserLogin] = { name: 'PageUserLogin', module: PageUserLogin }; // pathModule: './pages/user/login.js' };
// this.pages[hashPageUserLogout] = { name: 'PageUserLogout', module: PageUserLogout }; // pathModule: './pages/user/logout.js' };
// this.pages[hashPageUserAccount] = { name: 'PageUserAccount', module: PageUserAccount }; // pathModule: './pages/user/account.js' };
// Routes
this.routes = {};
// Core
this.routes[hashPageHome] = function () {
var isPopState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
return _this.navigateToHash(hashPageHome, isPopState);
};
this.routes[hashPageContact] = function () {
var isPopState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
return _this.navigateToHash(hashPageContact, isPopState);
};
// Legal
this.routes[hashPageAccessibilityStatement] = function () {
var isPopState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
return _this.navigateToHash(hashPageAccessibilityStatement, isPopState);
};
this.routes[hashPageDataRetentionSchedule] = function () {
var isPopState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
return _this.navigateToHash(hashPageDataRetentionSchedule, isPopState);
};
this.routes[hashPageLicense] = function () {
var isPopState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
return _this.navigateToHash(hashPageLicense, isPopState);
};
this.routes[hashPagePrivacyPolicy] = function () {
var isPopState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
return _this.navigateToHash(hashPagePrivacyPolicy, isPopState);
};
// User
// this.routes[hashPageUserLogin] = (isPopState = false) => this.navigateToHash(hashPageUserLogin, isPopState);
// this.routes[hashPageUserLogout] = (isPopState = false) => this.navigateToHash(hashPageUserLogout, isPopState);
// this.routes[hashPageUserAccount] = (isPopState = false) => this.navigateToHash(hashPageUserAccount, isPopState);
this.initialize();
}
return router_createClass(Router, [{
key: "loadPage",
value: function loadPage(hashPage) {
var _this2 = this;
var isPopState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
var PageClass = this.getClassPageFromHash(hashPage);
this.currentPage = new PageClass(this);
this.currentPage.initialize(isPopState);
window.addEventListener('beforeunload', function () {
return _this2.currentPage.leave();
});
}
}, {
key: "getClassPageFromHash",
value: function getClassPageFromHash(hashPage) {
var pageJson = this.pages[hashPage];
try {
/*
const module = await pagesContext(pageJson.pathModule);
console.log("module: ", module);
return module[pageJson.name];
*/
// const module = await import(pageJson.pathModule); // pageJson.page;
// const module = () => import(pageJson.pathModule);
var module = pageJson.module; // importModule;
return module; // [pageJson.name];
} catch (error) {
if (_verbose) {
console.log("this.pages: ", this.pages);
}
;
console.error('Page not found:', hashPage);
throw error;
}
}
}, {
key: "initialize",
value: function initialize() {
/*
let pages = Router.getPages();
for (const key of Object.keys(pages)) {
let page = pages[key];
this.addRoute(page.hash, page.initialize);
}
*/
window.addEventListener('popstate', this.handlePopState.bind(this)); // page accessed by history navigation
}
}, {
key: "handlePopState",
value: function handlePopState(event) {
this.loadPageCurrent();
}
}, {
key: "loadPageCurrent",
value: function loadPageCurrent() {
var hashPageCurrent = DOM.getHashPageCurrent();
this.loadPage(hashPageCurrent);
}
}, {
key: "navigateToHash",
value: function navigateToHash(hash) {
var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
var isPopState = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
// this.beforeLeave();
/*
if (this.routes[hash]) {
this.routes[hash](isPopState);
} else {
console.error(`Hash ${hash} not found`);
}
*/
var url = API.getUrlFromHash(hash, params);
// if (!isPopState)
history.pushState({
data: data,
params: params
}, '', hash);
API.goToUrl(url, data);
}
/* beforeunload listener
async beforeLeave() {
const ClassPageCurrent = await this.getClassPageFromHash(DOM.getHashPageCurrent());
const pageCurrent = new ClassPageCurrent(this);
pageCurrent.leave();
}
*/
}, {
key: "navigateToUrl",
value: function navigateToUrl(url) {
var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
var appendHistory = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
// this.beforeLeave();
if (appendHistory) history.pushState(data, '', url);
url = API.parameteriseUrl(url, data);
API.goToUrl(url);
}
}], [{
key: "loadPageBodyFromResponse",
value: function loadPageBodyFromResponse(response) {
DOM.loadPageBody(response.data);
}
}]);
}();
var router = new Router();
/*
router.addRoute('/', () => {
console.log('Home page');
// Load home page content
});
router.addRoute('/about', () => {
console.log('About page');
// Load about page content
});
export function setupNavigationEvents() {
document.querySelectorAll('a[data-nav]').forEach(link => {
link.addEventListener('click', (e) => {
e.preventDefault();
const url = e.target.getAttribute('href');
router.navigateToUrl(url);
});
});
}
*/
;// ./static/js/app.js
function app_typeof(o) { "@babel/helpers - typeof"; return app_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, app_typeof(o); }
function app_classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
function app_defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, app_toPropertyKey(o.key), o); } }
function app_createClass(e, r, t) { return r && app_defineProperties(e.prototype, r), t && app_defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
function app_toPropertyKey(t) { var i = app_toPrimitive(t, "string"); return "symbol" == app_typeof(i) ? i : i + ""; }
function app_toPrimitive(t, r) { if ("object" != app_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != app_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
var App = /*#__PURE__*/function () {
function App() {
app_classCallCheck(this, App);
this.dom = new DOM();
this.router = new Router();
}
return app_createClass(App, [{
key: "initialize",
value: function initialize() {
this.setupEventListeners();
this.start();
}
}, {
key: "setupEventListeners",
value: function setupEventListeners() {
// document.addEventListener('click', this.handleGlobalClick.bind(this));
}
}, {
key: "handleGlobalClick",
value: function handleGlobalClick(event) {}
}, {
key: "start",
value: function start() {
this.initPageCurrent();
}
}, {
key: "initPageCurrent",
value: function initPageCurrent() {
this.router.loadPageCurrent();
}
}]);
}();
var app = new App();
function domReady(fn) {
if (document.readyState !== 'loading') {
fn();
} else {
document.addEventListener('DOMContentLoaded', fn);
}
}
domReady(function () {
app.initialize();
});
window.app = app;
/* harmony default export */ const js_app = ((/* unused pure expression or super */ null && (app)));
})();
// This entry needs to be wrapped in an IIFE because it needs to be isolated against other entry modules.
(() => {
// extracted by mini-css-extract-plugin
})();
// This entry needs to be wrapped in an IIFE because it needs to be isolated against other entry modules.
(() => {
// extracted by mini-css-extract-plugin
})();
// This entry needs to be wrapped in an IIFE because it needs to be isolated against other entry modules.
(() => {
// extracted by mini-css-extract-plugin
})();
// This entry needs to be wrapped in an IIFE because it needs to be isolated against other entry modules.
(() => {
// extracted by mini-css-extract-plugin
})();
// This entry needs to be wrapped in an IIFE because it needs to be isolated against other entry modules.
(() => {
// extracted by mini-css-extract-plugin
})();
// This entry needs to be wrapped in an IIFE because it needs to be isolated against other entry modules.
(() => {
// extracted by mini-css-extract-plugin
})();
// This entry needs to be wrapped in an IIFE because it needs to be isolated against other entry modules.
(() => {
// extracted by mini-css-extract-plugin
})();
// This entry needs to be wrapped in an IIFE because it needs to be isolated against other entry modules.
(() => {
// extracted by mini-css-extract-plugin
})();
// This entry needs to be wrapped in an IIFE because it needs to be isolated against other entry modules.
(() => {
// extracted by mini-css-extract-plugin
})();
/******/ })()
;
//# sourceMappingURL=main.bundle.js.map