vendor: 1,396 bytes, lines 1-29
1"use strict"; 2(() => { 3 var __create = Object.create; 4 var __defProp = Object.defineProperty; 5 var __getOwnPropDesc = Object.getOwnPropertyDescriptor; 6 var __getOwnPropNames = Object.getOwnPropertyNames; 7 var __getProtoOf = Object.getPrototypeOf; 8 var __hasOwnProp = Object.prototype.hasOwnProperty; 9 var __commonJS = (cb, mod) => function __require() { 10 return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; 11 }; 12 var __copyProps = (to, from, except, desc) => { 13 if (from && typeof from === "object" || typeof from === "function") { 14 for (let key of __getOwnPropNames(from)) 15 if (!__hasOwnProp.call(to, key) && key !== except) 16 __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); 17 } 18 return to; 19 }; 20 var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( 21 // If the importer is in node compatibility mode or this is not an ESM 22 // file that has been converted to a CommonJS file using a Babel- 23 // compatible transform (i.e. "__esModule" has not been set), then set 24 // "default" to the CommonJS "module.exports" for node compatibility. 25 isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, 26 mod 27 )); 28 29
vendor: 257,463 bytes, lines 29-6369
29// node_modules/jquery/dist/jquery.js 30 var require_jquery = __commonJS({ 31 "node_modules/jquery/dist/jquery.js"(exports, module) { 32 (function(global, factory) { 33 "use strict"; 34 if (typeof module === "object" && typeof module.exports === "object") { 35 module.exports = global.document ? factory(global, true) : function(w) { 36 if (!w.document) { 37 throw new Error("jQuery requires a window with a document"); 38 } 39 return factory(w); 40 }; 41 } else { 42 factory(global); 43 } 44 })(typeof window !== "undefined" ? window : exports, function(window2, noGlobal) { 45 "use strict"; 46 var arr2 = []; 47 var getProto = Object.getPrototypeOf; 48 var slice2 = arr2.slice; 49 var flat = arr2.flat ? function(array) { 50 return arr2.flat.call(array); 51 } : function(array) { 52 return arr2.concat.apply([], array); 53 }; 54 var push = arr2.push; 55 var indexOf = arr2.indexOf; 56 var class2type = {}; 57 var toString = class2type.toString; 58 var hasOwn = class2type.hasOwnProperty; 59 var fnToString = hasOwn.toString; 60 var ObjectFunctionString = fnToString.call(Object); 61 var support = {}; 62 var isFunction2 = function isFunction3(obj) { 63 return typeof obj === "function" && typeof obj.nodeType !== "number" && typeof obj.item !== "function"; 64 }; 65 var isWindow = function isWindow2(obj) { 66 return obj != null && obj === obj.window; 67 }; 68 var document2 = window2.document; 69 var preservedScriptAttributes = { 70 type: true, 71 src: true, 72 nonce: true, 73 noModule: true 74 }; 75 function DOMEval(code, node, doc) { 76 doc = doc || document2; 77 var i, val, script = doc.createElement("script"); 78 script.text = code; 79 if (node) { 80 for (i in preservedScriptAttributes) { 81 val = node[i] || node.getAttribute && node.getAttribute(i); 82 if (val) { 83 script.setAttribute(i, val); 84 } 85 } 86 } 87 doc.head.appendChild(script).parentNode.removeChild(script); 88 } 89 function toType(obj) { 90 if (obj == null) { 91 return obj + ""; 92 } 93 return typeof obj === "object" || typeof obj === "function" ? class2type[toString.call(obj)] || "object" : typeof obj; 94 } 95 var version = "3.7.0", rhtmlSuffix = /HTML$/i, jQuery2 = function(selector, context) { 96 return new jQuery2.fn.init(selector, context); 97 }; 98 jQuery2.fn = jQuery2.prototype = { 99 // The current version of jQuery being used 100 jquery: version, 101 constructor: jQuery2, 102 // The default length of a jQuery object is 0 103 length: 0, 104 toArray: function() { 105 return slice2.call(this); 106 }, 107 // Get the Nth element in the matched element set OR 108 // Get the whole matched element set as a clean array 109 get: function(num) { 110 if (num == null) { 111 return slice2.call(this); 112 } 113 return num < 0 ? this[num + this.length] : this[num]; 114 }, 115 // Take an array of elements and push it onto the stack 116 // (returning the new matched element set) 117 pushStack: function(elems) { 118 var ret = jQuery2.merge(this.constructor(), elems); 119 ret.prevObject = this; 120 return ret; 121 }, 122 // Execute a callback for every element in the matched set. 123 each: function(callback) { 124 return jQuery2.each(this, callback); 125 }, 126 map: function(callback) { 127 return this.pushStack(jQuery2.map(this, function(elem, i) { 128 return callback.call(elem, i, elem); 129 })); 130 }, 131 slice: function() { 132 return this.pushStack(slice2.apply(this, arguments)); 133 }, 134 first: function() { 135 return this.eq(0); 136 }, 137 last: function() { 138 return this.eq(-1); 139 }, 140 even: function() { 141 return this.pushStack(jQuery2.grep(this, function(_elem, i) { 142 return (i + 1) % 2; 143 })); 144 }, 145 odd: function() { 146 return this.pushStack(jQuery2.grep(this, function(_elem, i) { 147 return i % 2; 148 })); 149 }, 150 eq: function(i) { 151 var len = this.length, j = +i + (i < 0 ? len : 0); 152 return this.pushStack(j >= 0 && j < len ? [this[j]] : []); 153 }, 154 end: function() { 155 return this.prevObject || this.constructor(); 156 }, 157 // For internal use only. 158 // Behaves like an Array's method, not like a jQuery method. 159 push, 160 sort: arr2.sort, 161 splice: arr2.splice 162 }; 163 jQuery2.extend = jQuery2.fn.extend = function() { 164 var options, name, src, copy2, copyIsArray, clone, target = arguments[0] || {}, i = 1, length = arguments.length, deep = false; 165 if (typeof target === "boolean") { 166 deep = target; 167 target = arguments[i] || {}; 168 i++; 169 } 170 if (typeof target !== "object" && !isFunction2(target)) { 171 target = {}; 172 } 173 if (i === length) { 174 target = this; 175 i--; 176 } 177 for (; i < length; i++) { 178 if ((options = arguments[i]) != null) { 179 for (name in options) { 180 copy2 = options[name]; 181 if (name === "__proto__" || target === copy2) { 182 continue; 183 } 184 if (deep && copy2 && (jQuery2.isPlainObject(copy2) || (copyIsArray = Array.isArray(copy2)))) { 185 src = target[name]; 186 if (copyIsArray && !Array.isArray(src)) { 187 clone = []; 188 } else if (!copyIsArray && !jQuery2.isPlainObject(src)) { 189 clone = {}; 190 } else { 191 clone = src; 192 } 193 copyIsArray = false; 194 target[name] = jQuery2.extend(deep, clone, copy2); 195 } else if (copy2 !== void 0) { 196 target[name] = copy2; 197 } 198 } 199 } 200 } 201 return target; 202 }; 203 jQuery2.extend({ 204 // Unique for each copy of jQuery on the page 205 expando: "jQuery" + (version + Math.random()).replace(/\D/g, ""), 206 // Assume jQuery is ready without the ready module 207 isReady: true, 208 error: function(msg) { 209 throw new Error(msg); 210 }, 211 noop: function() { 212 }, 213 isPlainObject: function(obj) { 214 var proto, Ctor; 215 if (!obj || toString.call(obj) !== "[object Object]") { 216 return false; 217 } 218 proto = getProto(obj); 219 if (!proto) { 220 return true; 221 } 222 Ctor = hasOwn.call(proto, "constructor") && proto.constructor; 223 return typeof Ctor === "function" && fnToString.call(Ctor) === ObjectFunctionString; 224 }, 225 isEmptyObject: function(obj) { 226 var name; 227 for (name in obj) { 228 return false; 229 } 230 return true; 231 }, 232 // Evaluates a script in a provided context; falls back to the global one 233 // if not specified. 234 globalEval: function(code, options, doc) { 235 DOMEval(code, { nonce: options && options.nonce }, doc); 236 }, 237 each: function(obj, callback) { 238 var length, i = 0; 239 if (isArrayLike(obj)) { 240 length = obj.length; 241 for (; i < length; i++) { 242 if (callback.call(obj[i], i, obj[i]) === false) { 243 break; 244 } 245 } 246 } else { 247 for (i in obj) { 248 if (callback.call(obj[i], i, obj[i]) === false) { 249 break; 250 } 251 } 252 } 253 return obj; 254 }, 255 // Retrieve the text value of an array of DOM nodes 256 text: function(elem) { 257 var node, ret = "", i = 0, nodeType = elem.nodeType; 258 if (!nodeType) { 259 while (node = elem[i++]) { 260 ret += jQuery2.text(node); 261 } 262 } else if (nodeType === 1 || nodeType === 9 || nodeType === 11) { 263 return elem.textContent; 264 } else if (nodeType === 3 || nodeType === 4) { 265 return elem.nodeValue; 266 } 267 return ret; 268 }, 269 // results is for internal usage only 270 makeArray: function(arr3, results) { 271 var ret = results || []; 272 if (arr3 != null) { 273 if (isArrayLike(Object(arr3))) { 274 jQuery2.merge( 275 ret, 276 typeof arr3 === "string" ? [arr3] : arr3 277 ); 278 } else { 279 push.call(ret, arr3); 280 } 281 } 282 return ret; 283 }, 284 inArray: function(elem, arr3, i) { 285 return arr3 == null ? -1 : indexOf.call(arr3, elem, i); 286 }, 287 isXMLDoc: function(elem) { 288 var namespace = elem && elem.namespaceURI, docElem = elem && (elem.ownerDocument || elem).documentElement; 289 return !rhtmlSuffix.test(namespace || docElem && docElem.nodeName || "HTML"); 290 }, 291 // Support: Android <=4.0 only, PhantomJS 1 only 292 // push.apply(_, arraylike) throws on ancient WebKit 293 merge: function(first, second) { 294 var len = +second.length, j = 0, i = first.length; 295 for (; j < len; j++) { 296 first[i++] = second[j]; 297 } 298 first.length = i; 299 return first; 300 }, 301 grep: function(elems, callback, invert) { 302 var callbackInverse, matches = [], i = 0, length = elems.length, callbackExpect = !invert; 303 for (; i < length; i++) { 304 callbackInverse = !callback(elems[i], i); 305 if (callbackInverse !== callbackExpect) { 306 matches.push(elems[i]); 307 } 308 } 309 return matches; 310 }, 311 // arg is for internal usage only 312 map: function(elems, callback, arg) { 313 var length, value, i = 0, ret = []; 314 if (isArrayLike(elems)) { 315 length = elems.length; 316 for (; i < length; i++) { 317 value = callback(elems[i], i, arg); 318 if (value != null) { 319 ret.push(value); 320 } 321 } 322 } else { 323 for (i in elems) { 324 value = callback(elems[i], i, arg); 325 if (value != null) { 326 ret.push(value); 327 } 328 } 329 } 330 return flat(ret); 331 }, 332 // A global GUID counter for objects 333 guid: 1, 334 // jQuery.support is not used in Core but other projects attach their 335 // properties to it so it needs to exist. 336 support 337 }); 338 if (typeof Symbol === "function") { 339 jQuery2.fn[Symbol.iterator] = arr2[Symbol.iterator]; 340 } 341 jQuery2.each( 342 "Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "), 343 function(_i, name) { 344 class2type["[object " + name + "]"] = name.toLowerCase(); 345 } 346 ); 347 function isArrayLike(obj) { 348 var length = !!obj && "length" in obj && obj.length, type = toType(obj); 349 if (isFunction2(obj) || isWindow(obj)) { 350 return false; 351 } 352 return type === "array" || length === 0 || typeof length === "number" && length > 0 && length - 1 in obj; 353 } 354 function nodeName(elem, name) { 355 return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); 356 } 357 var pop = arr2.pop; 358 var sort = arr2.sort; 359 var splice = arr2.splice; 360 var whitespace = "[\\x20\\t\\r\\n\\f]"; 361 var rtrimCSS = new RegExp( 362 "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", 363 "g" 364 ); 365 jQuery2.contains = function(a, b) { 366 var bup = b && b.parentNode; 367 return a === bup || !!(bup && bup.nodeType === 1 && // Support: IE 9 - 11+ 368 // IE doesn't have `contains` on SVG. 369 (a.contains ? a.contains(bup) : a.compareDocumentPosition && a.compareDocumentPosition(bup) & 16)); 370 }; 371 var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g; 372 function fcssescape(ch, asCodePoint) { 373 if (asCodePoint) { 374 if (ch === "\0") { 375 return "\uFFFD"; 376 } 377 return ch.slice(0, -1) + "\\" + ch.charCodeAt(ch.length - 1).toString(16) + " "; 378 } 379 return "\\" + ch; 380 } 381 jQuery2.escapeSelector = function(sel) { 382 return (sel + "").replace(rcssescape, fcssescape); 383 }; 384 var preferredDoc = document2, pushNative = push; 385 (function() { 386 var i, Expr, outermostContext, sortInput, hasDuplicate, push2 = pushNative, document3, documentElement2, documentIsHTML, rbuggyQSA, matches, expando = jQuery2.expando, dirruns = 0, done = 0, classCache = createCache(), tokenCache = createCache(), compilerCache = createCache(), nonnativeSelectorCache = createCache(), sortOrder = function(a, b) { 387 if (a === b) { 388 hasDuplicate = true; 389 } 390 return 0; 391 }, booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+", attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + // Operator (capture 2) 392 "*([*^$|!~]?=)" + whitespace + // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" 393 `*(?:'((?:\\\\.|[^\\\\'])*)'|"((?:\\\\.|[^\\\\"])*)"|(` + identifier + "))|)" + whitespace + "*\\]", pseudos = ":(" + identifier + `)(?:\\((('((?:\\\\.|[^\\\\'])*)'|"((?:\\\\.|[^\\\\"])*)")|((?:\\\\.|[^\\\\()[\\]]|` + attributes + ")*)|.*)\\)|)", rwhitespace = new RegExp(whitespace + "+", "g"), rcomma = new RegExp("^" + whitespace + "*," + whitespace + "*"), rleadingCombinator = new RegExp("^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*"), rdescend = new RegExp(whitespace + "|>"), rpseudo = new RegExp(pseudos), ridentifier = new RegExp("^" + identifier + "$"), matchExpr = { 394 ID: new RegExp("^#(" + identifier + ")"), 395 CLASS: new RegExp("^\\.(" + identifier + ")"), 396 TAG: new RegExp("^(" + identifier + "|[*])"), 397 ATTR: new RegExp("^" + attributes), 398 PSEUDO: new RegExp("^" + pseudos), 399 CHILD: new RegExp( 400 "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", 401 "i" 402 ), 403 bool: new RegExp("^(?:" + booleans + ")$", "i"), 404 // For use in libraries implementing .is() 405 // We use this for POS matching in `select` 406 needsContext: new RegExp("^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i") 407 }, rinputs = /^(?:input|select|textarea|button)$/i, rheader = /^h\d$/i, rquickExpr2 = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, rsibling = /[+~]/, runescape = new RegExp("\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\([^\\r\\n\\f])", "g"), funescape = function(escape3, nonHex) { 408 var high = "0x" + escape3.slice(1) - 65536; 409 if (nonHex) { 410 return nonHex; 411 } 412 return high < 0 ? String.fromCharCode(high + 65536) : String.fromCharCode(high >> 10 | 55296, high & 1023 | 56320); 413 }, unloadHandler = function() { 414 setDocument(); 415 }, inDisabledFieldset = addCombinator( 416 function(elem) { 417 return elem.disabled === true && nodeName(elem, "fieldset"); 418 }, 419 { dir: "parentNode", next: "legend" } 420 ); 421 function safeActiveElement() { 422 try { 423 return document3.activeElement; 424 } catch (err) { 425 } 426 } 427 try { 428 push2.apply( 429 arr2 = slice2.call(preferredDoc.childNodes), 430 preferredDoc.childNodes 431 ); 432 arr2[preferredDoc.childNodes.length].nodeType; 433 } catch (e2) { 434 push2 = { 435 apply: function(target, els) { 436 pushNative.apply(target, slice2.call(els)); 437 }, 438 call: function(target) { 439 pushNative.apply(target, slice2.call(arguments, 1)); 440 } 441 }; 442 } 443 function find(selector, context, results, seed) { 444 var m, i2, elem, nid, match, groups, newSelector, newContext = context && context.ownerDocument, nodeType = context ? context.nodeType : 9; 445 results = results || []; 446 if (typeof selector !== "string" || !selector || nodeType !== 1 && nodeType !== 9 && nodeType !== 11) { 447 return results; 448 } 449 if (!seed) { 450 setDocument(context); 451 context = context || document3; 452 if (documentIsHTML) { 453 if (nodeType !== 11 && (match = rquickExpr2.exec(selector))) { 454 if (m = match[1]) { 455 if (nodeType === 9) { 456 if (elem = context.getElementById(m)) { 457 if (elem.id === m) { 458 push2.call(results, elem); 459 return results; 460 } 461 } else { 462 return results; 463 } 464 } else { 465 if (newContext && (elem = newContext.getElementById(m)) && find.contains(context, elem) && elem.id === m) { 466 push2.call(results, elem); 467 return results; 468 } 469 } 470 } else if (match[2]) { 471 push2.apply(results, context.getElementsByTagName(selector)); 472 return results; 473 } else if ((m = match[3]) && context.getElementsByClassName) { 474 push2.apply(results, context.getElementsByClassName(m)); 475 return results; 476 } 477 } 478 if (!nonnativeSelectorCache[selector + " "] && (!rbuggyQSA || !rbuggyQSA.test(selector))) { 479 newSelector = selector; 480 newContext = context; 481 if (nodeType === 1 && (rdescend.test(selector) || rleadingCombinator.test(selector))) { 482 newContext = rsibling.test(selector) && testContext(context.parentNode) || context; 483 if (newContext != context || !support.scope) { 484 if (nid = context.getAttribute("id")) { 485 nid = jQuery2.escapeSelector(nid); 486 } else { 487 context.setAttribute("id", nid = expando); 488 } 489 } 490 groups = tokenize(selector); 491 i2 = groups.length; 492 while (i2--) { 493 groups[i2] = (nid ? "#" + nid : ":scope") + " " + toSelector(groups[i2]); 494 } 495 newSelector = groups.join(","); 496 } 497 try { 498 push2.apply( 499 results, 500 newContext.querySelectorAll(newSelector) 501 ); 502 return results; 503 } catch (qsaError) { 504 nonnativeSelectorCache(selector, true); 505 } finally { 506 if (nid === expando) { 507 context.removeAttribute("id"); 508 } 509 } 510 } 511 } 512 } 513 return select(selector.replace(rtrimCSS, "$1"), context, results, seed); 514 } 515 function createCache() { 516 var keys = []; 517 function cache(key, value) { 518 if (keys.push(key + " ") > Expr.cacheLength) { 519 delete cache[keys.shift()]; 520 } 521 return cache[key + " "] = value; 522 } 523 return cache; 524 } 525 function markFunction(fn) { 526 fn[expando] = true; 527 return fn; 528 } 529 function assert(fn) { 530 var el = document3.createElement("fieldset"); 531 try { 532 return !!fn(el); 533 } catch (e2) { 534 return false; 535 } finally { 536 if (el.parentNode) { 537 el.parentNode.removeChild(el); 538 } 539 el = null; 540 } 541 } 542 function createInputPseudo(type) { 543 return function(elem) { 544 return nodeName(elem, "input") && elem.type === type; 545 }; 546 } 547 function createButtonPseudo(type) { 548 return function(elem) { 549 return (nodeName(elem, "input") || nodeName(elem, "button")) && elem.type === type; 550 }; 551 } 552 function createDisabledPseudo(disabled) { 553 return function(elem) { 554 if ("form" in elem) { 555 if (elem.parentNode && elem.disabled === false) { 556 if ("label" in elem) { 557 if ("label" in elem.parentNode) { 558 return elem.parentNode.disabled === disabled; 559 } else { 560 return elem.disabled === disabled; 561 } 562 } 563 return elem.isDisabled === disabled || // Where there is no isDisabled, check manually 564 elem.isDisabled !== !disabled && inDisabledFieldset(elem) === disabled; 565 } 566 return elem.disabled === disabled; 567 } else if ("label" in elem) { 568 return elem.disabled === disabled; 569 } 570 return false; 571 }; 572 } 573 function createPositionalPseudo(fn) { 574 return markFunction(function(argument) { 575 argument = +argument; 576 return markFunction(function(seed, matches2) { 577 var j, matchIndexes = fn([], seed.length, argument), i2 = matchIndexes.length; 578 while (i2--) { 579 if (seed[j = matchIndexes[i2]]) { 580 seed[j] = !(matches2[j] = seed[j]); 581 } 582 } 583 }); 584 }); 585 } 586 function testContext(context) { 587 return context && typeof context.getElementsByTagName !== "undefined" && context; 588 } 589 function setDocument(node) { 590 var subWindow, doc = node ? node.ownerDocument || node : preferredDoc; 591 if (doc == document3 || doc.nodeType !== 9 || !doc.documentElement) { 592 return document3; 593 } 594 document3 = doc; 595 documentElement2 = document3.documentElement; 596 documentIsHTML = !jQuery2.isXMLDoc(document3); 597 matches = documentElement2.matches || documentElement2.webkitMatchesSelector || documentElement2.msMatchesSelector; 598 if (preferredDoc != document3 && (subWindow = document3.defaultView) && subWindow.top !== subWindow) { 599 subWindow.addEventListener("unload", unloadHandler); 600 } 601 support.getById = assert(function(el) { 602 documentElement2.appendChild(el).id = jQuery2.expando; 603 return !document3.getElementsByName || !document3.getElementsByName(jQuery2.expando).length; 604 }); 605 support.disconnectedMatch = assert(function(el) { 606 return matches.call(el, "*"); 607 }); 608 support.scope = assert(function() { 609 return document3.querySelectorAll(":scope"); 610 }); 611 support.cssHas = assert(function() { 612 try { 613 document3.querySelector(":has(*,:jqfake)"); 614 return false; 615 } catch (e2) { 616 return true; 617 } 618 }); 619 if (support.getById) { 620 Expr.filter.ID = function(id) { 621 var attrId = id.replace(runescape, funescape); 622 return function(elem) { 623 return elem.getAttribute("id") === attrId; 624 }; 625 }; 626 Expr.find.ID = function(id, context) { 627 if (typeof context.getElementById !== "undefined" && documentIsHTML) { 628 var elem = context.getElementById(id); 629 return elem ? [elem] : []; 630 } 631 }; 632 } else { 633 Expr.filter.ID = function(id) { 634 var attrId = id.replace(runescape, funescape); 635 return function(elem) { 636 var node2 = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); 637 return node2 && node2.value === attrId; 638 }; 639 }; 640 Expr.find.ID = function(id, context) { 641 if (typeof context.getElementById !== "undefined" && documentIsHTML) { 642 var node2, i2, elems, elem = context.getElementById(id); 643 if (elem) { 644 node2 = elem.getAttributeNode("id"); 645 if (node2 && node2.value === id) { 646 return [elem]; 647 } 648 elems = context.getElementsByName(id); 649 i2 = 0; 650 while (elem = elems[i2++]) { 651 node2 = elem.getAttributeNode("id"); 652 if (node2 && node2.value === id) { 653 return [elem]; 654 } 655 } 656 } 657 return []; 658 } 659 }; 660 } 661 Expr.find.TAG = function(tag, context) { 662 if (typeof context.getElementsByTagName !== "undefined") { 663 return context.getElementsByTagName(tag); 664 } else { 665 return context.querySelectorAll(tag); 666 } 667 }; 668 Expr.find.CLASS = function(className, context) { 669 if (typeof context.getElementsByClassName !== "undefined" && documentIsHTML) { 670 return context.getElementsByClassName(className); 671 } 672 }; 673 rbuggyQSA = []; 674 assert(function(el) { 675 var input; 676 documentElement2.appendChild(el).innerHTML = "<a id='" + expando + "' href='' disabled='disabled'></a><select id='" + expando + "-\r\\' disabled='disabled'><option selected=''></option></select>"; 677 if (!el.querySelectorAll("[selected]").length) { 678 rbuggyQSA.push("\\[" + whitespace + "*(?:value|" + booleans + ")"); 679 } 680 if (!el.querySelectorAll("[id~=" + expando + "-]").length) { 681 rbuggyQSA.push("~="); 682 } 683 if (!el.querySelectorAll("a#" + expando + "+*").length) { 684 rbuggyQSA.push(".#.+[+~]"); 685 } 686 if (!el.querySelectorAll(":checked").length) { 687 rbuggyQSA.push(":checked"); 688 } 689 input = document3.createElement("input"); 690 input.setAttribute("type", "hidden"); 691 el.appendChild(input).setAttribute("name", "D"); 692 documentElement2.appendChild(el).disabled = true; 693 if (el.querySelectorAll(":disabled").length !== 2) { 694 rbuggyQSA.push(":enabled", ":disabled"); 695 } 696 input = document3.createElement("input"); 697 input.setAttribute("name", ""); 698 el.appendChild(input); 699 if (!el.querySelectorAll("[name='']").length) { 700 rbuggyQSA.push("\\[" + whitespace + "*name" + whitespace + "*=" + whitespace + `*(?:''|"")`); 701 } 702 }); 703 if (!support.cssHas) { 704 rbuggyQSA.push(":has"); 705 } 706 rbuggyQSA = rbuggyQSA.length && new RegExp(rbuggyQSA.join("|")); 707 sortOrder = function(a, b) { 708 if (a === b) { 709 hasDuplicate = true; 710 return 0; 711 } 712 var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; 713 if (compare) { 714 return compare; 715 } 716 compare = (a.ownerDocument || a) == (b.ownerDocument || b) ? a.compareDocumentPosition(b) : ( 717 // Otherwise we know they are disconnected 718 1 719 ); 720 if (compare & 1 || !support.sortDetached && b.compareDocumentPosition(a) === compare) { 721 if (a === document3 || a.ownerDocument == preferredDoc && find.contains(preferredDoc, a)) { 722 return -1; 723 } 724 if (b === document3 || b.ownerDocument == preferredDoc && find.contains(preferredDoc, b)) { 725 return 1; 726 } 727 return sortInput ? indexOf.call(sortInput, a) - indexOf.call(sortInput, b) : 0; 728 } 729 return compare & 4 ? -1 : 1; 730 }; 731 return document3; 732 } 733 find.matches = function(expr, elements2) { 734 return find(expr, null, null, elements2); 735 }; 736 find.matchesSelector = function(elem, expr) { 737 setDocument(elem); 738 if (documentIsHTML && !nonnativeSelectorCache[expr + " "] && (!rbuggyQSA || !rbuggyQSA.test(expr))) { 739 try { 740 var ret = matches.call(elem, expr); 741 if (ret || support.disconnectedMatch || // As well, disconnected nodes are said to be in a document 742 // fragment in IE 9 743 elem.document && elem.document.nodeType !== 11) { 744 return ret; 745 } 746 } catch (e2) { 747 nonnativeSelectorCache(expr, true); 748 } 749 } 750 return find(expr, document3, null, [elem]).length > 0; 751 }; 752 find.contains = function(context, elem) { 753 if ((context.ownerDocument || context) != document3) { 754 setDocument(context); 755 } 756 return jQuery2.contains(context, elem); 757 }; 758 find.attr = function(elem, name) { 759 if ((elem.ownerDocument || elem) != document3) { 760 setDocument(elem); 761 } 762 var fn = Expr.attrHandle[name.toLowerCase()], val = fn && hasOwn.call(Expr.attrHandle, name.toLowerCase()) ? fn(elem, name, !documentIsHTML) : void 0; 763 if (val !== void 0) { 764 return val; 765 } 766 return elem.getAttribute(name); 767 }; 768 find.error = function(msg) { 769 throw new Error("Syntax error, unrecognized expression: " + msg); 770 }; 771 jQuery2.uniqueSort = function(results) { 772 var elem, duplicates = [], j = 0, i2 = 0; 773 hasDuplicate = !support.sortStable; 774 sortInput = !support.sortStable && slice2.call(results, 0); 775 sort.call(results, sortOrder); 776 if (hasDuplicate) { 777 while (elem = results[i2++]) { 778 if (elem === results[i2]) { 779 j = duplicates.push(i2); 780 } 781 } 782 while (j--) { 783 splice.call(results, duplicates[j], 1); 784 } 785 } 786 sortInput = null; 787 return results; 788 }; 789 jQuery2.fn.uniqueSort = function() { 790 return this.pushStack(jQuery2.uniqueSort(slice2.apply(this))); 791 }; 792 Expr = jQuery2.expr = { 793 // Can be adjusted by the user 794 cacheLength: 50, 795 createPseudo: markFunction, 796 match: matchExpr, 797 attrHandle: {}, 798 find: {}, 799 relative: { 800 ">": { dir: "parentNode", first: true }, 801 " ": { dir: "parentNode" }, 802 "+": { dir: "previousSibling", first: true }, 803 "~": { dir: "previousSibling" } 804 }, 805 preFilter: { 806 ATTR: function(match) { 807 match[1] = match[1].replace(runescape, funescape); 808 match[3] = (match[3] || match[4] || match[5] || "").replace(runescape, funescape); 809 if (match[2] === "~=") { 810 match[3] = " " + match[3] + " "; 811 } 812 return match.slice(0, 4); 813 }, 814 CHILD: function(match) { 815 match[1] = match[1].toLowerCase(); 816 if (match[1].slice(0, 3) === "nth") { 817 if (!match[3]) { 818 find.error(match[0]); 819 } 820 match[4] = +(match[4] ? match[5] + (match[6] || 1) : 2 * (match[3] === "even" || match[3] === "odd")); 821 match[5] = +(match[7] + match[8] || match[3] === "odd"); 822 } else if (match[3]) { 823 find.error(match[0]); 824 } 825 return match; 826 }, 827 PSEUDO: function(match) { 828 var excess, unquoted = !match[6] && match[2]; 829 if (matchExpr.CHILD.test(match[0])) { 830 return null; 831 } 832 if (match[3]) { 833 match[2] = match[4] || match[5] || ""; 834 } else if (unquoted && rpseudo.test(unquoted) && // Get excess from tokenize (recursively) 835 (excess = tokenize(unquoted, true)) && // advance to the next closing parenthesis 836 (excess = unquoted.indexOf(")", unquoted.length - excess) - unquoted.length)) { 837 match[0] = match[0].slice(0, excess); 838 match[2] = unquoted.slice(0, excess); 839 } 840 return match.slice(0, 3); 841 } 842 }, 843 filter: { 844 TAG: function(nodeNameSelector) { 845 var expectedNodeName = nodeNameSelector.replace(runescape, funescape).toLowerCase(); 846 return nodeNameSelector === "*" ? function() { 847 return true; 848 } : function(elem) { 849 return nodeName(elem, expectedNodeName); 850 }; 851 }, 852 CLASS: function(className) { 853 var pattern = classCache[className + " "]; 854 return pattern || (pattern = new RegExp("(^|" + whitespace + ")" + className + "(" + whitespace + "|$)")) && classCache(className, function(elem) { 855 return pattern.test( 856 typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" 857 ); 858 }); 859 }, 860 ATTR: function(name, operator, check) { 861 return function(elem) { 862 var result = find.attr(elem, name); 863 if (result == null) { 864 return operator === "!="; 865 } 866 if (!operator) { 867 return true; 868 } 869 result += ""; 870 if (operator === "=") { 871 return result === check; 872 } 873 if (operator === "!=") { 874 return result !== check; 875 } 876 if (operator === "^=") { 877 return check && result.indexOf(check) === 0; 878 } 879 if (operator === "*=") { 880 return check && result.indexOf(check) > -1; 881 } 882 if (operator === "$=") { 883 return check && result.slice(-check.length) === check; 884 } 885 if (operator === "~=") { 886 return (" " + result.replace(rwhitespace, " ") + " ").indexOf(check) > -1; 887 } 888 if (operator === "|=") { 889 return result === check || result.slice(0, check.length + 1) === check + "-"; 890 } 891 return false; 892 }; 893 }, 894 CHILD: function(type, what, _argument, first, last) { 895 var simple = type.slice(0, 3) !== "nth", forward = type.slice(-4) !== "last", ofType = what === "of-type"; 896 return first === 1 && last === 0 ? ( 897 // Shortcut for :nth-*(n) 898 function(elem) { 899 return !!elem.parentNode; 900 } 901 ) : function(elem, _context, xml) { 902 var cache, outerCache, node, nodeIndex, start, dir2 = simple !== forward ? "nextSibling" : "previousSibling", parent = elem.parentNode, name = ofType && elem.nodeName.toLowerCase(), useCache = !xml && !ofType, diff = false; 903 if (parent) { 904 if (simple) { 905 while (dir2) { 906 node = elem; 907 while (node = node[dir2]) { 908 if (ofType ? nodeName(node, name) : node.nodeType === 1) { 909 return false; 910 } 911 } 912 start = dir2 = type === "only" && !start && "nextSibling"; 913 } 914 return true; 915 } 916 start = [forward ? parent.firstChild : parent.lastChild]; 917 if (forward && useCache) { 918 outerCache = parent[expando] || (parent[expando] = {}); 919 cache = outerCache[type] || []; 920 nodeIndex = cache[0] === dirruns && cache[1]; 921 diff = nodeIndex && cache[2]; 922 node = nodeIndex && parent.childNodes[nodeIndex]; 923 while (node = ++nodeIndex && node && node[dir2] || // Fallback to seeking `elem` from the start 924 (diff = nodeIndex = 0) || start.pop()) { 925 if (node.nodeType === 1 && ++diff && node === elem) { 926 outerCache[type] = [dirruns, nodeIndex, diff]; 927 break; 928 } 929 } 930 } else { 931 if (useCache) { 932 outerCache = elem[expando] || (elem[expando] = {}); 933 cache = outerCache[type] || []; 934 nodeIndex = cache[0] === dirruns && cache[1]; 935 diff = nodeIndex; 936 } 937 if (diff === false) { 938 while (node = ++nodeIndex && node && node[dir2] || (diff = nodeIndex = 0) || start.pop()) { 939 if ((ofType ? nodeName(node, name) : node.nodeType === 1) && ++diff) { 940 if (useCache) { 941 outerCache = node[expando] || (node[expando] = {}); 942 outerCache[type] = [dirruns, diff]; 943 } 944 if (node === elem) { 945 break; 946 } 947 } 948 } 949 } 950 } 951 diff -= last; 952 return diff === first || diff % first === 0 && diff / first >= 0; 953 } 954 }; 955 }, 956 PSEUDO: function(pseudo, argument) { 957 var args, fn = Expr.pseudos[pseudo] || Expr.setFilters[pseudo.toLowerCase()] || find.error("unsupported pseudo: " + pseudo); 958 if (fn[expando]) { 959 return fn(argument); 960 } 961 if (fn.length > 1) { 962 args = [pseudo, pseudo, "", argument]; 963 return Expr.setFilters.hasOwnProperty(pseudo.toLowerCase()) ? markFunction(function(seed, matches2) { 964 var idx, matched = fn(seed, argument), i2 = matched.length; 965 while (i2--) { 966 idx = indexOf.call(seed, matched[i2]); 967 seed[idx] = !(matches2[idx] = matched[i2]); 968 } 969 }) : function(elem) { 970 return fn(elem, 0, args); 971 }; 972 } 973 return fn; 974 } 975 }, 976 pseudos: { 977 // Potentially complex pseudos 978 not: markFunction(function(selector) { 979 var input = [], results = [], matcher = compile(selector.replace(rtrimCSS, "$1")); 980 return matcher[expando] ? markFunction(function(seed, matches2, _context, xml) { 981 var elem, unmatched = matcher(seed, null, xml, []), i2 = seed.length; 982 while (i2--) { 983 if (elem = unmatched[i2]) { 984 seed[i2] = !(matches2[i2] = elem); 985 } 986 } 987 }) : function(elem, _context, xml) { 988 input[0] = elem; 989 matcher(input, null, xml, results); 990 input[0] = null; 991 return !results.pop(); 992 }; 993 }), 994 has: markFunction(function(selector) { 995 return function(elem) { 996 return find(selector, elem).length > 0; 997 }; 998 }), 999 contains: markFunction(function(text) { 1000 text = text.replace(runescape, funescape); 1001 return function(elem) { 1002 return (elem.textContent || jQuery2.text(elem)).indexOf(text) > -1; 1003 }; 1004 }), 1005 // "Whether an element is represented by a :lang() selector 1006 // is based solely on the element's language value 1007 // being equal to the identifier C, 1008 // or beginning with the identifier C immediately followed by "-". 1009 // The matching of C against the element's language value is performed case-insensitively. 1010 // The identifier C does not have to be a valid language name." 1011 // https://www.w3.org/TR/selectors/#lang-pseudo 1012 lang: markFunction(function(lang) { 1013 if (!ridentifier.test(lang || "")) { 1014 find.error("unsupported lang: " + lang); 1015 } 1016 lang = lang.replace(runescape, funescape).toLowerCase(); 1017 return function(elem) { 1018 var elemLang; 1019 do { 1020 if (elemLang = documentIsHTML ? elem.lang : elem.getAttribute("xml:lang") || elem.getAttribute("lang")) { 1021 elemLang = elemLang.toLowerCase(); 1022 return elemLang === lang || elemLang.indexOf(lang + "-") === 0; 1023 } 1024 } while ((elem = elem.parentNode) && elem.nodeType === 1); 1025 return false; 1026 }; 1027 }), 1028 // Miscellaneous 1029 target: function(elem) { 1030 var hash = window2.location && window2.location.hash; 1031 return hash && hash.slice(1) === elem.id; 1032 }, 1033 root: function(elem) { 1034 return elem === documentElement2; 1035 }, 1036 focus: function(elem) { 1037 return elem === safeActiveElement() && document3.hasFocus() && !!(elem.type || elem.href || ~elem.tabIndex); 1038 }, 1039 // Boolean properties 1040 enabled: createDisabledPseudo(false), 1041 disabled: createDisabledPseudo(true), 1042 checked: function(elem) { 1043 return nodeName(elem, "input") && !!elem.checked || nodeName(elem, "option") && !!elem.selected; 1044 }, 1045 selected: function(elem) { 1046 if (elem.parentNode) { 1047 elem.parentNode.selectedIndex; 1048 } 1049 return elem.selected === true; 1050 }, 1051 // Contents 1052 empty: function(elem) { 1053 for (elem = elem.firstChild; elem; elem = elem.nextSibling) { 1054 if (elem.nodeType < 6) { 1055 return false; 1056 } 1057 } 1058 return true; 1059 }, 1060 parent: function(elem) { 1061 return !Expr.pseudos.empty(elem); 1062 }, 1063 // Element/input types 1064 header: function(elem) { 1065 return rheader.test(elem.nodeName); 1066 }, 1067 input: function(elem) { 1068 return rinputs.test(elem.nodeName); 1069 }, 1070 button: function(elem) { 1071 return nodeName(elem, "input") && elem.type === "button" || nodeName(elem, "button"); 1072 }, 1073 text: function(elem) { 1074 var attr; 1075 return nodeName(elem, "input") && elem.type === "text" && // Support: IE <10 only 1076 // New HTML5 attribute values (e.g., "search") appear 1077 // with elem.type === "text" 1078 ((attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text"); 1079 }, 1080 // Position-in-collection 1081 first: createPositionalPseudo(function() { 1082 return [0]; 1083 }), 1084 last: createPositionalPseudo(function(_matchIndexes, length) { 1085 return [length - 1]; 1086 }), 1087 eq: createPositionalPseudo(function(_matchIndexes, length, argument) { 1088 return [argument < 0 ? argument + length : argument]; 1089 }), 1090 even: createPositionalPseudo(function(matchIndexes, length) { 1091 var i2 = 0; 1092 for (; i2 < length; i2 += 2) { 1093 matchIndexes.push(i2); 1094 } 1095 return matchIndexes; 1096 }), 1097 odd: createPositionalPseudo(function(matchIndexes, length) { 1098 var i2 = 1; 1099 for (; i2 < length; i2 += 2) { 1100 matchIndexes.push(i2); 1101 } 1102 return matchIndexes; 1103 }), 1104 lt: createPositionalPseudo(function(matchIndexes, length, argument) { 1105 var i2; 1106 if (argument < 0) { 1107 i2 = argument + length; 1108 } else if (argument > length) { 1109 i2 = length; 1110 } else { 1111 i2 = argument; 1112 } 1113 for (; --i2 >= 0; ) { 1114 matchIndexes.push(i2); 1115 } 1116 return matchIndexes; 1117 }), 1118 gt: createPositionalPseudo(function(matchIndexes, length, argument) { 1119 var i2 = argument < 0 ? argument + length : argument; 1120 for (; ++i2 < length; ) { 1121 matchIndexes.push(i2); 1122 } 1123 return matchIndexes; 1124 }) 1125 } 1126 }; 1127 Expr.pseudos.nth = Expr.pseudos.eq; 1128 for (i in { radio: true, checkbox: true, file: true, password: true, image: true }) { 1129 Expr.pseudos[i] = createInputPseudo(i); 1130 } 1131 for (i in { submit: true, reset: true }) { 1132 Expr.pseudos[i] = createButtonPseudo(i); 1133 } 1134 function setFilters() { 1135 } 1136 setFilters.prototype = Expr.filters = Expr.pseudos; 1137 Expr.setFilters = new setFilters(); 1138 function tokenize(selector, parseOnly) { 1139 var matched, match, tokens, type, soFar, groups, preFilters, cached = tokenCache[selector + " "]; 1140 if (cached) { 1141 return parseOnly ? 0 : cached.slice(0); 1142 } 1143 soFar = selector; 1144 groups = []; 1145 preFilters = Expr.preFilter; 1146 while (soFar) { 1147 if (!matched || (match = rcomma.exec(soFar))) { 1148 if (match) { 1149 soFar = soFar.slice(match[0].length) || soFar; 1150 } 1151 groups.push(tokens = []); 1152 } 1153 matched = false; 1154 if (match = rleadingCombinator.exec(soFar)) { 1155 matched = match.shift(); 1156 tokens.push({ 1157 value: matched, 1158 // Cast descendant combinators to space 1159 type: match[0].replace(rtrimCSS, " ") 1160 }); 1161 soFar = soFar.slice(matched.length); 1162 } 1163 for (type in Expr.filter) { 1164 if ((match = matchExpr[type].exec(soFar)) && (!preFilters[type] || (match = preFilters[type](match)))) { 1165 matched = match.shift(); 1166 tokens.push({ 1167 value: matched, 1168 type, 1169 matches: match 1170 }); 1171 soFar = soFar.slice(matched.length); 1172 } 1173 } 1174 if (!matched) { 1175 break; 1176 } 1177 } 1178 if (parseOnly) { 1179 return soFar.length; 1180 } 1181 return soFar ? find.error(selector) : ( 1182 // Cache the tokens 1183 tokenCache(selector, groups).slice(0) 1184 ); 1185 } 1186 function toSelector(tokens) { 1187 var i2 = 0, len = tokens.length, selector = ""; 1188 for (; i2 < len; i2++) { 1189 selector += tokens[i2].value; 1190 } 1191 return selector; 1192 } 1193 function addCombinator(matcher, combinator, base) { 1194 var dir2 = combinator.dir, skip = combinator.next, key = skip || dir2, checkNonElements = base && key === "parentNode", doneName = done++; 1195 return combinator.first ? ( 1196 // Check against closest ancestor/preceding element 1197 function(elem, context, xml) { 1198 while (elem = elem[dir2]) { 1199 if (elem.nodeType === 1 || checkNonElements) { 1200 return matcher(elem, context, xml); 1201 } 1202 } 1203 return false; 1204 } 1205 ) : ( 1206 // Check against all ancestor/preceding elements 1207 function(elem, context, xml) { 1208 var oldCache, outerCache, newCache = [dirruns, doneName]; 1209 if (xml) { 1210 while (elem = elem[dir2]) { 1211 if (elem.nodeType === 1 || checkNonElements) { 1212 if (matcher(elem, context, xml)) { 1213 return true; 1214 } 1215 } 1216 } 1217 } else { 1218 while (elem = elem[dir2]) { 1219 if (elem.nodeType === 1 || checkNonElements) { 1220 outerCache = elem[expando] || (elem[expando] = {}); 1221 if (skip && nodeName(elem, skip)) { 1222 elem = elem[dir2] || elem; 1223 } else if ((oldCache = outerCache[key]) && oldCache[0] === dirruns && oldCache[1] === doneName) { 1224 return newCache[2] = oldCache[2]; 1225 } else { 1226 outerCache[key] = newCache; 1227 if (newCache[2] = matcher(elem, context, xml)) { 1228 return true; 1229 } 1230 } 1231 } 1232 } 1233 } 1234 return false; 1235 } 1236 ); 1237 } 1238 function elementMatcher(matchers) { 1239 return matchers.length > 1 ? function(elem, context, xml) { 1240 var i2 = matchers.length; 1241 while (i2--) { 1242 if (!matchers[i2](elem, context, xml)) { 1243 return false; 1244 } 1245 } 1246 return true; 1247 } : matchers[0]; 1248 } 1249 function multipleContexts(selector, contexts, results) { 1250 var i2 = 0, len = contexts.length; 1251 for (; i2 < len; i2++) { 1252 find(selector, contexts[i2], results); 1253 } 1254 return results; 1255 } 1256 function condense(unmatched, map, filter, context, xml) { 1257 var elem, newUnmatched = [], i2 = 0, len = unmatched.length, mapped = map != null; 1258 for (; i2 < len; i2++) { 1259 if (elem = unmatched[i2]) { 1260 if (!filter || filter(elem, context, xml)) { 1261 newUnmatched.push(elem); 1262 if (mapped) { 1263 map.push(i2); 1264 } 1265 } 1266 } 1267 } 1268 return newUnmatched; 1269 } 1270 function setMatcher(preFilter, selector, matcher, postFilter, postFinder, postSelector) { 1271 if (postFilter && !postFilter[expando]) { 1272 postFilter = setMatcher(postFilter); 1273 } 1274 if (postFinder && !postFinder[expando]) { 1275 postFinder = setMatcher(postFinder, postSelector); 1276 } 1277 return markFunction(function(seed, results, context, xml) { 1278 var temp, i2, elem, matcherOut, preMap = [], postMap = [], preexisting = results.length, elems = seed || multipleContexts( 1279 selector || "*", 1280 context.nodeType ? [context] : context, 1281 [] 1282 ), matcherIn = preFilter && (seed || !selector) ? condense(elems, preMap, preFilter, context, xml) : elems; 1283 if (matcher) { 1284 matcherOut = postFinder || (seed ? preFilter : preexisting || postFilter) ? ( 1285 // ...intermediate processing is necessary 1286 [] 1287 ) : ( 1288 // ...otherwise use results directly 1289 results 1290 ); 1291 matcher(matcherIn, matcherOut, context, xml); 1292 } else { 1293 matcherOut = matcherIn; 1294 } 1295 if (postFilter) { 1296 temp = condense(matcherOut, postMap); 1297 postFilter(temp, [], context, xml); 1298 i2 = temp.length; 1299 while (i2--) { 1300 if (elem = temp[i2]) { 1301 matcherOut[postMap[i2]] = !(matcherIn[postMap[i2]] = elem); 1302 } 1303 } 1304 } 1305 if (seed) { 1306 if (postFinder || preFilter) { 1307 if (postFinder) { 1308 temp = []; 1309 i2 = matcherOut.length; 1310 while (i2--) { 1311 if (elem = matcherOut[i2]) { 1312 temp.push(matcherIn[i2] = elem); 1313 } 1314 } 1315 postFinder(null, matcherOut = [], temp, xml); 1316 } 1317 i2 = matcherOut.length; 1318 while (i2--) { 1319 if ((elem = matcherOut[i2]) && (temp = postFinder ? indexOf.call(seed, elem) : preMap[i2]) > -1) { 1320 seed[temp] = !(results[temp] = elem); 1321 } 1322 } 1323 } 1324 } else { 1325 matcherOut = condense( 1326 matcherOut === results ? matcherOut.splice(preexisting, matcherOut.length) : matcherOut 1327 ); 1328 if (postFinder) { 1329 postFinder(null, results, matcherOut, xml); 1330 } else { 1331 push2.apply(results, matcherOut); 1332 } 1333 } 1334 }); 1335 } 1336 function matcherFromTokens(tokens) { 1337 var checkContext, matcher, j, len = tokens.length, leadingRelative = Expr.relative[tokens[0].type], implicitRelative = leadingRelative || Expr.relative[" "], i2 = leadingRelative ? 1 : 0, matchContext = addCombinator(function(elem) { 1338 return elem === checkContext; 1339 }, implicitRelative, true), matchAnyContext = addCombinator(function(elem) { 1340 return indexOf.call(checkContext, elem) > -1; 1341 }, implicitRelative, true), matchers = [function(elem, context, xml) { 1342 var ret = !leadingRelative && (xml || context != outermostContext) || ((checkContext = context).nodeType ? matchContext(elem, context, xml) : matchAnyContext(elem, context, xml)); 1343 checkContext = null; 1344 return ret; 1345 }]; 1346 for (; i2 < len; i2++) { 1347 if (matcher = Expr.relative[tokens[i2].type]) { 1348 matchers = [addCombinator(elementMatcher(matchers), matcher)]; 1349 } else { 1350 matcher = Expr.filter[tokens[i2].type].apply(null, tokens[i2].matches); 1351 if (matcher[expando]) { 1352 j = ++i2; 1353 for (; j < len; j++) { 1354 if (Expr.relative[tokens[j].type]) { 1355 break; 1356 } 1357 } 1358 return setMatcher( 1359 i2 > 1 && elementMatcher(matchers), 1360 i2 > 1 && toSelector( 1361 // If the preceding token was a descendant combinator, insert an implicit any-element `*` 1362 tokens.slice(0, i2 - 1).concat({ value: tokens[i2 - 2].type === " " ? "*" : "" }) 1363 ).replace(rtrimCSS, "$1"), 1364 matcher, 1365 i2 < j && matcherFromTokens(tokens.slice(i2, j)), 1366 j < len && matcherFromTokens(tokens = tokens.slice(j)), 1367 j < len && toSelector(tokens) 1368 ); 1369 } 1370 matchers.push(matcher); 1371 } 1372 } 1373 return elementMatcher(matchers); 1374 } 1375 function matcherFromGroupMatchers(elementMatchers, setMatchers) { 1376 var bySet = setMatchers.length > 0, byElement = elementMatchers.length > 0, superMatcher = function(seed, context, xml, results, outermost) { 1377 var elem, j, matcher, matchedCount = 0, i2 = "0", unmatched = seed && [], setMatched = [], contextBackup = outermostContext, elems = seed || byElement && Expr.find.TAG("*", outermost), dirrunsUnique = dirruns += contextBackup == null ? 1 : Math.random() || 0.1, len = elems.length; 1378 if (outermost) { 1379 outermostContext = context == document3 || context || outermost; 1380 } 1381 for (; i2 !== len && (elem = elems[i2]) != null; i2++) { 1382 if (byElement && elem) { 1383 j = 0; 1384 if (!context && elem.ownerDocument != document3) { 1385 setDocument(elem); 1386 xml = !documentIsHTML; 1387 } 1388 while (matcher = elementMatchers[j++]) { 1389 if (matcher(elem, context || document3, xml)) { 1390 push2.call(results, elem); 1391 break; 1392 } 1393 } 1394 if (outermost) { 1395 dirruns = dirrunsUnique; 1396 } 1397 } 1398 if (bySet) { 1399 if (elem = !matcher && elem) { 1400 matchedCount--; 1401 } 1402 if (seed) { 1403 unmatched.push(elem); 1404 } 1405 } 1406 } 1407 matchedCount += i2; 1408 if (bySet && i2 !== matchedCount) { 1409 j = 0; 1410 while (matcher = setMatchers[j++]) { 1411 matcher(unmatched, setMatched, context, xml); 1412 } 1413 if (seed) { 1414 if (matchedCount > 0) { 1415 while (i2--) { 1416 if (!(unmatched[i2] || setMatched[i2])) { 1417 setMatched[i2] = pop.call(results); 1418 } 1419 } 1420 } 1421 setMatched = condense(setMatched); 1422 } 1423 push2.apply(results, setMatched); 1424 if (outermost && !seed && setMatched.length > 0 && matchedCount + setMatchers.length > 1) { 1425 jQuery2.uniqueSort(results); 1426 } 1427 } 1428 if (outermost) { 1429 dirruns = dirrunsUnique; 1430 outermostContext = contextBackup; 1431 } 1432 return unmatched; 1433 }; 1434 return bySet ? markFunction(superMatcher) : superMatcher; 1435 } 1436 function compile(selector, match) { 1437 var i2, setMatchers = [], elementMatchers = [], cached = compilerCache[selector + " "]; 1438 if (!cached) { 1439 if (!match) { 1440 match = tokenize(selector); 1441 } 1442 i2 = match.length; 1443 while (i2--) { 1444 cached = matcherFromTokens(match[i2]); 1445 if (cached[expando]) { 1446 setMatchers.push(cached); 1447 } else { 1448 elementMatchers.push(cached); 1449 } 1450 } 1451 cached = compilerCache( 1452 selector, 1453 matcherFromGroupMatchers(elementMatchers, setMatchers) 1454 ); 1455 cached.selector = selector; 1456 } 1457 return cached; 1458 } 1459 function select(selector, context, results, seed) { 1460 var i2, tokens, token, type, find2, compiled = typeof selector === "function" && selector, match = !seed && tokenize(selector = compiled.selector || selector); 1461 results = results || []; 1462 if (match.length === 1) { 1463 tokens = match[0] = match[0].slice(0); 1464 if (tokens.length > 2 && (token = tokens[0]).type === "ID" && context.nodeType === 9 && documentIsHTML && Expr.relative[tokens[1].type]) { 1465 context = (Expr.find.ID( 1466 token.matches[0].replace(runescape, funescape), 1467 context 1468 ) || [])[0]; 1469 if (!context) { 1470 return results; 1471 } else if (compiled) { 1472 context = context.parentNode; 1473 } 1474 selector = selector.slice(tokens.shift().value.length); 1475 } 1476 i2 = matchExpr.needsContext.test(selector) ? 0 : tokens.length; 1477 while (i2--) { 1478 token = tokens[i2]; 1479 if (Expr.relative[type = token.type]) { 1480 break; 1481 } 1482 if (find2 = Expr.find[type]) { 1483 if (seed = find2( 1484 token.matches[0].replace(runescape, funescape), 1485 rsibling.test(tokens[0].type) && testContext(context.parentNode) || context 1486 )) { 1487 tokens.splice(i2, 1); 1488 selector = seed.length && toSelector(tokens); 1489 if (!selector) { 1490 push2.apply(results, seed); 1491 return results; 1492 } 1493 break; 1494 } 1495 } 1496 } 1497 } 1498 (compiled || compile(selector, match))( 1499 seed, 1500 context, 1501 !documentIsHTML, 1502 results, 1503 !context || rsibling.test(selector) && testContext(context.parentNode) || context 1504 ); 1505 return results; 1506 } 1507 support.sortStable = expando.split("").sort(sortOrder).join("") === expando; 1508 setDocument(); 1509 support.sortDetached = assert(function(el) { 1510 return el.compareDocumentPosition(document3.createElement("fieldset")) & 1; 1511 }); 1512 jQuery2.find = find; 1513 jQuery2.expr[":"] = jQuery2.expr.pseudos; 1514 jQuery2.unique = jQuery2.uniqueSort; 1515 find.compile = compile; 1516 find.select = select; 1517 find.setDocument = setDocument; 1518 find.escape = jQuery2.escapeSelector; 1519 find.getText = jQuery2.text; 1520 find.isXML = jQuery2.isXMLDoc; 1521 find.selectors = jQuery2.expr; 1522 find.support = jQuery2.support; 1523 find.uniqueSort = jQuery2.uniqueSort; 1524 })(); 1525 var dir = function(elem, dir2, until) { 1526 var matched = [], truncate = until !== void 0; 1527 while ((elem = elem[dir2]) && elem.nodeType !== 9) { 1528 if (elem.nodeType === 1) { 1529 if (truncate && jQuery2(elem).is(until)) { 1530 break; 1531 } 1532 matched.push(elem); 1533 } 1534 } 1535 return matched; 1536 }; 1537 var siblings2 = function(n, elem) { 1538 var matched = []; 1539 for (; n; n = n.nextSibling) { 1540 if (n.nodeType === 1 && n !== elem) { 1541 matched.push(n); 1542 } 1543 } 1544 return matched; 1545 }; 1546 var rneedsContext = jQuery2.expr.match.needsContext; 1547 var rsingleTag = /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i; 1548 function winnow(elements2, qualifier, not) { 1549 if (isFunction2(qualifier)) { 1550 return jQuery2.grep(elements2, function(elem, i) { 1551 return !!qualifier.call(elem, i, elem) !== not; 1552 }); 1553 } 1554 if (qualifier.nodeType) { 1555 return jQuery2.grep(elements2, function(elem) { 1556 return elem === qualifier !== not; 1557 }); 1558 } 1559 if (typeof qualifier !== "string") { 1560 return jQuery2.grep(elements2, function(elem) { 1561 return indexOf.call(qualifier, elem) > -1 !== not; 1562 }); 1563 } 1564 return jQuery2.filter(qualifier, elements2, not); 1565 } 1566 jQuery2.filter = function(expr, elems, not) { 1567 var elem = elems[0]; 1568 if (not) { 1569 expr = ":not(" + expr + ")"; 1570 } 1571 if (elems.length === 1 && elem.nodeType === 1) { 1572 return jQuery2.find.matchesSelector(elem, expr) ? [elem] : []; 1573 } 1574 return jQuery2.find.matches(expr, jQuery2.grep(elems, function(elem2) { 1575 return elem2.nodeType === 1; 1576 })); 1577 }; 1578 jQuery2.fn.extend({ 1579 find: function(selector) { 1580 var i, ret, len = this.length, self = this; 1581 if (typeof selector !== "string") { 1582 return this.pushStack(jQuery2(selector).filter(function() { 1583 for (i = 0; i < len; i++) { 1584 if (jQuery2.contains(self[i], this)) { 1585 return true; 1586 } 1587 } 1588 })); 1589 } 1590 ret = this.pushStack([]); 1591 for (i = 0; i < len; i++) { 1592 jQuery2.find(selector, self[i], ret); 1593 } 1594 return len > 1 ? jQuery2.uniqueSort(ret) : ret; 1595 }, 1596 filter: function(selector) { 1597 return this.pushStack(winnow(this, selector || [], false)); 1598 }, 1599 not: function(selector) { 1600 return this.pushStack(winnow(this, selector || [], true)); 1601 }, 1602 is: function(selector) { 1603 return !!winnow( 1604 this, 1605 // If this is a positional/relative selector, check membership in the returned set 1606 // so $("p:first").is("p:last") won't return true for a doc with two "p". 1607 typeof selector === "string" && rneedsContext.test(selector) ? jQuery2(selector) : selector || [], 1608 false 1609 ).length; 1610 } 1611 }); 1612 var rootjQuery, rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, init2 = jQuery2.fn.init = function(selector, context, root) { 1613 var match, elem; 1614 if (!selector) { 1615 return this; 1616 } 1617 root = root || rootjQuery; 1618 if (typeof selector === "string") { 1619 if (selector[0] === "<" && selector[selector.length - 1] === ">" && selector.length >= 3) { 1620 match = [null, selector, null]; 1621 } else { 1622 match = rquickExpr.exec(selector); 1623 } 1624 if (match && (match[1] || !context)) { 1625 if (match[1]) { 1626 context = context instanceof jQuery2 ? context[0] : context; 1627 jQuery2.merge(this, jQuery2.parseHTML( 1628 match[1], 1629 context && context.nodeType ? context.ownerDocument || context : document2, 1630 true 1631 )); 1632 if (rsingleTag.test(match[1]) && jQuery2.isPlainObject(context)) { 1633 for (match in context) { 1634 if (isFunction2(this[match])) { 1635 this[match](context[match]); 1636 } else { 1637 this.attr(match, context[match]); 1638 } 1639 } 1640 } 1641 return this; 1642 } else { 1643 elem = document2.getElementById(match[2]); 1644 if (elem) { 1645 this[0] = elem; 1646 this.length = 1; 1647 } 1648 return this; 1649 } 1650 } else if (!context || context.jquery) { 1651 return (context || root).find(selector); 1652 } else { 1653 return this.constructor(context).find(selector); 1654 } 1655 } else if (selector.nodeType) { 1656 this[0] = selector; 1657 this.length = 1; 1658 return this; 1659 } else if (isFunction2(selector)) { 1660 return root.ready !== void 0 ? root.ready(selector) : ( 1661 // Execute immediately if ready is not present 1662 selector(jQuery2) 1663 ); 1664 } 1665 return jQuery2.makeArray(selector, this); 1666 }; 1667 init2.prototype = jQuery2.fn; 1668 rootjQuery = jQuery2(document2); 1669 var rparentsprev = /^(?:parents|prev(?:Until|All))/, guaranteedUnique = { 1670 children: true, 1671 contents: true, 1672 next: true, 1673 prev: true 1674 }; 1675 jQuery2.fn.extend({ 1676 has: function(target) { 1677 var targets = jQuery2(target, this), l = targets.length; 1678 return this.filter(function() { 1679 var i = 0; 1680 for (; i < l; i++) { 1681 if (jQuery2.contains(this, targets[i])) { 1682 return true; 1683 } 1684 } 1685 }); 1686 }, 1687 closest: function(selectors, context) { 1688 var cur, i = 0, l = this.length, matched = [], targets = typeof selectors !== "string" && jQuery2(selectors); 1689 if (!rneedsContext.test(selectors)) { 1690 for (; i < l; i++) { 1691 for (cur = this[i]; cur && cur !== context; cur = cur.parentNode) { 1692 if (cur.nodeType < 11 && (targets ? targets.index(cur) > -1 : ( 1693 // Don't pass non-elements to jQuery#find 1694 cur.nodeType === 1 && jQuery2.find.matchesSelector(cur, selectors) 1695 ))) { 1696 matched.push(cur); 1697 break; 1698 } 1699 } 1700 } 1701 } 1702 return this.pushStack(matched.length > 1 ? jQuery2.uniqueSort(matched) : matched); 1703 }, 1704 // Determine the position of an element within the set 1705 index: function(elem) { 1706 if (!elem) { 1707 return this[0] && this[0].parentNode ? this.first().prevAll().length : -1; 1708 } 1709 if (typeof elem === "string") { 1710 return indexOf.call(jQuery2(elem), this[0]); 1711 } 1712 return indexOf.call( 1713 this, 1714 // If it receives a jQuery object, the first element is used 1715 elem.jquery ? elem[0] : elem 1716 ); 1717 }, 1718 add: function(selector, context) { 1719 return this.pushStack( 1720 jQuery2.uniqueSort( 1721 jQuery2.merge(this.get(), jQuery2(selector, context)) 1722 ) 1723 ); 1724 }, 1725 addBack: function(selector) { 1726 return this.add( 1727 selector == null ? this.prevObject : this.prevObject.filter(selector) 1728 ); 1729 } 1730 }); 1731 function sibling(cur, dir2) { 1732 while ((cur = cur[dir2]) && cur.nodeType !== 1) { 1733 } 1734 return cur; 1735 } 1736 jQuery2.each({ 1737 parent: function(elem) { 1738 var parent = elem.parentNode; 1739 return parent && parent.nodeType !== 11 ? parent : null; 1740 }, 1741 parents: function(elem) { 1742 return dir(elem, "parentNode"); 1743 }, 1744 parentsUntil: function(elem, _i, until) { 1745 return dir(elem, "parentNode", until); 1746 }, 1747 next: function(elem) { 1748 return sibling(elem, "nextSibling"); 1749 }, 1750 prev: function(elem) { 1751 return sibling(elem, "previousSibling"); 1752 }, 1753 nextAll: function(elem) { 1754 return dir(elem, "nextSibling"); 1755 }, 1756 prevAll: function(elem) { 1757 return dir(elem, "previousSibling"); 1758 }, 1759 nextUntil: function(elem, _i, until) { 1760 return dir(elem, "nextSibling", until); 1761 }, 1762 prevUntil: function(elem, _i, until) { 1763 return dir(elem, "previousSibling", until); 1764 }, 1765 siblings: function(elem) { 1766 return siblings2((elem.parentNode || {}).firstChild, elem); 1767 }, 1768 children: function(elem) { 1769 return siblings2(elem.firstChild); 1770 }, 1771 contents: function(elem) { 1772 if (elem.contentDocument != null && // Support: IE 11+ 1773 // <object> elements with no `data` attribute has an object 1774 // `contentDocument` with a `null` prototype. 1775 getProto(elem.contentDocument)) { 1776 return elem.contentDocument; 1777 } 1778 if (nodeName(elem, "template")) { 1779 elem = elem.content || elem; 1780 } 1781 return jQuery2.merge([], elem.childNodes); 1782 } 1783 }, function(name, fn) { 1784 jQuery2.fn[name] = function(until, selector) { 1785 var matched = jQuery2.map(this, fn, until); 1786 if (name.slice(-5) !== "Until") { 1787 selector = until; 1788 } 1789 if (selector && typeof selector === "string") { 1790 matched = jQuery2.filter(selector, matched); 1791 } 1792 if (this.length > 1) { 1793 if (!guaranteedUnique[name]) { 1794 jQuery2.uniqueSort(matched); 1795 } 1796 if (rparentsprev.test(name)) { 1797 matched.reverse(); 1798 } 1799 } 1800 return this.pushStack(matched); 1801 }; 1802 }); 1803 var rnothtmlwhite = /[^\x20\t\r\n\f]+/g; 1804 function createOptions(options) { 1805 var object = {}; 1806 jQuery2.each(options.match(rnothtmlwhite) || [], function(_23, flag) { 1807 object[flag] = true; 1808 }); 1809 return object; 1810 } 1811 jQuery2.Callbacks = function(options) { 1812 options = typeof options === "string" ? createOptions(options) : jQuery2.extend({}, options); 1813 var firing, memory, fired, locked, list = [], queue = [], firingIndex = -1, fire = function() { 1814 locked = locked || options.once; 1815 fired = firing = true; 1816 for (; queue.length; firingIndex = -1) { 1817 memory = queue.shift(); 1818 while (++firingIndex < list.length) { 1819 if (list[firingIndex].apply(memory[0], memory[1]) === false && options.stopOnFalse) { 1820 firingIndex = list.length; 1821 memory = false; 1822 } 1823 } 1824 } 1825 if (!options.memory) { 1826 memory = false; 1827 } 1828 firing = false; 1829 if (locked) { 1830 if (memory) { 1831 list = []; 1832 } else { 1833 list = ""; 1834 } 1835 } 1836 }, self = { 1837 // Add a callback or a collection of callbacks to the list 1838 add: function() { 1839 if (list) { 1840 if (memory && !firing) { 1841 firingIndex = list.length - 1; 1842 queue.push(memory); 1843 } 1844 (function add(args) { 1845 jQuery2.each(args, function(_23, arg) { 1846 if (isFunction2(arg)) { 1847 if (!options.unique || !self.has(arg)) { 1848 list.push(arg); 1849 } 1850 } else if (arg && arg.length && toType(arg) !== "string") { 1851 add(arg); 1852 } 1853 }); 1854 })(arguments); 1855 if (memory && !firing) { 1856 fire(); 1857 } 1858 } 1859 return this; 1860 }, 1861 // Remove a callback from the list 1862 remove: function() { 1863 jQuery2.each(arguments, function(_23, arg) { 1864 var index; 1865 while ((index = jQuery2.inArray(arg, list, index)) > -1) { 1866 list.splice(index, 1); 1867 if (index <= firingIndex) { 1868 firingIndex--; 1869 } 1870 } 1871 }); 1872 return this; 1873 }, 1874 // Check if a given callback is in the list. 1875 // If no argument is given, return whether or not list has callbacks attached. 1876 has: function(fn) { 1877 return fn ? jQuery2.inArray(fn, list) > -1 : list.length > 0; 1878 }, 1879 // Remove all callbacks from the list 1880 empty: function() { 1881 if (list) { 1882 list = []; 1883 } 1884 return this; 1885 }, 1886 // Disable .fire and .add 1887 // Abort any current/pending executions 1888 // Clear all callbacks and values 1889 disable: function() { 1890 locked = queue = []; 1891 list = memory = ""; 1892 return this; 1893 }, 1894 disabled: function() { 1895 return !list; 1896 }, 1897 // Disable .fire 1898 // Also disable .add unless we have memory (since it would have no effect) 1899 // Abort any pending executions 1900 lock: function() { 1901 locked = queue = []; 1902 if (!memory && !firing) { 1903 list = memory = ""; 1904 } 1905 return this; 1906 }, 1907 locked: function() { 1908 return !!locked; 1909 }, 1910 // Call all callbacks with the given context and arguments 1911 fireWith: function(context, args) { 1912 if (!locked) { 1913 args = args || []; 1914 args = [context, args.slice ? args.slice() : args]; 1915 queue.push(args); 1916 if (!firing) { 1917 fire(); 1918 } 1919 } 1920 return this; 1921 }, 1922 // Call all the callbacks with the given arguments 1923 fire: function() { 1924 self.fireWith(this, arguments); 1925 return this; 1926 }, 1927 // To know if the callbacks have already been called at least once 1928 fired: function() { 1929 return !!fired; 1930 } 1931 }; 1932 return self; 1933 }; 1934 function Identity(v) { 1935 return v; 1936 } 1937 function Thrower(ex) { 1938 throw ex; 1939 } 1940 function adoptValue(value, resolve, reject, noValue) { 1941 var method; 1942 try { 1943 if (value && isFunction2(method = value.promise)) { 1944 method.call(value).done(resolve).fail(reject); 1945 } else if (value && isFunction2(method = value.then)) { 1946 method.call(value, resolve, reject); 1947 } else { 1948 resolve.apply(void 0, [value].slice(noValue)); 1949 } 1950 } catch (value2) { 1951 reject.apply(void 0, [value2]); 1952 } 1953 } 1954 jQuery2.extend({ 1955 Deferred: function(func) { 1956 var tuples = [ 1957 // action, add listener, callbacks, 1958 // ... .then handlers, argument index, [final state] 1959 [ 1960 "notify", 1961 "progress", 1962 jQuery2.Callbacks("memory"), 1963 jQuery2.Callbacks("memory"), 1964 2 1965 ], 1966 [ 1967 "resolve", 1968 "done", 1969 jQuery2.Callbacks("once memory"), 1970 jQuery2.Callbacks("once memory"), 1971 0, 1972 "resolved" 1973 ], 1974 [ 1975 "reject", 1976 "fail", 1977 jQuery2.Callbacks("once memory"), 1978 jQuery2.Callbacks("once memory"), 1979 1, 1980 "rejected" 1981 ] 1982 ], state = "pending", promise = { 1983 state: function() { 1984 return state; 1985 }, 1986 always: function() { 1987 deferred.done(arguments).fail(arguments); 1988 return this; 1989 }, 1990 "catch": function(fn) { 1991 return promise.then(null, fn); 1992 }, 1993 // Keep pipe for back-compat 1994 pipe: function() { 1995 var fns = arguments; 1996 return jQuery2.Deferred(function(newDefer) { 1997 jQuery2.each(tuples, function(_i, tuple) { 1998 var fn = isFunction2(fns[tuple[4]]) && fns[tuple[4]]; 1999 deferred[tuple[1]](function() { 2000 var returned = fn && fn.apply(this, arguments); 2001 if (returned && isFunction2(returned.promise)) { 2002 returned.promise().progress(newDefer.notify).done(newDefer.resolve).fail(newDefer.reject); 2003 } else { 2004 newDefer[tuple[0] + "With"]( 2005 this, 2006 fn ? [returned] : arguments 2007 ); 2008 } 2009 }); 2010 }); 2011 fns = null; 2012 }).promise(); 2013 }, 2014 then: function(onFulfilled, onRejected, onProgress) { 2015 var maxDepth = 0; 2016 function resolve(depth, deferred2, handler, special) { 2017 return function() { 2018 var that = this, args = arguments, mightThrow = function() { 2019 var returned, then; 2020 if (depth < maxDepth) { 2021 return; 2022 } 2023 returned = handler.apply(that, args); 2024 if (returned === deferred2.promise()) { 2025 throw new TypeError("Thenable self-resolution"); 2026 } 2027 then = returned && // Support: Promises/A+ section 2.3.4 2028 // https://promisesaplus.com/#point-64 2029 // Only check objects and functions for thenability 2030 (typeof returned === "object" || typeof returned === "function") && returned.then; 2031 if (isFunction2(then)) { 2032 if (special) { 2033 then.call( 2034 returned, 2035 resolve(maxDepth, deferred2, Identity, special), 2036 resolve(maxDepth, deferred2, Thrower, special) 2037 ); 2038 } else { 2039 maxDepth++; 2040 then.call( 2041 returned, 2042 resolve(maxDepth, deferred2, Identity, special), 2043 resolve(maxDepth, deferred2, Thrower, special), 2044 resolve( 2045 maxDepth, 2046 deferred2, 2047 Identity, 2048 deferred2.notifyWith 2049 ) 2050 ); 2051 } 2052 } else { 2053 if (handler !== Identity) { 2054 that = void 0; 2055 args = [returned]; 2056 } 2057 (special || deferred2.resolveWith)(that, args); 2058 } 2059 }, process = special ? mightThrow : function() { 2060 try { 2061 mightThrow(); 2062 } catch (e2) { 2063 if (jQuery2.Deferred.exceptionHook) { 2064 jQuery2.Deferred.exceptionHook( 2065 e2, 2066 process.error 2067 ); 2068 } 2069 if (depth + 1 >= maxDepth) { 2070 if (handler !== Thrower) { 2071 that = void 0; 2072 args = [e2]; 2073 } 2074 deferred2.rejectWith(that, args); 2075 } 2076 } 2077 }; 2078 if (depth) { 2079 process(); 2080 } else { 2081 if (jQuery2.Deferred.getErrorHook) { 2082 process.error = jQuery2.Deferred.getErrorHook(); 2083 } else if (jQuery2.Deferred.getStackHook) { 2084 process.error = jQuery2.Deferred.getStackHook(); 2085 } 2086 window2.setTimeout(process); 2087 } 2088 }; 2089 } 2090 return jQuery2.Deferred(function(newDefer) { 2091 tuples[0][3].add( 2092 resolve( 2093 0, 2094 newDefer, 2095 isFunction2(onProgress) ? onProgress : Identity, 2096 newDefer.notifyWith 2097 ) 2098 ); 2099 tuples[1][3].add( 2100 resolve( 2101 0, 2102 newDefer, 2103 isFunction2(onFulfilled) ? onFulfilled : Identity 2104 ) 2105 ); 2106 tuples[2][3].add( 2107 resolve( 2108 0, 2109 newDefer, 2110 isFunction2(onRejected) ? onRejected : Thrower 2111 ) 2112 ); 2113 }).promise(); 2114 }, 2115 // Get a promise for this deferred 2116 // If obj is provided, the promise aspect is added to the object 2117 promise: function(obj) { 2118 return obj != null ? jQuery2.extend(obj, promise) : promise; 2119 } 2120 }, deferred = {}; 2121 jQuery2.each(tuples, function(i, tuple) { 2122 var list = tuple[2], stateString = tuple[5]; 2123 promise[tuple[1]] = list.add; 2124 if (stateString) { 2125 list.add( 2126 function() { 2127 state = stateString; 2128 }, 2129 // rejected_callbacks.disable 2130 // fulfilled_callbacks.disable 2131 tuples[3 - i][2].disable, 2132 // rejected_handlers.disable 2133 // fulfilled_handlers.disable 2134 tuples[3 - i][3].disable, 2135 // progress_callbacks.lock 2136 tuples[0][2].lock, 2137 // progress_handlers.lock 2138 tuples[0][3].lock 2139 ); 2140 } 2141 list.add(tuple[3].fire); 2142 deferred[tuple[0]] = function() { 2143 deferred[tuple[0] + "With"](this === deferred ? void 0 : this, arguments); 2144 return this; 2145 }; 2146 deferred[tuple[0] + "With"] = list.fireWith; 2147 }); 2148 promise.promise(deferred); 2149 if (func) { 2150 func.call(deferred, deferred); 2151 } 2152 return deferred; 2153 }, 2154 // Deferred helper 2155 when: function(singleValue) { 2156 var remaining = arguments.length, i = remaining, resolveContexts = Array(i), resolveValues = slice2.call(arguments), primary = jQuery2.Deferred(), updateFunc = function(i2) { 2157 return function(value) { 2158 resolveContexts[i2] = this; 2159 resolveValues[i2] = arguments.length > 1 ? slice2.call(arguments) : value; 2160 if (!--remaining) { 2161 primary.resolveWith(resolveContexts, resolveValues); 2162 } 2163 }; 2164 }; 2165 if (remaining <= 1) { 2166 adoptValue( 2167 singleValue, 2168 primary.done(updateFunc(i)).resolve, 2169 primary.reject, 2170 !remaining 2171 ); 2172 if (primary.state() === "pending" || isFunction2(resolveValues[i] && resolveValues[i].then)) { 2173 return primary.then(); 2174 } 2175 } 2176 while (i--) { 2177 adoptValue(resolveValues[i], updateFunc(i), primary.reject); 2178 } 2179 return primary.promise(); 2180 } 2181 }); 2182 var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; 2183 jQuery2.Deferred.exceptionHook = function(error2, asyncError) { 2184 if (window2.console && window2.console.warn && error2 && rerrorNames.test(error2.name)) { 2185 window2.console.warn( 2186 "jQuery.Deferred exception: " + error2.message, 2187 error2.stack, 2188 asyncError 2189 ); 2190 } 2191 }; 2192 jQuery2.readyException = function(error2) { 2193 window2.setTimeout(function() { 2194 throw error2; 2195 }); 2196 }; 2197 var readyList = jQuery2.Deferred(); 2198 jQuery2.fn.ready = function(fn) { 2199 readyList.then(fn).catch(function(error2) { 2200 jQuery2.readyException(error2); 2201 }); 2202 return this; 2203 }; 2204 jQuery2.extend({ 2205 // Is the DOM ready to be used? Set to true once it occurs. 2206 isReady: false, 2207 // A counter to track how many items to wait for before 2208 // the ready event fires. See trac-6781 2209 readyWait: 1, 2210 // Handle when the DOM is ready 2211 ready: function(wait) { 2212 if (wait === true ? --jQuery2.readyWait : jQuery2.isReady) { 2213 return; 2214 } 2215 jQuery2.isReady = true; 2216 if (wait !== true && --jQuery2.readyWait > 0) { 2217 return; 2218 } 2219 readyList.resolveWith(document2, [jQuery2]); 2220 } 2221 }); 2222 jQuery2.ready.then = readyList.then; 2223 function completed() { 2224 document2.removeEventListener("DOMContentLoaded", completed); 2225 window2.removeEventListener("load", completed); 2226 jQuery2.ready(); 2227 } 2228 if (document2.readyState === "complete" || document2.readyState !== "loading" && !document2.documentElement.doScroll) { 2229 window2.setTimeout(jQuery2.ready); 2230 } else { 2231 document2.addEventListener("DOMContentLoaded", completed); 2232 window2.addEventListener("load", completed); 2233 } 2234 var access = function(elems, fn, key, value, chainable, emptyGet, raw) { 2235 var i = 0, len = elems.length, bulk = key == null; 2236 if (toType(key) === "object") { 2237 chainable = true; 2238 for (i in key) { 2239 access(elems, fn, i, key[i], true, emptyGet, raw); 2240 } 2241 } else if (value !== void 0) { 2242 chainable = true; 2243 if (!isFunction2(value)) { 2244 raw = true; 2245 } 2246 if (bulk) { 2247 if (raw) { 2248 fn.call(elems, value); 2249 fn = null; 2250 } else { 2251 bulk = fn; 2252 fn = function(elem, _key, value2) { 2253 return bulk.call(jQuery2(elem), value2); 2254 }; 2255 } 2256 } 2257 if (fn) { 2258 for (; i < len; i++) { 2259 fn( 2260 elems[i], 2261 key, 2262 raw ? value : value.call(elems[i], i, fn(elems[i], key)) 2263 ); 2264 } 2265 } 2266 } 2267 if (chainable) { 2268 return elems; 2269 } 2270 if (bulk) { 2271 return fn.call(elems); 2272 } 2273 return len ? fn(elems[0], key) : emptyGet; 2274 }; 2275 var rmsPrefix = /^-ms-/, rdashAlpha = /-([a-z])/g; 2276 function fcamelCase(_all, letter) { 2277 return letter.toUpperCase(); 2278 } 2279 function camelCase(string) { 2280 return string.replace(rmsPrefix, "ms-").replace(rdashAlpha, fcamelCase); 2281 } 2282 var acceptData = function(owner) { 2283 return owner.nodeType === 1 || owner.nodeType === 9 || !+owner.nodeType; 2284 }; 2285 function Data() { 2286 this.expando = jQuery2.expando + Data.uid++; 2287 } 2288 Data.uid = 1; 2289 Data.prototype = { 2290 cache: function(owner) { 2291 var value = owner[this.expando]; 2292 if (!value) { 2293 value = {}; 2294 if (acceptData(owner)) { 2295 if (owner.nodeType) { 2296 owner[this.expando] = value; 2297 } else { 2298 Object.defineProperty(owner, this.expando, { 2299 value, 2300 configurable: true 2301 }); 2302 } 2303 } 2304 } 2305 return value; 2306 }, 2307 set: function(owner, data, value) { 2308 var prop, cache = this.cache(owner); 2309 if (typeof data === "string") { 2310 cache[camelCase(data)] = value; 2311 } else { 2312 for (prop in data) { 2313 cache[camelCase(prop)] = data[prop]; 2314 } 2315 } 2316 return cache; 2317 }, 2318 get: function(owner, key) { 2319 return key === void 0 ? this.cache(owner) : ( 2320 // Always use camelCase key (gh-2257) 2321 owner[this.expando] && owner[this.expando][camelCase(key)] 2322 ); 2323 }, 2324 access: function(owner, key, value) { 2325 if (key === void 0 || key && typeof key === "string" && value === void 0) { 2326 return this.get(owner, key); 2327 } 2328 this.set(owner, key, value); 2329 return value !== void 0 ? value : key; 2330 }, 2331 remove: function(owner, key) { 2332 var i, cache = owner[this.expando]; 2333 if (cache === void 0) { 2334 return; 2335 } 2336 if (key !== void 0) { 2337 if (Array.isArray(key)) { 2338 key = key.map(camelCase); 2339 } else { 2340 key = camelCase(key); 2341 key = key in cache ? [key] : key.match(rnothtmlwhite) || []; 2342 } 2343 i = key.length; 2344 while (i--) { 2345 delete cache[key[i]]; 2346 } 2347 } 2348 if (key === void 0 || jQuery2.isEmptyObject(cache)) { 2349 if (owner.nodeType) { 2350 owner[this.expando] = void 0; 2351 } else { 2352 delete owner[this.expando]; 2353 } 2354 } 2355 }, 2356 hasData: function(owner) { 2357 var cache = owner[this.expando]; 2358 return cache !== void 0 && !jQuery2.isEmptyObject(cache); 2359 } 2360 }; 2361 var dataPriv = new Data(); 2362 var dataUser = new Data(); 2363 var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, rmultiDash = /[A-Z]/g; 2364 function getData(data) { 2365 if (data === "true") { 2366 return true; 2367 } 2368 if (data === "false") { 2369 return false; 2370 } 2371 if (data === "null") { 2372 return null; 2373 } 2374 if (data === +data + "") { 2375 return +data; 2376 } 2377 if (rbrace.test(data)) { 2378 return JSON.parse(data); 2379 } 2380 return data; 2381 } 2382 function dataAttr(elem, key, data) { 2383 var name; 2384 if (data === void 0 && elem.nodeType === 1) { 2385 name = "data-" + key.replace(rmultiDash, "-$&").toLowerCase(); 2386 data = elem.getAttribute(name); 2387 if (typeof data === "string") { 2388 try { 2389 data = getData(data); 2390 } catch (e2) { 2391 } 2392 dataUser.set(elem, key, data); 2393 } else { 2394 data = void 0; 2395 } 2396 } 2397 return data; 2398 } 2399 jQuery2.extend({ 2400 hasData: function(elem) { 2401 return dataUser.hasData(elem) || dataPriv.hasData(elem); 2402 }, 2403 data: function(elem, name, data) { 2404 return dataUser.access(elem, name, data); 2405 }, 2406 removeData: function(elem, name) { 2407 dataUser.remove(elem, name); 2408 }, 2409 // TODO: Now that all calls to _data and _removeData have been replaced 2410 // with direct calls to dataPriv methods, these can be deprecated. 2411 _data: function(elem, name, data) { 2412 return dataPriv.access(elem, name, data); 2413 }, 2414 _removeData: function(elem, name) { 2415 dataPriv.remove(elem, name); 2416 } 2417 }); 2418 jQuery2.fn.extend({ 2419 data: function(key, value) { 2420 var i, name, data, elem = this[0], attrs = elem && elem.attributes; 2421 if (key === void 0) { 2422 if (this.length) { 2423 data = dataUser.get(elem); 2424 if (elem.nodeType === 1 && !dataPriv.get(elem, "hasDataAttrs")) { 2425 i = attrs.length; 2426 while (i--) { 2427 if (attrs[i]) { 2428 name = attrs[i].name; 2429 if (name.indexOf("data-") === 0) { 2430 name = camelCase(name.slice(5)); 2431 dataAttr(elem, name, data[name]); 2432 } 2433 } 2434 } 2435 dataPriv.set(elem, "hasDataAttrs", true); 2436 } 2437 } 2438 return data; 2439 } 2440 if (typeof key === "object") { 2441 return this.each(function() { 2442 dataUser.set(this, key); 2443 }); 2444 } 2445 return access(this, function(value2) { 2446 var data2; 2447 if (elem && value2 === void 0) { 2448 data2 = dataUser.get(elem, key); 2449 if (data2 !== void 0) { 2450 return data2; 2451 } 2452 data2 = dataAttr(elem, key); 2453 if (data2 !== void 0) { 2454 return data2; 2455 } 2456 return; 2457 } 2458 this.each(function() { 2459 dataUser.set(this, key, value2); 2460 }); 2461 }, null, value, arguments.length > 1, null, true); 2462 }, 2463 removeData: function(key) { 2464 return this.each(function() { 2465 dataUser.remove(this, key); 2466 }); 2467 } 2468 }); 2469 jQuery2.extend({ 2470 queue: function(elem, type, data) { 2471 var queue; 2472 if (elem) { 2473 type = (type || "fx") + "queue"; 2474 queue = dataPriv.get(elem, type); 2475 if (data) { 2476 if (!queue || Array.isArray(data)) { 2477 queue = dataPriv.access(elem, type, jQuery2.makeArray(data)); 2478 } else { 2479 queue.push(data); 2480 } 2481 } 2482 return queue || []; 2483 } 2484 }, 2485 dequeue: function(elem, type) { 2486 type = type || "fx"; 2487 var queue = jQuery2.queue(elem, type), startLength = queue.length, fn = queue.shift(), hooks = jQuery2._queueHooks(elem, type), next = function() { 2488 jQuery2.dequeue(elem, type); 2489 }; 2490 if (fn === "inprogress") { 2491 fn = queue.shift(); 2492 startLength--; 2493 } 2494 if (fn) { 2495 if (type === "fx") { 2496 queue.unshift("inprogress"); 2497 } 2498 delete hooks.stop; 2499 fn.call(elem, next, hooks); 2500 } 2501 if (!startLength && hooks) { 2502 hooks.empty.fire(); 2503 } 2504 }, 2505 // Not public - generate a queueHooks object, or return the current one 2506 _queueHooks: function(elem, type) { 2507 var key = type + "queueHooks"; 2508 return dataPriv.get(elem, key) || dataPriv.access(elem, key, { 2509 empty: jQuery2.Callbacks("once memory").add(function() { 2510 dataPriv.remove(elem, [type + "queue", key]); 2511 }) 2512 }); 2513 } 2514 }); 2515 jQuery2.fn.extend({ 2516 queue: function(type, data) { 2517 var setter = 2; 2518 if (typeof type !== "string") { 2519 data = type; 2520 type = "fx"; 2521 setter--; 2522 } 2523 if (arguments.length < setter) { 2524 return jQuery2.queue(this[0], type); 2525 } 2526 return data === void 0 ? this : this.each(function() { 2527 var queue = jQuery2.queue(this, type, data); 2528 jQuery2._queueHooks(this, type); 2529 if (type === "fx" && queue[0] !== "inprogress") { 2530 jQuery2.dequeue(this, type); 2531 } 2532 }); 2533 }, 2534 dequeue: function(type) { 2535 return this.each(function() { 2536 jQuery2.dequeue(this, type); 2537 }); 2538 }, 2539 clearQueue: function(type) { 2540 return this.queue(type || "fx", []); 2541 }, 2542 // Get a promise resolved when queues of a certain type 2543 // are emptied (fx is the type by default) 2544 promise: function(type, obj) { 2545 var tmp, count = 1, defer2 = jQuery2.Deferred(), elements2 = this, i = this.length, resolve = function() { 2546 if (!--count) { 2547 defer2.resolveWith(elements2, [elements2]); 2548 } 2549 }; 2550 if (typeof type !== "string") { 2551 obj = type; 2552 type = void 0; 2553 } 2554 type = type || "fx"; 2555 while (i--) { 2556 tmp = dataPriv.get(elements2[i], type + "queueHooks"); 2557 if (tmp && tmp.empty) { 2558 count++; 2559 tmp.empty.add(resolve); 2560 } 2561 } 2562 resolve(); 2563 return defer2.promise(obj); 2564 } 2565 }); 2566 var pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source; 2567 var rcssNum = new RegExp("^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i"); 2568 var cssExpand = ["Top", "Right", "Bottom", "Left"]; 2569 var documentElement = document2.documentElement; 2570 var isAttached = function(elem) { 2571 return jQuery2.contains(elem.ownerDocument, elem); 2572 }, composed = { composed: true }; 2573 if (documentElement.getRootNode) { 2574 isAttached = function(elem) { 2575 return jQuery2.contains(elem.ownerDocument, elem) || elem.getRootNode(composed) === elem.ownerDocument; 2576 }; 2577 } 2578 var isHiddenWithinTree = function(elem, el) { 2579 elem = el || elem; 2580 return elem.style.display === "none" || elem.style.display === "" && // Otherwise, check computed style 2581 // Support: Firefox <=43 - 45 2582 // Disconnected elements can have computed display: none, so first confirm that elem is 2583 // in the document. 2584 isAttached(elem) && jQuery2.css(elem, "display") === "none"; 2585 }; 2586 function adjustCSS(elem, prop, valueParts, tween) { 2587 var adjusted, scale, maxIterations = 20, currentValue = tween ? function() { 2588 return tween.cur(); 2589 } : function() { 2590 return jQuery2.css(elem, prop, ""); 2591 }, initial = currentValue(), unit = valueParts && valueParts[3] || (jQuery2.cssNumber[prop] ? "" : "px"), initialInUnit = elem.nodeType && (jQuery2.cssNumber[prop] || unit !== "px" && +initial) && rcssNum.exec(jQuery2.css(elem, prop)); 2592 if (initialInUnit && initialInUnit[3] !== unit) { 2593 initial = initial / 2; 2594 unit = unit || initialInUnit[3]; 2595 initialInUnit = +initial || 1; 2596 while (maxIterations--) { 2597 jQuery2.style(elem, prop, initialInUnit + unit); 2598 if ((1 - scale) * (1 - (scale = currentValue() / initial || 0.5)) <= 0) { 2599 maxIterations = 0; 2600 } 2601 initialInUnit = initialInUnit / scale; 2602 } 2603 initialInUnit = initialInUnit * 2; 2604 jQuery2.style(elem, prop, initialInUnit + unit); 2605 valueParts = valueParts || []; 2606 } 2607 if (valueParts) { 2608 initialInUnit = +initialInUnit || +initial || 0; 2609 adjusted = valueParts[1] ? initialInUnit + (valueParts[1] + 1) * valueParts[2] : +valueParts[2]; 2610 if (tween) { 2611 tween.unit = unit; 2612 tween.start = initialInUnit; 2613 tween.end = adjusted; 2614 } 2615 } 2616 return adjusted; 2617 } 2618 var defaultDisplayMap = {}; 2619 function getDefaultDisplay(elem) { 2620 var temp, doc = elem.ownerDocument, nodeName2 = elem.nodeName, display = defaultDisplayMap[nodeName2]; 2621 if (display) { 2622 return display; 2623 } 2624 temp = doc.body.appendChild(doc.createElement(nodeName2)); 2625 display = jQuery2.css(temp, "display"); 2626 temp.parentNode.removeChild(temp); 2627 if (display === "none") { 2628 display = "block"; 2629 } 2630 defaultDisplayMap[nodeName2] = display; 2631 return display; 2632 } 2633 function showHide(elements2, show) { 2634 var display, elem, values = [], index = 0, length = elements2.length; 2635 for (; index < length; index++) { 2636 elem = elements2[index]; 2637 if (!elem.style) { 2638 continue; 2639 } 2640 display = elem.style.display; 2641 if (show) { 2642 if (display === "none") { 2643 values[index] = dataPriv.get(elem, "display") || null; 2644 if (!values[index]) { 2645 elem.style.display = ""; 2646 } 2647 } 2648 if (elem.style.display === "" && isHiddenWithinTree(elem)) { 2649 values[index] = getDefaultDisplay(elem); 2650 } 2651 } else { 2652 if (display !== "none") { 2653 values[index] = "none"; 2654 dataPriv.set(elem, "display", display); 2655 } 2656 } 2657 } 2658 for (index = 0; index < length; index++) { 2659 if (values[index] != null) { 2660 elements2[index].style.display = values[index]; 2661 } 2662 } 2663 return elements2; 2664 } 2665 jQuery2.fn.extend({ 2666 show: function() { 2667 return showHide(this, true); 2668 }, 2669 hide: function() { 2670 return showHide(this); 2671 }, 2672 toggle: function(state) { 2673 if (typeof state === "boolean") { 2674 return state ? this.show() : this.hide(); 2675 } 2676 return this.each(function() { 2677 if (isHiddenWithinTree(this)) { 2678 jQuery2(this).show(); 2679 } else { 2680 jQuery2(this).hide(); 2681 } 2682 }); 2683 } 2684 }); 2685 var rcheckableType = /^(?:checkbox|radio)$/i; 2686 var rtagName = /<([a-z][^\/\0>\x20\t\r\n\f]*)/i; 2687 var rscriptType = /^$|^module$|\/(?:java|ecma)script/i; 2688 (function() { 2689 var fragment = document2.createDocumentFragment(), div = fragment.appendChild(document2.createElement("div")), input = document2.createElement("input"); 2690 input.setAttribute("type", "radio"); 2691 input.setAttribute("checked", "checked"); 2692 input.setAttribute("name", "t"); 2693 div.appendChild(input); 2694 support.checkClone = div.cloneNode(true).cloneNode(true).lastChild.checked; 2695 div.innerHTML = "<textarea>x</textarea>"; 2696 support.noCloneChecked = !!div.cloneNode(true).lastChild.defaultValue; 2697 div.innerHTML = "<option></option>"; 2698 support.option = !!div.lastChild; 2699 })(); 2700 var wrapMap = { 2701 // XHTML parsers do not magically insert elements in the 2702 // same way that tag soup parsers do. So we cannot shorten 2703 // this by omitting <tbody> or other required elements. 2704 thead: [1, "<table>", "</table>"], 2705 col: [2, "<table><colgroup>", "</colgroup></table>"], 2706 tr: [2, "<table><tbody>", "</tbody></table>"], 2707 td: [3, "<table><tbody><tr>", "</tr></tbody></table>"], 2708 _default: [0, "", ""] 2709 }; 2710 wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; 2711 wrapMap.th = wrapMap.td; 2712 if (!support.option) { 2713 wrapMap.optgroup = wrapMap.option = [1, "<select multiple='multiple'>", "</select>"]; 2714 } 2715 function getAll(context, tag) { 2716 var ret; 2717 if (typeof context.getElementsByTagName !== "undefined") { 2718 ret = context.getElementsByTagName(tag || "*"); 2719 } else if (typeof context.querySelectorAll !== "undefined") { 2720 ret = context.querySelectorAll(tag || "*"); 2721 } else { 2722 ret = []; 2723 } 2724 if (tag === void 0 || tag && nodeName(context, tag)) { 2725 return jQuery2.merge([context], ret); 2726 } 2727 return ret; 2728 } 2729 function setGlobalEval(elems, refElements) { 2730 var i = 0, l = elems.length; 2731 for (; i < l; i++) { 2732 dataPriv.set( 2733 elems[i], 2734 "globalEval", 2735 !refElements || dataPriv.get(refElements[i], "globalEval") 2736 ); 2737 } 2738 } 2739 var rhtml = /<|&#?\w+;/; 2740 function buildFragment(elems, context, scripts, selection, ignored) { 2741 var elem, tmp, tag, wrap, attached, j, fragment = context.createDocumentFragment(), nodes = [], i = 0, l = elems.length; 2742 for (; i < l; i++) { 2743 elem = elems[i]; 2744 if (elem || elem === 0) { 2745 if (toType(elem) === "object") { 2746 jQuery2.merge(nodes, elem.nodeType ? [elem] : elem); 2747 } else if (!rhtml.test(elem)) { 2748 nodes.push(context.createTextNode(elem)); 2749 } else { 2750 tmp = tmp || fragment.appendChild(context.createElement("div")); 2751 tag = (rtagName.exec(elem) || ["", ""])[1].toLowerCase(); 2752 wrap = wrapMap[tag] || wrapMap._default; 2753 tmp.innerHTML = wrap[1] + jQuery2.htmlPrefilter(elem) + wrap[2]; 2754 j = wrap[0]; 2755 while (j--) { 2756 tmp = tmp.lastChild; 2757 } 2758 jQuery2.merge(nodes, tmp.childNodes); 2759 tmp = fragment.firstChild; 2760 tmp.textContent = ""; 2761 } 2762 } 2763 } 2764 fragment.textContent = ""; 2765 i = 0; 2766 while (elem = nodes[i++]) { 2767 if (selection && jQuery2.inArray(elem, selection) > -1) { 2768 if (ignored) { 2769 ignored.push(elem); 2770 } 2771 continue; 2772 } 2773 attached = isAttached(elem); 2774 tmp = getAll(fragment.appendChild(elem), "script"); 2775 if (attached) { 2776 setGlobalEval(tmp); 2777 } 2778 if (scripts) { 2779 j = 0; 2780 while (elem = tmp[j++]) { 2781 if (rscriptType.test(elem.type || "")) { 2782 scripts.push(elem); 2783 } 2784 } 2785 } 2786 } 2787 return fragment; 2788 } 2789 var rtypenamespace = /^([^.]*)(?:\.(.+)|)/; 2790 function returnTrue() { 2791 return true; 2792 } 2793 function returnFalse() { 2794 return false; 2795 } 2796 function on(elem, types, selector, data, fn, one) { 2797 var origFn, type; 2798 if (typeof types === "object") { 2799 if (typeof selector !== "string") { 2800 data = data || selector; 2801 selector = void 0; 2802 } 2803 for (type in types) { 2804 on(elem, type, selector, data, types[type], one); 2805 } 2806 return elem; 2807 } 2808 if (data == null && fn == null) { 2809 fn = selector; 2810 data = selector = void 0; 2811 } else if (fn == null) { 2812 if (typeof selector === "string") { 2813 fn = data; 2814 data = void 0; 2815 } else { 2816 fn = data; 2817 data = selector; 2818 selector = void 0; 2819 } 2820 } 2821 if (fn === false) { 2822 fn = returnFalse; 2823 } else if (!fn) { 2824 return elem; 2825 } 2826 if (one === 1) { 2827 origFn = fn; 2828 fn = function(event) { 2829 jQuery2().off(event); 2830 return origFn.apply(this, arguments); 2831 }; 2832 fn.guid = origFn.guid || (origFn.guid = jQuery2.guid++); 2833 } 2834 return elem.each(function() { 2835 jQuery2.event.add(this, types, fn, data, selector); 2836 }); 2837 } 2838 jQuery2.event = { 2839 global: {}, 2840 add: function(elem, types, handler, data, selector) { 2841 var handleObjIn, eventHandle, tmp, events, t3, handleObj, special, handlers, type, namespaces, origType, elemData = dataPriv.get(elem); 2842 if (!acceptData(elem)) { 2843 return; 2844 } 2845 if (handler.handler) { 2846 handleObjIn = handler; 2847 handler = handleObjIn.handler; 2848 selector = handleObjIn.selector; 2849 } 2850 if (selector) { 2851 jQuery2.find.matchesSelector(documentElement, selector); 2852 } 2853 if (!handler.guid) { 2854 handler.guid = jQuery2.guid++; 2855 } 2856 if (!(events = elemData.events)) { 2857 events = elemData.events = /* @__PURE__ */ Object.create(null); 2858 } 2859 if (!(eventHandle = elemData.handle)) { 2860 eventHandle = elemData.handle = function(e2) { 2861 return typeof jQuery2 !== "undefined" && jQuery2.event.triggered !== e2.type ? jQuery2.event.dispatch.apply(elem, arguments) : void 0; 2862 }; 2863 } 2864 types = (types || "").match(rnothtmlwhite) || [""]; 2865 t3 = types.length; 2866 while (t3--) { 2867 tmp = rtypenamespace.exec(types[t3]) || []; 2868 type = origType = tmp[1]; 2869 namespaces = (tmp[2] || "").split(".").sort(); 2870 if (!type) { 2871 continue; 2872 } 2873 special = jQuery2.event.special[type] || {}; 2874 type = (selector ? special.delegateType : special.bindType) || type; 2875 special = jQuery2.event.special[type] || {}; 2876 handleObj = jQuery2.extend({ 2877 type, 2878 origType, 2879 data, 2880 handler, 2881 guid: handler.guid, 2882 selector, 2883 needsContext: selector && jQuery2.expr.match.needsContext.test(selector), 2884 namespace: namespaces.join(".") 2885 }, handleObjIn); 2886 if (!(handlers = events[type])) { 2887 handlers = events[type] = []; 2888 handlers.delegateCount = 0; 2889 if (!special.setup || special.setup.call(elem, data, namespaces, eventHandle) === false) { 2890 if (elem.addEventListener) { 2891 elem.addEventListener(type, eventHandle); 2892 } 2893 } 2894 } 2895 if (special.add) { 2896 special.add.call(elem, handleObj); 2897 if (!handleObj.handler.guid) { 2898 handleObj.handler.guid = handler.guid; 2899 } 2900 } 2901 if (selector) { 2902 handlers.splice(handlers.delegateCount++, 0, handleObj); 2903 } else { 2904 handlers.push(handleObj); 2905 } 2906 jQuery2.event.global[type] = true; 2907 } 2908 }, 2909 // Detach an event or set of events from an element 2910 remove: function(elem, types, handler, selector, mappedTypes) { 2911 var j, origCount, tmp, events, t3, handleObj, special, handlers, type, namespaces, origType, elemData = dataPriv.hasData(elem) && dataPriv.get(elem); 2912 if (!elemData || !(events = elemData.events)) { 2913 return; 2914 } 2915 types = (types || "").match(rnothtmlwhite) || [""]; 2916 t3 = types.length; 2917 while (t3--) { 2918 tmp = rtypenamespace.exec(types[t3]) || []; 2919 type = origType = tmp[1]; 2920 namespaces = (tmp[2] || "").split(".").sort(); 2921 if (!type) { 2922 for (type in events) { 2923 jQuery2.event.remove(elem, type + types[t3], handler, selector, true); 2924 } 2925 continue; 2926 } 2927 special = jQuery2.event.special[type] || {}; 2928 type = (selector ? special.delegateType : special.bindType) || type; 2929 handlers = events[type] || []; 2930 tmp = tmp[2] && new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)"); 2931 origCount = j = handlers.length; 2932 while (j--) { 2933 handleObj = handlers[j]; 2934 if ((mappedTypes || origType === handleObj.origType) && (!handler || handler.guid === handleObj.guid) && (!tmp || tmp.test(handleObj.namespace)) && (!selector || selector === handleObj.selector || selector === "**" && handleObj.selector)) { 2935 handlers.splice(j, 1); 2936 if (handleObj.selector) { 2937 handlers.delegateCount--; 2938 } 2939 if (special.remove) { 2940 special.remove.call(elem, handleObj); 2941 } 2942 } 2943 } 2944 if (origCount && !handlers.length) { 2945 if (!special.teardown || special.teardown.call(elem, namespaces, elemData.handle) === false) { 2946 jQuery2.removeEvent(elem, type, elemData.handle); 2947 } 2948 delete events[type]; 2949 } 2950 } 2951 if (jQuery2.isEmptyObject(events)) { 2952 dataPriv.remove(elem, "handle events"); 2953 } 2954 }, 2955 dispatch: function(nativeEvent) { 2956 var i, j, ret, matched, handleObj, handlerQueue, args = new Array(arguments.length), event = jQuery2.event.fix(nativeEvent), handlers = (dataPriv.get(this, "events") || /* @__PURE__ */ Object.create(null))[event.type] || [], special = jQuery2.event.special[event.type] || {}; 2957 args[0] = event; 2958 for (i = 1; i < arguments.length; i++) { 2959 args[i] = arguments[i]; 2960 } 2961 event.delegateTarget = this; 2962 if (special.preDispatch && special.preDispatch.call(this, event) === false) { 2963 return; 2964 } 2965 handlerQueue = jQuery2.event.handlers.call(this, event, handlers); 2966 i = 0; 2967 while ((matched = handlerQueue[i++]) && !event.isPropagationStopped()) { 2968 event.currentTarget = matched.elem; 2969 j = 0; 2970 while ((handleObj = matched.handlers[j++]) && !event.isImmediatePropagationStopped()) { 2971 if (!event.rnamespace || handleObj.namespace === false || event.rnamespace.test(handleObj.namespace)) { 2972 event.handleObj = handleObj; 2973 event.data = handleObj.data; 2974 ret = ((jQuery2.event.special[handleObj.origType] || {}).handle || handleObj.handler).apply(matched.elem, args); 2975 if (ret !== void 0) { 2976 if ((event.result = ret) === false) { 2977 event.preventDefault(); 2978 event.stopPropagation(); 2979 } 2980 } 2981 } 2982 } 2983 } 2984 if (special.postDispatch) { 2985 special.postDispatch.call(this, event); 2986 } 2987 return event.result; 2988 }, 2989 handlers: function(event, handlers) { 2990 var i, handleObj, sel, matchedHandlers, matchedSelectors, handlerQueue = [], delegateCount = handlers.delegateCount, cur = event.target; 2991 if (delegateCount && // Support: IE <=9 2992 // Black-hole SVG <use> instance trees (trac-13180) 2993 cur.nodeType && // Support: Firefox <=42 2994 // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861) 2995 // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click 2996 // Support: IE 11 only 2997 // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343) 2998 !(event.type === "click" && event.button >= 1)) { 2999 for (; cur !== this; cur = cur.parentNode || this) { 3000 if (cur.nodeType === 1 && !(event.type === "click" && cur.disabled === true)) { 3001 matchedHandlers = []; 3002 matchedSelectors = {}; 3003 for (i = 0; i < delegateCount; i++) { 3004 handleObj = handlers[i]; 3005 sel = handleObj.selector + " "; 3006 if (matchedSelectors[sel] === void 0) { 3007 matchedSelectors[sel] = handleObj.needsContext ? jQuery2(sel, this).index(cur) > -1 : jQuery2.find(sel, this, null, [cur]).length; 3008 } 3009 if (matchedSelectors[sel]) { 3010 matchedHandlers.push(handleObj); 3011 } 3012 } 3013 if (matchedHandlers.length) { 3014 handlerQueue.push({ elem: cur, handlers: matchedHandlers }); 3015 } 3016 } 3017 } 3018 } 3019 cur = this; 3020 if (delegateCount < handlers.length) { 3021 handlerQueue.push({ elem: cur, handlers: handlers.slice(delegateCount) }); 3022 } 3023 return handlerQueue; 3024 }, 3025 addProp: function(name, hook) { 3026 Object.defineProperty(jQuery2.Event.prototype, name, { 3027 enumerable: true, 3028 configurable: true, 3029 get: isFunction2(hook) ? function() { 3030 if (this.originalEvent) { 3031 return hook(this.originalEvent); 3032 } 3033 } : function() { 3034 if (this.originalEvent) { 3035 return this.originalEvent[name]; 3036 } 3037 }, 3038 set: function(value) { 3039 Object.defineProperty(this, name, { 3040 enumerable: true, 3041 configurable: true, 3042 writable: true, 3043 value 3044 }); 3045 } 3046 }); 3047 }, 3048 fix: function(originalEvent) { 3049 return originalEvent[jQuery2.expando] ? originalEvent : new jQuery2.Event(originalEvent); 3050 }, 3051 special: { 3052 load: { 3053 // Prevent triggered image.load events from bubbling to window.load 3054 noBubble: true 3055 }, 3056 click: { 3057 // Utilize native event to ensure correct state for checkable inputs 3058 setup: function(data) { 3059 var el = this || data; 3060 if (rcheckableType.test(el.type) && el.click && nodeName(el, "input")) { 3061 leverageNative(el, "click", true); 3062 } 3063 return false; 3064 }, 3065 trigger: function(data) { 3066 var el = this || data; 3067 if (rcheckableType.test(el.type) && el.click && nodeName(el, "input")) { 3068 leverageNative(el, "click"); 3069 } 3070 return true; 3071 }, 3072 // For cross-browser consistency, suppress native .click() on links 3073 // Also prevent it if we're currently inside a leveraged native-event stack 3074 _default: function(event) { 3075 var target = event.target; 3076 return rcheckableType.test(target.type) && target.click && nodeName(target, "input") && dataPriv.get(target, "click") || nodeName(target, "a"); 3077 } 3078 }, 3079 beforeunload: { 3080 postDispatch: function(event) { 3081 if (event.result !== void 0 && event.originalEvent) { 3082 event.originalEvent.returnValue = event.result; 3083 } 3084 } 3085 } 3086 } 3087 }; 3088 function leverageNative(el, type, isSetup) { 3089 if (!isSetup) { 3090 if (dataPriv.get(el, type) === void 0) { 3091 jQuery2.event.add(el, type, returnTrue); 3092 } 3093 return; 3094 } 3095 dataPriv.set(el, type, false); 3096 jQuery2.event.add(el, type, { 3097 namespace: false, 3098 handler: function(event) { 3099 var result, saved = dataPriv.get(this, type); 3100 if (event.isTrigger & 1 && this[type]) { 3101 if (!saved) { 3102 saved = slice2.call(arguments); 3103 dataPriv.set(this, type, saved); 3104 this[type](); 3105 result = dataPriv.get(this, type); 3106 dataPriv.set(this, type, false); 3107 if (saved !== result) { 3108 event.stopImmediatePropagation(); 3109 event.preventDefault(); 3110 return result; 3111 } 3112 } else if ((jQuery2.event.special[type] || {}).delegateType) { 3113 event.stopPropagation(); 3114 } 3115 } else if (saved) { 3116 dataPriv.set(this, type, jQuery2.event.trigger( 3117 saved[0], 3118 saved.slice(1), 3119 this 3120 )); 3121 event.stopPropagation(); 3122 event.isImmediatePropagationStopped = returnTrue; 3123 } 3124 } 3125 }); 3126 } 3127 jQuery2.removeEvent = function(elem, type, handle2) { 3128 if (elem.removeEventListener) { 3129 elem.removeEventListener(type, handle2); 3130 } 3131 }; 3132 jQuery2.Event = function(src, props) { 3133 if (!(this instanceof jQuery2.Event)) { 3134 return new jQuery2.Event(src, props); 3135 } 3136 if (src && src.type) { 3137 this.originalEvent = src; 3138 this.type = src.type; 3139 this.isDefaultPrevented = src.defaultPrevented || src.defaultPrevented === void 0 && // Support: Android <=2.3 only 3140 src.returnValue === false ? returnTrue : returnFalse; 3141 this.target = src.target && src.target.nodeType === 3 ? src.target.parentNode : src.target; 3142 this.currentTarget = src.currentTarget; 3143 this.relatedTarget = src.relatedTarget; 3144 } else { 3145 this.type = src; 3146 } 3147 if (props) { 3148 jQuery2.extend(this, props); 3149 } 3150 this.timeStamp = src && src.timeStamp || Date.now(); 3151 this[jQuery2.expando] = true; 3152 }; 3153 jQuery2.Event.prototype = { 3154 constructor: jQuery2.Event, 3155 isDefaultPrevented: returnFalse, 3156 isPropagationStopped: returnFalse, 3157 isImmediatePropagationStopped: returnFalse, 3158 isSimulated: false, 3159 preventDefault: function() { 3160 var e2 = this.originalEvent; 3161 this.isDefaultPrevented = returnTrue; 3162 if (e2 && !this.isSimulated) { 3163 e2.preventDefault(); 3164 } 3165 }, 3166 stopPropagation: function() { 3167 var e2 = this.originalEvent; 3168 this.isPropagationStopped = returnTrue; 3169 if (e2 && !this.isSimulated) { 3170 e2.stopPropagation(); 3171 } 3172 }, 3173 stopImmediatePropagation: function() { 3174 var e2 = this.originalEvent; 3175 this.isImmediatePropagationStopped = returnTrue; 3176 if (e2 && !this.isSimulated) { 3177 e2.stopImmediatePropagation(); 3178 } 3179 this.stopPropagation(); 3180 } 3181 }; 3182 jQuery2.each({ 3183 altKey: true, 3184 bubbles: true, 3185 cancelable: true, 3186 changedTouches: true, 3187 ctrlKey: true, 3188 detail: true, 3189 eventPhase: true, 3190 metaKey: true, 3191 pageX: true, 3192 pageY: true, 3193 shiftKey: true, 3194 view: true, 3195 "char": true, 3196 code: true, 3197 charCode: true, 3198 key: true, 3199 keyCode: true, 3200 button: true, 3201 buttons: true, 3202 clientX: true, 3203 clientY: true, 3204 offsetX: true, 3205 offsetY: true, 3206 pointerId: true, 3207 pointerType: true, 3208 screenX: true, 3209 screenY: true, 3210 targetTouches: true, 3211 toElement: true, 3212 touches: true, 3213 which: true 3214 }, jQuery2.event.addProp); 3215 jQuery2.each({ focus: "focusin", blur: "focusout" }, function(type, delegateType) { 3216 function focusMappedHandler(nativeEvent) { 3217 if (document2.documentMode) { 3218 var handle2 = dataPriv.get(this, "handle"), event = jQuery2.event.fix(nativeEvent); 3219 event.type = nativeEvent.type === "focusin" ? "focus" : "blur"; 3220 event.isSimulated = true; 3221 handle2(nativeEvent); 3222 if (event.target === event.currentTarget) { 3223 handle2(event); 3224 } 3225 } else { 3226 jQuery2.event.simulate( 3227 delegateType, 3228 nativeEvent.target, 3229 jQuery2.event.fix(nativeEvent) 3230 ); 3231 } 3232 } 3233 jQuery2.event.special[type] = { 3234 // Utilize native event if possible so blur/focus sequence is correct 3235 setup: function() { 3236 var attaches; 3237 leverageNative(this, type, true); 3238 if (document2.documentMode) { 3239 attaches = dataPriv.get(this, delegateType); 3240 if (!attaches) { 3241 this.addEventListener(delegateType, focusMappedHandler); 3242 } 3243 dataPriv.set(this, delegateType, (attaches || 0) + 1); 3244 } else { 3245 return false; 3246 } 3247 }, 3248 trigger: function() { 3249 leverageNative(this, type); 3250 return true; 3251 }, 3252 teardown: function() { 3253 var attaches; 3254 if (document2.documentMode) { 3255 attaches = dataPriv.get(this, delegateType) - 1; 3256 if (!attaches) { 3257 this.removeEventListener(delegateType, focusMappedHandler); 3258 dataPriv.remove(this, delegateType); 3259 } else { 3260 dataPriv.set(this, delegateType, attaches); 3261 } 3262 } else { 3263 return false; 3264 } 3265 }, 3266 // Suppress native focus or blur if we're currently inside 3267 // a leveraged native-event stack 3268 _default: function(event) { 3269 return dataPriv.get(event.target, type); 3270 }, 3271 delegateType 3272 }; 3273 jQuery2.event.special[delegateType] = { 3274 setup: function() { 3275 var doc = this.ownerDocument || this.document || this, dataHolder = document2.documentMode ? this : doc, attaches = dataPriv.get(dataHolder, delegateType); 3276 if (!attaches) { 3277 if (document2.documentMode) { 3278 this.addEventListener(delegateType, focusMappedHandler); 3279 } else { 3280 doc.addEventListener(type, focusMappedHandler, true); 3281 } 3282 } 3283 dataPriv.set(dataHolder, delegateType, (attaches || 0) + 1); 3284 }, 3285 teardown: function() { 3286 var doc = this.ownerDocument || this.document || this, dataHolder = document2.documentMode ? this : doc, attaches = dataPriv.get(dataHolder, delegateType) - 1; 3287 if (!attaches) { 3288 if (document2.documentMode) { 3289 this.removeEventListener(delegateType, focusMappedHandler); 3290 } else { 3291 doc.removeEventListener(type, focusMappedHandler, true); 3292 } 3293 dataPriv.remove(dataHolder, delegateType); 3294 } else { 3295 dataPriv.set(dataHolder, delegateType, attaches); 3296 } 3297 } 3298 }; 3299 }); 3300 jQuery2.each({ 3301 mouseenter: "mouseover", 3302 mouseleave: "mouseout", 3303 pointerenter: "pointerover", 3304 pointerleave: "pointerout" 3305 }, function(orig, fix) { 3306 jQuery2.event.special[orig] = { 3307 delegateType: fix, 3308 bindType: fix, 3309 handle: function(event) { 3310 var ret, target = this, related = event.relatedTarget, handleObj = event.handleObj; 3311 if (!related || related !== target && !jQuery2.contains(target, related)) { 3312 event.type = handleObj.origType; 3313 ret = handleObj.handler.apply(this, arguments); 3314 event.type = fix; 3315 } 3316 return ret; 3317 } 3318 }; 3319 }); 3320 jQuery2.fn.extend({ 3321 on: function(types, selector, data, fn) { 3322 return on(this, types, selector, data, fn); 3323 }, 3324 one: function(types, selector, data, fn) { 3325 return on(this, types, selector, data, fn, 1); 3326 }, 3327 off: function(types, selector, fn) { 3328 var handleObj, type; 3329 if (types && types.preventDefault && types.handleObj) { 3330 handleObj = types.handleObj; 3331 jQuery2(types.delegateTarget).off( 3332 handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, 3333 handleObj.selector, 3334 handleObj.handler 3335 ); 3336 return this; 3337 } 3338 if (typeof types === "object") { 3339 for (type in types) { 3340 this.off(type, selector, types[type]); 3341 } 3342 return this; 3343 } 3344 if (selector === false || typeof selector === "function") { 3345 fn = selector; 3346 selector = void 0; 3347 } 3348 if (fn === false) { 3349 fn = returnFalse; 3350 } 3351 return this.each(function() { 3352 jQuery2.event.remove(this, types, fn, selector); 3353 }); 3354 } 3355 }); 3356 var rnoInnerhtml = /<script|<style|<link/i, rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, rcleanScript = /^\s*<!\[CDATA\[|\]\]>\s*$/g; 3357 function manipulationTarget(elem, content) { 3358 if (nodeName(elem, "table") && nodeName(content.nodeType !== 11 ? content : content.firstChild, "tr")) { 3359 return jQuery2(elem).children("tbody")[0] || elem; 3360 } 3361 return elem; 3362 } 3363 function disableScript(elem) { 3364 elem.type = (elem.getAttribute("type") !== null) + "/" + elem.type; 3365 return elem; 3366 } 3367 function restoreScript(elem) { 3368 if ((elem.type || "").slice(0, 5) === "true/") { 3369 elem.type = elem.type.slice(5); 3370 } else { 3371 elem.removeAttribute("type"); 3372 } 3373 return elem; 3374 } 3375 function cloneCopyEvent(src, dest) { 3376 var i, l, type, pdataOld, udataOld, udataCur, events; 3377 if (dest.nodeType !== 1) { 3378 return; 3379 } 3380 if (dataPriv.hasData(src)) { 3381 pdataOld = dataPriv.get(src); 3382 events = pdataOld.events; 3383 if (events) { 3384 dataPriv.remove(dest, "handle events"); 3385 for (type in events) { 3386 for (i = 0, l = events[type].length; i < l; i++) { 3387 jQuery2.event.add(dest, type, events[type][i]); 3388 } 3389 } 3390 } 3391 } 3392 if (dataUser.hasData(src)) { 3393 udataOld = dataUser.access(src); 3394 udataCur = jQuery2.extend({}, udataOld); 3395 dataUser.set(dest, udataCur); 3396 } 3397 } 3398 function fixInput(src, dest) { 3399 var nodeName2 = dest.nodeName.toLowerCase(); 3400 if (nodeName2 === "input" && rcheckableType.test(src.type)) { 3401 dest.checked = src.checked; 3402 } else if (nodeName2 === "input" || nodeName2 === "textarea") { 3403 dest.defaultValue = src.defaultValue; 3404 } 3405 } 3406 function domManip(collection, args, callback, ignored) { 3407 args = flat(args); 3408 var fragment, first, scripts, hasScripts, node, doc, i = 0, l = collection.length, iNoClone = l - 1, value = args[0], valueIsFunction = isFunction2(value); 3409 if (valueIsFunction || l > 1 && typeof value === "string" && !support.checkClone && rchecked.test(value)) { 3410 return collection.each(function(index) { 3411 var self = collection.eq(index); 3412 if (valueIsFunction) { 3413 args[0] = value.call(this, index, self.html()); 3414 } 3415 domManip(self, args, callback, ignored); 3416 }); 3417 } 3418 if (l) { 3419 fragment = buildFragment(args, collection[0].ownerDocument, false, collection, ignored); 3420 first = fragment.firstChild; 3421 if (fragment.childNodes.length === 1) { 3422 fragment = first; 3423 } 3424 if (first || ignored) { 3425 scripts = jQuery2.map(getAll(fragment, "script"), disableScript); 3426 hasScripts = scripts.length; 3427 for (; i < l; i++) { 3428 node = fragment; 3429 if (i !== iNoClone) { 3430 node = jQuery2.clone(node, true, true); 3431 if (hasScripts) { 3432 jQuery2.merge(scripts, getAll(node, "script")); 3433 } 3434 } 3435 callback.call(collection[i], node, i); 3436 } 3437 if (hasScripts) { 3438 doc = scripts[scripts.length - 1].ownerDocument; 3439 jQuery2.map(scripts, restoreScript); 3440 for (i = 0; i < hasScripts; i++) { 3441 node = scripts[i]; 3442 if (rscriptType.test(node.type || "") && !dataPriv.access(node, "globalEval") && jQuery2.contains(doc, node)) { 3443 if (node.src && (node.type || "").toLowerCase() !== "module") { 3444 if (jQuery2._evalUrl && !node.noModule) { 3445 jQuery2._evalUrl(node.src, { 3446 nonce: node.nonce || node.getAttribute("nonce") 3447 }, doc); 3448 } 3449 } else { 3450 DOMEval(node.textContent.replace(rcleanScript, ""), node, doc); 3451 } 3452 } 3453 } 3454 } 3455 } 3456 } 3457 return collection; 3458 } 3459 function remove2(elem, selector, keepData) { 3460 var node, nodes = selector ? jQuery2.filter(selector, elem) : elem, i = 0; 3461 for (; (node = nodes[i]) != null; i++) { 3462 if (!keepData && node.nodeType === 1) { 3463 jQuery2.cleanData(getAll(node)); 3464 } 3465 if (node.parentNode) { 3466 if (keepData && isAttached(node)) { 3467 setGlobalEval(getAll(node, "script")); 3468 } 3469 node.parentNode.removeChild(node); 3470 } 3471 } 3472 return elem; 3473 } 3474 jQuery2.extend({ 3475 htmlPrefilter: function(html) { 3476 return html; 3477 }, 3478 clone: function(elem, dataAndEvents, deepDataAndEvents) { 3479 var i, l, srcElements, destElements, clone = elem.cloneNode(true), inPage = isAttached(elem); 3480 if (!support.noCloneChecked && (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery2.isXMLDoc(elem)) { 3481 destElements = getAll(clone); 3482 srcElements = getAll(elem); 3483 for (i = 0, l = srcElements.length; i < l; i++) { 3484 fixInput(srcElements[i], destElements[i]); 3485 } 3486 } 3487 if (dataAndEvents) { 3488 if (deepDataAndEvents) { 3489 srcElements = srcElements || getAll(elem); 3490 destElements = destElements || getAll(clone); 3491 for (i = 0, l = srcElements.length; i < l; i++) { 3492 cloneCopyEvent(srcElements[i], destElements[i]); 3493 } 3494 } else { 3495 cloneCopyEvent(elem, clone); 3496 } 3497 } 3498 destElements = getAll(clone, "script"); 3499 if (destElements.length > 0) { 3500 setGlobalEval(destElements, !inPage && getAll(elem, "script")); 3501 } 3502 return clone; 3503 }, 3504 cleanData: function(elems) { 3505 var data, elem, type, special = jQuery2.event.special, i = 0; 3506 for (; (elem = elems[i]) !== void 0; i++) { 3507 if (acceptData(elem)) { 3508 if (data = elem[dataPriv.expando]) { 3509 if (data.events) { 3510 for (type in data.events) { 3511 if (special[type]) { 3512 jQuery2.event.remove(elem, type); 3513 } else { 3514 jQuery2.removeEvent(elem, type, data.handle); 3515 } 3516 } 3517 } 3518 elem[dataPriv.expando] = void 0; 3519 } 3520 if (elem[dataUser.expando]) { 3521 elem[dataUser.expando] = void 0; 3522 } 3523 } 3524 } 3525 } 3526 }); 3527 jQuery2.fn.extend({ 3528 detach: function(selector) { 3529 return remove2(this, selector, true); 3530 }, 3531 remove: function(selector) { 3532 return remove2(this, selector); 3533 }, 3534 text: function(value) { 3535 return access(this, function(value2) { 3536 return value2 === void 0 ? jQuery2.text(this) : this.empty().each(function() { 3537 if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) { 3538 this.textContent = value2; 3539 } 3540 }); 3541 }, null, value, arguments.length); 3542 }, 3543 append: function() { 3544 return domManip(this, arguments, function(elem) { 3545 if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) { 3546 var target = manipulationTarget(this, elem); 3547 target.appendChild(elem); 3548 } 3549 }); 3550 }, 3551 prepend: function() { 3552 return domManip(this, arguments, function(elem) { 3553 if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) { 3554 var target = manipulationTarget(this, elem); 3555 target.insertBefore(elem, target.firstChild); 3556 } 3557 }); 3558 }, 3559 before: function() { 3560 return domManip(this, arguments, function(elem) { 3561 if (this.parentNode) { 3562 this.parentNode.insertBefore(elem, this); 3563 } 3564 }); 3565 }, 3566 after: function() { 3567 return domManip(this, arguments, function(elem) { 3568 if (this.parentNode) { 3569 this.parentNode.insertBefore(elem, this.nextSibling); 3570 } 3571 }); 3572 }, 3573 empty: function() { 3574 var elem, i = 0; 3575 for (; (elem = this[i]) != null; i++) { 3576 if (elem.nodeType === 1) { 3577 jQuery2.cleanData(getAll(elem, false)); 3578 elem.textContent = ""; 3579 } 3580 } 3581 return this; 3582 }, 3583 clone: function(dataAndEvents, deepDataAndEvents) { 3584 dataAndEvents = dataAndEvents == null ? false : dataAndEvents; 3585 deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; 3586 return this.map(function() { 3587 return jQuery2.clone(this, dataAndEvents, deepDataAndEvents); 3588 }); 3589 }, 3590 html: function(value) { 3591 return access(this, function(value2) { 3592 var elem = this[0] || {}, i = 0, l = this.length; 3593 if (value2 === void 0 && elem.nodeType === 1) { 3594 return elem.innerHTML; 3595 } 3596 if (typeof value2 === "string" && !rnoInnerhtml.test(value2) && !wrapMap[(rtagName.exec(value2) || ["", ""])[1].toLowerCase()]) { 3597 value2 = jQuery2.htmlPrefilter(value2); 3598 try { 3599 for (; i < l; i++) { 3600 elem = this[i] || {}; 3601 if (elem.nodeType === 1) { 3602 jQuery2.cleanData(getAll(elem, false)); 3603 elem.innerHTML = value2; 3604 } 3605 } 3606 elem = 0; 3607 } catch (e2) { 3608 } 3609 } 3610 if (elem) { 3611 this.empty().append(value2); 3612 } 3613 }, null, value, arguments.length); 3614 }, 3615 replaceWith: function() { 3616 var ignored = []; 3617 return domManip(this, arguments, function(elem) { 3618 var parent = this.parentNode; 3619 if (jQuery2.inArray(this, ignored) < 0) { 3620 jQuery2.cleanData(getAll(this)); 3621 if (parent) { 3622 parent.replaceChild(elem, this); 3623 } 3624 } 3625 }, ignored); 3626 } 3627 }); 3628 jQuery2.each({ 3629 appendTo: "append", 3630 prependTo: "prepend", 3631 insertBefore: "before", 3632 insertAfter: "after", 3633 replaceAll: "replaceWith" 3634 }, function(name, original) { 3635 jQuery2.fn[name] = function(selector) { 3636 var elems, ret = [], insert = jQuery2(selector), last = insert.length - 1, i = 0; 3637 for (; i <= last; i++) { 3638 elems = i === last ? this : this.clone(true); 3639 jQuery2(insert[i])[original](elems); 3640 push.apply(ret, elems.get()); 3641 } 3642 return this.pushStack(ret); 3643 }; 3644 }); 3645 var rnumnonpx = new RegExp("^(" + pnum + ")(?!px)[a-z%]+$", "i"); 3646 var rcustomProp = /^--/; 3647 var getStyles = function(elem) { 3648 var view = elem.ownerDocument.defaultView; 3649 if (!view || !view.opener) { 3650 view = window2; 3651 } 3652 return view.getComputedStyle(elem); 3653 }; 3654 var swap = function(elem, options, callback) { 3655 var ret, name, old = {}; 3656 for (name in options) { 3657 old[name] = elem.style[name]; 3658 elem.style[name] = options[name]; 3659 } 3660 ret = callback.call(elem); 3661 for (name in options) { 3662 elem.style[name] = old[name]; 3663 } 3664 return ret; 3665 }; 3666 var rboxStyle = new RegExp(cssExpand.join("|"), "i"); 3667 (function() { 3668 function computeStyleTests() { 3669 if (!div) { 3670 return; 3671 } 3672 container.style.cssText = "position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0"; 3673 div.style.cssText = "position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%"; 3674 documentElement.appendChild(container).appendChild(div); 3675 var divStyle = window2.getComputedStyle(div); 3676 pixelPositionVal = divStyle.top !== "1%"; 3677 reliableMarginLeftVal = roundPixelMeasures(divStyle.marginLeft) === 12; 3678 div.style.right = "60%"; 3679 pixelBoxStylesVal = roundPixelMeasures(divStyle.right) === 36; 3680 boxSizingReliableVal = roundPixelMeasures(divStyle.width) === 36; 3681 div.style.position = "absolute"; 3682 scrollboxSizeVal = roundPixelMeasures(div.offsetWidth / 3) === 12; 3683 documentElement.removeChild(container); 3684 div = null; 3685 } 3686 function roundPixelMeasures(measure) { 3687 return Math.round(parseFloat(measure)); 3688 } 3689 var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal, reliableTrDimensionsVal, reliableMarginLeftVal, container = document2.createElement("div"), div = document2.createElement("div"); 3690 if (!div.style) { 3691 return; 3692 } 3693 div.style.backgroundClip = "content-box"; 3694 div.cloneNode(true).style.backgroundClip = ""; 3695 support.clearCloneStyle = div.style.backgroundClip === "content-box"; 3696 jQuery2.extend(support, { 3697 boxSizingReliable: function() { 3698 computeStyleTests(); 3699 return boxSizingReliableVal; 3700 }, 3701 pixelBoxStyles: function() { 3702 computeStyleTests(); 3703 return pixelBoxStylesVal; 3704 }, 3705 pixelPosition: function() { 3706 computeStyleTests(); 3707 return pixelPositionVal; 3708 }, 3709 reliableMarginLeft: function() { 3710 computeStyleTests(); 3711 return reliableMarginLeftVal; 3712 }, 3713 scrollboxSize: function() { 3714 computeStyleTests(); 3715 return scrollboxSizeVal; 3716 }, 3717 // Support: IE 9 - 11+, Edge 15 - 18+ 3718 // IE/Edge misreport `getComputedStyle` of table rows with width/height 3719 // set in CSS while `offset*` properties report correct values. 3720 // Behavior in IE 9 is more subtle than in newer versions & it passes 3721 // some versions of this test; make sure not to make it pass there! 3722 // 3723 // Support: Firefox 70+ 3724 // Only Firefox includes border widths 3725 // in computed dimensions. (gh-4529) 3726 reliableTrDimensions: function() { 3727 var table, tr, trChild, trStyle; 3728 if (reliableTrDimensionsVal == null) { 3729 table = document2.createElement("table"); 3730 tr = document2.createElement("tr"); 3731 trChild = document2.createElement("div"); 3732 table.style.cssText = "position:absolute;left:-11111px;border-collapse:separate"; 3733 tr.style.cssText = "border:1px solid"; 3734 tr.style.height = "1px"; 3735 trChild.style.height = "9px"; 3736 trChild.style.display = "block"; 3737 documentElement.appendChild(table).appendChild(tr).appendChild(trChild); 3738 trStyle = window2.getComputedStyle(tr); 3739 reliableTrDimensionsVal = parseInt(trStyle.height, 10) + parseInt(trStyle.borderTopWidth, 10) + parseInt(trStyle.borderBottomWidth, 10) === tr.offsetHeight; 3740 documentElement.removeChild(table); 3741 } 3742 return reliableTrDimensionsVal; 3743 } 3744 }); 3745 })(); 3746 function curCSS(elem, name, computed) { 3747 var width, minWidth, maxWidth, ret, isCustomProp = rcustomProp.test(name), style = elem.style; 3748 computed = computed || getStyles(elem); 3749 if (computed) { 3750 ret = computed.getPropertyValue(name) || computed[name]; 3751 if (isCustomProp && ret) { 3752 ret = ret.replace(rtrimCSS, "$1") || void 0; 3753 } 3754 if (ret === "" && !isAttached(elem)) { 3755 ret = jQuery2.style(elem, name); 3756 } 3757 if (!support.pixelBoxStyles() && rnumnonpx.test(ret) && rboxStyle.test(name)) { 3758 width = style.width; 3759 minWidth = style.minWidth; 3760 maxWidth = style.maxWidth; 3761 style.minWidth = style.maxWidth = style.width = ret; 3762 ret = computed.width; 3763 style.width = width; 3764 style.minWidth = minWidth; 3765 style.maxWidth = maxWidth; 3766 } 3767 } 3768 return ret !== void 0 ? ( 3769 // Support: IE <=9 - 11 only 3770 // IE returns zIndex value as an integer. 3771 ret + "" 3772 ) : ret; 3773 } 3774 function addGetHookIf(conditionFn, hookFn) { 3775 return { 3776 get: function() { 3777 if (conditionFn()) { 3778 delete this.get; 3779 return; 3780 } 3781 return (this.get = hookFn).apply(this, arguments); 3782 } 3783 }; 3784 } 3785 var cssPrefixes = ["Webkit", "Moz", "ms"], emptyStyle = document2.createElement("div").style, vendorProps = {}; 3786 function vendorPropName(name) { 3787 var capName = name[0].toUpperCase() + name.slice(1), i = cssPrefixes.length; 3788 while (i--) { 3789 name = cssPrefixes[i] + capName; 3790 if (name in emptyStyle) { 3791 return name; 3792 } 3793 } 3794 } 3795 function finalPropName(name) { 3796 var final = jQuery2.cssProps[name] || vendorProps[name]; 3797 if (final) { 3798 return final; 3799 } 3800 if (name in emptyStyle) { 3801 return name; 3802 } 3803 return vendorProps[name] = vendorPropName(name) || name; 3804 } 3805 var rdisplayswap = /^(none|table(?!-c[ea]).+)/, cssShow = { position: "absolute", visibility: "hidden", display: "block" }, cssNormalTransform = { 3806 letterSpacing: "0", 3807 fontWeight: "400" 3808 }; 3809 function setPositiveNumber(_elem, value, subtract) { 3810 var matches = rcssNum.exec(value); 3811 return matches ? ( 3812 // Guard against undefined "subtract", e.g., when used as in cssHooks 3813 Math.max(0, matches[2] - (subtract || 0)) + (matches[3] || "px") 3814 ) : value; 3815 } 3816 function boxModelAdjustment(elem, dimension, box, isBorderBox, styles, computedVal) { 3817 var i = dimension === "width" ? 1 : 0, extra = 0, delta = 0, marginDelta = 0; 3818 if (box === (isBorderBox ? "border" : "content")) { 3819 return 0; 3820 } 3821 for (; i < 4; i += 2) { 3822 if (box === "margin") { 3823 marginDelta += jQuery2.css(elem, box + cssExpand[i], true, styles); 3824 } 3825 if (!isBorderBox) { 3826 delta += jQuery2.css(elem, "padding" + cssExpand[i], true, styles); 3827 if (box !== "padding") { 3828 delta += jQuery2.css(elem, "border" + cssExpand[i] + "Width", true, styles); 3829 } else { 3830 extra += jQuery2.css(elem, "border" + cssExpand[i] + "Width", true, styles); 3831 } 3832 } else { 3833 if (box === "content") { 3834 delta -= jQuery2.css(elem, "padding" + cssExpand[i], true, styles); 3835 } 3836 if (box !== "margin") { 3837 delta -= jQuery2.css(elem, "border" + cssExpand[i] + "Width", true, styles); 3838 } 3839 } 3840 } 3841 if (!isBorderBox && computedVal >= 0) { 3842 delta += Math.max(0, Math.ceil( 3843 elem["offset" + dimension[0].toUpperCase() + dimension.slice(1)] - computedVal - delta - extra - 0.5 3844 // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter 3845 // Use an explicit zero to avoid NaN (gh-3964) 3846 )) || 0; 3847 } 3848 return delta + marginDelta; 3849 } 3850 function getWidthOrHeight(elem, dimension, extra) { 3851 var styles = getStyles(elem), boxSizingNeeded = !support.boxSizingReliable() || extra, isBorderBox = boxSizingNeeded && jQuery2.css(elem, "boxSizing", false, styles) === "border-box", valueIsBorderBox = isBorderBox, val = curCSS(elem, dimension, styles), offsetProp = "offset" + dimension[0].toUpperCase() + dimension.slice(1); 3852 if (rnumnonpx.test(val)) { 3853 if (!extra) { 3854 return val; 3855 } 3856 val = "auto"; 3857 } 3858 if ((!support.boxSizingReliable() && isBorderBox || // Support: IE 10 - 11+, Edge 15 - 18+ 3859 // IE/Edge misreport `getComputedStyle` of table rows with width/height 3860 // set in CSS while `offset*` properties report correct values. 3861 // Interestingly, in some cases IE 9 doesn't suffer from this issue. 3862 !support.reliableTrDimensions() && nodeName(elem, "tr") || // Fall back to offsetWidth/offsetHeight when value is "auto" 3863 // This happens for inline elements with no explicit setting (gh-3571) 3864 val === "auto" || // Support: Android <=4.1 - 4.3 only 3865 // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602) 3866 !parseFloat(val) && jQuery2.css(elem, "display", false, styles) === "inline") && // Make sure the element is visible & connected 3867 elem.getClientRects().length) { 3868 isBorderBox = jQuery2.css(elem, "boxSizing", false, styles) === "border-box"; 3869 valueIsBorderBox = offsetProp in elem; 3870 if (valueIsBorderBox) { 3871 val = elem[offsetProp]; 3872 } 3873 } 3874 val = parseFloat(val) || 0; 3875 return val + boxModelAdjustment( 3876 elem, 3877 dimension, 3878 extra || (isBorderBox ? "border" : "content"), 3879 valueIsBorderBox, 3880 styles, 3881 // Provide the current computed size to request scroll gutter calculation (gh-3589) 3882 val 3883 ) + "px"; 3884 } 3885 jQuery2.extend({ 3886 // Add in style property hooks for overriding the default 3887 // behavior of getting and setting a style property 3888 cssHooks: { 3889 opacity: { 3890 get: function(elem, computed) { 3891 if (computed) { 3892 var ret = curCSS(elem, "opacity"); 3893 return ret === "" ? "1" : ret; 3894 } 3895 } 3896 } 3897 }, 3898 // Don't automatically add "px" to these possibly-unitless properties 3899 cssNumber: { 3900 animationIterationCount: true, 3901 aspectRatio: true, 3902 borderImageSlice: true, 3903 columnCount: true, 3904 flexGrow: true, 3905 flexShrink: true, 3906 fontWeight: true, 3907 gridArea: true, 3908 gridColumn: true, 3909 gridColumnEnd: true, 3910 gridColumnStart: true, 3911 gridRow: true, 3912 gridRowEnd: true, 3913 gridRowStart: true, 3914 lineHeight: true, 3915 opacity: true, 3916 order: true, 3917 orphans: true, 3918 scale: true, 3919 widows: true, 3920 zIndex: true, 3921 zoom: true, 3922 // SVG-related 3923 fillOpacity: true, 3924 floodOpacity: true, 3925 stopOpacity: true, 3926 strokeMiterlimit: true, 3927 strokeOpacity: true 3928 }, 3929 // Add in properties whose names you wish to fix before 3930 // setting or getting the value 3931 cssProps: {}, 3932 // Get and set the style property on a DOM Node 3933 style: function(elem, name, value, extra) { 3934 if (!elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style) { 3935 return; 3936 } 3937 var ret, type, hooks, origName = camelCase(name), isCustomProp = rcustomProp.test(name), style = elem.style; 3938 if (!isCustomProp) { 3939 name = finalPropName(origName); 3940 } 3941 hooks = jQuery2.cssHooks[name] || jQuery2.cssHooks[origName]; 3942 if (value !== void 0) { 3943 type = typeof value; 3944 if (type === "string" && (ret = rcssNum.exec(value)) && ret[1]) { 3945 value = adjustCSS(elem, name, ret); 3946 type = "number"; 3947 } 3948 if (value == null || value !== value) { 3949 return; 3950 } 3951 if (type === "number" && !isCustomProp) { 3952 value += ret && ret[3] || (jQuery2.cssNumber[origName] ? "" : "px"); 3953 } 3954 if (!support.clearCloneStyle && value === "" && name.indexOf("background") === 0) { 3955 style[name] = "inherit"; 3956 } 3957 if (!hooks || !("set" in hooks) || (value = hooks.set(elem, value, extra)) !== void 0) { 3958 if (isCustomProp) { 3959 style.setProperty(name, value); 3960 } else { 3961 style[name] = value; 3962 } 3963 } 3964 } else { 3965 if (hooks && "get" in hooks && (ret = hooks.get(elem, false, extra)) !== void 0) { 3966 return ret; 3967 } 3968 return style[name]; 3969 } 3970 }, 3971 css: function(elem, name, extra, styles) { 3972 var val, num, hooks, origName = camelCase(name), isCustomProp = rcustomProp.test(name); 3973 if (!isCustomProp) { 3974 name = finalPropName(origName); 3975 } 3976 hooks = jQuery2.cssHooks[name] || jQuery2.cssHooks[origName]; 3977 if (hooks && "get" in hooks) { 3978 val = hooks.get(elem, true, extra); 3979 } 3980 if (val === void 0) { 3981 val = curCSS(elem, name, styles); 3982 } 3983 if (val === "normal" && name in cssNormalTransform) { 3984 val = cssNormalTransform[name]; 3985 } 3986 if (extra === "" || extra) { 3987 num = parseFloat(val); 3988 return extra === true || isFinite(num) ? num || 0 : val; 3989 } 3990 return val; 3991 } 3992 }); 3993 jQuery2.each(["height", "width"], function(_i, dimension) { 3994 jQuery2.cssHooks[dimension] = { 3995 get: function(elem, computed, extra) { 3996 if (computed) { 3997 return rdisplayswap.test(jQuery2.css(elem, "display")) && // Support: Safari 8+ 3998 // Table columns in Safari have non-zero offsetWidth & zero 3999 // getBoundingClientRect().width unless display is changed. 4000 // Support: IE <=11 only 4001 // Running getBoundingClientRect on a disconnected node 4002 // in IE throws an error. 4003 (!elem.getClientRects().length || !elem.getBoundingClientRect().width) ? swap(elem, cssShow, function() { 4004 return getWidthOrHeight(elem, dimension, extra); 4005 }) : getWidthOrHeight(elem, dimension, extra); 4006 } 4007 }, 4008 set: function(elem, value, extra) { 4009 var matches, styles = getStyles(elem), scrollboxSizeBuggy = !support.scrollboxSize() && styles.position === "absolute", boxSizingNeeded = scrollboxSizeBuggy || extra, isBorderBox = boxSizingNeeded && jQuery2.css(elem, "boxSizing", false, styles) === "border-box", subtract = extra ? boxModelAdjustment( 4010 elem, 4011 dimension, 4012 extra, 4013 isBorderBox, 4014 styles 4015 ) : 0; 4016 if (isBorderBox && scrollboxSizeBuggy) { 4017 subtract -= Math.ceil( 4018 elem["offset" + dimension[0].toUpperCase() + dimension.slice(1)] - parseFloat(styles[dimension]) - boxModelAdjustment(elem, dimension, "border", false, styles) - 0.5 4019 ); 4020 } 4021 if (subtract && (matches = rcssNum.exec(value)) && (matches[3] || "px") !== "px") { 4022 elem.style[dimension] = value; 4023 value = jQuery2.css(elem, dimension); 4024 } 4025 return setPositiveNumber(elem, value, subtract); 4026 } 4027 }; 4028 }); 4029 jQuery2.cssHooks.marginLeft = addGetHookIf( 4030 support.reliableMarginLeft, 4031 function(elem, computed) { 4032 if (computed) { 4033 return (parseFloat(curCSS(elem, "marginLeft")) || elem.getBoundingClientRect().left - swap(elem, { marginLeft: 0 }, function() { 4034 return elem.getBoundingClientRect().left; 4035 })) + "px"; 4036 } 4037 } 4038 ); 4039 jQuery2.each({ 4040 margin: "", 4041 padding: "", 4042 border: "Width" 4043 }, function(prefix, suffix) { 4044 jQuery2.cssHooks[prefix + suffix] = { 4045 expand: function(value) { 4046 var i = 0, expanded = {}, parts = typeof value === "string" ? value.split(" ") : [value]; 4047 for (; i < 4; i++) { 4048 expanded[prefix + cssExpand[i] + suffix] = parts[i] || parts[i - 2] || parts[0]; 4049 } 4050 return expanded; 4051 } 4052 }; 4053 if (prefix !== "margin") { 4054 jQuery2.cssHooks[prefix + suffix].set = setPositiveNumber; 4055 } 4056 }); 4057 jQuery2.fn.extend({ 4058 css: function(name, value) { 4059 return access(this, function(elem, name2, value2) { 4060 var styles, len, map = {}, i = 0; 4061 if (Array.isArray(name2)) { 4062 styles = getStyles(elem); 4063 len = name2.length; 4064 for (; i < len; i++) { 4065 map[name2[i]] = jQuery2.css(elem, name2[i], false, styles); 4066 } 4067 return map; 4068 } 4069 return value2 !== void 0 ? jQuery2.style(elem, name2, value2) : jQuery2.css(elem, name2); 4070 }, name, value, arguments.length > 1); 4071 } 4072 }); 4073 function Tween(elem, options, prop, end, easing) { 4074 return new Tween.prototype.init(elem, options, prop, end, easing); 4075 } 4076 jQuery2.Tween = Tween; 4077 Tween.prototype = { 4078 constructor: Tween, 4079 init: function(elem, options, prop, end, easing, unit) { 4080 this.elem = elem; 4081 this.prop = prop; 4082 this.easing = easing || jQuery2.easing._default; 4083 this.options = options; 4084 this.start = this.now = this.cur(); 4085 this.end = end; 4086 this.unit = unit || (jQuery2.cssNumber[prop] ? "" : "px"); 4087 }, 4088 cur: function() { 4089 var hooks = Tween.propHooks[this.prop]; 4090 return hooks && hooks.get ? hooks.get(this) : Tween.propHooks._default.get(this); 4091 }, 4092 run: function(percent) { 4093 var eased, hooks = Tween.propHooks[this.prop]; 4094 if (this.options.duration) { 4095 this.pos = eased = jQuery2.easing[this.easing]( 4096 percent, 4097 this.options.duration * percent, 4098 0, 4099 1, 4100 this.options.duration 4101 ); 4102 } else { 4103 this.pos = eased = percent; 4104 } 4105 this.now = (this.end - this.start) * eased + this.start; 4106 if (this.options.step) { 4107 this.options.step.call(this.elem, this.now, this); 4108 } 4109 if (hooks && hooks.set) { 4110 hooks.set(this); 4111 } else { 4112 Tween.propHooks._default.set(this); 4113 } 4114 return this; 4115 } 4116 }; 4117 Tween.prototype.init.prototype = Tween.prototype; 4118 Tween.propHooks = { 4119 _default: { 4120 get: function(tween) { 4121 var result; 4122 if (tween.elem.nodeType !== 1 || tween.elem[tween.prop] != null && tween.elem.style[tween.prop] == null) { 4123 return tween.elem[tween.prop]; 4124 } 4125 result = jQuery2.css(tween.elem, tween.prop, ""); 4126 return !result || result === "auto" ? 0 : result; 4127 }, 4128 set: function(tween) { 4129 if (jQuery2.fx.step[tween.prop]) { 4130 jQuery2.fx.step[tween.prop](tween); 4131 } else if (tween.elem.nodeType === 1 && (jQuery2.cssHooks[tween.prop] || tween.elem.style[finalPropName(tween.prop)] != null)) { 4132 jQuery2.style(tween.elem, tween.prop, tween.now + tween.unit); 4133 } else { 4134 tween.elem[tween.prop] = tween.now; 4135 } 4136 } 4137 } 4138 }; 4139 Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { 4140 set: function(tween) { 4141 if (tween.elem.nodeType && tween.elem.parentNode) { 4142 tween.elem[tween.prop] = tween.now; 4143 } 4144 } 4145 }; 4146 jQuery2.easing = { 4147 linear: function(p) { 4148 return p; 4149 }, 4150 swing: function(p) { 4151 return 0.5 - Math.cos(p * Math.PI) / 2; 4152 }, 4153 _default: "swing" 4154 }; 4155 jQuery2.fx = Tween.prototype.init; 4156 jQuery2.fx.step = {}; 4157 var fxNow, inProgress, rfxtypes = /^(?:toggle|show|hide)$/, rrun = /queueHooks$/; 4158 function schedule() { 4159 if (inProgress) { 4160 if (document2.hidden === false && window2.requestAnimationFrame) { 4161 window2.requestAnimationFrame(schedule); 4162 } else { 4163 window2.setTimeout(schedule, jQuery2.fx.interval); 4164 } 4165 jQuery2.fx.tick(); 4166 } 4167 } 4168 function createFxNow() { 4169 window2.setTimeout(function() { 4170 fxNow = void 0; 4171 }); 4172 return fxNow = Date.now(); 4173 } 4174 function genFx(type, includeWidth) { 4175 var which, i = 0, attrs = { height: type }; 4176 includeWidth = includeWidth ? 1 : 0; 4177 for (; i < 4; i += 2 - includeWidth) { 4178 which = cssExpand[i]; 4179 attrs["margin" + which] = attrs["padding" + which] = type; 4180 } 4181 if (includeWidth) { 4182 attrs.opacity = attrs.width = type; 4183 } 4184 return attrs; 4185 } 4186 function createTween(value, prop, animation) { 4187 var tween, collection = (Animation.tweeners[prop] || []).concat(Animation.tweeners["*"]), index = 0, length = collection.length; 4188 for (; index < length; index++) { 4189 if (tween = collection[index].call(animation, prop, value)) { 4190 return tween; 4191 } 4192 } 4193 } 4194 function defaultPrefilter(elem, props, opts) { 4195 var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display, isBox = "width" in props || "height" in props, anim = this, orig = {}, style = elem.style, hidden = elem.nodeType && isHiddenWithinTree(elem), dataShow = dataPriv.get(elem, "fxshow"); 4196 if (!opts.queue) { 4197 hooks = jQuery2._queueHooks(elem, "fx"); 4198 if (hooks.unqueued == null) { 4199 hooks.unqueued = 0; 4200 oldfire = hooks.empty.fire; 4201 hooks.empty.fire = function() { 4202 if (!hooks.unqueued) { 4203 oldfire(); 4204 } 4205 }; 4206 } 4207 hooks.unqueued++; 4208 anim.always(function() { 4209 anim.always(function() { 4210 hooks.unqueued--; 4211 if (!jQuery2.queue(elem, "fx").length) { 4212 hooks.empty.fire(); 4213 } 4214 }); 4215 }); 4216 } 4217 for (prop in props) { 4218 value = props[prop]; 4219 if (rfxtypes.test(value)) { 4220 delete props[prop]; 4221 toggle = toggle || value === "toggle"; 4222 if (value === (hidden ? "hide" : "show")) { 4223 if (value === "show" && dataShow && dataShow[prop] !== void 0) { 4224 hidden = true; 4225 } else { 4226 continue; 4227 } 4228 } 4229 orig[prop] = dataShow && dataShow[prop] || jQuery2.style(elem, prop); 4230 } 4231 } 4232 propTween = !jQuery2.isEmptyObject(props); 4233 if (!propTween && jQuery2.isEmptyObject(orig)) { 4234 return; 4235 } 4236 if (isBox && elem.nodeType === 1) { 4237 opts.overflow = [style.overflow, style.overflowX, style.overflowY]; 4238 restoreDisplay = dataShow && dataShow.display; 4239 if (restoreDisplay == null) { 4240 restoreDisplay = dataPriv.get(elem, "display"); 4241 } 4242 display = jQuery2.css(elem, "display"); 4243 if (display === "none") { 4244 if (restoreDisplay) { 4245 display = restoreDisplay; 4246 } else { 4247 showHide([elem], true); 4248 restoreDisplay = elem.style.display || restoreDisplay; 4249 display = jQuery2.css(elem, "display"); 4250 showHide([elem]); 4251 } 4252 } 4253 if (display === "inline" || display === "inline-block" && restoreDisplay != null) { 4254 if (jQuery2.css(elem, "float") === "none") { 4255 if (!propTween) { 4256 anim.done(function() { 4257 style.display = restoreDisplay; 4258 }); 4259 if (restoreDisplay == null) { 4260 display = style.display; 4261 restoreDisplay = display === "none" ? "" : display; 4262 } 4263 } 4264 style.display = "inline-block"; 4265 } 4266 } 4267 } 4268 if (opts.overflow) { 4269 style.overflow = "hidden"; 4270 anim.always(function() { 4271 style.overflow = opts.overflow[0]; 4272 style.overflowX = opts.overflow[1]; 4273 style.overflowY = opts.overflow[2]; 4274 }); 4275 } 4276 propTween = false; 4277 for (prop in orig) { 4278 if (!propTween) { 4279 if (dataShow) { 4280 if ("hidden" in dataShow) { 4281 hidden = dataShow.hidden; 4282 } 4283 } else { 4284 dataShow = dataPriv.access(elem, "fxshow", { display: restoreDisplay }); 4285 } 4286 if (toggle) { 4287 dataShow.hidden = !hidden; 4288 } 4289 if (hidden) { 4290 showHide([elem], true); 4291 } 4292 anim.done(function() { 4293 if (!hidden) { 4294 showHide([elem]); 4295 } 4296 dataPriv.remove(elem, "fxshow"); 4297 for (prop in orig) { 4298 jQuery2.style(elem, prop, orig[prop]); 4299 } 4300 }); 4301 } 4302 propTween = createTween(hidden ? dataShow[prop] : 0, prop, anim); 4303 if (!(prop in dataShow)) { 4304 dataShow[prop] = propTween.start; 4305 if (hidden) { 4306 propTween.end = propTween.start; 4307 propTween.start = 0; 4308 } 4309 } 4310 } 4311 } 4312 function propFilter(props, specialEasing) { 4313 var index, name, easing, value, hooks; 4314 for (index in props) { 4315 name = camelCase(index); 4316 easing = specialEasing[name]; 4317 value = props[index]; 4318 if (Array.isArray(value)) { 4319 easing = value[1]; 4320 value = props[index] = value[0]; 4321 } 4322 if (index !== name) { 4323 props[name] = value; 4324 delete props[index]; 4325 } 4326 hooks = jQuery2.cssHooks[name]; 4327 if (hooks && "expand" in hooks) { 4328 value = hooks.expand(value); 4329 delete props[name]; 4330 for (index in value) { 4331 if (!(index in props)) { 4332 props[index] = value[index]; 4333 specialEasing[index] = easing; 4334 } 4335 } 4336 } else { 4337 specialEasing[name] = easing; 4338 } 4339 } 4340 } 4341 function Animation(elem, properties, options) { 4342 var result, stopped, index = 0, length = Animation.prefilters.length, deferred = jQuery2.Deferred().always(function() { 4343 delete tick.elem; 4344 }), tick = function() { 4345 if (stopped) { 4346 return false; 4347 } 4348 var currentTime = fxNow || createFxNow(), remaining = Math.max(0, animation.startTime + animation.duration - currentTime), temp = remaining / animation.duration || 0, percent = 1 - temp, index2 = 0, length2 = animation.tweens.length; 4349 for (; index2 < length2; index2++) { 4350 animation.tweens[index2].run(percent); 4351 } 4352 deferred.notifyWith(elem, [animation, percent, remaining]); 4353 if (percent < 1 && length2) { 4354 return remaining; 4355 } 4356 if (!length2) { 4357 deferred.notifyWith(elem, [animation, 1, 0]); 4358 } 4359 deferred.resolveWith(elem, [animation]); 4360 return false; 4361 }, animation = deferred.promise({ 4362 elem, 4363 props: jQuery2.extend({}, properties), 4364 opts: jQuery2.extend(true, { 4365 specialEasing: {}, 4366 easing: jQuery2.easing._default 4367 }, options), 4368 originalProperties: properties, 4369 originalOptions: options, 4370 startTime: fxNow || createFxNow(), 4371 duration: options.duration, 4372 tweens: [], 4373 createTween: function(prop, end) { 4374 var tween = jQuery2.Tween( 4375 elem, 4376 animation.opts, 4377 prop, 4378 end, 4379 animation.opts.specialEasing[prop] || animation.opts.easing 4380 ); 4381 animation.tweens.push(tween); 4382 return tween; 4383 }, 4384 stop: function(gotoEnd) { 4385 var index2 = 0, length2 = gotoEnd ? animation.tweens.length : 0; 4386 if (stopped) { 4387 return this; 4388 } 4389 stopped = true; 4390 for (; index2 < length2; index2++) { 4391 animation.tweens[index2].run(1); 4392 } 4393 if (gotoEnd) { 4394 deferred.notifyWith(elem, [animation, 1, 0]); 4395 deferred.resolveWith(elem, [animation, gotoEnd]); 4396 } else { 4397 deferred.rejectWith(elem, [animation, gotoEnd]); 4398 } 4399 return this; 4400 } 4401 }), props = animation.props; 4402 propFilter(props, animation.opts.specialEasing); 4403 for (; index < length; index++) { 4404 result = Animation.prefilters[index].call(animation, elem, props, animation.opts); 4405 if (result) { 4406 if (isFunction2(result.stop)) { 4407 jQuery2._queueHooks(animation.elem, animation.opts.queue).stop = result.stop.bind(result); 4408 } 4409 return result; 4410 } 4411 } 4412 jQuery2.map(props, createTween, animation); 4413 if (isFunction2(animation.opts.start)) { 4414 animation.opts.start.call(elem, animation); 4415 } 4416 animation.progress(animation.opts.progress).done(animation.opts.done, animation.opts.complete).fail(animation.opts.fail).always(animation.opts.always); 4417 jQuery2.fx.timer( 4418 jQuery2.extend(tick, { 4419 elem, 4420 anim: animation, 4421 queue: animation.opts.queue 4422 }) 4423 ); 4424 return animation; 4425 } 4426 jQuery2.Animation = jQuery2.extend(Animation, { 4427 tweeners: { 4428 "*": [function(prop, value) { 4429 var tween = this.createTween(prop, value); 4430 adjustCSS(tween.elem, prop, rcssNum.exec(value), tween); 4431 return tween; 4432 }] 4433 }, 4434 tweener: function(props, callback) { 4435 if (isFunction2(props)) { 4436 callback = props; 4437 props = ["*"]; 4438 } else { 4439 props = props.match(rnothtmlwhite); 4440 } 4441 var prop, index = 0, length = props.length; 4442 for (; index < length; index++) { 4443 prop = props[index]; 4444 Animation.tweeners[prop] = Animation.tweeners[prop] || []; 4445 Animation.tweeners[prop].unshift(callback); 4446 } 4447 }, 4448 prefilters: [defaultPrefilter], 4449 prefilter: function(callback, prepend) { 4450 if (prepend) { 4451 Animation.prefilters.unshift(callback); 4452 } else { 4453 Animation.prefilters.push(callback); 4454 } 4455 } 4456 }); 4457 jQuery2.speed = function(speed, easing, fn) { 4458 var opt = speed && typeof speed === "object" ? jQuery2.extend({}, speed) : { 4459 complete: fn || !fn && easing || isFunction2(speed) && speed, 4460 duration: speed, 4461 easing: fn && easing || easing && !isFunction2(easing) && easing 4462 }; 4463 if (jQuery2.fx.off) { 4464 opt.duration = 0; 4465 } else { 4466 if (typeof opt.duration !== "number") { 4467 if (opt.duration in jQuery2.fx.speeds) { 4468 opt.duration = jQuery2.fx.speeds[opt.duration]; 4469 } else { 4470 opt.duration = jQuery2.fx.speeds._default; 4471 } 4472 } 4473 } 4474 if (opt.queue == null || opt.queue === true) { 4475 opt.queue = "fx"; 4476 } 4477 opt.old = opt.complete; 4478 opt.complete = function() { 4479 if (isFunction2(opt.old)) { 4480 opt.old.call(this); 4481 } 4482 if (opt.queue) { 4483 jQuery2.dequeue(this, opt.queue); 4484 } 4485 }; 4486 return opt; 4487 }; 4488 jQuery2.fn.extend({ 4489 fadeTo: function(speed, to, easing, callback) { 4490 return this.filter(isHiddenWithinTree).css("opacity", 0).show().end().animate({ opacity: to }, speed, easing, callback); 4491 }, 4492 animate: function(prop, speed, easing, callback) { 4493 var empty = jQuery2.isEmptyObject(prop), optall = jQuery2.speed(speed, easing, callback), doAnimation = function() { 4494 var anim = Animation(this, jQuery2.extend({}, prop), optall); 4495 if (empty || dataPriv.get(this, "finish")) { 4496 anim.stop(true); 4497 } 4498 }; 4499 doAnimation.finish = doAnimation; 4500 return empty || optall.queue === false ? this.each(doAnimation) : this.queue(optall.queue, doAnimation); 4501 }, 4502 stop: function(type, clearQueue, gotoEnd) { 4503 var stopQueue = function(hooks) { 4504 var stop = hooks.stop; 4505 delete hooks.stop; 4506 stop(gotoEnd); 4507 }; 4508 if (typeof type !== "string") { 4509 gotoEnd = clearQueue; 4510 clearQueue = type; 4511 type = void 0; 4512 } 4513 if (clearQueue) { 4514 this.queue(type || "fx", []); 4515 } 4516 return this.each(function() { 4517 var dequeue = true, index = type != null && type + "queueHooks", timers = jQuery2.timers, data = dataPriv.get(this); 4518 if (index) { 4519 if (data[index] && data[index].stop) { 4520 stopQueue(data[index]); 4521 } 4522 } else { 4523 for (index in data) { 4524 if (data[index] && data[index].stop && rrun.test(index)) { 4525 stopQueue(data[index]); 4526 } 4527 } 4528 } 4529 for (index = timers.length; index--; ) { 4530 if (timers[index].elem === this && (type == null || timers[index].queue === type)) { 4531 timers[index].anim.stop(gotoEnd); 4532 dequeue = false; 4533 timers.splice(index, 1); 4534 } 4535 } 4536 if (dequeue || !gotoEnd) { 4537 jQuery2.dequeue(this, type); 4538 } 4539 }); 4540 }, 4541 finish: function(type) { 4542 if (type !== false) { 4543 type = type || "fx"; 4544 } 4545 return this.each(function() { 4546 var index, data = dataPriv.get(this), queue = data[type + "queue"], hooks = data[type + "queueHooks"], timers = jQuery2.timers, length = queue ? queue.length : 0; 4547 data.finish = true; 4548 jQuery2.queue(this, type, []); 4549 if (hooks && hooks.stop) { 4550 hooks.stop.call(this, true); 4551 } 4552 for (index = timers.length; index--; ) { 4553 if (timers[index].elem === this && timers[index].queue === type) { 4554 timers[index].anim.stop(true); 4555 timers.splice(index, 1); 4556 } 4557 } 4558 for (index = 0; index < length; index++) { 4559 if (queue[index] && queue[index].finish) { 4560 queue[index].finish.call(this); 4561 } 4562 } 4563 delete data.finish; 4564 }); 4565 } 4566 }); 4567 jQuery2.each(["toggle", "show", "hide"], function(_i, name) { 4568 var cssFn = jQuery2.fn[name]; 4569 jQuery2.fn[name] = function(speed, easing, callback) { 4570 return speed == null || typeof speed === "boolean" ? cssFn.apply(this, arguments) : this.animate(genFx(name, true), speed, easing, callback); 4571 }; 4572 }); 4573 jQuery2.each({ 4574 slideDown: genFx("show"), 4575 slideUp: genFx("hide"), 4576 slideToggle: genFx("toggle"), 4577 fadeIn: { opacity: "show" }, 4578 fadeOut: { opacity: "hide" }, 4579 fadeToggle: { opacity: "toggle" } 4580 }, function(name, props) { 4581 jQuery2.fn[name] = function(speed, easing, callback) { 4582 return this.animate(props, speed, easing, callback); 4583 }; 4584 }); 4585 jQuery2.timers = []; 4586 jQuery2.fx.tick = function() { 4587 var timer, i = 0, timers = jQuery2.timers; 4588 fxNow = Date.now(); 4589 for (; i < timers.length; i++) { 4590 timer = timers[i]; 4591 if (!timer() && timers[i] === timer) { 4592 timers.splice(i--, 1); 4593 } 4594 } 4595 if (!timers.length) { 4596 jQuery2.fx.stop(); 4597 } 4598 fxNow = void 0; 4599 }; 4600 jQuery2.fx.timer = function(timer) { 4601 jQuery2.timers.push(timer); 4602 jQuery2.fx.start(); 4603 }; 4604 jQuery2.fx.interval = 13; 4605 jQuery2.fx.start = function() { 4606 if (inProgress) { 4607 return; 4608 } 4609 inProgress = true; 4610 schedule(); 4611 }; 4612 jQuery2.fx.stop = function() { 4613 inProgress = null; 4614 }; 4615 jQuery2.fx.speeds = { 4616 slow: 600, 4617 fast: 200, 4618 // Default speed 4619 _default: 400 4620 }; 4621 jQuery2.fn.delay = function(time, type) { 4622 time = jQuery2.fx ? jQuery2.fx.speeds[time] || time : time; 4623 type = type || "fx"; 4624 return this.queue(type, function(next, hooks) { 4625 var timeout = window2.setTimeout(next, time); 4626 hooks.stop = function() { 4627 window2.clearTimeout(timeout); 4628 }; 4629 }); 4630 }; 4631 (function() { 4632 var input = document2.createElement("input"), select = document2.createElement("select"), opt = select.appendChild(document2.createElement("option")); 4633 input.type = "checkbox"; 4634 support.checkOn = input.value !== ""; 4635 support.optSelected = opt.selected; 4636 input = document2.createElement("input"); 4637 input.value = "t"; 4638 input.type = "radio"; 4639 support.radioValue = input.value === "t"; 4640 })(); 4641 var boolHook, attrHandle = jQuery2.expr.attrHandle; 4642 jQuery2.fn.extend({ 4643 attr: function(name, value) { 4644 return access(this, jQuery2.attr, name, value, arguments.length > 1); 4645 }, 4646 removeAttr: function(name) { 4647 return this.each(function() { 4648 jQuery2.removeAttr(this, name); 4649 }); 4650 } 4651 }); 4652 jQuery2.extend({ 4653 attr: function(elem, name, value) { 4654 var ret, hooks, nType = elem.nodeType; 4655 if (nType === 3 || nType === 8 || nType === 2) { 4656 return; 4657 } 4658 if (typeof elem.getAttribute === "undefined") { 4659 return jQuery2.prop(elem, name, value); 4660 } 4661 if (nType !== 1 || !jQuery2.isXMLDoc(elem)) { 4662 hooks = jQuery2.attrHooks[name.toLowerCase()] || (jQuery2.expr.match.bool.test(name) ? boolHook : void 0); 4663 } 4664 if (value !== void 0) { 4665 if (value === null) { 4666 jQuery2.removeAttr(elem, name); 4667 return; 4668 } 4669 if (hooks && "set" in hooks && (ret = hooks.set(elem, value, name)) !== void 0) { 4670 return ret; 4671 } 4672 elem.setAttribute(name, value + ""); 4673 return value; 4674 } 4675 if (hooks && "get" in hooks && (ret = hooks.get(elem, name)) !== null) { 4676 return ret; 4677 } 4678 ret = jQuery2.find.attr(elem, name); 4679 return ret == null ? void 0 : ret; 4680 }, 4681 attrHooks: { 4682 type: { 4683 set: function(elem, value) { 4684 if (!support.radioValue && value === "radio" && nodeName(elem, "input")) { 4685 var val = elem.value; 4686 elem.setAttribute("type", value); 4687 if (val) { 4688 elem.value = val; 4689 } 4690 return value; 4691 } 4692 } 4693 } 4694 }, 4695 removeAttr: function(elem, value) { 4696 var name, i = 0, attrNames = value && value.match(rnothtmlwhite); 4697 if (attrNames && elem.nodeType === 1) { 4698 while (name = attrNames[i++]) { 4699 elem.removeAttribute(name); 4700 } 4701 } 4702 } 4703 }); 4704 boolHook = { 4705 set: function(elem, value, name) { 4706 if (value === false) { 4707 jQuery2.removeAttr(elem, name); 4708 } else { 4709 elem.setAttribute(name, name); 4710 } 4711 return name; 4712 } 4713 }; 4714 jQuery2.each(jQuery2.expr.match.bool.source.match(/\w+/g), function(_i, name) { 4715 var getter = attrHandle[name] || jQuery2.find.attr; 4716 attrHandle[name] = function(elem, name2, isXML) { 4717 var ret, handle2, lowercaseName = name2.toLowerCase(); 4718 if (!isXML) { 4719 handle2 = attrHandle[lowercaseName]; 4720 attrHandle[lowercaseName] = ret; 4721 ret = getter(elem, name2, isXML) != null ? lowercaseName : null; 4722 attrHandle[lowercaseName] = handle2; 4723 } 4724 return ret; 4725 }; 4726 }); 4727 var rfocusable = /^(?:input|select|textarea|button)$/i, rclickable = /^(?:a|area)$/i; 4728 jQuery2.fn.extend({ 4729 prop: function(name, value) { 4730 return access(this, jQuery2.prop, name, value, arguments.length > 1); 4731 }, 4732 removeProp: function(name) { 4733 return this.each(function() { 4734 delete this[jQuery2.propFix[name] || name]; 4735 }); 4736 } 4737 }); 4738 jQuery2.extend({ 4739 prop: function(elem, name, value) { 4740 var ret, hooks, nType = elem.nodeType; 4741 if (nType === 3 || nType === 8 || nType === 2) { 4742 return; 4743 } 4744 if (nType !== 1 || !jQuery2.isXMLDoc(elem)) { 4745 name = jQuery2.propFix[name] || name; 4746 hooks = jQuery2.propHooks[name]; 4747 } 4748 if (value !== void 0) { 4749 if (hooks && "set" in hooks && (ret = hooks.set(elem, value, name)) !== void 0) { 4750 return ret; 4751 } 4752 return elem[name] = value; 4753 } 4754 if (hooks && "get" in hooks && (ret = hooks.get(elem, name)) !== null) { 4755 return ret; 4756 } 4757 return elem[name]; 4758 }, 4759 propHooks: { 4760 tabIndex: { 4761 get: function(elem) { 4762 var tabindex = jQuery2.find.attr(elem, "tabindex"); 4763 if (tabindex) { 4764 return parseInt(tabindex, 10); 4765 } 4766 if (rfocusable.test(elem.nodeName) || rclickable.test(elem.nodeName) && elem.href) { 4767 return 0; 4768 } 4769 return -1; 4770 } 4771 } 4772 }, 4773 propFix: { 4774 "for": "htmlFor", 4775 "class": "className" 4776 } 4777 }); 4778 if (!support.optSelected) { 4779 jQuery2.propHooks.selected = { 4780 get: function(elem) { 4781 var parent = elem.parentNode; 4782 if (parent && parent.parentNode) { 4783 parent.parentNode.selectedIndex; 4784 } 4785 return null; 4786 }, 4787 set: function(elem) { 4788 var parent = elem.parentNode; 4789 if (parent) { 4790 parent.selectedIndex; 4791 if (parent.parentNode) { 4792 parent.parentNode.selectedIndex; 4793 } 4794 } 4795 } 4796 }; 4797 } 4798 jQuery2.each([ 4799 "tabIndex", 4800 "readOnly", 4801 "maxLength", 4802 "cellSpacing", 4803 "cellPadding", 4804 "rowSpan", 4805 "colSpan", 4806 "useMap", 4807 "frameBorder", 4808 "contentEditable" 4809 ], function() { 4810 jQuery2.propFix[this.toLowerCase()] = this; 4811 }); 4812 function stripAndCollapse(value) { 4813 var tokens = value.match(rnothtmlwhite) || []; 4814 return tokens.join(" "); 4815 } 4816 function getClass(elem) { 4817 return elem.getAttribute && elem.getAttribute("class") || ""; 4818 } 4819 function classesToArray(value) { 4820 if (Array.isArray(value)) { 4821 return value; 4822 } 4823 if (typeof value === "string") { 4824 return value.match(rnothtmlwhite) || []; 4825 } 4826 return []; 4827 } 4828 jQuery2.fn.extend({ 4829 addClass: function(value) { 4830 var classNames, cur, curValue, className, i, finalValue; 4831 if (isFunction2(value)) { 4832 return this.each(function(j) { 4833 jQuery2(this).addClass(value.call(this, j, getClass(this))); 4834 }); 4835 } 4836 classNames = classesToArray(value); 4837 if (classNames.length) { 4838 return this.each(function() { 4839 curValue = getClass(this); 4840 cur = this.nodeType === 1 && " " + stripAndCollapse(curValue) + " "; 4841 if (cur) { 4842 for (i = 0; i < classNames.length; i++) { 4843 className = classNames[i]; 4844 if (cur.indexOf(" " + className + " ") < 0) { 4845 cur += className + " "; 4846 } 4847 } 4848 finalValue = stripAndCollapse(cur); 4849 if (curValue !== finalValue) { 4850 this.setAttribute("class", finalValue); 4851 } 4852 } 4853 }); 4854 } 4855 return this; 4856 }, 4857 removeClass: function(value) { 4858 var classNames, cur, curValue, className, i, finalValue; 4859 if (isFunction2(value)) { 4860 return this.each(function(j) { 4861 jQuery2(this).removeClass(value.call(this, j, getClass(this))); 4862 }); 4863 } 4864 if (!arguments.length) { 4865 return this.attr("class", ""); 4866 } 4867 classNames = classesToArray(value); 4868 if (classNames.length) { 4869 return this.each(function() { 4870 curValue = getClass(this); 4871 cur = this.nodeType === 1 && " " + stripAndCollapse(curValue) + " "; 4872 if (cur) { 4873 for (i = 0; i < classNames.length; i++) { 4874 className = classNames[i]; 4875 while (cur.indexOf(" " + className + " ") > -1) { 4876 cur = cur.replace(" " + className + " ", " "); 4877 } 4878 } 4879 finalValue = stripAndCollapse(cur); 4880 if (curValue !== finalValue) { 4881 this.setAttribute("class", finalValue); 4882 } 4883 } 4884 }); 4885 } 4886 return this; 4887 }, 4888 toggleClass: function(value, stateVal) { 4889 var classNames, className, i, self, type = typeof value, isValidValue = type === "string" || Array.isArray(value); 4890 if (isFunction2(value)) { 4891 return this.each(function(i2) { 4892 jQuery2(this).toggleClass( 4893 value.call(this, i2, getClass(this), stateVal), 4894 stateVal 4895 ); 4896 }); 4897 } 4898 if (typeof stateVal === "boolean" && isValidValue) { 4899 return stateVal ? this.addClass(value) : this.removeClass(value); 4900 } 4901 classNames = classesToArray(value); 4902 return this.each(function() { 4903 if (isValidValue) { 4904 self = jQuery2(this); 4905 for (i = 0; i < classNames.length; i++) { 4906 className = classNames[i]; 4907 if (self.hasClass(className)) { 4908 self.removeClass(className); 4909 } else { 4910 self.addClass(className); 4911 } 4912 } 4913 } else if (value === void 0 || type === "boolean") { 4914 className = getClass(this); 4915 if (className) { 4916 dataPriv.set(this, "__className__", className); 4917 } 4918 if (this.setAttribute) { 4919 this.setAttribute( 4920 "class", 4921 className || value === false ? "" : dataPriv.get(this, "__className__") || "" 4922 ); 4923 } 4924 } 4925 }); 4926 }, 4927 hasClass: function(selector) { 4928 var className, elem, i = 0; 4929 className = " " + selector + " "; 4930 while (elem = this[i++]) { 4931 if (elem.nodeType === 1 && (" " + stripAndCollapse(getClass(elem)) + " ").indexOf(className) > -1) { 4932 return true; 4933 } 4934 } 4935 return false; 4936 } 4937 }); 4938 var rreturn = /\r/g; 4939 jQuery2.fn.extend({ 4940 val: function(value) { 4941 var hooks, ret, valueIsFunction, elem = this[0]; 4942 if (!arguments.length) { 4943 if (elem) { 4944 hooks = jQuery2.valHooks[elem.type] || jQuery2.valHooks[elem.nodeName.toLowerCase()]; 4945 if (hooks && "get" in hooks && (ret = hooks.get(elem, "value")) !== void 0) { 4946 return ret; 4947 } 4948 ret = elem.value; 4949 if (typeof ret === "string") { 4950 return ret.replace(rreturn, ""); 4951 } 4952 return ret == null ? "" : ret; 4953 } 4954 return; 4955 } 4956 valueIsFunction = isFunction2(value); 4957 return this.each(function(i) { 4958 var val; 4959 if (this.nodeType !== 1) { 4960 return; 4961 } 4962 if (valueIsFunction) { 4963 val = value.call(this, i, jQuery2(this).val()); 4964 } else { 4965 val = value; 4966 } 4967 if (val == null) { 4968 val = ""; 4969 } else if (typeof val === "number") { 4970 val += ""; 4971 } else if (Array.isArray(val)) { 4972 val = jQuery2.map(val, function(value2) { 4973 return value2 == null ? "" : value2 + ""; 4974 }); 4975 } 4976 hooks = jQuery2.valHooks[this.type] || jQuery2.valHooks[this.nodeName.toLowerCase()]; 4977 if (!hooks || !("set" in hooks) || hooks.set(this, val, "value") === void 0) { 4978 this.value = val; 4979 } 4980 }); 4981 } 4982 }); 4983 jQuery2.extend({ 4984 valHooks: { 4985 option: { 4986 get: function(elem) { 4987 var val = jQuery2.find.attr(elem, "value"); 4988 return val != null ? val : ( 4989 // Support: IE <=10 - 11 only 4990 // option.text throws exceptions (trac-14686, trac-14858) 4991 // Strip and collapse whitespace 4992 // https://html.spec.whatwg.org/#strip-and-collapse-whitespace 4993 stripAndCollapse(jQuery2.text(elem)) 4994 ); 4995 } 4996 }, 4997 select: { 4998 get: function(elem) { 4999 var value, option, i, options = elem.options, index = elem.selectedIndex, one = elem.type === "select-one", values = one ? null : [], max = one ? index + 1 : options.length; 5000 if (index < 0) { 5001 i = max; 5002 } else { 5003 i = one ? index : 0; 5004 } 5005 for (; i < max; i++) { 5006 option = options[i]; 5007 if ((option.selected || i === index) && // Don't return options that are disabled or in a disabled optgroup 5008 !option.disabled && (!option.parentNode.disabled || !nodeName(option.parentNode, "optgroup"))) { 5009 value = jQuery2(option).val(); 5010 if (one) { 5011 return value; 5012 } 5013 values.push(value); 5014 } 5015 } 5016 return values; 5017 }, 5018 set: function(elem, value) { 5019 var optionSet, option, options = elem.options, values = jQuery2.makeArray(value), i = options.length; 5020 while (i--) { 5021 option = options[i]; 5022 if (option.selected = jQuery2.inArray(jQuery2.valHooks.option.get(option), values) > -1) { 5023 optionSet = true; 5024 } 5025 } 5026 if (!optionSet) { 5027 elem.selectedIndex = -1; 5028 } 5029 return values; 5030 } 5031 } 5032 } 5033 }); 5034 jQuery2.each(["radio", "checkbox"], function() { 5035 jQuery2.valHooks[this] = { 5036 set: function(elem, value) { 5037 if (Array.isArray(value)) { 5038 return elem.checked = jQuery2.inArray(jQuery2(elem).val(), value) > -1; 5039 } 5040 } 5041 }; 5042 if (!support.checkOn) { 5043 jQuery2.valHooks[this].get = function(elem) { 5044 return elem.getAttribute("value") === null ? "on" : elem.value; 5045 }; 5046 } 5047 }); 5048 var location = window2.location; 5049 var nonce = { guid: Date.now() }; 5050 var rquery = /\?/; 5051 jQuery2.parseXML = function(data) { 5052 var xml, parserErrorElem; 5053 if (!data || typeof data !== "string") { 5054 return null; 5055 } 5056 try { 5057 xml = new window2.DOMParser().parseFromString(data, "text/xml"); 5058 } catch (e2) { 5059 } 5060 parserErrorElem = xml && xml.getElementsByTagName("parsererror")[0]; 5061 if (!xml || parserErrorElem) { 5062 jQuery2.error("Invalid XML: " + (parserErrorElem ? jQuery2.map(parserErrorElem.childNodes, function(el) { 5063 return el.textContent; 5064 }).join("\n") : data)); 5065 } 5066 return xml; 5067 }; 5068 var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, stopPropagationCallback = function(e2) { 5069 e2.stopPropagation(); 5070 }; 5071 jQuery2.extend(jQuery2.event, { 5072 trigger: function(event, data, elem, onlyHandlers) { 5073 var i, cur, tmp, bubbleType, ontype, handle2, special, lastElement, eventPath = [elem || document2], type = hasOwn.call(event, "type") ? event.type : event, namespaces = hasOwn.call(event, "namespace") ? event.namespace.split(".") : []; 5074 cur = lastElement = tmp = elem = elem || document2; 5075 if (elem.nodeType === 3 || elem.nodeType === 8) { 5076 return; 5077 } 5078 if (rfocusMorph.test(type + jQuery2.event.triggered)) { 5079 return; 5080 } 5081 if (type.indexOf(".") > -1) { 5082 namespaces = type.split("."); 5083 type = namespaces.shift(); 5084 namespaces.sort(); 5085 } 5086 ontype = type.indexOf(":") < 0 && "on" + type; 5087 event = event[jQuery2.expando] ? event : new jQuery2.Event(type, typeof event === "object" && event); 5088 event.isTrigger = onlyHandlers ? 2 : 3; 5089 event.namespace = namespaces.join("."); 5090 event.rnamespace = event.namespace ? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)") : null; 5091 event.result = void 0; 5092 if (!event.target) { 5093 event.target = elem; 5094 } 5095 data = data == null ? [event] : jQuery2.makeArray(data, [event]); 5096 special = jQuery2.event.special[type] || {}; 5097 if (!onlyHandlers && special.trigger && special.trigger.apply(elem, data) === false) { 5098 return; 5099 } 5100 if (!onlyHandlers && !special.noBubble && !isWindow(elem)) { 5101 bubbleType = special.delegateType || type; 5102 if (!rfocusMorph.test(bubbleType + type)) { 5103 cur = cur.parentNode; 5104 } 5105 for (; cur; cur = cur.parentNode) { 5106 eventPath.push(cur); 5107 tmp = cur; 5108 } 5109 if (tmp === (elem.ownerDocument || document2)) { 5110 eventPath.push(tmp.defaultView || tmp.parentWindow || window2); 5111 } 5112 } 5113 i = 0; 5114 while ((cur = eventPath[i++]) && !event.isPropagationStopped()) { 5115 lastElement = cur; 5116 event.type = i > 1 ? bubbleType : special.bindType || type; 5117 handle2 = (dataPriv.get(cur, "events") || /* @__PURE__ */ Object.create(null))[event.type] && dataPriv.get(cur, "handle"); 5118 if (handle2) { 5119 handle2.apply(cur, data); 5120 } 5121 handle2 = ontype && cur[ontype]; 5122 if (handle2 && handle2.apply && acceptData(cur)) { 5123 event.result = handle2.apply(cur, data); 5124 if (event.result === false) { 5125 event.preventDefault(); 5126 } 5127 } 5128 } 5129 event.type = type; 5130 if (!onlyHandlers && !event.isDefaultPrevented()) { 5131 if ((!special._default || special._default.apply(eventPath.pop(), data) === false) && acceptData(elem)) { 5132 if (ontype && isFunction2(elem[type]) && !isWindow(elem)) { 5133 tmp = elem[ontype]; 5134 if (tmp) { 5135 elem[ontype] = null; 5136 } 5137 jQuery2.event.triggered = type; 5138 if (event.isPropagationStopped()) { 5139 lastElement.addEventListener(type, stopPropagationCallback); 5140 } 5141 elem[type](); 5142 if (event.isPropagationStopped()) { 5143 lastElement.removeEventListener(type, stopPropagationCallback); 5144 } 5145 jQuery2.event.triggered = void 0; 5146 if (tmp) { 5147 elem[ontype] = tmp; 5148 } 5149 } 5150 } 5151 } 5152 return event.result; 5153 }, 5154 // Piggyback on a donor event to simulate a different one 5155 // Used only for `focus(in | out)` events 5156 simulate: function(type, elem, event) { 5157 var e2 = jQuery2.extend( 5158 new jQuery2.Event(), 5159 event, 5160 { 5161 type, 5162 isSimulated: true 5163 } 5164 ); 5165 jQuery2.event.trigger(e2, null, elem); 5166 } 5167 }); 5168 jQuery2.fn.extend({ 5169 trigger: function(type, data) { 5170 return this.each(function() { 5171 jQuery2.event.trigger(type, data, this); 5172 }); 5173 }, 5174 triggerHandler: function(type, data) { 5175 var elem = this[0]; 5176 if (elem) { 5177 return jQuery2.event.trigger(type, data, elem, true); 5178 } 5179 } 5180 }); 5181 var rbracket = /\[\]$/, rCRLF = /\r?\n/g, rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, rsubmittable = /^(?:input|select|textarea|keygen)/i; 5182 function buildParams(prefix, obj, traditional, add) { 5183 var name; 5184 if (Array.isArray(obj)) { 5185 jQuery2.each(obj, function(i, v) { 5186 if (traditional || rbracket.test(prefix)) { 5187 add(prefix, v); 5188 } else { 5189 buildParams( 5190 prefix + "[" + (typeof v === "object" && v != null ? i : "") + "]", 5191 v, 5192 traditional, 5193 add 5194 ); 5195 } 5196 }); 5197 } else if (!traditional && toType(obj) === "object") { 5198 for (name in obj) { 5199 buildParams(prefix + "[" + name + "]", obj[name], traditional, add); 5200 } 5201 } else { 5202 add(prefix, obj); 5203 } 5204 } 5205 jQuery2.param = function(a, traditional) { 5206 var prefix, s = [], add = function(key, valueOrFunction) { 5207 var value = isFunction2(valueOrFunction) ? valueOrFunction() : valueOrFunction; 5208 s[s.length] = encodeURIComponent(key) + "=" + encodeURIComponent(value == null ? "" : value); 5209 }; 5210 if (a == null) { 5211 return ""; 5212 } 5213 if (Array.isArray(a) || a.jquery && !jQuery2.isPlainObject(a)) { 5214 jQuery2.each(a, function() { 5215 add(this.name, this.value); 5216 }); 5217 } else { 5218 for (prefix in a) { 5219 buildParams(prefix, a[prefix], traditional, add); 5220 } 5221 } 5222 return s.join("&"); 5223 }; 5224 jQuery2.fn.extend({ 5225 serialize: function() { 5226 return jQuery2.param(this.serializeArray()); 5227 }, 5228 serializeArray: function() { 5229 return this.map(function() { 5230 var elements2 = jQuery2.prop(this, "elements"); 5231 return elements2 ? jQuery2.makeArray(elements2) : this; 5232 }).filter(function() { 5233 var type = this.type; 5234 return this.name && !jQuery2(this).is(":disabled") && rsubmittable.test(this.nodeName) && !rsubmitterTypes.test(type) && (this.checked || !rcheckableType.test(type)); 5235 }).map(function(_i, elem) { 5236 var val = jQuery2(this).val(); 5237 if (val == null) { 5238 return null; 5239 } 5240 if (Array.isArray(val)) { 5241 return jQuery2.map(val, function(val2) { 5242 return { name: elem.name, value: val2.replace(rCRLF, "\r\n") }; 5243 }); 5244 } 5245 return { name: elem.name, value: val.replace(rCRLF, "\r\n") }; 5246 }).get(); 5247 } 5248 }); 5249 var r20 = /%20/g, rhash = /#.*$/, rantiCache = /([?&])_=[^&]*/, rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, rnoContent = /^(?:GET|HEAD)$/, rprotocol = /^\/\//, prefilters = {}, transports = {}, allTypes = "*/".concat("*"), originAnchor = document2.createElement("a"); 5250 originAnchor.href = location.href; 5251 function addToPrefiltersOrTransports(structure) { 5252 return function(dataTypeExpression, func) { 5253 if (typeof dataTypeExpression !== "string") { 5254 func = dataTypeExpression; 5255 dataTypeExpression = "*"; 5256 } 5257 var dataType, i = 0, dataTypes = dataTypeExpression.toLowerCase().match(rnothtmlwhite) || []; 5258 if (isFunction2(func)) { 5259 while (dataType = dataTypes[i++]) { 5260 if (dataType[0] === "+") { 5261 dataType = dataType.slice(1) || "*"; 5262 (structure[dataType] = structure[dataType] || []).unshift(func); 5263 } else { 5264 (structure[dataType] = structure[dataType] || []).push(func); 5265 } 5266 } 5267 } 5268 }; 5269 } 5270 function inspectPrefiltersOrTransports(structure, options, originalOptions, jqXHR) { 5271 var inspected = {}, seekingTransport = structure === transports; 5272 function inspect(dataType) { 5273 var selected; 5274 inspected[dataType] = true; 5275 jQuery2.each(structure[dataType] || [], function(_23, prefilterOrFactory) { 5276 var dataTypeOrTransport = prefilterOrFactory(options, originalOptions, jqXHR); 5277 if (typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[dataTypeOrTransport]) { 5278 options.dataTypes.unshift(dataTypeOrTransport); 5279 inspect(dataTypeOrTransport); 5280 return false; 5281 } else if (seekingTransport) { 5282 return !(selected = dataTypeOrTransport); 5283 } 5284 }); 5285 return selected; 5286 } 5287 return inspect(options.dataTypes[0]) || !inspected["*"] && inspect("*"); 5288 } 5289 function ajaxExtend(target, src) { 5290 var key, deep, flatOptions = jQuery2.ajaxSettings.flatOptions || {}; 5291 for (key in src) { 5292 if (src[key] !== void 0) { 5293 (flatOptions[key] ? target : deep || (deep = {}))[key] = src[key]; 5294 } 5295 } 5296 if (deep) { 5297 jQuery2.extend(true, target, deep); 5298 } 5299 return target; 5300 } 5301 function ajaxHandleResponses(s, jqXHR, responses) { 5302 var ct, type, finalDataType, firstDataType, contents = s.contents, dataTypes = s.dataTypes; 5303 while (dataTypes[0] === "*") { 5304 dataTypes.shift(); 5305 if (ct === void 0) { 5306 ct = s.mimeType || jqXHR.getResponseHeader("Content-Type"); 5307 } 5308 } 5309 if (ct) { 5310 for (type in contents) { 5311 if (contents[type] && contents[type].test(ct)) { 5312 dataTypes.unshift(type); 5313 break; 5314 } 5315 } 5316 } 5317 if (dataTypes[0] in responses) { 5318 finalDataType = dataTypes[0]; 5319 } else { 5320 for (type in responses) { 5321 if (!dataTypes[0] || s.converters[type + " " + dataTypes[0]]) { 5322 finalDataType = type; 5323 break; 5324 } 5325 if (!firstDataType) { 5326 firstDataType = type; 5327 } 5328 } 5329 finalDataType = finalDataType || firstDataType; 5330 } 5331 if (finalDataType) { 5332 if (finalDataType !== dataTypes[0]) { 5333 dataTypes.unshift(finalDataType); 5334 } 5335 return responses[finalDataType]; 5336 } 5337 } 5338 function ajaxConvert(s, response, jqXHR, isSuccess) { 5339 var conv2, current, conv, tmp, prev, converters = {}, dataTypes = s.dataTypes.slice(); 5340 if (dataTypes[1]) { 5341 for (conv in s.converters) { 5342 converters[conv.toLowerCase()] = s.converters[conv]; 5343 } 5344 } 5345 current = dataTypes.shift(); 5346 while (current) { 5347 if (s.responseFields[current]) { 5348 jqXHR[s.responseFields[current]] = response; 5349 } 5350 if (!prev && isSuccess && s.dataFilter) { 5351 response = s.dataFilter(response, s.dataType); 5352 } 5353 prev = current; 5354 current = dataTypes.shift(); 5355 if (current) { 5356 if (current === "*") { 5357 current = prev; 5358 } else if (prev !== "*" && prev !== current) { 5359 conv = converters[prev + " " + current] || converters["* " + current]; 5360 if (!conv) { 5361 for (conv2 in converters) { 5362 tmp = conv2.split(" "); 5363 if (tmp[1] === current) { 5364 conv = converters[prev + " " + tmp[0]] || converters["* " + tmp[0]]; 5365 if (conv) { 5366 if (conv === true) { 5367 conv = converters[conv2]; 5368 } else if (converters[conv2] !== true) { 5369 current = tmp[0]; 5370 dataTypes.unshift(tmp[1]); 5371 } 5372 break; 5373 } 5374 } 5375 } 5376 } 5377 if (conv !== true) { 5378 if (conv && s.throws) { 5379 response = conv(response); 5380 } else { 5381 try { 5382 response = conv(response); 5383 } catch (e2) { 5384 return { 5385 state: "parsererror", 5386 error: conv ? e2 : "No conversion from " + prev + " to " + current 5387 }; 5388 } 5389 } 5390 } 5391 } 5392 } 5393 } 5394 return { state: "success", data: response }; 5395 } 5396 jQuery2.extend({ 5397 // Counter for holding the number of active queries 5398 active: 0, 5399 // Last-Modified header cache for next request 5400 lastModified: {}, 5401 etag: {}, 5402 ajaxSettings: { 5403 url: location.href, 5404 type: "GET", 5405 isLocal: rlocalProtocol.test(location.protocol), 5406 global: true, 5407 processData: true, 5408 async: true, 5409 contentType: "application/x-www-form-urlencoded; charset=UTF-8", 5410 /* 5411 timeout: 0, 5412 data: null, 5413 dataType: null, 5414 username: null, 5415 password: null, 5416 cache: null, 5417 throws: false, 5418 traditional: false, 5419 headers: {}, 5420 */ 5421 accepts: { 5422 "*": allTypes, 5423 text: "text/plain", 5424 html: "text/html", 5425 xml: "application/xml, text/xml", 5426 json: "application/json, text/javascript" 5427 }, 5428 contents: { 5429 xml: /\bxml\b/, 5430 html: /\bhtml/, 5431 json: /\bjson\b/ 5432 }, 5433 responseFields: { 5434 xml: "responseXML", 5435 text: "responseText", 5436 json: "responseJSON" 5437 }, 5438 // Data converters 5439 // Keys separate source (or catchall "*") and destination types with a single space 5440 converters: { 5441 // Convert anything to text 5442 "* text": String, 5443 // Text to html (true = no transformation) 5444 "text html": true, 5445 // Evaluate text as a json expression 5446 "text json": JSON.parse, 5447 // Parse text as xml 5448 "text xml": jQuery2.parseXML 5449 }, 5450 // For options that shouldn't be deep extended: 5451 // you can add your own custom options here if 5452 // and when you create one that shouldn't be 5453 // deep extended (see ajaxExtend) 5454 flatOptions: { 5455 url: true, 5456 context: true 5457 } 5458 }, 5459 // Creates a full fledged settings object into target 5460 // with both ajaxSettings and settings fields. 5461 // If target is omitted, writes into ajaxSettings. 5462 ajaxSetup: function(target, settings2) { 5463 return settings2 ? ( 5464 // Building a settings object 5465 ajaxExtend(ajaxExtend(target, jQuery2.ajaxSettings), settings2) 5466 ) : ( 5467 // Extending ajaxSettings 5468 ajaxExtend(jQuery2.ajaxSettings, target) 5469 ); 5470 }, 5471 ajaxPrefilter: addToPrefiltersOrTransports(prefilters), 5472 ajaxTransport: addToPrefiltersOrTransports(transports), 5473 // Main method 5474 ajax: function(url, options) { 5475 if (typeof url === "object") { 5476 options = url; 5477 url = void 0; 5478 } 5479 options = options || {}; 5480 var transport, cacheURL, responseHeadersString, responseHeaders, timeoutTimer, urlAnchor, completed2, fireGlobals, i, uncached, s = jQuery2.ajaxSetup({}, options), callbackContext = s.context || s, globalEventContext = s.context && (callbackContext.nodeType || callbackContext.jquery) ? jQuery2(callbackContext) : jQuery2.event, deferred = jQuery2.Deferred(), completeDeferred = jQuery2.Callbacks("once memory"), statusCode = s.statusCode || {}, requestHeaders = {}, requestHeadersNames = {}, strAbort = "canceled", jqXHR = { 5481 readyState: 0, 5482 // Builds headers hashtable if needed 5483 getResponseHeader: function(key) { 5484 var match; 5485 if (completed2) { 5486 if (!responseHeaders) { 5487 responseHeaders = {}; 5488 while (match = rheaders.exec(responseHeadersString)) { 5489 responseHeaders[match[1].toLowerCase() + " "] = (responseHeaders[match[1].toLowerCase() + " "] || []).concat(match[2]); 5490 } 5491 } 5492 match = responseHeaders[key.toLowerCase() + " "]; 5493 } 5494 return match == null ? null : match.join(", "); 5495 }, 5496 // Raw string 5497 getAllResponseHeaders: function() { 5498 return completed2 ? responseHeadersString : null; 5499 }, 5500 // Caches the header 5501 setRequestHeader: function(name, value) { 5502 if (completed2 == null) { 5503 name = requestHeadersNames[name.toLowerCase()] = requestHeadersNames[name.toLowerCase()] || name; 5504 requestHeaders[name] = value; 5505 } 5506 return this; 5507 }, 5508 // Overrides response content-type header 5509 overrideMimeType: function(type) { 5510 if (completed2 == null) { 5511 s.mimeType = type; 5512 } 5513 return this; 5514 }, 5515 // Status-dependent callbacks 5516 statusCode: function(map) { 5517 var code; 5518 if (map) { 5519 if (completed2) { 5520 jqXHR.always(map[jqXHR.status]); 5521 } else { 5522 for (code in map) { 5523 statusCode[code] = [statusCode[code], map[code]]; 5524 } 5525 } 5526 } 5527 return this; 5528 }, 5529 // Cancel the request 5530 abort: function(statusText) { 5531 var finalText = statusText || strAbort; 5532 if (transport) { 5533 transport.abort(finalText); 5534 } 5535 done(0, finalText); 5536 return this; 5537 } 5538 }; 5539 deferred.promise(jqXHR); 5540 s.url = ((url || s.url || location.href) + "").replace(rprotocol, location.protocol + "//"); 5541 s.type = options.method || options.type || s.method || s.type; 5542 s.dataTypes = (s.dataType || "*").toLowerCase().match(rnothtmlwhite) || [""]; 5543 if (s.crossDomain == null) { 5544 urlAnchor = document2.createElement("a"); 5545 try { 5546 urlAnchor.href = s.url; 5547 urlAnchor.href = urlAnchor.href; 5548 s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== urlAnchor.protocol + "//" + urlAnchor.host; 5549 } catch (e2) { 5550 s.crossDomain = true; 5551 } 5552 } 5553 if (s.data && s.processData && typeof s.data !== "string") { 5554 s.data = jQuery2.param(s.data, s.traditional); 5555 } 5556 inspectPrefiltersOrTransports(prefilters, s, options, jqXHR); 5557 if (completed2) { 5558 return jqXHR; 5559 } 5560 fireGlobals = jQuery2.event && s.global; 5561 if (fireGlobals && jQuery2.active++ === 0) { 5562 jQuery2.event.trigger("ajaxStart"); 5563 } 5564 s.type = s.type.toUpperCase(); 5565 s.hasContent = !rnoContent.test(s.type); 5566 cacheURL = s.url.replace(rhash, ""); 5567 if (!s.hasContent) { 5568 uncached = s.url.slice(cacheURL.length); 5569 if (s.data && (s.processData || typeof s.data === "string")) { 5570 cacheURL += (rquery.test(cacheURL) ? "&" : "?") + s.data; 5571 delete s.data; 5572 } 5573 if (s.cache === false) { 5574 cacheURL = cacheURL.replace(rantiCache, "$1"); 5575 uncached = (rquery.test(cacheURL) ? "&" : "?") + "_=" + nonce.guid++ + uncached; 5576 } 5577 s.url = cacheURL + uncached; 5578 } else if (s.data && s.processData && (s.contentType || "").indexOf("application/x-www-form-urlencoded") === 0) { 5579 s.data = s.data.replace(r20, "+"); 5580 } 5581 if (s.ifModified) { 5582 if (jQuery2.lastModified[cacheURL]) { 5583 jqXHR.setRequestHeader("If-Modified-Since", jQuery2.lastModified[cacheURL]); 5584 } 5585 if (jQuery2.etag[cacheURL]) { 5586 jqXHR.setRequestHeader("If-None-Match", jQuery2.etag[cacheURL]); 5587 } 5588 } 5589 if (s.data && s.hasContent && s.contentType !== false || options.contentType) { 5590 jqXHR.setRequestHeader("Content-Type", s.contentType); 5591 } 5592 jqXHR.setRequestHeader( 5593 "Accept", 5594 s.dataTypes[0] && s.accepts[s.dataTypes[0]] ? s.accepts[s.dataTypes[0]] + (s.dataTypes[0] !== "*" ? ", " + allTypes + "; q=0.01" : "") : s.accepts["*"] 5595 ); 5596 for (i in s.headers) { 5597 jqXHR.setRequestHeader(i, s.headers[i]); 5598 } 5599 if (s.beforeSend && (s.beforeSend.call(callbackContext, jqXHR, s) === false || completed2)) { 5600 return jqXHR.abort(); 5601 } 5602 strAbort = "abort"; 5603 completeDeferred.add(s.complete); 5604 jqXHR.done(s.success); 5605 jqXHR.fail(s.error); 5606 transport = inspectPrefiltersOrTransports(transports, s, options, jqXHR); 5607 if (!transport) { 5608 done(-1, "No Transport"); 5609 } else { 5610 jqXHR.readyState = 1; 5611 if (fireGlobals) { 5612 globalEventContext.trigger("ajaxSend", [jqXHR, s]); 5613 } 5614 if (completed2) { 5615 return jqXHR; 5616 } 5617 if (s.async && s.timeout > 0) { 5618 timeoutTimer = window2.setTimeout(function() { 5619 jqXHR.abort("timeout"); 5620 }, s.timeout); 5621 } 5622 try { 5623 completed2 = false; 5624 transport.send(requestHeaders, done); 5625 } catch (e2) { 5626 if (completed2) { 5627 throw e2; 5628 } 5629 done(-1, e2); 5630 } 5631 } 5632 function done(status, nativeStatusText, responses, headers) { 5633 var isSuccess, success, error2, response, modified, statusText = nativeStatusText; 5634 if (completed2) { 5635 return; 5636 } 5637 completed2 = true; 5638 if (timeoutTimer) { 5639 window2.clearTimeout(timeoutTimer); 5640 } 5641 transport = void 0; 5642 responseHeadersString = headers || ""; 5643 jqXHR.readyState = status > 0 ? 4 : 0; 5644 isSuccess = status >= 200 && status < 300 || status === 304; 5645 if (responses) { 5646 response = ajaxHandleResponses(s, jqXHR, responses); 5647 } 5648 if (!isSuccess && jQuery2.inArray("script", s.dataTypes) > -1 && jQuery2.inArray("json", s.dataTypes) < 0) { 5649 s.converters["text script"] = function() { 5650 }; 5651 } 5652 response = ajaxConvert(s, response, jqXHR, isSuccess); 5653 if (isSuccess) { 5654 if (s.ifModified) { 5655 modified = jqXHR.getResponseHeader("Last-Modified"); 5656 if (modified) { 5657 jQuery2.lastModified[cacheURL] = modified; 5658 } 5659 modified = jqXHR.getResponseHeader("etag"); 5660 if (modified) { 5661 jQuery2.etag[cacheURL] = modified; 5662 } 5663 } 5664 if (status === 204 || s.type === "HEAD") { 5665 statusText = "nocontent"; 5666 } else if (status === 304) { 5667 statusText = "notmodified"; 5668 } else { 5669 statusText = response.state; 5670 success = response.data; 5671 error2 = response.error; 5672 isSuccess = !error2; 5673 } 5674 } else { 5675 error2 = statusText; 5676 if (status || !statusText) { 5677 statusText = "error"; 5678 if (status < 0) { 5679 status = 0; 5680 } 5681 } 5682 } 5683 jqXHR.status = status; 5684 jqXHR.statusText = (nativeStatusText || statusText) + ""; 5685 if (isSuccess) { 5686 deferred.resolveWith(callbackContext, [success, statusText, jqXHR]); 5687 } else { 5688 deferred.rejectWith(callbackContext, [jqXHR, statusText, error2]); 5689 } 5690 jqXHR.statusCode(statusCode); 5691 statusCode = void 0; 5692 if (fireGlobals) { 5693 globalEventContext.trigger( 5694 isSuccess ? "ajaxSuccess" : "ajaxError", 5695 [jqXHR, s, isSuccess ? success : error2] 5696 ); 5697 } 5698 completeDeferred.fireWith(callbackContext, [jqXHR, statusText]); 5699 if (fireGlobals) { 5700 globalEventContext.trigger("ajaxComplete", [jqXHR, s]); 5701 if (!--jQuery2.active) { 5702 jQuery2.event.trigger("ajaxStop"); 5703 } 5704 } 5705 } 5706 return jqXHR; 5707 }, 5708 getJSON: function(url, data, callback) { 5709 return jQuery2.get(url, data, callback, "json"); 5710 }, 5711 getScript: function(url, callback) { 5712 return jQuery2.get(url, void 0, callback, "script"); 5713 } 5714 }); 5715 jQuery2.each(["get", "post"], function(_i, method) { 5716 jQuery2[method] = function(url, data, callback, type) { 5717 if (isFunction2(data)) { 5718 type = type || callback; 5719 callback = data; 5720 data = void 0; 5721 } 5722 return jQuery2.ajax(jQuery2.extend({ 5723 url, 5724 type: method, 5725 dataType: type, 5726 data, 5727 success: callback 5728 }, jQuery2.isPlainObject(url) && url)); 5729 }; 5730 }); 5731 jQuery2.ajaxPrefilter(function(s) { 5732 var i; 5733 for (i in s.headers) { 5734 if (i.toLowerCase() === "content-type") { 5735 s.contentType = s.headers[i] || ""; 5736 } 5737 } 5738 }); 5739 jQuery2._evalUrl = function(url, options, doc) { 5740 return jQuery2.ajax({ 5741 url, 5742 // Make this explicit, since user can override this through ajaxSetup (trac-11264) 5743 type: "GET", 5744 dataType: "script", 5745 cache: true, 5746 async: false, 5747 global: false, 5748 // Only evaluate the response if it is successful (gh-4126) 5749 // dataFilter is not invoked for failure responses, so using it instead 5750 // of the default converter is kludgy but it works. 5751 converters: { 5752 "text script": function() { 5753 } 5754 }, 5755 dataFilter: function(response) { 5756 jQuery2.globalEval(response, options, doc); 5757 } 5758 }); 5759 }; 5760 jQuery2.fn.extend({ 5761 wrapAll: function(html) { 5762 var wrap; 5763 if (this[0]) { 5764 if (isFunction2(html)) { 5765 html = html.call(this[0]); 5766 } 5767 wrap = jQuery2(html, this[0].ownerDocument).eq(0).clone(true); 5768 if (this[0].parentNode) { 5769 wrap.insertBefore(this[0]); 5770 } 5771 wrap.map(function() { 5772 var elem = this; 5773 while (elem.firstElementChild) { 5774 elem = elem.firstElementChild; 5775 } 5776 return elem; 5777 }).append(this); 5778 } 5779 return this; 5780 }, 5781 wrapInner: function(html) { 5782 if (isFunction2(html)) { 5783 return this.each(function(i) { 5784 jQuery2(this).wrapInner(html.call(this, i)); 5785 }); 5786 } 5787 return this.each(function() { 5788 var self = jQuery2(this), contents = self.contents(); 5789 if (contents.length) { 5790 contents.wrapAll(html); 5791 } else { 5792 self.append(html); 5793 } 5794 }); 5795 }, 5796 wrap: function(html) { 5797 var htmlIsFunction = isFunction2(html); 5798 return this.each(function(i) { 5799 jQuery2(this).wrapAll(htmlIsFunction ? html.call(this, i) : html); 5800 }); 5801 }, 5802 unwrap: function(selector) { 5803 this.parent(selector).not("body").each(function() { 5804 jQuery2(this).replaceWith(this.childNodes); 5805 }); 5806 return this; 5807 } 5808 }); 5809 jQuery2.expr.pseudos.hidden = function(elem) { 5810 return !jQuery2.expr.pseudos.visible(elem); 5811 }; 5812 jQuery2.expr.pseudos.visible = function(elem) { 5813 return !!(elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length); 5814 }; 5815 jQuery2.ajaxSettings.xhr = function() { 5816 try { 5817 return new window2.XMLHttpRequest(); 5818 } catch (e2) { 5819 } 5820 }; 5821 var xhrSuccessStatus = { 5822 // File protocol always yields status code 0, assume 200 5823 0: 200, 5824 // Support: IE <=9 only 5825 // trac-1450: sometimes IE returns 1223 when it should be 204 5826 1223: 204 5827 }, xhrSupported = jQuery2.ajaxSettings.xhr(); 5828 support.cors = !!xhrSupported && "withCredentials" in xhrSupported; 5829 support.ajax = xhrSupported = !!xhrSupported; 5830 jQuery2.ajaxTransport(function(options) { 5831 var callback, errorCallback; 5832 if (support.cors || xhrSupported && !options.crossDomain) { 5833 return { 5834 send: function(headers, complete) { 5835 var i, xhr = options.xhr(); 5836 xhr.open( 5837 options.type, 5838 options.url, 5839 options.async, 5840 options.username, 5841 options.password 5842 ); 5843 if (options.xhrFields) { 5844 for (i in options.xhrFields) { 5845 xhr[i] = options.xhrFields[i]; 5846 } 5847 } 5848 if (options.mimeType && xhr.overrideMimeType) { 5849 xhr.overrideMimeType(options.mimeType); 5850 } 5851 if (!options.crossDomain && !headers["X-Requested-With"]) { 5852 headers["X-Requested-With"] = "XMLHttpRequest"; 5853 } 5854 for (i in headers) { 5855 xhr.setRequestHeader(i, headers[i]); 5856 } 5857 callback = function(type) { 5858 return function() { 5859 if (callback) { 5860 callback = errorCallback = xhr.onload = xhr.onerror = xhr.onabort = xhr.ontimeout = xhr.onreadystatechange = null; 5861 if (type === "abort") { 5862 xhr.abort(); 5863 } else if (type === "error") { 5864 if (typeof xhr.status !== "number") { 5865 complete(0, "error"); 5866 } else { 5867 complete( 5868 // File: protocol always yields status 0; see trac-8605, trac-14207 5869 xhr.status, 5870 xhr.statusText 5871 ); 5872 } 5873 } else { 5874 complete( 5875 xhrSuccessStatus[xhr.status] || xhr.status, 5876 xhr.statusText, 5877 // Support: IE <=9 only 5878 // IE9 has no XHR2 but throws on binary (trac-11426) 5879 // For XHR2 non-text, let the caller handle it (gh-2498) 5880 (xhr.responseType || "text") !== "text" || typeof xhr.responseText !== "string" ? { binary: xhr.response } : { text: xhr.responseText }, 5881 xhr.getAllResponseHeaders() 5882 ); 5883 } 5884 } 5885 }; 5886 }; 5887 xhr.onload = callback(); 5888 errorCallback = xhr.onerror = xhr.ontimeout = callback("error"); 5889 if (xhr.onabort !== void 0) { 5890 xhr.onabort = errorCallback; 5891 } else { 5892 xhr.onreadystatechange = function() { 5893 if (xhr.readyState === 4) { 5894 window2.setTimeout(function() { 5895 if (callback) { 5896 errorCallback(); 5897 } 5898 }); 5899 } 5900 }; 5901 } 5902 callback = callback("abort"); 5903 try { 5904 xhr.send(options.hasContent && options.data || null); 5905 } catch (e2) { 5906 if (callback) { 5907 throw e2; 5908 } 5909 } 5910 }, 5911 abort: function() { 5912 if (callback) { 5913 callback(); 5914 } 5915 } 5916 }; 5917 } 5918 }); 5919 jQuery2.ajaxPrefilter(function(s) { 5920 if (s.crossDomain) { 5921 s.contents.script = false; 5922 } 5923 }); 5924 jQuery2.ajaxSetup({ 5925 accepts: { 5926 script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" 5927 }, 5928 contents: { 5929 script: /\b(?:java|ecma)script\b/ 5930 }, 5931 converters: { 5932 "text script": function(text) { 5933 jQuery2.globalEval(text); 5934 return text; 5935 } 5936 } 5937 }); 5938 jQuery2.ajaxPrefilter("script", function(s) { 5939 if (s.cache === void 0) { 5940 s.cache = false; 5941 } 5942 if (s.crossDomain) { 5943 s.type = "GET"; 5944 } 5945 }); 5946 jQuery2.ajaxTransport("script", function(s) { 5947 if (s.crossDomain || s.scriptAttrs) { 5948 var script, callback; 5949 return { 5950 send: function(_23, complete) { 5951 script = jQuery2("<script>").attr(s.scriptAttrs || {}).prop({ charset: s.scriptCharset, src: s.url }).on("load error", callback = function(evt) { 5952 script.remove(); 5953 callback = null; 5954 if (evt) { 5955 complete(evt.type === "error" ? 404 : 200, evt.type); 5956 } 5957 }); 5958 document2.head.appendChild(script[0]); 5959 }, 5960 abort: function() { 5961 if (callback) { 5962 callback(); 5963 } 5964 } 5965 }; 5966 } 5967 }); 5968 var oldCallbacks = [], rjsonp = /(=)\?(?=&|$)|\?\?/; 5969 jQuery2.ajaxSetup({ 5970 jsonp: "callback", 5971 jsonpCallback: function() { 5972 var callback = oldCallbacks.pop() || jQuery2.expando + "_" + nonce.guid++; 5973 this[callback] = true; 5974 return callback; 5975 } 5976 }); 5977 jQuery2.ajaxPrefilter("json jsonp", function(s, originalSettings, jqXHR) { 5978 var callbackName, overwritten, responseContainer, jsonProp = s.jsonp !== false && (rjsonp.test(s.url) ? "url" : typeof s.data === "string" && (s.contentType || "").indexOf("application/x-www-form-urlencoded") === 0 && rjsonp.test(s.data) && "data"); 5979 if (jsonProp || s.dataTypes[0] === "jsonp") { 5980 callbackName = s.jsonpCallback = isFunction2(s.jsonpCallback) ? s.jsonpCallback() : s.jsonpCallback; 5981 if (jsonProp) { 5982 s[jsonProp] = s[jsonProp].replace(rjsonp, "$1" + callbackName); 5983 } else if (s.jsonp !== false) { 5984 s.url += (rquery.test(s.url) ? "&" : "?") + s.jsonp + "=" + callbackName; 5985 } 5986 s.converters["script json"] = function() { 5987 if (!responseContainer) { 5988 jQuery2.error(callbackName + " was not called"); 5989 } 5990 return responseContainer[0]; 5991 }; 5992 s.dataTypes[0] = "json"; 5993 overwritten = window2[callbackName]; 5994 window2[callbackName] = function() { 5995 responseContainer = arguments; 5996 }; 5997 jqXHR.always(function() { 5998 if (overwritten === void 0) { 5999 jQuery2(window2).removeProp(callbackName); 6000 } else { 6001 window2[callbackName] = overwritten; 6002 } 6003 if (s[callbackName]) { 6004 s.jsonpCallback = originalSettings.jsonpCallback; 6005 oldCallbacks.push(callbackName); 6006 } 6007 if (responseContainer && isFunction2(overwritten)) { 6008 overwritten(responseContainer[0]); 6009 } 6010 responseContainer = overwritten = void 0; 6011 }); 6012 return "script"; 6013 } 6014 }); 6015 support.createHTMLDocument = (function() { 6016 var body2 = document2.implementation.createHTMLDocument("").body; 6017 body2.innerHTML = "<form></form><form></form>"; 6018 return body2.childNodes.length === 2; 6019 })(); 6020 jQuery2.parseHTML = function(data, context, keepScripts) { 6021 if (typeof data !== "string") { 6022 return []; 6023 } 6024 if (typeof context === "boolean") { 6025 keepScripts = context; 6026 context = false; 6027 } 6028 var base, parsed, scripts; 6029 if (!context) { 6030 if (support.createHTMLDocument) { 6031 context = document2.implementation.createHTMLDocument(""); 6032 base = context.createElement("base"); 6033 base.href = document2.location.href; 6034 context.head.appendChild(base); 6035 } else { 6036 context = document2; 6037 } 6038 } 6039 parsed = rsingleTag.exec(data); 6040 scripts = !keepScripts && []; 6041 if (parsed) { 6042 return [context.createElement(parsed[1])]; 6043 } 6044 parsed = buildFragment([data], context, scripts); 6045 if (scripts && scripts.length) { 6046 jQuery2(scripts).remove(); 6047 } 6048 return jQuery2.merge([], parsed.childNodes); 6049 }; 6050 jQuery2.fn.load = function(url, params, callback) { 6051 var selector, type, response, self = this, off = url.indexOf(" "); 6052 if (off > -1) { 6053 selector = stripAndCollapse(url.slice(off)); 6054 url = url.slice(0, off); 6055 } 6056 if (isFunction2(params)) { 6057 callback = params; 6058 params = void 0; 6059 } else if (params && typeof params === "object") { 6060 type = "POST"; 6061 } 6062 if (self.length > 0) { 6063 jQuery2.ajax({ 6064 url, 6065 // If "type" variable is undefined, then "GET" method will be used. 6066 // Make value of this field explicit since 6067 // user can override it through ajaxSetup method 6068 type: type || "GET", 6069 dataType: "html", 6070 data: params 6071 }).done(function(responseText) { 6072 response = arguments; 6073 self.html(selector ? ( 6074 // If a selector was specified, locate the right elements in a dummy div 6075 // Exclude scripts to avoid IE 'Permission Denied' errors 6076 jQuery2("<div>").append(jQuery2.parseHTML(responseText)).find(selector) 6077 ) : ( 6078 // Otherwise use the full result 6079 responseText 6080 )); 6081 }).always(callback && function(jqXHR, status) { 6082 self.each(function() { 6083 callback.apply(this, response || [jqXHR.responseText, status, jqXHR]); 6084 }); 6085 }); 6086 } 6087 return this; 6088 }; 6089 jQuery2.expr.pseudos.animated = function(elem) { 6090 return jQuery2.grep(jQuery2.timers, function(fn) { 6091 return elem === fn.elem; 6092 }).length; 6093 }; 6094 jQuery2.offset = { 6095 setOffset: function(elem, options, i) { 6096 var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition, position = jQuery2.css(elem, "position"), curElem = jQuery2(elem), props = {}; 6097 if (position === "static") { 6098 elem.style.position = "relative"; 6099 } 6100 curOffset = curElem.offset(); 6101 curCSSTop = jQuery2.css(elem, "top"); 6102 curCSSLeft = jQuery2.css(elem, "left"); 6103 calculatePosition = (position === "absolute" || position === "fixed") && (curCSSTop + curCSSLeft).indexOf("auto") > -1; 6104 if (calculatePosition) { 6105 curPosition = curElem.position(); 6106 curTop = curPosition.top; 6107 curLeft = curPosition.left; 6108 } else { 6109 curTop = parseFloat(curCSSTop) || 0; 6110 curLeft = parseFloat(curCSSLeft) || 0; 6111 } 6112 if (isFunction2(options)) { 6113 options = options.call(elem, i, jQuery2.extend({}, curOffset)); 6114 } 6115 if (options.top != null) { 6116 props.top = options.top - curOffset.top + curTop; 6117 } 6118 if (options.left != null) { 6119 props.left = options.left - curOffset.left + curLeft; 6120 } 6121 if ("using" in options) { 6122 options.using.call(elem, props); 6123 } else { 6124 curElem.css(props); 6125 } 6126 } 6127 }; 6128 jQuery2.fn.extend({ 6129 // offset() relates an element's border box to the document origin 6130 offset: function(options) { 6131 if (arguments.length) { 6132 return options === void 0 ? this : this.each(function(i) { 6133 jQuery2.offset.setOffset(this, options, i); 6134 }); 6135 } 6136 var rect, win, elem = this[0]; 6137 if (!elem) { 6138 return; 6139 } 6140 if (!elem.getClientRects().length) { 6141 return { top: 0, left: 0 }; 6142 } 6143 rect = elem.getBoundingClientRect(); 6144 win = elem.ownerDocument.defaultView; 6145 return { 6146 top: rect.top + win.pageYOffset, 6147 left: rect.left + win.pageXOffset 6148 }; 6149 }, 6150 // position() relates an element's margin box to its offset parent's padding box 6151 // This corresponds to the behavior of CSS absolute positioning 6152 position: function() { 6153 if (!this[0]) { 6154 return; 6155 } 6156 var offsetParent, offset, doc, elem = this[0], parentOffset = { top: 0, left: 0 }; 6157 if (jQuery2.css(elem, "position") === "fixed") { 6158 offset = elem.getBoundingClientRect(); 6159 } else { 6160 offset = this.offset(); 6161 doc = elem.ownerDocument; 6162 offsetParent = elem.offsetParent || doc.documentElement; 6163 while (offsetParent && (offsetParent === doc.body || offsetParent === doc.documentElement) && jQuery2.css(offsetParent, "position") === "static") { 6164 offsetParent = offsetParent.parentNode; 6165 } 6166 if (offsetParent && offsetParent !== elem && offsetParent.nodeType === 1) { 6167 parentOffset = jQuery2(offsetParent).offset(); 6168 parentOffset.top += jQuery2.css(offsetParent, "borderTopWidth", true); 6169 parentOffset.left += jQuery2.css(offsetParent, "borderLeftWidth", true); 6170 } 6171 } 6172 return { 6173 top: offset.top - parentOffset.top - jQuery2.css(elem, "marginTop", true), 6174 left: offset.left - parentOffset.left - jQuery2.css(elem, "marginLeft", true) 6175 }; 6176 }, 6177 // This method will return documentElement in the following cases: 6178 // 1) For the element inside the iframe without offsetParent, this method will return 6179 // documentElement of the parent window 6180 // 2) For the hidden or detached element 6181 // 3) For body or html element, i.e. in case of the html node - it will return itself 6182 // 6183 // but those exceptions were never presented as a real life use-cases 6184 // and might be considered as more preferable results. 6185 // 6186 // This logic, however, is not guaranteed and can change at any point in the future 6187 offsetParent: function() { 6188 return this.map(function() { 6189 var offsetParent = this.offsetParent; 6190 while (offsetParent && jQuery2.css(offsetParent, "position") === "static") { 6191 offsetParent = offsetParent.offsetParent; 6192 } 6193 return offsetParent || documentElement; 6194 }); 6195 } 6196 }); 6197 jQuery2.each({ scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function(method, prop) { 6198 var top = "pageYOffset" === prop; 6199 jQuery2.fn[method] = function(val) { 6200 return access(this, function(elem, method2, val2) { 6201 var win; 6202 if (isWindow(elem)) { 6203 win = elem; 6204 } else if (elem.nodeType === 9) { 6205 win = elem.defaultView; 6206 } 6207 if (val2 === void 0) { 6208 return win ? win[prop] : elem[method2]; 6209 } 6210 if (win) { 6211 win.scrollTo( 6212 !top ? val2 : win.pageXOffset, 6213 top ? val2 : win.pageYOffset 6214 ); 6215 } else { 6216 elem[method2] = val2; 6217 } 6218 }, method, val, arguments.length); 6219 }; 6220 }); 6221 jQuery2.each(["top", "left"], function(_i, prop) { 6222 jQuery2.cssHooks[prop] = addGetHookIf( 6223 support.pixelPosition, 6224 function(elem, computed) { 6225 if (computed) { 6226 computed = curCSS(elem, prop); 6227 return rnumnonpx.test(computed) ? jQuery2(elem).position()[prop] + "px" : computed; 6228 } 6229 } 6230 ); 6231 }); 6232 jQuery2.each({ Height: "height", Width: "width" }, function(name, type) { 6233 jQuery2.each({ 6234 padding: "inner" + name, 6235 content: type, 6236 "": "outer" + name 6237 }, function(defaultExtra, funcName) { 6238 jQuery2.fn[funcName] = function(margin, value) { 6239 var chainable = arguments.length && (defaultExtra || typeof margin !== "boolean"), extra = defaultExtra || (margin === true || value === true ? "margin" : "border"); 6240 return access(this, function(elem, type2, value2) { 6241 var doc; 6242 if (isWindow(elem)) { 6243 return funcName.indexOf("outer") === 0 ? elem["inner" + name] : elem.document.documentElement["client" + name]; 6244 } 6245 if (elem.nodeType === 9) { 6246 doc = elem.documentElement; 6247 return Math.max( 6248 elem.body["scroll" + name], 6249 doc["scroll" + name], 6250 elem.body["offset" + name], 6251 doc["offset" + name], 6252 doc["client" + name] 6253 ); 6254 } 6255 return value2 === void 0 ? ( 6256 // Get width or height on the element, requesting but not forcing parseFloat 6257 jQuery2.css(elem, type2, extra) 6258 ) : ( 6259 // Set width or height on the element 6260 jQuery2.style(elem, type2, value2, extra) 6261 ); 6262 }, type, chainable ? margin : void 0, chainable); 6263 }; 6264 }); 6265 }); 6266 jQuery2.each([ 6267 "ajaxStart", 6268 "ajaxStop", 6269 "ajaxComplete", 6270 "ajaxError", 6271 "ajaxSuccess", 6272 "ajaxSend" 6273 ], function(_i, type) { 6274 jQuery2.fn[type] = function(fn) { 6275 return this.on(type, fn); 6276 }; 6277 }); 6278 jQuery2.fn.extend({ 6279 bind: function(types, data, fn) { 6280 return this.on(types, null, data, fn); 6281 }, 6282 unbind: function(types, fn) { 6283 return this.off(types, null, fn); 6284 }, 6285 delegate: function(selector, types, data, fn) { 6286 return this.on(types, selector, data, fn); 6287 }, 6288 undelegate: function(selector, types, fn) { 6289 return arguments.length === 1 ? this.off(selector, "**") : this.off(types, selector || "**", fn); 6290 }, 6291 hover: function(fnOver, fnOut) { 6292 return this.mouseenter(fnOver).mouseleave(fnOut || fnOver); 6293 } 6294 }); 6295 jQuery2.each( 6296 "blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "), 6297 function(_i, name) { 6298 jQuery2.fn[name] = function(data, fn) { 6299 return arguments.length > 0 ? this.on(name, null, data, fn) : this.trigger(name); 6300 }; 6301 } 6302 ); 6303 var rtrim = /^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g; 6304 jQuery2.proxy = function(fn, context) { 6305 var tmp, args, proxy; 6306 if (typeof context === "string") { 6307 tmp = fn[context]; 6308 context = fn; 6309 fn = tmp; 6310 } 6311 if (!isFunction2(fn)) { 6312 return void 0; 6313 } 6314 args = slice2.call(arguments, 2); 6315 proxy = function() { 6316 return fn.apply(context || this, args.concat(slice2.call(arguments))); 6317 }; 6318 proxy.guid = fn.guid = fn.guid || jQuery2.guid++; 6319 return proxy; 6320 }; 6321 jQuery2.holdReady = function(hold) { 6322 if (hold) { 6323 jQuery2.readyWait++; 6324 } else { 6325 jQuery2.ready(true); 6326 } 6327 }; 6328 jQuery2.isArray = Array.isArray; 6329 jQuery2.parseJSON = JSON.parse; 6330 jQuery2.nodeName = nodeName; 6331 jQuery2.isFunction = isFunction2; 6332 jQuery2.isWindow = isWindow; 6333 jQuery2.camelCase = camelCase; 6334 jQuery2.type = toType; 6335 jQuery2.now = Date.now; 6336 jQuery2.isNumeric = function(obj) { 6337 var type = jQuery2.type(obj); 6338 return (type === "number" || type === "string") && // parseFloat NaNs numeric-cast false positives ("") 6339 // ...but misinterprets leading-number strings, particularly hex literals ("0x...") 6340 // subtraction forces infinities to NaN 6341 !isNaN(obj - parseFloat(obj)); 6342 }; 6343 jQuery2.trim = function(text) { 6344 return text == null ? "" : (text + "").replace(rtrim, "$1"); 6345 }; 6346 if (typeof define === "function" && define.amd) { 6347 define("jquery", [], function() { 6348 return jQuery2; 6349 }); 6350 } 6351 var _jQuery = window2.jQuery, _$ = window2.$; 6352 jQuery2.noConflict = function(deep) { 6353 if (window2.$ === jQuery2) { 6354 window2.$ = _$; 6355 } 6356 if (deep && window2.jQuery === jQuery2) { 6357 window2.jQuery = _jQuery; 6358 } 6359 return jQuery2; 6360 }; 6361 if (typeof noGlobal === "undefined") { 6362 window2.jQuery = window2.$ = jQuery2; 6363 } 6364 return jQuery2; 6365 }); 6366 } 6367 }); 6368 6369
vendor: 55,408 bytes, lines 6369-7580
6369// node_modules/jquery-validation/dist/jquery.validate.js 6370 var require_jquery_validate = __commonJS({ 6371 "node_modules/jquery-validation/dist/jquery.validate.js"(exports, module) { 6372 (function(factory) { 6373 if (typeof define === "function" && define.amd) { 6374 define(["jquery"], factory); 6375 } else if (typeof module === "object" && module.exports) { 6376 module.exports = factory(require_jquery()); 6377 } else { 6378 factory(jQuery); 6379 } 6380 })(function($27) { 6381 $27.extend($27.fn, { 6382 // https://jqueryvalidation.org/validate/ 6383 validate: function(options) { 6384 if (!this.length) { 6385 if (options && options.debug && window.console) { 6386 console.warn("Nothing selected, can't validate, returning nothing."); 6387 } 6388 return; 6389 } 6390 var validator = $27.data(this[0], "validator"); 6391 if (validator) { 6392 return validator; 6393 } 6394 this.attr("novalidate", "novalidate"); 6395 validator = new $27.validator(options, this[0]); 6396 $27.data(this[0], "validator", validator); 6397 if (validator.settings.onsubmit) { 6398 this.on("click.validate", ":submit", function(event) { 6399 validator.submitButton = event.currentTarget; 6400 if ($27(this).hasClass("cancel")) { 6401 validator.cancelSubmit = true; 6402 } 6403 if ($27(this).attr("formnovalidate") !== void 0) { 6404 validator.cancelSubmit = true; 6405 } 6406 }); 6407 this.on("submit.validate", function(event) { 6408 if (validator.settings.debug) { 6409 event.preventDefault(); 6410 } 6411 function handle2() { 6412 var hidden, result; 6413 if (validator.submitButton && (validator.settings.submitHandler || validator.formSubmitted)) { 6414 hidden = $27("<input type='hidden'/>").attr("name", validator.submitButton.name).val($27(validator.submitButton).val()).appendTo(validator.currentForm); 6415 } 6416 if (validator.settings.submitHandler && !validator.settings.debug) { 6417 result = validator.settings.submitHandler.call(validator, validator.currentForm, event); 6418 if (hidden) { 6419 hidden.remove(); 6420 } 6421 if (result !== void 0) { 6422 return result; 6423 } 6424 return false; 6425 } 6426 return true; 6427 } 6428 if (validator.cancelSubmit) { 6429 validator.cancelSubmit = false; 6430 return handle2(); 6431 } 6432 if (validator.form()) { 6433 if (validator.pendingRequest) { 6434 validator.formSubmitted = true; 6435 return false; 6436 } 6437 return handle2(); 6438 } else { 6439 validator.focusInvalid(); 6440 return false; 6441 } 6442 }); 6443 } 6444 return validator; 6445 }, 6446 // https://jqueryvalidation.org/valid/ 6447 valid: function() { 6448 var valid, validator, errorList; 6449 if ($27(this[0]).is("form")) { 6450 valid = this.validate().form(); 6451 } else { 6452 errorList = []; 6453 valid = true; 6454 validator = $27(this[0].form).validate(); 6455 this.each(function() { 6456 valid = validator.element(this) && valid; 6457 if (!valid) { 6458 errorList = errorList.concat(validator.errorList); 6459 } 6460 }); 6461 validator.errorList = errorList; 6462 } 6463 return valid; 6464 }, 6465 // https://jqueryvalidation.org/rules/ 6466 rules: function(command, argument) { 6467 var element = this[0], isContentEditable = typeof this.attr("contenteditable") !== "undefined" && this.attr("contenteditable") !== "false", settings2, staticRules, existingRules, data, param, filtered; 6468 if (element == null) { 6469 return; 6470 } 6471 if (!element.form && isContentEditable) { 6472 element.form = this.closest("form")[0]; 6473 element.name = this.attr("name"); 6474 } 6475 if (element.form == null) { 6476 return; 6477 } 6478 if (command) { 6479 settings2 = $27.data(element.form, "validator").settings; 6480 staticRules = settings2.rules; 6481 existingRules = $27.validator.staticRules(element); 6482 switch (command) { 6483 case "add": 6484 $27.extend(existingRules, $27.validator.normalizeRule(argument)); 6485 delete existingRules.messages; 6486 staticRules[element.name] = existingRules; 6487 if (argument.messages) { 6488 settings2.messages[element.name] = $27.extend(settings2.messages[element.name], argument.messages); 6489 } 6490 break; 6491 case "remove": 6492 if (!argument) { 6493 delete staticRules[element.name]; 6494 return existingRules; 6495 } 6496 filtered = {}; 6497 $27.each(argument.split(/\s/), function(index, method) { 6498 filtered[method] = existingRules[method]; 6499 delete existingRules[method]; 6500 }); 6501 return filtered; 6502 } 6503 } 6504 data = $27.validator.normalizeRules( 6505 $27.extend( 6506 {}, 6507 $27.validator.classRules(element), 6508 $27.validator.attributeRules(element), 6509 $27.validator.dataRules(element), 6510 $27.validator.staticRules(element) 6511 ), 6512 element 6513 ); 6514 if (data.required) { 6515 param = data.required; 6516 delete data.required; 6517 data = $27.extend({ required: param }, data); 6518 } 6519 if (data.remote) { 6520 param = data.remote; 6521 delete data.remote; 6522 data = $27.extend(data, { remote: param }); 6523 } 6524 return data; 6525 } 6526 }); 6527 var trim = function(str) { 6528 return str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ""); 6529 }; 6530 $27.extend($27.expr.pseudos || $27.expr[":"], { 6531 // '|| $.expr[ ":" ]' here enables backwards compatibility to jQuery 1.7. Can be removed when dropping jQ 1.7.x support 6532 // https://jqueryvalidation.org/blank-selector/ 6533 blank: function(a) { 6534 return !trim("" + $27(a).val()); 6535 }, 6536 // https://jqueryvalidation.org/filled-selector/ 6537 filled: function(a) { 6538 var val = $27(a).val(); 6539 return val !== null && !!trim("" + val); 6540 }, 6541 // https://jqueryvalidation.org/unchecked-selector/ 6542 unchecked: function(a) { 6543 return !$27(a).prop("checked"); 6544 } 6545 }); 6546 $27.validator = function(options, form) { 6547 this.settings = $27.extend(true, {}, $27.validator.defaults, options); 6548 this.currentForm = form; 6549 this.init(); 6550 }; 6551 $27.validator.format = function(source, params) { 6552 if (arguments.length === 1) { 6553 return function() { 6554 var args = $27.makeArray(arguments); 6555 args.unshift(source); 6556 return $27.validator.format.apply(this, args); 6557 }; 6558 } 6559 if (params === void 0) { 6560 return source; 6561 } 6562 if (arguments.length > 2 && params.constructor !== Array) { 6563 params = $27.makeArray(arguments).slice(1); 6564 } 6565 if (params.constructor !== Array) { 6566 params = [params]; 6567 } 6568 $27.each(params, function(i, n) { 6569 source = source.replace(new RegExp("\\{" + i + "\\}", "g"), function() { 6570 return n; 6571 }); 6572 }); 6573 return source; 6574 }; 6575 $27.extend($27.validator, { 6576 defaults: { 6577 messages: {}, 6578 groups: {}, 6579 rules: {}, 6580 errorClass: "error", 6581 pendingClass: "pending", 6582 validClass: "valid", 6583 errorElement: "label", 6584 focusCleanup: false, 6585 focusInvalid: true, 6586 errorContainer: $27([]), 6587 errorLabelContainer: $27([]), 6588 onsubmit: true, 6589 ignore: ":hidden", 6590 ignoreTitle: false, 6591 onfocusin: function(element) { 6592 this.lastActive = element; 6593 if (this.settings.focusCleanup) { 6594 if (this.settings.unhighlight) { 6595 this.settings.unhighlight.call(this, element, this.settings.errorClass, this.settings.validClass); 6596 } 6597 this.hideThese(this.errorsFor(element)); 6598 } 6599 }, 6600 onfocusout: function(element) { 6601 if (!this.checkable(element) && (element.name in this.submitted || !this.optional(element))) { 6602 this.element(element); 6603 } 6604 }, 6605 onkeyup: function(element, event) { 6606 var excludedKeys = [ 6607 16, 6608 17, 6609 18, 6610 20, 6611 35, 6612 36, 6613 37, 6614 38, 6615 39, 6616 40, 6617 45, 6618 144, 6619 225 6620 ]; 6621 if (event.which === 9 && this.elementValue(element) === "" || $27.inArray(event.keyCode, excludedKeys) !== -1) { 6622 return; 6623 } else if (element.name in this.submitted || element.name in this.invalid) { 6624 this.element(element); 6625 } 6626 }, 6627 onclick: function(element) { 6628 if (element.name in this.submitted) { 6629 this.element(element); 6630 } else if (element.parentNode.name in this.submitted) { 6631 this.element(element.parentNode); 6632 } 6633 }, 6634 highlight: function(element, errorClass, validClass) { 6635 if (element.type === "radio") { 6636 this.findByName(element.name).addClass(errorClass).removeClass(validClass); 6637 } else { 6638 $27(element).addClass(errorClass).removeClass(validClass); 6639 } 6640 }, 6641 unhighlight: function(element, errorClass, validClass) { 6642 if (element.type === "radio") { 6643 this.findByName(element.name).removeClass(errorClass).addClass(validClass); 6644 } else { 6645 $27(element).removeClass(errorClass).addClass(validClass); 6646 } 6647 } 6648 }, 6649 // https://jqueryvalidation.org/jQuery.validator.setDefaults/ 6650 setDefaults: function(settings2) { 6651 $27.extend($27.validator.defaults, settings2); 6652 }, 6653 messages: { 6654 required: "This field is required.", 6655 remote: "Please fix this field.", 6656 email: "Please enter a valid email address.", 6657 url: "Please enter a valid URL.", 6658 date: "Please enter a valid date.", 6659 dateISO: "Please enter a valid date (ISO).", 6660 number: "Please enter a valid number.", 6661 digits: "Please enter only digits.", 6662 equalTo: "Please enter the same value again.", 6663 maxlength: $27.validator.format("Please enter no more than {0} characters."), 6664 minlength: $27.validator.format("Please enter at least {0} characters."), 6665 rangelength: $27.validator.format("Please enter a value between {0} and {1} characters long."), 6666 range: $27.validator.format("Please enter a value between {0} and {1}."), 6667 max: $27.validator.format("Please enter a value less than or equal to {0}."), 6668 min: $27.validator.format("Please enter a value greater than or equal to {0}."), 6669 step: $27.validator.format("Please enter a multiple of {0}.") 6670 }, 6671 autoCreateRanges: false, 6672 prototype: { 6673 init: function() { 6674 this.labelContainer = $27(this.settings.errorLabelContainer); 6675 this.errorContext = this.labelContainer.length && this.labelContainer || $27(this.currentForm); 6676 this.containers = $27(this.settings.errorContainer).add(this.settings.errorLabelContainer); 6677 this.submitted = {}; 6678 this.valueCache = {}; 6679 this.pendingRequest = 0; 6680 this.pending = {}; 6681 this.invalid = {}; 6682 this.reset(); 6683 var currentForm = this.currentForm, groups = this.groups = {}, rules; 6684 $27.each(this.settings.groups, function(key, value) { 6685 if (typeof value === "string") { 6686 value = value.split(/\s/); 6687 } 6688 $27.each(value, function(index, name) { 6689 groups[name] = key; 6690 }); 6691 }); 6692 rules = this.settings.rules; 6693 $27.each(rules, function(key, value) { 6694 rules[key] = $27.validator.normalizeRule(value); 6695 }); 6696 function delegate(event) { 6697 var isContentEditable = typeof $27(this).attr("contenteditable") !== "undefined" && $27(this).attr("contenteditable") !== "false"; 6698 if (!this.form && isContentEditable) { 6699 this.form = $27(this).closest("form")[0]; 6700 this.name = $27(this).attr("name"); 6701 } 6702 if (currentForm !== this.form) { 6703 return; 6704 } 6705 var validator = $27.data(this.form, "validator"), eventType = "on" + event.type.replace(/^validate/, ""), settings2 = validator.settings; 6706 if (settings2[eventType] && !$27(this).is(settings2.ignore)) { 6707 settings2[eventType].call(validator, this, event); 6708 } 6709 } 6710 $27(this.currentForm).on( 6711 "focusin.validate focusout.validate keyup.validate", 6712 ":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], [type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], [type='radio'], [type='checkbox'], [contenteditable], [type='button']", 6713 delegate 6714 ).on("click.validate", "select, option, [type='radio'], [type='checkbox']", delegate); 6715 if (this.settings.invalidHandler) { 6716 $27(this.currentForm).on("invalid-form.validate", this.settings.invalidHandler); 6717 } 6718 }, 6719 // https://jqueryvalidation.org/Validator.form/ 6720 form: function() { 6721 this.checkForm(); 6722 $27.extend(this.submitted, this.errorMap); 6723 this.invalid = $27.extend({}, this.errorMap); 6724 if (!this.valid()) { 6725 $27(this.currentForm).triggerHandler("invalid-form", [this]); 6726 } 6727 this.showErrors(); 6728 return this.valid(); 6729 }, 6730 checkForm: function() { 6731 this.prepareForm(); 6732 for (var i = 0, elements2 = this.currentElements = this.elements(); elements2[i]; i++) { 6733 this.check(elements2[i]); 6734 } 6735 return this.valid(); 6736 }, 6737 // https://jqueryvalidation.org/Validator.element/ 6738 element: function(element) { 6739 var cleanElement = this.clean(element), checkElement = this.validationTargetFor(cleanElement), v = this, result = true, rs, group; 6740 if (checkElement === void 0) { 6741 delete this.invalid[cleanElement.name]; 6742 } else { 6743 this.prepareElement(checkElement); 6744 this.currentElements = $27(checkElement); 6745 group = this.groups[checkElement.name]; 6746 if (group) { 6747 $27.each(this.groups, function(name, testgroup) { 6748 if (testgroup === group && name !== checkElement.name) { 6749 cleanElement = v.validationTargetFor(v.clean(v.findByName(name))); 6750 if (cleanElement && cleanElement.name in v.invalid) { 6751 v.currentElements.push(cleanElement); 6752 result = v.check(cleanElement) && result; 6753 } 6754 } 6755 }); 6756 } 6757 rs = this.check(checkElement) !== false; 6758 result = result && rs; 6759 if (rs) { 6760 this.invalid[checkElement.name] = false; 6761 } else { 6762 this.invalid[checkElement.name] = true; 6763 } 6764 if (!this.numberOfInvalids()) { 6765 this.toHide = this.toHide.add(this.containers); 6766 } 6767 this.showErrors(); 6768 $27(element).attr("aria-invalid", !rs); 6769 } 6770 return result; 6771 }, 6772 // https://jqueryvalidation.org/Validator.showErrors/ 6773 showErrors: function(errors) { 6774 if (errors) { 6775 var validator = this; 6776 $27.extend(this.errorMap, errors); 6777 this.errorList = $27.map(this.errorMap, function(message, name) { 6778 return { 6779 message, 6780 element: validator.findByName(name)[0] 6781 }; 6782 }); 6783 this.successList = $27.grep(this.successList, function(element) { 6784 return !(element.name in errors); 6785 }); 6786 } 6787 if (this.settings.showErrors) { 6788 this.settings.showErrors.call(this, this.errorMap, this.errorList); 6789 } else { 6790 this.defaultShowErrors(); 6791 } 6792 }, 6793 // https://jqueryvalidation.org/Validator.resetForm/ 6794 resetForm: function() { 6795 if ($27.fn.resetForm) { 6796 $27(this.currentForm).resetForm(); 6797 } 6798 this.invalid = {}; 6799 this.submitted = {}; 6800 this.prepareForm(); 6801 this.hideErrors(); 6802 var elements2 = this.elements().removeData("previousValue").removeAttr("aria-invalid"); 6803 this.resetElements(elements2); 6804 }, 6805 resetElements: function(elements2) { 6806 var i; 6807 if (this.settings.unhighlight) { 6808 for (i = 0; elements2[i]; i++) { 6809 this.settings.unhighlight.call( 6810 this, 6811 elements2[i], 6812 this.settings.errorClass, 6813 "" 6814 ); 6815 this.findByName(elements2[i].name).removeClass(this.settings.validClass); 6816 } 6817 } else { 6818 elements2.removeClass(this.settings.errorClass).removeClass(this.settings.validClass); 6819 } 6820 }, 6821 numberOfInvalids: function() { 6822 return this.objectLength(this.invalid); 6823 }, 6824 objectLength: function(obj) { 6825 var count = 0, i; 6826 for (i in obj) { 6827 if (obj[i] !== void 0 && obj[i] !== null && obj[i] !== false) { 6828 count++; 6829 } 6830 } 6831 return count; 6832 }, 6833 hideErrors: function() { 6834 this.hideThese(this.toHide); 6835 }, 6836 hideThese: function(errors) { 6837 errors.not(this.containers).text(""); 6838 this.addWrapper(errors).hide(); 6839 }, 6840 valid: function() { 6841 return this.size() === 0; 6842 }, 6843 size: function() { 6844 return this.errorList.length; 6845 }, 6846 focusInvalid: function() { 6847 if (this.settings.focusInvalid) { 6848 try { 6849 $27(this.findLastActive() || this.errorList.length && this.errorList[0].element || []).filter(":visible").trigger("focus").trigger("focusin"); 6850 } catch (e2) { 6851 } 6852 } 6853 }, 6854 findLastActive: function() { 6855 var lastActive = this.lastActive; 6856 return lastActive && $27.grep(this.errorList, function(n) { 6857 return n.element.name === lastActive.name; 6858 }).length === 1 && lastActive; 6859 }, 6860 elements: function() { 6861 var validator = this, rulesCache = {}; 6862 return $27(this.currentForm).find("input, select, textarea, [contenteditable]").not(":submit, :reset, :image, :disabled").not(this.settings.ignore).filter(function() { 6863 var name = this.name || $27(this).attr("name"); 6864 var isContentEditable = typeof $27(this).attr("contenteditable") !== "undefined" && $27(this).attr("contenteditable") !== "false"; 6865 if (!name && validator.settings.debug && window.console) { 6866 console.error("%o has no name assigned", this); 6867 } 6868 if (isContentEditable) { 6869 this.form = $27(this).closest("form")[0]; 6870 this.name = name; 6871 } 6872 if (this.form !== validator.currentForm) { 6873 return false; 6874 } 6875 if (name in rulesCache || !validator.objectLength($27(this).rules())) { 6876 return false; 6877 } 6878 rulesCache[name] = true; 6879 return true; 6880 }); 6881 }, 6882 clean: function(selector) { 6883 return $27(selector)[0]; 6884 }, 6885 errors: function() { 6886 var errorClass = this.settings.errorClass.split(" ").join("."); 6887 return $27(this.settings.errorElement + "." + errorClass, this.errorContext); 6888 }, 6889 resetInternals: function() { 6890 this.successList = []; 6891 this.errorList = []; 6892 this.errorMap = {}; 6893 this.toShow = $27([]); 6894 this.toHide = $27([]); 6895 }, 6896 reset: function() { 6897 this.resetInternals(); 6898 this.currentElements = $27([]); 6899 }, 6900 prepareForm: function() { 6901 this.reset(); 6902 this.toHide = this.errors().add(this.containers); 6903 }, 6904 prepareElement: function(element) { 6905 this.reset(); 6906 this.toHide = this.errorsFor(element); 6907 }, 6908 elementValue: function(element) { 6909 var $element = $27(element), type = element.type, isContentEditable = typeof $element.attr("contenteditable") !== "undefined" && $element.attr("contenteditable") !== "false", val, idx; 6910 if (type === "radio" || type === "checkbox") { 6911 return this.findByName(element.name).filter(":checked").val(); 6912 } else if (type === "number" && typeof element.validity !== "undefined") { 6913 return element.validity.badInput ? "NaN" : $element.val(); 6914 } 6915 if (isContentEditable) { 6916 val = $element.text(); 6917 } else { 6918 val = $element.val(); 6919 } 6920 if (type === "file") { 6921 if (val.substr(0, 12) === "C:\\fakepath\\") { 6922 return val.substr(12); 6923 } 6924 idx = val.lastIndexOf("/"); 6925 if (idx >= 0) { 6926 return val.substr(idx + 1); 6927 } 6928 idx = val.lastIndexOf("\\"); 6929 if (idx >= 0) { 6930 return val.substr(idx + 1); 6931 } 6932 return val; 6933 } 6934 if (typeof val === "string") { 6935 return val.replace(/\r/g, ""); 6936 } 6937 return val; 6938 }, 6939 check: function(element) { 6940 element = this.validationTargetFor(this.clean(element)); 6941 var rules = $27(element).rules(), rulesCount = $27.map(rules, function(n, i) { 6942 return i; 6943 }).length, dependencyMismatch = false, val = this.elementValue(element), result, method, rule, normalizer; 6944 if (typeof rules.normalizer === "function") { 6945 normalizer = rules.normalizer; 6946 } else if (typeof this.settings.normalizer === "function") { 6947 normalizer = this.settings.normalizer; 6948 } 6949 if (normalizer) { 6950 val = normalizer.call(element, val); 6951 delete rules.normalizer; 6952 } 6953 for (method in rules) { 6954 rule = { method, parameters: rules[method] }; 6955 try { 6956 result = $27.validator.methods[method].call(this, val, element, rule.parameters); 6957 if (result === "dependency-mismatch" && rulesCount === 1) { 6958 dependencyMismatch = true; 6959 continue; 6960 } 6961 dependencyMismatch = false; 6962 if (result === "pending") { 6963 this.toHide = this.toHide.not(this.errorsFor(element)); 6964 return; 6965 } 6966 if (!result) { 6967 this.formatAndAdd(element, rule); 6968 return false; 6969 } 6970 } catch (e2) { 6971 if (this.settings.debug && window.console) { 6972 console.log("Exception occurred when checking element " + element.id + ", check the '" + rule.method + "' method.", e2); 6973 } 6974 if (e2 instanceof TypeError) { 6975 e2.message += ". Exception occurred when checking element " + element.id + ", check the '" + rule.method + "' method."; 6976 } 6977 throw e2; 6978 } 6979 } 6980 if (dependencyMismatch) { 6981 return; 6982 } 6983 if (this.objectLength(rules)) { 6984 this.successList.push(element); 6985 } 6986 return true; 6987 }, 6988 // Return the custom message for the given element and validation method 6989 // specified in the element's HTML5 data attribute 6990 // return the generic message if present and no method specific message is present 6991 customDataMessage: function(element, method) { 6992 return $27(element).data("msg" + method.charAt(0).toUpperCase() + method.substring(1).toLowerCase()) || $27(element).data("msg"); 6993 }, 6994 // Return the custom message for the given element name and validation method 6995 customMessage: function(name, method) { 6996 var m = this.settings.messages[name]; 6997 return m && (m.constructor === String ? m : m[method]); 6998 }, 6999 // Return the first defined argument, allowing empty strings 7000 findDefined: function() { 7001 for (var i = 0; i < arguments.length; i++) { 7002 if (arguments[i] !== void 0) { 7003 return arguments[i]; 7004 } 7005 } 7006 return void 0; 7007 }, 7008 // The second parameter 'rule' used to be a string, and extended to an object literal 7009 // of the following form: 7010 // rule = { 7011 // method: "method name", 7012 // parameters: "the given method parameters" 7013 // } 7014 // 7015 // The old behavior still supported, kept to maintain backward compatibility with 7016 // old code, and will be removed in the next major release. 7017 defaultMessage: function(element, rule) { 7018 if (typeof rule === "string") { 7019 rule = { method: rule }; 7020 } 7021 var message = this.findDefined( 7022 this.customMessage(element.name, rule.method), 7023 this.customDataMessage(element, rule.method), 7024 // 'title' is never undefined, so handle empty string as undefined 7025 !this.settings.ignoreTitle && element.title || void 0, 7026 $27.validator.messages[rule.method], 7027 "<strong>Warning: No message defined for " + element.name + "</strong>" 7028 ), theregex = /\$?\{(\d+)\}/g; 7029 if (typeof message === "function") { 7030 message = message.call(this, rule.parameters, element); 7031 } else if (theregex.test(message)) { 7032 message = $27.validator.format(message.replace(theregex, "{$1}"), rule.parameters); 7033 } 7034 return message; 7035 }, 7036 formatAndAdd: function(element, rule) { 7037 var message = this.defaultMessage(element, rule); 7038 this.errorList.push({ 7039 message, 7040 element, 7041 method: rule.method 7042 }); 7043 this.errorMap[element.name] = message; 7044 this.submitted[element.name] = message; 7045 }, 7046 addWrapper: function(toToggle) { 7047 if (this.settings.wrapper) { 7048 toToggle = toToggle.add(toToggle.parent(this.settings.wrapper)); 7049 } 7050 return toToggle; 7051 }, 7052 defaultShowErrors: function() { 7053 var i, elements2, error2; 7054 for (i = 0; this.errorList[i]; i++) { 7055 error2 = this.errorList[i]; 7056 if (this.settings.highlight) { 7057 this.settings.highlight.call(this, error2.element, this.settings.errorClass, this.settings.validClass); 7058 } 7059 this.showLabel(error2.element, error2.message); 7060 } 7061 if (this.errorList.length) { 7062 this.toShow = this.toShow.add(this.containers); 7063 } 7064 if (this.settings.success) { 7065 for (i = 0; this.successList[i]; i++) { 7066 this.showLabel(this.successList[i]); 7067 } 7068 } 7069 if (this.settings.unhighlight) { 7070 for (i = 0, elements2 = this.validElements(); elements2[i]; i++) { 7071 this.settings.unhighlight.call(this, elements2[i], this.settings.errorClass, this.settings.validClass); 7072 } 7073 } 7074 this.toHide = this.toHide.not(this.toShow); 7075 this.hideErrors(); 7076 this.addWrapper(this.toShow).show(); 7077 }, 7078 validElements: function() { 7079 return this.currentElements.not(this.invalidElements()); 7080 }, 7081 invalidElements: function() { 7082 return $27(this.errorList).map(function() { 7083 return this.element; 7084 }); 7085 }, 7086 showLabel: function(element, message) { 7087 var place, group, errorID, v, error2 = this.errorsFor(element), elementID = this.idOrName(element), describedBy = $27(element).attr("aria-describedby"); 7088 if (error2.length) { 7089 error2.removeClass(this.settings.validClass).addClass(this.settings.errorClass); 7090 error2.html(message); 7091 } else { 7092 error2 = $27("<" + this.settings.errorElement + ">").attr("id", elementID + "-error").addClass(this.settings.errorClass).html(message || ""); 7093 place = error2; 7094 if (this.settings.wrapper) { 7095 place = error2.hide().show().wrap("<" + this.settings.wrapper + "/>").parent(); 7096 } 7097 if (this.labelContainer.length) { 7098 this.labelContainer.append(place); 7099 } else if (this.settings.errorPlacement) { 7100 this.settings.errorPlacement.call(this, place, $27(element)); 7101 } else { 7102 place.insertAfter(element); 7103 } 7104 if (error2.is("label")) { 7105 error2.attr("for", elementID); 7106 } else if (error2.parents("label[for='" + this.escapeCssMeta(elementID) + "']").length === 0) { 7107 errorID = error2.attr("id"); 7108 if (!describedBy) { 7109 describedBy = errorID; 7110 } else if (!describedBy.match(new RegExp("\\b" + this.escapeCssMeta(errorID) + "\\b"))) { 7111 describedBy += " " + errorID; 7112 } 7113 $27(element).attr("aria-describedby", describedBy); 7114 group = this.groups[element.name]; 7115 if (group) { 7116 v = this; 7117 $27.each(v.groups, function(name, testgroup) { 7118 if (testgroup === group) { 7119 $27("[name='" + v.escapeCssMeta(name) + "']", v.currentForm).attr("aria-describedby", error2.attr("id")); 7120 } 7121 }); 7122 } 7123 } 7124 } 7125 if (!message && this.settings.success) { 7126 error2.text(""); 7127 if (typeof this.settings.success === "string") { 7128 error2.addClass(this.settings.success); 7129 } else { 7130 this.settings.success(error2, element); 7131 } 7132 } 7133 this.toShow = this.toShow.add(error2); 7134 }, 7135 errorsFor: function(element) { 7136 var name = this.escapeCssMeta(this.idOrName(element)), describer = $27(element).attr("aria-describedby"), selector = "label[for='" + name + "'], label[for='" + name + "'] *"; 7137 if (describer) { 7138 selector = selector + ", #" + this.escapeCssMeta(describer).replace(/\s+/g, ", #"); 7139 } 7140 return this.errors().filter(selector); 7141 }, 7142 // See https://api.jquery.com/category/selectors/, for CSS 7143 // meta-characters that should be escaped in order to be used with JQuery 7144 // as a literal part of a name/id or any selector. 7145 escapeCssMeta: function(string) { 7146 if (string === void 0) { 7147 return ""; 7148 } 7149 return string.replace(/([\\!"#$%&'()*+,./:;<=>?@\[\]^`{|}~])/g, "\\$1"); 7150 }, 7151 idOrName: function(element) { 7152 return this.groups[element.name] || (this.checkable(element) ? element.name : element.id || element.name); 7153 }, 7154 validationTargetFor: function(element) { 7155 if (this.checkable(element)) { 7156 element = this.findByName(element.name); 7157 } 7158 return $27(element).not(this.settings.ignore)[0]; 7159 }, 7160 checkable: function(element) { 7161 return /radio|checkbox/i.test(element.type); 7162 }, 7163 findByName: function(name) { 7164 return $27(this.currentForm).find("[name='" + this.escapeCssMeta(name) + "']"); 7165 }, 7166 getLength: function(value, element) { 7167 switch (element.nodeName.toLowerCase()) { 7168 case "select": 7169 return $27("option:selected", element).length; 7170 case "input": 7171 if (this.checkable(element)) { 7172 return this.findByName(element.name).filter(":checked").length; 7173 } 7174 } 7175 return value.length; 7176 }, 7177 depend: function(param, element) { 7178 return this.dependTypes[typeof param] ? this.dependTypes[typeof param](param, element) : true; 7179 }, 7180 dependTypes: { 7181 "boolean": function(param) { 7182 return param; 7183 }, 7184 "string": function(param, element) { 7185 return !!$27(param, element.form).length; 7186 }, 7187 "function": function(param, element) { 7188 return param(element); 7189 } 7190 }, 7191 optional: function(element) { 7192 var val = this.elementValue(element); 7193 return !$27.validator.methods.required.call(this, val, element) && "dependency-mismatch"; 7194 }, 7195 startRequest: function(element) { 7196 if (!this.pending[element.name]) { 7197 this.pendingRequest++; 7198 $27(element).addClass(this.settings.pendingClass); 7199 this.pending[element.name] = true; 7200 } 7201 }, 7202 stopRequest: function(element, valid) { 7203 this.pendingRequest--; 7204 if (this.pendingRequest < 0) { 7205 this.pendingRequest = 0; 7206 } 7207 delete this.pending[element.name]; 7208 $27(element).removeClass(this.settings.pendingClass); 7209 if (valid && this.pendingRequest === 0 && this.formSubmitted && this.form() && this.pendingRequest === 0) { 7210 $27(this.currentForm).trigger("submit"); 7211 if (this.submitButton) { 7212 $27("input:hidden[name='" + this.submitButton.name + "']", this.currentForm).remove(); 7213 } 7214 this.formSubmitted = false; 7215 } else if (!valid && this.pendingRequest === 0 && this.formSubmitted) { 7216 $27(this.currentForm).triggerHandler("invalid-form", [this]); 7217 this.formSubmitted = false; 7218 } 7219 }, 7220 previousValue: function(element, method) { 7221 method = typeof method === "string" && method || "remote"; 7222 return $27.data(element, "previousValue") || $27.data(element, "previousValue", { 7223 old: null, 7224 valid: true, 7225 message: this.defaultMessage(element, { method }) 7226 }); 7227 }, 7228 // Cleans up all forms and elements, removes validator-specific events 7229 destroy: function() { 7230 this.resetForm(); 7231 $27(this.currentForm).off(".validate").removeData("validator").find(".validate-equalTo-blur").off(".validate-equalTo").removeClass("validate-equalTo-blur").find(".validate-lessThan-blur").off(".validate-lessThan").removeClass("validate-lessThan-blur").find(".validate-lessThanEqual-blur").off(".validate-lessThanEqual").removeClass("validate-lessThanEqual-blur").find(".validate-greaterThanEqual-blur").off(".validate-greaterThanEqual").removeClass("validate-greaterThanEqual-blur").find(".validate-greaterThan-blur").off(".validate-greaterThan").removeClass("validate-greaterThan-blur"); 7232 } 7233 }, 7234 classRuleSettings: { 7235 required: { required: true }, 7236 email: { email: true }, 7237 url: { url: true }, 7238 date: { date: true }, 7239 dateISO: { dateISO: true }, 7240 number: { number: true }, 7241 digits: { digits: true }, 7242 creditcard: { creditcard: true } 7243 }, 7244 addClassRules: function(className, rules) { 7245 if (className.constructor === String) { 7246 this.classRuleSettings[className] = rules; 7247 } else { 7248 $27.extend(this.classRuleSettings, className); 7249 } 7250 }, 7251 classRules: function(element) { 7252 var rules = {}, classes = $27(element).attr("class"); 7253 if (classes) { 7254 $27.each(classes.split(" "), function() { 7255 if (this in $27.validator.classRuleSettings) { 7256 $27.extend(rules, $27.validator.classRuleSettings[this]); 7257 } 7258 }); 7259 } 7260 return rules; 7261 }, 7262 normalizeAttributeRule: function(rules, type, method, value) { 7263 if (/min|max|step/.test(method) && (type === null || /number|range|text/.test(type))) { 7264 value = Number(value); 7265 if (isNaN(value)) { 7266 value = void 0; 7267 } 7268 } 7269 if (value || value === 0) { 7270 rules[method] = value; 7271 } else if (type === method && type !== "range") { 7272 rules[type === "date" ? "dateISO" : method] = true; 7273 } 7274 }, 7275 attributeRules: function(element) { 7276 var rules = {}, $element = $27(element), type = element.getAttribute("type"), method, value; 7277 for (method in $27.validator.methods) { 7278 if (method === "required") { 7279 value = element.getAttribute(method); 7280 if (value === "") { 7281 value = true; 7282 } 7283 value = !!value; 7284 } else { 7285 value = $element.attr(method); 7286 } 7287 this.normalizeAttributeRule(rules, type, method, value); 7288 } 7289 if (rules.maxlength && /-1|2147483647|524288/.test(rules.maxlength)) { 7290 delete rules.maxlength; 7291 } 7292 return rules; 7293 }, 7294 dataRules: function(element) { 7295 var rules = {}, $element = $27(element), type = element.getAttribute("type"), method, value; 7296 for (method in $27.validator.methods) { 7297 value = $element.data("rule" + method.charAt(0).toUpperCase() + method.substring(1).toLowerCase()); 7298 if (value === "") { 7299 value = true; 7300 } 7301 this.normalizeAttributeRule(rules, type, method, value); 7302 } 7303 return rules; 7304 }, 7305 staticRules: function(element) { 7306 var rules = {}, validator = $27.data(element.form, "validator"); 7307 if (validator.settings.rules) { 7308 rules = $27.validator.normalizeRule(validator.settings.rules[element.name]) || {}; 7309 } 7310 return rules; 7311 }, 7312 normalizeRules: function(rules, element) { 7313 $27.each(rules, function(prop, val) { 7314 if (val === false) { 7315 delete rules[prop]; 7316 return; 7317 } 7318 if (val.param || val.depends) { 7319 var keepRule = true; 7320 switch (typeof val.depends) { 7321 case "string": 7322 keepRule = !!$27(val.depends, element.form).length; 7323 break; 7324 case "function": 7325 keepRule = val.depends.call(element, element); 7326 break; 7327 } 7328 if (keepRule) { 7329 rules[prop] = val.param !== void 0 ? val.param : true; 7330 } else { 7331 $27.data(element.form, "validator").resetElements($27(element)); 7332 delete rules[prop]; 7333 } 7334 } 7335 }); 7336 $27.each(rules, function(rule, parameter) { 7337 rules[rule] = typeof parameter === "function" && rule !== "normalizer" ? parameter(element) : parameter; 7338 }); 7339 $27.each(["minlength", "maxlength"], function() { 7340 if (rules[this]) { 7341 rules[this] = Number(rules[this]); 7342 } 7343 }); 7344 $27.each(["rangelength", "range"], function() { 7345 var parts; 7346 if (rules[this]) { 7347 if (Array.isArray(rules[this])) { 7348 rules[this] = [Number(rules[this][0]), Number(rules[this][1])]; 7349 } else if (typeof rules[this] === "string") { 7350 parts = rules[this].replace(/[\[\]]/g, "").split(/[\s,]+/); 7351 rules[this] = [Number(parts[0]), Number(parts[1])]; 7352 } 7353 } 7354 }); 7355 if ($27.validator.autoCreateRanges) { 7356 if (rules.min != null && rules.max != null) { 7357 rules.range = [rules.min, rules.max]; 7358 delete rules.min; 7359 delete rules.max; 7360 } 7361 if (rules.minlength != null && rules.maxlength != null) { 7362 rules.rangelength = [rules.minlength, rules.maxlength]; 7363 delete rules.minlength; 7364 delete rules.maxlength; 7365 } 7366 } 7367 return rules; 7368 }, 7369 // Converts a simple string to a {string: true} rule, e.g., "required" to {required:true} 7370 normalizeRule: function(data) { 7371 if (typeof data === "string") { 7372 var transformed = {}; 7373 $27.each(data.split(/\s/), function() { 7374 transformed[this] = true; 7375 }); 7376 data = transformed; 7377 } 7378 return data; 7379 }, 7380 // https://jqueryvalidation.org/jQuery.validator.addMethod/ 7381 addMethod: function(name, method, message) { 7382 $27.validator.methods[name] = method; 7383 $27.validator.messages[name] = message !== void 0 ? message : $27.validator.messages[name]; 7384 if (method.length < 3) { 7385 $27.validator.addClassRules(name, $27.validator.normalizeRule(name)); 7386 } 7387 }, 7388 // https://jqueryvalidation.org/jQuery.validator.methods/ 7389 methods: { 7390 // https://jqueryvalidation.org/required-method/ 7391 required: function(value, element, param) { 7392 if (!this.depend(param, element)) { 7393 return "dependency-mismatch"; 7394 } 7395 if (element.nodeName.toLowerCase() === "select") { 7396 var val = $27(element).val(); 7397 return val && val.length > 0; 7398 } 7399 if (this.checkable(element)) { 7400 return this.getLength(value, element) > 0; 7401 } 7402 return value !== void 0 && value !== null && value.length > 0; 7403 }, 7404 // https://jqueryvalidation.org/email-method/ 7405 email: function(value, element) { 7406 return this.optional(element) || /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(value); 7407 }, 7408 // https://jqueryvalidation.org/url-method/ 7409 url: function(value, element) { 7410 return this.optional(element) || /^(?:(?:(?:https?|ftp):)?\/\/)(?:(?:[^\]\[?\/<~#`!@$^&*()+=}|:";',>{ ]|%[0-9A-Fa-f]{2})+(?::(?:[^\]\[?\/<~#`!@$^&*()+=}|:";',>{ ]|%[0-9A-Fa-f]{2})*)?@)?(?:(?!(?: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-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(value); 7411 }, 7412 // https://jqueryvalidation.org/date-method/ 7413 date: /* @__PURE__ */ (function() { 7414 var called = false; 7415 return function(value, element) { 7416 if (!called) { 7417 called = true; 7418 if (this.settings.debug && window.console) { 7419 console.warn( 7420 "The `date` method is deprecated and will be removed in version '2.0.0'.\nPlease don't use it, since it relies on the Date constructor, which\nbehaves very differently across browsers and locales. Use `dateISO`\ninstead or one of the locale specific methods in `localizations/`\nand `additional-methods.js`." 7421 ); 7422 } 7423 } 7424 return this.optional(element) || !/Invalid|NaN/.test(new Date(value).toString()); 7425 }; 7426 })(), 7427 // https://jqueryvalidation.org/dateISO-method/ 7428 dateISO: function(value, element) { 7429 return this.optional(element) || /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(value); 7430 }, 7431 // https://jqueryvalidation.org/number-method/ 7432 number: function(value, element) { 7433 return this.optional(element) || /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(value); 7434 }, 7435 // https://jqueryvalidation.org/digits-method/ 7436 digits: function(value, element) { 7437 return this.optional(element) || /^\d+$/.test(value); 7438 }, 7439 // https://jqueryvalidation.org/minlength-method/ 7440 minlength: function(value, element, param) { 7441 var length = Array.isArray(value) ? value.length : this.getLength(value, element); 7442 return this.optional(element) || length >= param; 7443 }, 7444 // https://jqueryvalidation.org/maxlength-method/ 7445 maxlength: function(value, element, param) { 7446 var length = Array.isArray(value) ? value.length : this.getLength(value, element); 7447 return this.optional(element) || length <= param; 7448 }, 7449 // https://jqueryvalidation.org/rangelength-method/ 7450 rangelength: function(value, element, param) { 7451 var length = Array.isArray(value) ? value.length : this.getLength(value, element); 7452 return this.optional(element) || length >= param[0] && length <= param[1]; 7453 }, 7454 // https://jqueryvalidation.org/min-method/ 7455 min: function(value, element, param) { 7456 return this.optional(element) || value >= param; 7457 }, 7458 // https://jqueryvalidation.org/max-method/ 7459 max: function(value, element, param) { 7460 return this.optional(element) || value <= param; 7461 }, 7462 // https://jqueryvalidation.org/range-method/ 7463 range: function(value, element, param) { 7464 return this.optional(element) || value >= param[0] && value <= param[1]; 7465 }, 7466 // https://jqueryvalidation.org/step-method/ 7467 step: function(value, element, param) { 7468 var type = $27(element).attr("type"), errorMessage = "Step attribute on input type " + type + " is not supported.", supportedTypes = ["text", "number", "range"], re = new RegExp("\\b" + type + "\\b"), notSupported = type && !re.test(supportedTypes.join()), decimalPlaces = function(num) { 7469 var match = ("" + num).match(/(?:\.(\d+))?$/); 7470 if (!match) { 7471 return 0; 7472 } 7473 return match[1] ? match[1].length : 0; 7474 }, toInt2 = function(num) { 7475 return Math.round(num * Math.pow(10, decimals)); 7476 }, valid = true, decimals; 7477 if (notSupported) { 7478 throw new Error(errorMessage); 7479 } 7480 decimals = decimalPlaces(param); 7481 if (decimalPlaces(value) > decimals || toInt2(value) % toInt2(param) !== 0) { 7482 valid = false; 7483 } 7484 return this.optional(element) || valid; 7485 }, 7486 // https://jqueryvalidation.org/equalTo-method/ 7487 equalTo: function(value, element, param) { 7488 var target = $27(param); 7489 if (this.settings.onfocusout && target.not(".validate-equalTo-blur").length) { 7490 target.addClass("validate-equalTo-blur").on("blur.validate-equalTo", function() { 7491 $27(element).valid(); 7492 }); 7493 } 7494 return value === target.val(); 7495 }, 7496 // https://jqueryvalidation.org/remote-method/ 7497 remote: function(value, element, param, method) { 7498 if (this.optional(element)) { 7499 return "dependency-mismatch"; 7500 } 7501 method = typeof method === "string" && method || "remote"; 7502 var previous = this.previousValue(element, method), validator, data, optionDataString; 7503 if (!this.settings.messages[element.name]) { 7504 this.settings.messages[element.name] = {}; 7505 } 7506 previous.originalMessage = previous.originalMessage || this.settings.messages[element.name][method]; 7507 this.settings.messages[element.name][method] = previous.message; 7508 param = typeof param === "string" && { url: param } || param; 7509 optionDataString = $27.param($27.extend({ data: value }, param.data)); 7510 if (previous.old === optionDataString) { 7511 return previous.valid; 7512 } 7513 previous.old = optionDataString; 7514 validator = this; 7515 this.startRequest(element); 7516 data = {}; 7517 data[element.name] = value; 7518 $27.ajax($27.extend(true, { 7519 mode: "abort", 7520 port: "validate" + element.name, 7521 dataType: "json", 7522 data, 7523 context: validator.currentForm, 7524 success: function(response) { 7525 var valid = response === true || response === "true", errors, message, submitted; 7526 validator.settings.messages[element.name][method] = previous.originalMessage; 7527 if (valid) { 7528 submitted = validator.formSubmitted; 7529 validator.resetInternals(); 7530 validator.toHide = validator.errorsFor(element); 7531 validator.formSubmitted = submitted; 7532 validator.successList.push(element); 7533 validator.invalid[element.name] = false; 7534 validator.showErrors(); 7535 } else { 7536 errors = {}; 7537 message = response || validator.defaultMessage(element, { method, parameters: value }); 7538 errors[element.name] = previous.message = message; 7539 validator.invalid[element.name] = true; 7540 validator.showErrors(errors); 7541 } 7542 previous.valid = valid; 7543 validator.stopRequest(element, valid); 7544 } 7545 }, param)); 7546 return "pending"; 7547 } 7548 } 7549 }); 7550 var pendingRequests = {}, ajax; 7551 if ($27.ajaxPrefilter) { 7552 $27.ajaxPrefilter(function(settings2, _23, xhr) { 7553 var port = settings2.port; 7554 if (settings2.mode === "abort") { 7555 if (pendingRequests[port]) { 7556 pendingRequests[port].abort(); 7557 } 7558 pendingRequests[port] = xhr; 7559 } 7560 }); 7561 } else { 7562 ajax = $27.ajax; 7563 $27.ajax = function(settings2) { 7564 var mode = ("mode" in settings2 ? settings2 : $27.ajaxSettings).mode, port = ("port" in settings2 ? settings2 : $27.ajaxSettings).port; 7565 if (mode === "abort") { 7566 if (pendingRequests[port]) { 7567 pendingRequests[port].abort(); 7568 } 7569 pendingRequests[port] = ajax.apply(this, arguments); 7570 return pendingRequests[port]; 7571 } 7572 return ajax.apply(this, arguments); 7573 }; 7574 } 7575 return $27; 7576 }); 7577 } 7578 }); 7579 7580
vendor: 66,156 bytes, lines 7580-9104
7580// node_modules/tablesaw/dist/tablesaw.jquery.js 7581 var require_tablesaw_jquery = __commonJS({ 7582 "node_modules/tablesaw/dist/tablesaw.jquery.js"(exports, module) { 7583 (function(root, factory) { 7584 if (typeof define === "function" && define.amd) { 7585 define(["jquery"], function(jQuery2) { 7586 return root.Tablesaw = factory(jQuery2, root); 7587 }); 7588 } else if (typeof exports === "object") { 7589 if ("document" in root) { 7590 module.exports = factory(require_jquery(), root); 7591 } else { 7592 module.exports = factory(require_jquery()(root), root); 7593 } 7594 } else { 7595 root.Tablesaw = factory(jQuery, root); 7596 } 7597 })(typeof window !== "undefined" ? window : exports, function($27, window2) { 7598 "use strict"; 7599 var document2 = window2.document; 7600 var domContentLoadedTriggered = /complete|loaded/.test(document2.readyState); 7601 document2.addEventListener("DOMContentLoaded", function() { 7602 domContentLoadedTriggered = true; 7603 }); 7604 var Tablesaw = { 7605 i18n: { 7606 modeStack: "Stack", 7607 modeSwipe: "Swipe", 7608 modeToggle: "Toggle", 7609 modeSwitchColumnsAbbreviated: "Cols", 7610 modeSwitchColumns: "Columns", 7611 columnToggleButton: "Columns", 7612 columnToggleError: "No eligible columns.", 7613 sort: "Sort", 7614 swipePreviousColumn: "Previous column", 7615 swipeNextColumn: "Next column" 7616 }, 7617 // cut the mustard 7618 mustard: "head" in document2 && // IE9+, Firefox 4+, Safari 5.1+, Mobile Safari 4.1+, Opera 11.5+, Android 2.3+ 7619 (!window2.blackberry || window2.WebKitPoint) && // only WebKit Blackberry (OS 6+) 7620 !window2.operamini, 7621 $: $27, 7622 _init: function(element) { 7623 Tablesaw.$(element || document2).trigger("enhance.tablesaw"); 7624 }, 7625 init: function(element) { 7626 domContentLoadedTriggered = domContentLoadedTriggered || /complete|loaded/.test(document2.readyState); 7627 if (!domContentLoadedTriggered) { 7628 if ("addEventListener" in document2) { 7629 document2.addEventListener("DOMContentLoaded", function() { 7630 Tablesaw._init(element); 7631 }); 7632 } 7633 } else { 7634 Tablesaw._init(element); 7635 } 7636 } 7637 }; 7638 $27(document2).on("enhance.tablesaw", function() { 7639 if (typeof TablesawConfig !== "undefined" && TablesawConfig.i18n) { 7640 Tablesaw.i18n = $27.extend(Tablesaw.i18n, TablesawConfig.i18n || {}); 7641 } 7642 Tablesaw.i18n.modes = [ 7643 Tablesaw.i18n.modeStack, 7644 Tablesaw.i18n.modeSwipe, 7645 Tablesaw.i18n.modeToggle 7646 ]; 7647 }); 7648 if (Tablesaw.mustard) { 7649 $27(document2.documentElement).addClass("tablesaw-enhanced"); 7650 } 7651 (function() { 7652 var pluginName = "tablesaw"; 7653 var classes = { 7654 toolbar: "tablesaw-bar" 7655 }; 7656 var events = { 7657 create: "tablesawcreate", 7658 destroy: "tablesawdestroy", 7659 refresh: "tablesawrefresh", 7660 resize: "tablesawresize" 7661 }; 7662 var defaultMode = "stack"; 7663 var initSelector = "table"; 7664 var initFilterSelector = "[data-tablesaw],[data-tablesaw-mode],[data-tablesaw-sortable]"; 7665 var defaultConfig = {}; 7666 Tablesaw.events = events; 7667 var Table2 = function(element) { 7668 if (!element) { 7669 throw new Error("Tablesaw requires an element."); 7670 } 7671 this.table = element; 7672 this.$table = $27(element); 7673 this.$thead = this.$table.children().filter("thead").eq(0); 7674 this.$tbody = this.$table.children().filter("tbody"); 7675 this.mode = this.$table.attr("data-tablesaw-mode") || defaultMode; 7676 this.$toolbar = null; 7677 this.attributes = { 7678 subrow: "data-tablesaw-subrow", 7679 ignorerow: "data-tablesaw-ignorerow" 7680 }; 7681 this.init(); 7682 }; 7683 Table2.prototype.init = function() { 7684 if (!this.$thead.length) { 7685 throw new Error("tablesaw: a <thead> is required, but none was found."); 7686 } 7687 if (!this.$thead.find("th").length) { 7688 throw new Error("tablesaw: no header cells found. Are you using <th> inside of <thead>?"); 7689 } 7690 if (!this.$table.attr("id")) { 7691 this.$table.attr("id", pluginName + "-" + Math.round(Math.random() * 1e4)); 7692 } 7693 this.createToolbar(); 7694 this._initCells(); 7695 this.$table.data(pluginName, this); 7696 this.$table.trigger(events.create, [this]); 7697 }; 7698 Table2.prototype.getConfig = function(pluginSpecificConfig) { 7699 var configs = $27.extend(defaultConfig, pluginSpecificConfig || {}); 7700 return $27.extend(configs, typeof TablesawConfig !== "undefined" ? TablesawConfig : {}); 7701 }; 7702 Table2.prototype._getPrimaryHeaderRow = function() { 7703 return this._getHeaderRows().eq(0); 7704 }; 7705 Table2.prototype._getHeaderRows = function() { 7706 return this.$thead.children().filter("tr").filter(function() { 7707 return !$27(this).is("[data-tablesaw-ignorerow]"); 7708 }); 7709 }; 7710 Table2.prototype._getRowIndex = function($row) { 7711 return $row.prevAll().length; 7712 }; 7713 Table2.prototype._getHeaderRowIndeces = function() { 7714 var self = this; 7715 var indeces = []; 7716 this._getHeaderRows().each(function() { 7717 indeces.push(self._getRowIndex($27(this))); 7718 }); 7719 return indeces; 7720 }; 7721 Table2.prototype._getPrimaryHeaderCells = function($row) { 7722 return ($row || this._getPrimaryHeaderRow()).find("th"); 7723 }; 7724 Table2.prototype._$getCells = function(th) { 7725 var self = this; 7726 return $27(th).add(th.cells).filter(function() { 7727 var $t = $27(this); 7728 var $row = $t.parent(); 7729 var hasColspan = $t.is("[colspan]"); 7730 return !$row.is("[" + self.attributes.subrow + "]") && (!$row.is("[" + self.attributes.ignorerow + "]") || !hasColspan); 7731 }); 7732 }; 7733 Table2.prototype._getVisibleColspan = function() { 7734 var colspan = 0; 7735 this._getPrimaryHeaderCells().each(function() { 7736 var $t = $27(this); 7737 if ($t.css("display") !== "none") { 7738 colspan += parseInt($t.attr("colspan"), 10) || 1; 7739 } 7740 }); 7741 return colspan; 7742 }; 7743 Table2.prototype.getColspanForCell = function($cell) { 7744 var visibleColspan = this._getVisibleColspan(); 7745 var visibleSiblingColumns = 0; 7746 if ($cell.closest("tr").data("tablesaw-rowspanned")) { 7747 visibleSiblingColumns++; 7748 } 7749 $cell.siblings().each(function() { 7750 var $t = $27(this); 7751 var colColspan = parseInt($t.attr("colspan"), 10) || 1; 7752 if ($t.css("display") !== "none") { 7753 visibleSiblingColumns += colColspan; 7754 } 7755 }); 7756 return visibleColspan - visibleSiblingColumns; 7757 }; 7758 Table2.prototype.isCellInColumn = function(header, cell) { 7759 return $27(header).add(header.cells).filter(function() { 7760 return this === cell; 7761 }).length; 7762 }; 7763 Table2.prototype.updateColspanCells = function(cls, header, userAction) { 7764 var self = this; 7765 var primaryHeaderRow = self._getPrimaryHeaderRow(); 7766 this.$table.find("[rowspan][data-tablesaw-priority]").each(function() { 7767 var $t = $27(this); 7768 if ($t.attr("data-tablesaw-priority") !== "persist") { 7769 return; 7770 } 7771 var $row = $t.closest("tr"); 7772 var rowspan = parseInt($t.attr("rowspan"), 10); 7773 if (rowspan > 1) { 7774 $row = $row.next(); 7775 $row.data("tablesaw-rowspanned", true); 7776 rowspan--; 7777 } 7778 }); 7779 this.$table.find("[colspan],[data-tablesaw-maxcolspan]").filter(function() { 7780 return $27(this).closest("tr")[0] !== primaryHeaderRow[0]; 7781 }).each(function() { 7782 var $cell = $27(this); 7783 if (userAction === void 0 || self.isCellInColumn(header, this)) { 7784 } else { 7785 return; 7786 } 7787 var colspan = self.getColspanForCell($cell); 7788 if (cls && userAction !== void 0) { 7789 $cell[colspan === 0 ? "addClass" : "removeClass"](cls); 7790 } 7791 var maxColspan = parseInt($cell.attr("data-tablesaw-maxcolspan"), 10); 7792 if (!maxColspan) { 7793 $cell.attr("data-tablesaw-maxcolspan", $cell.attr("colspan")); 7794 } else if (colspan > maxColspan) { 7795 colspan = maxColspan; 7796 } 7797 $cell.attr("colspan", colspan); 7798 }); 7799 }; 7800 Table2.prototype._findPrimaryHeadersForCell = function(cell) { 7801 var $headerRow = this._getPrimaryHeaderRow(); 7802 var headerRowIndex = this._getRowIndex($headerRow); 7803 var results = []; 7804 for (var rowNumber = 0; rowNumber < this.headerMapping.length; rowNumber++) { 7805 if (rowNumber === headerRowIndex) { 7806 continue; 7807 } 7808 for (var colNumber = 0; colNumber < this.headerMapping[rowNumber].length; colNumber++) { 7809 if (this.headerMapping[rowNumber][colNumber] === cell) { 7810 results.push(this.headerMapping[headerRowIndex][colNumber]); 7811 } 7812 } 7813 } 7814 return results; 7815 }; 7816 Table2.prototype.getRows = function() { 7817 var self = this; 7818 return this.$table.find("tr").filter(function() { 7819 return $27(this).closest("table").is(self.$table); 7820 }); 7821 }; 7822 Table2.prototype.getBodyRows = function(tbody) { 7823 return (tbody ? $27(tbody) : this.$tbody).children().filter("tr"); 7824 }; 7825 Table2.prototype.getHeaderCellIndex = function(cell) { 7826 var lookup9 = this.headerMapping[0]; 7827 for (var colIndex = 0; colIndex < lookup9.length; colIndex++) { 7828 if (lookup9[colIndex] === cell) { 7829 return colIndex; 7830 } 7831 } 7832 return -1; 7833 }; 7834 Table2.prototype._initCells = function() { 7835 this.$table.find("[data-tablesaw-maxcolspan]").each(function() { 7836 var $t = $27(this); 7837 $t.attr("colspan", $t.attr("data-tablesaw-maxcolspan")); 7838 }); 7839 var $rows = this.getRows(); 7840 var columnLookup = []; 7841 $rows.each(function(rowNumber2) { 7842 columnLookup[rowNumber2] = []; 7843 }); 7844 $rows.each(function(rowNumber2) { 7845 var coltally = 0; 7846 var $t = $27(this); 7847 var children = $t.children(); 7848 children.each(function() { 7849 var colspan = parseInt( 7850 this.getAttribute("data-tablesaw-maxcolspan") || this.getAttribute("colspan"), 7851 10 7852 ); 7853 var rowspan = parseInt(this.getAttribute("rowspan"), 10); 7854 while (columnLookup[rowNumber2][coltally]) { 7855 coltally++; 7856 } 7857 columnLookup[rowNumber2][coltally] = this; 7858 if (colspan) { 7859 for (var k2 = 0; k2 < colspan - 1; k2++) { 7860 coltally++; 7861 columnLookup[rowNumber2][coltally] = this; 7862 } 7863 } 7864 if (rowspan) { 7865 for (var j = 1; j < rowspan; j++) { 7866 columnLookup[rowNumber2 + j][coltally] = this; 7867 } 7868 } 7869 coltally++; 7870 }); 7871 }); 7872 var headerRowIndeces = this._getHeaderRowIndeces(); 7873 for (var colNumber = 0; colNumber < columnLookup[0].length; colNumber++) { 7874 for (var headerIndex = 0, k = headerRowIndeces.length; headerIndex < k; headerIndex++) { 7875 var headerCol = columnLookup[headerRowIndeces[headerIndex]][colNumber]; 7876 var rowNumber = headerRowIndeces[headerIndex]; 7877 var rowCell; 7878 if (!headerCol.cells) { 7879 headerCol.cells = []; 7880 } 7881 while (rowNumber < columnLookup.length) { 7882 rowCell = columnLookup[rowNumber][colNumber]; 7883 if (headerCol !== rowCell) { 7884 headerCol.cells.push(rowCell); 7885 } 7886 rowNumber++; 7887 } 7888 } 7889 } 7890 this.headerMapping = columnLookup; 7891 }; 7892 Table2.prototype.refresh = function() { 7893 this._initCells(); 7894 this.$table.trigger(events.refresh, [this]); 7895 }; 7896 Table2.prototype._getToolbarAnchor = function() { 7897 var $parent = this.$table.parent(); 7898 if ($parent.is(".tablesaw-overflow")) { 7899 return $parent; 7900 } 7901 return this.$table; 7902 }; 7903 Table2.prototype._getToolbar = function($anchor) { 7904 if (!$anchor) { 7905 $anchor = this._getToolbarAnchor(); 7906 } 7907 return $anchor.prev().filter("." + classes.toolbar); 7908 }; 7909 Table2.prototype.createToolbar = function() { 7910 var $anchor = this._getToolbarAnchor(); 7911 var $toolbar = this._getToolbar($anchor); 7912 if (!$toolbar.length) { 7913 $toolbar = $27("<div>").addClass(classes.toolbar).insertBefore($anchor); 7914 } 7915 this.$toolbar = $toolbar; 7916 if (this.mode) { 7917 this.$toolbar.addClass("tablesaw-mode-" + this.mode); 7918 } 7919 }; 7920 Table2.prototype.destroy = function() { 7921 this._getToolbar().each(function() { 7922 this.className = this.className.replace(/\btablesaw-mode\-\w*\b/gi, ""); 7923 }); 7924 var tableId = this.$table.attr("id"); 7925 $27(document2).off("." + tableId); 7926 $27(window2).off("." + tableId); 7927 this.$table.trigger(events.destroy, [this]); 7928 this.$table.removeData(pluginName); 7929 }; 7930 $27.fn[pluginName] = function() { 7931 return this.each(function() { 7932 var $t = $27(this); 7933 if ($t.data(pluginName)) { 7934 return; 7935 } 7936 new Table2(this); 7937 }); 7938 }; 7939 var $doc = $27(document2); 7940 $doc.on("enhance.tablesaw", function(e2) { 7941 if (Tablesaw.mustard) { 7942 var $target = $27(e2.target); 7943 if ($target.parent().length) { 7944 $target = $target.parent(); 7945 } 7946 $target.find(initSelector).filter(initFilterSelector)[pluginName](); 7947 } 7948 }); 7949 var isScrolling = false; 7950 var scrollTimeout; 7951 $doc.on("scroll.tablesaw", function() { 7952 isScrolling = true; 7953 window2.clearTimeout(scrollTimeout); 7954 scrollTimeout = window2.setTimeout(function() { 7955 isScrolling = false; 7956 }, 300); 7957 }); 7958 var resizeTimeout; 7959 $27(window2).on("resize", function() { 7960 if (!isScrolling) { 7961 window2.clearTimeout(resizeTimeout); 7962 resizeTimeout = window2.setTimeout(function() { 7963 $doc.trigger(events.resize); 7964 }, 150); 7965 } 7966 }); 7967 Tablesaw.Table = Table2; 7968 })(); 7969 (function() { 7970 var classes = { 7971 stackTable: "tablesaw-stack", 7972 cellLabels: "tablesaw-cell-label", 7973 cellContentLabels: "tablesaw-cell-content" 7974 }; 7975 var data = { 7976 key: "tablesaw-stack" 7977 }; 7978 var attrs = { 7979 labelless: "data-tablesaw-no-labels", 7980 hideempty: "data-tablesaw-hide-empty" 7981 }; 7982 var Stack = function(element, tablesaw) { 7983 this.tablesaw = tablesaw; 7984 this.$table = $27(element); 7985 this.labelless = this.$table.is("[" + attrs.labelless + "]"); 7986 this.hideempty = this.$table.is("[" + attrs.hideempty + "]"); 7987 this.$table.data(data.key, this); 7988 }; 7989 Stack.prototype.init = function() { 7990 this.$table.addClass(classes.stackTable); 7991 if (this.labelless) { 7992 return; 7993 } 7994 var self = this; 7995 this.$table.find("th, td").filter(function() { 7996 return !$27(this).closest("thead").length; 7997 }).filter(function() { 7998 return !$27(this).is("[" + attrs.labelless + "]") && !$27(this).closest("tr").is("[" + attrs.labelless + "]") && (!self.hideempty || !!$27(this).html()); 7999 }).each(function() { 8000 var $newHeader = $27(document2.createElement("b")).addClass(classes.cellLabels); 8001 var $cell = $27(this); 8002 $27(self.tablesaw._findPrimaryHeadersForCell(this)).each(function(index) { 8003 var $header = $27(this.cloneNode(true)); 8004 var $sortableButton = $header.find(".tablesaw-sortable-btn"); 8005 $header.find(".tablesaw-sortable-arrow").remove(); 8006 var $checkall = $header.find("[data-tablesaw-checkall]"); 8007 $checkall.closest("label").remove(); 8008 if ($checkall.length) { 8009 $newHeader = $27([]); 8010 return; 8011 } 8012 if (index > 0) { 8013 $newHeader.append(document2.createTextNode(", ")); 8014 } 8015 var parentNode = $sortableButton.length ? $sortableButton[0] : $header[0]; 8016 var el; 8017 while (el = parentNode.firstChild) { 8018 $newHeader[0].appendChild(el); 8019 } 8020 }); 8021 if ($newHeader.length && !$cell.find("." + classes.cellContentLabels).length) { 8022 $cell.wrapInner("<span class='" + classes.cellContentLabels + "'></span>"); 8023 } 8024 var $label = $cell.find("." + classes.cellLabels); 8025 if (!$label.length) { 8026 $cell.prepend(document2.createTextNode(" ")); 8027 $cell.prepend($newHeader); 8028 } else { 8029 $label.replaceWith($newHeader); 8030 } 8031 }); 8032 }; 8033 Stack.prototype.destroy = function() { 8034 this.$table.removeClass(classes.stackTable); 8035 this.$table.find("." + classes.cellLabels).remove(); 8036 this.$table.find("." + classes.cellContentLabels).each(function() { 8037 $27(this).replaceWith($27(this.childNodes)); 8038 }); 8039 }; 8040 $27(document2).on(Tablesaw.events.create, function(e2, tablesaw) { 8041 if (tablesaw.mode === "stack") { 8042 var table = new Stack(tablesaw.table, tablesaw); 8043 table.init(); 8044 } 8045 }).on(Tablesaw.events.refresh, function(e2, tablesaw) { 8046 if (tablesaw.mode === "stack") { 8047 $27(tablesaw.table).data(data.key).init(); 8048 } 8049 }).on(Tablesaw.events.destroy, function(e2, tablesaw) { 8050 if (tablesaw.mode === "stack") { 8051 $27(tablesaw.table).data(data.key).destroy(); 8052 } 8053 }); 8054 Tablesaw.Stack = Stack; 8055 })(); 8056 (function() { 8057 var pluginName = "tablesawbtn", methods = { 8058 _create: function() { 8059 return $27(this).each(function() { 8060 $27(this).trigger("beforecreate." + pluginName)[pluginName]("_init").trigger("create." + pluginName); 8061 }); 8062 }, 8063 _init: function() { 8064 var oEl = $27(this), sel = this.getElementsByTagName("select")[0]; 8065 if (sel) { 8066 $27(this).addClass("btn-select tablesaw-btn-select")[pluginName]("_select", sel); 8067 } 8068 return oEl; 8069 }, 8070 _select: function(sel) { 8071 var update = function(oEl, sel2) { 8072 var opts = $27(sel2).find("option"); 8073 var label = document2.createElement("span"); 8074 var el; 8075 var children; 8076 var found = false; 8077 label.setAttribute("aria-hidden", "true"); 8078 label.innerHTML = " "; 8079 opts.each(function() { 8080 var opt = this; 8081 if (opt.selected) { 8082 label.innerHTML = opt.text; 8083 } 8084 }); 8085 children = oEl.childNodes; 8086 if (opts.length > 0) { 8087 for (var i = 0, l = children.length; i < l; i++) { 8088 el = children[i]; 8089 if (el && el.nodeName.toUpperCase() === "SPAN") { 8090 oEl.replaceChild(label, el); 8091 found = true; 8092 } 8093 } 8094 if (!found) { 8095 oEl.insertBefore(label, oEl.firstChild); 8096 } 8097 } 8098 }; 8099 update(this, sel); 8100 $27(this).on("change refresh", function() { 8101 update(this, sel); 8102 }); 8103 } 8104 }; 8105 $27.fn[pluginName] = function(arrg, a, b, c) { 8106 return this.each(function() { 8107 if (arrg && typeof arrg === "string") { 8108 return $27.fn[pluginName].prototype[arrg].call(this, a, b, c); 8109 } 8110 if ($27(this).data(pluginName + "active")) { 8111 return $27(this); 8112 } 8113 $27(this).data(pluginName + "active", true); 8114 $27.fn[pluginName].prototype._create.call(this); 8115 }); 8116 }; 8117 $27.extend($27.fn[pluginName].prototype, methods); 8118 })(); 8119 (function() { 8120 var data = { 8121 key: "tablesaw-coltoggle" 8122 }; 8123 var ColumnToggle = function(element) { 8124 this.$table = $27(element); 8125 if (!this.$table.length) { 8126 return; 8127 } 8128 this.tablesaw = this.$table.data("tablesaw"); 8129 this.attributes = { 8130 btnTarget: "data-tablesaw-columntoggle-btn-target", 8131 set: "data-tablesaw-columntoggle-set" 8132 }; 8133 this.classes = { 8134 columnToggleTable: "tablesaw-columntoggle", 8135 columnBtnContain: "tablesaw-columntoggle-btnwrap tablesaw-advance", 8136 columnBtn: "tablesaw-columntoggle-btn tablesaw-nav-btn down", 8137 popup: "tablesaw-columntoggle-popup", 8138 priorityPrefix: "tablesaw-priority-" 8139 }; 8140 this.set = []; 8141 this.$headers = this.tablesaw._getPrimaryHeaderCells(); 8142 this.$table.data(data.key, this); 8143 }; 8144 ColumnToggle.prototype.initSet = function() { 8145 var set = this.$table.attr(this.attributes.set); 8146 if (set) { 8147 var table = this.$table[0]; 8148 this.set = $27("table[" + this.attributes.set + "='" + set + "']").filter(function() { 8149 return this !== table; 8150 }).get(); 8151 } 8152 }; 8153 ColumnToggle.prototype.init = function() { 8154 if (!this.$table.length) { 8155 return; 8156 } 8157 var tableId, id, $menuButton, $popup, $menu, $btnContain, self = this; 8158 var cfg = this.tablesaw.getConfig({ 8159 getColumnToggleLabelTemplate: function(text) { 8160 return "<label><input type='checkbox' checked>" + text + "</label>"; 8161 } 8162 }); 8163 this.$table.addClass(this.classes.columnToggleTable); 8164 tableId = this.$table.attr("id"); 8165 id = tableId + "-popup"; 8166 $btnContain = $27("<div class='" + this.classes.columnBtnContain + "'></div>"); 8167 $menuButton = $27( 8168 "<a href='#" + id + "' class='btn tablesaw-btn btn-micro " + this.classes.columnBtn + "' data-popup-link><span>" + Tablesaw.i18n.columnToggleButton + "</span></a>" 8169 ); 8170 $popup = $27("<div class='" + this.classes.popup + "' id='" + id + "'></div>"); 8171 $menu = $27("<div class='tablesaw-btn-group'></div>"); 8172 this.$popup = $popup; 8173 var hasNonPersistentHeaders = false; 8174 this.$headers.each(function() { 8175 var $this = $27(this), priority = $this.attr("data-tablesaw-priority"), $cells = self.tablesaw._$getCells(this); 8176 if (priority && priority !== "persist") { 8177 $cells.addClass(self.classes.priorityPrefix + priority); 8178 $27(cfg.getColumnToggleLabelTemplate($this.text())).appendTo($menu).find('input[type="checkbox"]').data("tablesaw-header", this); 8179 hasNonPersistentHeaders = true; 8180 } 8181 }); 8182 if (!hasNonPersistentHeaders) { 8183 $menu.append("<label>" + Tablesaw.i18n.columnToggleError + "</label>"); 8184 } 8185 $menu.appendTo($popup); 8186 function onToggleCheckboxChange(checkbox) { 8187 var checked = checkbox.checked; 8188 var header = self.getHeaderFromCheckbox(checkbox); 8189 var $cells = self.tablesaw._$getCells(header); 8190 $cells[!checked ? "addClass" : "removeClass"]("tablesaw-toggle-cellhidden"); 8191 $cells[checked ? "addClass" : "removeClass"]("tablesaw-toggle-cellvisible"); 8192 self.updateColspanCells(header, checked); 8193 self.$table.trigger("tablesawcolumns"); 8194 } 8195 $menu.find('input[type="checkbox"]').on("change", function(e2) { 8196 onToggleCheckboxChange(e2.target); 8197 if (self.set.length) { 8198 var index; 8199 $27(self.$popup).find("input[type='checkbox']").each(function(j) { 8200 if (this === e2.target) { 8201 index = j; 8202 return false; 8203 } 8204 }); 8205 $27(self.set).each(function() { 8206 var checkbox = $27(this).data(data.key).$popup.find("input[type='checkbox']").get(index); 8207 if (checkbox) { 8208 checkbox.checked = e2.target.checked; 8209 onToggleCheckboxChange(checkbox); 8210 } 8211 }); 8212 } 8213 }); 8214 $menuButton.appendTo($btnContain); 8215 var $btnTarget = $27(this.$table.attr(this.attributes.btnTarget)); 8216 $btnContain.appendTo($btnTarget.length ? $btnTarget : this.tablesaw.$toolbar); 8217 function closePopup(event) { 8218 if (event && $27(event.target).closest("." + self.classes.popup).length) { 8219 return; 8220 } 8221 $27(document2).off("click." + tableId); 8222 $menuButton.removeClass("up").addClass("down"); 8223 $btnContain.removeClass("visible"); 8224 } 8225 var closeTimeout; 8226 function openPopup() { 8227 $btnContain.addClass("visible"); 8228 $menuButton.removeClass("down").addClass("up"); 8229 $27(document2).off("click." + tableId, closePopup); 8230 window2.clearTimeout(closeTimeout); 8231 closeTimeout = window2.setTimeout(function() { 8232 $27(document2).on("click." + tableId, closePopup); 8233 }, 15); 8234 } 8235 $menuButton.on("click.tablesaw", function(event) { 8236 event.preventDefault(); 8237 if (!$btnContain.is(".visible")) { 8238 openPopup(); 8239 } else { 8240 closePopup(); 8241 } 8242 }); 8243 $popup.appendTo($btnContain); 8244 this.$menu = $menu; 8245 var $overflow = this.$table.closest(".tablesaw-overflow"); 8246 if ($overflow.css("-webkit-overflow-scrolling")) { 8247 var timeout; 8248 $overflow.on("scroll", function() { 8249 var $div = $27(this); 8250 window2.clearTimeout(timeout); 8251 timeout = window2.setTimeout(function() { 8252 $div.css("-webkit-overflow-scrolling", "auto"); 8253 window2.setTimeout(function() { 8254 $div.css("-webkit-overflow-scrolling", "touch"); 8255 }, 0); 8256 }, 100); 8257 }); 8258 } 8259 $27(window2).on(Tablesaw.events.resize + "." + tableId, function() { 8260 self.refreshToggle(); 8261 }); 8262 this.initSet(); 8263 this.refreshToggle(); 8264 }; 8265 ColumnToggle.prototype.getHeaderFromCheckbox = function(checkbox) { 8266 return $27(checkbox).data("tablesaw-header"); 8267 }; 8268 ColumnToggle.prototype.refreshToggle = function() { 8269 var self = this; 8270 var invisibleColumns = 0; 8271 this.$menu.find("input").each(function() { 8272 var header = self.getHeaderFromCheckbox(this); 8273 this.checked = self.tablesaw._$getCells(header).eq(0).css("display") === "table-cell"; 8274 }); 8275 this.updateColspanCells(); 8276 }; 8277 ColumnToggle.prototype.updateColspanCells = function(header, userAction) { 8278 this.tablesaw.updateColspanCells("tablesaw-toggle-cellhidden", header, userAction); 8279 }; 8280 ColumnToggle.prototype.destroy = function() { 8281 this.$table.removeClass(this.classes.columnToggleTable); 8282 this.$table.find("th, td").each(function() { 8283 var $cell = $27(this); 8284 $cell.removeClass("tablesaw-toggle-cellhidden").removeClass("tablesaw-toggle-cellvisible"); 8285 this.className = this.className.replace(/\bui\-table\-priority\-\d\b/g, ""); 8286 }); 8287 }; 8288 $27(document2).on(Tablesaw.events.create, function(e2, tablesaw) { 8289 if (tablesaw.mode === "columntoggle") { 8290 var table = new ColumnToggle(tablesaw.table); 8291 table.init(); 8292 } 8293 }); 8294 $27(document2).on(Tablesaw.events.destroy, function(e2, tablesaw) { 8295 if (tablesaw.mode === "columntoggle") { 8296 $27(tablesaw.table).data(data.key).destroy(); 8297 } 8298 }); 8299 $27(document2).on(Tablesaw.events.refresh, function(e2, tablesaw) { 8300 if (tablesaw.mode === "columntoggle") { 8301 $27(tablesaw.table).data(data.key).refreshToggle(); 8302 } 8303 }); 8304 Tablesaw.ColumnToggle = ColumnToggle; 8305 })(); 8306 (function() { 8307 function getSortValue(cell) { 8308 var text = []; 8309 $27(cell.childNodes).each(function() { 8310 var $el = $27(this); 8311 if ($el.is("input, select")) { 8312 text.push($el.val()); 8313 } else if ($el.is(".tablesaw-cell-label")) { 8314 } else { 8315 text.push(($el.text() || "").replace(/^\s+|\s+$/g, "")); 8316 } 8317 }); 8318 return text.join(""); 8319 } 8320 var pluginName = "tablesaw-sortable", initSelector = "table[data-" + pluginName + "]", sortableSwitchSelector = "[data-" + pluginName + "-switch]", attrs = { 8321 sortCol: "data-tablesaw-sortable-col", 8322 defaultCol: "data-tablesaw-sortable-default-col", 8323 numericCol: "data-tablesaw-sortable-numeric", 8324 subRow: "data-tablesaw-subrow", 8325 ignoreRow: "data-tablesaw-ignorerow" 8326 }, classes = { 8327 head: pluginName + "-head", 8328 ascend: pluginName + "-ascending", 8329 descend: pluginName + "-descending", 8330 switcher: pluginName + "-switch", 8331 tableToolbar: "tablesaw-bar-section", 8332 sortButton: pluginName + "-btn" 8333 }, methods = { 8334 _create: function(o2) { 8335 return $27(this).each(function() { 8336 var init2 = $27(this).data(pluginName + "-init"); 8337 if (init2) { 8338 return false; 8339 } 8340 $27(this).data(pluginName + "-init", true).trigger("beforecreate." + pluginName)[pluginName]("_init", o2).trigger("create." + pluginName); 8341 }); 8342 }, 8343 _init: function() { 8344 var el = $27(this); 8345 var tblsaw = el.data("tablesaw"); 8346 var heads; 8347 var $switcher; 8348 function addClassToHeads(h) { 8349 $27.each(h, function(i, v) { 8350 $27(v).addClass(classes.head); 8351 }); 8352 } 8353 function makeHeadsActionable(h, fn) { 8354 $27.each(h, function(i, col) { 8355 var b = $27("<button class='" + classes.sortButton + "'/>"); 8356 b.on("click", { col }, fn); 8357 $27(col).wrapInner(b).find("button").append("<span class='tablesaw-sortable-arrow'>"); 8358 }); 8359 } 8360 function clearOthers(headcells) { 8361 $27.each(headcells, function(i, v) { 8362 var col = $27(v); 8363 col.removeAttr(attrs.defaultCol); 8364 col.removeClass(classes.ascend); 8365 col.removeClass(classes.descend); 8366 }); 8367 } 8368 function headsOnAction(e2) { 8369 if ($27(e2.target).is("a[href]")) { 8370 return; 8371 } 8372 e2.stopPropagation(); 8373 var headCell = $27(e2.target).closest("[" + attrs.sortCol + "]"), v = e2.data.col, newSortValue = heads.index(headCell[0]); 8374 clearOthers( 8375 headCell.closest("thead").find("th").filter(function() { 8376 return this !== headCell[0]; 8377 }) 8378 ); 8379 if (headCell.is("." + classes.descend) || !headCell.is("." + classes.ascend)) { 8380 el[pluginName]("sortBy", v, true); 8381 newSortValue += "_asc"; 8382 } else { 8383 el[pluginName]("sortBy", v); 8384 newSortValue += "_desc"; 8385 } 8386 if ($switcher) { 8387 $switcher.find("select").val(newSortValue).trigger("refresh"); 8388 } 8389 e2.preventDefault(); 8390 } 8391 function handleDefault(heads2) { 8392 $27.each(heads2, function(idx, el2) { 8393 var $el = $27(el2); 8394 if ($el.is("[" + attrs.defaultCol + "]")) { 8395 if (!$el.is("." + classes.descend)) { 8396 $el.addClass(classes.ascend); 8397 } 8398 } 8399 }); 8400 } 8401 function addSwitcher(heads2) { 8402 $switcher = $27("<div>").addClass(classes.switcher).addClass(classes.tableToolbar); 8403 var html = ["<label>" + Tablesaw.i18n.sort + ":"]; 8404 html.push('<span class="btn tablesaw-btn"><select>'); 8405 heads2.each(function(j) { 8406 var $t = $27(this); 8407 var isDefaultCol = $t.is("[" + attrs.defaultCol + "]"); 8408 var isDescending = $t.is("." + classes.descend); 8409 var hasNumericAttribute = $t.is("[" + attrs.numericCol + "]"); 8410 var numericCount = 0; 8411 var numericCountMax = 5; 8412 $27(this.cells.slice(0, numericCountMax)).each(function() { 8413 if (!isNaN(parseInt(getSortValue(this), 10))) { 8414 numericCount++; 8415 } 8416 }); 8417 var isNumeric = numericCount === numericCountMax; 8418 if (!hasNumericAttribute) { 8419 $t.attr(attrs.numericCol, isNumeric ? "" : "false"); 8420 } 8421 html.push( 8422 "<option" + (isDefaultCol && !isDescending ? " selected" : "") + ' value="' + j + '_asc">' + $t.text() + " " + (isNumeric ? "↑" : "(A-Z)") + "</option>" 8423 ); 8424 html.push( 8425 "<option" + (isDefaultCol && isDescending ? " selected" : "") + ' value="' + j + '_desc">' + $t.text() + " " + (isNumeric ? "↓" : "(Z-A)") + "</option>" 8426 ); 8427 }); 8428 html.push("</select></span></label>"); 8429 $switcher.html(html.join("")); 8430 var $firstChild = tblsaw.$toolbar.children().eq(0); 8431 if ($firstChild.length) { 8432 $switcher.insertBefore($firstChild); 8433 } else { 8434 $switcher.appendTo(tblsaw.$toolbar); 8435 } 8436 $switcher.find(".tablesaw-btn").tablesawbtn(); 8437 $switcher.find("select").on("change", function() { 8438 var val = $27(this).val().split("_"), head = heads2.eq(val[0]); 8439 clearOthers(head.siblings()); 8440 el[pluginName]("sortBy", head.get(0), val[1] === "asc"); 8441 }); 8442 } 8443 el.addClass(pluginName); 8444 heads = el.children().filter("thead").find("th[" + attrs.sortCol + "]"); 8445 addClassToHeads(heads); 8446 makeHeadsActionable(heads, headsOnAction); 8447 handleDefault(heads); 8448 if (el.is(sortableSwitchSelector)) { 8449 addSwitcher(heads); 8450 } 8451 }, 8452 sortRows: function(rows, colNum, ascending, col, tbody) { 8453 function convertCells(cellArr, belongingToTbody) { 8454 var cells2 = []; 8455 $27.each(cellArr, function(i, cell) { 8456 var row = cell.parentNode; 8457 var $row = $27(row); 8458 var subrows = []; 8459 var $next = $row.next(); 8460 while ($next.is("[" + attrs.subRow + "]")) { 8461 subrows.push($next[0]); 8462 $next = $next.next(); 8463 } 8464 var tbody2 = row.parentNode; 8465 if ($row.is("[" + attrs.subRow + "]")) { 8466 } else if (tbody2 === belongingToTbody) { 8467 cells2.push({ 8468 element: cell, 8469 cell: getSortValue(cell), 8470 row, 8471 subrows: subrows.length ? subrows : null, 8472 ignored: $row.is("[" + attrs.ignoreRow + "]") 8473 }); 8474 } 8475 }); 8476 return cells2; 8477 } 8478 function getSortFxn(ascending2, forceNumeric) { 8479 var fn2, regex = /[^\-\+\d\.]/g; 8480 if (ascending2) { 8481 fn2 = function(a, b) { 8482 if (a.ignored || b.ignored) { 8483 return 0; 8484 } 8485 if (forceNumeric) { 8486 return parseFloat(a.cell.replace(regex, "")) - parseFloat(b.cell.replace(regex, "")); 8487 } else { 8488 return a.cell.toLowerCase() > b.cell.toLowerCase() ? 1 : -1; 8489 } 8490 }; 8491 } else { 8492 fn2 = function(a, b) { 8493 if (a.ignored || b.ignored) { 8494 return 0; 8495 } 8496 if (forceNumeric) { 8497 return parseFloat(b.cell.replace(regex, "")) - parseFloat(a.cell.replace(regex, "")); 8498 } else { 8499 return a.cell.toLowerCase() < b.cell.toLowerCase() ? 1 : -1; 8500 } 8501 }; 8502 } 8503 return fn2; 8504 } 8505 function convertToRows(sorted2) { 8506 var newRows = [], i, l; 8507 for (i = 0, l = sorted2.length; i < l; i++) { 8508 newRows.push(sorted2[i].row); 8509 if (sorted2[i].subrows) { 8510 newRows.push(sorted2[i].subrows); 8511 } 8512 } 8513 return newRows; 8514 } 8515 var fn; 8516 var sorted; 8517 var cells = convertCells(col.cells, tbody); 8518 var customFn = $27(col).data("tablesaw-sort"); 8519 fn = (customFn && typeof customFn === "function" ? customFn(ascending) : false) || getSortFxn( 8520 ascending, 8521 $27(col).is("[" + attrs.numericCol + "]") && !$27(col).is("[" + attrs.numericCol + '="false"]') 8522 ); 8523 sorted = cells.sort(fn); 8524 rows = convertToRows(sorted); 8525 return rows; 8526 }, 8527 makeColDefault: function(col, a) { 8528 var c = $27(col); 8529 c.attr(attrs.defaultCol, "true"); 8530 if (a) { 8531 c.removeClass(classes.descend); 8532 c.addClass(classes.ascend); 8533 } else { 8534 c.removeClass(classes.ascend); 8535 c.addClass(classes.descend); 8536 } 8537 }, 8538 sortBy: function(col, ascending) { 8539 var el = $27(this); 8540 var colNum; 8541 var tbl = el.data("tablesaw"); 8542 tbl.$tbody.each(function() { 8543 var tbody = this; 8544 var $tbody = $27(this); 8545 var rows = tbl.getBodyRows(tbody); 8546 var sortedRows; 8547 var map = tbl.headerMapping[0]; 8548 var j, k; 8549 for (j = 0, k = map.length; j < k; j++) { 8550 if (map[j] === col) { 8551 colNum = j; 8552 break; 8553 } 8554 } 8555 sortedRows = el[pluginName]("sortRows", rows, colNum, ascending, col, tbody); 8556 for (j = 0, k = sortedRows.length; j < k; j++) { 8557 $tbody.append(sortedRows[j]); 8558 } 8559 }); 8560 el[pluginName]("makeColDefault", col, ascending); 8561 el.trigger("tablesaw-sorted"); 8562 } 8563 }; 8564 $27.fn[pluginName] = function(arrg) { 8565 var args = Array.prototype.slice.call(arguments, 1), returnVal; 8566 if (arrg && typeof arrg === "string") { 8567 returnVal = $27.fn[pluginName].prototype[arrg].apply(this[0], args); 8568 return typeof returnVal !== "undefined" ? returnVal : $27(this); 8569 } 8570 if (!$27(this).data(pluginName + "-active")) { 8571 $27(this).data(pluginName + "-active", true); 8572 $27.fn[pluginName].prototype._create.call(this, arrg); 8573 } 8574 return $27(this); 8575 }; 8576 $27.extend($27.fn[pluginName].prototype, methods); 8577 $27(document2).on(Tablesaw.events.create, function(e2, Tablesaw2) { 8578 if (Tablesaw2.$table.is(initSelector)) { 8579 Tablesaw2.$table[pluginName](); 8580 } 8581 }); 8582 })(); 8583 (function() { 8584 var classes = { 8585 hideBtn: "disabled", 8586 persistWidths: "tablesaw-fix-persist", 8587 hiddenCol: "tablesaw-swipe-cellhidden", 8588 persistCol: "tablesaw-swipe-cellpersist", 8589 allColumnsVisible: "tablesaw-all-cols-visible" 8590 }; 8591 var attrs = { 8592 disableTouchEvents: "data-tablesaw-no-touch", 8593 ignorerow: "data-tablesaw-ignorerow", 8594 subrow: "data-tablesaw-subrow" 8595 }; 8596 function createSwipeTable(tbl, $table) { 8597 var tblsaw = $table.data("tablesaw"); 8598 var $btns = $27("<div class='tablesaw-advance'></div>"); 8599 var $prevBtn = $27( 8600 "<a href='#' class='btn tablesaw-nav-btn tablesaw-btn btn-micro left'>" + Tablesaw.i18n.swipePreviousColumn + "</a>" 8601 ).appendTo($btns); 8602 var $nextBtn = $27( 8603 "<a href='#' class='btn tablesaw-nav-btn tablesaw-btn btn-micro right'>" + Tablesaw.i18n.swipeNextColumn + "</a>" 8604 ).appendTo($btns); 8605 var $headerCells = tbl._getPrimaryHeaderCells(); 8606 var $headerCellsNoPersist = $headerCells.not('[data-tablesaw-priority="persist"]'); 8607 var headerWidths = []; 8608 var headerWidthsNoPersist = []; 8609 var $head = $27(document2.head || "head"); 8610 var tableId = $table.attr("id"); 8611 if (!$headerCells.length) { 8612 throw new Error("tablesaw swipe: no header cells found."); 8613 } 8614 $table.addClass("tablesaw-swipe"); 8615 function initMinHeaderWidths() { 8616 $table.css({ 8617 width: "1px" 8618 }); 8619 $table.find("." + classes.hiddenCol).removeClass(classes.hiddenCol); 8620 headerWidths = []; 8621 headerWidthsNoPersist = []; 8622 $headerCells.each(function() { 8623 var width = this.offsetWidth; 8624 headerWidths.push(width); 8625 if (!isPersistent(this)) { 8626 headerWidthsNoPersist.push(width); 8627 } 8628 }); 8629 $table.css({ 8630 width: "" 8631 }); 8632 } 8633 initMinHeaderWidths(); 8634 $btns.appendTo(tblsaw.$toolbar); 8635 if (!tableId) { 8636 tableId = "tableswipe-" + Math.round(Math.random() * 1e4); 8637 $table.attr("id", tableId); 8638 } 8639 function showColumn(headerCell) { 8640 tblsaw._$getCells(headerCell).removeClass(classes.hiddenCol); 8641 } 8642 function hideColumn(headerCell) { 8643 tblsaw._$getCells(headerCell).addClass(classes.hiddenCol); 8644 } 8645 function persistColumn(headerCell) { 8646 tblsaw._$getCells(headerCell).addClass(classes.persistCol); 8647 } 8648 function isPersistent(headerCell) { 8649 return $27(headerCell).is('[data-tablesaw-priority="persist"]'); 8650 } 8651 function unmaintainWidths() { 8652 $table.removeClass(classes.persistWidths); 8653 $27("#" + tableId + "-persist").remove(); 8654 } 8655 function maintainWidths() { 8656 var prefix = "#" + tableId + ".tablesaw-swipe "; 8657 var styles = []; 8658 var tableWidth = $table.width(); 8659 var tableWidthNoPersistantColumns = tableWidth; 8660 var hash = []; 8661 var newHash; 8662 $headerCells.each(function(index) { 8663 var width; 8664 if (isPersistent(this)) { 8665 width = this.offsetWidth; 8666 tableWidthNoPersistantColumns -= width; 8667 if (width < tableWidth * 0.75) { 8668 hash.push(index + "-" + width); 8669 styles.push( 8670 prefix + " ." + classes.persistCol + ":nth-child(" + (index + 1) + ") { width: " + width + "px; }" 8671 ); 8672 } 8673 } 8674 }); 8675 newHash = hash.join("_"); 8676 if (styles.length) { 8677 $table.addClass(classes.persistWidths); 8678 var $style = $27("#" + tableId + "-persist"); 8679 if (!$style.length || $style.data("tablesaw-hash") !== newHash) { 8680 $style.remove(); 8681 $27("<style>" + styles.join("\n") + "</style>").attr("id", tableId + "-persist").data("tablesaw-hash", newHash).appendTo($head); 8682 } 8683 } 8684 return tableWidthNoPersistantColumns; 8685 } 8686 function getNext() { 8687 var next = []; 8688 var checkFound; 8689 $headerCellsNoPersist.each(function(i) { 8690 var $t = $27(this); 8691 var isHidden = $t.css("display") === "none" || $t.is("." + classes.hiddenCol); 8692 if (!isHidden && !checkFound) { 8693 checkFound = true; 8694 next[0] = i; 8695 } else if (isHidden && checkFound) { 8696 next[1] = i; 8697 return false; 8698 } 8699 }); 8700 return next; 8701 } 8702 function getPrev() { 8703 var next = getNext(); 8704 return [next[1] - 1, next[0] - 1]; 8705 } 8706 function canNavigate(pair) { 8707 return pair[1] > -1 && pair[1] < $headerCellsNoPersist.length; 8708 } 8709 function matchesMedia() { 8710 var matchMedia = $table.attr("data-tablesaw-swipe-media"); 8711 return !matchMedia || "matchMedia" in window2 && window2.matchMedia(matchMedia).matches; 8712 } 8713 function fakeBreakpoints() { 8714 if (!matchesMedia()) { 8715 return; 8716 } 8717 var containerWidth = $table.parent().width(), persist = [], sum = 0, sums = [], visibleNonPersistantCount = $headerCells.length; 8718 $headerCells.each(function(index) { 8719 var $t = $27(this), isPersist = $t.is('[data-tablesaw-priority="persist"]'); 8720 persist.push(isPersist); 8721 sum += headerWidths[index]; 8722 sums.push(sum); 8723 if (isPersist || sum > containerWidth) { 8724 visibleNonPersistantCount--; 8725 } 8726 }); 8727 var needsNonPersistentColumn = visibleNonPersistantCount === 0; 8728 $headerCells.each(function(index) { 8729 if (sums[index] > containerWidth) { 8730 hideColumn(this); 8731 } 8732 }); 8733 var firstPersist = true; 8734 $headerCells.each(function(index) { 8735 if (persist[index]) { 8736 persistColumn(this); 8737 if (firstPersist) { 8738 tblsaw._$getCells(this).css("width", sums[index] + "px"); 8739 firstPersist = false; 8740 } 8741 return; 8742 } 8743 if (sums[index] <= containerWidth || needsNonPersistentColumn) { 8744 needsNonPersistentColumn = false; 8745 showColumn(this); 8746 tblsaw.updateColspanCells(classes.hiddenCol, this, true); 8747 } 8748 }); 8749 unmaintainWidths(); 8750 $table.trigger("tablesawcolumns"); 8751 } 8752 function goForward() { 8753 navigate(true); 8754 } 8755 function goBackward() { 8756 navigate(false); 8757 } 8758 function navigate(isNavigateForward) { 8759 var pair; 8760 if (isNavigateForward) { 8761 pair = getNext(); 8762 } else { 8763 pair = getPrev(); 8764 } 8765 if (canNavigate(pair)) { 8766 if (isNaN(pair[0])) { 8767 if (isNavigateForward) { 8768 pair[0] = 0; 8769 } else { 8770 pair[0] = $headerCellsNoPersist.length - 1; 8771 } 8772 } 8773 var roomForColumnsWidth = maintainWidths(); 8774 var hideColumnIndex = pair[0]; 8775 var showColumnIndex = pair[1]; 8776 var columnToShow; 8777 var columnToHide = $headerCellsNoPersist.get(hideColumnIndex); 8778 var wasAtLeastOneColumnShown = false; 8779 var atLeastOneColumnIsVisible = false; 8780 hideColumn(columnToHide); 8781 tblsaw.updateColspanCells(classes.hiddenCol, columnToHide, true); 8782 var columnIndex = hideColumnIndex + (isNavigateForward ? 1 : -1); 8783 while (columnIndex >= 0 && columnIndex < headerWidthsNoPersist.length) { 8784 roomForColumnsWidth -= headerWidthsNoPersist[columnIndex]; 8785 var $columnToShow = $headerCellsNoPersist.eq(columnIndex); 8786 if ($columnToShow.is(".tablesaw-swipe-cellhidden")) { 8787 if (roomForColumnsWidth > 0) { 8788 columnToShow = $columnToShow.get(0); 8789 wasAtLeastOneColumnShown = true; 8790 atLeastOneColumnIsVisible = true; 8791 showColumn(columnToShow); 8792 tblsaw.updateColspanCells(classes.hiddenCol, columnToShow, false); 8793 } 8794 } else { 8795 atLeastOneColumnIsVisible = true; 8796 } 8797 if (isNavigateForward) { 8798 columnIndex++; 8799 } else { 8800 columnIndex--; 8801 } 8802 } 8803 if (!atLeastOneColumnIsVisible) { 8804 columnToShow = $headerCellsNoPersist.get(showColumnIndex); 8805 showColumn(columnToShow); 8806 tblsaw.updateColspanCells(classes.hiddenCol, columnToShow, false); 8807 } else if (!wasAtLeastOneColumnShown && canNavigate(isNavigateForward ? getNext() : getPrev())) { 8808 navigate(isNavigateForward); 8809 } 8810 $table.trigger("tablesawcolumns"); 8811 } 8812 } 8813 $prevBtn.add($nextBtn).on("click", function(e2) { 8814 if (!!$27(e2.target).closest($nextBtn).length) { 8815 goForward(); 8816 } else { 8817 goBackward(); 8818 } 8819 e2.preventDefault(); 8820 }); 8821 function getCoord(event, key) { 8822 return (event.touches || event.originalEvent.touches)[0][key]; 8823 } 8824 if (!$table.is("[" + attrs.disableTouchEvents + "]")) { 8825 $table.on("touchstart.swipetoggle", function(e2) { 8826 var originX = getCoord(e2, "pageX"); 8827 var originY = getCoord(e2, "pageY"); 8828 var x; 8829 var y; 8830 var scrollTop = window2.pageYOffset; 8831 $27(window2).off(Tablesaw.events.resize, fakeBreakpoints); 8832 $27(this).on("touchmove.swipetoggle", function(e3) { 8833 x = getCoord(e3, "pageX"); 8834 y = getCoord(e3, "pageY"); 8835 }).on("touchend.swipetoggle", function() { 8836 var cfg = tbl.getConfig({ 8837 swipeHorizontalThreshold: 30, 8838 swipeVerticalThreshold: 30 8839 }); 8840 var verticalThreshold = cfg.swipe ? cfg.swipe.verticalThreshold : cfg.swipeVerticalThreshold; 8841 var horizontalThreshold = cfg.swipe ? cfg.swipe.horizontalThreshold : cfg.swipeHorizontalThreshold; 8842 var isPageScrolled = Math.abs(window2.pageYOffset - scrollTop) >= verticalThreshold; 8843 var isVerticalSwipe = Math.abs(y - originY) >= verticalThreshold; 8844 if (!isVerticalSwipe && !isPageScrolled) { 8845 if (x - originX < -1 * horizontalThreshold) { 8846 goForward(); 8847 } 8848 if (x - originX > horizontalThreshold) { 8849 goBackward(); 8850 } 8851 } 8852 window2.setTimeout(function() { 8853 $27(window2).on(Tablesaw.events.resize, fakeBreakpoints); 8854 }, 300); 8855 $27(this).off("touchmove.swipetoggle touchend.swipetoggle"); 8856 }); 8857 }); 8858 } 8859 $table.on("tablesawcolumns.swipetoggle", function() { 8860 var canGoPrev = canNavigate(getPrev()); 8861 var canGoNext = canNavigate(getNext()); 8862 $prevBtn[canGoPrev ? "removeClass" : "addClass"](classes.hideBtn); 8863 $nextBtn[canGoNext ? "removeClass" : "addClass"](classes.hideBtn); 8864 tblsaw.$toolbar[!canGoPrev && !canGoNext ? "addClass" : "removeClass"]( 8865 classes.allColumnsVisible 8866 ); 8867 }).on("tablesawnext.swipetoggle", function() { 8868 goForward(); 8869 }).on("tablesawprev.swipetoggle", function() { 8870 goBackward(); 8871 }).on(Tablesaw.events.destroy + ".swipetoggle", function() { 8872 var $t = $27(this); 8873 $t.removeClass("tablesaw-swipe"); 8874 tblsaw.$toolbar.find(".tablesaw-advance").remove(); 8875 $27(window2).off(Tablesaw.events.resize, fakeBreakpoints); 8876 $t.off(".swipetoggle"); 8877 }).on(Tablesaw.events.refresh, function() { 8878 unmaintainWidths(); 8879 initMinHeaderWidths(); 8880 fakeBreakpoints(); 8881 }); 8882 fakeBreakpoints(); 8883 $27(window2).on(Tablesaw.events.resize, fakeBreakpoints); 8884 } 8885 $27(document2).on(Tablesaw.events.create, function(e2, tablesaw) { 8886 if (tablesaw.mode === "swipe") { 8887 createSwipeTable(tablesaw, tablesaw.$table); 8888 } 8889 }); 8890 })(); 8891 (function() { 8892 var MiniMap = { 8893 attr: { 8894 init: "data-tablesaw-minimap" 8895 }, 8896 show: function(table) { 8897 var mq = table.getAttribute(MiniMap.attr.init); 8898 if (mq === "") { 8899 return true; 8900 } else if (mq && "matchMedia" in window2) { 8901 return window2.matchMedia(mq).matches; 8902 } 8903 return false; 8904 } 8905 }; 8906 function createMiniMap($table) { 8907 var tblsaw = $table.data("tablesaw"); 8908 var $btns = $27('<div class="tablesaw-advance minimap">'); 8909 var $dotNav = $27('<ul class="tablesaw-advance-dots">').appendTo($btns); 8910 var hideDot = "tablesaw-advance-dots-hide"; 8911 var $headerCells = $table.data("tablesaw")._getPrimaryHeaderCells(); 8912 $headerCells.each(function() { 8913 $dotNav.append("<li><i></i></li>"); 8914 }); 8915 $btns.appendTo(tblsaw.$toolbar); 8916 function showHideNav() { 8917 if (!MiniMap.show($table[0])) { 8918 $btns.css("display", "none"); 8919 return; 8920 } 8921 $btns.css("display", "block"); 8922 var dots = $dotNav.find("li").removeClass(hideDot); 8923 $table.find("thead th").each(function(i) { 8924 if ($27(this).css("display") === "none") { 8925 dots.eq(i).addClass(hideDot); 8926 } 8927 }); 8928 } 8929 showHideNav(); 8930 $27(window2).on(Tablesaw.events.resize, showHideNav); 8931 $table.on("tablesawcolumns.minimap", function() { 8932 showHideNav(); 8933 }).on(Tablesaw.events.destroy + ".minimap", function() { 8934 var $t = $27(this); 8935 tblsaw.$toolbar.find(".tablesaw-advance").remove(); 8936 $27(window2).off(Tablesaw.events.resize, showHideNav); 8937 $t.off(".minimap"); 8938 }); 8939 } 8940 $27(document2).on(Tablesaw.events.create, function(e2, tablesaw) { 8941 if ((tablesaw.mode === "swipe" || tablesaw.mode === "columntoggle") && tablesaw.$table.is("[ " + MiniMap.attr.init + "]")) { 8942 createMiniMap(tablesaw.$table); 8943 } 8944 }); 8945 Tablesaw.MiniMap = MiniMap; 8946 })(); 8947 (function() { 8948 var S = { 8949 selectors: { 8950 init: "table[data-tablesaw-mode-switch]" 8951 }, 8952 attributes: { 8953 excludeMode: "data-tablesaw-mode-exclude" 8954 }, 8955 classes: { 8956 main: "tablesaw-modeswitch", 8957 toolbar: "tablesaw-bar-section" 8958 }, 8959 modes: ["stack", "swipe", "columntoggle"], 8960 init: function(table) { 8961 var $table = $27(table); 8962 var tblsaw = $table.data("tablesaw"); 8963 var ignoreMode = $table.attr(S.attributes.excludeMode); 8964 var $toolbar = tblsaw.$toolbar; 8965 var $switcher = $27("<div>").addClass(S.classes.main + " " + S.classes.toolbar); 8966 var html = [ 8967 '<label><span class="abbreviated">' + Tablesaw.i18n.modeSwitchColumnsAbbreviated + '</span><span class="longform">' + Tablesaw.i18n.modeSwitchColumns + "</span>:" 8968 ], dataMode = $table.attr("data-tablesaw-mode"), isSelected; 8969 html.push('<span class="btn tablesaw-btn"><select>'); 8970 for (var j = 0, k = S.modes.length; j < k; j++) { 8971 if (ignoreMode && ignoreMode.toLowerCase() === S.modes[j]) { 8972 continue; 8973 } 8974 isSelected = dataMode === S.modes[j]; 8975 html.push( 8976 "<option" + (isSelected ? " selected" : "") + ' value="' + S.modes[j] + '">' + Tablesaw.i18n.modes[j] + "</option>" 8977 ); 8978 } 8979 html.push("</select></span></label>"); 8980 $switcher.html(html.join("")); 8981 var $otherToolbarItems = $toolbar.find(".tablesaw-advance").eq(0); 8982 if ($otherToolbarItems.length) { 8983 $switcher.insertBefore($otherToolbarItems); 8984 } else { 8985 $switcher.appendTo($toolbar); 8986 } 8987 $switcher.find(".tablesaw-btn").tablesawbtn(); 8988 $switcher.find("select").on("change", function(event) { 8989 return S.onModeChange.call(table, event, $27(this).val()); 8990 }); 8991 }, 8992 onModeChange: function(event, val) { 8993 var $table = $27(this); 8994 var tblsaw = $table.data("tablesaw"); 8995 var $switcher = tblsaw.$toolbar.find("." + S.classes.main); 8996 $switcher.remove(); 8997 tblsaw.destroy(); 8998 $table.attr("data-tablesaw-mode", val); 8999 $table.tablesaw(); 9000 } 9001 }; 9002 $27(document2).on(Tablesaw.events.create, function(e2, Tablesaw2) { 9003 if (Tablesaw2.$table.is(S.selectors.init)) { 9004 S.init(Tablesaw2.table); 9005 } 9006 }); 9007 })(); 9008 (function() { 9009 var pluginName = "tablesawCheckAll"; 9010 function CheckAll(tablesaw) { 9011 this.tablesaw = tablesaw; 9012 this.$table = tablesaw.$table; 9013 this.attr = "data-tablesaw-checkall"; 9014 this.checkAllSelector = "[" + this.attr + "]"; 9015 this.forceCheckedSelector = "[" + this.attr + "-checked]"; 9016 this.forceUncheckedSelector = "[" + this.attr + "-unchecked]"; 9017 this.checkboxSelector = 'input[type="checkbox"]'; 9018 this.$triggers = null; 9019 this.$checkboxes = null; 9020 if (this.$table.data(pluginName)) { 9021 return; 9022 } 9023 this.$table.data(pluginName, this); 9024 this.init(); 9025 } 9026 CheckAll.prototype._filterCells = function($checkboxes) { 9027 return $checkboxes.filter(function() { 9028 return !$27(this).closest("tr").is("[data-tablesaw-subrow],[data-tablesaw-ignorerow]"); 9029 }).find(this.checkboxSelector).not(this.checkAllSelector); 9030 }; 9031 CheckAll.prototype.getCheckboxesForButton = function(button) { 9032 return this._filterCells($27($27(button).attr(this.attr))); 9033 }; 9034 CheckAll.prototype.getCheckboxesForCheckbox = function(checkbox) { 9035 return this._filterCells($27($27(checkbox).closest("th")[0].cells)); 9036 }; 9037 CheckAll.prototype.init = function() { 9038 var self = this; 9039 this.$table.find(this.checkAllSelector).each(function() { 9040 var $trigger = $27(this); 9041 if ($trigger.is(self.checkboxSelector)) { 9042 self.addCheckboxEvents(this); 9043 } else { 9044 self.addButtonEvents(this); 9045 } 9046 }); 9047 }; 9048 CheckAll.prototype.addButtonEvents = function(trigger) { 9049 var self = this; 9050 $27(trigger).on("click", function(event) { 9051 event.preventDefault(); 9052 var $checkboxes = self.getCheckboxesForButton(this); 9053 var allChecked = true; 9054 $checkboxes.each(function() { 9055 if (!this.checked) { 9056 allChecked = false; 9057 } 9058 }); 9059 var setChecked; 9060 if ($27(this).is(self.forceCheckedSelector)) { 9061 setChecked = true; 9062 } else if ($27(this).is(self.forceUncheckedSelector)) { 9063 setChecked = false; 9064 } else { 9065 setChecked = allChecked ? false : true; 9066 } 9067 $checkboxes.each(function() { 9068 this.checked = setChecked; 9069 $27(this).trigger("change." + pluginName); 9070 }); 9071 }); 9072 }; 9073 CheckAll.prototype.addCheckboxEvents = function(trigger) { 9074 var self = this; 9075 $27(trigger).on("change", function() { 9076 var setChecked = this.checked; 9077 self.getCheckboxesForCheckbox(this).each(function() { 9078 this.checked = setChecked; 9079 }); 9080 }); 9081 var $checkboxes = self.getCheckboxesForCheckbox(trigger); 9082 $checkboxes.on("change." + pluginName, function() { 9083 var checkedCount = 0; 9084 $checkboxes.each(function() { 9085 if (this.checked) { 9086 checkedCount++; 9087 } 9088 }); 9089 var allSelected = checkedCount === $checkboxes.length; 9090 trigger.checked = allSelected; 9091 trigger.indeterminate = checkedCount !== 0 && !allSelected; 9092 }); 9093 }; 9094 $27(document2).on(Tablesaw.events.create, function(e2, tablesaw) { 9095 new CheckAll(tablesaw); 9096 }); 9097 Tablesaw.CheckAll = CheckAll; 9098 })(); 9099 return Tablesaw; 9100 }); 9101 } 9102 }); 9103 9104
vendor: 2,654 bytes, lines 9104-9180
9104// node_modules/ev-emitter/ev-emitter.js 9105 var require_ev_emitter = __commonJS({ 9106 "node_modules/ev-emitter/ev-emitter.js"(exports, module) { 9107 (function(global, factory) { 9108 if (typeof define == "function" && define.amd) { 9109 define(factory); 9110 } else if (typeof module == "object" && module.exports) { 9111 module.exports = factory(); 9112 } else { 9113 global.EvEmitter = factory(); 9114 } 9115 })(typeof window != "undefined" ? window : exports, function() { 9116 "use strict"; 9117 function EvEmitter() { 9118 } 9119 var proto = EvEmitter.prototype; 9120 proto.on = function(eventName, listener) { 9121 if (!eventName || !listener) { 9122 return; 9123 } 9124 var events = this._events = this._events || {}; 9125 var listeners = events[eventName] = events[eventName] || []; 9126 if (listeners.indexOf(listener) == -1) { 9127 listeners.push(listener); 9128 } 9129 return this; 9130 }; 9131 proto.once = function(eventName, listener) { 9132 if (!eventName || !listener) { 9133 return; 9134 } 9135 this.on(eventName, listener); 9136 var onceEvents = this._onceEvents = this._onceEvents || {}; 9137 var onceListeners = onceEvents[eventName] = onceEvents[eventName] || {}; 9138 onceListeners[listener] = true; 9139 return this; 9140 }; 9141 proto.off = function(eventName, listener) { 9142 var listeners = this._events && this._events[eventName]; 9143 if (!listeners || !listeners.length) { 9144 return; 9145 } 9146 var index = listeners.indexOf(listener); 9147 if (index != -1) { 9148 listeners.splice(index, 1); 9149 } 9150 return this; 9151 }; 9152 proto.emitEvent = function(eventName, args) { 9153 var listeners = this._events && this._events[eventName]; 9154 if (!listeners || !listeners.length) { 9155 return; 9156 } 9157 listeners = listeners.slice(0); 9158 args = args || []; 9159 var onceListeners = this._onceEvents && this._onceEvents[eventName]; 9160 for (var i = 0; i < listeners.length; i++) { 9161 var listener = listeners[i]; 9162 var isOnce = onceListeners && onceListeners[listener]; 9163 if (isOnce) { 9164 this.off(eventName, listener); 9165 delete onceListeners[listener]; 9166 } 9167 listener.apply(this, args); 9168 } 9169 return this; 9170 }; 9171 proto.allOff = function() { 9172 delete this._events; 9173 delete this._onceEvents; 9174 }; 9175 return EvEmitter; 9176 }); 9177 } 9178 }); 9179 9180
vendor: 4,889 bytes, lines 9180-9310
9180// node_modules/get-size/get-size.js 9181 var require_get_size = __commonJS({ 9182 "node_modules/get-size/get-size.js"(exports, module) { 9183 (function(window2, factory) { 9184 if (typeof define == "function" && define.amd) { 9185 define(factory); 9186 } else if (typeof module == "object" && module.exports) { 9187 module.exports = factory(); 9188 } else { 9189 window2.getSize = factory(); 9190 } 9191 })(window, function factory() { 9192 "use strict"; 9193 function getStyleSize(value) { 9194 var num = parseFloat(value); 9195 var isValid = value.indexOf("%") == -1 && !isNaN(num); 9196 return isValid && num; 9197 } 9198 function noop2() { 9199 } 9200 var logError = typeof console == "undefined" ? noop2 : function(message) { 9201 console.error(message); 9202 }; 9203 var measurements = [ 9204 "paddingLeft", 9205 "paddingRight", 9206 "paddingTop", 9207 "paddingBottom", 9208 "marginLeft", 9209 "marginRight", 9210 "marginTop", 9211 "marginBottom", 9212 "borderLeftWidth", 9213 "borderRightWidth", 9214 "borderTopWidth", 9215 "borderBottomWidth" 9216 ]; 9217 var measurementsLength = measurements.length; 9218 function getZeroSize() { 9219 var size = { 9220 width: 0, 9221 height: 0, 9222 innerWidth: 0, 9223 innerHeight: 0, 9224 outerWidth: 0, 9225 outerHeight: 0 9226 }; 9227 for (var i = 0; i < measurementsLength; i++) { 9228 var measurement = measurements[i]; 9229 size[measurement] = 0; 9230 } 9231 return size; 9232 } 9233 function getStyle(elem) { 9234 var style = getComputedStyle(elem); 9235 if (!style) { 9236 logError("Style returned " + style + ". Are you running this code in a hidden iframe on Firefox? See https://bit.ly/getsizebug1"); 9237 } 9238 return style; 9239 } 9240 var isSetup = false; 9241 var isBoxSizeOuter; 9242 function setup2() { 9243 if (isSetup) { 9244 return; 9245 } 9246 isSetup = true; 9247 var div = document.createElement("div"); 9248 div.style.width = "200px"; 9249 div.style.padding = "1px 2px 3px 4px"; 9250 div.style.borderStyle = "solid"; 9251 div.style.borderWidth = "1px 2px 3px 4px"; 9252 div.style.boxSizing = "border-box"; 9253 var body2 = document.body || document.documentElement; 9254 body2.appendChild(div); 9255 var style = getStyle(div); 9256 isBoxSizeOuter = Math.round(getStyleSize(style.width)) == 200; 9257 getSize.isBoxSizeOuter = isBoxSizeOuter; 9258 body2.removeChild(div); 9259 } 9260 function getSize(elem) { 9261 setup2(); 9262 if (typeof elem == "string") { 9263 elem = document.querySelector(elem); 9264 } 9265 if (!elem || typeof elem != "object" || !elem.nodeType) { 9266 return; 9267 } 9268 var style = getStyle(elem); 9269 if (style.display == "none") { 9270 return getZeroSize(); 9271 } 9272 var size = {}; 9273 size.width = elem.offsetWidth; 9274 size.height = elem.offsetHeight; 9275 var isBorderBox = size.isBorderBox = style.boxSizing == "border-box"; 9276 for (var i = 0; i < measurementsLength; i++) { 9277 var measurement = measurements[i]; 9278 var value = style[measurement]; 9279 var num = parseFloat(value); 9280 size[measurement] = !isNaN(num) ? num : 0; 9281 } 9282 var paddingWidth = size.paddingLeft + size.paddingRight; 9283 var paddingHeight = size.paddingTop + size.paddingBottom; 9284 var marginWidth = size.marginLeft + size.marginRight; 9285 var marginHeight = size.marginTop + size.marginBottom; 9286 var borderWidth = size.borderLeftWidth + size.borderRightWidth; 9287 var borderHeight = size.borderTopWidth + size.borderBottomWidth; 9288 var isBorderBoxSizeOuter = isBorderBox && isBoxSizeOuter; 9289 var styleWidth = getStyleSize(style.width); 9290 if (styleWidth !== false) { 9291 size.width = styleWidth + // add padding and border unless it's already including it 9292 (isBorderBoxSizeOuter ? 0 : paddingWidth + borderWidth); 9293 } 9294 var styleHeight = getStyleSize(style.height); 9295 if (styleHeight !== false) { 9296 size.height = styleHeight + // add padding and border unless it's already including it 9297 (isBorderBoxSizeOuter ? 0 : paddingHeight + borderHeight); 9298 } 9299 size.innerWidth = size.width - (paddingWidth + borderWidth); 9300 size.innerHeight = size.height - (paddingHeight + borderHeight); 9301 size.outerWidth = size.width + marginWidth; 9302 size.outerHeight = size.height + marginHeight; 9303 return size; 9304 } 9305 return getSize; 9306 }); 9307 } 9308 }); 9309 9310
vendor: 1,284 bytes, lines 9310-9348
9310// node_modules/desandro-matches-selector/matches-selector.js 9311 var require_matches_selector = __commonJS({ 9312 "node_modules/desandro-matches-selector/matches-selector.js"(exports, module) { 9313 (function(window2, factory) { 9314 "use strict"; 9315 if (typeof define == "function" && define.amd) { 9316 define(factory); 9317 } else if (typeof module == "object" && module.exports) { 9318 module.exports = factory(); 9319 } else { 9320 window2.matchesSelector = factory(); 9321 } 9322 })(window, function factory() { 9323 "use strict"; 9324 var matchesMethod = (function() { 9325 var ElemProto = window.Element.prototype; 9326 if (ElemProto.matches) { 9327 return "matches"; 9328 } 9329 if (ElemProto.matchesSelector) { 9330 return "matchesSelector"; 9331 } 9332 var prefixes = ["webkit", "moz", "ms", "o"]; 9333 for (var i = 0; i < prefixes.length; i++) { 9334 var prefix = prefixes[i]; 9335 var method = prefix + "MatchesSelector"; 9336 if (ElemProto[method]) { 9337 return method; 9338 } 9339 } 9340 })(); 9341 return function matchesSelector(elem, selector) { 9342 return elem[matchesMethod](selector); 9343 }; 9344 }); 9345 } 9346 }); 9347 9348
vendor: 5,438 bytes, lines 9348-9503
9348// node_modules/fizzy-ui-utils/utils.js 9349 var require_utils = __commonJS({ 9350 "node_modules/fizzy-ui-utils/utils.js"(exports, module) { 9351 (function(window2, factory) { 9352 if (typeof define == "function" && define.amd) { 9353 define([ 9354 "desandro-matches-selector/matches-selector" 9355 ], function(matchesSelector) { 9356 return factory(window2, matchesSelector); 9357 }); 9358 } else if (typeof module == "object" && module.exports) { 9359 module.exports = factory( 9360 window2, 9361 require_matches_selector() 9362 ); 9363 } else { 9364 window2.fizzyUIUtils = factory( 9365 window2, 9366 window2.matchesSelector 9367 ); 9368 } 9369 })(window, function factory(window2, matchesSelector) { 9370 "use strict"; 9371 var utils = {}; 9372 utils.extend = function(a, b) { 9373 for (var prop in b) { 9374 a[prop] = b[prop]; 9375 } 9376 return a; 9377 }; 9378 utils.modulo = function(num, div) { 9379 return (num % div + div) % div; 9380 }; 9381 var arraySlice = Array.prototype.slice; 9382 utils.makeArray = function(obj) { 9383 if (Array.isArray(obj)) { 9384 return obj; 9385 } 9386 if (obj === null || obj === void 0) { 9387 return []; 9388 } 9389 var isArrayLike = typeof obj == "object" && typeof obj.length == "number"; 9390 if (isArrayLike) { 9391 return arraySlice.call(obj); 9392 } 9393 return [obj]; 9394 }; 9395 utils.removeFrom = function(ary, obj) { 9396 var index = ary.indexOf(obj); 9397 if (index != -1) { 9398 ary.splice(index, 1); 9399 } 9400 }; 9401 utils.getParent = function(elem, selector) { 9402 while (elem.parentNode && elem != document.body) { 9403 elem = elem.parentNode; 9404 if (matchesSelector(elem, selector)) { 9405 return elem; 9406 } 9407 } 9408 }; 9409 utils.getQueryElement = function(elem) { 9410 if (typeof elem == "string") { 9411 return document.querySelector(elem); 9412 } 9413 return elem; 9414 }; 9415 utils.handleEvent = function(event) { 9416 var method = "on" + event.type; 9417 if (this[method]) { 9418 this[method](event); 9419 } 9420 }; 9421 utils.filterFindElements = function(elems, selector) { 9422 elems = utils.makeArray(elems); 9423 var ffElems = []; 9424 elems.forEach(function(elem) { 9425 if (!(elem instanceof HTMLElement)) { 9426 return; 9427 } 9428 if (!selector) { 9429 ffElems.push(elem); 9430 return; 9431 } 9432 if (matchesSelector(elem, selector)) { 9433 ffElems.push(elem); 9434 } 9435 var childElems = elem.querySelectorAll(selector); 9436 for (var i = 0; i < childElems.length; i++) { 9437 ffElems.push(childElems[i]); 9438 } 9439 }); 9440 return ffElems; 9441 }; 9442 utils.debounceMethod = function(_class, methodName, threshold) { 9443 threshold = threshold || 100; 9444 var method = _class.prototype[methodName]; 9445 var timeoutName = methodName + "Timeout"; 9446 _class.prototype[methodName] = function() { 9447 var timeout = this[timeoutName]; 9448 clearTimeout(timeout); 9449 var args = arguments; 9450 var _this = this; 9451 this[timeoutName] = setTimeout(function() { 9452 method.apply(_this, args); 9453 delete _this[timeoutName]; 9454 }, threshold); 9455 }; 9456 }; 9457 utils.docReady = function(callback) { 9458 var readyState = document.readyState; 9459 if (readyState == "complete" || readyState == "interactive") { 9460 setTimeout(callback); 9461 } else { 9462 document.addEventListener("DOMContentLoaded", callback); 9463 } 9464 }; 9465 utils.toDashed = function(str) { 9466 return str.replace(/(.)([A-Z])/g, function(match, $1, $27) { 9467 return $1 + "-" + $27; 9468 }).toLowerCase(); 9469 }; 9470 var console2 = window2.console; 9471 utils.htmlInit = function(WidgetClass, namespace) { 9472 utils.docReady(function() { 9473 var dashedNamespace = utils.toDashed(namespace); 9474 var dataAttr = "data-" + dashedNamespace; 9475 var dataAttrElems = document.querySelectorAll("[" + dataAttr + "]"); 9476 var jsDashElems = document.querySelectorAll(".js-" + dashedNamespace); 9477 var elems = utils.makeArray(dataAttrElems).concat(utils.makeArray(jsDashElems)); 9478 var dataOptionsAttr = dataAttr + "-options"; 9479 var jQuery2 = window2.jQuery; 9480 elems.forEach(function(elem) { 9481 var attr = elem.getAttribute(dataAttr) || elem.getAttribute(dataOptionsAttr); 9482 var options; 9483 try { 9484 options = attr && JSON.parse(attr); 9485 } catch (error2) { 9486 if (console2) { 9487 console2.error("Error parsing " + dataAttr + " on " + elem.className + ": " + error2); 9488 } 9489 return; 9490 } 9491 var instance2 = new WidgetClass(elem, options); 9492 if (jQuery2) { 9493 jQuery2.data(elem, namespace, instance2); 9494 } 9495 }); 9496 }); 9497 }; 9498 return utils; 9499 }); 9500 } 9501 }); 9502 9503
vendor: 13,122 bytes, lines 9503-9864
9503// node_modules/outlayer/item.js 9504 var require_item = __commonJS({ 9505 "node_modules/outlayer/item.js"(exports, module) { 9506 (function(window2, factory) { 9507 if (typeof define == "function" && define.amd) { 9508 define( 9509 [ 9510 "ev-emitter/ev-emitter", 9511 "get-size/get-size" 9512 ], 9513 factory 9514 ); 9515 } else if (typeof module == "object" && module.exports) { 9516 module.exports = factory( 9517 require_ev_emitter(), 9518 require_get_size() 9519 ); 9520 } else { 9521 window2.Outlayer = {}; 9522 window2.Outlayer.Item = factory( 9523 window2.EvEmitter, 9524 window2.getSize 9525 ); 9526 } 9527 })(window, function factory(EvEmitter, getSize) { 9528 "use strict"; 9529 function isEmptyObj(obj) { 9530 for (var prop in obj) { 9531 return false; 9532 } 9533 prop = null; 9534 return true; 9535 } 9536 var docElemStyle = document.documentElement.style; 9537 var transitionProperty = typeof docElemStyle.transition == "string" ? "transition" : "WebkitTransition"; 9538 var transformProperty = typeof docElemStyle.transform == "string" ? "transform" : "WebkitTransform"; 9539 var transitionEndEvent = { 9540 WebkitTransition: "webkitTransitionEnd", 9541 transition: "transitionend" 9542 }[transitionProperty]; 9543 var vendorProperties = { 9544 transform: transformProperty, 9545 transition: transitionProperty, 9546 transitionDuration: transitionProperty + "Duration", 9547 transitionProperty: transitionProperty + "Property", 9548 transitionDelay: transitionProperty + "Delay" 9549 }; 9550 function Item(element, layout) { 9551 if (!element) { 9552 return; 9553 } 9554 this.element = element; 9555 this.layout = layout; 9556 this.position = { 9557 x: 0, 9558 y: 0 9559 }; 9560 this._create(); 9561 } 9562 var proto = Item.prototype = Object.create(EvEmitter.prototype); 9563 proto.constructor = Item; 9564 proto._create = function() { 9565 this._transn = { 9566 ingProperties: {}, 9567 clean: {}, 9568 onEnd: {} 9569 }; 9570 this.css({ 9571 position: "absolute" 9572 }); 9573 }; 9574 proto.handleEvent = function(event) { 9575 var method = "on" + event.type; 9576 if (this[method]) { 9577 this[method](event); 9578 } 9579 }; 9580 proto.getSize = function() { 9581 this.size = getSize(this.element); 9582 }; 9583 proto.css = function(style) { 9584 var elemStyle = this.element.style; 9585 for (var prop in style) { 9586 var supportedProp = vendorProperties[prop] || prop; 9587 elemStyle[supportedProp] = style[prop]; 9588 } 9589 }; 9590 proto.getPosition = function() { 9591 var style = getComputedStyle(this.element); 9592 var isOriginLeft = this.layout._getOption("originLeft"); 9593 var isOriginTop = this.layout._getOption("originTop"); 9594 var xValue = style[isOriginLeft ? "left" : "right"]; 9595 var yValue = style[isOriginTop ? "top" : "bottom"]; 9596 var x = parseFloat(xValue); 9597 var y = parseFloat(yValue); 9598 var layoutSize = this.layout.size; 9599 if (xValue.indexOf("%") != -1) { 9600 x = x / 100 * layoutSize.width; 9601 } 9602 if (yValue.indexOf("%") != -1) { 9603 y = y / 100 * layoutSize.height; 9604 } 9605 x = isNaN(x) ? 0 : x; 9606 y = isNaN(y) ? 0 : y; 9607 x -= isOriginLeft ? layoutSize.paddingLeft : layoutSize.paddingRight; 9608 y -= isOriginTop ? layoutSize.paddingTop : layoutSize.paddingBottom; 9609 this.position.x = x; 9610 this.position.y = y; 9611 }; 9612 proto.layoutPosition = function() { 9613 var layoutSize = this.layout.size; 9614 var style = {}; 9615 var isOriginLeft = this.layout._getOption("originLeft"); 9616 var isOriginTop = this.layout._getOption("originTop"); 9617 var xPadding = isOriginLeft ? "paddingLeft" : "paddingRight"; 9618 var xProperty = isOriginLeft ? "left" : "right"; 9619 var xResetProperty = isOriginLeft ? "right" : "left"; 9620 var x = this.position.x + layoutSize[xPadding]; 9621 style[xProperty] = this.getXValue(x); 9622 style[xResetProperty] = ""; 9623 var yPadding = isOriginTop ? "paddingTop" : "paddingBottom"; 9624 var yProperty = isOriginTop ? "top" : "bottom"; 9625 var yResetProperty = isOriginTop ? "bottom" : "top"; 9626 var y = this.position.y + layoutSize[yPadding]; 9627 style[yProperty] = this.getYValue(y); 9628 style[yResetProperty] = ""; 9629 this.css(style); 9630 this.emitEvent("layout", [this]); 9631 }; 9632 proto.getXValue = function(x) { 9633 var isHorizontal = this.layout._getOption("horizontal"); 9634 return this.layout.options.percentPosition && !isHorizontal ? x / this.layout.size.width * 100 + "%" : x + "px"; 9635 }; 9636 proto.getYValue = function(y) { 9637 var isHorizontal = this.layout._getOption("horizontal"); 9638 return this.layout.options.percentPosition && isHorizontal ? y / this.layout.size.height * 100 + "%" : y + "px"; 9639 }; 9640 proto._transitionTo = function(x, y) { 9641 this.getPosition(); 9642 var curX = this.position.x; 9643 var curY = this.position.y; 9644 var didNotMove = x == this.position.x && y == this.position.y; 9645 this.setPosition(x, y); 9646 if (didNotMove && !this.isTransitioning) { 9647 this.layoutPosition(); 9648 return; 9649 } 9650 var transX = x - curX; 9651 var transY = y - curY; 9652 var transitionStyle = {}; 9653 transitionStyle.transform = this.getTranslate(transX, transY); 9654 this.transition({ 9655 to: transitionStyle, 9656 onTransitionEnd: { 9657 transform: this.layoutPosition 9658 }, 9659 isCleaning: true 9660 }); 9661 }; 9662 proto.getTranslate = function(x, y) { 9663 var isOriginLeft = this.layout._getOption("originLeft"); 9664 var isOriginTop = this.layout._getOption("originTop"); 9665 x = isOriginLeft ? x : -x; 9666 y = isOriginTop ? y : -y; 9667 return "translate3d(" + x + "px, " + y + "px, 0)"; 9668 }; 9669 proto.goTo = function(x, y) { 9670 this.setPosition(x, y); 9671 this.layoutPosition(); 9672 }; 9673 proto.moveTo = proto._transitionTo; 9674 proto.setPosition = function(x, y) { 9675 this.position.x = parseFloat(x); 9676 this.position.y = parseFloat(y); 9677 }; 9678 proto._nonTransition = function(args) { 9679 this.css(args.to); 9680 if (args.isCleaning) { 9681 this._removeStyles(args.to); 9682 } 9683 for (var prop in args.onTransitionEnd) { 9684 args.onTransitionEnd[prop].call(this); 9685 } 9686 }; 9687 proto.transition = function(args) { 9688 if (!parseFloat(this.layout.options.transitionDuration)) { 9689 this._nonTransition(args); 9690 return; 9691 } 9692 var _transition = this._transn; 9693 for (var prop in args.onTransitionEnd) { 9694 _transition.onEnd[prop] = args.onTransitionEnd[prop]; 9695 } 9696 for (prop in args.to) { 9697 _transition.ingProperties[prop] = true; 9698 if (args.isCleaning) { 9699 _transition.clean[prop] = true; 9700 } 9701 } 9702 if (args.from) { 9703 this.css(args.from); 9704 var h = this.element.offsetHeight; 9705 h = null; 9706 } 9707 this.enableTransition(args.to); 9708 this.css(args.to); 9709 this.isTransitioning = true; 9710 }; 9711 function toDashedAll(str) { 9712 return str.replace(/([A-Z])/g, function($1) { 9713 return "-" + $1.toLowerCase(); 9714 }); 9715 } 9716 var transitionProps = "opacity," + toDashedAll(transformProperty); 9717 proto.enableTransition = function() { 9718 if (this.isTransitioning) { 9719 return; 9720 } 9721 var duration = this.layout.options.transitionDuration; 9722 duration = typeof duration == "number" ? duration + "ms" : duration; 9723 this.css({ 9724 transitionProperty: transitionProps, 9725 transitionDuration: duration, 9726 transitionDelay: this.staggerDelay || 0 9727 }); 9728 this.element.addEventListener(transitionEndEvent, this, false); 9729 }; 9730 proto.onwebkitTransitionEnd = function(event) { 9731 this.ontransitionend(event); 9732 }; 9733 proto.onotransitionend = function(event) { 9734 this.ontransitionend(event); 9735 }; 9736 var dashedVendorProperties = { 9737 "-webkit-transform": "transform" 9738 }; 9739 proto.ontransitionend = function(event) { 9740 if (event.target !== this.element) { 9741 return; 9742 } 9743 var _transition = this._transn; 9744 var propertyName = dashedVendorProperties[event.propertyName] || event.propertyName; 9745 delete _transition.ingProperties[propertyName]; 9746 if (isEmptyObj(_transition.ingProperties)) { 9747 this.disableTransition(); 9748 } 9749 if (propertyName in _transition.clean) { 9750 this.element.style[event.propertyName] = ""; 9751 delete _transition.clean[propertyName]; 9752 } 9753 if (propertyName in _transition.onEnd) { 9754 var onTransitionEnd = _transition.onEnd[propertyName]; 9755 onTransitionEnd.call(this); 9756 delete _transition.onEnd[propertyName]; 9757 } 9758 this.emitEvent("transitionEnd", [this]); 9759 }; 9760 proto.disableTransition = function() { 9761 this.removeTransitionStyles(); 9762 this.element.removeEventListener(transitionEndEvent, this, false); 9763 this.isTransitioning = false; 9764 }; 9765 proto._removeStyles = function(style) { 9766 var cleanStyle = {}; 9767 for (var prop in style) { 9768 cleanStyle[prop] = ""; 9769 } 9770 this.css(cleanStyle); 9771 }; 9772 var cleanTransitionStyle = { 9773 transitionProperty: "", 9774 transitionDuration: "", 9775 transitionDelay: "" 9776 }; 9777 proto.removeTransitionStyles = function() { 9778 this.css(cleanTransitionStyle); 9779 }; 9780 proto.stagger = function(delay) { 9781 delay = isNaN(delay) ? 0 : delay; 9782 this.staggerDelay = delay + "ms"; 9783 }; 9784 proto.removeElem = function() { 9785 this.element.parentNode.removeChild(this.element); 9786 this.css({ display: "" }); 9787 this.emitEvent("remove", [this]); 9788 }; 9789 proto.remove = function() { 9790 if (!transitionProperty || !parseFloat(this.layout.options.transitionDuration)) { 9791 this.removeElem(); 9792 return; 9793 } 9794 this.once("transitionEnd", function() { 9795 this.removeElem(); 9796 }); 9797 this.hide(); 9798 }; 9799 proto.reveal = function() { 9800 delete this.isHidden; 9801 this.css({ display: "" }); 9802 var options = this.layout.options; 9803 var onTransitionEnd = {}; 9804 var transitionEndProperty = this.getHideRevealTransitionEndProperty("visibleStyle"); 9805 onTransitionEnd[transitionEndProperty] = this.onRevealTransitionEnd; 9806 this.transition({ 9807 from: options.hiddenStyle, 9808 to: options.visibleStyle, 9809 isCleaning: true, 9810 onTransitionEnd 9811 }); 9812 }; 9813 proto.onRevealTransitionEnd = function() { 9814 if (!this.isHidden) { 9815 this.emitEvent("reveal"); 9816 } 9817 }; 9818 proto.getHideRevealTransitionEndProperty = function(styleProperty) { 9819 var optionStyle = this.layout.options[styleProperty]; 9820 if (optionStyle.opacity) { 9821 return "opacity"; 9822 } 9823 for (var prop in optionStyle) { 9824 return prop; 9825 } 9826 }; 9827 proto.hide = function() { 9828 this.isHidden = true; 9829 this.css({ display: "" }); 9830 var options = this.layout.options; 9831 var onTransitionEnd = {}; 9832 var transitionEndProperty = this.getHideRevealTransitionEndProperty("hiddenStyle"); 9833 onTransitionEnd[transitionEndProperty] = this.onHideTransitionEnd; 9834 this.transition({ 9835 from: options.visibleStyle, 9836 to: options.hiddenStyle, 9837 // keep hidden stuff hidden 9838 isCleaning: true, 9839 onTransitionEnd 9840 }); 9841 }; 9842 proto.onHideTransitionEnd = function() { 9843 if (this.isHidden) { 9844 this.css({ display: "none" }); 9845 this.emitEvent("hide"); 9846 } 9847 }; 9848 proto.destroy = function() { 9849 this.css({ 9850 position: "", 9851 left: "", 9852 right: "", 9853 top: "", 9854 bottom: "", 9855 transition: "", 9856 transform: "" 9857 }); 9858 }; 9859 return Item; 9860 }); 9861 } 9862 }); 9863 9864
vendor: 18,100 bytes, lines 9864-10394
9864// node_modules/outlayer/outlayer.js 9865 var require_outlayer = __commonJS({ 9866 "node_modules/outlayer/outlayer.js"(exports, module) { 9867 (function(window2, factory) { 9868 "use strict"; 9869 if (typeof define == "function" && define.amd) { 9870 define( 9871 [ 9872 "ev-emitter/ev-emitter", 9873 "get-size/get-size", 9874 "fizzy-ui-utils/utils", 9875 "./item" 9876 ], 9877 function(EvEmitter, getSize, utils, Item) { 9878 return factory(window2, EvEmitter, getSize, utils, Item); 9879 } 9880 ); 9881 } else if (typeof module == "object" && module.exports) { 9882 module.exports = factory( 9883 window2, 9884 require_ev_emitter(), 9885 require_get_size(), 9886 require_utils(), 9887 require_item() 9888 ); 9889 } else { 9890 window2.Outlayer = factory( 9891 window2, 9892 window2.EvEmitter, 9893 window2.getSize, 9894 window2.fizzyUIUtils, 9895 window2.Outlayer.Item 9896 ); 9897 } 9898 })(window, function factory(window2, EvEmitter, getSize, utils, Item) { 9899 "use strict"; 9900 var console2 = window2.console; 9901 var jQuery2 = window2.jQuery; 9902 var noop2 = function() { 9903 }; 9904 var GUID = 0; 9905 var instances = {}; 9906 function Outlayer(element, options) { 9907 var queryElement = utils.getQueryElement(element); 9908 if (!queryElement) { 9909 if (console2) { 9910 console2.error("Bad element for " + this.constructor.namespace + ": " + (queryElement || element)); 9911 } 9912 return; 9913 } 9914 this.element = queryElement; 9915 if (jQuery2) { 9916 this.$element = jQuery2(this.element); 9917 } 9918 this.options = utils.extend({}, this.constructor.defaults); 9919 this.option(options); 9920 var id = ++GUID; 9921 this.element.outlayerGUID = id; 9922 instances[id] = this; 9923 this._create(); 9924 var isInitLayout = this._getOption("initLayout"); 9925 if (isInitLayout) { 9926 this.layout(); 9927 } 9928 } 9929 Outlayer.namespace = "outlayer"; 9930 Outlayer.Item = Item; 9931 Outlayer.defaults = { 9932 containerStyle: { 9933 position: "relative" 9934 }, 9935 initLayout: true, 9936 originLeft: true, 9937 originTop: true, 9938 resize: true, 9939 resizeContainer: true, 9940 // item options 9941 transitionDuration: "0.4s", 9942 hiddenStyle: { 9943 opacity: 0, 9944 transform: "scale(0.001)" 9945 }, 9946 visibleStyle: { 9947 opacity: 1, 9948 transform: "scale(1)" 9949 } 9950 }; 9951 var proto = Outlayer.prototype; 9952 utils.extend(proto, EvEmitter.prototype); 9953 proto.option = function(opts) { 9954 utils.extend(this.options, opts); 9955 }; 9956 proto._getOption = function(option) { 9957 var oldOption = this.constructor.compatOptions[option]; 9958 return oldOption && this.options[oldOption] !== void 0 ? this.options[oldOption] : this.options[option]; 9959 }; 9960 Outlayer.compatOptions = { 9961 // currentName: oldName 9962 initLayout: "isInitLayout", 9963 horizontal: "isHorizontal", 9964 layoutInstant: "isLayoutInstant", 9965 originLeft: "isOriginLeft", 9966 originTop: "isOriginTop", 9967 resize: "isResizeBound", 9968 resizeContainer: "isResizingContainer" 9969 }; 9970 proto._create = function() { 9971 this.reloadItems(); 9972 this.stamps = []; 9973 this.stamp(this.options.stamp); 9974 utils.extend(this.element.style, this.options.containerStyle); 9975 var canBindResize = this._getOption("resize"); 9976 if (canBindResize) { 9977 this.bindResize(); 9978 } 9979 }; 9980 proto.reloadItems = function() { 9981 this.items = this._itemize(this.element.children); 9982 }; 9983 proto._itemize = function(elems) { 9984 var itemElems = this._filterFindItemElements(elems); 9985 var Item2 = this.constructor.Item; 9986 var items = []; 9987 for (var i = 0; i < itemElems.length; i++) { 9988 var elem = itemElems[i]; 9989 var item = new Item2(elem, this); 9990 items.push(item); 9991 } 9992 return items; 9993 }; 9994 proto._filterFindItemElements = function(elems) { 9995 return utils.filterFindElements(elems, this.options.itemSelector); 9996 }; 9997 proto.getItemElements = function() { 9998 return this.items.map(function(item) { 9999 return item.element; 10000 }); 10001 }; 10002 proto.layout = function() { 10003 this._resetLayout(); 10004 this._manageStamps(); 10005 var layoutInstant = this._getOption("layoutInstant"); 10006 var isInstant = layoutInstant !== void 0 ? layoutInstant : !this._isLayoutInited; 10007 this.layoutItems(this.items, isInstant); 10008 this._isLayoutInited = true; 10009 }; 10010 proto._init = proto.layout; 10011 proto._resetLayout = function() { 10012 this.getSize(); 10013 }; 10014 proto.getSize = function() { 10015 this.size = getSize(this.element); 10016 }; 10017 proto._getMeasurement = function(measurement, size) { 10018 var option = this.options[measurement]; 10019 var elem; 10020 if (!option) { 10021 this[measurement] = 0; 10022 } else { 10023 if (typeof option == "string") { 10024 elem = this.element.querySelector(option); 10025 } else if (option instanceof HTMLElement) { 10026 elem = option; 10027 } 10028 this[measurement] = elem ? getSize(elem)[size] : option; 10029 } 10030 }; 10031 proto.layoutItems = function(items, isInstant) { 10032 items = this._getItemsForLayout(items); 10033 this._layoutItems(items, isInstant); 10034 this._postLayout(); 10035 }; 10036 proto._getItemsForLayout = function(items) { 10037 return items.filter(function(item) { 10038 return !item.isIgnored; 10039 }); 10040 }; 10041 proto._layoutItems = function(items, isInstant) { 10042 this._emitCompleteOnItems("layout", items); 10043 if (!items || !items.length) { 10044 return; 10045 } 10046 var queue = []; 10047 items.forEach(function(item) { 10048 var position = this._getItemLayoutPosition(item); 10049 position.item = item; 10050 position.isInstant = isInstant || item.isLayoutInstant; 10051 queue.push(position); 10052 }, this); 10053 this._processLayoutQueue(queue); 10054 }; 10055 proto._getItemLayoutPosition = function() { 10056 return { 10057 x: 0, 10058 y: 0 10059 }; 10060 }; 10061 proto._processLayoutQueue = function(queue) { 10062 this.updateStagger(); 10063 queue.forEach(function(obj, i) { 10064 this._positionItem(obj.item, obj.x, obj.y, obj.isInstant, i); 10065 }, this); 10066 }; 10067 proto.updateStagger = function() { 10068 var stagger = this.options.stagger; 10069 if (stagger === null || stagger === void 0) { 10070 this.stagger = 0; 10071 return; 10072 } 10073 this.stagger = getMilliseconds(stagger); 10074 return this.stagger; 10075 }; 10076 proto._positionItem = function(item, x, y, isInstant, i) { 10077 if (isInstant) { 10078 item.goTo(x, y); 10079 } else { 10080 item.stagger(i * this.stagger); 10081 item.moveTo(x, y); 10082 } 10083 }; 10084 proto._postLayout = function() { 10085 this.resizeContainer(); 10086 }; 10087 proto.resizeContainer = function() { 10088 var isResizingContainer = this._getOption("resizeContainer"); 10089 if (!isResizingContainer) { 10090 return; 10091 } 10092 var size = this._getContainerSize(); 10093 if (size) { 10094 this._setContainerMeasure(size.width, true); 10095 this._setContainerMeasure(size.height, false); 10096 } 10097 }; 10098 proto._getContainerSize = noop2; 10099 proto._setContainerMeasure = function(measure, isWidth) { 10100 if (measure === void 0) { 10101 return; 10102 } 10103 var elemSize = this.size; 10104 if (elemSize.isBorderBox) { 10105 measure += isWidth ? elemSize.paddingLeft + elemSize.paddingRight + elemSize.borderLeftWidth + elemSize.borderRightWidth : elemSize.paddingBottom + elemSize.paddingTop + elemSize.borderTopWidth + elemSize.borderBottomWidth; 10106 } 10107 measure = Math.max(measure, 0); 10108 this.element.style[isWidth ? "width" : "height"] = measure + "px"; 10109 }; 10110 proto._emitCompleteOnItems = function(eventName, items) { 10111 var _this = this; 10112 function onComplete() { 10113 _this.dispatchEvent(eventName + "Complete", null, [items]); 10114 } 10115 var count = items.length; 10116 if (!items || !count) { 10117 onComplete(); 10118 return; 10119 } 10120 var doneCount = 0; 10121 function tick() { 10122 doneCount++; 10123 if (doneCount == count) { 10124 onComplete(); 10125 } 10126 } 10127 items.forEach(function(item) { 10128 item.once(eventName, tick); 10129 }); 10130 }; 10131 proto.dispatchEvent = function(type, event, args) { 10132 var emitArgs = event ? [event].concat(args) : args; 10133 this.emitEvent(type, emitArgs); 10134 if (jQuery2) { 10135 this.$element = this.$element || jQuery2(this.element); 10136 if (event) { 10137 var $event = jQuery2.Event(event); 10138 $event.type = type; 10139 this.$element.trigger($event, args); 10140 } else { 10141 this.$element.trigger(type, args); 10142 } 10143 } 10144 }; 10145 proto.ignore = function(elem) { 10146 var item = this.getItem(elem); 10147 if (item) { 10148 item.isIgnored = true; 10149 } 10150 }; 10151 proto.unignore = function(elem) { 10152 var item = this.getItem(elem); 10153 if (item) { 10154 delete item.isIgnored; 10155 } 10156 }; 10157 proto.stamp = function(elems) { 10158 elems = this._find(elems); 10159 if (!elems) { 10160 return; 10161 } 10162 this.stamps = this.stamps.concat(elems); 10163 elems.forEach(this.ignore, this); 10164 }; 10165 proto.unstamp = function(elems) { 10166 elems = this._find(elems); 10167 if (!elems) { 10168 return; 10169 } 10170 elems.forEach(function(elem) { 10171 utils.removeFrom(this.stamps, elem); 10172 this.unignore(elem); 10173 }, this); 10174 }; 10175 proto._find = function(elems) { 10176 if (!elems) { 10177 return; 10178 } 10179 if (typeof elems == "string") { 10180 elems = this.element.querySelectorAll(elems); 10181 } 10182 elems = utils.makeArray(elems); 10183 return elems; 10184 }; 10185 proto._manageStamps = function() { 10186 if (!this.stamps || !this.stamps.length) { 10187 return; 10188 } 10189 this._getBoundingRect(); 10190 this.stamps.forEach(this._manageStamp, this); 10191 }; 10192 proto._getBoundingRect = function() { 10193 var boundingRect = this.element.getBoundingClientRect(); 10194 var size = this.size; 10195 this._boundingRect = { 10196 left: boundingRect.left + size.paddingLeft + size.borderLeftWidth, 10197 top: boundingRect.top + size.paddingTop + size.borderTopWidth, 10198 right: boundingRect.right - (size.paddingRight + size.borderRightWidth), 10199 bottom: boundingRect.bottom - (size.paddingBottom + size.borderBottomWidth) 10200 }; 10201 }; 10202 proto._manageStamp = noop2; 10203 proto._getElementOffset = function(elem) { 10204 var boundingRect = elem.getBoundingClientRect(); 10205 var thisRect = this._boundingRect; 10206 var size = getSize(elem); 10207 var offset = { 10208 left: boundingRect.left - thisRect.left - size.marginLeft, 10209 top: boundingRect.top - thisRect.top - size.marginTop, 10210 right: thisRect.right - boundingRect.right - size.marginRight, 10211 bottom: thisRect.bottom - boundingRect.bottom - size.marginBottom 10212 }; 10213 return offset; 10214 }; 10215 proto.handleEvent = utils.handleEvent; 10216 proto.bindResize = function() { 10217 window2.addEventListener("resize", this); 10218 this.isResizeBound = true; 10219 }; 10220 proto.unbindResize = function() { 10221 window2.removeEventListener("resize", this); 10222 this.isResizeBound = false; 10223 }; 10224 proto.onresize = function() { 10225 this.resize(); 10226 }; 10227 utils.debounceMethod(Outlayer, "onresize", 100); 10228 proto.resize = function() { 10229 if (!this.isResizeBound || !this.needsResizeLayout()) { 10230 return; 10231 } 10232 this.layout(); 10233 }; 10234 proto.needsResizeLayout = function() { 10235 var size = getSize(this.element); 10236 var hasSizes = this.size && size; 10237 return hasSizes && size.innerWidth !== this.size.innerWidth; 10238 }; 10239 proto.addItems = function(elems) { 10240 var items = this._itemize(elems); 10241 if (items.length) { 10242 this.items = this.items.concat(items); 10243 } 10244 return items; 10245 }; 10246 proto.appended = function(elems) { 10247 var items = this.addItems(elems); 10248 if (!items.length) { 10249 return; 10250 } 10251 this.layoutItems(items, true); 10252 this.reveal(items); 10253 }; 10254 proto.prepended = function(elems) { 10255 var items = this._itemize(elems); 10256 if (!items.length) { 10257 return; 10258 } 10259 var previousItems = this.items.slice(0); 10260 this.items = items.concat(previousItems); 10261 this._resetLayout(); 10262 this._manageStamps(); 10263 this.layoutItems(items, true); 10264 this.reveal(items); 10265 this.layoutItems(previousItems); 10266 }; 10267 proto.reveal = function(items) { 10268 this._emitCompleteOnItems("reveal", items); 10269 if (!items || !items.length) { 10270 return; 10271 } 10272 var stagger = this.updateStagger(); 10273 items.forEach(function(item, i) { 10274 item.stagger(i * stagger); 10275 item.reveal(); 10276 }); 10277 }; 10278 proto.hide = function(items) { 10279 this._emitCompleteOnItems("hide", items); 10280 if (!items || !items.length) { 10281 return; 10282 } 10283 var stagger = this.updateStagger(); 10284 items.forEach(function(item, i) { 10285 item.stagger(i * stagger); 10286 item.hide(); 10287 }); 10288 }; 10289 proto.revealItemElements = function(elems) { 10290 var items = this.getItems(elems); 10291 this.reveal(items); 10292 }; 10293 proto.hideItemElements = function(elems) { 10294 var items = this.getItems(elems); 10295 this.hide(items); 10296 }; 10297 proto.getItem = function(elem) { 10298 for (var i = 0; i < this.items.length; i++) { 10299 var item = this.items[i]; 10300 if (item.element == elem) { 10301 return item; 10302 } 10303 } 10304 }; 10305 proto.getItems = function(elems) { 10306 elems = utils.makeArray(elems); 10307 var items = []; 10308 elems.forEach(function(elem) { 10309 var item = this.getItem(elem); 10310 if (item) { 10311 items.push(item); 10312 } 10313 }, this); 10314 return items; 10315 }; 10316 proto.remove = function(elems) { 10317 var removeItems = this.getItems(elems); 10318 this._emitCompleteOnItems("remove", removeItems); 10319 if (!removeItems || !removeItems.length) { 10320 return; 10321 } 10322 removeItems.forEach(function(item) { 10323 item.remove(); 10324 utils.removeFrom(this.items, item); 10325 }, this); 10326 }; 10327 proto.destroy = function() { 10328 var style = this.element.style; 10329 style.height = ""; 10330 style.position = ""; 10331 style.width = ""; 10332 this.items.forEach(function(item) { 10333 item.destroy(); 10334 }); 10335 this.unbindResize(); 10336 var id = this.element.outlayerGUID; 10337 delete instances[id]; 10338 delete this.element.outlayerGUID; 10339 if (jQuery2) { 10340 jQuery2.removeData(this.element, this.constructor.namespace); 10341 } 10342 }; 10343 Outlayer.data = function(elem) { 10344 elem = utils.getQueryElement(elem); 10345 var id = elem && elem.outlayerGUID; 10346 return id && instances[id]; 10347 }; 10348 Outlayer.create = function(namespace, options) { 10349 var Layout = subclass(Outlayer); 10350 Layout.defaults = utils.extend({}, Outlayer.defaults); 10351 utils.extend(Layout.defaults, options); 10352 Layout.compatOptions = utils.extend({}, Outlayer.compatOptions); 10353 Layout.namespace = namespace; 10354 Layout.data = Outlayer.data; 10355 Layout.Item = subclass(Item); 10356 utils.htmlInit(Layout, namespace); 10357 if (jQuery2 && jQuery2.bridget) { 10358 jQuery2.bridget(namespace, Layout); 10359 } 10360 return Layout; 10361 }; 10362 function subclass(Parent) { 10363 function SubClass() { 10364 Parent.apply(this, arguments); 10365 } 10366 SubClass.prototype = Object.create(Parent.prototype); 10367 SubClass.prototype.constructor = SubClass; 10368 return SubClass; 10369 } 10370 var msUnits = { 10371 ms: 1, 10372 s: 1e3 10373 }; 10374 function getMilliseconds(time) { 10375 if (typeof time == "number") { 10376 return time; 10377 } 10378 var matches = time.match(/(^\d*\.?\d*)(\w*)/); 10379 var num = matches && matches[1]; 10380 var unit = matches && matches[2]; 10381 if (!num.length) { 10382 return 0; 10383 } 10384 num = parseFloat(num); 10385 var mult = msUnits[unit] || 1; 10386 return num * mult; 10387 } 10388 Outlayer.Item = Item; 10389 return Outlayer; 10390 }); 10391 } 10392 }); 10393 10394
vendor: 6,541 bytes, lines 10394-10560
10394// node_modules/masonry-layout/masonry.js 10395 var require_masonry = __commonJS({ 10396 "node_modules/masonry-layout/masonry.js"(exports, module) { 10397 (function(window2, factory) { 10398 if (typeof define == "function" && define.amd) { 10399 define( 10400 [ 10401 "outlayer/outlayer", 10402 "get-size/get-size" 10403 ], 10404 factory 10405 ); 10406 } else if (typeof module == "object" && module.exports) { 10407 module.exports = factory( 10408 require_outlayer(), 10409 require_get_size() 10410 ); 10411 } else { 10412 window2.Masonry = factory( 10413 window2.Outlayer, 10414 window2.getSize 10415 ); 10416 } 10417 })(window, function factory(Outlayer, getSize) { 10418 "use strict"; 10419 var Masonry3 = Outlayer.create("masonry"); 10420 Masonry3.compatOptions.fitWidth = "isFitWidth"; 10421 var proto = Masonry3.prototype; 10422 proto._resetLayout = function() { 10423 this.getSize(); 10424 this._getMeasurement("columnWidth", "outerWidth"); 10425 this._getMeasurement("gutter", "outerWidth"); 10426 this.measureColumns(); 10427 this.colYs = []; 10428 for (var i = 0; i < this.cols; i++) { 10429 this.colYs.push(0); 10430 } 10431 this.maxY = 0; 10432 this.horizontalColIndex = 0; 10433 }; 10434 proto.measureColumns = function() { 10435 this.getContainerWidth(); 10436 if (!this.columnWidth) { 10437 var firstItem = this.items[0]; 10438 var firstItemElem = firstItem && firstItem.element; 10439 this.columnWidth = firstItemElem && getSize(firstItemElem).outerWidth || // if first elem has no width, default to size of container 10440 this.containerWidth; 10441 } 10442 var columnWidth = this.columnWidth += this.gutter; 10443 var containerWidth = this.containerWidth + this.gutter; 10444 var cols = containerWidth / columnWidth; 10445 var excess = columnWidth - containerWidth % columnWidth; 10446 var mathMethod = excess && excess < 1 ? "round" : "floor"; 10447 cols = Math[mathMethod](cols); 10448 this.cols = Math.max(cols, 1); 10449 }; 10450 proto.getContainerWidth = function() { 10451 var isFitWidth = this._getOption("fitWidth"); 10452 var container = isFitWidth ? this.element.parentNode : this.element; 10453 var size = getSize(container); 10454 this.containerWidth = size && size.innerWidth; 10455 }; 10456 proto._getItemLayoutPosition = function(item) { 10457 item.getSize(); 10458 var remainder = item.size.outerWidth % this.columnWidth; 10459 var mathMethod = remainder && remainder < 1 ? "round" : "ceil"; 10460 var colSpan = Math[mathMethod](item.size.outerWidth / this.columnWidth); 10461 colSpan = Math.min(colSpan, this.cols); 10462 var colPosMethod = this.options.horizontalOrder ? "_getHorizontalColPosition" : "_getTopColPosition"; 10463 var colPosition = this[colPosMethod](colSpan, item); 10464 var position = { 10465 x: this.columnWidth * colPosition.col, 10466 y: colPosition.y 10467 }; 10468 var setHeight = colPosition.y + item.size.outerHeight; 10469 var setMax = colSpan + colPosition.col; 10470 for (var i = colPosition.col; i < setMax; i++) { 10471 this.colYs[i] = setHeight; 10472 } 10473 return position; 10474 }; 10475 proto._getTopColPosition = function(colSpan) { 10476 var colGroup = this._getTopColGroup(colSpan); 10477 var minimumY = Math.min.apply(Math, colGroup); 10478 return { 10479 col: colGroup.indexOf(minimumY), 10480 y: minimumY 10481 }; 10482 }; 10483 proto._getTopColGroup = function(colSpan) { 10484 if (colSpan < 2) { 10485 return this.colYs; 10486 } 10487 var colGroup = []; 10488 var groupCount = this.cols + 1 - colSpan; 10489 for (var i = 0; i < groupCount; i++) { 10490 colGroup[i] = this._getColGroupY(i, colSpan); 10491 } 10492 return colGroup; 10493 }; 10494 proto._getColGroupY = function(col, colSpan) { 10495 if (colSpan < 2) { 10496 return this.colYs[col]; 10497 } 10498 var groupColYs = this.colYs.slice(col, col + colSpan); 10499 return Math.max.apply(Math, groupColYs); 10500 }; 10501 proto._getHorizontalColPosition = function(colSpan, item) { 10502 var col = this.horizontalColIndex % this.cols; 10503 var isOver = colSpan > 1 && col + colSpan > this.cols; 10504 col = isOver ? 0 : col; 10505 var hasSize = item.size.outerWidth && item.size.outerHeight; 10506 this.horizontalColIndex = hasSize ? col + colSpan : this.horizontalColIndex; 10507 return { 10508 col, 10509 y: this._getColGroupY(col, colSpan) 10510 }; 10511 }; 10512 proto._manageStamp = function(stamp) { 10513 var stampSize = getSize(stamp); 10514 var offset = this._getElementOffset(stamp); 10515 var isOriginLeft = this._getOption("originLeft"); 10516 var firstX = isOriginLeft ? offset.left : offset.right; 10517 var lastX = firstX + stampSize.outerWidth; 10518 var firstCol = Math.floor(firstX / this.columnWidth); 10519 firstCol = Math.max(0, firstCol); 10520 var lastCol = Math.floor(lastX / this.columnWidth); 10521 lastCol -= lastX % this.columnWidth ? 0 : 1; 10522 lastCol = Math.min(this.cols - 1, lastCol); 10523 var isOriginTop = this._getOption("originTop"); 10524 var stampMaxY = (isOriginTop ? offset.top : offset.bottom) + stampSize.outerHeight; 10525 for (var i = firstCol; i <= lastCol; i++) { 10526 this.colYs[i] = Math.max(stampMaxY, this.colYs[i]); 10527 } 10528 }; 10529 proto._getContainerSize = function() { 10530 this.maxY = Math.max.apply(Math, this.colYs); 10531 var size = { 10532 height: this.maxY 10533 }; 10534 if (this._getOption("fitWidth")) { 10535 size.width = this._getContainerFitWidth(); 10536 } 10537 return size; 10538 }; 10539 proto._getContainerFitWidth = function() { 10540 var unusedCols = 0; 10541 var i = this.cols; 10542 while (--i) { 10543 if (this.colYs[i] !== 0) { 10544 break; 10545 } 10546 unusedCols++; 10547 } 10548 return (this.cols - unusedCols) * this.columnWidth - this.gutter; 10549 }; 10550 proto.needsResizeLayout = function() { 10551 var previousWidth = this.containerWidth; 10552 this.getContainerWidth(); 10553 return previousWidth != this.containerWidth; 10554 }; 10555 return Masonry3; 10556 }); 10557 } 10558 }); 10559 10560
vendor: 3,112 bytes, lines 10560-10642
10560// node_modules/jquery.cookie/jquery.cookie.js 10561 var require_jquery_cookie = __commonJS({ 10562 "node_modules/jquery.cookie/jquery.cookie.js"(exports) { 10563 (function(factory) { 10564 if (typeof define === "function" && define.amd) { 10565 define(["jquery"], factory); 10566 } else if (typeof exports === "object") { 10567 factory(require_jquery()); 10568 } else { 10569 factory(jQuery); 10570 } 10571 })(function($27) { 10572 var pluses = /\+/g; 10573 function encode(s) { 10574 return config.raw ? s : encodeURIComponent(s); 10575 } 10576 function decode(s) { 10577 return config.raw ? s : decodeURIComponent(s); 10578 } 10579 function stringifyCookieValue(value) { 10580 return encode(config.json ? JSON.stringify(value) : String(value)); 10581 } 10582 function parseCookieValue(s) { 10583 if (s.indexOf('"') === 0) { 10584 s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, "\\"); 10585 } 10586 try { 10587 s = decodeURIComponent(s.replace(pluses, " ")); 10588 return config.json ? JSON.parse(s) : s; 10589 } catch (e2) { 10590 } 10591 } 10592 function read2(s, converter) { 10593 var value = config.raw ? s : parseCookieValue(s); 10594 return $27.isFunction(converter) ? converter(value) : value; 10595 } 10596 var config = $27.cookie = function(key, value, options) { 10597 if (value !== void 0 && !$27.isFunction(value)) { 10598 options = $27.extend({}, config.defaults, options); 10599 if (typeof options.expires === "number") { 10600 var days = options.expires, t3 = options.expires = /* @__PURE__ */ new Date(); 10601 t3.setTime(+t3 + days * 864e5); 10602 } 10603 return document.cookie = [ 10604 encode(key), 10605 "=", 10606 stringifyCookieValue(value), 10607 options.expires ? "; expires=" + options.expires.toUTCString() : "", 10608 // use expires attribute, max-age is not supported by IE 10609 options.path ? "; path=" + options.path : "", 10610 options.domain ? "; domain=" + options.domain : "", 10611 options.secure ? "; secure" : "" 10612 ].join(""); 10613 } 10614 var result = key ? void 0 : {}; 10615 var cookies = document.cookie ? document.cookie.split("; ") : []; 10616 for (var i = 0, l = cookies.length; i < l; i++) { 10617 var parts = cookies[i].split("="); 10618 var name = decode(parts.shift()); 10619 var cookie2 = parts.join("="); 10620 if (key && key === name) { 10621 result = read2(cookie2, value); 10622 break; 10623 } 10624 if (!key && (cookie2 = read2(cookie2)) !== void 0) { 10625 result[name] = cookie2; 10626 } 10627 } 10628 return result; 10629 }; 10630 config.defaults = {}; 10631 $27.removeCookie = function(key, options) { 10632 if ($27.cookie(key) === void 0) { 10633 return false; 10634 } 10635 $27.cookie(key, "", $27.extend({}, options, { expires: -1 })); 10636 return !$27.cookie(key); 10637 }; 10638 }); 10639 } 10640 }); 10641 10642
vendor: 3,333 bytes, lines 10642-10723
10642// node_modules/crypt/crypt.js 10643 var require_crypt = __commonJS({ 10644 "node_modules/crypt/crypt.js"(exports, module) { 10645 (function() { 10646 var base64map = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", crypt = { 10647 // Bit-wise rotation left 10648 rotl: function(n, b) { 10649 return n << b | n >>> 32 - b; 10650 }, 10651 // Bit-wise rotation right 10652 rotr: function(n, b) { 10653 return n << 32 - b | n >>> b; 10654 }, 10655 // Swap big-endian to little-endian and vice versa 10656 endian: function(n) { 10657 if (n.constructor == Number) { 10658 return crypt.rotl(n, 8) & 16711935 | crypt.rotl(n, 24) & 4278255360; 10659 } 10660 for (var i = 0; i < n.length; i++) 10661 n[i] = crypt.endian(n[i]); 10662 return n; 10663 }, 10664 // Generate an array of any length of random bytes 10665 randomBytes: function(n) { 10666 for (var bytes = []; n > 0; n--) 10667 bytes.push(Math.floor(Math.random() * 256)); 10668 return bytes; 10669 }, 10670 // Convert a byte array to big-endian 32-bit words 10671 bytesToWords: function(bytes) { 10672 for (var words = [], i = 0, b = 0; i < bytes.length; i++, b += 8) 10673 words[b >>> 5] |= bytes[i] << 24 - b % 32; 10674 return words; 10675 }, 10676 // Convert big-endian 32-bit words to a byte array 10677 wordsToBytes: function(words) { 10678 for (var bytes = [], b = 0; b < words.length * 32; b += 8) 10679 bytes.push(words[b >>> 5] >>> 24 - b % 32 & 255); 10680 return bytes; 10681 }, 10682 // Convert a byte array to a hex string 10683 bytesToHex: function(bytes) { 10684 for (var hex = [], i = 0; i < bytes.length; i++) { 10685 hex.push((bytes[i] >>> 4).toString(16)); 10686 hex.push((bytes[i] & 15).toString(16)); 10687 } 10688 return hex.join(""); 10689 }, 10690 // Convert a hex string to a byte array 10691 hexToBytes: function(hex) { 10692 for (var bytes = [], c = 0; c < hex.length; c += 2) 10693 bytes.push(parseInt(hex.substr(c, 2), 16)); 10694 return bytes; 10695 }, 10696 // Convert a byte array to a base-64 string 10697 bytesToBase64: function(bytes) { 10698 for (var base64 = [], i = 0; i < bytes.length; i += 3) { 10699 var triplet = bytes[i] << 16 | bytes[i + 1] << 8 | bytes[i + 2]; 10700 for (var j = 0; j < 4; j++) 10701 if (i * 8 + j * 6 <= bytes.length * 8) 10702 base64.push(base64map.charAt(triplet >>> 6 * (3 - j) & 63)); 10703 else 10704 base64.push("="); 10705 } 10706 return base64.join(""); 10707 }, 10708 // Convert a base-64 string to a byte array 10709 base64ToBytes: function(base64) { 10710 base64 = base64.replace(/[^A-Z0-9+\/]/ig, ""); 10711 for (var bytes = [], i = 0, imod4 = 0; i < base64.length; imod4 = ++i % 4) { 10712 if (imod4 == 0) continue; 10713 bytes.push((base64map.indexOf(base64.charAt(i - 1)) & Math.pow(2, -2 * imod4 + 8) - 1) << imod4 * 2 | base64map.indexOf(base64.charAt(i)) >>> 6 - imod4 * 2); 10714 } 10715 return bytes; 10716 } 10717 }; 10718 module.exports = crypt; 10719 })(); 10720 } 10721 }); 10722 10723
vendor: 1,163 bytes, lines 10723-10758
10723// node_modules/charenc/charenc.js 10724 var require_charenc = __commonJS({ 10725 "node_modules/charenc/charenc.js"(exports, module) { 10726 var charenc = { 10727 // UTF-8 encoding 10728 utf8: { 10729 // Convert a string to a byte array 10730 stringToBytes: function(str) { 10731 return charenc.bin.stringToBytes(unescape(encodeURIComponent(str))); 10732 }, 10733 // Convert a byte array to a string 10734 bytesToString: function(bytes) { 10735 return decodeURIComponent(escape(charenc.bin.bytesToString(bytes))); 10736 } 10737 }, 10738 // Binary encoding 10739 bin: { 10740 // Convert a string to a byte array 10741 stringToBytes: function(str) { 10742 for (var bytes = [], i = 0; i < str.length; i++) 10743 bytes.push(str.charCodeAt(i) & 255); 10744 return bytes; 10745 }, 10746 // Convert a byte array to a string 10747 bytesToString: function(bytes) { 10748 for (var str = [], i = 0; i < bytes.length; i++) 10749 str.push(String.fromCharCode(bytes[i])); 10750 return str.join(""); 10751 } 10752 } 10753 }; 10754 module.exports = charenc; 10755 } 10756 }); 10757 10758
vendor: 598 bytes, lines 10758-10773
10758// node_modules/is-buffer/index.js 10759 var require_is_buffer = __commonJS({ 10760 "node_modules/is-buffer/index.js"(exports, module) { 10761 module.exports = function(obj) { 10762 return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer); 10763 }; 10764 function isBuffer(obj) { 10765 return !!obj.constructor && typeof obj.constructor.isBuffer === "function" && obj.constructor.isBuffer(obj); 10766 } 10767 function isSlowBuffer(obj) { 10768 return typeof obj.readFloatLE === "function" && typeof obj.slice === "function" && isBuffer(obj.slice(0, 0)); 10769 } 10770 } 10771 }); 10772 10773
vendor: 6,324 bytes, lines 10773-10895
10773// node_modules/md5/md5.js 10774 var require_md5 = __commonJS({ 10775 "node_modules/md5/md5.js"(exports, module) { 10776 (function() { 10777 var crypt = require_crypt(), utf8 = require_charenc().utf8, isBuffer = require_is_buffer(), bin = require_charenc().bin, md5 = function(message, options) { 10778 if (message.constructor == String) 10779 if (options && options.encoding === "binary") 10780 message = bin.stringToBytes(message); 10781 else 10782 message = utf8.stringToBytes(message); 10783 else if (isBuffer(message)) 10784 message = Array.prototype.slice.call(message, 0); 10785 else if (!Array.isArray(message) && message.constructor !== Uint8Array) 10786 message = message.toString(); 10787 var m = crypt.bytesToWords(message), l = message.length * 8, a = 1732584193, b = -271733879, c = -1732584194, d = 271733878; 10788 for (var i = 0; i < m.length; i++) { 10789 m[i] = (m[i] << 8 | m[i] >>> 24) & 16711935 | (m[i] << 24 | m[i] >>> 8) & 4278255360; 10790 } 10791 m[l >>> 5] |= 128 << l % 32; 10792 m[(l + 64 >>> 9 << 4) + 14] = l; 10793 var FF = md5._ff, GG = md5._gg, HH = md5._hh, II = md5._ii; 10794 for (var i = 0; i < m.length; i += 16) { 10795 var aa = a, bb = b, cc = c, dd = d; 10796 a = FF(a, b, c, d, m[i + 0], 7, -680876936); 10797 d = FF(d, a, b, c, m[i + 1], 12, -389564586); 10798 c = FF(c, d, a, b, m[i + 2], 17, 606105819); 10799 b = FF(b, c, d, a, m[i + 3], 22, -1044525330); 10800 a = FF(a, b, c, d, m[i + 4], 7, -176418897); 10801 d = FF(d, a, b, c, m[i + 5], 12, 1200080426); 10802 c = FF(c, d, a, b, m[i + 6], 17, -1473231341); 10803 b = FF(b, c, d, a, m[i + 7], 22, -45705983); 10804 a = FF(a, b, c, d, m[i + 8], 7, 1770035416); 10805 d = FF(d, a, b, c, m[i + 9], 12, -1958414417); 10806 c = FF(c, d, a, b, m[i + 10], 17, -42063); 10807 b = FF(b, c, d, a, m[i + 11], 22, -1990404162); 10808 a = FF(a, b, c, d, m[i + 12], 7, 1804603682); 10809 d = FF(d, a, b, c, m[i + 13], 12, -40341101); 10810 c = FF(c, d, a, b, m[i + 14], 17, -1502002290); 10811 b = FF(b, c, d, a, m[i + 15], 22, 1236535329); 10812 a = GG(a, b, c, d, m[i + 1], 5, -165796510); 10813 d = GG(d, a, b, c, m[i + 6], 9, -1069501632); 10814 c = GG(c, d, a, b, m[i + 11], 14, 643717713); 10815 b = GG(b, c, d, a, m[i + 0], 20, -373897302); 10816 a = GG(a, b, c, d, m[i + 5], 5, -701558691); 10817 d = GG(d, a, b, c, m[i + 10], 9, 38016083); 10818 c = GG(c, d, a, b, m[i + 15], 14, -660478335); 10819 b = GG(b, c, d, a, m[i + 4], 20, -405537848); 10820 a = GG(a, b, c, d, m[i + 9], 5, 568446438); 10821 d = GG(d, a, b, c, m[i + 14], 9, -1019803690); 10822 c = GG(c, d, a, b, m[i + 3], 14, -187363961); 10823 b = GG(b, c, d, a, m[i + 8], 20, 1163531501); 10824 a = GG(a, b, c, d, m[i + 13], 5, -1444681467); 10825 d = GG(d, a, b, c, m[i + 2], 9, -51403784); 10826 c = GG(c, d, a, b, m[i + 7], 14, 1735328473); 10827 b = GG(b, c, d, a, m[i + 12], 20, -1926607734); 10828 a = HH(a, b, c, d, m[i + 5], 4, -378558); 10829 d = HH(d, a, b, c, m[i + 8], 11, -2022574463); 10830 c = HH(c, d, a, b, m[i + 11], 16, 1839030562); 10831 b = HH(b, c, d, a, m[i + 14], 23, -35309556); 10832 a = HH(a, b, c, d, m[i + 1], 4, -1530992060); 10833 d = HH(d, a, b, c, m[i + 4], 11, 1272893353); 10834 c = HH(c, d, a, b, m[i + 7], 16, -155497632); 10835 b = HH(b, c, d, a, m[i + 10], 23, -1094730640); 10836 a = HH(a, b, c, d, m[i + 13], 4, 681279174); 10837 d = HH(d, a, b, c, m[i + 0], 11, -358537222); 10838 c = HH(c, d, a, b, m[i + 3], 16, -722521979); 10839 b = HH(b, c, d, a, m[i + 6], 23, 76029189); 10840 a = HH(a, b, c, d, m[i + 9], 4, -640364487); 10841 d = HH(d, a, b, c, m[i + 12], 11, -421815835); 10842 c = HH(c, d, a, b, m[i + 15], 16, 530742520); 10843 b = HH(b, c, d, a, m[i + 2], 23, -995338651); 10844 a = II(a, b, c, d, m[i + 0], 6, -198630844); 10845 d = II(d, a, b, c, m[i + 7], 10, 1126891415); 10846 c = II(c, d, a, b, m[i + 14], 15, -1416354905); 10847 b = II(b, c, d, a, m[i + 5], 21, -57434055); 10848 a = II(a, b, c, d, m[i + 12], 6, 1700485571); 10849 d = II(d, a, b, c, m[i + 3], 10, -1894986606); 10850 c = II(c, d, a, b, m[i + 10], 15, -1051523); 10851 b = II(b, c, d, a, m[i + 1], 21, -2054922799); 10852 a = II(a, b, c, d, m[i + 8], 6, 1873313359); 10853 d = II(d, a, b, c, m[i + 15], 10, -30611744); 10854 c = II(c, d, a, b, m[i + 6], 15, -1560198380); 10855 b = II(b, c, d, a, m[i + 13], 21, 1309151649); 10856 a = II(a, b, c, d, m[i + 4], 6, -145523070); 10857 d = II(d, a, b, c, m[i + 11], 10, -1120210379); 10858 c = II(c, d, a, b, m[i + 2], 15, 718787259); 10859 b = II(b, c, d, a, m[i + 9], 21, -343485551); 10860 a = a + aa >>> 0; 10861 b = b + bb >>> 0; 10862 c = c + cc >>> 0; 10863 d = d + dd >>> 0; 10864 } 10865 return crypt.endian([a, b, c, d]); 10866 }; 10867 md5._ff = function(a, b, c, d, x, s, t3) { 10868 var n = a + (b & c | ~b & d) + (x >>> 0) + t3; 10869 return (n << s | n >>> 32 - s) + b; 10870 }; 10871 md5._gg = function(a, b, c, d, x, s, t3) { 10872 var n = a + (b & d | c & ~d) + (x >>> 0) + t3; 10873 return (n << s | n >>> 32 - s) + b; 10874 }; 10875 md5._hh = function(a, b, c, d, x, s, t3) { 10876 var n = a + (b ^ c ^ d) + (x >>> 0) + t3; 10877 return (n << s | n >>> 32 - s) + b; 10878 }; 10879 md5._ii = function(a, b, c, d, x, s, t3) { 10880 var n = a + (c ^ (b | ~d)) + (x >>> 0) + t3; 10881 return (n << s | n >>> 32 - s) + b; 10882 }; 10883 md5._blocksize = 16; 10884 md5._digestsize = 16; 10885 module.exports = function(message, options) { 10886 if (message === void 0 || message === null) 10887 throw new Error("Illegal argument " + message); 10888 var digestbytes = crypt.wordsToBytes(md5(message, options)); 10889 return options && options.asBytes ? digestbytes : options && options.asString ? bin.bytesToString(digestbytes) : crypt.bytesToHex(digestbytes); 10890 }; 10891 })(); 10892 } 10893 }); 10894 10895
10895// src/fairtrade_provider/js/Settings.js 10896 var settings = { 10897 i18n: { 10898 lngs: ["en", "fr"], 10899 fallbackLng: "en", 10900 detection: { 10901 order: ["htmlTag"] 10902 }, 10903 resources: { 10904 en: { 10905 translation: { 10906 // ... 10907 } 10908 }, 10909 fr: { 10910 translation: { 10911 // ... 10912 } 10913 } 10914 }, 10915 debug: false 10916 }, 10917 media: { 10918 screen: { 10919 small: { 10920 minWidth: 480, 10921 maxWidth: 640 10922 }, 10923 moderate: { 10924 minWidth: 640, 10925 maxWidth: 768 10926 }, 10927 medium: { 10928 minWidth: 768, 10929 maxWidth: 992 10930 }, 10931 large: { 10932 minWidth: 992, 10933 maxWidth: 1280 10934 }, 10935 big: { 10936 minWidth: 1280, 10937 maxWidth: 1440 10938 }, 10939 great: { 10940 minWidth: 1440, 10941 maxWidth: 99999999 10942 } 10943 } 10944 }, 10945 layers: { 10946 nirvana: -1, 10947 audience: 0, 10948 supernumerary: 21, 10949 actor: 42, 10950 celebrity: 1001, 10951 popstar: 1002, 10952 diva: 1003, 10953 primaDonna: 1004 10954 } 10955 }; 10956 10957
vendor: 1,181 bytes, lines 10957-10982
10957// node_modules/default-passive-events/dist/index.module.js 10958 var e; 10959 var t = ["scroll", "wheel", "touchstart", "touchmove", "touchenter", "touchend", "touchleave", "mouseout", "mouseleave", "mouseup", "mousedown", "mousemove", "mouseenter", "mousewheel", "mouseover"]; 10960 if ((function() { 10961 var e2 = false; 10962 try { 10963 var t3 = Object.defineProperty({}, "passive", { get: function() { 10964 e2 = true; 10965 } }); 10966 window.addEventListener("test", null, t3), window.removeEventListener("test", null, t3); 10967 } catch (e3) { 10968 } 10969 return e2; 10970 })()) { 10971 o2 = EventTarget.prototype.addEventListener; 10972 e = o2, EventTarget.prototype.addEventListener = function(o3, r, n) { 10973 var s, a = "object" == typeof n && null !== n, i = a ? n.capture : n; 10974 (n = a ? (function(e2) { 10975 var t3 = Object.getOwnPropertyDescriptor(e2, "passive"); 10976 return t3 && true !== t3.writable && void 0 === t3.set ? Object.assign({}, e2) : e2; 10977 })(n) : {}).passive = void 0 !== (s = n.passive) ? s : -1 !== t.indexOf(o3) && true, n.capture = void 0 !== i && i, e.call(this, o3, r, n); 10978 }, EventTarget.prototype.addEventListener._original = e; 10979 } 10980 var o2; 10981 10982
10982// src/fairtrade_provider/js/Base.js 10983 var import_jquery26 = __toESM(require_jquery()); 10984 10985
vendor: 28,220 bytes, lines 10985-11736
10985// node_modules/jquery-colorbox/jquery.colorbox.js 10986 (function($27, document2, window2) { 10987 var defaults3 = { 10988 // data sources 10989 html: false, 10990 photo: false, 10991 iframe: false, 10992 inline: false, 10993 // behavior and appearance 10994 transition: "elastic", 10995 speed: 300, 10996 fadeOut: 300, 10997 width: false, 10998 initialWidth: "600", 10999 innerWidth: false, 11000 maxWidth: false, 11001 height: false, 11002 initialHeight: "450", 11003 innerHeight: false, 11004 maxHeight: false, 11005 scalePhotos: true, 11006 scrolling: true, 11007 opacity: 0.9, 11008 preloading: true, 11009 className: false, 11010 overlayClose: true, 11011 escKey: true, 11012 arrowKey: true, 11013 top: false, 11014 bottom: false, 11015 left: false, 11016 right: false, 11017 fixed: false, 11018 data: void 0, 11019 closeButton: true, 11020 fastIframe: true, 11021 open: false, 11022 reposition: true, 11023 loop: true, 11024 slideshow: false, 11025 slideshowAuto: true, 11026 slideshowSpeed: 2500, 11027 slideshowStart: "start slideshow", 11028 slideshowStop: "stop slideshow", 11029 photoRegex: /\.(gif|png|jp(e|g|eg)|bmp|ico|webp|jxr|svg)((#|\?).*)?$/i, 11030 // alternate image paths for high-res displays 11031 retinaImage: false, 11032 retinaUrl: false, 11033 retinaSuffix: "@2x.$1", 11034 // internationalization 11035 current: "image {current} of {total}", 11036 previous: "previous", 11037 next: "next", 11038 close: "close", 11039 xhrError: "This content failed to load.", 11040 imgError: "This image failed to load.", 11041 // accessbility 11042 returnFocus: true, 11043 trapFocus: true, 11044 // callbacks 11045 onOpen: false, 11046 onLoad: false, 11047 onComplete: false, 11048 onCleanup: false, 11049 onClosed: false, 11050 rel: function() { 11051 return this.rel; 11052 }, 11053 href: function() { 11054 return $27(this).attr("href"); 11055 }, 11056 title: function() { 11057 return this.title; 11058 }, 11059 createImg: function() { 11060 var img = new Image(); 11061 var attrs = $27(this).data("cbox-img-attrs"); 11062 if (typeof attrs === "object") { 11063 $27.each(attrs, function(key, val) { 11064 img[key] = val; 11065 }); 11066 } 11067 return img; 11068 }, 11069 createIframe: function() { 11070 var iframe = document2.createElement("iframe"); 11071 var attrs = $27(this).data("cbox-iframe-attrs"); 11072 if (typeof attrs === "object") { 11073 $27.each(attrs, function(key, val) { 11074 iframe[key] = val; 11075 }); 11076 } 11077 if ("frameBorder" in iframe) { 11078 iframe.frameBorder = 0; 11079 } 11080 if ("allowTransparency" in iframe) { 11081 iframe.allowTransparency = "true"; 11082 } 11083 iframe.name = (/* @__PURE__ */ new Date()).getTime(); 11084 iframe.allowFullscreen = true; 11085 return iframe; 11086 } 11087 }, colorbox = "colorbox", prefix = "cbox", boxElement = prefix + "Element", event_open = prefix + "_open", event_load = prefix + "_load", event_complete = prefix + "_complete", event_cleanup = prefix + "_cleanup", event_closed = prefix + "_closed", event_purge = prefix + "_purge", $overlay, $box, $wrap, $content, $topBorder, $leftBorder, $rightBorder, $bottomBorder, $related, $window, $loaded, $loadingBay, $loadingOverlay, $title, $current, $slideshow, $next, $prev, $close, $groupControls, $events = $27("<a/>"), settings2, interfaceHeight, interfaceWidth, loadedHeight, loadedWidth, index, photo, open, active, closing, loadingTimer, publicMethod, div = "div", requests = 0, previousCSS = {}, init2; 11088 function $tag(tag, id, css) { 11089 var element = document2.createElement(tag); 11090 if (id) { 11091 element.id = prefix + id; 11092 } 11093 if (css) { 11094 element.style.cssText = css; 11095 } 11096 return $27(element); 11097 } 11098 function winheight() { 11099 return window2.innerHeight ? window2.innerHeight : $27(window2).height(); 11100 } 11101 function Settings(element, options) { 11102 if (options !== Object(options)) { 11103 options = {}; 11104 } 11105 this.cache = {}; 11106 this.el = element; 11107 this.value = function(key) { 11108 var dataAttr; 11109 if (this.cache[key] === void 0) { 11110 dataAttr = $27(this.el).attr("data-cbox-" + key); 11111 if (dataAttr !== void 0) { 11112 this.cache[key] = dataAttr; 11113 } else if (options[key] !== void 0) { 11114 this.cache[key] = options[key]; 11115 } else if (defaults3[key] !== void 0) { 11116 this.cache[key] = defaults3[key]; 11117 } 11118 } 11119 return this.cache[key]; 11120 }; 11121 this.get = function(key) { 11122 var value = this.value(key); 11123 return $27.isFunction(value) ? value.call(this.el, this) : value; 11124 }; 11125 } 11126 function getIndex(increment) { 11127 var max = $related.length, newIndex = (index + increment) % max; 11128 return newIndex < 0 ? max + newIndex : newIndex; 11129 } 11130 function setSize(size, dimension) { 11131 return Math.round((/%/.test(size) ? (dimension === "x" ? $window.width() : winheight()) / 100 : 1) * parseInt(size, 10)); 11132 } 11133 function isImage(settings3, url) { 11134 return settings3.get("photo") || settings3.get("photoRegex").test(url); 11135 } 11136 function retinaUrl(settings3, url) { 11137 return settings3.get("retinaUrl") && window2.devicePixelRatio > 1 ? url.replace(settings3.get("photoRegex"), settings3.get("retinaSuffix")) : url; 11138 } 11139 function trapFocus(e2) { 11140 if ("contains" in $box[0] && !$box[0].contains(e2.target) && e2.target !== $overlay[0]) { 11141 e2.stopPropagation(); 11142 $box.focus(); 11143 } 11144 } 11145 function setClass(str) { 11146 if (setClass.str !== str) { 11147 $box.add($overlay).removeClass(setClass.str).addClass(str); 11148 setClass.str = str; 11149 } 11150 } 11151 function getRelated(rel) { 11152 index = 0; 11153 if (rel && rel !== false && rel !== "nofollow") { 11154 $related = $27("." + boxElement).filter(function() { 11155 var options = $27.data(this, colorbox); 11156 var settings3 = new Settings(this, options); 11157 return settings3.get("rel") === rel; 11158 }); 11159 index = $related.index(settings2.el); 11160 if (index === -1) { 11161 $related = $related.add(settings2.el); 11162 index = $related.length - 1; 11163 } 11164 } else { 11165 $related = $27(settings2.el); 11166 } 11167 } 11168 function trigger(event) { 11169 $27(document2).trigger(event); 11170 $events.triggerHandler(event); 11171 } 11172 var slideshow = (function() { 11173 var active2, className = prefix + "Slideshow_", click = "click." + prefix, timeOut; 11174 function clear() { 11175 clearTimeout(timeOut); 11176 } 11177 function set() { 11178 if (settings2.get("loop") || $related[index + 1]) { 11179 clear(); 11180 timeOut = setTimeout(publicMethod.next, settings2.get("slideshowSpeed")); 11181 } 11182 } 11183 function start() { 11184 $slideshow.html(settings2.get("slideshowStop")).unbind(click).one(click, stop); 11185 $events.bind(event_complete, set).bind(event_load, clear); 11186 $box.removeClass(className + "off").addClass(className + "on"); 11187 } 11188 function stop() { 11189 clear(); 11190 $events.unbind(event_complete, set).unbind(event_load, clear); 11191 $slideshow.html(settings2.get("slideshowStart")).unbind(click).one(click, function() { 11192 publicMethod.next(); 11193 start(); 11194 }); 11195 $box.removeClass(className + "on").addClass(className + "off"); 11196 } 11197 function reset() { 11198 active2 = false; 11199 $slideshow.hide(); 11200 clear(); 11201 $events.unbind(event_complete, set).unbind(event_load, clear); 11202 $box.removeClass(className + "off " + className + "on"); 11203 } 11204 return function() { 11205 if (active2) { 11206 if (!settings2.get("slideshow")) { 11207 $events.unbind(event_cleanup, reset); 11208 reset(); 11209 } 11210 } else { 11211 if (settings2.get("slideshow") && $related[1]) { 11212 active2 = true; 11213 $events.one(event_cleanup, reset); 11214 if (settings2.get("slideshowAuto")) { 11215 start(); 11216 } else { 11217 stop(); 11218 } 11219 $slideshow.show(); 11220 } 11221 } 11222 }; 11223 })(); 11224 function launch(element) { 11225 var options; 11226 if (!closing) { 11227 options = $27(element).data(colorbox); 11228 settings2 = new Settings(element, options); 11229 getRelated(settings2.get("rel")); 11230 if (!open) { 11231 open = active = true; 11232 setClass(settings2.get("className")); 11233 $box.css({ visibility: "hidden", display: "block", opacity: "" }); 11234 $loaded = $tag(div, "LoadedContent", "width:0; height:0; overflow:hidden; visibility:hidden"); 11235 $content.css({ width: "", height: "" }).append($loaded); 11236 interfaceHeight = $topBorder.height() + $bottomBorder.height() + $content.outerHeight(true) - $content.height(); 11237 interfaceWidth = $leftBorder.width() + $rightBorder.width() + $content.outerWidth(true) - $content.width(); 11238 loadedHeight = $loaded.outerHeight(true); 11239 loadedWidth = $loaded.outerWidth(true); 11240 var initialWidth = setSize(settings2.get("initialWidth"), "x"); 11241 var initialHeight = setSize(settings2.get("initialHeight"), "y"); 11242 var maxWidth = settings2.get("maxWidth"); 11243 var maxHeight = settings2.get("maxHeight"); 11244 settings2.w = Math.max((maxWidth !== false ? Math.min(initialWidth, setSize(maxWidth, "x")) : initialWidth) - loadedWidth - interfaceWidth, 0); 11245 settings2.h = Math.max((maxHeight !== false ? Math.min(initialHeight, setSize(maxHeight, "y")) : initialHeight) - loadedHeight - interfaceHeight, 0); 11246 $loaded.css({ width: "", height: settings2.h }); 11247 publicMethod.position(); 11248 trigger(event_open); 11249 settings2.get("onOpen"); 11250 $groupControls.add($title).hide(); 11251 $box.focus(); 11252 if (settings2.get("trapFocus")) { 11253 if (document2.addEventListener) { 11254 document2.addEventListener("focus", trapFocus, true); 11255 $events.one(event_closed, function() { 11256 document2.removeEventListener("focus", trapFocus, true); 11257 }); 11258 } 11259 } 11260 if (settings2.get("returnFocus")) { 11261 $events.one(event_closed, function() { 11262 $27(settings2.el).focus(); 11263 }); 11264 } 11265 } 11266 var opacity = parseFloat(settings2.get("opacity")); 11267 $overlay.css({ 11268 opacity: opacity === opacity ? opacity : "", 11269 cursor: settings2.get("overlayClose") ? "pointer" : "", 11270 visibility: "visible" 11271 }).show(); 11272 if (settings2.get("closeButton")) { 11273 $close.html(settings2.get("close")).appendTo($content); 11274 } else { 11275 $close.appendTo("<div/>"); 11276 } 11277 load(); 11278 } 11279 } 11280 function appendHTML() { 11281 if (!$box) { 11282 init2 = false; 11283 $window = $27(window2); 11284 $box = $tag(div).attr({ 11285 id: colorbox, 11286 "class": $27.support.opacity === false ? prefix + "IE" : "", 11287 // class for optional IE8 & lower targeted CSS. 11288 role: "dialog", 11289 tabindex: "-1" 11290 }).hide(); 11291 $overlay = $tag(div, "Overlay").hide(); 11292 $loadingOverlay = $27([$tag(div, "LoadingOverlay")[0], $tag(div, "LoadingGraphic")[0]]); 11293 $wrap = $tag(div, "Wrapper"); 11294 $content = $tag(div, "Content").append( 11295 $title = $tag(div, "Title"), 11296 $current = $tag(div, "Current"), 11297 $prev = $27('<button type="button"/>').attr({ id: prefix + "Previous" }), 11298 $next = $27('<button type="button"/>').attr({ id: prefix + "Next" }), 11299 $slideshow = $27('<button type="button"/>').attr({ id: prefix + "Slideshow" }), 11300 $loadingOverlay 11301 ); 11302 $close = $27('<button type="button"/>').attr({ id: prefix + "Close" }); 11303 $wrap.append( 11304 // The 3x3 Grid that makes up Colorbox 11305 $tag(div).append( 11306 $tag(div, "TopLeft"), 11307 $topBorder = $tag(div, "TopCenter"), 11308 $tag(div, "TopRight") 11309 ), 11310 $tag(div, false, "clear:left").append( 11311 $leftBorder = $tag(div, "MiddleLeft"), 11312 $content, 11313 $rightBorder = $tag(div, "MiddleRight") 11314 ), 11315 $tag(div, false, "clear:left").append( 11316 $tag(div, "BottomLeft"), 11317 $bottomBorder = $tag(div, "BottomCenter"), 11318 $tag(div, "BottomRight") 11319 ) 11320 ).find("div div").css({ "float": "left" }); 11321 $loadingBay = $tag(div, false, "position:absolute; width:9999px; visibility:hidden; display:none; max-width:none;"); 11322 $groupControls = $next.add($prev).add($current).add($slideshow); 11323 } 11324 if (document2.body && !$box.parent().length) { 11325 $27(document2.body).append($overlay, $box.append($wrap, $loadingBay)); 11326 } 11327 } 11328 function addBindings() { 11329 function clickHandler(e2) { 11330 if (!(e2.which > 1 || e2.shiftKey || e2.altKey || e2.metaKey || e2.ctrlKey)) { 11331 e2.preventDefault(); 11332 launch(this); 11333 } 11334 } 11335 if ($box) { 11336 if (!init2) { 11337 init2 = true; 11338 $next.click(function() { 11339 publicMethod.next(); 11340 }); 11341 $prev.click(function() { 11342 publicMethod.prev(); 11343 }); 11344 $close.click(function() { 11345 publicMethod.close(); 11346 }); 11347 $overlay.click(function() { 11348 if (settings2.get("overlayClose")) { 11349 publicMethod.close(); 11350 } 11351 }); 11352 $27(document2).bind("keydown." + prefix, function(e2) { 11353 var key = e2.keyCode; 11354 if (open && settings2.get("escKey") && key === 27) { 11355 e2.preventDefault(); 11356 publicMethod.close(); 11357 } 11358 if (open && settings2.get("arrowKey") && $related[1] && !e2.altKey) { 11359 if (key === 37) { 11360 e2.preventDefault(); 11361 $prev.click(); 11362 } else if (key === 39) { 11363 e2.preventDefault(); 11364 $next.click(); 11365 } 11366 } 11367 }); 11368 if ($27.isFunction($27.fn.on)) { 11369 $27(document2).on("click." + prefix, "." + boxElement, clickHandler); 11370 } else { 11371 $27("." + boxElement).live("click." + prefix, clickHandler); 11372 } 11373 } 11374 return true; 11375 } 11376 return false; 11377 } 11378 if ($27[colorbox]) { 11379 return; 11380 } 11381 $27(appendHTML); 11382 publicMethod = $27.fn[colorbox] = $27[colorbox] = function(options, callback) { 11383 var settings3; 11384 var $obj = this; 11385 options = options || {}; 11386 if ($27.isFunction($obj)) { 11387 $obj = $27("<a/>"); 11388 options.open = true; 11389 } 11390 if (!$obj[0]) { 11391 return $obj; 11392 } 11393 appendHTML(); 11394 if (addBindings()) { 11395 if (callback) { 11396 options.onComplete = callback; 11397 } 11398 $obj.each(function() { 11399 var old = $27.data(this, colorbox) || {}; 11400 $27.data(this, colorbox, $27.extend(old, options)); 11401 }).addClass(boxElement); 11402 settings3 = new Settings($obj[0], options); 11403 if (settings3.get("open")) { 11404 launch($obj[0]); 11405 } 11406 } 11407 return $obj; 11408 }; 11409 publicMethod.position = function(speed, loadedCallback) { 11410 var css, top = 0, left = 0, offset = $box.offset(), scrollTop, scrollLeft; 11411 $window.unbind("resize." + prefix); 11412 $box.css({ top: -9e4, left: -9e4 }); 11413 scrollTop = $window.scrollTop(); 11414 scrollLeft = $window.scrollLeft(); 11415 if (settings2.get("fixed")) { 11416 offset.top -= scrollTop; 11417 offset.left -= scrollLeft; 11418 $box.css({ position: "fixed" }); 11419 } else { 11420 top = scrollTop; 11421 left = scrollLeft; 11422 $box.css({ position: "absolute" }); 11423 } 11424 if (settings2.get("right") !== false) { 11425 left += Math.max($window.width() - settings2.w - loadedWidth - interfaceWidth - setSize(settings2.get("right"), "x"), 0); 11426 } else if (settings2.get("left") !== false) { 11427 left += setSize(settings2.get("left"), "x"); 11428 } else { 11429 left += Math.round(Math.max($window.width() - settings2.w - loadedWidth - interfaceWidth, 0) / 2); 11430 } 11431 if (settings2.get("bottom") !== false) { 11432 top += Math.max(winheight() - settings2.h - loadedHeight - interfaceHeight - setSize(settings2.get("bottom"), "y"), 0); 11433 } else if (settings2.get("top") !== false) { 11434 top += setSize(settings2.get("top"), "y"); 11435 } else { 11436 top += Math.round(Math.max(winheight() - settings2.h - loadedHeight - interfaceHeight, 0) / 2); 11437 } 11438 $box.css({ top: offset.top, left: offset.left, visibility: "visible" }); 11439 $wrap[0].style.width = $wrap[0].style.height = "9999px"; 11440 function modalDimensions() { 11441 $topBorder[0].style.width = $bottomBorder[0].style.width = $content[0].style.width = parseInt($box[0].style.width, 10) - interfaceWidth + "px"; 11442 $content[0].style.height = $leftBorder[0].style.height = $rightBorder[0].style.height = parseInt($box[0].style.height, 10) - interfaceHeight + "px"; 11443 } 11444 css = { width: settings2.w + loadedWidth + interfaceWidth, height: settings2.h + loadedHeight + interfaceHeight, top, left }; 11445 if (speed) { 11446 var tempSpeed = 0; 11447 $27.each(css, function(i) { 11448 if (css[i] !== previousCSS[i]) { 11449 tempSpeed = speed; 11450 return; 11451 } 11452 }); 11453 speed = tempSpeed; 11454 } 11455 previousCSS = css; 11456 if (!speed) { 11457 $box.css(css); 11458 } 11459 $box.dequeue().animate(css, { 11460 duration: speed || 0, 11461 complete: function() { 11462 modalDimensions(); 11463 active = false; 11464 $wrap[0].style.width = settings2.w + loadedWidth + interfaceWidth + "px"; 11465 $wrap[0].style.height = settings2.h + loadedHeight + interfaceHeight + "px"; 11466 if (settings2.get("reposition")) { 11467 setTimeout(function() { 11468 $window.bind("resize." + prefix, publicMethod.position); 11469 }, 1); 11470 } 11471 if ($27.isFunction(loadedCallback)) { 11472 loadedCallback(); 11473 } 11474 }, 11475 step: modalDimensions 11476 }); 11477 }; 11478 publicMethod.resize = function(options) { 11479 var scrolltop; 11480 if (open) { 11481 options = options || {}; 11482 if (options.width) { 11483 settings2.w = setSize(options.width, "x") - loadedWidth - interfaceWidth; 11484 } 11485 if (options.innerWidth) { 11486 settings2.w = setSize(options.innerWidth, "x"); 11487 } 11488 $loaded.css({ width: settings2.w }); 11489 if (options.height) { 11490 settings2.h = setSize(options.height, "y") - loadedHeight - interfaceHeight; 11491 } 11492 if (options.innerHeight) { 11493 settings2.h = setSize(options.innerHeight, "y"); 11494 } 11495 if (!options.innerHeight && !options.height) { 11496 scrolltop = $loaded.scrollTop(); 11497 $loaded.css({ height: "auto" }); 11498 settings2.h = $loaded.height(); 11499 } 11500 $loaded.css({ height: settings2.h }); 11501 if (scrolltop) { 11502 $loaded.scrollTop(scrolltop); 11503 } 11504 publicMethod.position(settings2.get("transition") === "none" ? 0 : settings2.get("speed")); 11505 } 11506 }; 11507 publicMethod.prep = function(object) { 11508 if (!open) { 11509 return; 11510 } 11511 var callback, speed = settings2.get("transition") === "none" ? 0 : settings2.get("speed"); 11512 $loaded.remove(); 11513 $loaded = $tag(div, "LoadedContent").append(object); 11514 function getWidth() { 11515 settings2.w = settings2.w || $loaded.width(); 11516 settings2.w = settings2.mw && settings2.mw < settings2.w ? settings2.mw : settings2.w; 11517 return settings2.w; 11518 } 11519 function getHeight() { 11520 settings2.h = settings2.h || $loaded.height(); 11521 settings2.h = settings2.mh && settings2.mh < settings2.h ? settings2.mh : settings2.h; 11522 return settings2.h; 11523 } 11524 $loaded.hide().appendTo($loadingBay.show()).css({ width: getWidth(), overflow: settings2.get("scrolling") ? "auto" : "hidden" }).css({ height: getHeight() }).prependTo($content); 11525 $loadingBay.hide(); 11526 $27(photo).css({ "float": "none" }); 11527 setClass(settings2.get("className")); 11528 callback = function() { 11529 var total = $related.length, iframe, complete; 11530 if (!open) { 11531 return; 11532 } 11533 function removeFilter() { 11534 if ($27.support.opacity === false) { 11535 $box[0].style.removeAttribute("filter"); 11536 } 11537 } 11538 complete = function() { 11539 clearTimeout(loadingTimer); 11540 $loadingOverlay.hide(); 11541 trigger(event_complete); 11542 settings2.get("onComplete"); 11543 }; 11544 $title.html(settings2.get("title")).show(); 11545 $loaded.show(); 11546 if (total > 1) { 11547 if (typeof settings2.get("current") === "string") { 11548 $current.html(settings2.get("current").replace("{current}", index + 1).replace("{total}", total)).show(); 11549 } 11550 $next[settings2.get("loop") || index < total - 1 ? "show" : "hide"]().html(settings2.get("next")); 11551 $prev[settings2.get("loop") || index ? "show" : "hide"]().html(settings2.get("previous")); 11552 slideshow(); 11553 if (settings2.get("preloading")) { 11554 $27.each([getIndex(-1), getIndex(1)], function() { 11555 var img, i = $related[this], settings3 = new Settings(i, $27.data(i, colorbox)), src = settings3.get("href"); 11556 if (src && isImage(settings3, src)) { 11557 src = retinaUrl(settings3, src); 11558 img = document2.createElement("img"); 11559 img.src = src; 11560 } 11561 }); 11562 } 11563 } else { 11564 $groupControls.hide(); 11565 } 11566 if (settings2.get("iframe")) { 11567 iframe = settings2.get("createIframe"); 11568 if (!settings2.get("scrolling")) { 11569 iframe.scrolling = "no"; 11570 } 11571 $27(iframe).attr({ 11572 src: settings2.get("href"), 11573 "class": prefix + "Iframe" 11574 }).one("load", complete).appendTo($loaded); 11575 $events.one(event_purge, function() { 11576 iframe.src = "//about:blank"; 11577 }); 11578 if (settings2.get("fastIframe")) { 11579 $27(iframe).trigger("load"); 11580 } 11581 } else { 11582 complete(); 11583 } 11584 if (settings2.get("transition") === "fade") { 11585 $box.fadeTo(speed, 1, removeFilter); 11586 } else { 11587 removeFilter(); 11588 } 11589 }; 11590 if (settings2.get("transition") === "fade") { 11591 $box.fadeTo(speed, 0, function() { 11592 publicMethod.position(0, callback); 11593 }); 11594 } else { 11595 publicMethod.position(speed, callback); 11596 } 11597 }; 11598 function load() { 11599 var href, setResize, prep = publicMethod.prep, $inline, request = ++requests; 11600 active = true; 11601 photo = false; 11602 trigger(event_purge); 11603 trigger(event_load); 11604 settings2.get("onLoad"); 11605 settings2.h = settings2.get("height") ? setSize(settings2.get("height"), "y") - loadedHeight - interfaceHeight : settings2.get("innerHeight") && setSize(settings2.get("innerHeight"), "y"); 11606 settings2.w = settings2.get("width") ? setSize(settings2.get("width"), "x") - loadedWidth - interfaceWidth : settings2.get("innerWidth") && setSize(settings2.get("innerWidth"), "x"); 11607 settings2.mw = settings2.w; 11608 settings2.mh = settings2.h; 11609 if (settings2.get("maxWidth")) { 11610 settings2.mw = setSize(settings2.get("maxWidth"), "x") - loadedWidth - interfaceWidth; 11611 settings2.mw = settings2.w && settings2.w < settings2.mw ? settings2.w : settings2.mw; 11612 } 11613 if (settings2.get("maxHeight")) { 11614 settings2.mh = setSize(settings2.get("maxHeight"), "y") - loadedHeight - interfaceHeight; 11615 settings2.mh = settings2.h && settings2.h < settings2.mh ? settings2.h : settings2.mh; 11616 } 11617 href = settings2.get("href"); 11618 loadingTimer = setTimeout(function() { 11619 $loadingOverlay.show(); 11620 }, 100); 11621 if (settings2.get("inline")) { 11622 var $target = $27(href).eq(0); 11623 $inline = $27("<div>").hide().insertBefore($target); 11624 $events.one(event_purge, function() { 11625 $inline.replaceWith($target); 11626 }); 11627 prep($target); 11628 } else if (settings2.get("iframe")) { 11629 prep(" "); 11630 } else if (settings2.get("html")) { 11631 prep(settings2.get("html")); 11632 } else if (isImage(settings2, href)) { 11633 href = retinaUrl(settings2, href); 11634 photo = settings2.get("createImg"); 11635 $27(photo).addClass(prefix + "Photo").bind("error." + prefix, function() { 11636 prep($tag(div, "Error").html(settings2.get("imgError"))); 11637 }).one("load", function() { 11638 if (request !== requests) { 11639 return; 11640 } 11641 setTimeout(function() { 11642 var percent; 11643 if (settings2.get("retinaImage") && window2.devicePixelRatio > 1) { 11644 photo.height = photo.height / window2.devicePixelRatio; 11645 photo.width = photo.width / window2.devicePixelRatio; 11646 } 11647 if (settings2.get("scalePhotos")) { 11648 setResize = function() { 11649 photo.height -= photo.height * percent; 11650 photo.width -= photo.width * percent; 11651 }; 11652 if (settings2.mw && photo.width > settings2.mw) { 11653 percent = (photo.width - settings2.mw) / photo.width; 11654 setResize(); 11655 } 11656 if (settings2.mh && photo.height > settings2.mh) { 11657 percent = (photo.height - settings2.mh) / photo.height; 11658 setResize(); 11659 } 11660 } 11661 if (settings2.h) { 11662 photo.style.marginTop = Math.max(settings2.mh - photo.height, 0) / 2 + "px"; 11663 } 11664 if ($related[1] && (settings2.get("loop") || $related[index + 1])) { 11665 photo.style.cursor = "pointer"; 11666 $27(photo).bind("click." + prefix, function() { 11667 publicMethod.next(); 11668 }); 11669 } 11670 photo.style.width = photo.width + "px"; 11671 photo.style.height = photo.height + "px"; 11672 prep(photo); 11673 }, 1); 11674 }); 11675 photo.src = href; 11676 } else if (href) { 11677 $loadingBay.load(href, settings2.get("data"), function(data, status) { 11678 if (request === requests) { 11679 prep(status === "error" ? $tag(div, "Error").html(settings2.get("xhrError")) : $27(this).contents()); 11680 } 11681 }); 11682 } 11683 } 11684 publicMethod.next = function() { 11685 if (!active && $related[1] && (settings2.get("loop") || $related[index + 1])) { 11686 index = getIndex(1); 11687 launch($related[index]); 11688 } 11689 }; 11690 publicMethod.prev = function() { 11691 if (!active && $related[1] && (settings2.get("loop") || index)) { 11692 index = getIndex(-1); 11693 launch($related[index]); 11694 } 11695 }; 11696 publicMethod.close = function() { 11697 if (open && !closing) { 11698 closing = true; 11699 open = false; 11700 trigger(event_cleanup); 11701 settings2.get("onCleanup"); 11702 $window.unbind("." + prefix); 11703 $overlay.fadeTo(settings2.get("fadeOut") || 0, 0); 11704 $box.stop().fadeTo(settings2.get("fadeOut") || 0, 0, function() { 11705 $box.hide(); 11706 $overlay.hide(); 11707 trigger(event_purge); 11708 $loaded.remove(); 11709 setTimeout(function() { 11710 closing = false; 11711 trigger(event_closed); 11712 settings2.get("onClosed"); 11713 }, 1); 11714 }); 11715 } 11716 }; 11717 publicMethod.remove = function() { 11718 if (!$box) { 11719 return; 11720 } 11721 $box.stop(); 11722 $27[colorbox].close(); 11723 $box.stop(false, true).remove(); 11724 $overlay.remove(); 11725 closing = false; 11726 $box = null; 11727 $27("." + boxElement).removeData(colorbox).removeClass(boxElement); 11728 $27(document2).unbind("click." + prefix).unbind("keydown." + prefix); 11729 }; 11730 publicMethod.element = function() { 11731 return $27(settings2.el); 11732 }; 11733 publicMethod.settings = defaults3; 11734 })(jQuery, document, window); 11735 11736
11736// src/fairtrade_provider/js/Base.js 11737 var import_jquery_validation = __toESM(require_jquery_validate()); 11738 11739
vendor: 430 bytes, lines 11739-11749
11739// node_modules/@babel/runtime/helpers/esm/typeof.js 11740 function _typeof(obj) { 11741 "@babel/helpers - typeof"; 11742 return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) { 11743 return typeof obj2; 11744 } : function(obj2) { 11745 return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; 11746 }, _typeof(obj); 11747 } 11748 11749
vendor: 238 bytes, lines 11749-11756
11749// node_modules/@babel/runtime/helpers/esm/classCallCheck.js 11750 function _classCallCheck(instance2, Constructor) { 11751 if (!(instance2 instanceof Constructor)) { 11752 throw new TypeError("Cannot call a class as a function"); 11753 } 11754 } 11755 11756
vendor: 482 bytes, lines 11756-11768
11756// node_modules/@babel/runtime/helpers/esm/toPrimitive.js 11757 function _toPrimitive(input, hint) { 11758 if (_typeof(input) !== "object" || input === null) return input; 11759 var prim = input[Symbol.toPrimitive]; 11760 if (prim !== void 0) { 11761 var res = prim.call(input, hint || "default"); 11762 if (_typeof(res) !== "object") return res; 11763 throw new TypeError("@@toPrimitive must return a primitive value."); 11764 } 11765 return (hint === "string" ? String : Number)(input); 11766 } 11767 11768
vendor: 201 bytes, lines 11768-11774
11768// node_modules/@babel/runtime/helpers/esm/toPropertyKey.js 11769 function _toPropertyKey(arg) { 11770 var key = _toPrimitive(arg, "string"); 11771 return _typeof(key) === "symbol" ? key : String(key); 11772 } 11773 11774
vendor: 753 bytes, lines 11774-11793
11774// node_modules/@babel/runtime/helpers/esm/createClass.js 11775 function _defineProperties(target, props) { 11776 for (var i = 0; i < props.length; i++) { 11777 var descriptor = props[i]; 11778 descriptor.enumerable = descriptor.enumerable || false; 11779 descriptor.configurable = true; 11780 if ("value" in descriptor) descriptor.writable = true; 11781 Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); 11782 } 11783 } 11784 function _createClass(Constructor, protoProps, staticProps) { 11785 if (protoProps) _defineProperties(Constructor.prototype, protoProps); 11786 if (staticProps) _defineProperties(Constructor, staticProps); 11787 Object.defineProperty(Constructor, "prototype", { 11788 writable: false 11789 }); 11790 return Constructor; 11791 } 11792 11793
vendor: 260 bytes, lines 11793-11801
11793// node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js 11794 function _assertThisInitialized(self) { 11795 if (self === void 0) { 11796 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 11797 } 11798 return self; 11799 } 11800 11801
vendor: 301 bytes, lines 11801-11810
11801// node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js 11802 function _setPrototypeOf(o2, p) { 11803 _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf3(o3, p2) { 11804 o3.__proto__ = p2; 11805 return o3; 11806 }; 11807 return _setPrototypeOf(o2, p); 11808 } 11809 11810
vendor: 591 bytes, lines 11810-11828
11810// node_modules/@babel/runtime/helpers/esm/inherits.js 11811 function _inherits(subClass, superClass) { 11812 if (typeof superClass !== "function" && superClass !== null) { 11813 throw new TypeError("Super expression must either be null or a function"); 11814 } 11815 subClass.prototype = Object.create(superClass && superClass.prototype, { 11816 constructor: { 11817 value: subClass, 11818 writable: true, 11819 configurable: true 11820 } 11821 }); 11822 Object.defineProperty(subClass, "prototype", { 11823 writable: false 11824 }); 11825 if (superClass) _setPrototypeOf(subClass, superClass); 11826 } 11827 11828
vendor: 396 bytes, lines 11828-11838
11828// node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js 11829 function _possibleConstructorReturn(self, call) { 11830 if (call && (_typeof(call) === "object" || typeof call === "function")) { 11831 return call; 11832 } else if (call !== void 0) { 11833 throw new TypeError("Derived constructors may only return object or undefined"); 11834 } 11835 return _assertThisInitialized(self); 11836 } 11837 11838
vendor: 305 bytes, lines 11838-11846
11838// node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js 11839 function _getPrototypeOf(o2) { 11840 _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf3(o3) { 11841 return o3.__proto__ || Object.getPrototypeOf(o3); 11842 }; 11843 return _getPrototypeOf(o2); 11844 } 11845 11846
vendor: 368 bytes, lines 11846-11862
11846// node_modules/@babel/runtime/helpers/esm/defineProperty.js 11847 function _defineProperty(obj, key, value) { 11848 key = _toPropertyKey(key); 11849 if (key in obj) { 11850 Object.defineProperty(obj, key, { 11851 value, 11852 enumerable: true, 11853 configurable: true, 11854 writable: true 11855 }); 11856 } else { 11857 obj[key] = value; 11858 } 11859 return obj; 11860 } 11861 11862
vendor: 145 bytes, lines 11862-11867
11862// node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js 11863 function _arrayWithHoles(arr2) { 11864 if (Array.isArray(arr2)) return arr2; 11865 } 11866 11867
vendor: 232 bytes, lines 11867-11872
11867// node_modules/@babel/runtime/helpers/esm/iterableToArray.js 11868 function _iterableToArray(iter) { 11869 if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); 11870 } 11871 11872
vendor: 269 bytes, lines 11872-11879
11872// node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js 11873 function _arrayLikeToArray(arr2, len) { 11874 if (len == null || len > arr2.length) len = arr2.length; 11875 for (var i = 0, arr22 = new Array(len); i < len; i++) arr22[i] = arr2[i]; 11876 return arr22; 11877 } 11878 11879
vendor: 530 bytes, lines 11879-11889
11879// node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js 11880 function _unsupportedIterableToArray(o2, minLen) { 11881 if (!o2) return; 11882 if (typeof o2 === "string") return _arrayLikeToArray(o2, minLen); 11883 var n = Object.prototype.toString.call(o2).slice(8, -1); 11884 if (n === "Object" && o2.constructor) n = o2.constructor.name; 11885 if (n === "Map" || n === "Set") return Array.from(o2); 11886 if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o2, minLen); 11887 } 11888 11889
vendor: 267 bytes, lines 11889-11894
11889// node_modules/@babel/runtime/helpers/esm/nonIterableRest.js 11890 function _nonIterableRest() { 11891 throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); 11892 } 11893 11894
vendor: 208 bytes, lines 11894-11899
11894// node_modules/@babel/runtime/helpers/esm/toArray.js 11895 function _toArray(arr2) { 11896 return _arrayWithHoles(arr2) || _iterableToArray(arr2) || _unsupportedIterableToArray(arr2) || _nonIterableRest(); 11897 } 11898 11899
vendor: 108,187 bytes, lines 11899-14590
11899// node_modules/i18next/dist/esm/i18next.js 11900 function ownKeys(object, enumerableOnly) { 11901 var keys = Object.keys(object); 11902 if (Object.getOwnPropertySymbols) { 11903 var symbols = Object.getOwnPropertySymbols(object); 11904 if (enumerableOnly) { 11905 symbols = symbols.filter(function(sym) { 11906 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 11907 }); 11908 } 11909 keys.push.apply(keys, symbols); 11910 } 11911 return keys; 11912 } 11913 function _objectSpread(target) { 11914 for (var i = 1; i < arguments.length; i++) { 11915 var source = arguments[i] != null ? arguments[i] : {}; 11916 if (i % 2) { 11917 ownKeys(Object(source), true).forEach(function(key) { 11918 _defineProperty(target, key, source[key]); 11919 }); 11920 } else if (Object.getOwnPropertyDescriptors) { 11921 Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); 11922 } else { 11923 ownKeys(Object(source)).forEach(function(key) { 11924 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 11925 }); 11926 } 11927 } 11928 return target; 11929 } 11930 var consoleLogger = { 11931 type: "logger", 11932 log: function log(args) { 11933 this.output("log", args); 11934 }, 11935 warn: function warn(args) { 11936 this.output("warn", args); 11937 }, 11938 error: function error(args) { 11939 this.output("error", args); 11940 }, 11941 output: function output(type, args) { 11942 if (console && console[type]) console[type].apply(console, args); 11943 } 11944 }; 11945 var Logger = (function() { 11946 function Logger2(concreteLogger) { 11947 var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; 11948 _classCallCheck(this, Logger2); 11949 this.init(concreteLogger, options); 11950 } 11951 _createClass(Logger2, [{ 11952 key: "init", 11953 value: function init2(concreteLogger) { 11954 var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; 11955 this.prefix = options.prefix || "i18next:"; 11956 this.logger = concreteLogger || consoleLogger; 11957 this.options = options; 11958 this.debug = options.debug; 11959 } 11960 }, { 11961 key: "setDebug", 11962 value: function setDebug(bool) { 11963 this.debug = bool; 11964 } 11965 }, { 11966 key: "log", 11967 value: function log2() { 11968 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { 11969 args[_key] = arguments[_key]; 11970 } 11971 return this.forward(args, "log", "", true); 11972 } 11973 }, { 11974 key: "warn", 11975 value: function warn3() { 11976 for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { 11977 args[_key2] = arguments[_key2]; 11978 } 11979 return this.forward(args, "warn", "", true); 11980 } 11981 }, { 11982 key: "error", 11983 value: function error2() { 11984 for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { 11985 args[_key3] = arguments[_key3]; 11986 } 11987 return this.forward(args, "error", ""); 11988 } 11989 }, { 11990 key: "deprecate", 11991 value: function deprecate() { 11992 for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { 11993 args[_key4] = arguments[_key4]; 11994 } 11995 return this.forward(args, "warn", "WARNING DEPRECATED: ", true); 11996 } 11997 }, { 11998 key: "forward", 11999 value: function forward(args, lvl, prefix, debugOnly) { 12000 if (debugOnly && !this.debug) return null; 12001 if (typeof args[0] === "string") args[0] = "".concat(prefix).concat(this.prefix, " ").concat(args[0]); 12002 return this.logger[lvl](args); 12003 } 12004 }, { 12005 key: "create", 12006 value: function create2(moduleName) { 12007 return new Logger2(this.logger, _objectSpread(_objectSpread({}, { 12008 prefix: "".concat(this.prefix, ":").concat(moduleName, ":") 12009 }), this.options)); 12010 } 12011 }, { 12012 key: "clone", 12013 value: function clone(options) { 12014 options = options || this.options; 12015 options.prefix = options.prefix || this.prefix; 12016 return new Logger2(this.logger, options); 12017 } 12018 }]); 12019 return Logger2; 12020 })(); 12021 var baseLogger = new Logger(); 12022 var EventEmitter = (function() { 12023 function EventEmitter2() { 12024 _classCallCheck(this, EventEmitter2); 12025 this.observers = {}; 12026 } 12027 _createClass(EventEmitter2, [{ 12028 key: "on", 12029 value: function on(events, listener) { 12030 var _this = this; 12031 events.split(" ").forEach(function(event) { 12032 _this.observers[event] = _this.observers[event] || []; 12033 _this.observers[event].push(listener); 12034 }); 12035 return this; 12036 } 12037 }, { 12038 key: "off", 12039 value: function off(event, listener) { 12040 if (!this.observers[event]) return; 12041 if (!listener) { 12042 delete this.observers[event]; 12043 return; 12044 } 12045 this.observers[event] = this.observers[event].filter(function(l) { 12046 return l !== listener; 12047 }); 12048 } 12049 }, { 12050 key: "emit", 12051 value: function emit(event) { 12052 for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { 12053 args[_key - 1] = arguments[_key]; 12054 } 12055 if (this.observers[event]) { 12056 var cloned = [].concat(this.observers[event]); 12057 cloned.forEach(function(observer) { 12058 observer.apply(void 0, args); 12059 }); 12060 } 12061 if (this.observers["*"]) { 12062 var _cloned = [].concat(this.observers["*"]); 12063 _cloned.forEach(function(observer) { 12064 observer.apply(observer, [event].concat(args)); 12065 }); 12066 } 12067 } 12068 }]); 12069 return EventEmitter2; 12070 })(); 12071 function defer() { 12072 var res; 12073 var rej; 12074 var promise = new Promise(function(resolve, reject) { 12075 res = resolve; 12076 rej = reject; 12077 }); 12078 promise.resolve = res; 12079 promise.reject = rej; 12080 return promise; 12081 } 12082 function makeString(object) { 12083 if (object == null) return ""; 12084 return "" + object; 12085 } 12086 function copy(a, s, t3) { 12087 a.forEach(function(m) { 12088 if (s[m]) t3[m] = s[m]; 12089 }); 12090 } 12091 function getLastOfPath(object, path2, Empty) { 12092 function cleanKey(key2) { 12093 return key2 && key2.indexOf("###") > -1 ? key2.replace(/###/g, ".") : key2; 12094 } 12095 function canNotTraverseDeeper() { 12096 return !object || typeof object === "string"; 12097 } 12098 var stack = typeof path2 !== "string" ? [].concat(path2) : path2.split("."); 12099 while (stack.length > 1) { 12100 if (canNotTraverseDeeper()) return {}; 12101 var key = cleanKey(stack.shift()); 12102 if (!object[key] && Empty) object[key] = new Empty(); 12103 if (Object.prototype.hasOwnProperty.call(object, key)) { 12104 object = object[key]; 12105 } else { 12106 object = {}; 12107 } 12108 } 12109 if (canNotTraverseDeeper()) return {}; 12110 return { 12111 obj: object, 12112 k: cleanKey(stack.shift()) 12113 }; 12114 } 12115 function setPath(object, path2, newValue) { 12116 var _getLastOfPath = getLastOfPath(object, path2, Object), obj = _getLastOfPath.obj, k = _getLastOfPath.k; 12117 obj[k] = newValue; 12118 } 12119 function pushPath(object, path2, newValue, concat) { 12120 var _getLastOfPath2 = getLastOfPath(object, path2, Object), obj = _getLastOfPath2.obj, k = _getLastOfPath2.k; 12121 obj[k] = obj[k] || []; 12122 if (concat) obj[k] = obj[k].concat(newValue); 12123 if (!concat) obj[k].push(newValue); 12124 } 12125 function getPath(object, path2) { 12126 var _getLastOfPath3 = getLastOfPath(object, path2), obj = _getLastOfPath3.obj, k = _getLastOfPath3.k; 12127 if (!obj) return void 0; 12128 return obj[k]; 12129 } 12130 function getPathWithDefaults(data, defaultData, key) { 12131 var value = getPath(data, key); 12132 if (value !== void 0) { 12133 return value; 12134 } 12135 return getPath(defaultData, key); 12136 } 12137 function deepExtend(target, source, overwrite) { 12138 for (var prop in source) { 12139 if (prop !== "__proto__" && prop !== "constructor") { 12140 if (prop in target) { 12141 if (typeof target[prop] === "string" || target[prop] instanceof String || typeof source[prop] === "string" || source[prop] instanceof String) { 12142 if (overwrite) target[prop] = source[prop]; 12143 } else { 12144 deepExtend(target[prop], source[prop], overwrite); 12145 } 12146 } else { 12147 target[prop] = source[prop]; 12148 } 12149 } 12150 } 12151 return target; 12152 } 12153 function regexEscape(str) { 12154 return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); 12155 } 12156 var _entityMap = { 12157 "&": "&", 12158 "<": "<", 12159 ">": ">", 12160 '"': """, 12161 "'": "'", 12162 "/": "/" 12163 }; 12164 function escape2(data) { 12165 if (typeof data === "string") { 12166 return data.replace(/[&<>"'\/]/g, function(s) { 12167 return _entityMap[s]; 12168 }); 12169 } 12170 return data; 12171 } 12172 var isIE10 = typeof window !== "undefined" && window.navigator && typeof window.navigator.userAgentData === "undefined" && window.navigator.userAgent && window.navigator.userAgent.indexOf("MSIE") > -1; 12173 var chars = [" ", ",", "?", "!", ";"]; 12174 function looksLikeObjectPath(key, nsSeparator, keySeparator) { 12175 nsSeparator = nsSeparator || ""; 12176 keySeparator = keySeparator || ""; 12177 var possibleChars = chars.filter(function(c) { 12178 return nsSeparator.indexOf(c) < 0 && keySeparator.indexOf(c) < 0; 12179 }); 12180 if (possibleChars.length === 0) return true; 12181 var r = new RegExp("(".concat(possibleChars.map(function(c) { 12182 return c === "?" ? "\\?" : c; 12183 }).join("|"), ")")); 12184 var matched = !r.test(key); 12185 if (!matched) { 12186 var ki = key.indexOf(keySeparator); 12187 if (ki > 0 && !r.test(key.substring(0, ki))) { 12188 matched = true; 12189 } 12190 } 12191 return matched; 12192 } 12193 function ownKeys$1(object, enumerableOnly) { 12194 var keys = Object.keys(object); 12195 if (Object.getOwnPropertySymbols) { 12196 var symbols = Object.getOwnPropertySymbols(object); 12197 if (enumerableOnly) { 12198 symbols = symbols.filter(function(sym) { 12199 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 12200 }); 12201 } 12202 keys.push.apply(keys, symbols); 12203 } 12204 return keys; 12205 } 12206 function _objectSpread$1(target) { 12207 for (var i = 1; i < arguments.length; i++) { 12208 var source = arguments[i] != null ? arguments[i] : {}; 12209 if (i % 2) { 12210 ownKeys$1(Object(source), true).forEach(function(key) { 12211 _defineProperty(target, key, source[key]); 12212 }); 12213 } else if (Object.getOwnPropertyDescriptors) { 12214 Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); 12215 } else { 12216 ownKeys$1(Object(source)).forEach(function(key) { 12217 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 12218 }); 12219 } 12220 } 12221 return target; 12222 } 12223 function _createSuper(Derived) { 12224 var hasNativeReflectConstruct = _isNativeReflectConstruct(); 12225 return function _createSuperInternal() { 12226 var Super = _getPrototypeOf(Derived), result; 12227 if (hasNativeReflectConstruct) { 12228 var NewTarget = _getPrototypeOf(this).constructor; 12229 result = Reflect.construct(Super, arguments, NewTarget); 12230 } else { 12231 result = Super.apply(this, arguments); 12232 } 12233 return _possibleConstructorReturn(this, result); 12234 }; 12235 } 12236 function _isNativeReflectConstruct() { 12237 if (typeof Reflect === "undefined" || !Reflect.construct) return false; 12238 if (Reflect.construct.sham) return false; 12239 if (typeof Proxy === "function") return true; 12240 try { 12241 Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { 12242 })); 12243 return true; 12244 } catch (e2) { 12245 return false; 12246 } 12247 } 12248 function deepFind(obj, path2) { 12249 var keySeparator = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "."; 12250 if (!obj) return void 0; 12251 if (obj[path2]) return obj[path2]; 12252 var paths = path2.split(keySeparator); 12253 var current = obj; 12254 for (var i = 0; i < paths.length; ++i) { 12255 if (!current) return void 0; 12256 if (typeof current[paths[i]] === "string" && i + 1 < paths.length) { 12257 return void 0; 12258 } 12259 if (current[paths[i]] === void 0) { 12260 var j = 2; 12261 var p = paths.slice(i, i + j).join(keySeparator); 12262 var mix = current[p]; 12263 while (mix === void 0 && paths.length > i + j) { 12264 j++; 12265 p = paths.slice(i, i + j).join(keySeparator); 12266 mix = current[p]; 12267 } 12268 if (mix === void 0) return void 0; 12269 if (mix === null) return null; 12270 if (path2.endsWith(p)) { 12271 if (typeof mix === "string") return mix; 12272 if (p && typeof mix[p] === "string") return mix[p]; 12273 } 12274 var joinedPath = paths.slice(i + j).join(keySeparator); 12275 if (joinedPath) return deepFind(mix, joinedPath, keySeparator); 12276 return void 0; 12277 } 12278 current = current[paths[i]]; 12279 } 12280 return current; 12281 } 12282 var ResourceStore = (function(_EventEmitter) { 12283 _inherits(ResourceStore2, _EventEmitter); 12284 var _super = _createSuper(ResourceStore2); 12285 function ResourceStore2(data) { 12286 var _this; 12287 var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : { 12288 ns: ["translation"], 12289 defaultNS: "translation" 12290 }; 12291 _classCallCheck(this, ResourceStore2); 12292 _this = _super.call(this); 12293 if (isIE10) { 12294 EventEmitter.call(_assertThisInitialized(_this)); 12295 } 12296 _this.data = data || {}; 12297 _this.options = options; 12298 if (_this.options.keySeparator === void 0) { 12299 _this.options.keySeparator = "."; 12300 } 12301 if (_this.options.ignoreJSONStructure === void 0) { 12302 _this.options.ignoreJSONStructure = true; 12303 } 12304 return _this; 12305 } 12306 _createClass(ResourceStore2, [{ 12307 key: "addNamespaces", 12308 value: function addNamespaces(ns) { 12309 if (this.options.ns.indexOf(ns) < 0) { 12310 this.options.ns.push(ns); 12311 } 12312 } 12313 }, { 12314 key: "removeNamespaces", 12315 value: function removeNamespaces(ns) { 12316 var index = this.options.ns.indexOf(ns); 12317 if (index > -1) { 12318 this.options.ns.splice(index, 1); 12319 } 12320 } 12321 }, { 12322 key: "getResource", 12323 value: function getResource(lng, ns, key) { 12324 var options = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {}; 12325 var keySeparator = options.keySeparator !== void 0 ? options.keySeparator : this.options.keySeparator; 12326 var ignoreJSONStructure = options.ignoreJSONStructure !== void 0 ? options.ignoreJSONStructure : this.options.ignoreJSONStructure; 12327 var path2 = [lng, ns]; 12328 if (key && typeof key !== "string") path2 = path2.concat(key); 12329 if (key && typeof key === "string") path2 = path2.concat(keySeparator ? key.split(keySeparator) : key); 12330 if (lng.indexOf(".") > -1) { 12331 path2 = lng.split("."); 12332 } 12333 var result = getPath(this.data, path2); 12334 if (result || !ignoreJSONStructure || typeof key !== "string") return result; 12335 return deepFind(this.data && this.data[lng] && this.data[lng][ns], key, keySeparator); 12336 } 12337 }, { 12338 key: "addResource", 12339 value: function addResource(lng, ns, key, value) { 12340 var options = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : { 12341 silent: false 12342 }; 12343 var keySeparator = this.options.keySeparator; 12344 if (keySeparator === void 0) keySeparator = "."; 12345 var path2 = [lng, ns]; 12346 if (key) path2 = path2.concat(keySeparator ? key.split(keySeparator) : key); 12347 if (lng.indexOf(".") > -1) { 12348 path2 = lng.split("."); 12349 value = ns; 12350 ns = path2[1]; 12351 } 12352 this.addNamespaces(ns); 12353 setPath(this.data, path2, value); 12354 if (!options.silent) this.emit("added", lng, ns, key, value); 12355 } 12356 }, { 12357 key: "addResources", 12358 value: function addResources(lng, ns, resources) { 12359 var options = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : { 12360 silent: false 12361 }; 12362 for (var m in resources) { 12363 if (typeof resources[m] === "string" || Object.prototype.toString.apply(resources[m]) === "[object Array]") this.addResource(lng, ns, m, resources[m], { 12364 silent: true 12365 }); 12366 } 12367 if (!options.silent) this.emit("added", lng, ns, resources); 12368 } 12369 }, { 12370 key: "addResourceBundle", 12371 value: function addResourceBundle(lng, ns, resources, deep, overwrite) { 12372 var options = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : { 12373 silent: false 12374 }; 12375 var path2 = [lng, ns]; 12376 if (lng.indexOf(".") > -1) { 12377 path2 = lng.split("."); 12378 deep = resources; 12379 resources = ns; 12380 ns = path2[1]; 12381 } 12382 this.addNamespaces(ns); 12383 var pack = getPath(this.data, path2) || {}; 12384 if (deep) { 12385 deepExtend(pack, resources, overwrite); 12386 } else { 12387 pack = _objectSpread$1(_objectSpread$1({}, pack), resources); 12388 } 12389 setPath(this.data, path2, pack); 12390 if (!options.silent) this.emit("added", lng, ns, resources); 12391 } 12392 }, { 12393 key: "removeResourceBundle", 12394 value: function removeResourceBundle(lng, ns) { 12395 if (this.hasResourceBundle(lng, ns)) { 12396 delete this.data[lng][ns]; 12397 } 12398 this.removeNamespaces(ns); 12399 this.emit("removed", lng, ns); 12400 } 12401 }, { 12402 key: "hasResourceBundle", 12403 value: function hasResourceBundle(lng, ns) { 12404 return this.getResource(lng, ns) !== void 0; 12405 } 12406 }, { 12407 key: "getResourceBundle", 12408 value: function getResourceBundle(lng, ns) { 12409 if (!ns) ns = this.options.defaultNS; 12410 if (this.options.compatibilityAPI === "v1") return _objectSpread$1(_objectSpread$1({}, {}), this.getResource(lng, ns)); 12411 return this.getResource(lng, ns); 12412 } 12413 }, { 12414 key: "getDataByLanguage", 12415 value: function getDataByLanguage(lng) { 12416 return this.data[lng]; 12417 } 12418 }, { 12419 key: "hasLanguageSomeTranslations", 12420 value: function hasLanguageSomeTranslations(lng) { 12421 var data = this.getDataByLanguage(lng); 12422 var n = data && Object.keys(data) || []; 12423 return !!n.find(function(v) { 12424 return data[v] && Object.keys(data[v]).length > 0; 12425 }); 12426 } 12427 }, { 12428 key: "toJSON", 12429 value: function toJSON() { 12430 return this.data; 12431 } 12432 }]); 12433 return ResourceStore2; 12434 })(EventEmitter); 12435 var postProcessor = { 12436 processors: {}, 12437 addPostProcessor: function addPostProcessor(module) { 12438 this.processors[module.name] = module; 12439 }, 12440 handle: function handle(processors, value, key, options, translator) { 12441 var _this = this; 12442 processors.forEach(function(processor) { 12443 if (_this.processors[processor]) value = _this.processors[processor].process(value, key, options, translator); 12444 }); 12445 return value; 12446 } 12447 }; 12448 function ownKeys$2(object, enumerableOnly) { 12449 var keys = Object.keys(object); 12450 if (Object.getOwnPropertySymbols) { 12451 var symbols = Object.getOwnPropertySymbols(object); 12452 if (enumerableOnly) { 12453 symbols = symbols.filter(function(sym) { 12454 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 12455 }); 12456 } 12457 keys.push.apply(keys, symbols); 12458 } 12459 return keys; 12460 } 12461 function _objectSpread$2(target) { 12462 for (var i = 1; i < arguments.length; i++) { 12463 var source = arguments[i] != null ? arguments[i] : {}; 12464 if (i % 2) { 12465 ownKeys$2(Object(source), true).forEach(function(key) { 12466 _defineProperty(target, key, source[key]); 12467 }); 12468 } else if (Object.getOwnPropertyDescriptors) { 12469 Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); 12470 } else { 12471 ownKeys$2(Object(source)).forEach(function(key) { 12472 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 12473 }); 12474 } 12475 } 12476 return target; 12477 } 12478 function _createSuper$1(Derived) { 12479 var hasNativeReflectConstruct = _isNativeReflectConstruct$1(); 12480 return function _createSuperInternal() { 12481 var Super = _getPrototypeOf(Derived), result; 12482 if (hasNativeReflectConstruct) { 12483 var NewTarget = _getPrototypeOf(this).constructor; 12484 result = Reflect.construct(Super, arguments, NewTarget); 12485 } else { 12486 result = Super.apply(this, arguments); 12487 } 12488 return _possibleConstructorReturn(this, result); 12489 }; 12490 } 12491 function _isNativeReflectConstruct$1() { 12492 if (typeof Reflect === "undefined" || !Reflect.construct) return false; 12493 if (Reflect.construct.sham) return false; 12494 if (typeof Proxy === "function") return true; 12495 try { 12496 Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { 12497 })); 12498 return true; 12499 } catch (e2) { 12500 return false; 12501 } 12502 } 12503 var checkedLoadedFor = {}; 12504 var Translator = (function(_EventEmitter) { 12505 _inherits(Translator2, _EventEmitter); 12506 var _super = _createSuper$1(Translator2); 12507 function Translator2(services) { 12508 var _this; 12509 var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; 12510 _classCallCheck(this, Translator2); 12511 _this = _super.call(this); 12512 if (isIE10) { 12513 EventEmitter.call(_assertThisInitialized(_this)); 12514 } 12515 copy(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], services, _assertThisInitialized(_this)); 12516 _this.options = options; 12517 if (_this.options.keySeparator === void 0) { 12518 _this.options.keySeparator = "."; 12519 } 12520 _this.logger = baseLogger.create("translator"); 12521 return _this; 12522 } 12523 _createClass(Translator2, [{ 12524 key: "changeLanguage", 12525 value: function changeLanguage2(lng) { 12526 if (lng) this.language = lng; 12527 } 12528 }, { 12529 key: "exists", 12530 value: function exists2(key) { 12531 var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : { 12532 interpolation: {} 12533 }; 12534 if (key === void 0 || key === null) { 12535 return false; 12536 } 12537 var resolved = this.resolve(key, options); 12538 return resolved && resolved.res !== void 0; 12539 } 12540 }, { 12541 key: "extractFromKey", 12542 value: function extractFromKey(key, options) { 12543 var nsSeparator = options.nsSeparator !== void 0 ? options.nsSeparator : this.options.nsSeparator; 12544 if (nsSeparator === void 0) nsSeparator = ":"; 12545 var keySeparator = options.keySeparator !== void 0 ? options.keySeparator : this.options.keySeparator; 12546 var namespaces = options.ns || this.options.defaultNS || []; 12547 var wouldCheckForNsInKey = nsSeparator && key.indexOf(nsSeparator) > -1; 12548 var seemsNaturalLanguage = !this.options.userDefinedKeySeparator && !options.keySeparator && !this.options.userDefinedNsSeparator && !options.nsSeparator && !looksLikeObjectPath(key, nsSeparator, keySeparator); 12549 if (wouldCheckForNsInKey && !seemsNaturalLanguage) { 12550 var m = key.match(this.interpolator.nestingRegexp); 12551 if (m && m.length > 0) { 12552 return { 12553 key, 12554 namespaces 12555 }; 12556 } 12557 var parts = key.split(nsSeparator); 12558 if (nsSeparator !== keySeparator || nsSeparator === keySeparator && this.options.ns.indexOf(parts[0]) > -1) namespaces = parts.shift(); 12559 key = parts.join(keySeparator); 12560 } 12561 if (typeof namespaces === "string") namespaces = [namespaces]; 12562 return { 12563 key, 12564 namespaces 12565 }; 12566 } 12567 }, { 12568 key: "translate", 12569 value: function translate(keys, options, lastKey) { 12570 var _this2 = this; 12571 if (_typeof(options) !== "object" && this.options.overloadTranslationOptionHandler) { 12572 options = this.options.overloadTranslationOptionHandler(arguments); 12573 } 12574 if (!options) options = {}; 12575 if (keys === void 0 || keys === null) return ""; 12576 if (!Array.isArray(keys)) keys = [String(keys)]; 12577 var returnDetails = options.returnDetails !== void 0 ? options.returnDetails : this.options.returnDetails; 12578 var keySeparator = options.keySeparator !== void 0 ? options.keySeparator : this.options.keySeparator; 12579 var _this$extractFromKey = this.extractFromKey(keys[keys.length - 1], options), key = _this$extractFromKey.key, namespaces = _this$extractFromKey.namespaces; 12580 var namespace = namespaces[namespaces.length - 1]; 12581 var lng = options.lng || this.language; 12582 var appendNamespaceToCIMode = options.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode; 12583 if (lng && lng.toLowerCase() === "cimode") { 12584 if (appendNamespaceToCIMode) { 12585 var nsSeparator = options.nsSeparator || this.options.nsSeparator; 12586 if (returnDetails) { 12587 resolved.res = "".concat(namespace).concat(nsSeparator).concat(key); 12588 return resolved; 12589 } 12590 return "".concat(namespace).concat(nsSeparator).concat(key); 12591 } 12592 if (returnDetails) { 12593 resolved.res = key; 12594 return resolved; 12595 } 12596 return key; 12597 } 12598 var resolved = this.resolve(keys, options); 12599 var res = resolved && resolved.res; 12600 var resUsedKey = resolved && resolved.usedKey || key; 12601 var resExactUsedKey = resolved && resolved.exactUsedKey || key; 12602 var resType = Object.prototype.toString.apply(res); 12603 var noObject = ["[object Number]", "[object Function]", "[object RegExp]"]; 12604 var joinArrays = options.joinArrays !== void 0 ? options.joinArrays : this.options.joinArrays; 12605 var handleAsObjectInI18nFormat = !this.i18nFormat || this.i18nFormat.handleAsObject; 12606 var handleAsObject = typeof res !== "string" && typeof res !== "boolean" && typeof res !== "number"; 12607 if (handleAsObjectInI18nFormat && res && handleAsObject && noObject.indexOf(resType) < 0 && !(typeof joinArrays === "string" && resType === "[object Array]")) { 12608 if (!options.returnObjects && !this.options.returnObjects) { 12609 if (!this.options.returnedObjectHandler) { 12610 this.logger.warn("accessing an object - but returnObjects options is not enabled!"); 12611 } 12612 var r = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(resUsedKey, res, _objectSpread$2(_objectSpread$2({}, options), {}, { 12613 ns: namespaces 12614 })) : "key '".concat(key, " (").concat(this.language, ")' returned an object instead of string."); 12615 if (returnDetails) { 12616 resolved.res = r; 12617 return resolved; 12618 } 12619 return r; 12620 } 12621 if (keySeparator) { 12622 var resTypeIsArray = resType === "[object Array]"; 12623 var copy2 = resTypeIsArray ? [] : {}; 12624 var newKeyToUse = resTypeIsArray ? resExactUsedKey : resUsedKey; 12625 for (var m in res) { 12626 if (Object.prototype.hasOwnProperty.call(res, m)) { 12627 var deepKey = "".concat(newKeyToUse).concat(keySeparator).concat(m); 12628 copy2[m] = this.translate(deepKey, _objectSpread$2(_objectSpread$2({}, options), { 12629 joinArrays: false, 12630 ns: namespaces 12631 })); 12632 if (copy2[m] === deepKey) copy2[m] = res[m]; 12633 } 12634 } 12635 res = copy2; 12636 } 12637 } else if (handleAsObjectInI18nFormat && typeof joinArrays === "string" && resType === "[object Array]") { 12638 res = res.join(joinArrays); 12639 if (res) res = this.extendTranslation(res, keys, options, lastKey); 12640 } else { 12641 var usedDefault = false; 12642 var usedKey = false; 12643 var needsPluralHandling = options.count !== void 0 && typeof options.count !== "string"; 12644 var hasDefaultValue = Translator2.hasDefaultValue(options); 12645 var defaultValueSuffix = needsPluralHandling ? this.pluralResolver.getSuffix(lng, options.count, options) : ""; 12646 var defaultValue = options["defaultValue".concat(defaultValueSuffix)] || options.defaultValue; 12647 if (!this.isValidLookup(res) && hasDefaultValue) { 12648 usedDefault = true; 12649 res = defaultValue; 12650 } 12651 if (!this.isValidLookup(res)) { 12652 usedKey = true; 12653 res = key; 12654 } 12655 var missingKeyNoValueFallbackToKey = options.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey; 12656 var resForMissing = missingKeyNoValueFallbackToKey && usedKey ? void 0 : res; 12657 var updateMissing = hasDefaultValue && defaultValue !== res && this.options.updateMissing; 12658 if (usedKey || usedDefault || updateMissing) { 12659 this.logger.log(updateMissing ? "updateKey" : "missingKey", lng, namespace, key, updateMissing ? defaultValue : res); 12660 if (keySeparator) { 12661 var fk = this.resolve(key, _objectSpread$2(_objectSpread$2({}, options), {}, { 12662 keySeparator: false 12663 })); 12664 if (fk && fk.res) this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format."); 12665 } 12666 var lngs = []; 12667 var fallbackLngs = this.languageUtils.getFallbackCodes(this.options.fallbackLng, options.lng || this.language); 12668 if (this.options.saveMissingTo === "fallback" && fallbackLngs && fallbackLngs[0]) { 12669 for (var i = 0; i < fallbackLngs.length; i++) { 12670 lngs.push(fallbackLngs[i]); 12671 } 12672 } else if (this.options.saveMissingTo === "all") { 12673 lngs = this.languageUtils.toResolveHierarchy(options.lng || this.language); 12674 } else { 12675 lngs.push(options.lng || this.language); 12676 } 12677 var send = function send2(l, k, specificDefaultValue) { 12678 var defaultForMissing = hasDefaultValue && specificDefaultValue !== res ? specificDefaultValue : resForMissing; 12679 if (_this2.options.missingKeyHandler) { 12680 _this2.options.missingKeyHandler(l, namespace, k, defaultForMissing, updateMissing, options); 12681 } else if (_this2.backendConnector && _this2.backendConnector.saveMissing) { 12682 _this2.backendConnector.saveMissing(l, namespace, k, defaultForMissing, updateMissing, options); 12683 } 12684 _this2.emit("missingKey", l, namespace, k, res); 12685 }; 12686 if (this.options.saveMissing) { 12687 if (this.options.saveMissingPlurals && needsPluralHandling) { 12688 lngs.forEach(function(language) { 12689 _this2.pluralResolver.getSuffixes(language, options).forEach(function(suffix) { 12690 send([language], key + suffix, options["defaultValue".concat(suffix)] || defaultValue); 12691 }); 12692 }); 12693 } else { 12694 send(lngs, key, defaultValue); 12695 } 12696 } 12697 } 12698 res = this.extendTranslation(res, keys, options, resolved, lastKey); 12699 if (usedKey && res === key && this.options.appendNamespaceToMissingKey) res = "".concat(namespace, ":").concat(key); 12700 if ((usedKey || usedDefault) && this.options.parseMissingKeyHandler) { 12701 if (this.options.compatibilityAPI !== "v1") { 12702 res = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? "".concat(namespace, ":").concat(key) : key, usedDefault ? res : void 0); 12703 } else { 12704 res = this.options.parseMissingKeyHandler(res); 12705 } 12706 } 12707 } 12708 if (returnDetails) { 12709 resolved.res = res; 12710 return resolved; 12711 } 12712 return res; 12713 } 12714 }, { 12715 key: "extendTranslation", 12716 value: function extendTranslation(res, key, options, resolved, lastKey) { 12717 var _this3 = this; 12718 if (this.i18nFormat && this.i18nFormat.parse) { 12719 res = this.i18nFormat.parse(res, _objectSpread$2(_objectSpread$2({}, this.options.interpolation.defaultVariables), options), resolved.usedLng, resolved.usedNS, resolved.usedKey, { 12720 resolved 12721 }); 12722 } else if (!options.skipInterpolation) { 12723 if (options.interpolation) this.interpolator.init(_objectSpread$2(_objectSpread$2({}, options), { 12724 interpolation: _objectSpread$2(_objectSpread$2({}, this.options.interpolation), options.interpolation) 12725 })); 12726 var skipOnVariables = typeof res === "string" && (options && options.interpolation && options.interpolation.skipOnVariables !== void 0 ? options.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables); 12727 var nestBef; 12728 if (skipOnVariables) { 12729 var nb = res.match(this.interpolator.nestingRegexp); 12730 nestBef = nb && nb.length; 12731 } 12732 var data = options.replace && typeof options.replace !== "string" ? options.replace : options; 12733 if (this.options.interpolation.defaultVariables) data = _objectSpread$2(_objectSpread$2({}, this.options.interpolation.defaultVariables), data); 12734 res = this.interpolator.interpolate(res, data, options.lng || this.language, options); 12735 if (skipOnVariables) { 12736 var na = res.match(this.interpolator.nestingRegexp); 12737 var nestAft = na && na.length; 12738 if (nestBef < nestAft) options.nest = false; 12739 } 12740 if (options.nest !== false) res = this.interpolator.nest(res, function() { 12741 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { 12742 args[_key] = arguments[_key]; 12743 } 12744 if (lastKey && lastKey[0] === args[0] && !options.context) { 12745 _this3.logger.warn("It seems you are nesting recursively key: ".concat(args[0], " in key: ").concat(key[0])); 12746 return null; 12747 } 12748 return _this3.translate.apply(_this3, args.concat([key])); 12749 }, options); 12750 if (options.interpolation) this.interpolator.reset(); 12751 } 12752 var postProcess = options.postProcess || this.options.postProcess; 12753 var postProcessorNames = typeof postProcess === "string" ? [postProcess] : postProcess; 12754 if (res !== void 0 && res !== null && postProcessorNames && postProcessorNames.length && options.applyPostProcessor !== false) { 12755 res = postProcessor.handle(postProcessorNames, res, key, this.options && this.options.postProcessPassResolved ? _objectSpread$2({ 12756 i18nResolved: resolved 12757 }, options) : options, this); 12758 } 12759 return res; 12760 } 12761 }, { 12762 key: "resolve", 12763 value: function resolve(keys) { 12764 var _this4 = this; 12765 var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; 12766 var found; 12767 var usedKey; 12768 var exactUsedKey; 12769 var usedLng; 12770 var usedNS; 12771 if (typeof keys === "string") keys = [keys]; 12772 keys.forEach(function(k) { 12773 if (_this4.isValidLookup(found)) return; 12774 var extracted = _this4.extractFromKey(k, options); 12775 var key = extracted.key; 12776 usedKey = key; 12777 var namespaces = extracted.namespaces; 12778 if (_this4.options.fallbackNS) namespaces = namespaces.concat(_this4.options.fallbackNS); 12779 var needsPluralHandling = options.count !== void 0 && typeof options.count !== "string"; 12780 var needsZeroSuffixLookup = needsPluralHandling && !options.ordinal && options.count === 0 && _this4.pluralResolver.shouldUseIntlApi(); 12781 var needsContextHandling = options.context !== void 0 && (typeof options.context === "string" || typeof options.context === "number") && options.context !== ""; 12782 var codes = options.lngs ? options.lngs : _this4.languageUtils.toResolveHierarchy(options.lng || _this4.language, options.fallbackLng); 12783 namespaces.forEach(function(ns) { 12784 if (_this4.isValidLookup(found)) return; 12785 usedNS = ns; 12786 if (!checkedLoadedFor["".concat(codes[0], "-").concat(ns)] && _this4.utils && _this4.utils.hasLoadedNamespace && !_this4.utils.hasLoadedNamespace(usedNS)) { 12787 checkedLoadedFor["".concat(codes[0], "-").concat(ns)] = true; 12788 _this4.logger.warn('key "'.concat(usedKey, '" for languages "').concat(codes.join(", "), `" won't get resolved as namespace "`).concat(usedNS, '" was not yet loaded'), "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"); 12789 } 12790 codes.forEach(function(code) { 12791 if (_this4.isValidLookup(found)) return; 12792 usedLng = code; 12793 var finalKeys = [key]; 12794 if (_this4.i18nFormat && _this4.i18nFormat.addLookupKeys) { 12795 _this4.i18nFormat.addLookupKeys(finalKeys, key, code, ns, options); 12796 } else { 12797 var pluralSuffix; 12798 if (needsPluralHandling) pluralSuffix = _this4.pluralResolver.getSuffix(code, options.count, options); 12799 var zeroSuffix = "".concat(_this4.options.pluralSeparator, "zero"); 12800 if (needsPluralHandling) { 12801 finalKeys.push(key + pluralSuffix); 12802 if (needsZeroSuffixLookup) { 12803 finalKeys.push(key + zeroSuffix); 12804 } 12805 } 12806 if (needsContextHandling) { 12807 var contextKey = "".concat(key).concat(_this4.options.contextSeparator).concat(options.context); 12808 finalKeys.push(contextKey); 12809 if (needsPluralHandling) { 12810 finalKeys.push(contextKey + pluralSuffix); 12811 if (needsZeroSuffixLookup) { 12812 finalKeys.push(contextKey + zeroSuffix); 12813 } 12814 } 12815 } 12816 } 12817 var possibleKey; 12818 while (possibleKey = finalKeys.pop()) { 12819 if (!_this4.isValidLookup(found)) { 12820 exactUsedKey = possibleKey; 12821 found = _this4.getResource(code, ns, possibleKey, options); 12822 } 12823 } 12824 }); 12825 }); 12826 }); 12827 return { 12828 res: found, 12829 usedKey, 12830 exactUsedKey, 12831 usedLng, 12832 usedNS 12833 }; 12834 } 12835 }, { 12836 key: "isValidLookup", 12837 value: function isValidLookup(res) { 12838 return res !== void 0 && !(!this.options.returnNull && res === null) && !(!this.options.returnEmptyString && res === ""); 12839 } 12840 }, { 12841 key: "getResource", 12842 value: function getResource(code, ns, key) { 12843 var options = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {}; 12844 if (this.i18nFormat && this.i18nFormat.getResource) return this.i18nFormat.getResource(code, ns, key, options); 12845 return this.resourceStore.getResource(code, ns, key, options); 12846 } 12847 }], [{ 12848 key: "hasDefaultValue", 12849 value: function hasDefaultValue(options) { 12850 var prefix = "defaultValue"; 12851 for (var option in options) { 12852 if (Object.prototype.hasOwnProperty.call(options, option) && prefix === option.substring(0, prefix.length) && void 0 !== options[option]) { 12853 return true; 12854 } 12855 } 12856 return false; 12857 } 12858 }]); 12859 return Translator2; 12860 })(EventEmitter); 12861 function capitalize(string) { 12862 return string.charAt(0).toUpperCase() + string.slice(1); 12863 } 12864 var LanguageUtil = (function() { 12865 function LanguageUtil2(options) { 12866 _classCallCheck(this, LanguageUtil2); 12867 this.options = options; 12868 this.supportedLngs = this.options.supportedLngs || false; 12869 this.logger = baseLogger.create("languageUtils"); 12870 } 12871 _createClass(LanguageUtil2, [{ 12872 key: "getScriptPartFromCode", 12873 value: function getScriptPartFromCode(code) { 12874 if (!code || code.indexOf("-") < 0) return null; 12875 var p = code.split("-"); 12876 if (p.length === 2) return null; 12877 p.pop(); 12878 if (p[p.length - 1].toLowerCase() === "x") return null; 12879 return this.formatLanguageCode(p.join("-")); 12880 } 12881 }, { 12882 key: "getLanguagePartFromCode", 12883 value: function getLanguagePartFromCode(code) { 12884 if (!code || code.indexOf("-") < 0) return code; 12885 var p = code.split("-"); 12886 return this.formatLanguageCode(p[0]); 12887 } 12888 }, { 12889 key: "formatLanguageCode", 12890 value: function formatLanguageCode(code) { 12891 if (typeof code === "string" && code.indexOf("-") > -1) { 12892 var specialCases = ["hans", "hant", "latn", "cyrl", "cans", "mong", "arab"]; 12893 var p = code.split("-"); 12894 if (this.options.lowerCaseLng) { 12895 p = p.map(function(part) { 12896 return part.toLowerCase(); 12897 }); 12898 } else if (p.length === 2) { 12899 p[0] = p[0].toLowerCase(); 12900 p[1] = p[1].toUpperCase(); 12901 if (specialCases.indexOf(p[1].toLowerCase()) > -1) p[1] = capitalize(p[1].toLowerCase()); 12902 } else if (p.length === 3) { 12903 p[0] = p[0].toLowerCase(); 12904 if (p[1].length === 2) p[1] = p[1].toUpperCase(); 12905 if (p[0] !== "sgn" && p[2].length === 2) p[2] = p[2].toUpperCase(); 12906 if (specialCases.indexOf(p[1].toLowerCase()) > -1) p[1] = capitalize(p[1].toLowerCase()); 12907 if (specialCases.indexOf(p[2].toLowerCase()) > -1) p[2] = capitalize(p[2].toLowerCase()); 12908 } 12909 return p.join("-"); 12910 } 12911 return this.options.cleanCode || this.options.lowerCaseLng ? code.toLowerCase() : code; 12912 } 12913 }, { 12914 key: "isSupportedCode", 12915 value: function isSupportedCode(code) { 12916 if (this.options.load === "languageOnly" || this.options.nonExplicitSupportedLngs) { 12917 code = this.getLanguagePartFromCode(code); 12918 } 12919 return !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(code) > -1; 12920 } 12921 }, { 12922 key: "getBestMatchFromCodes", 12923 value: function getBestMatchFromCodes(codes) { 12924 var _this = this; 12925 if (!codes) return null; 12926 var found; 12927 codes.forEach(function(code) { 12928 if (found) return; 12929 var cleanedLng = _this.formatLanguageCode(code); 12930 if (!_this.options.supportedLngs || _this.isSupportedCode(cleanedLng)) found = cleanedLng; 12931 }); 12932 if (!found && this.options.supportedLngs) { 12933 codes.forEach(function(code) { 12934 if (found) return; 12935 var lngOnly = _this.getLanguagePartFromCode(code); 12936 if (_this.isSupportedCode(lngOnly)) return found = lngOnly; 12937 found = _this.options.supportedLngs.find(function(supportedLng) { 12938 if (supportedLng.indexOf(lngOnly) === 0) return supportedLng; 12939 }); 12940 }); 12941 } 12942 if (!found) found = this.getFallbackCodes(this.options.fallbackLng)[0]; 12943 return found; 12944 } 12945 }, { 12946 key: "getFallbackCodes", 12947 value: function getFallbackCodes(fallbacks, code) { 12948 if (!fallbacks) return []; 12949 if (typeof fallbacks === "function") fallbacks = fallbacks(code); 12950 if (typeof fallbacks === "string") fallbacks = [fallbacks]; 12951 if (Object.prototype.toString.apply(fallbacks) === "[object Array]") return fallbacks; 12952 if (!code) return fallbacks["default"] || []; 12953 var found = fallbacks[code]; 12954 if (!found) found = fallbacks[this.getScriptPartFromCode(code)]; 12955 if (!found) found = fallbacks[this.formatLanguageCode(code)]; 12956 if (!found) found = fallbacks[this.getLanguagePartFromCode(code)]; 12957 if (!found) found = fallbacks["default"]; 12958 return found || []; 12959 } 12960 }, { 12961 key: "toResolveHierarchy", 12962 value: function toResolveHierarchy(code, fallbackCode) { 12963 var _this2 = this; 12964 var fallbackCodes = this.getFallbackCodes(fallbackCode || this.options.fallbackLng || [], code); 12965 var codes = []; 12966 var addCode = function addCode2(c) { 12967 if (!c) return; 12968 if (_this2.isSupportedCode(c)) { 12969 codes.push(c); 12970 } else { 12971 _this2.logger.warn("rejecting language code not found in supportedLngs: ".concat(c)); 12972 } 12973 }; 12974 if (typeof code === "string" && code.indexOf("-") > -1) { 12975 if (this.options.load !== "languageOnly") addCode(this.formatLanguageCode(code)); 12976 if (this.options.load !== "languageOnly" && this.options.load !== "currentOnly") addCode(this.getScriptPartFromCode(code)); 12977 if (this.options.load !== "currentOnly") addCode(this.getLanguagePartFromCode(code)); 12978 } else if (typeof code === "string") { 12979 addCode(this.formatLanguageCode(code)); 12980 } 12981 fallbackCodes.forEach(function(fc) { 12982 if (codes.indexOf(fc) < 0) addCode(_this2.formatLanguageCode(fc)); 12983 }); 12984 return codes; 12985 } 12986 }]); 12987 return LanguageUtil2; 12988 })(); 12989 var sets = [{ 12990 lngs: ["ach", "ak", "am", "arn", "br", "fil", "gun", "ln", "mfe", "mg", "mi", "oc", "pt", "pt-BR", "tg", "tl", "ti", "tr", "uz", "wa"], 12991 nr: [1, 2], 12992 fc: 1 12993 }, { 12994 lngs: ["af", "an", "ast", "az", "bg", "bn", "ca", "da", "de", "dev", "el", "en", "eo", "es", "et", "eu", "fi", "fo", "fur", "fy", "gl", "gu", "ha", "hi", "hu", "hy", "ia", "it", "kk", "kn", "ku", "lb", "mai", "ml", "mn", "mr", "nah", "nap", "nb", "ne", "nl", "nn", "no", "nso", "pa", "pap", "pms", "ps", "pt-PT", "rm", "sco", "se", "si", "so", "son", "sq", "sv", "sw", "ta", "te", "tk", "ur", "yo"], 12995 nr: [1, 2], 12996 fc: 2 12997 }, { 12998 lngs: ["ay", "bo", "cgg", "fa", "ht", "id", "ja", "jbo", "ka", "km", "ko", "ky", "lo", "ms", "sah", "su", "th", "tt", "ug", "vi", "wo", "zh"], 12999 nr: [1], 13000 fc: 3 13001 }, { 13002 lngs: ["be", "bs", "cnr", "dz", "hr", "ru", "sr", "uk"], 13003 nr: [1, 2, 5], 13004 fc: 4 13005 }, { 13006 lngs: ["ar"], 13007 nr: [0, 1, 2, 3, 11, 100], 13008 fc: 5 13009 }, { 13010 lngs: ["cs", "sk"], 13011 nr: [1, 2, 5], 13012 fc: 6 13013 }, { 13014 lngs: ["csb", "pl"], 13015 nr: [1, 2, 5], 13016 fc: 7 13017 }, { 13018 lngs: ["cy"], 13019 nr: [1, 2, 3, 8], 13020 fc: 8 13021 }, { 13022 lngs: ["fr"], 13023 nr: [1, 2], 13024 fc: 9 13025 }, { 13026 lngs: ["ga"], 13027 nr: [1, 2, 3, 7, 11], 13028 fc: 10 13029 }, { 13030 lngs: ["gd"], 13031 nr: [1, 2, 3, 20], 13032 fc: 11 13033 }, { 13034 lngs: ["is"], 13035 nr: [1, 2], 13036 fc: 12 13037 }, { 13038 lngs: ["jv"], 13039 nr: [0, 1], 13040 fc: 13 13041 }, { 13042 lngs: ["kw"], 13043 nr: [1, 2, 3, 4], 13044 fc: 14 13045 }, { 13046 lngs: ["lt"], 13047 nr: [1, 2, 10], 13048 fc: 15 13049 }, { 13050 lngs: ["lv"], 13051 nr: [1, 2, 0], 13052 fc: 16 13053 }, { 13054 lngs: ["mk"], 13055 nr: [1, 2], 13056 fc: 17 13057 }, { 13058 lngs: ["mnk"], 13059 nr: [0, 1, 2], 13060 fc: 18 13061 }, { 13062 lngs: ["mt"], 13063 nr: [1, 2, 11, 20], 13064 fc: 19 13065 }, { 13066 lngs: ["or"], 13067 nr: [2, 1], 13068 fc: 2 13069 }, { 13070 lngs: ["ro"], 13071 nr: [1, 2, 20], 13072 fc: 20 13073 }, { 13074 lngs: ["sl"], 13075 nr: [5, 1, 2, 3], 13076 fc: 21 13077 }, { 13078 lngs: ["he", "iw"], 13079 nr: [1, 2, 20, 21], 13080 fc: 22 13081 }]; 13082 var _rulesPluralsTypes = { 13083 1: function _(n) { 13084 return Number(n > 1); 13085 }, 13086 2: function _2(n) { 13087 return Number(n != 1); 13088 }, 13089 3: function _3(n) { 13090 return 0; 13091 }, 13092 4: function _4(n) { 13093 return Number(n % 10 == 1 && n % 100 != 11 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2); 13094 }, 13095 5: function _5(n) { 13096 return Number(n == 0 ? 0 : n == 1 ? 1 : n == 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5); 13097 }, 13098 6: function _6(n) { 13099 return Number(n == 1 ? 0 : n >= 2 && n <= 4 ? 1 : 2); 13100 }, 13101 7: function _7(n) { 13102 return Number(n == 1 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2); 13103 }, 13104 8: function _8(n) { 13105 return Number(n == 1 ? 0 : n == 2 ? 1 : n != 8 && n != 11 ? 2 : 3); 13106 }, 13107 9: function _9(n) { 13108 return Number(n >= 2); 13109 }, 13110 10: function _10(n) { 13111 return Number(n == 1 ? 0 : n == 2 ? 1 : n < 7 ? 2 : n < 11 ? 3 : 4); 13112 }, 13113 11: function _11(n) { 13114 return Number(n == 1 || n == 11 ? 0 : n == 2 || n == 12 ? 1 : n > 2 && n < 20 ? 2 : 3); 13115 }, 13116 12: function _12(n) { 13117 return Number(n % 10 != 1 || n % 100 == 11); 13118 }, 13119 13: function _13(n) { 13120 return Number(n !== 0); 13121 }, 13122 14: function _14(n) { 13123 return Number(n == 1 ? 0 : n == 2 ? 1 : n == 3 ? 2 : 3); 13124 }, 13125 15: function _15(n) { 13126 return Number(n % 10 == 1 && n % 100 != 11 ? 0 : n % 10 >= 2 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2); 13127 }, 13128 16: function _16(n) { 13129 return Number(n % 10 == 1 && n % 100 != 11 ? 0 : n !== 0 ? 1 : 2); 13130 }, 13131 17: function _17(n) { 13132 return Number(n == 1 || n % 10 == 1 && n % 100 != 11 ? 0 : 1); 13133 }, 13134 18: function _18(n) { 13135 return Number(n == 0 ? 0 : n == 1 ? 1 : 2); 13136 }, 13137 19: function _19(n) { 13138 return Number(n == 1 ? 0 : n == 0 || n % 100 > 1 && n % 100 < 11 ? 1 : n % 100 > 10 && n % 100 < 20 ? 2 : 3); 13139 }, 13140 20: function _20(n) { 13141 return Number(n == 1 ? 0 : n == 0 || n % 100 > 0 && n % 100 < 20 ? 1 : 2); 13142 }, 13143 21: function _21(n) { 13144 return Number(n % 100 == 1 ? 1 : n % 100 == 2 ? 2 : n % 100 == 3 || n % 100 == 4 ? 3 : 0); 13145 }, 13146 22: function _22(n) { 13147 return Number(n == 1 ? 0 : n == 2 ? 1 : (n < 0 || n > 10) && n % 10 == 0 ? 2 : 3); 13148 } 13149 }; 13150 var deprecatedJsonVersions = ["v1", "v2", "v3"]; 13151 var suffixesOrder = { 13152 zero: 0, 13153 one: 1, 13154 two: 2, 13155 few: 3, 13156 many: 4, 13157 other: 5 13158 }; 13159 function createRules() { 13160 var rules = {}; 13161 sets.forEach(function(set) { 13162 set.lngs.forEach(function(l) { 13163 rules[l] = { 13164 numbers: set.nr, 13165 plurals: _rulesPluralsTypes[set.fc] 13166 }; 13167 }); 13168 }); 13169 return rules; 13170 } 13171 var PluralResolver = (function() { 13172 function PluralResolver2(languageUtils) { 13173 var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; 13174 _classCallCheck(this, PluralResolver2); 13175 this.languageUtils = languageUtils; 13176 this.options = options; 13177 this.logger = baseLogger.create("pluralResolver"); 13178 if ((!this.options.compatibilityJSON || this.options.compatibilityJSON === "v4") && (typeof Intl === "undefined" || !Intl.PluralRules)) { 13179 this.options.compatibilityJSON = "v3"; 13180 this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling."); 13181 } 13182 this.rules = createRules(); 13183 } 13184 _createClass(PluralResolver2, [{ 13185 key: "addRule", 13186 value: function addRule(lng, obj) { 13187 this.rules[lng] = obj; 13188 } 13189 }, { 13190 key: "getRule", 13191 value: function getRule(code) { 13192 var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; 13193 if (this.shouldUseIntlApi()) { 13194 try { 13195 return new Intl.PluralRules(code, { 13196 type: options.ordinal ? "ordinal" : "cardinal" 13197 }); 13198 } catch (_unused) { 13199 return; 13200 } 13201 } 13202 return this.rules[code] || this.rules[this.languageUtils.getLanguagePartFromCode(code)]; 13203 } 13204 }, { 13205 key: "needsPlural", 13206 value: function needsPlural(code) { 13207 var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; 13208 var rule = this.getRule(code, options); 13209 if (this.shouldUseIntlApi()) { 13210 return rule && rule.resolvedOptions().pluralCategories.length > 1; 13211 } 13212 return rule && rule.numbers.length > 1; 13213 } 13214 }, { 13215 key: "getPluralFormsOfKey", 13216 value: function getPluralFormsOfKey(code, key) { 13217 var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; 13218 return this.getSuffixes(code, options).map(function(suffix) { 13219 return "".concat(key).concat(suffix); 13220 }); 13221 } 13222 }, { 13223 key: "getSuffixes", 13224 value: function getSuffixes(code) { 13225 var _this = this; 13226 var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; 13227 var rule = this.getRule(code, options); 13228 if (!rule) { 13229 return []; 13230 } 13231 if (this.shouldUseIntlApi()) { 13232 return rule.resolvedOptions().pluralCategories.sort(function(pluralCategory1, pluralCategory2) { 13233 return suffixesOrder[pluralCategory1] - suffixesOrder[pluralCategory2]; 13234 }).map(function(pluralCategory) { 13235 return "".concat(_this.options.prepend).concat(pluralCategory); 13236 }); 13237 } 13238 return rule.numbers.map(function(number) { 13239 return _this.getSuffix(code, number, options); 13240 }); 13241 } 13242 }, { 13243 key: "getSuffix", 13244 value: function getSuffix(code, count) { 13245 var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; 13246 var rule = this.getRule(code, options); 13247 if (rule) { 13248 if (this.shouldUseIntlApi()) { 13249 return "".concat(this.options.prepend).concat(rule.select(count)); 13250 } 13251 return this.getSuffixRetroCompatible(rule, count); 13252 } 13253 this.logger.warn("no plural rule found for: ".concat(code)); 13254 return ""; 13255 } 13256 }, { 13257 key: "getSuffixRetroCompatible", 13258 value: function getSuffixRetroCompatible(rule, count) { 13259 var _this2 = this; 13260 var idx = rule.noAbs ? rule.plurals(count) : rule.plurals(Math.abs(count)); 13261 var suffix = rule.numbers[idx]; 13262 if (this.options.simplifyPluralSuffix && rule.numbers.length === 2 && rule.numbers[0] === 1) { 13263 if (suffix === 2) { 13264 suffix = "plural"; 13265 } else if (suffix === 1) { 13266 suffix = ""; 13267 } 13268 } 13269 var returnSuffix = function returnSuffix2() { 13270 return _this2.options.prepend && suffix.toString() ? _this2.options.prepend + suffix.toString() : suffix.toString(); 13271 }; 13272 if (this.options.compatibilityJSON === "v1") { 13273 if (suffix === 1) return ""; 13274 if (typeof suffix === "number") return "_plural_".concat(suffix.toString()); 13275 return returnSuffix(); 13276 } else if (this.options.compatibilityJSON === "v2") { 13277 return returnSuffix(); 13278 } else if (this.options.simplifyPluralSuffix && rule.numbers.length === 2 && rule.numbers[0] === 1) { 13279 return returnSuffix(); 13280 } 13281 return this.options.prepend && idx.toString() ? this.options.prepend + idx.toString() : idx.toString(); 13282 } 13283 }, { 13284 key: "shouldUseIntlApi", 13285 value: function shouldUseIntlApi() { 13286 return !deprecatedJsonVersions.includes(this.options.compatibilityJSON); 13287 } 13288 }]); 13289 return PluralResolver2; 13290 })(); 13291 function ownKeys$3(object, enumerableOnly) { 13292 var keys = Object.keys(object); 13293 if (Object.getOwnPropertySymbols) { 13294 var symbols = Object.getOwnPropertySymbols(object); 13295 if (enumerableOnly) { 13296 symbols = symbols.filter(function(sym) { 13297 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 13298 }); 13299 } 13300 keys.push.apply(keys, symbols); 13301 } 13302 return keys; 13303 } 13304 function _objectSpread$3(target) { 13305 for (var i = 1; i < arguments.length; i++) { 13306 var source = arguments[i] != null ? arguments[i] : {}; 13307 if (i % 2) { 13308 ownKeys$3(Object(source), true).forEach(function(key) { 13309 _defineProperty(target, key, source[key]); 13310 }); 13311 } else if (Object.getOwnPropertyDescriptors) { 13312 Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); 13313 } else { 13314 ownKeys$3(Object(source)).forEach(function(key) { 13315 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 13316 }); 13317 } 13318 } 13319 return target; 13320 } 13321 var Interpolator = (function() { 13322 function Interpolator2() { 13323 var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; 13324 _classCallCheck(this, Interpolator2); 13325 this.logger = baseLogger.create("interpolator"); 13326 this.options = options; 13327 this.format = options.interpolation && options.interpolation.format || function(value) { 13328 return value; 13329 }; 13330 this.init(options); 13331 } 13332 _createClass(Interpolator2, [{ 13333 key: "init", 13334 value: function init2() { 13335 var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; 13336 if (!options.interpolation) options.interpolation = { 13337 escapeValue: true 13338 }; 13339 var iOpts = options.interpolation; 13340 this.escape = iOpts.escape !== void 0 ? iOpts.escape : escape2; 13341 this.escapeValue = iOpts.escapeValue !== void 0 ? iOpts.escapeValue : true; 13342 this.useRawValueToEscape = iOpts.useRawValueToEscape !== void 0 ? iOpts.useRawValueToEscape : false; 13343 this.prefix = iOpts.prefix ? regexEscape(iOpts.prefix) : iOpts.prefixEscaped || "{{"; 13344 this.suffix = iOpts.suffix ? regexEscape(iOpts.suffix) : iOpts.suffixEscaped || "}}"; 13345 this.formatSeparator = iOpts.formatSeparator ? iOpts.formatSeparator : iOpts.formatSeparator || ","; 13346 this.unescapePrefix = iOpts.unescapeSuffix ? "" : iOpts.unescapePrefix || "-"; 13347 this.unescapeSuffix = this.unescapePrefix ? "" : iOpts.unescapeSuffix || ""; 13348 this.nestingPrefix = iOpts.nestingPrefix ? regexEscape(iOpts.nestingPrefix) : iOpts.nestingPrefixEscaped || regexEscape("$t("); 13349 this.nestingSuffix = iOpts.nestingSuffix ? regexEscape(iOpts.nestingSuffix) : iOpts.nestingSuffixEscaped || regexEscape(")"); 13350 this.nestingOptionsSeparator = iOpts.nestingOptionsSeparator ? iOpts.nestingOptionsSeparator : iOpts.nestingOptionsSeparator || ","; 13351 this.maxReplaces = iOpts.maxReplaces ? iOpts.maxReplaces : 1e3; 13352 this.alwaysFormat = iOpts.alwaysFormat !== void 0 ? iOpts.alwaysFormat : false; 13353 this.resetRegExp(); 13354 } 13355 }, { 13356 key: "reset", 13357 value: function reset() { 13358 if (this.options) this.init(this.options); 13359 } 13360 }, { 13361 key: "resetRegExp", 13362 value: function resetRegExp() { 13363 var regexpStr = "".concat(this.prefix, "(.+?)").concat(this.suffix); 13364 this.regexp = new RegExp(regexpStr, "g"); 13365 var regexpUnescapeStr = "".concat(this.prefix).concat(this.unescapePrefix, "(.+?)").concat(this.unescapeSuffix).concat(this.suffix); 13366 this.regexpUnescape = new RegExp(regexpUnescapeStr, "g"); 13367 var nestingRegexpStr = "".concat(this.nestingPrefix, "(.+?)").concat(this.nestingSuffix); 13368 this.nestingRegexp = new RegExp(nestingRegexpStr, "g"); 13369 } 13370 }, { 13371 key: "interpolate", 13372 value: function interpolate(str, data, lng, options) { 13373 var _this = this; 13374 var match; 13375 var value; 13376 var replaces; 13377 var defaultData = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}; 13378 function regexSafe(val) { 13379 return val.replace(/\$/g, "$$$$"); 13380 } 13381 var handleFormat = function handleFormat2(key) { 13382 if (key.indexOf(_this.formatSeparator) < 0) { 13383 var path2 = getPathWithDefaults(data, defaultData, key); 13384 return _this.alwaysFormat ? _this.format(path2, void 0, lng, _objectSpread$3(_objectSpread$3(_objectSpread$3({}, options), data), {}, { 13385 interpolationkey: key 13386 })) : path2; 13387 } 13388 var p = key.split(_this.formatSeparator); 13389 var k = p.shift().trim(); 13390 var f = p.join(_this.formatSeparator).trim(); 13391 return _this.format(getPathWithDefaults(data, defaultData, k), f, lng, _objectSpread$3(_objectSpread$3(_objectSpread$3({}, options), data), {}, { 13392 interpolationkey: k 13393 })); 13394 }; 13395 this.resetRegExp(); 13396 var missingInterpolationHandler = options && options.missingInterpolationHandler || this.options.missingInterpolationHandler; 13397 var skipOnVariables = options && options.interpolation && options.interpolation.skipOnVariables !== void 0 ? options.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables; 13398 var todos = [{ 13399 regex: this.regexpUnescape, 13400 safeValue: function safeValue(val) { 13401 return regexSafe(val); 13402 } 13403 }, { 13404 regex: this.regexp, 13405 safeValue: function safeValue(val) { 13406 return _this.escapeValue ? regexSafe(_this.escape(val)) : regexSafe(val); 13407 } 13408 }]; 13409 todos.forEach(function(todo) { 13410 replaces = 0; 13411 while (match = todo.regex.exec(str)) { 13412 var matchedVar = match[1].trim(); 13413 value = handleFormat(matchedVar); 13414 if (value === void 0) { 13415 if (typeof missingInterpolationHandler === "function") { 13416 var temp = missingInterpolationHandler(str, match, options); 13417 value = typeof temp === "string" ? temp : ""; 13418 } else if (options && options.hasOwnProperty(matchedVar)) { 13419 value = ""; 13420 } else if (skipOnVariables) { 13421 value = match[0]; 13422 continue; 13423 } else { 13424 _this.logger.warn("missed to pass in variable ".concat(matchedVar, " for interpolating ").concat(str)); 13425 value = ""; 13426 } 13427 } else if (typeof value !== "string" && !_this.useRawValueToEscape) { 13428 value = makeString(value); 13429 } 13430 var safeValue = todo.safeValue(value); 13431 str = str.replace(match[0], safeValue); 13432 if (skipOnVariables) { 13433 todo.regex.lastIndex += value.length; 13434 todo.regex.lastIndex -= match[0].length; 13435 } else { 13436 todo.regex.lastIndex = 0; 13437 } 13438 replaces++; 13439 if (replaces >= _this.maxReplaces) { 13440 break; 13441 } 13442 } 13443 }); 13444 return str; 13445 } 13446 }, { 13447 key: "nest", 13448 value: function nest(str, fc) { 13449 var _this2 = this; 13450 var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; 13451 var match; 13452 var value; 13453 var clonedOptions = _objectSpread$3({}, options); 13454 clonedOptions.applyPostProcessor = false; 13455 delete clonedOptions.defaultValue; 13456 function handleHasOptions(key, inheritedOptions) { 13457 var sep = this.nestingOptionsSeparator; 13458 if (key.indexOf(sep) < 0) return key; 13459 var c = key.split(new RegExp("".concat(sep, "[ ]*{"))); 13460 var optionsString = "{".concat(c[1]); 13461 key = c[0]; 13462 optionsString = this.interpolate(optionsString, clonedOptions); 13463 var matchedSingleQuotes = optionsString.match(/'/g); 13464 var matchedDoubleQuotes = optionsString.match(/"/g); 13465 if (matchedSingleQuotes && matchedSingleQuotes.length % 2 === 0 && !matchedDoubleQuotes || matchedDoubleQuotes.length % 2 !== 0) { 13466 optionsString = optionsString.replace(/'/g, '"'); 13467 } 13468 try { 13469 clonedOptions = JSON.parse(optionsString); 13470 if (inheritedOptions) clonedOptions = _objectSpread$3(_objectSpread$3({}, inheritedOptions), clonedOptions); 13471 } catch (e2) { 13472 this.logger.warn("failed parsing options string in nesting for key ".concat(key), e2); 13473 return "".concat(key).concat(sep).concat(optionsString); 13474 } 13475 delete clonedOptions.defaultValue; 13476 return key; 13477 } 13478 while (match = this.nestingRegexp.exec(str)) { 13479 var formatters = []; 13480 var doReduce = false; 13481 if (match[0].indexOf(this.formatSeparator) !== -1 && !/{.*}/.test(match[1])) { 13482 var r = match[1].split(this.formatSeparator).map(function(elem) { 13483 return elem.trim(); 13484 }); 13485 match[1] = r.shift(); 13486 formatters = r; 13487 doReduce = true; 13488 } 13489 value = fc(handleHasOptions.call(this, match[1].trim(), clonedOptions), clonedOptions); 13490 if (value && match[0] === str && typeof value !== "string") return value; 13491 if (typeof value !== "string") value = makeString(value); 13492 if (!value) { 13493 this.logger.warn("missed to resolve ".concat(match[1], " for nesting ").concat(str)); 13494 value = ""; 13495 } 13496 if (doReduce) { 13497 value = formatters.reduce(function(v, f) { 13498 return _this2.format(v, f, options.lng, _objectSpread$3(_objectSpread$3({}, options), {}, { 13499 interpolationkey: match[1].trim() 13500 })); 13501 }, value.trim()); 13502 } 13503 str = str.replace(match[0], value); 13504 this.regexp.lastIndex = 0; 13505 } 13506 return str; 13507 } 13508 }]); 13509 return Interpolator2; 13510 })(); 13511 function ownKeys$4(object, enumerableOnly) { 13512 var keys = Object.keys(object); 13513 if (Object.getOwnPropertySymbols) { 13514 var symbols = Object.getOwnPropertySymbols(object); 13515 if (enumerableOnly) { 13516 symbols = symbols.filter(function(sym) { 13517 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 13518 }); 13519 } 13520 keys.push.apply(keys, symbols); 13521 } 13522 return keys; 13523 } 13524 function _objectSpread$4(target) { 13525 for (var i = 1; i < arguments.length; i++) { 13526 var source = arguments[i] != null ? arguments[i] : {}; 13527 if (i % 2) { 13528 ownKeys$4(Object(source), true).forEach(function(key) { 13529 _defineProperty(target, key, source[key]); 13530 }); 13531 } else if (Object.getOwnPropertyDescriptors) { 13532 Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); 13533 } else { 13534 ownKeys$4(Object(source)).forEach(function(key) { 13535 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 13536 }); 13537 } 13538 } 13539 return target; 13540 } 13541 function parseFormatStr(formatStr) { 13542 var formatName = formatStr.toLowerCase().trim(); 13543 var formatOptions = {}; 13544 if (formatStr.indexOf("(") > -1) { 13545 var p = formatStr.split("("); 13546 formatName = p[0].toLowerCase().trim(); 13547 var optStr = p[1].substring(0, p[1].length - 1); 13548 if (formatName === "currency" && optStr.indexOf(":") < 0) { 13549 if (!formatOptions.currency) formatOptions.currency = optStr.trim(); 13550 } else if (formatName === "relativetime" && optStr.indexOf(":") < 0) { 13551 if (!formatOptions.range) formatOptions.range = optStr.trim(); 13552 } else { 13553 var opts = optStr.split(";"); 13554 opts.forEach(function(opt) { 13555 if (!opt) return; 13556 var _opt$split = opt.split(":"), _opt$split2 = _toArray(_opt$split), key = _opt$split2[0], rest = _opt$split2.slice(1); 13557 var val = rest.join(":").trim().replace(/^'+|'+$/g, ""); 13558 if (!formatOptions[key.trim()]) formatOptions[key.trim()] = val; 13559 if (val === "false") formatOptions[key.trim()] = false; 13560 if (val === "true") formatOptions[key.trim()] = true; 13561 if (!isNaN(val)) formatOptions[key.trim()] = parseInt(val, 10); 13562 }); 13563 } 13564 } 13565 return { 13566 formatName, 13567 formatOptions 13568 }; 13569 } 13570 function createCachedFormatter(fn) { 13571 var cache = {}; 13572 return function invokeFormatter(val, lng, options) { 13573 var key = lng + JSON.stringify(options); 13574 var formatter = cache[key]; 13575 if (!formatter) { 13576 formatter = fn(lng, options); 13577 cache[key] = formatter; 13578 } 13579 return formatter(val); 13580 }; 13581 } 13582 var Formatter = (function() { 13583 function Formatter2() { 13584 var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; 13585 _classCallCheck(this, Formatter2); 13586 this.logger = baseLogger.create("formatter"); 13587 this.options = options; 13588 this.formats = { 13589 number: createCachedFormatter(function(lng, options2) { 13590 var formatter = new Intl.NumberFormat(lng, options2); 13591 return function(val) { 13592 return formatter.format(val); 13593 }; 13594 }), 13595 currency: createCachedFormatter(function(lng, options2) { 13596 var formatter = new Intl.NumberFormat(lng, _objectSpread$4(_objectSpread$4({}, options2), {}, { 13597 style: "currency" 13598 })); 13599 return function(val) { 13600 return formatter.format(val); 13601 }; 13602 }), 13603 datetime: createCachedFormatter(function(lng, options2) { 13604 var formatter = new Intl.DateTimeFormat(lng, _objectSpread$4({}, options2)); 13605 return function(val) { 13606 return formatter.format(val); 13607 }; 13608 }), 13609 relativetime: createCachedFormatter(function(lng, options2) { 13610 var formatter = new Intl.RelativeTimeFormat(lng, _objectSpread$4({}, options2)); 13611 return function(val) { 13612 return formatter.format(val, options2.range || "day"); 13613 }; 13614 }), 13615 list: createCachedFormatter(function(lng, options2) { 13616 var formatter = new Intl.ListFormat(lng, _objectSpread$4({}, options2)); 13617 return function(val) { 13618 return formatter.format(val); 13619 }; 13620 }) 13621 }; 13622 this.init(options); 13623 } 13624 _createClass(Formatter2, [{ 13625 key: "init", 13626 value: function init2(services) { 13627 var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : { 13628 interpolation: {} 13629 }; 13630 var iOpts = options.interpolation; 13631 this.formatSeparator = iOpts.formatSeparator ? iOpts.formatSeparator : iOpts.formatSeparator || ","; 13632 } 13633 }, { 13634 key: "add", 13635 value: function add(name, fc) { 13636 this.formats[name.toLowerCase().trim()] = fc; 13637 } 13638 }, { 13639 key: "addCached", 13640 value: function addCached(name, fc) { 13641 this.formats[name.toLowerCase().trim()] = createCachedFormatter(fc); 13642 } 13643 }, { 13644 key: "format", 13645 value: function format(value, _format, lng, options) { 13646 var _this = this; 13647 var formats = _format.split(this.formatSeparator); 13648 var result = formats.reduce(function(mem, f) { 13649 var _parseFormatStr = parseFormatStr(f), formatName = _parseFormatStr.formatName, formatOptions = _parseFormatStr.formatOptions; 13650 if (_this.formats[formatName]) { 13651 var formatted = mem; 13652 try { 13653 var valOptions = options && options.formatParams && options.formatParams[options.interpolationkey] || {}; 13654 var l = valOptions.locale || valOptions.lng || options.locale || options.lng || lng; 13655 formatted = _this.formats[formatName](mem, l, _objectSpread$4(_objectSpread$4(_objectSpread$4({}, formatOptions), options), valOptions)); 13656 } catch (error2) { 13657 _this.logger.warn(error2); 13658 } 13659 return formatted; 13660 } else { 13661 _this.logger.warn("there was no format function for ".concat(formatName)); 13662 } 13663 return mem; 13664 }, value); 13665 return result; 13666 } 13667 }]); 13668 return Formatter2; 13669 })(); 13670 function ownKeys$5(object, enumerableOnly) { 13671 var keys = Object.keys(object); 13672 if (Object.getOwnPropertySymbols) { 13673 var symbols = Object.getOwnPropertySymbols(object); 13674 if (enumerableOnly) { 13675 symbols = symbols.filter(function(sym) { 13676 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 13677 }); 13678 } 13679 keys.push.apply(keys, symbols); 13680 } 13681 return keys; 13682 } 13683 function _objectSpread$5(target) { 13684 for (var i = 1; i < arguments.length; i++) { 13685 var source = arguments[i] != null ? arguments[i] : {}; 13686 if (i % 2) { 13687 ownKeys$5(Object(source), true).forEach(function(key) { 13688 _defineProperty(target, key, source[key]); 13689 }); 13690 } else if (Object.getOwnPropertyDescriptors) { 13691 Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); 13692 } else { 13693 ownKeys$5(Object(source)).forEach(function(key) { 13694 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 13695 }); 13696 } 13697 } 13698 return target; 13699 } 13700 function _createSuper$2(Derived) { 13701 var hasNativeReflectConstruct = _isNativeReflectConstruct$2(); 13702 return function _createSuperInternal() { 13703 var Super = _getPrototypeOf(Derived), result; 13704 if (hasNativeReflectConstruct) { 13705 var NewTarget = _getPrototypeOf(this).constructor; 13706 result = Reflect.construct(Super, arguments, NewTarget); 13707 } else { 13708 result = Super.apply(this, arguments); 13709 } 13710 return _possibleConstructorReturn(this, result); 13711 }; 13712 } 13713 function _isNativeReflectConstruct$2() { 13714 if (typeof Reflect === "undefined" || !Reflect.construct) return false; 13715 if (Reflect.construct.sham) return false; 13716 if (typeof Proxy === "function") return true; 13717 try { 13718 Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { 13719 })); 13720 return true; 13721 } catch (e2) { 13722 return false; 13723 } 13724 } 13725 function removePending(q, name) { 13726 if (q.pending[name] !== void 0) { 13727 delete q.pending[name]; 13728 q.pendingCount--; 13729 } 13730 } 13731 var Connector = (function(_EventEmitter) { 13732 _inherits(Connector2, _EventEmitter); 13733 var _super = _createSuper$2(Connector2); 13734 function Connector2(backend, store, services) { 13735 var _this; 13736 var options = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {}; 13737 _classCallCheck(this, Connector2); 13738 _this = _super.call(this); 13739 if (isIE10) { 13740 EventEmitter.call(_assertThisInitialized(_this)); 13741 } 13742 _this.backend = backend; 13743 _this.store = store; 13744 _this.services = services; 13745 _this.languageUtils = services.languageUtils; 13746 _this.options = options; 13747 _this.logger = baseLogger.create("backendConnector"); 13748 _this.waitingReads = []; 13749 _this.maxParallelReads = options.maxParallelReads || 10; 13750 _this.readingCalls = 0; 13751 _this.maxRetries = options.maxRetries >= 0 ? options.maxRetries : 5; 13752 _this.retryTimeout = options.retryTimeout >= 1 ? options.retryTimeout : 350; 13753 _this.state = {}; 13754 _this.queue = []; 13755 if (_this.backend && _this.backend.init) { 13756 _this.backend.init(services, options.backend, options); 13757 } 13758 return _this; 13759 } 13760 _createClass(Connector2, [{ 13761 key: "queueLoad", 13762 value: function queueLoad(languages, namespaces, options, callback) { 13763 var _this2 = this; 13764 var toLoad = {}; 13765 var pending = {}; 13766 var toLoadLanguages = {}; 13767 var toLoadNamespaces = {}; 13768 languages.forEach(function(lng) { 13769 var hasAllNamespaces = true; 13770 namespaces.forEach(function(ns) { 13771 var name = "".concat(lng, "|").concat(ns); 13772 if (!options.reload && _this2.store.hasResourceBundle(lng, ns)) { 13773 _this2.state[name] = 2; 13774 } else if (_this2.state[name] < 0) ; 13775 else if (_this2.state[name] === 1) { 13776 if (pending[name] === void 0) pending[name] = true; 13777 } else { 13778 _this2.state[name] = 1; 13779 hasAllNamespaces = false; 13780 if (pending[name] === void 0) pending[name] = true; 13781 if (toLoad[name] === void 0) toLoad[name] = true; 13782 if (toLoadNamespaces[ns] === void 0) toLoadNamespaces[ns] = true; 13783 } 13784 }); 13785 if (!hasAllNamespaces) toLoadLanguages[lng] = true; 13786 }); 13787 if (Object.keys(toLoad).length || Object.keys(pending).length) { 13788 this.queue.push({ 13789 pending, 13790 pendingCount: Object.keys(pending).length, 13791 loaded: {}, 13792 errors: [], 13793 callback 13794 }); 13795 } 13796 return { 13797 toLoad: Object.keys(toLoad), 13798 pending: Object.keys(pending), 13799 toLoadLanguages: Object.keys(toLoadLanguages), 13800 toLoadNamespaces: Object.keys(toLoadNamespaces) 13801 }; 13802 } 13803 }, { 13804 key: "loaded", 13805 value: function loaded(name, err, data) { 13806 var s = name.split("|"); 13807 var lng = s[0]; 13808 var ns = s[1]; 13809 if (err) this.emit("failedLoading", lng, ns, err); 13810 if (data) { 13811 this.store.addResourceBundle(lng, ns, data); 13812 } 13813 this.state[name] = err ? -1 : 2; 13814 var loaded2 = {}; 13815 this.queue.forEach(function(q) { 13816 pushPath(q.loaded, [lng], ns); 13817 removePending(q, name); 13818 if (err) q.errors.push(err); 13819 if (q.pendingCount === 0 && !q.done) { 13820 Object.keys(q.loaded).forEach(function(l) { 13821 if (!loaded2[l]) loaded2[l] = {}; 13822 var loadedKeys = q.loaded[l]; 13823 if (loadedKeys.length) { 13824 loadedKeys.forEach(function(ns2) { 13825 if (loaded2[l][ns2] === void 0) loaded2[l][ns2] = true; 13826 }); 13827 } 13828 }); 13829 q.done = true; 13830 if (q.errors.length) { 13831 q.callback(q.errors); 13832 } else { 13833 q.callback(); 13834 } 13835 } 13836 }); 13837 this.emit("loaded", loaded2); 13838 this.queue = this.queue.filter(function(q) { 13839 return !q.done; 13840 }); 13841 } 13842 }, { 13843 key: "read", 13844 value: function read2(lng, ns, fcName) { 13845 var _this3 = this; 13846 var tried = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 0; 13847 var wait = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : this.retryTimeout; 13848 var callback = arguments.length > 5 ? arguments[5] : void 0; 13849 if (!lng.length) return callback(null, {}); 13850 if (this.readingCalls >= this.maxParallelReads) { 13851 this.waitingReads.push({ 13852 lng, 13853 ns, 13854 fcName, 13855 tried, 13856 wait, 13857 callback 13858 }); 13859 return; 13860 } 13861 this.readingCalls++; 13862 return this.backend[fcName](lng, ns, function(err, data) { 13863 _this3.readingCalls--; 13864 if (_this3.waitingReads.length > 0) { 13865 var next = _this3.waitingReads.shift(); 13866 _this3.read(next.lng, next.ns, next.fcName, next.tried, next.wait, next.callback); 13867 } 13868 if (err && data && tried < _this3.maxRetries) { 13869 setTimeout(function() { 13870 _this3.read.call(_this3, lng, ns, fcName, tried + 1, wait * 2, callback); 13871 }, wait); 13872 return; 13873 } 13874 callback(err, data); 13875 }); 13876 } 13877 }, { 13878 key: "prepareLoading", 13879 value: function prepareLoading(languages, namespaces) { 13880 var _this4 = this; 13881 var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; 13882 var callback = arguments.length > 3 ? arguments[3] : void 0; 13883 if (!this.backend) { 13884 this.logger.warn("No backend was added via i18next.use. Will not load resources."); 13885 return callback && callback(); 13886 } 13887 if (typeof languages === "string") languages = this.languageUtils.toResolveHierarchy(languages); 13888 if (typeof namespaces === "string") namespaces = [namespaces]; 13889 var toLoad = this.queueLoad(languages, namespaces, options, callback); 13890 if (!toLoad.toLoad.length) { 13891 if (!toLoad.pending.length) callback(); 13892 return null; 13893 } 13894 toLoad.toLoad.forEach(function(name) { 13895 _this4.loadOne(name); 13896 }); 13897 } 13898 }, { 13899 key: "load", 13900 value: function load(languages, namespaces, callback) { 13901 this.prepareLoading(languages, namespaces, {}, callback); 13902 } 13903 }, { 13904 key: "reload", 13905 value: function reload(languages, namespaces, callback) { 13906 this.prepareLoading(languages, namespaces, { 13907 reload: true 13908 }, callback); 13909 } 13910 }, { 13911 key: "loadOne", 13912 value: function loadOne(name) { 13913 var _this5 = this; 13914 var prefix = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ""; 13915 var s = name.split("|"); 13916 var lng = s[0]; 13917 var ns = s[1]; 13918 this.read(lng, ns, "read", void 0, void 0, function(err, data) { 13919 if (err) _this5.logger.warn("".concat(prefix, "loading namespace ").concat(ns, " for language ").concat(lng, " failed"), err); 13920 if (!err && data) _this5.logger.log("".concat(prefix, "loaded namespace ").concat(ns, " for language ").concat(lng), data); 13921 _this5.loaded(name, err, data); 13922 }); 13923 } 13924 }, { 13925 key: "saveMissing", 13926 value: function saveMissing(languages, namespace, key, fallbackValue, isUpdate) { 13927 var options = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {}; 13928 if (this.services.utils && this.services.utils.hasLoadedNamespace && !this.services.utils.hasLoadedNamespace(namespace)) { 13929 this.logger.warn('did not save key "'.concat(key, '" as the namespace "').concat(namespace, '" was not yet loaded'), "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"); 13930 return; 13931 } 13932 if (key === void 0 || key === null || key === "") return; 13933 if (this.backend && this.backend.create) { 13934 this.backend.create(languages, namespace, key, fallbackValue, null, _objectSpread$5(_objectSpread$5({}, options), {}, { 13935 isUpdate 13936 })); 13937 } 13938 if (!languages || !languages[0]) return; 13939 this.store.addResource(languages[0], namespace, key, fallbackValue); 13940 } 13941 }]); 13942 return Connector2; 13943 })(EventEmitter); 13944 function get() { 13945 return { 13946 debug: false, 13947 initImmediate: true, 13948 ns: ["translation"], 13949 defaultNS: ["translation"], 13950 fallbackLng: ["dev"], 13951 fallbackNS: false, 13952 supportedLngs: false, 13953 nonExplicitSupportedLngs: false, 13954 load: "all", 13955 preload: false, 13956 simplifyPluralSuffix: true, 13957 keySeparator: ".", 13958 nsSeparator: ":", 13959 pluralSeparator: "_", 13960 contextSeparator: "_", 13961 partialBundledLanguages: false, 13962 saveMissing: false, 13963 updateMissing: false, 13964 saveMissingTo: "fallback", 13965 saveMissingPlurals: true, 13966 missingKeyHandler: false, 13967 missingInterpolationHandler: false, 13968 postProcess: false, 13969 postProcessPassResolved: false, 13970 returnNull: true, 13971 returnEmptyString: true, 13972 returnObjects: false, 13973 joinArrays: false, 13974 returnedObjectHandler: false, 13975 parseMissingKeyHandler: false, 13976 appendNamespaceToMissingKey: false, 13977 appendNamespaceToCIMode: false, 13978 overloadTranslationOptionHandler: function handle2(args) { 13979 var ret = {}; 13980 if (_typeof(args[1]) === "object") ret = args[1]; 13981 if (typeof args[1] === "string") ret.defaultValue = args[1]; 13982 if (typeof args[2] === "string") ret.tDescription = args[2]; 13983 if (_typeof(args[2]) === "object" || _typeof(args[3]) === "object") { 13984 var options = args[3] || args[2]; 13985 Object.keys(options).forEach(function(key) { 13986 ret[key] = options[key]; 13987 }); 13988 } 13989 return ret; 13990 }, 13991 interpolation: { 13992 escapeValue: true, 13993 format: function format(value, _format, lng, options) { 13994 return value; 13995 }, 13996 prefix: "{{", 13997 suffix: "}}", 13998 formatSeparator: ",", 13999 unescapePrefix: "-", 14000 nestingPrefix: "$t(", 14001 nestingSuffix: ")", 14002 nestingOptionsSeparator: ",", 14003 maxReplaces: 1e3, 14004 skipOnVariables: true 14005 } 14006 }; 14007 } 14008 function transformOptions(options) { 14009 if (typeof options.ns === "string") options.ns = [options.ns]; 14010 if (typeof options.fallbackLng === "string") options.fallbackLng = [options.fallbackLng]; 14011 if (typeof options.fallbackNS === "string") options.fallbackNS = [options.fallbackNS]; 14012 if (options.supportedLngs && options.supportedLngs.indexOf("cimode") < 0) { 14013 options.supportedLngs = options.supportedLngs.concat(["cimode"]); 14014 } 14015 return options; 14016 } 14017 function ownKeys$6(object, enumerableOnly) { 14018 var keys = Object.keys(object); 14019 if (Object.getOwnPropertySymbols) { 14020 var symbols = Object.getOwnPropertySymbols(object); 14021 if (enumerableOnly) { 14022 symbols = symbols.filter(function(sym) { 14023 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 14024 }); 14025 } 14026 keys.push.apply(keys, symbols); 14027 } 14028 return keys; 14029 } 14030 function _objectSpread$6(target) { 14031 for (var i = 1; i < arguments.length; i++) { 14032 var source = arguments[i] != null ? arguments[i] : {}; 14033 if (i % 2) { 14034 ownKeys$6(Object(source), true).forEach(function(key) { 14035 _defineProperty(target, key, source[key]); 14036 }); 14037 } else if (Object.getOwnPropertyDescriptors) { 14038 Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); 14039 } else { 14040 ownKeys$6(Object(source)).forEach(function(key) { 14041 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 14042 }); 14043 } 14044 } 14045 return target; 14046 } 14047 function _createSuper$3(Derived) { 14048 var hasNativeReflectConstruct = _isNativeReflectConstruct$3(); 14049 return function _createSuperInternal() { 14050 var Super = _getPrototypeOf(Derived), result; 14051 if (hasNativeReflectConstruct) { 14052 var NewTarget = _getPrototypeOf(this).constructor; 14053 result = Reflect.construct(Super, arguments, NewTarget); 14054 } else { 14055 result = Super.apply(this, arguments); 14056 } 14057 return _possibleConstructorReturn(this, result); 14058 }; 14059 } 14060 function _isNativeReflectConstruct$3() { 14061 if (typeof Reflect === "undefined" || !Reflect.construct) return false; 14062 if (Reflect.construct.sham) return false; 14063 if (typeof Proxy === "function") return true; 14064 try { 14065 Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { 14066 })); 14067 return true; 14068 } catch (e2) { 14069 return false; 14070 } 14071 } 14072 function noop() { 14073 } 14074 function bindMemberFunctions(inst) { 14075 var mems = Object.getOwnPropertyNames(Object.getPrototypeOf(inst)); 14076 mems.forEach(function(mem) { 14077 if (typeof inst[mem] === "function") { 14078 inst[mem] = inst[mem].bind(inst); 14079 } 14080 }); 14081 } 14082 var I18n = (function(_EventEmitter) { 14083 _inherits(I18n2, _EventEmitter); 14084 var _super = _createSuper$3(I18n2); 14085 function I18n2() { 14086 var _this; 14087 var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; 14088 var callback = arguments.length > 1 ? arguments[1] : void 0; 14089 _classCallCheck(this, I18n2); 14090 _this = _super.call(this); 14091 if (isIE10) { 14092 EventEmitter.call(_assertThisInitialized(_this)); 14093 } 14094 _this.options = transformOptions(options); 14095 _this.services = {}; 14096 _this.logger = baseLogger; 14097 _this.modules = { 14098 external: [] 14099 }; 14100 bindMemberFunctions(_assertThisInitialized(_this)); 14101 if (callback && !_this.isInitialized && !options.isClone) { 14102 if (!_this.options.initImmediate) { 14103 _this.init(options, callback); 14104 return _possibleConstructorReturn(_this, _assertThisInitialized(_this)); 14105 } 14106 setTimeout(function() { 14107 _this.init(options, callback); 14108 }, 0); 14109 } 14110 return _this; 14111 } 14112 _createClass(I18n2, [{ 14113 key: "init", 14114 value: function init2() { 14115 var _this2 = this; 14116 var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; 14117 var callback = arguments.length > 1 ? arguments[1] : void 0; 14118 if (typeof options === "function") { 14119 callback = options; 14120 options = {}; 14121 } 14122 if (!options.defaultNS && options.defaultNS !== false && options.ns) { 14123 if (typeof options.ns === "string") { 14124 options.defaultNS = options.ns; 14125 } else if (options.ns.indexOf("translation") < 0) { 14126 options.defaultNS = options.ns[0]; 14127 } 14128 } 14129 var defOpts = get(); 14130 this.options = _objectSpread$6(_objectSpread$6(_objectSpread$6({}, defOpts), this.options), transformOptions(options)); 14131 if (this.options.compatibilityAPI !== "v1") { 14132 this.options.interpolation = _objectSpread$6(_objectSpread$6({}, defOpts.interpolation), this.options.interpolation); 14133 } 14134 if (options.keySeparator !== void 0) { 14135 this.options.userDefinedKeySeparator = options.keySeparator; 14136 } 14137 if (options.nsSeparator !== void 0) { 14138 this.options.userDefinedNsSeparator = options.nsSeparator; 14139 } 14140 function createClassOnDemand(ClassOrObject) { 14141 if (!ClassOrObject) return null; 14142 if (typeof ClassOrObject === "function") return new ClassOrObject(); 14143 return ClassOrObject; 14144 } 14145 if (!this.options.isClone) { 14146 if (this.modules.logger) { 14147 baseLogger.init(createClassOnDemand(this.modules.logger), this.options); 14148 } else { 14149 baseLogger.init(null, this.options); 14150 } 14151 var formatter; 14152 if (this.modules.formatter) { 14153 formatter = this.modules.formatter; 14154 } else if (typeof Intl !== "undefined") { 14155 formatter = Formatter; 14156 } 14157 var lu = new LanguageUtil(this.options); 14158 this.store = new ResourceStore(this.options.resources, this.options); 14159 var s = this.services; 14160 s.logger = baseLogger; 14161 s.resourceStore = this.store; 14162 s.languageUtils = lu; 14163 s.pluralResolver = new PluralResolver(lu, { 14164 prepend: this.options.pluralSeparator, 14165 compatibilityJSON: this.options.compatibilityJSON, 14166 simplifyPluralSuffix: this.options.simplifyPluralSuffix 14167 }); 14168 if (formatter && (!this.options.interpolation.format || this.options.interpolation.format === defOpts.interpolation.format)) { 14169 s.formatter = createClassOnDemand(formatter); 14170 s.formatter.init(s, this.options); 14171 this.options.interpolation.format = s.formatter.format.bind(s.formatter); 14172 } 14173 s.interpolator = new Interpolator(this.options); 14174 s.utils = { 14175 hasLoadedNamespace: this.hasLoadedNamespace.bind(this) 14176 }; 14177 s.backendConnector = new Connector(createClassOnDemand(this.modules.backend), s.resourceStore, s, this.options); 14178 s.backendConnector.on("*", function(event) { 14179 for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { 14180 args[_key - 1] = arguments[_key]; 14181 } 14182 _this2.emit.apply(_this2, [event].concat(args)); 14183 }); 14184 if (this.modules.languageDetector) { 14185 s.languageDetector = createClassOnDemand(this.modules.languageDetector); 14186 s.languageDetector.init(s, this.options.detection, this.options); 14187 } 14188 if (this.modules.i18nFormat) { 14189 s.i18nFormat = createClassOnDemand(this.modules.i18nFormat); 14190 if (s.i18nFormat.init) s.i18nFormat.init(this); 14191 } 14192 this.translator = new Translator(this.services, this.options); 14193 this.translator.on("*", function(event) { 14194 for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { 14195 args[_key2 - 1] = arguments[_key2]; 14196 } 14197 _this2.emit.apply(_this2, [event].concat(args)); 14198 }); 14199 this.modules.external.forEach(function(m) { 14200 if (m.init) m.init(_this2); 14201 }); 14202 } 14203 this.format = this.options.interpolation.format; 14204 if (!callback) callback = noop; 14205 if (this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) { 14206 var codes = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng); 14207 if (codes.length > 0 && codes[0] !== "dev") this.options.lng = codes[0]; 14208 } 14209 if (!this.services.languageDetector && !this.options.lng) { 14210 this.logger.warn("init: no languageDetector is used and no lng is defined"); 14211 } 14212 var storeApi = ["getResource", "hasResourceBundle", "getResourceBundle", "getDataByLanguage"]; 14213 storeApi.forEach(function(fcName) { 14214 _this2[fcName] = function() { 14215 var _this2$store; 14216 return (_this2$store = _this2.store)[fcName].apply(_this2$store, arguments); 14217 }; 14218 }); 14219 var storeApiChained = ["addResource", "addResources", "addResourceBundle", "removeResourceBundle"]; 14220 storeApiChained.forEach(function(fcName) { 14221 _this2[fcName] = function() { 14222 var _this2$store2; 14223 (_this2$store2 = _this2.store)[fcName].apply(_this2$store2, arguments); 14224 return _this2; 14225 }; 14226 }); 14227 var deferred = defer(); 14228 var load = function load2() { 14229 var finish = function finish2(err, t3) { 14230 if (_this2.isInitialized && !_this2.initializedStoreOnce) _this2.logger.warn("init: i18next is already initialized. You should call init just once!"); 14231 _this2.isInitialized = true; 14232 if (!_this2.options.isClone) _this2.logger.log("initialized", _this2.options); 14233 _this2.emit("initialized", _this2.options); 14234 deferred.resolve(t3); 14235 callback(err, t3); 14236 }; 14237 if (_this2.languages && _this2.options.compatibilityAPI !== "v1" && !_this2.isInitialized) return finish(null, _this2.t.bind(_this2)); 14238 _this2.changeLanguage(_this2.options.lng, finish); 14239 }; 14240 if (this.options.resources || !this.options.initImmediate) { 14241 load(); 14242 } else { 14243 setTimeout(load, 0); 14244 } 14245 return deferred; 14246 } 14247 }, { 14248 key: "loadResources", 14249 value: function loadResources2(language) { 14250 var _this3 = this; 14251 var callback = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : noop; 14252 var usedCallback = callback; 14253 var usedLng = typeof language === "string" ? language : this.language; 14254 if (typeof language === "function") usedCallback = language; 14255 if (!this.options.resources || this.options.partialBundledLanguages) { 14256 if (usedLng && usedLng.toLowerCase() === "cimode") return usedCallback(); 14257 var toLoad = []; 14258 var append = function append2(lng) { 14259 if (!lng) return; 14260 var lngs = _this3.services.languageUtils.toResolveHierarchy(lng); 14261 lngs.forEach(function(l) { 14262 if (toLoad.indexOf(l) < 0) toLoad.push(l); 14263 }); 14264 }; 14265 if (!usedLng) { 14266 var fallbacks = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng); 14267 fallbacks.forEach(function(l) { 14268 return append(l); 14269 }); 14270 } else { 14271 append(usedLng); 14272 } 14273 if (this.options.preload) { 14274 this.options.preload.forEach(function(l) { 14275 return append(l); 14276 }); 14277 } 14278 this.services.backendConnector.load(toLoad, this.options.ns, function(e2) { 14279 if (!e2 && !_this3.resolvedLanguage && _this3.language) _this3.setResolvedLanguage(_this3.language); 14280 usedCallback(e2); 14281 }); 14282 } else { 14283 usedCallback(null); 14284 } 14285 } 14286 }, { 14287 key: "reloadResources", 14288 value: function reloadResources2(lngs, ns, callback) { 14289 var deferred = defer(); 14290 if (!lngs) lngs = this.languages; 14291 if (!ns) ns = this.options.ns; 14292 if (!callback) callback = noop; 14293 this.services.backendConnector.reload(lngs, ns, function(err) { 14294 deferred.resolve(); 14295 callback(err); 14296 }); 14297 return deferred; 14298 } 14299 }, { 14300 key: "use", 14301 value: function use2(module) { 14302 if (!module) throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()"); 14303 if (!module.type) throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()"); 14304 if (module.type === "backend") { 14305 this.modules.backend = module; 14306 } 14307 if (module.type === "logger" || module.log && module.warn && module.error) { 14308 this.modules.logger = module; 14309 } 14310 if (module.type === "languageDetector") { 14311 this.modules.languageDetector = module; 14312 } 14313 if (module.type === "i18nFormat") { 14314 this.modules.i18nFormat = module; 14315 } 14316 if (module.type === "postProcessor") { 14317 postProcessor.addPostProcessor(module); 14318 } 14319 if (module.type === "formatter") { 14320 this.modules.formatter = module; 14321 } 14322 if (module.type === "3rdParty") { 14323 this.modules.external.push(module); 14324 } 14325 return this; 14326 } 14327 }, { 14328 key: "setResolvedLanguage", 14329 value: function setResolvedLanguage(l) { 14330 if (!l || !this.languages) return; 14331 if (["cimode", "dev"].indexOf(l) > -1) return; 14332 for (var li = 0; li < this.languages.length; li++) { 14333 var lngInLngs = this.languages[li]; 14334 if (["cimode", "dev"].indexOf(lngInLngs) > -1) continue; 14335 if (this.store.hasLanguageSomeTranslations(lngInLngs)) { 14336 this.resolvedLanguage = lngInLngs; 14337 break; 14338 } 14339 } 14340 } 14341 }, { 14342 key: "changeLanguage", 14343 value: function changeLanguage2(lng, callback) { 14344 var _this4 = this; 14345 this.isLanguageChangingTo = lng; 14346 var deferred = defer(); 14347 this.emit("languageChanging", lng); 14348 var setLngProps = function setLngProps2(l) { 14349 _this4.language = l; 14350 _this4.languages = _this4.services.languageUtils.toResolveHierarchy(l); 14351 _this4.resolvedLanguage = void 0; 14352 _this4.setResolvedLanguage(l); 14353 }; 14354 var done = function done2(err, l) { 14355 if (l) { 14356 setLngProps(l); 14357 _this4.translator.changeLanguage(l); 14358 _this4.isLanguageChangingTo = void 0; 14359 _this4.emit("languageChanged", l); 14360 _this4.logger.log("languageChanged", l); 14361 } else { 14362 _this4.isLanguageChangingTo = void 0; 14363 } 14364 deferred.resolve(function() { 14365 return _this4.t.apply(_this4, arguments); 14366 }); 14367 if (callback) callback(err, function() { 14368 return _this4.t.apply(_this4, arguments); 14369 }); 14370 }; 14371 var setLng = function setLng2(lngs) { 14372 if (!lng && !lngs && _this4.services.languageDetector) lngs = []; 14373 var l = typeof lngs === "string" ? lngs : _this4.services.languageUtils.getBestMatchFromCodes(lngs); 14374 if (l) { 14375 if (!_this4.language) { 14376 setLngProps(l); 14377 } 14378 if (!_this4.translator.language) _this4.translator.changeLanguage(l); 14379 if (_this4.services.languageDetector) _this4.services.languageDetector.cacheUserLanguage(l); 14380 } 14381 _this4.loadResources(l, function(err) { 14382 done(err, l); 14383 }); 14384 }; 14385 if (!lng && this.services.languageDetector && !this.services.languageDetector.async) { 14386 setLng(this.services.languageDetector.detect()); 14387 } else if (!lng && this.services.languageDetector && this.services.languageDetector.async) { 14388 this.services.languageDetector.detect(setLng); 14389 } else { 14390 setLng(lng); 14391 } 14392 return deferred; 14393 } 14394 }, { 14395 key: "getFixedT", 14396 value: function getFixedT2(lng, ns, keyPrefix) { 14397 var _this5 = this; 14398 var fixedT = function fixedT2(key, opts) { 14399 var options; 14400 if (_typeof(opts) !== "object") { 14401 for (var _len3 = arguments.length, rest = new Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) { 14402 rest[_key3 - 2] = arguments[_key3]; 14403 } 14404 options = _this5.options.overloadTranslationOptionHandler([key, opts].concat(rest)); 14405 } else { 14406 options = _objectSpread$6({}, opts); 14407 } 14408 options.lng = options.lng || fixedT2.lng; 14409 options.lngs = options.lngs || fixedT2.lngs; 14410 options.ns = options.ns || fixedT2.ns; 14411 options.keyPrefix = options.keyPrefix || keyPrefix || fixedT2.keyPrefix; 14412 var keySeparator = _this5.options.keySeparator || "."; 14413 var resultKey = options.keyPrefix ? "".concat(options.keyPrefix).concat(keySeparator).concat(key) : key; 14414 return _this5.t(resultKey, options); 14415 }; 14416 if (typeof lng === "string") { 14417 fixedT.lng = lng; 14418 } else { 14419 fixedT.lngs = lng; 14420 } 14421 fixedT.ns = ns; 14422 fixedT.keyPrefix = keyPrefix; 14423 return fixedT; 14424 } 14425 }, { 14426 key: "t", 14427 value: function t3() { 14428 var _this$translator; 14429 return this.translator && (_this$translator = this.translator).translate.apply(_this$translator, arguments); 14430 } 14431 }, { 14432 key: "exists", 14433 value: function exists2() { 14434 var _this$translator2; 14435 return this.translator && (_this$translator2 = this.translator).exists.apply(_this$translator2, arguments); 14436 } 14437 }, { 14438 key: "setDefaultNamespace", 14439 value: function setDefaultNamespace2(ns) { 14440 this.options.defaultNS = ns; 14441 } 14442 }, { 14443 key: "hasLoadedNamespace", 14444 value: function hasLoadedNamespace2(ns) { 14445 var _this6 = this; 14446 var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; 14447 if (!this.isInitialized) { 14448 this.logger.warn("hasLoadedNamespace: i18next was not initialized", this.languages); 14449 return false; 14450 } 14451 if (!this.languages || !this.languages.length) { 14452 this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty", this.languages); 14453 return false; 14454 } 14455 var lng = this.resolvedLanguage || this.languages[0]; 14456 var fallbackLng = this.options ? this.options.fallbackLng : false; 14457 var lastLng = this.languages[this.languages.length - 1]; 14458 if (lng.toLowerCase() === "cimode") return true; 14459 var loadNotPending = function loadNotPending2(l, n) { 14460 var loadState = _this6.services.backendConnector.state["".concat(l, "|").concat(n)]; 14461 return loadState === -1 || loadState === 2; 14462 }; 14463 if (options.precheck) { 14464 var preResult = options.precheck(this, loadNotPending); 14465 if (preResult !== void 0) return preResult; 14466 } 14467 if (this.hasResourceBundle(lng, ns)) return true; 14468 if (!this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages) return true; 14469 if (loadNotPending(lng, ns) && (!fallbackLng || loadNotPending(lastLng, ns))) return true; 14470 return false; 14471 } 14472 }, { 14473 key: "loadNamespaces", 14474 value: function loadNamespaces2(ns, callback) { 14475 var _this7 = this; 14476 var deferred = defer(); 14477 if (!this.options.ns) { 14478 callback && callback(); 14479 return Promise.resolve(); 14480 } 14481 if (typeof ns === "string") ns = [ns]; 14482 ns.forEach(function(n) { 14483 if (_this7.options.ns.indexOf(n) < 0) _this7.options.ns.push(n); 14484 }); 14485 this.loadResources(function(err) { 14486 deferred.resolve(); 14487 if (callback) callback(err); 14488 }); 14489 return deferred; 14490 } 14491 }, { 14492 key: "loadLanguages", 14493 value: function loadLanguages2(lngs, callback) { 14494 var deferred = defer(); 14495 if (typeof lngs === "string") lngs = [lngs]; 14496 var preloaded = this.options.preload || []; 14497 var newLngs = lngs.filter(function(lng) { 14498 return preloaded.indexOf(lng) < 0; 14499 }); 14500 if (!newLngs.length) { 14501 if (callback) callback(); 14502 return Promise.resolve(); 14503 } 14504 this.options.preload = preloaded.concat(newLngs); 14505 this.loadResources(function(err) { 14506 deferred.resolve(); 14507 if (callback) callback(err); 14508 }); 14509 return deferred; 14510 } 14511 }, { 14512 key: "dir", 14513 value: function dir(lng) { 14514 if (!lng) lng = this.resolvedLanguage || (this.languages && this.languages.length > 0 ? this.languages[0] : this.language); 14515 if (!lng) return "rtl"; 14516 var rtlLngs = ["ar", "shu", "sqr", "ssh", "xaa", "yhd", "yud", "aao", "abh", "abv", "acm", "acq", "acw", "acx", "acy", "adf", "ads", "aeb", "aec", "afb", "ajp", "apc", "apd", "arb", "arq", "ars", "ary", "arz", "auz", "avl", "ayh", "ayl", "ayn", "ayp", "bbz", "pga", "he", "iw", "ps", "pbt", "pbu", "pst", "prp", "prd", "ug", "ur", "ydd", "yds", "yih", "ji", "yi", "hbo", "men", "xmn", "fa", "jpr", "peo", "pes", "prs", "dv", "sam", "ckb"]; 14517 return rtlLngs.indexOf(this.services.languageUtils.getLanguagePartFromCode(lng)) > -1 || lng.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr"; 14518 } 14519 }, { 14520 key: "cloneInstance", 14521 value: function cloneInstance() { 14522 var _this8 = this; 14523 var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; 14524 var callback = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : noop; 14525 var mergedOptions = _objectSpread$6(_objectSpread$6(_objectSpread$6({}, this.options), options), { 14526 isClone: true 14527 }); 14528 var clone = new I18n2(mergedOptions); 14529 if (options.debug !== void 0 || options.prefix !== void 0) { 14530 clone.logger = clone.logger.clone(options); 14531 } 14532 var membersToCopy = ["store", "services", "language"]; 14533 membersToCopy.forEach(function(m) { 14534 clone[m] = _this8[m]; 14535 }); 14536 clone.services = _objectSpread$6({}, this.services); 14537 clone.services.utils = { 14538 hasLoadedNamespace: clone.hasLoadedNamespace.bind(clone) 14539 }; 14540 clone.translator = new Translator(clone.services, clone.options); 14541 clone.translator.on("*", function(event) { 14542 for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) { 14543 args[_key4 - 1] = arguments[_key4]; 14544 } 14545 clone.emit.apply(clone, [event].concat(args)); 14546 }); 14547 clone.init(mergedOptions, callback); 14548 clone.translator.options = clone.options; 14549 clone.translator.backendConnector.services.utils = { 14550 hasLoadedNamespace: clone.hasLoadedNamespace.bind(clone) 14551 }; 14552 return clone; 14553 } 14554 }, { 14555 key: "toJSON", 14556 value: function toJSON() { 14557 return { 14558 options: this.options, 14559 store: this.store, 14560 language: this.language, 14561 languages: this.languages, 14562 resolvedLanguage: this.resolvedLanguage 14563 }; 14564 } 14565 }]); 14566 return I18n2; 14567 })(EventEmitter); 14568 _defineProperty(I18n, "createInstance", function() { 14569 var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; 14570 var callback = arguments.length > 1 ? arguments[1] : void 0; 14571 return new I18n(options, callback); 14572 }); 14573 var instance = I18n.createInstance(); 14574 instance.createInstance = I18n.createInstance; 14575 var createInstance = instance.createInstance; 14576 var init = instance.init; 14577 var loadResources = instance.loadResources; 14578 var reloadResources = instance.reloadResources; 14579 var use = instance.use; 14580 var changeLanguage = instance.changeLanguage; 14581 var getFixedT = instance.getFixedT; 14582 var t2 = instance.t; 14583 var exists = instance.exists; 14584 var setDefaultNamespace = instance.setDefaultNamespace; 14585 var hasLoadedNamespace = instance.hasLoadedNamespace; 14586 var loadNamespaces = instance.loadNamespaces; 14587 var loadLanguages = instance.loadLanguages; 14588 var i18next_default = instance; 14589 14590
vendor: 11,731 bytes, lines 14590-14920
14590// node_modules/i18next-browser-languagedetector/dist/esm/i18nextBrowserLanguageDetector.js 14591 var arr = []; 14592 var each = arr.forEach; 14593 var slice = arr.slice; 14594 function defaults(obj) { 14595 each.call(slice.call(arguments, 1), function(source) { 14596 if (source) { 14597 for (var prop in source) { 14598 if (obj[prop] === void 0) obj[prop] = source[prop]; 14599 } 14600 } 14601 }); 14602 return obj; 14603 } 14604 var fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/; 14605 var serializeCookie = function serializeCookie2(name, val, options) { 14606 var opt = options || {}; 14607 opt.path = opt.path || "/"; 14608 var value = encodeURIComponent(val); 14609 var str = "".concat(name, "=").concat(value); 14610 if (opt.maxAge > 0) { 14611 var maxAge = opt.maxAge - 0; 14612 if (Number.isNaN(maxAge)) throw new Error("maxAge should be a Number"); 14613 str += "; Max-Age=".concat(Math.floor(maxAge)); 14614 } 14615 if (opt.domain) { 14616 if (!fieldContentRegExp.test(opt.domain)) { 14617 throw new TypeError("option domain is invalid"); 14618 } 14619 str += "; Domain=".concat(opt.domain); 14620 } 14621 if (opt.path) { 14622 if (!fieldContentRegExp.test(opt.path)) { 14623 throw new TypeError("option path is invalid"); 14624 } 14625 str += "; Path=".concat(opt.path); 14626 } 14627 if (opt.expires) { 14628 if (typeof opt.expires.toUTCString !== "function") { 14629 throw new TypeError("option expires is invalid"); 14630 } 14631 str += "; Expires=".concat(opt.expires.toUTCString()); 14632 } 14633 if (opt.httpOnly) str += "; HttpOnly"; 14634 if (opt.secure) str += "; Secure"; 14635 if (opt.sameSite) { 14636 var sameSite = typeof opt.sameSite === "string" ? opt.sameSite.toLowerCase() : opt.sameSite; 14637 switch (sameSite) { 14638 case true: 14639 str += "; SameSite=Strict"; 14640 break; 14641 case "lax": 14642 str += "; SameSite=Lax"; 14643 break; 14644 case "strict": 14645 str += "; SameSite=Strict"; 14646 break; 14647 case "none": 14648 str += "; SameSite=None"; 14649 break; 14650 default: 14651 throw new TypeError("option sameSite is invalid"); 14652 } 14653 } 14654 return str; 14655 }; 14656 var cookie = { 14657 create: function create(name, value, minutes, domain) { 14658 var cookieOptions = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : { 14659 path: "/", 14660 sameSite: "strict" 14661 }; 14662 if (minutes) { 14663 cookieOptions.expires = /* @__PURE__ */ new Date(); 14664 cookieOptions.expires.setTime(cookieOptions.expires.getTime() + minutes * 60 * 1e3); 14665 } 14666 if (domain) cookieOptions.domain = domain; 14667 document.cookie = serializeCookie(name, encodeURIComponent(value), cookieOptions); 14668 }, 14669 read: function read(name) { 14670 var nameEQ = "".concat(name, "="); 14671 var ca = document.cookie.split(";"); 14672 for (var i = 0; i < ca.length; i++) { 14673 var c = ca[i]; 14674 while (c.charAt(0) === " ") { 14675 c = c.substring(1, c.length); 14676 } 14677 if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length); 14678 } 14679 return null; 14680 }, 14681 remove: function remove(name) { 14682 this.create(name, "", -1); 14683 } 14684 }; 14685 var cookie$1 = { 14686 name: "cookie", 14687 lookup: function lookup(options) { 14688 var found; 14689 if (options.lookupCookie && typeof document !== "undefined") { 14690 var c = cookie.read(options.lookupCookie); 14691 if (c) found = c; 14692 } 14693 return found; 14694 }, 14695 cacheUserLanguage: function cacheUserLanguage(lng, options) { 14696 if (options.lookupCookie && typeof document !== "undefined") { 14697 cookie.create(options.lookupCookie, lng, options.cookieMinutes, options.cookieDomain, options.cookieOptions); 14698 } 14699 } 14700 }; 14701 var querystring = { 14702 name: "querystring", 14703 lookup: function lookup2(options) { 14704 var found; 14705 if (typeof window !== "undefined") { 14706 var search = window.location.search; 14707 if (!window.location.search && window.location.hash && window.location.hash.indexOf("?") > -1) { 14708 search = window.location.hash.substring(window.location.hash.indexOf("?")); 14709 } 14710 var query = search.substring(1); 14711 var params = query.split("&"); 14712 for (var i = 0; i < params.length; i++) { 14713 var pos = params[i].indexOf("="); 14714 if (pos > 0) { 14715 var key = params[i].substring(0, pos); 14716 if (key === options.lookupQuerystring) { 14717 found = params[i].substring(pos + 1); 14718 } 14719 } 14720 } 14721 } 14722 return found; 14723 } 14724 }; 14725 var hasLocalStorageSupport = null; 14726 var localStorageAvailable = function localStorageAvailable2() { 14727 if (hasLocalStorageSupport !== null) return hasLocalStorageSupport; 14728 try { 14729 hasLocalStorageSupport = window !== "undefined" && window.localStorage !== null; 14730 var testKey = "i18next.translate.boo"; 14731 window.localStorage.setItem(testKey, "foo"); 14732 window.localStorage.removeItem(testKey); 14733 } catch (e2) { 14734 hasLocalStorageSupport = false; 14735 } 14736 return hasLocalStorageSupport; 14737 }; 14738 var localStorage = { 14739 name: "localStorage", 14740 lookup: function lookup3(options) { 14741 var found; 14742 if (options.lookupLocalStorage && localStorageAvailable()) { 14743 var lng = window.localStorage.getItem(options.lookupLocalStorage); 14744 if (lng) found = lng; 14745 } 14746 return found; 14747 }, 14748 cacheUserLanguage: function cacheUserLanguage2(lng, options) { 14749 if (options.lookupLocalStorage && localStorageAvailable()) { 14750 window.localStorage.setItem(options.lookupLocalStorage, lng); 14751 } 14752 } 14753 }; 14754 var hasSessionStorageSupport = null; 14755 var sessionStorageAvailable = function sessionStorageAvailable2() { 14756 if (hasSessionStorageSupport !== null) return hasSessionStorageSupport; 14757 try { 14758 hasSessionStorageSupport = window !== "undefined" && window.sessionStorage !== null; 14759 var testKey = "i18next.translate.boo"; 14760 window.sessionStorage.setItem(testKey, "foo"); 14761 window.sessionStorage.removeItem(testKey); 14762 } catch (e2) { 14763 hasSessionStorageSupport = false; 14764 } 14765 return hasSessionStorageSupport; 14766 }; 14767 var sessionStorage = { 14768 name: "sessionStorage", 14769 lookup: function lookup4(options) { 14770 var found; 14771 if (options.lookupSessionStorage && sessionStorageAvailable()) { 14772 var lng = window.sessionStorage.getItem(options.lookupSessionStorage); 14773 if (lng) found = lng; 14774 } 14775 return found; 14776 }, 14777 cacheUserLanguage: function cacheUserLanguage3(lng, options) { 14778 if (options.lookupSessionStorage && sessionStorageAvailable()) { 14779 window.sessionStorage.setItem(options.lookupSessionStorage, lng); 14780 } 14781 } 14782 }; 14783 var navigator$1 = { 14784 name: "navigator", 14785 lookup: function lookup5(options) { 14786 var found = []; 14787 if (typeof navigator !== "undefined") { 14788 if (navigator.languages) { 14789 for (var i = 0; i < navigator.languages.length; i++) { 14790 found.push(navigator.languages[i]); 14791 } 14792 } 14793 if (navigator.userLanguage) { 14794 found.push(navigator.userLanguage); 14795 } 14796 if (navigator.language) { 14797 found.push(navigator.language); 14798 } 14799 } 14800 return found.length > 0 ? found : void 0; 14801 } 14802 }; 14803 var htmlTag = { 14804 name: "htmlTag", 14805 lookup: function lookup6(options) { 14806 var found; 14807 var htmlTag2 = options.htmlTag || (typeof document !== "undefined" ? document.documentElement : null); 14808 if (htmlTag2 && typeof htmlTag2.getAttribute === "function") { 14809 found = htmlTag2.getAttribute("lang"); 14810 } 14811 return found; 14812 } 14813 }; 14814 var path = { 14815 name: "path", 14816 lookup: function lookup7(options) { 14817 var found; 14818 if (typeof window !== "undefined") { 14819 var language = window.location.pathname.match(/\/([a-zA-Z-]*)/g); 14820 if (language instanceof Array) { 14821 if (typeof options.lookupFromPathIndex === "number") { 14822 if (typeof language[options.lookupFromPathIndex] !== "string") { 14823 return void 0; 14824 } 14825 found = language[options.lookupFromPathIndex].replace("/", ""); 14826 } else { 14827 found = language[0].replace("/", ""); 14828 } 14829 } 14830 } 14831 return found; 14832 } 14833 }; 14834 var subdomain = { 14835 name: "subdomain", 14836 lookup: function lookup8(options) { 14837 var lookupFromSubdomainIndex = typeof options.lookupFromSubdomainIndex === "number" ? options.lookupFromSubdomainIndex + 1 : 1; 14838 var language = typeof window !== "undefined" && window.location && window.location.hostname && window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i); 14839 if (!language) return void 0; 14840 return language[lookupFromSubdomainIndex]; 14841 } 14842 }; 14843 function getDefaults() { 14844 return { 14845 order: ["querystring", "cookie", "localStorage", "sessionStorage", "navigator", "htmlTag"], 14846 lookupQuerystring: "lng", 14847 lookupCookie: "i18next", 14848 lookupLocalStorage: "i18nextLng", 14849 lookupSessionStorage: "i18nextLng", 14850 // cache user language 14851 caches: ["localStorage"], 14852 excludeCacheFor: ["cimode"] 14853 // cookieMinutes: 10, 14854 // cookieDomain: 'myDomain' 14855 }; 14856 } 14857 var Browser = /* @__PURE__ */ (function() { 14858 function Browser2(services) { 14859 var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; 14860 _classCallCheck(this, Browser2); 14861 this.type = "languageDetector"; 14862 this.detectors = {}; 14863 this.init(services, options); 14864 } 14865 _createClass(Browser2, [{ 14866 key: "init", 14867 value: function init2(services) { 14868 var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; 14869 var i18nOptions = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; 14870 this.services = services; 14871 this.options = defaults(options, this.options || {}, getDefaults()); 14872 if (this.options.lookupFromUrlIndex) this.options.lookupFromPathIndex = this.options.lookupFromUrlIndex; 14873 this.i18nOptions = i18nOptions; 14874 this.addDetector(cookie$1); 14875 this.addDetector(querystring); 14876 this.addDetector(localStorage); 14877 this.addDetector(sessionStorage); 14878 this.addDetector(navigator$1); 14879 this.addDetector(htmlTag); 14880 this.addDetector(path); 14881 this.addDetector(subdomain); 14882 } 14883 }, { 14884 key: "addDetector", 14885 value: function addDetector(detector) { 14886 this.detectors[detector.name] = detector; 14887 } 14888 }, { 14889 key: "detect", 14890 value: function detect(detectionOrder) { 14891 var _this = this; 14892 if (!detectionOrder) detectionOrder = this.options.order; 14893 var detected = []; 14894 detectionOrder.forEach(function(detectorName) { 14895 if (_this.detectors[detectorName]) { 14896 var lookup9 = _this.detectors[detectorName].lookup(_this.options); 14897 if (lookup9 && typeof lookup9 === "string") lookup9 = [lookup9]; 14898 if (lookup9) detected = detected.concat(lookup9); 14899 } 14900 }); 14901 if (this.services.languageUtils.getBestMatchFromCodes) return detected; 14902 return detected.length > 0 ? detected[0] : null; 14903 } 14904 }, { 14905 key: "cacheUserLanguage", 14906 value: function cacheUserLanguage4(lng, caches) { 14907 var _this2 = this; 14908 if (!caches) caches = this.options.caches; 14909 if (!caches) return; 14910 if (this.options.excludeCacheFor && this.options.excludeCacheFor.indexOf(lng) > -1) return; 14911 caches.forEach(function(cacheName) { 14912 if (_this2.detectors[cacheName]) _this2.detectors[cacheName].cacheUserLanguage(lng, _this2.options); 14913 }); 14914 } 14915 }]); 14916 return Browser2; 14917 })(); 14918 Browser.type = "languageDetector"; 14919 14920
14920// src/fairtrade_provider/js/Base/Vendor/T3vBase/Components/Graphical/SVG.js 14921 var import_jquery = __toESM(require_jquery()); 14922 var SVG = class _SVG { 14923 // --- Defaults --- 14924 static get defaults() { 14925 return Object.freeze({ 14926 inline: false, 14927 colorize: false, 14928 debug: false 14929 }); 14930 } 14931 // --- Public --- 14932 constructor(svg, options) { 14933 this.$svg = (0, import_jquery.default)(svg); 14934 this.options = Object.assign({}, _SVG.defaults, options); 14935 this.initialize(); 14936 } 14937 // --- Private --- 14938 initialize() { 14939 this.$svgify(); 14940 } 14941 $svgify() { 14942 const self = this; 14943 const $origin = this.$svg; 14944 const inline = $origin.data("inline"); 14945 const colorize = $origin.data("colorize"); 14946 if (inline === "true" || inline === 1 || this.options.inline) { 14947 const id = $origin.attr("id"); 14948 const classes = $origin.attr("class"); 14949 const src = $origin.attr("src"); 14950 const height = $origin.attr("height"); 14951 const width = $origin.attr("width"); 14952 if (src.indexOf(".svg") > -1) { 14953 import_jquery.default.get(src, function(data) { 14954 let $svg = (0, import_jquery.default)(data).find("svg"); 14955 if ($svg.length) { 14956 if (id) { 14957 $svg = $svg.attr("id", id); 14958 } 14959 if (classes) { 14960 $svg = $svg.attr("class", classes); 14961 if (colorize === "true" || colorize === 1 || self.options.colorize) { 14962 $svg = $svg.attr("class", `${classes} colorized`); 14963 } 14964 } 14965 if (!$svg.attr("viewBox") && $svg.attr("height") && $svg.attr("width")) { 14966 $svg.attr("viewBox", `${$svg.attr("height")} ${$svg.attr("width")}`); 14967 } 14968 if (height) { 14969 $svg.attr("height", height); 14970 } 14971 if (width) { 14972 $svg.attr("width", width); 14973 } 14974 $svg = $svg.removeAttr("xmlns:a, xmlns:serif"); 14975 $origin.replaceWith($svg); 14976 } 14977 }, "xml"); 14978 } 14979 } 14980 } 14981 }; 14982 import_jquery.default.fn.svgify = function(options) { 14983 this.each(function() { 14984 const element = (0, import_jquery.default)(this); 14985 if (typeof element.data("svgify") === "undefined") { 14986 const instance2 = new SVG(this, options); 14987 element.data("svgify", instance2); 14988 } 14989 }); 14990 return this; 14991 }; 14992 14993
14993// src/fairtrade_provider/js/Base/Vendor/T3vBase/Components/Table.js 14994 var import_jquery2 = __toESM(require_jquery()); 14995 var import_tablesaw = __toESM(require_tablesaw_jquery()); 14996 var Table = class _Table { 14997 // --- Defaults --- 14998 static get defaults() { 14999 return Object.freeze({ 15000 debug: false 15001 }); 15002 } 15003 // --- Public --- 15004 constructor(table, options) { 15005 this.$table = (0, import_jquery2.default)(table); 15006 this.options = Object.assign({}, _Table.defaults, options); 15007 this.initialize(); 15008 } 15009 // --- Private --- 15010 initialize() { 15011 if (!this.$table.hasClass("no-tablesaw")) { 15012 const $thead = this.$table.find("thead"); 15013 if ($thead.length > 0) { 15014 this.$table.addClass("tablesaw tablesaw-stack").attr("data-tablesaw-mode", "stack"); 15015 (0, import_jquery2.default)(document.body).trigger("enhance.tablesaw"); 15016 } 15017 } 15018 } 15019 }; 15020 import_jquery2.default.fn.tablify = function(options) { 15021 this.each(function() { 15022 const element = (0, import_jquery2.default)(this); 15023 if (typeof element.data("tablify") === "undefined") { 15024 const instance2 = new Table(this, options); 15025 element.data("tablify", instance2); 15026 } 15027 }); 15028 return this; 15029 }; 15030 15031
15031// src/fairtrade_provider/js/Base/Vendor/T3vBase/GridElements/BarGridElement.js 15032 var import_jquery4 = __toESM(require_jquery()); 15033 15034
15034// src/fairtrade_provider/js/Base/Vendor/T3vBase/GridElements/BarGridElement/NavbarGridElement.js 15035 var import_tablesaw2 = __toESM(require_tablesaw_jquery()); 15036 var NavbarGridElement = class _NavbarGridElement { 15037 // --- Defaults --- 15038 static get defaults() { 15039 return Object.freeze({ 15040 tag: "t3v-base-bar-grid-element", 15041 debug: false 15042 }); 15043 } 15044 // --- Public --- 15045 constructor(gridElement, options) { 15046 this.$gridElement = $(gridElement); 15047 this.options = Object.assign({}, _NavbarGridElement.defaults, options); 15048 this.initialize(); 15049 } 15050 // --- Private --- 15051 initialize() { 15052 this.$bodyHeader = $(".body-header"); 15053 this.$toolbarGridElement = $(`.${this.options.tag}[type="toolbar"]`); 15054 this.position = this.$gridElement.position(); 15055 this.modus = this.$toolbarGridElement.length ? "tango" : "single"; 15056 this.setup(); 15057 } 15058 setup() { 15059 const self = this; 15060 if (this.modus === "tango") { 15061 const $body = $("body"); 15062 $body.waypoint(function(direction) { 15063 if (direction === "down") { 15064 self.$toolbarGridElement.fadeOut({ 15065 duration: "fast", 15066 start: function() { 15067 self.$toolbarGridElement.fadeOut({ 15068 duration: "fast", 15069 complete: function() { 15070 self.$gridElement.hide(); 15071 self.$gridElement.attr("state", "fixed"); 15072 self.$gridElement.fadeIn({ 15073 duration: 600 15074 }); 15075 const height = self.$toolbarGridElement.outerHeight(); 15076 } 15077 }); 15078 }, 15079 complete: function() { 15080 } 15081 }); 15082 } 15083 }, { 15084 offset: -Math.abs(this.position.top - this.$toolbarGridElement.outerHeight()) 15085 }); 15086 $body.waypoint(function(direction) { 15087 if (direction === "up") { 15088 self.$toolbarGridElement.fadeIn({ 15089 display: "flex", 15090 start: function() { 15091 self.$gridElement.fadeOut({ 15092 duration: "fast", 15093 complete: function() { 15094 self.$gridElement.hide(); 15095 self.$gridElement.attr("state", "default"); 15096 self.$gridElement.fadeIn({ 15097 duration: 600 15098 }); 15099 } 15100 }); 15101 } 15102 }); 15103 } 15104 }, { 15105 offset: -Math.abs(this.position.top - this.$toolbarGridElement.outerHeight() - 1) 15106 }); 15107 $body.waypoint(function(direction) { 15108 if (direction === "up") { 15109 self.$toolbarGridElement.fadeIn({ 15110 display: "flex", 15111 duration: "fast", 15112 start: function() { 15113 self.$gridElement.fadeOut({ 15114 duration: "fast", 15115 complete: function() { 15116 self.$gridElement.attr("state", "default"); 15117 } 15118 }); 15119 }, 15120 complete: function() { 15121 self.$gridElement.fadeIn({ 15122 duration: 600 15123 }); 15124 } 15125 }); 15126 } 15127 }); 15128 } 15129 } 15130 }; 15131 15132
15132// src/fairtrade_provider/js/Base/Vendor/T3vBase/GridElements/BarGridElement/SidebarGridElement.js 15133 var import_jquery3 = __toESM(require_jquery()); 15134 var SidebarGridElement = class _SidebarGridElement { 15135 // --- Defaults --- 15136 static get defaults() { 15137 return Object.freeze({ 15138 tag: "t3v-base-bar-grid-element", 15139 debug: false 15140 }); 15141 } 15142 // --- Public --- 15143 constructor(gridElement, options) { 15144 this.$gridElement = (0, import_jquery3.default)(gridElement); 15145 this.options = Object.assign({}, _SidebarGridElement.defaults, options); 15146 this.initialize(); 15147 } 15148 // --- Private --- 15149 initialize() { 15150 } 15151 }; 15152 15153
vendor: 17,079 bytes, lines 15153-15656
15153// node_modules/waypoints/lib/jquery.waypoints.js 15154 (function() { 15155 "use strict"; 15156 var keyCounter = 0; 15157 var allWaypoints = {}; 15158 function Waypoint(options) { 15159 if (!options) { 15160 throw new Error("No options passed to Waypoint constructor"); 15161 } 15162 if (!options.element) { 15163 throw new Error("No element option passed to Waypoint constructor"); 15164 } 15165 if (!options.handler) { 15166 throw new Error("No handler option passed to Waypoint constructor"); 15167 } 15168 this.key = "waypoint-" + keyCounter; 15169 this.options = Waypoint.Adapter.extend({}, Waypoint.defaults, options); 15170 this.element = this.options.element; 15171 this.adapter = new Waypoint.Adapter(this.element); 15172 this.callback = options.handler; 15173 this.axis = this.options.horizontal ? "horizontal" : "vertical"; 15174 this.enabled = this.options.enabled; 15175 this.triggerPoint = null; 15176 this.group = Waypoint.Group.findOrCreate({ 15177 name: this.options.group, 15178 axis: this.axis 15179 }); 15180 this.context = Waypoint.Context.findOrCreateByElement(this.options.context); 15181 if (Waypoint.offsetAliases[this.options.offset]) { 15182 this.options.offset = Waypoint.offsetAliases[this.options.offset]; 15183 } 15184 this.group.add(this); 15185 this.context.add(this); 15186 allWaypoints[this.key] = this; 15187 keyCounter += 1; 15188 } 15189 Waypoint.prototype.queueTrigger = function(direction) { 15190 this.group.queueTrigger(this, direction); 15191 }; 15192 Waypoint.prototype.trigger = function(args) { 15193 if (!this.enabled) { 15194 return; 15195 } 15196 if (this.callback) { 15197 this.callback.apply(this, args); 15198 } 15199 }; 15200 Waypoint.prototype.destroy = function() { 15201 this.context.remove(this); 15202 this.group.remove(this); 15203 delete allWaypoints[this.key]; 15204 }; 15205 Waypoint.prototype.disable = function() { 15206 this.enabled = false; 15207 return this; 15208 }; 15209 Waypoint.prototype.enable = function() { 15210 this.context.refresh(); 15211 this.enabled = true; 15212 return this; 15213 }; 15214 Waypoint.prototype.next = function() { 15215 return this.group.next(this); 15216 }; 15217 Waypoint.prototype.previous = function() { 15218 return this.group.previous(this); 15219 }; 15220 Waypoint.invokeAll = function(method) { 15221 var allWaypointsArray = []; 15222 for (var waypointKey in allWaypoints) { 15223 allWaypointsArray.push(allWaypoints[waypointKey]); 15224 } 15225 for (var i = 0, end = allWaypointsArray.length; i < end; i++) { 15226 allWaypointsArray[i][method](); 15227 } 15228 }; 15229 Waypoint.destroyAll = function() { 15230 Waypoint.invokeAll("destroy"); 15231 }; 15232 Waypoint.disableAll = function() { 15233 Waypoint.invokeAll("disable"); 15234 }; 15235 Waypoint.enableAll = function() { 15236 Waypoint.Context.refreshAll(); 15237 for (var waypointKey in allWaypoints) { 15238 allWaypoints[waypointKey].enabled = true; 15239 } 15240 return this; 15241 }; 15242 Waypoint.refreshAll = function() { 15243 Waypoint.Context.refreshAll(); 15244 }; 15245 Waypoint.viewportHeight = function() { 15246 return window.innerHeight || document.documentElement.clientHeight; 15247 }; 15248 Waypoint.viewportWidth = function() { 15249 return document.documentElement.clientWidth; 15250 }; 15251 Waypoint.adapters = []; 15252 Waypoint.defaults = { 15253 context: window, 15254 continuous: true, 15255 enabled: true, 15256 group: "default", 15257 horizontal: false, 15258 offset: 0 15259 }; 15260 Waypoint.offsetAliases = { 15261 "bottom-in-view": function() { 15262 return this.context.innerHeight() - this.adapter.outerHeight(); 15263 }, 15264 "right-in-view": function() { 15265 return this.context.innerWidth() - this.adapter.outerWidth(); 15266 } 15267 }; 15268 window.Waypoint = Waypoint; 15269 })(); 15270 (function() { 15271 "use strict"; 15272 function requestAnimationFrameShim(callback) { 15273 window.setTimeout(callback, 1e3 / 60); 15274 } 15275 var keyCounter = 0; 15276 var contexts = {}; 15277 var Waypoint = window.Waypoint; 15278 var oldWindowLoad = window.onload; 15279 function Context(element) { 15280 this.element = element; 15281 this.Adapter = Waypoint.Adapter; 15282 this.adapter = new this.Adapter(element); 15283 this.key = "waypoint-context-" + keyCounter; 15284 this.didScroll = false; 15285 this.didResize = false; 15286 this.oldScroll = { 15287 x: this.adapter.scrollLeft(), 15288 y: this.adapter.scrollTop() 15289 }; 15290 this.waypoints = { 15291 vertical: {}, 15292 horizontal: {} 15293 }; 15294 element.waypointContextKey = this.key; 15295 contexts[element.waypointContextKey] = this; 15296 keyCounter += 1; 15297 if (!Waypoint.windowContext) { 15298 Waypoint.windowContext = true; 15299 Waypoint.windowContext = new Context(window); 15300 } 15301 this.createThrottledScrollHandler(); 15302 this.createThrottledResizeHandler(); 15303 } 15304 Context.prototype.add = function(waypoint) { 15305 var axis = waypoint.options.horizontal ? "horizontal" : "vertical"; 15306 this.waypoints[axis][waypoint.key] = waypoint; 15307 this.refresh(); 15308 }; 15309 Context.prototype.checkEmpty = function() { 15310 var horizontalEmpty = this.Adapter.isEmptyObject(this.waypoints.horizontal); 15311 var verticalEmpty = this.Adapter.isEmptyObject(this.waypoints.vertical); 15312 var isWindow = this.element == this.element.window; 15313 if (horizontalEmpty && verticalEmpty && !isWindow) { 15314 this.adapter.off(".waypoints"); 15315 delete contexts[this.key]; 15316 } 15317 }; 15318 Context.prototype.createThrottledResizeHandler = function() { 15319 var self = this; 15320 function resizeHandler() { 15321 self.handleResize(); 15322 self.didResize = false; 15323 } 15324 this.adapter.on("resize.waypoints", function() { 15325 if (!self.didResize) { 15326 self.didResize = true; 15327 Waypoint.requestAnimationFrame(resizeHandler); 15328 } 15329 }); 15330 }; 15331 Context.prototype.createThrottledScrollHandler = function() { 15332 var self = this; 15333 function scrollHandler() { 15334 self.handleScroll(); 15335 self.didScroll = false; 15336 } 15337 this.adapter.on("scroll.waypoints", function() { 15338 if (!self.didScroll || Waypoint.isTouch) { 15339 self.didScroll = true; 15340 Waypoint.requestAnimationFrame(scrollHandler); 15341 } 15342 }); 15343 }; 15344 Context.prototype.handleResize = function() { 15345 Waypoint.Context.refreshAll(); 15346 }; 15347 Context.prototype.handleScroll = function() { 15348 var triggeredGroups = {}; 15349 var axes = { 15350 horizontal: { 15351 newScroll: this.adapter.scrollLeft(), 15352 oldScroll: this.oldScroll.x, 15353 forward: "right", 15354 backward: "left" 15355 }, 15356 vertical: { 15357 newScroll: this.adapter.scrollTop(), 15358 oldScroll: this.oldScroll.y, 15359 forward: "down", 15360 backward: "up" 15361 } 15362 }; 15363 for (var axisKey in axes) { 15364 var axis = axes[axisKey]; 15365 var isForward = axis.newScroll > axis.oldScroll; 15366 var direction = isForward ? axis.forward : axis.backward; 15367 for (var waypointKey in this.waypoints[axisKey]) { 15368 var waypoint = this.waypoints[axisKey][waypointKey]; 15369 if (waypoint.triggerPoint === null) { 15370 continue; 15371 } 15372 var wasBeforeTriggerPoint = axis.oldScroll < waypoint.triggerPoint; 15373 var nowAfterTriggerPoint = axis.newScroll >= waypoint.triggerPoint; 15374 var crossedForward = wasBeforeTriggerPoint && nowAfterTriggerPoint; 15375 var crossedBackward = !wasBeforeTriggerPoint && !nowAfterTriggerPoint; 15376 if (crossedForward || crossedBackward) { 15377 waypoint.queueTrigger(direction); 15378 triggeredGroups[waypoint.group.id] = waypoint.group; 15379 } 15380 } 15381 } 15382 for (var groupKey in triggeredGroups) { 15383 triggeredGroups[groupKey].flushTriggers(); 15384 } 15385 this.oldScroll = { 15386 x: axes.horizontal.newScroll, 15387 y: axes.vertical.newScroll 15388 }; 15389 }; 15390 Context.prototype.innerHeight = function() { 15391 if (this.element == this.element.window) { 15392 return Waypoint.viewportHeight(); 15393 } 15394 return this.adapter.innerHeight(); 15395 }; 15396 Context.prototype.remove = function(waypoint) { 15397 delete this.waypoints[waypoint.axis][waypoint.key]; 15398 this.checkEmpty(); 15399 }; 15400 Context.prototype.innerWidth = function() { 15401 if (this.element == this.element.window) { 15402 return Waypoint.viewportWidth(); 15403 } 15404 return this.adapter.innerWidth(); 15405 }; 15406 Context.prototype.destroy = function() { 15407 var allWaypoints = []; 15408 for (var axis in this.waypoints) { 15409 for (var waypointKey in this.waypoints[axis]) { 15410 allWaypoints.push(this.waypoints[axis][waypointKey]); 15411 } 15412 } 15413 for (var i = 0, end = allWaypoints.length; i < end; i++) { 15414 allWaypoints[i].destroy(); 15415 } 15416 }; 15417 Context.prototype.refresh = function() { 15418 var isWindow = this.element == this.element.window; 15419 var contextOffset = isWindow ? void 0 : this.adapter.offset(); 15420 var triggeredGroups = {}; 15421 var axes; 15422 this.handleScroll(); 15423 axes = { 15424 horizontal: { 15425 contextOffset: isWindow ? 0 : contextOffset.left, 15426 contextScroll: isWindow ? 0 : this.oldScroll.x, 15427 contextDimension: this.innerWidth(), 15428 oldScroll: this.oldScroll.x, 15429 forward: "right", 15430 backward: "left", 15431 offsetProp: "left" 15432 }, 15433 vertical: { 15434 contextOffset: isWindow ? 0 : contextOffset.top, 15435 contextScroll: isWindow ? 0 : this.oldScroll.y, 15436 contextDimension: this.innerHeight(), 15437 oldScroll: this.oldScroll.y, 15438 forward: "down", 15439 backward: "up", 15440 offsetProp: "top" 15441 } 15442 }; 15443 for (var axisKey in axes) { 15444 var axis = axes[axisKey]; 15445 for (var waypointKey in this.waypoints[axisKey]) { 15446 var waypoint = this.waypoints[axisKey][waypointKey]; 15447 var adjustment = waypoint.options.offset; 15448 var oldTriggerPoint = waypoint.triggerPoint; 15449 var elementOffset = 0; 15450 var freshWaypoint = oldTriggerPoint == null; 15451 var contextModifier, wasBeforeScroll, nowAfterScroll; 15452 var triggeredBackward, triggeredForward; 15453 if (waypoint.element !== waypoint.element.window) { 15454 elementOffset = waypoint.adapter.offset()[axis.offsetProp]; 15455 } 15456 if (typeof adjustment === "function") { 15457 adjustment = adjustment.apply(waypoint); 15458 } else if (typeof adjustment === "string") { 15459 adjustment = parseFloat(adjustment); 15460 if (waypoint.options.offset.indexOf("%") > -1) { 15461 adjustment = Math.ceil(axis.contextDimension * adjustment / 100); 15462 } 15463 } 15464 contextModifier = axis.contextScroll - axis.contextOffset; 15465 waypoint.triggerPoint = Math.floor(elementOffset + contextModifier - adjustment); 15466 wasBeforeScroll = oldTriggerPoint < axis.oldScroll; 15467 nowAfterScroll = waypoint.triggerPoint >= axis.oldScroll; 15468 triggeredBackward = wasBeforeScroll && nowAfterScroll; 15469 triggeredForward = !wasBeforeScroll && !nowAfterScroll; 15470 if (!freshWaypoint && triggeredBackward) { 15471 waypoint.queueTrigger(axis.backward); 15472 triggeredGroups[waypoint.group.id] = waypoint.group; 15473 } else if (!freshWaypoint && triggeredForward) { 15474 waypoint.queueTrigger(axis.forward); 15475 triggeredGroups[waypoint.group.id] = waypoint.group; 15476 } else if (freshWaypoint && axis.oldScroll >= waypoint.triggerPoint) { 15477 waypoint.queueTrigger(axis.forward); 15478 triggeredGroups[waypoint.group.id] = waypoint.group; 15479 } 15480 } 15481 } 15482 Waypoint.requestAnimationFrame(function() { 15483 for (var groupKey in triggeredGroups) { 15484 triggeredGroups[groupKey].flushTriggers(); 15485 } 15486 }); 15487 return this; 15488 }; 15489 Context.findOrCreateByElement = function(element) { 15490 return Context.findByElement(element) || new Context(element); 15491 }; 15492 Context.refreshAll = function() { 15493 for (var contextId in contexts) { 15494 contexts[contextId].refresh(); 15495 } 15496 }; 15497 Context.findByElement = function(element) { 15498 return contexts[element.waypointContextKey]; 15499 }; 15500 window.onload = function() { 15501 if (oldWindowLoad) { 15502 oldWindowLoad(); 15503 } 15504 Context.refreshAll(); 15505 }; 15506 Waypoint.requestAnimationFrame = function(callback) { 15507 var requestFn = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || requestAnimationFrameShim; 15508 requestFn.call(window, callback); 15509 }; 15510 Waypoint.Context = Context; 15511 })(); 15512 (function() { 15513 "use strict"; 15514 function byTriggerPoint(a, b) { 15515 return a.triggerPoint - b.triggerPoint; 15516 } 15517 function byReverseTriggerPoint(a, b) { 15518 return b.triggerPoint - a.triggerPoint; 15519 } 15520 var groups = { 15521 vertical: {}, 15522 horizontal: {} 15523 }; 15524 var Waypoint = window.Waypoint; 15525 function Group(options) { 15526 this.name = options.name; 15527 this.axis = options.axis; 15528 this.id = this.name + "-" + this.axis; 15529 this.waypoints = []; 15530 this.clearTriggerQueues(); 15531 groups[this.axis][this.name] = this; 15532 } 15533 Group.prototype.add = function(waypoint) { 15534 this.waypoints.push(waypoint); 15535 }; 15536 Group.prototype.clearTriggerQueues = function() { 15537 this.triggerQueues = { 15538 up: [], 15539 down: [], 15540 left: [], 15541 right: [] 15542 }; 15543 }; 15544 Group.prototype.flushTriggers = function() { 15545 for (var direction in this.triggerQueues) { 15546 var waypoints = this.triggerQueues[direction]; 15547 var reverse = direction === "up" || direction === "left"; 15548 waypoints.sort(reverse ? byReverseTriggerPoint : byTriggerPoint); 15549 for (var i = 0, end = waypoints.length; i < end; i += 1) { 15550 var waypoint = waypoints[i]; 15551 if (waypoint.options.continuous || i === waypoints.length - 1) { 15552 waypoint.trigger([direction]); 15553 } 15554 } 15555 } 15556 this.clearTriggerQueues(); 15557 }; 15558 Group.prototype.next = function(waypoint) { 15559 this.waypoints.sort(byTriggerPoint); 15560 var index = Waypoint.Adapter.inArray(waypoint, this.waypoints); 15561 var isLast = index === this.waypoints.length - 1; 15562 return isLast ? null : this.waypoints[index + 1]; 15563 }; 15564 Group.prototype.previous = function(waypoint) { 15565 this.waypoints.sort(byTriggerPoint); 15566 var index = Waypoint.Adapter.inArray(waypoint, this.waypoints); 15567 return index ? this.waypoints[index - 1] : null; 15568 }; 15569 Group.prototype.queueTrigger = function(waypoint, direction) { 15570 this.triggerQueues[direction].push(waypoint); 15571 }; 15572 Group.prototype.remove = function(waypoint) { 15573 var index = Waypoint.Adapter.inArray(waypoint, this.waypoints); 15574 if (index > -1) { 15575 this.waypoints.splice(index, 1); 15576 } 15577 }; 15578 Group.prototype.first = function() { 15579 return this.waypoints[0]; 15580 }; 15581 Group.prototype.last = function() { 15582 return this.waypoints[this.waypoints.length - 1]; 15583 }; 15584 Group.findOrCreate = function(options) { 15585 return groups[options.axis][options.name] || new Group(options); 15586 }; 15587 Waypoint.Group = Group; 15588 })(); 15589 (function() { 15590 "use strict"; 15591 var $27 = window.jQuery; 15592 var Waypoint = window.Waypoint; 15593 function JQueryAdapter(element) { 15594 this.$element = $27(element); 15595 } 15596 $27.each([ 15597 "innerHeight", 15598 "innerWidth", 15599 "off", 15600 "offset", 15601 "on", 15602 "outerHeight", 15603 "outerWidth", 15604 "scrollLeft", 15605 "scrollTop" 15606 ], function(i, method) { 15607 JQueryAdapter.prototype[method] = function() { 15608 var args = Array.prototype.slice.call(arguments); 15609 return this.$element[method].apply(this.$element, args); 15610 }; 15611 }); 15612 $27.each([ 15613 "extend", 15614 "inArray", 15615 "isEmptyObject" 15616 ], function(i, method) { 15617 JQueryAdapter[method] = $27[method]; 15618 }); 15619 Waypoint.adapters.push({ 15620 name: "jquery", 15621 Adapter: JQueryAdapter 15622 }); 15623 Waypoint.Adapter = JQueryAdapter; 15624 })(); 15625 (function() { 15626 "use strict"; 15627 var Waypoint = window.Waypoint; 15628 function createExtension(framework) { 15629 return function() { 15630 var waypoints = []; 15631 var overrides = arguments[0]; 15632 if (framework.isFunction(arguments[0])) { 15633 overrides = framework.extend({}, arguments[1]); 15634 overrides.handler = arguments[0]; 15635 } 15636 this.each(function() { 15637 var options = framework.extend({}, overrides, { 15638 element: this 15639 }); 15640 if (typeof options.context === "string") { 15641 options.context = framework(this).closest(options.context)[0]; 15642 } 15643 waypoints.push(new Waypoint(options)); 15644 }); 15645 return waypoints; 15646 }; 15647 } 15648 if (window.jQuery) { 15649 window.jQuery.fn.waypoint = createExtension(window.jQuery); 15650 } 15651 if (window.Zepto) { 15652 window.Zepto.fn.waypoint = createExtension(window.Zepto); 15653 } 15654 })(); 15655 15656
15656// src/fairtrade_provider/js/Base/Vendor/T3vBase/GridElements/BarGridElement/ToolbarGridElement.js 15657 var ToolbarGridElement = class _ToolbarGridElement { 15658 // --- Defaults --- 15659 static get defaults() { 15660 return Object.freeze({ 15661 tag: "t3v-base-bar-grid-element", 15662 debug: false 15663 }); 15664 } 15665 // --- Public --- 15666 constructor(gridElement, options) { 15667 this.$gridElement = $(gridElement); 15668 this.options = Object.assign({}, _ToolbarGridElement.defaults, options); 15669 this.initialize(); 15670 } 15671 // --- Private --- 15672 initialize() { 15673 this.$navbarGridElement = $(`.${this.options.tag}[type="navbar"]`); 15674 this.modus = this.$navbarGridElement.length ? "tango" : "single"; 15675 this.setup(); 15676 } 15677 setup() { 15678 const self = this; 15679 if (this.modus === "single") { 15680 $("body").waypoint(function(direction) { 15681 switch (direction) { 15682 case "down": 15683 self.$gridElement.attr("state", "fixed"); 15684 break; 15685 case "up": 15686 self.$gridElement.attr("state", "default"); 15687 break; 15688 } 15689 }, { 15690 offset: -Math.abs(this.$gridElement.outerHeight()) 15691 }); 15692 } 15693 } 15694 }; 15695 15696
15696// src/fairtrade_provider/js/Base/Vendor/T3vBase/GridElements/BarGridElement.js 15697 import_jquery4.default.fn.barGridElementify = function(options) { 15698 this.each(function() { 15699 const element = (0, import_jquery4.default)(this); 15700 if (typeof element.data("barGridElementify") === "undefined") { 15701 const type = element.attr("type"); 15702 if (type) { 15703 let instance2; 15704 switch (type) { 15705 case "navbar": 15706 instance2 = new NavbarGridElement(this, options); 15707 break; 15708 case "sidebar": 15709 instance2 = new SidebarGridElement(this, options); 15710 break; 15711 case "toolbar": 15712 instance2 = new ToolbarGridElement(this, options); 15713 break; 15714 } 15715 element.data("barGridElementify", instance2); 15716 } 15717 } 15718 }); 15719 }; 15720 15721
15721// src/fairtrade_provider/js/Base/Vendor/T3vBase/GridElements/CascadingLayoutGridElement.js 15722 var import_jquery5 = __toESM(require_jquery()); 15723 var import_masonry_layout = __toESM(require_masonry()); 15724 var CascadingLayoutGridElement = class _CascadingLayoutGridElement { 15725 // --- Defaults --- 15726 static get defaults() { 15727 return Object.freeze({ 15728 tag: "t3v-base-cascading-layout-grid-element", 15729 masonry: { 15730 columnWidth: 640 - 16 / 2, 15731 // fitWidth: true, 15732 gutter: 16, 15733 // horizontalOrder: true, 15734 itemSelector: ".grid-element__view-child" 15735 }, 15736 debug: false 15737 }); 15738 } 15739 // --- Public --- 15740 constructor(gridElement, options) { 15741 this.$gridElement = (0, import_jquery5.default)(gridElement); 15742 this.options = Object.assign({}, _CascadingLayoutGridElement.defaults, options); 15743 this.initialize(); 15744 } 15745 // --- Private --- 15746 initialize() { 15747 const $main = this.$gridElement.find(`.${this.options.tag}__main`); 15748 new import_masonry_layout.default($main.get(0), this.options.masonry); 15749 } 15750 }; 15751 import_jquery5.default.fn.cascadingLayoutGridElementify = function(options) { 15752 this.each(function() { 15753 const element = (0, import_jquery5.default)(this); 15754 if (typeof element.data("cascadingLayoutGridElementify") === "undefined") { 15755 const instance2 = new CascadingLayoutGridElement(this, options); 15756 element.data("cascadingLayoutGridElementify", instance2); 15757 } 15758 }); 15759 }; 15760 15761
15761// src/fairtrade_provider/js/Base/Vendor/T3vBase/GridElements/FlyoutGridElement.js 15762 var import_jquery6 = __toESM(require_jquery()); 15763 var FlyoutGridElement = class _FlyoutGridElement { 15764 // --- Defaults --- 15765 static get defaults() { 15766 return Object.freeze({ 15767 tag: "t3v-base-flyout-grid-element", 15768 animations: { 15769 expand: { 15770 duration: 300 15771 }, 15772 collapse: { 15773 duration: 600 15774 } 15775 }, 15776 debug: false 15777 }); 15778 } 15779 // --- Public --- 15780 constructor(gridElement, options) { 15781 this.$gridElement = (0, import_jquery6.default)(gridElement); 15782 this.options = Object.assign({}, _FlyoutGridElement.defaults, options); 15783 this.initialize(); 15784 } 15785 toogle() { 15786 const state = this.$gridElement.attr("state") || "collapsed"; 15787 if (state === "collapsed") { 15788 this.expand(); 15789 } else { 15790 this.collapse(); 15791 } 15792 } 15793 expand() { 15794 const self = this; 15795 const state = this.$gridElement.attr("state") || "collapsed"; 15796 if (state === "collapsed") { 15797 this.$main.slideDown({ 15798 duration: self.options.animations.expand.duration, 15799 start: function() { 15800 self.$gridElement.attr("state", "expanded"); 15801 self.$control.attr("data-layout", "close"); 15802 } 15803 }); 15804 } 15805 } 15806 collapse() { 15807 const self = this; 15808 const state = this.$gridElement.attr("state") || "collapsed"; 15809 if (state !== "collapsed") { 15810 this.$main.slideUp({ 15811 duration: self.options.animations.collapse.duration, 15812 complete: function() { 15813 self.$control.attr("data-layout", "htx"); 15814 self.$gridElement.attr("state", "collapsed"); 15815 } 15816 }); 15817 } 15818 } 15819 // --- Events --- 15820 onTitleClick() { 15821 this.toogle(); 15822 return false; 15823 } 15824 onControlClick() { 15825 this.toogle(); 15826 return false; 15827 } 15828 // --- Private --- 15829 initialize() { 15830 this.$main = this.$gridElement.find(`.${this.options.tag}__main`); 15831 this.$title = this.$gridElement.find(`.${this.options.tag}__title`); 15832 this.$control = this.$gridElement.find(`.${this.options.tag}__control`); 15833 this.$title.on("click", import_jquery6.default.proxy(this.onTitleClick, this)); 15834 this.$control.on("click", import_jquery6.default.proxy(this.onControlClick, this)); 15835 } 15836 }; 15837 import_jquery6.default.fn.flyoutGridElementify = function(options) { 15838 this.each(function() { 15839 const element = (0, import_jquery6.default)(this); 15840 if (typeof element.data("flyoutGridElementify") === "undefined") { 15841 const instance2 = new FlyoutGridElement(this, options); 15842 element.data("flyoutGridElementify", instance2); 15843 } 15844 }); 15845 }; 15846 15847
15847// src/fairtrade_provider/js/Base/Vendor/T3vBase/GridElements/HeaderGridElement.js 15848 var import_jquery7 = __toESM(require_jquery()); 15849 var HeaderGridElement = class _HeaderGridElement { 15850 // --- Defaults --- 15851 static get defaults() { 15852 return Object.freeze({ 15853 tag: "t3v-base-header-grid-element", 15854 debug: false 15855 }); 15856 } 15857 // --- Public --- 15858 constructor(gridElement, options) { 15859 this.$gridElement = (0, import_jquery7.default)(gridElement); 15860 this.options = Object.assign({}, _HeaderGridElement.defaults, options); 15861 this.initialize(); 15862 } 15863 // --- Events --- 15864 onBackgroundVideoClick(event) { 15865 event.preventDefault(); 15866 const backgroundVideo = event.currentTarget; 15867 if (backgroundVideo.paused) { 15868 backgroundVideo.play(); 15869 } else { 15870 backgroundVideo.pause(); 15871 } 15872 return false; 15873 } 15874 // --- Private --- 15875 initialize() { 15876 this.$backgroundVideo = this.$gridElement.find(`.${this.options.tag}__background-video`); 15877 this.$backgroundVideo.on("click touchstart", import_jquery7.default.proxy(this.onBackgroundVideoClick, this)); 15878 } 15879 }; 15880 import_jquery7.default.fn.headerGridElementify = function(options) { 15881 this.each(function() { 15882 const element = (0, import_jquery7.default)(this); 15883 if (typeof element.data("headerGridElementify") === "undefined") { 15884 const instance2 = new HeaderGridElement(this, options); 15885 element.data("headerGridElementify", instance2); 15886 } 15887 }); 15888 return this; 15889 }; 15890 15891
15891// src/fairtrade_provider/js/Base/Vendor/T3vBase/GridElements/ModalGridElement.js 15892 var import_jquery8 = __toESM(require_jquery()); 15893 var ModalGridElement = class _ModalGridElement { 15894 // --- Defaults --- 15895 static get defaults() { 15896 return Object.freeze({ 15897 tag: "t3v-base-modal-grid-element", 15898 colorbox: { 15899 // --- Common --- 15900 // The transition type. Can be set to `elastic`, `fade`, or `none`. 15901 transition: "elastic", 15902 // --- Dimensions --- 15903 // Sets a maximum height for loaded content. 15904 // Example: `100%`, `500px` or `500` 15905 maxHeight: "86%", 15906 // Sets a maximum width for loaded content. 15907 // Example: `100%`, `500px` or `500` 15908 maxWidth: "86%" 15909 }, 15910 debug: false 15911 }); 15912 } 15913 // --- Public --- 15914 constructor(gridElement, options) { 15915 this.$gridElement = (0, import_jquery8.default)(gridElement); 15916 this.options = Object.assign({}, _ModalGridElement.defaults, options); 15917 this.initialize(); 15918 } 15919 // --- Events --- 15920 onControlClick(event) { 15921 event.preventDefault(); 15922 const $control = (0, import_jquery8.default)(event.currentTarget); 15923 const href = $control.attr("href"); 15924 const reference = href.substring(href.indexOf("#") + 1); 15925 const options = this.options.colorbox; 15926 switch (reference) { 15927 case "contact": 15928 if (this.onDesktop()) { 15929 options.html = this.$main.html(); 15930 import_jquery8.default.colorbox(options); 15931 } else { 15932 window.location = href; 15933 } 15934 break; 15935 default: 15936 options.html = this.$main.html(); 15937 import_jquery8.default.colorbox(options); 15938 } 15939 return false; 15940 } 15941 // --- Private --- 15942 initialize() { 15943 this.$main = this.$gridElement.find(`.${this.options.tag}__main`); 15944 if (this.$main.length) { 15945 const reference = this.$gridElement.attr("ref"); 15946 if (reference) { 15947 const $controls = (0, import_jquery8.default)(`a[href*="#${reference}"]`); 15948 $controls.on("click", import_jquery8.default.proxy(this.onControlClick, this)); 15949 } 15950 } 15951 } 15952 onMobile() { 15953 return !this.onDesktop(); 15954 } 15955 onDesktop() { 15956 if (window.innerWidth >= settings.media.screen.large.minWidth) { 15957 return true; 15958 } else { 15959 return false; 15960 } 15961 } 15962 }; 15963 import_jquery8.default.fn.modalGridElementify = function(options) { 15964 this.each(function() { 15965 const element = (0, import_jquery8.default)(this); 15966 if (typeof element.data("modalGridElementify") === "undefined") { 15967 const instance2 = new ModalGridElement(this, options); 15968 element.data("modalGridElementify", instance2); 15969 } 15970 }); 15971 return this; 15972 }; 15973 15974
15974// src/fairtrade_provider/js/Base/Vendor/T3vContent/GridElements/AccordGridElement.js 15975 var import_jquery9 = __toESM(require_jquery()); 15976 var AccordGridElement = class _AccordGridElement { 15977 // --- Defaults --- 15978 static get defaults() { 15979 return Object.freeze({ 15980 tag: "t3v-content-accord-grid-element", 15981 animations: { 15982 expand: { 15983 command: "slideDown", 15984 duration: 300 15985 }, 15986 collapse: { 15987 command: "slideUp", 15988 duration: 600 15989 } 15990 }, 15991 debug: false 15992 }); 15993 } 15994 // --- Public --- 15995 constructor(gridElement, options) { 15996 this.$gridElement = (0, import_jquery9.default)(gridElement); 15997 this.options = Object.assign({}, _AccordGridElement.defaults, options); 15998 this.initialize(); 15999 } 16000 expand() { 16001 const self = this; 16002 if (this.$main.length) { 16003 const $gridElement = this.$gridElement; 16004 const $body = this.$body; 16005 this.$main.slideDown({ 16006 duration: self.options.animations.expand.duration, 16007 complete: function() { 16008 $gridElement.attr("state", "expanded"); 16009 $body.trigger("change"); 16010 } 16011 }); 16012 } 16013 } 16014 collapse() { 16015 const self = this; 16016 if (this.$main.length) { 16017 const $gridElement = this.$gridElement; 16018 const $body = this.$body; 16019 this.$main.slideUp({ 16020 duration: self.options.animations.collapse.duration, 16021 complete: function() { 16022 $gridElement.attr("state", "collapsed"); 16023 $body.trigger("change"); 16024 } 16025 }); 16026 } 16027 } 16028 shuffle() { 16029 const state = this.$gridElement.attr("state") || "collapsed"; 16030 if (state === "collapsed") { 16031 this.expand(); 16032 } else { 16033 this.collapse(); 16034 } 16035 } 16036 // --- Events --- 16037 onHeaderClick() { 16038 this.shuffle(); 16039 return false; 16040 } 16041 // --- Private --- 16042 initialize() { 16043 this.$body = (0, import_jquery9.default)(document.body); 16044 this.$header = this.$gridElement.find(`.${this.options.tag}__header`); 16045 this.$main = this.$gridElement.find(`.${this.options.tag}__main`); 16046 this.$header.on("click", import_jquery9.default.proxy(this.onHeaderClick, this)); 16047 } 16048 }; 16049 import_jquery9.default.fn.accordGridElementify = function(options) { 16050 this.each(function() { 16051 const element = (0, import_jquery9.default)(this); 16052 if (typeof element.data("accordGridElementify") === "undefined") { 16053 const instance2 = new AccordGridElement(this, options); 16054 element.data("accordGridElementify", instance2); 16055 } 16056 }); 16057 }; 16058 16059
16059// src/fairtrade_provider/js/Base/Vendor/T3vContent/GridElements/EventGridElement.js 16060 var import_jquery10 = __toESM(require_jquery()); 16061 var EventGridElement = class _EventGridElement { 16062 // --- Defaults --- 16063 static get defaults() { 16064 return Object.freeze({ 16065 tag: "t3v-content-event-grid-element", 16066 animations: { 16067 expand: { 16068 duration: 300 16069 }, 16070 collapse: { 16071 duration: 600 16072 } 16073 }, 16074 debug: false 16075 }); 16076 } 16077 // --- Public --- 16078 constructor(gridElement, options) { 16079 this.$gridElement = (0, import_jquery10.default)(gridElement); 16080 this.options = Object.assign({}, _EventGridElement.defaults, options); 16081 this.initialize(); 16082 } 16083 expand() { 16084 const self = this; 16085 if (this.$main.length) { 16086 const $gridElement = this.$gridElement; 16087 const $body = this.$body; 16088 this.$main.slideDown({ 16089 duration: self.options.animations.expand.duration, 16090 complete: function() { 16091 $gridElement.attr("state", "expanded"); 16092 $body.trigger("change"); 16093 } 16094 }); 16095 } 16096 } 16097 collapse() { 16098 const self = this; 16099 if (this.$main.length) { 16100 const $gridElement = this.$gridElement; 16101 const $body = this.$body; 16102 this.$main.slideUp({ 16103 duration: self.options.animations.collapse.duration, 16104 complete: function() { 16105 $gridElement.attr("state", "collapsed"); 16106 $body.trigger("change"); 16107 } 16108 }); 16109 } 16110 } 16111 shuffle() { 16112 const state = this.$gridElement.attr("state") || "collapsed"; 16113 if (state === "collapsed") { 16114 this.expand(); 16115 } else { 16116 this.collapse(); 16117 } 16118 } 16119 // --- Events --- 16120 onHeaderClick() { 16121 this.shuffle(); 16122 return false; 16123 } 16124 // --- Private --- 16125 initialize() { 16126 this.$body = (0, import_jquery10.default)(document.body); 16127 this.$header = this.$gridElement.find(`.${this.options.tag}__header`); 16128 this.$main = this.$gridElement.find(`.${this.options.tag}__main`); 16129 this.$header.on("click", import_jquery10.default.proxy(this.onHeaderClick, this)); 16130 } 16131 }; 16132 import_jquery10.default.fn.eventGridElementify = function(options) { 16133 this.each(function() { 16134 const element = (0, import_jquery10.default)(this); 16135 if (typeof element.data("eventGridElementify") === "undefined") { 16136 const instance2 = new EventGridElement(this, options); 16137 element.data("eventGridElementify", instance2); 16138 } 16139 }); 16140 return this; 16141 }; 16142 16143
16143// src/fairtrade_provider/js/Base/Vendor/T3vContent/GridElements/SessionGridElement.js 16144 var import_jquery11 = __toESM(require_jquery()); 16145 var SessionGridElement = class _SessionGridElement { 16146 // --- Defaults --- 16147 static get defaults() { 16148 return Object.freeze({ 16149 tag: "t3v-content-session-grid-element", 16150 animations: { 16151 expand: { 16152 duration: 300 16153 }, 16154 collapse: { 16155 duration: 600 16156 } 16157 }, 16158 debug: false 16159 }); 16160 } 16161 // --- Public --- 16162 constructor(gridElement, options) { 16163 this.$gridElement = (0, import_jquery11.default)(gridElement); 16164 this.options = Object.assign({}, _SessionGridElement.defaults, options); 16165 this.initialize(); 16166 } 16167 expand() { 16168 const self = this; 16169 if (this.$main.length) { 16170 const $gridElement = this.$gridElement; 16171 const $body = this.$body; 16172 this.$main.slideDown({ 16173 duration: self.options.animations.expand.duration, 16174 complete: function() { 16175 $gridElement.attr("state", "expanded"); 16176 $body.trigger("change"); 16177 } 16178 }); 16179 } 16180 } 16181 collapse() { 16182 const self = this; 16183 if (this.$main.length) { 16184 const $gridElement = this.$gridElement; 16185 const $body = this.$body; 16186 this.$main.slideUp({ 16187 duration: self.options.animations.collapse.duration, 16188 complete: function() { 16189 $gridElement.attr("state", "collapsed"); 16190 $body.trigger("change"); 16191 } 16192 }); 16193 } 16194 } 16195 shuffle() { 16196 const state = this.$gridElement.attr("state") || "collapsed"; 16197 if (state === "collapsed") { 16198 this.expand(); 16199 } else { 16200 this.collapse(); 16201 } 16202 } 16203 // --- Events --- 16204 onHeaderClick() { 16205 this.shuffle(); 16206 return false; 16207 } 16208 // --- Private --- 16209 initialize() { 16210 this.$body = (0, import_jquery11.default)(document.body); 16211 this.$header = this.$gridElement.find(`.${this.options.tag}__header`); 16212 this.$main = this.$gridElement.find(`.${this.options.tag}__main`); 16213 this.$header.on("click", import_jquery11.default.proxy(this.onHeaderClick, this)); 16214 } 16215 }; 16216 import_jquery11.default.fn.sessionGridElementify = function(options) { 16217 this.each(function() { 16218 const element = (0, import_jquery11.default)(this); 16219 if (typeof element.data("sessionGridElementify") === "undefined") { 16220 const instance2 = new SessionGridElement(this, options); 16221 element.data("sessionGridElementify", instance2); 16222 } 16223 }); 16224 return this; 16225 }; 16226 16227
16227// src/fairtrade_provider/js/Base/Vendor/T3vBase/ContentObjects/Link.js 16228 var import_jquery12 = __toESM(require_jquery()); 16229 16230
16230// src/fairtrade_provider/js/Base/Vendor/T3vBase/ContentObjects/Link/ScrollBackToTopLink.js 16231 var import_tablesaw3 = __toESM(require_tablesaw_jquery()); 16232 var ScrollBackToTopLink = class _ScrollBackToTopLink { 16233 // --- Defaults --- 16234 static get defaults() { 16235 return Object.freeze({ 16236 animations: { 16237 down: { 16238 duration: 900 16239 }, 16240 up: { 16241 duration: 300 16242 } 16243 }, 16244 body: $(".body-main"), 16245 offset: 200, 16246 debug: false 16247 }); 16248 } 16249 // --- Public --- 16250 constructor(link, options) { 16251 this.$link = $(link); 16252 this.options = Object.assign({}, _ScrollBackToTopLink.defaults, options); 16253 this.initialize(); 16254 } 16255 // --- Private --- 16256 initialize() { 16257 this.setup(); 16258 } 16259 setup() { 16260 const self = this; 16261 self.options.body.waypoint(function(direction) { 16262 switch (direction) { 16263 case "down": 16264 self.$link.fadeIn({ 16265 duration: self.options.animations.down.duration 16266 }); 16267 break; 16268 case "up": 16269 self.$link.fadeOut({ 16270 duration: self.options.animations.up.duration 16271 }); 16272 break; 16273 } 16274 }, { 16275 offset: self.options.offset 16276 }); 16277 } 16278 }; 16279 16280
16280// src/fairtrade_provider/js/Base/Vendor/T3vBase/ContentObjects/Link.js 16281 import_jquery12.default.fn.linkify = function(options) { 16282 this.each(function() { 16283 const element = (0, import_jquery12.default)(this); 16284 if (typeof element.data("linkify") === "undefined") { 16285 const type = element.data("type"); 16286 if (type) { 16287 let instance2; 16288 switch (type) { 16289 // case 'button': 16290 // instance = new ButtonLink(this, options) 16291 // 16292 // break 16293 // case 'download': 16294 // instance = new DownloadLink(this, options) 16295 // 16296 // break 16297 // case 'home': 16298 // instance = new HomeLink(this, options) 16299 // 16300 // break 16301 // case 'mail': 16302 // instance = new MailLink(this, options) 16303 // 16304 // break 16305 // case 'more': 16306 // instance = new MoreLink(this, options) 16307 // 16308 // break 16309 // case 'phone': 16310 // instance = new PhoneLink(this, options) 16311 // 16312 // break 16313 case "scroll-back-to-top": 16314 instance2 = new ScrollBackToTopLink(this, options); 16315 break; 16316 } 16317 element.data("linkify", instance2); 16318 } 16319 } 16320 }); 16321 }; 16322 16323
16323// src/fairtrade_provider/js/Base/Vendor/T3vBase/ContentObjects/SearchBar.js 16324 var import_jquery13 = __toESM(require_jquery()); 16325 var SearchBar = class _SearchBar { 16326 // --- Defaults --- 16327 static get defaults() { 16328 return Object.freeze({ 16329 tag: "t3v-base-search-bar", 16330 states: { 16331 expanded: { 16332 searchTerm: { 16333 width: "180px" 16334 } 16335 } 16336 }, 16337 debug: false 16338 }); 16339 } 16340 // --- Public --- 16341 constructor(contentElement, options) { 16342 this.$contentElement = (0, import_jquery13.default)(contentElement); 16343 this.options = Object.assign({}, _SearchBar.defaults, options); 16344 this.initialize(); 16345 } 16346 // --- Private --- 16347 initialize() { 16348 this.$form = this.$contentElement.find(`.${this.options.tag}-form`); 16349 this.$searchTermInput = this.$form.find(`#${this.options.tag}-form__search-term`); 16350 this.$searchTermField = this.$searchTermInput.closest(".form__field"); 16351 this.$submit = this.$form.find(".form__submit"); 16352 this.setup(); 16353 } 16354 setup() { 16355 const self = this; 16356 const layout = this.$contentElement.attr("layout") || "default"; 16357 if (layout === "compact") { 16358 this.$submit.hover( 16359 function() { 16360 self.$searchTermField.animate({ 16361 width: self.options.states.expanded.searchTerm.width 16362 }, { 16363 duration: "fast", 16364 queue: false, 16365 begin: function() { 16366 self.$form.attr("state", "expanded"); 16367 }, 16368 complete: function() { 16369 self.$searchTermInput.focus(); 16370 } 16371 }); 16372 }, 16373 function() { 16374 } 16375 ); 16376 } 16377 } 16378 }; 16379 import_jquery13.default.fn.searchBarify = function(options) { 16380 this.each(function() { 16381 const element = (0, import_jquery13.default)(this); 16382 if (typeof element.data("searchBarify") === "undefined") { 16383 const instance2 = new SearchBar(this, options); 16384 element.data("searchBarify", instance2); 16385 } 16386 }); 16387 return this; 16388 }; 16389 16390
16390// src/fairtrade_provider/js/Base/Vendor/T3vContent/ContentObjects/Carousel.js 16391 var import_jquery14 = __toESM(require_jquery()); 16392 16393
vendor: 80,099 bytes, lines 16393-19193
16393// node_modules/@glidejs/glide/dist/glide.esm.js 16394 function _typeof2(obj) { 16395 "@babel/helpers - typeof"; 16396 if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { 16397 _typeof2 = function(obj2) { 16398 return typeof obj2; 16399 }; 16400 } else { 16401 _typeof2 = function(obj2) { 16402 return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2; 16403 }; 16404 } 16405 return _typeof2(obj); 16406 } 16407 function _classCallCheck2(instance2, Constructor) { 16408 if (!(instance2 instanceof Constructor)) { 16409 throw new TypeError("Cannot call a class as a function"); 16410 } 16411 } 16412 function _defineProperties2(target, props) { 16413 for (var i = 0; i < props.length; i++) { 16414 var descriptor = props[i]; 16415 descriptor.enumerable = descriptor.enumerable || false; 16416 descriptor.configurable = true; 16417 if ("value" in descriptor) descriptor.writable = true; 16418 Object.defineProperty(target, descriptor.key, descriptor); 16419 } 16420 } 16421 function _createClass2(Constructor, protoProps, staticProps) { 16422 if (protoProps) _defineProperties2(Constructor.prototype, protoProps); 16423 if (staticProps) _defineProperties2(Constructor, staticProps); 16424 return Constructor; 16425 } 16426 function _inherits2(subClass, superClass) { 16427 if (typeof superClass !== "function" && superClass !== null) { 16428 throw new TypeError("Super expression must either be null or a function"); 16429 } 16430 subClass.prototype = Object.create(superClass && superClass.prototype, { 16431 constructor: { 16432 value: subClass, 16433 writable: true, 16434 configurable: true 16435 } 16436 }); 16437 if (superClass) _setPrototypeOf2(subClass, superClass); 16438 } 16439 function _getPrototypeOf2(o2) { 16440 _getPrototypeOf2 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf3(o3) { 16441 return o3.__proto__ || Object.getPrototypeOf(o3); 16442 }; 16443 return _getPrototypeOf2(o2); 16444 } 16445 function _setPrototypeOf2(o2, p) { 16446 _setPrototypeOf2 = Object.setPrototypeOf || function _setPrototypeOf3(o3, p2) { 16447 o3.__proto__ = p2; 16448 return o3; 16449 }; 16450 return _setPrototypeOf2(o2, p); 16451 } 16452 function _isNativeReflectConstruct2() { 16453 if (typeof Reflect === "undefined" || !Reflect.construct) return false; 16454 if (Reflect.construct.sham) return false; 16455 if (typeof Proxy === "function") return true; 16456 try { 16457 Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() { 16458 })); 16459 return true; 16460 } catch (e2) { 16461 return false; 16462 } 16463 } 16464 function _assertThisInitialized2(self) { 16465 if (self === void 0) { 16466 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 16467 } 16468 return self; 16469 } 16470 function _possibleConstructorReturn2(self, call) { 16471 if (call && (typeof call === "object" || typeof call === "function")) { 16472 return call; 16473 } else if (call !== void 0) { 16474 throw new TypeError("Derived constructors may only return object or undefined"); 16475 } 16476 return _assertThisInitialized2(self); 16477 } 16478 function _createSuper2(Derived) { 16479 var hasNativeReflectConstruct = _isNativeReflectConstruct2(); 16480 return function _createSuperInternal() { 16481 var Super = _getPrototypeOf2(Derived), result; 16482 if (hasNativeReflectConstruct) { 16483 var NewTarget = _getPrototypeOf2(this).constructor; 16484 result = Reflect.construct(Super, arguments, NewTarget); 16485 } else { 16486 result = Super.apply(this, arguments); 16487 } 16488 return _possibleConstructorReturn2(this, result); 16489 }; 16490 } 16491 function _superPropBase(object, property) { 16492 while (!Object.prototype.hasOwnProperty.call(object, property)) { 16493 object = _getPrototypeOf2(object); 16494 if (object === null) break; 16495 } 16496 return object; 16497 } 16498 function _get() { 16499 if (typeof Reflect !== "undefined" && Reflect.get) { 16500 _get = Reflect.get; 16501 } else { 16502 _get = function _get2(target, property, receiver) { 16503 var base = _superPropBase(target, property); 16504 if (!base) return; 16505 var desc = Object.getOwnPropertyDescriptor(base, property); 16506 if (desc.get) { 16507 return desc.get.call(arguments.length < 3 ? target : receiver); 16508 } 16509 return desc.value; 16510 }; 16511 } 16512 return _get.apply(this, arguments); 16513 } 16514 var defaults2 = { 16515 /** 16516 * Type of the movement. 16517 * 16518 * Available types: 16519 * `slider` - Rewinds slider to the start/end when it reaches the first or last slide. 16520 * `carousel` - Changes slides without starting over when it reaches the first or last slide. 16521 * 16522 * @type {String} 16523 */ 16524 type: "slider", 16525 /** 16526 * Start at specific slide number defined with zero-based index. 16527 * 16528 * @type {Number} 16529 */ 16530 startAt: 0, 16531 /** 16532 * A number of slides visible on the single viewport. 16533 * 16534 * @type {Number} 16535 */ 16536 perView: 1, 16537 /** 16538 * Focus currently active slide at a specified position in the track. 16539 * 16540 * Available inputs: 16541 * `center` - Current slide will be always focused at the center of a track. 16542 * `0,1,2,3...` - Current slide will be focused on the specified zero-based index. 16543 * 16544 * @type {String|Number} 16545 */ 16546 focusAt: 0, 16547 /** 16548 * A size of the gap added between slides. 16549 * 16550 * @type {Number} 16551 */ 16552 gap: 10, 16553 /** 16554 * Change slides after a specified interval. Use `false` for turning off autoplay. 16555 * 16556 * @type {Number|Boolean} 16557 */ 16558 autoplay: false, 16559 /** 16560 * Stop autoplay on mouseover event. 16561 * 16562 * @type {Boolean} 16563 */ 16564 hoverpause: true, 16565 /** 16566 * Allow for changing slides with left and right keyboard arrows. 16567 * 16568 * @type {Boolean} 16569 */ 16570 keyboard: true, 16571 /** 16572 * Stop running `perView` number of slides from the end. Use this 16573 * option if you don't want to have an empty space after 16574 * a slider. Works only with `slider` type and a 16575 * non-centered `focusAt` setting. 16576 * 16577 * @type {Boolean} 16578 */ 16579 bound: false, 16580 /** 16581 * Minimal swipe distance needed to change the slide. Use `false` for turning off a swiping. 16582 * 16583 * @type {Number|Boolean} 16584 */ 16585 swipeThreshold: 80, 16586 /** 16587 * Minimal mouse drag distance needed to change the slide. Use `false` for turning off a dragging. 16588 * 16589 * @type {Number|Boolean} 16590 */ 16591 dragThreshold: 120, 16592 /** 16593 * A number of slides moved on single swipe. 16594 * 16595 * Available types: 16596 * `` - Moves slider by one slide per swipe 16597 * `|` - Moves slider between views per swipe (number of slides defined in `perView` options) 16598 * 16599 * @type {String} 16600 */ 16601 perSwipe: "", 16602 /** 16603 * Moving distance ratio of the slides on a swiping and dragging. 16604 * 16605 * @type {Number} 16606 */ 16607 touchRatio: 0.5, 16608 /** 16609 * Angle required to activate slides moving on swiping or dragging. 16610 * 16611 * @type {Number} 16612 */ 16613 touchAngle: 45, 16614 /** 16615 * Duration of the animation in milliseconds. 16616 * 16617 * @type {Number} 16618 */ 16619 animationDuration: 400, 16620 /** 16621 * Allows looping the `slider` type. Slider will rewind to the first/last slide when it's at the start/end. 16622 * 16623 * @type {Boolean} 16624 */ 16625 rewind: true, 16626 /** 16627 * Duration of the rewinding animation of the `slider` type in milliseconds. 16628 * 16629 * @type {Number} 16630 */ 16631 rewindDuration: 800, 16632 /** 16633 * Easing function for the animation. 16634 * 16635 * @type {String} 16636 */ 16637 animationTimingFunc: "cubic-bezier(.165, .840, .440, 1)", 16638 /** 16639 * Wait for the animation to finish until the next user input can be processed 16640 * 16641 * @type {boolean} 16642 */ 16643 waitForTransition: true, 16644 /** 16645 * Throttle costly events at most once per every wait milliseconds. 16646 * 16647 * @type {Number} 16648 */ 16649 throttle: 10, 16650 /** 16651 * Moving direction mode. 16652 * 16653 * Available inputs: 16654 * - 'ltr' - left to right movement, 16655 * - 'rtl' - right to left movement. 16656 * 16657 * @type {String} 16658 */ 16659 direction: "ltr", 16660 /** 16661 * The distance value of the next and previous viewports which 16662 * have to peek in the current view. Accepts number and 16663 * pixels as a string. Left and right peeking can be 16664 * set up separately with a directions object. 16665 * 16666 * For example: 16667 * `100` - Peek 100px on the both sides. 16668 * { before: 100, after: 50 }` - Peek 100px on the left side and 50px on the right side. 16669 * 16670 * @type {Number|String|Object} 16671 */ 16672 peek: 0, 16673 /** 16674 * Defines how many clones of current viewport will be generated. 16675 * 16676 * @type {Number} 16677 */ 16678 cloningRatio: 1, 16679 /** 16680 * Collection of options applied at specified media breakpoints. 16681 * For example: display two slides per view under 800px. 16682 * `{ 16683 * '800px': { 16684 * perView: 2 16685 * } 16686 * }` 16687 */ 16688 breakpoints: {}, 16689 /** 16690 * Collection of internally used HTML classes. 16691 * 16692 * @todo Refactor `slider` and `carousel` properties to single `type: { slider: '', carousel: '' }` object 16693 * @type {Object} 16694 */ 16695 classes: { 16696 swipeable: "glide--swipeable", 16697 dragging: "glide--dragging", 16698 direction: { 16699 ltr: "glide--ltr", 16700 rtl: "glide--rtl" 16701 }, 16702 type: { 16703 slider: "glide--slider", 16704 carousel: "glide--carousel" 16705 }, 16706 slide: { 16707 clone: "glide__slide--clone", 16708 active: "glide__slide--active" 16709 }, 16710 arrow: { 16711 disabled: "glide__arrow--disabled" 16712 }, 16713 nav: { 16714 active: "glide__bullet--active" 16715 } 16716 } 16717 }; 16718 function warn2(msg) { 16719 console.error("[Glide warn]: ".concat(msg)); 16720 } 16721 function toInt(value) { 16722 return parseInt(value); 16723 } 16724 function toFloat(value) { 16725 return parseFloat(value); 16726 } 16727 function isString(value) { 16728 return typeof value === "string"; 16729 } 16730 function isObject(value) { 16731 var type = _typeof2(value); 16732 return type === "function" || type === "object" && !!value; 16733 } 16734 function isFunction(value) { 16735 return typeof value === "function"; 16736 } 16737 function isUndefined(value) { 16738 return typeof value === "undefined"; 16739 } 16740 function isArray(value) { 16741 return value.constructor === Array; 16742 } 16743 function mount(glide, extensions, events) { 16744 var components2 = {}; 16745 for (var name in extensions) { 16746 if (isFunction(extensions[name])) { 16747 components2[name] = extensions[name](glide, components2, events); 16748 } else { 16749 warn2("Extension must be a function"); 16750 } 16751 } 16752 for (var _name in components2) { 16753 if (isFunction(components2[_name].mount)) { 16754 components2[_name].mount(); 16755 } 16756 } 16757 return components2; 16758 } 16759 function define2(obj, prop, definition) { 16760 Object.defineProperty(obj, prop, definition); 16761 } 16762 function sortKeys(obj) { 16763 return Object.keys(obj).sort().reduce(function(r, k) { 16764 r[k] = obj[k]; 16765 return r[k], r; 16766 }, {}); 16767 } 16768 function mergeOptions(defaults3, settings2) { 16769 var options = Object.assign({}, defaults3, settings2); 16770 if (settings2.hasOwnProperty("classes")) { 16771 options.classes = Object.assign({}, defaults3.classes, settings2.classes); 16772 if (settings2.classes.hasOwnProperty("direction")) { 16773 options.classes.direction = Object.assign({}, defaults3.classes.direction, settings2.classes.direction); 16774 } 16775 if (settings2.classes.hasOwnProperty("type")) { 16776 options.classes.type = Object.assign({}, defaults3.classes.type, settings2.classes.type); 16777 } 16778 if (settings2.classes.hasOwnProperty("slide")) { 16779 options.classes.slide = Object.assign({}, defaults3.classes.slide, settings2.classes.slide); 16780 } 16781 if (settings2.classes.hasOwnProperty("arrow")) { 16782 options.classes.arrow = Object.assign({}, defaults3.classes.arrow, settings2.classes.arrow); 16783 } 16784 if (settings2.classes.hasOwnProperty("nav")) { 16785 options.classes.nav = Object.assign({}, defaults3.classes.nav, settings2.classes.nav); 16786 } 16787 } 16788 if (settings2.hasOwnProperty("breakpoints")) { 16789 options.breakpoints = Object.assign({}, defaults3.breakpoints, settings2.breakpoints); 16790 } 16791 return options; 16792 } 16793 var EventsBus = /* @__PURE__ */ (function() { 16794 function EventsBus2() { 16795 var events = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; 16796 _classCallCheck2(this, EventsBus2); 16797 this.events = events; 16798 this.hop = events.hasOwnProperty; 16799 } 16800 _createClass2(EventsBus2, [{ 16801 key: "on", 16802 value: function on(event, handler) { 16803 if (isArray(event)) { 16804 for (var i = 0; i < event.length; i++) { 16805 this.on(event[i], handler); 16806 } 16807 return; 16808 } 16809 if (!this.hop.call(this.events, event)) { 16810 this.events[event] = []; 16811 } 16812 var index = this.events[event].push(handler) - 1; 16813 return { 16814 remove: function remove2() { 16815 delete this.events[event][index]; 16816 } 16817 }; 16818 } 16819 /** 16820 * Runs registered handlers for specified event. 16821 * 16822 * @param {String|Array} event 16823 * @param {Object=} context 16824 */ 16825 }, { 16826 key: "emit", 16827 value: function emit(event, context) { 16828 if (isArray(event)) { 16829 for (var i = 0; i < event.length; i++) { 16830 this.emit(event[i], context); 16831 } 16832 return; 16833 } 16834 if (!this.hop.call(this.events, event)) { 16835 return; 16836 } 16837 this.events[event].forEach(function(item) { 16838 item(context || {}); 16839 }); 16840 } 16841 }]); 16842 return EventsBus2; 16843 })(); 16844 var Glide$1 = /* @__PURE__ */ (function() { 16845 function Glide2(selector) { 16846 var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; 16847 _classCallCheck2(this, Glide2); 16848 this._c = {}; 16849 this._t = []; 16850 this._e = new EventsBus(); 16851 this.disabled = false; 16852 this.selector = selector; 16853 this.settings = mergeOptions(defaults2, options); 16854 this.index = this.settings.startAt; 16855 } 16856 _createClass2(Glide2, [{ 16857 key: "mount", 16858 value: function mount$1() { 16859 var extensions = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; 16860 this._e.emit("mount.before"); 16861 if (isObject(extensions)) { 16862 this._c = mount(this, extensions, this._e); 16863 } else { 16864 warn2("You need to provide a object on `mount()`"); 16865 } 16866 this._e.emit("mount.after"); 16867 return this; 16868 } 16869 /** 16870 * Collects an instance `translate` transformers. 16871 * 16872 * @param {Array} transformers Collection of transformers. 16873 * @return {Void} 16874 */ 16875 }, { 16876 key: "mutate", 16877 value: function mutate() { 16878 var transformers = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : []; 16879 if (isArray(transformers)) { 16880 this._t = transformers; 16881 } else { 16882 warn2("You need to provide a array on `mutate()`"); 16883 } 16884 return this; 16885 } 16886 /** 16887 * Updates glide with specified settings. 16888 * 16889 * @param {Object} settings 16890 * @return {Glide} 16891 */ 16892 }, { 16893 key: "update", 16894 value: function update() { 16895 var settings2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; 16896 this.settings = mergeOptions(this.settings, settings2); 16897 if (settings2.hasOwnProperty("startAt")) { 16898 this.index = settings2.startAt; 16899 } 16900 this._e.emit("update"); 16901 return this; 16902 } 16903 /** 16904 * Change slide with specified pattern. A pattern must be in the special format: 16905 * `>` - Move one forward 16906 * `<` - Move one backward 16907 * `={i}` - Go to {i} zero-based slide (eq. '=1', will go to second slide) 16908 * `>>` - Rewinds to end (last slide) 16909 * `<<` - Rewinds to start (first slide) 16910 * `|>` - Move one viewport forward 16911 * `|<` - Move one viewport backward 16912 * 16913 * @param {String} pattern 16914 * @return {Glide} 16915 */ 16916 }, { 16917 key: "go", 16918 value: function go(pattern) { 16919 this._c.Run.make(pattern); 16920 return this; 16921 } 16922 /** 16923 * Move track by specified distance. 16924 * 16925 * @param {String} distance 16926 * @return {Glide} 16927 */ 16928 }, { 16929 key: "move", 16930 value: function move(distance) { 16931 this._c.Transition.disable(); 16932 this._c.Move.make(distance); 16933 return this; 16934 } 16935 /** 16936 * Destroy instance and revert all changes done by this._c. 16937 * 16938 * @return {Glide} 16939 */ 16940 }, { 16941 key: "destroy", 16942 value: function destroy() { 16943 this._e.emit("destroy"); 16944 return this; 16945 } 16946 /** 16947 * Start instance autoplaying. 16948 * 16949 * @param {Boolean|Number} interval Run autoplaying with passed interval regardless of `autoplay` settings 16950 * @return {Glide} 16951 */ 16952 }, { 16953 key: "play", 16954 value: function play() { 16955 var interval = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false; 16956 if (interval) { 16957 this.settings.autoplay = interval; 16958 } 16959 this._e.emit("play"); 16960 return this; 16961 } 16962 /** 16963 * Stop instance autoplaying. 16964 * 16965 * @return {Glide} 16966 */ 16967 }, { 16968 key: "pause", 16969 value: function pause() { 16970 this._e.emit("pause"); 16971 return this; 16972 } 16973 /** 16974 * Sets glide into a idle status. 16975 * 16976 * @return {Glide} 16977 */ 16978 }, { 16979 key: "disable", 16980 value: function disable() { 16981 this.disabled = true; 16982 return this; 16983 } 16984 /** 16985 * Sets glide into a active status. 16986 * 16987 * @return {Glide} 16988 */ 16989 }, { 16990 key: "enable", 16991 value: function enable() { 16992 this.disabled = false; 16993 return this; 16994 } 16995 /** 16996 * Adds cuutom event listener with handler. 16997 * 16998 * @param {String|Array} event 16999 * @param {Function} handler 17000 * @return {Glide} 17001 */ 17002 }, { 17003 key: "on", 17004 value: function on(event, handler) { 17005 this._e.on(event, handler); 17006 return this; 17007 } 17008 /** 17009 * Checks if glide is a precised type. 17010 * 17011 * @param {String} name 17012 * @return {Boolean} 17013 */ 17014 }, { 17015 key: "isType", 17016 value: function isType(name) { 17017 return this.settings.type === name; 17018 } 17019 /** 17020 * Gets value of the core options. 17021 * 17022 * @return {Object} 17023 */ 17024 }, { 17025 key: "settings", 17026 get: function get2() { 17027 return this._o; 17028 }, 17029 set: function set(o2) { 17030 if (isObject(o2)) { 17031 this._o = o2; 17032 } else { 17033 warn2("Options must be an `object` instance."); 17034 } 17035 } 17036 /** 17037 * Gets current index of the slider. 17038 * 17039 * @return {Object} 17040 */ 17041 }, { 17042 key: "index", 17043 get: function get2() { 17044 return this._i; 17045 }, 17046 set: function set(i) { 17047 this._i = toInt(i); 17048 } 17049 /** 17050 * Gets type name of the slider. 17051 * 17052 * @return {String} 17053 */ 17054 }, { 17055 key: "type", 17056 get: function get2() { 17057 return this.settings.type; 17058 } 17059 /** 17060 * Gets value of the idle status. 17061 * 17062 * @return {Boolean} 17063 */ 17064 }, { 17065 key: "disabled", 17066 get: function get2() { 17067 return this._d; 17068 }, 17069 set: function set(status) { 17070 this._d = !!status; 17071 } 17072 }]); 17073 return Glide2; 17074 })(); 17075 function Run(Glide2, Components, Events) { 17076 var Run2 = { 17077 /** 17078 * Initializes autorunning of the glide. 17079 * 17080 * @return {Void} 17081 */ 17082 mount: function mount2() { 17083 this._o = false; 17084 }, 17085 /** 17086 * Makes glides running based on the passed moving schema. 17087 * 17088 * @param {String} move 17089 */ 17090 make: function make(move) { 17091 var _this = this; 17092 if (!Glide2.disabled) { 17093 !Glide2.settings.waitForTransition || Glide2.disable(); 17094 this.move = move; 17095 Events.emit("run.before", this.move); 17096 this.calculate(); 17097 Events.emit("run", this.move); 17098 Components.Transition.after(function() { 17099 if (_this.isStart()) { 17100 Events.emit("run.start", _this.move); 17101 } 17102 if (_this.isEnd()) { 17103 Events.emit("run.end", _this.move); 17104 } 17105 if (_this.isOffset()) { 17106 _this._o = false; 17107 Events.emit("run.offset", _this.move); 17108 } 17109 Events.emit("run.after", _this.move); 17110 Glide2.enable(); 17111 }); 17112 } 17113 }, 17114 /** 17115 * Calculates current index based on defined move. 17116 * 17117 * @return {Number|Undefined} 17118 */ 17119 calculate: function calculate() { 17120 var move = this.move, length = this.length; 17121 var steps = move.steps, direction = move.direction; 17122 var viewSize = 1; 17123 if (direction === "=") { 17124 if (Glide2.settings.bound && toInt(steps) > length) { 17125 Glide2.index = length; 17126 return; 17127 } 17128 Glide2.index = steps; 17129 return; 17130 } 17131 if (direction === ">" && steps === ">") { 17132 Glide2.index = length; 17133 return; 17134 } 17135 if (direction === "<" && steps === "<") { 17136 Glide2.index = 0; 17137 return; 17138 } 17139 if (direction === "|") { 17140 viewSize = Glide2.settings.perView || 1; 17141 } 17142 if (direction === ">" || direction === "|" && steps === ">") { 17143 var index = calculateForwardIndex(viewSize); 17144 if (index > length) { 17145 this._o = true; 17146 } 17147 Glide2.index = normalizeForwardIndex(index, viewSize); 17148 return; 17149 } 17150 if (direction === "<" || direction === "|" && steps === "<") { 17151 var _index = calculateBackwardIndex(viewSize); 17152 if (_index < 0) { 17153 this._o = true; 17154 } 17155 Glide2.index = normalizeBackwardIndex(_index, viewSize); 17156 return; 17157 } 17158 warn2("Invalid direction pattern [".concat(direction).concat(steps, "] has been used")); 17159 }, 17160 /** 17161 * Checks if we are on the first slide. 17162 * 17163 * @return {Boolean} 17164 */ 17165 isStart: function isStart() { 17166 return Glide2.index <= 0; 17167 }, 17168 /** 17169 * Checks if we are on the last slide. 17170 * 17171 * @return {Boolean} 17172 */ 17173 isEnd: function isEnd() { 17174 return Glide2.index >= this.length; 17175 }, 17176 /** 17177 * Checks if we are making a offset run. 17178 * 17179 * @param {String} direction 17180 * @return {Boolean} 17181 */ 17182 isOffset: function isOffset() { 17183 var direction = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : void 0; 17184 if (!direction) { 17185 return this._o; 17186 } 17187 if (!this._o) { 17188 return false; 17189 } 17190 if (direction === "|>") { 17191 return this.move.direction === "|" && this.move.steps === ">"; 17192 } 17193 if (direction === "|<") { 17194 return this.move.direction === "|" && this.move.steps === "<"; 17195 } 17196 return this.move.direction === direction; 17197 }, 17198 /** 17199 * Checks if bound mode is active 17200 * 17201 * @return {Boolean} 17202 */ 17203 isBound: function isBound() { 17204 return Glide2.isType("slider") && Glide2.settings.focusAt !== "center" && Glide2.settings.bound; 17205 } 17206 }; 17207 function calculateForwardIndex(viewSize) { 17208 var index = Glide2.index; 17209 if (Glide2.isType("carousel")) { 17210 return index + viewSize; 17211 } 17212 return index + (viewSize - index % viewSize); 17213 } 17214 function normalizeForwardIndex(index, viewSize) { 17215 var length = Run2.length; 17216 if (index <= length) { 17217 return index; 17218 } 17219 if (Glide2.isType("carousel")) { 17220 return index - (length + 1); 17221 } 17222 if (Glide2.settings.rewind) { 17223 if (Run2.isBound() && !Run2.isEnd()) { 17224 return length; 17225 } 17226 return 0; 17227 } 17228 if (Run2.isBound()) { 17229 return length; 17230 } 17231 return Math.floor(length / viewSize) * viewSize; 17232 } 17233 function calculateBackwardIndex(viewSize) { 17234 var index = Glide2.index; 17235 if (Glide2.isType("carousel")) { 17236 return index - viewSize; 17237 } 17238 var view = Math.ceil(index / viewSize); 17239 return (view - 1) * viewSize; 17240 } 17241 function normalizeBackwardIndex(index, viewSize) { 17242 var length = Run2.length; 17243 if (index >= 0) { 17244 return index; 17245 } 17246 if (Glide2.isType("carousel")) { 17247 return index + (length + 1); 17248 } 17249 if (Glide2.settings.rewind) { 17250 if (Run2.isBound() && Run2.isStart()) { 17251 return length; 17252 } 17253 return Math.floor(length / viewSize) * viewSize; 17254 } 17255 return 0; 17256 } 17257 define2(Run2, "move", { 17258 /** 17259 * Gets value of the move schema. 17260 * 17261 * @returns {Object} 17262 */ 17263 get: function get2() { 17264 return this._m; 17265 }, 17266 /** 17267 * Sets value of the move schema. 17268 * 17269 * @returns {Object} 17270 */ 17271 set: function set(value) { 17272 var step = value.substr(1); 17273 this._m = { 17274 direction: value.substr(0, 1), 17275 steps: step ? toInt(step) ? toInt(step) : step : 0 17276 }; 17277 } 17278 }); 17279 define2(Run2, "length", { 17280 /** 17281 * Gets value of the running distance based 17282 * on zero-indexing number of slides. 17283 * 17284 * @return {Number} 17285 */ 17286 get: function get2() { 17287 var settings2 = Glide2.settings; 17288 var length = Components.Html.slides.length; 17289 if (this.isBound()) { 17290 return length - 1 - (toInt(settings2.perView) - 1) + toInt(settings2.focusAt); 17291 } 17292 return length - 1; 17293 } 17294 }); 17295 define2(Run2, "offset", { 17296 /** 17297 * Gets status of the offsetting flag. 17298 * 17299 * @return {Boolean} 17300 */ 17301 get: function get2() { 17302 return this._o; 17303 } 17304 }); 17305 return Run2; 17306 } 17307 function now() { 17308 return (/* @__PURE__ */ new Date()).getTime(); 17309 } 17310 function throttle(func, wait, options) { 17311 var timeout, context, args, result; 17312 var previous = 0; 17313 if (!options) options = {}; 17314 var later = function later2() { 17315 previous = options.leading === false ? 0 : now(); 17316 timeout = null; 17317 result = func.apply(context, args); 17318 if (!timeout) context = args = null; 17319 }; 17320 var throttled = function throttled2() { 17321 var at = now(); 17322 if (!previous && options.leading === false) previous = at; 17323 var remaining = wait - (at - previous); 17324 context = this; 17325 args = arguments; 17326 if (remaining <= 0 || remaining > wait) { 17327 if (timeout) { 17328 clearTimeout(timeout); 17329 timeout = null; 17330 } 17331 previous = at; 17332 result = func.apply(context, args); 17333 if (!timeout) context = args = null; 17334 } else if (!timeout && options.trailing !== false) { 17335 timeout = setTimeout(later, remaining); 17336 } 17337 return result; 17338 }; 17339 throttled.cancel = function() { 17340 clearTimeout(timeout); 17341 previous = 0; 17342 timeout = context = args = null; 17343 }; 17344 return throttled; 17345 } 17346 var MARGIN_TYPE = { 17347 ltr: ["marginLeft", "marginRight"], 17348 rtl: ["marginRight", "marginLeft"] 17349 }; 17350 function Gaps(Glide2, Components, Events) { 17351 var Gaps2 = { 17352 /** 17353 * Applies gaps between slides. First and last 17354 * slides do not receive it's edge margins. 17355 * 17356 * @param {HTMLCollection} slides 17357 * @return {Void} 17358 */ 17359 apply: function apply(slides) { 17360 for (var i = 0, len = slides.length; i < len; i++) { 17361 var style = slides[i].style; 17362 var direction = Components.Direction.value; 17363 if (i !== 0) { 17364 style[MARGIN_TYPE[direction][0]] = "".concat(this.value / 2, "px"); 17365 } else { 17366 style[MARGIN_TYPE[direction][0]] = ""; 17367 } 17368 if (i !== slides.length - 1) { 17369 style[MARGIN_TYPE[direction][1]] = "".concat(this.value / 2, "px"); 17370 } else { 17371 style[MARGIN_TYPE[direction][1]] = ""; 17372 } 17373 } 17374 }, 17375 /** 17376 * Removes gaps from the slides. 17377 * 17378 * @param {HTMLCollection} slides 17379 * @returns {Void} 17380 */ 17381 remove: function remove2(slides) { 17382 for (var i = 0, len = slides.length; i < len; i++) { 17383 var style = slides[i].style; 17384 style.marginLeft = ""; 17385 style.marginRight = ""; 17386 } 17387 } 17388 }; 17389 define2(Gaps2, "value", { 17390 /** 17391 * Gets value of the gap. 17392 * 17393 * @returns {Number} 17394 */ 17395 get: function get2() { 17396 return toInt(Glide2.settings.gap); 17397 } 17398 }); 17399 define2(Gaps2, "grow", { 17400 /** 17401 * Gets additional dimensions value caused by gaps. 17402 * Used to increase width of the slides wrapper. 17403 * 17404 * @returns {Number} 17405 */ 17406 get: function get2() { 17407 return Gaps2.value * Components.Sizes.length; 17408 } 17409 }); 17410 define2(Gaps2, "reductor", { 17411 /** 17412 * Gets reduction value caused by gaps. 17413 * Used to subtract width of the slides. 17414 * 17415 * @returns {Number} 17416 */ 17417 get: function get2() { 17418 var perView = Glide2.settings.perView; 17419 return Gaps2.value * (perView - 1) / perView; 17420 } 17421 }); 17422 Events.on(["build.after", "update"], throttle(function() { 17423 Gaps2.apply(Components.Html.wrapper.children); 17424 }, 30)); 17425 Events.on("destroy", function() { 17426 Gaps2.remove(Components.Html.wrapper.children); 17427 }); 17428 return Gaps2; 17429 } 17430 function siblings(node) { 17431 if (node && node.parentNode) { 17432 var n = node.parentNode.firstChild; 17433 var matched = []; 17434 for (; n; n = n.nextSibling) { 17435 if (n.nodeType === 1 && n !== node) { 17436 matched.push(n); 17437 } 17438 } 17439 return matched; 17440 } 17441 return []; 17442 } 17443 function exist(node) { 17444 if (node && node instanceof window.HTMLElement) { 17445 return true; 17446 } 17447 return false; 17448 } 17449 function toArray(nodeList) { 17450 return Array.prototype.slice.call(nodeList); 17451 } 17452 var TRACK_SELECTOR = '[data-glide-el="track"]'; 17453 function Html(Glide2, Components, Events) { 17454 var Html2 = { 17455 /** 17456 * Setup slider HTML nodes. 17457 * 17458 * @param {Glide} glide 17459 */ 17460 mount: function mount2() { 17461 this.root = Glide2.selector; 17462 this.track = this.root.querySelector(TRACK_SELECTOR); 17463 this.collectSlides(); 17464 }, 17465 /** 17466 * Collect slides 17467 */ 17468 collectSlides: function collectSlides() { 17469 this.slides = toArray(this.wrapper.children).filter(function(slide) { 17470 return !slide.classList.contains(Glide2.settings.classes.slide.clone); 17471 }); 17472 } 17473 }; 17474 define2(Html2, "root", { 17475 /** 17476 * Gets node of the glide main element. 17477 * 17478 * @return {Object} 17479 */ 17480 get: function get2() { 17481 return Html2._r; 17482 }, 17483 /** 17484 * Sets node of the glide main element. 17485 * 17486 * @return {Object} 17487 */ 17488 set: function set(r) { 17489 if (isString(r)) { 17490 r = document.querySelector(r); 17491 } 17492 if (exist(r)) { 17493 Html2._r = r; 17494 } else { 17495 warn2("Root element must be a existing Html node"); 17496 } 17497 } 17498 }); 17499 define2(Html2, "track", { 17500 /** 17501 * Gets node of the glide track with slides. 17502 * 17503 * @return {Object} 17504 */ 17505 get: function get2() { 17506 return Html2._t; 17507 }, 17508 /** 17509 * Sets node of the glide track with slides. 17510 * 17511 * @return {Object} 17512 */ 17513 set: function set(t3) { 17514 if (exist(t3)) { 17515 Html2._t = t3; 17516 } else { 17517 warn2("Could not find track element. Please use ".concat(TRACK_SELECTOR, " attribute.")); 17518 } 17519 } 17520 }); 17521 define2(Html2, "wrapper", { 17522 /** 17523 * Gets node of the slides wrapper. 17524 * 17525 * @return {Object} 17526 */ 17527 get: function get2() { 17528 return Html2.track.children[0]; 17529 } 17530 }); 17531 Events.on("update", function() { 17532 Html2.collectSlides(); 17533 }); 17534 return Html2; 17535 } 17536 function Peek(Glide2, Components, Events) { 17537 var Peek2 = { 17538 /** 17539 * Setups how much to peek based on settings. 17540 * 17541 * @return {Void} 17542 */ 17543 mount: function mount2() { 17544 this.value = Glide2.settings.peek; 17545 } 17546 }; 17547 define2(Peek2, "value", { 17548 /** 17549 * Gets value of the peek. 17550 * 17551 * @returns {Number|Object} 17552 */ 17553 get: function get2() { 17554 return Peek2._v; 17555 }, 17556 /** 17557 * Sets value of the peek. 17558 * 17559 * @param {Number|Object} value 17560 * @return {Void} 17561 */ 17562 set: function set(value) { 17563 if (isObject(value)) { 17564 value.before = toInt(value.before); 17565 value.after = toInt(value.after); 17566 } else { 17567 value = toInt(value); 17568 } 17569 Peek2._v = value; 17570 } 17571 }); 17572 define2(Peek2, "reductor", { 17573 /** 17574 * Gets reduction value caused by peek. 17575 * 17576 * @returns {Number} 17577 */ 17578 get: function get2() { 17579 var value = Peek2.value; 17580 var perView = Glide2.settings.perView; 17581 if (isObject(value)) { 17582 return value.before / perView + value.after / perView; 17583 } 17584 return value * 2 / perView; 17585 } 17586 }); 17587 Events.on(["resize", "update"], function() { 17588 Peek2.mount(); 17589 }); 17590 return Peek2; 17591 } 17592 function Move(Glide2, Components, Events) { 17593 var Move2 = { 17594 /** 17595 * Constructs move component. 17596 * 17597 * @returns {Void} 17598 */ 17599 mount: function mount2() { 17600 this._o = 0; 17601 }, 17602 /** 17603 * Calculates a movement value based on passed offset and currently active index. 17604 * 17605 * @param {Number} offset 17606 * @return {Void} 17607 */ 17608 make: function make() { 17609 var _this = this; 17610 var offset = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0; 17611 this.offset = offset; 17612 Events.emit("move", { 17613 movement: this.value 17614 }); 17615 Components.Transition.after(function() { 17616 Events.emit("move.after", { 17617 movement: _this.value 17618 }); 17619 }); 17620 } 17621 }; 17622 define2(Move2, "offset", { 17623 /** 17624 * Gets an offset value used to modify current translate. 17625 * 17626 * @return {Object} 17627 */ 17628 get: function get2() { 17629 return Move2._o; 17630 }, 17631 /** 17632 * Sets an offset value used to modify current translate. 17633 * 17634 * @return {Object} 17635 */ 17636 set: function set(value) { 17637 Move2._o = !isUndefined(value) ? toInt(value) : 0; 17638 } 17639 }); 17640 define2(Move2, "translate", { 17641 /** 17642 * Gets a raw movement value. 17643 * 17644 * @return {Number} 17645 */ 17646 get: function get2() { 17647 return Components.Sizes.slideWidth * Glide2.index; 17648 } 17649 }); 17650 define2(Move2, "value", { 17651 /** 17652 * Gets an actual movement value corrected by offset. 17653 * 17654 * @return {Number} 17655 */ 17656 get: function get2() { 17657 var offset = this.offset; 17658 var translate = this.translate; 17659 if (Components.Direction.is("rtl")) { 17660 return translate + offset; 17661 } 17662 return translate - offset; 17663 } 17664 }); 17665 Events.on(["build.before", "run"], function() { 17666 Move2.make(); 17667 }); 17668 return Move2; 17669 } 17670 function Sizes(Glide2, Components, Events) { 17671 var Sizes2 = { 17672 /** 17673 * Setups dimensions of slides. 17674 * 17675 * @return {Void} 17676 */ 17677 setupSlides: function setupSlides() { 17678 var width = "".concat(this.slideWidth, "px"); 17679 var slides = Components.Html.slides; 17680 for (var i = 0; i < slides.length; i++) { 17681 slides[i].style.width = width; 17682 } 17683 }, 17684 /** 17685 * Setups dimensions of slides wrapper. 17686 * 17687 * @return {Void} 17688 */ 17689 setupWrapper: function setupWrapper() { 17690 Components.Html.wrapper.style.width = "".concat(this.wrapperSize, "px"); 17691 }, 17692 /** 17693 * Removes applied styles from HTML elements. 17694 * 17695 * @returns {Void} 17696 */ 17697 remove: function remove2() { 17698 var slides = Components.Html.slides; 17699 for (var i = 0; i < slides.length; i++) { 17700 slides[i].style.width = ""; 17701 } 17702 Components.Html.wrapper.style.width = ""; 17703 } 17704 }; 17705 define2(Sizes2, "length", { 17706 /** 17707 * Gets count number of the slides. 17708 * 17709 * @return {Number} 17710 */ 17711 get: function get2() { 17712 return Components.Html.slides.length; 17713 } 17714 }); 17715 define2(Sizes2, "width", { 17716 /** 17717 * Gets width value of the slider (visible area). 17718 * 17719 * @return {Number} 17720 */ 17721 get: function get2() { 17722 return Components.Html.track.offsetWidth; 17723 } 17724 }); 17725 define2(Sizes2, "wrapperSize", { 17726 /** 17727 * Gets size of the slides wrapper. 17728 * 17729 * @return {Number} 17730 */ 17731 get: function get2() { 17732 return Sizes2.slideWidth * Sizes2.length + Components.Gaps.grow + Components.Clones.grow; 17733 } 17734 }); 17735 define2(Sizes2, "slideWidth", { 17736 /** 17737 * Gets width value of a single slide. 17738 * 17739 * @return {Number} 17740 */ 17741 get: function get2() { 17742 return Sizes2.width / Glide2.settings.perView - Components.Peek.reductor - Components.Gaps.reductor; 17743 } 17744 }); 17745 Events.on(["build.before", "resize", "update"], function() { 17746 Sizes2.setupSlides(); 17747 Sizes2.setupWrapper(); 17748 }); 17749 Events.on("destroy", function() { 17750 Sizes2.remove(); 17751 }); 17752 return Sizes2; 17753 } 17754 function Build(Glide2, Components, Events) { 17755 var Build2 = { 17756 /** 17757 * Init glide building. Adds classes, sets 17758 * dimensions and setups initial state. 17759 * 17760 * @return {Void} 17761 */ 17762 mount: function mount2() { 17763 Events.emit("build.before"); 17764 this.typeClass(); 17765 this.activeClass(); 17766 Events.emit("build.after"); 17767 }, 17768 /** 17769 * Adds `type` class to the glide element. 17770 * 17771 * @return {Void} 17772 */ 17773 typeClass: function typeClass() { 17774 Components.Html.root.classList.add(Glide2.settings.classes.type[Glide2.settings.type]); 17775 }, 17776 /** 17777 * Sets active class to current slide. 17778 * 17779 * @return {Void} 17780 */ 17781 activeClass: function activeClass() { 17782 var classes = Glide2.settings.classes; 17783 var slide = Components.Html.slides[Glide2.index]; 17784 if (slide) { 17785 slide.classList.add(classes.slide.active); 17786 siblings(slide).forEach(function(sibling) { 17787 sibling.classList.remove(classes.slide.active); 17788 }); 17789 } 17790 }, 17791 /** 17792 * Removes HTML classes applied at building. 17793 * 17794 * @return {Void} 17795 */ 17796 removeClasses: function removeClasses() { 17797 var _Glide$settings$class = Glide2.settings.classes, type = _Glide$settings$class.type, slide = _Glide$settings$class.slide; 17798 Components.Html.root.classList.remove(type[Glide2.settings.type]); 17799 Components.Html.slides.forEach(function(sibling) { 17800 sibling.classList.remove(slide.active); 17801 }); 17802 } 17803 }; 17804 Events.on(["destroy", "update"], function() { 17805 Build2.removeClasses(); 17806 }); 17807 Events.on(["resize", "update"], function() { 17808 Build2.mount(); 17809 }); 17810 Events.on("move.after", function() { 17811 Build2.activeClass(); 17812 }); 17813 return Build2; 17814 } 17815 function Clones(Glide2, Components, Events) { 17816 var Clones2 = { 17817 /** 17818 * Create pattern map and collect slides to be cloned. 17819 */ 17820 mount: function mount2() { 17821 this.items = []; 17822 if (Glide2.isType("carousel")) { 17823 this.items = this.collect(); 17824 } 17825 }, 17826 /** 17827 * Collect clones with pattern. 17828 * 17829 * @return {[]} 17830 */ 17831 collect: function collect() { 17832 var items = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : []; 17833 var slides = Components.Html.slides; 17834 var _Glide$settings = Glide2.settings, perView = _Glide$settings.perView, classes = _Glide$settings.classes, cloningRatio = _Glide$settings.cloningRatio; 17835 if (slides.length !== 0) { 17836 var peekIncrementer = +!!Glide2.settings.peek; 17837 var cloneCount = perView + peekIncrementer + Math.round(perView / 2); 17838 var append = slides.slice(0, cloneCount).reverse(); 17839 var prepend = slides.slice(cloneCount * -1); 17840 for (var r = 0; r < Math.max(cloningRatio, Math.floor(perView / slides.length)); r++) { 17841 for (var i = 0; i < append.length; i++) { 17842 var clone = append[i].cloneNode(true); 17843 clone.classList.add(classes.slide.clone); 17844 items.push(clone); 17845 } 17846 for (var _i = 0; _i < prepend.length; _i++) { 17847 var _clone = prepend[_i].cloneNode(true); 17848 _clone.classList.add(classes.slide.clone); 17849 items.unshift(_clone); 17850 } 17851 } 17852 } 17853 return items; 17854 }, 17855 /** 17856 * Append cloned slides with generated pattern. 17857 * 17858 * @return {Void} 17859 */ 17860 append: function append() { 17861 var items = this.items; 17862 var _Components$Html = Components.Html, wrapper = _Components$Html.wrapper, slides = _Components$Html.slides; 17863 var half = Math.floor(items.length / 2); 17864 var prepend = items.slice(0, half).reverse(); 17865 var append2 = items.slice(half * -1).reverse(); 17866 var width = "".concat(Components.Sizes.slideWidth, "px"); 17867 for (var i = 0; i < append2.length; i++) { 17868 wrapper.appendChild(append2[i]); 17869 } 17870 for (var _i2 = 0; _i2 < prepend.length; _i2++) { 17871 wrapper.insertBefore(prepend[_i2], slides[0]); 17872 } 17873 for (var _i3 = 0; _i3 < items.length; _i3++) { 17874 items[_i3].style.width = width; 17875 } 17876 }, 17877 /** 17878 * Remove all cloned slides. 17879 * 17880 * @return {Void} 17881 */ 17882 remove: function remove2() { 17883 var items = this.items; 17884 for (var i = 0; i < items.length; i++) { 17885 Components.Html.wrapper.removeChild(items[i]); 17886 } 17887 } 17888 }; 17889 define2(Clones2, "grow", { 17890 /** 17891 * Gets additional dimensions value caused by clones. 17892 * 17893 * @return {Number} 17894 */ 17895 get: function get2() { 17896 return (Components.Sizes.slideWidth + Components.Gaps.value) * Clones2.items.length; 17897 } 17898 }); 17899 Events.on("update", function() { 17900 Clones2.remove(); 17901 Clones2.mount(); 17902 Clones2.append(); 17903 }); 17904 Events.on("build.before", function() { 17905 if (Glide2.isType("carousel")) { 17906 Clones2.append(); 17907 } 17908 }); 17909 Events.on("destroy", function() { 17910 Clones2.remove(); 17911 }); 17912 return Clones2; 17913 } 17914 var EventsBinder = /* @__PURE__ */ (function() { 17915 function EventsBinder2() { 17916 var listeners = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; 17917 _classCallCheck2(this, EventsBinder2); 17918 this.listeners = listeners; 17919 } 17920 _createClass2(EventsBinder2, [{ 17921 key: "on", 17922 value: function on(events, el, closure) { 17923 var capture = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false; 17924 if (isString(events)) { 17925 events = [events]; 17926 } 17927 for (var i = 0; i < events.length; i++) { 17928 this.listeners[events[i]] = closure; 17929 el.addEventListener(events[i], this.listeners[events[i]], capture); 17930 } 17931 } 17932 /** 17933 * Removes event listeners from arrows HTML elements. 17934 * 17935 * @param {String|Array} events 17936 * @param {Element|Window|Document} el 17937 * @param {Boolean|Object} capture 17938 * @return {Void} 17939 */ 17940 }, { 17941 key: "off", 17942 value: function off(events, el) { 17943 var capture = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false; 17944 if (isString(events)) { 17945 events = [events]; 17946 } 17947 for (var i = 0; i < events.length; i++) { 17948 el.removeEventListener(events[i], this.listeners[events[i]], capture); 17949 } 17950 } 17951 /** 17952 * Destroy collected listeners. 17953 * 17954 * @returns {Void} 17955 */ 17956 }, { 17957 key: "destroy", 17958 value: function destroy() { 17959 delete this.listeners; 17960 } 17961 }]); 17962 return EventsBinder2; 17963 })(); 17964 function Resize(Glide2, Components, Events) { 17965 var Binder = new EventsBinder(); 17966 var Resize2 = { 17967 /** 17968 * Initializes window bindings. 17969 */ 17970 mount: function mount2() { 17971 this.bind(); 17972 }, 17973 /** 17974 * Binds `rezsize` listener to the window. 17975 * It's a costly event, so we are debouncing it. 17976 * 17977 * @return {Void} 17978 */ 17979 bind: function bind() { 17980 Binder.on("resize", window, throttle(function() { 17981 Events.emit("resize"); 17982 }, Glide2.settings.throttle)); 17983 }, 17984 /** 17985 * Unbinds listeners from the window. 17986 * 17987 * @return {Void} 17988 */ 17989 unbind: function unbind() { 17990 Binder.off("resize", window); 17991 } 17992 }; 17993 Events.on("destroy", function() { 17994 Resize2.unbind(); 17995 Binder.destroy(); 17996 }); 17997 return Resize2; 17998 } 17999 var VALID_DIRECTIONS = ["ltr", "rtl"]; 18000 var FLIPED_MOVEMENTS = { 18001 ">": "<", 18002 "<": ">", 18003 "=": "=" 18004 }; 18005 function Direction(Glide2, Components, Events) { 18006 var Direction2 = { 18007 /** 18008 * Setups gap value based on settings. 18009 * 18010 * @return {Void} 18011 */ 18012 mount: function mount2() { 18013 this.value = Glide2.settings.direction; 18014 }, 18015 /** 18016 * Resolves pattern based on direction value 18017 * 18018 * @param {String} pattern 18019 * @returns {String} 18020 */ 18021 resolve: function resolve(pattern) { 18022 var token = pattern.slice(0, 1); 18023 if (this.is("rtl")) { 18024 return pattern.split(token).join(FLIPED_MOVEMENTS[token]); 18025 } 18026 return pattern; 18027 }, 18028 /** 18029 * Checks value of direction mode. 18030 * 18031 * @param {String} direction 18032 * @returns {Boolean} 18033 */ 18034 is: function is(direction) { 18035 return this.value === direction; 18036 }, 18037 /** 18038 * Applies direction class to the root HTML element. 18039 * 18040 * @return {Void} 18041 */ 18042 addClass: function addClass() { 18043 Components.Html.root.classList.add(Glide2.settings.classes.direction[this.value]); 18044 }, 18045 /** 18046 * Removes direction class from the root HTML element. 18047 * 18048 * @return {Void} 18049 */ 18050 removeClass: function removeClass() { 18051 Components.Html.root.classList.remove(Glide2.settings.classes.direction[this.value]); 18052 } 18053 }; 18054 define2(Direction2, "value", { 18055 /** 18056 * Gets value of the direction. 18057 * 18058 * @returns {Number} 18059 */ 18060 get: function get2() { 18061 return Direction2._v; 18062 }, 18063 /** 18064 * Sets value of the direction. 18065 * 18066 * @param {String} value 18067 * @return {Void} 18068 */ 18069 set: function set(value) { 18070 if (VALID_DIRECTIONS.indexOf(value) > -1) { 18071 Direction2._v = value; 18072 } else { 18073 warn2("Direction value must be `ltr` or `rtl`"); 18074 } 18075 } 18076 }); 18077 Events.on(["destroy", "update"], function() { 18078 Direction2.removeClass(); 18079 }); 18080 Events.on("update", function() { 18081 Direction2.mount(); 18082 }); 18083 Events.on(["build.before", "update"], function() { 18084 Direction2.addClass(); 18085 }); 18086 return Direction2; 18087 } 18088 function Rtl(Glide2, Components) { 18089 return { 18090 /** 18091 * Negates the passed translate if glide is in RTL option. 18092 * 18093 * @param {Number} translate 18094 * @return {Number} 18095 */ 18096 modify: function modify(translate) { 18097 if (Components.Direction.is("rtl")) { 18098 return -translate; 18099 } 18100 return translate; 18101 } 18102 }; 18103 } 18104 function Gap(Glide2, Components) { 18105 return { 18106 /** 18107 * Modifies passed translate value with number in the `gap` settings. 18108 * 18109 * @param {Number} translate 18110 * @return {Number} 18111 */ 18112 modify: function modify(translate) { 18113 var multiplier = Math.floor(translate / Components.Sizes.slideWidth); 18114 return translate + Components.Gaps.value * multiplier; 18115 } 18116 }; 18117 } 18118 function Grow(Glide2, Components) { 18119 return { 18120 /** 18121 * Adds to the passed translate width of the half of clones. 18122 * 18123 * @param {Number} translate 18124 * @return {Number} 18125 */ 18126 modify: function modify(translate) { 18127 return translate + Components.Clones.grow / 2; 18128 } 18129 }; 18130 } 18131 function Peeking(Glide2, Components) { 18132 return { 18133 /** 18134 * Modifies passed translate value with a `peek` setting. 18135 * 18136 * @param {Number} translate 18137 * @return {Number} 18138 */ 18139 modify: function modify(translate) { 18140 if (Glide2.settings.focusAt >= 0) { 18141 var peek = Components.Peek.value; 18142 if (isObject(peek)) { 18143 return translate - peek.before; 18144 } 18145 return translate - peek; 18146 } 18147 return translate; 18148 } 18149 }; 18150 } 18151 function Focusing(Glide2, Components) { 18152 return { 18153 /** 18154 * Modifies passed translate value with index in the `focusAt` setting. 18155 * 18156 * @param {Number} translate 18157 * @return {Number} 18158 */ 18159 modify: function modify(translate) { 18160 var gap = Components.Gaps.value; 18161 var width = Components.Sizes.width; 18162 var focusAt = Glide2.settings.focusAt; 18163 var slideWidth = Components.Sizes.slideWidth; 18164 if (focusAt === "center") { 18165 return translate - (width / 2 - slideWidth / 2); 18166 } 18167 return translate - slideWidth * focusAt - gap * focusAt; 18168 } 18169 }; 18170 } 18171 function mutator(Glide2, Components, Events) { 18172 var TRANSFORMERS = [Gap, Grow, Peeking, Focusing].concat(Glide2._t, [Rtl]); 18173 return { 18174 /** 18175 * Piplines translate value with registered transformers. 18176 * 18177 * @param {Number} translate 18178 * @return {Number} 18179 */ 18180 mutate: function mutate(translate) { 18181 for (var i = 0; i < TRANSFORMERS.length; i++) { 18182 var transformer = TRANSFORMERS[i]; 18183 if (isFunction(transformer) && isFunction(transformer().modify)) { 18184 translate = transformer(Glide2, Components, Events).modify(translate); 18185 } else { 18186 warn2("Transformer should be a function that returns an object with `modify()` method"); 18187 } 18188 } 18189 return translate; 18190 } 18191 }; 18192 } 18193 function Translate(Glide2, Components, Events) { 18194 var Translate2 = { 18195 /** 18196 * Sets value of translate on HTML element. 18197 * 18198 * @param {Number} value 18199 * @return {Void} 18200 */ 18201 set: function set(value) { 18202 var transform = mutator(Glide2, Components).mutate(value); 18203 var translate3d = "translate3d(".concat(-1 * transform, "px, 0px, 0px)"); 18204 Components.Html.wrapper.style.mozTransform = translate3d; 18205 Components.Html.wrapper.style.webkitTransform = translate3d; 18206 Components.Html.wrapper.style.transform = translate3d; 18207 }, 18208 /** 18209 * Removes value of translate from HTML element. 18210 * 18211 * @return {Void} 18212 */ 18213 remove: function remove2() { 18214 Components.Html.wrapper.style.transform = ""; 18215 }, 18216 /** 18217 * @return {number} 18218 */ 18219 getStartIndex: function getStartIndex() { 18220 var length = Components.Sizes.length; 18221 var index = Glide2.index; 18222 var perView = Glide2.settings.perView; 18223 if (Components.Run.isOffset(">") || Components.Run.isOffset("|>")) { 18224 return length + (index - perView); 18225 } 18226 return (index + perView) % length; 18227 }, 18228 /** 18229 * @return {number} 18230 */ 18231 getTravelDistance: function getTravelDistance() { 18232 var travelDistance = Components.Sizes.slideWidth * Glide2.settings.perView; 18233 if (Components.Run.isOffset(">") || Components.Run.isOffset("|>")) { 18234 return travelDistance * -1; 18235 } 18236 return travelDistance; 18237 } 18238 }; 18239 Events.on("move", function(context) { 18240 if (!Glide2.isType("carousel") || !Components.Run.isOffset()) { 18241 return Translate2.set(context.movement); 18242 } 18243 Components.Transition.after(function() { 18244 Events.emit("translate.jump"); 18245 Translate2.set(Components.Sizes.slideWidth * Glide2.index); 18246 }); 18247 var startWidth = Components.Sizes.slideWidth * Components.Translate.getStartIndex(); 18248 return Translate2.set(startWidth - Components.Translate.getTravelDistance()); 18249 }); 18250 Events.on("destroy", function() { 18251 Translate2.remove(); 18252 }); 18253 return Translate2; 18254 } 18255 function Transition(Glide2, Components, Events) { 18256 var disabled = false; 18257 var Transition2 = { 18258 /** 18259 * Composes string of the CSS transition. 18260 * 18261 * @param {String} property 18262 * @return {String} 18263 */ 18264 compose: function compose(property) { 18265 var settings2 = Glide2.settings; 18266 if (!disabled) { 18267 return "".concat(property, " ").concat(this.duration, "ms ").concat(settings2.animationTimingFunc); 18268 } 18269 return "".concat(property, " 0ms ").concat(settings2.animationTimingFunc); 18270 }, 18271 /** 18272 * Sets value of transition on HTML element. 18273 * 18274 * @param {String=} property 18275 * @return {Void} 18276 */ 18277 set: function set() { 18278 var property = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "transform"; 18279 Components.Html.wrapper.style.transition = this.compose(property); 18280 }, 18281 /** 18282 * Removes value of transition from HTML element. 18283 * 18284 * @return {Void} 18285 */ 18286 remove: function remove2() { 18287 Components.Html.wrapper.style.transition = ""; 18288 }, 18289 /** 18290 * Runs callback after animation. 18291 * 18292 * @param {Function} callback 18293 * @return {Void} 18294 */ 18295 after: function after(callback) { 18296 setTimeout(function() { 18297 callback(); 18298 }, this.duration); 18299 }, 18300 /** 18301 * Enable transition. 18302 * 18303 * @return {Void} 18304 */ 18305 enable: function enable() { 18306 disabled = false; 18307 this.set(); 18308 }, 18309 /** 18310 * Disable transition. 18311 * 18312 * @return {Void} 18313 */ 18314 disable: function disable() { 18315 disabled = true; 18316 this.set(); 18317 } 18318 }; 18319 define2(Transition2, "duration", { 18320 /** 18321 * Gets duration of the transition based 18322 * on currently running animation type. 18323 * 18324 * @return {Number} 18325 */ 18326 get: function get2() { 18327 var settings2 = Glide2.settings; 18328 if (Glide2.isType("slider") && Components.Run.offset) { 18329 return settings2.rewindDuration; 18330 } 18331 return settings2.animationDuration; 18332 } 18333 }); 18334 Events.on("move", function() { 18335 Transition2.set(); 18336 }); 18337 Events.on(["build.before", "resize", "translate.jump"], function() { 18338 Transition2.disable(); 18339 }); 18340 Events.on("run", function() { 18341 Transition2.enable(); 18342 }); 18343 Events.on("destroy", function() { 18344 Transition2.remove(); 18345 }); 18346 return Transition2; 18347 } 18348 var supportsPassive = false; 18349 try { 18350 opts = Object.defineProperty({}, "passive", { 18351 get: function get2() { 18352 supportsPassive = true; 18353 } 18354 }); 18355 window.addEventListener("testPassive", null, opts); 18356 window.removeEventListener("testPassive", null, opts); 18357 } catch (e2) { 18358 } 18359 var opts; 18360 var supportsPassive$1 = supportsPassive; 18361 var START_EVENTS = ["touchstart", "mousedown"]; 18362 var MOVE_EVENTS = ["touchmove", "mousemove"]; 18363 var END_EVENTS = ["touchend", "touchcancel", "mouseup", "mouseleave"]; 18364 var MOUSE_EVENTS = ["mousedown", "mousemove", "mouseup", "mouseleave"]; 18365 function Swipe(Glide2, Components, Events) { 18366 var Binder = new EventsBinder(); 18367 var swipeSin = 0; 18368 var swipeStartX = 0; 18369 var swipeStartY = 0; 18370 var disabled = false; 18371 var capture = supportsPassive$1 ? { 18372 passive: true 18373 } : false; 18374 var Swipe2 = { 18375 /** 18376 * Initializes swipe bindings. 18377 * 18378 * @return {Void} 18379 */ 18380 mount: function mount2() { 18381 this.bindSwipeStart(); 18382 }, 18383 /** 18384 * Handler for `swipestart` event. Calculates entry points of the user's tap. 18385 * 18386 * @param {Object} event 18387 * @return {Void} 18388 */ 18389 start: function start(event) { 18390 if (!disabled && !Glide2.disabled) { 18391 this.disable(); 18392 var swipe = this.touches(event); 18393 swipeSin = null; 18394 swipeStartX = toInt(swipe.pageX); 18395 swipeStartY = toInt(swipe.pageY); 18396 this.bindSwipeMove(); 18397 this.bindSwipeEnd(); 18398 Events.emit("swipe.start"); 18399 } 18400 }, 18401 /** 18402 * Handler for `swipemove` event. Calculates user's tap angle and distance. 18403 * 18404 * @param {Object} event 18405 */ 18406 move: function move(event) { 18407 if (!Glide2.disabled) { 18408 var _Glide$settings = Glide2.settings, touchAngle = _Glide$settings.touchAngle, touchRatio = _Glide$settings.touchRatio, classes = _Glide$settings.classes; 18409 var swipe = this.touches(event); 18410 var subExSx = toInt(swipe.pageX) - swipeStartX; 18411 var subEySy = toInt(swipe.pageY) - swipeStartY; 18412 var powEX = Math.abs(subExSx << 2); 18413 var powEY = Math.abs(subEySy << 2); 18414 var swipeHypotenuse = Math.sqrt(powEX + powEY); 18415 var swipeCathetus = Math.sqrt(powEY); 18416 swipeSin = Math.asin(swipeCathetus / swipeHypotenuse); 18417 if (swipeSin * 180 / Math.PI < touchAngle) { 18418 event.stopPropagation(); 18419 Components.Move.make(subExSx * toFloat(touchRatio)); 18420 Components.Html.root.classList.add(classes.dragging); 18421 Events.emit("swipe.move"); 18422 } else { 18423 return false; 18424 } 18425 } 18426 }, 18427 /** 18428 * Handler for `swipeend` event. Finitializes user's tap and decides about glide move. 18429 * 18430 * @param {Object} event 18431 * @return {Void} 18432 */ 18433 end: function end(event) { 18434 if (!Glide2.disabled) { 18435 var _Glide$settings2 = Glide2.settings, perSwipe = _Glide$settings2.perSwipe, touchAngle = _Glide$settings2.touchAngle, classes = _Glide$settings2.classes; 18436 var swipe = this.touches(event); 18437 var threshold = this.threshold(event); 18438 var swipeDistance = swipe.pageX - swipeStartX; 18439 var swipeDeg = swipeSin * 180 / Math.PI; 18440 this.enable(); 18441 if (swipeDistance > threshold && swipeDeg < touchAngle) { 18442 Components.Run.make(Components.Direction.resolve("".concat(perSwipe, "<"))); 18443 } else if (swipeDistance < -threshold && swipeDeg < touchAngle) { 18444 Components.Run.make(Components.Direction.resolve("".concat(perSwipe, ">"))); 18445 } else { 18446 Components.Move.make(); 18447 } 18448 Components.Html.root.classList.remove(classes.dragging); 18449 this.unbindSwipeMove(); 18450 this.unbindSwipeEnd(); 18451 Events.emit("swipe.end"); 18452 } 18453 }, 18454 /** 18455 * Binds swipe's starting event. 18456 * 18457 * @return {Void} 18458 */ 18459 bindSwipeStart: function bindSwipeStart() { 18460 var _this = this; 18461 var _Glide$settings3 = Glide2.settings, swipeThreshold = _Glide$settings3.swipeThreshold, dragThreshold = _Glide$settings3.dragThreshold; 18462 if (swipeThreshold) { 18463 Binder.on(START_EVENTS[0], Components.Html.wrapper, function(event) { 18464 _this.start(event); 18465 }, capture); 18466 } 18467 if (dragThreshold) { 18468 Binder.on(START_EVENTS[1], Components.Html.wrapper, function(event) { 18469 _this.start(event); 18470 }, capture); 18471 } 18472 }, 18473 /** 18474 * Unbinds swipe's starting event. 18475 * 18476 * @return {Void} 18477 */ 18478 unbindSwipeStart: function unbindSwipeStart() { 18479 Binder.off(START_EVENTS[0], Components.Html.wrapper, capture); 18480 Binder.off(START_EVENTS[1], Components.Html.wrapper, capture); 18481 }, 18482 /** 18483 * Binds swipe's moving event. 18484 * 18485 * @return {Void} 18486 */ 18487 bindSwipeMove: function bindSwipeMove() { 18488 var _this2 = this; 18489 Binder.on(MOVE_EVENTS, Components.Html.wrapper, throttle(function(event) { 18490 _this2.move(event); 18491 }, Glide2.settings.throttle), capture); 18492 }, 18493 /** 18494 * Unbinds swipe's moving event. 18495 * 18496 * @return {Void} 18497 */ 18498 unbindSwipeMove: function unbindSwipeMove() { 18499 Binder.off(MOVE_EVENTS, Components.Html.wrapper, capture); 18500 }, 18501 /** 18502 * Binds swipe's ending event. 18503 * 18504 * @return {Void} 18505 */ 18506 bindSwipeEnd: function bindSwipeEnd() { 18507 var _this3 = this; 18508 Binder.on(END_EVENTS, Components.Html.wrapper, function(event) { 18509 _this3.end(event); 18510 }); 18511 }, 18512 /** 18513 * Unbinds swipe's ending event. 18514 * 18515 * @return {Void} 18516 */ 18517 unbindSwipeEnd: function unbindSwipeEnd() { 18518 Binder.off(END_EVENTS, Components.Html.wrapper); 18519 }, 18520 /** 18521 * Normalizes event touches points accorting to different types. 18522 * 18523 * @param {Object} event 18524 */ 18525 touches: function touches(event) { 18526 if (MOUSE_EVENTS.indexOf(event.type) > -1) { 18527 return event; 18528 } 18529 return event.touches[0] || event.changedTouches[0]; 18530 }, 18531 /** 18532 * Gets value of minimum swipe distance settings based on event type. 18533 * 18534 * @return {Number} 18535 */ 18536 threshold: function threshold(event) { 18537 var settings2 = Glide2.settings; 18538 if (MOUSE_EVENTS.indexOf(event.type) > -1) { 18539 return settings2.dragThreshold; 18540 } 18541 return settings2.swipeThreshold; 18542 }, 18543 /** 18544 * Enables swipe event. 18545 * 18546 * @return {self} 18547 */ 18548 enable: function enable() { 18549 disabled = false; 18550 Components.Transition.enable(); 18551 return this; 18552 }, 18553 /** 18554 * Disables swipe event. 18555 * 18556 * @return {self} 18557 */ 18558 disable: function disable() { 18559 disabled = true; 18560 Components.Transition.disable(); 18561 return this; 18562 } 18563 }; 18564 Events.on("build.after", function() { 18565 Components.Html.root.classList.add(Glide2.settings.classes.swipeable); 18566 }); 18567 Events.on("destroy", function() { 18568 Swipe2.unbindSwipeStart(); 18569 Swipe2.unbindSwipeMove(); 18570 Swipe2.unbindSwipeEnd(); 18571 Binder.destroy(); 18572 }); 18573 return Swipe2; 18574 } 18575 function Images(Glide2, Components, Events) { 18576 var Binder = new EventsBinder(); 18577 var Images2 = { 18578 /** 18579 * Binds listener to glide wrapper. 18580 * 18581 * @return {Void} 18582 */ 18583 mount: function mount2() { 18584 this.bind(); 18585 }, 18586 /** 18587 * Binds `dragstart` event on wrapper to prevent dragging images. 18588 * 18589 * @return {Void} 18590 */ 18591 bind: function bind() { 18592 Binder.on("dragstart", Components.Html.wrapper, this.dragstart); 18593 }, 18594 /** 18595 * Unbinds `dragstart` event on wrapper. 18596 * 18597 * @return {Void} 18598 */ 18599 unbind: function unbind() { 18600 Binder.off("dragstart", Components.Html.wrapper); 18601 }, 18602 /** 18603 * Event handler. Prevents dragging. 18604 * 18605 * @return {Void} 18606 */ 18607 dragstart: function dragstart(event) { 18608 event.preventDefault(); 18609 } 18610 }; 18611 Events.on("destroy", function() { 18612 Images2.unbind(); 18613 Binder.destroy(); 18614 }); 18615 return Images2; 18616 } 18617 function Anchors(Glide2, Components, Events) { 18618 var Binder = new EventsBinder(); 18619 var detached = false; 18620 var prevented = false; 18621 var Anchors2 = { 18622 /** 18623 * Setups a initial state of anchors component. 18624 * 18625 * @returns {Void} 18626 */ 18627 mount: function mount2() { 18628 this._a = Components.Html.wrapper.querySelectorAll("a"); 18629 this.bind(); 18630 }, 18631 /** 18632 * Binds events to anchors inside a track. 18633 * 18634 * @return {Void} 18635 */ 18636 bind: function bind() { 18637 Binder.on("click", Components.Html.wrapper, this.click); 18638 }, 18639 /** 18640 * Unbinds events attached to anchors inside a track. 18641 * 18642 * @return {Void} 18643 */ 18644 unbind: function unbind() { 18645 Binder.off("click", Components.Html.wrapper); 18646 }, 18647 /** 18648 * Handler for click event. Prevents clicks when glide is in `prevent` status. 18649 * 18650 * @param {Object} event 18651 * @return {Void} 18652 */ 18653 click: function click(event) { 18654 if (prevented) { 18655 event.stopPropagation(); 18656 event.preventDefault(); 18657 } 18658 }, 18659 /** 18660 * Detaches anchors click event inside glide. 18661 * 18662 * @return {self} 18663 */ 18664 detach: function detach() { 18665 prevented = true; 18666 if (!detached) { 18667 for (var i = 0; i < this.items.length; i++) { 18668 this.items[i].draggable = false; 18669 } 18670 detached = true; 18671 } 18672 return this; 18673 }, 18674 /** 18675 * Attaches anchors click events inside glide. 18676 * 18677 * @return {self} 18678 */ 18679 attach: function attach() { 18680 prevented = false; 18681 if (detached) { 18682 for (var i = 0; i < this.items.length; i++) { 18683 this.items[i].draggable = true; 18684 } 18685 detached = false; 18686 } 18687 return this; 18688 } 18689 }; 18690 define2(Anchors2, "items", { 18691 /** 18692 * Gets collection of the arrows HTML elements. 18693 * 18694 * @return {HTMLElement[]} 18695 */ 18696 get: function get2() { 18697 return Anchors2._a; 18698 } 18699 }); 18700 Events.on("swipe.move", function() { 18701 Anchors2.detach(); 18702 }); 18703 Events.on("swipe.end", function() { 18704 Components.Transition.after(function() { 18705 Anchors2.attach(); 18706 }); 18707 }); 18708 Events.on("destroy", function() { 18709 Anchors2.attach(); 18710 Anchors2.unbind(); 18711 Binder.destroy(); 18712 }); 18713 return Anchors2; 18714 } 18715 var NAV_SELECTOR = '[data-glide-el="controls[nav]"]'; 18716 var CONTROLS_SELECTOR = '[data-glide-el^="controls"]'; 18717 var PREVIOUS_CONTROLS_SELECTOR = "".concat(CONTROLS_SELECTOR, ' [data-glide-dir*="<"]'); 18718 var NEXT_CONTROLS_SELECTOR = "".concat(CONTROLS_SELECTOR, ' [data-glide-dir*=">"]'); 18719 function Controls(Glide2, Components, Events) { 18720 var Binder = new EventsBinder(); 18721 var capture = supportsPassive$1 ? { 18722 passive: true 18723 } : false; 18724 var Controls2 = { 18725 /** 18726 * Inits arrows. Binds events listeners 18727 * to the arrows HTML elements. 18728 * 18729 * @return {Void} 18730 */ 18731 mount: function mount2() { 18732 this._n = Components.Html.root.querySelectorAll(NAV_SELECTOR); 18733 this._c = Components.Html.root.querySelectorAll(CONTROLS_SELECTOR); 18734 this._arrowControls = { 18735 previous: Components.Html.root.querySelectorAll(PREVIOUS_CONTROLS_SELECTOR), 18736 next: Components.Html.root.querySelectorAll(NEXT_CONTROLS_SELECTOR) 18737 }; 18738 this.addBindings(); 18739 }, 18740 /** 18741 * Sets active class to current slide. 18742 * 18743 * @return {Void} 18744 */ 18745 setActive: function setActive() { 18746 for (var i = 0; i < this._n.length; i++) { 18747 this.addClass(this._n[i].children); 18748 } 18749 }, 18750 /** 18751 * Removes active class to current slide. 18752 * 18753 * @return {Void} 18754 */ 18755 removeActive: function removeActive() { 18756 for (var i = 0; i < this._n.length; i++) { 18757 this.removeClass(this._n[i].children); 18758 } 18759 }, 18760 /** 18761 * Toggles active class on items inside navigation. 18762 * 18763 * @param {HTMLElement} controls 18764 * @return {Void} 18765 */ 18766 addClass: function addClass(controls) { 18767 var settings2 = Glide2.settings; 18768 var item = controls[Glide2.index]; 18769 if (!item) { 18770 return; 18771 } 18772 if (item) { 18773 item.classList.add(settings2.classes.nav.active); 18774 siblings(item).forEach(function(sibling) { 18775 sibling.classList.remove(settings2.classes.nav.active); 18776 }); 18777 } 18778 }, 18779 /** 18780 * Removes active class from active control. 18781 * 18782 * @param {HTMLElement} controls 18783 * @return {Void} 18784 */ 18785 removeClass: function removeClass(controls) { 18786 var item = controls[Glide2.index]; 18787 if (item) { 18788 item.classList.remove(Glide2.settings.classes.nav.active); 18789 } 18790 }, 18791 /** 18792 * Calculates, removes or adds `Glide.settings.classes.disabledArrow` class on the control arrows 18793 */ 18794 setArrowState: function setArrowState() { 18795 if (Glide2.settings.rewind) { 18796 return; 18797 } 18798 var next = Controls2._arrowControls.next; 18799 var previous = Controls2._arrowControls.previous; 18800 this.resetArrowState(next, previous); 18801 if (Glide2.index === 0) { 18802 this.disableArrow(previous); 18803 } 18804 if (Glide2.index === Components.Run.length) { 18805 this.disableArrow(next); 18806 } 18807 }, 18808 /** 18809 * Removes `Glide.settings.classes.disabledArrow` from given NodeList elements 18810 * 18811 * @param {NodeList[]} lists 18812 */ 18813 resetArrowState: function resetArrowState() { 18814 var settings2 = Glide2.settings; 18815 for (var _len = arguments.length, lists = new Array(_len), _key = 0; _key < _len; _key++) { 18816 lists[_key] = arguments[_key]; 18817 } 18818 lists.forEach(function(list) { 18819 toArray(list).forEach(function(element) { 18820 element.classList.remove(settings2.classes.arrow.disabled); 18821 }); 18822 }); 18823 }, 18824 /** 18825 * Adds `Glide.settings.classes.disabledArrow` to given NodeList elements 18826 * 18827 * @param {NodeList[]} lists 18828 */ 18829 disableArrow: function disableArrow() { 18830 var settings2 = Glide2.settings; 18831 for (var _len2 = arguments.length, lists = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { 18832 lists[_key2] = arguments[_key2]; 18833 } 18834 lists.forEach(function(list) { 18835 toArray(list).forEach(function(element) { 18836 element.classList.add(settings2.classes.arrow.disabled); 18837 }); 18838 }); 18839 }, 18840 /** 18841 * Adds handles to the each group of controls. 18842 * 18843 * @return {Void} 18844 */ 18845 addBindings: function addBindings() { 18846 for (var i = 0; i < this._c.length; i++) { 18847 this.bind(this._c[i].children); 18848 } 18849 }, 18850 /** 18851 * Removes handles from the each group of controls. 18852 * 18853 * @return {Void} 18854 */ 18855 removeBindings: function removeBindings() { 18856 for (var i = 0; i < this._c.length; i++) { 18857 this.unbind(this._c[i].children); 18858 } 18859 }, 18860 /** 18861 * Binds events to arrows HTML elements. 18862 * 18863 * @param {HTMLCollection} elements 18864 * @return {Void} 18865 */ 18866 bind: function bind(elements2) { 18867 for (var i = 0; i < elements2.length; i++) { 18868 Binder.on("click", elements2[i], this.click); 18869 Binder.on("touchstart", elements2[i], this.click, capture); 18870 } 18871 }, 18872 /** 18873 * Unbinds events binded to the arrows HTML elements. 18874 * 18875 * @param {HTMLCollection} elements 18876 * @return {Void} 18877 */ 18878 unbind: function unbind(elements2) { 18879 for (var i = 0; i < elements2.length; i++) { 18880 Binder.off(["click", "touchstart"], elements2[i]); 18881 } 18882 }, 18883 /** 18884 * Handles `click` event on the arrows HTML elements. 18885 * Moves slider in direction given via the 18886 * `data-glide-dir` attribute. 18887 * 18888 * @param {Object} event 18889 * @return {void} 18890 */ 18891 click: function click(event) { 18892 if (!supportsPassive$1 && event.type === "touchstart") { 18893 event.preventDefault(); 18894 } 18895 var direction = event.currentTarget.getAttribute("data-glide-dir"); 18896 Components.Run.make(Components.Direction.resolve(direction)); 18897 } 18898 }; 18899 define2(Controls2, "items", { 18900 /** 18901 * Gets collection of the controls HTML elements. 18902 * 18903 * @return {HTMLElement[]} 18904 */ 18905 get: function get2() { 18906 return Controls2._c; 18907 } 18908 }); 18909 Events.on(["mount.after", "move.after"], function() { 18910 Controls2.setActive(); 18911 }); 18912 Events.on(["mount.after", "run"], function() { 18913 Controls2.setArrowState(); 18914 }); 18915 Events.on("destroy", function() { 18916 Controls2.removeBindings(); 18917 Controls2.removeActive(); 18918 Binder.destroy(); 18919 }); 18920 return Controls2; 18921 } 18922 function Keyboard(Glide2, Components, Events) { 18923 var Binder = new EventsBinder(); 18924 var Keyboard2 = { 18925 /** 18926 * Binds keyboard events on component mount. 18927 * 18928 * @return {Void} 18929 */ 18930 mount: function mount2() { 18931 if (Glide2.settings.keyboard) { 18932 this.bind(); 18933 } 18934 }, 18935 /** 18936 * Adds keyboard press events. 18937 * 18938 * @return {Void} 18939 */ 18940 bind: function bind() { 18941 Binder.on("keyup", document, this.press); 18942 }, 18943 /** 18944 * Removes keyboard press events. 18945 * 18946 * @return {Void} 18947 */ 18948 unbind: function unbind() { 18949 Binder.off("keyup", document); 18950 }, 18951 /** 18952 * Handles keyboard's arrows press and moving glide foward and backward. 18953 * 18954 * @param {Object} event 18955 * @return {Void} 18956 */ 18957 press: function press(event) { 18958 var perSwipe = Glide2.settings.perSwipe; 18959 if (event.code === "ArrowRight") { 18960 Components.Run.make(Components.Direction.resolve("".concat(perSwipe, ">"))); 18961 } 18962 if (event.code === "ArrowLeft") { 18963 Components.Run.make(Components.Direction.resolve("".concat(perSwipe, "<"))); 18964 } 18965 } 18966 }; 18967 Events.on(["destroy", "update"], function() { 18968 Keyboard2.unbind(); 18969 }); 18970 Events.on("update", function() { 18971 Keyboard2.mount(); 18972 }); 18973 Events.on("destroy", function() { 18974 Binder.destroy(); 18975 }); 18976 return Keyboard2; 18977 } 18978 function Autoplay(Glide2, Components, Events) { 18979 var Binder = new EventsBinder(); 18980 var Autoplay2 = { 18981 /** 18982 * Initializes autoplaying and events. 18983 * 18984 * @return {Void} 18985 */ 18986 mount: function mount2() { 18987 this.enable(); 18988 this.start(); 18989 if (Glide2.settings.hoverpause) { 18990 this.bind(); 18991 } 18992 }, 18993 /** 18994 * Enables autoplaying 18995 * 18996 * @returns {Void} 18997 */ 18998 enable: function enable() { 18999 this._e = true; 19000 }, 19001 /** 19002 * Disables autoplaying. 19003 * 19004 * @returns {Void} 19005 */ 19006 disable: function disable() { 19007 this._e = false; 19008 }, 19009 /** 19010 * Starts autoplaying in configured interval. 19011 * 19012 * @param {Boolean|Number} force Run autoplaying with passed interval regardless of `autoplay` settings 19013 * @return {Void} 19014 */ 19015 start: function start() { 19016 var _this = this; 19017 if (!this._e) { 19018 return; 19019 } 19020 this.enable(); 19021 if (Glide2.settings.autoplay) { 19022 if (isUndefined(this._i)) { 19023 this._i = setInterval(function() { 19024 _this.stop(); 19025 Components.Run.make(">"); 19026 _this.start(); 19027 Events.emit("autoplay"); 19028 }, this.time); 19029 } 19030 } 19031 }, 19032 /** 19033 * Stops autorunning of the glide. 19034 * 19035 * @return {Void} 19036 */ 19037 stop: function stop() { 19038 this._i = clearInterval(this._i); 19039 }, 19040 /** 19041 * Stops autoplaying while mouse is over glide's area. 19042 * 19043 * @return {Void} 19044 */ 19045 bind: function bind() { 19046 var _this2 = this; 19047 Binder.on("mouseover", Components.Html.root, function() { 19048 if (_this2._e) { 19049 _this2.stop(); 19050 } 19051 }); 19052 Binder.on("mouseout", Components.Html.root, function() { 19053 if (_this2._e) { 19054 _this2.start(); 19055 } 19056 }); 19057 }, 19058 /** 19059 * Unbind mouseover events. 19060 * 19061 * @returns {Void} 19062 */ 19063 unbind: function unbind() { 19064 Binder.off(["mouseover", "mouseout"], Components.Html.root); 19065 } 19066 }; 19067 define2(Autoplay2, "time", { 19068 /** 19069 * Gets time period value for the autoplay interval. Prioritizes 19070 * times in `data-glide-autoplay` attrubutes over options. 19071 * 19072 * @return {Number} 19073 */ 19074 get: function get2() { 19075 var autoplay = Components.Html.slides[Glide2.index].getAttribute("data-glide-autoplay"); 19076 if (autoplay) { 19077 return toInt(autoplay); 19078 } 19079 return toInt(Glide2.settings.autoplay); 19080 } 19081 }); 19082 Events.on(["destroy", "update"], function() { 19083 Autoplay2.unbind(); 19084 }); 19085 Events.on(["run.before", "swipe.start", "update"], function() { 19086 Autoplay2.stop(); 19087 }); 19088 Events.on(["pause", "destroy"], function() { 19089 Autoplay2.disable(); 19090 Autoplay2.stop(); 19091 }); 19092 Events.on(["run.after", "swipe.end"], function() { 19093 Autoplay2.start(); 19094 }); 19095 Events.on(["play"], function() { 19096 Autoplay2.enable(); 19097 Autoplay2.start(); 19098 }); 19099 Events.on("update", function() { 19100 Autoplay2.mount(); 19101 }); 19102 Events.on("destroy", function() { 19103 Binder.destroy(); 19104 }); 19105 return Autoplay2; 19106 } 19107 function sortBreakpoints(points) { 19108 if (isObject(points)) { 19109 return sortKeys(points); 19110 } else { 19111 warn2("Breakpoints option must be an object"); 19112 } 19113 return {}; 19114 } 19115 function Breakpoints(Glide2, Components, Events) { 19116 var Binder = new EventsBinder(); 19117 var settings2 = Glide2.settings; 19118 var points = sortBreakpoints(settings2.breakpoints); 19119 var defaults3 = Object.assign({}, settings2); 19120 var Breakpoints2 = { 19121 /** 19122 * Matches settings for currectly matching media breakpoint. 19123 * 19124 * @param {Object} points 19125 * @returns {Object} 19126 */ 19127 match: function match(points2) { 19128 if (typeof window.matchMedia !== "undefined") { 19129 for (var point in points2) { 19130 if (points2.hasOwnProperty(point)) { 19131 if (window.matchMedia("(max-width: ".concat(point, "px)")).matches) { 19132 return points2[point]; 19133 } 19134 } 19135 } 19136 } 19137 return defaults3; 19138 } 19139 }; 19140 Object.assign(settings2, Breakpoints2.match(points)); 19141 Binder.on("resize", window, throttle(function() { 19142 Glide2.settings = mergeOptions(settings2, Breakpoints2.match(points)); 19143 }, Glide2.settings.throttle)); 19144 Events.on("update", function() { 19145 points = sortBreakpoints(points); 19146 defaults3 = Object.assign({}, settings2); 19147 }); 19148 Events.on("destroy", function() { 19149 Binder.off("resize", window); 19150 }); 19151 return Breakpoints2; 19152 } 19153 var COMPONENTS = { 19154 // Required 19155 Html, 19156 Translate, 19157 Transition, 19158 Direction, 19159 Peek, 19160 Sizes, 19161 Gaps, 19162 Move, 19163 Clones, 19164 Resize, 19165 Build, 19166 Run, 19167 // Optional 19168 Swipe, 19169 Images, 19170 Anchors, 19171 Controls, 19172 Keyboard, 19173 Autoplay, 19174 Breakpoints 19175 }; 19176 var Glide = /* @__PURE__ */ (function(_Core) { 19177 _inherits2(Glide2, _Core); 19178 var _super = _createSuper2(Glide2); 19179 function Glide2() { 19180 _classCallCheck2(this, Glide2); 19181 return _super.apply(this, arguments); 19182 } 19183 _createClass2(Glide2, [{ 19184 key: "mount", 19185 value: function mount2() { 19186 var extensions = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; 19187 return _get(_getPrototypeOf2(Glide2.prototype), "mount", this).call(this, Object.assign({}, COMPONENTS, extensions)); 19188 } 19189 }]); 19190 return Glide2; 19191 })(Glide$1); 19192 19193
19193// src/fairtrade_provider/js/Base/Vendor/T3vContent/ContentObjects/Carousel.js 19194 var Carousel = class _Carousel { 19195 // --- Defaults --- 19196 static get defaults() { 19197 return Object.freeze({ 19198 tag: "t3v-content-carousel", 19199 glide: { 19200 type: "carousel", 19201 startAt: 0, 19202 perView: 6, 19203 // focusAt: 'center', 19204 gap: 0, 19205 breakpoints: { 19206 1280: { 19207 perView: 4 19208 }, 19209 992: { 19210 perView: 3 19211 }, 19212 640: { 19213 perView: 2 19214 } 19215 }, 19216 autoplay: 0, 19217 hoverpause: true, 19218 keyboard: true 19219 }, 19220 debug: false 19221 }); 19222 } 19223 // --- Public --- 19224 constructor(contentObject, options) { 19225 this.$contentObject = (0, import_jquery14.default)(contentObject); 19226 this.options = Object.assign({}, _Carousel.defaults, options); 19227 if (this.$contentObject.attr("autoplay")) { 19228 const autoplay = parseInt(this.$contentObject.get(0).getAttribute("autoplay")) || 0; 19229 if (autoplay > 0) { 19230 this.options.glide.autoplay = autoplay; 19231 } 19232 } 19233 this.initialize(); 19234 } 19235 // --- Private --- 19236 initialize() { 19237 this.$glide = this.$contentObject.find(".glide"); 19238 if (this.$glide.length) { 19239 this.$arrows = this.$glide.find(".glide__arrow"); 19240 this.glide = new Glide(this.$glide.get(0), this.options.glide); 19241 this.glide.mount(); 19242 } 19243 } 19244 }; 19245 import_jquery14.default.fn.carouselify = function(options) { 19246 this.each(function() { 19247 const element = (0, import_jquery14.default)(this); 19248 if (typeof element.data("carouselify") === "undefined") { 19249 const instance2 = new Carousel(this, options); 19250 element.data("carouselify", instance2); 19251 } 19252 }); 19253 return this; 19254 }; 19255 19256
19256// src/fairtrade_provider/js/Base/Vendor/T3vContent/ContentObjects/Slider.js 19257 var import_jquery15 = __toESM(require_jquery()); 19258 var Slider = class _Slider { 19259 // --- Defaults --- 19260 static get defaults() { 19261 return Object.freeze({ 19262 tag: "t3v-content-slider", 19263 glide: { 19264 type: "slider", 19265 autoplay: 0, 19266 hoverpause: true, 19267 keyboard: true 19268 }, 19269 debug: false 19270 }); 19271 } 19272 // --- Public --- 19273 constructor(contentObject, options) { 19274 this.$contentObject = (0, import_jquery15.default)(contentObject); 19275 this.options = Object.assign({}, _Slider.defaults, options); 19276 if (this.$contentObject.attr("autoplay")) { 19277 const autoplay = parseInt(this.$contentObject.get(0).getAttribute("autoplay")) || 0; 19278 if (autoplay > 0) { 19279 this.options.glide.autoplay = autoplay; 19280 } 19281 } 19282 this.initialize(); 19283 } 19284 // --- Private --- 19285 initialize() { 19286 this.$glide = this.$contentObject.find(".glide"); 19287 if (this.$glide.length) { 19288 this.glide = new Glide(this.$glide.get(0), this.options.glide); 19289 this.glide.mount(); 19290 } 19291 } 19292 }; 19293 import_jquery15.default.fn.sliderify = function(options) { 19294 this.each(function() { 19295 const element = (0, import_jquery15.default)(this); 19296 if (typeof element.data("sliderify") === "undefined") { 19297 const instance2 = new Slider(this, options); 19298 element.data("sliderify", instance2); 19299 } 19300 }); 19301 return this; 19302 }; 19303 19304
19304// src/fairtrade_provider/js/Base/Vendor/T3vContent/ContentObjects/MediaGallery.js 19305 var import_jquery16 = __toESM(require_jquery()); 19306 var MediaGallery = class _MediaGallery { 19307 // --- Defaults --- 19308 static get defaults() { 19309 return Object.freeze({ 19310 tag: "media-gallery", 19311 colorbox: { 19312 // --- Common --- 19313 // The transition type. Can be set to `elastic`, `fade`, or `none`. 19314 transition: "elastic", 19315 // If true and if `height` or `width`, `innerHeight`, `innerWidth`, `maxHeight` or `maxWidth` have been defined, Colorbox will scale 19316 // photos to fit within the those values. 19317 // scalePhotos: true, 19318 // Allows for preloading of next and previous content in a group, after the current content has finished loading. 19319 // preloading: true, 19320 // --- Dimensions --- 19321 // Sets a fixed total height. This includes borders and buttons. 19322 // Example: `100%`, `500px` or `500` 19323 // height: false, 19324 // Sets a fixed total width. This includes borders and buttons. 19325 // Example: `100%`, `500px` or `500` 19326 // width: false, 19327 // This is an alternative to `height` used to set a fixed inner height. This excludes borders and buttons. 19328 // Example: `50%`, `500px` or `500` 19329 // innerHeight: false, 19330 // This is an alternative to `width` used to set a fixed inner width. This excludes borders and buttons. 19331 // Example: `50%`, `500px` or `500` 19332 // innerWidth: false, 19333 // Sets the initial height, prior to any content being loaded. 19334 // initialHeight: 100, 19335 // Sets the initial width, prior to any content being loaded. 19336 // initialWidth: 300, 19337 // Sets a maximum height for loaded content. 19338 // Example: `100%`, `500px` or `500` 19339 maxHeight: "86%", 19340 // Sets a maximum width for loaded content. 19341 // Example: `100%`, `500px` or `500` 19342 maxWidth: "86%" 19343 // --- Callbacks --- 19344 // The callback that fires right before Colorbox begins to open. 19345 // onOpen: function() { 19346 // ... 19347 // }, 19348 // The callback that fires right before attempting to load the target content. 19349 }, 19350 debug: false 19351 }); 19352 } 19353 // --- Public --- 19354 constructor(contentObject, options) { 19355 this.$contentObject = (0, import_jquery16.default)(contentObject); 19356 this.options = Object.assign({}, _MediaGallery.defaults, options); 19357 this.initialize(window.$); 19358 } 19359 // --- Private --- 19360 initialize($27) { 19361 const self = this; 19362 this.$contentObject.find(".link--media").each(function() { 19363 const $mediaLink = $27(this); 19364 const $image = $mediaLink.children("img"); 19365 if ($image.length) { 19366 const options = self.options.colorbox; 19367 const title = $image.attr("title"); 19368 const alternativeText = $image.attr("alt"); 19369 options.title = title || alternativeText; 19370 $mediaLink.colorbox(options); 19371 } else { 19372 $mediaLink.colorbox(self.options.colorbox); 19373 } 19374 }); 19375 } 19376 }; 19377 import_jquery16.default.fn.mediaGallerify = function(options) { 19378 this.each(function() { 19379 const element = (0, import_jquery16.default)(this); 19380 if (typeof element.data("mediaGallerify") === "undefined") { 19381 const instance2 = new MediaGallery(this, options); 19382 element.data("mediaGallerify", instance2); 19383 } 19384 }); 19385 return this; 19386 }; 19387 19388
19388// src/fairtrade_provider/js/Base/Vendor/T3vNavigations/ContentObjects/MobileNavigation.js 19389 var import_jquery17 = __toESM(require_jquery()); 19390 var MobileNavigation = class _MobileNavigation { 19391 // --- Defaults --- 19392 static get defaults() { 19393 return Object.freeze({ 19394 tag: "t3v-navigations-mobile-navigation", 19395 debug: false 19396 }); 19397 } 19398 // --- Public --- 19399 constructor(navigation, options) { 19400 this.$navigation = (0, import_jquery17.default)(navigation); 19401 this.options = Object.assign({}, _MobileNavigation.defaults, options); 19402 this.initialize(); 19403 } 19404 toogleEntry($entry) { 19405 $entry = (0, import_jquery17.default)($entry); 19406 const condition = $entry.attr("data-condition") || "collapsed"; 19407 if (condition === "collapsed") { 19408 this.expandEntry($entry); 19409 } else { 19410 this.collapseEntry($entry); 19411 } 19412 } 19413 expandEntry($entry) { 19414 $entry = (0, import_jquery17.default)($entry); 19415 const condition = $entry.attr("data-condition") || "collapsed"; 19416 if (condition === "collapsed") { 19417 this.collapseCurrentEntry(); 19418 const $subentries = $entry.find(".navigation__subentries"); 19419 $subentries.slideDown({ 19420 duration: 300, 19421 complete: function() { 19422 $entry.attr("data-condition", "expanded"); 19423 } 19424 }); 19425 } 19426 } 19427 collapseEntry($entry) { 19428 $entry = (0, import_jquery17.default)($entry); 19429 const condition = $entry.attr("data-condition") || "collapsed"; 19430 if (condition !== "collapsed") { 19431 const $subentries = $entry.find(".navigation__subentries"); 19432 $subentries.slideUp({ 19433 duration: 300, 19434 complete: function() { 19435 $entry.attr("data-condition", "collapsed"); 19436 } 19437 }); 19438 } 19439 } 19440 collapseCurrentEntry() { 19441 const $entry = this.$navigation.find('.navigation__entry[data-condition="expanded"]'); 19442 this.collapseEntry($entry); 19443 } 19444 // --- Events --- 19445 onEntryClick(event) { 19446 const $entry = (0, import_jquery17.default)(event.currentTarget); 19447 const $item = $entry.find(".navigation__item"); 19448 if ($item.siblings().length > 0) { 19449 $item.trigger("click"); 19450 } 19451 } 19452 onItemClick(event) { 19453 const $item = (0, import_jquery17.default)(event.currentTarget);
19454 const $entry = $item.closest(".navigation__entry"); 19455 const $subentries = $entry.find(".navigation__subentry"); 19456 if ($subentries.length > 0) { 19457 const condition = $entry.attr("data-condition") || "collapsed"; 19458 if (condition === "expanded") { 19459 const url = $item.attr("href"); 19460 if (url) { 19461 window.location = url; 19462 } 19463 return false; 19464 } else { 19465 this.toogleEntry($entry); 19466 return false; 19467 } 19468 } 19469 return true; 19470 } 19471 // --- Private --- 19472 initialize() { 19473 this.$window = (0, import_jquery17.default)(window); 19474 this.$entries = this.$navigation.find(".navigation__entry"); 19475 this.$subentries = this.$navigation.find(".navigation__subentry"); 19476 this.$items = this.$navigation.find(".navigation__item"); 19477 this.$entries.on("click", import_jquery17.default.proxy(this.onEntryClick, this)); 19478 this.$items.on("click", import_jquery17.default.proxy(this.onItemClick, this)); 19479 } 19480 }; 19481 import_jquery17.default.fn.mobileNavigatify = function(options) { 19482 this.each(function() { 19483 const element = (0, import_jquery17.default)(this); 19484 if (typeof element.data("mobileNavigatify") === "undefined") { 19485 const instance2 = new MobileNavigation(this, options); 19486 element.data("mobileNavigatify", instance2); 19487 } 19488 }); 19489 return this; 19490 }; 19491 19492
19492// src/fairtrade_provider/js/Base/ContentObjects/chat-button-styling.js 19493 var import_jquery18 = __toESM(require_jquery()); 19494 function styleChatButtons() { 19495 let styled = 0; 19496 const normalSelectors = [ 19497 ".bg-widget-launcher-bg", 19498 'button[id*="chat-"]', 19499 "#chat-92b0c56a-6548-49aa-8806-bacde371c87a-trigger" 19500 ]; 19501 normalSelectors.forEach((selector) => { 19502 try { 19503 document.querySelectorAll(selector).forEach((button) => { 19504 if (!button.dataset.styledByChatScript) { 19505 button.style.setProperty("background-color", "var(--mb-button-bg-color)", "important"); 19506 button.style.setProperty("color", "var(--mb-launcher-text-color)", "important"); 19507 button.style.setProperty("border", "none", "important"); 19508 button.dataset.styledByChatScript = "true"; 19509 styled++; 19510 } 19511 }); 19512 } catch (e2) { 19513 console.warn("Normal DOM Selektor-Fehler:", selector, e2); 19514 } 19515 }); 19516 function findAndStyleInShadowDOM(element) { 19517 if (element.shadowRoot) { 19518 const computedStyle = getComputedStyle(document.documentElement); 19519 const bodyComputedStyle = getComputedStyle(document.body); 19520 const bgColor = bodyComputedStyle.getPropertyValue("--mb-button-bg-color").trim() || computedStyle.getPropertyValue("--mb-button-bg-color").trim() || bodyComputedStyle.getPropertyValue("--theme-primary-color").trim() || computedStyle.getPropertyValue("--theme-primary-color").trim() || "#c4003d"; 19521 const textColor = bodyComputedStyle.getPropertyValue("--mb-launcher-text-color").trim() || computedStyle.getPropertyValue("--mb-launcher-text-color").trim() || "#FFF"; 19522 const hoverColor = bodyComputedStyle.getPropertyValue("--mb-launcher-hover-bg-color").trim() || computedStyle.getPropertyValue("--mb-launcher-hover-bg-color").trim() || bodyComputedStyle.getPropertyValue("--theme-secondary-color").trim() || computedStyle.getPropertyValue("--theme-secondary-color").trim() || "#80A0B4"; 19523 let shadowStyle = element.shadowRoot.querySelector("#theme-variables"); 19524 if (!shadowStyle) { 19525 shadowStyle = document.createElement("style"); 19526 shadowStyle.id = "theme-variables"; 19527 shadowStyle.textContent = ` 19528 :host, :root { 19529 --mb-button-bg-color: ${bgColor}; 19530 --mb-launcher-text-color: ${textColor}; 19531 --mb-launcher-hover-bg-color: ${hoverColor}; 19532 } 19533 19534 button, [role="button"] { 19535 background-color: var(--mb-button-bg-color) !important; 19536 transition: background-color 0.2s ease !important; 19537 } 19538 19539 button:hover, [role="button"]:hover { 19540 background-color: var(--mb-launcher-hover-bg-color) !important; 19541 } 19542 `; 19543 const nonce = document.querySelector("script[nonce]")?.nonce; 19544 if (nonce) { 19545 shadowStyle.setAttribute("nonce", nonce); 19546 } 19547 element.shadowRoot.appendChild(shadowStyle); 19548 } 19549 const shadowSelectors = [ 19550 "button", 19551 '[role="button"]', 19552 ".chat-button", 19553 ".launcher", 19554 '*[class*="button"]', 19555 '*[id*="trigger"]' 19556 ]; 19557 shadowSelectors.forEach((selector) => { 19558 try { 19559 element.shadowRoot.querySelectorAll(selector).forEach((button) => { 19560 if (!button.dataset.styledByChatScript) { 19561 button.style.setProperty("background-color", bgColor, "important"); 19562 button.style.setProperty("color", textColor, "important"); 19563 button.style.setProperty("border", "none", "important"); 19564 button.dataset.styledByChatScript = "true"; 19565 styled++; 19566 } 19567 }); 19568 } catch (e2) { 19569 console.warn("Shadow DOM Selektor-Fehler:", selector, e2); 19570 } 19571 }); 19572 } 19573 element.querySelectorAll("*").forEach((child) => { 19574 if (child.shadowRoot) { 19575 findAndStyleInShadowDOM(child); 19576 } 19577 }); 19578 } 19579 const shadowContainers = document.querySelectorAll('bird-chat, [data-project-id], [project-id], *[class*="chat"], *[id*="chat"]');
19580 shadowContainers.forEach((container) => { 19581 findAndStyleInShadowDOM(container); 19582 }); 19583 findAndStyleInShadowDOM(document.body); 19584 return styled > 0; 19585 } 19586 import_jquery18.default.fn.chatButtonStylingify = function() { 19587 styleChatButtons(); 19588 const observer = new MutationObserver(() => { 19589 setTimeout(styleChatButtons, 500); 19590 }); 19591 observer.observe(document.body, { childList: true, subtree: true }); 19592 setInterval(styleChatButtons, 2e3); 19593 return this; 19594 }; 19595 19596
19596// src/fairtrade_provider/js/Base/ContentObjects/CookieBanner.js 19597 var import_jquery19 = __toESM(require_jquery()); 19598 var import_jquery20 = __toESM(require_jquery_cookie()); 19599 var CookieBanner = class _CookieBanner { 19600 // --- Defaults --- 19601 static get defaults() { 19602 return Object.freeze({ 19603 tag: "fairtrade-provider-cookie-banner", 19604 cookieGeoIp: "fairtradegeoip", 19605 cookieUnderstand: "fairtradecookie", 19606 debug: false 19607 }); 19608 } 19609 // --- Public --- 19610 constructor(cookieBanner, options) { 19611 this.$cookieBanner = (0, import_jquery19.default)(cookieBanner); 19612 this.options = Object.assign({}, _CookieBanner.defaults, options); 19613 this.initialize(); 19614 } 19615 // --- Events --- 19616 onButtonClick() { 19617 this.$cookieBanner.fadeOut(1e3); 19618 this.setCookie(this.options.cookieUnderstand, "1", 100); 19619 this.updateGtagConsent(); 19620 return false; 19621 } 19622 // --- Private --- 19623 initialize() { 19624 this.data = this.$cookieBanner.data(); 19625 this.$button = this.$cookieBanner.find(`.${this.options.tag}__button`); 19626 this.insertDefaultGtagScript(); 19627 this.setup(); 19628 this.renderBanner(); 19629 this.reapplyConsentIfCookieSet(); 19630 } 19631 setup() { 19632 this.$button.on("click", import_jquery19.default.proxy(this.onButtonClick, this)); 19633 } 19634 renderBanner() { 19635 const self = this; 19636 const cookieGeoIp = self.getCookie(self.options.cookieGeoIp); 19637 let data = null; 19638 if (cookieGeoIp) { 19639 try { 19640 data = JSON.parse(cookieGeoIp); 19641 } catch (exception) { 19642 data = null; 19643 } 19644 } 19645 if (this.isOnlyEu() === false) { 19646 data = { 19647 ip: "n/a", 19648 cc: "n/a", 19649 eu: "n/a" 19650 }; 19651 } 19652 if (data === null) { 19653 import_jquery19.default.get("/?type=99998899&testMode=0&r=" + Math.random(), function(data2) { 19654 if (data2) { 19655 if (typeof data2 === "string") { 19656 try { 19657 data2 = JSON.parse(data2); 19658 } catch (exception) { 19659 data2 = { 19660 ip: "n/a", 19661 cc: "n/a", 19662 eu: "n/a" 19663 }; 19664 } 19665 } 19666 self.setCookie(self.options.cookieGeoIp, JSON.stringify(data2), null); 19667 data2.info = "geoip"; 19668 self.renderContent(data2); 19669 } 19670 }); 19671 } else { 19672 data.info = "cookie"; 19673 this.renderContent(data); 19674 } 19675 } 19676 renderContent(data) { 19677 if (this.showBanner(data) === false) { 19678 return; 19679 } 19680 const cookieUnderstand = this.getCookie(this.options.cookieUnderstand); 19681 if (typeof cookieUnderstand !== "undefined") { 19682 this.$cookieBanner.hide(); 19683 } else { 19684 this.$cookieBanner.fadeIn(500); 19685 } 19686 if (this.isDebug()) { 19687 this.$cookieBanner.find(`.${this.options.tag}__geoip--ip`).text(data.ip); 19688 this.$cookieBanner.find(`.${this.options.tag}__geoip--cc`).text(data.cc); 19689 this.$cookieBanner.find(`.${this.options.tag}__geoip--eu`).text(data.eu); 19690 this.$cookieBanner.find(`.${this.options.tag}__geoip--info`).text(data.info); 19691 this.$cookieBanner.find(".table").show(); 19692 } 19693 } 19694 showBanner(data) { 19695 if (this.isOnlyEu()) { 19696 if (data) { 19697 if (data.eu === "false") { 19698 return false; 19699 } 19700 } 19701 } 19702 return true; 19703 } 19704 getCookie(name) { 19705 return import_jquery19.default.cookie(name); 19706 } 19707 setCookie(name, value, expires, path2) { 19708 if (typeof expires === "undefined") { 19709 expires = null; 19710 } 19711 if (typeof path2 === "undefined") { 19712 path2 = "/"; 19713 } 19714 return import_jquery19.default.cookie(name, value, { expires, path: path2 }); 19715 } 19716 isOnlyEu() { 19717 if (this.data) { 19718 if (parseInt(this.data.onlyEu) === 1) { 19719 return true; 19720 } 19721 } 19722 return false; 19723 } 19724 isDebug() { 19725 if (this.data) { 19726 if (parseInt(this.data.debug) === 1) { 19727 return true; 19728 } 19729 } 19730 return false; 19731 } 19732 // --- Insert Google Tag Script --- 19733 insertDefaultGtagScript() { 19734 const script = document.createElement("script");
19735 const nonce = document.querySelector("script[nonce]")?.nonce; 19736 if (nonce) { 19737 script.setAttribute("nonce", nonce); 19738 } 19739 script.text = ` 19740 window.dataLayer = window.dataLayer || []; 19741 function gtag(){dataLayer.push(arguments);} 19742 19743 gtag('consent', 'default', { 19744 'ad_storage': 'denied', 19745 'ad_user_data': 'denied', 19746 'ad_personalization': 'denied', 19747 'analytics_storage': 'denied' 19748 }); 19749 `; 19750 document.head.appendChild(script); 19751 } 19752 updateGtagConsent() { 19753 gtag("consent", "update", { 19754 "ad_storage": "granted", 19755 "ad_user_data": "granted", 19756 "ad_personalization": "granted", 19757 "analytics_storage": "granted" 19758 }); 19759 } 19760 // --- Reapply Consent if Cookie is Set --- 19761 reapplyConsentIfCookieSet() { 19762 const cookieUnderstand = this.getCookie(this.options.cookieUnderstand); 19763 if (cookieUnderstand) { 19764 this.updateGtagConsent(); 19765 } 19766 } 19767 }; 19768 import_jquery19.default.fn.cookieBannerify = function(options) { 19769 this.each(function() { 19770 const element = (0, import_jquery19.default)(this); 19771 if (typeof element.data("cookieBannerify") === "undefined") { 19772 const instance2 = new CookieBanner(this, options); 19773 element.data("cookieBannerify", instance2); 19774 } 19775 }); 19776 return this; 19777 }; 19778 19779
19779// src/fairtrade_provider/js/Base/ContentObjects/FacebookGallery.js 19780 var import_jquery21 = __toESM(require_jquery()); 19781 var import_md5 = __toESM(require_md5()); 19782 var FacebookGallery = class _FacebookGallery { 19783 // --- Defaults --- 19784 static get defaults() { 19785 return Object.freeze({ 19786 tag: "fairtrade-provider-facebook-gallery", 19787 debug: false 19788 }); 19789 } 19790 // --- Public --- 19791 constructor(facebookGallery, options) { 19792 this.$facebookGallery = (0, import_jquery21.default)(facebookGallery); 19793 this.options = Object.assign({}, _FacebookGallery.defaults, options); 19794 this.initialize(); 19795 } 19796 // --- Private --- 19797 initialize() { 19798 this.data = this.$facebookGallery.data(); 19799 this.getTestItems(); 19800 } 19801 getItems() { 19802 const self = this; 19803 import_jquery21.default.get(this.data.cacheFile, function(data) { 19804 const myItems = {}; 19805 const $doc = (0, import_jquery21.default)(data); 19806 const $codes = $doc.find("code"); 19807 import_jquery21.default.each($codes, function(k, v) { 19808 const h = (0, import_jquery21.default)(this).html(); 19809 let hh = h.replace("<!--", ""); 19810 hh = hh.replace("-->", ""); 19811 const $content = (0, import_jquery21.default)(hh); 19812 const $items = $content.find("[data-gt]"); 19813 $items.each(function(kk, vv) { 19814 const test = (0, import_jquery21.default)(this).find("._6-e6").html(); 19815 const md5sum = new import_md5.default().update(test).digest("hex"); 19816 if (!myItems[md5sum]) { 19817 let myContent = (0, import_jquery21.default)(this).html(); 19818 myContent = myContent.replace(/href="\/fairtrademesse\//g, 'href="https://www.facebook.com/fairtrademesse/'); 19819 myContent = myContent.replace(/href=/g, ' target="_blank" href='); 19820 self.$facebookGallery.append('<div class="fairtrade-provider-facebook-gallery__item">' + myContent + "</div>"); 19821 myItems[md5sum] = 1; 19822 } 19823 }); 19824 }); 19825 (0, import_jquery21.default)(".fbEmuTracking").remove(); 19826 (0, import_jquery21.default)(".hidden_elem").remove(); 19827 }); 19828 } 19829 getTestItems() { 19830 const self = this; 19831 import_jquery21.default.get(this.data.cacheFile, function(data) { 19832 const $doc = (0, import_jquery21.default)(data); 19833 const $stream = $doc.find("#pagelet_timeline_main_column"); 19834 let content = $stream.html(); 19835 content = content.replace(/href="\/fairtrademesse\//g, 'href="https://www.facebook.com/fairtrademesse/'); 19836 content = content.replace(/href=/g, ' target="_blank" href='); 19837 self.$facebookGallery.append(content); 19838 (0, import_jquery21.default)("#www_pages_reaction_see_more_unitwww_pages_posts").remove(); 19839 }); 19840 } 19841 }; 19842 import_jquery21.default.fn.facebookGalleryify = function(options) { 19843 this.each(function() { 19844 const element = (0, import_jquery21.default)(this); 19845 if (typeof element.data("facebookGalleryify") === "undefined") { 19846 const instance2 = new FacebookGallery(this, options); 19847 element.data("facebookGalleryify", instance2); 19848 } 19849 }); 19850 return this; 19851 }; 19852 19853
19853// src/fairtrade_provider/js/Base/ContentObjects/LeadForm.js 19854 var import_jquery22 = __toESM(require_jquery()); 19855 var LeadForm = class _LeadForm { 19856 // --- Defaults --- 19857 static get defaults() { 19858 return Object.freeze({ 19859 tag: "fairtrade-provider-lead-form", 19860 debug: false 19861 }); 19862 } 19863 // --- Public --- 19864 constructor(form, options) { 19865 this.$form = (0, import_jquery22.default)(form); 19866 this.options = Object.assign({}, _LeadForm.defaults, options); 19867 this.initialize(); 19868 } 19869 // --- Private --- 19870 initialize() { 19871 const value = new URLSearchParams(window.location.search).get("email"); 19872 if (value) { 19873 this.$form.find("#email").val(decodeURIComponent(value)); 19874 } 19875 } 19876 }; 19877 import_jquery22.default.fn.leadFormify = function(options) { 19878 this.each(function() { 19879 const element = (0, import_jquery22.default)(this); 19880 if (typeof element.data("leadFormify") === "undefined") { 19881 const instance2 = new LeadForm(this, options); 19882 element.data("leadFormify", instance2); 19883 } 19884 }); 19885 return this; 19886 }; 19887 19888
19888// src/fairtrade_provider/js/Base/ContentObjects/MasonryGallery.js 19889 var import_jquery23 = __toESM(require_jquery()); 19890 var import_masonry_layout2 = __toESM(require_masonry()); 19891 var MasonryGallery = class _MasonryGallery { 19892 // --- Defaults --- 19893 static get defaults() { 19894 return Object.freeze({ 19895 tag: "fairtrade-provider-masonry-gallery", 19896 debug: false 19897 }); 19898 } 19899 // --- Public --- 19900 constructor(masonryGallery, options) { 19901 this.$masonryGallery = (0, import_jquery23.default)(masonryGallery); 19902 this.options = Object.assign({}, _MasonryGallery.defaults, options); 19903 this.initialize(); 19904 } 19905 // --- Private --- 19906 initialize() { 19907 this.mason = new import_masonry_layout2.default(this.$masonryGallery.get(0), { 19908 itemSelector: ".grid-item" 19909 }); 19910 } 19911 }; 19912 import_jquery23.default.fn.masonryGalleryify = function(options) { 19913 this.each(function() { 19914 const element = (0, import_jquery23.default)(this); 19915 if (typeof element.data("masonryGalleryify") === "undefined") { 19916 const instance2 = new MasonryGallery(this, options); 19917 element.data("masonryGalleryify", instance2); 19918 } 19919 }); 19920 return this; 19921 }; 19922 19923
19923// src/fairtrade_provider/js/Base/ContentObjects/MediaVideoPlaylist.js 19924 var import_jquery24 = __toESM(require_jquery()); 19925 var MediaVideoPlaylist = class _MediaVideoPlaylist { 19926 // --- Defaults --- 19927 static get defaults() { 19928 return Object.freeze({ 19929 tag: "fairtrade-provider-media-video-playlist", 19930 debug: false 19931 }); 19932 } 19933 // --- Public --- 19934 constructor(contentObject, options) { 19935 this.$contentObject = (0, import_jquery24.default)(contentObject); 19936 this.options = Object.assign({}, _MediaVideoPlaylist.defaults, options); 19937 this.initialize(); 19938 } 19939 // --- Events --- 19940 onMenuLinkClick(event) { 19941 event.preventDefault(); 19942 const $menuLink = (0, import_jquery24.default)(event.currentTarget); 19943 const videoId = $menuLink.data("videoId"); 19944 this.playVideo(videoId); 19945 return false; 19946 } 19947 // --- Private --- 19948 initialize() { 19949 this.$iframe = this.$contentObject.find(this.getSelectorName("player iframe")); 19950 this.$menuLinks = this.$contentObject.find(this.getSelectorName("link")); 19951 this.setup(); 19952 } 19953 setup() { 19954 this.$menuLinks.on("click", import_jquery24.default.proxy(this.onMenuLinkClick, this)); 19955 } 19956 playVideo(id) { 19957 this.$iframe.attr("src", this.generateVideoUrl(id)); 19958 } 19959 generateVideoUrl(id) { 19960 return `https://www.youtube-nocookie.com/embed/${id}?autohide=1&controls=1&enablejsapi=1`; 19961 } 19962 getSelectorName(name) { 19963 return `.${this.options.tag}__${name}`; 19964 } 19965 }; 19966 import_jquery24.default.fn.mediaVideoPlaylistify = function(options) { 19967 this.each(function() { 19968 const element = (0, import_jquery24.default)(this); 19969 if (typeof element.data("mediaVideoPlaylistify") === "undefined") { 19970 const instance2 = new MediaVideoPlaylist(this, options); 19971 element.data("mediaVideoPlaylistify", instance2); 19972 } 19973 }); 19974 return this; 19975 }; 19976 19977
19977// src/fairtrade_provider/js/Base/ContentObjects/StatisticsCounter.js 19978 var import_jquery25 = __toESM(require_jquery()); 19979 19980
vendor: 1,294 bytes, lines 19980-20001
19980// node_modules/observe-element-in-viewport/dist/index.esm.js 19981 function o(o2, r, t3, e2) { 19982 if (void 0 === t3 && (t3 = function() { 19983 }), void 0 === e2 && (e2 = {}), !o2) throw new Error("Target element to observe should be a valid DOM Node"); 19984 var n = Object.assign({}, { viewport: null, modTop: "0px", modRight: "0px", modBottom: "0px", modLeft: "0px", threshold: [0] }, e2), i = n.viewport, a = n.modTop, u = n.modLeft, s = n.modBottom, f = n.modRight, d = n.threshold; 19985 if (!Array.isArray(d) && "number" != typeof d) throw new Error("threshold should be a number or an array of numbers"); 19986 var h = Array.isArray(d) ? d.map(function(o3) { 19987 return Math.floor(o3 % 101) / 100; 19988 }) : [Math.floor(d ? d % 101 : 0) / 100], c = Math.min.apply(Math, h), m = { root: i instanceof Node ? i : null, rootMargin: a + " " + f + " " + s + " " + u, threshold: h }, l = new IntersectionObserver(function(e3, n2) { 19989 var i2 = e3.filter(function(r2) { 19990 return r2.target === o2; 19991 })[0], a2 = function() { 19992 return n2.unobserve(o2); 19993 }; 19994 i2 && (i2.isInViewport = i2.isIntersecting && i2.intersectionRatio >= c, i2.isInViewport ? r(i2, a2, o2) : t3(i2, a2, o2)); 19995 }, m); 19996 return l.observe(o2), function() { 19997 return l.unobserve(o2); 19998 }; 19999 } 20000 20001
20001// src/fairtrade_provider/js/Base/ContentObjects/StatisticsCounter.js 20002 var StatisticsCounter = class _StatisticsCounter { 20003 // --- Defaults --- 20004 static get defaults() { 20005 return Object.freeze({ 20006 tag: "fairtrade-provider-statistics-counter", 20007 debug: false 20008 }); 20009 } 20010 // --- Public --- 20011 constructor(statisticsCounter, options) { 20012 this.$statisticsCounter = (0, import_jquery25.default)(statisticsCounter); 20013 this.options = Object.assign({}, _StatisticsCounter.defaults, options); 20014 this.initialize(); 20015 } 20016 // --- Private --- 20017 initialize() { 20018 this.$items = this.$statisticsCounter.find(`.${this.options.tag}__number`); 20019 this.duration = this.$statisticsCounter.attr("duration") || 1e4; 20020 this.easing = this.$statisticsCounter.attr("easing") || "swing"; 20021 if (typeof window.IntersectionObserver === "function") { 20022 this.setupIntersectionObserver(); 20023 } else { 20024 this.run(); 20025 } 20026 } 20027 setupIntersectionObserver() { 20028 const self = this; 20029 const element = this.$statisticsCounter.get(0); 20030 o( 20031 element, 20032 (...args) => { 20033 self.run(); 20034 }, 20035 (...args) => { 20036 self.stop(element, args); 20037 }, 20038 { 20039 viewport: document.querySelector("body-main"), 20040 threshold: [100, 25, 75] 20041 } 20042 ); 20043 } 20044 run() { 20045 const self = this; 20046 this.$items.each(function() { 20047 const $item = (0, import_jquery25.default)(this); 20048 const number = (0, import_jquery25.default)(this).data("number"); 20049 $item.prop("Counter", 0).animate({ 20050 Counter: number 20051 }, { 20052 duration: self.duration, 20053 easing: self.easing, 20054 step: function(now2) { 20055 $item.text(Math.ceil(now2).toLocaleString("en-GB")); 20056 } 20057 }); 20058 }); 20059 } 20060 stop(element, args) { 20061 this.$items.text("0"); 20062 } 20063 }; 20064 import_jquery25.default.fn.statisticsCounterify = function(options) { 20065 this.each(function() { 20066 const element = (0, import_jquery25.default)(this); 20067 if (typeof element.data("statisticsCounterify") === "undefined") { 20068 const instance2 = new StatisticsCounter(this, options); 20069 element.data("statisticsCounterify", instance2); 20070 } 20071 }); 20072 return this; 20073 }; 20074 20075
20075// src/fairtrade_provider/js/Base.js 20076 var $document = (0, import_jquery26.default)(window.document); 20077 function body() { 20078 } 20079 function elements() { 20080 } 20081 function components() { 20082 $document.find(".t3v-base-icon__source, .t3v-base-label__icon").svgify(); 20083 $document.find(".table").tablify(); 20084 } 20085 function gridElements() { 20086 $document.find(".t3v-base-bar-grid-element").barGridElementify(); 20087 $document.find(".t3v-base-cascading-layout-grid-element").cascadingLayoutGridElementify(); 20088 $document.find(".t3v-base-flyout-grid-element").flyoutGridElementify(); 20089 $document.find(".t3v-base-header-grid-element").headerGridElementify(); 20090 $document.find(".t3v-base-modal-grid-element").modalGridElementify(); 20091 $document.find(".t3v-content-accord-grid-element").accordGridElementify(); 20092 $document.find(".t3v-content-event-grid-element").eventGridElementify(); 20093 $document.find(".t3v-content-session-grid-element").sessionGridElementify(); 20094 } 20095 function contentElements() { 20096 } 20097 function contentObjects() { 20098 $document.find(".t3v-base-link").linkify(); 20099 $document.find(".t3v-base-search-bar").searchBarify(); 20100 $document.find(".t3v-content-carousel").carouselify(); 20101 $document.find(".t3v-content-slider").sliderify(); 20102 $document.find(".media-gallery").mediaGallerify(); 20103 $document.find(".t3v-navigations-mobile-navigation").mobileNavigatify(); 20104 $document.find(".t3v-showcase-partner-carousel").carouselify(); 20105 $document.find(".fairtrade-provider-lead-form").leadFormify(); 20106 $document.find(".fairtrade-provider-facebook-gallery").facebookGalleryify(); 20107 $document.find(".fairtrade-provider-masonry-gallery").masonryGalleryify().mediaGallerify(); 20108 $document.find(".fairtrade-provider-media-video-playlist").mediaVideoPlaylistify(); 20109 $document.find(".fairtrade-provider-statistics-counter").statisticsCounterify(); 20110 $document.find(".fairtrade-provider-cookie-banner").cookieBannerify(); 20111 $document.chatButtonStylingify({ debug: false }); 20112 } 20113 function layouts() { 20114 } 20115 function sites() { 20116 } 20117 function setup() { 20118 body(); 20119 elements(); 20120 components(); 20121 gridElements(); 20122 contentElements(); 20123 contentObjects(); 20124 layouts(); 20125 sites(); 20126 } 20127 import_jquery26.default.when(import_jquery26.default.ready).then(function() { 20128 i18next_default.use(Browser).init(settings.i18n).then(function() { 20129 window.i18n = i18next_default; 20130 setup(); 20131 }); 20132 }); 20133})(); 20134/*! Bundled license information: 20135 20136jquery/dist/jquery.js: 20137 (*! 20138 * jQuery JavaScript Library v3.7.0 20139 * https://jquery.com/ 20140 * 20141 * Copyright OpenJS Foundation and other contributors 20142 * Released under the MIT license 20143 * https://jquery.org/license 20144 * 20145 * Date: 2023-05-11T18:29Z 20146 *) 20147 20148jquery-validation/dist/jquery.validate.js: 20149 (*! 20150 * jQuery Validation Plugin v1.19.5 20151 * 20152 * https://jqueryvalidation.org/ 20153 * 20154 * Copyright (c) 2022 Jörn Zaefferer 20155 * Released under the MIT license 20156 *) 20157 20158tablesaw/dist/tablesaw.jquery.js: 20159 (*! Tablesaw - v3.1.2 - 2019-03-19 20160 * https://github.com/filamentgroup/tablesaw 20161 * Copyright (c) 2019 Filament Group; Licensed MIT *) 20162 20163get-size/get-size.js: 20164 (*! 20165 * getSize v2.0.3 20166 * measure size of elements 20167 * MIT license 20168 *) 20169 20170outlayer/outlayer.js: 20171 (*! 20172 * Outlayer v2.1.1 20173 * the brains and guts of a layout library 20174 * MIT license 20175 *) 20176 20177masonry-layout/masonry.js: 20178 (*! 20179 * Masonry v4.2.2 20180 * Cascading grid layout library 20181 * https://masonry.desandro.com 20182 * MIT License 20183 * by David DeSandro 20184 *) 20185 20186jquery.cookie/jquery.cookie.js: 20187 (*! 20188 * jQuery Cookie Plugin v1.4.1 20189 * https://github.com/carhartl/jquery-cookie 20190 * 20191 * Copyright 2013 Klaus Hartl 20192 * Released under the MIT license 20193 *) 20194 20195is-buffer/index.js: 20196 (*! 20197 * Determine if an object is a Buffer 20198 * 20199 * @author Feross Aboukhadijeh <https://feross.org> 20200 * @license MIT 20201 *) 20202 20203jquery-colorbox/jquery.colorbox.js: 20204 (*! 20205 Colorbox 1.6.4 20206 license: MIT 20207 http://www.jacklmoore.com/colorbox 20208 *) 20209 20210waypoints/lib/jquery.waypoints.js: 20211 (*! 20212 Waypoints - 4.0.1 20213 Copyright © 2011-2016 Caleb Troughton 20214 Licensed under the MIT license. 20215 https://github.com/imakewebthings/waypoints/blob/master/licenses.txt 20216 *) 20217 20218@glidejs/glide/dist/glide.esm.js: 20219 (*! 20220 * Glide.js v3.6.0 20221 * (c) 2013-2022 JÄdrzej ChaÅubek (https://github.com/jedrzejchalubek/) 20222 * Released under the MIT License. 20223 *) 20224*/
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.