{"version":3,"file":"bundle.js","sources":["../node_modules/svelte/internal/index.mjs","../node_modules/svelte/store/index.mjs","../node_modules/svelte-routing/src/contexts.js","../node_modules/svelte-routing/src/history.js","../node_modules/svelte-routing/src/utils.js","../node_modules/svelte-routing/src/Router.svelte","../node_modules/svelte-routing/src/Route.svelte","../src/stores/index.js","../node_modules/svelte/easing/index.mjs","../node_modules/svelte/transition/index.mjs","../src/config/index.js","../src/tealium/index.js","../src/components/PageSection.svelte","../src/validation/index.js","../src/components/NavigationButtons.svelte","../src/routes/Registration/LandingPage.svelte","../node_modules/uuid4/browser.js","../src/components/Country.svelte","../src/components/AddressAutoComplete.svelte","../src/components/Checkbox.svelte","../src/components/Address.svelte","../src/components/Select.svelte","../src/components/Contact.svelte","../src/components/RadioGroup.svelte","../src/routes/Registration/PersonalDetails.svelte","../node_modules/dropzone/dist/dropzone.js","../src/components/DropZone.svelte","../src/routes/Registration/Details.svelte","../src/routes/Registration/Confirmation.svelte","../src/routes/Registration/Review.svelte","../src/routes/Registration/ThankYou.svelte","../src/routes/FileUpload/LandingPage.svelte","../src/routes/FileUpload/Files.svelte","../src/routes/FileUpload/ThankYou.svelte","../src/routes/ConfirmAgreements/LandingPage.svelte","../src/components/IFrame.svelte","../src/routes/ConfirmAgreements/ConfirmAgreements.svelte","../src/routes/ConfirmAgreements/ThankYou.svelte","../src/components/ClassActionEmailAddress.svelte","../src/components/ClassActionPhoneNumber.svelte","../src/routes/AcknowledgeAmendments/LandingPage.svelte","../src/routes/AcknowledgeAmendments/Letter.svelte","../src/routes/AcknowledgeAmendments/Funding.svelte","../src/routes/AcknowledgeAmendments/Disclosure.svelte","../src/routes/AcknowledgeAmendments/ThankYou.svelte","../src/routes/AcknowledgeUpdatedAgreements/LandingPage.svelte","../src/routes/AcknowledgeUpdatedAgreements/Letter.svelte","../src/routes/AcknowledgeUpdatedAgreements/ThankYou.svelte","../src/routes/AgreementsAcceptance/LandingPage.svelte","../src/routes/AgreementsAcceptance/Cost.svelte","../src/routes/AgreementsAcceptance/Funding.svelte","../src/routes/AgreementsAcceptance/ThankYou.svelte","../src/models/questionsModel.js","../src/components/FormRow.svelte","../src/components/FormColumn.svelte","../src/components/NumberInput.svelte","../src/routes/Questionnaire/Questions.svelte","../src/routes/Questionnaire/Confirmation.svelte","../src/routes/Questionnaire/ThankYou.svelte","../src/routes/Questionnaire/Review.svelte","../src/components/lib/helpers.js","../src/components/Week.svelte","../src/components/Month.svelte","../src/components/DatePickerNavBar.svelte","../src/components/Popover.svelte","../src/components/lib/keyCodes.js","../src/components/Datepicker.svelte","../src/components/TextInput.svelte","../src/routes/Questionnaire2/Questions.svelte","../src/routes/Questionnaire2/Confirmation.svelte","../src/routes/Questionnaire2/ThankYou.svelte","../src/routes/Questionnaire2/Review.svelte","../src/routes/Error.svelte","../src/components/NavTrackerActive.svelte","../src/components/NavTrackerVisited.svelte","../src/components/NavTrackerNotVisited.svelte","../src/components/NavTracker.svelte","../src/App.svelte","../src/main.js"],"sourcesContent":["function noop() { }\nconst identity = x => x;\nfunction assign(tar, src) {\n // @ts-ignore\n for (const k in src)\n tar[k] = src[k];\n return tar;\n}\n// Adapted from https://github.com/then/is-promise/blob/master/index.js\n// Distributed under MIT License https://github.com/then/is-promise/blob/master/LICENSE\nfunction is_promise(value) {\n return !!value && (typeof value === 'object' || typeof value === 'function') && typeof value.then === 'function';\n}\nfunction add_location(element, file, line, column, char) {\n element.__svelte_meta = {\n loc: { file, line, column, char }\n };\n}\nfunction run(fn) {\n return fn();\n}\nfunction blank_object() {\n return Object.create(null);\n}\nfunction run_all(fns) {\n fns.forEach(run);\n}\nfunction is_function(thing) {\n return typeof thing === 'function';\n}\nfunction safe_not_equal(a, b) {\n return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');\n}\nlet src_url_equal_anchor;\nfunction src_url_equal(element_src, url) {\n if (!src_url_equal_anchor) {\n src_url_equal_anchor = document.createElement('a');\n }\n src_url_equal_anchor.href = url;\n return element_src === src_url_equal_anchor.href;\n}\nfunction not_equal(a, b) {\n return a != a ? b == b : a !== b;\n}\nfunction is_empty(obj) {\n return Object.keys(obj).length === 0;\n}\nfunction validate_store(store, name) {\n if (store != null && typeof store.subscribe !== 'function') {\n throw new Error(`'${name}' is not a store with a 'subscribe' method`);\n }\n}\nfunction subscribe(store, ...callbacks) {\n if (store == null) {\n return noop;\n }\n const unsub = store.subscribe(...callbacks);\n return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;\n}\nfunction get_store_value(store) {\n let value;\n subscribe(store, _ => value = _)();\n return value;\n}\nfunction component_subscribe(component, store, callback) {\n component.$$.on_destroy.push(subscribe(store, callback));\n}\nfunction create_slot(definition, ctx, $$scope, fn) {\n if (definition) {\n const slot_ctx = get_slot_context(definition, ctx, $$scope, fn);\n return definition[0](slot_ctx);\n }\n}\nfunction get_slot_context(definition, ctx, $$scope, fn) {\n return definition[1] && fn\n ? assign($$scope.ctx.slice(), definition[1](fn(ctx)))\n : $$scope.ctx;\n}\nfunction get_slot_changes(definition, $$scope, dirty, fn) {\n if (definition[2] && fn) {\n const lets = definition[2](fn(dirty));\n if ($$scope.dirty === undefined) {\n return lets;\n }\n if (typeof lets === 'object') {\n const merged = [];\n const len = Math.max($$scope.dirty.length, lets.length);\n for (let i = 0; i < len; i += 1) {\n merged[i] = $$scope.dirty[i] | lets[i];\n }\n return merged;\n }\n return $$scope.dirty | lets;\n }\n return $$scope.dirty;\n}\nfunction update_slot_base(slot, slot_definition, ctx, $$scope, slot_changes, get_slot_context_fn) {\n if (slot_changes) {\n const slot_context = get_slot_context(slot_definition, ctx, $$scope, get_slot_context_fn);\n slot.p(slot_context, slot_changes);\n }\n}\nfunction update_slot(slot, slot_definition, ctx, $$scope, dirty, get_slot_changes_fn, get_slot_context_fn) {\n const slot_changes = get_slot_changes(slot_definition, $$scope, dirty, get_slot_changes_fn);\n update_slot_base(slot, slot_definition, ctx, $$scope, slot_changes, get_slot_context_fn);\n}\nfunction get_all_dirty_from_scope($$scope) {\n if ($$scope.ctx.length > 32) {\n const dirty = [];\n const length = $$scope.ctx.length / 32;\n for (let i = 0; i < length; i++) {\n dirty[i] = -1;\n }\n return dirty;\n }\n return -1;\n}\nfunction exclude_internal_props(props) {\n const result = {};\n for (const k in props)\n if (k[0] !== '$')\n result[k] = props[k];\n return result;\n}\nfunction compute_rest_props(props, keys) {\n const rest = {};\n keys = new Set(keys);\n for (const k in props)\n if (!keys.has(k) && k[0] !== '$')\n rest[k] = props[k];\n return rest;\n}\nfunction compute_slots(slots) {\n const result = {};\n for (const key in slots) {\n result[key] = true;\n }\n return result;\n}\nfunction once(fn) {\n let ran = false;\n return function (...args) {\n if (ran)\n return;\n ran = true;\n fn.call(this, ...args);\n };\n}\nfunction null_to_empty(value) {\n return value == null ? '' : value;\n}\nfunction set_store_value(store, ret, value) {\n store.set(value);\n return ret;\n}\nconst has_prop = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);\nfunction action_destroyer(action_result) {\n return action_result && is_function(action_result.destroy) ? action_result.destroy : noop;\n}\nfunction split_css_unit(value) {\n const split = typeof value === 'string' && value.match(/^\\s*(-?[\\d.]+)([^\\s]*)\\s*$/);\n return split ? [parseFloat(split[1]), split[2] || 'px'] : [value, 'px'];\n}\nconst contenteditable_truthy_values = ['', true, 1, 'true', 'contenteditable'];\n\nconst is_client = typeof window !== 'undefined';\nlet now = is_client\n ? () => window.performance.now()\n : () => Date.now();\nlet raf = is_client ? cb => requestAnimationFrame(cb) : noop;\n// used internally for testing\nfunction set_now(fn) {\n now = fn;\n}\nfunction set_raf(fn) {\n raf = fn;\n}\n\nconst tasks = new Set();\nfunction run_tasks(now) {\n tasks.forEach(task => {\n if (!task.c(now)) {\n tasks.delete(task);\n task.f();\n }\n });\n if (tasks.size !== 0)\n raf(run_tasks);\n}\n/**\n * For testing purposes only!\n */\nfunction clear_loops() {\n tasks.clear();\n}\n/**\n * Creates a new task that runs on each raf frame\n * until it returns a falsy value or is aborted\n */\nfunction loop(callback) {\n let task;\n if (tasks.size === 0)\n raf(run_tasks);\n return {\n promise: new Promise(fulfill => {\n tasks.add(task = { c: callback, f: fulfill });\n }),\n abort() {\n tasks.delete(task);\n }\n };\n}\n\nconst globals = (typeof window !== 'undefined'\n ? window\n : typeof globalThis !== 'undefined'\n ? globalThis\n : global);\n\n/**\n * Resize observer singleton.\n * One listener per element only!\n * https://groups.google.com/a/chromium.org/g/blink-dev/c/z6ienONUb5A/m/F5-VcUZtBAAJ\n */\nclass ResizeObserverSingleton {\n constructor(options) {\n this.options = options;\n this._listeners = 'WeakMap' in globals ? new WeakMap() : undefined;\n }\n observe(element, listener) {\n this._listeners.set(element, listener);\n this._getObserver().observe(element, this.options);\n return () => {\n this._listeners.delete(element);\n this._observer.unobserve(element); // this line can probably be removed\n };\n }\n _getObserver() {\n var _a;\n return (_a = this._observer) !== null && _a !== void 0 ? _a : (this._observer = new ResizeObserver((entries) => {\n var _a;\n for (const entry of entries) {\n ResizeObserverSingleton.entries.set(entry.target, entry);\n (_a = this._listeners.get(entry.target)) === null || _a === void 0 ? void 0 : _a(entry);\n }\n }));\n }\n}\n// Needs to be written like this to pass the tree-shake-test\nResizeObserverSingleton.entries = 'WeakMap' in globals ? new WeakMap() : undefined;\n\n// Track which nodes are claimed during hydration. Unclaimed nodes can then be removed from the DOM\n// at the end of hydration without touching the remaining nodes.\nlet is_hydrating = false;\nfunction start_hydrating() {\n is_hydrating = true;\n}\nfunction end_hydrating() {\n is_hydrating = false;\n}\nfunction upper_bound(low, high, key, value) {\n // Return first index of value larger than input value in the range [low, high)\n while (low < high) {\n const mid = low + ((high - low) >> 1);\n if (key(mid) <= value) {\n low = mid + 1;\n }\n else {\n high = mid;\n }\n }\n return low;\n}\nfunction init_hydrate(target) {\n if (target.hydrate_init)\n return;\n target.hydrate_init = true;\n // We know that all children have claim_order values since the unclaimed have been detached if target is not
\n let children = target.childNodes;\n // If target is , there may be children without claim_order\n if (target.nodeName === 'HEAD') {\n const myChildren = [];\n for (let i = 0; i < children.length; i++) {\n const node = children[i];\n if (node.claim_order !== undefined) {\n myChildren.push(node);\n }\n }\n children = myChildren;\n }\n /*\n * Reorder claimed children optimally.\n * We can reorder claimed children optimally by finding the longest subsequence of\n * nodes that are already claimed in order and only moving the rest. The longest\n * subsequence of nodes that are claimed in order can be found by\n * computing the longest increasing subsequence of .claim_order values.\n *\n * This algorithm is optimal in generating the least amount of reorder operations\n * possible.\n *\n * Proof:\n * We know that, given a set of reordering operations, the nodes that do not move\n * always form an increasing subsequence, since they do not move among each other\n * meaning that they must be already ordered among each other. Thus, the maximal\n * set of nodes that do not move form a longest increasing subsequence.\n */\n // Compute longest increasing subsequence\n // m: subsequence length j => index k of smallest value that ends an increasing subsequence of length j\n const m = new Int32Array(children.length + 1);\n // Predecessor indices + 1\n const p = new Int32Array(children.length);\n m[0] = -1;\n let longest = 0;\n for (let i = 0; i < children.length; i++) {\n const current = children[i].claim_order;\n // Find the largest subsequence length such that it ends in a value less than our current value\n // upper_bound returns first greater value, so we subtract one\n // with fast path for when we are on the current longest subsequence\n const seqLen = ((longest > 0 && children[m[longest]].claim_order <= current) ? longest + 1 : upper_bound(1, longest, idx => children[m[idx]].claim_order, current)) - 1;\n p[i] = m[seqLen] + 1;\n const newLen = seqLen + 1;\n // We can guarantee that current is the smallest value. Otherwise, we would have generated a longer sequence.\n m[newLen] = i;\n longest = Math.max(newLen, longest);\n }\n // The longest increasing subsequence of nodes (initially reversed)\n const lis = [];\n // The rest of the nodes, nodes that will be moved\n const toMove = [];\n let last = children.length - 1;\n for (let cur = m[longest] + 1; cur != 0; cur = p[cur - 1]) {\n lis.push(children[cur - 1]);\n for (; last >= cur; last--) {\n toMove.push(children[last]);\n }\n last--;\n }\n for (; last >= 0; last--) {\n toMove.push(children[last]);\n }\n lis.reverse();\n // We sort the nodes being moved to guarantee that their insertion order matches the claim order\n toMove.sort((a, b) => a.claim_order - b.claim_order);\n // Finally, we move the nodes\n for (let i = 0, j = 0; i < toMove.length; i++) {\n while (j < lis.length && toMove[i].claim_order >= lis[j].claim_order) {\n j++;\n }\n const anchor = j < lis.length ? lis[j] : null;\n target.insertBefore(toMove[i], anchor);\n }\n}\nfunction append(target, node) {\n target.appendChild(node);\n}\nfunction append_styles(target, style_sheet_id, styles) {\n const append_styles_to = get_root_for_style(target);\n if (!append_styles_to.getElementById(style_sheet_id)) {\n const style = element('style');\n style.id = style_sheet_id;\n style.textContent = styles;\n append_stylesheet(append_styles_to, style);\n }\n}\nfunction get_root_for_style(node) {\n if (!node)\n return document;\n const root = node.getRootNode ? node.getRootNode() : node.ownerDocument;\n if (root && root.host) {\n return root;\n }\n return node.ownerDocument;\n}\nfunction append_empty_stylesheet(node) {\n const style_element = element('style');\n append_stylesheet(get_root_for_style(node), style_element);\n return style_element.sheet;\n}\nfunction append_stylesheet(node, style) {\n append(node.head || node, style);\n return style.sheet;\n}\nfunction append_hydration(target, node) {\n if (is_hydrating) {\n init_hydrate(target);\n if ((target.actual_end_child === undefined) || ((target.actual_end_child !== null) && (target.actual_end_child.parentNode !== target))) {\n target.actual_end_child = target.firstChild;\n }\n // Skip nodes of undefined ordering\n while ((target.actual_end_child !== null) && (target.actual_end_child.claim_order === undefined)) {\n target.actual_end_child = target.actual_end_child.nextSibling;\n }\n if (node !== target.actual_end_child) {\n // We only insert if the ordering of this node should be modified or the parent node is not target\n if (node.claim_order !== undefined || node.parentNode !== target) {\n target.insertBefore(node, target.actual_end_child);\n }\n }\n else {\n target.actual_end_child = node.nextSibling;\n }\n }\n else if (node.parentNode !== target || node.nextSibling !== null) {\n target.appendChild(node);\n }\n}\nfunction insert(target, node, anchor) {\n target.insertBefore(node, anchor || null);\n}\nfunction insert_hydration(target, node, anchor) {\n if (is_hydrating && !anchor) {\n append_hydration(target, node);\n }\n else if (node.parentNode !== target || node.nextSibling != anchor) {\n target.insertBefore(node, anchor || null);\n }\n}\nfunction detach(node) {\n if (node.parentNode) {\n node.parentNode.removeChild(node);\n }\n}\nfunction destroy_each(iterations, detaching) {\n for (let i = 0; i < iterations.length; i += 1) {\n if (iterations[i])\n iterations[i].d(detaching);\n }\n}\nfunction element(name) {\n return document.createElement(name);\n}\nfunction element_is(name, is) {\n return document.createElement(name, { is });\n}\nfunction object_without_properties(obj, exclude) {\n const target = {};\n for (const k in obj) {\n if (has_prop(obj, k)\n // @ts-ignore\n && exclude.indexOf(k) === -1) {\n // @ts-ignore\n target[k] = obj[k];\n }\n }\n return target;\n}\nfunction svg_element(name) {\n return document.createElementNS('http://www.w3.org/2000/svg', name);\n}\nfunction text(data) {\n return document.createTextNode(data);\n}\nfunction space() {\n return text(' ');\n}\nfunction empty() {\n return text('');\n}\nfunction comment(content) {\n return document.createComment(content);\n}\nfunction listen(node, event, handler, options) {\n node.addEventListener(event, handler, options);\n return () => node.removeEventListener(event, handler, options);\n}\nfunction prevent_default(fn) {\n return function (event) {\n event.preventDefault();\n // @ts-ignore\n return fn.call(this, event);\n };\n}\nfunction stop_propagation(fn) {\n return function (event) {\n event.stopPropagation();\n // @ts-ignore\n return fn.call(this, event);\n };\n}\nfunction stop_immediate_propagation(fn) {\n return function (event) {\n event.stopImmediatePropagation();\n // @ts-ignore\n return fn.call(this, event);\n };\n}\nfunction self(fn) {\n return function (event) {\n // @ts-ignore\n if (event.target === this)\n fn.call(this, event);\n };\n}\nfunction trusted(fn) {\n return function (event) {\n // @ts-ignore\n if (event.isTrusted)\n fn.call(this, event);\n };\n}\nfunction attr(node, attribute, value) {\n if (value == null)\n node.removeAttribute(attribute);\n else if (node.getAttribute(attribute) !== value)\n node.setAttribute(attribute, value);\n}\n/**\n * List of attributes that should always be set through the attr method,\n * because updating them through the property setter doesn't work reliably.\n * In the example of `width`/`height`, the problem is that the setter only\n * accepts numeric values, but the attribute can also be set to a string like `50%`.\n * If this list becomes too big, rethink this approach.\n */\nconst always_set_through_set_attribute = ['width', 'height'];\nfunction set_attributes(node, attributes) {\n // @ts-ignore\n const descriptors = Object.getOwnPropertyDescriptors(node.__proto__);\n for (const key in attributes) {\n if (attributes[key] == null) {\n node.removeAttribute(key);\n }\n else if (key === 'style') {\n node.style.cssText = attributes[key];\n }\n else if (key === '__value') {\n node.value = node[key] = attributes[key];\n }\n else if (descriptors[key] && descriptors[key].set && always_set_through_set_attribute.indexOf(key) === -1) {\n node[key] = attributes[key];\n }\n else {\n attr(node, key, attributes[key]);\n }\n }\n}\nfunction set_svg_attributes(node, attributes) {\n for (const key in attributes) {\n attr(node, key, attributes[key]);\n }\n}\nfunction set_custom_element_data_map(node, data_map) {\n Object.keys(data_map).forEach((key) => {\n set_custom_element_data(node, key, data_map[key]);\n });\n}\nfunction set_custom_element_data(node, prop, value) {\n if (prop in node) {\n node[prop] = typeof node[prop] === 'boolean' && value === '' ? true : value;\n }\n else {\n attr(node, prop, value);\n }\n}\nfunction set_dynamic_element_data(tag) {\n return (/-/.test(tag)) ? set_custom_element_data_map : set_attributes;\n}\nfunction xlink_attr(node, attribute, value) {\n node.setAttributeNS('http://www.w3.org/1999/xlink', attribute, value);\n}\nfunction get_binding_group_value(group, __value, checked) {\n const value = new Set();\n for (let i = 0; i < group.length; i += 1) {\n if (group[i].checked)\n value.add(group[i].__value);\n }\n if (!checked) {\n value.delete(__value);\n }\n return Array.from(value);\n}\nfunction init_binding_group(group) {\n let _inputs;\n return {\n /* push */ p(...inputs) {\n _inputs = inputs;\n _inputs.forEach(input => group.push(input));\n },\n /* remove */ r() {\n _inputs.forEach(input => group.splice(group.indexOf(input), 1));\n }\n };\n}\nfunction init_binding_group_dynamic(group, indexes) {\n let _group = get_binding_group(group);\n let _inputs;\n function get_binding_group(group) {\n for (let i = 0; i < indexes.length; i++) {\n group = group[indexes[i]] = group[indexes[i]] || [];\n }\n return group;\n }\n function push() {\n _inputs.forEach(input => _group.push(input));\n }\n function remove() {\n _inputs.forEach(input => _group.splice(_group.indexOf(input), 1));\n }\n return {\n /* update */ u(new_indexes) {\n indexes = new_indexes;\n const new_group = get_binding_group(group);\n if (new_group !== _group) {\n remove();\n _group = new_group;\n push();\n }\n },\n /* push */ p(...inputs) {\n _inputs = inputs;\n push();\n },\n /* remove */ r: remove\n };\n}\nfunction to_number(value) {\n return value === '' ? null : +value;\n}\nfunction time_ranges_to_array(ranges) {\n const array = [];\n for (let i = 0; i < ranges.length; i += 1) {\n array.push({ start: ranges.start(i), end: ranges.end(i) });\n }\n return array;\n}\nfunction children(element) {\n return Array.from(element.childNodes);\n}\nfunction init_claim_info(nodes) {\n if (nodes.claim_info === undefined) {\n nodes.claim_info = { last_index: 0, total_claimed: 0 };\n }\n}\nfunction claim_node(nodes, predicate, processNode, createNode, dontUpdateLastIndex = false) {\n // Try to find nodes in an order such that we lengthen the longest increasing subsequence\n init_claim_info(nodes);\n const resultNode = (() => {\n // We first try to find an element after the previous one\n for (let i = nodes.claim_info.last_index; i < nodes.length; i++) {\n const node = nodes[i];\n if (predicate(node)) {\n const replacement = processNode(node);\n if (replacement === undefined) {\n nodes.splice(i, 1);\n }\n else {\n nodes[i] = replacement;\n }\n if (!dontUpdateLastIndex) {\n nodes.claim_info.last_index = i;\n }\n return node;\n }\n }\n // Otherwise, we try to find one before\n // We iterate in reverse so that we don't go too far back\n for (let i = nodes.claim_info.last_index - 1; i >= 0; i--) {\n const node = nodes[i];\n if (predicate(node)) {\n const replacement = processNode(node);\n if (replacement === undefined) {\n nodes.splice(i, 1);\n }\n else {\n nodes[i] = replacement;\n }\n if (!dontUpdateLastIndex) {\n nodes.claim_info.last_index = i;\n }\n else if (replacement === undefined) {\n // Since we spliced before the last_index, we decrease it\n nodes.claim_info.last_index--;\n }\n return node;\n }\n }\n // If we can't find any matching node, we create a new one\n return createNode();\n })();\n resultNode.claim_order = nodes.claim_info.total_claimed;\n nodes.claim_info.total_claimed += 1;\n return resultNode;\n}\nfunction claim_element_base(nodes, name, attributes, create_element) {\n return claim_node(nodes, (node) => node.nodeName === name, (node) => {\n const remove = [];\n for (let j = 0; j < node.attributes.length; j++) {\n const attribute = node.attributes[j];\n if (!attributes[attribute.name]) {\n remove.push(attribute.name);\n }\n }\n remove.forEach(v => node.removeAttribute(v));\n return undefined;\n }, () => create_element(name));\n}\nfunction claim_element(nodes, name, attributes) {\n return claim_element_base(nodes, name, attributes, element);\n}\nfunction claim_svg_element(nodes, name, attributes) {\n return claim_element_base(nodes, name, attributes, svg_element);\n}\nfunction claim_text(nodes, data) {\n return claim_node(nodes, (node) => node.nodeType === 3, (node) => {\n const dataStr = '' + data;\n if (node.data.startsWith(dataStr)) {\n if (node.data.length !== dataStr.length) {\n return node.splitText(dataStr.length);\n }\n }\n else {\n node.data = dataStr;\n }\n }, () => text(data), true // Text nodes should not update last index since it is likely not worth it to eliminate an increasing subsequence of actual elements\n );\n}\nfunction claim_space(nodes) {\n return claim_text(nodes, ' ');\n}\nfunction claim_comment(nodes, data) {\n return claim_node(nodes, (node) => node.nodeType === 8, (node) => {\n node.data = '' + data;\n return undefined;\n }, () => comment(data), true);\n}\nfunction find_comment(nodes, text, start) {\n for (let i = start; i < nodes.length; i += 1) {\n const node = nodes[i];\n if (node.nodeType === 8 /* comment node */ && node.textContent.trim() === text) {\n return i;\n }\n }\n return nodes.length;\n}\nfunction claim_html_tag(nodes, is_svg) {\n // find html opening tag\n const start_index = find_comment(nodes, 'HTML_TAG_START', 0);\n const end_index = find_comment(nodes, 'HTML_TAG_END', start_index);\n if (start_index === end_index) {\n return new HtmlTagHydration(undefined, is_svg);\n }\n init_claim_info(nodes);\n const html_tag_nodes = nodes.splice(start_index, end_index - start_index + 1);\n detach(html_tag_nodes[0]);\n detach(html_tag_nodes[html_tag_nodes.length - 1]);\n const claimed_nodes = html_tag_nodes.slice(1, html_tag_nodes.length - 1);\n for (const n of claimed_nodes) {\n n.claim_order = nodes.claim_info.total_claimed;\n nodes.claim_info.total_claimed += 1;\n }\n return new HtmlTagHydration(claimed_nodes, is_svg);\n}\nfunction set_data(text, data) {\n data = '' + data;\n if (text.data === data)\n return;\n text.data = data;\n}\nfunction set_data_contenteditable(text, data) {\n data = '' + data;\n if (text.wholeText === data)\n return;\n text.data = data;\n}\nfunction set_data_maybe_contenteditable(text, data, attr_value) {\n if (~contenteditable_truthy_values.indexOf(attr_value)) {\n set_data_contenteditable(text, data);\n }\n else {\n set_data(text, data);\n }\n}\nfunction set_input_value(input, value) {\n input.value = value == null ? '' : value;\n}\nfunction set_input_type(input, type) {\n try {\n input.type = type;\n }\n catch (e) {\n // do nothing\n }\n}\nfunction set_style(node, key, value, important) {\n if (value == null) {\n node.style.removeProperty(key);\n }\n else {\n node.style.setProperty(key, value, important ? 'important' : '');\n }\n}\nfunction select_option(select, value, mounting) {\n for (let i = 0; i < select.options.length; i += 1) {\n const option = select.options[i];\n if (option.__value === value) {\n option.selected = true;\n return;\n }\n }\n if (!mounting || value !== undefined) {\n select.selectedIndex = -1; // no option should be selected\n }\n}\nfunction select_options(select, value) {\n for (let i = 0; i < select.options.length; i += 1) {\n const option = select.options[i];\n option.selected = ~value.indexOf(option.__value);\n }\n}\nfunction select_value(select) {\n const selected_option = select.querySelector(':checked');\n return selected_option && selected_option.__value;\n}\nfunction select_multiple_value(select) {\n return [].map.call(select.querySelectorAll(':checked'), option => option.__value);\n}\n// unfortunately this can't be a constant as that wouldn't be tree-shakeable\n// so we cache the result instead\nlet crossorigin;\nfunction is_crossorigin() {\n if (crossorigin === undefined) {\n crossorigin = false;\n try {\n if (typeof window !== 'undefined' && window.parent) {\n void window.parent.document;\n }\n }\n catch (error) {\n crossorigin = true;\n }\n }\n return crossorigin;\n}\nfunction add_iframe_resize_listener(node, fn) {\n const computed_style = getComputedStyle(node);\n if (computed_style.position === 'static') {\n node.style.position = 'relative';\n }\n const iframe = element('iframe');\n iframe.setAttribute('style', 'display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; ' +\n 'overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;');\n iframe.setAttribute('aria-hidden', 'true');\n iframe.tabIndex = -1;\n const crossorigin = is_crossorigin();\n let unsubscribe;\n if (crossorigin) {\n iframe.src = \"data:text/html,\";\n unsubscribe = listen(window, 'message', (event) => {\n if (event.source === iframe.contentWindow)\n fn();\n });\n }\n else {\n iframe.src = 'about:blank';\n iframe.onload = () => {\n unsubscribe = listen(iframe.contentWindow, 'resize', fn);\n // make sure an initial resize event is fired _after_ the iframe is loaded (which is asynchronous)\n // see https://github.com/sveltejs/svelte/issues/4233\n fn();\n };\n }\n append(node, iframe);\n return () => {\n if (crossorigin) {\n unsubscribe();\n }\n else if (unsubscribe && iframe.contentWindow) {\n unsubscribe();\n }\n detach(iframe);\n };\n}\nconst resize_observer_content_box = /* @__PURE__ */ new ResizeObserverSingleton({ box: 'content-box' });\nconst resize_observer_border_box = /* @__PURE__ */ new ResizeObserverSingleton({ box: 'border-box' });\nconst resize_observer_device_pixel_content_box = /* @__PURE__ */ new ResizeObserverSingleton({ box: 'device-pixel-content-box' });\nfunction toggle_class(element, name, toggle) {\n element.classList[toggle ? 'add' : 'remove'](name);\n}\nfunction custom_event(type, detail, { bubbles = false, cancelable = false } = {}) {\n const e = document.createEvent('CustomEvent');\n e.initCustomEvent(type, bubbles, cancelable, detail);\n return e;\n}\nfunction query_selector_all(selector, parent = document.body) {\n return Array.from(parent.querySelectorAll(selector));\n}\nfunction head_selector(nodeId, head) {\n const result = [];\n let started = 0;\n for (const node of head.childNodes) {\n if (node.nodeType === 8 /* comment node */) {\n const comment = node.textContent.trim();\n if (comment === `HEAD_${nodeId}_END`) {\n started -= 1;\n result.push(node);\n }\n else if (comment === `HEAD_${nodeId}_START`) {\n started += 1;\n result.push(node);\n }\n }\n else if (started > 0) {\n result.push(node);\n }\n }\n return result;\n}\nclass HtmlTag {\n constructor(is_svg = false) {\n this.is_svg = false;\n this.is_svg = is_svg;\n this.e = this.n = null;\n }\n c(html) {\n this.h(html);\n }\n m(html, target, anchor = null) {\n if (!this.e) {\n if (this.is_svg)\n this.e = svg_element(target.nodeName);\n /** #7364 target for may be provided as #document-fragment(11) */\n else\n this.e = element((target.nodeType === 11 ? 'TEMPLATE' : target.nodeName));\n this.t = target.tagName !== 'TEMPLATE' ? target : target.content;\n this.c(html);\n }\n this.i(anchor);\n }\n h(html) {\n this.e.innerHTML = html;\n this.n = Array.from(this.e.nodeName === 'TEMPLATE' ? this.e.content.childNodes : this.e.childNodes);\n }\n i(anchor) {\n for (let i = 0; i < this.n.length; i += 1) {\n insert(this.t, this.n[i], anchor);\n }\n }\n p(html) {\n this.d();\n this.h(html);\n this.i(this.a);\n }\n d() {\n this.n.forEach(detach);\n }\n}\nclass HtmlTagHydration extends HtmlTag {\n constructor(claimed_nodes, is_svg = false) {\n super(is_svg);\n this.e = this.n = null;\n this.l = claimed_nodes;\n }\n c(html) {\n if (this.l) {\n this.n = this.l;\n }\n else {\n super.c(html);\n }\n }\n i(anchor) {\n for (let i = 0; i < this.n.length; i += 1) {\n insert_hydration(this.t, this.n[i], anchor);\n }\n }\n}\nfunction attribute_to_object(attributes) {\n const result = {};\n for (const attribute of attributes) {\n result[attribute.name] = attribute.value;\n }\n return result;\n}\nfunction get_custom_elements_slots(element) {\n const result = {};\n element.childNodes.forEach((node) => {\n result[node.slot || 'default'] = true;\n });\n return result;\n}\nfunction construct_svelte_component(component, props) {\n return new component(props);\n}\n\n// we need to store the information for multiple documents because a Svelte application could also contain iframes\n// https://github.com/sveltejs/svelte/issues/3624\nconst managed_styles = new Map();\nlet active = 0;\n// https://github.com/darkskyapp/string-hash/blob/master/index.js\nfunction hash(str) {\n let hash = 5381;\n let i = str.length;\n while (i--)\n hash = ((hash << 5) - hash) ^ str.charCodeAt(i);\n return hash >>> 0;\n}\nfunction create_style_information(doc, node) {\n const info = { stylesheet: append_empty_stylesheet(node), rules: {} };\n managed_styles.set(doc, info);\n return info;\n}\nfunction create_rule(node, a, b, duration, delay, ease, fn, uid = 0) {\n const step = 16.666 / duration;\n let keyframes = '{\\n';\n for (let p = 0; p <= 1; p += step) {\n const t = a + (b - a) * ease(p);\n keyframes += p * 100 + `%{${fn(t, 1 - t)}}\\n`;\n }\n const rule = keyframes + `100% {${fn(b, 1 - b)}}\\n}`;\n const name = `__svelte_${hash(rule)}_${uid}`;\n const doc = get_root_for_style(node);\n const { stylesheet, rules } = managed_styles.get(doc) || create_style_information(doc, node);\n if (!rules[name]) {\n rules[name] = true;\n stylesheet.insertRule(`@keyframes ${name} ${rule}`, stylesheet.cssRules.length);\n }\n const animation = node.style.animation || '';\n node.style.animation = `${animation ? `${animation}, ` : ''}${name} ${duration}ms linear ${delay}ms 1 both`;\n active += 1;\n return name;\n}\nfunction delete_rule(node, name) {\n const previous = (node.style.animation || '').split(', ');\n const next = previous.filter(name\n ? anim => anim.indexOf(name) < 0 // remove specific animation\n : anim => anim.indexOf('__svelte') === -1 // remove all Svelte animations\n );\n const deleted = previous.length - next.length;\n if (deleted) {\n node.style.animation = next.join(', ');\n active -= deleted;\n if (!active)\n clear_rules();\n }\n}\nfunction clear_rules() {\n raf(() => {\n if (active)\n return;\n managed_styles.forEach(info => {\n const { ownerNode } = info.stylesheet;\n // there is no ownerNode if it runs on jsdom.\n if (ownerNode)\n detach(ownerNode);\n });\n managed_styles.clear();\n });\n}\n\nfunction create_animation(node, from, fn, params) {\n if (!from)\n return noop;\n const to = node.getBoundingClientRect();\n if (from.left === to.left && from.right === to.right && from.top === to.top && from.bottom === to.bottom)\n return noop;\n const { delay = 0, duration = 300, easing = identity, \n // @ts-ignore todo: should this be separated from destructuring? Or start/end added to public api and documentation?\n start: start_time = now() + delay, \n // @ts-ignore todo:\n end = start_time + duration, tick = noop, css } = fn(node, { from, to }, params);\n let running = true;\n let started = false;\n let name;\n function start() {\n if (css) {\n name = create_rule(node, 0, 1, duration, delay, easing, css);\n }\n if (!delay) {\n started = true;\n }\n }\n function stop() {\n if (css)\n delete_rule(node, name);\n running = false;\n }\n loop(now => {\n if (!started && now >= start_time) {\n started = true;\n }\n if (started && now >= end) {\n tick(1, 0);\n stop();\n }\n if (!running) {\n return false;\n }\n if (started) {\n const p = now - start_time;\n const t = 0 + 1 * easing(p / duration);\n tick(t, 1 - t);\n }\n return true;\n });\n start();\n tick(0, 1);\n return stop;\n}\nfunction fix_position(node) {\n const style = getComputedStyle(node);\n if (style.position !== 'absolute' && style.position !== 'fixed') {\n const { width, height } = style;\n const a = node.getBoundingClientRect();\n node.style.position = 'absolute';\n node.style.width = width;\n node.style.height = height;\n add_transform(node, a);\n }\n}\nfunction add_transform(node, a) {\n const b = node.getBoundingClientRect();\n if (a.left !== b.left || a.top !== b.top) {\n const style = getComputedStyle(node);\n const transform = style.transform === 'none' ? '' : style.transform;\n node.style.transform = `${transform} translate(${a.left - b.left}px, ${a.top - b.top}px)`;\n }\n}\n\nlet current_component;\nfunction set_current_component(component) {\n current_component = component;\n}\nfunction get_current_component() {\n if (!current_component)\n throw new Error('Function called outside component initialization');\n return current_component;\n}\n/**\n * Schedules a callback to run immediately before the component is updated after any state change.\n *\n * The first time the callback runs will be before the initial `onMount`\n *\n * https://svelte.dev/docs#run-time-svelte-beforeupdate\n */\nfunction beforeUpdate(fn) {\n get_current_component().$$.before_update.push(fn);\n}\n/**\n * The `onMount` function schedules a callback to run as soon as the component has been mounted to the DOM.\n * It must be called during the component's initialisation (but doesn't need to live *inside* the component;\n * it can be called from an external module).\n *\n * `onMount` does not run inside a [server-side component](/docs#run-time-server-side-component-api).\n *\n * https://svelte.dev/docs#run-time-svelte-onmount\n */\nfunction onMount(fn) {\n get_current_component().$$.on_mount.push(fn);\n}\n/**\n * Schedules a callback to run immediately after the component has been updated.\n *\n * The first time the callback runs will be after the initial `onMount`\n */\nfunction afterUpdate(fn) {\n get_current_component().$$.after_update.push(fn);\n}\n/**\n * Schedules a callback to run immediately before the component is unmounted.\n *\n * Out of `onMount`, `beforeUpdate`, `afterUpdate` and `onDestroy`, this is the\n * only one that runs inside a server-side component.\n *\n * https://svelte.dev/docs#run-time-svelte-ondestroy\n */\nfunction onDestroy(fn) {\n get_current_component().$$.on_destroy.push(fn);\n}\n/**\n * Creates an event dispatcher that can be used to dispatch [component events](/docs#template-syntax-component-directives-on-eventname).\n * Event dispatchers are functions that can take two arguments: `name` and `detail`.\n *\n * Component events created with `createEventDispatcher` create a\n * [CustomEvent](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent).\n * These events do not [bubble](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/Events#Event_bubbling_and_capture).\n * The `detail` argument corresponds to the [CustomEvent.detail](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/detail)\n * property and can contain any type of data.\n *\n * https://svelte.dev/docs#run-time-svelte-createeventdispatcher\n */\nfunction createEventDispatcher() {\n const component = get_current_component();\n return (type, detail, { cancelable = false } = {}) => {\n const callbacks = component.$$.callbacks[type];\n if (callbacks) {\n // TODO are there situations where events could be dispatched\n // in a server (non-DOM) environment?\n const event = custom_event(type, detail, { cancelable });\n callbacks.slice().forEach(fn => {\n fn.call(component, event);\n });\n return !event.defaultPrevented;\n }\n return true;\n };\n}\n/**\n * Associates an arbitrary `context` object with the current component and the specified `key`\n * and returns that object. The context is then available to children of the component\n * (including slotted content) with `getContext`.\n *\n * Like lifecycle functions, this must be called during component initialisation.\n *\n * https://svelte.dev/docs#run-time-svelte-setcontext\n */\nfunction setContext(key, context) {\n get_current_component().$$.context.set(key, context);\n return context;\n}\n/**\n * Retrieves the context that belongs to the closest parent component with the specified `key`.\n * Must be called during component initialisation.\n *\n * https://svelte.dev/docs#run-time-svelte-getcontext\n */\nfunction getContext(key) {\n return get_current_component().$$.context.get(key);\n}\n/**\n * Retrieves the whole context map that belongs to the closest parent component.\n * Must be called during component initialisation. Useful, for example, if you\n * programmatically create a component and want to pass the existing context to it.\n *\n * https://svelte.dev/docs#run-time-svelte-getallcontexts\n */\nfunction getAllContexts() {\n return get_current_component().$$.context;\n}\n/**\n * Checks whether a given `key` has been set in the context of a parent component.\n * Must be called during component initialisation.\n *\n * https://svelte.dev/docs#run-time-svelte-hascontext\n */\nfunction hasContext(key) {\n return get_current_component().$$.context.has(key);\n}\n// TODO figure out if we still want to support\n// shorthand events, or if we want to implement\n// a real bubbling mechanism\nfunction bubble(component, event) {\n const callbacks = component.$$.callbacks[event.type];\n if (callbacks) {\n // @ts-ignore\n callbacks.slice().forEach(fn => fn.call(this, event));\n }\n}\n\nconst dirty_components = [];\nconst intros = { enabled: false };\nconst binding_callbacks = [];\nlet render_callbacks = [];\nconst flush_callbacks = [];\nconst resolved_promise = /* @__PURE__ */ Promise.resolve();\nlet update_scheduled = false;\nfunction schedule_update() {\n if (!update_scheduled) {\n update_scheduled = true;\n resolved_promise.then(flush);\n }\n}\nfunction tick() {\n schedule_update();\n return resolved_promise;\n}\nfunction add_render_callback(fn) {\n render_callbacks.push(fn);\n}\nfunction add_flush_callback(fn) {\n flush_callbacks.push(fn);\n}\n// flush() calls callbacks in this order:\n// 1. All beforeUpdate callbacks, in order: parents before children\n// 2. All bind:this callbacks, in reverse order: children before parents.\n// 3. All afterUpdate callbacks, in order: parents before children. EXCEPT\n// for afterUpdates called during the initial onMount, which are called in\n// reverse order: children before parents.\n// Since callbacks might update component values, which could trigger another\n// call to flush(), the following steps guard against this:\n// 1. During beforeUpdate, any updated components will be added to the\n// dirty_components array and will cause a reentrant call to flush(). Because\n// the flush index is kept outside the function, the reentrant call will pick\n// up where the earlier call left off and go through all dirty components. The\n// current_component value is saved and restored so that the reentrant call will\n// not interfere with the \"parent\" flush() call.\n// 2. bind:this callbacks cannot trigger new flush() calls.\n// 3. During afterUpdate, any updated components will NOT have their afterUpdate\n// callback called a second time; the seen_callbacks set, outside the flush()\n// function, guarantees this behavior.\nconst seen_callbacks = new Set();\nlet flushidx = 0; // Do *not* move this inside the flush() function\nfunction flush() {\n // Do not reenter flush while dirty components are updated, as this can\n // result in an infinite loop. Instead, let the inner flush handle it.\n // Reentrancy is ok afterwards for bindings etc.\n if (flushidx !== 0) {\n return;\n }\n const saved_component = current_component;\n do {\n // first, call beforeUpdate functions\n // and update components\n try {\n while (flushidx < dirty_components.length) {\n const component = dirty_components[flushidx];\n flushidx++;\n set_current_component(component);\n update(component.$$);\n }\n }\n catch (e) {\n // reset dirty state to not end up in a deadlocked state and then rethrow\n dirty_components.length = 0;\n flushidx = 0;\n throw e;\n }\n set_current_component(null);\n dirty_components.length = 0;\n flushidx = 0;\n while (binding_callbacks.length)\n binding_callbacks.pop()();\n // then, once components are updated, call\n // afterUpdate functions. This may cause\n // subsequent updates...\n for (let i = 0; i < render_callbacks.length; i += 1) {\n const callback = render_callbacks[i];\n if (!seen_callbacks.has(callback)) {\n // ...so guard against infinite loops\n seen_callbacks.add(callback);\n callback();\n }\n }\n render_callbacks.length = 0;\n } while (dirty_components.length);\n while (flush_callbacks.length) {\n flush_callbacks.pop()();\n }\n update_scheduled = false;\n seen_callbacks.clear();\n set_current_component(saved_component);\n}\nfunction update($$) {\n if ($$.fragment !== null) {\n $$.update();\n run_all($$.before_update);\n const dirty = $$.dirty;\n $$.dirty = [-1];\n $$.fragment && $$.fragment.p($$.ctx, dirty);\n $$.after_update.forEach(add_render_callback);\n }\n}\n/**\n * Useful for example to execute remaining `afterUpdate` callbacks before executing `destroy`.\n */\nfunction flush_render_callbacks(fns) {\n const filtered = [];\n const targets = [];\n render_callbacks.forEach((c) => fns.indexOf(c) === -1 ? filtered.push(c) : targets.push(c));\n targets.forEach((c) => c());\n render_callbacks = filtered;\n}\n\nlet promise;\nfunction wait() {\n if (!promise) {\n promise = Promise.resolve();\n promise.then(() => {\n promise = null;\n });\n }\n return promise;\n}\nfunction dispatch(node, direction, kind) {\n node.dispatchEvent(custom_event(`${direction ? 'intro' : 'outro'}${kind}`));\n}\nconst outroing = new Set();\nlet outros;\nfunction group_outros() {\n outros = {\n r: 0,\n c: [],\n p: outros // parent group\n };\n}\nfunction check_outros() {\n if (!outros.r) {\n run_all(outros.c);\n }\n outros = outros.p;\n}\nfunction transition_in(block, local) {\n if (block && block.i) {\n outroing.delete(block);\n block.i(local);\n }\n}\nfunction transition_out(block, local, detach, callback) {\n if (block && block.o) {\n if (outroing.has(block))\n return;\n outroing.add(block);\n outros.c.push(() => {\n outroing.delete(block);\n if (callback) {\n if (detach)\n block.d(1);\n callback();\n }\n });\n block.o(local);\n }\n else if (callback) {\n callback();\n }\n}\nconst null_transition = { duration: 0 };\nfunction create_in_transition(node, fn, params) {\n const options = { direction: 'in' };\n let config = fn(node, params, options);\n let running = false;\n let animation_name;\n let task;\n let uid = 0;\n function cleanup() {\n if (animation_name)\n delete_rule(node, animation_name);\n }\n function go() {\n const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;\n if (css)\n animation_name = create_rule(node, 0, 1, duration, delay, easing, css, uid++);\n tick(0, 1);\n const start_time = now() + delay;\n const end_time = start_time + duration;\n if (task)\n task.abort();\n running = true;\n add_render_callback(() => dispatch(node, true, 'start'));\n task = loop(now => {\n if (running) {\n if (now >= end_time) {\n tick(1, 0);\n dispatch(node, true, 'end');\n cleanup();\n return running = false;\n }\n if (now >= start_time) {\n const t = easing((now - start_time) / duration);\n tick(t, 1 - t);\n }\n }\n return running;\n });\n }\n let started = false;\n return {\n start() {\n if (started)\n return;\n started = true;\n delete_rule(node);\n if (is_function(config)) {\n config = config(options);\n wait().then(go);\n }\n else {\n go();\n }\n },\n invalidate() {\n started = false;\n },\n end() {\n if (running) {\n cleanup();\n running = false;\n }\n }\n };\n}\nfunction create_out_transition(node, fn, params) {\n const options = { direction: 'out' };\n let config = fn(node, params, options);\n let running = true;\n let animation_name;\n const group = outros;\n group.r += 1;\n function go() {\n const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;\n if (css)\n animation_name = create_rule(node, 1, 0, duration, delay, easing, css);\n const start_time = now() + delay;\n const end_time = start_time + duration;\n add_render_callback(() => dispatch(node, false, 'start'));\n loop(now => {\n if (running) {\n if (now >= end_time) {\n tick(0, 1);\n dispatch(node, false, 'end');\n if (!--group.r) {\n // this will result in `end()` being called,\n // so we don't need to clean up here\n run_all(group.c);\n }\n return false;\n }\n if (now >= start_time) {\n const t = easing((now - start_time) / duration);\n tick(1 - t, t);\n }\n }\n return running;\n });\n }\n if (is_function(config)) {\n wait().then(() => {\n // @ts-ignore\n config = config(options);\n go();\n });\n }\n else {\n go();\n }\n return {\n end(reset) {\n if (reset && config.tick) {\n config.tick(1, 0);\n }\n if (running) {\n if (animation_name)\n delete_rule(node, animation_name);\n running = false;\n }\n }\n };\n}\nfunction create_bidirectional_transition(node, fn, params, intro) {\n const options = { direction: 'both' };\n let config = fn(node, params, options);\n let t = intro ? 0 : 1;\n let running_program = null;\n let pending_program = null;\n let animation_name = null;\n function clear_animation() {\n if (animation_name)\n delete_rule(node, animation_name);\n }\n function init(program, duration) {\n const d = (program.b - t);\n duration *= Math.abs(d);\n return {\n a: t,\n b: program.b,\n d,\n duration,\n start: program.start,\n end: program.start + duration,\n group: program.group\n };\n }\n function go(b) {\n const { delay = 0, duration = 300, easing = identity, tick = noop, css } = config || null_transition;\n const program = {\n start: now() + delay,\n b\n };\n if (!b) {\n // @ts-ignore todo: improve typings\n program.group = outros;\n outros.r += 1;\n }\n if (running_program || pending_program) {\n pending_program = program;\n }\n else {\n // if this is an intro, and there's a delay, we need to do\n // an initial tick and/or apply CSS animation immediately\n if (css) {\n clear_animation();\n animation_name = create_rule(node, t, b, duration, delay, easing, css);\n }\n if (b)\n tick(0, 1);\n running_program = init(program, duration);\n add_render_callback(() => dispatch(node, b, 'start'));\n loop(now => {\n if (pending_program && now > pending_program.start) {\n running_program = init(pending_program, duration);\n pending_program = null;\n dispatch(node, running_program.b, 'start');\n if (css) {\n clear_animation();\n animation_name = create_rule(node, t, running_program.b, running_program.duration, 0, easing, config.css);\n }\n }\n if (running_program) {\n if (now >= running_program.end) {\n tick(t = running_program.b, 1 - t);\n dispatch(node, running_program.b, 'end');\n if (!pending_program) {\n // we're done\n if (running_program.b) {\n // intro — we can tidy up immediately\n clear_animation();\n }\n else {\n // outro — needs to be coordinated\n if (!--running_program.group.r)\n run_all(running_program.group.c);\n }\n }\n running_program = null;\n }\n else if (now >= running_program.start) {\n const p = now - running_program.start;\n t = running_program.a + running_program.d * easing(p / running_program.duration);\n tick(t, 1 - t);\n }\n }\n return !!(running_program || pending_program);\n });\n }\n }\n return {\n run(b) {\n if (is_function(config)) {\n wait().then(() => {\n // @ts-ignore\n config = config(options);\n go(b);\n });\n }\n else {\n go(b);\n }\n },\n end() {\n clear_animation();\n running_program = pending_program = null;\n }\n };\n}\n\nfunction handle_promise(promise, info) {\n const token = info.token = {};\n function update(type, index, key, value) {\n if (info.token !== token)\n return;\n info.resolved = value;\n let child_ctx = info.ctx;\n if (key !== undefined) {\n child_ctx = child_ctx.slice();\n child_ctx[key] = value;\n }\n const block = type && (info.current = type)(child_ctx);\n let needs_flush = false;\n if (info.block) {\n if (info.blocks) {\n info.blocks.forEach((block, i) => {\n if (i !== index && block) {\n group_outros();\n transition_out(block, 1, 1, () => {\n if (info.blocks[i] === block) {\n info.blocks[i] = null;\n }\n });\n check_outros();\n }\n });\n }\n else {\n info.block.d(1);\n }\n block.c();\n transition_in(block, 1);\n block.m(info.mount(), info.anchor);\n needs_flush = true;\n }\n info.block = block;\n if (info.blocks)\n info.blocks[index] = block;\n if (needs_flush) {\n flush();\n }\n }\n if (is_promise(promise)) {\n const current_component = get_current_component();\n promise.then(value => {\n set_current_component(current_component);\n update(info.then, 1, info.value, value);\n set_current_component(null);\n }, error => {\n set_current_component(current_component);\n update(info.catch, 2, info.error, error);\n set_current_component(null);\n if (!info.hasCatch) {\n throw error;\n }\n });\n // if we previously had a then/catch block, destroy it\n if (info.current !== info.pending) {\n update(info.pending, 0);\n return true;\n }\n }\n else {\n if (info.current !== info.then) {\n update(info.then, 1, info.value, promise);\n return true;\n }\n info.resolved = promise;\n }\n}\nfunction update_await_block_branch(info, ctx, dirty) {\n const child_ctx = ctx.slice();\n const { resolved } = info;\n if (info.current === info.then) {\n child_ctx[info.value] = resolved;\n }\n if (info.current === info.catch) {\n child_ctx[info.error] = resolved;\n }\n info.block.p(child_ctx, dirty);\n}\n\nfunction destroy_block(block, lookup) {\n block.d(1);\n lookup.delete(block.key);\n}\nfunction outro_and_destroy_block(block, lookup) {\n transition_out(block, 1, 1, () => {\n lookup.delete(block.key);\n });\n}\nfunction fix_and_destroy_block(block, lookup) {\n block.f();\n destroy_block(block, lookup);\n}\nfunction fix_and_outro_and_destroy_block(block, lookup) {\n block.f();\n outro_and_destroy_block(block, lookup);\n}\nfunction update_keyed_each(old_blocks, dirty, get_key, dynamic, ctx, list, lookup, node, destroy, create_each_block, next, get_context) {\n let o = old_blocks.length;\n let n = list.length;\n let i = o;\n const old_indexes = {};\n while (i--)\n old_indexes[old_blocks[i].key] = i;\n const new_blocks = [];\n const new_lookup = new Map();\n const deltas = new Map();\n const updates = [];\n i = n;\n while (i--) {\n const child_ctx = get_context(ctx, list, i);\n const key = get_key(child_ctx);\n let block = lookup.get(key);\n if (!block) {\n block = create_each_block(key, child_ctx);\n block.c();\n }\n else if (dynamic) {\n // defer updates until all the DOM shuffling is done\n updates.push(() => block.p(child_ctx, dirty));\n }\n new_lookup.set(key, new_blocks[i] = block);\n if (key in old_indexes)\n deltas.set(key, Math.abs(i - old_indexes[key]));\n }\n const will_move = new Set();\n const did_move = new Set();\n function insert(block) {\n transition_in(block, 1);\n block.m(node, next);\n lookup.set(block.key, block);\n next = block.first;\n n--;\n }\n while (o && n) {\n const new_block = new_blocks[n - 1];\n const old_block = old_blocks[o - 1];\n const new_key = new_block.key;\n const old_key = old_block.key;\n if (new_block === old_block) {\n // do nothing\n next = new_block.first;\n o--;\n n--;\n }\n else if (!new_lookup.has(old_key)) {\n // remove old block\n destroy(old_block, lookup);\n o--;\n }\n else if (!lookup.has(new_key) || will_move.has(new_key)) {\n insert(new_block);\n }\n else if (did_move.has(old_key)) {\n o--;\n }\n else if (deltas.get(new_key) > deltas.get(old_key)) {\n did_move.add(new_key);\n insert(new_block);\n }\n else {\n will_move.add(old_key);\n o--;\n }\n }\n while (o--) {\n const old_block = old_blocks[o];\n if (!new_lookup.has(old_block.key))\n destroy(old_block, lookup);\n }\n while (n)\n insert(new_blocks[n - 1]);\n run_all(updates);\n return new_blocks;\n}\nfunction validate_each_keys(ctx, list, get_context, get_key) {\n const keys = new Set();\n for (let i = 0; i < list.length; i++) {\n const key = get_key(get_context(ctx, list, i));\n if (keys.has(key)) {\n throw new Error('Cannot have duplicate keys in a keyed each');\n }\n keys.add(key);\n }\n}\n\nfunction get_spread_update(levels, updates) {\n const update = {};\n const to_null_out = {};\n const accounted_for = { $$scope: 1 };\n let i = levels.length;\n while (i--) {\n const o = levels[i];\n const n = updates[i];\n if (n) {\n for (const key in o) {\n if (!(key in n))\n to_null_out[key] = 1;\n }\n for (const key in n) {\n if (!accounted_for[key]) {\n update[key] = n[key];\n accounted_for[key] = 1;\n }\n }\n levels[i] = n;\n }\n else {\n for (const key in o) {\n accounted_for[key] = 1;\n }\n }\n }\n for (const key in to_null_out) {\n if (!(key in update))\n update[key] = undefined;\n }\n return update;\n}\nfunction get_spread_object(spread_props) {\n return typeof spread_props === 'object' && spread_props !== null ? spread_props : {};\n}\n\nconst _boolean_attributes = [\n 'allowfullscreen',\n 'allowpaymentrequest',\n 'async',\n 'autofocus',\n 'autoplay',\n 'checked',\n 'controls',\n 'default',\n 'defer',\n 'disabled',\n 'formnovalidate',\n 'hidden',\n 'inert',\n 'ismap',\n 'loop',\n 'multiple',\n 'muted',\n 'nomodule',\n 'novalidate',\n 'open',\n 'playsinline',\n 'readonly',\n 'required',\n 'reversed',\n 'selected'\n];\n/**\n * List of HTML boolean attributes (e.g. ``).\n * Source: https://html.spec.whatwg.org/multipage/indices.html\n */\nconst boolean_attributes = new Set([..._boolean_attributes]);\n\n/** regex of all html void element names */\nconst void_element_names = /^(?:area|base|br|col|command|embed|hr|img|input|keygen|link|meta|param|source|track|wbr)$/;\nfunction is_void(name) {\n return void_element_names.test(name) || name.toLowerCase() === '!doctype';\n}\n\nconst invalid_attribute_name_character = /[\\s'\">/=\\u{FDD0}-\\u{FDEF}\\u{FFFE}\\u{FFFF}\\u{1FFFE}\\u{1FFFF}\\u{2FFFE}\\u{2FFFF}\\u{3FFFE}\\u{3FFFF}\\u{4FFFE}\\u{4FFFF}\\u{5FFFE}\\u{5FFFF}\\u{6FFFE}\\u{6FFFF}\\u{7FFFE}\\u{7FFFF}\\u{8FFFE}\\u{8FFFF}\\u{9FFFE}\\u{9FFFF}\\u{AFFFE}\\u{AFFFF}\\u{BFFFE}\\u{BFFFF}\\u{CFFFE}\\u{CFFFF}\\u{DFFFE}\\u{DFFFF}\\u{EFFFE}\\u{EFFFF}\\u{FFFFE}\\u{FFFFF}\\u{10FFFE}\\u{10FFFF}]/u;\n// https://html.spec.whatwg.org/multipage/syntax.html#attributes-2\n// https://infra.spec.whatwg.org/#noncharacter\nfunction spread(args, attrs_to_add) {\n const attributes = Object.assign({}, ...args);\n if (attrs_to_add) {\n const classes_to_add = attrs_to_add.classes;\n const styles_to_add = attrs_to_add.styles;\n if (classes_to_add) {\n if (attributes.class == null) {\n attributes.class = classes_to_add;\n }\n else {\n attributes.class += ' ' + classes_to_add;\n }\n }\n if (styles_to_add) {\n if (attributes.style == null) {\n attributes.style = style_object_to_string(styles_to_add);\n }\n else {\n attributes.style = style_object_to_string(merge_ssr_styles(attributes.style, styles_to_add));\n }\n }\n }\n let str = '';\n Object.keys(attributes).forEach(name => {\n if (invalid_attribute_name_character.test(name))\n return;\n const value = attributes[name];\n if (value === true)\n str += ' ' + name;\n else if (boolean_attributes.has(name.toLowerCase())) {\n if (value)\n str += ' ' + name;\n }\n else if (value != null) {\n str += ` ${name}=\"${value}\"`;\n }\n });\n return str;\n}\nfunction merge_ssr_styles(style_attribute, style_directive) {\n const style_object = {};\n for (const individual_style of style_attribute.split(';')) {\n const colon_index = individual_style.indexOf(':');\n const name = individual_style.slice(0, colon_index).trim();\n const value = individual_style.slice(colon_index + 1).trim();\n if (!name)\n continue;\n style_object[name] = value;\n }\n for (const name in style_directive) {\n const value = style_directive[name];\n if (value) {\n style_object[name] = value;\n }\n else {\n delete style_object[name];\n }\n }\n return style_object;\n}\nconst ATTR_REGEX = /[&\"]/g;\nconst CONTENT_REGEX = /[&<]/g;\n/**\n * Note: this method is performance sensitive and has been optimized\n * https://github.com/sveltejs/svelte/pull/5701\n */\nfunction escape(value, is_attr = false) {\n const str = String(value);\n const pattern = is_attr ? ATTR_REGEX : CONTENT_REGEX;\n pattern.lastIndex = 0;\n let escaped = '';\n let last = 0;\n while (pattern.test(str)) {\n const i = pattern.lastIndex - 1;\n const ch = str[i];\n escaped += str.substring(last, i) + (ch === '&' ? '&' : (ch === '\"' ? '"' : '<'));\n last = i + 1;\n }\n return escaped + str.substring(last);\n}\nfunction escape_attribute_value(value) {\n // keep booleans, null, and undefined for the sake of `spread`\n const should_escape = typeof value === 'string' || (value && typeof value === 'object');\n return should_escape ? escape(value, true) : value;\n}\nfunction escape_object(obj) {\n const result = {};\n for (const key in obj) {\n result[key] = escape_attribute_value(obj[key]);\n }\n return result;\n}\nfunction each(items, fn) {\n let str = '';\n for (let i = 0; i < items.length; i += 1) {\n str += fn(items[i], i);\n }\n return str;\n}\nconst missing_component = {\n $$render: () => ''\n};\nfunction validate_component(component, name) {\n if (!component || !component.$$render) {\n if (name === 'svelte:component')\n name += ' this={...}';\n throw new Error(`<${name}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules. Otherwise you may need to fix a <${name}>.`);\n }\n return component;\n}\nfunction debug(file, line, column, values) {\n console.log(`{@debug} ${file ? file + ' ' : ''}(${line}:${column})`); // eslint-disable-line no-console\n console.log(values); // eslint-disable-line no-console\n return '';\n}\nlet on_destroy;\nfunction create_ssr_component(fn) {\n function $$render(result, props, bindings, slots, context) {\n const parent_component = current_component;\n const $$ = {\n on_destroy,\n context: new Map(context || (parent_component ? parent_component.$$.context : [])),\n // these will be immediately discarded\n on_mount: [],\n before_update: [],\n after_update: [],\n callbacks: blank_object()\n };\n set_current_component({ $$ });\n const html = fn(result, props, bindings, slots);\n set_current_component(parent_component);\n return html;\n }\n return {\n render: (props = {}, { $$slots = {}, context = new Map() } = {}) => {\n on_destroy = [];\n const result = { title: '', head: '', css: new Set() };\n const html = $$render(result, props, {}, $$slots, context);\n run_all(on_destroy);\n return {\n html,\n css: {\n code: Array.from(result.css).map(css => css.code).join('\\n'),\n map: null // TODO\n },\n head: result.title + result.head\n };\n },\n $$render\n };\n}\nfunction add_attribute(name, value, boolean) {\n if (value == null || (boolean && !value))\n return '';\n const assignment = (boolean && value === true) ? '' : `=\"${escape(value, true)}\"`;\n return ` ${name}${assignment}`;\n}\nfunction add_classes(classes) {\n return classes ? ` class=\"${classes}\"` : '';\n}\nfunction style_object_to_string(style_object) {\n return Object.keys(style_object)\n .filter(key => style_object[key])\n .map(key => `${key}: ${escape_attribute_value(style_object[key])};`)\n .join(' ');\n}\nfunction add_styles(style_object) {\n const styles = style_object_to_string(style_object);\n return styles ? ` style=\"${styles}\"` : '';\n}\n\nfunction bind(component, name, callback) {\n const index = component.$$.props[name];\n if (index !== undefined) {\n component.$$.bound[index] = callback;\n callback(component.$$.ctx[index]);\n }\n}\nfunction create_component(block) {\n block && block.c();\n}\nfunction claim_component(block, parent_nodes) {\n block && block.l(parent_nodes);\n}\nfunction mount_component(component, target, anchor, customElement) {\n const { fragment, after_update } = component.$$;\n fragment && fragment.m(target, anchor);\n if (!customElement) {\n // onMount happens before the initial afterUpdate\n add_render_callback(() => {\n const new_on_destroy = component.$$.on_mount.map(run).filter(is_function);\n // if the component was destroyed immediately\n // it will update the `$$.on_destroy` reference to `null`.\n // the destructured on_destroy may still reference to the old array\n if (component.$$.on_destroy) {\n component.$$.on_destroy.push(...new_on_destroy);\n }\n else {\n // Edge case - component was destroyed immediately,\n // most likely as a result of a binding initialising\n run_all(new_on_destroy);\n }\n component.$$.on_mount = [];\n });\n }\n after_update.forEach(add_render_callback);\n}\nfunction destroy_component(component, detaching) {\n const $$ = component.$$;\n if ($$.fragment !== null) {\n flush_render_callbacks($$.after_update);\n run_all($$.on_destroy);\n $$.fragment && $$.fragment.d(detaching);\n // TODO null out other refs, including component.$$ (but need to\n // preserve final state?)\n $$.on_destroy = $$.fragment = null;\n $$.ctx = [];\n }\n}\nfunction make_dirty(component, i) {\n if (component.$$.dirty[0] === -1) {\n dirty_components.push(component);\n schedule_update();\n component.$$.dirty.fill(0);\n }\n component.$$.dirty[(i / 31) | 0] |= (1 << (i % 31));\n}\nfunction init(component, options, instance, create_fragment, not_equal, props, append_styles, dirty = [-1]) {\n const parent_component = current_component;\n set_current_component(component);\n const $$ = component.$$ = {\n fragment: null,\n ctx: [],\n // state\n props,\n update: noop,\n not_equal,\n bound: blank_object(),\n // lifecycle\n on_mount: [],\n on_destroy: [],\n on_disconnect: [],\n before_update: [],\n after_update: [],\n context: new Map(options.context || (parent_component ? parent_component.$$.context : [])),\n // everything else\n callbacks: blank_object(),\n dirty,\n skip_bound: false,\n root: options.target || parent_component.$$.root\n };\n append_styles && append_styles($$.root);\n let ready = false;\n $$.ctx = instance\n ? instance(component, options.props || {}, (i, ret, ...rest) => {\n const value = rest.length ? rest[0] : ret;\n if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) {\n if (!$$.skip_bound && $$.bound[i])\n $$.bound[i](value);\n if (ready)\n make_dirty(component, i);\n }\n return ret;\n })\n : [];\n $$.update();\n ready = true;\n run_all($$.before_update);\n // `false` as a special case of no DOM component\n $$.fragment = create_fragment ? create_fragment($$.ctx) : false;\n if (options.target) {\n if (options.hydrate) {\n start_hydrating();\n const nodes = children(options.target);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n $$.fragment && $$.fragment.l(nodes);\n nodes.forEach(detach);\n }\n else {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n $$.fragment && $$.fragment.c();\n }\n if (options.intro)\n transition_in(component.$$.fragment);\n mount_component(component, options.target, options.anchor, options.customElement);\n end_hydrating();\n flush();\n }\n set_current_component(parent_component);\n}\nlet SvelteElement;\nif (typeof HTMLElement === 'function') {\n SvelteElement = class extends HTMLElement {\n constructor() {\n super();\n this.attachShadow({ mode: 'open' });\n }\n connectedCallback() {\n const { on_mount } = this.$$;\n this.$$.on_disconnect = on_mount.map(run).filter(is_function);\n // @ts-ignore todo: improve typings\n for (const key in this.$$.slotted) {\n // @ts-ignore todo: improve typings\n this.appendChild(this.$$.slotted[key]);\n }\n }\n attributeChangedCallback(attr, _oldValue, newValue) {\n this[attr] = newValue;\n }\n disconnectedCallback() {\n run_all(this.$$.on_disconnect);\n }\n $destroy() {\n destroy_component(this, 1);\n this.$destroy = noop;\n }\n $on(type, callback) {\n // TODO should this delegate to addEventListener?\n if (!is_function(callback)) {\n return noop;\n }\n const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = []));\n callbacks.push(callback);\n return () => {\n const index = callbacks.indexOf(callback);\n if (index !== -1)\n callbacks.splice(index, 1);\n };\n }\n $set($$props) {\n if (this.$$set && !is_empty($$props)) {\n this.$$.skip_bound = true;\n this.$$set($$props);\n this.$$.skip_bound = false;\n }\n }\n };\n}\n/**\n * Base class for Svelte components. Used when dev=false.\n */\nclass SvelteComponent {\n $destroy() {\n destroy_component(this, 1);\n this.$destroy = noop;\n }\n $on(type, callback) {\n if (!is_function(callback)) {\n return noop;\n }\n const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = []));\n callbacks.push(callback);\n return () => {\n const index = callbacks.indexOf(callback);\n if (index !== -1)\n callbacks.splice(index, 1);\n };\n }\n $set($$props) {\n if (this.$$set && !is_empty($$props)) {\n this.$$.skip_bound = true;\n this.$$set($$props);\n this.$$.skip_bound = false;\n }\n }\n}\n\nfunction dispatch_dev(type, detail) {\n document.dispatchEvent(custom_event(type, Object.assign({ version: '3.59.2' }, detail), { bubbles: true }));\n}\nfunction append_dev(target, node) {\n dispatch_dev('SvelteDOMInsert', { target, node });\n append(target, node);\n}\nfunction append_hydration_dev(target, node) {\n dispatch_dev('SvelteDOMInsert', { target, node });\n append_hydration(target, node);\n}\nfunction insert_dev(target, node, anchor) {\n dispatch_dev('SvelteDOMInsert', { target, node, anchor });\n insert(target, node, anchor);\n}\nfunction insert_hydration_dev(target, node, anchor) {\n dispatch_dev('SvelteDOMInsert', { target, node, anchor });\n insert_hydration(target, node, anchor);\n}\nfunction detach_dev(node) {\n dispatch_dev('SvelteDOMRemove', { node });\n detach(node);\n}\nfunction detach_between_dev(before, after) {\n while (before.nextSibling && before.nextSibling !== after) {\n detach_dev(before.nextSibling);\n }\n}\nfunction detach_before_dev(after) {\n while (after.previousSibling) {\n detach_dev(after.previousSibling);\n }\n}\nfunction detach_after_dev(before) {\n while (before.nextSibling) {\n detach_dev(before.nextSibling);\n }\n}\nfunction listen_dev(node, event, handler, options, has_prevent_default, has_stop_propagation, has_stop_immediate_propagation) {\n const modifiers = options === true ? ['capture'] : options ? Array.from(Object.keys(options)) : [];\n if (has_prevent_default)\n modifiers.push('preventDefault');\n if (has_stop_propagation)\n modifiers.push('stopPropagation');\n if (has_stop_immediate_propagation)\n modifiers.push('stopImmediatePropagation');\n dispatch_dev('SvelteDOMAddEventListener', { node, event, handler, modifiers });\n const dispose = listen(node, event, handler, options);\n return () => {\n dispatch_dev('SvelteDOMRemoveEventListener', { node, event, handler, modifiers });\n dispose();\n };\n}\nfunction attr_dev(node, attribute, value) {\n attr(node, attribute, value);\n if (value == null)\n dispatch_dev('SvelteDOMRemoveAttribute', { node, attribute });\n else\n dispatch_dev('SvelteDOMSetAttribute', { node, attribute, value });\n}\nfunction prop_dev(node, property, value) {\n node[property] = value;\n dispatch_dev('SvelteDOMSetProperty', { node, property, value });\n}\nfunction dataset_dev(node, property, value) {\n node.dataset[property] = value;\n dispatch_dev('SvelteDOMSetDataset', { node, property, value });\n}\nfunction set_data_dev(text, data) {\n data = '' + data;\n if (text.data === data)\n return;\n dispatch_dev('SvelteDOMSetData', { node: text, data });\n text.data = data;\n}\nfunction set_data_contenteditable_dev(text, data) {\n data = '' + data;\n if (text.wholeText === data)\n return;\n dispatch_dev('SvelteDOMSetData', { node: text, data });\n text.data = data;\n}\nfunction set_data_maybe_contenteditable_dev(text, data, attr_value) {\n if (~contenteditable_truthy_values.indexOf(attr_value)) {\n set_data_contenteditable_dev(text, data);\n }\n else {\n set_data_dev(text, data);\n }\n}\nfunction validate_each_argument(arg) {\n if (typeof arg !== 'string' && !(arg && typeof arg === 'object' && 'length' in arg)) {\n let msg = '{#each} only iterates over array-like objects.';\n if (typeof Symbol === 'function' && arg && Symbol.iterator in arg) {\n msg += ' You can use a spread to convert this iterable into an array.';\n }\n throw new Error(msg);\n }\n}\nfunction validate_slots(name, slot, keys) {\n for (const slot_key of Object.keys(slot)) {\n if (!~keys.indexOf(slot_key)) {\n console.warn(`<${name}> received an unexpected slot \"${slot_key}\".`);\n }\n }\n}\nfunction validate_dynamic_element(tag) {\n const is_string = typeof tag === 'string';\n if (tag && !is_string) {\n throw new Error(' expects \"this\" attribute to be a string.');\n }\n}\nfunction validate_void_dynamic_element(tag) {\n if (tag && is_void(tag)) {\n console.warn(` is self-closing and cannot have content.`);\n }\n}\nfunction construct_svelte_component_dev(component, props) {\n const error_message = 'this={...} of should specify a Svelte component.';\n try {\n const instance = new component(props);\n if (!instance.$$ || !instance.$set || !instance.$on || !instance.$destroy) {\n throw new Error(error_message);\n }\n return instance;\n }\n catch (err) {\n const { message } = err;\n if (typeof message === 'string' && message.indexOf('is not a constructor') !== -1) {\n throw new Error(error_message);\n }\n else {\n throw err;\n }\n }\n}\n/**\n * Base class for Svelte components with some minor dev-enhancements. Used when dev=true.\n */\nclass SvelteComponentDev extends SvelteComponent {\n constructor(options) {\n if (!options || (!options.target && !options.$$inline)) {\n throw new Error(\"'target' is a required option\");\n }\n super();\n }\n $destroy() {\n super.$destroy();\n this.$destroy = () => {\n console.warn('Component was already destroyed'); // eslint-disable-line no-console\n };\n }\n $capture_state() { }\n $inject_state() { }\n}\n/**\n * Base class to create strongly typed Svelte components.\n * This only exists for typing purposes and should be used in `.d.ts` files.\n *\n * ### Example:\n *\n * You have component library on npm called `component-library`, from which\n * you export a component called `MyComponent`. For Svelte+TypeScript users,\n * you want to provide typings. Therefore you create a `index.d.ts`:\n * ```ts\n * import { SvelteComponentTyped } from \"svelte\";\n * export class MyComponent extends SvelteComponentTyped<{foo: string}> {}\n * ```\n * Typing this makes it possible for IDEs like VS Code with the Svelte extension\n * to provide intellisense and to use the component like this in a Svelte file\n * with TypeScript:\n * ```svelte\n * \n * \n * ```\n *\n * #### Why not make this part of `SvelteComponent(Dev)`?\n * Because\n * ```ts\n * class ASubclassOfSvelteComponent extends SvelteComponent<{foo: string}> {}\n * const component: typeof SvelteComponent = ASubclassOfSvelteComponent;\n * ```\n * will throw a type error, so we need to separate the more strictly typed class.\n */\nclass SvelteComponentTyped extends SvelteComponentDev {\n constructor(options) {\n super(options);\n }\n}\nfunction loop_guard(timeout) {\n const start = Date.now();\n return () => {\n if (Date.now() - start > timeout) {\n throw new Error('Infinite loop detected');\n }\n };\n}\n\nexport { HtmlTag, HtmlTagHydration, ResizeObserverSingleton, SvelteComponent, SvelteComponentDev, SvelteComponentTyped, SvelteElement, action_destroyer, add_attribute, add_classes, add_flush_callback, add_iframe_resize_listener, add_location, add_render_callback, add_styles, add_transform, afterUpdate, append, append_dev, append_empty_stylesheet, append_hydration, append_hydration_dev, append_styles, assign, attr, attr_dev, attribute_to_object, beforeUpdate, bind, binding_callbacks, blank_object, bubble, check_outros, children, claim_comment, claim_component, claim_element, claim_html_tag, claim_space, claim_svg_element, claim_text, clear_loops, comment, component_subscribe, compute_rest_props, compute_slots, construct_svelte_component, construct_svelte_component_dev, contenteditable_truthy_values, createEventDispatcher, create_animation, create_bidirectional_transition, create_component, create_in_transition, create_out_transition, create_slot, create_ssr_component, current_component, custom_event, dataset_dev, debug, destroy_block, destroy_component, destroy_each, detach, detach_after_dev, detach_before_dev, detach_between_dev, detach_dev, dirty_components, dispatch_dev, each, element, element_is, empty, end_hydrating, escape, escape_attribute_value, escape_object, exclude_internal_props, fix_and_destroy_block, fix_and_outro_and_destroy_block, fix_position, flush, flush_render_callbacks, getAllContexts, getContext, get_all_dirty_from_scope, get_binding_group_value, get_current_component, get_custom_elements_slots, get_root_for_style, get_slot_changes, get_spread_object, get_spread_update, get_store_value, globals, group_outros, handle_promise, hasContext, has_prop, head_selector, identity, init, init_binding_group, init_binding_group_dynamic, insert, insert_dev, insert_hydration, insert_hydration_dev, intros, invalid_attribute_name_character, is_client, is_crossorigin, is_empty, is_function, is_promise, is_void, listen, listen_dev, loop, loop_guard, merge_ssr_styles, missing_component, mount_component, noop, not_equal, now, null_to_empty, object_without_properties, onDestroy, onMount, once, outro_and_destroy_block, prevent_default, prop_dev, query_selector_all, raf, resize_observer_border_box, resize_observer_content_box, resize_observer_device_pixel_content_box, run, run_all, safe_not_equal, schedule_update, select_multiple_value, select_option, select_options, select_value, self, setContext, set_attributes, set_current_component, set_custom_element_data, set_custom_element_data_map, set_data, set_data_contenteditable, set_data_contenteditable_dev, set_data_dev, set_data_maybe_contenteditable, set_data_maybe_contenteditable_dev, set_dynamic_element_data, set_input_type, set_input_value, set_now, set_raf, set_store_value, set_style, set_svg_attributes, space, split_css_unit, spread, src_url_equal, start_hydrating, stop_immediate_propagation, stop_propagation, subscribe, svg_element, text, tick, time_ranges_to_array, to_number, toggle_class, transition_in, transition_out, trusted, update_await_block_branch, update_keyed_each, update_slot, update_slot_base, validate_component, validate_dynamic_element, validate_each_argument, validate_each_keys, validate_slots, validate_store, validate_void_dynamic_element, xlink_attr };\n","import { noop, safe_not_equal, subscribe, run_all, is_function } from '../internal/index.mjs';\nexport { get_store_value as get } from '../internal/index.mjs';\n\nconst subscriber_queue = [];\n/**\n * Creates a `Readable` store that allows reading by subscription.\n * @param value initial value\n * @param {StartStopNotifier} [start]\n */\nfunction readable(value, start) {\n return {\n subscribe: writable(value, start).subscribe\n };\n}\n/**\n * Create a `Writable` store that allows both updating and reading by subscription.\n * @param {*=}value initial value\n * @param {StartStopNotifier=} start\n */\nfunction writable(value, start = noop) {\n let stop;\n const subscribers = new Set();\n function set(new_value) {\n if (safe_not_equal(value, new_value)) {\n value = new_value;\n if (stop) { // store is ready\n const run_queue = !subscriber_queue.length;\n for (const subscriber of subscribers) {\n subscriber[1]();\n subscriber_queue.push(subscriber, value);\n }\n if (run_queue) {\n for (let i = 0; i < subscriber_queue.length; i += 2) {\n subscriber_queue[i][0](subscriber_queue[i + 1]);\n }\n subscriber_queue.length = 0;\n }\n }\n }\n }\n function update(fn) {\n set(fn(value));\n }\n function subscribe(run, invalidate = noop) {\n const subscriber = [run, invalidate];\n subscribers.add(subscriber);\n if (subscribers.size === 1) {\n stop = start(set) || noop;\n }\n run(value);\n return () => {\n subscribers.delete(subscriber);\n if (subscribers.size === 0 && stop) {\n stop();\n stop = null;\n }\n };\n }\n return { set, update, subscribe };\n}\nfunction derived(stores, fn, initial_value) {\n const single = !Array.isArray(stores);\n const stores_array = single\n ? [stores]\n : stores;\n const auto = fn.length < 2;\n return readable(initial_value, (set) => {\n let started = false;\n const values = [];\n let pending = 0;\n let cleanup = noop;\n const sync = () => {\n if (pending) {\n return;\n }\n cleanup();\n const result = fn(single ? values[0] : values, set);\n if (auto) {\n set(result);\n }\n else {\n cleanup = is_function(result) ? result : noop;\n }\n };\n const unsubscribers = stores_array.map((store, i) => subscribe(store, (value) => {\n values[i] = value;\n pending &= ~(1 << i);\n if (started) {\n sync();\n }\n }, () => {\n pending |= (1 << i);\n }));\n started = true;\n sync();\n return function stop() {\n run_all(unsubscribers);\n cleanup();\n // We need to set this to false because callbacks can still happen despite having unsubscribed:\n // Callbacks might already be placed in the queue which doesn't know it should no longer\n // invoke this derived store.\n started = false;\n };\n });\n}\n/**\n * Takes a store and returns a new one derived from the old one that is readable.\n *\n * @param store - store to make readonly\n */\nfunction readonly(store) {\n return {\n subscribe: store.subscribe.bind(store)\n };\n}\n\nexport { derived, readable, readonly, writable };\n","export const LOCATION = {};\nexport const ROUTER = {};\n","/**\n * Adapted from https://github.com/reach/router/blob/b60e6dd781d5d3a4bdaaf4de665649c0f6a7e78d/src/lib/history.js\n *\n * https://github.com/reach/router/blob/master/LICENSE\n * */\n\nfunction getLocation(source) {\n return {\n ...source.location,\n state: source.history.state,\n key: (source.history.state && source.history.state.key) || \"initial\"\n };\n}\n\nfunction createHistory(source, options) {\n const listeners = [];\n let location = getLocation(source);\n\n return {\n get location() {\n return location;\n },\n\n listen(listener) {\n listeners.push(listener);\n\n const popstateListener = () => {\n location = getLocation(source);\n listener({ location, action: \"POP\" });\n };\n\n source.addEventListener(\"popstate\", popstateListener);\n\n return () => {\n source.removeEventListener(\"popstate\", popstateListener);\n\n const index = listeners.indexOf(listener);\n listeners.splice(index, 1);\n };\n },\n\n navigate(to, { state, replace = false } = {}) {\n state = { ...state, key: Date.now() + \"\" };\n // try...catch iOS Safari limits to 100 pushState calls\n try {\n if (replace) {\n source.history.replaceState(state, null, to);\n } else {\n source.history.pushState(state, null, to);\n }\n } catch (e) {\n source.location[replace ? \"replace\" : \"assign\"](to);\n }\n\n location = getLocation(source);\n listeners.forEach(listener => listener({ location, action: \"PUSH\" }));\n }\n };\n}\n\n// Stores history entries in memory for testing or other platforms like Native\nfunction createMemorySource(initialPathname = \"/\") {\n let index = 0;\n const stack = [{ pathname: initialPathname, search: \"\" }];\n const states = [];\n\n return {\n get location() {\n return stack[index];\n },\n addEventListener(name, fn) {},\n removeEventListener(name, fn) {},\n history: {\n get entries() {\n return stack;\n },\n get index() {\n return index;\n },\n get state() {\n return states[index];\n },\n pushState(state, _, uri) {\n const [pathname, search = \"\"] = uri.split(\"?\");\n index++;\n stack.push({ pathname, search });\n states.push(state);\n },\n replaceState(state, _, uri) {\n const [pathname, search = \"\"] = uri.split(\"?\");\n stack[index] = { pathname, search };\n states[index] = state;\n }\n }\n };\n}\n\n// Global history uses window.history as the source if available,\n// otherwise a memory history\nconst canUseDOM = Boolean(\n typeof window !== \"undefined\" &&\n window.document &&\n window.document.createElement\n);\nconst globalHistory = createHistory(canUseDOM ? window : createMemorySource());\nconst { navigate } = globalHistory;\n\nexport { globalHistory, navigate, createHistory, createMemorySource };\n","/**\n * Adapted from https://github.com/reach/router/blob/b60e6dd781d5d3a4bdaaf4de665649c0f6a7e78d/src/lib/utils.js\n *\n * https://github.com/reach/router/blob/master/LICENSE\n * */\n\nconst paramRe = /^:(.+)/;\n\nconst SEGMENT_POINTS = 4;\nconst STATIC_POINTS = 3;\nconst DYNAMIC_POINTS = 2;\nconst SPLAT_PENALTY = 1;\nconst ROOT_POINTS = 1;\n\n/**\n * Check if `string` starts with `search`\n * @param {string} string\n * @param {string} search\n * @return {boolean}\n */\nexport function startsWith(string, search) {\n return string.substr(0, search.length) === search;\n}\n\n/**\n * Check if `segment` is a root segment\n * @param {string} segment\n * @return {boolean}\n */\nfunction isRootSegment(segment) {\n return segment === \"\";\n}\n\n/**\n * Check if `segment` is a dynamic segment\n * @param {string} segment\n * @return {boolean}\n */\nfunction isDynamic(segment) {\n return paramRe.test(segment);\n}\n\n/**\n * Check if `segment` is a splat\n * @param {string} segment\n * @return {boolean}\n */\nfunction isSplat(segment) {\n return segment[0] === \"*\";\n}\n\n/**\n * Split up the URI into segments delimited by `/`\n * @param {string} uri\n * @return {string[]}\n */\nfunction segmentize(uri) {\n return (\n uri\n // Strip starting/ending `/`\n .replace(/(^\\/+|\\/+$)/g, \"\")\n .split(\"/\")\n );\n}\n\n/**\n * Strip `str` of potential start and end `/`\n * @param {string} str\n * @return {string}\n */\nfunction stripSlashes(str) {\n return str.replace(/(^\\/+|\\/+$)/g, \"\");\n}\n\n/**\n * Score a route depending on how its individual segments look\n * @param {object} route\n * @param {number} index\n * @return {object}\n */\nfunction rankRoute(route, index) {\n const score = route.default\n ? 0\n : segmentize(route.path).reduce((score, segment) => {\n score += SEGMENT_POINTS;\n\n if (isRootSegment(segment)) {\n score += ROOT_POINTS;\n } else if (isDynamic(segment)) {\n score += DYNAMIC_POINTS;\n } else if (isSplat(segment)) {\n score -= SEGMENT_POINTS + SPLAT_PENALTY;\n } else {\n score += STATIC_POINTS;\n }\n\n return score;\n }, 0);\n\n return { route, score, index };\n}\n\n/**\n * Give a score to all routes and sort them on that\n * @param {object[]} routes\n * @return {object[]}\n */\nfunction rankRoutes(routes) {\n return (\n routes\n .map(rankRoute)\n // If two routes have the exact same score, we go by index instead\n .sort((a, b) =>\n a.score < b.score ? 1 : a.score > b.score ? -1 : a.index - b.index\n )\n );\n}\n\n/**\n * Ranks and picks the best route to match. Each segment gets the highest\n * amount of points, then the type of segment gets an additional amount of\n * points where\n *\n * static > dynamic > splat > root\n *\n * This way we don't have to worry about the order of our routes, let the\n * computers do it.\n *\n * A route looks like this\n *\n * { path, default, value }\n *\n * And a returned match looks like:\n *\n * { route, params, uri }\n *\n * @param {object[]} routes\n * @param {string} uri\n * @return {?object}\n */\nfunction pick(routes, uri) {\n let match;\n let default_;\n\n const [uriPathname] = uri.split(\"?\");\n const uriSegments = segmentize(uriPathname);\n const isRootUri = uriSegments[0] === \"\";\n const ranked = rankRoutes(routes);\n\n for (let i = 0, l = ranked.length; i < l; i++) {\n const route = ranked[i].route;\n let missed = false;\n\n if (route.default) {\n default_ = {\n route,\n params: {},\n uri\n };\n continue;\n }\n\n const routeSegments = segmentize(route.path);\n const params = {};\n const max = Math.max(uriSegments.length, routeSegments.length);\n let index = 0;\n\n for (; index < max; index++) {\n const routeSegment = routeSegments[index];\n const uriSegment = uriSegments[index];\n\n if (routeSegment !== undefined && isSplat(routeSegment)) {\n // Hit a splat, just grab the rest, and return a match\n // uri: /files/documents/work\n // route: /files/* or /files/*splatname\n const splatName = routeSegment === \"*\" ? \"*\" : routeSegment.slice(1);\n\n params[splatName] = uriSegments\n .slice(index)\n .map(decodeURIComponent)\n .join(\"/\");\n break;\n }\n\n if (uriSegment === undefined) {\n // URI is shorter than the route, no match\n // uri: /users\n // route: /users/:userId\n missed = true;\n break;\n }\n\n let dynamicMatch = paramRe.exec(routeSegment);\n\n if (dynamicMatch && !isRootUri) {\n const value = decodeURIComponent(uriSegment);\n params[dynamicMatch[1]] = value;\n } else if (routeSegment !== uriSegment) {\n // Current segments don't match, not dynamic, not splat, so no match\n // uri: /users/123/settings\n // route: /users/:id/profile\n missed = true;\n break;\n }\n }\n\n if (!missed) {\n match = {\n route,\n params,\n uri: \"/\" + uriSegments.slice(0, index).join(\"/\")\n };\n break;\n }\n }\n\n return match || default_ || null;\n}\n\n/**\n * Check if the `path` matches the `uri`.\n * @param {string} path\n * @param {string} uri\n * @return {?object}\n */\nfunction match(route, uri) {\n return pick([route], uri);\n}\n\n/**\n * Add the query to the pathname if a query is given\n * @param {string} pathname\n * @param {string} [query]\n * @return {string}\n */\nfunction addQuery(pathname, query) {\n return pathname + (query ? `?${query}` : \"\");\n}\n\n/**\n * Resolve URIs as though every path is a directory, no files. Relative URIs\n * in the browser can feel awkward because not only can you be \"in a directory\",\n * you can be \"at a file\", too. For example:\n *\n * browserSpecResolve('foo', '/bar/') => /bar/foo\n * browserSpecResolve('foo', '/bar') => /foo\n *\n * But on the command line of a file system, it's not as complicated. You can't\n * `cd` from a file, only directories. This way, links have to know less about\n * their current path. To go deeper you can do this:\n *\n * \n * // instead of\n * \n *\n * Just like `cd`, if you want to go deeper from the command line, you do this:\n *\n * cd deeper\n * # not\n * cd $(pwd)/deeper\n *\n * By treating every path as a directory, linking to relative paths should\n * require less contextual information and (fingers crossed) be more intuitive.\n * @param {string} to\n * @param {string} base\n * @return {string}\n */\nfunction resolve(to, base) {\n // /foo/bar, /baz/qux => /foo/bar\n if (startsWith(to, \"/\")) {\n return to;\n }\n\n const [toPathname, toQuery] = to.split(\"?\");\n const [basePathname] = base.split(\"?\");\n const toSegments = segmentize(toPathname);\n const baseSegments = segmentize(basePathname);\n\n // ?a=b, /users?b=c => /users?a=b\n if (toSegments[0] === \"\") {\n return addQuery(basePathname, toQuery);\n }\n\n // profile, /users/789 => /users/789/profile\n if (!startsWith(toSegments[0], \".\")) {\n const pathname = baseSegments.concat(toSegments).join(\"/\");\n\n return addQuery((basePathname === \"/\" ? \"\" : \"/\") + pathname, toQuery);\n }\n\n // ./ , /users/123 => /users/123\n // ../ , /users/123 => /users\n // ../.. , /users/123 => /\n // ../../one, /a/b/c/d => /a/b/one\n // .././one , /a/b/c/d => /a/b/c/one\n const allSegments = baseSegments.concat(toSegments);\n const segments = [];\n\n allSegments.forEach(segment => {\n if (segment === \"..\") {\n segments.pop();\n } else if (segment !== \".\") {\n segments.push(segment);\n }\n });\n\n return addQuery(\"/\" + segments.join(\"/\"), toQuery);\n}\n\n/**\n * Combines the `basepath` and the `path` into one path.\n * @param {string} basepath\n * @param {string} path\n */\nfunction combinePaths(basepath, path) {\n return `${stripSlashes(\n path === \"/\" ? basepath : `${stripSlashes(basepath)}/${stripSlashes(path)}`\n )}/`;\n}\n\n/**\n * Decides whether a given `event` should result in a navigation or not.\n * @param {object} event\n */\nfunction shouldNavigate(event) {\n return (\n !event.defaultPrevented &&\n event.button === 0 &&\n !(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey)\n );\n}\n\nfunction hostMatches(anchor) {\n const host = location.host\n return (\n anchor.host == host ||\n // svelte seems to kill anchor.host value in ie11, so fall back to checking href\n anchor.href.indexOf(`https://${host}`) === 0 ||\n anchor.href.indexOf(`http://${host}`) === 0\n )\n}\n\nexport { stripSlashes, pick, match, resolve, combinePaths, shouldNavigate, hostMatches };\n","\n\n\n","\n\n{#if $activeRoute !== null && $activeRoute.route === route}\n {#if component !== null}\n \n {:else}\n \n {/if}\n{/if}\n","function noop() { }\r\nimport { writable } from 'svelte/store';\r\nimport { navigate } from \"svelte-routing\";\r\n\r\nfunction modelStore(value) {\r\n var model = writable(window.theModel);\r\n\r\n async function persistJson(url) {\r\n try {\r\n let headers = {\r\n 'Content-type': 'application/json; charset=utf-8'\r\n }\r\n await makeHttpRequest(url, 'POST', headers, JSON.stringify(value));\r\n return true;\r\n } catch (err) {\r\n console.log(\"Unexpected result:\", err);\r\n navigate(\"Registration/Error\");\r\n return false;\r\n }\r\n }\r\n\r\n return { ...model, persistJson };\r\n}\r\n\r\nexport const makeHttpRequest = function (url, method, headers, data) {\r\n\r\n // Create the XHR request\r\n let request = new XMLHttpRequest();\r\n\r\n // Return it as a Promise\r\n return new Promise(function (resolve, reject) {\r\n\r\n // Setup our listener to process compeleted requests\r\n request.onreadystatechange = function () {\r\n\r\n // Only run if the request is complete\r\n if (request.readyState !== 4) return;\r\n\r\n // Process the response\r\n if (request.status >= 200 && request.status < 300) {\r\n // If successful\r\n resolve(request);\r\n } else {\r\n // If failed\r\n reject({\r\n status: request.status,\r\n statusText: request.statusText\r\n });\r\n }\r\n };\r\n\r\n // Setup our HTTP request\r\n request.open(method || 'GET', url, true);\r\n\r\n // Add headers\r\n for (var header in headers) {\r\n if (headers.hasOwnProperty(header)) {\r\n request.setRequestHeader(header, headers[header]);\r\n }\r\n }\r\n\r\n // Send the request\r\n request.send(data);\r\n });\r\n};\r\n\r\n\r\nexport const model = modelStore(window.theModel);\r\nexport const pageNumber = writable(1);\r\n","export { identity as linear } from '../internal/index.mjs';\n\n/*\nAdapted from https://github.com/mattdesl\nDistributed under MIT License https://github.com/mattdesl/eases/blob/master/LICENSE.md\n*/\nfunction backInOut(t) {\n const s = 1.70158 * 1.525;\n if ((t *= 2) < 1)\n return 0.5 * (t * t * ((s + 1) * t - s));\n return 0.5 * ((t -= 2) * t * ((s + 1) * t + s) + 2);\n}\nfunction backIn(t) {\n const s = 1.70158;\n return t * t * ((s + 1) * t - s);\n}\nfunction backOut(t) {\n const s = 1.70158;\n return --t * t * ((s + 1) * t + s) + 1;\n}\nfunction bounceOut(t) {\n const a = 4.0 / 11.0;\n const b = 8.0 / 11.0;\n const c = 9.0 / 10.0;\n const ca = 4356.0 / 361.0;\n const cb = 35442.0 / 1805.0;\n const cc = 16061.0 / 1805.0;\n const t2 = t * t;\n return t < a\n ? 7.5625 * t2\n : t < b\n ? 9.075 * t2 - 9.9 * t + 3.4\n : t < c\n ? ca * t2 - cb * t + cc\n : 10.8 * t * t - 20.52 * t + 10.72;\n}\nfunction bounceInOut(t) {\n return t < 0.5\n ? 0.5 * (1.0 - bounceOut(1.0 - t * 2.0))\n : 0.5 * bounceOut(t * 2.0 - 1.0) + 0.5;\n}\nfunction bounceIn(t) {\n return 1.0 - bounceOut(1.0 - t);\n}\nfunction circInOut(t) {\n if ((t *= 2) < 1)\n return -0.5 * (Math.sqrt(1 - t * t) - 1);\n return 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1);\n}\nfunction circIn(t) {\n return 1.0 - Math.sqrt(1.0 - t * t);\n}\nfunction circOut(t) {\n return Math.sqrt(1 - --t * t);\n}\nfunction cubicInOut(t) {\n return t < 0.5 ? 4.0 * t * t * t : 0.5 * Math.pow(2.0 * t - 2.0, 3.0) + 1.0;\n}\nfunction cubicIn(t) {\n return t * t * t;\n}\nfunction cubicOut(t) {\n const f = t - 1.0;\n return f * f * f + 1.0;\n}\nfunction elasticInOut(t) {\n return t < 0.5\n ? 0.5 *\n Math.sin(((+13.0 * Math.PI) / 2) * 2.0 * t) *\n Math.pow(2.0, 10.0 * (2.0 * t - 1.0))\n : 0.5 *\n Math.sin(((-13.0 * Math.PI) / 2) * (2.0 * t - 1.0 + 1.0)) *\n Math.pow(2.0, -10.0 * (2.0 * t - 1.0)) +\n 1.0;\n}\nfunction elasticIn(t) {\n return Math.sin((13.0 * t * Math.PI) / 2) * Math.pow(2.0, 10.0 * (t - 1.0));\n}\nfunction elasticOut(t) {\n return (Math.sin((-13.0 * (t + 1.0) * Math.PI) / 2) * Math.pow(2.0, -10.0 * t) + 1.0);\n}\nfunction expoInOut(t) {\n return t === 0.0 || t === 1.0\n ? t\n : t < 0.5\n ? +0.5 * Math.pow(2.0, 20.0 * t - 10.0)\n : -0.5 * Math.pow(2.0, 10.0 - t * 20.0) + 1.0;\n}\nfunction expoIn(t) {\n return t === 0.0 ? t : Math.pow(2.0, 10.0 * (t - 1.0));\n}\nfunction expoOut(t) {\n return t === 1.0 ? t : 1.0 - Math.pow(2.0, -10.0 * t);\n}\nfunction quadInOut(t) {\n t /= 0.5;\n if (t < 1)\n return 0.5 * t * t;\n t--;\n return -0.5 * (t * (t - 2) - 1);\n}\nfunction quadIn(t) {\n return t * t;\n}\nfunction quadOut(t) {\n return -t * (t - 2.0);\n}\nfunction quartInOut(t) {\n return t < 0.5\n ? +8.0 * Math.pow(t, 4.0)\n : -8.0 * Math.pow(t - 1.0, 4.0) + 1.0;\n}\nfunction quartIn(t) {\n return Math.pow(t, 4.0);\n}\nfunction quartOut(t) {\n return Math.pow(t - 1.0, 3.0) * (1.0 - t) + 1.0;\n}\nfunction quintInOut(t) {\n if ((t *= 2) < 1)\n return 0.5 * t * t * t * t * t;\n return 0.5 * ((t -= 2) * t * t * t * t + 2);\n}\nfunction quintIn(t) {\n return t * t * t * t * t;\n}\nfunction quintOut(t) {\n return --t * t * t * t * t + 1;\n}\nfunction sineInOut(t) {\n return -0.5 * (Math.cos(Math.PI * t) - 1);\n}\nfunction sineIn(t) {\n const v = Math.cos(t * Math.PI * 0.5);\n if (Math.abs(v) < 1e-14)\n return 1;\n else\n return 1 - v;\n}\nfunction sineOut(t) {\n return Math.sin((t * Math.PI) / 2);\n}\n\nexport { backIn, backInOut, backOut, bounceIn, bounceInOut, bounceOut, circIn, circInOut, circOut, cubicIn, cubicInOut, cubicOut, elasticIn, elasticInOut, elasticOut, expoIn, expoInOut, expoOut, quadIn, quadInOut, quadOut, quartIn, quartInOut, quartOut, quintIn, quintInOut, quintOut, sineIn, sineInOut, sineOut };\n","import { cubicInOut, linear, cubicOut } from '../easing/index.mjs';\nimport { split_css_unit, is_function, assign } from '../internal/index.mjs';\n\n/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n\r\nfunction __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\n\nfunction blur(node, { delay = 0, duration = 400, easing = cubicInOut, amount = 5, opacity = 0 } = {}) {\n const style = getComputedStyle(node);\n const target_opacity = +style.opacity;\n const f = style.filter === 'none' ? '' : style.filter;\n const od = target_opacity * (1 - opacity);\n const [value, unit] = split_css_unit(amount);\n return {\n delay,\n duration,\n easing,\n css: (_t, u) => `opacity: ${target_opacity - (od * u)}; filter: ${f} blur(${u * value}${unit});`\n };\n}\nfunction fade(node, { delay = 0, duration = 400, easing = linear } = {}) {\n const o = +getComputedStyle(node).opacity;\n return {\n delay,\n duration,\n easing,\n css: t => `opacity: ${t * o}`\n };\n}\nfunction fly(node, { delay = 0, duration = 400, easing = cubicOut, x = 0, y = 0, opacity = 0 } = {}) {\n const style = getComputedStyle(node);\n const target_opacity = +style.opacity;\n const transform = style.transform === 'none' ? '' : style.transform;\n const od = target_opacity * (1 - opacity);\n const [xValue, xUnit] = split_css_unit(x);\n const [yValue, yUnit] = split_css_unit(y);\n return {\n delay,\n duration,\n easing,\n css: (t, u) => `\n\t\t\ttransform: ${transform} translate(${(1 - t) * xValue}${xUnit}, ${(1 - t) * yValue}${yUnit});\n\t\t\topacity: ${target_opacity - (od * u)}`\n };\n}\nfunction slide(node, { delay = 0, duration = 400, easing = cubicOut, axis = 'y' } = {}) {\n const style = getComputedStyle(node);\n const opacity = +style.opacity;\n const primary_property = axis === 'y' ? 'height' : 'width';\n const primary_property_value = parseFloat(style[primary_property]);\n const secondary_properties = axis === 'y' ? ['top', 'bottom'] : ['left', 'right'];\n const capitalized_secondary_properties = secondary_properties.map((e) => `${e[0].toUpperCase()}${e.slice(1)}`);\n const padding_start_value = parseFloat(style[`padding${capitalized_secondary_properties[0]}`]);\n const padding_end_value = parseFloat(style[`padding${capitalized_secondary_properties[1]}`]);\n const margin_start_value = parseFloat(style[`margin${capitalized_secondary_properties[0]}`]);\n const margin_end_value = parseFloat(style[`margin${capitalized_secondary_properties[1]}`]);\n const border_width_start_value = parseFloat(style[`border${capitalized_secondary_properties[0]}Width`]);\n const border_width_end_value = parseFloat(style[`border${capitalized_secondary_properties[1]}Width`]);\n return {\n delay,\n duration,\n easing,\n css: t => 'overflow: hidden;' +\n `opacity: ${Math.min(t * 20, 1) * opacity};` +\n `${primary_property}: ${t * primary_property_value}px;` +\n `padding-${secondary_properties[0]}: ${t * padding_start_value}px;` +\n `padding-${secondary_properties[1]}: ${t * padding_end_value}px;` +\n `margin-${secondary_properties[0]}: ${t * margin_start_value}px;` +\n `margin-${secondary_properties[1]}: ${t * margin_end_value}px;` +\n `border-${secondary_properties[0]}-width: ${t * border_width_start_value}px;` +\n `border-${secondary_properties[1]}-width: ${t * border_width_end_value}px;`\n };\n}\nfunction scale(node, { delay = 0, duration = 400, easing = cubicOut, start = 0, opacity = 0 } = {}) {\n const style = getComputedStyle(node);\n const target_opacity = +style.opacity;\n const transform = style.transform === 'none' ? '' : style.transform;\n const sd = 1 - start;\n const od = target_opacity * (1 - opacity);\n return {\n delay,\n duration,\n easing,\n css: (_t, u) => `\n\t\t\ttransform: ${transform} scale(${1 - (sd * u)});\n\t\t\topacity: ${target_opacity - (od * u)}\n\t\t`\n };\n}\nfunction draw(node, { delay = 0, speed, duration, easing = cubicInOut } = {}) {\n let len = node.getTotalLength();\n const style = getComputedStyle(node);\n if (style.strokeLinecap !== 'butt') {\n len += parseInt(style.strokeWidth);\n }\n if (duration === undefined) {\n if (speed === undefined) {\n duration = 800;\n }\n else {\n duration = len / speed;\n }\n }\n else if (typeof duration === 'function') {\n duration = duration(len);\n }\n return {\n delay,\n duration,\n easing,\n css: (_, u) => `\n\t\t\tstroke-dasharray: ${len};\n\t\t\tstroke-dashoffset: ${u * len};\n\t\t`\n };\n}\nfunction crossfade(_a) {\n var { fallback } = _a, defaults = __rest(_a, [\"fallback\"]);\n const to_receive = new Map();\n const to_send = new Map();\n function crossfade(from_node, node, params) {\n const { delay = 0, duration = d => Math.sqrt(d) * 30, easing = cubicOut } = assign(assign({}, defaults), params);\n const from = from_node.getBoundingClientRect();\n const to = node.getBoundingClientRect();\n const dx = from.left - to.left;\n const dy = from.top - to.top;\n const dw = from.width / to.width;\n const dh = from.height / to.height;\n const d = Math.sqrt(dx * dx + dy * dy);\n const style = getComputedStyle(node);\n const transform = style.transform === 'none' ? '' : style.transform;\n const opacity = +style.opacity;\n return {\n delay,\n duration: is_function(duration) ? duration(d) : duration,\n easing,\n css: (t, u) => `\n\t\t\t\topacity: ${t * opacity};\n\t\t\t\ttransform-origin: top left;\n\t\t\t\ttransform: ${transform} translate(${u * dx}px,${u * dy}px) scale(${t + (1 - t) * dw}, ${t + (1 - t) * dh});\n\t\t\t`\n };\n }\n function transition(items, counterparts, intro) {\n return (node, params) => {\n items.set(params.key, node);\n return () => {\n if (counterparts.has(params.key)) {\n const other_node = counterparts.get(params.key);\n counterparts.delete(params.key);\n return crossfade(other_node, node, params);\n }\n // if the node is disappearing altogether\n // (i.e. wasn't claimed by the other list)\n // then we need to supply an outro\n items.delete(params.key);\n return fallback && fallback(node, params, intro);\n };\n };\n }\n return [\n transition(to_send, to_receive, false),\n transition(to_receive, to_send, true)\n ];\n}\n\nexport { blur, crossfade, draw, fade, fly, scale, slide };\n","export const projectSettings = {\r\n phoneNumber: (window.projectSettings && window.projectSettings.phoneNumber) || \"\",\r\n emailAddress: (window.projectSettings && window.projectSettings.emailAddress) || \"\",\r\n classActionName: (window.projectSettings && window.projectSettings.classActionName) || \"\",\r\n lfaDocumentUrl: (window.projectSettings && window.projectSettings.lfaDocumentUrl) || \"\",\r\n costAgreementDocumentUrl: (window.projectSettings && window.projectSettings.costAgreementDocumentUrl) || \"\",\r\n serviceUrl: (window.projectSettings && window.projectSettings.serviceUrl) || \"\",\r\n gSiteKey2: (window.projectSettings && window.projectSettings.gSiteKey2) || \"\",\r\n gSiteKey3: (window.projectSettings && window.projectSettings.gSiteKey3) || \"\",\r\n}\r\n\r\nconst registrationPageIndex = {\r\n LandingPage: 0,\r\n PersonalDetails: 1,\r\n Details: 2,\r\n Confirmation: 3,\r\n ThankYou: 4,\r\n Review: 5,\r\n Error: 6,\r\n};\r\n\r\nconst fileUploadPageIndex = {\r\n FileUploadLandingPage: 0,\r\n FileUploadFiles: 1,\r\n FileUploadThankYou: 2,\r\n Error: 3,\r\n};\r\n\r\nconst confirmAgreementsPageIndex = {\r\n ConfirmAgreements_LandingPage: 0,\r\n ConfirmAgreements_CostAndFundingAgreements: 1,\r\n ConfirmAgreements_ThankYou: 2,\r\n Error: 3,\r\n};\r\n\r\nconst acknowledgeUpdatedAgreementsPageIndex = {\r\n AckUpdatedAgreements_LandingPage: 0,\r\n AckUpdatedAgreements_Letter: 1,\r\n AckUpdatedAgreements_ThankYou: 2,\r\n Error: 3,\r\n};\r\n\r\nconst acknowledgeAmendmentsPageIndexAU = {\r\n AckAU_LandingPage: 0,\r\n AckAU_Letter: 1,\r\n AckAU_ThankYou: 2,\r\n Error: 3,\r\n};\r\n\r\nconst acknowledgeAmendmentsPageIndexOS = {\r\n AckOS_LandingPage: 0,\r\n AckOS_Letter: 1,\r\n AckOS_Funding: 2,\r\n AckOS_Disclosure: 3,\r\n AckOS_ThankYou: 4,\r\n Error: 5,\r\n};\r\n\r\nconst agreementsAcceptancePageIndex = {\r\n AgreementsAcceptance_LandingPage: 0,\r\n AgreementsAcceptance_Cost: 1,\r\n AgreementsAcceptance_Funding: 2,\r\n AgreementsAcceptance_ThankYou: 3,\r\n Error: 4,\r\n};\r\n\r\nconst questionnairePageIndex = {\r\n Questionnaire_Questions: 0,\r\n Questionnaire_Confirmation: 1,\r\n Questionnaire_ThankYou: 2,\r\n Questionnaire_Review: 3,\r\n Error: 4,\r\n};\r\n\r\nconst questionnaire2PageIndex = {\r\n Questionnaire2_Questions: 0,\r\n Questionnaire2_Confirmation: 1,\r\n Questionnaire2_ThankYou: 2,\r\n Questionnaire2_Review: 3,\r\n Error: 4,\r\n};\r\n\r\nconst registrationPageList = [\r\n {\r\n pageIndex: 0,\r\n pageTitle: `${projectSettings.classActionName}`,\r\n title: \"Landing Page\",\r\n showInTracker: false,\r\n lastVisitedPage: \"Landing Page\",\r\n nextPage: \"Registration/PersonalDetails\",\r\n },\r\n {\r\n pageIndex: 1,\r\n title: \"Personal Details\",\r\n showInTracker: true,\r\n pageTitle: `${projectSettings.classActionName} - Personal Details`,\r\n nextPage: \"Registration/Details\",\r\n previousPage: \"Registration\",\r\n persistUrl: \"api/project\",\r\n lastVisitedPage: \"Personal Details\"\r\n },\r\n {\r\n pageIndex: 2,\r\n title: \"Details\",\r\n showInTracker: true,\r\n pageTitle: `${projectSettings.classActionName} - Details`,\r\n nextPage: \"Registration/Confirmation\",\r\n previousPage: \"Registration/PersonalDetails\",\r\n persistUrl: \"api/project\",\r\n lastVisitedPage: \"Details\"\r\n },\r\n // {\r\n // pageIndex: 3,\r\n // title: \"Funding Agreement and Costs Agreement\",\r\n // showInTracker: true,\r\n // pageTitle: `${projectSettings.classActionName} - Funding Agreement and Costs Agreement`,\r\n // nextPage: \"Registration/Confirmation\",\r\n // previousPage: \"Registration/Details\",\r\n // persistUrl: \"api/project\",\r\n // lastVisitedPage: \"Funding Agreement and Costs Agreement\"\r\n // },\r\n {\r\n pageIndex: 3,\r\n title: \"Confirmation\",\r\n showInTracker: true,\r\n pageTitle: `${projectSettings.classActionName} - Confirmation`,\r\n previousPage: \"Registration/Details\",\r\n nextPage: \"Registration/ThankYou\",\r\n nextPageLabel: \"Submit\",\r\n persistUrl: \"api/registration\",\r\n lastVisitedPage: \"Confirmation\"\r\n },\r\n {\r\n pageIndex: 4,\r\n title: \"Thank you\",\r\n showInTracker: true,\r\n pageTitle: `${projectSettings.classActionName} - Thank you`,\r\n },\r\n {\r\n pageIndex: 5,\r\n title: \"Review\",\r\n showInTracker: false,\r\n pageTitle: `${projectSettings.classActionName} - Review`,\r\n },\r\n {\r\n pageIndex: 6,\r\n title: \"Error\",\r\n showInTracker: false,\r\n pageTitle: `${projectSettings.classActionName} - Error`,\r\n },\r\n];\r\n\r\nconst fileUploadPageList = [\r\n {\r\n pageIndex: 0,\r\n pageTitle: `${projectSettings.classActionName}`,\r\n title: \"Landing Page\",\r\n showInTracker: false,\r\n nextPage: \"FileUpload/Files\",\r\n },\r\n {\r\n pageIndex: 1,\r\n title: \"Files\",\r\n showInTracker: true,\r\n pageTitle: `${projectSettings.classActionName} - Files`,\r\n nextPage: \"FileUpload/Thankyou\",\r\n previousPage: \"FileUpload\",\r\n nextPageLabel: \"Submit\",\r\n persistUrl: \"api/file-upload-submit\",\r\n },\r\n {\r\n pageIndex: 2,\r\n title: \"Thank you\",\r\n showInTracker: true,\r\n pageTitle: `${projectSettings.classActionName} - Thank you`,\r\n },\r\n {\r\n pageIndex: 3,\r\n title: \"Error\",\r\n showInTracker: false,\r\n pageTitle: `${projectSettings.classActionName} - Error`,\r\n },\r\n];\r\n\r\nconst confirmAgreementsPageList = [\r\n {\r\n pageIndex: 0,\r\n pageTitle: `${projectSettings.classActionName} Class Action`,\r\n title: \"Landing Page\",\r\n showInTracker: false,\r\n nextPage: \"ConfirmAgreements/Confirm\",\r\n },\r\n {\r\n pageIndex: 1,\r\n title: \"Confirm Agreements\",\r\n showInTracker: true,\r\n pageTitle: `${projectSettings.classActionName} Class Action - Confirm Agreements`,\r\n nextPage: \"ConfirmAgreements/Thankyou\",\r\n previousPage: \"ConfirmAgreements\",\r\n nextPageLabel: \"Submit\",\r\n persistUrl: \"api/agreements\",\r\n },\r\n {\r\n pageIndex: 2,\r\n title: \"Thank you\",\r\n showInTracker: true,\r\n pageTitle: `${projectSettings.classActionName} Class Action - Thank you`,\r\n },\r\n {\r\n pageIndex: 3,\r\n title: \"Error\",\r\n showInTracker: false,\r\n pageTitle: `${projectSettings.classActionName} Class Action - Error`,\r\n },\r\n];\r\n\r\nconst acknowledgeAmendmentsPageListAU = [\r\n {\r\n pageIndex: 0,\r\n pageTitle: `${projectSettings.classActionName} Class Action`,\r\n title: \"Landing Page\",\r\n showInTracker: false,\r\n nextPage: \"AcknowledgeAmendments/Letter\",\r\n },\r\n {\r\n pageIndex: 1,\r\n title: \"Letter re Cost Agreement\",\r\n showInTracker: true,\r\n pageTitle: `${projectSettings.classActionName} Class Action - Letter re Cost Agreement`,\r\n nextPage: \"AcknowledgeAmendments/Thankyou\",\r\n previousPage: \"AcknowledgeAmendments\",\r\n nextPageLabel: \"Submit\",\r\n persistUrl: \"api/acknowledge-amendments\",\r\n },\r\n {\r\n pageIndex: 2,\r\n title: \"Dummy\",\r\n showInTracker: false,\r\n },\r\n {\r\n pageIndex: 3,\r\n title: \"Dummy\",\r\n showInTracker: false,\r\n },\r\n {\r\n pageIndex: 4,\r\n title: \"Thank you\",\r\n showInTracker: true,\r\n pageTitle: `${projectSettings.classActionName} Class Action - Thank you`,\r\n },\r\n {\r\n pageIndex: 5,\r\n title: \"Error\",\r\n showInTracker: false,\r\n pageTitle: `${projectSettings.classActionName} Class Action - Error`,\r\n },\r\n];\r\n\r\nconst acknowledgeAmendmentsPageListOS = [\r\n {\r\n pageIndex: 0,\r\n pageTitle: `${projectSettings.classActionName} Class Action`,\r\n title: \"Landing Page\",\r\n showInTracker: false,\r\n nextPage: \"AcknowledgeAmendments/Letter\",\r\n },\r\n {\r\n pageIndex: 1,\r\n title: \"Letter re Cost Agreement\",\r\n showInTracker: true,\r\n pageTitle: `${projectSettings.classActionName} Class Action - Letter re Cost Agreement`,\r\n nextPage: \"AcknowledgeAmendments/Funding\",\r\n nextPageLabel: \"Next\",\r\n previousPage: \"AcknowledgeAmendments\",\r\n },\r\n {\r\n pageIndex: 2,\r\n title: \"Funding Agreement\",\r\n showInTracker: true,\r\n pageTitle: `${projectSettings.classActionName} Class Action - Funding Agreement`,\r\n nextPage: \"AcknowledgeAmendments/Disclosure\",\r\n nextPageLabel: \"Next\",\r\n previousPage: \"AcknowledgeAmendments/Letter\",\r\n },\r\n {\r\n pageIndex: 3,\r\n title: \"Conflicts Disclosure Statement\",\r\n showInTracker: true,\r\n pageTitle: `${projectSettings.classActionName} Class Action - Conflicts Disclosure Statement`,\r\n nextPage: \"AcknowledgeAmendments/Thankyou\",\r\n previousPage: \"AcknowledgeAmendments/Funding\",\r\n nextPageLabel: \"Submit\",\r\n persistUrl: \"api/acknowledge-amendments\",\r\n },\r\n {\r\n pageIndex: 4,\r\n title: \"Thank you\",\r\n showInTracker: true,\r\n pageTitle: `${projectSettings.classActionName} Class Action - Thank you`,\r\n },\r\n {\r\n pageIndex: 5,\r\n title: \"Error\",\r\n showInTracker: false,\r\n pageTitle: `${projectSettings.classActionName} Class Action - Error`,\r\n },\r\n];\r\n\r\nconst acknowledgeUpdatedAgreementsPageList = [\r\n {\r\n pageIndex: 0,\r\n pageTitle: `${projectSettings.classActionName} Class Action`,\r\n title: \"Landing Page\",\r\n showInTracker: false,\r\n nextPage: \"AcknowledgeUpdatedAgreements/Letter\",\r\n },\r\n {\r\n pageIndex: 1,\r\n title: \"Letter re Cost Agreement\",\r\n showInTracker: true,\r\n pageTitle: `${projectSettings.classActionName} Class Action - Letter re Cost Agreement`,\r\n nextPage: \"AcknowledgeUpdatedAgreements/Thankyou\",\r\n previousPage: \"AcknowledgeUpdatedAgreements\",\r\n nextPageLabel: \"Submit\",\r\n persistUrl: \"api/acknowledge-updated-agreements\",\r\n },\r\n {\r\n pageIndex: 2,\r\n title: \"Thank you\",\r\n showInTracker: true,\r\n pageTitle: `${projectSettings.classActionName} Class Action - Thank you`,\r\n },\r\n {\r\n pageIndex: 3,\r\n title: \"Error\",\r\n showInTracker: false,\r\n pageTitle: `${projectSettings.classActionName} Class Action - Error`,\r\n },\r\n];\r\n\r\nconst agreementsAcceptancePageList = [\r\n {\r\n pageIndex: 0,\r\n pageTitle: `${projectSettings.classActionName} Class Action`,\r\n title: \"Landing Page\",\r\n showInTracker: false,\r\n nextPage: \"AgreementsAcceptance/Cost\",\r\n },\r\n {\r\n pageIndex: 1,\r\n title: \"Costs Agreement\",\r\n showInTracker: true,\r\n pageTitle: `${projectSettings.classActionName} Class Action - Costs Agreement`,\r\n nextPage: \"AgreementsAcceptance/Funding\",\r\n previousPage: \"AgreementsAcceptance\",\r\n nextPageLabel: \"Next\",\r\n },\r\n {\r\n pageIndex: 2,\r\n title: \"Funding Agreement\",\r\n showInTracker: true,\r\n pageTitle: `${projectSettings.classActionName} Class Action - Funding Agreement`,\r\n nextPage: \"AgreementsAcceptance/Thankyou\",\r\n previousPage: \"AgreementsAcceptance/Cost\",\r\n nextPageLabel: \"Submit\",\r\n persistUrl: \"api/agreements-acceptance\",\r\n },\r\n {\r\n pageIndex: 3,\r\n title: \"Thank you\",\r\n showInTracker: true,\r\n pageTitle: `${projectSettings.classActionName} Class Action - Thank you`,\r\n },\r\n {\r\n pageIndex: 4,\r\n title: \"Error\",\r\n showInTracker: false,\r\n pageTitle: `${projectSettings.classActionName} Class Action - Error`,\r\n },\r\n];\r\n\r\nconst questionnairePageList = [\r\n {\r\n pageIndex: 0,\r\n pageTitle: `${projectSettings.classActionName} Class Action`,\r\n title: \"Questionnaire\",\r\n showInTracker: false,\r\n nnnnnextPageLabel: \"Submit\",\r\n pppppersistUrl: \"api/questionnaire\",\r\n nextPage: \"Questionnaire/Confirmation\",\r\n lastVisitedPage: \"Questionnaire\"\r\n },\r\n {\r\n pageIndex: 1,\r\n title: \"Confirmation\",\r\n showInTracker: true,\r\n pageTitle: `${projectSettings.classActionName} - Confirmation`,\r\n previousPage: \"Questionnaire/Questions\",\r\n nextPage: \"Questionnaire/ThankYou\",\r\n nextPageLabel: \"Submit\",\r\n persistUrl: \"api/questionnaire\",\r\n lastVisitedPage: \"Confirmation\"\r\n },\r\n {\r\n pageIndex: 2,\r\n title: \"Thank you\",\r\n showInTracker: true,\r\n pageTitle: `${projectSettings.classActionName} Class Action - Thank you`,\r\n },\r\n {\r\n pageIndex: 3,\r\n title: \"Questionnaire/Review\",\r\n showInTracker: false,\r\n pageTitle: `${projectSettings.classActionName} Class Action - Review`,\r\n },\r\n {\r\n pageIndex: 4,\r\n title: \"Error\",\r\n showInTracker: false,\r\n pageTitle: `${projectSettings.classActionName} Class Action - Error`,\r\n },\r\n];\r\n\r\nconst questionnaire2PageList = [\r\n {\r\n pageIndex: 0,\r\n pageTitle: `${projectSettings.classActionName} Class Action`,\r\n title: \"Questionnaire 2\",\r\n showInTracker: false,\r\n nextPage: \"Questionnaire2/Confirmation\",\r\n lastVisitedPage: \"Questionnaire 2\"\r\n },\r\n {\r\n pageIndex: 1,\r\n title: \"Confirmation\",\r\n showInTracker: true,\r\n pageTitle: `${projectSettings.classActionName} - Confirmation`,\r\n previousPage: \"Questionnaire2/Questions\",\r\n nextPage: \"Questionnaire2/ThankYou\",\r\n nextPageLabel: \"Submit\",\r\n persistUrl: \"api/questionnaire\",\r\n lastVisitedPage: \"Confirmation\"\r\n },\r\n {\r\n pageIndex: 2,\r\n title: \"Thank you\",\r\n showInTracker: true,\r\n pageTitle: `${projectSettings.classActionName} Class Action - Thank you`,\r\n },\r\n {\r\n pageIndex: 3,\r\n title: \"Questionnaire2/Review\",\r\n showInTracker: false,\r\n pageTitle: `${projectSettings.classActionName} Class Action - Review`,\r\n },\r\n {\r\n pageIndex: 4,\r\n title: \"Error\",\r\n showInTracker: false,\r\n pageTitle: `${projectSettings.classActionName} Class Action - Error`,\r\n },\r\n];\r\n\r\n\r\nexport const applicationPages = {\r\n registrationPageIndex: registrationPageIndex,\r\n registrationPageList: registrationPageList,\r\n fileUploadPageIndex: fileUploadPageIndex,\r\n fileUploadPageList: fileUploadPageList,\r\n confirmAgreementsPageIndex: confirmAgreementsPageIndex,\r\n confirmAgreementsPageList: confirmAgreementsPageList,\r\n acknowledgeAmendmentsPageIndexAU: acknowledgeAmendmentsPageIndexAU,\r\n acknowledgeAmendmentsPageListAU: acknowledgeAmendmentsPageListAU,\r\n acknowledgeAmendmentsPageIndexOS: acknowledgeAmendmentsPageIndexOS,\r\n acknowledgeAmendmentsPageListOS: acknowledgeAmendmentsPageListOS,\r\n acknowledgeUpdatedAgreementsPageIndex : acknowledgeUpdatedAgreementsPageIndex,\r\n acknowledgeUpdatedAgreementsPageList: acknowledgeUpdatedAgreementsPageList,\r\n agreementsAcceptancePageIndex : agreementsAcceptancePageIndex,\r\n agreementsAcceptancePageList: agreementsAcceptancePageList,\r\n questionnaire2PageList: questionnaire2PageList,\r\n questionnaire2PageIndex: questionnaire2PageIndex,\r\n questionnairePageList: questionnairePageList,\r\n questionnairePageIndex: questionnairePageIndex,\r\n}\r\n\r\nexport const referralTypes = [\r\n { name: \"Advertising\" },\r\n { name: \"Client\" },\r\n { name: \"Online\" },\r\n { name: \"Family/Friend\" },\r\n { name: \"Professional Referral\" },\r\n { name: \"Staff Referral\" },\r\n { name: \"Media\" },\r\n { name: \"Word of Mouth\" },\r\n { name: \"Other\" },\r\n];\r\n\r\nexport const salutationTypes = [\r\n { name: \"Dr\" },\r\n { name: \"Mr\" },\r\n { name: \"Miss\" },\r\n { name: \"Ms\" },\r\n { name: \"Mrs\" },\r\n { name: \"Other\" },\r\n];\r\n\r\nexport const relationshipTypes = [\r\n { name: \"Parent\" },\r\n { name: \"Family Member\" },\r\n { name: \"Spouse \" },\r\n { name: \"Other\" },\r\n];\r\n\r\nexport const acceptedFileUploadList = \"application/pdf,image/*,application/docx,text/plain,application/msword\";\r\n\r\nexport const yesNoOptions = [\r\n { label: \"Yes\", value: \"Yes\" },\r\n { label: \"No\", value: \"No\" },\r\n];","import { get } from \"svelte/store\";\r\nimport { projectSettings } from \"../config\";\r\nimport { model } from \"../stores\";\r\n\r\nwindow.gtm_var_disable_tealium = window.gtm_var_disable_tealium || false;\r\nwindow.gtm_var_web_visitor_id = window.gtm_var_web_visitor_id || false;\r\n\r\nfunction getCookie(name) {\r\n var value = \"; \" + document.cookie;\r\n var parts = value.split(\"; \" + name + \"=\");\r\n if (parts.length == 2) {\r\n return parts.pop().split(\";\").shift();\r\n }\r\n return null;\r\n}\r\n\r\nfunction userIdentifier(attempts) {\r\n attempts = attempts || 0;\r\n var maxAttempts = 20;\r\n\r\n try {\r\n\r\n // allow me to provide an override via GTM. \r\n var gtmIdOverride = window.gtm_var_web_visitor_id;\r\n if (window.gtm_var_web_visitor_id) {\r\n return window.gtm_var_web_visitor_id;\r\n }\r\n\r\n // get GA4 cookie.\r\n var ga4Cookie = getCookie('_ga');\r\n if (ga4Cookie) {\r\n // get the correct value from cookie:\r\n var uid = /.+\\.(\\d+\\.\\d+)$/gi.exec(ga4Cookie)[1];\r\n // add required prefix:\r\n var prefix = 'ga_c_id|' + uid;\r\n return prefix\r\n } else if (attempts < maxAttempts) {\r\n setTimeout(function () {\r\n userIdentifier(attempts + 1);\r\n }, 500);\r\n } else {\r\n window.dataLayer = window.dataLayer || [];\r\n window.dataLayer.push({\r\n event: 'ga4_id_capture_timeout'\r\n });\r\n }\r\n } catch (err) {\r\n window.dataLayer = window.dataLayer || [];\r\n window.dataLayer.push({\r\n event: 'ga4_id_capture_error'\r\n });\r\n }\r\n}\r\n\r\nexport const getTealiumID = () =>\r\n typeof window !== \"undefined\" &&\r\n typeof window.utag === \"object\" &&\r\n typeof window.utag.data === \"object\"\r\n ? window.utag.data.tealium_visitor_id\r\n : null;\r\n\r\nconst formatPhoneNumber = (phoneNumber) => {\r\n if (phoneNumber) {\r\n let formattedNumber = phoneNumber.replace(/\\s+/g, '');\r\n if (formattedNumber.startsWith('0')) {\r\n return formattedNumber.replace(/^0/, '+61');\r\n } else if (!formattedNumber.startsWith('+61')) {\r\n return '+61' + formattedNumber;\r\n }\r\n return formattedNumber;\r\n }\r\n return phoneNumber;\r\n};\r\n\r\n\r\nasync function hash(string) {\r\n const utf8 = new TextEncoder().encode(string);\r\n const hashBuffer = await crypto.subtle.digest('SHA-256', utf8);\r\n const hashArray = Array.from(new Uint8Array(hashBuffer));\r\n const hashHex = hashArray\r\n .map((bytes) => bytes.toString(16).padStart(2, '0'))\r\n .join('');\r\n return hashHex;\r\n}\r\n\r\nconst pushDataLayer = async (data) => {\r\n window.dataLayer = window.dataLayer || []\r\n if (data.tealium_event) {\r\n data.event = data.tealium_event\r\n delete data.tealium_event\r\n }\r\n window.dataLayer.push(data)\r\n}\r\n\r\n// Helper function that assists in asynchronously sending user data just in case\r\n// the user interacts with the page before the Tealium scripts load. Prevents data being dropped.\r\nconst resolveUtag = async () => {\r\n if (window?.utag) return window?.utag;\r\n\r\n await new Promise((resolve) => setTimeout(resolve, 200));\r\n if (window?.utag) return window?.utag;\r\n\r\n return { link: () => undefined, view: () => undefined };\r\n};\r\n\r\nconst utagLink = async (data) => {\r\n // If Tealium has been disabled, don't send any data.\r\n if (window.gtm_var_disable_tealium) return;\r\n\r\n let utag = await resolveUtag();\r\n utag.link(data);\r\n}\r\n\r\nconst registerFormStart = () => {\r\n const data = {\r\n \"class_action_name\": projectSettings.classActionName,\r\n \"page_url\": `${window.location.hostname}${window.location.pathname}`\r\n }\r\n const eventName = `class_action_form_start`\r\n\r\n pushDataLayer({\r\n ...data,\r\n event: eventName\r\n })\r\n utagLink({\r\n ...data,\r\n tealium_event: eventName\r\n });\r\n}\r\n\r\nconst getEmailDataPoints = async (emailAddress) => {\r\n let email = null;\r\n let emailHash = null;\r\n let emailHashGads = null;\r\n\r\n if (Array.isArray(emailAddress) && emailAddress.length > 0) {\r\n if (emailAddress[0] && emailAddress[0].EmailAddress) {\r\n email = emailAddress[0].EmailAddress;\r\n } else {\r\n email = emailAddress[0];\r\n }\r\n } else {\r\n email = emailAddress;\r\n }\r\n\r\n if (email) {\r\n emailHash = await hash(email.toLowerCase().trim());\r\n\r\n if (email.endsWith(\"@gmail.com\") ||\r\n email.endsWith(\"@googlemail.com\")) {\r\n let arr = email.toLowerCase().trim().split(\"@\")\r\n if (arr.length == 2) {\r\n let name = arr[0].replace(\".\", \"\");\r\n emailHashGads = await hash(`${name}@${arr[1]}`);\r\n }\r\n }\r\n }\r\n\r\n return { emailHash, emailHashGads };\r\n}\r\n\r\nconst getPhoneDataPoints = async (phoneNumber) => {\r\n if (Array.isArray(phoneNumber) && phoneNumber.length > 0) {\r\n if (phoneNumber[0] && phoneNumber[0].PhoneNumber) {\r\n return await hash(formatPhoneNumber(phoneNumber[0].PhoneNumber));\r\n }\r\n return await hash(formatPhoneNumber(phoneNumber[0]));\r\n } else {\r\n return await hash(formatPhoneNumber(phoneNumber));\r\n }\r\n}\r\n\r\nconst getAdditionalDataPoints = async (model, data) => {\r\n let emails = { emailHash: null, emailHashGads: null };\r\n let phoneHash = null;\r\n\r\n if (model.contact) {\r\n let phone = model.contact.phoneNumber || model.contact.phoneNumbers;\r\n emails = await getEmailDataPoints(model.contact.emailAddress || model.contact.emailAddresses, data);\r\n phoneHash = await getPhoneDataPoints(phone);\r\n } else if (model.Contact) {\r\n let phone = model.Contact.PhoneNumber || model.Contact.PhoneNumbers;\r\n emails = await getEmailDataPoints(model.Contact.EmailAddress || model.Contact.EmailAddresses, data);\r\n phoneHash = await getPhoneDataPoints(phone);\r\n }\r\n\r\n const registrationType = model.registrationType ||\r\n model.RegistrationType ||\r\n null;\r\n\r\n if (emails.emailHash) data.hashed_email = emails.emailHash;\r\n if (emails.emailHashGads) data.hashed_email_gads = emails.emailHashGads;\r\n if (phoneHash) data.hashed_phone = phoneHash;\r\n if (registrationType) data.class_action_behalf_of = registrationType;\r\n\r\n return data;\r\n}\r\n\r\nconst registerPageComplete = async (pageName) => {\r\n\r\n model.update(m => {\r\n if (window.gtm_var_disable_tealium) {\r\n let webVisitorId = window.gtm_var_web_visitor_id || userIdentifier();\r\n m.tealiumId = webVisitorId;\r\n } else {\r\n m.tealiumId = getTealiumID();\r\n }\r\n\r\n return m;\r\n });\r\n\r\n let data = {\r\n \"class_action_name\": projectSettings.classActionName,\r\n \"class_action_phase_name\": pageName,\r\n \"page_url\": `${window.location.hostname}${window.location.pathname}`\r\n }\r\n\r\n data = await getAdditionalDataPoints(get(model), data);\r\n\r\n const eventName = `class_action_form_phase_completed`\r\n\r\n pushDataLayer({\r\n ...data,\r\n event: eventName\r\n })\r\n\r\n utagLink({\r\n ...data,\r\n tealium_event: eventName\r\n });\r\n}\r\n\r\nconst registerSubmit = async (email, phone, registrationNumber) => {\r\n let data = {\r\n \"class_action_name\": projectSettings.classActionName,\r\n \"page_url\": `${window.location.hostname}${window.location.pathname}`,\r\n \"reference_number\": registrationNumber,\r\n };\r\n\r\n const formattedPhoneNumber = formatPhoneNumber(phone);\r\n const phoneHash = await hash(formattedPhoneNumber);\r\n data.hashed_phone = phoneHash;\r\n\r\n const emails = await getEmailDataPoints(email);\r\n if (emails.emailHash) data.hashed_email = emails.emailHash;\r\n if (emails.emailHashGads) data.hashed_email_gads = emails.emailHashGads;\r\n\r\n const eventName = `class_action_form_submit`;\r\n\r\n pushDataLayer({\r\n ...data,\r\n event: eventName\r\n });\r\n\r\n utagLink({\r\n ...data,\r\n \"tealium_event\": \"class_action_form_submit\"\r\n });\r\n}\r\n\r\nconst regFormPhone = async (phoneNumber) => {\r\n let formattedPhoneNumber = formatPhoneNumber(phoneNumber);\r\n\r\n var data = {\r\n click_text: \"Call \" + formattedPhoneNumber,\r\n click_url: \"tel:\" + formattedPhoneNumber,\r\n event_action: \"user_click\",\r\n tealium_event_type: \"link\",\r\n event: \"tel_link_click\"\r\n };\r\n\r\n pushDataLayer(data);\r\n}\r\n\r\nconst regFormEmail = async (emailAddress) => {\r\n var data = {\r\n click_text: emailAddress,\r\n click_url: \"mailto:\" + emailAddress,\r\n event_action: \"user_click\",\r\n tealium_event_type: \"link\",\r\n event: \"email_link_click\"\r\n };\r\n\r\n pushDataLayer(data);\r\n}\r\n\r\nexport { registerFormStart, registerPageComplete, registerSubmit, pushDataLayer, regFormEmail, regFormPhone };\r\n","\r\n\r\n\r\n \r\n\r\n","import { writable } from 'svelte/store';\r\n\r\nif (!Element.prototype.matches) {\r\n Element.prototype.matches = Element.prototype.msMatchesSelector ||\r\n Element.prototype.webkitMatchesSelector;\r\n}\r\n\r\nif (!Element.prototype.closest) {\r\n Element.prototype.closest = function (s) {\r\n var el = this;\r\n\r\n do {\r\n if (Element.prototype.matches.call(el, s)) return el;\r\n el = el.parentElement || el.parentNode;\r\n } while (el !== null && el.nodeType === 1);\r\n return null;\r\n };\r\n}\r\n\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n define([], (function () {\r\n return factory(root);\r\n }));\r\n } else if (typeof exports === 'object') {\r\n module.exports = factory(root);\r\n } else {\r\n root.Bouncer = factory(root);\r\n }\r\n})(typeof global !== 'undefined' ? global : window, (function (window) {\r\n 'use strict';\r\n\r\n //\r\n // Variables\r\n //\r\n\r\n var defaults = {\r\n\r\n // Classes & IDs\r\n\r\n fieldGroupClass: 'invalid',\r\n fieldClass: 'error',\r\n errorClass: 'error-message',\r\n fieldPrefix: 'bouncer-field_',\r\n errorPrefix: 'bouncer-error_',\r\n\r\n // Patterns\r\n patterns: {\r\n email: /^([^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+|\\x22([^\\x0d\\x22\\x5c\\x80-\\xff]|\\x5c[\\x00-\\x7f])*\\x22)(\\x2e([^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+|\\x22([^\\x0d\\x22\\x5c\\x80-\\xff]|\\x5c[\\x00-\\x7f])*\\x22))*\\x40([^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+|\\x5b([^\\x0d\\x5b-\\x5d\\x80-\\xff]|\\x5c[\\x00-\\x7f])*\\x5d)(\\x2e([^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+|\\x5b([^\\x0d\\x5b-\\x5d\\x80-\\xff]|\\x5c[\\x00-\\x7f])*\\x5d))*(\\.\\w{2,})+$/,\r\n url: /^(?:(?:https?|HTTPS?|ftp|FTP):\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-zA-Z\\u00a1-\\uffff0-9]-*)*[a-zA-Z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-zA-Z\\u00a1-\\uffff0-9]-*)*[a-zA-Z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-zA-Z\\u00a1-\\uffff]{2,}))\\.?)(?::\\d{2,5})?(?:[/?#]\\S*)?$/,\r\n number: /^(?:[-+]?[0-9]*[.,]?[0-9]+)$/,\r\n color: /^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/,\r\n date: /(?:19|20)[0-9]{2}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-9])|(?:(?!02)(?:0[1-9]|1[0-2])-(?:30))|(?:(?:0[13578]|1[02])-31))/,\r\n time: /^(?:(0[0-9]|1[0-9]|2[0-3])(:[0-5][0-9]))$/,\r\n month: /^(?:(?:19|20)[0-9]{2}-(?:(?:0[1-9]|1[0-2])))$/\r\n },\r\n\r\n // Custom Validations\r\n customValidations: {},\r\n\r\n // Messages\r\n messageAfterField: true,\r\n messageCustom: 'data-bouncer-message',\r\n messageTarget: 'data-bouncer-target',\r\n messages: {\r\n missingValue: {\r\n checkbox: 'This field is required.',\r\n radio: 'Please select a value.',\r\n select: 'Please select a value.',\r\n 'select-multiple': 'Please select at least one value.',\r\n default: 'Please fill out this field.'\r\n },\r\n patternMismatch: {\r\n email: 'Please enter a valid email address.',\r\n url: 'Please enter a URL.',\r\n number: 'Please enter a number',\r\n color: 'Please match the following format: #rrggbb',\r\n date: 'Please use the YYYY-MM-DD format',\r\n time: 'Please use the 24-hour time format. Ex. 23:00',\r\n month: 'Please use the YYYY-MM format',\r\n default: 'Please match the requested format.'\r\n },\r\n outOfRange: {\r\n over: 'Please select a value that is no more than {max}.',\r\n under: 'Please select a value that is no less than {min}.'\r\n },\r\n wrongLength: {\r\n over: 'Please shorten this text to no more than {maxLength} characters. You are currently using {length} characters.',\r\n under: 'Please lengthen this text to {minLength} characters or more. You are currently using {length} characters.'\r\n },\r\n fallback: 'There was an error with this field.'\r\n },\r\n\r\n // Form Submission\r\n disableSubmit: false,\r\n\r\n // Custom Events\r\n emitEvents: true\r\n\r\n };\r\n\r\n\r\n //\r\n // Methods\r\n //\r\n\r\n\t/**\r\n\t * A wrapper for Array.prototype.forEach() for non-arrays\r\n\t * @param {Array-like} arr The array-like object\r\n\t * @param {Function} callback The callback to run\r\n\t */\r\n var forEach = function (arr, callback) {\r\n Array.prototype.forEach.call(arr, callback);\r\n };\r\n\r\n\t/**\r\n\t * Merge two or more objects together.\r\n\t * @param {Object} objects The objects to merge together\r\n\t * @returns {Object} Merged values of defaults and options\r\n\t */\r\n var extend = function () {\r\n var merged = {};\r\n forEach(arguments, (function (obj) {\r\n for (var key in obj) {\r\n if (!obj.hasOwnProperty(key)) return;\r\n if (Object.prototype.toString.call(obj[key]) === '[object Object]') {\r\n merged[key] = extend(merged[key], obj[key]);\r\n } else {\r\n merged[key] = obj[key];\r\n }\r\n // merged[key] = obj[key];\r\n }\r\n }));\r\n return merged;\r\n };\r\n\r\n\t/**\r\n\t * Emit a custom event\r\n\t * @param {String} type The event type\r\n\t * @param {Object} options The settings object\r\n\t * @param {Node} anchor The anchor element\r\n\t * @param {Node} toggle The toggle element\r\n\t */\r\n var emitEvent = function (elem, type, details) {\r\n if (typeof window.CustomEvent !== 'function') return;\r\n var event = new CustomEvent(type, {\r\n bubbles: true,\r\n detail: details || {}\r\n });\r\n elem.dispatchEvent(event);\r\n };\r\n\r\n\t/**\r\n\t * Add the `novalidate` attribute to all forms\r\n\t * @param {Boolean} remove If true, remove the `novalidate` attribute\r\n\t */\r\n var addNoValidate = function (selector) {\r\n forEach(document.querySelectorAll(selector), (function (form) {\r\n form.setAttribute('novalidate', true);\r\n }));\r\n };\r\n\r\n\t/**\r\n\t * Remove the `novalidate` attribute to all forms\r\n\t */\r\n var removeNoValidate = function (selector) {\r\n forEach(document.querySelectorAll(selector), (function (form) {\r\n form.removeAttribute('novalidate');\r\n }));\r\n };\r\n\r\n\t/**\r\n\t * Check if a required field is missing its value\r\n\t * @param {Node} field The field to check\r\n\t * @return {Boolean} It true, field is missing it's value\r\n\t */\r\n var missingValue = function (field) {\r\n\r\n // If not required, bail\r\n if (!field.hasAttribute('required')) return false;\r\n\r\n // Handle checkboxes\r\n if (field.type === 'checkbox') {\r\n return !field.checked;\r\n }\r\n\r\n // Get the field value length\r\n var length = field.value.length;\r\n\r\n // Handle radio buttons\r\n if (field.type === 'radio') {\r\n length = Array.prototype.filter.call(field.form.querySelectorAll('[name=\"' + escapeCharacters(field.name) + '\"]'), (function (btn) {\r\n return btn.checked;\r\n })).length;\r\n }\r\n\r\n // Check for value\r\n return length < 1;\r\n\r\n };\r\n\r\n\t/**\r\n\t * Check if field value doesn't match a patter.\r\n\t * @param {Node} field The field to check\r\n\t * @param {Object} settings The plugin settings\r\n\t * @see https://www.w3.org/TR/html51/sec-forms.html#the-pattern-attribute\r\n\t * @return {Boolean} If true, there's a pattern mismatch\r\n\t */\r\n var patternMismatch = function (field, settings) {\r\n\r\n // Check if there's a pattern to match\r\n var pattern = field.getAttribute('pattern');\r\n pattern = pattern ? new RegExp('^(?:' + pattern + ')$') : settings.patterns[field.type];\r\n if (!pattern || !field.value || field.value.length < 1) return false;\r\n\r\n // Validate the pattern\r\n return field.value.match(pattern) ? false : true;\r\n\r\n };\r\n\r\n\t/**\r\n\t * Check if field value is out-of-range\r\n\t * @param {Node} field The field to check\r\n\t * @return {String} Returns 'over', 'under', or false\r\n\t */\r\n var outOfRange = function (field) {\r\n\r\n // Make sure field has value\r\n if (!field.value || field.value.length < 1) return false;\r\n\r\n // Check for range\r\n var max = field.getAttribute('max');\r\n var min = field.getAttribute('min');\r\n\r\n // Check validity\r\n var num = parseFloat(field.value);\r\n if (max && num > max) return 'over';\r\n if (min && num < min) return 'under';\r\n return false;\r\n\r\n };\r\n\r\n\t/**\r\n\t * Check if the field value is too long or too short\r\n\t * @param {Node} field The field to check\r\n\t * @return {String} Returns 'over', 'under', or false\r\n\t */\r\n var wrongLength = function (field) {\r\n\r\n // Make sure field has value\r\n if (!field.value || field.value.length < 1) return false;\r\n\r\n // Check for min/max length\r\n var max = field.getAttribute('maxlength');\r\n var min = field.getAttribute('minlength');\r\n\r\n // Check validity\r\n var length = field.value.length;\r\n if (max && length > max) return 'over';\r\n if (min && length < min) return 'under';\r\n return false;\r\n\r\n };\r\n\r\n\t/**\r\n\t * Test for standard field validations\r\n\t * @param {Node} field The field to test\r\n\t * @param {Object} settings The plugin settings\r\n\t * @return {Object} The tests and their results\r\n\t */\r\n var runValidations = function (field, settings) {\r\n return {\r\n missingValue: missingValue(field),\r\n patternMismatch: patternMismatch(field, settings),\r\n outOfRange: outOfRange(field),\r\n wrongLength: wrongLength(field)\r\n };\r\n };\r\n\r\n\t/**\r\n\t * Run any provided custom validations\r\n\t * @param {Node} field The field to test\r\n\t * @param {Object} errors The existing errors\r\n\t * @param {Object} validations The custom validations to run\r\n\t * @param {Object} settings The plugin settings\r\n\t * @return {Object} The tests and their results\r\n\t */\r\n var customValidations = function (field, errors, validations, settings) {\r\n for (var test in validations) {\r\n if (validations.hasOwnProperty(test) && (field.hasAttribute(test) || field.getAttribute(\"data-validator\") == test)) {\r\n errors[test] = validations[test](field, settings);\r\n }\r\n }\r\n return errors;\r\n };\r\n\r\n\t/**\r\n\t * Check if a field has any errors\r\n\t * @param {Object} errors The validation test results\r\n\t * @return {Boolean} Returns true if there are errors\r\n\t */\r\n var hasErrors = function (errors) {\r\n for (var type in errors) {\r\n if (errors[type]) return true;\r\n }\r\n return false;\r\n };\r\n\r\n\t/**\r\n\t * Check a field for errors\r\n\t * @param {Node} field The field to test\r\n\t * @param {Object} settings The plugin settings\r\n\t * @return {Object} The field validity and errors\r\n\t */\r\n var getErrors = function (field, settings) {\r\n\r\n // Get standard validation errors\r\n var errors = runValidations(field, settings);\r\n\r\n // Check for custom validations\r\n errors = customValidations(field, errors, settings.customValidations, settings);\r\n\r\n return {\r\n valid: !hasErrors(errors),\r\n errors: errors\r\n };\r\n\r\n };\r\n\r\n\t/**\r\n\t * Escape special characters for use with querySelector\r\n\t * @author Mathias Bynens\r\n\t * @link https://github.com/mathiasbynens/CSS.escape\r\n\t * @param {String} id The anchor ID to escape\r\n\t */\r\n var escapeCharacters = function (id) {\r\n\r\n var string = String(id);\r\n var length = string.length;\r\n var index = -1;\r\n var codeUnit;\r\n var result = '';\r\n var firstCodeUnit = string.charCodeAt(0);\r\n while (++index < length) {\r\n codeUnit = string.charCodeAt(index);\r\n // Note: there’s no need to special-case astral symbols, surrogate\r\n // pairs, or lone surrogates.\r\n\r\n // If the character is NULL (U+0000), then throw an\r\n // `InvalidCharacterError` exception and terminate these steps.\r\n if (codeUnit === 0x0000) {\r\n throw new InvalidCharacterError(\r\n 'Invalid character: the input contains U+0000.'\r\n );\r\n }\r\n\r\n if (\r\n // If the character is in the range [\\1-\\1F] (U+0001 to U+001F) or is\r\n // U+007F, […]\r\n (codeUnit >= 0x0001 && codeUnit <= 0x001F) || codeUnit == 0x007F ||\r\n // If the character is the first character and is in the range [0-9]\r\n // (U+0030 to U+0039), […]\r\n (index === 0 && codeUnit >= 0x0030 && codeUnit <= 0x0039) ||\r\n // If the character is the second character and is in the range [0-9]\r\n // (U+0030 to U+0039) and the first character is a `-` (U+002D), […]\r\n (\r\n index === 1 &&\r\n codeUnit >= 0x0030 && codeUnit <= 0x0039 &&\r\n firstCodeUnit === 0x002D\r\n )\r\n ) {\r\n // http://dev.w3.org/csswg/cssom/#escape-a-character-as-code-point\r\n result += '\\\\' + codeUnit.toString(16) + ' ';\r\n continue;\r\n }\r\n\r\n // If the character is not handled by one of the above rules and is\r\n // greater than or equal to U+0080, is `-` (U+002D) or `_` (U+005F), or\r\n // is in one of the ranges [0-9] (U+0030 to U+0039), [A-Z] (U+0041 to\r\n // U+005A), or [a-z] (U+0061 to U+007A), […]\r\n if (\r\n codeUnit >= 0x0080 ||\r\n codeUnit === 0x002D ||\r\n codeUnit === 0x005F ||\r\n codeUnit >= 0x0030 && codeUnit <= 0x0039 ||\r\n codeUnit >= 0x0041 && codeUnit <= 0x005A ||\r\n codeUnit >= 0x0061 && codeUnit <= 0x007A\r\n ) {\r\n // the character itself\r\n result += string.charAt(index);\r\n continue;\r\n }\r\n\r\n // Otherwise, the escaped character.\r\n // http://dev.w3.org/csswg/cssom/#escape-a-character\r\n result += '\\\\' + string.charAt(index);\r\n\r\n }\r\n\r\n // Return sanitized hash\r\n return result;\r\n\r\n };\r\n\r\n\t/**\r\n\t * Get or create an ID for a field\r\n\t * @param {Node} field The field\r\n\t * @param {Object} settings The plugin settings\r\n\t * @param {Boolean} create If true, create an ID if there isn't one\r\n\t * @return {String} The field ID\r\n\t */\r\n var getFieldID = function (field, settings, create) {\r\n var id = field.name ? field.name : field.id;\r\n if (!id && create) {\r\n id = settings.fieldPrefix + Math.floor(Math.random() * 999);\r\n field.id = id;\r\n }\r\n // if (field.type === 'checkbox') {\r\n // id += '_' + (field.value || field.id);\r\n // }\r\n return id;\r\n };\r\n\r\n\t/**\r\n\t * Special handling for radio buttons and checkboxes wrapped in labels.\r\n\t * @param {Node} field The field with the error\r\n\t * @return {Node} The field to show the error on\r\n\t */\r\n var getErrorField = function (field) {\r\n\r\n // If the field is a radio button, get the last item in the radio group\r\n // @todo if location is before, get first item\r\n if ((field.type === 'radio' || field.type === 'checkbox') && field.name) {\r\n var group = field.form.querySelectorAll('[name=\"' + escapeCharacters(field.name) + '\"]');\r\n field = group[group.length - 1];\r\n }\r\n\r\n // Get the associated label for radio button or checkbox\r\n if (field.type === 'radio' || field.type === 'checkbox') {\r\n var label = field.closest('label') || field.form.querySelector('[for=\"' + field.id + '\"]');\r\n field = label || field;\r\n }\r\n\r\n return field;\r\n\r\n };\r\n\r\n\t/**\r\n\t * Get the location for a field's error message\r\n\t * @param {Node} field The field\r\n\t * @param {Node} target The target for error message\r\n\t * @param {Object} settings The plugin settings\r\n\t * @return {Node} The error location\r\n\t */\r\n var getErrorLocation = function (field, target, settings) {\r\n\r\n // Check for a custom error message\r\n var selector = field.getAttribute(settings.messageTarget);\r\n if (selector) {\r\n //var location = field.form.querySelector(selector);\r\n var location = field.parentElement.querySelector(selector);\r\n if (location) {\r\n // @bugfix by @HaroldPutman\r\n // https://github.com/cferdinandi/bouncer/pull/28\r\n return location.firstChild || location.appendChild(document.createTextNode(''));\r\n }\r\n // Try an extra parent element\r\n if (field.parentElement.parentElement) {\r\n location = field.parentElement.parentElement.querySelector(selector);\r\n if (location) {\r\n // @bugfix by @HaroldPutman\r\n // https://github.com/cferdinandi/bouncer/pull/28\r\n return location.firstChild || location.appendChild(document.createTextNode(''));\r\n }\r\n }\r\n }\r\n\r\n // If the message should come after the field\r\n if (settings.messageAfterField) {\r\n return target.nextSibling;\r\n }\r\n\r\n // If it should come before\r\n return target;\r\n\r\n };\r\n\r\n /**\r\n * Create a validation error message node\r\n * @param {Node} field The field\r\n * @param {Object} settings The plugin settings\r\n * @return {Node} The error message node\r\n */\r\n var createError = function (field, settings) {\r\n\r\n // Create the error message\r\n var error = document.createElement('div');\r\n error.className = settings.errorClass;\r\n error.id = settings.errorPrefix + getFieldID(field, settings, true);\r\n\r\n // If the field is a radio button or checkbox, grab the last field label\r\n var fieldTarget = getErrorField(field);\r\n\r\n // Inject the error message into the DOM\r\n var location = getErrorLocation(field, fieldTarget, settings);\r\n\r\n if (location) {\r\n location.parentNode.insertBefore(error, location);\r\n } else {\r\n fieldTarget.insertAdjacentElement('afterEnd', error);\r\n }\r\n\r\n return error;\r\n\r\n };\r\n\r\n /**\r\n * Get the error message test\r\n * @param {Node} field The field to get an error message for\r\n * @param {Object} errors The errors on the field\r\n * @param {Object} settings The plugin settings\r\n * @return {String|Function} The error message\r\n */\r\n var getErrorMessage = function (field, errors, settings) {\r\n\r\n // Variables\r\n var messages = settings.messages;\r\n\r\n // Missing value error\r\n if (errors.missingValue) {\r\n return messages.missingValue[field.type] || messages.missingValue.default;\r\n }\r\n\r\n // Numbers that are out of range\r\n if (errors.outOfRange) {\r\n return messages.outOfRange[errors.outOfRange].replace('{max}', field.getAttribute('max')).replace('{min}', field.getAttribute('min')).replace('{length}', field.value.length);\r\n }\r\n\r\n // Values that are too long or short\r\n if (errors.wrongLength) {\r\n return messages.wrongLength[errors.wrongLength].replace('{maxLength}', field.getAttribute('maxlength')).replace('{minLength}', field.getAttribute('minlength')).replace('{length}', field.value.length);\r\n }\r\n\r\n // Pattern mismatch error\r\n if (errors.patternMismatch) {\r\n var custom = field.getAttribute(settings.messageCustom);\r\n if (custom) return custom;\r\n return messages.patternMismatch[field.type] || messages.patternMismatch.default;\r\n }\r\n\r\n // Custom validations\r\n for (var test in settings.customValidations) {\r\n if (settings.customValidations.hasOwnProperty(test)) {\r\n if (errors[test] && messages[test]) return messages[test];\r\n var custom = field.getAttribute(settings.messageCustom);\r\n if (custom) return custom;\r\n }\r\n }\r\n\r\n // Fallback error message\r\n return messages.fallback;\r\n\r\n };\r\n\r\n /**\r\n * Add error attributes to a field\r\n * @param {Node} field The field with the error message\r\n * @param {Node} error The error message\r\n * @param {Object} settings The plugin settings\r\n */\r\n var addErrorAttributes = function (field, error, settings) {\r\n field.classList.add(settings.fieldClass);\r\n if (field.parentNode && field.parentNode.classList) {\r\n field.parentNode.classList.add(settings.fieldGroupClass);\r\n }\r\n field.setAttribute('aria-describedby', error.id);\r\n field.setAttribute('aria-invalid', true);\r\n };\r\n\r\n /**\r\n * Show error attributes on a field or radio/checkbox group\r\n * @param {Node} field The field with the error message\r\n * @param {Node} error The error message\r\n * @param {Object} settings The plugin settings\r\n */\r\n var showErrorAttributes = function (field, error, settings) {\r\n\r\n // If field is a radio button, add attributes to every button in the group\r\n if ((field.type === 'radio' || field.type === 'checkbox') && field.name) {\r\n Array.prototype.forEach.call(document.querySelectorAll('[name=\"' + field.name + '\"]'), (function (button) {\r\n addErrorAttributes(button, error, settings);\r\n }));\r\n }\r\n\r\n // Otherwise, add an error class and aria attribute to the field\r\n addErrorAttributes(field, error, settings);\r\n\r\n };\r\n\r\n /**\r\n * Show an error message in the DOM\r\n * @param {Node} field The field to show an error message for\r\n * @param {Object} errors The errors on the field\r\n * @param {Object} settings The plugin settings\r\n */\r\n var showError = function (field, errors, settings) {\r\n\r\n // Get/create an error message\r\n var error = field.form.querySelector('#' + escapeCharacters(settings.errorPrefix + getFieldID(field, settings))) || createError(field, settings);\r\n var msg = getErrorMessage(field, errors, settings);\r\n error.textContent = typeof msg === 'function' ? msg(field, settings) : msg;\r\n\r\n // Add error attributes\r\n showErrorAttributes(field, error, settings);\r\n\r\n // Emit custom event\r\n if (settings.emitEvents) {\r\n emitEvent(field, 'bouncerShowError', {\r\n errors: errors\r\n });\r\n }\r\n\r\n };\r\n\r\n /**\r\n * Remove error attributes from a field\r\n * @param {Node} field The field with the error message\r\n * @param {Node} error The error message\r\n * @param {Object} settings The plugin settings\r\n */\r\n var removeAttributes = function (field, settings) {\r\n field.classList.remove(settings.fieldClass);\r\n if (field.parentNode && field.parentNode.classList) {\r\n field.parentNode.classList.remove(settings.fieldGroupClass);\r\n }\r\n field.removeAttribute('aria-describedby');\r\n field.removeAttribute('aria-invalid');\r\n };\r\n\r\n /**\r\n * Remove error attributes from the field or radio group\r\n * @param {Node} field The field with the error message\r\n * @param {Node} error The error message\r\n * @param {Object} settings The plugin settings\r\n */\r\n var removeErrorAttributes = function (field, settings) {\r\n\r\n // If field is a radio button, remove attributes from every button in the group\r\n if ((field.type === 'radio' || field.type === 'checkbox') && field.name) {\r\n Array.prototype.forEach.call(document.querySelectorAll('[name=\"' + field.name + '\"]'), (function (button) {\r\n removeAttributes(button, settings);\r\n }));\r\n return;\r\n }\r\n\r\n // Otherwise, add an error class and aria attribute to the field\r\n removeAttributes(field, settings);\r\n\r\n };\r\n\r\n /**\r\n * Remove an error message from the DOM\r\n * @param {Node} field The field with the error message\r\n * @param {Object} settings The plugin settings\r\n */\r\n var removeError = function (field, settings) {\r\n\r\n // Get the error message for this field\r\n var error = field.form.querySelector('#' + escapeCharacters(settings.errorPrefix + getFieldID(field, settings)));\r\n if (!error) return;\r\n\r\n // Remove the error\r\n error.parentNode.removeChild(error);\r\n\r\n // Remove error and a11y from the field\r\n removeErrorAttributes(field, settings);\r\n\r\n // Emit custom event\r\n if (settings.emitEvents) {\r\n emitEvent(field, 'bouncerRemoveError');\r\n }\r\n\r\n };\r\n\r\n /**\r\n * Remove errors from all fields\r\n * @param {String} selector The selector for the form\r\n * @param {Object} settings The plugin settings\r\n */\r\n var removeAllErrors = function (selector, settings) {\r\n forEach(document.querySelectorAll(selector), (function (form) {\r\n formEach(form.querySelectorAll('input, select, textarea'), (function (field) {\r\n removeError(field, settings);\r\n }));\r\n }));\r\n };\r\n\r\n /**\r\n * The plugin constructor\r\n * @param {String} selector The selector to use for forms to be validated\r\n * @param {Object} options User settings [optional]\r\n */\r\n var Constructor = function (selector, options) {\r\n\r\n //\r\n // Variables\r\n //\r\n\r\n var publicAPIs = {};\r\n var settings;\r\n\r\n\r\n //\r\n // Methods\r\n //\r\n\r\n /**\r\n * Validate a field\r\n * @param {Node} field The field to validate\r\n * @param {Object} options Validation options\r\n * @return {Object} The validity state and errors\r\n */\r\n publicAPIs.validate = function (field, options) {\r\n\r\n // Don't validate submits, buttons, file and reset inputs, and disabled and readonly fields\r\n if (field.disabled || field.readOnly || field.type === 'reset' || field.type === 'submit' || field.type === 'button') return;\r\n\r\n // Local settings\r\n var _settings = extend(settings, options || {});\r\n\r\n // Check for errors\r\n var isValid = getErrors(field, _settings);\r\n\r\n // If valid, remove any error messages\r\n if (isValid.valid) {\r\n removeError(field, _settings);\r\n return;\r\n }\r\n\r\n // Otherwise, show an error message\r\n showError(field, isValid.errors, _settings);\r\n\r\n return isValid;\r\n\r\n };\r\n\r\n /**\r\n * Validate all fields in a form or section\r\n * @param {Node} target The form or section to validate fields in\r\n * @return {Array} An array of fields with errors\r\n */\r\n publicAPIs.validateAll = function (target) {\r\n return Array.prototype.filter.call(target.querySelectorAll('input, select, textarea'), (function (field) {\r\n var validate = publicAPIs.validate(field);\r\n return validate && !validate.valid;\r\n }));\r\n };\r\n\r\n publicAPIs.clearVisualError = function (field, options) {\r\n\r\n // Don't validate submits, buttons, file and reset inputs, and disabled and readonly fields\r\n if (field.disabled || field.readOnly || field.type === 'reset' || field.type === 'submit' || field.type === 'button') return;\r\n\r\n // Local settings\r\n var _settings = extend(settings, options || {});\r\n\r\n removeError(field, _settings);\r\n return;\r\n };\r\n\r\n publicAPIs.clearAllVisualError = function (target) {\r\n console.log(target.querySelectorAll('input, select, textarea'))\r\n return Array.prototype.filter.call(target.querySelectorAll('input, select, textarea'), (function (field) {\r\n publicAPIs.clearVisualError(field);\r\n return;\r\n }));\r\n };\r\n\r\n /**\r\n * Run a validation on field blur\r\n */\r\n var changeHandler = function (event) {\r\n\r\n // Only run if the field is in a form to be validated\r\n if (!event.target.form || !event.target.form.matches(selector)) return;\r\n\r\n // Validate the field\r\n publicAPIs.validate(event.target);\r\n\r\n };\r\n\r\n /**\r\n * Run a validation on a fields with errors when the value changes\r\n */\r\n var inputHandler = function (event) {\r\n\r\n // Only run if the field is in a form to be validated\r\n if (!event.target.form || !event.target.form.matches(selector)) return;\r\n\r\n // Only run on fields with errors\r\n if (!event.target.classList.contains(settings.fieldClass)) return;\r\n\r\n // Validate the field\r\n publicAPIs.validate(event.target);\r\n\r\n };\r\n\r\n /**\r\n * Validate an entire form when it's submitted\r\n */\r\n var submitHandler = function (event) {\r\n\r\n // Only run on matching elements\r\n if (!event.target.matches(selector)) return;\r\n\r\n // Prevent form submission\r\n event.preventDefault();\r\n\r\n // Validate each field\r\n var errors = publicAPIs.validateAll(event.target);\r\n\r\n // If there are errors, focus on the first one\r\n if (errors.length > 0) {\r\n errors[0].focus();\r\n emitEvent(event.target, 'bouncerFormInvalid', { errors: errors });\r\n return;\r\n }\r\n\r\n // Otherwise, submit if not disabled\r\n if (!settings.disableSubmit) {\r\n event.target.submit();\r\n }\r\n\r\n // Emit custom event\r\n if (settings.emitEvents) {\r\n emitEvent(event.target, 'bouncerFormValid');\r\n }\r\n\r\n };\r\n\r\n /**\r\n * Destroy the current plugin instantiation\r\n */\r\n publicAPIs.destroy = function () {\r\n\r\n // Remove event listeners\r\n document.removeEventListener('change', changeHandler, true);\r\n document.removeEventListener('input', inputHandler, false);\r\n document.removeEventListener('click', inputHandler, false);\r\n document.removeEventListener('submit', submitHandler, false);\r\n\r\n // Remove all errors\r\n removeAllErrors(selector, settings);\r\n\r\n // Remove novalidate attribute\r\n removeNoValidate(selector);\r\n\r\n // Emit custom event\r\n if (settings.emitEvents) {\r\n emitEvent(document, 'bouncerDestroyed', {\r\n settings: settings\r\n });\r\n }\r\n\r\n // Reset settings\r\n settings = null;\r\n\r\n };\r\n\r\n /**\r\n * Instantiate a new instance of the plugin\r\n */\r\n var init = function () {\r\n\r\n // Create settings\r\n settings = extend(defaults, options || {});\r\n\r\n // Add novalidate attribute\r\n addNoValidate(selector);\r\n\r\n // Event Listeners\r\n document.addEventListener('change', changeHandler, true);\r\n document.addEventListener('input', inputHandler, false);\r\n document.addEventListener('click', inputHandler, false);\r\n document.addEventListener('submit', submitHandler, false);\r\n\r\n // Emit custom event\r\n if (settings.emitEvents) {\r\n emitEvent(document, 'bouncerInitialized', {\r\n settings: settings\r\n });\r\n }\r\n\r\n };\r\n\r\n //\r\n // Inits & Event Listeners\r\n //\r\n\r\n init();\r\n return publicAPIs;\r\n\r\n };\r\n\r\n\r\n //\r\n // Return the constructor\r\n //\r\n\r\n return Constructor;\r\n\r\n}));\r\n\r\nexport const validate = function (rules, messages) {\r\n if (rules && messages) {\r\n return new Bouncer('form', {\r\n customValidations: rules,\r\n messages: messages\r\n })\r\n } else {\r\n return new Bouncer('form')\r\n }\r\n}\r\n\r\nconst appValidator = validate({\r\n currency: function (element) {\r\n // Return false because there is NO error\r\n var value = element.value.trim()\r\n if (value === '') return false;\r\n\r\n var regex = /^\\d*\\.?\\d*$/;\r\n if (regex.test(value)) return false;\r\n\r\n // Return true when there is\r\n return true;\r\n },\r\n phone: function (element) {\r\n // Return false because there is NO error\r\n var value = element.value.trim()\r\n if (value === '') return false;\r\n\r\n var regex = /^[+]*[(]{0,1}[0-9]{1,4}[)]{0,1}[\\s/0-9]{9,12}$/;\r\n if (regex.test(value)) return false;\r\n\r\n // Return true when there is\r\n return true;\r\n },\r\n autocompleteaddress: function (element) {\r\n var siblings = element.parentElement.childNodes;\r\n\r\n var value = '';\r\n siblings.forEach(function (node) {\r\n if (node.classList && node.classList.contains(\"validator-address\")) {\r\n value = node.value;\r\n }\r\n });\r\n\r\n // Return true when there is\r\n return value === '';\r\n },\r\n loandate: function (element) {\r\n var value = element.value.trim()\r\n if (value === '') return false;\r\n \r\n let arr = value.split('/');\r\n\r\n if (arr.length != 3) return true;\r\n let day = arr[0];\r\n let month = arr[1];\r\n let year = arr[2];\r\n let loanDate = new Date(year, month - 1, day);\r\n \r\n if (loanDate < new Date(2014, 6, 8) || loanDate > new Date(2018, 10, 1)) return true;\r\n\r\n // Return true when there is\r\n return false;\r\n },\r\n requireValue: function (element) {\r\n let requiredValue = element.getAttribute(\"data-validator-value\")\r\n if (requiredValue === null) {\r\n return false;\r\n }\r\n\r\n if (element.type === 'radio') {\r\n let radios = document.getElementsByName(element.name);\r\n\r\n for (var i = 0; i < radios.length; i++) {\r\n if (radios[i].checked) {\r\n return radios[i].value != requiredValue;\r\n }\r\n }\r\n\r\n return false;\r\n }\r\n\r\n var value = element.value.trim()\r\n\r\n if (value === requiredValue && element.checked) {\r\n return false;\r\n }\r\n\r\n return true;\r\n },\r\n checkboxRequired: function (element) {\r\n let requiredValue = element.getAttribute(\"data-validator-value\");\r\n if (requiredValue === null) {\r\n return false;\r\n }\r\n\r\n let selector = element.getAttribute(\"data-bouncer-target\");\r\n let errorElement;\r\n if (selector) {\r\n var location = element.parentElement.querySelector(selector);\r\n if (location) {\r\n errorElement = location;\r\n }\r\n // Try an extra parent element\r\n if (element.parentElement.parentElement) {\r\n location = element.parentElement.parentElement.querySelector(selector);\r\n if (location) {\r\n errorElement = location;\r\n }\r\n }\r\n\r\n if (errorElement) {\r\n let errorMessage = errorElement.querySelector(\".error-message\");\r\n errorMessage && errorElement.removeChild(errorMessage);\r\n }\r\n }\r\n\r\n if (element.type === 'checkbox') {\r\n let checkedCount = 0;\r\n let checkboxes = document.getElementsByName(element.name);\r\n\r\n for (var i = 0; i < checkboxes.length; i++) {\r\n // If valid, remove any error messages\r\n checkboxes[i].classList.remove(\"error\");\r\n\r\n if (checkboxes[i].checked) {\r\n checkedCount++;\r\n if (checkedCount == requiredValue) {\r\n return false;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return true;\r\n },\r\n},\r\n {\r\n phone: 'Please fill in a valid phone number.',\r\n currency: 'Please fill in a valid cash value.',\r\n loandate: 'The loan date needs to be between 8 July 2014 and 1 November 2018.',\r\n requireYes: '',\r\n });\r\n\r\n\r\nexport const validator = writable(appValidator);\r\n","\r\n\r\n{#if showPrevious != 'false' }\r\n\r\n{/if}\r\n\r\n{#if showNext != 'false' }\r\n\r\n{/if}\r\n\r\n\r\n","\r\n\r\n\r\n
\r\n
\r\n
Register for the {projectSettings.classActionName}
\r\n
\r\n
\r\n
\r\n
\r\n \r\n\r\n
\r\n You are able to register for the Ruby Princess Coronavirus Class Action if: \r\n
\r\n\t\t\t\t\t
You were one of the passengers on the Ruby Princess that departed Circular Quay on 8 March 2020 (regardless of whether or not you contracted coronavirus).
\r\n
You are an executor, administrator or personal representative of the estate of a passenger who contracted coronavirus on the cruise and subsequently passed away.
\r\n
You are a family member or loved one of an ill or deceased passenger who has suffered a psychiatric injury (such as PTSD or nervous shock) as a result of their loved one's contracting the virus on the cruise
\r\n
\r\n
\r\n To register on a confidential, no-cost, no-obligation basis, please click on the button below and fill out the registration form.\r\n
\r\n
\r\n
\r\n
\r\n
\r\n registerFormStart()}>\r\n >\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n If you require support completing your registration or you are unsure whether you can participate in the class action, please contact Shine Lawyers on\r\n {projectSettings.phoneNumber} or via email \r\n {projectSettings.emailAddress}.\r\n
\r\n
\r\n
\r\n\r\n\r\n","(function() {\n function getBytes() {\n try {\n // Modern Browser\n return Array.from(\n (window.crypto || window.msCrypto).getRandomValues(new Uint8Array(16))\n );\n } catch (error) {\n // Legacy Browser, fallback to Math.random\n var ret = [];\n while (ret.length < 16) ret.push((Math.random() * 256) & 0xff);\n return ret;\n }\n }\n\n function m(v) {\n v = v.toString(16);\n if (v.length < 2) v = \"0\" + v;\n return v;\n }\n\n function genUUID() {\n var rnd = getBytes();\n rnd[6] = (rnd[6] & 0x0f) | 0x40;\n rnd[8] = (rnd[8] & 0x3f) | 0x80;\n rnd = rnd\n .map(m)\n .join(\"\")\n .match(/(.{8})(.{4})(.{4})(.{4})(.{12})/);\n rnd.shift();\n return rnd.join(\"-\");\n }\n\n var uuidPattern = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;\n function isUUID(uuid) {\n return uuidPattern.test(uuid);\n }\n\n genUUID.valid = isUUID;\n\n // global\n if (window) {\n window.uuid4 = genUUID;\n }\n\n // Node-style CJS\n if (typeof module !== \"undefined\" && module.exports) {\n module.exports = genUUID;\n }\n\n // AMD - legacy\n if (typeof define === \"function\" && define.amd) {\n define([], function() {\n return genUUID;\n });\n }\n})();\n","\r\n\r\n","\r\n\r\n\r\n\r\n
');\n this.element.appendChild(messageElement);\n }\n\n var span = messageElement.getElementsByTagName(\"span\")[0];\n\n if (span) {\n if (span.textContent != null) {\n span.textContent = this.options.dictFallbackMessage;\n } else if (span.innerText != null) {\n span.innerText = this.options.dictFallbackMessage;\n }\n }\n\n return this.element.appendChild(this.getFallbackForm());\n },\n\n /**\n * Gets called to calculate the thumbnail dimensions.\n *\n * It gets `file`, `width` and `height` (both may be `null`) as parameters and must return an object containing:\n *\n * - `srcWidth` & `srcHeight` (required)\n * - `trgWidth` & `trgHeight` (required)\n * - `srcX` & `srcY` (optional, default `0`)\n * - `trgX` & `trgY` (optional, default `0`)\n *\n * Those values are going to be used by `ctx.drawImage()`.\n */\n resize: function resize(file, width, height, resizeMethod) {\n var info = {\n srcX: 0,\n srcY: 0,\n srcWidth: file.width,\n srcHeight: file.height\n };\n var srcRatio = file.width / file.height; // Automatically calculate dimensions if not specified\n\n if (width == null && height == null) {\n width = info.srcWidth;\n height = info.srcHeight;\n } else if (width == null) {\n width = height * srcRatio;\n } else if (height == null) {\n height = width / srcRatio;\n } // Make sure images aren't upscaled\n\n\n width = Math.min(width, info.srcWidth);\n height = Math.min(height, info.srcHeight);\n var trgRatio = width / height;\n\n if (info.srcWidth > width || info.srcHeight > height) {\n // Image is bigger and needs rescaling\n if (resizeMethod === \"crop\") {\n if (srcRatio > trgRatio) {\n info.srcHeight = file.height;\n info.srcWidth = info.srcHeight * trgRatio;\n } else {\n info.srcWidth = file.width;\n info.srcHeight = info.srcWidth / trgRatio;\n }\n } else if (resizeMethod === \"contain\") {\n // Method 'contain'\n if (srcRatio > trgRatio) {\n height = width / srcRatio;\n } else {\n width = height * srcRatio;\n }\n } else {\n throw new Error(\"Unknown resizeMethod '\".concat(resizeMethod, \"'\"));\n }\n }\n\n info.srcX = (file.width - info.srcWidth) / 2;\n info.srcY = (file.height - info.srcHeight) / 2;\n info.trgWidth = width;\n info.trgHeight = height;\n return info;\n },\n\n /**\n * Can be used to transform the file (for example, resize an image if necessary).\n *\n * The default implementation uses `resizeWidth` and `resizeHeight` (if provided) and resizes\n * images according to those dimensions.\n *\n * Gets the `file` as the first parameter, and a `done()` function as the second, that needs\n * to be invoked with the file when the transformation is done.\n */\n transformFile: function transformFile(file, done) {\n if ((this.options.resizeWidth || this.options.resizeHeight) && file.type.match(/image.*/)) {\n return this.resizeImage(file, this.options.resizeWidth, this.options.resizeHeight, this.options.resizeMethod, done);\n } else {\n return done(file);\n }\n },\n\n /**\n * A string that contains the template used for each dropped\n * file. Change it to fulfill your needs but make sure to properly\n * provide all elements.\n *\n * If you want to use an actual HTML element instead of providing a String\n * as a config option, you could create a div with the id `tpl`,\n * put the template inside it and provide the element like this:\n *\n * document\n * .querySelector('#tpl')\n * .innerHTML\n *\n */\n previewTemplate: preview_template,\n\n /*\n Those functions register themselves to the events on init and handle all\n the user interface specific stuff. Overwriting them won't break the upload\n but can break the way it's displayed.\n You can overwrite them if you don't like the default behavior. If you just\n want to add an additional event handler, register it on the dropzone object\n and don't overwrite those options.\n */\n // Those are self explanatory and simply concern the DragnDrop.\n drop: function drop(e) {\n return this.element.classList.remove(\"dz-drag-hover\");\n },\n dragstart: function dragstart(e) {},\n dragend: function dragend(e) {\n return this.element.classList.remove(\"dz-drag-hover\");\n },\n dragenter: function dragenter(e) {\n return this.element.classList.add(\"dz-drag-hover\");\n },\n dragover: function dragover(e) {\n return this.element.classList.add(\"dz-drag-hover\");\n },\n dragleave: function dragleave(e) {\n return this.element.classList.remove(\"dz-drag-hover\");\n },\n paste: function paste(e) {},\n // Called whenever there are no files left in the dropzone anymore, and the\n // dropzone should be displayed as if in the initial state.\n reset: function reset() {\n return this.element.classList.remove(\"dz-started\");\n },\n // Called when a file is added to the queue\n // Receives `file`\n addedfile: function addedfile(file) {\n var _this = this;\n\n if (this.element === this.previewsContainer) {\n this.element.classList.add(\"dz-started\");\n }\n\n if (this.previewsContainer && !this.options.disablePreviews) {\n file.previewElement = Dropzone.createElement(this.options.previewTemplate.trim());\n file.previewTemplate = file.previewElement; // Backwards compatibility\n\n this.previewsContainer.appendChild(file.previewElement);\n\n var _iterator2 = options_createForOfIteratorHelper(file.previewElement.querySelectorAll(\"[data-dz-name]\"), true),\n _step2;\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var node = _step2.value;\n node.textContent = file.name;\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n\n var _iterator3 = options_createForOfIteratorHelper(file.previewElement.querySelectorAll(\"[data-dz-size]\"), true),\n _step3;\n\n try {\n for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n node = _step3.value;\n node.innerHTML = this.filesize(file.size);\n }\n } catch (err) {\n _iterator3.e(err);\n } finally {\n _iterator3.f();\n }\n\n if (this.options.addRemoveLinks) {\n file._removeLink = Dropzone.createElement(\"\".concat(this.options.dictRemoveFile, \"\"));\n file.previewElement.appendChild(file._removeLink);\n }\n\n var removeFileEvent = function removeFileEvent(e) {\n e.preventDefault();\n e.stopPropagation();\n\n if (file.status === Dropzone.UPLOADING) {\n return Dropzone.confirm(_this.options.dictCancelUploadConfirmation, function () {\n return _this.removeFile(file);\n });\n } else {\n if (_this.options.dictRemoveFileConfirmation) {\n return Dropzone.confirm(_this.options.dictRemoveFileConfirmation, function () {\n return _this.removeFile(file);\n });\n } else {\n return _this.removeFile(file);\n }\n }\n };\n\n var _iterator4 = options_createForOfIteratorHelper(file.previewElement.querySelectorAll(\"[data-dz-remove]\"), true),\n _step4;\n\n try {\n for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {\n var removeLink = _step4.value;\n removeLink.addEventListener(\"click\", removeFileEvent);\n }\n } catch (err) {\n _iterator4.e(err);\n } finally {\n _iterator4.f();\n }\n }\n },\n // Called whenever a file is removed.\n removedfile: function removedfile(file) {\n if (file.previewElement != null && file.previewElement.parentNode != null) {\n file.previewElement.parentNode.removeChild(file.previewElement);\n }\n\n return this._updateMaxFilesReachedClass();\n },\n // Called when a thumbnail has been generated\n // Receives `file` and `dataUrl`\n thumbnail: function thumbnail(file, dataUrl) {\n if (file.previewElement) {\n file.previewElement.classList.remove(\"dz-file-preview\");\n\n var _iterator5 = options_createForOfIteratorHelper(file.previewElement.querySelectorAll(\"[data-dz-thumbnail]\"), true),\n _step5;\n\n try {\n for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {\n var thumbnailElement = _step5.value;\n thumbnailElement.alt = file.name;\n thumbnailElement.src = dataUrl;\n }\n } catch (err) {\n _iterator5.e(err);\n } finally {\n _iterator5.f();\n }\n\n return setTimeout(function () {\n return file.previewElement.classList.add(\"dz-image-preview\");\n }, 1);\n }\n },\n // Called whenever an error occurs\n // Receives `file` and `message`\n error: function error(file, message) {\n if (file.previewElement) {\n file.previewElement.classList.add(\"dz-error\");\n\n if (typeof message !== \"string\" && message.error) {\n message = message.error;\n }\n\n var _iterator6 = options_createForOfIteratorHelper(file.previewElement.querySelectorAll(\"[data-dz-errormessage]\"), true),\n _step6;\n\n try {\n for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {\n var node = _step6.value;\n node.textContent = message;\n }\n } catch (err) {\n _iterator6.e(err);\n } finally {\n _iterator6.f();\n }\n }\n },\n errormultiple: function errormultiple() {},\n // Called when a file gets processed. Since there is a cue, not all added\n // files are processed immediately.\n // Receives `file`\n processing: function processing(file) {\n if (file.previewElement) {\n file.previewElement.classList.add(\"dz-processing\");\n\n if (file._removeLink) {\n return file._removeLink.innerHTML = this.options.dictCancelUpload;\n }\n }\n },\n processingmultiple: function processingmultiple() {},\n // Called whenever the upload progress gets updated.\n // Receives `file`, `progress` (percentage 0-100) and `bytesSent`.\n // To get the total number of bytes of the file, use `file.size`\n uploadprogress: function uploadprogress(file, progress, bytesSent) {\n if (file.previewElement) {\n var _iterator7 = options_createForOfIteratorHelper(file.previewElement.querySelectorAll(\"[data-dz-uploadprogress]\"), true),\n _step7;\n\n try {\n for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {\n var node = _step7.value;\n node.nodeName === \"PROGRESS\" ? node.value = progress : node.style.width = \"\".concat(progress, \"%\");\n }\n } catch (err) {\n _iterator7.e(err);\n } finally {\n _iterator7.f();\n }\n }\n },\n // Called whenever the total upload progress gets updated.\n // Called with totalUploadProgress (0-100), totalBytes and totalBytesSent\n totaluploadprogress: function totaluploadprogress() {},\n // Called just before the file is sent. Gets the `xhr` object as second\n // parameter, so you can modify it (for example to add a CSRF token) and a\n // `formData` object to add additional information.\n sending: function sending() {},\n sendingmultiple: function sendingmultiple() {},\n // When the complete upload is finished and successful\n // Receives `file`\n success: function success(file) {\n if (file.previewElement) {\n return file.previewElement.classList.add(\"dz-success\");\n }\n },\n successmultiple: function successmultiple() {},\n // When the upload is canceled.\n canceled: function canceled(file) {\n return this.emit(\"error\", file, this.options.dictUploadCanceled);\n },\n canceledmultiple: function canceledmultiple() {},\n // When the upload is finished, either with success or an error.\n // Receives `file`\n complete: function complete(file) {\n if (file._removeLink) {\n file._removeLink.innerHTML = this.options.dictRemoveFile;\n }\n\n if (file.previewElement) {\n return file.previewElement.classList.add(\"dz-complete\");\n }\n },\n completemultiple: function completemultiple() {},\n maxfilesexceeded: function maxfilesexceeded() {},\n maxfilesreached: function maxfilesreached() {},\n queuecomplete: function queuecomplete() {},\n addedfiles: function addedfiles() {}\n};\n/* harmony default export */ var src_options = (defaultOptions);\n;// CONCATENATED MODULE: ./src/dropzone.js\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nfunction dropzone_createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === \"undefined\" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = dropzone_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\n\nfunction dropzone_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return dropzone_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return dropzone_arrayLikeToArray(o, minLen); }\n\nfunction dropzone_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction dropzone_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction dropzone_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction dropzone_createClass(Constructor, protoProps, staticProps) { if (protoProps) dropzone_defineProperties(Constructor.prototype, protoProps); if (staticProps) dropzone_defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n\n\n\nvar Dropzone = /*#__PURE__*/function (_Emitter) {\n _inherits(Dropzone, _Emitter);\n\n var _super = _createSuper(Dropzone);\n\n function Dropzone(el, options) {\n var _this;\n\n dropzone_classCallCheck(this, Dropzone);\n\n _this = _super.call(this);\n var fallback, left;\n _this.element = el; // For backwards compatibility since the version was in the prototype previously\n\n _this.version = Dropzone.version;\n _this.clickableElements = [];\n _this.listeners = [];\n _this.files = []; // All files\n\n if (typeof _this.element === \"string\") {\n _this.element = document.querySelector(_this.element);\n } // Not checking if instance of HTMLElement or Element since IE9 is extremely weird.\n\n\n if (!_this.element || _this.element.nodeType == null) {\n throw new Error(\"Invalid dropzone element.\");\n }\n\n if (_this.element.dropzone) {\n throw new Error(\"Dropzone already attached.\");\n } // Now add this dropzone to the instances.\n\n\n Dropzone.instances.push(_assertThisInitialized(_this)); // Put the dropzone inside the element itself.\n\n _this.element.dropzone = _assertThisInitialized(_this);\n var elementOptions = (left = Dropzone.optionsForElement(_this.element)) != null ? left : {};\n _this.options = Dropzone.extend({}, src_options, elementOptions, options != null ? options : {});\n _this.options.previewTemplate = _this.options.previewTemplate.replace(/\\n*/g, \"\"); // If the browser failed, just call the fallback and leave\n\n if (_this.options.forceFallback || !Dropzone.isBrowserSupported()) {\n return _possibleConstructorReturn(_this, _this.options.fallback.call(_assertThisInitialized(_this)));\n } // @options.url = @element.getAttribute \"action\" unless @options.url?\n\n\n if (_this.options.url == null) {\n _this.options.url = _this.element.getAttribute(\"action\");\n }\n\n if (!_this.options.url) {\n throw new Error(\"No URL provided.\");\n }\n\n if (_this.options.acceptedFiles && _this.options.acceptedMimeTypes) {\n throw new Error(\"You can't provide both 'acceptedFiles' and 'acceptedMimeTypes'. 'acceptedMimeTypes' is deprecated.\");\n }\n\n if (_this.options.uploadMultiple && _this.options.chunking) {\n throw new Error(\"You cannot set both: uploadMultiple and chunking.\");\n } // Backwards compatibility\n\n\n if (_this.options.acceptedMimeTypes) {\n _this.options.acceptedFiles = _this.options.acceptedMimeTypes;\n delete _this.options.acceptedMimeTypes;\n } // Backwards compatibility\n\n\n if (_this.options.renameFilename != null) {\n _this.options.renameFile = function (file) {\n return _this.options.renameFilename.call(_assertThisInitialized(_this), file.name, file);\n };\n }\n\n if (typeof _this.options.method === \"string\") {\n _this.options.method = _this.options.method.toUpperCase();\n }\n\n if ((fallback = _this.getExistingFallback()) && fallback.parentNode) {\n // Remove the fallback\n fallback.parentNode.removeChild(fallback);\n } // Display previews in the previewsContainer element or the Dropzone element unless explicitly set to false\n\n\n if (_this.options.previewsContainer !== false) {\n if (_this.options.previewsContainer) {\n _this.previewsContainer = Dropzone.getElement(_this.options.previewsContainer, \"previewsContainer\");\n } else {\n _this.previewsContainer = _this.element;\n }\n }\n\n if (_this.options.clickable) {\n if (_this.options.clickable === true) {\n _this.clickableElements = [_this.element];\n } else {\n _this.clickableElements = Dropzone.getElements(_this.options.clickable, \"clickable\");\n }\n }\n\n _this.init();\n\n return _this;\n } // Returns all files that have been accepted\n\n\n dropzone_createClass(Dropzone, [{\n key: \"getAcceptedFiles\",\n value: function getAcceptedFiles() {\n return this.files.filter(function (file) {\n return file.accepted;\n }).map(function (file) {\n return file;\n });\n } // Returns all files that have been rejected\n // Not sure when that's going to be useful, but added for completeness.\n\n }, {\n key: \"getRejectedFiles\",\n value: function getRejectedFiles() {\n return this.files.filter(function (file) {\n return !file.accepted;\n }).map(function (file) {\n return file;\n });\n }\n }, {\n key: \"getFilesWithStatus\",\n value: function getFilesWithStatus(status) {\n return this.files.filter(function (file) {\n return file.status === status;\n }).map(function (file) {\n return file;\n });\n } // Returns all files that are in the queue\n\n }, {\n key: \"getQueuedFiles\",\n value: function getQueuedFiles() {\n return this.getFilesWithStatus(Dropzone.QUEUED);\n }\n }, {\n key: \"getUploadingFiles\",\n value: function getUploadingFiles() {\n return this.getFilesWithStatus(Dropzone.UPLOADING);\n }\n }, {\n key: \"getAddedFiles\",\n value: function getAddedFiles() {\n return this.getFilesWithStatus(Dropzone.ADDED);\n } // Files that are either queued or uploading\n\n }, {\n key: \"getActiveFiles\",\n value: function getActiveFiles() {\n return this.files.filter(function (file) {\n return file.status === Dropzone.UPLOADING || file.status === Dropzone.QUEUED;\n }).map(function (file) {\n return file;\n });\n } // The function that gets called when Dropzone is initialized. You\n // can (and should) setup event listeners inside this function.\n\n }, {\n key: \"init\",\n value: function init() {\n var _this2 = this;\n\n // In case it isn't set already\n if (this.element.tagName === \"form\") {\n this.element.setAttribute(\"enctype\", \"multipart/form-data\");\n }\n\n if (this.element.classList.contains(\"dropzone\") && !this.element.querySelector(\".dz-message\")) {\n this.element.appendChild(Dropzone.createElement(\"\")));\n }\n\n if (this.clickableElements.length) {\n var setupHiddenFileInput = function setupHiddenFileInput() {\n if (_this2.hiddenFileInput) {\n _this2.hiddenFileInput.parentNode.removeChild(_this2.hiddenFileInput);\n }\n\n _this2.hiddenFileInput = document.createElement(\"input\");\n\n _this2.hiddenFileInput.setAttribute(\"type\", \"file\");\n\n if (_this2.options.maxFiles === null || _this2.options.maxFiles > 1) {\n _this2.hiddenFileInput.setAttribute(\"multiple\", \"multiple\");\n }\n\n _this2.hiddenFileInput.className = \"dz-hidden-input\";\n\n if (_this2.options.acceptedFiles !== null) {\n _this2.hiddenFileInput.setAttribute(\"accept\", _this2.options.acceptedFiles);\n }\n\n if (_this2.options.capture !== null) {\n _this2.hiddenFileInput.setAttribute(\"capture\", _this2.options.capture);\n } // Making sure that no one can \"tab\" into this field.\n\n\n _this2.hiddenFileInput.setAttribute(\"tabindex\", \"-1\"); // Not setting `display=\"none\"` because some browsers don't accept clicks\n // on elements that aren't displayed.\n\n\n _this2.hiddenFileInput.style.visibility = \"hidden\";\n _this2.hiddenFileInput.style.position = \"absolute\";\n _this2.hiddenFileInput.style.top = \"0\";\n _this2.hiddenFileInput.style.left = \"0\";\n _this2.hiddenFileInput.style.height = \"0\";\n _this2.hiddenFileInput.style.width = \"0\";\n Dropzone.getElement(_this2.options.hiddenInputContainer, \"hiddenInputContainer\").appendChild(_this2.hiddenFileInput);\n\n _this2.hiddenFileInput.addEventListener(\"change\", function () {\n var files = _this2.hiddenFileInput.files;\n\n if (files.length) {\n var _iterator = dropzone_createForOfIteratorHelper(files, true),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var file = _step.value;\n\n _this2.addFile(file);\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n }\n\n _this2.emit(\"addedfiles\", files);\n\n setupHiddenFileInput();\n });\n };\n\n setupHiddenFileInput();\n }\n\n this.URL = window.URL !== null ? window.URL : window.webkitURL; // Setup all event listeners on the Dropzone object itself.\n // They're not in @setupEventListeners() because they shouldn't be removed\n // again when the dropzone gets disabled.\n\n var _iterator2 = dropzone_createForOfIteratorHelper(this.events, true),\n _step2;\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var eventName = _step2.value;\n this.on(eventName, this.options[eventName]);\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n\n this.on(\"uploadprogress\", function () {\n return _this2.updateTotalUploadProgress();\n });\n this.on(\"removedfile\", function () {\n return _this2.updateTotalUploadProgress();\n });\n this.on(\"canceled\", function (file) {\n return _this2.emit(\"complete\", file);\n }); // Emit a `queuecomplete` event if all files finished uploading.\n\n this.on(\"complete\", function (file) {\n if (_this2.getAddedFiles().length === 0 && _this2.getUploadingFiles().length === 0 && _this2.getQueuedFiles().length === 0) {\n // This needs to be deferred so that `queuecomplete` really triggers after `complete`\n return setTimeout(function () {\n return _this2.emit(\"queuecomplete\");\n }, 0);\n }\n });\n\n var containsFiles = function containsFiles(e) {\n if (e.dataTransfer.types) {\n // Because e.dataTransfer.types is an Object in\n // IE, we need to iterate like this instead of\n // using e.dataTransfer.types.some()\n for (var i = 0; i < e.dataTransfer.types.length; i++) {\n if (e.dataTransfer.types[i] === \"Files\") return true;\n }\n }\n\n return false;\n };\n\n var noPropagation = function noPropagation(e) {\n // If there are no files, we don't want to stop\n // propagation so we don't interfere with other\n // drag and drop behaviour.\n if (!containsFiles(e)) return;\n e.stopPropagation();\n\n if (e.preventDefault) {\n return e.preventDefault();\n } else {\n return e.returnValue = false;\n }\n }; // Create the listeners\n\n\n this.listeners = [{\n element: this.element,\n events: {\n dragstart: function dragstart(e) {\n return _this2.emit(\"dragstart\", e);\n },\n dragenter: function dragenter(e) {\n noPropagation(e);\n return _this2.emit(\"dragenter\", e);\n },\n dragover: function dragover(e) {\n // Makes it possible to drag files from chrome's download bar\n // http://stackoverflow.com/questions/19526430/drag-and-drop-file-uploads-from-chrome-downloads-bar\n // Try is required to prevent bug in Internet Explorer 11 (SCRIPT65535 exception)\n var efct;\n\n try {\n efct = e.dataTransfer.effectAllowed;\n } catch (error) {}\n\n e.dataTransfer.dropEffect = \"move\" === efct || \"linkMove\" === efct ? \"move\" : \"copy\";\n noPropagation(e);\n return _this2.emit(\"dragover\", e);\n },\n dragleave: function dragleave(e) {\n return _this2.emit(\"dragleave\", e);\n },\n drop: function drop(e) {\n noPropagation(e);\n return _this2.drop(e);\n },\n dragend: function dragend(e) {\n return _this2.emit(\"dragend\", e);\n }\n } // This is disabled right now, because the browsers don't implement it properly.\n // \"paste\": (e) =>\n // noPropagation e\n // @paste e\n\n }];\n this.clickableElements.forEach(function (clickableElement) {\n return _this2.listeners.push({\n element: clickableElement,\n events: {\n click: function click(evt) {\n // Only the actual dropzone or the message element should trigger file selection\n if (clickableElement !== _this2.element || evt.target === _this2.element || Dropzone.elementInside(evt.target, _this2.element.querySelector(\".dz-message\"))) {\n _this2.hiddenFileInput.click(); // Forward the click\n\n }\n\n return true;\n }\n }\n });\n });\n this.enable();\n return this.options.init.call(this);\n } // Not fully tested yet\n\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.disable();\n this.removeAllFiles(true);\n\n if (this.hiddenFileInput != null ? this.hiddenFileInput.parentNode : undefined) {\n this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput);\n this.hiddenFileInput = null;\n }\n\n delete this.element.dropzone;\n return Dropzone.instances.splice(Dropzone.instances.indexOf(this), 1);\n }\n }, {\n key: \"updateTotalUploadProgress\",\n value: function updateTotalUploadProgress() {\n var totalUploadProgress;\n var totalBytesSent = 0;\n var totalBytes = 0;\n var activeFiles = this.getActiveFiles();\n\n if (activeFiles.length) {\n var _iterator3 = dropzone_createForOfIteratorHelper(this.getActiveFiles(), true),\n _step3;\n\n try {\n for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n var file = _step3.value;\n totalBytesSent += file.upload.bytesSent;\n totalBytes += file.upload.total;\n }\n } catch (err) {\n _iterator3.e(err);\n } finally {\n _iterator3.f();\n }\n\n totalUploadProgress = 100 * totalBytesSent / totalBytes;\n } else {\n totalUploadProgress = 100;\n }\n\n return this.emit(\"totaluploadprogress\", totalUploadProgress, totalBytes, totalBytesSent);\n } // @options.paramName can be a function taking one parameter rather than a string.\n // A parameter name for a file is obtained simply by calling this with an index number.\n\n }, {\n key: \"_getParamName\",\n value: function _getParamName(n) {\n if (typeof this.options.paramName === \"function\") {\n return this.options.paramName(n);\n } else {\n return \"\".concat(this.options.paramName).concat(this.options.uploadMultiple ? \"[\".concat(n, \"]\") : \"\");\n }\n } // If @options.renameFile is a function,\n // the function will be used to rename the file.name before appending it to the formData\n\n }, {\n key: \"_renameFile\",\n value: function _renameFile(file) {\n if (typeof this.options.renameFile !== \"function\") {\n return file.name;\n }\n\n return this.options.renameFile(file);\n } // Returns a form that can be used as fallback if the browser does not support DragnDrop\n //\n // If the dropzone is already a form, only the input field and button are returned. Otherwise a complete form element is provided.\n // This code has to pass in IE7 :(\n\n }, {\n key: \"getFallbackForm\",\n value: function getFallbackForm() {\n var existingFallback, form;\n\n if (existingFallback = this.getExistingFallback()) {\n return existingFallback;\n }\n\n var fieldsString = '
';\n\n if (this.options.dictFallbackText) {\n fieldsString += \"
\".concat(this.options.dictFallbackText, \"
\");\n }\n\n fieldsString += \"
\");\n var fields = Dropzone.createElement(fieldsString);\n\n if (this.element.tagName !== \"FORM\") {\n form = Dropzone.createElement(\"\"));\n form.appendChild(fields);\n } else {\n // Make sure that the enctype and method attributes are set properly\n this.element.setAttribute(\"enctype\", \"multipart/form-data\");\n this.element.setAttribute(\"method\", this.options.method);\n }\n\n return form != null ? form : fields;\n } // Returns the fallback elements if they exist already\n //\n // This code has to pass in IE7 :(\n\n }, {\n key: \"getExistingFallback\",\n value: function getExistingFallback() {\n var getFallback = function getFallback(elements) {\n var _iterator4 = dropzone_createForOfIteratorHelper(elements, true),\n _step4;\n\n try {\n for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {\n var el = _step4.value;\n\n if (/(^| )fallback($| )/.test(el.className)) {\n return el;\n }\n }\n } catch (err) {\n _iterator4.e(err);\n } finally {\n _iterator4.f();\n }\n };\n\n for (var _i = 0, _arr = [\"div\", \"form\"]; _i < _arr.length; _i++) {\n var tagName = _arr[_i];\n var fallback;\n\n if (fallback = getFallback(this.element.getElementsByTagName(tagName))) {\n return fallback;\n }\n }\n } // Activates all listeners stored in @listeners\n\n }, {\n key: \"setupEventListeners\",\n value: function setupEventListeners() {\n return this.listeners.map(function (elementListeners) {\n return function () {\n var result = [];\n\n for (var event in elementListeners.events) {\n var listener = elementListeners.events[event];\n result.push(elementListeners.element.addEventListener(event, listener, false));\n }\n\n return result;\n }();\n });\n } // Deactivates all listeners stored in @listeners\n\n }, {\n key: \"removeEventListeners\",\n value: function removeEventListeners() {\n return this.listeners.map(function (elementListeners) {\n return function () {\n var result = [];\n\n for (var event in elementListeners.events) {\n var listener = elementListeners.events[event];\n result.push(elementListeners.element.removeEventListener(event, listener, false));\n }\n\n return result;\n }();\n });\n } // Removes all event listeners and cancels all files in the queue or being processed.\n\n }, {\n key: \"disable\",\n value: function disable() {\n var _this3 = this;\n\n this.clickableElements.forEach(function (element) {\n return element.classList.remove(\"dz-clickable\");\n });\n this.removeEventListeners();\n this.disabled = true;\n return this.files.map(function (file) {\n return _this3.cancelUpload(file);\n });\n }\n }, {\n key: \"enable\",\n value: function enable() {\n delete this.disabled;\n this.clickableElements.forEach(function (element) {\n return element.classList.add(\"dz-clickable\");\n });\n return this.setupEventListeners();\n } // Returns a nicely formatted filesize\n\n }, {\n key: \"filesize\",\n value: function filesize(size) {\n var selectedSize = 0;\n var selectedUnit = \"b\";\n\n if (size > 0) {\n var units = [\"tb\", \"gb\", \"mb\", \"kb\", \"b\"];\n\n for (var i = 0; i < units.length; i++) {\n var unit = units[i];\n var cutoff = Math.pow(this.options.filesizeBase, 4 - i) / 10;\n\n if (size >= cutoff) {\n selectedSize = size / Math.pow(this.options.filesizeBase, 4 - i);\n selectedUnit = unit;\n break;\n }\n }\n\n selectedSize = Math.round(10 * selectedSize) / 10; // Cutting of digits\n }\n\n return \"\".concat(selectedSize, \" \").concat(this.options.dictFileSizeUnits[selectedUnit]);\n } // Adds or removes the `dz-max-files-reached` class from the form.\n\n }, {\n key: \"_updateMaxFilesReachedClass\",\n value: function _updateMaxFilesReachedClass() {\n if (this.options.maxFiles != null && this.getAcceptedFiles().length >= this.options.maxFiles) {\n if (this.getAcceptedFiles().length === this.options.maxFiles) {\n this.emit(\"maxfilesreached\", this.files);\n }\n\n return this.element.classList.add(\"dz-max-files-reached\");\n } else {\n return this.element.classList.remove(\"dz-max-files-reached\");\n }\n }\n }, {\n key: \"drop\",\n value: function drop(e) {\n if (!e.dataTransfer) {\n return;\n }\n\n this.emit(\"drop\", e); // Convert the FileList to an Array\n // This is necessary for IE11\n\n var files = [];\n\n for (var i = 0; i < e.dataTransfer.files.length; i++) {\n files[i] = e.dataTransfer.files[i];\n } // Even if it's a folder, files.length will contain the folders.\n\n\n if (files.length) {\n var items = e.dataTransfer.items;\n\n if (items && items.length && items[0].webkitGetAsEntry != null) {\n // The browser supports dropping of folders, so handle items instead of files\n this._addFilesFromItems(items);\n } else {\n this.handleFiles(files);\n }\n }\n\n this.emit(\"addedfiles\", files);\n }\n }, {\n key: \"paste\",\n value: function paste(e) {\n if (__guard__(e != null ? e.clipboardData : undefined, function (x) {\n return x.items;\n }) == null) {\n return;\n }\n\n this.emit(\"paste\", e);\n var items = e.clipboardData.items;\n\n if (items.length) {\n return this._addFilesFromItems(items);\n }\n }\n }, {\n key: \"handleFiles\",\n value: function handleFiles(files) {\n var _iterator5 = dropzone_createForOfIteratorHelper(files, true),\n _step5;\n\n try {\n for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {\n var file = _step5.value;\n this.addFile(file);\n }\n } catch (err) {\n _iterator5.e(err);\n } finally {\n _iterator5.f();\n }\n } // When a folder is dropped (or files are pasted), items must be handled\n // instead of files.\n\n }, {\n key: \"_addFilesFromItems\",\n value: function _addFilesFromItems(items) {\n var _this4 = this;\n\n return function () {\n var result = [];\n\n var _iterator6 = dropzone_createForOfIteratorHelper(items, true),\n _step6;\n\n try {\n for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {\n var item = _step6.value;\n var entry;\n\n if (item.webkitGetAsEntry != null && (entry = item.webkitGetAsEntry())) {\n if (entry.isFile) {\n result.push(_this4.addFile(item.getAsFile()));\n } else if (entry.isDirectory) {\n // Append all files from that directory to files\n result.push(_this4._addFilesFromDirectory(entry, entry.name));\n } else {\n result.push(undefined);\n }\n } else if (item.getAsFile != null) {\n if (item.kind == null || item.kind === \"file\") {\n result.push(_this4.addFile(item.getAsFile()));\n } else {\n result.push(undefined);\n }\n } else {\n result.push(undefined);\n }\n }\n } catch (err) {\n _iterator6.e(err);\n } finally {\n _iterator6.f();\n }\n\n return result;\n }();\n } // Goes through the directory, and adds each file it finds recursively\n\n }, {\n key: \"_addFilesFromDirectory\",\n value: function _addFilesFromDirectory(directory, path) {\n var _this5 = this;\n\n var dirReader = directory.createReader();\n\n var errorHandler = function errorHandler(error) {\n return __guardMethod__(console, \"log\", function (o) {\n return o.log(error);\n });\n };\n\n var readEntries = function readEntries() {\n return dirReader.readEntries(function (entries) {\n if (entries.length > 0) {\n var _iterator7 = dropzone_createForOfIteratorHelper(entries, true),\n _step7;\n\n try {\n for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {\n var entry = _step7.value;\n\n if (entry.isFile) {\n entry.file(function (file) {\n if (_this5.options.ignoreHiddenFiles && file.name.substring(0, 1) === \".\") {\n return;\n }\n\n file.fullPath = \"\".concat(path, \"/\").concat(file.name);\n return _this5.addFile(file);\n });\n } else if (entry.isDirectory) {\n _this5._addFilesFromDirectory(entry, \"\".concat(path, \"/\").concat(entry.name));\n }\n } // Recursively call readEntries() again, since browser only handle\n // the first 100 entries.\n // See: https://developer.mozilla.org/en-US/docs/Web/API/DirectoryReader#readEntries\n\n } catch (err) {\n _iterator7.e(err);\n } finally {\n _iterator7.f();\n }\n\n readEntries();\n }\n\n return null;\n }, errorHandler);\n };\n\n return readEntries();\n } // If `done()` is called without argument the file is accepted\n // If you call it with an error message, the file is rejected\n // (This allows for asynchronous validation)\n //\n // This function checks the filesize, and if the file.type passes the\n // `acceptedFiles` check.\n\n }, {\n key: \"accept\",\n value: function accept(file, done) {\n if (this.options.maxFilesize && file.size > this.options.maxFilesize * 1024 * 1024) {\n done(this.options.dictFileTooBig.replace(\"{{filesize}}\", Math.round(file.size / 1024 / 10.24) / 100).replace(\"{{maxFilesize}}\", this.options.maxFilesize));\n } else if (!Dropzone.isValidFile(file, this.options.acceptedFiles)) {\n done(this.options.dictInvalidFileType);\n } else if (this.options.maxFiles != null && this.getAcceptedFiles().length >= this.options.maxFiles) {\n done(this.options.dictMaxFilesExceeded.replace(\"{{maxFiles}}\", this.options.maxFiles));\n this.emit(\"maxfilesexceeded\", file);\n } else {\n this.options.accept.call(this, file, done);\n }\n }\n }, {\n key: \"addFile\",\n value: function addFile(file) {\n var _this6 = this;\n\n file.upload = {\n uuid: Dropzone.uuidv4(),\n progress: 0,\n // Setting the total upload size to file.size for the beginning\n // It's actual different than the size to be transmitted.\n total: file.size,\n bytesSent: 0,\n filename: this._renameFile(file) // Not setting chunking information here, because the acutal data — and\n // thus the chunks — might change if `options.transformFile` is set\n // and does something to the data.\n\n };\n this.files.push(file);\n file.status = Dropzone.ADDED;\n this.emit(\"addedfile\", file);\n\n this._enqueueThumbnail(file);\n\n this.accept(file, function (error) {\n if (error) {\n file.accepted = false;\n\n _this6._errorProcessing([file], error); // Will set the file.status\n\n } else {\n file.accepted = true;\n\n if (_this6.options.autoQueue) {\n _this6.enqueueFile(file);\n } // Will set .accepted = true\n\n }\n\n _this6._updateMaxFilesReachedClass();\n });\n } // Wrapper for enqueueFile\n\n }, {\n key: \"enqueueFiles\",\n value: function enqueueFiles(files) {\n var _iterator8 = dropzone_createForOfIteratorHelper(files, true),\n _step8;\n\n try {\n for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {\n var file = _step8.value;\n this.enqueueFile(file);\n }\n } catch (err) {\n _iterator8.e(err);\n } finally {\n _iterator8.f();\n }\n\n return null;\n }\n }, {\n key: \"enqueueFile\",\n value: function enqueueFile(file) {\n var _this7 = this;\n\n if (file.status === Dropzone.ADDED && file.accepted === true) {\n file.status = Dropzone.QUEUED;\n\n if (this.options.autoProcessQueue) {\n return setTimeout(function () {\n return _this7.processQueue();\n }, 0); // Deferring the call\n }\n } else {\n throw new Error(\"This file can't be queued because it has already been processed or was rejected.\");\n }\n }\n }, {\n key: \"_enqueueThumbnail\",\n value: function _enqueueThumbnail(file) {\n var _this8 = this;\n\n if (this.options.createImageThumbnails && file.type.match(/image.*/) && file.size <= this.options.maxThumbnailFilesize * 1024 * 1024) {\n this._thumbnailQueue.push(file);\n\n return setTimeout(function () {\n return _this8._processThumbnailQueue();\n }, 0); // Deferring the call\n }\n }\n }, {\n key: \"_processThumbnailQueue\",\n value: function _processThumbnailQueue() {\n var _this9 = this;\n\n if (this._processingThumbnail || this._thumbnailQueue.length === 0) {\n return;\n }\n\n this._processingThumbnail = true;\n\n var file = this._thumbnailQueue.shift();\n\n return this.createThumbnail(file, this.options.thumbnailWidth, this.options.thumbnailHeight, this.options.thumbnailMethod, true, function (dataUrl) {\n _this9.emit(\"thumbnail\", file, dataUrl);\n\n _this9._processingThumbnail = false;\n return _this9._processThumbnailQueue();\n });\n } // Can be called by the user to remove a file\n\n }, {\n key: \"removeFile\",\n value: function removeFile(file) {\n if (file.status === Dropzone.UPLOADING) {\n this.cancelUpload(file);\n }\n\n this.files = without(this.files, file);\n this.emit(\"removedfile\", file);\n\n if (this.files.length === 0) {\n return this.emit(\"reset\");\n }\n } // Removes all files that aren't currently processed from the list\n\n }, {\n key: \"removeAllFiles\",\n value: function removeAllFiles(cancelIfNecessary) {\n // Create a copy of files since removeFile() changes the @files array.\n if (cancelIfNecessary == null) {\n cancelIfNecessary = false;\n }\n\n var _iterator9 = dropzone_createForOfIteratorHelper(this.files.slice(), true),\n _step9;\n\n try {\n for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {\n var file = _step9.value;\n\n if (file.status !== Dropzone.UPLOADING || cancelIfNecessary) {\n this.removeFile(file);\n }\n }\n } catch (err) {\n _iterator9.e(err);\n } finally {\n _iterator9.f();\n }\n\n return null;\n } // Resizes an image before it gets sent to the server. This function is the default behavior of\n // `options.transformFile` if `resizeWidth` or `resizeHeight` are set. The callback is invoked with\n // the resized blob.\n\n }, {\n key: \"resizeImage\",\n value: function resizeImage(file, width, height, resizeMethod, callback) {\n var _this10 = this;\n\n return this.createThumbnail(file, width, height, resizeMethod, true, function (dataUrl, canvas) {\n if (canvas == null) {\n // The image has not been resized\n return callback(file);\n } else {\n var resizeMimeType = _this10.options.resizeMimeType;\n\n if (resizeMimeType == null) {\n resizeMimeType = file.type;\n }\n\n var resizedDataURL = canvas.toDataURL(resizeMimeType, _this10.options.resizeQuality);\n\n if (resizeMimeType === \"image/jpeg\" || resizeMimeType === \"image/jpg\") {\n // Now add the original EXIF information\n resizedDataURL = ExifRestore.restore(file.dataURL, resizedDataURL);\n }\n\n return callback(Dropzone.dataURItoBlob(resizedDataURL));\n }\n });\n }\n }, {\n key: \"createThumbnail\",\n value: function createThumbnail(file, width, height, resizeMethod, fixOrientation, callback) {\n var _this11 = this;\n\n var fileReader = new FileReader();\n\n fileReader.onload = function () {\n file.dataURL = fileReader.result; // Don't bother creating a thumbnail for SVG images since they're vector\n\n if (file.type === \"image/svg+xml\") {\n if (callback != null) {\n callback(fileReader.result);\n }\n\n return;\n }\n\n _this11.createThumbnailFromUrl(file, width, height, resizeMethod, fixOrientation, callback);\n };\n\n fileReader.readAsDataURL(file);\n } // `mockFile` needs to have these attributes:\n //\n // { name: 'name', size: 12345, imageUrl: '' }\n //\n // `callback` will be invoked when the image has been downloaded and displayed.\n // `crossOrigin` will be added to the `img` tag when accessing the file.\n\n }, {\n key: \"displayExistingFile\",\n value: function displayExistingFile(mockFile, imageUrl, callback, crossOrigin) {\n var _this12 = this;\n\n var resizeThumbnail = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;\n this.emit(\"addedfile\", mockFile);\n this.emit(\"complete\", mockFile);\n\n if (!resizeThumbnail) {\n this.emit(\"thumbnail\", mockFile, imageUrl);\n if (callback) callback();\n } else {\n var onDone = function onDone(thumbnail) {\n _this12.emit(\"thumbnail\", mockFile, thumbnail);\n\n if (callback) callback();\n };\n\n mockFile.dataURL = imageUrl;\n this.createThumbnailFromUrl(mockFile, this.options.thumbnailWidth, this.options.thumbnailHeight, this.options.thumbnailMethod, this.options.fixOrientation, onDone, crossOrigin);\n }\n }\n }, {\n key: \"createThumbnailFromUrl\",\n value: function createThumbnailFromUrl(file, width, height, resizeMethod, fixOrientation, callback, crossOrigin) {\n var _this13 = this;\n\n // Not using `new Image` here because of a bug in latest Chrome versions.\n // See https://github.com/enyo/dropzone/pull/226\n var img = document.createElement(\"img\");\n\n if (crossOrigin) {\n img.crossOrigin = crossOrigin;\n } // fixOrientation is not needed anymore with browsers handling imageOrientation\n\n\n fixOrientation = getComputedStyle(document.body)[\"imageOrientation\"] == \"from-image\" ? false : fixOrientation;\n\n img.onload = function () {\n var loadExif = function loadExif(callback) {\n return callback(1);\n };\n\n if (typeof EXIF !== \"undefined\" && EXIF !== null && fixOrientation) {\n loadExif = function loadExif(callback) {\n return EXIF.getData(img, function () {\n return callback(EXIF.getTag(this, \"Orientation\"));\n });\n };\n }\n\n return loadExif(function (orientation) {\n file.width = img.width;\n file.height = img.height;\n\n var resizeInfo = _this13.options.resize.call(_this13, file, width, height, resizeMethod);\n\n var canvas = document.createElement(\"canvas\");\n var ctx = canvas.getContext(\"2d\");\n canvas.width = resizeInfo.trgWidth;\n canvas.height = resizeInfo.trgHeight;\n\n if (orientation > 4) {\n canvas.width = resizeInfo.trgHeight;\n canvas.height = resizeInfo.trgWidth;\n }\n\n switch (orientation) {\n case 2:\n // horizontal flip\n ctx.translate(canvas.width, 0);\n ctx.scale(-1, 1);\n break;\n\n case 3:\n // 180° rotate left\n ctx.translate(canvas.width, canvas.height);\n ctx.rotate(Math.PI);\n break;\n\n case 4:\n // vertical flip\n ctx.translate(0, canvas.height);\n ctx.scale(1, -1);\n break;\n\n case 5:\n // vertical flip + 90 rotate right\n ctx.rotate(0.5 * Math.PI);\n ctx.scale(1, -1);\n break;\n\n case 6:\n // 90° rotate right\n ctx.rotate(0.5 * Math.PI);\n ctx.translate(0, -canvas.width);\n break;\n\n case 7:\n // horizontal flip + 90 rotate right\n ctx.rotate(0.5 * Math.PI);\n ctx.translate(canvas.height, -canvas.width);\n ctx.scale(-1, 1);\n break;\n\n case 8:\n // 90° rotate left\n ctx.rotate(-0.5 * Math.PI);\n ctx.translate(-canvas.height, 0);\n break;\n } // This is a bugfix for iOS' scaling bug.\n\n\n drawImageIOSFix(ctx, img, resizeInfo.srcX != null ? resizeInfo.srcX : 0, resizeInfo.srcY != null ? resizeInfo.srcY : 0, resizeInfo.srcWidth, resizeInfo.srcHeight, resizeInfo.trgX != null ? resizeInfo.trgX : 0, resizeInfo.trgY != null ? resizeInfo.trgY : 0, resizeInfo.trgWidth, resizeInfo.trgHeight);\n var thumbnail = canvas.toDataURL(\"image/png\");\n\n if (callback != null) {\n return callback(thumbnail, canvas);\n }\n });\n };\n\n if (callback != null) {\n img.onerror = callback;\n }\n\n return img.src = file.dataURL;\n } // Goes through the queue and processes files if there aren't too many already.\n\n }, {\n key: \"processQueue\",\n value: function processQueue() {\n var parallelUploads = this.options.parallelUploads;\n var processingLength = this.getUploadingFiles().length;\n var i = processingLength; // There are already at least as many files uploading than should be\n\n if (processingLength >= parallelUploads) {\n return;\n }\n\n var queuedFiles = this.getQueuedFiles();\n\n if (!(queuedFiles.length > 0)) {\n return;\n }\n\n if (this.options.uploadMultiple) {\n // The files should be uploaded in one request\n return this.processFiles(queuedFiles.slice(0, parallelUploads - processingLength));\n } else {\n while (i < parallelUploads) {\n if (!queuedFiles.length) {\n return;\n } // Nothing left to process\n\n\n this.processFile(queuedFiles.shift());\n i++;\n }\n }\n } // Wrapper for `processFiles`\n\n }, {\n key: \"processFile\",\n value: function processFile(file) {\n return this.processFiles([file]);\n } // Loads the file, then calls finishedLoading()\n\n }, {\n key: \"processFiles\",\n value: function processFiles(files) {\n var _iterator10 = dropzone_createForOfIteratorHelper(files, true),\n _step10;\n\n try {\n for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {\n var file = _step10.value;\n file.processing = true; // Backwards compatibility\n\n file.status = Dropzone.UPLOADING;\n this.emit(\"processing\", file);\n }\n } catch (err) {\n _iterator10.e(err);\n } finally {\n _iterator10.f();\n }\n\n if (this.options.uploadMultiple) {\n this.emit(\"processingmultiple\", files);\n }\n\n return this.uploadFiles(files);\n }\n }, {\n key: \"_getFilesWithXhr\",\n value: function _getFilesWithXhr(xhr) {\n var files;\n return files = this.files.filter(function (file) {\n return file.xhr === xhr;\n }).map(function (file) {\n return file;\n });\n } // Cancels the file upload and sets the status to CANCELED\n // **if** the file is actually being uploaded.\n // If it's still in the queue, the file is being removed from it and the status\n // set to CANCELED.\n\n }, {\n key: \"cancelUpload\",\n value: function cancelUpload(file) {\n if (file.status === Dropzone.UPLOADING) {\n var groupedFiles = this._getFilesWithXhr(file.xhr);\n\n var _iterator11 = dropzone_createForOfIteratorHelper(groupedFiles, true),\n _step11;\n\n try {\n for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {\n var groupedFile = _step11.value;\n groupedFile.status = Dropzone.CANCELED;\n }\n } catch (err) {\n _iterator11.e(err);\n } finally {\n _iterator11.f();\n }\n\n if (typeof file.xhr !== \"undefined\") {\n file.xhr.abort();\n }\n\n var _iterator12 = dropzone_createForOfIteratorHelper(groupedFiles, true),\n _step12;\n\n try {\n for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {\n var _groupedFile = _step12.value;\n this.emit(\"canceled\", _groupedFile);\n }\n } catch (err) {\n _iterator12.e(err);\n } finally {\n _iterator12.f();\n }\n\n if (this.options.uploadMultiple) {\n this.emit(\"canceledmultiple\", groupedFiles);\n }\n } else if (file.status === Dropzone.ADDED || file.status === Dropzone.QUEUED) {\n file.status = Dropzone.CANCELED;\n this.emit(\"canceled\", file);\n\n if (this.options.uploadMultiple) {\n this.emit(\"canceledmultiple\", [file]);\n }\n }\n\n if (this.options.autoProcessQueue) {\n return this.processQueue();\n }\n }\n }, {\n key: \"resolveOption\",\n value: function resolveOption(option) {\n if (typeof option === \"function\") {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n return option.apply(this, args);\n }\n\n return option;\n }\n }, {\n key: \"uploadFile\",\n value: function uploadFile(file) {\n return this.uploadFiles([file]);\n }\n }, {\n key: \"uploadFiles\",\n value: function uploadFiles(files) {\n var _this14 = this;\n\n this._transformFiles(files, function (transformedFiles) {\n if (_this14.options.chunking) {\n // Chunking is not allowed to be used with `uploadMultiple` so we know\n // that there is only __one__file.\n var transformedFile = transformedFiles[0];\n files[0].upload.chunked = _this14.options.chunking && (_this14.options.forceChunking || transformedFile.size > _this14.options.chunkSize);\n files[0].upload.totalChunkCount = Math.ceil(transformedFile.size / _this14.options.chunkSize);\n }\n\n if (files[0].upload.chunked) {\n // This file should be sent in chunks!\n // If the chunking option is set, we **know** that there can only be **one** file, since\n // uploadMultiple is not allowed with this option.\n var file = files[0];\n var _transformedFile = transformedFiles[0];\n var startedChunkCount = 0;\n file.upload.chunks = [];\n\n var handleNextChunk = function handleNextChunk() {\n var chunkIndex = 0; // Find the next item in file.upload.chunks that is not defined yet.\n\n while (file.upload.chunks[chunkIndex] !== undefined) {\n chunkIndex++;\n } // This means, that all chunks have already been started.\n\n\n if (chunkIndex >= file.upload.totalChunkCount) return;\n startedChunkCount++;\n var start = chunkIndex * _this14.options.chunkSize;\n var end = Math.min(start + _this14.options.chunkSize, _transformedFile.size);\n var dataBlock = {\n name: _this14._getParamName(0),\n data: _transformedFile.webkitSlice ? _transformedFile.webkitSlice(start, end) : _transformedFile.slice(start, end),\n filename: file.upload.filename,\n chunkIndex: chunkIndex\n };\n file.upload.chunks[chunkIndex] = {\n file: file,\n index: chunkIndex,\n dataBlock: dataBlock,\n // In case we want to retry.\n status: Dropzone.UPLOADING,\n progress: 0,\n retries: 0 // The number of times this block has been retried.\n\n };\n\n _this14._uploadData(files, [dataBlock]);\n };\n\n file.upload.finishedChunkUpload = function (chunk, response) {\n var allFinished = true;\n chunk.status = Dropzone.SUCCESS; // Clear the data from the chunk\n\n chunk.dataBlock = null; // Leaving this reference to xhr intact here will cause memory leaks in some browsers\n\n chunk.xhr = null;\n\n for (var i = 0; i < file.upload.totalChunkCount; i++) {\n if (file.upload.chunks[i] === undefined) {\n return handleNextChunk();\n }\n\n if (file.upload.chunks[i].status !== Dropzone.SUCCESS) {\n allFinished = false;\n }\n }\n\n if (allFinished) {\n _this14.options.chunksUploaded(file, function () {\n _this14._finished(files, response, null);\n });\n }\n };\n\n if (_this14.options.parallelChunkUploads) {\n for (var i = 0; i < file.upload.totalChunkCount; i++) {\n handleNextChunk();\n }\n } else {\n handleNextChunk();\n }\n } else {\n var dataBlocks = [];\n\n for (var _i2 = 0; _i2 < files.length; _i2++) {\n dataBlocks[_i2] = {\n name: _this14._getParamName(_i2),\n data: transformedFiles[_i2],\n filename: files[_i2].upload.filename\n };\n }\n\n _this14._uploadData(files, dataBlocks);\n }\n });\n } /// Returns the right chunk for given file and xhr\n\n }, {\n key: \"_getChunk\",\n value: function _getChunk(file, xhr) {\n for (var i = 0; i < file.upload.totalChunkCount; i++) {\n if (file.upload.chunks[i] !== undefined && file.upload.chunks[i].xhr === xhr) {\n return file.upload.chunks[i];\n }\n }\n } // This function actually uploads the file(s) to the server.\n // If dataBlocks contains the actual data to upload (meaning, that this could either be transformed\n // files, or individual chunks for chunked upload).\n\n }, {\n key: \"_uploadData\",\n value: function _uploadData(files, dataBlocks) {\n var _this15 = this;\n\n var xhr = new XMLHttpRequest(); // Put the xhr object in the file objects to be able to reference it later.\n\n var _iterator13 = dropzone_createForOfIteratorHelper(files, true),\n _step13;\n\n try {\n for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {\n var file = _step13.value;\n file.xhr = xhr;\n }\n } catch (err) {\n _iterator13.e(err);\n } finally {\n _iterator13.f();\n }\n\n if (files[0].upload.chunked) {\n // Put the xhr object in the right chunk object, so it can be associated later, and found with _getChunk\n files[0].upload.chunks[dataBlocks[0].chunkIndex].xhr = xhr;\n }\n\n var method = this.resolveOption(this.options.method, files);\n var url = this.resolveOption(this.options.url, files);\n xhr.open(method, url, true); // Setting the timeout after open because of IE11 issue: https://gitlab.com/meno/dropzone/issues/8\n\n var timeout = this.resolveOption(this.options.timeout, files);\n if (timeout) xhr.timeout = this.resolveOption(this.options.timeout, files); // Has to be after `.open()`. See https://github.com/enyo/dropzone/issues/179\n\n xhr.withCredentials = !!this.options.withCredentials;\n\n xhr.onload = function (e) {\n _this15._finishedUploading(files, xhr, e);\n };\n\n xhr.ontimeout = function () {\n _this15._handleUploadError(files, xhr, \"Request timedout after \".concat(_this15.options.timeout / 1000, \" seconds\"));\n };\n\n xhr.onerror = function () {\n _this15._handleUploadError(files, xhr);\n }; // Some browsers do not have the .upload property\n\n\n var progressObj = xhr.upload != null ? xhr.upload : xhr;\n\n progressObj.onprogress = function (e) {\n return _this15._updateFilesUploadProgress(files, xhr, e);\n };\n\n var headers = {\n Accept: \"application/json\",\n \"Cache-Control\": \"no-cache\",\n \"X-Requested-With\": \"XMLHttpRequest\"\n };\n\n if (this.options.headers) {\n Dropzone.extend(headers, this.options.headers);\n }\n\n for (var headerName in headers) {\n var headerValue = headers[headerName];\n\n if (headerValue) {\n xhr.setRequestHeader(headerName, headerValue);\n }\n }\n\n var formData = new FormData(); // Adding all @options parameters\n\n if (this.options.params) {\n var additionalParams = this.options.params;\n\n if (typeof additionalParams === \"function\") {\n additionalParams = additionalParams.call(this, files, xhr, files[0].upload.chunked ? this._getChunk(files[0], xhr) : null);\n }\n\n for (var key in additionalParams) {\n var value = additionalParams[key];\n\n if (Array.isArray(value)) {\n // The additional parameter contains an array,\n // so lets iterate over it to attach each value\n // individually.\n for (var i = 0; i < value.length; i++) {\n formData.append(key, value[i]);\n }\n } else {\n formData.append(key, value);\n }\n }\n } // Let the user add additional data if necessary\n\n\n var _iterator14 = dropzone_createForOfIteratorHelper(files, true),\n _step14;\n\n try {\n for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) {\n var _file = _step14.value;\n this.emit(\"sending\", _file, xhr, formData);\n }\n } catch (err) {\n _iterator14.e(err);\n } finally {\n _iterator14.f();\n }\n\n if (this.options.uploadMultiple) {\n this.emit(\"sendingmultiple\", files, xhr, formData);\n }\n\n this._addFormElementData(formData); // Finally add the files\n // Has to be last because some servers (eg: S3) expect the file to be the last parameter\n\n\n for (var _i3 = 0; _i3 < dataBlocks.length; _i3++) {\n var dataBlock = dataBlocks[_i3];\n formData.append(dataBlock.name, dataBlock.data, dataBlock.filename);\n }\n\n this.submitRequest(xhr, formData, files);\n } // Transforms all files with this.options.transformFile and invokes done with the transformed files when done.\n\n }, {\n key: \"_transformFiles\",\n value: function _transformFiles(files, done) {\n var _this16 = this;\n\n var transformedFiles = []; // Clumsy way of handling asynchronous calls, until I get to add a proper Future library.\n\n var doneCounter = 0;\n\n var _loop = function _loop(i) {\n _this16.options.transformFile.call(_this16, files[i], function (transformedFile) {\n transformedFiles[i] = transformedFile;\n\n if (++doneCounter === files.length) {\n done(transformedFiles);\n }\n });\n };\n\n for (var i = 0; i < files.length; i++) {\n _loop(i);\n }\n } // Takes care of adding other input elements of the form to the AJAX request\n\n }, {\n key: \"_addFormElementData\",\n value: function _addFormElementData(formData) {\n // Take care of other input elements\n if (this.element.tagName === \"FORM\") {\n var _iterator15 = dropzone_createForOfIteratorHelper(this.element.querySelectorAll(\"input, textarea, select, button\"), true),\n _step15;\n\n try {\n for (_iterator15.s(); !(_step15 = _iterator15.n()).done;) {\n var input = _step15.value;\n var inputName = input.getAttribute(\"name\");\n var inputType = input.getAttribute(\"type\");\n if (inputType) inputType = inputType.toLowerCase(); // If the input doesn't have a name, we can't use it.\n\n if (typeof inputName === \"undefined\" || inputName === null) continue;\n\n if (input.tagName === \"SELECT\" && input.hasAttribute(\"multiple\")) {\n // Possibly multiple values\n var _iterator16 = dropzone_createForOfIteratorHelper(input.options, true),\n _step16;\n\n try {\n for (_iterator16.s(); !(_step16 = _iterator16.n()).done;) {\n var option = _step16.value;\n\n if (option.selected) {\n formData.append(inputName, option.value);\n }\n }\n } catch (err) {\n _iterator16.e(err);\n } finally {\n _iterator16.f();\n }\n } else if (!inputType || inputType !== \"checkbox\" && inputType !== \"radio\" || input.checked) {\n formData.append(inputName, input.value);\n }\n }\n } catch (err) {\n _iterator15.e(err);\n } finally {\n _iterator15.f();\n }\n }\n } // Invoked when there is new progress information about given files.\n // If e is not provided, it is assumed that the upload is finished.\n\n }, {\n key: \"_updateFilesUploadProgress\",\n value: function _updateFilesUploadProgress(files, xhr, e) {\n if (!files[0].upload.chunked) {\n // Handle file uploads without chunking\n var _iterator17 = dropzone_createForOfIteratorHelper(files, true),\n _step17;\n\n try {\n for (_iterator17.s(); !(_step17 = _iterator17.n()).done;) {\n var file = _step17.value;\n\n if (file.upload.total && file.upload.bytesSent && file.upload.bytesSent == file.upload.total) {\n // If both, the `total` and `bytesSent` have already been set, and\n // they are equal (meaning progress is at 100%), we can skip this\n // file, since an upload progress shouldn't go down.\n continue;\n }\n\n if (e) {\n file.upload.progress = 100 * e.loaded / e.total;\n file.upload.total = e.total;\n file.upload.bytesSent = e.loaded;\n } else {\n // No event, so we're at 100%\n file.upload.progress = 100;\n file.upload.bytesSent = file.upload.total;\n }\n\n this.emit(\"uploadprogress\", file, file.upload.progress, file.upload.bytesSent);\n }\n } catch (err) {\n _iterator17.e(err);\n } finally {\n _iterator17.f();\n }\n } else {\n // Handle chunked file uploads\n // Chunked upload is not compatible with uploading multiple files in one\n // request, so we know there's only one file.\n var _file2 = files[0]; // Since this is a chunked upload, we need to update the appropriate chunk\n // progress.\n\n var chunk = this._getChunk(_file2, xhr);\n\n if (e) {\n chunk.progress = 100 * e.loaded / e.total;\n chunk.total = e.total;\n chunk.bytesSent = e.loaded;\n } else {\n // No event, so we're at 100%\n chunk.progress = 100;\n chunk.bytesSent = chunk.total;\n } // Now tally the *file* upload progress from its individual chunks\n\n\n _file2.upload.progress = 0;\n _file2.upload.total = 0;\n _file2.upload.bytesSent = 0;\n\n for (var i = 0; i < _file2.upload.totalChunkCount; i++) {\n if (_file2.upload.chunks[i] && typeof _file2.upload.chunks[i].progress !== \"undefined\") {\n _file2.upload.progress += _file2.upload.chunks[i].progress;\n _file2.upload.total += _file2.upload.chunks[i].total;\n _file2.upload.bytesSent += _file2.upload.chunks[i].bytesSent;\n }\n } // Since the process is a percentage, we need to divide by the amount of\n // chunks we've used.\n\n\n _file2.upload.progress = _file2.upload.progress / _file2.upload.totalChunkCount;\n this.emit(\"uploadprogress\", _file2, _file2.upload.progress, _file2.upload.bytesSent);\n }\n }\n }, {\n key: \"_finishedUploading\",\n value: function _finishedUploading(files, xhr, e) {\n var response;\n\n if (files[0].status === Dropzone.CANCELED) {\n return;\n }\n\n if (xhr.readyState !== 4) {\n return;\n }\n\n if (xhr.responseType !== \"arraybuffer\" && xhr.responseType !== \"blob\") {\n response = xhr.responseText;\n\n if (xhr.getResponseHeader(\"content-type\") && ~xhr.getResponseHeader(\"content-type\").indexOf(\"application/json\")) {\n try {\n response = JSON.parse(response);\n } catch (error) {\n e = error;\n response = \"Invalid JSON response from server.\";\n }\n }\n }\n\n this._updateFilesUploadProgress(files, xhr);\n\n if (!(200 <= xhr.status && xhr.status < 300)) {\n this._handleUploadError(files, xhr, response);\n } else {\n if (files[0].upload.chunked) {\n files[0].upload.finishedChunkUpload(this._getChunk(files[0], xhr), response);\n } else {\n this._finished(files, response, e);\n }\n }\n }\n }, {\n key: \"_handleUploadError\",\n value: function _handleUploadError(files, xhr, response) {\n if (files[0].status === Dropzone.CANCELED) {\n return;\n }\n\n if (files[0].upload.chunked && this.options.retryChunks) {\n var chunk = this._getChunk(files[0], xhr);\n\n if (chunk.retries++ < this.options.retryChunksLimit) {\n this._uploadData(files, [chunk.dataBlock]);\n\n return;\n } else {\n console.warn(\"Retried this chunk too often. Giving up.\");\n }\n }\n\n this._errorProcessing(files, response || this.options.dictResponseError.replace(\"{{statusCode}}\", xhr.status), xhr);\n }\n }, {\n key: \"submitRequest\",\n value: function submitRequest(xhr, formData, files) {\n if (xhr.readyState != 1) {\n console.warn(\"Cannot send this request because the XMLHttpRequest.readyState is not OPENED.\");\n return;\n }\n\n xhr.send(formData);\n } // Called internally when processing is finished.\n // Individual callbacks have to be called in the appropriate sections.\n\n }, {\n key: \"_finished\",\n value: function _finished(files, responseText, e) {\n var _iterator18 = dropzone_createForOfIteratorHelper(files, true),\n _step18;\n\n try {\n for (_iterator18.s(); !(_step18 = _iterator18.n()).done;) {\n var file = _step18.value;\n file.status = Dropzone.SUCCESS;\n this.emit(\"success\", file, responseText, e);\n this.emit(\"complete\", file);\n }\n } catch (err) {\n _iterator18.e(err);\n } finally {\n _iterator18.f();\n }\n\n if (this.options.uploadMultiple) {\n this.emit(\"successmultiple\", files, responseText, e);\n this.emit(\"completemultiple\", files);\n }\n\n if (this.options.autoProcessQueue) {\n return this.processQueue();\n }\n } // Called internally when processing is finished.\n // Individual callbacks have to be called in the appropriate sections.\n\n }, {\n key: \"_errorProcessing\",\n value: function _errorProcessing(files, message, xhr) {\n var _iterator19 = dropzone_createForOfIteratorHelper(files, true),\n _step19;\n\n try {\n for (_iterator19.s(); !(_step19 = _iterator19.n()).done;) {\n var file = _step19.value;\n file.status = Dropzone.ERROR;\n this.emit(\"error\", file, message, xhr);\n this.emit(\"complete\", file);\n }\n } catch (err) {\n _iterator19.e(err);\n } finally {\n _iterator19.f();\n }\n\n if (this.options.uploadMultiple) {\n this.emit(\"errormultiple\", files, message, xhr);\n this.emit(\"completemultiple\", files);\n }\n\n if (this.options.autoProcessQueue) {\n return this.processQueue();\n }\n }\n }], [{\n key: \"initClass\",\n value: function initClass() {\n // Exposing the emitter class, mainly for tests\n this.prototype.Emitter = Emitter;\n /*\n This is a list of all available events you can register on a dropzone object.\n You can register an event handler like this:\n dropzone.on(\"dragEnter\", function() { });\n */\n\n this.prototype.events = [\"drop\", \"dragstart\", \"dragend\", \"dragenter\", \"dragover\", \"dragleave\", \"addedfile\", \"addedfiles\", \"removedfile\", \"thumbnail\", \"error\", \"errormultiple\", \"processing\", \"processingmultiple\", \"uploadprogress\", \"totaluploadprogress\", \"sending\", \"sendingmultiple\", \"success\", \"successmultiple\", \"canceled\", \"canceledmultiple\", \"complete\", \"completemultiple\", \"reset\", \"maxfilesexceeded\", \"maxfilesreached\", \"queuecomplete\"];\n this.prototype._thumbnailQueue = [];\n this.prototype._processingThumbnail = false;\n } // global utility\n\n }, {\n key: \"extend\",\n value: function extend(target) {\n for (var _len2 = arguments.length, objects = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n objects[_key2 - 1] = arguments[_key2];\n }\n\n for (var _i4 = 0, _objects = objects; _i4 < _objects.length; _i4++) {\n var object = _objects[_i4];\n\n for (var key in object) {\n var val = object[key];\n target[key] = val;\n }\n }\n\n return target;\n }\n }, {\n key: \"uuidv4\",\n value: function uuidv4() {\n return \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, function (c) {\n var r = Math.random() * 16 | 0,\n v = c === \"x\" ? r : r & 0x3 | 0x8;\n return v.toString(16);\n });\n }\n }]);\n\n return Dropzone;\n}(Emitter);\n\n\nDropzone.initClass();\nDropzone.version = \"5.9.3\"; // This is a map of options for your different dropzones. Add configurations\n// to this object for your different dropzone elemens.\n//\n// Example:\n//\n// Dropzone.options.myDropzoneElementId = { maxFilesize: 1 };\n//\n// To disable autoDiscover for a specific element, you can set `false` as an option:\n//\n// Dropzone.options.myDisabledElementId = false;\n//\n// And in html:\n//\n// \n\nDropzone.options = {}; // Returns the options for an element or undefined if none available.\n\nDropzone.optionsForElement = function (element) {\n // Get the `Dropzone.options.elementId` for this element if it exists\n if (element.getAttribute(\"id\")) {\n return Dropzone.options[camelize(element.getAttribute(\"id\"))];\n } else {\n return undefined;\n }\n}; // Holds a list of all dropzone instances\n\n\nDropzone.instances = []; // Returns the dropzone for given element if any\n\nDropzone.forElement = function (element) {\n if (typeof element === \"string\") {\n element = document.querySelector(element);\n }\n\n if ((element != null ? element.dropzone : undefined) == null) {\n throw new Error(\"No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone.\");\n }\n\n return element.dropzone;\n}; // Set to false if you don't want Dropzone to automatically find and attach to .dropzone elements.\n\n\nDropzone.autoDiscover = true; // Looks for all .dropzone elements and creates a dropzone for them\n\nDropzone.discover = function () {\n var dropzones;\n\n if (document.querySelectorAll) {\n dropzones = document.querySelectorAll(\".dropzone\");\n } else {\n dropzones = []; // IE :(\n\n var checkElements = function checkElements(elements) {\n return function () {\n var result = [];\n\n var _iterator20 = dropzone_createForOfIteratorHelper(elements, true),\n _step20;\n\n try {\n for (_iterator20.s(); !(_step20 = _iterator20.n()).done;) {\n var el = _step20.value;\n\n if (/(^| )dropzone($| )/.test(el.className)) {\n result.push(dropzones.push(el));\n } else {\n result.push(undefined);\n }\n }\n } catch (err) {\n _iterator20.e(err);\n } finally {\n _iterator20.f();\n }\n\n return result;\n }();\n };\n\n checkElements(document.getElementsByTagName(\"div\"));\n checkElements(document.getElementsByTagName(\"form\"));\n }\n\n return function () {\n var result = [];\n\n var _iterator21 = dropzone_createForOfIteratorHelper(dropzones, true),\n _step21;\n\n try {\n for (_iterator21.s(); !(_step21 = _iterator21.n()).done;) {\n var dropzone = _step21.value;\n\n // Create a dropzone unless auto discover has been disabled for specific element\n if (Dropzone.optionsForElement(dropzone) !== false) {\n result.push(new Dropzone(dropzone));\n } else {\n result.push(undefined);\n }\n }\n } catch (err) {\n _iterator21.e(err);\n } finally {\n _iterator21.f();\n }\n\n return result;\n }();\n}; // Some browsers support drag and drog functionality, but not correctly.\n//\n// So I created a blocklist of userAgents. Yes, yes. Browser sniffing, I know.\n// But what to do when browsers *theoretically* support an API, but crash\n// when using it.\n//\n// This is a list of regular expressions tested against navigator.userAgent\n//\n// ** It should only be used on browser that *do* support the API, but\n// incorrectly **\n\n\nDropzone.blockedBrowsers = [// The mac os and windows phone version of opera 12 seems to have a problem with the File drag'n'drop API.\n/opera.*(Macintosh|Windows Phone).*version\\/12/i]; // Checks if the browser is supported\n\nDropzone.isBrowserSupported = function () {\n var capableBrowser = true;\n\n if (window.File && window.FileReader && window.FileList && window.Blob && window.FormData && document.querySelector) {\n if (!(\"classList\" in document.createElement(\"a\"))) {\n capableBrowser = false;\n } else {\n if (Dropzone.blacklistedBrowsers !== undefined) {\n // Since this has been renamed, this makes sure we don't break older\n // configuration.\n Dropzone.blockedBrowsers = Dropzone.blacklistedBrowsers;\n } // The browser supports the API, but may be blocked.\n\n\n var _iterator22 = dropzone_createForOfIteratorHelper(Dropzone.blockedBrowsers, true),\n _step22;\n\n try {\n for (_iterator22.s(); !(_step22 = _iterator22.n()).done;) {\n var regex = _step22.value;\n\n if (regex.test(navigator.userAgent)) {\n capableBrowser = false;\n continue;\n }\n }\n } catch (err) {\n _iterator22.e(err);\n } finally {\n _iterator22.f();\n }\n }\n } else {\n capableBrowser = false;\n }\n\n return capableBrowser;\n};\n\nDropzone.dataURItoBlob = function (dataURI) {\n // convert base64 to raw binary data held in a string\n // doesn't handle URLEncoded DataURIs - see SO answer #6850276 for code that does this\n var byteString = atob(dataURI.split(\",\")[1]); // separate out the mime component\n\n var mimeString = dataURI.split(\",\")[0].split(\":\")[1].split(\";\")[0]; // write the bytes of the string to an ArrayBuffer\n\n var ab = new ArrayBuffer(byteString.length);\n var ia = new Uint8Array(ab);\n\n for (var i = 0, end = byteString.length, asc = 0 <= end; asc ? i <= end : i >= end; asc ? i++ : i--) {\n ia[i] = byteString.charCodeAt(i);\n } // write the ArrayBuffer to a blob\n\n\n return new Blob([ab], {\n type: mimeString\n });\n}; // Returns an array without the rejected item\n\n\nvar without = function without(list, rejectedItem) {\n return list.filter(function (item) {\n return item !== rejectedItem;\n }).map(function (item) {\n return item;\n });\n}; // abc-def_ghi -> abcDefGhi\n\n\nvar camelize = function camelize(str) {\n return str.replace(/[\\-_](\\w)/g, function (match) {\n return match.charAt(1).toUpperCase();\n });\n}; // Creates an element from string\n\n\nDropzone.createElement = function (string) {\n var div = document.createElement(\"div\");\n div.innerHTML = string;\n return div.childNodes[0];\n}; // Tests if given element is inside (or simply is) the container\n\n\nDropzone.elementInside = function (element, container) {\n if (element === container) {\n return true;\n } // Coffeescript doesn't support do/while loops\n\n\n while (element = element.parentNode) {\n if (element === container) {\n return true;\n }\n }\n\n return false;\n};\n\nDropzone.getElement = function (el, name) {\n var element;\n\n if (typeof el === \"string\") {\n element = document.querySelector(el);\n } else if (el.nodeType != null) {\n element = el;\n }\n\n if (element == null) {\n throw new Error(\"Invalid `\".concat(name, \"` option provided. Please provide a CSS selector or a plain HTML element.\"));\n }\n\n return element;\n};\n\nDropzone.getElements = function (els, name) {\n var el, elements;\n\n if (els instanceof Array) {\n elements = [];\n\n try {\n var _iterator23 = dropzone_createForOfIteratorHelper(els, true),\n _step23;\n\n try {\n for (_iterator23.s(); !(_step23 = _iterator23.n()).done;) {\n el = _step23.value;\n elements.push(this.getElement(el, name));\n }\n } catch (err) {\n _iterator23.e(err);\n } finally {\n _iterator23.f();\n }\n } catch (e) {\n elements = null;\n }\n } else if (typeof els === \"string\") {\n elements = [];\n\n var _iterator24 = dropzone_createForOfIteratorHelper(document.querySelectorAll(els), true),\n _step24;\n\n try {\n for (_iterator24.s(); !(_step24 = _iterator24.n()).done;) {\n el = _step24.value;\n elements.push(el);\n }\n } catch (err) {\n _iterator24.e(err);\n } finally {\n _iterator24.f();\n }\n } else if (els.nodeType != null) {\n elements = [els];\n }\n\n if (elements == null || !elements.length) {\n throw new Error(\"Invalid `\".concat(name, \"` option provided. Please provide a CSS selector, a plain HTML element or a list of those.\"));\n }\n\n return elements;\n}; // Asks the user the question and calls accepted or rejected accordingly\n//\n// The default implementation just uses `window.confirm` and then calls the\n// appropriate callback.\n\n\nDropzone.confirm = function (question, accepted, rejected) {\n if (window.confirm(question)) {\n return accepted();\n } else if (rejected != null) {\n return rejected();\n }\n}; // Validates the mime type like this:\n//\n// https://developer.mozilla.org/en-US/docs/HTML/Element/input#attr-accept\n\n\nDropzone.isValidFile = function (file, acceptedFiles) {\n if (!acceptedFiles) {\n return true;\n } // If there are no accepted mime types, it's OK\n\n\n acceptedFiles = acceptedFiles.split(\",\");\n var mimeType = file.type;\n var baseMimeType = mimeType.replace(/\\/.*$/, \"\");\n\n var _iterator25 = dropzone_createForOfIteratorHelper(acceptedFiles, true),\n _step25;\n\n try {\n for (_iterator25.s(); !(_step25 = _iterator25.n()).done;) {\n var validType = _step25.value;\n validType = validType.trim();\n\n if (validType.charAt(0) === \".\") {\n if (file.name.toLowerCase().indexOf(validType.toLowerCase(), file.name.length - validType.length) !== -1) {\n return true;\n }\n } else if (/\\/\\*$/.test(validType)) {\n // This is something like a image/* mime type\n if (baseMimeType === validType.replace(/\\/.*$/, \"\")) {\n return true;\n }\n } else {\n if (mimeType === validType) {\n return true;\n }\n }\n }\n } catch (err) {\n _iterator25.e(err);\n } finally {\n _iterator25.f();\n }\n\n return false;\n}; // Augment jQuery\n\n\nif (typeof jQuery !== \"undefined\" && jQuery !== null) {\n jQuery.fn.dropzone = function (options) {\n return this.each(function () {\n return new Dropzone(this, options);\n });\n };\n} // Dropzone file status codes\n\n\nDropzone.ADDED = \"added\";\nDropzone.QUEUED = \"queued\"; // For backwards compatibility. Now, if a file is accepted, it's either queued\n// or uploading.\n\nDropzone.ACCEPTED = Dropzone.QUEUED;\nDropzone.UPLOADING = \"uploading\";\nDropzone.PROCESSING = Dropzone.UPLOADING; // alias\n\nDropzone.CANCELED = \"canceled\";\nDropzone.ERROR = \"error\";\nDropzone.SUCCESS = \"success\";\n/*\n\n Bugfix for iOS 6 and 7\n Source: http://stackoverflow.com/questions/11929099/html5-canvas-drawimage-ratio-bug-ios\n based on the work of https://github.com/stomita/ios-imagefile-megapixel\n\n */\n// Detecting vertical squash in loaded image.\n// Fixes a bug which squash image vertically while drawing into canvas for some images.\n// This is a bug in iOS6 devices. This function from https://github.com/stomita/ios-imagefile-megapixel\n\nvar detectVerticalSquash = function detectVerticalSquash(img) {\n var iw = img.naturalWidth;\n var ih = img.naturalHeight;\n var canvas = document.createElement(\"canvas\");\n canvas.width = 1;\n canvas.height = ih;\n var ctx = canvas.getContext(\"2d\");\n ctx.drawImage(img, 0, 0);\n\n var _ctx$getImageData = ctx.getImageData(1, 0, 1, ih),\n data = _ctx$getImageData.data; // search image edge pixel position in case it is squashed vertically.\n\n\n var sy = 0;\n var ey = ih;\n var py = ih;\n\n while (py > sy) {\n var alpha = data[(py - 1) * 4 + 3];\n\n if (alpha === 0) {\n ey = py;\n } else {\n sy = py;\n }\n\n py = ey + sy >> 1;\n }\n\n var ratio = py / ih;\n\n if (ratio === 0) {\n return 1;\n } else {\n return ratio;\n }\n}; // A replacement for context.drawImage\n// (args are for source and destination).\n\n\nvar drawImageIOSFix = function drawImageIOSFix(ctx, img, sx, sy, sw, sh, dx, dy, dw, dh) {\n var vertSquashRatio = detectVerticalSquash(img);\n return ctx.drawImage(img, sx, sy, sw, sh, dx, dy, dw, dh / vertSquashRatio);\n}; // Based on MinifyJpeg\n// Source: http://www.perry.cz/files/ExifRestorer.js\n// http://elicon.blog57.fc2.com/blog-entry-206.html\n\n\nvar ExifRestore = /*#__PURE__*/function () {\n function ExifRestore() {\n dropzone_classCallCheck(this, ExifRestore);\n }\n\n dropzone_createClass(ExifRestore, null, [{\n key: \"initClass\",\n value: function initClass() {\n this.KEY_STR = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n }\n }, {\n key: \"encode64\",\n value: function encode64(input) {\n var output = \"\";\n var chr1 = undefined;\n var chr2 = undefined;\n var chr3 = \"\";\n var enc1 = undefined;\n var enc2 = undefined;\n var enc3 = undefined;\n var enc4 = \"\";\n var i = 0;\n\n while (true) {\n chr1 = input[i++];\n chr2 = input[i++];\n chr3 = input[i++];\n enc1 = chr1 >> 2;\n enc2 = (chr1 & 3) << 4 | chr2 >> 4;\n enc3 = (chr2 & 15) << 2 | chr3 >> 6;\n enc4 = chr3 & 63;\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64;\n } else if (isNaN(chr3)) {\n enc4 = 64;\n }\n\n output = output + this.KEY_STR.charAt(enc1) + this.KEY_STR.charAt(enc2) + this.KEY_STR.charAt(enc3) + this.KEY_STR.charAt(enc4);\n chr1 = chr2 = chr3 = \"\";\n enc1 = enc2 = enc3 = enc4 = \"\";\n\n if (!(i < input.length)) {\n break;\n }\n }\n\n return output;\n }\n }, {\n key: \"restore\",\n value: function restore(origFileBase64, resizedFileBase64) {\n if (!origFileBase64.match(\"data:image/jpeg;base64,\")) {\n return resizedFileBase64;\n }\n\n var rawImage = this.decode64(origFileBase64.replace(\"data:image/jpeg;base64,\", \"\"));\n var segments = this.slice2Segments(rawImage);\n var image = this.exifManipulation(resizedFileBase64, segments);\n return \"data:image/jpeg;base64,\".concat(this.encode64(image));\n }\n }, {\n key: \"exifManipulation\",\n value: function exifManipulation(resizedFileBase64, segments) {\n var exifArray = this.getExifArray(segments);\n var newImageArray = this.insertExif(resizedFileBase64, exifArray);\n var aBuffer = new Uint8Array(newImageArray);\n return aBuffer;\n }\n }, {\n key: \"getExifArray\",\n value: function getExifArray(segments) {\n var seg = undefined;\n var x = 0;\n\n while (x < segments.length) {\n seg = segments[x];\n\n if (seg[0] === 255 & seg[1] === 225) {\n return seg;\n }\n\n x++;\n }\n\n return [];\n }\n }, {\n key: \"insertExif\",\n value: function insertExif(resizedFileBase64, exifArray) {\n var imageData = resizedFileBase64.replace(\"data:image/jpeg;base64,\", \"\");\n var buf = this.decode64(imageData);\n var separatePoint = buf.indexOf(255, 3);\n var mae = buf.slice(0, separatePoint);\n var ato = buf.slice(separatePoint);\n var array = mae;\n array = array.concat(exifArray);\n array = array.concat(ato);\n return array;\n }\n }, {\n key: \"slice2Segments\",\n value: function slice2Segments(rawImageArray) {\n var head = 0;\n var segments = [];\n\n while (true) {\n var length;\n\n if (rawImageArray[head] === 255 & rawImageArray[head + 1] === 218) {\n break;\n }\n\n if (rawImageArray[head] === 255 & rawImageArray[head + 1] === 216) {\n head += 2;\n } else {\n length = rawImageArray[head + 2] * 256 + rawImageArray[head + 3];\n var endPoint = head + length + 2;\n var seg = rawImageArray.slice(head, endPoint);\n segments.push(seg);\n head = endPoint;\n }\n\n if (head > rawImageArray.length) {\n break;\n }\n }\n\n return segments;\n }\n }, {\n key: \"decode64\",\n value: function decode64(input) {\n var output = \"\";\n var chr1 = undefined;\n var chr2 = undefined;\n var chr3 = \"\";\n var enc1 = undefined;\n var enc2 = undefined;\n var enc3 = undefined;\n var enc4 = \"\";\n var i = 0;\n var buf = []; // remove all characters that are not A-Z, a-z, 0-9, +, /, or =\n\n var base64test = /[^A-Za-z0-9\\+\\/\\=]/g;\n\n if (base64test.exec(input)) {\n console.warn(\"There were invalid base64 characters in the input text.\\nValid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='\\nExpect errors in decoding.\");\n }\n\n input = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, \"\");\n\n while (true) {\n enc1 = this.KEY_STR.indexOf(input.charAt(i++));\n enc2 = this.KEY_STR.indexOf(input.charAt(i++));\n enc3 = this.KEY_STR.indexOf(input.charAt(i++));\n enc4 = this.KEY_STR.indexOf(input.charAt(i++));\n chr1 = enc1 << 2 | enc2 >> 4;\n chr2 = (enc2 & 15) << 4 | enc3 >> 2;\n chr3 = (enc3 & 3) << 6 | enc4;\n buf.push(chr1);\n\n if (enc3 !== 64) {\n buf.push(chr2);\n }\n\n if (enc4 !== 64) {\n buf.push(chr3);\n }\n\n chr1 = chr2 = chr3 = \"\";\n enc1 = enc2 = enc3 = enc4 = \"\";\n\n if (!(i < input.length)) {\n break;\n }\n }\n\n return buf;\n }\n }]);\n\n return ExifRestore;\n}();\n\nExifRestore.initClass();\n/*\n * contentloaded.js\n *\n * Author: Diego Perini (diego.perini at gmail.com)\n * Summary: cross-browser wrapper for DOMContentLoaded\n * Updated: 20101020\n * License: MIT\n * Version: 1.2\n *\n * URL:\n * http://javascript.nwbox.com/ContentLoaded/\n * http://javascript.nwbox.com/ContentLoaded/MIT-LICENSE\n */\n// @win window reference\n// @fn function reference\n\nvar contentLoaded = function contentLoaded(win, fn) {\n var done = false;\n var top = true;\n var doc = win.document;\n var root = doc.documentElement;\n var add = doc.addEventListener ? \"addEventListener\" : \"attachEvent\";\n var rem = doc.addEventListener ? \"removeEventListener\" : \"detachEvent\";\n var pre = doc.addEventListener ? \"\" : \"on\";\n\n var init = function init(e) {\n if (e.type === \"readystatechange\" && doc.readyState !== \"complete\") {\n return;\n }\n\n (e.type === \"load\" ? win : doc)[rem](pre + e.type, init, false);\n\n if (!done && (done = true)) {\n return fn.call(win, e.type || e);\n }\n };\n\n var poll = function poll() {\n try {\n root.doScroll(\"left\");\n } catch (e) {\n setTimeout(poll, 50);\n return;\n }\n\n return init(\"poll\");\n };\n\n if (doc.readyState !== \"complete\") {\n if (doc.createEventObject && root.doScroll) {\n try {\n top = !win.frameElement;\n } catch (error) {}\n\n if (top) {\n poll();\n }\n }\n\n doc[add](pre + \"DOMContentLoaded\", init, false);\n doc[add](pre + \"readystatechange\", init, false);\n return win[add](pre + \"load\", init, false);\n }\n}; // As a single function to be able to write tests.\n\n\nDropzone._autoDiscoverFunction = function () {\n if (Dropzone.autoDiscover) {\n return Dropzone.discover();\n }\n};\n\ncontentLoaded(window, Dropzone._autoDiscoverFunction);\n\nfunction __guard__(value, transform) {\n return typeof value !== \"undefined\" && value !== null ? transform(value) : undefined;\n}\n\nfunction __guardMethod__(obj, methodName, transform) {\n if (typeof obj !== \"undefined\" && obj !== null && typeof obj[methodName] === \"function\") {\n return transform(obj, methodName);\n } else {\n return undefined;\n }\n}\n\n\n;// CONCATENATED MODULE: ./tool/dropzone.dist.js\n /// Make Dropzone a global variable.\n\nwindow.Dropzone = Dropzone;\n/* harmony default export */ var dropzone_dist = (Dropzone);\n\n}();\n/******/ \treturn __webpack_exports__;\n/******/ })()\n;\n});","\r\n{#if (disabled == null)}\r\n
\r\n Thank you for completing the online registration form for the {projectSettings.classActionName}.\r\n
\r\n\r\n
\r\n Your registration number is: {$model.RegistrationNumber}\r\n
\r\n\r\n
\r\n If you have any questions, please contact Shine Lawyers on {projectSettings.phoneNumber}, or at\r\n {projectSettings.emailAddress}\r\n and quote the registration number above.\r\n
\r\n To add files to your registration for the {projectSettings.classActionName} please click \"UPLOAD FILES\".\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n If you require support completing this form, please contact Shine Lawyers on {projectSettings.phoneNumber}\r\n or via email to\r\n {projectSettings.emailAddress}.\r\n
\r\n
\r\n
\r\n\r\n\r\n","\r\n\r\n\r\n
\r\n \r\n
\r\n \r\n \r\n
\r\n
\r\n\r\n
\r\n
\r\n \r\n
\r\n
\r\n\r\n\r\n\r\n\r\n","\r\n\r\n\r\n
\r\n
\r\n
Thank you
\r\n\r\n
\r\n Thank you for adding supporting documentation to your registration for the {projectSettings.classActionName}.\r\n
\r\n\r\n
\r\n Your registration number is: {$model.RegistrationNumber}\r\n
\r\n\r\n
\r\n If you have any questions, please contact Shine Lawyers on {projectSettings.phoneNumber}, or at\r\n {projectSettings.emailAddress},\r\n and quote the registration number above.\r\n
\r\n
\r\n
\r\n\r\n\r\n","\r\n\r\n\r\n
\r\n
\r\n
{projectSettings.classActionName}
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n Litigation Funding Agreement and Conditional Costs Agreements\r\n
\r\n
\r\n {$model.IsDeceased ? 'To the Personal Representative of the Estate of' : 'Dear'} {$model.FirstName} {$model.Surname},\r\n
\r\n\r\n
\r\n To allow Shine Lawyers to deliver all legal and professional work required to run the Ruby Princess Class Action and to verify, conduct and quantify your claim, we request you sign the Litigation Funding and Conditional Costs Agreement.\r\n
\r\n
\r\n To access and agree to the Litigation Funding Agreement and Conditional Costs Agreement, please click on the button below. Please note that your signature is not required to sign these online agreements. \r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n If you require support accessing or signing these documents, please contact us on \r\n {projectSettings.phoneNumber} or via email to\r\n {projectSettings.emailAddress}.\r\n
Litigation Funding Agreement and Conditional Costs Agreement
\r\n\r\n
\r\n To obtain funding for Shine Lawyers to deliver all legal and professional work required\r\n to run the class action and to verify, conduct and quantify your claim, we request\r\n you sign the Litigation Funding and Conditional Costs Agreements. These can be accessed via the unique links below; please note that your signature is not required to sign these online agreements.\r\n
\r\n
\r\n You can agree to these agreements in one of two ways:\r\n
\r\n
\r\n
Tick the boxes below; OR
\r\n
\r\n If you wish, you are welcome to download hardcopy versions of these agreements which can\r\n be downloaded below. To return, please print, sign and then post or email the agreements to\r\n our offices on PO Box 589, Darlinghurst NSW 1300.\r\n
\r\n
\r\n\r\n
\r\n
\r\n \r\n
\r\n
\r\n\r\n
\r\n If you are having trouble viewing the funding and costs agreements or would like to download a copy, see below:\r\n
\r\n I confirm that I am the claimant described above, or am duly authorised to act on the claimant's behalf I understand that I am entering into a legally binding agreement (the Funding Agreement and Costs Agreement)\r\n
\r\n
\r\n I confirm that I have been informed of my right to obtain, and have obtained, all independent legal, financial and other professional advice before entering into the Agreements that I consider necessary\r\n
\r\n
\r\n I expressly consent to this method of acceptance in accordance with s9(1) of the Electronic Transactions (New South Wales) Act 2000 and accept the terms of the agreement by electronic acceptance\r\n
\r\n
\r\n I consent to Shine Lawyers and Balance Legal Capital I UK Ltd collecting, storing, using and disclosing personal information provided by me in accordance with and subject to the Agreements and the Privacy Policy which is available on the Shine website.\r\n
\r\n
\r\n I understand I have a 5 day cooling off period from the date I sign this registration form, which cooling off period enables me to seek external legal advice, raise any questions, negotiate terms or withdraw from the agreements\r\n
\r\n Thank you for entering into the Litigation Funding Agreement and Conditional Costs Agreement for your registration in the {projectSettings.classActionName}.\r\n
\r\n\r\n
\r\n Your registration number is: {$model.RegistrationNumber}\r\n
\r\n\r\n
\r\n If you have any questions, please contact Shine Lawyers on {projectSettings.phoneNumber}, or at\r\n {projectSettings.emailAddress},\r\n and quote the registration number above.\r\n
\r\n\r\n
\r\n The {projectSettings.classActionName}\r\n page on our website will be kept up to date with the latest developments in the case, so we \r\n encourage you to refer to the website for future case updates. If you have any questions regarding this update, please do not hesitate to contact us.\r\n
\r\n To electronically confirm your agreement to the amendment to the Conditional Costs Agreement{osText} please click \"CONTINUE\".\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n If you require support completing this form, please contact us on\r\n or via email to\r\n .\r\n
\r\n
\r\n
\r\n {/if}\r\n\r\n\r\n","\r\n\r\n\r\n
Letter from Shine amending the Conditional Cost Agreement
\r\n\r\n
\r\n
\r\n This letter sets out an update to the Conditional Cost Agreement between you and Shine Lawyers addressing the additional cost and disbursements required to run the application regarding whether overseas group members can participate in this class action.\r\n
\r\n
\r\n
\r\n
\r\n Pleased be assured that no matter the outcome of the class action, successful or unsuccessful, you will not have to pay any out-of-pocket costs.\r\n
\r\n
\r\n
\r\n
\r\n If you require support completing this form, please contact Shine Lawyers on\r\n or via email to\r\n .\r\n
\r\n
\r\n\r\n
\r\n
\r\n If you are having trouble viewing the letter or would like to download a copy please click here.\r\n
\r\n This is the new Litigation Funding Agreement.\r\n
\r\n
\r\n
\r\n
\r\n It addresses the additional cost and disbursements required to run the application regarding whether overseas group members can participate in this class action.\r\n
\r\n
\r\n
\r\n
\r\n If you require support completing this form, please contact Shine Lawyers on\r\n or via email to\r\n .\r\n
\r\n
\r\n\r\n
\r\n
\r\n If you are having trouble viewing the agreement or would like to download a copy please click here.\r\n
\r\n
\r\n\r\n
\r\n
\r\n \r\n
\r\n
\r\n\r\n\r\n \r\n\r\n\r\n\r\n","\r\n\r\n\r\n
Conflicts Disclosure Statement
\r\n\r\n
\r\n
\r\n The Corporations Act 2001 (Cth) requires that, in respect of the class action Proceedings, the Litigation Funder (Balance) must maintain adequate practices for management of conflicts of interest.\r\n
\r\n
\r\n
\r\n
\r\n This letter is written to you to provide you with information to assist you in understanding Balance's interests, any potential conflicts with group member's interests and how any conflicts will be managed.\r\n
\r\n
\r\n
\r\n
\r\n This letter is an important document and we ask you to read it carefully. You are not required to sign the letter, but please keep a copy for your records.\r\n
\r\n
\r\n
\r\n
\r\n If you require support completing this form, please contact Shine Lawyers on\r\n or via email to\r\n .\r\n
\r\n
\r\n\r\n
\r\n
\r\n If you are having trouble viewing the conflicts disclosure statement or would like to download a copy please click here.\r\n
\r\n
\r\n\r\n
\r\n
\r\n \r\n
\r\n
\r\n\r\n \r\n\r\n\r\n\r\n","\r\n\r\n\r\n
\r\n
\r\n
Thank you
\r\n\r\n
\r\n Thank you for confirming your agreement to the amendment to the Conditional Costs Agreement{osText}.\r\n
\r\n\r\n
\r\n Your registration number is: {$model.RegistrationNumber}\r\n
\r\n\r\n
\r\n If you have any questions, please contact Shine Lawyers on , or at\r\n ,\r\n and quote the registration number above.\r\n
\r\n To electronically acknowledge and accept the amendment to the Conditional Costs Agreement please click \"CONTINUE\".\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n If you require support completing this form, please contact us on\r\n or via email to\r\n .\r\n
\r\n
\r\n
\r\n\r\n\r\n","\r\n\r\n\r\n
Letter from Shine Lawyers updating legal costs estimate
\r\n\r\n
\r\n
\r\n This letter sets out an update to the legal costs estimate in the Conditional Cost Agreement between you and Shine Lawyers. The updated costs estimate provides for an increase in the total estimate of legal costs due to various matters set out in the letter.\r\n
\r\n
\r\n
\r\n
\r\n Pleased be assured that no matter the outcome of the class action, successful or unsuccessful, you will not have to pay any out-of-pocket costs.\r\n
\r\n
\r\n
\r\n
\r\n If you require support completing this form, please contact Shine Lawyers on\r\n or via email to\r\n .\r\n
\r\n
\r\n\r\n
\r\n
\r\n If you are having trouble viewing the letter or would like to download a copy please click here.\r\n
\r\n
\r\n\r\n
\r\n
\r\n \r\n
\r\n
\r\n\r\n\r\n \r\n\r\n\r\n\r\n\r\n","\r\n\r\n\r\n
\r\n
\r\n
Thank you
\r\n\r\n
\r\n Thank you for confirming your acceptance of the amendment to the Conditional Costs Agreement.\r\n
\r\n\r\n
\r\n Your registration number is: {$model.RegistrationNumber}\r\n
\r\n\r\n
\r\n If you have any questions, please contact Shine Lawyers on , or at\r\n ,\r\n and quote the registration number above.\r\n
\r\n To electronically accept the document(s) sent regarding your registration for the {projectSettings.classActionName} please click \"CONTINUE\".\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n If you require support completing this form, please contact Shine Lawyers on\r\n or via email to\r\n .\r\n
\r\n
\r\n
\r\n\r\n\r\n","\r\n\r\n\r\n
Costs Agreement
\r\n\r\n
\r\n
\r\n \r\n
\r\n
\r\n\r\n
\r\n
\r\n If you are having trouble viewing the costs agreement or would like to download a copy please click here.\r\n
\r\n
\r\n\r\n \r\n\r\n\r\n\r\n\r\n","\r\n\r\n\r\n\r\n
Funding Agreement
\r\n\r\n
\r\n
\r\n \r\n
\r\n
\r\n\r\n
\r\n
\r\n
If you are having trouble viewing the agreement or would like to download a copy please click here.
\r\n Thank you for acknowledging the Funding and Costs Agreement for your registration for the {projectSettings.classActionName}.\r\n
\r\n\r\n
\r\n Your registration number is: {$model.RegistrationNumber}\r\n
\r\n\r\n
\r\n If you have any questions, please contact Shine Lawyers on {projectSettings.phoneNumber}, or at\r\n {projectSettings.emailAddress},\r\n and quote the registration number above.\r\n
\r\n\t\t\tYou have previously submitted the Questionnaire, you are unable to complete this form again.\r\n\t\t\t \r\n\t\t\tIf you need to amend any of the details provided, please contact Shine Lawyers on or via email to . \r\n\t\t
\r\n \r\n\t\t
\r\n\t\t\tYours sincerely, \r\n\t\t
\r\n\t\t
\r\n\t\t\tShine Lawyers \r\n\t\t
\r\n\t{:else}\r\n\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t
\r\n\t\t\t\t\tQuestions relating to your COVID-19 Infection\r\n\t\t\t\t
\r\n\r\n\t\t\t\t
\r\n\t\t\t\t\tIn preparing for mediation Shine Lawyers are seeking to\r\n\t\t\t\t\tdetermine the potential value of group members individual\r\n\t\t\t\t\tclaims. As part of this process, we require additional\r\n\t\t\t\t\tinformation from you about your injuries arising from the Ruby\r\n\t\t\t\t\tPrincess Cruise.\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\tWe appreciate you taking the time to fill out this further\r\n\t\t\t\t\tquestionnaire.\r\n\t\t\t\t
\r\n Please check the below details are correct before submitting your\r\n registration.\r\n
\r\n \r\n\r\n \r\n\r\n{/if}\r\n","\r\n\r\n\r\n
\r\n
\r\n
Thank you
\r\n\r\n
\r\n Thank you for completing your questionnaire for the {projectSettings.classActionName}.\r\n
\r\n\r\n
\r\n\r\n
\r\n If you have any questions, please contact Shine Lawyers on {projectSettings.phoneNumber}, or at\r\n {projectSettings.emailAddress}.\r\n
\r\n \r\n
\r\n\r\n
\r\n
What happens next
\r\n
\r\n If you consented to us obtaining your medical records from your General Practitioner(s) (GPs), you will shortly receive General Authority forms matching the number of GPs who treated you. These forms will be sent to you via DocuSign. Please complete this form for each of the relevant GPs. \r\n
\r\n
\r\n We thank you for your support and cooperation throughout this process. We will be in touch shortly. \r\n
\r\n
\r\n
\r\n\r\n\r\n\r\n","\r\n\r\n\r\n \r\n\r\n","const getCalendarPage = (month, year, dayProps, weekStart = 0) => {\r\n let date = new Date(year, month, 1);\r\n date.setDate(date.getDate() - date.getDay() + weekStart);\r\n let nextMonth = month === 11 ? 0 : month + 1;\r\n // ensure days starts on Sunday\r\n // and end on saturday\r\n let weeks = [];\r\n while (date.getMonth() !== nextMonth || date.getDay() !== weekStart || weeks.length !== 6) {\r\n if (date.getDay() === weekStart) weeks.unshift({ days: [], id: `${year}${month}${year}${weeks.length}` });\r\n const updated = Object.assign({\r\n partOfMonth: date.getMonth() === month,\r\n date: new Date(date)\r\n }, dayProps(date));\r\n weeks[0].days.push(updated);\r\n date.setDate(date.getDate() + 1);\r\n }\r\n weeks.reverse();\r\n return { month, year, weeks };\r\n};\r\n\r\nconst getDayPropsHandler = (start, end, selectableCallback) => {\r\n let today = new Date();\r\n today.setHours(0, 0, 0, 0);\r\n return date => ({\r\n selectable: date >= start && date <= end\r\n && (!selectableCallback || selectableCallback(date)),\r\n isToday: date.getTime() === today.getTime()\r\n });\r\n};\r\n\r\nexport function getMonths(start, end, selectableCallback = null, weekStart = 0) {\r\n start.setHours(0, 0, 0, 0);\r\n end.setHours(0, 0, 0, 0);\r\n let endDate = new Date(end.getFullYear(), end.getMonth() + 1, 1);\r\n let months = [];\r\n let date = new Date(start.getFullYear(), start.getMonth(), 1);\r\n let dayPropsHandler = getDayPropsHandler(start, end, selectableCallback);\r\n while (date < endDate) {\r\n months.push(getCalendarPage(date.getMonth(), date.getFullYear(), dayPropsHandler, weekStart));\r\n date.setMonth(date.getMonth() + 1);\r\n }\r\n return months;\r\n}\r\n\r\nexport const areDatesEquivalent = (a, b) =>\r\n Object.prototype.toString.call(a) === \"[object Date]\"\r\n && Object.prototype.toString.call(b) === \"[object Date]\"\r\n && a.getDate() === b.getDate()\r\n && a.getMonth() === b.getMonth()\r\n && a.getFullYear() === b.getFullYear();\r\n\r\n \r\nexport const camelCaseToDash = str => str\r\n .replace(/([a-zA-Z])(?=[A-Z])/g, '$1-').toLowerCase();\r\n\r\nexport const toCssString = (props) => props && Object.keys(props)\r\n .reduce((str, key) => `${str}; ${camelCaseToDash(key)}: ${props[key]}`, '');\r\n","\r\n\r\n
\r\n {#each days as day}\r\n
\r\n \r\n
\r\n {/each}\r\n
\r\n\r\n\r\n","\r\n\r\n
\r\n {#each visibleMonth.weeks as week (week.id) }\r\n \r\n {/each}\r\n
\r\n\r\n\r\n","\r\n\r\n
\r\n
\r\n
dispatch('incrementMonth', -1)}>\r\n \r\n
\r\n
\r\n {monthsOfYear[month][0]} {year}\r\n
\r\n
dispatch('incrementMonth', 1)}>\r\n \r\n
\r\n
\r\n
\r\n {#each availableMonths as monthDefinition, index}\r\n
\r\n\t\t\tYou have previously submitted the Questionnaire, you are unable to complete this form again.\r\n\t\t\t \r\n\t\t\tIf you need to amend any of the details provided, please contact Shine Lawyers on or via email to . \r\n\t\t
\r\n \r\n\t\t
\r\n\t\t\tYours sincerely, \r\n\t\t
\r\n\t\t
\r\n\t\t\tShine Lawyers \r\n\t\t
\r\n\t{:else}\r\n\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t
\r\n\t\t\t\t\tQuestions relating to your COVID-19 Infection\r\n\t\t\t\t
\r\n\r\n\t\t\t\t
\r\n\t\t\t\t\tIn preparing for mediation Shine Lawyers are seeking to\r\n\t\t\t\t\tdetermine the potential value of group members individual\r\n\t\t\t\t\tclaims. As part of this process, we require additional\r\n\t\t\t\t\tinformation from you about your injuries arising from the Ruby\r\n\t\t\t\t\tPrincess Cruise.\r\n\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t\t\tWe appreciate you taking the time to fill out this further\r\n\t\t\t\t\tquestionnaire.\r\n\t\t\t\t
\r\n Please check the below details are correct before submitting your\r\n registration.\r\n
\r\n \r\n\r\n \r\n\r\n{/if}\r\n","\r\n\r\n\r\n
\r\n
\r\n
Thank you
\r\n\r\n
\r\n Thank you for completing your questionnaire for the {projectSettings.classActionName}.\r\n
\r\n\r\n
\r\n\r\n
\r\n If you have any questions, please contact Shine Lawyers on {projectSettings.phoneNumber}, or at\r\n {projectSettings.emailAddress}.\r\n
\r\n \r\n
\r\n\r\n
\r\n
What happens next
\r\n
\r\n If you consented to us obtaining your medical records from your General Practitioner(s) (GPs), you will shortly receive General Authority forms matching the number of GPs who treated you. These forms will be sent to you via DocuSign. Please complete this form for each of the relevant GPs. \r\n
\r\n
\r\n We thank you for your support and cooperation throughout this process. We will be in touch shortly. \r\n
\r\n Thank you for trying to complete your registration form for the {projectSettings.classActionName}.\r\n Unfortunately there has been a problem.\r\n
\r\n
\r\n Please contact Shine Lawyers on {projectSettings.phoneNumber}, or at\r\n {projectSettings.emailAddress},\r\n and quote the registration number below and we can help you out.\r\n
\r\n
\r\n Your registration number is: {$model.RegistrationNumber}\r\n