1/*! 2* jquery.inputmask.js 3* http://github.com/RobinHerbots/jquery.inputmask 4* Copyright (c) 2010 - 2015 Robin Herbots 5* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php) 6* Version: 3.1.60 7*/ 8!function(factory) { 9 "function" == typeof define && define.amd ? define([ "jquery" ], factory) : factory(jQuery); 10}(function($) { 11 function isInputEventSupported(eventName) { 12 var el = document.createElement("input"), evName = "on" + eventName, isSupported = evName in el; 13 return isSupported || (el.setAttribute(evName, "return;"), isSupported = "function" == typeof el[evName]), 14 el = null, isSupported; 15 } 16 function isInputTypeSupported(inputType) { 17 var isSupported = "text" == inputType || "tel" == inputType; 18 if (!isSupported) { 19 var el = document.createElement("input"); 20 el.setAttribute("type", inputType), isSupported = "text" === el.type, el = null; 21 } 22 return isSupported; 23 } 24 function resolveAlias(aliasStr, options, opts) { 25 var aliasDefinition = opts.aliases[aliasStr]; 26 return aliasDefinition ? (aliasDefinition.alias && resolveAlias(aliasDefinition.alias, void 0, opts), 27 $.extend(!0, opts, aliasDefinition), $.extend(!0, opts, options), !0) : !1; 28 } 29 function generateMaskSet(opts) { 30 function analyseMask(mask) { 31 function maskToken(isGroup, isOptional, isQuantifier, isAlternator) { 32 this.matches = [], this.isGroup = isGroup || !1, this.isOptional = isOptional || !1, 33 this.isQuantifier = isQuantifier || !1, this.isAlternator = isAlternator || !1, 34 this.quantifier = { 35 min: 1, 36 max: 1 37 }; 38 } 39 function insertTestDefinition(mtoken, element, position) { 40 var maskdef = opts.definitions[element], newBlockMarker = 0 == mtoken.matches.length; 41 if (position = void 0 != position ? position : mtoken.matches.length, maskdef && !escaped) { 42 maskdef.placeholder = $.isFunction(maskdef.placeholder) ? maskdef.placeholder.call(this, opts) : maskdef.placeholder; 43 for (var prevalidators = maskdef.prevalidator, prevalidatorsL = prevalidators ? prevalidators.length : 0, i = 1; i < maskdef.cardinality; i++) { 44 var prevalidator = prevalidatorsL >= i ? prevalidators[i - 1] : [], validator = prevalidator.validator, cardinality = prevalidator.cardinality; 45 mtoken.matches.splice(position++, 0, { 46 fn: validator ? "string" == typeof validator ? new RegExp(validator) : new function() { 47 this.test = validator; 48 }() : new RegExp("."), 49 cardinality: cardinality ? cardinality : 1, 50 optionality: mtoken.isOptional, 51 newBlockMarker: newBlockMarker, 52 casing: maskdef.casing, 53 def: maskdef.definitionSymbol || element, 54 placeholder: maskdef.placeholder, 55 mask: element 56 }); 57 } 58 mtoken.matches.splice(position++, 0, { 59 fn: maskdef.validator ? "string" == typeof maskdef.validator ? new RegExp(maskdef.validator) : new function() { 60 this.test = maskdef.validator; 61 }() : new RegExp("."), 62 cardinality: maskdef.cardinality, 63 optionality: mtoken.isOptional, 64 newBlockMarker: newBlockMarker, 65 casing: maskdef.casing, 66 def: maskdef.definitionSymbol || element, 67 placeholder: maskdef.placeholder, 68 mask: element 69 }); 70 } else mtoken.matches.splice(position++, 0, { 71 fn: null, 72 cardinality: 0, 73 optionality: mtoken.isOptional, 74 newBlockMarker: newBlockMarker, 75 casing: null, 76 def: element, 77 placeholder: void 0, 78 mask: element 79 }), escaped = !1; 80 } 81 for (var match, m, openingToken, currentOpeningToken, alternator, lastMatch, tokenizer = /(?:[?*+]|\{[0-9\+\*]+(?:,[0-9\+\*]*)?\})\??|[^.?*+^${[]()|\\]+|./g, escaped = !1, currentToken = new maskToken(), openenings = [], maskTokens = []; match = tokenizer.exec(mask); ) switch (m = match[0], 82 m.charAt(0)) { 83 case opts.optionalmarker.end: 84 case opts.groupmarker.end: 85 if (openingToken = openenings.pop(), openenings.length > 0) { 86 if (currentOpeningToken = openenings[openenings.length - 1], currentOpeningToken.matches.push(openingToken), 87 currentOpeningToken.isAlternator) { 88 alternator = openenings.pop(); 89 for (var mndx = 0; mndx < alternator.matches.length; mndx++) alternator.matches[mndx].isGroup = !1; 90 openenings.length > 0 ? (currentOpeningToken = openenings[openenings.length - 1], 91 currentOpeningToken.matches.push(alternator)) : currentToken.matches.push(alternator); 92 } 93 } else currentToken.matches.push(openingToken); 94 break; 95 96 case opts.optionalmarker.start: 97 openenings.push(new maskToken(!1, !0)); 98 break; 99 100 case opts.groupmarker.start: 101 openenings.push(new maskToken(!0)); 102 break; 103 104 case opts.quantifiermarker.start: 105 var quantifier = new maskToken(!1, !1, !0); 106 m = m.replace(/[{}]/g, ""); 107 var mq = m.split(","), mq0 = isNaN(mq[0]) ? mq[0] : parseInt(mq[0]), mq1 = 1 == mq.length ? mq0 : isNaN(mq[1]) ? mq[1] : parseInt(mq[1]); 108 if (("*" == mq1 || "+" == mq1) && (mq0 = "*" == mq1 ? 0 : 1), quantifier.quantifier = { 109 min: mq0, 110 max: mq1 111 }, openenings.length > 0) { 112 var matches = openenings[openenings.length - 1].matches; 113 if (match = matches.pop(), !match.isGroup) { 114 var groupToken = new maskToken(!0); 115 groupToken.matches.push(match), match = groupToken; 116 } 117 matches.push(match), matches.push(quantifier); 118 } else { 119 if (match = currentToken.matches.pop(), !match.isGroup) { 120 var groupToken = new maskToken(!0); 121 groupToken.matches.push(match), match = groupToken; 122 } 123 currentToken.matches.push(match), currentToken.matches.push(quantifier); 124 } 125 break; 126 127 case opts.escapeChar: 128 escaped = !0; 129 break; 130 131 case opts.alternatormarker: 132 openenings.length > 0 ? (currentOpeningToken = openenings[openenings.length - 1], 133 lastMatch = currentOpeningToken.matches.pop()) : lastMatch = currentToken.matches.pop(), 134 lastMatch.isAlternator ? openenings.push(lastMatch) : (alternator = new maskToken(!1, !1, !1, !0), 135 alternator.matches.push(lastMatch), openenings.push(alternator)); 136 break; 137 138 default: 139 if (openenings.length > 0) { 140 if (currentOpeningToken = openenings[openenings.length - 1], currentOpeningToken.matches.length > 0 && (lastMatch = currentOpeningToken.matches[currentOpeningToken.matches.length - 1], 141 lastMatch.isGroup && (lastMatch.isGroup = !1, insertTestDefinition(lastMatch, opts.groupmarker.start, 0), 142 insertTestDefinition(lastMatch, opts.groupmarker.end))), insertTestDefinition(currentOpeningToken, m), 143 currentOpeningToken.isAlternator) { 144 alternator = openenings.pop(); 145 for (var mndx = 0; mndx < alternator.matches.length; mndx++) alternator.matches[mndx].isGroup = !1; 146 openenings.length > 0 ? (currentOpeningToken = openenings[openenings.length - 1], 147 currentOpeningToken.matches.push(alternator)) : currentToken.matches.push(alternator); 148 } 149 } else currentToken.matches.length > 0 && (lastMatch = currentToken.matches[currentToken.matches.length - 1], 150 lastMatch.isGroup && (lastMatch.isGroup = !1, insertTestDefinition(lastMatch, opts.groupmarker.start, 0), 151 insertTestDefinition(lastMatch, opts.groupmarker.end))), insertTestDefinition(currentToken, m); 152 } 153 return currentToken.matches.length > 0 && (lastMatch = currentToken.matches[currentToken.matches.length - 1], 154 lastMatch.isGroup && (lastMatch.isGroup = !1, insertTestDefinition(lastMatch, opts.groupmarker.start, 0), 155 insertTestDefinition(lastMatch, opts.groupmarker.end)), maskTokens.push(currentToken)), 156 maskTokens; 157 } 158 function generateMask(mask, metadata) { 159 if (void 0 == mask || "" == mask) return void 0; 160 if (1 == mask.length && 0 == opts.greedy && 0 != opts.repeat && (opts.placeholder = ""), 161 opts.repeat >
161 0 || "*" == opts.repeat || "+" == opts.repeat) { 162 var repeatStart = "*" == opts.repeat ? 0 : "+" == opts.repeat ? 1 : opts.repeat; 163 mask = opts.groupmarker.start + mask + opts.groupmarker.end + opts.quantifiermarker.start + repeatStart + "," + opts.repeat + opts.quantifiermarker.end; 164 } 165 return void 0 == $.inputmask.masksCache[mask] && ($.inputmask.masksCache[mask] = { 166 mask: mask, 167 maskToken: analyseMask(mask), 168 validPositions: {}, 169 _buffer: void 0, 170 buffer: void 0, 171 tests: {}, 172 metadata: metadata 173 }), $.extend(!0, {}, $.inputmask.masksCache[mask]); 174 } 175 function preProcessMask(mask) { 176 if (mask = mask.toString(), opts.numericInput) { 177 mask = mask.split("").reverse(); 178 for (var ndx = 0; ndx < mask.length; ndx++) mask[ndx] == opts.optionalmarker.start ? mask[ndx] = opts.optionalmarker.end : mask[ndx] == opts.optionalmarker.end ? mask[ndx] = opts.optionalmarker.start : mask[ndx] == opts.groupmarker.start ? mask[ndx] = opts.groupmarker.end : mask[ndx] == opts.groupmarker.end && (mask[ndx] = opts.groupmarker.start); 179 mask = mask.join(""); 180 } 181 return mask; 182 } 183 var ms = void 0; 184 if ($.isFunction(opts.mask) && (opts.mask = opts.mask.call(this, opts)), $.isArray(opts.mask)) { 185 if (opts.mask.length > 1) { 186 opts.keepStatic = void 0 == opts.keepStatic ? !0 : opts.keepStatic; 187 var altMask = "("; 188 return $.each(opts.mask, function(ndx, msk) { 189 altMask.length > 1 && (altMask += ")|("), altMask += preProcessMask(void 0 == msk.mask || $.isFunction(msk.mask) ? msk : msk.mask); 190 }), altMask += ")", generateMask(altMask, opts.mask); 191 } 192 opts.mask = opts.mask.pop(); 193 } 194 return opts.mask && (ms = void 0 == opts.mask.mask || $.isFunction(opts.mask.mask) ? generateMask(preProcessMask(opts.mask), opts.mask) : generateMask(preProcessMask(opts.mask.mask), opts.mask)), 195 ms; 196 } 197 function maskScope(actionObj, maskset, opts) { 198 function getMaskTemplate(baseOnInput, minimalPos, includeInput) { 199 minimalPos = minimalPos || 0; 200 var ndxIntlzr, test, testPos, maskTemplate = [], pos = 0; 201 do { 202 if (baseOnInput === !0 && getMaskSet().validPositions[pos]) { 203 var validPos = getMaskSet().validPositions[pos]; 204 test = validPos.match, ndxIntlzr = validPos.locator.slice(), maskTemplate.push(includeInput === !0 ? validPos.input : getPlaceholder(pos, test)); 205 } else testPos = getTestTemplate(pos, ndxIntlzr, pos - 1), test = testPos.match, 206 ndxIntlzr = testPos.locator.slice(), maskTemplate.push(getPlaceholder(pos, test)); 207 pos++; 208 } while ((void 0 == maxLength || maxLength > pos - 1) && null != test.fn || null == test.fn && "" != test.def || minimalPos >= pos); 209 return maskTemplate.pop(), maskTemplate; 210 } 211 function getMaskSet() { 212 return maskset; 213 } 214 function resetMaskSet(soft) { 215 var maskset = getMaskSet(); 216 maskset.buffer = void 0, maskset.tests = {}, soft !== !0 && (maskset._buffer = void 0, 217 maskset.validPositions = {}, maskset.p = 0); 218 } 219 function getLastValidPosition(closestTo) { 220 var maskset = getMaskSet(), lastValidPosition = -1, valids = maskset.validPositions; 221 void 0 == closestTo && (closestTo = -1); 222 var before = lastValidPosition, after = lastValidPosition; 223 for (var posNdx in valids) { 224 var psNdx = parseInt(posNdx); 225 (-1 == closestTo || null != valids[psNdx].match.fn) && (closestTo >= psNdx && (before = psNdx), 226 psNdx >= closestTo && (after = psNdx)); 227 } 228 return lastValidPosition = -1 != before && closestTo - before > 1 || closestTo > after ? before : after; 229 } 230 function setValidPosition(pos, validTest, fromSetValid) { 231 if (opts.insertMode && void 0 != getMaskSet().validPositions[pos] && void 0 == fromSetValid) { 232 var i, positionsClone = $.extend(!0, {}, getMaskSet().validPositions), lvp = getLastValidPosition(); 233 for (i = pos; lvp >= i; i++) delete getMaskSet().validPositions[i]; 234 getMaskSet().validPositions[pos] = validTest; 235 var j, valid = !0; 236 for (i = pos; lvp >= i; i++) {
237 var t = positionsClone[i]; 238 if (void 0 != t) { 239 var vps = getMaskSet().validPositions; 240 j = !opts.keepStatic && vps[i] && (void 0 != vps[i + 1] && getTests(i + 1, vps[i].locator.slice(), i).length > 1 || void 0 != vps[i].alternation) ? i + 1 : seekNext(i), 241 valid = positionCanMatchDefinition(j, t.match.def) ? valid && isValid(j, t.input, !0, !0) !== !1 : null == t.match.fn; 242 } 243 if (!valid) break; 244 } 245 if (!valid) return getMaskSet().validPositions = $.extend(!0, {}, positionsClone), 246 !1; 247 } else getMaskSet().validPositions[pos] = validTest; 248 return !0; 249 } 250 function stripValidPositions(start, end, nocheck, strict) { 251 var i, startPos = start; 252 getMaskSet().p = start, void 0 != getMaskSet().validPositions[start] && getMaskSet().validPositions[start].input == opts.radixPoint && (end++, 253 startPos++); 254 for (i = startPos; end > i; i++) void 0 != getMaskSet().validPositions[i] && (nocheck === !0 || 0 != opts.canClearPosition(getMaskSet(), i, getLastValidPosition(), strict, opts)) && delete getMaskSet().validPositions[i]; 255 for (resetMaskSet(!0), i = startPos + 1; i <= getLastValidPosition(); ) { 256 for (;void 0 != getMaskSet().validPositions[startPos]; ) startPos++; 257 var s = getMaskSet().validPositions[startPos]; 258 startPos > i && (i = startPos + 1); 259 var t = getMaskSet().validPositions[i]; 260 void 0 != t && void 0 == s ? (positionCanMatchDefinition(startPos, t.match.def) && isValid(startPos, t.input, !0) !== !1 && (delete getMaskSet().validPositions[i], 261 i++), startPos++) : i++; 262 } 263 var lvp = getLastValidPosition(); 264 lvp >= start && void 0 != getMaskSet().validPositions[lvp] && getMaskSet().validPositions[lvp].input == opts.radixPoint && delete getMaskSet().validPositions[lvp], 265 resetMaskSet(!0); 266 } 267 function getTestTemplate(pos, ndxIntlzr, tstPs) { 268 for (var testPos, testPositions = getTests(pos, ndxIntlzr, tstPs), lvp = getLastValidPosition(), lvTest = getMaskSet().validPositions[lvp] || getTests(0)[0], lvTestAltArr = void 0 != lvTest.alternation ? lvTest.locator[lvTest.alternation].split(",") : [], ndx = 0; ndx < testPositions.length && (testPos = testPositions[ndx], 269 !(testPos.match && (opts.greedy && testPos.match.optionalQuantifier !== !0 || (testPos.match.optionality === !1 || testPos.match.newBlockMarker === !1) && testPos.match.optionalQuantifier !== !0) && (void 0 == lvTest.alternation || void 0 != testPos.locator[lvTest.alternation] && checkAlternationMatch(testPos.locator[lvTest.alternation].toString().split(","), lvTestAltArr)))); ndx++) ; 270 return testPos; 271 } 272 function getTest(pos) { 273 return getMaskSet().validPositions[pos] ? getMaskSet().validPositions[pos].match : getTests(pos)[0].match; 274 } 275 function positionCanMatchDefinition(pos, def) { 276 for (var valid = !1, tests = getTests(pos), tndx = 0; tndx < tests.length; tndx++) if (tests[tndx].match && tests[tndx].match.def == def) { 277 valid = !0; 278 break; 279 } 280 return valid; 281 } 282 function getTests(pos, ndxIntlzr, tstPs) { 283 function ResolveTestFromToken(maskToken, ndxInitializer, loopNdx, quantifierRecurse) { 284 function handleMatch(match, loopNdx, quantifierRecurse) { 285 if (testPos > 1e4) return alert("jquery.inputmask: There is probably an error in your mask definition or in the code. Create an issue on github with an example of the mask you are using. " + getMaskSet().mask), 286 !0; 287 if (testPos == pos && void 0 == match.matches) return matches.push({ 288 match: match, 289 locator: loopNdx.reverse() 290 }), !0; 291 if (void 0 != match.matches) { 292 if (match.isGroup && quantifierRecurse !== !0) { 293 if (match = handleMatch(maskToken.matches[tndx + 1], loopNdx)) return !0; 294 } else if (match.isOptional) { 295 var optionalToken = match; 296 if (match = ResolveTestFromToken(match, ndxInitializer, loopNdx, quantifierRecurse)) { 297 var latestMatch = matches[matches.length - 1].match, isFirstMatch = 0 == $.inArray(latestMatch, optionalToken.matches); 298 isFirstMatch && (insertStop = !0), testPos = pos; 299 } 300 } else if (match.isAlternator) { 301 var maltMatches, alternateToken = match, malternateMatches = [], currentMatches = matches.slice(), loopNdxCnt = loopNdx.length, altIndex = ndxInitializer.length > 0 ? ndxInitializer.shift() : -1; 302 if (-1 == altIndex || "string" == typeof altIndex) { 303 var altIndexArr, currentPos = testPos, ndxInitializerClone = ndxInitializer.slice(); 304 "string" == typeof altIndex && (altIndexArr = altIndex.split(",")); 305 for (var amndx = 0;
305 amndx < alternateToken.matches.length; amndx++) { 306 matches = [], match = handleMatch(alternateToken.matches[amndx], [ amndx ].concat(loopNdx), quantifierRecurse) || match, 307 maltMatches = matches.slice(), testPos = currentPos, matches = []; 308 for (var i = 0; i < ndxInitializerClone.length; i++) ndxInitializer[i] = ndxInitializerClone[i]; 309 for (var ndx1 = 0; ndx1 < maltMatches.length; ndx1++) for (var altMatch = maltMatches[ndx1], ndx2 = 0; ndx2 < malternateMatches.length; ndx2++) { 310 var altMatch2 = malternateMatches[ndx2]; 311 if (altMatch.match.mask == altMatch2.match.mask && ("string" != typeof altIndex || -1 != $.inArray(altMatch.locator[loopNdxCnt].toString(), altIndexArr))) { 312 maltMatches.splice(ndx1, 1), altMatch2.locator[loopNdxCnt] = altMatch2.locator[loopNdxCnt] + "," + altMatch.locator[loopNdxCnt], 313 altMatch2.alternation = loopNdxCnt; 314 break; 315 } 316 } 317 malternateMatches = malternateMatches.concat(maltMatches); 318 } 319 "string" == typeof altIndex && (malternateMatches = $.map(malternateMatches, function(lmnt, ndx) { 320 if (isFinite(ndx)) { 321 var mamatch, altLocArr = lmnt.locator[loopNdxCnt].toString().split(","); 322 lmnt.locator[loopNdxCnt] = void 0, lmnt.alternation = void 0; 323 for (var alndx = 0; alndx < altLocArr.length; alndx++) mamatch = -1 != $.inArray(altLocArr[alndx], altIndexArr), 324 mamatch && (void 0 != lmnt.locator[loopNdxCnt] ? (lmnt.locator[loopNdxCnt] += ",", 325 lmnt.alternation = loopNdxCnt, lmnt.locator[loopNdxCnt] += altLocArr[alndx]) : lmnt.locator[loopNdxCnt] = parseInt(altLocArr[alndx])); 326 if (void 0 != lmnt.locator[loopNdxCnt]) return lmnt; 327 } 328 })), matches = currentMatches.concat(malternateMatches), insertStop = !0; 329 } else match = handleMatch(alternateToken.matches[altIndex], [ altIndex ].concat(loopNdx), quantifierRecurse); 330 if (match) return !0; 331 } else if (match.isQuantifier && quantifierRecurse !== !0) for (var qt = match, qndx = ndxInitializer.length > 0 && quantifierRecurse !== !0 ? ndxInitializer.shift() : 0; qndx < (isNaN(qt.quantifier.max) ? qndx + 1 : qt.quantifier.max) && pos >= testPos; qndx++) { 332 var tokenGroup = maskToken.matches[$.inArray(qt, maskToken.matches) - 1]; 333 if (match = handleMatch(tokenGroup, [ qndx ].concat(loopNdx), !0)) { 334 var latestMatch = matches[matches.length - 1].match; 335 latestMatch.optionalQuantifier = qndx > qt.quantifier.min - 1; 336 var isFirstMatch = 0 == $.inArray(latestMatch, tokenGroup.matches); 337 if (isFirstMatch) { 338 if (qndx > qt.quantifier.min - 1) { 339 insertStop = !0, testPos = pos; 340 break; 341 } 342 return !0; 343 } 344 return !0; 345 } 346 } else if (match = ResolveTestFromToken(match, ndxInitializer, loopNdx, quantifierRecurse)) return !0; 347 } else testPos++; 348 } 349 for (var tndx = ndxInitializer.length > 0 ? ndxInitializer.shift() : 0; tndx < maskToken.matches.length; tndx++) if (maskToken.matches[tndx].isQuantifier !== !0) { 350 var match = handleMatch(maskToken.matches[tndx], [ tndx ].concat(loopNdx), quantifierRecurse); 351 if (match && testPos == pos) return match; 352 if (testPos > pos) break; 353 } 354 } 355 var maskTokens = getMaskSet().maskToken, testPos = ndxIntlzr ? tstPs : 0, ndxInitializer = ndxIntlzr || [ 0 ], matches = [], insertStop = !1; 356 if (void 0 == ndxIntlzr) { 357 for (var test, previousPos = pos - 1; void 0 == (test = getMaskSet().validPositions[previousPos]) && previousPos > -1; ) previousPos--; 358 if (void 0 != test && previousPos > -1) testPos = previousPos, ndxInitializer = test.locator.slice(); else { 359 for (previousPos = pos - 1; void 0 == (test = getMaskSet().tests[previousPos]) && previousPos > -1; ) previousPos--; 360 void 0 != test && previousPos > -1 && (testPos = previousPos, ndxInitializer = test[0].locator.slice()); 361 } 362 } 363 for (var mtndx = ndxInitializer.shift(); mtndx < maskTokens.length; mtndx++) { 364 var match = ResolveTestFromToken(maskTokens[mtndx], ndxInitializer, [ mtndx ]); 365 if (match && testPos == pos || testPos > pos) break; 366 } 367 return (0 == matches.length || insertStop) && matches.push({ 368 match: { 369 fn: null, 370 cardinality: 0, 371 optionality: !0, 372 casing: null, 373 def: "" 374 }, 375 locator: [] 376 }), getMaskSet().tests[pos] = $.extend(!0, [], matches), getMaskSet().tests[pos]; 377 } 378 function getBufferTemplate() { 379 return void 0 == getMaskSet()._buffer && (getMaskSet()._buffer = getMaskTemplate(!1, 1)), 380 getMaskSet()._buffer; 381 } 382 function getBuffer() { 383 return void 0 == getMaskSet().buffer && (getMaskSet().buffer = getMaskTemplate(!0, getLastValidPosition(), !0)), 384 getMaskSet().buffer; 385 } 386 function refreshFromBuffer(start, end, buffer) { 387 if (buffer = buffer || getBuffer().slice(), start === !0) resetMaskSet(), start = 0, 388 end = buffer.length; else for (var i = start; end > i; i++) delete getMaskSet().validPositions[i], 389 delete getMaskSet().tests[i]; 390 for (var i = start; end > i; i++) buffer[i] != opts.skipOptionalPartCharacter && isValid(i, buffer[i], !0, !0); 391 } 392 function casing(elem, test) { 393 switch (test.casing) { 394 case "upper": 395 elem = elem.toUpperCase(); 396 break; 397 398 case "lower": 399 elem = elem.toLowerCase(); 400 } 401 return elem; 402 } 403 function checkAlternationMatch(altArr1, altArr2) { 404 for (var altArrC = opts.greedy ? altArr2 : altArr2.slice(0, 1), isMatch = !1, alndx = 0; alndx < altArr1.length;
404 alndx++) if (-1 != $.inArray(altArr1[alndx], altArrC)) { 405 isMatch = !0; 406 break; 407 } 408 return isMatch; 409 } 410 function isValid(pos, c, strict, fromSetValid) { 411 function _isValid(position, c, strict, fromSetValid) { 412 var rslt = !1; 413 return $.each(getTests(position), function(ndx, tst) { 414 for (var test = tst.match, loopend = c ? 1 : 0, chrs = "", i = (getBuffer(), test.cardinality); i > loopend; i--) chrs += getBufferElement(position - (i - 1)); 415 if (c && (chrs += c), rslt = null != test.fn ? test.fn.test(chrs, getMaskSet(), position, strict, opts) : c != test.def && c != opts.skipOptionalPartCharacter || "" == test.def ? !1 : { 416 c: test.def, 417 pos: position 418 }, rslt !== !1) { 419 var elem = void 0 != rslt.c ? rslt.c : c; 420 elem = elem == opts.skipOptionalPartCharacter && null === test.fn ? test.def : elem; 421 var validatedPos = position; 422 if (void 0 != rslt.remove && stripValidPositions(rslt.remove, rslt.remove + 1, !0), 423 rslt.refreshFromBuffer) { 424 var refresh = rslt.refreshFromBuffer; 425 if (strict = !0, refreshFromBuffer(refresh === !0 ? refresh : refresh.start, refresh.end), 426 void 0 == rslt.pos && void 0 == rslt.c) return rslt.pos = getLastValidPosition(), 427 !1; 428 if (validatedPos = void 0 != rslt.pos ? rslt.pos : position, validatedPos != position) return rslt = $.extend(rslt, isValid(validatedPos, elem, !0)), 429 !1; 430 } else if (rslt !== !0 && void 0 != rslt.pos && rslt.pos != position && (validatedPos = rslt.pos, 431 refreshFromBuffer(position, validatedPos), validatedPos != position)) return rslt = $.extend(rslt, isValid(validatedPos, elem, !0)), 432 !1; 433 return 1 != rslt && void 0 == rslt.pos && void 0 == rslt.c ? !1 : (ndx > 0 && resetMaskSet(!0), 434 setValidPosition(validatedPos, $.extend({}, tst, { 435 input: casing(elem, test) 436 }), fromSetValid) || (rslt = !1), !1); 437 } 438 }), rslt; 439 } 440 function alternate(pos, c, strict, fromSetValid) { 441 var lastAlt, alternation, validPsClone = $.extend(!0, {}, getMaskSet().validPositions); 442 for (lastAlt = getLastValidPosition(); lastAlt >= 0; lastAlt--) if (getMaskSet().validPositions[lastAlt] && void 0 != getMaskSet().validPositions[lastAlt].alternation) { 443 alternation = getMaskSet().validPositions[lastAlt].alternation; 444 break; 445 } 446 if (void 0 != alternation) for (var decisionPos in getMaskSet().validPositions) if (parseInt(decisionPos) > parseInt(lastAlt) && void 0 === getMaskSet().validPositions[decisionPos].alternation) { 447 for (var altPos = getMaskSet().validPositions[decisionPos], decisionTaker = altPos.locator[alternation], altNdxs = getMaskSet().validPositions[lastAlt].locator[alternation].split(","), mndx = 0; mndx < altNdxs.length; mndx++) if (decisionTaker < altNdxs[mndx]) { 448 for (var possibilityPos, possibilities, dp = decisionPos - 1; dp >= 0; dp--) if (possibilityPos = getMaskSet().validPositions[dp], 449 void 0 != possibilityPos) { 450 possibilities = possibilityPos.locator[alternation], possibilityPos.locator[alternation] = altNdxs[mndx]; 451 break; 452 } 453 if (decisionTaker != possibilityPos.locator[alternation]) { 454 for (var buffer = getBuffer().slice(), i = decisionPos; i < getLastValidPosition() + 1; i++) delete getMaskSet().validPositions[i], 455 delete getMaskSet().tests[i]; 456 resetMaskSet(!0), opts.keepStatic = !opts.keepStatic; 457 for (var i = decisionPos; i < buffer.length; i++) buffer[i] != opts.skipOptionalPartCharacter && isValid(getLastValidPosition() + 1, buffer[i], !1, !0); 458 possibilityPos.locator[alternation] = possibilities; 459 var isValidRslt = isValid(pos, c, strict, fromSetValid); 460 if (opts.keepStatic = !opts.keepStatic, isValidRslt) return isValidRslt; 461 resetMaskSet(), getMaskSet().validPositions = $.extend(!0, {}, validPsClone); 462 } 463 } 464 break; 465 } 466 return !1; 467 } 468 function trackbackAlternations(originalPos, newPos) { 469 for (var vp = getMaskSet().validPositions[newPos], targetL
469ocator = vp.locator, tll = targetLocator.length, ps = originalPos; newPos > ps; ps++) if (!isMask(ps)) { 470 var tests = getTests(ps), bestMatch = tests[0], equality = -1; 471 $.each(tests, function(ndx, tst) { 472 for (var i = 0; tll > i; i++) tst.locator[i] && checkAlternationMatch(tst.locator[i].toString().split(","), targetLocator[i].toString().split(",")) && i > equality && (equality = i, 473 bestMatch = tst); 474 }), setValidPosition(ps, $.extend({}, bestMatch, { 475 input: bestMatch.match.def 476 }), !0); 477 } 478 } 479 strict = strict === !0; 480 for (var buffer = getBuffer(), pndx = pos - 1; pndx > -1 && !getMaskSet().validPositions[pndx]; pndx--) ; 481 for (pndx++; pos > pndx; pndx++) void 0 == getMaskSet().validPositions[pndx] && ((!isMask(pndx) || buffer[pndx] != getPlaceholder(pndx)) && getTests(pndx).length > 1 || buffer[pndx] == opts.radixPoint || "0" == buffer[pndx] && $.inArray(opts.radixPoint, buffer) < pndx) && _isValid(pndx, buffer[pndx], !0); 482 var maskPos = pos, result = !1, positionsClone = $.extend(!0, {}, getMaskSet().validPositions); 483 if (maskPos < getMaskLength() && (result = _isValid(maskPos, c, strict, fromSetValid), 484 !strict && result === !1)) { 485 var currentPosValid = getMaskSet().validPositions[maskPos]; 486 if (!currentPosValid || null != currentPosValid.match.fn || currentPosValid.match.def != c && c != opts.skipOptionalPartCharacter) { 487 if ((opts.insertMode || void 0 == getMaskSet().validPositions[seekNext(maskPos)]) && !isMask(maskPos)) for (var nPos = maskPos + 1, snPos = seekNext(maskPos); snPos >= nPos; nPos++) if (result = _isValid(nPos, c, strict, fromSetValid), 488 result !== !1) { 489 trackbackAlternations(maskPos, nPos), maskPos = nPos; 490 break; 491 } 492 } else result = { 493 caret: seekNext(maskPos) 494 }; 495 } 496 if (result === !1 && opts.keepStatic && isComplete(buffer) && (result = alternate(pos, c, strict, fromSetValid)), 497 result === !0 && (result = { 498 pos: maskPos 499 }), $.isFunction(opts.postValidation) && 0 != result && !strict) { 500 resetMaskSet(!0); 501 var postValidResult = opts.postValidation(getBuffer(), opts); 502 if (!postValidResult) return resetMaskSet(!0), getMaskSet().validPositions = $.extend(!0, {}, positionsClone), 503 !1; 504 } 505 return result; 506 } 507 function isMask(pos) { 508 var test = getTest(pos); 509 return null != test.fn ? test.fn : !1; 510 } 511 function getMaskLength() { 512 var maskLength; 513 maxLength = $el.prop("maxLength"), -1 == maxLength && (maxLength = void 0); 514 var pos, lvp = getLastValidPosition(), testPos = getMaskSet().validPositions[lvp], ndxIntlzr = void 0 != testPos ? testPos.locator.slice() : void 0; 515 for (pos = lvp + 1; void 0 == testPos || null != testPos.match.fn || null == testPos.match.fn && "" != testPos.match.def; pos++) testPos = getTestTemplate(pos, ndxIntlzr, pos - 1), 516 ndxIntlzr = testPos.locator.slice(); 517 return maskLength = pos, void 0 == maxLength || maxLength > maskLength ? maskLength : maxLength; 518 } 519 function seekNext(pos) { 520 var maskL = getMaskLength(); 521 if (pos >= maskL) return maskL; 522 for (var position = pos; ++position < maskL && !isMask(position) && (opts.nojumps !== !0 || opts.nojumpsThreshold > position); ) ; 523 return position; 524 } 525 function seekPrevious(pos) { 526 var position = pos; 527 if (0 >= position) return 0; 528 for (;--position > 0 && !isMask(position); ) ; 529 return position; 530 } 531 function getBufferElement(position) { 532 return void 0 == getMaskSet().validPositions[position] ? getPlaceholder(position) : getMaskSet().validPositions[position].input; 533 } 534 function writeBuffer(input, buffer, caretPos, event, triggerInputEvent) { 535 if (event && $.isFunction(opts.onBeforeWrite)) { 536 var result = opts.onBeforeWrite.call(input, event, buffer, caretPos, opts); 537 if (result) { 538 if (result.refreshFromBuffer) { 539 var refresh = result.refreshFromBuffer; 540 refreshFromBuffer(refresh === !0 ? refresh : refresh.start, refresh.end, result.buffer), 541 resetMaskSet(!0), buffer = getBuffer(); 542 } 543 caretPos = result.caret || caretPos; 544 } 545 } 546 input._valueSet(buffer.join("")), void 0 != caretPos && caret(input, caretPos), 547 triggerInputEvent === !0 && (skipInputEvent = !0, $(input).trigger("input")); 548 } 549 function getPlaceholder(pos, test) { 550 return test = test || getTest(pos), void 0 != test.placeholder ? test.placeholder : null == test.fn ? test.def : opts.placeholder.charAt(pos % opts.placeholder.length); 551 } 552 function checkVal(input, writeOut, strict, nptvl) { 553 function isTemplateMatch() {
554 var isMatch = !1, charCodeNdx = getBufferTemplate().slice(initialNdx, seekNext(initialNdx)).join("").indexOf(charCodes); 555 if (-1 != charCodeNdx && !isMask(initialNdx)) { 556 isMatch = !0; 557 for (var bufferTemplateArr = getBufferTemplate().slice(initialNdx, initialNdx + charCodeNdx), i = 0; i < bufferTemplateArr.length; i++) if (" " != bufferTemplateArr[i]) { 558 isMatch = !1; 559 break; 560 } 561 } 562 return isMatch; 563 } 564 var inputValue = void 0 != nptvl ? nptvl.slice() : input._valueGet().split(""), charCodes = "", initialNdx = 0; 565 resetMaskSet(), getMaskSet().p = seekNext(-1), writeOut && input._valueSet(""); 566 var staticInput = getBufferTemplate().slice(0, seekNext(-1)).join(""), matches = inputValue.join("").match(new RegExp(escapeRegex(staticInput), "g")); 567 matches && matches.length > 0 && (inputValue.splice(0, matches.length * staticInput.length), 568 initialNdx = seekNext(initialNdx)), $.each(inputValue, function(ndx, charCode) { 569 var keypress = $.Event("keypress"); 570 keypress.which = charCode.charCodeAt(0), charCodes += charCode; 571 var lvp = getLastValidPosition(), lvTest = getMaskSet().validPositions[lvp], nextTest = getTestTemplate(lvp + 1, lvTest ? lvTest.locator.slice() : void 0, lvp); 572 if (!isTemplateMatch() || strict) { 573 var pos = strict ? ndx : null == nextTest.match.fn && nextTest.match.optionality && lvp + 1 < getMaskSet().p ? lvp + 1 : getMaskSet().p; 574 keypressEvent.call(input, keypress, !0, !1, strict, pos), initialNdx = pos + 1, 575 charCodes = ""; 576 } else keypressEvent.call(input, keypress, !0, !1, !0, lvp + 1); 577 }), writeOut && writeBuffer(input, getBuffer(), $(input).is(":focus") ? seekNext(getLastValidPosition(0)) : void 0, $.Event("checkval")); 578 } 579 function escapeRegex(str) { 580 return $.inputmask.escapeRegex.call(this, str); 581 } 582 function unmaskedvalue($input) { 583 if ($input.data("_inputmask") && !$input.hasClass("hasDatepicker")) { 584 var umValue = [], vps = getMaskSet().validPositions; 585 for (var pndx in vps) vps[pndx].match && null != vps[pndx].match.fn && umValue.push(vps[pndx].input); 586 var unmaskedValue = (isRTL ? umValue.reverse() : umValue).join(""), bufferValue = (isRTL ? getBuffer().slice().reverse() : getBuffer()).join(""); 587 return $.isFunction(opts.onUnMask) && (unmaskedValue = opts.onUnMask.call($input, bufferValue, unmaskedValue, opts) || unmaskedValue), 588 unmaskedValue; 589 } 590 return $input[0]._valueGet(); 591 } 592 function TranslatePosition(pos) { 593 if (isRTL && "number" == typeof pos && (!opts.greedy || "" != opts.placeholder)) { 594 var bffrLght = getBuffer().length; 595 pos = bffrLght - pos; 596 } 597 return pos; 598 } 599 function caret(input, begin, end) { 600 var range, npt = input.jquery && input.length > 0 ? input[0] : input; 601 if ("number" != typeof begin) return npt.setSelectionRange ? (begin = npt.selectionStart, 602 end = npt.selectionEnd) : document.selection && document.selection.createRange && (range = document.selection.createRange(), 603 begin = 0 - range.duplicate().moveStart("character", -1e5), end = begin + range.text.length), 604 { 605 begin: TranslatePosition(begin), 606 end: TranslatePosition(end) 607 }; 608 if (begin = TranslatePosition(begin), end = TranslatePosition(end), end = "number" == typeof end ? end : begin, 609 $(npt).is(":visible")) { 610 var scrollCalc = $(npt).css("font-size").replace("px", "") * end; 611 npt.scrollLeft = scrollCalc > npt.scrollWidth ? scrollCalc : 0, 0 == opts.insertMode && begin == end && end++, 612 npt.setSelectionRange ? (npt.selectionStart = begin, npt.selectionEnd = end) : npt.createTextRange && (range = npt.createTextRange(), 613 range.collapse(!0), range.moveEnd("character", end), range.moveStart("character", begin), 614 range.select()); 615 } 616 } 617 function determineLastRequiredPosition(returnDefinition) { 618 var pos, testPos, buffer = getBuffer(), bl = buffer.length, lvp = getLastValidPosition(), positions = {}, lvTest = getMaskSet().validPositions[lvp], ndxIntlzr = void 0 != lvTest ? lvTest.locator.slice() : void 0; 619 for (pos = lvp + 1; pos < buffer.length; pos++) testPos = getTestTemplate(pos, ndxIntlzr, pos - 1), 620 ndxIntlzr = testPos.locator.slice(), positions[pos] = $.extend(!0, {}, testPos); 621 var lvTestAltArr = lvTest && void 0 != lvTest.alternation ? lvTest.locator[lvTest.alternation].split(",") : []; 622 for (pos = bl - 1; pos > lvp && (testPos = positions[pos].match, (testPos.optionality || testPos.optionalQuantifier || lvTest && void 0 != lvTest.alternation && void 0 != positions[pos].locator[lvTest.alternation] && -1 != $.inArray(positions[pos].locator[lvTest.alternation].toString(), lvTestAltArr)) && buffer[pos] == getPlaceholder(pos, testPos)); pos--) bl--; 623 return returnDefinition ? { 624 l: bl, 625 def: positions[bl] ? positions[bl].match : void 0 626 } : bl; 627 } 628 function clearOptionalTail(buffer) { 629 for (var rl = determineLastRequiredPosition(), lmib = buffer.length - 1; lmib > rl && !isMask(lmib); lmib--) ; 630 buffer.splice(rl, lmib + 1 - rl); 631 } 632 function isComplete(buffer) { 633 if ($.isFunction(opts.isComplete)) return opts.isComplete.call($el, buffer, opts); 634 if ("*" == opts.repeat) return void 0; 635 { 636 var complete = !1, lrp = determineLastRequiredPosition(!0), aml = seekPrevious(lrp.l); 637 getLastValidPosition(); 638 } 639 if (void 0 == lrp.def || lrp.def.newBlockMarker || lrp.def.optionalQuantifier) { 640 complete = !0; 641 for (var i = 0; aml >= i; i++) { 642 var mask = isMask(i), test = getTest(i); 643 if (mask && void 0 == getMaskSet().validPositions[i] && test.optionality !== !0 && test.optionalQuantifier !== !0 || !mask && buffer[i] != getPlaceholder(i)) { 644 complete = !1; 645 break; 646 } 647 } 648 } 649 return complete; 650 } 651 function isSelection(begin, end) { 652 return isRTL ? begin - end > 1 || begin - end == 1 && opts.insertMode : end - begin > 1 || end - begin == 1 && opts.insertMode; 653 } 654 function installEventRuler(npt) { 655 var events = $._data(npt).events; 656 $.each(events, function(eventType, eventHandlers) { 657 $.each(eventHandlers, function(ndx, eventHandler) { 658 if ("inputmask" == eventHandler.namespace && "setvalue" != eventHandler.type) { 659 var handler = eventHandler.handler; 660 eventHandler.handler = function(e) { 661 if (!this.disabled && (!this.readOnly || "keydown" == e.type && e.ctrlKey && 67 == e.keyCode)) { 662 switch (e.type) { 663 case "input": 664 if (skipInputEvent === !0) return skipInputEvent = !1, e.preventDefault(); 665 break; 666 667 case "keydown": 668 skipKeyPressEvent = !1; 669 break; 670 671 case "keypress": 672 if (skipKeyPressEvent === !0) return e.preventDefault(); 673 skipKeyPressEvent = !0; 674 break; 675 676 case "compositionstart": 677 break; 678 679 case "compositionupdate": 680 skipInputEvent = !0; 681 break; 682 683 case "compositionend": } 684 return handler.apply(this, arguments); 685 } 686 e.preventDefault(); 687 }; 688 } 689 }); 690 }); 691 } 692 function patchValueProperty(npt) { 693 function PatchValhook(type) { 694 if (void 0 == $.valHooks[type] || 1 != $.valHooks[type].inputmaskpatch) { 695 var valhookGet = $.valHooks[type] && $.valHooks[type].get ? $.valHooks[type].get : function(elem) { 696 return elem.value; 697 }, valhookSet = $.valHooks[type] && $.valHooks[type].set ? $.valHooks[type].set : function(elem, value) { 698 return elem.value = value, elem; 699 }; 700 $.valHooks[type] = { 701 get: function(elem) { 702 var $elem = $(elem); 703 if ($elem.data("_inputmask")) { 704 if ($elem.data("_inputmask").opts.autoUnmask) return $elem.inputmask("unmaskedvalue"); 705 var result = valhookGet(elem), inputData = $elem.data("_inputmask"), maskset = inputData.maskset, bufferTemplate = maskset._buffer; 706 return bufferTemplate = bufferTemplate ? bufferTemplate.join("") : "", result != bufferTemplate ? result : ""; 707 } 708 return valhookGet(elem); 709 }, 710 set: function(elem, value) { 711 var result, $elem = $(elem), inputData = $elem.data("_inputmask"); 712 return inputData ? (result = valhookSet(elem, $.isFunction(inputData.opts.onBeforeMask) ? inputData.opts.onBeforeMask.call(el, value, inputData.opts) || value : value), 713 $elem.triggerHandler("setvalue.inputmask")) : result = valhookSet(elem, value), 714 result; 715 }, 716 inputmaskpatch: !0 717 }; 718 } 719 } 720 function getter() { 721 var $self = $(this), inputData = $(this).data("_inputmask"); 722 return inputData ? inputData.opts.autoUnmask ? $self.inputmask("unmaskedvalue") : valueGet.call(this) != getBufferTemplate().join("") ? valueGet.call(this) : "" : valueGet.call(this); 723 } 724 function setter(value) { 725 var inputData = $(this).data("_inputmask"); 726 inputData ? (valueSet.call(this, $.isFunction(inputData.opts.onBeforeMask) ? inputData.opts.onBeforeMask.call(el, value, inputData.opts) || value : value), 727 $(this).triggerHandler("setvalue.inputmask")) : valueSet.call(this, value); 728 } 729 function InstallNativeValueSetFallback(npt) { 730 $(npt).bind("mouseenter.inputmask", function() { 731 var $input = $(this), input = this, value = input._valueGet(); 732 "" != value && value != getBuffer().join("") && (this._valueSet($.is
732Function(opts.onBeforeMask) ? opts.onBeforeMask.call(el, value, opts) || value : value), 733 $input.triggerHandler("setvalue.inputmask")); 734 }); 735 //!! the bound handlers are executed in the order they where bound 736 var events = $._data(npt).events, handlers = events.mouseover; 737 if (handlers) { 738 for (var ourHandler = handlers[handlers.length - 1], i = handlers.length - 1; i > 0; i--) handlers[i] = handlers[i - 1]; 739 handlers[0] = ourHandler; 740 } 741 } 742 var valueGet, valueSet; 743 if (!npt._valueGet) { 744 if (Object.getOwnPropertyDescriptor) { 745 Object.getOwnPropertyDescriptor(npt, "value"); 746 } 747 document.__lookupGetter__ && npt.__lookupGetter__("value") ? (valueGet = npt.__lookupGetter__("value"), 748 valueSet = npt.__lookupSetter__("value"), npt.__defineGetter__("value", getter), 749 npt.__defineSetter__("value", setter)) : (valueGet = function() { 750 return npt.value; 751 }, valueSet = function(value) { 752 npt.value = value; 753 }, PatchValhook(npt.type), InstallNativeValueSetFallback(npt)), npt._valueGet = function(overruleRTL) { 754 return isRTL && overruleRTL !== !0 ? valueGet.call(this).split("").reverse().join("") : valueGet.call(this); 755 }, npt._valueSet = function(value) { 756 valueSet.call(this, isRTL ? value.split("").reverse().join("") : value); 757 }; 758 } 759 } 760 function handleRemove(input, k, pos, strict) { 761 function generalize() { 762 if (opts.keepStatic) { 763 resetMaskSet(!0); 764 var lastAlt, validInputs = []; 765 for (lastAlt = getLastValidPosition(); lastAlt >= 0; lastAlt--) if (getMaskSet().validPositions[lastAlt]) { 766 if (void 0 != getMaskSet().validPositions[lastAlt].alternation) break; 767 validInputs.push(getMaskSet().validPositions[lastAlt].input), delete getMaskSet().validPositions[lastAlt]; 768 } 769 if (lastAlt > 0) for (;validInputs.length > 0; ) { 770 getMaskSet().p = seekNext(getLastValidPosition()); 771 var keypress = $.Event("keypress"); 772 keypress.which = validInputs.pop().charCodeAt(0), keypressEvent.call(input, keypress, !0, !1, !1, getMaskSet().p); 773 } 774 } 775 } 776 if ((opts.numericInput || isRTL) && (k == $.inputmask.keyCode.BACKSPACE ? k = $.inputmask.keyCode.DELETE : k == $.inputmask.keyCode.DELETE && (k = $.inputmask.keyCode.BACKSPACE), 777 isRTL)) { 778 var pend = pos.end; 779 pos.end = pos.begin, pos.begin = pend; 780 } 781 if (k == $.inputmask.keyCode.BACKSPACE && (pos.end - pos.begin < 1 || 0 == opts.insertMode) ? pos.begin = seekPrevious(pos.begin) : k == $.inputmask.keyCode.DELETE && pos.begin == pos.end && (pos.end = isMask(pos.end) ? pos.end + 1 : seekNext(pos.end) + 1), 782 stripValidPositions(pos.begin, pos.end, !1, strict), strict !== !0) { 783 generalize(); 784 var lvp = getLastValidPosition(pos.begin); 785 lvp < pos.begin ? (-1 == lvp && resetMaskSet(), getMaskSet().p = seekNext(lvp)) : getMaskSet().p = pos.begin; 786 } 787 } 788 function keydownEvent(e) { 789 var input = this, $input = $(input), k = e.keyCode, pos = caret(input); 790 k == $.inputmask.keyCode.BACKSPACE || k == $.inputmask.keyCode.DELETE || iphone && 127 == k || e.ctrlKey && 88 == k && !isInputEventSupported("cut") ? (e.preventDefault(), 791 88 == k && (undoValue = getBuffer().join("")), handleRemove(input, k, pos), writeBuffer(input, getBuffer(), getMaskSet().p, e, undoValue != getBuffer().join("")), 792 input._valueGet() == getBufferTemplate().join("") ? $input.trigger("cleared") : isComplete(getBuffer()) === !0 && $input.trigger("complete"), 793 opts.showTooltip && $input.prop("title", getMaskSet().mask)) : k == $.inputmask.keyCode.END || k == $.inputmask.keyCode.PAGE_DOWN ? setTimeout(function() { 794 var caretPos = seekNext(getLastValidPosition()); 795 opts.insertMode || caretPos != getMaskLength() || e.shiftKey || caretPos--, caret(input, e.shiftKey ? pos.begin : caretPos, caretPos); 796 }, 0) : k == $.inputmask.keyCode.HOME && !e.shiftKey || k == $.inputmask.keyCode.PAGE_UP ? caret(input, 0, e.shiftKey ? pos.begin : 0) : (opts.undoOnEscape && k == $.inputmask.keyCode.ESCAPE || 90 == k && e.ctrlKey) && e.altKey !== !0 ? (checkVal(input, !0, !1, undoValue.split("")), 797 $input.click()) : k != $.inputmask.keyCode.INSERT || e.shiftKey || e.ctrlKey ? 0 != opts.insertMode || e.shiftKey || (k == $.inputmask.keyCode.RIGHT ? setTimeout(function() { 798 var caretPos = caret(input); 799 caret(input, caretPos.begin); 800 }, 0) : k == $.inputmask.keyCode.LEFT && setTimeout(function() { 801 var caretPos = caret(input); 802 caret(input, isRTL ? caretPos.begin + 1 : caretPos.begin - 1); 803 }, 0)) : (opts.insertMode = !opts.insertMode, caret(input, opts.insertMode || pos.begin != getMaskLength() ? pos.begin : pos.begin - 1)), 804 opts.onKeyDown.call(this, e, getBuffer(), caret(input).begin, opts), ignorable = -1 != $.inArray(k, opts.ignorables); 805 } 806 function keypressEvent(e, checkval, writeOut, strict, ndx) { 807 var input = this, $input = $(input), k = e.which || e.charCode || e.keyCode; 808 if (!(checkval === !0 || e.ctrlKey && e.altKey) && (e.ctrlKey || e.metaKey || ignorable)) return !0; 809 if (k) { 810 46 == k && 0 == e.shiftKey && "," == opts.radixPoint && (k = 44); 811 var forwardPosition, pos = checkval ? { 812 begin: ndx, 813 end: ndx 814 } : caret(input), c = String.fromCharCode(k), isSlctn = isSelection(pos.begin, pos.end); 815 isSlctn && (getMaskSet().undoPositions = $.extend(!0, {}, getMaskSet().validPositions), 816 handleRemove(input, $.inputmask.keyCode.DELETE, pos, !0), pos.begin = getMaskSet().p, 817 opts.insertMode || (opts.insertMode = !opts.insertMode, setValidPosition(pos.begin, strict), 818 opts.insertMode = !opts.insertMode), isSlctn = !opts.multi), getMaskSet().writeOutBuffer = !0; 819 var p = isRTL && !isSlctn ? pos.end : pos.begin, valResult = isValid(p, c, strict); 820 if (valResult !== !1) { 821 if (valResult !== !0 && (p = void 0 != valResult.pos ? valResult.pos : p, c = void 0 != valResult.c ? valResult.c : c), 822 resetMaskSet(!0), void 0 != valResult.caret) forwardPosition = valResult.caret; else { 823 var vps = getMaskSet().validPositions; 824 forwardPosition = !opts.keepStatic && (void 0 != vps[p + 1] && getTests(p + 1, vps[p].locator.slice(), p).length > 1 || void 0 != vps[p].alternation) ? p + 1 : seekNext(p); 825 } 826 getMaskSet().p = forwardPosition; 827 } 828 if (writeOut !== !1) { 829 var self = this; 830 if (setTimeout(function() { 831 opts.onKeyValidation.call(self, valResult, opts); 832 }, 0), getMaskSet().writeOutBuffer && valResult !== !1) { 833 var buffer = getBuffer(); 834 writeBuffer(input, buffer, checkval ? void 0 : opts.numericInput ? seekPrevious(forwardPosition) : forwardPosition, e, checkval !== !0), 835 checkval !== !0 && setTimeout(function() { 836 isComplete(buffer) === !0 && $input.trigger("complete"); 837 }, 0); 838 } else isSlctn && (getMaskSet().buffer = void 0, getMaskSet().validPositions = getMaskSet().undoPositions); 839 } else isSlctn && (getMaskSet().buffer = void 0, getMaskSet().validPositions = getMaskSet().undoPositions); 840 if (opts.showTooltip && $input.prop("title", getMaskSet().mask), checkval && $.isFunction(opts.onBeforeWrite)) { 841 var result = opts.onBeforeWrite.call(this, e, getBuffer(), forwardPosition, opts); 842 if (result && result.refreshFromBuffer) { 843 var refresh = result.refreshFromBuffer; 844 refreshFromBuffer(refresh === !0 ? refresh : refresh.start, refresh.end, result.buffer), 845 resetMaskSet(!0), result.caret && (getMaskSet().p = result.caret); 846 } 847 } 848 e.preventDefault(); 849 } 850 } 851 function pasteEvent(e) { 852 var input = this, $input = $(input), inputValue = input._valueGet(!0), caretPos = caret(input); 853 if ("propertychange" == e.type && input._valueGet().length <= getMaskLength()) return !0; 854 if ("paste" == e.type) { 855 var valueBeforeCaret = inputValue.substr(0, caretPos.begin), valueAfterCaret = inputValue.substr(caretPos.end, inputValue.length); 856 valueBeforeCaret == getBufferTemplate().slice(0, caretPos.begin).join("") && (valueBeforeCaret = ""), 857 valueAfterCaret == getBufferTemplate().slice(caretPos.end).join("") && (valueAfterCaret = ""), 858 window.clipboardData && window.clipboardData.getData ? inputValue = valueBeforeCaret + window.clipboardData.getData("Text") + valueAfterCaret : e.originalEvent && e.originalEvent.clipboardData && e.originalEvent.clipboardData.getData && (inputValue = valueBeforeCaret + e.originalEvent.clipboardData.getData("text/plain") + valueAfterCaret); 859 } 860 var pasteValue = inputValue; 861 if ($.isFunction(opts.onBeforePaste)) { 862 if (pasteValue = opts.onBeforePaste.call(input, inputValue, opts), pasteValue === !1) return e.preventDefault(), 863 !1; 864 pasteValue || (pasteValue = inputValue); 865 } 866 return checkVal(input, !0, !1, isRTL ? pasteValue.split("").reverse() : pasteValue.split("")), 867 $input.click(), isComplete(getBuffer()) === !0 && $input.trigger("complete"), !1; 868 } 869 function inputFallBackEvent(e) { 870 var input = this; 871 checkVal(input, !0, !1), isComplete(getBuffer()) === !0 && $(input).trigger("complete"), 872 e.preventDefault(); 873 } 874 function compositionStartEvent(e) { 875 var input = this; 876 undoValue = getBuffer().join(""), ("" == compositionData || 0 != e.originalEvent.data.indexOf(compositionData)) && (compositionCaretPos = caret(input)); 877 } 878 function compositionUpdateEvent(e) { 879 var input = this, caretPos = compositionCaretPos || caret(input); 880 0 == e.originalEvent.data.indexOf(compositionData) && (resetMaskSet(), caretPos = { 881 begin: 0, 882 end: 0 883 }); 884 var newData = e.originalEvent.data; 885 caret(input, caretPos.begin, caretPos.end); 886 for (var i = 0; i < newData.length; i++) { 887 var keypress = $.Event("keypress"); 888 keypress.which = newData.charCodeAt(i), skipKeyPressEvent = !1, ignorable = !1, 889 keypressEvent.call(input, keypress); 890 } 891 setTimeout(function() { 892 var forwardPosition = getMaskSet().p; 893 writeBuffer(input, getBuffer(), opts.numericInput ? seekPrevious(forwardPosition) : forwardPosition); 894 }, 0), compositionData = e.originalEvent.data; 895 } 896 function compositionEndEvent() {} 897 function mask(el) { 898 if ($el = $(el), $el.is(":input") && isInputTypeSupported($el.attr("type"))) { 899 if ($el.data("_inputmask", { 900 maskset: maskset, 901 opts: opts, 902 isRTL: !1 903 }), opts.showTooltip && $el.prop("title", getMaskSet().mask), ("rtl" == el.dir || opts.rightAlign) && $el.css("text-align", "right"), 904 "rtl" == el.dir || opts.numericInput) { 905 el.dir = "ltr", $el.removeAttr("dir"); 906 var inputData = $el.data("_inputmask"); 907 inputData.isRTL = !0, $el.data("_inputmask", inputData), isRTL = !0; 908 } 909 $el.unbind(".inputmask"), $el.closest("form").bind("submit", function() { 910 undoValue != getBuffer().join("") && $el.change(), $el[0]._valueGet && $el[0]._valueGet() == getBufferTemplate().join("") && $el[0]._valueSet(""), 911 opts.removeMaskOnSubmit && $el.inputmask("remove"); 912 }).bind("reset", function() { 913 setTimeout(function() { 914 $el.triggerHandler("setvalue.inputmask"); 915 }, 0); 916 }), $el.bind("mouseenter.inputmask", function() { 917 var $input = $(this), input = this; 918 !$input.is(":focus") && opts.showMaskOnHover && input._valueGet() != getBuffer().join("") && writeBuffer(input, getBuffer()); 919 }).bind("blur.inputmask", function(e) { 920 var $input = $(this), input = this; 921 if ($input.data("_inputmask")) { 922 var nptValue = input._valueGet(), buffer = getBuffer().slice(); 923 firstClick = !0, undoValue != buffer.join("") && setTimeout(function() { 924 $input.change(), undoValue = buffer.join(""); 925 }, 0), "" != nptValue && (opts.clearMaskOnLostFocus && (nptValue == getBufferTemplate().join("") ? buffer = [] : clearOptionalTail(buffer)), 926 isComplete(buffer) === !1 && ($input.trigger("incomplete"), opts.clearIncomplete && (resetMaskSet(), 927 buffer = opts.clearMaskOnLostFocus ? [] : getBufferTemplate().slice())), writeBuffer(input, buffer, void 0, e)); 928 } 929 }).bind("focus.inputmask", function() { 930 var input = ($(this), this), nptValue = input._valueGet(); 931 opts.showMaskOnFocus && (!opts.showMaskOnHover || opts.showMaskOnHover && "" == nptValue) && input._valueGet() != getBuffer().join("") && writeBuffer(input, getBuffer(), seekNext(getLastValidPosition())), 932 undoValue = getBuffer().join(""); 933 }).bind("mouseleave.inputmask", function() { 934 var $input = $(this), input = this; 935 if (opts.clearMaskOnLostFocus) { 936 var buffer = getBuffer().slice(), nptValue = input._valueGet(); 937 $input.is(":focus") || nptValue == $input.attr("placeholder") || "" == nptValue || (nptValue == getBufferTemplate().join("") ? buffer = [] : clearOptionalTail(buffer), 938 writeBuffer(input, buffer)); 939 } 940 }).bind("click.inputmask", function() { 941 var $input = $(this), input = this; 942 if ($input.is(":focus")) { 943 var selectedCaret = caret(input); 944 if (selectedCaret.begin == selectedCaret.end) if (opts.radixFocus && "" != opts.radixPoint && -1 != $.inArray(opts.radixPoint, getBuffer()) && (firstClick || getBuffer().join("") == getBufferTemplate().join(""))) caret(input, $.inArray(opts.radixPoint, getBuffer())), 945 firstClick = !1; else { 946 var clickPosition = isRTL ? TranslatePosition(selectedCaret.begin) : selectedCaret.begin, lastPosition = seekNext(getLastValidPosition(clickPosition)); 947 lastPosition > clickPosition ? caret(input, isMask(clickPosition) ? clickPosition : seekNext(clickPosition)) : caret(input, lastPosition); 948 } 949 } 950 }).bind("dblclick.inputmask", function() { 951 var input = this; 952 setTimeout(func
952tion() { 953 caret(input, 0, seekNext(getLastValidPosition())); 954 }, 0); 955 }).bind(PasteEventType + ".inputmask dragdrop.inputmask drop.inputmask", pasteEvent).bind("setvalue.inputmask", function() { 956 var input = this; 957 checkVal(input, !0, !1), undoValue = getBuffer().join(""), (opts.clearMaskOnLostFocus || opts.clearIncomplete) && input._valueGet() == getBufferTemplate().join("") && input._valueSet(""); 958 }).bind("cut.inputmask", function(e) { 959 skipInputEvent = !0; 960 var input = this, $input = $(input), pos = caret(input); 961 handleRemove(input, $.inputmask.keyCode.DELETE, pos), writeBuffer(input, getBuffer(), getMaskSet().p, e, undoValue != getBuffer().join("")), 962 input._valueGet() == getBufferTemplate().join("") && $input.trigger("cleared"), 963 opts.showTooltip && $input.prop("title", getMaskSet().mask); 964 }).bind("complete.inputmask", opts.oncomplete).bind("incomplete.inputmask", opts.onincomplete).bind("cleared.inputmask", opts.oncleared), 965 $el.bind("keydown.inputmask", keydownEvent).bind("keypress.inputmask", keypressEvent), 966 androidfirefox || $el.bind("compositionstart.inputmask", compositionStartEvent).bind("compositionupdate.inputmask", compositionUpdateEvent).bind("compositionend.inputmask", compositionEndEvent), 967 "paste" === PasteEventType && $el.bind("input.inputmask", inputFallBackEvent), patchValueProperty(el); 968 var initialValue = $.isFunction(opts.onBeforeMask) ? opts.onBeforeMask.call(el, el._valueGet(), opts) || el._valueGet() : el._valueGet(); 969 checkVal(el, !0, !1, initialValue.split("")); 970 var buffer = getBuffer().slice(); 971 undoValue = buffer.join(""); 972 var activeElement; 973 try { 974 activeElement = document.activeElement; 975 } catch (e) {} 976 isComplete(buffer) === !1 && opts.clearIncomplete && resetMaskSet(), opts.clearMaskOnLostFocus && (buffer.join("") == getBufferTemplate().join("") ? buffer = [] : clearOptionalTail(buffer)), 977 writeBuffer(el, buffer), activeElement === el && caret(el, seekNext(getLastValidPosition())), 978 installEventRuler(el); 979 } 980 } 981 var undoValue, compositionCaretPos, compositionData, $el, maxLength, isRTL = !1, skipKeyPressEvent = !1, skipInputEvent = !1, ignorable = !1, firstClick = !0; 982 if (void 0 != actionObj) switch (actionObj.action) { 983 case "isComplete": 984 return $el = $(actionObj.el), maskset = $el.data("_inputmask").maskset, opts = $el.data("_inputmask").opts, 985 isComplete(actionObj.buffer); 986 987 case "unmaskedvalue": 988 return $el = actionObj.$input, maskset = $el.data("_inputmask").maskset, opts = $el.data("_inputmask").opts, 989 isRTL = actionObj.$input.data("_inputmask").isRTL, unmaskedvalue(actionObj.$input); 990 991 case "mask": 992 undoValue = getBuffer().join(""), mask(actionObj.el); 993 break; 994 995 case "format": 996 $el = $({}), $el.data("_inputmask", { 997 maskset: maskset, 998 opts: opts, 999 isRTL: opts.numericInput 1000 }), opts.numericInput && (isRTL = !0); 1001 var valueBuffer = ($.isFunction(opts.onBeforeMask) ? opts.onBeforeMask.call($el, actionObj.value, opts) || actionObj.value : actionObj.value).split(""); 1002 return checkVal($el, !1, !1, isRTL ? valueBuffer.reverse() : valueBuffer), $.isFunction(opts.onBeforeWrite) && opts.onBeforeWrite.call(this, void 0, getBuffer(), 0, opts), 1003 actionObj.metadata ? { 1004 value: isRTL ? getBuffer().slice().reverse().join("") : getBuffer().join(""), 1005 metadata: $el.inputmask("getmetadata") 1006 } : isRTL ? getBuffer().slice().reverse().join("") : getBuffer().join(""); 1007 1008 case "isValid": 1009 $el = $({}), $el.data("_inputmask", { 1010 maskset: maskset, 1011 opts: opts, 1012 isRTL: opts.numericInput 1013 }), opts.numericInput && (isRTL = !0); 1014 var valueBuffer = actionObj.value.split(""); 1015 checkVal($el, !1, !0, isRTL ? valueBuffer.reverse() : valueBuffer); 1016 for (var buffer = getBuffer(), rl = determineLastRequiredPosition(), lmib = buffer.length - 1; lmib > rl && !isMask(lmib); lmib--) ; 1017 return buffer.splice(rl, lmib + 1 - rl), isComplete(buffer) && actionObj.value == buffer.join(""); 1018 1019 case "getemptymask": 1020 return $el = $(actionObj.el), maskset = $el.data("_inputmask").maskset, opts = $el.data("_inputmask").opts, 1021 getBufferTemplate(); 1022 1023 case "remove": 1024 var el = actionObj.el; 1025 $el = $(el), maskset = $el.data("_inputmask").maskset, opts = $el.data("_inputmask").opts, 1026 el._valueSet(unmaskedvalue($el)), $el.unbind(".inputmask"), $el.removeData("_inputmask"); 1027 var valueProperty; 1028 Object.getOwnPropertyDescriptor && (valueProperty = Object.getOwnPropertyDescriptor(el, "value")), 1029 valueProperty && valueProperty.get ? el._valueGet && Object.defineProperty(el, "value", { 1030 get: el._valueGet, 1031 set: el._valueSet 1032 }) : document.__lookupGetter__ && el.__lookupGetter__("value") && el._valueGet && (el.__defineGetter__("value", el._valueGet), 1033 el.__defineSetter__("value", el._valueSet)); 1034 try { 1035 delete el._valueGet, delete el._valueSet; 1036 } catch (e) { 1037 el._valueGet = void 0, el._valueSet = void 0; 1038 } 1039 break; 1040 1041 case "getmetadata": 1042 if ($el = $(actionObj.el), maskset = $el.data("_inputmask").maskset, opts = $el.data("_inputmask").opts, 1043 $.isArray(maskset.metadata)) { 1044 for (var alternation, lvp = getLastValidPosition(), firstAlt = lvp; firstAlt >= 0; firstAlt--) if (getMaskSet().validPositions[firstAlt] && void 0 != getMaskSet().validPositions[firstAlt].alternation) { 1045 alternation = getMaskSet().validPositions[firstAlt].alternation; 1046 break; 1047 } 1048 return void 0 != alternation ? maskset.metadata[getMaskSet().validPositions[lvp].locator[alternation]] : maskset.metadata[0]; 1049 } 1050 return maskset.metadata; 1051 } 1052 } 1053 if (void 0 === $.fn.inputmask) { 1054 var ua = navigator.userAgent, iphone = null !== ua.match(new RegExp("iphone", "i")), androidfirefox = (null !== ua.match(new RegExp("android.*safari.*", "i")), 1055 null !== ua.match(new RegExp("android.*chrome.*", "i")), null !== ua.match(new RegExp("android.*firefox.*", "i"))), PasteEventType = (/Kindle/i.test(ua) || /Silk/i.test(ua) || /KFTT/i.test(ua) || /KFOT/i.test(ua) || /KFJWA/i.test(ua) || /KFJWI/i.test(ua) || /KFSOWI/i.test(ua) || /KFTHWA/i.test(ua) || /KFTHWI/i.test(ua) || /KFAPWA/i.test(ua) || /KFAPWI/i.test(ua), 1056 isInputEventSupported("paste") ? "paste" : isInputEventSupported("input") ? "input" : "propertychange"); 1057 $.inputmask = { 1058 defaults: { 1059 placeholder: "_", 1060 optionalmarker: { 1061 start: "[", 1062 end: "]" 1063 }, 1064 quantifiermarker: { 1065 start: "{", 1066 end: "}" 1067 }, 1068 groupmarker: { 1069 start: "(", 1070 end: ")" 1071 }, 1072 alternatormarker: "|", 1073 escapeChar: "\\", 1074 mask: null, 1075 oncomplete: $.noop, 1076 onincomplete: $.noop, 1077 oncleared: $.noop, 1078 repeat: 0, 1079 greedy: !0, 1080 autoUnmask: !1, 1081 removeMaskOnSubmit: !1, 1082 clearMaskOnLostFocus: !0, 1083 insertMode: !0, 1084 clearIncomplete: !1, 1085 aliases: {}, 1086 alias: null, 1087 onKeyDown: $.noop, 1088 onBeforeMask: void 0, 1089 onBeforePaste: void 0, 1090 onBeforeWrite: void 0, 1091 onUnMask: void 0, 1092 showMaskOnFocus: !0, 1093 showMaskOnHover: !0, 1094 onKeyValidation: $.noop, 1095 skipOptionalPartCharacter: " ", 1096 showTooltip: !1, 1097 numericInput: !1, 1098 rightAlign: !1, 1099 undoOnEscape: !0, 1100 radixPoint: "", 1101 radixFocus: !1, 1102 nojumps: !1, 1103 nojumpsThreshold: 0, 1104 keepStatic: void 0, 1105 definitions: { 1106 "9": { 1107 validator: "[0-9]", 1108 cardinality: 1, 1109 definitionSymbol: "*" 1110 }, 1111 a: { 1112 validator: "[A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5]", 1113 cardinality: 1, 1114 definitionSymbol: "*" 1115 }, 1116 "*": { 1117 validator: "[0-9A-Za-z\u0410-\u044f\u0401\u0451\xc0-\xff\xb5]", 1118 cardinality: 1 1119 } 1120 }, 1121 ignorables: [ 8, 9, 13, 19, 27, 33, 34, 35, 36, 37, 38, 39, 40, 45, 46, 93, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123 ], 1122 isComplete: void 0, 1123 canClearPosition: $.noop, 1124 postValidation: void 0 1125 }, 1126 keyCode: { 1127 ALT: 18, 1128 BACKSPACE: 8, 1129 CAPS_LOCK: 20, 1130 COMMA: 188, 1131 COMMAND: 91, 1132 COMMAND_LEFT: 91, 1133 COMMAND_RIGHT: 93, 1134 CONTROL: 17, 1135 DELETE: 46, 1136 DOWN: 40, 1137 END: 35, 1138 ENTER: 13, 1139 ESCAPE: 27, 1140 HOME: 36, 1141 INSERT: 45, 1142 LEFT: 37, 1143 MENU: 93, 1144 NUMPAD_ADD: 107, 1145 NUMPAD_DECIMAL: 110, 1146 NUMPAD_DIVIDE: 111, 1147 NUMPAD_ENTER: 108, 1148 NUMPAD_MULTIPLY: 106, 1149 NUMPAD_SUBTRACT: 109, 1150 PAGE_DOWN: 34, 1151 PAGE_UP: 33, 1152 PERIOD: 190, 1153 RIGHT: 39, 1154 SHIFT: 16, 1155 SPACE: 32, 1156 TAB: 9, 1157 UP: 38, 1158 WINDOWS: 91 1159 }, 1160 masksCache: {}, 1161 escapeRegex: function(str) { 1162 var specials = [ "/", ".", "*", "+", "?", "|", "(", ")", "[", "]", "{", "}", "\\", "$", "^" ]; 1163 return str.replace(new RegExp("(\\" + specials.join("|\\") + ")", "gim"), "\\$1"); 1164 }, 1165 format: function(value, options, metadata) { 1166 var opts = $.extend(!0, {}, $.inputmask.defaults, options); 1167 return resolveAlias(opts.alias, options, opts), maskScope({ 1168 action: "format", 1169 value: value, 1170 metadata: metadata 1171 }, generateMaskSet(opts), opts); 1172 }, 1173 isValid: function(value, options) { 1174 var opts = $.extend(!0, {}, $.inputmask.defaults, options); 1175 return resolveAlias(opts.alias, options, opts), maskScope({ 1176 action: "isValid", 1177 value: value 1178 }, generateMaskSet(opts), opts); 1179 } 1180 }, $.fn.inputmask = function(fn, options) { 1181 function importAttributeOptions(npt, opts, importedOptionsContainer) { 1182 var $npt = $(npt); 1183 $npt.data("inputmask-alias") && resolveAlias($npt.data("inputmask-alias"), {}, opts); 1184 for (var option in opts) { 1185 var optionData = $npt.data("inputmask-" + option.toLowerCase()); 1186 void 0 != optionData && ("mask" == option && 0 == optionData.indexOf("[") ? (opts[option] = optionData.replace(/[\s[\]]/g, "").split("','"), 1187 opts[option][0] = opts[option][0].replace("'", ""), opts[option][opts[option].length - 1] = opts[option][opts[option].length - 1].replace("'", "")) : opts[option] = "boolean" == typeof optionData ? optionData : optionData.toString(), 1188 importedOptionsContainer && (importedOptionsContainer[option] = opts[option])); 1189 } 1190 return opts; 1191 } 1192 var maskset, opts = $.extend(!0, {}, $.inputmask.defaults, options); 1193 if ("string" == typeof fn) switch (fn) { 1194 case "mask": 1195 return resolveAlias(opts.alias, options, opts), maskset = generateMaskSet(opts), 1196 void 0 == maskset ? this : this.each(function() { 1197 maskScope({ 1198 action: "mask", 1199 el: this 1200 }, $.extend(!0, {}, maskset), importAttributeOptions(this, opts)); 1201 }); 1202 1203 case "unmaskedvalue": 1204 var $input = $(this); 1205 return $input.data("_inputmask") ? maskScope({ 1206 action: "unmaskedvalue", 1207 $input: $input 1208 }) : $input.val(); 1209 1210 case "remove": 1211 return this.each(function() { 1212 var $input = $(this); 1213 $input.data("_inputmask") && maskScope({ 1214 action: "remove", 1215 el: this 1216 }); 1217 }); 1218 1219 case "getemptymask": 1220 return this.data("_inputmask") ? maskScope({ 1221 action: "getemptymask", 1222 el: this 1223 }) : ""; 1224 1225 case "hasMaskedValue": 1226 return this.data("_inputmask") ? !this.data("_inputmask").opts.autoUnmask : !1; 1227 1228 case "isComplete": 1229 return this.data("_inputmask") ? maskScope({ 1230 action: "isComplete", 1231 buffer: this[0]._valueGet().split(""), 1232 el: this 1233 }) : !0; 1234 1235 case "getmetadata": 1236 return this.data("_inputmask") ? maskScope({ 1237 action: "getmetadata", 1238 el: this 1239 }) : void 0; 1240 1241 default: 1242 return resolveAlias(opts.alias, options, opts), resolveAlias(fn, options, opts) || (opts.mask = fn), 1243 maskset = generateMaskSet(opts), void 0 == maskset ? this : this.each(function() { 1244 maskScope({ 1245 action: "mask", 1246 el: this 1247 }, $.extend(!0, {}, maskset), importAttributeOptions(this, opts)); 1248 }); 1249 } else { 1250 if ("object" == typeof fn) return opts = $.extend(!0, {}, $.inputmask.defaults, fn), 1251 resolveAlias(opts.alias, fn, opts), maskset = generateMaskSet(opts), void 0 == maskset ? this : this.each(function() { 1252 maskScope({ 1253 action: "mask", 1254 el: this 1255 }, $.extend(!0, {}, maskset), importAttributeOptions(this, opts)); 1256 }); 1257 if (void 0 == fn) return this.each(function() { 1258 var attrOptions = $(this).attr("data-inputmask"); 1259 if (attrOptions && "" != attrOptions) try { 1260 attrOptions = attrOptions.replace(new RegExp("'", "g"), '"'); 1261 var dataoptions = $.parseJSON("{" + attrOptions + "}"); 1262 $.extend(!0, dataoptions, options), opts = $.extend(!0, {}, $.inputmask.defaults, dataoptions), 1263 opts = importAttributeOptions(this, opts), resolveAlias(opts.alias, dataoptions, opts), 1264 opts.alias = void 0, $(this).inputmask("mask", opts); 1265 } catch (ex) {} 1266 if ($(this).attr("data-inputmask-mask") || $(this).attr("data-inputmask-alias")) { 1267
vendor: 10,995 bytes, lines 1267-1641
1267 opts = $.extend(!0, {}, $.inputmask.defaults, {}); 1268 var dataOptions = {}; 1269 opts = importAttributeOptions(this, opts, dataOptions), resolveAlias(opts.alias, dataOptions, opts), 1270 opts.alias = void 0, $(this).inputmask("mask", opts); 1271 } 1272 }); 1273 } 1274 }; 1275 } 1276 return $.fn.inputmask; 1277}); 1278/**! 1279 1280 @license 1281 handlebars v4.3.1 1282 1283Copyright (C) 2011-2017 by Yehuda Katz 1284 1285Permission is hereby granted, free of charge, to any person obtaining a copy 1286of this software and associated documentation files (the "Software"), to deal 1287in the Software without restriction, including without limitation the rights 1288to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 1289copies of the Software, and to permit persons to whom the Software is 1290furnished to do so, subject to the following conditions: 1291 1292The above copyright notice and this permission notice shall be included in 1293all copies or substantial portions of the Software. 1294 1295THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 1296IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 1297FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 1298AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 1299LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 1300OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 1301THE SOFTWARE. 1302 1303*/ 1304(function webpackUniversalModuleDefinition(root, factory) { 1305 if(typeof exports === 'object' && typeof module === 'object') 1306 module.exports = factory(); 1307 else if(typeof define === 'function' && define.amd) 1308 define([], factory); 1309 else if(typeof exports === 'object') 1310 exports["Handlebars"] = factory(); 1311 else 1312 root["Handlebars"] = factory(); 1313})(this, function() { 1314return /******/ (function(modules) { // webpackBootstrap 1315/******/ // The module cache 1316/******/ var installedModules = {}; 1317 1318/******/ // The require function 1319/******/ function __webpack_require__(moduleId) { 1320 1321/******/ // Check if module is in cache 1322/******/ if(installedModules[moduleId]) 1323/******/ return installedModules[moduleId].exports; 1324 1325/******/ // Create a new module (and put it into the cache) 1326/******/ var module = installedModules[moduleId] = { 1327/******/ exports: {}, 1328/******/ id: moduleId, 1329/******/ loaded: false 1330/******/ }; 1331 1332/******/ // Execute the module function 1333/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 1334 1335/******/ // Flag the module as loaded 1336/******/ module.loaded = true; 1337 1338/******/ // Return the exports of the module 1339/******/ return module.exports; 1340/******/ } 1341 1342 1343/******/ // expose the modules object (__webpack_modules__) 1344/******/ __webpack_require__.m = modules; 1345 1346/******/ // expose the module cache 1347/******/ __webpack_require__.c = installedModules; 1348 1349/******/ // __webpack_public_path__ 1350/******/ __webpack_require__.p = ""; 1351 1352/******/ // Load entry module and return exports 1353/******/ return __webpack_require__(0); 1354/******/ }) 1355/************************************************************************/ 1356/******/ ([ 1357/* 0 */ 1358/***/ (function(module, exports, __webpack_require__) { 1359 1360 'use strict'; 1361 1362 var _interopRequireDefault = __webpack_require__(1)['default']; 1363 1364 exports.__esModule = true; 1365 1366 var _handlebarsRuntime = __webpack_require__(2); 1367 1368 var _handlebarsRuntime2 = _interopRequireDefault(_handlebarsRuntime); 1369 1370 // Compiler imports 1371 1372 var _handlebarsCompilerAst = __webpack_require__(35); 1373 1374 var _handlebarsCompilerAst2 = _interopRequireDefault(_handlebarsCompilerAst); 1375 1376 var _handlebarsCompilerBase = __webpack_require__(36); 1377 1378 var _handlebarsCompilerCompiler = __webpack_require__(41); 1379 1380 var _handlebarsCompilerJavascriptCompiler = __webpack_require__(42); 1381 1382 var _handlebarsCompilerJavascriptCompiler2 = _interopRequireDefault(_handlebarsCompilerJavascriptCompiler); 1383 1384 var _handlebarsCompilerVisitor = __webpack_require__(39); 1385 1386 var _handlebarsCompilerVisitor2 = _interopRequireDefault(_handlebarsCompilerVisitor); 1387 1388 var _handlebarsNoConflict = __webpack_require__(34); 1389 1390 var _handlebarsNoConflict2 = _interopRequireDefault(_handlebarsNoConflict); 1391 1392 var _create = _handlebarsRuntime2['default'].create; 1393 function create() { 1394 var hb = _create(); 1395 1396 hb.compile = function (input, options) { 1397 return _handlebarsCompilerCompiler.compile(input, options, hb); 1398 }; 1399 hb.precompile = function (input, options) { 1400 return _handlebarsCompilerCompiler.precompile(input, options, hb); 1401 }; 1402 1403 hb.AST = _handlebarsCompilerAst2['default']; 1404 hb.Compiler = _handlebarsCompilerCompiler.Compiler; 1405 hb.JavaScriptCompiler = _handlebarsCompilerJavascriptCompiler2['default']; 1406 hb.Parser = _handlebarsCompilerBase.parser; 1407 hb.parse = _handlebarsCompilerBase.parse; 1408 1409 return hb; 1410 } 1411 1412 var inst = create(); 1413 inst.create = create; 1414 1415 _handlebarsNoConflict2['default'](inst); 1416 1417 inst.Visitor = _handlebarsCompilerVisitor2['default']; 1418 1419 inst['default'] = inst; 1420 1421 exports['default'] = inst; 1422 module.exports = exports['default']; 1423 1424/***/ }), 1425/* 1 */ 1426/***/ (function(module, exports) { 1427 1428 "use strict"; 1429 1430 exports["default"] = function (obj) { 1431 return obj && obj.__esModule ? obj : { 1432 "default": obj 1433 }; 1434 }; 1435 1436 exports.__esModule = true; 1437 1438/***/ }), 1439/* 2 */ 1440/***/ (function(module, exports, __webpack_require__) { 1441 1442 'use strict'; 1443 1444 var _interopRequireWildcard = __webpack_require__(3)['default']; 1445 1446 var _interopRequireDefault = __webpack_require__(1)['default']; 1447 1448 exports.__esModule = true; 1449 1450 var _handlebarsBase = __webpack_require__(4); 1451 1452 var base = _interopRequireWildcard(_handlebarsBase); 1453 1454 // Each of these augment the Handlebars object. No need to setup here. 1455 // (This is done to easily share code between commonjs and browse envs) 1456 1457 var _handlebarsSafeString = __webpack_require__(21); 1458 1459 var _handlebarsSafeString2 = _interopRequireDefault(_handlebarsSafeString); 1460 1461 var _handlebarsException = __webpack_require__(6); 1462 1463 var _handlebarsException2 = _interopRequireDefault(_handlebarsException); 1464 1465 var _handlebarsUtils = __webpack_require__(5); 1466 1467 var Utils = _interopRequireWildcard(_handlebarsUtils); 1468 1469 var _handlebarsRuntime = __webpack_require__(22); 1470 1471 var runtime = _interopRequireWildcard(_handlebarsRuntime); 1472 1473 var _handlebarsNoConflict = __webpack_require__(34); 1474 1475 var _handlebarsNoConflict2 = _interopRequireDefault(_handlebarsNoConflict); 1476 1477 // For compatibility and usage outside of module systems, make the Handlebars object a namespace 1478 function create() { 1479 var hb = new base.HandlebarsEnvironment(); 1480 1481 Utils.extend(hb, base); 1482 hb.SafeString = _handlebarsSafeString2['default']; 1483 hb.Exception = _handlebarsException2['default']; 1484 hb.Utils = Utils; 1485 hb.escapeExpression = Utils.escapeExpression; 1486 1487 hb.VM = runtime; 1488 hb.template = function (spec) { 1489 return runtime.template(spec, hb); 1490 }; 1491 1492 return hb; 1493 } 1494 1495 var inst = create(); 1496 inst.create = create; 1497 1498 _handlebarsNoConflict2['default'](inst); 1499 1500 inst['default'] = inst; 1501 1502 exports['default'] = inst; 1503 module.exports = exports['default']; 1504 1505/***/ }), 1506/* 3 */ 1507/***/ (function(module, exports) { 1508 1509 "use strict"; 1510 1511 exports["default"] = function (obj) { 1512 if (obj && obj.__esModule) { 1513 return obj; 1514 } else { 1515 var newObj = {}; 1516 1517 if (obj != null) { 1518 for (var key in obj) { 1519 if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; 1520 } 1521 } 1522 1523 newObj["default"] = obj; 1524 return newObj; 1525 } 1526 }; 1527 1528 exports.__esModule = true; 1529 1530/***/ }), 1531/* 4 */ 1532/***/ (function(module, exports, __webpack_require__) { 1533 1534 'use strict'; 1535 1536 var _interopRequireDefault = __webpack_require__(1)['default']; 1537 1538 exports.__esModule = true; 1539 exports.HandlebarsEnvironment = HandlebarsEnvironment; 1540 1541 var _utils = __webpack_require__(5); 1542 1543 var _exception = __webpack_require__(6); 1544 1545 var _exception2 = _interopRequireDefault(_exception); 1546 1547 var _helpers = __webpack_require__(10); 1548 1549 var _decorators = __webpack_require__(18); 1550 1551 var _logger = __webpack_require__(20); 1552 1553 var _logger2 = _interopRequireDefault(_logger); 1554 1555 var VERSION = '4.3.1'; 1556 exports.VERSION = VERSION; 1557 var COMPILER_REVISION = 8; 1558 exports.COMPILER_REVISION = COMPILER_REVISION; 1559 var LAST_COMPATIBLE_COMPILER_REVISION = 7; 1560 1561 exports.LAST_COMPATIBLE_COMPILER_REVISION = LAST_COMPATIBLE_COMPILER_REVISION; 1562 var REVISION_CHANGES = { 1563 1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it 1564 2: '== 1.0.0-rc.3', 1565 3: '== 1.0.0-rc.4', 1566 4: '== 1.x.x', 1567 5: '== 2.0.0-alpha.x', 1568 6: '>= 2.0.0-beta.1', 1569 7: '>= 4.0.0 <4.3.0', 1570 8: '>= 4.3.0' 1571 }; 1572 1573 exports.REVISION_CHANGES = REVISION_CHANGES; 1574 var objectType = '[object Object]'; 1575 1576 function HandlebarsEnvironment(helpers, partials, decorators) { 1577 this.helpers = helpers || {}; 1578 this.partials = partials || {}; 1579 this.decorators = decorators || {}; 1580 1581 _helpers.registerDefaultHelpers(this); 1582 _decorators.registerDefaultDecorators(this); 1583 } 1584 1585 HandlebarsEnvironment.prototype = { 1586 constructor: HandlebarsEnvironment, 1587 1588 logger: _logger2['default'], 1589 log: _logger2['default'].log, 1590 1591 registerHelper: function registerHelper(name, fn) { 1592 if (_utils.toString.call(name) === objectType) { 1593 if (fn) { 1594 throw new _exception2['default']('Arg not supported with multiple helpers'); 1595 } 1596 _utils.extend(this.helpers, name); 1597 } else { 1598 this.helpers[name] = fn; 1599 } 1600 }, 1601 unregisterHelper: function unregisterHelper(name) { 1602 delete this.helpers[name]; 1603 }, 1604 1605 registerPartial: function registerPartial(name, partial) { 1606 if (_utils.toString.call(name) === objectType) { 1607 _utils.extend(this.partials, name); 1608 } else { 1609 if (typeof partial === 'undefined') { 1610 throw new _exception2['default']('Attempting to register a partial called "' + name + '" as undefined'); 1611 } 1612 this.partials[name] = partial; 1613 } 1614 }, 1615 unregisterPartial: function unregisterPartial(name) { 1616 delete this.partials[name]; 1617 }, 1618 1619 registerDecorator: function registerDecorator(name, fn) { 1620 if (_utils.toString.call(name) === objectType) { 1621 if (fn) { 1622 throw new _exception2['default']('Arg not supported with multiple decorators'); 1623 } 1624 _utils.extend(this.decorators, name); 1625 } else { 1626 this.decorators[name] = fn; 1627 } 1628 }, 1629 unregisterDecorator: function unregisterDecorator(name) { 1630 delete this.decorators[name]; 1631 } 1632 }; 1633 1634 var log = _logger2['default'].log; 1635 1636 exports.log = log; 1637 exports.createFrame = _utils.createFrame; 1638 exports.logger = _logger2['default']; 1639 1640/***/ }), 1641/* 5 */
vendor: 5,212 bytes, lines 1642-1845
1642/***/ (function(module, exports) { 1643 1644 'use strict'; 1645 1646 exports.__esModule = true; 1647 exports.extend = extend; 1648 exports.indexOf = indexOf; 1649 exports.escapeExpression = escapeExpression; 1650 exports.isEmpty = isEmpty; 1651 exports.createFrame = createFrame; 1652 exports.blockParams = blockParams; 1653 exports.appendContextPath = appendContextPath; 1654 1655 var escape = { 1656 '&': '&', 1657 '<': '<', 1658 '>': '>', 1659 '"': '"', 1660 "'": ''', 1661 '`': '`', 1662 '=': '=' 1663 }; 1664 1665 var badChars = /[&<>"'`=]/g, 1666 possible = /[&<>"'`=]/; 1667 1668 function escapeChar(chr) { 1669 return escape[chr]; 1670 } 1671 1672 function extend(obj /* , ...source */) { 1673 for (var i = 1; i < arguments.length; i++) { 1674 for (var key in arguments[i]) { 1675 if (Object.prototype.hasOwnProperty.call(arguments[i], key)) { 1676 obj[key] = arguments[i][key]; 1677 } 1678 } 1679 } 1680 1681 return obj; 1682 } 1683 1684 var toString = Object.prototype.toString; 1685 1686 exports.toString = toString; 1687 // Sourced from lodash 1688 // https://github.com/bestiejs/lodash/blob/master/LICENSE.txt 1689 /* eslint-disable func-style */ 1690 var isFunction = function isFunction(value) { 1691 return typeof value === 'function'; 1692 }; 1693 // fallback for older versions of Chrome and Safari 1694 /* istanbul ignore next */ 1695 if (isFunction(/x/)) { 1696 exports.isFunction = isFunction = function (value) { 1697 return typeof value === 'function' && toString.call(value) === '[object Function]'; 1698 }; 1699 } 1700 exports.isFunction = isFunction; 1701 1702 /* eslint-enable func-style */ 1703 1704 /* istanbul ignore next */ 1705 var isArray = Array.isArray || function (value) { 1706 return value && typeof value === 'object' ? toString.call(value) === '[object Array]' : false; 1707 }; 1708 1709 exports.isArray = isArray; 1710 // Older IE versions do not directly support indexOf so we must implement our own, sadly. 1711 1712 function indexOf(array, value) { 1713 for (var i = 0, len = array.length; i < len; i++) { 1714 if (array[i] === value) { 1715 return i; 1716 } 1717 } 1718 return -1; 1719 } 1720 1721 function escapeExpression(string) { 1722 if (typeof string !== 'string') { 1723 // don't escape SafeStrings, since they're already safe 1724 if (string && string.toHTML) { 1725 return string.toHTML(); 1726 } else if (string == null) { 1727 return ''; 1728 } else if (!string) { 1729 return string + ''; 1730 } 1731 1732 // Force a string conversion as this will be done by the append regardless and 1733 // the regex test will do this transparently behind the scenes, causing issues if 1734 // an object's to string has escaped characters in it. 1735 string = '' + string; 1736 } 1737 1738 if (!possible.test(string)) { 1739 return string; 1740 } 1741 return string.replace(badChars, escapeChar); 1742 } 1743 1744 function isEmpty(value) { 1745 if (!value && value !== 0) { 1746 return true; 1747 } else if (isArray(value) && value.length === 0) { 1748 return true; 1749 } else { 1750 return false; 1751 } 1752 } 1753 1754 function createFrame(object) { 1755 var frame = extend({}, object); 1756 frame._parent = object; 1757 return frame; 1758 } 1759 1760 function blockParams(params, ids) { 1761 params.path = ids; 1762 return params; 1763 } 1764 1765 function appendContextPath(contextPath, id) { 1766 return (contextPath ? contextPath + '.' : '') + id; 1767 } 1768 1769/***/ }), 1770/* 6 */ 1771/***/ (function(module, exports, __webpack_require__) { 1772 1773 'use strict'; 1774 1775 var _Object$defineProperty = __webpack_require__(7)['default']; 1776 1777 exports.__esModule = true; 1778 1779 var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack']; 1780 1781 function Exception(message, node) { 1782 var loc = node && node.loc, 1783 line = undefined, 1784 column = undefined; 1785 if (loc) { 1786 line = loc.start.line; 1787 column = loc.start.column; 1788 1789 message += ' - ' + line + ':' + column; 1790 } 1791 1792 var tmp = Error.prototype.constructor.call(this, message); 1793 1794 // Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work. 1795 for (var idx = 0; idx < errorProps.length; idx++) { 1796 this[errorProps[idx]] = tmp[errorProps[idx]]; 1797 } 1798 1799 /* istanbul ignore else */ 1800 if (Error.captureStackTrace) { 1801 Error.captureStackTrace(this, Exception); 1802 } 1803 1804 try { 1805 if (loc) { 1806 this.lineNumber = line; 1807 1808 // Work around issue under safari where we can't directly set the column value 1809 /* istanbul ignore next */ 1810 if (_Object$defineProperty) { 1811 Object.defineProperty(this, 'column', { 1812 value: column, 1813 enumerable: true 1814 }); 1815 } else { 1816 this.column = column; 1817 } 1818 } 1819 } catch (nop) { 1820 /* Ignore if the browser is very particular */ 1821 } 1822 } 1823 1824 Exception.prototype = new Error(); 1825 1826 exports['default'] = Exception; 1827 module.exports = exports['default']; 1828 1829/***/ }), 1830/* 7 */ 1831/***/ (function(module, exports, __webpack_require__) { 1832 1833 module.exports = { "default": __webpack_require__(8), __esModule: true }; 1834 1835/***/ }), 1836/* 8 */ 1837/***/ (function(module, exports, __webpack_require__) { 1838 1839 var $ = __webpack_require__(9); 1840 module.exports = function defineProperty(it, key, desc){ 1841 return $.setDesc(it, key, desc); 1842 }; 1843 1844/***/ }), 1845/* 9 */
vendor: 24,918 bytes, lines 1846-2665
1846/***/ (function(module, exports) { 1847 1848 var $Object = Object; 1849 module.exports = { 1850 create: $Object.create, 1851 getProto: $Object.getPrototypeOf, 1852 isEnum: {}.propertyIsEnumerable, 1853 getDesc: $Object.getOwnPropertyDescriptor, 1854 setDesc: $Object.defineProperty, 1855 setDescs: $Object.defineProperties, 1856 getKeys: $Object.keys, 1857 getNames: $Object.getOwnPropertyNames, 1858 getSymbols: $Object.getOwnPropertySymbols, 1859 each: [].forEach 1860 }; 1861 1862/***/ }), 1863/* 10 */ 1864/***/ (function(module, exports, __webpack_require__) { 1865 1866 'use strict'; 1867 1868 var _interopRequireDefault = __webpack_require__(1)['default']; 1869 1870 exports.__esModule = true; 1871 exports.registerDefaultHelpers = registerDefaultHelpers; 1872 exports.moveHelperToHooks = moveHelperToHooks; 1873 1874 var _helpersBlockHelperMissing = __webpack_require__(11); 1875 1876 var _helpersBlockHelperMissing2 = _interopRequireDefault(_helpersBlockHelperMissing); 1877 1878 var _helpersEach = __webpack_require__(12); 1879 1880 var _helpersEach2 = _interopRequireDefault(_helpersEach); 1881 1882 var _helpersHelperMissing = __webpack_require__(13); 1883 1884 var _helpersHelperMissing2 = _interopRequireDefault(_helpersHelperMissing); 1885 1886 var _helpersIf = __webpack_require__(14); 1887 1888 var _helpersIf2 = _interopRequireDefault(_helpersIf); 1889 1890 var _helpersLog = __webpack_require__(15); 1891 1892 var _helpersLog2 = _interopRequireDefault(_helpersLog); 1893 1894 var _helpersLookup = __webpack_require__(16); 1895 1896 var _helpersLookup2 = _interopRequireDefault(_helpersLookup); 1897 1898 var _helpersWith = __webpack_require__(17); 1899 1900 var _helpersWith2 = _interopRequireDefault(_helpersWith); 1901 1902 function registerDefaultHelpers(instance) { 1903 _helpersBlockHelperMissing2['default'](instance); 1904 _helpersEach2['default'](instance); 1905 _helpersHelperMissing2['default'](instance); 1906 _helpersIf2['default'](instance); 1907 _helpersLog2['default'](instance); 1908 _helpersLookup2['default'](instance); 1909 _helpersWith2['default'](instance); 1910 } 1911 1912 function moveHelperToHooks(instance, helperName, keepHelper) { 1913 if (instance.helpers[helperName]) { 1914 instance.hooks[helperName] = instance.helpers[helperName]; 1915 if (!keepHelper) { 1916 delete instance.helpers[helperName]; 1917 } 1918 } 1919 } 1920 1921/***/ }), 1922/* 11 */ 1923/***/ (function(module, exports, __webpack_require__) { 1924 1925 'use strict'; 1926 1927 exports.__esModule = true; 1928 1929 var _utils = __webpack_require__(5); 1930 1931 exports['default'] = function (instance) { 1932 instance.registerHelper('blockHelperMissing', function (context, options) { 1933 var inverse = options.inverse, 1934 fn = options.fn; 1935 1936 if (context === true) { 1937 return fn(this); 1938 } else if (context === false || context == null) { 1939 return inverse(this); 1940 } else if (_utils.isArray(context)) { 1941 if (context.length > 0) { 1942 if (options.ids) { 1943 options.ids = [options.name]; 1944 } 1945 1946 return instance.helpers.each(context, options); 1947 } else { 1948 return inverse(this); 1949 } 1950 } else { 1951 if (options.data && options.ids) { 1952 var data = _utils.createFrame(options.data); 1953 data.contextPath = _utils.appendContextPath(options.data.contextPath, options.name); 1954 options = { data: data }; 1955 } 1956 1957 return fn(context, options); 1958 } 1959 }); 1960 }; 1961 1962 module.exports = exports['default']; 1963 1964/***/ }), 1965/* 12 */ 1966/***/ (function(module, exports, __webpack_require__) { 1967 1968 'use strict'; 1969 1970 var _interopRequireDefault = __webpack_require__(1)['default']; 1971 1972 exports.__esModule = true; 1973 1974 var _utils = __webpack_require__(5); 1975 1976 var _exception = __webpack_require__(6); 1977 1978 var _exception2 = _interopRequireDefault(_exception); 1979 1980 exports['default'] = function (instance) { 1981 instance.registerHelper('each', function (context, options) { 1982 if (!options) { 1983 throw new _exception2['default']('Must pass iterator to #each'); 1984 } 1985 1986 var fn = options.fn, 1987 inverse = options.inverse, 1988 i = 0, 1989 ret = '', 1990 data = undefined, 1991 contextPath = undefined; 1992 1993 if (options.data && options.ids) { 1994 contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]) + '.'; 1995 } 1996 1997 if (_utils.isFunction(context)) { 1998 context = context.call(this); 1999 } 2000 2001 if (options.data) { 2002 data = _utils.createFrame(options.data); 2003 } 2004 2005 function execIteration(field, index, last) { 2006 if (data) { 2007 data.key = field; 2008 data.index = index; 2009 data.first = index === 0; 2010 data.last = !!last; 2011 2012 if (contextPath) { 2013 data.contextPath = contextPath + field; 2014 } 2015 } 2016 2017 ret = ret + fn(context[field], { 2018 data: data, 2019 blockParams: _utils.blockParams([context[field], field], [contextPath + field, null]) 2020 }); 2021 } 2022 2023 if (context && typeof context === 'object') { 2024 if (_utils.isArray(context)) { 2025 for (var j = context.length; i < j; i++) { 2026 if (i in context) { 2027 execIteration(i, i, i === context.length - 1); 2028 } 2029 } 2030 } else { 2031 var priorKey = undefined; 2032 2033 for (var key in context) { 2034 if (context.hasOwnProperty(key)) { 2035 // We're running the iterations one step out of sync so we can detect 2036 // the last iteration without have to scan the object twice and create 2037 // an itermediate keys array. 2038 if (priorKey !== undefined) { 2039 execIteration(priorKey, i - 1); 2040 } 2041 priorKey = key; 2042 i++; 2043 } 2044 } 2045 if (priorKey !== undefined) { 2046 execIteration(priorKey, i - 1, true); 2047 } 2048 } 2049 } 2050 2051 if (i === 0) { 2052 ret = inverse(this); 2053 } 2054 2055 return ret; 2056 }); 2057 }; 2058 2059 module.exports = exports['default']; 2060 2061/***/ }), 2062/* 13 */ 2063/***/ (function(module, exports, __webpack_require__) { 2064 2065 'use strict'; 2066 2067 var _interopRequireDefault = __webpack_require__(1)['default']; 2068 2069 exports.__esModule = true; 2070 2071 var _exception = __webpack_require__(6); 2072 2073 var _exception2 = _interopRequireDefault(_exception); 2074 2075 exports['default'] = function (instance) { 2076 instance.registerHelper('helperMissing', function () /* [args, ]options */{ 2077 if (arguments.length === 1) { 2078 // A missing field in a {{foo}} construct. 2079 return undefined; 2080 } else { 2081 // Someone is actually trying to call something, blow up. 2082 throw new _exception2['default']('Missing helper: "' + arguments[arguments.length - 1].name + '"'); 2083 } 2084 }); 2085 }; 2086 2087 module.exports = exports['default']; 2088 2089/***/ }), 2090/* 14 */ 2091/***/ (function(module, exports, __webpack_require__) { 2092 2093 'use strict'; 2094 2095 exports.__esModule = true; 2096 2097 var _utils = __webpack_require__(5); 2098 2099 exports['default'] = function (instance) { 2100 instance.registerHelper('if', function (conditional, options) { 2101 if (_utils.isFunction(conditional)) { 2102 conditional = conditional.call(this); 2103 } 2104 2105 // Default behavior is to render the positive path if the value is truthy and not empty. 2106 // The `includeZero` option may be set to treat the condtional as purely not empty based on the 2107 // behavior of isEmpty. Effectively this determines if 0 is handled by the positive path or negative. 2108 if (!options.hash.includeZero && !conditional || _utils.isEmpty(conditional)) { 2109 return options.inverse(this); 2110 } else { 2111 return options.fn(this); 2112 } 2113 }); 2114 2115 instance.registerHelper('unless', function (conditional, options) { 2116 return instance.helpers['if'].call(this, conditional, { fn: options.inverse, inverse: options.fn, hash: options.hash }); 2117 }); 2118 }; 2119 2120 module.exports = exports['default']; 2121 2122/***/ }), 2123/* 15 */ 2124/***/ (function(module, exports) { 2125 2126 'use strict'; 2127 2128 exports.__esModule = true; 2129 2130 exports['default'] = function (instance) { 2131 instance.registerHelper('log', function () /* message, options */{ 2132 var args = [undefined], 2133 options = arguments[arguments.length - 1]; 2134 for (var i = 0; i < arguments.length - 1; i++) { 2135 args.push(arguments[i]); 2136 } 2137 2138 var level = 1; 2139 if (options.hash.level != null) { 2140 level = options.hash.level; 2141 } else if (options.data && options.data.level != null) { 2142 level = options.data.level; 2143 } 2144 args[0] = level; 2145 2146 instance.log.apply(instance, args); 2147 }); 2148 }; 2149 2150 module.exports = exports['default']; 2151 2152/***/ }), 2153/* 16 */ 2154/***/ (function(module, exports) { 2155 2156 'use strict'; 2157 2158 exports.__esModule = true; 2159 2160 exports['default'] = function (instance) { 2161 instance.registerHelper('lookup', function (obj, field) { 2162 if (!obj) { 2163 return obj; 2164 } 2165 if (field === 'constructor' && !obj.propertyIsEnumerable(field)) { 2166 return undefined; 2167 } 2168 return obj[field]; 2169 }); 2170 }; 2171 2172 module.exports = exports['default']; 2173 2174/***/ }), 2175/* 17 */ 2176/***/ (function(module, exports, __webpack_require__) { 2177 2178 'use strict'; 2179 2180 exports.__esModule = true; 2181 2182 var _utils = __webpack_require__(5); 2183 2184 exports['default'] = function (instance) { 2185 instance.registerHelper('with', function (context, options) { 2186 if (_utils.isFunction(context)) { 2187 context = context.call(this); 2188 } 2189 2190 var fn = options.fn; 2191 2192 if (!_utils.isEmpty(context)) { 2193 var data = options.data; 2194 if (options.data && options.ids) { 2195 data = _utils.createFrame(options.data); 2196 data.contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]); 2197 } 2198 2199 return fn(context, { 2200 data: data, 2201 blockParams: _utils.blockParams([context], [data && data.contextPath]) 2202 }); 2203 } else { 2204 return options.inverse(this); 2205 } 2206 }); 2207 }; 2208 2209 module.exports = exports['default']; 2210 2211/***/ }), 2212/* 18 */ 2213/***/ (function(module, exports, __webpack_require__) { 2214 2215 'use strict'; 2216 2217 var _interopRequireDefault = __webpack_require__(1)['default']; 2218 2219 exports.__esModule = true; 2220 exports.registerDefaultDecorators = registerDefaultDecorators; 2221 2222 var _decoratorsInline = __webpack_require__(19); 2223 2224 var _decoratorsInline2 = _interopRequireDefault(_decoratorsInline); 2225 2226 function registerDefaultDecorators(instance) { 2227 _decoratorsInline2['default'](instance); 2228 } 2229 2230/***/ }), 2231/* 19 */ 2232/***/ (function(module, exports, __webpack_require__) { 2233 2234 'use strict'; 2235 2236 exports.__esModule = true; 2237 2238 var _utils = __webpack_require__(5); 2239 2240 exports['default'] = function (instance) { 2241 instance.registerDecorator('inline', function (fn, props, container, options) { 2242 var ret = fn; 2243 if (!props.partials) { 2244 props.partials = {}; 2245 ret = function (context, options) { 2246 // Create a new partials stack frame prior to exec. 2247 var original = container.partials; 2248 container.partials = _utils.extend({}, original, props.partials); 2249 var ret = fn(context, options); 2250 container.partials = original; 2251 return ret; 2252 }; 2253 } 2254 2255 props.partials[options.args[0]] = options.fn; 2256 2257 return ret; 2258 }); 2259 }; 2260 2261 module.exports = exports['default']; 2262 2263/***/ }), 2264/* 20 */ 2265/***/ (function(module, exports, __webpack_require__) { 2266 2267 'use strict'; 2268 2269 exports.__esModule = true; 2270 2271 var _utils = __webpack_require__(5); 2272 2273 var logger = { 2274 methodMap: ['debug', 'info', 'warn', 'error'], 2275 level: 'info', 2276 2277 // Maps a given level value to the `methodMap` indexes above. 2278 lookupLevel: function lookupLevel(level) { 2279 if (typeof level === 'string') { 2280 var levelMap = _utils.indexOf(logger.methodMap, level.toLowerCase()); 2281 if (levelMap >= 0) { 2282 level = levelMap; 2283 } else { 2284 level = parseInt(level, 10); 2285 } 2286 } 2287 2288 return level; 2289 }, 2290 2291 // Can be overridden in the host environment 2292 log: function log(level) { 2293 level = logger.lookupLevel(level); 2294 2295 if (typeof console !== 'undefined' && logger.lookupLevel(logger.level) <= level) { 2296 var method = logger.methodMap[level]; 2297 if (!console[method]) { 2298 // eslint-disable-line no-console 2299 method = 'log'; 2300 } 2301 2302 for (var _len = arguments.length, message = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { 2303 message[_key - 1] = arguments[_key]; 2304 } 2305 2306 console[method].apply(console, message); // eslint-disable-line no-console 2307 } 2308 } 2309 }; 2310 2311 exports['default'] = logger; 2312 module.exports = exports['default']; 2313 2314/***/ }), 2315/* 21 */ 2316/***/ (function(module, exports) { 2317 2318 // Build out our basic SafeString type 2319 'use strict'; 2320 2321 exports.__esModule = true; 2322 function SafeString(string) { 2323 this.string = string; 2324 } 2325 2326 SafeString.prototype.toString = SafeString.prototype.toHTML = function () { 2327 return '' + this.string; 2328 }; 2329 2330 exports['default'] = SafeString; 2331 module.exports = exports['default']; 2332 2333/***/ }), 2334/* 22 */ 2335/***/ (function(module, exports, __webpack_require__) { 2336 2337 'use strict'; 2338 2339 var _Object$seal = __webpack_require__(23)['default']; 2340 2341 var _interopRequireWildcard = __webpack_require__(3)['default']; 2342 2343 var _interopRequireDefault = __webpack_require__(1)['default']; 2344 2345 exports.__esModule = true; 2346 exports.checkRevision = checkRevision; 2347 exports.template = template; 2348 exports.wrapProgram = wrapProgram; 2349 exports.resolvePartial = resolvePartial; 2350 exports.invokePartial = invokePartial; 2351 exports.noop = noop; 2352 2353 var _utils = __webpack_require__(5); 2354 2355 var Utils = _interopRequireWildcard(_utils); 2356 2357 var _exception = __webpack_require__(6); 2358 2359 var _exception2 = _interopRequireDefault(_exception); 2360 2361 var _base = __webpack_require__(4); 2362 2363 var _helpers = __webpack_require__(10); 2364 2365 function checkRevision(compilerInfo) { 2366 var compilerRevision = compilerInfo && compilerInfo[0] || 1, 2367 currentRevision = _base.COMPILER_REVISION; 2368 2369 if (compilerRevision >= _base.LAST_COMPATIBLE_COMPILER_REVISION && compilerRevision <= _base.COMPILER_REVISION) { 2370 return; 2371 } 2372 2373 if (compilerRevision < _base.LAST_COMPATIBLE_COMPILER_REVISION) { 2374 var runtimeVersions = _base.REVISION_CHANGES[currentRevision], 2375 compilerVersions = _base.REVISION_CHANGES[compilerRevision]; 2376 throw new _exception2['default']('Template was precompiled with an older version of Handlebars than the current runtime. ' + 'Please update your precompiler to a newer version (' + runtimeVersions + ') or downgrade your runtime to an older version (' + compilerVersions + ').'); 2377 } else { 2378 // Use the embedded version info since the runtime doesn't know about this revision yet 2379 throw new _exception2['default']('Template was precompiled with a newer version of Handlebars than the current runtime. ' + 'Please update your runtime to a newer version (' + compilerInfo[1] + ').'); 2380 } 2381 } 2382 2383 function template(templateSpec, env) { 2384 2385 /* istanbul ignore next */ 2386 if (!env) { 2387 throw new _exception2['default']('No environment passed to template'); 2388 } 2389 if (!templateSpec || !templateSpec.main) { 2390 throw new _exception2['default']('Unknown template object: ' + typeof templateSpec); 2391 } 2392 2393 templateSpec.main.decorator = templateSpec.main_d; 2394 2395 // Note: Using env.VM references rather than local var references throughout this section to allow 2396 // for external users to override these as pseudo-supported APIs. 2397 env.VM.checkRevision(templateSpec.compiler); 2398 2399 // backwards compatibility for precompiled templates with compiler-version 7 (<4.3.0) 2400 var templateWasPrecompiledWithCompilerV7 = templateSpec.compiler && templateSpec.compiler[0] === 7; 2401 2402 function invokePartialWrapper(partial, context, options) { 2403 if (options.hash) { 2404 context = Utils.extend({}, context, options.hash); 2405 if (options.ids) { 2406 options.ids[0] = true; 2407 } 2408 } 2409 partial = env.VM.resolvePartial.call(this, partial, context, options); 2410 2411 var optionsWithHooks = Utils.extend({}, options, { hooks: this.hooks }); 2412 2413 var result = env.VM.invokePartial.call(this, partial, context, optionsWithHooks); 2414 2415 if (result == null && env.compile) { 2416 options.partials[options.name] = env.compile(partial, templateSpec.compilerOptions, env); 2417 result = options.partials[options.name](context, optionsWithHooks); 2418 } 2419 if (result != null) { 2420 if (options.indent) { 2421 var lines = result.split('\n'); 2422 for (var i = 0, l = lines.length; i < l; i++) { 2423 if (!lines[i] && i + 1 === l) { 2424 break; 2425 } 2426 2427 lines[i] = options.indent + lines[i]; 2428 } 2429 result = lines.join('\n'); 2430 } 2431 return result; 2432 } else { 2433 throw new _exception2['default']('The partial ' + options.name + ' could not be compiled when running in runtime-only mode'); 2434 } 2435 } 2436 2437 // Just add water 2438 var container = { 2439 strict: function strict(obj, name) { 2440 if (!(name in obj)) { 2441 throw new _exception2['default']('"' + name + '" not defined in ' + obj); 2442 } 2443 return obj[name]; 2444 }, 2445 lookup: function lookup(depths, name) { 2446 var len = depths.length; 2447 for (var i = 0; i < len; i++) { 2448 if (depths[i] && depths[i][name] != null) { 2449 return depths[i][name]; 2450 } 2451 } 2452 }, 2453 lambda: function lambda(current, context) { 2454 return typeof current === 'function' ? current.call(context) : current; 2455 }, 2456 2457 escapeExpression: Utils.escapeExpression, 2458 invokePartial: invokePartialWrapper, 2459 2460 fn: function fn(i) { 2461 var ret = templateSpec[i]; 2462 ret.decorator = templateSpec[i + '_d']; 2463 return ret; 2464 }, 2465 2466 programs: [], 2467 program: function program(i, data, declaredBlockParams, blockParams, depths) { 2468 var programWrapper = this.programs[i], 2469 fn = this.fn(i); 2470 if (data || depths || blockParams || declaredBlockParams) { 2471 programWrapper = wrapProgram(this, i, fn, data, declaredBlockParams, blockParams, depths); 2472 } else if (!programWrapper) { 2473 programWrapper = this.programs[i] = wrapProgram(this, i, fn); 2474 } 2475 return programWrapper; 2476 }, 2477 2478 data: function data(value, depth) { 2479 while (value && depth--) { 2480 value = value._parent; 2481 } 2482 return value; 2483 }, 2484 // An empty object to use as replacement for null-contexts 2485 nullContext: _Object$seal({}), 2486 2487 noop: env.VM.noop, 2488 compilerInfo: templateSpec.compiler 2489 }; 2490 2491 function ret(context) { 2492 var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; 2493 2494 var data = options.data; 2495 2496 ret._setup(options); 2497 if (!options.partial && templateSpec.useData) { 2498 data = initData(context, data); 2499 } 2500 var depths = undefined, 2501 blockParams = templateSpec.useBlockParams ? [] : undefined; 2502 if (templateSpec.useDepths) { 2503 if (options.depths) { 2504 depths = context != options.depths[0] ? [context].concat(options.depths) : options.depths; 2505 } else { 2506 depths = [context]; 2507 } 2508 } 2509 2510 function main(context /*, options*/) { 2511 return '' + templateSpec.main(container, context, container.helpers, container.partials, data, blockParams, depths); 2512 } 2513 main = executeDecorators(templateSpec.main, main, container, options.depths || [], data, blockParams); 2514 return main(context, options); 2515 } 2516 ret.isTop = true; 2517 2518 ret._setup = function (options) { 2519 if (!options.partial) { 2520 container.helpers = Utils.extend({}, env.helpers, options.helpers); 2521 2522 if (templateSpec.usePartial) { 2523 container.partials = Utils.extend({}, env.partials, options.partials); 2524 } 2525 if (templateSpec.usePartial || templateSpec.useDecorators) { 2526 container.decorators = Utils.extend({}, env.decorators, options.decorators); 2527 } 2528 2529 container.hooks = {}; 2530 2531 var keepHelperInHelpers = options.allowCallsToHelperMissing || templateWasPrecompiledWithCompilerV7; 2532 _helpers.moveHelperToHooks(container, 'helperMissing', keepHelperInHelpers); 2533 _helpers.moveHelperToHooks(container, 'blockHelperMissing', keepHelperInHelpers); 2534 } else { 2535 container.helpers = options.helpers; 2536 container.partials = options.partials; 2537 container.decorators = options.decorators; 2538 container.hooks = options.hooks; 2539 } 2540 }; 2541 2542 ret._child = function (i, data, blockParams, depths) { 2543 if (templateSpec.useBlockParams && !blockParams) { 2544 throw new _exception2['default']('must pass block params'); 2545 } 2546 if (templateSpec.useDepths && !depths) { 2547 throw new _exception2['default']('must pass parent depths'); 2548 } 2549 2550 return wrapProgram(container, i, templateSpec[i], data, 0, blockParams, depths); 2551 }; 2552 return ret; 2553 } 2554 2555 function wrapProgram(container, i, fn, data, declaredBlockParams, blockParams, depths) { 2556 function prog(context) { 2557 var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; 2558 2559 var currentDepths = depths; 2560 if (depths && context != depths[0] && !(context === container.nullContext && depths[0] === null)) { 2561 currentDepths = [context].concat(depths); 2562 } 2563 2564 return fn(container, context, container.helpers, container.partials, options.data || data, blockParams && [options.blockParams].concat(blockParams), currentDepths); 2565 } 2566 2567 prog = executeDecorators(fn, prog, container, depths, data, blockParams); 2568 2569 prog.program = i; 2570 prog.depth = depths ? depths.length : 0; 2571 prog.blockParams = declaredBlockParams || 0; 2572 return prog; 2573 } 2574 2575 /** 2576 * This is currently part of the official API, therefore implementation details should not be changed. 2577 */ 2578 2579 function resolvePartial(partial, context, options) { 2580 if (!partial) { 2581 if (options.name === '@partial-block') { 2582 partial = options.data['partial-block']; 2583 } else { 2584 partial = options.partials[options.name]; 2585 } 2586 } else if (!partial.call && !options.name) { 2587 // This is a dynamic partial that returned a string 2588 options.name = partial; 2589 partial = options.partials[partial]; 2590 } 2591 return partial; 2592 } 2593 2594 function invokePartial(partial, context, options) { 2595 // Use the current closure context to save the partial-block if this partial 2596 var currentPartialBlock = options.data && options.data['partial-block']; 2597 options.partial = true; 2598 if (options.ids) { 2599 options.data.contextPath = options.ids[0] || options.data.contextPath; 2600 } 2601 2602 var partialBlock = undefined; 2603 if (options.fn && options.fn !== noop) { 2604 (function () { 2605 options.data = _base.createFrame(options.data); 2606 // Wrapper function to get access to currentPartialBlock from the closure 2607 var fn = options.fn; 2608 partialBlock = options.data['partial-block'] = function partialBlockWrapper(context) { 2609 var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; 2610 2611 // Restore the partial-block from the closure for the execution of the block 2612 // i.e. the part inside the block of the partial call. 2613 options.data = _base.createFrame(options.data); 2614 options.data['partial-block'] = currentPartialBlock; 2615 return fn(context, options); 2616 }; 2617 if (fn.partials) { 2618 options.partials = Utils.extend({}, options.partials, fn.partials); 2619 } 2620 })(); 2621 } 2622 2623 if (partial === undefined && partialBlock) { 2624 partial = partialBlock; 2625 } 2626 2627 if (partial === undefined) { 2628 throw new _exception2['default']('The partial ' + options.name + ' could not be found'); 2629 } else if (partial instanceof Function) { 2630 return partial(context, options); 2631 } 2632 } 2633 2634 function noop() { 2635 return ''; 2636 } 2637 2638 function initData(context, data) { 2639 if (!data || !('root' in data)) { 2640 data = data ? _base.createFrame(data) : {}; 2641 data.root = context; 2642 } 2643 return data; 2644 } 2645 2646 function executeDecorators(fn, prog, container, depths, data, blockParams) { 2647 if (fn.decorator) { 2648 var props = {}; 2649 prog = fn.decorator(prog, props, container, depths && depths[0], data, blockParams, depths); 2650 Utils.extend(prog, props); 2651 } 2652 return prog; 2653 } 2654 2655/***/ }), 2656/* 23 */ 2657/***/ (function(module, exports, __webpack_require__) { 2658 2659 module.exports = { "default": __webpack_require__(24), __esModule: true }; 2660 2661/***/ }), 2662/* 24 */ 2663/***/ (function(module, exports, __webpack_require__) { 2664 2665 __webpack_require__(25);
vendor: 4,152 bytes, lines 2666-2797
2666 module.exports = __webpack_require__(30).Object.seal; 2667 2668/***/ }), 2669/* 25 */ 2670/***/ (function(module, exports, __webpack_require__) { 2671 2672 // 19.1.2.17 Object.seal(O) 2673 var isObject = __webpack_require__(26); 2674 2675 __webpack_require__(27)('seal', function($seal){ 2676 return function seal(it){ 2677 return $seal && isObject(it) ? $seal(it) : it; 2678 }; 2679 }); 2680 2681/***/ }), 2682/* 26 */ 2683/***/ (function(module, exports) { 2684 2685 module.exports = function(it){ 2686 return typeof it === 'object' ? it !== null : typeof it === 'function'; 2687 }; 2688 2689/***/ }), 2690/* 27 */ 2691/***/ (function(module, exports, __webpack_require__) { 2692 2693 // most Object methods by ES6 should accept primitives 2694 var $export = __webpack_require__(28) 2695 , core = __webpack_require__(30) 2696 , fails = __webpack_require__(33); 2697 module.exports = function(KEY, exec){ 2698 var fn = (core.Object || {})[KEY] || Object[KEY] 2699 , exp = {}; 2700 exp[KEY] = exec(fn); 2701 $export($export.S + $export.F * fails(function(){ fn(1); }), 'Object', exp); 2702 }; 2703 2704/***/ }), 2705/* 28 */ 2706/***/ (function(module, exports, __webpack_require__) { 2707 2708 var global = __webpack_require__(29) 2709 , core = __webpack_require__(30) 2710 , ctx = __webpack_require__(31) 2711 , PROTOTYPE = 'prototype'; 2712 2713 var $export = function(type, name, source){ 2714 var IS_FORCED = type & $export.F 2715 , IS_GLOBAL = type & $export.G 2716 , IS_STATIC = type & $export.S 2717 , IS_PROTO = type & $export.P 2718 , IS_BIND = type & $export.B 2719 , IS_WRAP = type & $export.W 2720 , exports = IS_GLOBAL ? core : core[name] || (core[name] = {}) 2721 , target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE] 2722 , key, own, out; 2723 if(IS_GLOBAL)source = name; 2724 for(key in source){ 2725 // contains in native 2726 own = !IS_FORCED && target && key in target; 2727 if(own && key in exports)continue; 2728 // export native or passed 2729 out = own ? target[key] : source[key]; 2730 // prevent global pollution for namespaces 2731 exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key] 2732 // bind timers to global for call from export context 2733 : IS_BIND && own ? ctx(out, global) 2734 // wrap global constructors for prevent change them in library 2735 : IS_WRAP && target[key] == out ? (function(C){ 2736 var F = function(param){ 2737 return this instanceof C ? new C(param) : C(param); 2738 }; 2739 F[PROTOTYPE] = C[PROTOTYPE]; 2740 return F; 2741 // make static versions for prototype methods 2742 })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; 2743 if(IS_PROTO)(exports[PROTOTYPE] || (exports[PROTOTYPE] = {}))[key] = out; 2744 } 2745 }; 2746 // type bitmap 2747 $export.F = 1; // forced 2748 $export.G = 2; // global 2749 $export.S = 4; // static 2750 $export.P = 8; // proto 2751 $export.B = 16; // bind 2752 $export.W = 32; // wrap 2753 module.exports = $export; 2754 2755/***/ }), 2756/* 29 */ 2757/***/ (function(module, exports) { 2758 2759 // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 2760 var global = module.exports = typeof window != 'undefined' && window.Math == Math 2761 ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')(); 2762 if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef 2763 2764/***/ }), 2765/* 30 */ 2766/***/ (function(module, exports) { 2767 2768 var core = module.exports = {version: '1.2.6'}; 2769 if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef 2770 2771/***/ }), 2772/* 31 */ 2773/***/ (function(module, exports, __webpack_require__) { 2774 2775 // optional / simple context binding 2776 var aFunction = __webpack_require__(32); 2777 module.exports = function(fn, that, length){ 2778 aFunction(fn); 2779 if(that === undefined)return fn; 2780 switch(length){ 2781 case 1: return function(a){ 2782 return fn.call(that, a); 2783 }; 2784 case 2: return function(a, b){ 2785 return fn.call(that, a, b); 2786 }; 2787 case 3: return function(a, b, c){ 2788 return fn.call(that, a, b, c); 2789 }; 2790 } 2791 return function(/* ...args */){ 2792 return fn.apply(that, arguments); 2793 }; 2794 }; 2795 2796/***/ }), 2797/* 32 */
vendor: 5,668 bytes, lines 2798-2939
2798/***/ (function(module, exports) { 2799 2800 module.exports = function(it){ 2801 if(typeof it != 'function')throw TypeError(it + ' is not a function!'); 2802 return it; 2803 }; 2804 2805/***/ }), 2806/* 33 */ 2807/***/ (function(module, exports) { 2808 2809 module.exports = function(exec){ 2810 try { 2811 return !!exec(); 2812 } catch(e){ 2813 return true; 2814 } 2815 }; 2816 2817/***/ }), 2818/* 34 */ 2819/***/ (function(module, exports) { 2820 2821 /* WEBPACK VAR INJECTION */(function(global) {/* global window */ 2822 'use strict'; 2823 2824 exports.__esModule = true; 2825 2826 exports['default'] = function (Handlebars) { 2827 /* istanbul ignore next */ 2828 var root = typeof global !== 'undefined' ? global : window, 2829 $Handlebars = root.Handlebars; 2830 /* istanbul ignore next */ 2831 Handlebars.noConflict = function () { 2832 if (root.Handlebars === Handlebars) { 2833 root.Handlebars = $Handlebars; 2834 } 2835 return Handlebars; 2836 }; 2837 }; 2838 2839 module.exports = exports['default']; 2840 /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) 2841 2842/***/ }), 2843/* 35 */ 2844/***/ (function(module, exports) { 2845 2846 'use strict'; 2847 2848 exports.__esModule = true; 2849 var AST = { 2850 // Public API used to evaluate derived attributes regarding AST nodes 2851 helpers: { 2852 // a mustache is definitely a helper if: 2853 // * it is an eligible helper, and 2854 // * it has at least one parameter or hash segment 2855 helperExpression: function helperExpression(node) { 2856 return node.type === 'SubExpression' || (node.type === 'MustacheStatement' || node.type === 'BlockStatement') && !!(node.params && node.params.length || node.hash); 2857 }, 2858 2859 scopedId: function scopedId(path) { 2860 return (/^\.|this\b/.test(path.original) 2861 ); 2862 }, 2863 2864 // an ID is simple if it only has one part, and that part is not 2865 // `..` or `this`. 2866 simpleId: function simpleId(path) { 2867 return path.parts.length === 1 && !AST.helpers.scopedId(path) && !path.depth; 2868 } 2869 } 2870 }; 2871 2872 // Must be exported as an object rather than the root of the module as the jison lexer 2873 // must modify the object to operate properly. 2874 exports['default'] = AST; 2875 module.exports = exports['default']; 2876 2877/***/ }), 2878/* 36 */ 2879/***/ (function(module, exports, __webpack_require__) { 2880 2881 'use strict'; 2882 2883 var _interopRequireDefault = __webpack_require__(1)['default']; 2884 2885 var _interopRequireWildcard = __webpack_require__(3)['default']; 2886 2887 exports.__esModule = true; 2888 exports.parse = parse; 2889 2890 var _parser = __webpack_require__(37); 2891 2892 var _parser2 = _interopRequireDefault(_parser); 2893 2894 var _whitespaceControl = __webpack_require__(38); 2895 2896 var _whitespaceControl2 = _interopRequireDefault(_whitespaceControl); 2897 2898 var _helpers = __webpack_require__(40); 2899 2900 var Helpers = _interopRequireWildcard(_helpers); 2901 2902 var _utils = __webpack_require__(5); 2903 2904 exports.parser = _parser2['default']; 2905 2906 var yy = {}; 2907 _utils.extend(yy, Helpers); 2908 2909 function parse(input, options) { 2910 // Just return if an already-compiled AST was passed in. 2911 if (input.type === 'Program') { 2912 return input; 2913 } 2914 2915 _parser2['default'].yy = yy; 2916 2917 // Altering the shared object here, but this is ok as parser is a sync operation 2918 yy.locInfo = function (locInfo) { 2919 return new yy.SourceLocation(options && options.srcName, locInfo); 2920 }; 2921 2922 var strip = new _whitespaceControl2['default'](options); 2923 return strip.accept(_parser2['default'].parse(input)); 2924 } 2925 2926/***/ }), 2927/* 37 */ 2928/***/ (function(module, exports) { 2929 2930 // File ignored in coverage tests via setting in .istanbul.yml 2931 /* Jison generated parser */ 2932 "use strict"; 2933 2934 exports.__esModule = true; 2935 var handlebars = (function () { 2936 var parser = { trace: function trace() {}, 2937 yy: {}, 2938 symbols_: { "error": 2, "root": 3, "program": 4, "EOF": 5, "program_repetition0": 6, "statement": 7, "mustache": 8, "block": 9, "rawBlock": 10, "partial": 11, "partialBlock": 12, "content": 13, "COMMENT": 14, "CONTENT": 15, "openRawBlock": 16, "rawBlock_repetition_plus0": 17, "END_RAW_BLOCK": 18, "OPEN_RAW_BLOCK": 19, "helperName": 20, "openRawBlock_repetition0": 21, "openRawBlock_option0": 22, "CLOSE_RAW_BLOCK": 23, "openBlock": 24, "block_option0": 25, "closeBlock": 26, "openInverse": 27, "block_option1": 28, "OPEN_BLOCK": 29, "openBlock_repetition0": 30, "openBlock_option0": 31, "openBlock_option1": 32, "CLOSE": 33, "OPEN_INVERSE": 34, "openInverse_repetition0": 35, "openInverse_option0": 36, "openInverse_option1": 37, "openInverseChain": 38, "OPEN_INVERSE_CHAIN": 39, "openInverseChain_repetition0": 40, "openInverseChain_option0": 41, "openInverseChain_option1": 42, "inverseAndProgram": 43, "INVERSE": 44, "inverseChain": 45, "inverseChain_option0": 46, "OPEN_ENDBLOCK": 47, "OPEN": 48, "mustache_repetition0": 49, "mustache_option0": 50, "OPEN_UNESCAPED": 51, "mustache_repetition1": 52, "mustache_option1": 53, "CLOSE_UNESCAPED": 54, "OPEN_PARTIAL": 55, "partialName": 56, "partial_repetition0": 57, "partial_option0": 58, "openPartialBlock": 59, "OPEN_PARTIAL_BLOCK": 60, "openPartialBlock_repetition0": 61, "openPartialBlock_option0": 62, "param": 63, "sexpr": 64, "OPEN_SEXPR": 65, "sexpr_repetition0": 66, "sexpr_option0": 67, "CLOSE_SEXPR": 68, "hash": 69, "hash_repetition_plus0": 70, "hashSegment": 71, "ID": 72, "EQUALS": 73, "blockParams": 74, "OPEN_BLOCK_PARAMS": 75, "blockParams_repetition_plus0": 76, "CLOSE_BLOCK_PARAMS": 77, "path": 78, "dataName": 79, "STRING": 80, "NUMBER": 81, "BOOLEAN": 82, "UNDEFINED": 83, "NULL": 84, "DATA": 85, "pathSegments": 86, "SEP": 87, "$accept": 0, "$end": 1 }, 2939 terminals_: { 2: "error", 5: "EOF", 14: "COMMENT", 15: "CONTENT",
vendor: 40,171 bytes, lines 2939-3470
293918: "END_RAW_BLOCK", 19: "OPEN_RAW_BLOCK", 23: "CLOSE_RAW_BLOCK", 29: "OPEN_BLOCK", 33: "CLOSE", 34: "OPEN_INVERSE", 39: "OPEN_INVERSE_CHAIN", 44: "INVERSE", 47: "OPEN_ENDBLOCK", 48: "OPEN", 51: "OPEN_UNESCAPED", 54: "CLOSE_UNESCAPED", 55: "OPEN_PARTIAL", 60: "OPEN_PARTIAL_BLOCK", 65: "OPEN_SEXPR", 68: "CLOSE_SEXPR", 72: "ID", 73: "EQUALS", 75: "OPEN_BLOCK_PARAMS", 77: "CLOSE_BLOCK_PARAMS", 80: "STRING", 81: "NUMBER", 82: "BOOLEAN", 83: "UNDEFINED", 84: "NULL", 85: "DATA", 87: "SEP" }, 2940 productions_: [0, [3, 2], [4, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [7, 1], [13, 1], [10, 3], [16, 5], [9, 4], [9, 4], [24, 6], [27, 6], [38, 6], [43, 2], [45, 3], [45, 1], [26, 3], [8, 5], [8, 5], [11, 5], [12, 3], [59, 5], [63, 1], [63, 1], [64, 5], [69, 1], [71, 3], [74, 3], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [20, 1], [56, 1], [56, 1], [79, 2], [78, 1], [86, 3], [86, 1], [6, 0], [6, 2], [17, 1], [17, 2], [21, 0], [21, 2], [22, 0], [22, 1], [25, 0], [25, 1], [28, 0], [28, 1], [30, 0], [30, 2], [31, 0], [31, 1], [32, 0], [32, 1], [35, 0], [35, 2], [36, 0], [36, 1], [37, 0], [37, 1], [40, 0], [40, 2], [41, 0], [41, 1], [42, 0], [42, 1], [46, 0], [46, 1], [49, 0], [49, 2], [50, 0], [50, 1], [52, 0], [52, 2], [53, 0], [53, 1], [57, 0], [57, 2], [58, 0], [58, 1], [61, 0], [61, 2], [62, 0], [62, 1], [66, 0], [66, 2], [67, 0], [67, 1], [70, 1], [70, 2], [76, 1], [76, 2]], 2941 performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) { 2942 2943 var $0 = $$.length - 1; 2944 switch (yystate) { 2945 case 1: 2946 return $$[$0 - 1]; 2947 break; 2948 case 2: 2949 this.$ = yy.prepareProgram($$[$0]); 2950 break; 2951 case 3: 2952 this.$ = $$[$0]; 2953 break; 2954 case 4: 2955 this.$ = $$[$0]; 2956 break; 2957 case 5: 2958 this.$ = $$[$0]; 2959 break; 2960 case 6: 2961 this.$ = $$[$0]; 2962 break; 2963 case 7: 2964 this.$ = $$[$0]; 2965 break; 2966 case 8: 2967 this.$ = $$[$0]; 2968 break; 2969 case 9: 2970 this.$ = { 2971 type: 'CommentStatement', 2972 value: yy.stripComment($$[$0]), 2973 strip: yy.stripFlags($$[$0], $$[$0]), 2974 loc: yy.locInfo(this._$) 2975 }; 2976 2977 break; 2978 case 10: 2979 this.$ = { 2980 type: 'ContentStatement', 2981 original: $$[$0], 2982 value: $$[$0], 2983 loc: yy.locInfo(this._$) 2984 }; 2985 2986 break; 2987 case 11: 2988 this.$ = yy.prepareRawBlock($$[$0 - 2], $$[$0 - 1], $$[$0], this._$); 2989 break; 2990 case 12: 2991 this.$ = { path: $$[$0 - 3], params: $$[$0 - 2], hash: $$[$0 - 1] }; 2992 break; 2993 case 13: 2994 this.$ = yy.prepareBlock($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0], false, this._$); 2995 break; 2996 case 14: 2997 this.$ = yy.prepareBlock($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0], true, this._$); 2998 break; 2999 case 15: 3000 this.$ = { open: $$[$0 - 5], path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) }; 3001 break; 3002 case 16: 3003 this.$ = { path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) }; 3004 break; 3005 case 17: 3006 this.$ = { path: $$[$0 - 4], params: $$[$0 - 3], hash: $$[$0 - 2], blockParams: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 5], $$[$0]) }; 3007 break; 3008 case 18: 3009 this.$ = { strip: yy.stripFlags($$[$0 - 1], $$[$0 - 1]), program: $$[$0] }; 3010 break; 3011 case 19: 3012 var inverse = yy.prepareBlock($$[$0 - 2], $$[$0 - 1], $$[$0], $$[$0], false, this._$), 3013 program = yy.prepareProgram([inverse], $$[$0 - 1].loc); 3014 program.chained = true; 3015 3016 this.$ = { strip: $$[$0 - 2].strip, program: program, chain: true }; 3017 3018 break; 3019 case 20: 3020 this.$ = $$[$0]; 3021 break; 3022 case 21: 3023 this.$ = { path: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 2], $$[$0]) }; 3024 break; 3025 case 22: 3026 this.$ = yy.prepareMustache($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 4], yy.stripFlags($$[$0 - 4], $$[$0]), this._$); 3027 break; 3028 case 23: 3029 this.$ = yy.prepareMustache($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 4], yy.stripFlags($$[$0 - 4], $$[$0]), this._$); 3030 break; 3031 case 24: 3032 this.$ = { 3033 type: 'PartialStatement', 3034 name: $$[$0 - 3], 3035 params: $$[$0 - 2], 3036 hash: $$[$0 - 1], 3037 indent: '', 3038 strip: yy.stripFlags($$[$0 - 4], $$[$0]), 3039 loc: yy.locInfo(this._$) 3040 }; 3041 3042 break; 3043 case 25: 3044 this.$ = yy.preparePartialBlock($$[$0 - 2], $$[$0 - 1], $$[$0], this._$); 3045 break; 3046 case 26: 3047 this.$ = { path: $$[$0 - 3], params: $$[$0 - 2], hash: $$[$0 - 1], strip: yy.stripFlags($$[$0 - 4], $$[$0]) }; 3048 break; 3049 case 27: 3050 this.$ = $$[$0]; 3051 break; 3052 case 28: 3053 this.$ = $$[$0]; 3054 break; 3055 case 29: 3056 this.$ = { 3057 type: 'SubExpression', 3058 path: $$[$0 - 3], 3059 params: $$[$0 - 2], 3060 hash: $$[$0 - 1], 3061 loc: yy.locInfo(this._$) 3062 }; 3063 3064 break; 3065 case 30: 3066 this.$ = { type: 'Hash', pairs: $$[$0], loc: yy.locInfo(this._$) }; 3067 break; 3068 case 31: 3069 this.$ = { type: 'HashPair', key: yy.id($$[$0 - 2]), value: $$[$0], loc: yy.locInfo(this._$) }; 3070 break; 3071 case 32: 3072 this.$ = yy.id($$[$0 - 1]); 3073 break; 3074 case 33: 3075 this.$ = $$[$0]; 3076 break; 3077 case 34: 3078 this.$ = $$[$0]; 3079 break; 3080 case 35: 3081 this.$ = { type: 'StringLiteral', value: $$[$0], original: $$[$0], loc: yy.locInfo(this._$) }; 3082 break; 3083 case 36: 3084 this.$ = { type: 'NumberLiteral', value: Number($$[$0]), original: Number($$[$0]), loc: yy.locInfo(this._$) }; 3085 break; 3086 case 37: 3087 this.$ = { type: 'BooleanLiteral', value: $$[$0] === 'true', original: $$[$0] === 'true', loc: yy.locInfo(this._$) }; 3088 break; 3089 case 38: 3090 this.$ = { type: 'UndefinedLiteral', original: undefined, value: undefined, loc: yy.locInfo(this._$) }; 3091 break; 3092 case 39: 3093 this.$ = { type: 'NullLiteral', original: null, value: null, loc: yy.locInfo(this._$) }; 3094 break; 3095 case 40: 3096 this.$ = $$[$0]; 3097 break; 3098 case 41: 3099 this.$ = $$[$0]; 3100 break; 3101 case 42: 3102 this.$ = yy.preparePath(true, $$[$0], this._$); 3103 break; 3104 case 43: 3105 this.$ = yy.preparePath(false, $$[$0], this._$); 3106 break; 3107 case 44: 3108 $$[$0 - 2].push({ part: yy.id($$[$0]), original: $$[$0], separator: $$[$0 - 1] });this.$ = $$[$0 - 2]; 3109 break; 3110 case 45: 3111 this.$ = [{ part: yy.id($$[$0]), original: $$[$0] }]; 3112 break; 3113 case 46: 3114 this.$ = []; 3115 break; 3116 case 47: 3117 $$[$0 - 1].push($$[$0]); 3118 break; 3119 case 48: 3120 this.$ = [$$[$0]]; 3121 break; 3122 case 49: 3123 $$[$0 - 1].push($$[$0]); 3124 break; 3125 case 50: 3126 this.$ = []; 3127 break; 3128 case 51: 3129 $$[$0 - 1].push($$[$0]); 3130 break; 3131 case 58: 3132 this.$ = []; 3133 break; 3134 case 59: 3135 $$[$0 - 1].push($$[$0]); 3136 break; 3137 case 64: 3138 this.$ = []; 3139 break; 3140 case 65: 3141 $$[$0 - 1].push($$[$0]); 3142 break; 3143 case 70: 3144 this.$ = []; 3145 break; 3146 case 71: 3147 $$[$0 - 1].push($$[$0]); 3148 break; 3149 case 78: 3150 this.$ = []; 3151 break; 3152 case 79: 3153 $$[$0 - 1].push($$[$0]); 3154 break; 3155 case 82: 3156 this.$ = []; 3157 break; 3158 case 83: 3159 $$[$0 - 1].push($$[$0]); 3160 break; 3161 case 86: 3162 this.$ = []; 3163 break; 3164 case 87: 3165 $$[$0 - 1].push($$[$0]); 3166 break; 3167 case 90: 3168 this.$ = []; 3169 break; 3170 case 91: 3171 $$[$0 - 1].push($$[$0]); 3172 break; 3173 case 94: 3174 this.$ = []; 3175 break; 3176 case 95: 3177 $$[$0 - 1].push($$[$0]); 3178 break; 3179 case 98: 3180 this.$ = [$$[$0]]; 3181 break; 3182 case 99: 3183 $$[$0 - 1].push($$[$0]); 3184 break; 3185 case 100: 3186 this.$ = [$$[$0]]; 3187 break; 3188 case 101: 3189 $$[$0 - 1].push($$[$0]); 3190 break; 3191 } 3192 }, 3193 table: [{ 3: 1, 4: 2, 5: [2, 46], 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 1: [3] }, { 5: [1, 4] }, { 5: [2, 2], 7: 5, 8: 6, 9: 7, 10: 8, 11: 9, 12: 10, 13: 11, 14: [1, 12], 15: [1, 20], 16: 17, 19: [1, 23], 24: 15, 27: 16, 29: [1, 21], 34: [1, 22], 39: [2, 2], 44: [2, 2], 47: [2, 2], 48: [1, 13], 51: [1, 14], 55: [1, 18], 59: 19, 60: [1, 24] }, { 1: [2, 1] }, { 5: [2, 47], 14: [2, 47], 15: [2, 47], 19: [2, 47], 29: [2, 47], 34: [2, 47], 39: [2, 47], 44: [2, 47], 47: [2, 47], 48: [2, 47], 51: [2, 47], 55: [2, 47], 60: [2, 47] }, { 5: [2, 3], 14: [2, 3], 15: [2, 3], 19: [2, 3], 29: [2, 3], 34: [2, 3], 39: [2, 3], 44: [2, 3], 47: [2, 3], 48: [2, 3], 51: [2, 3], 55: [2, 3], 60: [2, 3] }, { 5: [2, 4], 14: [2, 4], 15: [2, 4], 19: [2, 4], 29: [2, 4], 34: [2, 4], 39: [2, 4], 44: [2, 4], 47: [2, 4], 48: [2, 4], 51: [2, 4], 55: [2, 4], 60: [2, 4] }, { 5: [2, 5], 14: [2, 5], 15: [2, 5], 19: [2, 5], 29: [2, 5], 34: [2, 5], 39: [2, 5], 44: [2, 5], 47: [2, 5], 48: [2, 5], 51: [2, 5], 55: [2, 5], 60: [2, 5] }, { 5: [2, 6], 14: [2, 6], 15: [2, 6], 19: [2, 6], 29: [2, 6], 34: [2, 6], 39: [2, 6], 44: [2, 6], 47: [2, 6], 48: [2, 6], 51: [2, 6], 55: [2, 6], 60: [2, 6] }, { 5: [2, 7], 14: [2, 7], 15: [2, 7], 19: [2, 7], 29: [2, 7], 34: [2, 7], 39: [2, 7], 44: [2, 7], 47: [2, 7], 48: [2, 7], 51: [2, 7], 55: [2, 7], 60: [2, 7] }, { 5: [2, 8], 14: [2, 8], 15: [2, 8], 19: [2, 8], 29: [2, 8], 34: [2, 8], 39: [2, 8], 44: [2, 8], 47: [2, 8], 48: [2, 8], 51: [2, 8], 55: [2, 8], 60: [2, 8] }, { 5: [2, 9], 14: [2, 9], 15: [2, 9], 19: [2, 9], 29: [2, 9], 34: [2, 9], 39: [2, 9], 44: [2, 9], 47: [2, 9], 48: [2, 9], 51: [2, 9], 55: [2, 9], 60: [2, 9] }, { 20: 25, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 36, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 37, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 39: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 4: 38, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 13: 40, 15: [1, 20], 17: 39 }, { 20: 42, 56: 41, 64: 43, 65: [1, 44], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 45, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 5: [2, 10], 14: [2, 10], 15: [2, 10], 18: [2, 10], 19: [2, 10], 29: [2, 10], 34: [2, 10], 39: [2, 10], 44: [2, 10], 47: [2, 10], 48: [2, 10], 51: [2, 10], 55: [2, 10], 60: [2, 10] }, { 20: 46, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 47, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 48, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 42, 56: 49, 64: 43, 65: [1, 44], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [2, 78], 49: 50, 65: [2, 78], 72: [2, 78], 80: [2, 78], 81: [2, 78], 82: [2, 78], 83: [2, 78], 84: [2, 78], 85: [2, 78] }, { 23: [2, 33], 33: [2, 33], 54: [2, 33], 65: [2, 33], 68: [2, 33], 72: [2, 33], 75: [2, 33], 80: [2, 33], 81: [2, 33], 82: [2, 33], 83: [2, 33], 84: [2, 33], 85: [2, 33] }, { 23: [2, 34], 33: [2, 34], 54: [2, 34], 65: [2, 34], 68: [2, 34], 72: [2, 34], 75: [2, 34], 80: [2, 34], 81: [2, 34], 82: [2, 34], 83: [2, 34], 84: [2, 34], 85: [2, 34] }, { 23: [2, 35], 33: [2, 35], 54: [2, 35], 65: [2, 35], 68: [2, 35], 72: [2, 35], 75: [2, 35], 80: [2, 35], 81: [2, 35], 82: [2, 35], 83: [2, 35], 84: [2, 35], 85: [2, 35] }, { 23: [2, 36], 33: [2, 36], 54: [2, 36], 65: [2, 36], 68: [2, 36], 72: [2, 36], 75: [2, 36], 80: [2, 36], 81: [2, 36], 82: [2, 36], 83: [2, 36], 84: [2, 36], 85: [2, 36] }, { 23: [2, 37], 33: [2, 37], 54: [2, 37], 65: [2, 37], 68: [2, 37], 72: [2, 37], 75: [2, 37], 80: [2, 37], 81: [2, 37], 82: [2, 37], 83: [2, 37], 84: [2, 37], 85: [2, 37] }, { 23: [2, 38], 33: [2, 38], 54: [2, 38], 65: [2, 38], 68: [2, 38], 72: [2, 38], 75: [2, 38], 80: [2, 38], 81: [2, 38], 82: [2, 38], 83: [2, 38], 84: [2, 38], 85: [2, 38] }, { 23: [2, 39], 33: [2, 39], 54: [2, 39], 65: [2, 39], 68: [2, 39], 72: [2, 39], 75: [2, 39], 80: [2, 39], 81: [2, 39], 82: [2, 39], 83: [2, 39], 84: [2, 39], 85: [2, 39] }, { 23: [2, 43], 33: [2, 43], 54: [2, 43], 65: [2, 43], 68: [2, 43], 72: [2, 43], 75: [2, 43], 80: [2, 43], 81: [2, 43], 82: [2, 43], 83: [2, 43], 84: [2, 43], 85: [2, 43], 87: [1, 51] }, { 72: [1, 35], 86: 52 }, { 23: [2, 45], 33: [2, 45], 54: [2, 45], 65: [2, 45], 68: [2, 45], 72: [2, 45], 75: [2, 45], 80: [2, 45], 81: [2, 45], 82: [2, 45], 83: [2, 45], 84: [2, 45], 85: [2, 45], 87: [2, 45] }, { 52: 53, 54: [2, 82], 65: [2, 82], 72: [2, 82], 80: [2, 82], 81: [2, 82], 82: [2, 82], 83: [2, 82], 84: [2, 82], 85: [2, 82] }, { 25: 54, 38: 56, 39: [1, 58], 43: 57, 44: [1, 59], 45: 55, 47: [2, 54] }, { 28: 60, 43: 61, 44: [1, 59], 47: [2, 56] }, { 13: 63, 15: [1, 20], 18: [1, 62] }, { 15: [2, 48], 18: [2, 48] }, { 33: [2, 86], 57: 64, 65: [2, 86], 72: [2, 86], 80: [2, 86], 81: [2, 86], 82: [2, 86], 83: [2, 86], 84: [2, 86], 85: [2, 86] }, { 33: [2, 40], 65: [2, 40], 72: [2, 40], 80: [2, 40], 81: [2, 40], 82: [2, 40], 83: [2, 40], 84: [2, 40], 85: [2, 40] }, { 33: [2, 41], 65: [2, 41], 72: [2, 41], 80: [2, 41], 81: [2, 41], 82: [2, 41], 83: [2, 41], 84: [2, 41], 85: [2, 41] }, { 20: 65, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 26: 66, 47: [1, 67] }, { 30: 68, 33: [2, 58], 65: [2, 58], 72: [2, 58], 75: [2, 58], 80: [2, 58], 81: [2, 58], 82: [2, 58], 83: [2, 58], 84: [2, 58], 85: [2, 58] }, { 33: [2, 64], 35: 69, 65: [2, 64], 72: [2, 64], 75: [2, 64], 80: [2, 64], 81: [2, 64], 82: [2, 64], 83: [2, 64], 84: [2, 64], 85: [2, 64] }, { 21: 70, 23: [2, 50], 65: [2, 50], 72: [2, 50], 80: [2, 50], 81: [2, 50], 82: [2, 50], 83: [2, 50], 84: [2, 50], 85: [2, 50] }, { 33: [2, 90], 61: 71, 65: [2, 90], 72: [2, 90], 80: [2, 90], 81: [2, 90], 82: [2, 90], 83: [2, 90], 84: [2, 90], 85: [2, 90] }, { 20: 75, 33: [2, 80], 50: 72, 63: 73, 64: 76, 65: [1, 44], 69: 74, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 72: [1, 80] }, { 23: [2, 42], 33: [2, 42], 54: [2, 42], 65: [2, 42], 68: [2, 42], 72: [2, 42], 75: [2, 42], 80: [2, 42], 81: [2, 42], 82: [2, 42], 83: [2, 42], 84: [2, 42], 85: [2, 42], 87: [1, 51] }, { 20: 75, 53: 81, 54: [2, 84], 63: 82, 64: 76, 65: [1, 44], 69: 83, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 26: 84, 47: [1, 67] }, { 47: [2, 55] }, { 4: 85, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 39: [2, 46], 44: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 47: [2, 20] }, { 20: 86, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 4: 87, 6: 3, 14: [2, 46], 15: [2, 46], 19: [2, 46], 29: [2, 46], 34: [2, 46], 47: [2, 46], 48: [2, 46], 51: [2, 46], 55: [2, 46], 60: [2, 46] }, { 26: 88, 47: [1, 67] }, { 47: [2, 57] }, { 5: [2, 11], 14: [2, 11], 15: [2, 11], 19: [2, 11], 29: [2, 11], 34: [2, 11], 39: [2, 11], 44: [2, 11], 47: [2, 11], 48: [2, 11], 51: [2, 11], 55: [2, 11], 60: [2, 11] }, { 15: [2, 49], 18: [2, 49] }, { 20: 75, 33: [2, 88], 58: 89, 63: 90, 64: 76, 65: [1, 44], 69: 91, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 65: [2, 94], 66: 92, 68: [2, 94], 72: [2, 94], 80: [2, 94], 81: [2, 94], 82: [2, 94], 83: [2, 94], 84: [2, 94], 85: [2, 94] }, { 5: [2, 25], 14: [2, 25], 15: [2, 25], 19: [2, 25], 29: [2, 25], 34: [2, 25], 39: [2, 25], 44: [2, 25], 47: [2, 25], 48: [2, 25], 51: [2, 25], 55: [2, 25], 60: [2, 25] }, { 20: 93, 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 75, 31: 94, 33: [2, 60], 63: 95, 64: 76, 65: [1, 44], 69: 96, 70: 77, 71: 78, 72: [1, 79], 75: [2, 60], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 75, 33: [2, 66], 36: 97, 63: 98, 64: 76, 65: [1, 44], 69: 99, 70: 77, 71: 78, 72: [1, 79], 75: [2, 66], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 75, 22: 100, 23: [2, 52], 63: 101, 64: 76, 65: [1, 44], 69: 102, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 20: 75, 33: [2, 92], 62: 103, 63: 104, 64: 76, 65: [1, 44], 69: 105, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [1, 106] }, { 33: [2, 79], 65: [2, 79], 72: [2, 79], 80: [2, 79], 81: [2, 79], 82: [2, 79], 83: [2, 79], 84: [2, 79], 85: [2, 79] }, { 33: [2, 81] }, { 23: [2, 27], 33: [2, 27], 54: [2, 27], 65: [2, 27], 68: [2, 27], 72: [2, 27], 75: [2, 27], 80: [2, 27], 81: [2, 27], 82: [2, 27], 83: [2, 27], 84: [2, 27], 85: [2, 27] }, { 23: [2, 28], 33: [2, 28], 54: [2, 28], 65: [2, 28], 68: [2, 28], 72: [2, 28], 75: [2, 28], 80: [2, 28], 81: [2, 28], 82: [2, 28], 83: [2, 28], 84: [2, 28], 85: [2, 28] }, { 23: [2, 30], 33: [2, 30], 54: [2, 30], 68: [2, 30], 71: 107, 72: [1, 108], 75: [2, 30] }, { 23: [2, 98], 33: [2, 98], 54: [2, 98], 68: [2, 98], 72: [2, 98], 75: [2, 98] }, { 23: [2, 45], 33: [2, 45], 54: [2, 45], 65: [2, 45], 68: [2, 45], 72: [2, 45], 73: [1, 109], 75: [2, 45], 80: [2, 45], 81: [2, 45], 82: [2, 45], 83: [2, 45], 84: [2, 45], 85: [2, 45], 87: [2, 45] }, { 23: [2, 44], 33: [2, 44], 54: [2, 44], 65: [2, 44], 68: [2, 44], 72: [2, 44], 75: [2, 44], 80: [2, 44], 81: [2, 44], 82: [2, 44], 83: [2, 44], 84: [2, 44], 85: [2, 44], 87: [2, 44] }, { 54: [1, 110] }, { 54: [2, 83], 65: [2, 83], 72: [2, 83], 80: [2, 83], 81: [2, 83], 82: [2, 83], 83: [2, 83], 84: [2, 83], 85: [2, 83] }, { 54: [2, 85] }, { 5: [2, 13], 14: [2, 13], 15: [2, 13], 19: [2, 13], 29: [2, 13], 34: [2, 13], 39: [2, 13], 44: [2, 13], 47: [2, 13], 48: [2, 13], 51: [2, 13], 55: [2, 13], 60: [2, 13] }, { 38: 56, 39: [1, 58], 43: 57, 44: [1, 59], 45: 112, 46: 111, 47: [2, 76] }, { 33: [2, 70], 40: 113, 65: [2, 70], 72: [2, 70], 75: [2, 70], 80: [2, 70], 81: [2, 70], 82: [2, 70], 83: [2, 70], 84: [2, 70], 85: [2, 70] }, { 47: [2, 18] }, { 5: [2, 14], 14: [2, 14], 15: [2, 14], 19: [2, 14], 29: [2, 14], 34: [2, 14], 39: [2, 14], 44: [2, 14], 47: [2, 14], 48: [2, 14], 51: [2, 14], 55: [2, 14], 60: [2, 14] }, { 33: [1, 114] }, { 33: [2, 87], 65: [2, 87], 72: [2, 87], 80: [2, 87], 81: [2, 87], 82: [2, 87], 83: [2, 87], 84: [2, 87], 85: [2, 87] }, { 33: [2, 89] }, { 20: 75, 63: 116, 64: 76, 65: [1, 44], 67: 115, 68: [2, 96], 69: 117, 70: 77, 71: 78, 72: [1, 79], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 33: [1, 118] }, { 32: 119, 33: [2, 62], 74: 120, 75: [1, 121] }, { 33: [2, 59], 65: [2, 59], 72: [2, 59], 75: [2, 59], 80: [2, 59], 81: [2, 59], 82: [2, 59], 83: [2, 59], 84: [2, 59], 85: [2, 59] }, { 33: [2, 61], 75: [2, 61] }, { 33: [2, 68], 37: 122, 74: 123, 75: [1, 121] }, { 33: [2, 65], 65: [2, 65], 72: [2, 65], 75: [2, 65], 80: [2, 65], 81: [2, 65], 82: [2, 65], 83: [2, 65], 84: [2, 65], 85: [2, 65] }, { 33: [2, 67], 75: [2, 67] }, { 23: [1, 124] }, { 23: [2, 51], 65: [2, 51], 72: [2, 51], 80: [2, 51], 81: [2, 51], 82: [2, 51], 83: [2, 51], 84: [2, 51], 85: [2, 51] }, { 23: [2, 53] }, { 33: [1, 125] }, { 33: [2, 91], 65: [2, 91], 72: [2, 91], 80: [2, 91], 81: [2, 91], 82: [2, 91], 83: [2, 91], 84: [2, 91], 85: [2, 91] }, { 33: [2, 93] }, { 5: [2, 22], 14: [2, 22], 15: [2, 22], 19: [2, 22], 29: [2, 22], 34: [2, 22], 39: [2, 22], 44: [2, 22], 47: [2, 22], 48: [2, 22], 51: [2, 22], 55: [2, 22], 60: [2, 22] }, { 23: [2, 99], 33: [2, 99], 54: [2, 99], 68: [2, 99], 72: [2, 99], 75: [2, 99] }, { 73: [1, 109] }, { 20: 75, 63: 126, 64: 76, 65: [1, 44], 72: [1, 35], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 5: [2, 23], 14: [2, 23], 15: [2, 23], 19: [2, 23], 29: [2, 23], 34: [2, 23], 39: [2, 23], 44: [2, 23], 47: [2, 23], 48: [2, 23], 51: [2, 23], 55: [2, 23], 60: [2, 23] }, { 47: [2, 19] }, { 47: [2, 77] }, { 20: 75, 33: [2, 72], 41: 127, 63: 128, 64: 76, 65: [1, 44], 69: 129, 70: 77, 71: 78, 72: [1, 79], 75: [2, 72], 78: 26, 79: 27, 80: [1, 28], 81: [1, 29], 82: [1, 30], 83: [1, 31], 84: [1, 32], 85: [1, 34], 86: 33 }, { 5: [2, 24], 14: [2, 24], 15: [2, 24], 19: [2, 24], 29: [2, 24], 34: [2, 24], 39: [2, 24], 44: [2, 24], 47: [2, 24], 48: [2, 24], 51: [2, 24], 55: [2, 24], 60: [2, 24] }, { 68: [1, 130] }, { 65: [2, 95], 68: [2, 95], 72: [2, 95], 80: [2, 95], 81: [2, 95], 82: [2, 95], 83: [2, 95], 84: [2, 95], 85: [2, 95] }, { 68: [2, 97] }, { 5: [2, 21], 14: [2, 21], 15: [2, 21], 19: [2, 21], 29: [2, 21], 34: [2, 21], 39: [2, 21], 44: [2, 21], 47: [2, 21], 48: [2, 21], 51: [2, 21], 55: [2, 21], 60: [2, 21] }, { 33: [1, 131] }, { 33: [2, 63] }, { 72: [1, 133], 76: 132 }, { 33: [1, 134] }, { 33: [2, 69] }, { 15: [2, 12] }, { 14: [2, 26], 15: [2, 26], 19: [2, 26], 29: [2, 26], 34: [2, 26], 47: [2, 26], 48: [2, 26], 51: [2, 26], 55: [2, 26], 60: [2, 26] }, { 23: [2, 31], 33: [2, 31], 54: [2, 31], 68: [2, 31], 72: [2, 31], 75: [2, 31] }, { 33: [2, 74], 42: 135, 74: 136, 75: [1, 121] }, { 33: [2, 71], 65: [2, 71], 72: [2, 71], 75: [2, 71], 80: [2, 71], 81: [2, 71], 82: [2, 71], 83: [2, 71], 84: [2, 71], 85: [2, 71] }, { 33: [2, 73], 75: [2, 73] }, { 23: [2, 29], 33: [2, 29], 54: [2, 29], 65: [2, 29], 68: [2, 29], 72: [2, 29], 75: [2, 29], 80: [2, 29], 81: [2, 29], 82: [2, 29], 83: [2, 29], 84: [2, 29], 85: [2, 29] }, { 14: [2, 15], 15: [2, 15], 19: [2, 15], 29: [2, 15], 34: [2, 15], 39: [2, 15], 44: [2, 15], 47: [2, 15], 48: [2, 15], 51: [2, 15], 55: [2, 15], 60: [2, 15] }, { 72: [1, 138], 77: [1, 137] }, { 72: [2, 100], 77: [2, 100] }, { 14: [2, 16], 15: [2, 16], 19: [2, 16], 29: [2, 16], 34: [2, 16], 44: [2, 16], 47: [2, 16], 48: [2, 16], 51: [2, 16], 55: [2, 16], 60: [2, 16] }, { 33: [1, 139] }, { 33: [2, 75] }, { 33: [2, 32] }, { 72: [2, 101], 77: [2, 101] }, { 14: [2, 17], 15: [2, 17], 19: [2, 17], 29: [2, 17], 34: [2, 17], 39: [2, 17], 44: [2, 17], 47: [2, 17], 48: [2, 17], 51: [2, 17], 55: [2, 17], 60: [2, 17] }], 3194 defaultActions: { 4: [2, 1], 55: [2, 55], 57: [2, 20], 61: [2, 57], 74: [2, 81], 83: [2, 85], 87: [2, 18], 91: [2, 89], 102: [2, 53], 105: [2, 93], 111: [2, 19], 112: [2, 77], 117: [2, 97], 120: [2, 63], 123: [2, 69], 124: [2, 12], 136: [2, 75], 137: [2, 32] }, 3195 parseError: function parseError(str, hash) { 3196 throw new Error(str); 3197 }, 3198 parse: function parse(input) { 3199 var self = this, 3200 stack = [0], 3201 vstack = [null], 3202 lstack = [], 3203 table = this.table, 3204 yytext = "", 3205 yylineno = 0, 3206 yyleng = 0, 3207 recovering = 0, 3208 TERROR = 2, 3209 EOF = 1; 3210 this.lexer.setInput(input); 3211 this.lexer.yy = this.yy; 3212 this.yy.lexer = this.lexer; 3213 this.yy.parser = this; 3214 if (typeof this.lexer.yylloc == "undefined") this.lexer.yylloc = {}; 3215 var yyloc = this.lexer.yylloc; 3216 lstack.push(yyloc); 3217 var ranges = this.lexer.options && this.lexer.options.ranges; 3218 if (typeof this.yy.parseError === "function") this.parseError = this.yy.parseError; 3219 function popStack(n) { 3220 stack.length = stack.length - 2 * n; 3221 vstack.length = vstack.length - n; 3222 lstack.length = lstack.length - n; 3223 } 3224 function lex() { 3225 var token; 3226 token = self.lexer.lex() || 1; 3227 if (typeof token !== "number") { 3228 token = self.symbols_[token] || token; 3229 } 3230 return token; 3231 } 3232 var symbol, 3233 preErrorSymbol, 3234 state, 3235 action, 3236 a, 3237 r, 3238 yyval = {}, 3239 p, 3240 len, 3241 newState, 3242 expected; 3243 while (true) { 3244 state = stack[stack.length - 1]; 3245 if (this.defaultActions[state]) { 3246 action = this.defaultActions[state]; 3247 } else { 3248 if (symbol === null || typeof symbol == "undefined") { 3249 symbol = lex(); 3250 } 3251 action = table[state] && table[state][symbol]; 3252 } 3253 if (typeof action === "undefined" || !action.length || !action[0]) { 3254 var errStr = ""; 3255 if (!recovering) { 3256 expected = []; 3257 for (p in table[state]) if (this.terminals_[p] && p > 2) { 3258 expected.push("'" + this.terminals_[p] + "'"); 3259 } 3260 if (this.lexer.showPosition) { 3261 errStr = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"; 3262 } else { 3263 errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1 ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'"); 3264 } 3265 this.parseError(errStr, { text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected }); 3266 } 3267 } 3268 if (action[0] instanceof Array && action.length > 1) { 3269 throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol); 3270 } 3271 switch (action[0]) { 3272 case 1: 3273 stack.push(symbol); 3274 vstack.push(this.lexer.yytext); 3275 lstack.push(this.lexer.yylloc); 3276 stack.push(action[1]); 3277 symbol = null; 3278 if (!preErrorSymbol) { 3279 yyleng = this.lexer.yyleng; 3280 yytext = this.lexer.yytext; 3281 yylineno = this.lexer.yylineno; 3282 yyloc = this.lexer.yylloc; 3283 if (recovering > 0) recovering--; 3284 } else { 3285 symbol = preErrorSymbol; 3286 preErrorSymbol = null; 3287 } 3288 break; 3289 case 2: 3290 len = this.productions_[action[1]][1]; 3291 yyval.$ = vstack[vstack.length - len]; 3292 yyval._$ = { first_line: lstack[lstack.length - (len || 1)].first_line, last_line: lstack[lstack.length - 1].last_line, first_column: lstack[lstack.length - (len || 1)].first_column, last_column: lstack[lstack.length - 1].last_column }; 3293 if (ranges) { 3294 yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]]; 3295 } 3296 r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack); 3297 if (typeof r !== "undefined") { 3298 return r; 3299 } 3300 if (len) { 3301 stack = stack.slice(0, -1 * len * 2); 3302 vstack = vstack.slice(0, -1 * len); 3303 lstack = lstack.slice(0, -1 * len); 3304 } 3305 stack.push(this.productions_[action[1]][0]); 3306 vstack.push(yyval.$); 3307 lstack.push(yyval._$); 3308 newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; 3309 stack.push(newState); 3310 break; 3311 case 3: 3312 return true; 3313 } 3314 } 3315 return true; 3316 } 3317 }; 3318 /* Jison generated lexer */ 3319 var lexer = (function () { 3320 var lexer = { EOF: 1, 3321 parseError: function parseError(str, hash) { 3322 if (this.yy.parser) { 3323 this.yy.parser.parseError(str, hash); 3324 } else { 3325 throw new Error(str); 3326 } 3327 }, 3328 setInput: function setInput(input) { 3329 this._input = input; 3330 this._more = this._less = this.done = false; 3331 this.yylineno = this.yyleng = 0; 3332 this.yytext = this.matched = this.match = ''; 3333 this.conditionStack = ['INITIAL']; 3334 this.yylloc = { first_line: 1, first_column: 0, last_line: 1, last_column: 0 }; 3335 if (this.options.ranges) this.yylloc.range = [0, 0]; 3336 this.offset = 0; 3337 return this; 3338 }, 3339 input: function input() { 3340 var ch = this._input[0]; 3341 this.yytext += ch; 3342 this.yyleng++; 3343 this.offset++; 3344 this.match += ch; 3345 this.matched += ch; 3346 var lines = ch.match(/(?:\r\n?|\n).*/g); 3347 if (lines) { 3348 this.yylineno++; 3349 this.yylloc.last_line++; 3350 } else { 3351 this.yylloc.last_column++; 3352 } 3353 if (this.options.ranges) this.yylloc.range[1]++; 3354 3355 this._input = this._input.slice(1); 3356 return ch; 3357 }, 3358 unput: function unput(ch) { 3359 var len = ch.length; 3360 var lines = ch.split(/(?:\r\n?|\n)/g); 3361 3362 this._input = ch + this._input; 3363 this.yytext = this.yytext.substr(0, this.yytext.length - len - 1); 3364 //this.yyleng -= len; 3365 this.offset -= len; 3366 var oldLines = this.match.split(/(?:\r\n?|\n)/g); 3367 this.match = this.match.substr(0, this.match.length - 1); 3368 this.matched = this.matched.substr(0, this.matched.length - 1); 3369 3370 if (lines.length - 1) this.yylineno -= lines.length - 1; 3371 var r = this.yylloc.range; 3372 3373 this.yylloc = { first_line: this.yylloc.first_line, 3374 last_line: this.yylineno + 1, 3375 first_column: this.yylloc.first_column, 3376 last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len 3377 }; 3378 3379 if (this.options.ranges) { 3380 this.yylloc.range = [r[0], r[0] + this.yyleng - len]; 3381 } 3382 return this; 3383 }, 3384 more: function more() { 3385 this._more = true; 3386 return this; 3387 }, 3388 less: function less(n) { 3389 this.unput(this.match.slice(n)); 3390 }, 3391 pastInput: function pastInput() { 3392 var past = this.matched.substr(0, this.matched.length - this.match.length); 3393 return (past.length > 20 ? '...' : '') + past.substr(-20).replace(/\n/g, ""); 3394 }, 3395 upcomingInput: function upcomingInput() { 3396 var next = this.match; 3397 if (next.length < 20) { 3398 next += this._input.substr(0, 20 - next.length); 3399 } 3400 return (next.substr(0, 20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); 3401 }, 3402 showPosition: function showPosition() { 3403 var pre = this.pastInput(); 3404 var c = new Array(pre.length + 1).join("-"); 3405 return pre + this.upcomingInput() + "\n" + c + "^"; 3406 }, 3407 next: function next() { 3408 if (this.done) { 3409 return this.EOF; 3410 } 3411 if (!this._input) this.done = true; 3412 3413 var token, match, tempMatch, index, col, lines; 3414 if (!this._more) { 3415 this.yytext = ''; 3416 this.match = ''; 3417 } 3418 var rules = this._currentRules(); 3419 for (var i = 0; i < rules.length; i++) { 3420 tempMatch = this._input.match(this.rules[rules[i]]); 3421 if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { 3422 match = tempMatch; 3423 index = i; 3424 if (!this.options.flex) break; 3425 } 3426 } 3427 if (match) { 3428 lines = match[0].match(/(?:\r\n?|\n).*/g); 3429 if (lines) this.yylineno += lines.length; 3430 this.yylloc = { first_line: this.yylloc.last_line, 3431 last_line: this.yylineno + 1, 3432 first_column: this.yylloc.last_column, 3433 last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length }; 3434 this.yytext += match[0]; 3435 this.match += match[0]; 3436 this.matches = match; 3437 this.yyleng = this.yytext.length; 3438 if (this.options.ranges) { 3439 this.yylloc.range = [this.offset, this.offset += this.yyleng]; 3440 } 3441 this._more = false; 3442 this._input = this._input.slice(match[0].length); 3443 this.matched += match[0]; 3444 token = this.performAction.call(this, this.yy, this, rules[index], this.conditionStack[this.conditionStack.length - 1]); 3445 if (this.done && this._input) this.done = false; 3446 if (token) return token;else return; 3447 } 3448 if (this._input === "") { 3449 return this.EOF; 3450 } else { 3451 return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { text: "", token: null, line: this.yylineno }); 3452 } 3453 }, 3454 lex: function lex() { 3455 var r = this.next(); 3456 if (typeof r !== 'undefined') { 3457 return r; 3458 } else { 3459 return this.lex(); 3460 } 3461 }, 3462 begin: function begin(condition) { 3463 this.conditionStack.push(condition); 3464 }, 3465 popState: function popState() { 3466 return this.conditionStack.pop(); 3467 }, 3468 _currentRules: function _currentRules() { 3469 return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; 3470 },
vendor: 8,551 bytes, lines 3471-3690
3471 topState: function topState() { 3472 return this.conditionStack[this.conditionStack.length - 2]; 3473 }, 3474 pushState: function begin(condition) { 3475 this.begin(condition); 3476 } }; 3477 lexer.options = {}; 3478 lexer.performAction = function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) { 3479 3480 function strip(start, end) { 3481 return yy_.yytext = yy_.yytext.substring(start, yy_.yyleng - end + start); 3482 } 3483 3484 var YYSTATE = YY_START; 3485 switch ($avoiding_name_collisions) { 3486 case 0: 3487 if (yy_.yytext.slice(-2) === "\\\\") { 3488 strip(0, 1); 3489 this.begin("mu"); 3490 } else if (yy_.yytext.slice(-1) === "\\") { 3491 strip(0, 1); 3492 this.begin("emu"); 3493 } else { 3494 this.begin("mu"); 3495 } 3496 if (yy_.yytext) return 15; 3497 3498 break; 3499 case 1: 3500 return 15; 3501 break; 3502 case 2: 3503 this.popState(); 3504 return 15; 3505 3506 break; 3507 case 3: 3508 this.begin('raw');return 15; 3509 break; 3510 case 4: 3511 this.popState(); 3512 // Should be using `this.topState()` below, but it currently 3513 // returns the second top instead of the first top. Opened an 3514 // issue about it at https://github.com/zaach/jison/issues/291 3515 if (this.conditionStack[this.conditionStack.length - 1] === 'raw') { 3516 return 15; 3517 } else { 3518 strip(5, 9); 3519 return 'END_RAW_BLOCK'; 3520 } 3521 3522 break; 3523 case 5: 3524 return 15; 3525 break; 3526 case 6: 3527 this.popState(); 3528 return 14; 3529 3530 break; 3531 case 7: 3532 return 65; 3533 break; 3534 case 8: 3535 return 68; 3536 break; 3537 case 9: 3538 return 19; 3539 break; 3540 case 10: 3541 this.popState(); 3542 this.begin('raw'); 3543 return 23; 3544 3545 break; 3546 case 11: 3547 return 55; 3548 break; 3549 case 12: 3550 return 60; 3551 break; 3552 case 13: 3553 return 29; 3554 break; 3555 case 14: 3556 return 47; 3557 break; 3558 case 15: 3559 this.popState();return 44; 3560 break; 3561 case 16: 3562 this.popState();return 44; 3563 break; 3564 case 17: 3565 return 34; 3566 break; 3567 case 18: 3568 return 39; 3569 break; 3570 case 19: 3571 return 51; 3572 break; 3573 case 20: 3574 return 48; 3575 break; 3576 case 21: 3577 this.unput(yy_.yytext); 3578 this.popState(); 3579 this.begin('com'); 3580 3581 break; 3582 case 22: 3583 this.popState(); 3584 return 14; 3585 3586 break; 3587 case 23: 3588 return 48; 3589 break; 3590 case 24: 3591 return 73; 3592 break; 3593 case 25: 3594 return 72; 3595 break; 3596 case 26: 3597 return 72; 3598 break; 3599 case 27: 3600 return 87; 3601 break; 3602 case 28: 3603 // ignore whitespace 3604 break; 3605 case 29: 3606 this.popState();return 54; 3607 break; 3608 case 30: 3609 this.popState();return 33; 3610 break; 3611 case 31: 3612 yy_.yytext = strip(1, 2).replace(/\\"/g, '"');return 80; 3613 break; 3614 case 32: 3615 yy_.yytext = strip(1, 2).replace(/\\'/g, "'");return 80; 3616 break; 3617 case 33: 3618 return 85; 3619 break; 3620 case 34: 3621 return 82; 3622 break; 3623 case 35: 3624 return 82; 3625 break; 3626 case 36: 3627 return 83; 3628 break; 3629 case 37: 3630 return 84; 3631 break; 3632 case 38: 3633 return 81; 3634 break; 3635 case 39: 3636 return 75; 3637 break; 3638 case 40: 3639 return 77; 3640 break; 3641 case 41: 3642 return 72; 3643 break; 3644 case 42: 3645 yy_.yytext = yy_.yytext.replace(/\\([\\\]])/g, '$1');return 72; 3646 break; 3647 case 43: 3648 return 'INVALID'; 3649 break; 3650 case 44: 3651 return 5; 3652 break; 3653 } 3654 }; 3655 lexer.rules = [/^(?:[^\x00]*?(?=(\{\{)))/, /^(?:[^\x00]+)/, /^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/, /^(?:\{\{\{\{(?=[^\/]))/, /^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/, /^(?:[^\x00]*?(?=(\{\{\{\{)))/, /^(?:[\s\S]*?--(~)?\}\})/, /^(?:\()/, /^(?:\))/, /^(?:\{\{\{\{)/, /^(?:\}\}\}\})/, /^(?:\{\{(~)?>)/, /^(?:\{\{(~)?#>)/, /^(?:\{\{(~)?#\*?)/, /^(?:\{\{(~)?\/)/, /^(?:\{\{(~)?\^\s*(~)?\}\})/, /^(?:\{\{(~)?\s*else\s*(~)?\}\})/, /^(?:\{\{(~)?\^)/, /^(?:\{\{(~)?\s*else\b)/, /^(?:\{\{(~)?\{)/, /^(?:\{\{(~)?&)/, /^(?:\{\{(~)?!--)/, /^(?:\{\{(~)?![\s\S]*?\}\})/, /^(?:\{\{(~)?\*?)/, /^(?:=)/, /^(?:\.\.)/, /^(?:\.(?=([=~}\s\/.)|])))/, /^(?:[\/.])/, /^(?:\s+)/, /^(?:\}(~)?\}\})/, /^(?:(~)?\}\})/, /^(?:"(\\["]|[^"])*")/, /^(?:'(\\[']|[^'])*')/, /^(?:@)/, /^(?:true(?=([~}\s)])))/, /^(?:false(?=([~}\s)])))/, /^(?:undefined(?=([~}\s)])))/, /^(?:null(?=([~}\s)])))/, /^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/, /^(?:as\s+\|)/, /^(?:\|)/, /^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/, /^(?:\[(\\\]|[^\]])*\])/, /^(?:.)/, /^(?:$)/]; 3656 lexer.conditions = { "mu": { "rules": [7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44], "inclusive": false }, "emu": { "rules": [2], "inclusive": false }, "com": { "rules": [6], "inclusive": false }, "raw": { "rules": [3, 4, 5], "inclusive": false }, "INITIAL": { "rules": [0, 1, 44], "inclusive": true } }; 3657 return lexer; 3658 })(); 3659 parser.lexer = lexer; 3660 function Parser() { 3661 this.yy = {}; 3662 }Parser.prototype = parser;parser.Parser = Parser; 3663 return new Parser(); 3664 })();exports["default"] = handlebars; 3665 module.exports = exports["default"]; 3666 3667/***/ }), 3668/* 38 */ 3669/***/ (function(module, exports, __webpack_require__) { 3670 3671 'use strict'; 3672 3673 var _interopRequireDefault = __webpack_require__(1)['default']; 3674 3675 exports.__esModule = true; 3676 3677 var _visitor = __webpack_require__(39); 3678 3679 var _visitor2 = _interopRequireDefault(_visitor); 3680 3681 function WhitespaceControl() { 3682 var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; 3683 3684 this.options = options; 3685 } 3686 WhitespaceControl.prototype = new _visitor2['default'](); 3687 3688 WhitespaceControl.prototype.Program = function (program) { 3689 var doStandalone = !this.options.ignoreStandalone; 3690
vendor: 5,172 bytes, lines 3691-3858
3691 var isRoot = !this.isRootSeen; 3692 this.isRootSeen = true; 3693 3694 var body = program.body; 3695 for (var i = 0, l = body.length; i < l; i++) { 3696 var current = body[i], 3697 strip = this.accept(current); 3698 3699 if (!strip) { 3700 continue; 3701 } 3702 3703 var _isPrevWhitespace = isPrevWhitespace(body, i, isRoot), 3704 _isNextWhitespace = isNextWhitespace(body, i, isRoot), 3705 openStandalone = strip.openStandalone && _isPrevWhitespace, 3706 closeStandalone = strip.closeStandalone && _isNextWhitespace, 3707 inlineStandalone = strip.inlineStandalone && _isPrevWhitespace && _isNextWhitespace; 3708 3709 if (strip.close) { 3710 omitRight(body, i, true); 3711 } 3712 if (strip.open) { 3713 omitLeft(body, i, true); 3714 } 3715 3716 if (doStandalone && inlineStandalone) { 3717 omitRight(body, i); 3718 3719 if (omitLeft(body, i)) { 3720 // If we are on a standalone node, save the indent info for partials 3721 if (current.type === 'PartialStatement') { 3722 // Pull out the whitespace from the final line 3723 current.indent = /([ \t]+$)/.exec(body[i - 1].original)[1]; 3724 } 3725 } 3726 } 3727 if (doStandalone && openStandalone) { 3728 omitRight((current.program || current.inverse).body); 3729 3730 // Strip out the previous content node if it's whitespace only 3731 omitLeft(body, i); 3732 } 3733 if (doStandalone && closeStandalone) { 3734 // Always strip the next node 3735 omitRight(body, i); 3736 3737 omitLeft((current.inverse || current.program).body); 3738 } 3739 } 3740 3741 return program; 3742 }; 3743 3744 WhitespaceControl.prototype.BlockStatement = WhitespaceControl.prototype.DecoratorBlock = WhitespaceControl.prototype.PartialBlockStatement = function (block) { 3745 this.accept(block.program); 3746 this.accept(block.inverse); 3747 3748 // Find the inverse program that is involed with whitespace stripping. 3749 var program = block.program || block.inverse, 3750 inverse = block.program && block.inverse, 3751 firstInverse = inverse, 3752 lastInverse = inverse; 3753 3754 if (inverse && inverse.chained) { 3755 firstInverse = inverse.body[0].program; 3756 3757 // Walk the inverse chain to find the last inverse that is actually in the chain. 3758 while (lastInverse.chained) { 3759 lastInverse = lastInverse.body[lastInverse.body.length - 1].program; 3760 } 3761 } 3762 3763 var strip = { 3764 open: block.openStrip.open, 3765 close: block.closeStrip.close, 3766 3767 // Determine the standalone candiacy. Basically flag our content as being possibly standalone 3768 // so our parent can determine if we actually are standalone 3769 openStandalone: isNextWhitespace(program.body), 3770 closeStandalone: isPrevWhitespace((firstInverse || program).body) 3771 }; 3772 3773 if (block.openStrip.close) { 3774 omitRight(program.body, null, true); 3775 } 3776 3777 if (inverse) { 3778 var inverseStrip = block.inverseStrip; 3779 3780 if (inverseStrip.open) { 3781 omitLeft(program.body, null, true); 3782 } 3783 3784 if (inverseStrip.close) { 3785 omitRight(firstInverse.body, null, true); 3786 } 3787 if (block.closeStrip.open) { 3788 omitLeft(lastInverse.body, null, true); 3789 } 3790 3791 // Find standalone else statments 3792 if (!this.options.ignoreStandalone && isPrevWhitespace(program.body) && isNextWhitespace(firstInverse.body)) { 3793 omitLeft(program.body); 3794 omitRight(firstInverse.body); 3795 } 3796 } else if (block.closeStrip.open) { 3797 omitLeft(program.body, null, true); 3798 } 3799 3800 return strip; 3801 }; 3802 3803 WhitespaceControl.prototype.Decorator = WhitespaceControl.prototype.MustacheStatement = function (mustache) { 3804 return mustache.strip; 3805 }; 3806 3807 WhitespaceControl.prototype.PartialStatement = WhitespaceControl.prototype.CommentStatement = function (node) { 3808 /* istanbul ignore next */ 3809 var strip = node.strip || {}; 3810 return { 3811 inlineStandalone: true, 3812 open: strip.open, 3813 close: strip.close 3814 }; 3815 }; 3816 3817 function isPrevWhitespace(body, i, isRoot) { 3818 if (i === undefined) { 3819 i = body.length; 3820 } 3821 3822 // Nodes that end with newlines are considered whitespace (but are special 3823 // cased for strip operations) 3824 var prev = body[i - 1], 3825 sibling = body[i - 2]; 3826 if (!prev) { 3827 return isRoot; 3828 } 3829 3830 if (prev.type === 'ContentStatement') { 3831 return (sibling || !isRoot ? /\r?\n\s*?$/ : /(^|\r?\n)\s*?$/).test(prev.original); 3832 } 3833 } 3834 function isNextWhitespace(body, i, isRoot) { 3835 if (i === undefined) { 3836 i = -1; 3837 } 3838 3839 var next = body[i + 1], 3840 sibling = body[i + 2]; 3841 if (!next) { 3842 return isRoot; 3843 } 3844 3845 if (next.type === 'ContentStatement') { 3846 return (sibling || !isRoot ? /^\s*?\r?\n/ : /^\s*?(\r?\n|$)/).test(next.original); 3847 } 3848 } 3849 3850 // Marks the node to the right of the position as omitted. 3851 // I.e. {{foo}}' ' will mark the ' ' node as omitted. 3852 // 3853 // If i is undefined, then the first child will be marked as such. 3854 // 3855 // If mulitple is truthy then all whitespace will be stripped out until non-whitespace 3856 // content is met. 3857 function omitRight(body, i, multiple) { 3858 var current = body[i == null ? 0 : i + 1];
vendor: 15,084 bytes, lines 3859-4406
3859 if (!current || current.type !== 'ContentStatement' || !multiple && current.rightStripped) { 3860 return; 3861 } 3862 3863 var original = current.value; 3864 current.value = current.value.replace(multiple ? /^\s+/ : /^[ \t]*\r?\n?/, ''); 3865 current.rightStripped = current.value !== original; 3866 } 3867 3868 // Marks the node to the left of the position as omitted. 3869 // I.e. ' '{{foo}} will mark the ' ' node as omitted. 3870 // 3871 // If i is undefined then the last child will be marked as such. 3872 // 3873 // If mulitple is truthy then all whitespace will be stripped out until non-whitespace 3874 // content is met. 3875 function omitLeft(body, i, multiple) { 3876 var current = body[i == null ? body.length - 1 : i - 1]; 3877 if (!current || current.type !== 'ContentStatement' || !multiple && current.leftStripped) { 3878 return; 3879 } 3880 3881 // We omit the last node if it's whitespace only and not preceded by a non-content node. 3882 var original = current.value; 3883 current.value = current.value.replace(multiple ? /\s+$/ : /[ \t]+$/, ''); 3884 current.leftStripped = current.value !== original; 3885 return current.leftStripped; 3886 } 3887 3888 exports['default'] = WhitespaceControl; 3889 module.exports = exports['default']; 3890 3891/***/ }), 3892/* 39 */ 3893/***/ (function(module, exports, __webpack_require__) { 3894 3895 'use strict'; 3896 3897 var _interopRequireDefault = __webpack_require__(1)['default']; 3898 3899 exports.__esModule = true; 3900 3901 var _exception = __webpack_require__(6); 3902 3903 var _exception2 = _interopRequireDefault(_exception); 3904 3905 function Visitor() { 3906 this.parents = []; 3907 } 3908 3909 Visitor.prototype = { 3910 constructor: Visitor, 3911 mutating: false, 3912 3913 // Visits a given value. If mutating, will replace the value if necessary. 3914 acceptKey: function acceptKey(node, name) { 3915 var value = this.accept(node[name]); 3916 if (this.mutating) { 3917 // Hacky sanity check: This may have a few false positives for type for the helper 3918 // methods but will generally do the right thing without a lot of overhead. 3919 if (value && !Visitor.prototype[value.type]) { 3920 throw new _exception2['default']('Unexpected node type "' + value.type + '" found when accepting ' + name + ' on ' + node.type); 3921 } 3922 node[name] = value; 3923 } 3924 }, 3925 3926 // Performs an accept operation with added sanity check to ensure 3927 // required keys are not removed. 3928 acceptRequired: function acceptRequired(node, name) { 3929 this.acceptKey(node, name); 3930 3931 if (!node[name]) { 3932 throw new _exception2['default'](node.type + ' requires ' + name); 3933 } 3934 }, 3935 3936 // Traverses a given array. If mutating, empty respnses will be removed 3937 // for child elements. 3938 acceptArray: function acceptArray(array) { 3939 for (var i = 0, l = array.length; i < l; i++) { 3940 this.acceptKey(array, i); 3941 3942 if (!array[i]) { 3943 array.splice(i, 1); 3944 i--; 3945 l--; 3946 } 3947 } 3948 }, 3949 3950 accept: function accept(object) { 3951 if (!object) { 3952 return; 3953 } 3954 3955 /* istanbul ignore next: Sanity code */ 3956 if (!this[object.type]) { 3957 throw new _exception2['default']('Unknown type: ' + object.type, object); 3958 } 3959 3960 if (this.current) { 3961 this.parents.unshift(this.current); 3962 } 3963 this.current = object; 3964 3965 var ret = this[object.type](object); 3966 3967 this.current = this.parents.shift(); 3968 3969 if (!this.mutating || ret) { 3970 return ret; 3971 } else if (ret !== false) { 3972 return object; 3973 } 3974 }, 3975 3976 Program: function Program(program) { 3977 this.acceptArray(program.body); 3978 }, 3979 3980 MustacheStatement: visitSubExpression, 3981 Decorator: visitSubExpression, 3982 3983 BlockStatement: visitBlock, 3984 DecoratorBlock: visitBlock, 3985 3986 PartialStatement: visitPartial, 3987 PartialBlockStatement: function PartialBlockStatement(partial) { 3988 visitPartial.call(this, partial); 3989 3990 this.acceptKey(partial, 'program'); 3991 }, 3992 3993 ContentStatement: function ContentStatement() /* content */{}, 3994 CommentStatement: function CommentStatement() /* comment */{}, 3995 3996 SubExpression: visitSubExpression, 3997 3998 PathExpression: function PathExpression() /* path */{}, 3999 4000 StringLiteral: function StringLiteral() /* string */{}, 4001 NumberLiteral: function NumberLiteral() /* number */{}, 4002 BooleanLiteral: function BooleanLiteral() /* bool */{}, 4003 UndefinedLiteral: function UndefinedLiteral() /* literal */{}, 4004 NullLiteral: function NullLiteral() /* literal */{}, 4005 4006 Hash: function Hash(hash) { 4007 this.acceptArray(hash.pairs); 4008 }, 4009 HashPair: function HashPair(pair) { 4010 this.acceptRequired(pair, 'value'); 4011 } 4012 }; 4013 4014 function visitSubExpression(mustache) { 4015 this.acceptRequired(mustache, 'path'); 4016 this.acceptArray(mustache.params); 4017 this.acceptKey(mustache, 'hash'); 4018 } 4019 function visitBlock(block) { 4020 visitSubExpression.call(this, block); 4021 4022 this.acceptKey(block, 'program'); 4023 this.acceptKey(block, 'inverse'); 4024 } 4025 function visitPartial(partial) { 4026 this.acceptRequired(partial, 'name'); 4027 this.acceptArray(partial.params); 4028 this.acceptKey(partial, 'hash'); 4029 } 4030 4031 exports['default'] = Visitor; 4032 module.exports = exports['default']; 4033 4034/***/ }), 4035/* 40 */ 4036/***/ (function(module, exports, __webpack_require__) { 4037 4038 'use strict'; 4039 4040 var _interopRequireDefault = __webpack_require__(1)['default']; 4041 4042 exports.__esModule = true; 4043 exports.SourceLocation = SourceLocation; 4044 exports.id = id; 4045 exports.stripFlags = stripFlags; 4046 exports.stripComment = stripComment; 4047 exports.preparePath = preparePath; 4048 exports.prepareMustache = prepareMustache; 4049 exports.prepareRawBlock = prepareRawBlock; 4050 exports.prepareBlock = prepareBlock; 4051 exports.prepareProgram = prepareProgram; 4052 exports.preparePartialBlock = preparePartialBlock; 4053 4054 var _exception = __webpack_require__(6); 4055 4056 var _exception2 = _interopRequireDefault(_exception); 4057 4058 function validateClose(open, close) { 4059 close = close.path ? close.path.original : close; 4060 4061 if (open.path.original !== close) { 4062 var errorNode = { loc: open.path.loc }; 4063 4064 throw new _exception2['default'](open.path.original + " doesn't match " + close, errorNode); 4065 } 4066 } 4067 4068 function SourceLocation(source, locInfo) { 4069 this.source = source; 4070 this.start = { 4071 line: locInfo.first_line, 4072 column: locInfo.first_column 4073 }; 4074 this.end = { 4075 line: locInfo.last_line, 4076 column: locInfo.last_column 4077 }; 4078 } 4079 4080 function id(token) { 4081 if (/^\[.*\]$/.test(token)) { 4082 return token.substring(1, token.length - 1); 4083 } else { 4084 return token; 4085 } 4086 } 4087 4088 function stripFlags(open, close) { 4089 return { 4090 open: open.charAt(2) === '~', 4091 close: close.charAt(close.length - 3) === '~' 4092 }; 4093 } 4094 4095 function stripComment(comment) { 4096 return comment.replace(/^\{\{~?!-?-?/, '').replace(/-?-?~?\}\}$/, ''); 4097 } 4098 4099 function preparePath(data, parts, loc) { 4100 loc = this.locInfo(loc); 4101 4102 var original = data ? '@' : '', 4103 dig = [], 4104 depth = 0; 4105 4106 for (var i = 0, l = parts.length; i < l; i++) { 4107 var part = parts[i].part, 4108 4109 // If we have [] syntax then we do not treat path references as operators, 4110 // i.e. foo.[this] resolves to approximately context.foo['this'] 4111 isLiteral = parts[i].original !== part; 4112 original += (parts[i].separator || '') + part; 4113 4114 if (!isLiteral && (part === '..' || part === '.' || part === 'this')) { 4115 if (dig.length > 0) { 4116 throw new _exception2['default']('Invalid path: ' + original, { loc: loc }); 4117 } else if (part === '..') { 4118 depth++; 4119 } 4120 } else { 4121 dig.push(part); 4122 } 4123 } 4124 4125 return { 4126 type: 'PathExpression', 4127 data: data, 4128 depth: depth, 4129 parts: dig, 4130 original: original, 4131 loc: loc 4132 }; 4133 } 4134 4135 function prepareMustache(path, params, hash, open, strip, locInfo) { 4136 // Must use charAt to support IE pre-10 4137 var escapeFlag = open.charAt(3) || open.charAt(2), 4138 escaped = escapeFlag !== '{' && escapeFlag !== '&'; 4139 4140 var decorator = /\*/.test(open); 4141 return { 4142 type: decorator ? 'Decorator' : 'MustacheStatement', 4143 path: path, 4144 params: params, 4145 hash: hash, 4146 escaped: escaped, 4147 strip: strip, 4148 loc: this.locInfo(locInfo) 4149 }; 4150 } 4151 4152 function prepareRawBlock(openRawBlock, contents, close, locInfo) { 4153 validateClose(openRawBlock, close); 4154 4155 locInfo = this.locInfo(locInfo); 4156 var program = { 4157 type: 'Program', 4158 body: contents, 4159 strip: {}, 4160 loc: locInfo 4161 }; 4162 4163 return { 4164 type: 'BlockStatement', 4165 path: openRawBlock.path, 4166 params: openRawBlock.params, 4167 hash: openRawBlock.hash, 4168 program: program, 4169 openStrip: {}, 4170 inverseStrip: {}, 4171 closeStrip: {}, 4172 loc: locInfo 4173 }; 4174 } 4175 4176 function prepareBlock(openBlock, program, inverseAndProgram, close, inverted, locInfo) { 4177 if (close && close.path) { 4178 validateClose(openBlock, close); 4179 } 4180 4181 var decorator = /\*/.test(openBlock.open); 4182 4183 program.blockParams = openBlock.blockParams; 4184 4185 var inverse = undefined, 4186 inverseStrip = undefined; 4187 4188 if (inverseAndProgram) { 4189 if (decorator) { 4190 throw new _exception2['default']('Unexpected inverse block on decorator', inverseAndProgram); 4191 } 4192 4193 if (inverseAndProgram.chain) { 4194 inverseAndProgram.program.body[0].closeStrip = close.strip; 4195 } 4196 4197 inverseStrip = inverseAndProgram.strip; 4198 inverse = inverseAndProgram.program; 4199 } 4200 4201 if (inverted) { 4202 inverted = inverse; 4203 inverse = program; 4204 program = inverted; 4205 } 4206 4207 return { 4208 type: decorator ? 'DecoratorBlock' : 'BlockStatement', 4209 path: openBlock.path, 4210 params: openBlock.params, 4211 hash: openBlock.hash, 4212 program: program, 4213 inverse: inverse, 4214 openStrip: openBlock.strip, 4215 inverseStrip: inverseStrip, 4216 closeStrip: close && close.strip, 4217 loc: this.locInfo(locInfo) 4218 }; 4219 } 4220 4221 function prepareProgram(statements, loc) { 4222 if (!loc && statements.length) { 4223 var firstLoc = statements[0].loc, 4224 lastLoc = statements[statements.length - 1].loc; 4225 4226 /* istanbul ignore else */ 4227 if (firstLoc && lastLoc) { 4228 loc = { 4229 source: firstLoc.source, 4230 start: { 4231 line: firstLoc.start.line, 4232 column: firstLoc.start.column 4233 }, 4234 end: { 4235 line: lastLoc.end.line, 4236 column: lastLoc.end.column 4237 } 4238 }; 4239 } 4240 } 4241 4242 return { 4243 type: 'Program', 4244 body: statements, 4245 strip: {}, 4246 loc: loc 4247 }; 4248 } 4249 4250 function preparePartialBlock(open, program, close, locInfo) { 4251 validateClose(open, close); 4252 4253 return { 4254 type: 'PartialBlockStatement', 4255 name: open.path, 4256 params: open.params, 4257 hash: open.hash, 4258 program: program, 4259 openStrip: open.strip, 4260 closeStrip: close && close.strip, 4261 loc: this.locInfo(locInfo) 4262 }; 4263 } 4264 4265/***/ }), 4266/* 41 */ 4267/***/ (function(module, exports, __webpack_require__) { 4268 4269 /* eslint-disable new-cap */ 4270 4271 'use strict'; 4272 4273 var _interopRequireDefault = __webpack_require__(1)['default']; 4274 4275 exports.__esModule = true; 4276 exports.Compiler = Compiler; 4277 exports.precompile = precompile; 4278 exports.compile = compile; 4279 4280 var _exception = __webpack_require__(6); 4281 4282 var _exception2 = _interopRequireDefault(_exception); 4283 4284 var _utils = __webpack_require__(5); 4285 4286 var _ast = __webpack_require__(35); 4287 4288 var _ast2 = _interopRequireDefault(_ast); 4289 4290 var slice = [].slice; 4291 4292 function Compiler() {} 4293 4294 // the foundHelper register will disambiguate helper lookup from finding a 4295 // function in a context. This is necessary for mustache compatibility, which 4296 // requires that context functions in blocks are evaluated by blockHelperMissing, 4297 // and then proceed as if the resulting value was provided to blockHelperMissing. 4298 4299 Compiler.prototype = { 4300 compiler: Compiler, 4301 4302 equals: function equals(other) { 4303 var len = this.opcodes.length; 4304 if (other.opcodes.length !== len) { 4305 return false; 4306 } 4307 4308 for (var i = 0; i < len; i++) { 4309 var opcode = this.opcodes[i], 4310 otherOpcode = other.opcodes[i]; 4311 if (opcode.opcode !== otherOpcode.opcode || !argEquals(opcode.args, otherOpcode.args)) { 4312 return false; 4313 } 4314 } 4315 4316 // We know that length is the same between the two arrays because they are directly tied 4317 // to the opcode behavior above. 4318 len = this.children.length; 4319 for (var i = 0; i < len; i++) { 4320 if (!this.children[i].equals(other.children[i])) { 4321 return false; 4322 } 4323 } 4324 4325 return true; 4326 }, 4327 4328 guid: 0, 4329 4330 compile: function compile(program, options) { 4331 this.sourceNode = []; 4332 this.opcodes = []; 4333 this.children = []; 4334 this.options = options; 4335 this.stringParams = options.stringParams; 4336 this.trackIds = options.trackIds; 4337 4338 options.blockParams = options.blockParams || []; 4339 4340 // These changes will propagate to the other compiler components 4341 var knownHelpers = options.knownHelpers; 4342 options.knownHelpers = { 4343 'helperMissing': true, 4344 'blockHelperMissing': true, 4345 'each': true, 4346 'if': true, 4347 'unless': true, 4348 'with': true, 4349 'log': true, 4350 'lookup': true 4351 }; 4352 if (knownHelpers) { 4353 // the next line should use "Object.keys", but the code has been like this a long time and changing it, might 4354 // cause backwards-compatibility issues... It's an old library... 4355 // eslint-disable-next-line guard-for-in 4356 for (var _name in knownHelpers) { 4357 this.options.knownHelpers[_name] = knownHelpers[_name]; 4358 } 4359 } 4360 4361 return this.accept(program); 4362 }, 4363 4364 compileProgram: function compileProgram(program) { 4365 var childCompiler = new this.compiler(), 4366 // eslint-disable-line new-cap 4367 result = childCompiler.compile(program, this.options), 4368 guid = this.guid++; 4369 4370 this.usePartial = this.usePartial || result.usePartial; 4371 4372 this.children[guid] = result; 4373 this.useDepths = this.useDepths || result.useDepths; 4374 4375 return guid; 4376 }, 4377 4378 accept: function accept(node) { 4379 /* istanbul ignore next: Sanity code */ 4380 if (!this[node.type]) { 4381 throw new _exception2['default']('Unknown type: ' + node.type, node); 4382 } 4383 4384 this.sourceNode.unshift(node); 4385 var ret = this[node.type](node); 4386 this.sourceNode.shift(); 4387 return ret; 4388 }, 4389 4390 Program: function Program(program) { 4391 this.options.blockParams.unshift(program.blockParams); 4392 4393 var body = program.body, 4394 bodyLength = body.length; 4395 for (var i = 0; i < bodyLength; i++) { 4396 this.accept(body[i]); 4397 } 4398 4399 this.options.blockParams.shift(); 4400 4401 this.isSimple = bodyLength === 1; 4402 this.blockParams = program.blockParams ? program.blockParams.length : 0; 4403 4404 return this; 4405 }, 4406
vendor: 12,595 bytes, lines 4407-4810
4407 BlockStatement: function BlockStatement(block) { 4408 transformLiteralToPath(block); 4409 4410 var program = block.program, 4411 inverse = block.inverse; 4412 4413 program = program && this.compileProgram(program); 4414 inverse = inverse && this.compileProgram(inverse); 4415 4416 var type = this.classifySexpr(block); 4417 4418 if (type === 'helper') { 4419 this.helperSexpr(block, program, inverse); 4420 } else if (type === 'simple') { 4421 this.simpleSexpr(block); 4422 4423 // now that the simple mustache is resolved, we need to 4424 // evaluate it by executing `blockHelperMissing` 4425 this.opcode('pushProgram', program); 4426 this.opcode('pushProgram', inverse); 4427 this.opcode('emptyHash'); 4428 this.opcode('blockValue', block.path.original); 4429 } else { 4430 this.ambiguousSexpr(block, program, inverse); 4431 4432 // now that the simple mustache is resolved, we need to 4433 // evaluate it by executing `blockHelperMissing` 4434 this.opcode('pushProgram', program); 4435 this.opcode('pushProgram', inverse); 4436 this.opcode('emptyHash'); 4437 this.opcode('ambiguousBlockValue'); 4438 } 4439 4440 this.opcode('append'); 4441 }, 4442 4443 DecoratorBlock: function DecoratorBlock(decorator) { 4444 var program = decorator.program && this.compileProgram(decorator.program); 4445 var params = this.setupFullMustacheParams(decorator, program, undefined), 4446 path = decorator.path; 4447 4448 this.useDecorators = true; 4449 this.opcode('registerDecorator', params.length, path.original); 4450 }, 4451 4452 PartialStatement: function PartialStatement(partial) { 4453 this.usePartial = true; 4454 4455 var program = partial.program; 4456 if (program) { 4457 program = this.compileProgram(partial.program); 4458 } 4459 4460 var params = partial.params; 4461 if (params.length > 1) { 4462 throw new _exception2['default']('Unsupported number of partial arguments: ' + params.length, partial); 4463 } else if (!params.length) { 4464 if (this.options.explicitPartialContext) { 4465 this.opcode('pushLiteral', 'undefined'); 4466 } else { 4467 params.push({ type: 'PathExpression', parts: [], depth: 0 }); 4468 } 4469 } 4470 4471 var partialName = partial.name.original, 4472 isDynamic = partial.name.type === 'SubExpression'; 4473 if (isDynamic) { 4474 this.accept(partial.name); 4475 } 4476 4477 this.setupFullMustacheParams(partial, program, undefined, true); 4478 4479 var indent = partial.indent || ''; 4480 if (this.options.preventIndent && indent) { 4481 this.opcode('appendContent', indent); 4482 indent = ''; 4483 } 4484 4485 this.opcode('invokePartial', isDynamic, partialName, indent); 4486 this.opcode('append'); 4487 }, 4488 PartialBlockStatement: function PartialBlockStatement(partialBlock) { 4489 this.PartialStatement(partialBlock); 4490 }, 4491 4492 MustacheStatement: function MustacheStatement(mustache) { 4493 this.SubExpression(mustache); 4494 4495 if (mustache.escaped && !this.options.noEscape) { 4496 this.opcode('appendEscaped'); 4497 } else { 4498 this.opcode('append'); 4499 } 4500 }, 4501 Decorator: function Decorator(decorator) { 4502 this.DecoratorBlock(decorator); 4503 }, 4504 4505 ContentStatement: function ContentStatement(content) { 4506 if (content.value) { 4507 this.opcode('appendContent', content.value); 4508 } 4509 }, 4510 4511 CommentStatement: function CommentStatement() {}, 4512 4513 SubExpression: function SubExpression(sexpr) { 4514 transformLiteralToPath(sexpr); 4515 var type = this.classifySexpr(sexpr); 4516 4517 if (type === 'simple') { 4518 this.simpleSexpr(sexpr); 4519 } else if (type === 'helper') { 4520 this.helperSexpr(sexpr); 4521 } else { 4522 this.ambiguousSexpr(sexpr); 4523 } 4524 }, 4525 ambiguousSexpr: function ambiguousSexpr(sexpr, program, inverse) { 4526 var path = sexpr.path, 4527 name = path.parts[0], 4528 isBlock = program != null || inverse != null; 4529 4530 this.opcode('getContext', path.depth); 4531 4532 this.opcode('pushProgram', program); 4533 this.opcode('pushProgram', inverse); 4534 4535 path.strict = true; 4536 this.accept(path); 4537 4538 this.opcode('invokeAmbiguous', name, isBlock); 4539 }, 4540 4541 simpleSexpr: function simpleSexpr(sexpr) { 4542 var path = sexpr.path; 4543 path.strict = true; 4544 this.accept(path); 4545 this.opcode('resolvePossibleLambda'); 4546 }, 4547 4548 helperSexpr: function helperSexpr(sexpr, program, inverse) { 4549 var params = this.setupFullMustacheParams(sexpr, program, inverse), 4550 path = sexpr.path, 4551 name = path.parts[0]; 4552 4553 if (this.options.knownHelpers[name]) { 4554 this.opcode('invokeKnownHelper', params.length, name); 4555 } else if (this.options.knownHelpersOnly) { 4556 throw new _exception2['default']('You specified knownHelpersOnly, but used the unknown helper ' + name, sexpr); 4557 } else { 4558 path.strict = true; 4559 path.falsy = true; 4560 4561 this.accept(path); 4562 this.opcode('invokeHelper', params.length, path.original, _ast2['default'].helpers.simpleId(path)); 4563 } 4564 }, 4565 4566 PathExpression: function PathExpression(path) { 4567 this.addDepth(path.depth); 4568 this.opcode('getContext', path.depth); 4569 4570 var name = path.parts[0], 4571 scoped = _ast2['default'].helpers.scopedId(path), 4572 blockParamId = !path.depth && !scoped && this.blockParamIndex(name); 4573 4574 if (blockParamId) { 4575 this.opcode('lookupBlockParam', blockParamId, path.parts); 4576 } else if (!name) { 4577 // Context reference, i.e. `{{foo .}}` or `{{foo ..}}` 4578 this.opcode('pushContext'); 4579 } else if (path.data) { 4580 this.options.data = true; 4581 this.opcode('lookupData', path.depth, path.parts, path.strict); 4582 } else { 4583 this.opcode('lookupOnContext', path.parts, path.falsy, path.strict, scoped); 4584 } 4585 }, 4586 4587 StringLiteral: function StringLiteral(string) { 4588 this.opcode('pushString', string.value); 4589 }, 4590 4591 NumberLiteral: function NumberLiteral(number) { 4592 this.opcode('pushLiteral', number.value); 4593 }, 4594 4595 BooleanLiteral: function BooleanLiteral(bool) { 4596 this.opcode('pushLiteral', bool.value); 4597 }, 4598 4599 UndefinedLiteral: function UndefinedLiteral() { 4600 this.opcode('pushLiteral', 'undefined'); 4601 }, 4602 4603 NullLiteral: function NullLiteral() { 4604 this.opcode('pushLiteral', 'null'); 4605 }, 4606 4607 Hash: function Hash(hash) { 4608 var pairs = hash.pairs, 4609 i = 0, 4610 l = pairs.length; 4611 4612 this.opcode('pushHash'); 4613 4614 for (; i < l; i++) { 4615 this.pushParam(pairs[i].value); 4616 } 4617 while (i--) { 4618 this.opcode('assignToHash', pairs[i].key); 4619 } 4620 this.opcode('popHash'); 4621 }, 4622 4623 // HELPERS 4624 opcode: function opcode(name) { 4625 this.opcodes.push({ opcode: name, args: slice.call(arguments, 1), loc: this.sourceNode[0].loc }); 4626 }, 4627 4628 addDepth: function addDepth(depth) { 4629 if (!depth) { 4630 return; 4631 } 4632 4633 this.useDepths = true; 4634 }, 4635 4636 classifySexpr: function classifySexpr(sexpr) { 4637 var isSimple = _ast2['default'].helpers.simpleId(sexpr.path); 4638 4639 var isBlockParam = isSimple && !!this.blockParamIndex(sexpr.path.parts[0]); 4640 4641 // a mustache is an eligible helper if: 4642 // * its id is simple (a single part, not `this` or `..`) 4643 var isHelper = !isBlockParam && _ast2['default'].helpers.helperExpression(sexpr); 4644 4645 // if a mustache is an eligible helper but not a definite 4646 // helper, it is ambiguous, and will be resolved in a later 4647 // pass or at runtime. 4648 var isEligible = !isBlockParam && (isHelper || isSimple); 4649 4650 // if ambiguous, we can possibly resolve the ambiguity now 4651 // An eligible helper is one that does not have a complex path, i.e. `this.foo`, `../foo` etc. 4652 if (isEligible && !isHelper) { 4653 var _name2 = sexpr.path.parts[0], 4654 options = this.options; 4655 4656 if (options.knownHelpers[_name2]) { 4657 isHelper = true; 4658 } else if (options.knownHelpersOnly) { 4659 isEligible = false; 4660 } 4661 } 4662 4663 if (isHelper) { 4664 return 'helper'; 4665 } else if (isEligible) { 4666 return 'ambiguous'; 4667 } else { 4668 return 'simple'; 4669 } 4670 }, 4671 4672 pushParams: function pushParams(params) { 4673 for (var i = 0, l = params.length; i < l; i++) { 4674 this.pushParam(params[i]); 4675 } 4676 }, 4677 4678 pushParam: function pushParam(val) { 4679 var value = val.value != null ? val.value : val.original || ''; 4680 4681 if (this.stringParams) { 4682 if (value.replace) { 4683 value = value.replace(/^(\.?\.\/)*/g, '').replace(/\//g, '.'); 4684 } 4685 4686 if (val.depth) { 4687 this.addDepth(val.depth); 4688 } 4689 this.opcode('getContext', val.depth || 0); 4690 this.opcode('pushStringParam', value, val.type); 4691 4692 if (val.type === 'SubExpression') { 4693 // SubExpressions get evaluated and passed in 4694 // in string params mode. 4695 this.accept(val); 4696 } 4697 } else { 4698 if (this.trackIds) { 4699 var blockParamIndex = undefined; 4700 if (val.parts && !_ast2['default'].helpers.scopedId(val) && !val.depth) { 4701 blockParamIndex = this.blockParamIndex(val.parts[0]); 4702 } 4703 if (blockParamIndex) { 4704 var blockParamChild = val.parts.slice(1).join('.'); 4705 this.opcode('pushId', 'BlockParam', blockParamIndex, blockParamChild); 4706 } else { 4707 value = val.original || value; 4708 if (value.replace) { 4709 value = value.replace(/^this(?:\.|$)/, '').replace(/^\.\//, '').replace(/^\.$/, ''); 4710 } 4711 4712 this.opcode('pushId', val.type, value); 4713 } 4714 } 4715 this.accept(val); 4716 } 4717 }, 4718 4719 setupFullMustacheParams: function setupFullMustacheParams(sexpr, program, inverse, omitEmpty) { 4720 var params = sexpr.params; 4721 this.pushParams(params); 4722 4723 this.opcode('pushProgram', program); 4724 this.opcode('pushProgram', inverse); 4725 4726 if (sexpr.hash) { 4727 this.accept(sexpr.hash); 4728 } else { 4729 this.opcode('emptyHash', omitEmpty); 4730 } 4731 4732 return params; 4733 }, 4734 4735 blockParamIndex: function blockParamIndex(name) { 4736 for (var depth = 0, len = this.options.blockParams.length; depth < len; depth++) { 4737 var blockParams = this.options.blockParams[depth], 4738 param = blockParams && _utils.indexOf(blockParams, name); 4739 if (blockParams && param >= 0) { 4740 return [depth, param]; 4741 } 4742 } 4743 } 4744 }; 4745 4746 function precompile(input, options, env) { 4747 if (input == null || typeof input !== 'string' && input.type !== 'Program') { 4748 throw new _exception2['default']('You must pass a string or Handlebars AST to Handlebars.precompile. You passed ' + input); 4749 } 4750 4751 options = options || {}; 4752 if (!('data' in options)) { 4753 options.data = true; 4754 } 4755 if (options.compat) { 4756 options.useDepths = true; 4757 } 4758 4759 var ast = env.parse(input, options), 4760 environment = new env.Compiler().compile(ast, options); 4761 return new env.JavaScriptCompiler().compile(environment, options); 4762 } 4763 4764 function compile(input, options, env) { 4765 if (options === undefined) options = {}; 4766 4767 if (input == null || typeof input !== 'string' && input.type !== 'Program') { 4768 throw new _exception2['default']('You must pass a string or Handlebars AST to Handlebars.compile. You passed ' + input); 4769 } 4770 4771 options = _utils.extend({}, options); 4772 if (!('data' in options)) { 4773 options.data = true; 4774 } 4775 if (options.compat) { 4776 options.useDepths = true; 4777 } 4778 4779 var compiled = undefined; 4780 4781 function compileInput() { 4782 var ast = env.parse(input, options), 4783 environment = new env.Compiler().compile(ast, options), 4784 templateSpec = new env.JavaScriptCompiler().compile(environment, options, undefined, true); 4785 return env.template(templateSpec); 4786 } 4787 4788 // Template is only compiled on first use and cached after that point. 4789 function ret(context, execOptions) { 4790 if (!compiled) { 4791 compiled = compileInput(); 4792 } 4793 return compiled.call(this, context, execOptions); 4794 } 4795 ret._setup = function (setupOptions) { 4796 if (!compiled) { 4797 compiled = compileInput(); 4798 } 4799 return compiled._setup(setupOptions); 4800 }; 4801 ret._child = function (i, data, blockParams, depths) { 4802 if (!compiled) { 4803 compiled = compileInput(); 4804 } 4805 return compiled._child(i, data, blockParams, depths); 4806 }; 4807 return ret; 4808 } 4809 4810 function argEquals(a, b) {
vendor: 8,439 bytes, lines 4811-5080
4811 if (a === b) { 4812 return true; 4813 } 4814 4815 if (_utils.isArray(a) && _utils.isArray(b) && a.length === b.length) { 4816 for (var i = 0; i < a.length; i++) { 4817 if (!argEquals(a[i], b[i])) { 4818 return false; 4819 } 4820 } 4821 return true; 4822 } 4823 } 4824 4825 function transformLiteralToPath(sexpr) { 4826 if (!sexpr.path.parts) { 4827 var literal = sexpr.path; 4828 // Casting to string here to make false and 0 literal values play nicely with the rest 4829 // of the system. 4830 sexpr.path = { 4831 type: 'PathExpression', 4832 data: false, 4833 depth: 0, 4834 parts: [literal.original + ''], 4835 original: literal.original + '', 4836 loc: literal.loc 4837 }; 4838 } 4839 } 4840 4841/***/ }), 4842/* 42 */ 4843/***/ (function(module, exports, __webpack_require__) { 4844 4845 'use strict'; 4846 4847 var _interopRequireDefault = __webpack_require__(1)['default']; 4848 4849 exports.__esModule = true; 4850 4851 var _base = __webpack_require__(4); 4852 4853 var _exception = __webpack_require__(6); 4854 4855 var _exception2 = _interopRequireDefault(_exception); 4856 4857 var _utils = __webpack_require__(5); 4858 4859 var _codeGen = __webpack_require__(43); 4860 4861 var _codeGen2 = _interopRequireDefault(_codeGen); 4862 4863 function Literal(value) { 4864 this.value = value; 4865 } 4866 4867 function JavaScriptCompiler() {} 4868 4869 JavaScriptCompiler.prototype = { 4870 // PUBLIC API: You can override these methods in a subclass to provide 4871 // alternative compiled forms for name lookup and buffering semantics 4872 nameLookup: function nameLookup(parent, name /* , type*/) { 4873 if (name === 'constructor') { 4874 return ['(', parent, '.propertyIsEnumerable(\'constructor\') ? ', parent, '.constructor : undefined', ')']; 4875 } 4876 if (JavaScriptCompiler.isValidJavaScriptVariableName(name)) { 4877 return [parent, '.', name]; 4878 } else { 4879 return [parent, '[', JSON.stringify(name), ']']; 4880 } 4881 }, 4882 depthedLookup: function depthedLookup(name) { 4883 return [this.aliasable('container.lookup'), '(depths, "', name, '")']; 4884 }, 4885 4886 compilerInfo: function compilerInfo() { 4887 var revision = _base.COMPILER_REVISION, 4888 versions = _base.REVISION_CHANGES[revision]; 4889 return [revision, versions]; 4890 }, 4891 4892 appendToBuffer: function appendToBuffer(source, location, explicit) { 4893 // Force a source as this simplifies the merge logic. 4894 if (!_utils.isArray(source)) { 4895 source = [source]; 4896 } 4897 source = this.source.wrap(source, location); 4898 4899 if (this.environment.isSimple) { 4900 return ['return ', source, ';']; 4901 } else if (explicit) { 4902 // This is a case where the buffer operation occurs as a child of another 4903 // construct, generally braces. We have to explicitly output these buffer 4904 // operations to ensure that the emitted code goes in the correct location. 4905 return ['buffer += ', source, ';']; 4906 } else { 4907 source.appendToBuffer = true; 4908 return source; 4909 } 4910 }, 4911 4912 initializeBuffer: function initializeBuffer() { 4913 return this.quotedString(''); 4914 }, 4915 // END PUBLIC API 4916 4917 compile: function compile(environment, options, context, asObject) { 4918 this.environment = environment; 4919 this.options = options; 4920 this.stringParams = this.options.stringParams; 4921 this.trackIds = this.options.trackIds; 4922 this.precompile = !asObject; 4923 4924 this.name = this.environment.name; 4925 this.isChild = !!context; 4926 this.context = context || { 4927 decorators: [], 4928 programs: [], 4929 environments: [] 4930 }; 4931 4932 this.preamble(); 4933 4934 this.stackSlot = 0; 4935 this.stackVars = []; 4936 this.aliases = {}; 4937 this.registers = { list: [] }; 4938 this.hashes = []; 4939 this.compileStack = []; 4940 this.inlineStack = []; 4941 this.blockParams = []; 4942 4943 this.compileChildren(environment, options); 4944 4945 this.useDepths = this.useDepths || environment.useDepths || environment.useDecorators || this.options.compat; 4946 this.useBlockParams = this.useBlockParams || environment.useBlockParams; 4947 4948 var opcodes = environment.opcodes, 4949 opcode = undefined, 4950 firstLoc = undefined, 4951 i = undefined, 4952 l = undefined; 4953 4954 for (i = 0, l = opcodes.length; i < l; i++) { 4955 opcode = opcodes[i]; 4956 4957 this.source.currentLocation = opcode.loc; 4958 firstLoc = firstLoc || opcode.loc; 4959 this[opcode.opcode].apply(this, opcode.args); 4960 } 4961 4962 // Flush any trailing content that might be pending. 4963 this.source.currentLocation = firstLoc; 4964 this.pushSource(''); 4965 4966 /* istanbul ignore next */ 4967 if (this.stackSlot || this.inlineStack.length || this.compileStack.length) { 4968 throw new _exception2['default']('Compile completed with content left on stack'); 4969 } 4970 4971 if (!this.decorators.isEmpty()) { 4972 this.useDecorators = true; 4973 4974 this.decorators.prepend('var decorators = container.decorators;\n'); 4975 this.decorators.push('return fn;'); 4976 4977 if (asObject) { 4978 this.decorators = Function.apply(this, ['fn', 'props', 'container', 'depth0', 'data', 'blockParams', 'depths', this.decorators.merge()]); 4979 } else { 4980 this.decorators.prepend('function(fn, props, container, depth0, data, blockParams, depths) {\n'); 4981 this.decorators.push('}\n'); 4982 this.decorators = this.decorators.merge(); 4983 } 4984 } else { 4985 this.decorators = undefined; 4986 } 4987 4988 var fn = this.createFunctionContext(asObject); 4989 if (!this.isChild) { 4990 var ret = { 4991 compiler: this.compilerInfo(), 4992 main: fn 4993 }; 4994 4995 if (this.decorators) { 4996 ret.main_d = this.decorators; // eslint-disable-line camelcase 4997 ret.useDecorators = true; 4998 } 4999 5000 var _context = this.context; 5001 var programs = _context.programs; 5002 var decorators = _context.decorators; 5003 5004 for (i = 0, l = programs.length; i < l; i++) { 5005 if (programs[i]) { 5006 ret[i] = programs[i]; 5007 if (decorators[i]) { 5008 ret[i + '_d'] = decorators[i]; 5009 ret.useDecorators = true; 5010 } 5011 } 5012 } 5013 5014 if (this.environment.usePartial) { 5015 ret.usePartial = true; 5016 } 5017 if (this.options.data) { 5018 ret.useData = true; 5019 } 5020 if (this.useDepths) { 5021 ret.useDepths = true; 5022 } 5023 if (this.useBlockParams) { 5024 ret.useBlockParams = true; 5025 } 5026 if (this.options.compat) { 5027 ret.compat = true; 5028 } 5029 5030 if (!asObject) { 5031 ret.compiler = JSON.stringify(ret.compiler); 5032 5033 this.source.currentLocation = { start: { line: 1, column: 0 } }; 5034 ret = this.objectLiteral(ret); 5035 5036 if (options.srcName) { 5037 ret = ret.toStringWithSourceMap({ file: options.destName }); 5038 ret.map = ret.map && ret.map.toString(); 5039 } else { 5040 ret = ret.toString(); 5041 } 5042 } else { 5043 ret.compilerOptions = this.options; 5044 } 5045 5046 return ret; 5047 } else { 5048 return fn; 5049 } 5050 }, 5051 5052 preamble: function preamble() { 5053 // track the last context pushed into place to allow skipping the 5054 // getContext opcode when it would be a noop 5055 this.lastContext = 0; 5056 this.source = new _codeGen2['default'](this.options.srcName); 5057 this.decorators = new _codeGen2['default'](this.options.srcName); 5058 }, 5059 5060 createFunctionContext: function createFunctionContext(asObject) { 5061 var varDeclarations = ''; 5062 5063 var locals = this.stackVars.concat(this.registers.list); 5064 if (locals.length > 0) { 5065 varDeclarations += ', ' + locals.join(', '); 5066 } 5067 5068 // Generate minimizer alias mappings 5069 // 5070 // When using true SourceNodes, this will update all references to the given alias 5071 // as the source nodes are reused in situ. For the non-source node compilation mode, 5072 // aliases will not be used, but this case is already being run on the client and 5073 // we aren't concern about minimizing the template size. 5074 var aliasCount = 0; 5075 for (var alias in this.aliases) { 5076 // eslint-disable-line guard-for-in 5077 var node = this.aliases[alias]; 5078 5079 if (this.aliases.hasOwnProperty(alias) && node.children && node.referenceCount > 1) { 5080 varDeclarations += ', alias' + ++aliasCount + '=' + alias;
vendor: 4,722 bytes, lines 5081-5230
5081 node.children[0] = 'alias' + aliasCount; 5082 } 5083 } 5084 5085 var params = ['container', 'depth0', 'helpers', 'partials', 'data']; 5086 5087 if (this.useBlockParams || this.useDepths) { 5088 params.push('blockParams'); 5089 } 5090 if (this.useDepths) { 5091 params.push('depths'); 5092 } 5093 5094 // Perform a second pass over the output to merge content when possible 5095 var source = this.mergeSource(varDeclarations); 5096 5097 if (asObject) { 5098 params.push(source); 5099 5100 return Function.apply(this, params); 5101 } else { 5102 return this.source.wrap(['function(', params.join(','), ') {\n ', source, '}']); 5103 } 5104 }, 5105 mergeSource: function mergeSource(varDeclarations) { 5106 var isSimple = this.environment.isSimple, 5107 appendOnly = !this.forceBuffer, 5108 appendFirst = undefined, 5109 sourceSeen = undefined, 5110 bufferStart = undefined, 5111 bufferEnd = undefined; 5112 this.source.each(function (line) { 5113 if (line.appendToBuffer) { 5114 if (bufferStart) { 5115 line.prepend(' + '); 5116 } else { 5117 bufferStart = line; 5118 } 5119 bufferEnd = line; 5120 } else { 5121 if (bufferStart) { 5122 if (!sourceSeen) { 5123 appendFirst = true; 5124 } else { 5125 bufferStart.prepend('buffer += '); 5126 } 5127 bufferEnd.add(';'); 5128 bufferStart = bufferEnd = undefined; 5129 } 5130 5131 sourceSeen = true; 5132 if (!isSimple) { 5133 appendOnly = false; 5134 } 5135 } 5136 }); 5137 5138 if (appendOnly) { 5139 if (bufferStart) { 5140 bufferStart.prepend('return '); 5141 bufferEnd.add(';'); 5142 } else if (!sourceSeen) { 5143 this.source.push('return "";'); 5144 } 5145 } else { 5146 varDeclarations += ', buffer = ' + (appendFirst ? '' : this.initializeBuffer()); 5147 5148 if (bufferStart) { 5149 bufferStart.prepend('return buffer + '); 5150 bufferEnd.add(';'); 5151 } else { 5152 this.source.push('return buffer;'); 5153 } 5154 } 5155 5156 if (varDeclarations) { 5157 this.source.prepend('var ' + varDeclarations.substring(2) + (appendFirst ? '' : ';\n')); 5158 } 5159 5160 return this.source.merge(); 5161 }, 5162 5163 // [blockValue] 5164 // 5165 // On stack, before: hash, inverse, program, value 5166 // On stack, after: return value of blockHelperMissing 5167 // 5168 // The purpose of this opcode is to take a block of the form 5169 // `{{#this.foo}}...{{/this.foo}}`, resolve the value of `foo`, and 5170 // replace it on the stack with the result of properly 5171 // invoking blockHelperMissing. 5172 blockValue: function blockValue(name) { 5173 var blockHelperMissing = this.aliasable('container.hooks.blockHelperMissing'), 5174 params = [this.contextName(0)]; 5175 this.setupHelperArgs(name, 0, params); 5176 5177 var blockName = this.popStack(); 5178 params.splice(1, 0, blockName); 5179 5180 this.push(this.source.functionCall(blockHelperMissing, 'call', params)); 5181 }, 5182 5183 // [ambiguousBlockValue] 5184 // 5185 // On stack, before: hash, inverse, program, value 5186 // Compiler value, before: lastHelper=value of last found helper, if any 5187 // On stack, after, if no lastHelper: same as [blockValue] 5188 // On stack, after, if lastHelper: value 5189 ambiguousBlockValue: function ambiguousBlockValue() { 5190 // We're being a bit cheeky and reusing the options value from the prior exec 5191 var blockHelperMissing = this.aliasable('container.hooks.blockHelperMissing'), 5192 params = [this.contextName(0)]; 5193 this.setupHelperArgs('', 0, params, true); 5194 5195 this.flushInline(); 5196 5197 var current = this.topStack(); 5198 params.splice(1, 0, current); 5199 5200 this.pushSource(['if (!', this.lastHelper, ') { ', current, ' = ', this.source.functionCall(blockHelperMissing, 'call', params), '}']); 5201 }, 5202 5203 // [appendContent] 5204 // 5205 // On stack, before: ... 5206 // On stack, after: ... 5207 // 5208 // Appends the string value of `content` to the current buffer 5209 appendContent: function appendContent(content) { 5210 if (this.pendingContent) { 5211 content = this.pendingContent + content; 5212 } else { 5213 this.pendingLocation = this.source.currentLocation; 5214 } 5215 5216 this.pendingContent = content; 5217 }, 5218 5219 // [append] 5220 // 5221 // On stack, before: value, ... 5222 // On stack, after: ... 5223 // 5224 // Coerces `value` to a String and appends it to the current buffer. 5225 // 5226 // If `value` is truthy, or 0, it is coerced into a string and appended 5227 // Otherwise, the empty string is appended 5228 append: function append() { 5229 if (this.isInline()) { 5230 this.replaceStack(function (current) {
vendor: 6,006 bytes, lines 5231-5423
5231 return [' != null ? ', current, ' : ""']; 5232 }); 5233 5234 this.pushSource(this.appendToBuffer(this.popStack())); 5235 } else { 5236 var local = this.popStack(); 5237 this.pushSource(['if (', local, ' != null) { ', this.appendToBuffer(local, undefined, true), ' }']); 5238 if (this.environment.isSimple) { 5239 this.pushSource(['else { ', this.appendToBuffer("''", undefined, true), ' }']); 5240 } 5241 } 5242 }, 5243 5244 // [appendEscaped] 5245 // 5246 // On stack, before: value, ... 5247 // On stack, after: ... 5248 // 5249 // Escape `value` and append it to the buffer 5250 appendEscaped: function appendEscaped() { 5251 this.pushSource(this.appendToBuffer([this.aliasable('container.escapeExpression'), '(', this.popStack(), ')'])); 5252 }, 5253 5254 // [getContext] 5255 // 5256 // On stack, before: ... 5257 // On stack, after: ... 5258 // Compiler value, after: lastContext=depth 5259 // 5260 // Set the value of the `lastContext` compiler value to the depth 5261 getContext: function getContext(depth) { 5262 this.lastContext = depth; 5263 }, 5264 5265 // [pushContext] 5266 // 5267 // On stack, before: ... 5268 // On stack, after: currentContext, ... 5269 // 5270 // Pushes the value of the current context onto the stack. 5271 pushContext: function pushContext() { 5272 this.pushStackLiteral(this.contextName(this.lastContext)); 5273 }, 5274 5275 // [lookupOnContext] 5276 // 5277 // On stack, before: ... 5278 // On stack, after: currentContext[name], ... 5279 // 5280 // Looks up the value of `name` on the current context and pushes 5281 // it onto the stack. 5282 lookupOnContext: function lookupOnContext(parts, falsy, strict, scoped) { 5283 var i = 0; 5284 5285 if (!scoped && this.options.compat && !this.lastContext) { 5286 // The depthed query is expected to handle the undefined logic for the root level that 5287 // is implemented below, so we evaluate that directly in compat mode 5288 this.push(this.depthedLookup(parts[i++])); 5289 } else { 5290 this.pushContext(); 5291 } 5292 5293 this.resolvePath('context', parts, i, falsy, strict); 5294 }, 5295 5296 // [lookupBlockParam] 5297 // 5298 // On stack, before: ... 5299 // On stack, after: blockParam[name], ... 5300 // 5301 // Looks up the value of `parts` on the given block param and pushes 5302 // it onto the stack. 5303 lookupBlockParam: function lookupBlockParam(blockParamId, parts) { 5304 this.useBlockParams = true; 5305 5306 this.push(['blockParams[', blockParamId[0], '][', blockParamId[1], ']']); 5307 this.resolvePath('context', parts, 1); 5308 }, 5309 5310 // [lookupData] 5311 // 5312 // On stack, before: ... 5313 // On stack, after: data, ... 5314 // 5315 // Push the data lookup operator 5316 lookupData: function lookupData(depth, parts, strict) { 5317 if (!depth) { 5318 this.pushStackLiteral('data'); 5319 } else { 5320 this.pushStackLiteral('container.data(data, ' + depth + ')'); 5321 } 5322 5323 this.resolvePath('data', parts, 0, true, strict); 5324 }, 5325 5326 resolvePath: function resolvePath(type, parts, i, falsy, strict) { 5327 // istanbul ignore next 5328 5329 var _this = this; 5330 5331 if (this.options.strict || this.options.assumeObjects) { 5332 this.push(strictLookup(this.options.strict && strict, this, parts, type)); 5333 return; 5334 } 5335 5336 var len = parts.length; 5337 for (; i < len; i++) { 5338 /* eslint-disable no-loop-func */ 5339 this.replaceStack(function (current) { 5340 var lookup = _this.nameLookup(current, parts[i], type); 5341 // We want to ensure that zero and false are handled properly if the context (falsy flag) 5342 // needs to have the special handling for these values. 5343 if (!falsy) { 5344 return [' != null ? ', lookup, ' : ', current]; 5345 } else { 5346 // Otherwise we can use generic falsy handling 5347 return [' && ', lookup]; 5348 } 5349 }); 5350 /* eslint-enable no-loop-func */ 5351 } 5352 }, 5353 5354 // [resolvePossibleLambda] 5355 // 5356 // On stack, before: value, ... 5357 // On stack, after: resolved value, ... 5358 // 5359 // If the `value` is a lambda, replace it on the stack by 5360 // the return value of the lambda 5361 resolvePossibleLambda: function resolvePossibleLambda() { 5362 this.push([this.aliasable('container.lambda'), '(', this.popStack(), ', ', this.contextName(0), ')']); 5363 }, 5364 5365 // [pushStringParam] 5366 // 5367 // On stack, before: ... 5368 // On stack, after: string, currentContext, ... 5369 // 5370 // This opcode is designed for use in string mode, which 5371 // provides the string value of a parameter along with its 5372 // depth rather than resolving it immediately. 5373 pushStringParam: function pushStringParam(string, type) { 5374 this.pushContext(); 5375 this.pushString(type); 5376 5377 // If it's a subexpression, the string result 5378 // will be pushed after this opcode. 5379 if (type !== 'SubExpression') { 5380 if (typeof string === 'string') { 5381 this.pushString(string); 5382 } else { 5383 this.pushStackLiteral(string); 5384 } 5385 } 5386 }, 5387 5388 emptyHash: function emptyHash(omitEmpty) { 5389 if (this.trackIds) { 5390 this.push('{}'); // hashIds 5391 } 5392 if (this.stringParams) { 5393 this.push('{}'); // hashContexts 5394 this.push('{}'); // hashTypes 5395 } 5396 this.pushStackLiteral(omitEmpty ? 'undefined' : '{}'); 5397 }, 5398 pushHash: function pushHash() { 5399 if (this.hash) { 5400 this.hashes.push(this.hash); 5401 } 5402 this.hash = { values: [], types: [], contexts: [], ids: [] }; 5403 }, 5404 popHash: function popHash() { 5405 var hash = this.hash; 5406 this.hash = this.hashes.pop(); 5407 5408 if (this.trackIds) { 5409 this.push(this.objectLiteral(hash.ids)); 5410 } 5411 if (this.stringParams) { 5412 this.push(this.objectLiteral(hash.contexts)); 5413 this.push(this.objectLiteral(hash.types)); 5414 } 5415 5416 this.push(this.objectLiteral(hash.values)); 5417 }, 5418 5419 // [pushString] 5420 // 5421 // On stack, before: ... 5422 // On stack, after: quotedString(string), ... 5423 //
vendor: 4,445 bytes, lines 5424-5546
5424 // Push a quoted version of `string` onto the stack 5425 pushString: function pushString(string) { 5426 this.pushStackLiteral(this.quotedString(string)); 5427 }, 5428 5429 // [pushLiteral] 5430 // 5431 // On stack, before: ... 5432 // On stack, after: value, ... 5433 // 5434 // Pushes a value onto the stack. This operation prevents 5435 // the compiler from creating a temporary variable to hold 5436 // it. 5437 pushLiteral: function pushLiteral(value) { 5438 this.pushStackLiteral(value); 5439 }, 5440 5441 // [pushProgram] 5442 // 5443 // On stack, before: ... 5444 // On stack, after: program(guid), ... 5445 // 5446 // Push a program expression onto the stack. This takes 5447 // a compile-time guid and converts it into a runtime-accessible 5448 // expression. 5449 pushProgram: function pushProgram(guid) { 5450 if (guid != null) { 5451 this.pushStackLiteral(this.programExpression(guid)); 5452 } else { 5453 this.pushStackLiteral(null); 5454 } 5455 }, 5456 5457 // [registerDecorator] 5458 // 5459 // On stack, before: hash, program, params..., ... 5460 // On stack, after: ... 5461 // 5462 // Pops off the decorator's parameters, invokes the decorator, 5463 // and inserts the decorator into the decorators list. 5464 registerDecorator: function registerDecorator(paramSize, name) { 5465 var foundDecorator = this.nameLookup('decorators', name, 'decorator'), 5466 options = this.setupHelperArgs(name, paramSize); 5467 5468 this.decorators.push(['fn = ', this.decorators.functionCall(foundDecorator, '', ['fn', 'props', 'container', options]), ' || fn;']); 5469 }, 5470 5471 // [invokeHelper] 5472 // 5473 // On stack, before: hash, inverse, program, params..., ... 5474 // On stack, after: result of helper invocation 5475 // 5476 // Pops off the helper's parameters, invokes the helper, 5477 // and pushes the helper's return value onto the stack. 5478 // 5479 // If the helper is not found, `helperMissing` is called. 5480 invokeHelper: function invokeHelper(paramSize, name, isSimple) { 5481 var nonHelper = this.popStack(), 5482 helper = this.setupHelper(paramSize, name); 5483 5484 var possibleFunctionCalls = []; 5485 5486 if (isSimple) { 5487 // direct call to helper 5488 possibleFunctionCalls.push(helper.name); 5489 } 5490 // call a function from the input object 5491 possibleFunctionCalls.push(nonHelper); 5492 if (!this.options.strict) { 5493 possibleFunctionCalls.push(this.aliasable('container.hooks.helperMissing')); 5494 } 5495 5496 var functionLookupCode = ['(', this.itemsSeparatedBy(possibleFunctionCalls, '||'), ')']; 5497 var functionCall = this.source.functionCall(functionLookupCode, 'call', helper.callParams); 5498 this.push(functionCall); 5499 }, 5500 5501 itemsSeparatedBy: function itemsSeparatedBy(items, separator) { 5502 var result = []; 5503 result.push(items[0]); 5504 for (var i = 1; i < items.length; i++) { 5505 result.push(separator, items[i]); 5506 } 5507 return result; 5508 }, 5509 // [invokeKnownHelper] 5510 // 5511 // On stack, before: hash, inverse, program, params..., ... 5512 // On stack, after: result of helper invocation 5513 // 5514 // This operation is used when the helper is known to exist, 5515 // so a `helperMissing` fallback is not required. 5516 invokeKnownHelper: function invokeKnownHelper(paramSize, name) { 5517 var helper = this.setupHelper(paramSize, name); 5518 this.push(this.source.functionCall(helper.name, 'call', helper.callParams)); 5519 }, 5520 5521 // [invokeAmbiguous] 5522 // 5523 // On stack, before: hash, inverse, program, params..., ... 5524 // On stack, after: result of disambiguation 5525 // 5526 // This operation is used when an expression like `{{foo}}` 5527 // is provided, but we don't know at compile-time whether it 5528 // is a helper or a path. 5529 // 5530 // This operation emits more code than the other options, 5531 // and can be avoided by passing the `knownHelpers` and 5532 // `knownHelpersOnly` flags at compile-time. 5533 invokeAmbiguous: function invokeAmbiguous(name, helperCall) { 5534 this.useRegister('helper'); 5535 5536 var nonHelper = this.popStack(); 5537 5538 this.emptyHash(); 5539 var helper = this.setupHelper(0, name, helperCall); 5540 5541 var helperName = this.lastHelper = this.nameLookup('helpers', name, 'helper'); 5542 5543 var lookup = ['(', '(helper = ', helperName, ' || ', nonHelper, ')']; 5544 if (!this.options.strict) { 5545 lookup[0] = '(helper = '; 5546 lookup.push(' != null ? helper : ', this.aliasable('container.hooks.helperMissing'));
vendor: 5,316 bytes, lines 5547-5716
5547 } 5548 5549 this.push(['(', lookup, helper.paramsInit ? ['),(', helper.paramsInit] : [], '),', '(typeof helper === ', this.aliasable('"function"'), ' ? ', this.source.functionCall('helper', 'call', helper.callParams), ' : helper))']); 5550 }, 5551 5552 // [invokePartial] 5553 // 5554 // On stack, before: context, ... 5555 // On stack after: result of partial invocation 5556 // 5557 // This operation pops off a context, invokes a partial with that context, 5558 // and pushes the result of the invocation back. 5559 invokePartial: function invokePartial(isDynamic, name, indent) { 5560 var params = [], 5561 options = this.setupParams(name, 1, params); 5562 5563 if (isDynamic) { 5564 name = this.popStack(); 5565 delete options.name; 5566 } 5567 5568 if (indent) { 5569 options.indent = JSON.stringify(indent); 5570 } 5571 options.helpers = 'helpers'; 5572 options.partials = 'partials'; 5573 options.decorators = 'container.decorators'; 5574 5575 if (!isDynamic) { 5576 params.unshift(this.nameLookup('partials', name, 'partial')); 5577 } else { 5578 params.unshift(name); 5579 } 5580 5581 if (this.options.compat) { 5582 options.depths = 'depths'; 5583 } 5584 options = this.objectLiteral(options); 5585 params.push(options); 5586 5587 this.push(this.source.functionCall('container.invokePartial', '', params)); 5588 }, 5589 5590 // [assignToHash] 5591 // 5592 // On stack, before: value, ..., hash, ... 5593 // On stack, after: ..., hash, ... 5594 // 5595 // Pops a value off the stack and assigns it to the current hash 5596 assignToHash: function assignToHash(key) { 5597 var value = this.popStack(), 5598 context = undefined, 5599 type = undefined, 5600 id = undefined; 5601 5602 if (this.trackIds) { 5603 id = this.popStack(); 5604 } 5605 if (this.stringParams) { 5606 type = this.popStack(); 5607 context = this.popStack(); 5608 } 5609 5610 var hash = this.hash; 5611 if (context) { 5612 hash.contexts[key] = context; 5613 } 5614 if (type) { 5615 hash.types[key] = type; 5616 } 5617 if (id) { 5618 hash.ids[key] = id; 5619 } 5620 hash.values[key] = value; 5621 }, 5622 5623 pushId: function pushId(type, name, child) { 5624 if (type === 'BlockParam') { 5625 this.pushStackLiteral('blockParams[' + name[0] + '].path[' + name[1] + ']' + (child ? ' + ' + JSON.stringify('.' + child) : '')); 5626 } else if (type === 'PathExpression') { 5627 this.pushString(name); 5628 } else if (type === 'SubExpression') { 5629 this.pushStackLiteral('true'); 5630 } else { 5631 this.pushStackLiteral('null'); 5632 } 5633 }, 5634 5635 // HELPERS 5636 5637 compiler: JavaScriptCompiler, 5638 5639 compileChildren: function compileChildren(environment, options) { 5640 var children = environment.children, 5641 child = undefined, 5642 compiler = undefined; 5643 5644 for (var i = 0, l = children.length; i < l; i++) { 5645 child = children[i]; 5646 compiler = new this.compiler(); // eslint-disable-line new-cap 5647 5648 var existing = this.matchExistingProgram(child); 5649 5650 if (existing == null) { 5651 this.context.programs.push(''); // Placeholder to prevent name conflicts for nested children 5652 var index = this.context.programs.length; 5653 child.index = index; 5654 child.name = 'program' + index; 5655 this.context.programs[index] = compiler.compile(child, options, this.context, !this.precompile); 5656 this.context.decorators[index] = compiler.decorators; 5657 this.context.environments[index] = child; 5658 5659 this.useDepths = this.useDepths || compiler.useDepths; 5660 this.useBlockParams = this.useBlockParams || compiler.useBlockParams; 5661 child.useDepths = this.useDepths; 5662 child.useBlockParams = this.useBlockParams; 5663 } else { 5664 child.index = existing.index; 5665 child.name = 'program' + existing.index; 5666 5667 this.useDepths = this.useDepths || existing.useDepths; 5668 this.useBlockParams = this.useBlockParams || existing.useBlockParams; 5669 } 5670 } 5671 }, 5672 matchExistingProgram: function matchExistingProgram(child) { 5673 for (var i = 0, len = this.context.environments.length; i < len; i++) { 5674 var environment = this.context.environments[i]; 5675 if (environment && environment.equals(child)) { 5676 return environment; 5677 } 5678 } 5679 }, 5680 5681 programExpression: function programExpression(guid) { 5682 var child = this.environment.children[guid], 5683 programParams = [child.index, 'data', child.blockParams]; 5684 5685 if (this.useBlockParams || this.useDepths) { 5686 programParams.push('blockParams'); 5687 } 5688 if (this.useDepths) { 5689 programParams.push('depths'); 5690 } 5691 5692 return 'container.program(' + programParams.join(', ') + ')'; 5693 }, 5694 5695 useRegister: function useRegister(name) { 5696 if (!this.registers[name]) { 5697 this.registers[name] = true; 5698 this.registers.list.push(name); 5699 } 5700 }, 5701 5702 push: function push(expr) { 5703 if (!(expr instanceof Literal)) { 5704 expr = this.source.wrap(expr); 5705 } 5706 5707 this.inlineStack.push(expr); 5708 return expr; 5709 }, 5710 5711 pushStackLiteral: function pushStackLiteral(item) { 5712 this.push(new Literal(item)); 5713 }, 5714 5715 pushSource: function pushSource(source) { 5716 if (this.pendingContent) {
vendor: 7,391 bytes, lines 5717-5963
5717 this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent), this.pendingLocation)); 5718 this.pendingContent = undefined; 5719 } 5720 5721 if (source) { 5722 this.source.push(source); 5723 } 5724 }, 5725 5726 replaceStack: function replaceStack(callback) { 5727 var prefix = ['('], 5728 stack = undefined, 5729 createdStack = undefined, 5730 usedLiteral = undefined; 5731 5732 /* istanbul ignore next */ 5733 if (!this.isInline()) { 5734 throw new _exception2['default']('replaceStack on non-inline'); 5735 } 5736 5737 // We want to merge the inline statement into the replacement statement via ',' 5738 var top = this.popStack(true); 5739 5740 if (top instanceof Literal) { 5741 // Literals do not need to be inlined 5742 stack = [top.value]; 5743 prefix = ['(', stack]; 5744 usedLiteral = true; 5745 } else { 5746 // Get or create the current stack name for use by the inline 5747 createdStack = true; 5748 var _name = this.incrStack(); 5749 5750 prefix = ['((', this.push(_name), ' = ', top, ')']; 5751 stack = this.topStack(); 5752 } 5753 5754 var item = callback.call(this, stack); 5755 5756 if (!usedLiteral) { 5757 this.popStack(); 5758 } 5759 if (createdStack) { 5760 this.stackSlot--; 5761 } 5762 this.push(prefix.concat(item, ')')); 5763 }, 5764 5765 incrStack: function incrStack() { 5766 this.stackSlot++; 5767 if (this.stackSlot > this.stackVars.length) { 5768 this.stackVars.push('stack' + this.stackSlot); 5769 } 5770 return this.topStackName(); 5771 }, 5772 topStackName: function topStackName() { 5773 return 'stack' + this.stackSlot; 5774 }, 5775 flushInline: function flushInline() { 5776 var inlineStack = this.inlineStack; 5777 this.inlineStack = []; 5778 for (var i = 0, len = inlineStack.length; i < len; i++) { 5779 var entry = inlineStack[i]; 5780 /* istanbul ignore if */ 5781 if (entry instanceof Literal) { 5782 this.compileStack.push(entry); 5783 } else { 5784 var stack = this.incrStack(); 5785 this.pushSource([stack, ' = ', entry, ';']); 5786 this.compileStack.push(stack); 5787 } 5788 } 5789 }, 5790 isInline: function isInline() { 5791 return this.inlineStack.length; 5792 }, 5793 5794 popStack: function popStack(wrapped) { 5795 var inline = this.isInline(), 5796 item = (inline ? this.inlineStack : this.compileStack).pop(); 5797 5798 if (!wrapped && item instanceof Literal) { 5799 return item.value; 5800 } else { 5801 if (!inline) { 5802 /* istanbul ignore next */ 5803 if (!this.stackSlot) { 5804 throw new _exception2['default']('Invalid stack pop'); 5805 } 5806 this.stackSlot--; 5807 } 5808 return item; 5809 } 5810 }, 5811 5812 topStack: function topStack() { 5813 var stack = this.isInline() ? this.inlineStack : this.compileStack, 5814 item = stack[stack.length - 1]; 5815 5816 /* istanbul ignore if */ 5817 if (item instanceof Literal) { 5818 return item.value; 5819 } else { 5820 return item; 5821 } 5822 }, 5823 5824 contextName: function contextName(context) { 5825 if (this.useDepths && context) { 5826 return 'depths[' + context + ']'; 5827 } else { 5828 return 'depth' + context; 5829 } 5830 }, 5831 5832 quotedString: function quotedString(str) { 5833 return this.source.quotedString(str); 5834 }, 5835 5836 objectLiteral: function objectLiteral(obj) { 5837 return this.source.objectLiteral(obj); 5838 }, 5839 5840 aliasable: function aliasable(name) { 5841 var ret = this.aliases[name]; 5842 if (ret) { 5843 ret.referenceCount++; 5844 return ret; 5845 } 5846 5847 ret = this.aliases[name] = this.source.wrap(name); 5848 ret.aliasable = true; 5849 ret.referenceCount = 1; 5850 5851 return ret; 5852 }, 5853 5854 setupHelper: function setupHelper(paramSize, name, blockHelper) { 5855 var params = [], 5856 paramsInit = this.setupHelperArgs(name, paramSize, params, blockHelper); 5857 var foundHelper = this.nameLookup('helpers', name, 'helper'), 5858 callContext = this.aliasable(this.contextName(0) + ' != null ? ' + this.contextName(0) + ' : (container.nullContext || {})'); 5859 5860 return { 5861 params: params, 5862 paramsInit: paramsInit, 5863 name: foundHelper, 5864 callParams: [callContext].concat(params) 5865 }; 5866 }, 5867 5868 setupParams: function setupParams(helper, paramSize, params) { 5869 var options = {}, 5870 contexts = [], 5871 types = [], 5872 ids = [], 5873 objectArgs = !params, 5874 param = undefined; 5875 5876 if (objectArgs) { 5877 params = []; 5878 } 5879 5880 options.name = this.quotedString(helper); 5881 options.hash = this.popStack(); 5882 5883 if (this.trackIds) { 5884 options.hashIds = this.popStack(); 5885 } 5886 if (this.stringParams) { 5887 options.hashTypes = this.popStack(); 5888 options.hashContexts = this.popStack(); 5889 } 5890 5891 var inverse = this.popStack(), 5892 program = this.popStack(); 5893 5894 // Avoid setting fn and inverse if neither are set. This allows 5895 // helpers to do a check for `if (options.fn)` 5896 if (program || inverse) { 5897 options.fn = program || 'container.noop'; 5898 options.inverse = inverse || 'container.noop'; 5899 } 5900 5901 // The parameters go on to the stack in order (making sure that they are evaluated in order) 5902 // so we need to pop them off the stack in reverse order 5903 var i = paramSize; 5904 while (i--) { 5905 param = this.popStack(); 5906 params[i] = param; 5907 5908 if (this.trackIds) { 5909 ids[i] = this.popStack(); 5910 } 5911 if (this.stringParams) { 5912 types[i] = this.popStack(); 5913 contexts[i] = this.popStack(); 5914 } 5915 } 5916 5917 if (objectArgs) { 5918 options.args = this.source.generateArray(params); 5919 } 5920 5921 if (this.trackIds) { 5922 options.ids = this.source.generateArray(ids); 5923 } 5924 if (this.stringParams) { 5925 options.types = this.source.generateArray(types); 5926 options.contexts = this.source.generateArray(contexts); 5927 } 5928 5929 if (this.options.data) { 5930 options.data = 'data'; 5931 } 5932 if (this.useBlockParams) { 5933 options.blockParams = 'blockParams'; 5934 } 5935 return options; 5936 }, 5937 5938 setupHelperArgs: function setupHelperArgs(helper, paramSize, params, useRegister) { 5939 var options = this.setupParams(helper, paramSize, params); 5940 options = this.objectLiteral(options); 5941 if (useRegister) { 5942 this.useRegister('options'); 5943 params.push('options'); 5944 return ['options=', options]; 5945 } else if (params) { 5946 params.push(options); 5947 return ''; 5948 } else { 5949 return options; 5950 } 5951 } 5952 }; 5953 5954 (function () { 5955 var reservedWords = ('break else new var' + ' case finally return void' + ' catch for switch while' + ' continue function this with' + ' default if throw' + ' delete in try' + ' do instanceof typeof' + ' abstract enum int short' + ' boolean export interface static' + ' byte extends long super' + ' char final native synchronized' + ' class float package throws' + ' const goto private transient' + ' debugger implements protected volatile' + ' double import public let yield await' + ' null true false').split(' '); 5956 5957 var compilerWords = JavaScriptCompiler.RESERVED_WORDS = {}; 5958 5959 for (var i = 0, l = reservedWords.length; i < l; i++) { 5960 compilerWords[reservedWords[i]] = true; 5961 } 5962 })(); 5963
vendor: 4,274 bytes, lines 5964-6115
5964 JavaScriptCompiler.isValidJavaScriptVariableName = function (name) { 5965 return !JavaScriptCompiler.RESERVED_WORDS[name] && /^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(name); 5966 }; 5967 5968 function strictLookup(requireTerminal, compiler, parts, type) { 5969 var stack = compiler.popStack(), 5970 i = 0, 5971 len = parts.length; 5972 if (requireTerminal) { 5973 len--; 5974 } 5975 5976 for (; i < len; i++) { 5977 stack = compiler.nameLookup(stack, parts[i], type); 5978 } 5979 5980 if (requireTerminal) { 5981 return [compiler.aliasable('container.strict'), '(', stack, ', ', compiler.quotedString(parts[i]), ')']; 5982 } else { 5983 return stack; 5984 } 5985 } 5986 5987 exports['default'] = JavaScriptCompiler; 5988 module.exports = exports['default']; 5989 5990/***/ }), 5991/* 43 */ 5992/***/ (function(module, exports, __webpack_require__) { 5993 5994 /* global define */ 5995 'use strict'; 5996 5997 exports.__esModule = true; 5998 5999 var _utils = __webpack_require__(5); 6000 6001 var SourceNode = undefined; 6002 6003 try { 6004 /* istanbul ignore next */ 6005 if (false) { 6006 // We don't support this in AMD environments. For these environments, we asusme that 6007 // they are running on the browser and thus have no need for the source-map library. 6008 var SourceMap = require('source-map'); 6009 SourceNode = SourceMap.SourceNode; 6010 } 6011 } catch (err) {} 6012 /* NOP */ 6013 6014 /* istanbul ignore if: tested but not covered in istanbul due to dist build */ 6015 if (!SourceNode) { 6016 SourceNode = function (line, column, srcFile, chunks) { 6017 this.src = ''; 6018 if (chunks) { 6019 this.add(chunks); 6020 } 6021 }; 6022 /* istanbul ignore next */ 6023 SourceNode.prototype = { 6024 add: function add(chunks) { 6025 if (_utils.isArray(chunks)) { 6026 chunks = chunks.join(''); 6027 } 6028 this.src += chunks; 6029 }, 6030 prepend: function prepend(chunks) { 6031 if (_utils.isArray(chunks)) { 6032 chunks = chunks.join(''); 6033 } 6034 this.src = chunks + this.src; 6035 }, 6036 toStringWithSourceMap: function toStringWithSourceMap() { 6037 return { code: this.toString() }; 6038 }, 6039 toString: function toString() { 6040 return this.src; 6041 } 6042 }; 6043 } 6044 6045 function castChunk(chunk, codeGen, loc) { 6046 if (_utils.isArray(chunk)) { 6047 var ret = []; 6048 6049 for (var i = 0, len = chunk.length; i < len; i++) { 6050 ret.push(codeGen.wrap(chunk[i], loc)); 6051 } 6052 return ret; 6053 } else if (typeof chunk === 'boolean' || typeof chunk === 'number') { 6054 // Handle primitives that the SourceNode will throw up on 6055 return chunk + ''; 6056 } 6057 return chunk; 6058 } 6059 6060 function CodeGen(srcFile) { 6061 this.srcFile = srcFile; 6062 this.source = []; 6063 } 6064 6065 CodeGen.prototype = { 6066 isEmpty: function isEmpty() { 6067 return !this.source.length; 6068 }, 6069 prepend: function prepend(source, loc) { 6070 this.source.unshift(this.wrap(source, loc)); 6071 }, 6072 push: function push(source, loc) { 6073 this.source.push(this.wrap(source, loc)); 6074 }, 6075 6076 merge: function merge() { 6077 var source = this.empty(); 6078 this.each(function (line) { 6079 source.add([' ', line, '\n']); 6080 }); 6081 return source; 6082 }, 6083 6084 each: function each(iter) { 6085 for (var i = 0, len = this.source.length; i < len; i++) { 6086 iter(this.source[i]); 6087 } 6088 }, 6089 6090 empty: function empty() { 6091 var loc = this.currentLocation || { start: {} }; 6092 return new SourceNode(loc.start.line, loc.start.column, this.srcFile); 6093 }, 6094 wrap: function wrap(chunk) { 6095 var loc = arguments.length <= 1 || arguments[1] === undefined ? this.currentLocation || { start: {} } : arguments[1]; 6096 6097 if (chunk instanceof SourceNode) { 6098 return chunk; 6099 } 6100 6101 chunk = castChunk(chunk, this, loc); 6102 6103 return new SourceNode(loc.start.line, loc.start.column, this.srcFile, chunk); 6104 }, 6105 6106 functionCall: function functionCall(fn, type, params) { 6107 params = this.generateList(params); 6108 return this.wrap([fn, type ? '.' + type + '(' : '(', params, ')']); 6109 }, 6110 6111 quotedString: function quotedString(str) { 6112 return '"' + (str + '').replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/\n/g, '\\n').replace(/\r/g, '\\r').replace(/\u2028/g, '\\u2028') // Per Ecma-262 7.3 + 7.8.4 6113 .replace(/\u2029/g, '\\u2029') + '"'; 6114 }, 6115
6116 objectLiteral: function objectLiteral(obj) { 6117 var pairs = []; 6118 6119 for (var key in obj) { 6120 if (obj.hasOwnProperty(key)) { 6121 var value = castChunk(obj[key], this); 6122 if (value !== 'undefined') { 6123 pairs.push([this.quotedString(key), ':', value]); 6124 } 6125 } 6126 } 6127 6128 var ret = this.generateList(pairs); 6129 ret.prepend('{'); 6130 ret.add('}'); 6131 return ret; 6132 }, 6133 6134 generateList: function generateList(entries) { 6135 var ret = this.empty(); 6136 6137 for (var i = 0, len = entries.length; i < len; i++) { 6138 if (i) { 6139 ret.add(','); 6140 } 6141 6142 ret.add(castChunk(entries[i], this)); 6143 } 6144 6145 return ret; 6146 }, 6147 6148 generateArray: function generateArray(entries) { 6149 var ret = this.generateList(entries); 6150 ret.prepend('['); 6151 ret.add(']'); 6152 6153 return ret; 6154 } 6155 }; 6156 6157 exports['default'] = CodeGen; 6158 module.exports = exports['default']; 6159 6160/***/ }) 6161/******/ ]) 6162}); 6163; 6164 6165/** 6166 * Link to original source code : https://www.npmjs.com/package/page?activeTab=code 6167 */ 6168 6169(function (global, factory) { 6170 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 6171 typeof define === 'function' && define.amd ? define(factory) : 6172 (global.page = factory()); 6173}(this, (function () { 'use strict'; 6174 6175var isarray = Array.isArray || function (arr) { 6176 return Object.prototype.toString.call(arr) == '[object Array]'; 6177}; 6178 6179/** 6180 * Expose `pathToRegexp`. 6181 */ 6182var pathToRegexp_1 = pathToRegexp; 6183var parse_1 = parse; 6184var compile_1 = compile; 6185var tokensToFunction_1 = tokensToFunction; 6186var tokensToRegExp_1 = tokensToRegExp; 6187 6188/** 6189 * The main path matching regexp utility. 6190 * 6191 * @type {RegExp} 6192 */ 6193var PATH_REGEXP = new RegExp([ 6194 // Match escaped characters that would otherwise appear in future matches. 6195 // This allows the user to escape special characters that won't transform. 6196 '(\\\\.)', 6197 // Match Express-style parameters and un-named parameters with a prefix 6198 // and optional suffixes. Matches appear as: 6199 // 6200 // "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?", undefined] 6201 // "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined, undefined] 6202 // "/*" => ["/", undefined, undefined, undefined, undefined, "*"] 6203 '([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^()])+)\\))?|\\(((?:\\\\.|[^()])+)\\))([+*?])?|(\\*))' 6204].join('|'), 'g'); 6205 6206/** 6207 * Parse a string for the raw tokens. 6208 * 6209 * @param {String} str 6210 * @return {Array} 6211 */ 6212function parse (str) { 6213 var tokens = []; 6214 var key = 0; 6215 var index = 0; 6216 var path = ''; 6217 var res; 6218 6219 while ((res = PATH_REGEXP.exec(str)) != null) { 6220 var m = res[0]; 6221 var escaped = res[1]; 6222 var offset = res.index; 6223 path += str.slice(index, offset); 6224 index = offset + m.length; 6225 6226 // Ignore already escaped sequences. 6227 if (escaped) { 6228 path += escaped[1]; 6229 continue 6230 } 6231 6232 // Push the current path onto the tokens. 6233 if (path) { 6234 tokens.push(path); 6235 path = ''; 6236 } 6237 6238 var prefix = res[2]; 6239 var name = res[3]; 6240 var capture = res[4]; 6241 var group = res[5]; 6242 var suffix = res[6]; 6243 var asterisk = res[7]; 6244 6245 var repeat = suffix === '+' || suffix === '*'; 6246 var optional = suffix === '?' || suffix === '*'; 6247 var delimiter = prefix || '/'; 6248 var pattern = capture || group || (asterisk ? '.*' : '[^' + delimiter + ']+?'); 6249 6250 tokens.push({ 6251 name: name || key++, 6252 prefix: prefix || '', 6253 delimiter: delimiter, 6254 optional: optional, 6255 repeat: repeat, 6256 pattern: escapeGroup(pattern) 6257 }); 6258 } 6259 6260 // Match any characters still remaining. 6261 if (index < str.length) { 6262 path += str.substr(index); 6263 } 6264 6265 // If the path exists, push it onto the end. 6266 if (path) { 6267 tokens.push(path); 6268 } 6269 6270 return tokens 6271} 6272 6273/** 6274 * Compile a string to a template function for the path. 6275 * 6276 * @param {String} str 6277 * @return {Function} 6278 */ 6279function compile (str) { 6280 return tokensToFunction(parse(str)) 6281} 6282 6283/** 6284 * Expose a method for transforming tokens into the path function. 6285 */ 6286function tokensToFunction (tokens) { 6287 // Compile all the tokens into regexps. 6288 var matches = new Array(tokens.length); 6289 6290 // Compile all the patterns before compilation. 6291 for (var i = 0; i < tokens.length; i++) { 6292 if (typeof tokens[i] === 'object') { 6293 matches[i] = new RegExp('^' + tokens[i].pattern + '$'); 6294 } 6295 } 6296 6297 return function (obj) { 6298 var path = ''; 6299 var data = obj || {}; 6300 6301 for (var i = 0; i < tokens.length; i++) { 6302 var token = tokens[i]; 6303 6304 if (typeof token === 'string') { 6305 path += token; 6306 6307 continue 6308 } 6309 6310 var value = data[token.name]; 6311 var segment; 6312 6313 if (value == null) { 6314 if (token.optional) { 6315 continue 6316 } else { 6317 throw new TypeError('Expected "' + token.name + '" to be defined') 6318 } 6319 } 6320 6321 if (isarray(value)) { 6322 if (!token.repeat) { 6323 throw new TypeError('Expected "' + token.name + '" to not repeat, but received "' + value + '"') 6324 } 6325 6326 if (value.length === 0) { 6327 if (token.optional) { 6328 continue 6329 } else { 6330 throw new TypeError('Expected "' + token.name + '" to not be empty') 6331 } 6332 } 6333 6334 for (var j = 0; j < value.length; j++) { 6335 segment = encodeURIComponent(value[j]); 6336 6337 if (!matches[i].test(segment)) { 6338 throw new TypeError('Expected all "' + token.name + '" to match "' + token.pattern + '", but received "' + segment + '"') 6339 } 6340 6341 path += (j === 0 ? token.prefix : token.delimiter) + segment; 6342 } 6343 6344 continue 6345 } 6346 6347 segment = encodeURIComponent(value); 6348 6349 if (!matches[i].test(segment)) { 6350 throw new TypeError('Expected "' + token.name + '" to match "' + token.pattern + '", but received "' + segment + '"') 6351 } 6352 6353 path += token.prefix + segment; 6354 } 6355 6356 return path 6357 } 6358} 6359 6360/** 6361 * Escape a regular expression string. 6362 * 6363 * @param {String} str 6364 * @return {String} 6365 */ 6366function escapeString (str) { 6367 return str.replace(/([.+*?=^!:${}()[\]|\/])/g, '\\$1') 6368} 6369 6370/** 6371 * Escape the capturing group by escaping special characters and meaning. 6372 * 6373 * @param {String} group 6374 * @return {String} 6375 */ 6376function escapeGroup (group) { 6377 return group.replace(/([=!:$\/()])/g, '\\$1') 6378} 6379 6380/** 6381 * Attach the keys as a property of the regexp. 6382 * 6383 * @param {RegExp} re 6384 * @param {Array} keys 6385 * @return {RegExp} 6386 */ 6387function attachKeys (re, keys) { 6388 re.keys = keys; 6389 return re 6390} 6391 6392/** 6393 * Get the flags for a regexp from the options. 6394 * 6395 * @param {Object} options 6396 * @return {String} 6397 */ 6398function flags (options) { 6399 return options.sensitive ? '' : 'i' 6400} 6401 6402/** 6403 * Pull out keys from a regexp. 6404 * 6405 * @param {RegExp} path 6406 * @param {Array} keys 6407 * @return {RegExp} 6408 */ 6409function regexpToRegexp (path, keys) { 6410 // Use a negative lookahead to match only capturing groups. 6411 var groups = path.source.match(/\((?!\?)/g); 6412 6413 if (groups) { 6414 for (var i = 0; i < groups.length; i++) { 6415 keys.push({ 6416 name: i, 6417 prefix: null, 6418 delimiter: null, 6419 optional: false, 6420 repeat: false, 6421 pattern: null 6422 }); 6423 } 6424 } 6425 6426 return attachKeys(path, keys) 6427} 6428 6429/** 6430 * Transform an array into a regexp. 6431 * 6432 * @param {Array} path 6433 * @param {Array} keys 6434 * @param {Object} options 6435 * @return {RegExp} 6436 */ 6437function arrayToRegexp (path, keys, options) { 6438 var parts = []; 6439 6440 for (var i = 0; i < path.length; i++) { 6441 parts.push(pathToRegexp(path[i], keys, options).source); 6442 } 6443 6444 var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options)); 6445 6446 return attachKeys(regexp, keys) 6447} 6448 6449/** 6450 * Create a path regexp from string input. 6451 * 6452 * @param {String} path 6453 * @param {Array} keys 6454 * @param {Object} options 6455 * @return {RegExp} 6456 */ 6457function stringToRegexp (path, keys, options) { 6458 var tokens = parse(path); 6459 var re = tokensToRegExp(tokens, options); 6460 6461 // Attach keys back to the regexp. 6462 for (var i = 0; i < tokens.length; i++) { 6463 if (typeof tokens[i] !== 'string') { 6464 keys.push(tokens[i]); 6465 } 6466 } 6467 6468 return attachKeys(re, keys) 6469} 6470 6471/** 6472 * Expose a function for taking tokens and returning a RegExp. 6473 * 6474 * @param {Array} tokens 6475 * @param {Array} keys 6476 * @param {Object} options 6477 * @return {RegExp} 6478 */ 6479function tokensToRegExp (tokens, options) { 6480 options = options || {}; 6481 6482 var strict = options.strict; 6483 var end = options.end !== false; 6484 var route = ''; 6485 var lastToken = tokens[tokens.length - 1]; 6486 var endsWithSlash = typeof lastToken === 'string' && /\/$/.test(lastToken); 6487 6488 // Iterate over the tokens and create our regexp string. 6489 for (var i = 0; i < tokens.length; i++) { 6490 var token = tokens[i]; 6491 6492 if (typeof token === 'string') { 6493 route += escapeString(token); 6494 } else { 6495 var prefix = escapeString(token.prefix); 6496 var capture = token.pattern; 6497 6498 if (token.repeat) { 6499 capture += '(?:' + prefix + capture + ')*'; 6500 } 6501 6502 if (token.optional) { 6503 if (prefix) { 6504 capture = '(?:' + prefix + '(' + capture + '))?'; 6505 } else { 6506 capture = '(' + capture + ')?'; 6507 } 6508 } else { 6509 capture = prefix + '(' + capture + ')'; 6510 } 6511 6512 route += capture; 6513 } 6514 } 6515 6516 // In non-strict mode we allow a slash at the end of match. If the path to 6517 // match already ends with a slash, we remove it for consistency. The slash 6518 // is valid at the end of a path match, not in the middle. This is important 6519 // in non-ending mode, where "/test/" shouldn't match "/test//route". 6520 if (!strict) { 6521 route = (endsWithSlash ? route.slice(0, -2) : route) + '(?:\\/(?=$))?'; 6522 } 6523 6524 if (end) { 6525 route += '$'; 6526 } else { 6527 // In non-ending mode, we need the capturing groups to match as much as 6528 // possible by using a positive lookahead to the end or next path segment. 6529 route += strict && endsWithSlash ? '' : '(?=\\/|$)'; 6530 } 6531 6532 return new RegExp('^' + route, flags(options)) 6533} 6534 6535/** 6536 * Normalize the given path string, returning a regular expression. 6537 * 6538 * An empty array can be passed in for the keys, which will hold the 6539 * placeholder key descriptions. For example, using `/user/:id`, `keys` will 6540 * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`. 6541 * 6542 * @param {(String|RegExp|Array)} path 6543 * @param {Array} [keys] 6544 * @param {Object} [options] 6545 * @return {RegExp} 6546 */ 6547function pathToRegexp (path, keys, options) { 6548 keys = keys || []; 6549 6550 if (!isarray(keys)) { 6551 options = keys; 6552 keys = []; 6553 } else if (!options) { 6554 options = {}; 6555 } 6556 6557 if (path instanceof RegExp) { 6558 return regexpToRegexp(path, keys, options) 6559 } 6560 6561 if (isarray(path)) { 6562 return arrayToRegexp(path, keys, options) 6563 } 6564 6565 return stringToRegexp(path, keys, options) 6566} 6567 6568pathToRegexp_1.parse = parse_1;
6569pathToRegexp_1.compile = compile_1; 6570pathToRegexp_1.tokensToFunction = tokensToFunction_1; 6571pathToRegexp_1.tokensToRegExp = tokensToRegExp_1; 6572 6573/** 6574 * Module dependencies. 6575 */ 6576 6577 6578 6579 /** 6580 * Short-cuts for global-object checks 6581 */ 6582 6583 var hasDocument = ('undefined' !== typeof document); 6584 var hasWindow = ('undefined' !== typeof window); 6585 var hasHistory = ('undefined' !== typeof history); 6586 var hasProcess = typeof process !== 'undefined'; 6587 6588 /** 6589 * Detect click event 6590 */ 6591 var clickEvent = hasDocument && document.ontouchstart ? 'touchstart' : 'click'; 6592 6593 /** 6594 * To work properly with the URL 6595 * history.location generated polyfill in https://github.com/devote/HTML5-History-API 6596 */ 6597 6598 var isLocation = hasWindow && !!(window.history.location || window.location); 6599 6600 /** 6601 * The page instance 6602 * @api private 6603 */ 6604 function Page() { 6605 // public things 6606 this.callbacks = []; 6607 this.exits = []; 6608 this.current = ''; 6609 this.len = 0; 6610 6611 // private things 6612 this._decodeURLComponents = true; 6613 this._base = ''; 6614 this._strict = false; 6615 this._running = false; 6616 this._hashbang = false; 6617 6618 // bound functions 6619 this.clickHandler = this.clickHandler.bind(this); 6620 this._onpopstate = this._onpopstate.bind(this); 6621 } 6622 6623 /** 6624 * Configure the instance of page. This can be called multiple times. 6625 * 6626 * @param {Object} options 6627 * @api public 6628 */ 6629 6630 Page.prototype.configure = function(options) { 6631 var opts = options || {}; 6632 6633 this._window = opts.window || (hasWindow && window); 6634 this._decodeURLComponents = opts.decodeURLComponents !== false; 6635 this._popstate = opts.popstate !== false && hasWindow; 6636 this._click = opts.click !== false && hasDocument; 6637 this._hashbang = !!opts.hashbang; 6638 6639 var _window = this._window; 6640 if(this._popstate) { 6641 _window.addEventListener('popstate', this._onpopstate, false); 6642 } else if(hasWindow) { 6643 _window.removeEventListener('popstate', this._onpopstate, false); 6644 } 6645 6646 if (this._click) { 6647 _window.document.addEventListener(clickEvent, this.clickHandler, false); 6648 } else if(hasDocument) { 6649 _window.document.removeEventListener(clickEvent, this.clickHandler, false); 6650 } 6651 6652 if(this._hashbang && hasWindow && !hasHistory) { 6653 _window.addEventListener('hashchange', this._onpopstate, false); 6654 } else if(hasWindow) { 6655 _window.removeEventListener('hashchange', this._onpopstate, false); 6656 } 6657 }; 6658 6659 /** 6660 * Get or set basepath to `path`. 6661 * 6662 * @param {string} path 6663 * @api public 6664 */ 6665 6666 Page.prototype.base = function(path) { 6667 if (0 === arguments.length) return this._base; 6668 this._base = path; 6669 }; 6670 6671 /** 6672 * Gets the `base`, which depends on whether we are using History or 6673 * hashbang routing. 6674 * @api private 6675 */ 6676 Page.prototype._getBase = function() { 6677 var base = this._base; 6678 if(!!base) return base; 6679 var loc = hasWindow && this._window && this._window.location; 6680 6681 if(hasWindow && this._hashbang && loc && loc.protocol === 'file:') { 6682 base = loc.pathname; 6683 } 6684 6685 return base; 6686 }; 6687 6688 /** 6689 * Get or set strict path matching to `enable` 6690 * 6691 * @param {boolean} enable 6692 * @api public 6693 */ 6694 6695 Page.prototype.strict = function(enable) { 6696 if (0 === arguments.length) return this._strict; 6697 this._strict = enable; 6698 }; 6699 6700 6701 /** 6702 * Bind with the given `options`. 6703 * 6704 * Options: 6705 * 6706 * - `click` bind to click events [true] 6707 * - `popstate` bind to popstate [true] 6708 * - `dispatch` perform initial dispatch [true] 6709 * 6710 * @param {Object} options 6711 * @api public 6712 */ 6713 6714 Page.prototype.start = function(options) { 6715 var opts = options || {}; 6716 this.configure(opts); 6717 6718 if (false === opts.dispatch) return; 6719 this._running = true; 6720 6721 var url; 6722 if(isLocation) { 6723 var window = this._window; 6724 var loc = window.location; 6725 6726 if(this._hashbang && ~loc.hash.indexOf('#!')) { 6727 url = loc.hash.substr(2) + loc.search; 6728 } else if (this._hashbang) { 6729 url = loc.search + loc.hash; 6730 } else { 6731 url = loc.pathname + loc.search + loc.hash; 6732 } 6733 } 6734 6735 this.replace(url, null, true, opts.dispatch); 6736 }; 6737 6738 /** 6739 * Unbind click and popstate event handlers. 6740 * 6741 * @api public 6742 */ 6743 6744 Page.prototype.stop = function() { 6745 if (!this._running) return; 6746 this.current = ''; 6747 this.len = 0; 6748 this._running = false;
6749 6750 var window = this._window; 6751 this._click && window.document.removeEventListener(clickEvent, this.clickHandler, false); 6752 hasWindow && window.removeEventListener('popstate', this._onpopstate, false); 6753 hasWindow && window.removeEventListener('hashchange', this._onpopstate, false); 6754 }; 6755 6756 /** 6757 * Show `path` with optional `state` object. 6758 * 6759 * @param {string} path 6760 * @param {Object=} state 6761 * @param {boolean=} dispatch 6762 * @param {boolean=} push 6763 * @return {!Context} 6764 * @api public 6765 */ 6766 6767 Page.prototype.show = function(path, state, dispatch, push) { 6768 var ctx = new Context(path, state, this), 6769 prev = this.prevContext; 6770 this.prevContext = ctx; 6771 this.current = ctx.path; 6772 if (false !== dispatch) this.dispatch(ctx, prev); 6773 if (false !== ctx.handled && false !== push) ctx.pushState(); 6774 return ctx; 6775 }; 6776 6777 /** 6778 * Goes back in the history 6779 * Back should always let the current route push state and then go back. 6780 * 6781 * @param {string} path - fallback path to go back if no more history exists, if undefined defaults to page.base 6782 * @param {Object=} state 6783 * @api public 6784 */ 6785 6786 Page.prototype.back = function(path, state) { 6787 var page = this; 6788 if (this.len > 0) { 6789 var window = this._window; 6790 // this may need more testing to see if all browsers 6791 // wait for the next tick to go back in history 6792 hasHistory && window.history.back(); 6793 this.len--; 6794 } else if (path) { 6795 setTimeout(function() { 6796 page.show(path, state); 6797 }); 6798 } else { 6799 setTimeout(function() { 6800 page.show(page._getBase(), state); 6801 }); 6802 } 6803 }; 6804 6805 /** 6806 * Register route to redirect from one path to other 6807 * or just redirect to another route 6808 * 6809 * @param {string} from - if param 'to' is undefined redirects to 'from' 6810 * @param {string=} to 6811 * @api public 6812 */ 6813 Page.prototype.redirect = function(from, to) { 6814 var inst = this; 6815 6816 // Define route from a path to another 6817 if ('string' === typeof from && 'string' === typeof to) { 6818 page.call(this, from, function(e) { 6819 setTimeout(function() { 6820 inst.replace(/** @type {!string} */ (to)); 6821 }, 0); 6822 }); 6823 } 6824 6825 // Wait for the push state and replace it with another 6826 if ('string' === typeof from && 'undefined' === typeof to) { 6827 setTimeout(function() { 6828 inst.replace(from); 6829 }, 0); 6830 } 6831 }; 6832 6833 /** 6834 * Replace `path` with optional `state` object. 6835 * 6836 * @param {string} path 6837 * @param {Object=} state 6838 * @param {boolean=} init 6839 * @param {boolean=} dispatch 6840 * @return {!Context} 6841 * @api public 6842 */ 6843 6844 6845 Page.prototype.replace = function(path, state, init, dispatch) { 6846 var ctx = new Context(path, state, this), 6847 prev = this.prevContext; 6848 this.prevContext = ctx; 6849 this.current = ctx.path; 6850 ctx.init = init; 6851 ctx.save(); // save before dispatching, which may redirect 6852 if (false !== dispatch) this.dispatch(ctx, prev); 6853 return ctx; 6854 }; 6855 6856 /** 6857 * Dispatch the given `ctx`. 6858 * 6859 * @param {Context} ctx 6860 * @api private 6861 */ 6862 6863 Page.prototype.dispatch = function(ctx, prev) { 6864 var i = 0, j = 0, page = this; 6865 6866 function nextExit() { 6867 var fn = page.exits[j++]; 6868 if (!fn) return nextEnter(); 6869 fn(prev, nextExit); 6870 } 6871 6872 function nextEnter() { 6873 var fn = page.callbacks[i++]; 6874 6875 if (ctx.path !== page.current) { 6876 ctx.handled = false; 6877 return; 6878 } 6879 if (!fn) return unhandled.call(page, ctx); 6880 fn(ctx, nextEnter); 6881 } 6882 6883 if (prev) { 6884 nextExit(); 6885 } else { 6886 nextEnter(); 6887 } 6888 }; 6889 6890 /** 6891 * Register an exit route on `path` with 6892 * callback `fn()`, which will be called 6893 * on the previous context when a new 6894 * page is visited. 6895 */ 6896 Page.prototype.exit = function(path, fn) { 6897 if (typeof path === 'function') { 6898 return this.exit('*', path); 6899 } 6900 6901 var route = new Route(path, null, this); 6902 for (var i = 1; i < arguments.length; ++i) { 6903 this.exits.push(route.middleware(arguments[i])); 6904 } 6905 }; 6906 6907 /** 6908 * Handle "click" events. 6909 */ 6910 6911 /* jshint +W054 */ 6912 Page.prototype.clickHandler = function(e) { 6913 if (1 !== this._which(e)) return; 6914 6915 if (e.metaKey || e.ctrlKey || e.shiftKey) return; 6916 if (e.defaultPrevented) return; 6917 6918 // ensure link 6919 // use shadow dom when available if not, fall back to composedPath() 6920 // for browsers that only have shady 6921 var el = e.target; 6922 var eventPath = e.path || (e.composedPath ? e.composedPath() : null); 6923 6924 if(eventPath) { 6925 for (var i = 0; i < eventPath.length; i++) { 6926 if (!eventPath[i].nodeName) continue; 6927 if (eventPath[i].nodeName.toUpperCase() !== 'A') continue; 6928 if (!eventPath[i].href) continue; 6929 6930 el = eventPath[i]; 6931 break; 6932 } 6933 } 6934 6935 // continue ensure link 6936 // el.nodeName for svg links are 'a' instead of 'A' 6937 while (el && 'A' !== el.nodeName.toUpperCase()) el = el.parentNode; 6938 if (!el || 'A' !== el.nodeName.toUpperCase()) return; 6939 6940 // check if link is inside an svg 6941 // in this case, both href and target are always inside an object 6942 var svg = (typeof el.href === 'object') && el.href.constructor.name === 'SVGAnimatedString'; 6943 6944 // Ignore if tag has 6945 // 1. "download" attribute 6946 // 2. rel="external" attribute 6947 if (el.hasAttribute('download') || el.getAttribute('rel') === 'external') return; 6948 6949 // ensure non-hash for the same path 6950 var link = el.getAttribute('href'); 6951 if(!this._hashbang && this._samePath(el) && (el.hash || '#' === link)) return; 6952 6953 // Check for mailto: in the href 6954 if (link && link.indexOf('mailto:') > -1) return; 6955 6956 // check target 6957 // svg target is an object and its desired value is in .baseVal property 6958 if (svg ? el.target.baseVal : el.target) return; 6959 6960 // x-origin 6961 // note: svg links that are not relative don't call click events (and ski
6961p page.js) 6962 // consequently, all svg links tested inside page.js are relative and in the same origin 6963 if (!svg && !this.sameOrigin(el.href)) return; 6964 6965 // rebuild path 6966 // There aren't .pathname and .search properties in svg links, so we use href 6967 // Also, svg href is an object and its desired value is in .baseVal property 6968 var path = svg ? el.href.baseVal : (el.pathname + el.search + (el.hash || '')); 6969 6970 path = path[0] !== '/' ? '/' + path : path; 6971 6972 // strip leading "/[drive letter]:" on NW.js on Windows 6973 if (hasProcess && path.match(/^\/[a-zA-Z]:\//)) { 6974 path = path.replace(/^\/[a-zA-Z]:\//, '/'); 6975 } 6976 6977 // same page 6978 var orig = path; 6979 var pageBase = this._getBase(); 6980 6981 if (path.indexOf(pageBase) === 0) { 6982 path = path.substr(pageBase.length); 6983 } 6984 6985 if (this._hashbang) path = path.replace('#!', ''); 6986 6987 if (pageBase && orig === path && (!isLocation || this._window.location.protocol !== 'file:')) { 6988 return; 6989 } 6990 6991 e.preventDefault(); 6992 this.show(orig); 6993 }; 6994 6995 /** 6996 * Handle "populate" events. 6997 * @api private 6998 */ 6999 7000 Page.prototype._onpopstate = (function () { 7001 var loaded = false; 7002 if ( ! hasWindow ) { 7003 return function () {}; 7004 } 7005 if (hasDocument && document.readyState === 'complete') { 7006 loaded = true; 7007 } else { 7008 window.addEventListener('load', function() { 7009 setTimeout(function() { 7010 loaded = true; 7011 }, 0); 7012 }); 7013 } 7014 return function onpopstate(e) { 7015 if (!loaded) return; 7016 var page = this; 7017 if (e.state) { 7018 var path = e.state.path; 7019 page.replace(path, e.state); 7020 } else if (isLocation) { 7021 var loc = page._window.location; 7022 page.show(loc.pathname + loc.search + loc.hash, undefined, undefined, false); 7023 } 7024 }; 7025 })(); 7026 7027 /** 7028 * Event button. 7029 */ 7030 Page.prototype._which = function(e) { 7031 e = e || (hasWindow && this._window.event); 7032 return null == e.which ? e.button : e.which; 7033 }; 7034 7035 /** 7036 * Convert to a URL object 7037 * @api private 7038 */ 7039 Page.prototype._toURL = function(href) { 7040 var window = this._window; 7041 if(typeof URL === 'function' && isLocation) { 7042 return new URL(href, window.location.toString()); 7043 } else if (hasDocument) { 7044 var anc = window.document.createElement('a'); 7045 anc.href = href; 7046 return anc; 7047 } 7048 }; 7049 7050 /** 7051 * Check if `href` is the same origin. 7052 * @param {string} href 7053 * @api public 7054 */ 7055 Page.prototype.sameOrigin = function(href) { 7056 if(!href || !isLocation) return false; 7057 7058 var url = this._toURL(href); 7059 var window = this._window; 7060 7061 var loc = window.location; 7062 7063 /* 7064 When the port is the default http port 80 for http, or 443 for 7065 https, internet explorer 11 returns an empty string for loc.port, 7066 so we need to compare loc.port with an empty string if url.port 7067 is the default port 80 or 443. 7068 Also the comparition with `port` is changed from `===` to `==` because 7069 `port` can be a string sometimes. This only applies to ie11. 7070 */ 7071 return loc.protocol === url.protocol && 7072 loc.hostname === url.hostname && 7073 (loc.port === url.port || loc.port === '' && (url.port == 80 || url.port == 443)); // jshint ignore:line 7074 }; 7075 7076 /** 7077 * @api private 7078 */ 7079 Page.prototype._samePath = function(url) { 7080 if(!isLocation) return false; 7081 var window = this._window; 7082 var loc = window.location; 7083 return url.pathname === loc.pathname && 7084 url.search === loc.search; 7085 }; 7086 7087 /** 7088 * Remove URL encoding from the given `str`. 7089 * Accommodates whitespace in both x-www-form-urlencoded 7090 * and regular percent-encoded form. 7091 * 7092 * @param {string} val - URL component to decode 7093 * @api private 7094 */ 7095 Page.prototype._decodeURLEncodedURIComponent = function(val) { 7096 if (typeof val !== 'string') { return val; } 7097 return this._decodeURLComponents ? decodeURIComponent(val.replace(/\+/g, ' ')) : val; 7098 }; 7099 7100 /** 7101 * Create a new `page` instance and function 7102 */ 7103 function createPage() { 7104 var pageInstance = new Page(); 7105 7106 function pageFn(/* args */) { 7107 return page.apply(pageInstance, arguments); 7108 } 7109 7110 // Copy all of the things over. In 2.0 maybe we use setPrototypeOf 7111 pageFn.callbacks = pageInstance.callbacks; 7112 pageFn.exits = pageInstance.exits; 7113 pageFn.base = pageInstance.base.bind(pageInstance); 7114 pageFn.strict = pageInstance.strict.bind(pageInstance); 7115 pageFn.start = pageInstance.start.bind(pageInstance); 7116 pageFn.stop = pageInstance.stop.bind(pageInstance); 7117 pageFn.show = pageInstance.show.bind(pageInstance); 7118 pageFn.back = pageInstance.back.bind(pageInstance); 7119 pageFn.redirect = pageInstance.redirect.bind(pageInstance);
7120 pageFn.replace = pageInstance.replace.bind(pageInstance); 7121 pageFn.dispatch = pageInstance.dispatch.bind(pageInstance); 7122 pageFn.exit = pageInstance.exit.bind(pageInstance); 7123 pageFn.configure = pageInstance.configure.bind(pageInstance); 7124 pageFn.sameOrigin = pageInstance.sameOrigin.bind(pageInstance); 7125 pageFn.clickHandler = pageInstance.clickHandler.bind(pageInstance); 7126 7127 pageFn.create = createPage; 7128 7129 Object.defineProperty(pageFn, 'len', { 7130 get: function(){ 7131 return pageInstance.len; 7132 }, 7133 set: function(val) { 7134 pageInstance.len = val; 7135 } 7136 }); 7137 7138 Object.defineProperty(pageFn, 'current', { 7139 get: function(){ 7140 return pageInstance.current; 7141 }, 7142 set: function(val) { 7143 pageInstance.current = val; 7144 } 7145 }); 7146 7147 // In 2.0 these can be named exports 7148 pageFn.Context = Context; 7149 pageFn.Route = Route; 7150 7151 return pageFn; 7152 } 7153 7154 /** 7155 * Register `path` with callback `fn()`, 7156 * or route `path`, or redirection, 7157 * or `page.start()`. 7158 * 7159 * page(fn); 7160 * page('*', fn); 7161 * page('/user/:id', load, user); 7162 * page('/user/' + user.id, { some: 'thing' }); 7163 * page('/user/' + user.id); 7164 * page('/from', '/to') 7165 * page(); 7166 * 7167 * @param {string|!Function|!Object} path 7168 * @param {Function=} fn 7169 * @api public 7170 */ 7171 7172 function page(path, fn) { 7173 // <callback> 7174 if ('function' === typeof path) { 7175 return page.call(this, '*', path); 7176 } 7177 7178 // route <path> to <callback ...> 7179 if ('function' === typeof fn) {
7180 var route = new Route(/** @type {string} */ (path), null, this); 7181 for (var i = 1; i < arguments.length; ++i) { 7182 this.callbacks.push(route.middleware(arguments[i])); 7183 } 7184 // show <path> with [state] 7185 } else if ('string' === typeof path) { 7186 this['string' === typeof fn ? 'redirect' : 'show'](path, fn); 7187 // start [options] 7188 } else { 7189 this.start(path); 7190 } 7191 } 7192 7193 /** 7194 * Unhandled `ctx`. When it's not the initial 7195 * popstate then redirect. If you wish to handle 7196 * 404s on your own use `page('*', callback)`. 7197 * 7198 * @param {Context} ctx 7199 * @api private 7200 */ 7201 function unhandled(ctx) { 7202 if (ctx.handled) return; 7203 var current; 7204 var page = this; 7205 var window = page._window; 7206 7207 if (page._hashbang) { 7208 current = isLocation && this._getBase() + window.location.hash.replace('#!', ''); 7209 } else { 7210 current = isLocation && window.location.pathname + window.location.search; 7211 } 7212 7213 if (current === ctx.canonicalPath) return; 7214 page.stop(); 7215 ctx.handled = false; 7216 isLocation && (window.location.href = ctx.canonicalPath); 7217 } 7218 7219 /** 7220 * Escapes RegExp characters in the given string. 7221 * 7222 * @param {string} s 7223 * @api private 7224 */ 7225 function escapeRegExp(s) { 7226 return s.replace(/([.+*?=^!:${}()[\]|/\\])/g, '\\$1'); 7227 } 7228 7229 /** 7230 * Initialize a new "request" `Context` 7231 * with the given `path` and optional initial `state`. 7232 * 7233 * @constructor 7234 * @param {string} path 7235 * @param {Object=} state 7236 * @api public 7237 */ 7238 7239 function Context(path, state, pageInstance) { 7240 var _page = this.page = pageInstance || page; 7241 var window = _page._window; 7242 var hashbang = _page._hashbang; 7243 7244 var pageBase = _page._getBase(); 7245 if ('/' === path[0] && 0 !== path.indexOf(pageBase)) path = pageBase + (hashbang ? '#!' : '') + path; 7246 var i = path.indexOf('?'); 7247 7248 this.canonicalPath = path; 7249 var re = new RegExp('^' + escapeRegExp(pageBase)); 7250 this.path = path.replace(re, '') || '/'; 7251 if (hashbang) this.path = this.path.replace('#!', '') || '/'; 7252 7253 this.title = (hasDocument && window.document.title); 7254 this.state = state || {}; 7255 this.state.path = path; 7256 this.querystring = ~i ? _page._decodeURLEncodedURIComponent(path.slice(i + 1)) : ''; 7257 this.pathname = _page._decodeURLEncodedURIComponent(~i ? path.slice(0, i) : path); 7258 this.params = {}; 7259 7260 // fragment 7261 this.hash = ''; 7262 if (!hashbang) { 7263 if (!~this.path.indexOf('#')) return; 7264 var parts = this.path.split('#'); 7265 this.path = this.pathname = parts[0]; 7266 this.hash = _page._decodeURLEncodedURIComponent(parts[1]) || ''; 7267 this.querystring = this.querystring.split('#')[0]; 7268 } 7269 } 7270 7271 /** 7272 * Push state. 7273 * 7274 * @api private 7275 */ 7276 7277 Context.prototype.pushState = function() { 7278 var page = this.page; 7279 var window = page._window; 7280 var hashbang = page._hashbang; 7281 7282 page.len++; 7283 if (hasHistory) { 7284 window.history.pushState(this.state, this.title, 7285 hashbang && this.path !== '/' ? '#!' + this.path : this.canonicalPath); 7286 } 7287 }; 7288 7289 /** 7290 * Save the context state. 7291 * 7292 * @api public 7293 */ 7294 7295 Context.prototype.save = function() { 7296 var page = this.page; 7297 if (hasHistory) { 7298 page._window.history.replaceState(this.state, this.title, 7299 page._hashbang && this.path !== '/' ? '#!' + this.path : this.canonicalPath); 7300 } 7301 }; 7302 7303 /** 7304 * Initialize `Route` with the given HTTP `path`, 7305 * and an array of `callbacks` and `options`. 7306 * 7307 * Options: 7308 * 7309 * - `sensitive` enable case-sensitive routes 7310 * - `strict` enable strict matching for trailing slashes 7311 * 7312 * @constructor 7313 * @param {string} path 7314 * @param {Object=} options 7315 * @api private 7316 */ 7317 7318 function Route(path, options, page) { 7319 var _page = this.page = page || globalPage; 7320 var opts = options || {}; 7321 opts.strict = opts.strict || _page._strict; 7322 this.path = (path === '*') ? '(.*)' : path; 7323 this.method = 'GET'; 7324 this.regexp = pathToRegexp_1(this.path, this.keys = [], opts); 7325 } 7326 7327 /** 7328 * Return route middleware with 7329 * the given callback `fn()`. 7330 * 7331 * @param {Function} fn 7332 * @return {Function} 7333 * @api public 7334 */ 7335 7336 Route.prototype.middleware = function(fn) { 7337 var self = this; 7338 return function(ctx, next) { 7339 if (self.match(ctx.path, ctx.params)) { 7340 ctx.routePath = self.path; 7341 return fn(ctx, next); 7342 } 7343 next(); 7344 }; 7345 }; 7346 7347 /** 7348 * Check if this route matches `path`, if so 7349 * populate `params`. 7350 * 7351 * @param {string} path 7352 * @param {Object} params 7353 * @return {boolean} 7354 * @api private 7355 */ 7356 7357 Route.prototype.match = function(path, params) { 7358 var keys = this.keys, 7359 qsIndex = path.indexOf('?'), 7360 pathname = ~qsIndex ? path.slice(0, qsIndex) : path, 7361 m = this.regexp.exec(decodeURIComponent(pathname)); 7362 7363 if (!m) return false;
7364 7365 delete params[0]; 7366 7367 for (var i = 1, len = m.length; i < len; ++i) { 7368 var key = keys[i - 1]; 7369 var val = this.page._decodeURLEncodedURIComponent(m[i]); 7370 if (val !== undefined || !(hasOwnProperty.call(params, key.name))) { 7371 params[key.name] = val; 7372 } 7373 } 7374 7375 return true; 7376 }; 7377 7378 7379 /** 7380 * Module exports. 7381 */ 7382 7383 var globalPage = createPage(); 7384 var page_js = globalPage; 7385 var default_1 = globalPage; 7386 7387page_js.default = default_1; 7388 7389return page_js; 7390 7391}))); 7392/*! 7393 * Materialize v1.0.0 (http://materializecss.com) 7394 * Copyright 2014-2017 Materialize 7395 * MIT License (https://raw.githubusercontent.com/Dogfalo/materialize/master/LICENSE) 7396 */�
vendor: 142,965 bytes, lines 7396-12165
7396 7397var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; 7398 7399var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); 7400 7401function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } 7402 7403function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } 7404 7405function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 7406 7407/*! cash-dom 1.3.5, https://github.com/kenwheeler/cash @license MIT */ 7408(function (factory) { 7409 window.cash = factory(); 7410})(function () { 7411 var doc = document, 7412 win = window, 7413 ArrayProto = Array.prototype, 7414 slice = ArrayProto.slice, 7415 filter = ArrayProto.filter, 7416 push = ArrayProto.push; 7417 7418 var noop = function () {}, 7419 isFunction = function (item) { 7420 // @see https://crbug.com/568448 7421 return typeof item === typeof noop && item.call; 7422 }, 7423 isString = function (item) { 7424 return typeof item === typeof ""; 7425 }; 7426 7427 var idMatch = /^#[\w-]*$/, 7428 classMatch = /^\.[\w-]*$/, 7429 htmlMatch = /<.+>/, 7430 singlet = /^\w+$/; 7431 7432 function find(selector, context) { 7433 context = context || doc; 7434 var elems = classMatch.test(selector) ? context.getElementsByClassName(selector.slice(1)) : singlet.test(selector) ? context.getElementsByTagName(selector) : context.querySelectorAll(selector); 7435 return elems; 7436 } 7437 7438 var frag; 7439 function parseHTML(str) { 7440 if (!frag) { 7441 frag = doc.implementation.createHTMLDocument(null); 7442 var base = frag.createElement("base"); 7443 base.href = doc.location.href; 7444 frag.head.appendChild(base); 7445 } 7446 7447 frag.body.innerHTML = str; 7448 7449 return frag.body.childNodes; 7450 } 7451 7452 function onReady(fn) { 7453 if (doc.readyState !== "loading") { 7454 fn(); 7455 } else { 7456 doc.addEventListener("DOMContentLoaded", fn); 7457 } 7458 } 7459 7460 function Init(selector, context) { 7461 if (!selector) { 7462 return this; 7463 } 7464 7465 // If already a cash collection, don't do any further processing 7466 if (selector.cash && selector !== win) { 7467 return selector; 7468 } 7469 7470 var elems = selector, 7471 i = 0, 7472 length; 7473 7474 if (isString(selector)) { 7475 elems = idMatch.test(selector) ? 7476 // If an ID use the faster getElementById check 7477 doc.getElementById(selector.slice(1)) : htmlMatch.test(selector) ? 7478 // If HTML, parse it into real elements 7479 parseHTML(selector) : 7480 // else use `find` 7481 find(selector, context); 7482 7483 // If function, use as shortcut for DOM ready 7484 } else if (isFunction(selector)) { 7485 onReady(selector);return this; 7486 } 7487 7488 if (!elems) { 7489 return this; 7490 } 7491 7492 // If a single DOM element is passed in or received via ID, return the single element 7493 if (elems.nodeType || elems === win) { 7494 this[0] = elems; 7495 this.length = 1; 7496 } else { 7497 // Treat like an array and loop through each item. 7498 length = this.length = elems.length; 7499 for (; i < length; i++) { 7500 this[i] = elems[i]; 7501 } 7502 } 7503 7504 return this; 7505 } 7506 7507 function cash(selector, context) { 7508 return new Init(selector, context); 7509 } 7510 7511 var fn = cash.fn = cash.prototype = Init.prototype = { // jshint ignore:line 7512 cash: true, 7513 length: 0, 7514 push: push, 7515 splice: ArrayProto.splice, 7516 map: ArrayProto.map, 7517 init: Init 7518 }; 7519 7520 Object.defineProperty(fn, "constructor", { value: cash }); 7521 7522 cash.parseHTML = parseHTML; 7523 cash.noop = noop; 7524 cash.isFunction = isFunction; 7525 cash.isString = isString; 7526 7527 cash.extend = fn.extend = function (target) { 7528 target = target || {}; 7529 7530 var args = slice.call(arguments), 7531 length = args.length, 7532 i = 1; 7533 7534 if (args.length === 1) { 7535 target = this; 7536 i = 0; 7537 } 7538 7539 for (; i < length; i++) { 7540 if (!args[i]) { 7541 continue; 7542 } 7543 for (var key in args[i]) { 7544 if (args[i].hasOwnProperty(key)) { 7545 target[key] = args[i][key]; 7546 } 7547 } 7548 } 7549 7550 return target; 7551 }; 7552 7553 function each(collection, callback) { 7554 var l = collection.length, 7555 i = 0; 7556 7557 for (; i < l; i++) { 7558 if (callback.call(collection[i], collection[i], i, collection) === false) { 7559 break; 7560 } 7561 } 7562 } 7563 7564 function matches(el, selector) { 7565 var m = el && (el.matches || el.webkitMatchesSelector || el.mozMatchesSelector || el.msMatchesSelector || el.oMatchesSelector); 7566 return !!m && m.call(el, selector); 7567 } 7568 7569 function getCompareFunction(selector) { 7570 return ( 7571 /* Use browser's `matches` function if string */ 7572 isString(selector) ? matches : 7573 /* Match a cash element */ 7574 selector.cash ? function (el) { 7575 return selector.is(el); 7576 } : 7577 /* Direct comparison */ 7578 function (el, selector) { 7579 return el === selector; 7580 } 7581 ); 7582 } 7583 7584 function unique(collection) { 7585 return cash(slice.call(collection).filter(function (item, index, self) { 7586 return self.indexOf(item) === index; 7587 })); 7588 } 7589 7590 cash.extend({ 7591 merge: function (first, second) { 7592 var len = +second.length, 7593 i = first.length, 7594 j = 0; 7595 7596 for (; j < len; i++, j++) { 7597 first[i] = second[j]; 7598 } 7599 7600 first.length = i; 7601 return first; 7602 }, 7603 7604 each: each, 7605 matches: matches, 7606 unique: unique, 7607 isArray: Array.isArray, 7608 isNumeric: function (n) { 7609 return !isNaN(parseFloat(n)) && isFinite(n); 7610 } 7611 7612 }); 7613 7614 var uid = cash.uid = "_cash" + Date.now(); 7615 7616 function getDataCache(node) { 7617 return node[uid] = node[uid] || {}; 7618 } 7619 7620 function setData(node, key, value) { 7621 return getDataCache(node)[key] = value; 7622 } 7623 7624 function getData(node, key) { 7625 var c = getDataCache(node); 7626 if (c[key] === undefined) { 7627 c[key] = node.dataset ? node.dataset[key] : cash(node).attr("data-" + key); 7628 } 7629 return c[key]; 7630 } 7631 7632 function removeData(node, key) { 7633 var c = getDataCache(node); 7634 if (c) { 7635 delete c[key]; 7636 } else if (node.dataset) { 7637 delete node.dataset[key]; 7638 } else { 7639 cash(node).removeAttr("data-" + name); 7640 } 7641 } 7642 7643 fn.extend({ 7644 data: function (name, value) { 7645 if (isString(name)) { 7646 return value === undefined ? getData(this[0], name) : this.each(function (v) { 7647 return setData(v, name, value); 7648 }); 7649 } 7650 7651 for (var key in name) { 7652 this.data(key, name[key]); 7653 } 7654 7655 return this; 7656 }, 7657 7658 removeData: function (key) { 7659 return this.each(function (v) { 7660 return removeData(v, key); 7661 }); 7662 } 7663 7664 }); 7665 7666 var notWhiteMatch = /\S+/g; 7667 7668 function getClasses(c) { 7669 return isString(c) && c.match(notWhiteMatch); 7670 } 7671 7672 function hasClass(v, c) { 7673 return v.classList ? v.classList.contains(c) : new RegExp("(^| )" + c + "( |$)", "gi").test(v.className); 7674 } 7675 7676 function addClass(v, c, spacedName) { 7677 if (v.classList) { 7678 v.classList.add(c); 7679 } else if (spacedName.indexOf(" " + c + " ")) { 7680 v.className += " " + c; 7681 } 7682 } 7683 7684 function removeClass(v, c) { 7685 if (v.classList) { 7686 v.classList.remove(c); 7687 } else { 7688 v.className = v.className.replace(c, ""); 7689 } 7690 } 7691 7692 fn.extend({ 7693 addClass: function (c) { 7694 var classes = getClasses(c); 7695 7696 return classes ? this.each(function (v) { 7697 var spacedName = " " + v.className + " "; 7698 each(classes, function (c) { 7699 addClass(v, c, spacedName); 7700 }); 7701 }) : this; 7702 }, 7703 7704 attr: function (name, value) { 7705 if (!name) { 7706 return undefined; 7707 } 7708 7709 if (isString(name)) { 7710 if (value === undefined) { 7711 return this[0] ? this[0].getAttribute ? this[0].getAttribute(name) : this[0][name] : undefined; 7712 } 7713 7714 return this.each(function (v) { 7715 if (v.setAttribute) { 7716 v.setAttribute(name, value); 7717 } else { 7718 v[name] = value; 7719 } 7720 }); 7721 } 7722 7723 for (var key in name) { 7724 this.attr(key, name[key]); 7725 } 7726 7727 return this; 7728 }, 7729 7730 hasClass: function (c) { 7731 var check = false, 7732 classes = getClasses(c); 7733 if (classes && classes.length) { 7734 this.each(function (v) { 7735 check = hasClass(v, classes[0]); 7736 return !check; 7737 }); 7738 } 7739 return check; 7740 }, 7741 7742 prop: function (name, value) { 7743 if (isString(name)) { 7744 return value === undefined ? this[0][name] : this.each(function (v) { 7745 v[name] = value; 7746 }); 7747 } 7748 7749 for (var key in name) { 7750 this.prop(key, name[key]); 7751 } 7752 7753 return this; 7754 }, 7755 7756 removeAttr: function (name) { 7757 return this.each(function (v) { 7758 if (v.removeAttribute) { 7759 v.removeAttribute(name); 7760 } else { 7761 delete v[name]; 7762 } 7763 }); 7764 }, 7765 7766 removeClass: function (c) { 7767 if (!arguments.length) { 7768 return this.attr("class", ""); 7769 } 7770 var classes = getClasses(c); 7771 return classes ? this.each(function (v) { 7772 each(classes, function (c) { 7773 removeClass(v, c); 7774 }); 7775 }) : this; 7776 }, 7777 7778 removeProp: function (name) { 7779 return this.each(function (v) { 7780 delete v[name]; 7781 }); 7782 }, 7783 7784 toggleClass: function (c, state) { 7785 if (state !== undefined) { 7786 return this[state ? "addClass" : "removeClass"](c); 7787 } 7788 var classes = getClasses(c); 7789 return classes ? this.each(function (v) { 7790 var spacedName = " " + v.className + " "; 7791 each(classes, function (c) { 7792 if (hasClass(v, c)) { 7793 removeClass(v, c); 7794 } else { 7795 addClass(v, c, spacedName); 7796 } 7797 }); 7798 }) : this; 7799 } }); 7800 7801 fn.extend({ 7802 add: function (selector, context) { 7803 return unique(cash.merge(this, cash(selector, context))); 7804 }, 7805 7806 each: function (callback) { 7807 each(this, callback); 7808 return this; 7809 }, 7810 7811 eq: function (index) { 7812 return cash(this.get(index)); 7813 }, 7814 7815 filter: function (selector) { 7816 if (!selector) { 7817 return this; 7818 } 7819 7820 var comparator = isFunction(selector) ? selector : getCompareFunction(selector); 7821 7822 return cash(filter.call(this, function (e) { 7823 return comparator(e, selector); 7824 })); 7825 }, 7826 7827 first: function () { 7828 return this.eq(0); 7829 }, 7830 7831 get: function (index) { 7832 if (index === undefined) { 7833 return slice.call(this); 7834 } 7835 return index < 0 ? this[index + this.length] : this[index]; 7836 }, 7837 7838 index: function (elem) { 7839 var child = elem ? cash(elem)[0] : this[0], 7840 collection = elem ? this : cash(child).parent().children(); 7841 return slice.call(collection).indexOf(child); 7842 }, 7843 7844 last: function () { 7845 return this.eq(-1); 7846 } 7847 7848 }); 7849 7850 var camelCase = function () { 7851 var camelRegex = /(?:^\w|[A-Z]|\b\w)/g, 7852 whiteSpace = /[\s-_]+/g; 7853 return function (str) { 7854 return str.replace(camelRegex, function (letter, index) { 7855 return letter[index === 0 ? "toLowerCase" : "toUpperCase"](); 7856 }).replace(whiteSpace, ""); 7857 }; 7858 }(); 7859 7860 var getPrefixedProp = function () { 7861 var cache = {}, 7862 doc = document, 7863 div = doc.createElement("div"), 7864 style = div.style; 7865 7866 return function (prop) { 7867 prop = camelCase(prop); 7868 if (cache[prop]) { 7869 return cache[prop]; 7870 } 7871 7872 var ucProp = prop.charAt(0).toUpperCase() + prop.slice(1), 7873 prefixes = ["webkit", "moz", "ms", "o"], 7874 props = (prop + " " + prefixes.join(ucProp + " ") + ucProp).split(" "); 7875 7876 each(props, function (p) { 7877 if (p in style) { 7878 cache[p] = prop = cache[prop] = p; 7879 return false; 7880 } 7881 }); 7882 7883 return cache[prop]; 7884 }; 7885 }(); 7886 7887 cash.prefixedProp = getPrefixedProp; 7888 cash.camelCase = camelCase; 7889 7890 fn.extend({ 7891 css: function (prop, value) { 7892 if (isString(prop)) { 7893 prop = getPrefixedProp(prop); 7894 return arguments.length > 1 ? this.each(function (v) { 7895 return v.style[prop] = value; 7896 }) : win.getComputedStyle(this[0])[prop]; 7897 } 7898 7899 for (var key in prop) { 7900 this.css(key, prop[key]); 7901 } 7902 7903 return this; 7904 } 7905 7906 }); 7907 7908 function compute(el, prop) { 7909 return parseInt(win.getComputedStyle(el[0], null)[prop], 10) || 0; 7910 } 7911 7912 each(["Width", "Height"], function (v) { 7913 var lower = v.toLowerCase(); 7914 7915 fn[lower] = function () { 7916 return this[0].getBoundingClientRect()[lower]; 7917 }; 7918 7919 fn["inner" + v] = function () { 7920 return this[0]["client" + v]; 7921 }; 7922 7923 fn["outer" + v] = function (margins) { 7924 return this[0]["offset" + v] + (margins ? compute(this, "margin" + (v === "Width" ? "Left" : "Top")) + compute(this, "margin" + (v === "Width" ? "Right" : "Bottom")) : 0); 7925 }; 7926 }); 7927 7928 function registerEvent(node, eventName, callback) { 7929 var eventCache = getData(node, "_cashEvents") || setData(node, "_cashEvents", {}); 7930 eventCache[eventName] = eventCache[eventName] || []; 7931 eventCache[eventName].push(callback); 7932 node.addEventListener(eventName, callback); 7933 } 7934 7935 function removeEvent(node, eventName, callback) { 7936 var events = getData(node, "_cashEvents"), 7937 eventCache = events && events[eventName], 7938 index; 7939 7940 if (!eventCache) { 7941 return; 7942 } 7943 7944 if (callback) { 7945 node.removeEventListener(eventName, callback); 7946 index = eventCache.indexOf(callback); 7947 if (index >= 0) { 7948 eventCache.splice(index, 1); 7949 } 7950 } else { 7951 each(eventCache, function (event) { 7952 node.removeEventListener(eventName, event); 7953 }); 7954 eventCache = []; 7955 } 7956 } 7957 7958 fn.extend({ 7959 off: function (eventName, callback) { 7960 return this.each(function (v) { 7961 return removeEvent(v, eventName, callback); 7962 }); 7963 }, 7964 7965 on: function (eventName, delegate, callback, runOnce) { 7966 // jshint ignore:line 7967 var originalCallback; 7968 if (!isString(eventName)) { 7969 for (var key in eventName) { 7970 this.on(key, delegate, eventName[key]); 7971 } 7972 return this; 7973 } 7974 7975 if (isFunction(delegate)) { 7976 callback = delegate; 7977 delegate = null; 7978 } 7979 7980 if (eventName === "ready") { 7981 onReady(callback); 7982 return this; 7983 } 7984 7985 if (delegate) { 7986 originalCallback = callback; 7987 callback = function (e) { 7988 var t = e.target; 7989 while (!matches(t, delegate)) { 7990 if (t === this || t === null) { 7991 return t = false; 7992 } 7993 7994 t = t.parentNode; 7995 } 7996 7997 if (t) { 7998 originalCallback.call(t, e); 7999 } 8000 }; 8001 } 8002 8003 return this.each(function (v) { 8004 var finalCallback = callback; 8005 if (runOnce) { 8006 finalCallback = function () { 8007 callback.apply(this, arguments); 8008 removeEvent(v, eventName, finalCallback); 8009 }; 8010 } 8011 registerEvent(v, eventName, finalCallback); 8012 }); 8013 }, 8014 8015 one: function (eventName, delegate, callback) { 8016 return this.on(eventName, delegate, callback, true); 8017 }, 8018 8019 ready: onReady, 8020 8021 /** 8022 * Modified 8023 * Triggers browser event 8024 * @param String eventName 8025 * @param Object data - Add properties to event object 8026 */ 8027 trigger: function (eventName, data) { 8028 if (document.createEvent) { 8029 var evt = document.createEvent('HTMLEvents'); 8030 evt.initEvent(eventName, true, false); 8031 evt = this.extend(evt, data); 8032 return this.each(function (v) { 8033 return v.dispatchEvent(evt); 8034 }); 8035 } 8036 } 8037 8038 }); 8039 8040 function encode(name, value) { 8041 return "&" + encodeURIComponent(name) + "=" + encodeURIComponent(value).replace(/%20/g, "+"); 8042 } 8043 8044 function getSelectMultiple_(el) { 8045 var values = []; 8046 each(el.options, function (o) { 8047 if (o.selected) { 8048 values.push(o.value); 8049 } 8050 }); 8051 return values.length ? values : null; 8052 } 8053 8054 function getSelectSingle_(el) { 8055 var selectedIndex = el.selectedIndex; 8056 return selectedIndex >= 0 ? el.options[selectedIndex].value : null; 8057 } 8058 8059 function getValue(el) { 8060 var type = el.type; 8061 if (!type) { 8062 return null; 8063 } 8064 switch (type.toLowerCase()) { 8065 case "select-one": 8066 return getSelectSingle_(el); 8067 case "select-multiple": 8068 return getSelectMultiple_(el); 8069 case "radio": 8070 return el.checked ? el.value : null; 8071 case "checkbox": 8072 return el.checked ? el.value : null; 8073 default: 8074 return el.value ? el.value : null; 8075 } 8076 } 8077 8078 fn.extend({ 8079 serialize: function () { 8080 var query = ""; 8081 8082 each(this[0].elements || this, function (el) { 8083 if (el.disabled || el.tagName === "FIELDSET") { 8084 return; 8085 } 8086 var name = el.name; 8087 switch (el.type.toLowerCase()) { 8088 case "file": 8089 case "reset": 8090 case "submit": 8091 case "button": 8092 break; 8093 case "select-multiple": 8094 var values = getValue(el); 8095 if (values !== null) { 8096 each(values, function (value) { 8097 query += encode(name, value); 8098 }); 8099 } 8100 break; 8101 default: 8102 var value = getValue(el); 8103 if (value !== null) { 8104 query += encode(name, value); 8105 } 8106 } 8107 }); 8108 8109 return query.substr(1); 8110 }, 8111 8112 val: function (value) { 8113 if (value === undefined) { 8114 return getValue(this[0]); 8115 } 8116 8117 return this.each(function (v) { 8118 return v.value = value; 8119 }); 8120 } 8121 8122 }); 8123 8124 function insertElement(el, child, prepend) { 8125 if (prepend) { 8126 var first = el.childNodes[0]; 8127 el.insertBefore(child, first); 8128 } else { 8129 el.appendChild(child); 8130 } 8131 } 8132 8133 function insertContent(parent, child, prepend) { 8134 var str = isString(child); 8135 8136 if (!str && child.length) { 8137 each(child, function (v) { 8138 return insertContent(parent, v, prepend); 8139 }); 8140 return; 8141 } 8142 8143 each(parent, str ? function (v) { 8144 return v.insertAdjacentHTML(prepend ? "afterbegin" : "beforeend", child); 8145 } : function (v, i) { 8146 return insertElement(v, i === 0 ? child : child.cloneNode(true), prepend); 8147 }); 8148 } 8149 8150 fn.extend({ 8151 after: function (selector) { 8152 cash(selector).insertAfter(this); 8153 return this; 8154 }, 8155 8156 append: function (content) { 8157 insertContent(this, content); 8158 return this; 8159 }, 8160 8161 appendTo: function (parent) { 8162 insertContent(cash(parent), this); 8163 return this; 8164 }, 8165 8166 before: function (selector) { 8167 cash(selector).insertBefore(this); 8168 return this; 8169 }, 8170 8171 clone: function () { 8172 return cash(this.map(function (v) { 8173 return v.cloneNode(true); 8174 })); 8175 }, 8176 8177 empty: function () { 8178 this.html(""); 8179 return this; 8180 }, 8181 8182 html: function (content) { 8183 if (content === undefined) { 8184 return this[0].innerHTML; 8185 } 8186 var source = content.nodeType ? content[0].outerHTML : content; 8187 return this.each(function (v) { 8188 return v.innerHTML = source; 8189 }); 8190 }, 8191 8192 insertAfter: function (selector) { 8193 var _this = this; 8194 8195 cash(selector).each(function (el, i) { 8196 var parent = el.parentNode, 8197 sibling = el.nextSibling; 8198 _this.each(function (v) { 8199 parent.insertBefore(i === 0 ? v : v.cloneNode(true), sibling); 8200 }); 8201 }); 8202 8203 return this; 8204 }, 8205 8206 insertBefore: function (selector) { 8207 var _this2 = this; 8208 cash(selector).each(function (el, i) { 8209 var parent = el.parentNode; 8210 _this2.each(function (v) { 8211 parent.insertBefore(i === 0 ? v : v.cloneNode(true), el); 8212 }); 8213 }); 8214 return this; 8215 }, 8216 8217 prepend: function (content) { 8218 insertContent(this, content, true); 8219 return this; 8220 }, 8221 8222 prependTo: function (parent) { 8223 insertContent(cash(parent), this, true); 8224 return this; 8225 }, 8226 8227 remove: function () { 8228 return this.each(function (v) { 8229 if (!!v.parentNode) { 8230 return v.parentNode.removeChild(v); 8231 } 8232 }); 8233 }, 8234 8235 text: function (content) { 8236 if (content === undefined) { 8237 return this[0].textContent; 8238 } 8239 return this.each(function (v) { 8240 return v.textContent = content; 8241 }); 8242 } 8243 8244 }); 8245 8246 var docEl = doc.documentElement; 8247 8248 fn.extend({ 8249 position: function () { 8250 var el = this[0]; 8251 return { 8252 left: el.offsetLeft, 8253 top: el.offsetTop 8254 }; 8255 }, 8256 8257 offset: function () { 8258 var rect = this[0].getBoundingClientRect(); 8259 return { 8260 top: rect.top + win.pageYOffset - docEl.clientTop, 8261 left: rect.left + win.pageXOffset - docEl.clientLeft 8262 }; 8263 }, 8264 8265 offsetParent: function () { 8266 return cash(this[0].offsetParent); 8267 } 8268 8269 }); 8270 8271 fn.extend({ 8272 children: function (selector) { 8273 var elems = []; 8274 this.each(function (el) { 8275 push.apply(elems, el.children); 8276 }); 8277 elems = unique(elems); 8278 8279 return !selector ? elems : elems.filter(function (v) { 8280 return matches(v, selector); 8281 }); 8282 }, 8283 8284 closest: function (selector) { 8285 if (!selector || this.length < 1) { 8286 return cash(); 8287 } 8288 if (this.is(selector)) { 8289 return this.filter(selector); 8290 } 8291 return this.parent().closest(selector); 8292 }, 8293 8294 is: function (selector) { 8295 if (!selector) { 8296 return false; 8297 } 8298 8299 var match = false, 8300 comparator = getCompareFunction(selector); 8301 8302 this.each(function (el) { 8303 match = comparator(el, selector); 8304 return !match; 8305 }); 8306 8307 return match; 8308 }, 8309 8310 find: function (selector) { 8311 if (!selector || selector.nodeType) { 8312 return cash(selector && this.has(selector).length ? selector : null); 8313 } 8314 8315 var elems = []; 8316 this.each(function (el) { 8317 push.apply(elems, find(selector, el)); 8318 }); 8319 8320 return unique(elems); 8321 }, 8322 8323 has: function (selector) { 8324 var comparator = isString(selector) ? function (el) { 8325 return find(selector, el).length !== 0; 8326 } : function (el) { 8327 return el.contains(selector); 8328 }; 8329 8330 return this.filter(comparator); 8331 }, 8332 8333 next: function () { 8334 return cash(this[0].nextElementSibling); 8335 }, 8336 8337 not: function (selector) { 8338 if (!selector) { 8339 return this; 8340 } 8341 8342 var comparator = getCompareFunction(selector); 8343 8344 return this.filter(function (el) { 8345 return !comparator(el, selector); 8346 }); 8347 }, 8348 8349 parent: function () { 8350 var result = []; 8351 8352 this.each(function (item) { 8353 if (item && item.parentNode) { 8354 result.push(item.parentNode); 8355 } 8356 }); 8357 8358 return unique(result); 8359 }, 8360 8361 parents: function (selector) { 8362 var last, 8363 result = []; 8364 8365 this.each(function (item) { 8366 last = item; 8367 8368 while (last && last.parentNode && last !== doc.body.parentNode) { 8369 last = last.parentNode; 8370 8371 if (!selector || selector && matches(last, selector)) { 8372 result.push(last); 8373 } 8374 } 8375 }); 8376 8377 return unique(result); 8378 }, 8379 8380 prev: function () { 8381 return cash(this[0].previousElementSibling); 8382 }, 8383 8384 siblings: function (selector) { 8385 var collection = this.parent().children(selector), 8386 el = this[0]; 8387 8388 return collection.filter(function (i) { 8389 return i !== el; 8390 }); 8391 } 8392 8393 }); 8394 8395 return cash; 8396}); 8397; 8398var Component = function () { 8399 /** 8400 * Generic constructor for all components 8401 * @constructor 8402 * @param {Element} el 8403 * @param {Object} options 8404 */ 8405 function Component(classDef, el, options) { 8406 _classCallCheck(this, Component); 8407 8408 // Display error if el is valid HTML Element 8409 if (!(el instanceof Element)) { 8410 console.error(Error(el + ' is not an HTML Element')); 8411 } 8412 8413 // If exists, destroy and reinitialize in child 8414 var ins = classDef.getInstance(el); 8415 if (!!ins) { 8416 ins.destroy(); 8417 } 8418 8419 this.el = el; 8420 this.$el = cash(el); 8421 } 8422 8423 /** 8424 * Initializes components 8425 * @param {class} classDef 8426 * @param {Element | NodeList | jQuery} els 8427 * @param {Object} options 8428 */ 8429 8430 8431 _createClass(Component, null, [{ 8432 key: "init", 8433 value: function init(classDef, els, options) { 8434 var instances = null; 8435 if (els instanceof Element) { 8436 instances = new classDef(els, options); 8437 } else if (!!els && (els.jquery || els.cash || els instanceof NodeList)) { 8438 var instancesArr = []; 8439 for (var i = 0; i < els.length; i++) { 8440 instancesArr.push(new classDef(els[i], options)); 8441 } 8442 instances = instancesArr; 8443 } 8444 8445 return instances; 8446 } 8447 }]); 8448 8449 return Component; 8450}(); 8451 8452; // Required for Meteor package, the use of window prevents export by Meteor 8453(function (window) { 8454 if (window.Package) { 8455 M = {}; 8456 } else { 8457 window.M = {}; 8458 } 8459 8460 // Check for jQuery 8461 M.jQueryLoaded = !!window.jQuery; 8462})(window); 8463 8464// AMD 8465if (typeof define === 'function' && define.amd) { 8466 define('M', [], function () { 8467 return M; 8468 }); 8469 8470 // Common JS 8471} else if (typeof exports !== 'undefined' && !exports.nodeType) { 8472 if (typeof module !== 'undefined' && !module.nodeType && module.exports) { 8473 exports = module.exports = M; 8474 } 8475 exports.default = M; 8476} 8477 8478M.version = '1.0.0'; 8479 8480M.keys = { 8481 TAB: 9, 8482 ENTER: 13, 8483 ESC: 27, 8484 ARROW_UP: 38, 8485 ARROW_DOWN: 40 8486}; 8487 8488/** 8489 * TabPress Keydown handler 8490 */ 8491M.tabPressed = false; 8492M.keyDown = false; 8493var docHandleKeydown = function (e) { 8494 M.keyDown = true; 8495 if (e.which === M.keys.TAB || e.which === M.keys.ARROW_DOWN || e.which === M.keys.ARROW_UP) { 8496 M.tabPressed = true; 8497 } 8498}; 8499var docHandleKeyup = function (e) { 8500 M.keyDown = false; 8501 if (e.which === M.keys.TAB || e.which === M.keys.ARROW_DOWN || e.which === M.keys.ARROW_UP) { 8502 M.tabPressed = false; 8503 } 8504}; 8505var docHandleFocus = function (e) { 8506 if (M.keyDown) { 8507 document.body.classList.add('keyboard-focused'); 8508 } 8509}; 8510var docHandleBlur = function (e) { 8511 document.body.classList.remove('keyboard-focused'); 8512}; 8513document.addEventListener('keydown', docHandleKeydown, true); 8514document.addEventListener('keyup', docHandleKeyup, true); 8515document.addEventListener('focus', docHandleFocus, true); 8516document.addEventListener('blur', docHandleBlur, true); 8517 8518/** 8519 * Initialize jQuery wrapper for plugin 8520 * @param {Class} plugin javascript class 8521 * @param {string} pluginName jQuery plugin name 8522 * @param {string} classRef Class reference name 8523 */ 8524M.initializeJqueryWrapper = function (plugin, pluginName, classRef) { 8525 jQuery.fn[pluginName] = function (methodOrOptions) { 8526 // Call plugin method if valid method name is passed in 8527 if (plugin.prototype[methodOrOptions]) { 8528 var params = Array.prototype.slice.call(arguments, 1); 8529 8530 // Getter methods 8531 if (methodOrOptions.slice(0, 3) === 'get') { 8532 var instance = this.first()[0][classRef]; 8533 return instance[methodOrOptions].apply(instance, params); 8534 } 8535 8536 // Void methods 8537 return this.each(function () { 8538 var instance = this[classRef]; 8539 instance[methodOrOptions].apply(instance, params); 8540 }); 8541 8542 // Initialize plugin if options or no argument is passed in 8543 } else if (typeof methodOrOptions === 'object' || !methodOrOptions) { 8544 plugin.init(this, arguments[0]); 8545 return this; 8546 } 8547 8548 // Return error if an unrecognized method name is passed in 8549 jQuery.error("Method " + methodOrOptions + " does not exist on jQuery." + pluginName); 8550 }; 8551}; 8552 8553/** 8554 * Automatically initialize components 8555 * @param {Element} context DOM Element to search within for components 8556 */ 8557M.AutoInit = function (context) { 8558 // Use document.body if no context is given 8559 var root = !!context ? context : document.body; 8560 8561 var registry = { 8562 Autocomplete: root.querySelectorAll('.autocomplete:not(.no-autoinit)'), 8563 Carousel: root.querySelectorAll('.carousel:not(.no-autoinit)'), 8564 Chips: root.querySelectorAll('.chips:not(.no-autoinit)'), 8565 Collapsible: root.querySelectorAll('.collapsible:not(.no-autoinit)'), 8566 Datepicker: root.querySelectorAll('.datepicker:not(.no-autoinit)'), 8567 Dropdown: root.querySelectorAll('.dropdown-trigger:not(.no-autoinit)'), 8568 Materialbox: root.querySelectorAll('.materialboxed:not(.no-autoinit)'), 8569 Modal: root.querySelectorAll('.modal:not(.no-autoinit)'), 8570 Parallax: root.querySelectorAll('.parallax:not(.no-autoinit)'), 8571 Pushpin: root.querySelectorAll('.pushpin:not(.no-autoinit)'), 8572 ScrollSpy: root.querySelectorAll('.scrollspy:not(.no-autoinit)'), 8573 FormSelect: root.querySelectorAll('select:not(.no-autoinit)'), 8574 Sidenav: root.querySelectorAll('.sidenav:not(.no-autoinit)'), 8575 Tabs: root.querySelectorAll('.tabs:not(.no-autoinit)'), 8576 TapTarget: root.querySelectorAll('.tap-target:not(.no-autoinit)'), 8577 Timepicker: root.querySelectorAll('.timepicker:not(.no-autoinit)'), 8578 Tooltip: root.querySelectorAll('.tooltipped:not(.no-autoinit)'), 8579 FloatingActionButton: root.querySelectorAll('.fixed-action-btn:not(.no-autoinit)') 8580 }; 8581 8582 for (var pluginName in registry) { 8583 var plugin = M[pluginName]; 8584 plugin.init(registry[pluginName]); 8585 } 8586}; 8587 8588/** 8589 * Generate approximated selector string for a jQuery object 8590 * @param {jQuery} obj jQuery object to be parsed 8591 * @returns {string} 8592 */ 8593M.objectSelectorString = function (obj) { 8594 var tagStr = obj.prop('tagName') || ''; 8595 var idStr = obj.attr('id') || ''; 8596 var classStr = obj.attr('class') || ''; 8597 return (tagStr + idStr + classStr).replace(/\s/g, ''); 8598}; 8599 8600// Unique Random ID 8601M.guid = function () { 8602 function s4() { 8603 return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1); 8604 } 8605 return function () { 8606 return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4(); 8607 }; 8608}(); 8609 8610/** 8611 * Escapes hash from special characters 8612 * @param {string} hash String returned from this.hash 8613 * @returns {string} 8614 */ 8615M.escapeHash = function (hash) { 8616 return hash.replace(/(:|\.|\[|\]|,|=|\/)/g, '\\$1'); 8617}; 8618 8619M.elementOrParentIsFixed = function (element) { 8620 var $element = $(element); 8621 var $checkElements = $element.add($element.parents()); 8622 var isFixed = false; 8623 $checkElements.each(function () { 8624 if ($(this).css('position') === 'fixed') { 8625 isFixed = true; 8626 return false; 8627 } 8628 }); 8629 return isFixed; 8630}; 8631 8632/** 8633 * @typedef {Object} Edges 8634 * @property {Boolean} top If the top edge was exceeded 8635 * @property {Boolean} right If the right edge was exceeded 8636 * @property {Boolean} bottom If the bottom edge was exceeded 8637 * @property {Boolean} left If the left edge was exceeded 8638 */ 8639 8640/** 8641 * @typedef {Object} Bounding 8642 * @property {Number} left left offset coordinate 8643 * @property {Number} top top offset coordinate 8644 * @property {Number} width 8645 * @property {Number} height 8646 */ 8647 8648/** 8649 * Escapes hash from special characters 8650 * @param {Element} container Container element that acts as the boundary 8651 * @param {Bounding} bounding element bounding that is being checked 8652 * @param {Number} offset offset from edge that counts as exceeding 8653 * @returns {Edges} 8654 */ 8655M.checkWithinContainer = function (container, bounding, offset) { 8656 var edges = { 8657 top: false, 8658 right: false, 8659 bottom: false, 8660 left: false 8661 }; 8662 8663 var containerRect = container.getBoundingClientRect(); 8664 // If body element is smaller than viewport, use viewport height instead. 8665 var containerBottom = container === document.body ? Math.max(containerRect.bottom, window.innerHeight) : containerRect.bottom; 8666 8667 var scrollLeft = container.scrollLeft; 8668 var scrollTop = container.scrollTop; 8669 8670 var scrolledX = bounding.left - scrollLeft; 8671 var scrolledY = bounding.top - scrollTop; 8672 8673 // Check for container and viewport for each edge 8674 if (scrolledX < containerRect.left + offset || scrolledX < offset) { 8675 edges.left = true; 8676 } 8677 8678 if (scrolledX + bounding.width > containerRect.right - offset || scrolledX + bounding.width > window.innerWidth - offset) { 8679 edges.right = true; 8680 } 8681 8682 if (scrolledY < containerRect.top + offset || scrolledY < offset) { 8683 edges.top = true; 8684 } 8685 8686 if (scrolledY + bounding.height > containerBottom - offset || scrolledY + bounding.height > window.innerHeight - offset) { 8687 edges.bottom = true; 8688 } 8689 8690 return edges; 8691}; 8692 8693M.checkPossibleAlignments = function (el, container, bounding, offset) { 8694 var canAlign = { 8695 top: true, 8696 right: true, 8697 bottom: true, 8698 left: true, 8699 spaceOnTop: null, 8700 spaceOnRight: null, 8701 spaceOnBottom: null, 8702 spaceOnLeft: null 8703 }; 8704 8705 var containerAllowsOverflow = getComputedStyle(container).overflow === 'visible'; 8706 var containerRect = container.getBoundingClientRect(); 8707 var containerHeight = Math.min(containerRect.height, window.innerHeight); 8708 var containerWidth = Math.min(containerRect.width, window.innerWidth); 8709 var elOffsetRect = el.getBoundingClientRect(); 8710 8711 var scrollLeft = container.scrollLeft; 8712 var scrollTop = container.scrollTop; 8713 8714 var scrolledX = bounding.left - scrollLeft; 8715 var scrolledYTopEdge = bounding.top - scrollTop; 8716 var scrolledYBottomEdge = bounding.top + elOffsetRect.height - scrollTop; 8717 8718 // Check for container and viewport for left 8719 canAlign.spaceOnRight = !containerAllowsOverflow ? containerWidth - (scrolledX + bounding.width) : window.innerWidth - (elOffsetRect.left + bounding.width); 8720 if (canAlign.spaceOnRight < 0) { 8721 canAlign.left = false; 8722 } 8723 8724 // Check for container and viewport for Right 8725 canAlign.spaceOnLeft = !containerAllowsOverflow ? scrolledX - bounding.width + elOffsetRect.width : elOffsetRect.right - bounding.width; 8726 if (canAlign.spaceOnLeft < 0) { 8727 canAlign.right = false; 8728 } 8729 8730 // Check for container and viewport for Top 8731 canAlign.spaceOnBottom = !containerAllowsOverflow ? containerHeight - (scrolledYTopEdge + bounding.height + offset) : window.innerHeight - (elOffsetRect.top + bounding.height + offset); 8732 if (canAlign.spaceOnBottom < 0) { 8733 canAlign.top = false; 8734 } 8735 8736 // Check for container and viewport for Bottom 8737 canAlign.spaceOnTop = !containerAllowsOverflow ? scrolledYBottomEdge - (bounding.height - offset) : elOffsetRect.bottom - (bounding.height + offset); 8738 if (canAlign.spaceOnTop < 0) { 8739 canAlign.bottom = false; 8740 } 8741 8742 return canAlign; 8743}; 8744 8745M.getOverflowParent = function (element) { 8746 if (element == null) { 8747 return null; 8748 } 8749 8750 if (element === document.body || getComputedStyle(element).overflow !== 'visible') { 8751 return element; 8752 } 8753 8754 return M.getOverflowParent(element.parentElement); 8755}; 8756 8757/** 8758 * Gets id of component from a trigger 8759 * @param {Element} trigger trigger 8760 * @returns {string} 8761 */ 8762M.getIdFromTrigger = function (trigger) { 8763 var id = trigger.getAttribute('data-target'); 8764 if (!id) { 8765 id = trigger.getAttribute('href'); 8766 if (id) { 8767 id = id.slice(1); 8768 } else { 8769 id = ''; 8770 } 8771 } 8772 return id; 8773}; 8774 8775/** 8776 * Multi browser support for document scroll top 8777 * @returns {Number} 8778 */ 8779M.getDocumentScrollTop = function () { 8780 return window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0; 8781}; 8782 8783/** 8784 * Multi browser support for document scroll left 8785 * @returns {Number} 8786 */ 8787M.getDocumentScrollLeft = function () { 8788 return window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0; 8789}; 8790 8791/** 8792 * @typedef {Object} Edges 8793 * @property {Boolean} top If the top edge was exceeded 8794 * @property {Boolean} right If the right edge was exceeded 8795 * @property {Boolean} bottom If the bottom edge was exceeded 8796 * @property {Boolean} left If the left edge was exceeded 8797 */ 8798 8799/** 8800 * @typedef {Object} Bounding 8801 * @property {Number} left left offset coordinate 8802 * @property {Number} top top offset coordinate 8803 * @property {Number} width 8804 * @property {Number} height 8805 */ 8806 8807/** 8808 * Get time in ms 8809 * @license https://raw.github.com/jashkenas/underscore/master/LICENSE 8810 * @type {function} 8811 * @return {number} 8812 */ 8813var getTime = Date.now || function () { 8814 return new Date().getTime(); 8815}; 8816 8817/** 8818 * Returns a function, that, when invoked, will only be triggered at most once 8819 * during a given window of time. Normally, the throttled function will run 8820 * as much as it can, without ever going more than once per `wait` duration; 8821 * but if you'd like to disable the execution on the leading edge, pass 8822 * `{leading: false}`. To disable execution on the trailing edge, ditto. 8823 * @license https://raw.github.com/jashkenas/underscore/master/LICENSE 8824 * @param {function} func 8825 * @param {number} wait 8826 * @param {Object=} options 8827 * @returns {Function} 8828 */ 8829M.throttle = function (func, wait, options) { 8830 var context = void 0, 8831 args = void 0, 8832 result = void 0; 8833 var timeout = null; 8834 var previous = 0; 8835 options || (options = {}); 8836 var later = function () { 8837 previous = options.leading === false ? 0 : getTime(); 8838 timeout = null; 8839 result = func.apply(context, args); 8840 context = args = null; 8841 }; 8842 return function () { 8843 var now = getTime(); 8844 if (!previous && options.leading === false) previous = now; 8845 var remaining = wait - (now - previous); 8846 context = this; 8847 args = arguments; 8848 if (remaining <= 0) { 8849 clearTimeout(timeout); 8850 timeout = null; 8851 previous = now; 8852 result = func.apply(context, args); 8853 context = args = null; 8854 } else if (!timeout && options.trailing !== false) { 8855 timeout = setTimeout(later, remaining); 8856 } 8857 return result; 8858 }; 8859}; 8860; /* 8861 v2.2.0 8862 2017 Julian Garnier 8863 Released under the MIT license 8864 */ 8865var $jscomp = { scope: {} };$jscomp.defineProperty = "function" == typeof Object.defineProperties ? Object.defineProperty : function (e, r, p) { 8866 if (p.get || p.set) throw new TypeError("ES3 does not support getters and setters.");e != Array.prototype && e != Object.prototype && (e[r] = p.value); 8867};$jscomp.getGlobal = function (e) { 8868 return "undefined" != typeof window && window === e ? e : "undefined" != typeof global && null != global ? global : e; 8869};$jscomp.global = $jscomp.getGlobal(this);$jscomp.SYMBOL_PREFIX = "jscomp_symbol_"; 8870$jscomp.initSymbol = function () { 8871 $jscomp.initSymbol = function () {};$jscomp.global.Symbol || ($jscomp.global.Symbol = $jscomp.Symbol); 8872};$jscomp.symbolCounter_ = 0;$jscomp.Symbol = function (e) { 8873 return $jscomp.SYMBOL_PREFIX + (e || "") + $jscomp.symbolCounter_++; 8874}; 8875$jscomp.initSymbolIterator = function () { 8876 $jscomp.initSymbol();var e = $jscomp.global.Symbol.iterator;e || (e = $jscomp.global.Symbol.iterator = $jscomp.global.Symbol("iterator"));"function" != typeof Array.prototype[e] && $jscomp.defineProperty(Array.prototype, e, { configurable: !0, writable: !0, value: function () { 8877 return $jscomp.arrayIterator(this); 8878 } });$jscomp.initSymbolIterator = function () {}; 8879};$jscomp.arrayIterator = function (e) { 8880 var r = 0;return $jscomp.iteratorPrototype(function () { 8881 return r < e.length ? { done: !1, value: e[r++] } : { done: !0 }; 8882 }); 8883}; 8884$jscomp.iteratorPrototype = function (e) { 8885 $jscomp.initSymbolIterator();e = { next: e };e[$jscomp.global.Symbol.iterator] = function () { 8886 return this; 8887 };return e; 8888};$jscomp.array = $jscomp.array || {};$jscomp.iteratorFromArray = function (e, r) { 8889 $jscomp.initSymbolIterator();e instanceof String && (e += "");var p = 0, 8890 m = { next: function () { 8891 if (p < e.length) { 8892 var u = p++;return { value: r(u, e[u]), done: !1 }; 8893 }m.next = function () { 8894 return { done: !0, value: void 0 }; 8895 };return m.next(); 8896 } };m[Symbol.iterator] = function () { 8897 return m; 8898 };return m; 8899}; 8900$jscomp.polyfill = function (e, r, p, m) { 8901 if (r) { 8902 p = $jscomp.global;e = e.split(".");for (m = 0; m < e.length - 1; m++) { 8903 var u = e[m];u in p || (p[u] = {});p = p[u]; 8904 }e = e[e.length - 1];m = p[e];r = r(m);r != m && null != r && $jscomp.defineProperty(p, e, { configurable: !0, writable: !0, value: r }); 8905 } 8906};$jscomp.polyfill("Array.prototype.keys", function (e) { 8907 return e ? e : function () { 8908 return $jscomp.iteratorFromArray(this, function (e) { 8909 return e; 8910 }); 8911 }; 8912}, "es6-impl", "es3");var $jscomp$this = this; 8913(function (r) { 8914 M.anime = r(); 8915})(function () { 8916 function e(a) { 8917 if (!h.col(a)) try { 8918 return document.querySelectorAll(a); 8919 } catch (c) {} 8920 }function r(a, c) { 8921 for (var d = a.length, b = 2 <= arguments.length ? arguments[1] : void 0, f = [], n = 0; n < d; n++) { 8922 if (n in a) { 8923 var k = a[n];c.call(b, k, n, a) && f.push(k); 8924 } 8925 }return f; 8926 }function p(a) { 8927 return a.reduce(function (a, d) { 8928 return a.concat(h.arr(d) ? p(d) : d); 8929 }, []); 8930 }function m(a) { 8931 if (h.arr(a)) return a; 8932 h.str(a) && (a = e(a) || a);return a instanceof NodeList || a instanceof HTMLCollection ? [].slice.call(a) : [a]; 8933 }function u(a, c) { 8934 return a.some(function (a) { 8935 return a === c; 8936 }); 8937 }function C(a) { 8938 var c = {}, 8939 d;for (d in a) { 8940 c[d] = a[d]; 8941 }return c; 8942 }function D(a, c) { 8943 var d = C(a), 8944 b;for (b in a) { 8945 d[b] = c.hasOwnProperty(b) ? c[b] : a[b]; 8946 }return d; 8947 }function z(a, c) { 8948 var d = C(a), 8949 b;for (b in c) { 8950 d[b] = h.und(a[b]) ? c[b] : a[b]; 8951 }return d; 8952 }function T(a) { 8953 a = a.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i, function (a, c, d, k) { 8954 return c + c + d + d + k + k; 8955 });var c = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(a); 8956 a = parseInt(c[1], 16);var d = parseInt(c[2], 16), 8957 c = parseInt(c[3], 16);return "rgba(" + a + "," + d + "," + c + ",1)"; 8958 }function U(a) { 8959 function c(a, c, b) { 8960 0 > b && (b += 1);1 < b && --b;return b < 1 / 6 ? a + 6 * (c - a) * b : .5 > b ? c : b < 2 / 3 ? a + (c - a) * (2 / 3 - b) * 6 : a; 8961 }var d = /hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(a) || /hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g.exec(a);a = parseInt(d[1]) / 360;var b = parseInt(d[2]) / 100, 8962 f = parseInt(d[3]) / 100, 8963 d = d[4] || 1;if (0 == b) f = b = a = f;else { 8964 var n = .5 > f ? f * (1 + b) : f + b - f * b, 8965 k = 2 * f - n, 8966 f = c(k, n, a + 1 / 3), 8967 b = c(k, n, a);a = c(k, n, a - 1 / 3); 8968 }return "rgba(" + 255 * f + "," + 255 * b + "," + 255 * a + "," + d + ")"; 8969 }function y(a) { 8970 if (a = /([\+\-]?[0-9#\.]+)(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(a)) return a[2]; 8971 }function V(a) { 8972 if (-1 < a.indexOf("translate") || "perspective" === a) return "px";if (-1 < a.indexOf("rotate") || -1 < a.indexOf("skew")) return "deg"; 8973 }function I(a, c) { 8974 return h.fnc(a) ? a(c.target, c.id, c.total) : a; 8975 }function E(a, c) { 8976 if (c in a.style) return getComputedStyle(a).getPropertyValue(c.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase()) || "0"; 8977 }function J(a, c) { 8978 if (h.dom(a) && u(W, c)) return "transform";if (h.dom(a) && (a.getAttribute(c) || h.svg(a) && a[c])) return "attribute";if (h.dom(a) && "transform" !== c && E(a, c)) return "css";if (null != a[c]) return "object"; 8979 }function X(a, c) { 8980 var d = V(c), 8981 d = -1 < c.indexOf("scale") ? 1 : 0 + d;a = a.style.transform;if (!a) return d;for (var b = [], f = [], n = [], k = /(\w+)\((.+?)\)/g; b = k.exec(a);) { 8982 f.push(b[1]), n.push(b[2]); 8983 }a = r(n, function (a, b) { 8984 return f[b] === c; 8985 });return a.length ? a[0] : d; 8986 }function K(a, c) { 8987 switch (J(a, c)) {case "transform": 8988 return X(a, c);case "css": 8989 return E(a, c);case "attribute": 8990 return a.getAttribute(c);}return a[c] || 0; 8991 }function L(a, c) { 8992 var d = /^(\*=|\+=|-=)/.exec(a);if (!d) return a;var b = y(a) || 0;c = parseFloat(c);a = parseFloat(a.replace(d[0], ""));switch (d[0][0]) {case "+": 8993 return c + a + b;case "-": 8994 return c - a + b;case "*": 8995 return c * a + b;} 8996 }function F(a, c) { 8997 return Math.sqrt(Math.pow(c.x - a.x, 2) + Math.pow(c.y - a.y, 2)); 8998 }function M(a) { 8999 a = a.points;for (var c = 0, d, b = 0; b < a.numberOfItems; b++) { 9000 var f = a.getItem(b);0 < b && (c += F(d, f));d = f; 9001 }return c; 9002 }function N(a) { 9003 if (a.getTotalLength) return a.getTotalLength();switch (a.tagName.toLowerCase()) {case "circle": 9004 return 2 * Math.PI * a.getAttribute("r");case "rect": 9005 return 2 * a.getAttribute("width") + 2 * a.getAttribute("height");case "line": 9006 return F({ x: a.getAttribute("x1"), y: a.getAttribute("y1") }, { x: a.getAttribute("x2"), y: a.getAttribute("y2") });case "polyline": 9007 return M(a);case "polygon": 9008 var c = a.points;return M(a) + F(c.getItem(c.numberOfItems - 1), c.getItem(0));} 9009 }function Y(a, c) { 9010 function d(b) { 9011 b = void 0 === b ? 0 : b;return a.el.getPointAtLength(1 <= c + b ? c + b : 0); 9012 }var b = d(), 9013 f = d(-1), 9014 n = d(1);switch (a.property) {case "x": 9015 return b.x;case "y": 9016 return b.y; 9017 case "angle": 9018 return 180 * Math.atan2(n.y - f.y, n.x - f.x) / Math.PI;} 9019 }function O(a, c) { 9020 var d = /-?\d*\.?\d+/g, 9021 b;b = h.pth(a) ? a.totalLength : a;if (h.col(b)) { 9022 if (h.rgb(b)) { 9023 var f = /rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g.exec(b);b = f ? "rgba(" + f[1] + ",1)" : b; 9024 } else b = h.hex(b) ? T(b) : h.hsl(b) ? U(b) : void 0; 9025 } else f = (f = y(b)) ? b.substr(0, b.length - f.length) : b, b = c && !/\s/g.test(b) ? f + c : f;b += "";return { original: b, numbers: b.match(d) ? b.match(d).map(Number) : [0], strings: h.str(a) || c ? b.split(d) : [] }; 9026 }function P(a) { 9027 a = a ? p(h.arr(a) ? a.map(m) : m(a)) : [];return r(a, function (a, d, b) { 9028 return b.indexOf(a) === d; 9029 }); 9030 }function Z(a) { 9031 var c = P(a);return c.map(function (a, b) { 9032 return { target: a, id: b, total: c.length }; 9033 }); 9034 }function aa(a, c) { 9035 var d = C(c);if (h.arr(a)) { 9036 var b = a.length;2 !== b || h.obj(a[0]) ? h.fnc(c.duration) || (d.duration = c.duration / b) : a = { value: a }; 9037 }return m(a).map(function (a, b) { 9038 b = b ? 0 : c.delay;a = h.obj(a) && !h.pth(a) ? a : { value: a };h.und(a.delay) && (a.delay = b);return a; 9039 }).map(function (a) { 9040 return z(a, d); 9041 }); 9042 }function ba(a, c) { 9043 var d = {}, 9044 b;for (b in a) { 9045 var f = I(a[b], c);h.arr(f) && (f = f.map(function (a) { 9046 return I(a, c); 9047 }), 1 === f.length && (f = f[0]));d[b] = f; 9048 }d.duration = parseFloat(d.duration);d.delay = parseFloat(d.delay);return d; 9049 }function ca(a) { 9050 return h.arr(a) ? A.apply(this, a) : Q[a]; 9051 }function da(a, c) { 9052 var d;return a.tweens.map(function (b) { 9053 b = ba(b, c);var f = b.value, 9054 e = K(c.target, a.name), 9055 k = d ? d.to.original : e, 9056 k = h.arr(f) ? f[0] : k, 9057 w = L(h.arr(f) ? f[1] : f, k), 9058 e = y(w) || y(k) || y(e);b.from = O(k, e);b.to = O(w, e);b.start = d ? d.end : a.offset;b.end = b.start + b.delay + b.duration;b.easing = ca(b.easing);b.elasticity = (1E3 - Math.min(Math.max(b.elasticity, 1), 999)) / 1E3;b.isPath = h.pth(f);b.isColor = h.col(b.from.original);b.isColor && (b.round = 1);return d = b; 9059 }); 9060 }function ea(a, c) { 9061 return r(p(a.map(function (a) { 9062 return c.map(function (b) { 9063 var c = J(a.target, b.name);if (c) { 9064 var d = da(b, a);b = { type: c, property: b.name, animatable: a, tweens: d, duration: d[d.length - 1].end, delay: d[0].delay }; 9065 } else b = void 0;return b; 9066 }); 9067 })), function (a) { 9068 return !h.und(a); 9069 }); 9070 }function R(a, c, d, b) { 9071 var f = "delay" === a;return c.length ? (f ? Math.min : Math.max).apply(Math, c.map(function (b) { 9072 return b[a]; 9073 })) : f ? b.delay : d.offset + b.delay + b.duration; 9074 }function fa(a) { 9075 var c = D(ga, a), 9076 d = D(S, a), 9077 b = Z(a.targets), 9078 f = [], 9079 e = z(c, d), 9080 k;for (k in a) { 9081 e.hasOwnProperty(k) || "targets" === k || f.push({ name: k, offset: e.offset, tweens: aa(a[k], d) }); 9082 }a = ea(b, f);return z(c, { children: [], animatables: b, animations: a, duration: R("duration", a, c, d), delay: R("delay", a, c, d) }); 9083 }function q(a) { 9084 function c() { 9085 return window.Promise && new Promise(function (a) { 9086 return p = a; 9087 }); 9088 }function d(a) { 9089 return g.reversed ? g.duration - a : a; 9090 }function b(a) { 9091 for (var b = 0, c = {}, d = g.animations, f = d.length; b < f;) { 9092 var e = d[b], 9093 k = e.animatable, 9094 h = e.tweens, 9095 n = h.length - 1, 9096 l = h[n];n && (l = r(h, function (b) { 9097 return a < b.end; 9098 })[0] || l);for (var h = Math.min(Math.max(a - l.start - l.delay, 0), l.duration) / l.duration, w = isNaN(h) ? 1 : l.easing(h, l.elasticity), h = l.to.strings, p = l.round, n = [], m = void 0, m = l.to.numbers.length, t = 0; t < m; t++) { 9099 var x = void 0, 9100 x = l.to.numbers[t], 9101 q = l.from.numbers[t], 9102 x = l.isPath ? Y(l.value, w * x) : q + w * (x - q);p && (l.isColor && 2 < t || (x = Math.round(x * p) / p));n.push(x); 9103 }if (l = h.length) for (m = h[0], w = 0; w < l; w++) { 9104 p = h[w + 1], t = n[w], isNaN(t) || (m = p ? m + (t + p) : m + (t + " ")); 9105 } else m = n[0];ha[e.type](k.target, e.property, m, c, k.id);e.currentValue = m;b++; 9106 }if (b = Object.keys(c).length) for (d = 0; d < b; d++) { 9107 H || (H = E(document.body, "transform") ? "transform" : "-webkit-transform"), g.animatables[d].target.style[H] = c[d].join(" "); 9108 }g.currentTime = a;g.progress = a / g.duration * 100; 9109 }function f(a) { 9110 if (g[a]) g[a](g); 9111 }function e() { 9112 g.remaining && !0 !== g.remaining && g.remaining--; 9113 }function k(a) { 9114 var k = g.duration, 9115 n = g.offset, 9116 w = n + g.delay, 9117 r = g.currentTime, 9118 x = g.reversed, 9119 q = d(a);if (g.children.length) { 9120 var u = g.children, 9121 v = u.length; 9122 if (q >= g.currentTime) for (var G = 0; G < v; G++) { 9123 u[G].seek(q); 9124 } else for (; v--;) { 9125 u[v].seek(q); 9126 } 9127 }if (q >= w || !k) g.began || (g.began = !0, f("begin")), f("run");if (q > n && q < k) b(q);else if (q <= n && 0 !== r && (b(0), x && e()), q >= k && r !== k || !k) b(k), x || e();f("update");a >= k && (g.remaining ? (t = h, "alternate" === g.direction && (g.reversed = !g.reversed)) : (g.pause(), g.completed || (g.completed = !0, f("complete"), "Promise" in window && (p(), m = c()))), l = 0); 9128 }a = void 0 === a ? {} : a;var h, 9129 t, 9130 l = 0, 9131 p = null, 9132 m = c(), 9133 g = fa(a);g.reset = function () { 9134 var a = g.direction, 9135 c = g.loop;g.currentTime = 0;g.progress = 0;g.paused = !0;g.began = !1;g.completed = !1;g.reversed = "reverse" === a;g.remaining = "alternate" === a && 1 === c ? 2 : c;b(0);for (a = g.children.length; a--;) { 9136 g.children[a].reset(); 9137 } 9138 };g.tick = function (a) { 9139 h = a;t || (t = h);k((l + h - t) * q.speed); 9140 };g.seek = function (a) { 9141 k(d(a)); 9142 };g.pause = function () { 9143 var a = v.indexOf(g);-1 < a && v.splice(a, 1);g.paused = !0; 9144 };g.play = function () { 9145 g.paused && (g.paused = !1, t = 0, l = d(g.currentTime), v.push(g), B || ia()); 9146 };g.reverse = function () { 9147 g.reversed = !g.reversed;t = 0;l = d(g.currentTime); 9148 };g.restart = function () { 9149 g.pause(); 9150 g.reset();g.play(); 9151 };g.finished = m;g.reset();g.autoplay && g.play();return g; 9152 }var ga = { update: void 0, begin: void 0, run: void 0, complete: void 0, loop: 1, direction: "normal", autoplay: !0, offset: 0 }, 9153 S = { duration: 1E3, delay: 0, easing: "easeOutElastic", elasticity: 500, round: 0 }, 9154 W = "translateX translateY translateZ rotate rotateX rotateY rotateZ scale scaleX scaleY scaleZ skewX skewY perspective".split(" "), 9155 H, 9156 h = { arr: function (a) { 9157 return Array.isArray(a); 9158 }, obj: function (a) { 9159 return -1 < Object.prototype.toString.call(a).indexOf("Object"); 9160 }, 9161 pth: function (a) { 9162 return h.obj(a) && a.hasOwnProperty("totalLength"); 9163 }, svg: function (a) { 9164 return a instanceof SVGElement; 9165 }, dom: function (a) { 9166 return a.nodeType || h.svg(a); 9167 }, str: function (a) { 9168 return "string" === typeof a; 9169 }, fnc: function (a) { 9170 return "function" === typeof a; 9171 }, und: function (a) { 9172 return "undefined" === typeof a; 9173 }, hex: function (a) { 9174 return (/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(a) 9175 ); 9176 }, rgb: function (a) { 9177 return (/^rgb/.test(a) 9178 ); 9179 }, hsl: function (a) { 9180 return (/^hsl/.test(a) 9181 ); 9182 }, col: function (a) { 9183 return h.hex(a) || h.rgb(a) || h.hsl(a); 9184 } }, 9185 A = function () { 9186 function a(a, d, b) { 9187 return (((1 - 3 * b + 3 * d) * a + (3 * b - 6 * d)) * a + 3 * d) * a; 9188 }return function (c, d, b, f) { 9189 if (0 <= c && 1 >= c && 0 <= b && 1 >= b) { 9190 var e = new Float32Array(11);if (c !== d || b !== f) for (var k = 0; 11 > k; ++k) { 9191 e[k] = a(.1 * k, c, b); 9192 }return function (k) { 9193 if (c === d && b === f) return k;if (0 === k) return 0;if (1 === k) return 1;for (var h = 0, l = 1; 10 !== l && e[l] <= k; ++l) { 9194 h += .1; 9195 }--l;var l = h + (k - e[l]) / (e[l + 1] - e[l]) * .1, 9196 n = 3 * (1 - 3 * b + 3 * c) * l * l + 2 * (3 * b - 6 * c) * l + 3 * c;if (.001 <= n) { 9197 for (h = 0; 4 > h; ++h) { 9198 n = 3 * (1 - 3 * b + 3 * c) * l * l + 2 * (3 * b - 6 * c) * l + 3 * c;if (0 === n) break;var m = a(l, c, b) - k, 9199 l = l - m / n; 9200 }k = l; 9201 } else if (0 === n) k = l;else { 9202 var l = h, 9203 h = h + .1, 9204 g = 0;do { 9205 m = l + (h - l) / 2, n = a(m, c, b) - k, 0 < n ? h = m : l = m; 9206 } while (1e-7 < Math.abs(n) && 10 > ++g);k = m; 9207 }return a(k, d, f); 9208 }; 9209 } 9210 }; 9211 }(), 9212 Q = function () { 9213 function a(a, b) { 9214 return 0 === a || 1 === a ? a : -Math.pow(2, 10 * (a - 1)) * Math.sin(2 * (a - 1 - b / (2 * Math.PI) * Math.asin(1)) * Math.PI / b); 9215 }var c = "Quad Cubic Quart Quint Sine Expo Circ Back Elastic".split(" "), 9216 d = { In: [[.55, .085, .68, .53], [.55, .055, .675, .19], [.895, .03, .685, .22], [.755, .05, .855, .06], [.47, 0, .745, .715], [.95, .05, .795, .035], [.6, .04, .98, .335], [.6, -.28, .735, .045], a], Out: [[.25, .46, .45, .94], [.215, .61, .355, 1], [.165, .84, .44, 1], [.23, 1, .32, 1], [.39, .575, .565, 1], [.19, 1, .22, 1], [.075, .82, .165, 1], [.175, .885, .32, 1.275], function (b, c) { 9217 return 1 - a(1 - b, c); 9218 }], InOut: [[.455, .03, .515, .955], [.645, .045, .355, 1], [.77, 0, .175, 1], [.86, 0, .07, 1], [.445, .05, .55, .95], [1, 0, 0, 1], [.785, .135, .15, .86], [.68, -.55, .265, 1.55], function (b, c) { 9219 return .5 > b ? a(2 * b, c) / 2 : 1 - a(-2 * b + 2, c) / 2; 9220 }] }, 9221 b = { linear: A(.25, .25, .75, .75) }, 9222 f = {}, 9223 e;for (e in d) { 9224 f.type = e, d[f.type].forEach(function (a) { 9225 return function (d, f) { 9226 b["ease" + a.type + c[f]] = h.fnc(d) ? d : A.apply($jscomp$this, d); 9227 }; 9228 }(f)), f = { type: f.type }; 9229 }return b; 9230 }(), 9231 ha = { css: function (a, c, d) { 9232 return a.style[c] = d; 9233 }, attribute: function (a, c, d) { 9234 return a.setAttribute(c, d); 9235 }, object: function (a, c, d) { 9236 return a[c] = d; 9237 }, transform: function (a, c, d, b, f) { 9238 b[f] || (b[f] = []);b[f].push(c + "(" + d + ")"); 9239 } }, 9240 v = [], 9241 B = 0, 9242 ia = function () { 9243 function a() { 9244 B = requestAnimationFrame(c); 9245 }function c(c) { 9246 var b = v.length;if (b) { 9247 for (var d = 0; d < b;) { 9248 v[d] && v[d].tick(c), d++; 9249 }a(); 9250 } else cancelAnimationFrame(B), B = 0; 9251 }return a; 9252 }();q.version = "2.2.0";q.speed = 1;q.running = v;q.remove = function (a) { 9253 a = P(a);for (var c = v.length; c--;) { 9254 for (var d = v[c], b = d.animations, f = b.length; f--;) { 9255 u(a, b[f].animatable.target) && (b.splice(f, 1), b.length || d.pause()); 9256 } 9257 } 9258 };q.getValue = K;q.path = function (a, c) { 9259 var d = h.str(a) ? e(a)[0] : a, 9260 b = c || 100;return function (a) { 9261 return { el: d, property: a, totalLength: N(d) * (b / 100) }; 9262 }; 9263 };q.setDashoffset = function (a) { 9264 var c = N(a);a.setAttribute("stroke-dasharray", c);return c; 9265 };q.bezier = A;q.easings = Q;q.timeline = function (a) { 9266 var c = q(a);c.pause();c.duration = 0;c.add = function (d) { 9267 c.children.forEach(function (a) { 9268 a.began = !0;a.completed = !0; 9269 });m(d).forEach(function (b) { 9270 var d = z(b, D(S, a || {}));d.targets = d.targets || a.targets;b = c.duration;var e = d.offset;d.autoplay = !1;d.direction = c.direction;d.offset = h.und(e) ? b : L(e, b);c.began = !0;c.completed = !0;c.seek(d.offset);d = q(d);d.began = !0;d.completed = !0;d.duration > b && (c.duration = d.duration);c.children.push(d); 9271 });c.seek(0);c.reset();c.autoplay && c.restart();return c; 9272 };return c; 9273 };q.random = function (a, c) { 9274 return Math.floor(Math.random() * (c - a + 1)) + a; 9275 };return q; 9276}); 9277;(function ($, anim) { 9278 'use strict'; 9279 9280 var _defaults = { 9281 accordion: true, 9282 onOpenStart: undefined, 9283 onOpenEnd: undefined, 9284 onCloseStart: undefined, 9285 onCloseEnd: undefined, 9286 inDuration: 300, 9287 outDuration: 300 9288 }; 9289 9290 /** 9291 * @class 9292 * 9293 */ 9294 9295 var Collapsible = function (_Component) { 9296 _inherits(Collapsible, _Component); 9297 9298 /** 9299 * Construct Collapsible instance 9300 * @constructor 9301 * @param {Element} el 9302 * @param {Object} options 9303 */ 9304 function Collapsible(el, options) { 9305 _classCallCheck(this, Collapsible); 9306 9307 var _this3 = _possibleConstructorReturn(this, (Collapsible.__proto__ || Object.getPrototypeOf(Collapsible)).call(this, Collapsible, el, options)); 9308 9309 _this3.el.M_Collapsible = _this3; 9310 9311 /** 9312 * Options for the collapsible 9313 * @member Collapsible#options 9314 * @prop {Boolean} [accordion=false] - Type of the collapsible 9315 * @prop {Function} onOpenStart - Callback function called before collapsible is opened 9316 * @prop {Function} onOpenEnd - Callback function called after collapsible is opened 9317 * @prop {Function} onCloseStart - Callback function called before collapsible is closed 9318 * @prop {Function} onCloseEnd - Callback function called after collapsible is closed 9319 * @prop {Number} inDuration - Transition in duration in milliseconds. 9320 * @prop {Number} outDuration - Transition duration in milliseconds. 9321 */ 9322 _this3.options = $.extend({}, Collapsible.defaults, options); 9323 9324 // Setup tab indices 9325 _this3.$headers = _this3.$el.children('li').children('.collapsible-header'); 9326 _this3.$headers.attr('tabindex', 0); 9327 9328 _this3._setupEventHandlers(); 9329 9330 // Open first active 9331 var $activeBodies = _this3.$el.children('li.active').children('.collapsible-body'); 9332 if (_this3.options.accordion) { 9333 // Handle Accordion 9334 $activeBodies.first().css('display', 'block'); 9335 } else { 9336 // Handle Expandables 9337 $activeBodies.css('display', 'block'); 9338 } 9339 return _this3; 9340 } 9341 9342 _createClass(Collapsible, [{ 9343 key: "destroy", 9344 9345 9346 /** 9347 * Teardown component 9348 */ 9349 value: function destroy() { 9350 this._removeEventHandlers(); 9351 this.el.M_Collapsible = undefined; 9352 } 9353 9354 /** 9355 * Setup Event Handlers 9356 */ 9357 9358 }, { 9359 key: "_setupEventHandlers", 9360 value: function _setupEventHandlers() { 9361 var _this4 = this; 9362 9363 this._handleCollapsibleClickBound = this._handleCollapsibleClick.bind(this); 9364 this._handleCollapsibleKeydownBound = this._handleCollapsibleKeydown.bind(this); 9365 this.el.addEventListener('click', this._handleCollapsibleClickBound); 9366 this.$headers.each(function (header) { 9367 header.addEventListener('keydown', _this4._handleCollapsibleKeydownBound); 9368 }); 9369 } 9370 9371 /** 9372 * Remove Event Handlers 9373 */ 9374 9375 }, { 9376 key: "_removeEventHandlers", 9377 value: function _removeEventHandlers() { 9378 var _this5 = this; 9379 9380 this.el.removeEventListener('click', this._handleCollapsibleClickBound); 9381 this.$headers.each(function (header) { 9382 header.removeEventListener('keydown', _this5._handleCollapsibleKeydownBound); 9383 }); 9384 } 9385 9386 /** 9387 * Handle Collapsible Click 9388 * @param {Event} e 9389 */ 9390 9391 }, { 9392 key: "_handleCollapsibleClick", 9393 value: function _handleCollapsibleClick(e) { 9394 var $header = $(e.target).closest('.collapsible-header'); 9395 if (e.target && $header.length) { 9396 var $collapsible = $header.closest('.collapsible'); 9397 if ($collapsible[0] === this.el) { 9398 var $collapsibleLi = $header.closest('li'); 9399 var $collapsibleLis = $collapsible.children('li'); 9400 var isActive = $collapsibleLi[0].classList.contains('active'); 9401 var index = $collapsibleLis.index($collapsibleLi); 9402 9403 if (isActive) { 9404 this.close(index); 9405 } else { 9406 this.open(index); 9407 } 9408 } 9409 } 9410 } 9411 9412 /** 9413 * Handle Collapsible Keydown 9414 * @param {Event} e 9415 */ 9416 9417 }, { 9418 key: "_handleCollapsibleKeydown", 9419 value: function _handleCollapsibleKeydown(e) { 9420 if (e.keyCode === 13) { 9421 this._handleCollapsibleClickBound(e); 9422 } 9423 } 9424 9425 /** 9426 * Animate in collapsible slide 9427 * @param {Number} index - 0th index of slide 9428 */ 9429 9430 }, { 9431 key: "_animateIn", 9432 value: function _animateIn(index) { 9433 var _this6 = this; 9434 9435 var $collapsibleLi = this.$el.children('li').eq(index); 9436 if ($collapsibleLi.length) { 9437 var $body = $collapsibleLi.children('.collapsible-body'); 9438 9439 anim.remove($body[0]); 9440 $body.css({ 9441 display: 'block', 9442 overflow: 'hidden', 9443 height: 0, 9444 paddingTop: '', 9445 paddingBottom: '' 9446 }); 9447 9448 var pTop = $body.css('padding-top'); 9449 var pBottom = $body.css('padding-bottom'); 9450 var finalHeight = $body[0].scrollHeight; 9451 $body.css({ 9452 paddingTop: 0, 9453 paddingBottom: 0 9454 }); 9455 9456 anim({ 9457 targets: $body[0], 9458 height: finalHeight, 9459 paddingTop: pTop, 9460 paddingBottom: pBottom, 9461 duration: this.options.inDuration, 9462 easing: 'easeInOutCubic', 9463 complete: function (anim) { 9464 $body.css({ 9465 overflow: '', 9466 paddingTop: '', 9467 paddingBottom: '', 9468 height: '' 9469 }); 9470 9471 // onOpenEnd callback 9472 if (typeof _this6.options.onOpenEnd === 'function') { 9473 _this6.options.onOpenEnd.call(_this6, $collapsibleLi[0]); 9474 } 9475 } 9476 }); 9477 } 9478 } 9479 9480 /** 9481 * Animate out collapsible slide 9482 * @param {Number} index - 0th index of slide to open 9483 */ 9484 9485 }, { 9486 key: "_animateOut", 9487 value: function _animateOut(index) { 9488 var _this7 = this; 9489 9490 var $collapsibleLi = this.$el.children('li').eq(index); 9491 if ($collapsibleLi.length) { 9492 var $body = $collapsibleLi.children('.collapsible-body'); 9493 anim.remove($body[0]); 9494 $body.css('overflow', 'hidden'); 9495 anim({ 9496 targets: $body[0], 9497 height: 0, 9498 paddingTop: 0, 9499 paddingBottom: 0, 9500 duration: this.options.outDuration, 9501 easing: 'easeInOutCubic', 9502 complete: function () { 9503 $body.css({ 9504 height: '', 9505 overflow: '', 9506 padding: '', 9507 display: '' 9508 }); 9509 9510 // onCloseEnd callback 9511 if (typeof _this7.options.onCloseEnd === 'function') { 9512 _this7.options.onCloseEnd.call(_this7, $collapsibleLi[0]); 9513 } 9514 } 9515 }); 9516 } 9517 } 9518 9519 /** 9520 * Open Collapsible 9521 * @param {Number} index - 0th index of slide 9522 */ 9523 9524 }, { 9525 key: "open", 9526 value: function open(index) { 9527 var _this8 = this; 9528 9529 var $collapsibleLi = this.$el.children('li').eq(index); 9530 if ($collapsibleLi.length && !$collapsibleLi[0].classList.contains('active')) { 9531 // onOpenStart callback 9532 if (typeof this.options.onOpenStart === 'function') { 9533 this.options.onOpenStart.call(this, $collapsibleLi[0]); 9534 } 9535 9536 // Handle accordion behavior 9537 if (this.options.accordion) { 9538 var $collapsibleLis = this.$el.children('li'); 9539 var $activeLis = this.$el.children('li.active'); 9540 $activeLis.each(function (el) { 9541 var index = $collapsibleLis.index($(el)); 9542 _this8.close(index); 9543 }); 9544 } 9545 9546 // Animate in 9547 $collapsibleLi[0].classList.add('active'); 9548 this._animateIn(index); 9549 } 9550 } 9551 9552 /** 9553 * Close Collapsible 9554 * @param {Number} index - 0th index of slide 9555 */ 9556 9557 }, { 9558 key: "close", 9559 value: function close(index) { 9560 var $collapsibleLi = this.$el.children('li').eq(index); 9561 if ($collapsibleLi.length && $collapsibleLi[0].classList.contains('active')) { 9562 // onCloseStart callback 9563 if (typeof this.options.onCloseStart === 'function') { 9564 this.options.onCloseStart.call(this, $collapsibleLi[0]); 9565 } 9566 9567 // Animate out 9568 $collapsibleLi[0].classList.remove('active'); 9569 this._animateOut(index); 9570 } 9571 } 9572 }], [{ 9573 key: "init", 9574 value: function init(els, options) { 9575 return _get(Collapsible.__proto__ || Object.getPrototypeOf(Collapsible), "init", this).call(this, this, els, options); 9576 } 9577 9578 /** 9579 * Get Instance 9580 */ 9581 9582 }, { 9583 key: "getInstance", 9584 value: function getInstance(el) { 9585 var domElem = !!el.jquery ? el[0] : el; 9586 return domElem.M_Collapsible; 9587 } 9588 }, { 9589 key: "defaults", 9590 get: function () { 9591 return _defaults; 9592 } 9593 }]); 9594 9595 return Collapsible; 9596 }(Component); 9597 9598 M.Collapsible = Collapsible; 9599 9600 if (M.jQueryLoaded) { 9601 M.initializeJqueryWrapper(Collapsible, 'collapsible', 'M_Collapsible'); 9602 } 9603})(cash, M.anime); 9604;(function ($, anim) { 9605 'use strict'; 9606 9607 var _defaults = { 9608 alignment: 'left', 9609 autoFocus: true, 9610 constrainWidth: true, 9611 container: null, 9612 coverTrigger: true, 9613 closeOnClick: true, 9614 hover: false, 9615 inDuration: 150, 9616 outDuration: 250, 9617 onOpenStart: null, 9618 onOpenEnd: null, 9619 onCloseStart: null, 9620 onCloseEnd: null, 9621 onItemClick: null 9622 }; 9623 9624 /** 9625 * @class 9626 */ 9627 9628 var Dropdown = function (_Component2) { 9629 _inherits(Dropdown, _Component2); 9630 9631 function Dropdown(el, options) { 9632 _classCallCheck(this, Dropdown); 9633 9634 var _this9 = _possibleConstructorReturn(this, (Dropdown.__proto__ || Object.getPrototypeOf(Dropdown)).call(this, Dropdown, el, options)); 9635 9636 _this9.el.M_Dropdown = _this9; 9637 Dropdown._dropdowns.push(_this9); 9638 9639 _this9.id = M.getIdFromTrigger(el); 9640 _this9.dropdownEl = document.getElementById(_this9.id); 9641 _this9.$dropdownEl = $(_this9.dropdownEl); 9642 9643 /** 9644 * Options for the dropdown 9645 * @member Dropdown#options 9646 * @prop {String} [alignment='left'] - Edge which the dropdown is aligned to 9647 * @prop {Boolean} [autoFocus=true] - Automatically focus dropdown el for keyboard 9648 * @prop {Boolean} [constrainWidth=true] - Constrain width to width of the button 9649 * @prop {Element} container - Container element to attach dropdown to (optional) 9650 * @prop {Boolean} [coverTrigger=true] - Place dropdown over trigger 9651 * @prop {Boolean} [closeOnClick=true] - Close on click of dropdown item 9652 * @prop {Boolean} [hover=false] - Open dropdown on hover 9653 * @prop {Number} [inDuration=150] - Duration of open animation in ms 9654 * @prop {Number} [outDuration=250] - Duration of close animation in ms 9655 * @prop {Function} onOpenStart - Function called when dropdown starts opening 9656 * @prop {Function} onOpenEnd - Function called when dropdown finishes opening 9657 * @prop {Function} onCloseStart - Function called when dropdown starts closing 9658 * @prop {Function} onCloseEnd - Function called when dropdown finishes closing 9659 */ 9660 _this9.options = $.extend({}, Dropdown.defaults, options); 9661 9662 /** 9663 * Describes open/close state of dropdown 9664 * @type {Boolean} 9665 */ 9666 _this9.isOpen = false; 9667 9668 /** 9669 * Describes if dropdown content is scrollable 9670 * @type {Boolean} 9671 */ 9672 _this9.isScrollable = false; 9673 9674 /** 9675 * Describes if touch moving on dropdown content 9676 * @type {Boolean} 9677 */ 9678 _this9.isTouchMoving = false; 9679 9680 _this9.focusedIndex = -1; 9681 _this9.filterQuery = []; 9682 9683 // Move dropdown-content after dropdown-trigger 9684 if (!!_this9.options.container) { 9685 $(_this9.options.container).append(_this9.dropdownEl); 9686 } else { 9687 _this9.$el.after(_this9.dropdownEl); 9688 } 9689 9690 _this9._makeDropdownFocusable(); 9691 _this9._resetFilterQueryBound = _this9._resetFilterQuery.bind(_this9); 9692 _this9._handleDocumentClickBound = _this9._handleDocumentClick.bind(_this9); 9693 _this9._handleDocumentTouchmoveBound = _this9._handleDocumentTouchmove.bind(_this9); 9694 _this9._handleDropdownClickBound = _this9._handleDropdownClick.bind(_this9); 9695 _this9._handleDropdownKeydownBound = _this9._handleDropdownKeydown.bind(_this9); 9696 _this9._handleTriggerKeydownBound = _this9._handleTriggerKeydown.bind(_this9); 9697 _this9._setupEventHandlers(); 9698 return _this9; 9699 } 9700 9701 _createClass(Dropdown, [{ 9702 key: "destroy", 9703 9704 9705 /** 9706 * Teardown component 9707 */ 9708 value: function destroy() { 9709 this._resetDropdownStyles(); 9710 this._removeEventHandlers(); 9711 Dropdown._dropdowns.splice(Dropdown._dropdowns.indexOf(this), 1); 9712 this.el.M_Dropdown = undefined; 9713 } 9714 9715 /** 9716 * Setup Event Handlers 9717 */ 9718 9719 }, { 9720 key: "_setupEventHandlers", 9721 value: function _setupEventHandlers() { 9722 // Trigger keydown handler 9723 this.el.addEventListener('keydown', this._handleTriggerKeydownBound); 9724 9725 // Item click handler 9726 this.dropdownEl.addEventListener('click', this._handleDropdownClickBound); 9727 9728 // Hover event handlers 9729 if (this.options.hover) { 9730 this._handleMouseEnterBound = this._handleMouseEnter.bind(this); 9731 this.el.addEventListener('mouseenter', this._handleMouseEnterBound); 9732 this._handleMouseLeaveBound = this._handleMouseLeave.bind(this); 9733 this.el.addEventListener('mouseleave', this._handleMouseLeaveBound); 9734 this.dropdownEl.addEventListener('mouseleave', this._handleMouseLeaveBound); 9735 9736 // Click event handlers 9737 } else { 9738 this._handleClickBound = this._handleClick.bind(this); 9739 this.el.addEventListener('click', this._handleClickBound); 9740 } 9741 } 9742 9743 /** 9744 * Remove Event Handlers 9745 */ 9746 9747 }, { 9748 key: "_removeEventHandlers", 9749 value: function _removeEventHandlers() { 9750 this.el.removeEventListener('keydown', this._handleTriggerKeydownBound); 9751 this.dropdownEl.removeEventListener('click', this._handleDropdownClickBound); 9752 9753 if (this.options.hover) { 9754 this.el.removeEventListener('mouseenter', this._handleMouseEnterBound); 9755 this.el.removeEventListener('mouseleave', this._handleMouseLeaveBound); 9756 this.dropdownEl.removeEventListener('mouseleave', this._handleMouseLeaveBound); 9757 } else { 9758 this.el.removeEventListener('click', this._handleClickBound); 9759 } 9760 } 9761 }, { 9762 key: "_setupTemporaryEventHandlers", 9763 value: function _setupTemporaryEventHandlers() { 9764 // Use capture phase event handler to prevent click 9765 document.body.addEventListener('click', this._handleDocumentClickBound, true); 9766 document.body.addEventListener('touchend', this._handleDocumentClickBound); 9767 document.body.addEventListener('touchmove', this._handleDocumentTouchmoveBound); 9768 this.dropdownEl.addEventListener('keydown', this._handleDropdownKeydownBound); 9769 } 9770 }, { 9771 key: "_removeTemporaryEventHandlers", 9772 value: function _removeTemporaryEventHandlers() { 9773 // Use capture phase event handler to prevent click 9774 document.body.removeEventListener('click', this._handleDocumentClickBound, true); 9775 document.body.removeEventListener('touchend', this._handleDocumentClickBound); 9776 document.body.removeEventListener('touchmove', this._handleDocumentTouchmoveBound); 9777 this.dropdownEl.removeEventListener('keydown', this._handleDropdownKeydownBound); 9778 } 9779 }, { 9780 key: "_handleClick", 9781 value: function _handleClick(e) { 9782 e.preventDefault(); 9783 this.open(); 9784 } 9785 }, { 9786 key: "_handleMouseEnter", 9787 value: function _handleMouseEnter() { 9788 this.open(); 9789 } 9790 }, { 9791 key: "_handleMouseLeave", 9792 value: function _handleMouseLeave(e) { 9793 var toEl = e.toElement || e.relatedTarget; 9794 var leaveToDropdownContent = !!$(toEl).closest('.dropdown-content').length; 9795 var leaveToActiveDropdownTrigger = false; 9796 9797 var $closestTrigger = $(toEl).closest('.dropdown-trigger'); 9798 if ($closestTrigger.length && !!$closestTrigger[0].M_Dropdown && $closestTrigger[0].M_Dropdown.isOpen) { 9799 leaveToActiveDropdownTrigger = true; 9800 } 9801 9802 // Close hover dropdown if mouse did not leave to either active dropdown-trigger or dropdown-content 9803 if (!leaveToActiveDropdownTrigger && !leaveToDropdownContent) { 9804 this.close(); 9805 } 9806 } 9807 }, { 9808 key: "_handleDocumentClick", 9809 value: function _handleDocumentClick(e) { 9810 var _this10 = this; 9811 9812 var $target = $(e.target); 9813 if (this.options.closeOnClick && $target.closest('.dropdown-content').length && !this.isTouchMoving) { 9814 // isTouchMoving to check if scrolling on mobile. 9815 setTimeout(function () { 9816 _this10.close(); 9817 }, 0); 9818 } else if ($target.closest('.dropdown-trigger').length || !$target.closest('.dropdown-content').length) { 9819 setTimeout(function () { 9820 _this10.close(); 9821 }, 0); 9822 } 9823 this.isTouchMoving = false; 9824 } 9825 }, { 9826 key: "_handleTriggerKeydown", 9827 value: function _handleTriggerKeydown(e) { 9828 // ARROW DOWN OR ENTER WHEN SELECT IS CLOSED - open Dropdown 9829 if ((e.which === M.keys.ARROW_DOWN || e.which === M.keys.ENTER) && !this.isOpen) { 9830 e.preventDefault(); 9831 this.open(); 9832 } 9833 } 9834 9835 /** 9836 * Handle Document Touchmove 9837 * @param {Event} e 9838 */ 9839 9840 }, { 9841 key: "_handleDocumentTouchmove", 9842 value: function _handleDocumentTouchmove(e) { 9843 var $target = $(e.target); 9844 if ($target.closest('.dropdown-content').length) { 9845 this.isTouchMoving = true; 9846 } 9847 } 9848 9849 /** 9850 * Handle Dropdown Click 9851 * @param {Event} e 9852 */ 9853 9854 }, { 9855 key: "_handleDropdownClick", 9856 value: function _handleDropdownClick(e) { 9857 // onItemClick callback 9858 if (typeof this.options.onItemClick === 'function') { 9859 var itemEl = $(e.target).closest('li')[0]; 9860 this.options.onItemClick.call(this, itemEl); 9861 } 9862 } 9863 9864 /** 9865 * Handle Dropdown Keydown 9866 * @param {Event} e 9867 */ 9868 9869 }, { 9870 key: "_handleDropdownKeydown", 9871 value: function _handleDropdownKeydown(e) { 9872 if (e.which === M.keys.TAB) { 9873 e.preventDefault(); 9874 this.close(); 9875 9876 // Navigate down dropdown list 9877 } else if ((e.which === M.keys.ARROW_DOWN || e.which === M.keys.ARROW_UP) && this.isOpen) { 9878 e.preventDefault(); 9879 var direction = e.which === M.keys.ARROW_DOWN ? 1 : -1; 9880 var newFocusedIndex = this.focusedIndex; 9881 var foundNewIndex = false; 9882 do { 9883 newFocusedIndex = newFocusedIndex + direction; 9884 9885 if (!!this.dropdownEl.children[newFocusedIndex] && this.dropdownEl.children[newFocusedIndex].tabIndex !== -1) { 9886 foundNewIndex = true; 9887 break; 9888 } 9889 } while (newFocusedIndex < this.dropdownEl.children.length && newFocusedIndex >= 0); 9890 9891 if (foundNewIndex) { 9892 this.focusedIndex = newFocusedIndex; 9893 this._focusFocusedItem(); 9894 } 9895 9896 // ENTER selects choice on focused item 9897 } else if (e.which === M.keys.ENTER && this.isOpen) { 9898 // Search for <a> and <button> 9899 var focusedElement = this.dropdownEl.children[this.focusedIndex]; 9900 var $activatableElement = $(focusedElement).find('a, button').first(); 9901 9902 // Click a or button tag if exists, otherwise click li tag 9903 if (!!$activatableElement.length) { 9904 $activatableElement[0].click(); 9905 } else if (!!focusedElement) { 9906 focusedElement.click(); 9907 } 9908 9909 // Close dropdown on ESC 9910 } else if (e.which === M.keys.ESC && this.isOpen) { 9911 e.preventDefault(); 9912 this.close(); 9913 } 9914 9915 // CASE WHEN USER TYPE LETTERS 9916 var letter = String.fromCharCode(e.which).toLowerCase(), 9917 nonLetters = [9, 13, 27, 38, 40]; 9918 if (letter && nonLetters.indexOf(e.which) === -1) { 9919 this.filterQuery.push(letter); 9920 9921 var string = this.filterQuery.join(''), 9922 newOptionEl = $(this.dropdownEl).find('li').filter(function (el) { 9923 return $(el).text().toLowerCase().indexOf(string) === 0; 9924 })[0]; 9925 9926 if (newOptionEl) { 9927 this.focusedIndex = $(newOptionEl).index(); 9928 this._focusFocusedItem(); 9929 } 9930 } 9931 9932 this.filterTimeout = setTimeout(this._resetFilterQueryBound, 1000); 9933 } 9934 9935 /** 9936 * Setup dropdown 9937 */ 9938 9939 }, { 9940 key: "_resetFilterQuery", 9941 value: function _resetFilterQuery() { 9942 this.filterQuery = []; 9943 } 9944 }, { 9945 key: "_resetDropdownStyles", 9946 value: function _resetDropdownStyles() { 9947 this.$dropdownEl.css({ 9948 display: '', 9949 width: '', 9950 height: '', 9951 left: '', 9952 top: '', 9953 'transform-origin': '', 9954 transform: '', 9955 opacity: '' 9956 }); 9957 } 9958 }, { 9959 key: "_makeDropdownFocusable", 9960 value: function _makeDropdownFocusable() { 9961 // Needed for arrow key navigation 9962 this.dropdownEl.tabIndex = 0; 9963 9964 // Only set tabindex if it hasn't been set by user 9965 $(this.dropdownEl).children().each(function (el) { 9966 if (!el.getAttribute('tabindex')) { 9967 el.setAttribute('tabindex', 0); 9968 } 9969 }); 9970 } 9971 }, { 9972 key: "_focusFocusedItem", 9973 value: function _focusFocusedItem() { 9974 if (this.focusedIndex >= 0 && this.focusedIndex < this.dropdownEl.children.length && this.options.autoFocus) { 9975 this.dropdownEl.children[this.focusedIndex].focus(); 9976 } 9977 } 9978 }, { 9979 key: "_getDropdownPosition", 9980 value: function _getDropdownPosition() { 9981 var offsetParentBRect = this.el.offsetParent.getBoundingClientRect(); 9982 var triggerBRect = this.el.getBoundingClientRect(); 9983 var dropdownBRect = this.dropdownEl.getBoundingClientRect(); 9984 9985 var idealHeight = dropdownBRect.height; 9986 var idealWidth = dropdownBRect.width; 9987 var idealXPos = triggerBRect.left - dropdownBRect.left; 9988 var idealYPos = triggerBRect.top - dropdownBRect.top; 9989 9990 var dropdownBounds = { 9991 left: idealXPos, 9992 top: idealYPos, 9993 height: idealHeight, 9994 width: idealWidth 9995 }; 9996 9997 // Countainer here will be closest ancestor with overflow: hidden 9998 var closestOverflowParent = !!this.dropdownEl.offsetParent ? this.dropdownEl.offsetParent : this.dropdownEl.parentNode; 9999 10000 var alignments = M.checkPossibleAlignments(this.el, closestOverflowParent, dropdownBounds, this.options.coverTrigger ? 0 : triggerBRect.height); 10001 10002 var verticalAlignment = 'top'; 10003 var horizontalAlignment = this.options.alignment; 10004 idealYPos += this.options.coverTrigger ? 0 : triggerBRect.height; 10005 10006 // Reset isScrollable 10007 this.isScrollable = false; 10008 10009 if (!alignments.top) { 10010 if (alignments.bottom) { 10011 verticalAlignment = 'bottom'; 10012 } else { 10013 this.isScrollable = true; 10014 10015 // Determine which side has most space and cutoff at correct height 10016 if (alignments.spaceOnTop > alignments.spaceOnBottom) { 10017 verticalAlignment = 'bottom'; 10018 idealHeight += alignments.spaceOnTop; 10019 idealYPos -= alignments.spaceOnTop; 10020 } else { 10021 idealHeight += alignments.spaceOnBottom; 10022 } 10023 } 10024 } 10025 10026 // If preferred horizontal alignment is possible 10027 if (!alignments[horizontalAlignment]) { 10028 var oppositeAlignment = horizontalAlignment === 'left' ? 'right' : 'left'; 10029 if (alignments[oppositeAlignment]) { 10030 horizontalAlignment = oppositeAlignment; 10031 } else { 10032 // Determine which side has most space and cutoff at correct height 10033 if (alignments.spaceOnLeft > alignments.spaceOnRight) { 10034 horizontalAlignment = 'right'; 10035 idealWidth += alignments.spaceOnLeft; 10036 idealXPos -= alignments.spaceOnLeft; 10037 } else { 10038 horizontalAlignment = 'left'; 10039 idealWidth += alignments.spaceOnRight; 10040 } 10041 } 10042 } 10043 10044 if (verticalAlignment === 'bottom') { 10045 idealYPos = idealYPos - dropdownBRect.height + (this.options.coverTrigger ? triggerBRect.height : 0); 10046 } 10047 if (horizontalAlignment === 'right') { 10048 idealXPos = idealXPos - dropdownBRect.width + triggerBRect.width; 10049 } 10050 return { 10051 x: idealXPos, 10052 y: idealYPos, 10053 verticalAlignment: verticalAlignment, 10054 horizontalAlignment: horizontalAlignment, 10055 height: idealHeight, 10056 width: idealWidth 10057 }; 10058 } 10059 10060 /** 10061 * Animate in dropdown 10062 */ 10063 10064 }, { 10065 key: "_animateIn", 10066 value: function _animateIn() { 10067 var _this11 = this; 10068 10069 anim.remove(this.dropdownEl); 10070 anim({ 10071 targets: this.dropdownEl, 10072 opacity: { 10073 value: [0, 1], 10074 easing: 'easeOutQuad' 10075 }, 10076 scaleX: [0.3, 1], 10077 scaleY: [0.3, 1], 10078 duration: this.options.inDuration, 10079 easing: 'easeOutQuint', 10080 complete: function (anim) { 10081 if (_this11.options.autoFocus) { 10082 _this11.dropdownEl.focus(); 10083 } 10084 10085 // onOpenEnd callback 10086 if (typeof _this11.options.onOpenEnd === 'function') { 10087 _this11.options.onOpenEnd.call(_this11, _this11.el); 10088 } 10089 } 10090 }); 10091 } 10092 10093 /** 10094 * Animate out dropdown 10095 */ 10096 10097 }, { 10098 key: "_animateOut", 10099 value: function _animateOut() { 10100 var _this12 = this; 10101 10102 anim.remove(this.dropdownEl); 10103 anim({ 10104 targets: this.dropdownEl, 10105 opacity: { 10106 value: 0, 10107 easing: 'easeOutQuint' 10108 }, 10109 scaleX: 0.3, 10110 scaleY: 0.3, 10111 duration: this.options.outDuration, 10112 easing: 'easeOutQuint', 10113 complete: function (anim) { 10114 _this12._resetDropdownStyles(); 10115 10116 // onCloseEnd callback 10117 if (typeof _this12.options.onCloseEnd === 'function') { 10118 _this12.options.onCloseEnd.call(_this12, _this12.el); 10119 } 10120 } 10121 }); 10122 } 10123 10124 /** 10125 * Place dropdown 10126 */ 10127 10128 }, { 10129 key: "_placeDropdown", 10130 value: function _placeDropdown() { 10131 // Set width before calculating positionInfo 10132 var idealWidth = this.options.constrainWidth ? this.el.getBoundingClientRect().width : this.dropdownEl.getBoundingClientRect().width; 10133 this.dropdownEl.style.width = idealWidth + 'px'; 10134 10135 var positionInfo = this._getDropdownPosition(); 10136 this.dropdownEl.style.left = positionInfo.x + 'px'; 10137 this.dropdownEl.style.top = positionInfo.y + 'px'; 10138 this.dropdownEl.style.height = positionInfo.height + 'px'; 10139 this.dropdownEl.style.width = positionInfo.width + 'px'; 10140 this.dropdownEl.style.transformOrigin = (positionInfo.horizontalAlignment === 'left' ? '0' : '100%') + " " + (positionInfo.verticalAlignment === 'top' ? '0' : '100%'); 10141 } 10142 10143 /** 10144 * Open Dropdown 10145 */ 10146 10147 }, { 10148 key: "open", 10149 value: function open() { 10150 if (this.isOpen) { 10151 return; 10152 } 10153 this.isOpen = true; 10154 10155 // onOpenStart callback 10156 if (typeof this.options.onOpenStart === 'function') { 10157 this.options.onOpenStart.call(this, this.el); 10158 } 10159 10160 // Reset styles 10161 this._resetDropdownStyles(); 10162 this.dropdownEl.style.display = 'block'; 10163 10164 this._placeDropdown(); 10165 this._animateIn(); 10166 this._setupTemporaryEventHandlers(); 10167 } 10168 10169 /** 10170 * Close Dropdown 10171 */ 10172 10173 }, { 10174 key: "close", 10175 value: function close() { 10176 if (!this.isOpen) { 10177 return; 10178 } 10179 this.isOpen = false; 10180 this.focusedIndex = -1; 10181 10182 // onCloseStart callback 10183 if (typeof this.options.onCloseStart === 'function') { 10184 this.options.onCloseStart.call(this, this.el); 10185 } 10186 10187 this._animateOut(); 10188 this._removeTemporaryEventHandlers(); 10189 10190 if (this.options.autoFocus) { 10191 this.el.focus(); 10192 } 10193 } 10194 10195 /** 10196 * Recalculate dimensions 10197 */ 10198 10199 }, { 10200 key: "recalculateDimensions", 10201 value: function recalculateDimensions() { 10202 if (this.isOpen) { 10203 this.$dropdownEl.css({ 10204 width: '', 10205 height: '', 10206 left: '', 10207 top: '', 10208 'transform-origin': '' 10209 }); 10210 this._placeDropdown(); 10211 } 10212 } 10213 }], [{ 10214 key: "init", 10215 value: function init(els, options) { 10216 return _get(Dropdown.__proto__ || Object.getPrototypeOf(Dropdown), "init", this).call(this, this, els, options); 10217 } 10218 10219 /** 10220 * Get Instance 10221 */ 10222 10223 }, { 10224 key: "getInstance", 10225 value: function getInstance(el) { 10226 var domElem = !!el.jquery ? el[0] : el; 10227 return domElem.M_Dropdown; 10228 } 10229 }, { 10230 key: "defaults", 10231 get: function () { 10232 return _defaults; 10233 } 10234 }]); 10235 10236 return Dropdown; 10237 }(Component); 10238 10239 /** 10240 * @static 10241 * @memberof Dropdown 10242 */ 10243 10244 10245 Dropdown._dropdowns = []; 10246 10247 M.Dropdown = Dropdown; 10248 10249 if (M.jQueryLoaded) { 10250 M.initializeJqueryWrapper(Dropdown, 'dropdown', 'M_Dropdown'); 10251 } 10252})(cash, M.anime); 10253;(function ($, anim) { 10254 'use strict'; 10255 10256 var _defaults = { 10257 opacity: 0.5, 10258 inDuration: 250, 10259 outDuration: 250, 10260 onOpenStart: null, 10261 onOpenEnd: null, 10262 onCloseStart: null, 10263 onCloseEnd: null, 10264 preventScrolling: true, 10265 dismissible: true, 10266 startingTop: '4%', 10267 endingTop: '10%' 10268 }; 10269 10270 /** 10271 * @class 10272 * 10273 */ 10274 10275 var Modal = function (_Component3) { 10276 _inherits(Modal, _Component3); 10277 10278 /** 10279 * Construct Modal instance and set up overlay 10280 * @constructor 10281 * @param {Element} el 10282 * @param {Object} options 10283 */ 10284 function Modal(el, options) { 10285 _classCallCheck(this, Modal); 10286 10287 var _this13 = _possibleConstructorReturn(this, (Modal.__proto__ || Object.getPrototypeOf(Modal)).call(this, Modal, el, options)); 10288 10289 _this13.el.M_Modal = _this13; 10290 10291 /** 10292 * Options for the modal 10293 * @member Modal#options 10294 * @prop {Number} [opacity=0.5] - Opacity of the modal overlay 10295 * @prop {Number} [inDuration=250] - Length in ms of enter transition 10296 * @prop {Number} [outDuration=250] - Length in ms of exit transition 10297 * @prop {Function} onOpenStart - Callback function called before modal is opened 10298 * @prop {Function} onOpenEnd - Callback function called after modal is opened 10299 * @prop {Function} onCloseStart - Callback function called before modal is closed 10300 * @prop {Function} onCloseEnd - Callback function called after modal is closed 10301 * @prop {Boolean} [dismissible=true] - Allow modal to be dismissed by keyboard or overlay click 10302 * @prop {String} [startingTop='4%'] - startingTop 10303 * @prop {String} [endingTop='10%'] - endingTop 10304 */ 10305 _this13.options = $.extend({}, Modal.defaults, options); 10306 10307 /** 10308 * Describes open/close state of modal 10309 * @type {Boolean} 10310 */ 10311 _this13.isOpen = false; 10312 10313 _this13.id = _this13.$el.attr('id'); 10314 _this13._openingTrigger = undefined; 10315 _this13.$overlay = $('<div class="modal-overlay"></div>'); 10316 _this13.el.tabIndex = 0; 10317 _this13._nthModalOpened = 0; 10318 10319 Modal._count++; 10320 _this13._setupEventHandlers(); 10321 return _this13; 10322 } 10323 10324 _createClass(Modal, [{ 10325 key: "destroy", 10326 10327 10328 /** 10329 * Teardown component 10330 */ 10331 value: function destroy() { 10332 Modal._count--; 10333 this._removeEventHandlers(); 10334 this.el.removeAttribute('style'); 10335 this.$overlay.remove(); 10336 this.el.M_Modal = undefined; 10337 } 10338 10339 /** 10340 * Setup Event Handlers 10341 */ 10342 10343 }, { 10344 key: "_setupEventHandlers", 10345 value: function _setupEventHandlers() { 10346 this._handleOverlayClickBound = this._handleOverlayClick.bind(this); 10347 this._handleModalCloseClickBound = this._handleModalCloseClick.bind(this); 10348 10349 if (Modal._count === 1) { 10350 document.body.addEventListener('click', this._handleTriggerClick); 10351 } 10352 this.$overlay[0].addEventListener('click', this._handleOverlayClickBound); 10353 this.el.addEventListener('click', this._handleModalCloseClickBound); 10354 } 10355 10356 /** 10357 * Remove Event Handlers 10358 */ 10359 10360 }, { 10361 key: "_removeEventHandlers", 10362 value: function _removeEventHandlers() { 10363 if (Modal._count === 0) { 10364 document.body.removeEventListener('click', this._handleTriggerClick); 10365 } 10366 this.$overlay[0].removeEventListener('click', this._handleOverlayClickBound); 10367 this.el.removeEventListener('click', this._handleModalCloseClickBound); 10368 } 10369 10370 /** 10371 * Handle Trigger Click 10372 * @param {Event} e 10373 */ 10374 10375 }, { 10376 key: "_handleTriggerClick", 10377 value: function _handleTriggerClick(e) { 10378 var $trigger = $(e.target).closest('.modal-trigger'); 10379 if ($trigger.length) { 10380 var modalId = M.getIdFromTrigger($trigger[0]); 10381 var modalInstance = document.getElementById(modalId).M_Modal; 10382 if (modalInstance) { 10383 modalInstance.open($trigger); 10384 } 10385 e.preventDefault(); 10386 } 10387 } 10388 10389 /** 10390 * Handle Overlay Click 10391 */ 10392 10393 }, { 10394 key: "_handleOverlayClick", 10395 value: function _handleOverlayClick() { 10396 if (this.options.dismissible) { 10397 this.close(); 10398 } 10399 } 10400 10401 /** 10402 * Handle Modal Close Click 10403 * @param {Event} e 10404 */ 10405 10406 }, { 10407 key: "_handleModalCloseClick", 10408 value: function _handleModalCloseClick(e) { 10409 var $closeTrigger = $(e.target).closest('.modal-close'); 10410 if ($closeTrigger.length) { 10411 this.close(); 10412 } 10413 } 10414 10415 /** 10416 * Handle Keydown 10417 * @param {Event} e 10418 */ 10419 10420 }, { 10421 key: "_handleKeydown", 10422 value: function _handleKeydown(e) { 10423 // ESC key 10424 if (e.keyCode === 27 && this.options.dismissible) { 10425 this.close(); 10426 } 10427 } 10428 10429 /** 10430 * Handle Focus 10431 * @param {Event} e 10432 */ 10433 10434 }, { 10435 key: "_handleFocus", 10436 value: function _handleFocus(e) { 10437 // Only trap focus if this modal is the last model opened (prevents loops in nested modals). 10438 if (!this.el.contains(e.target) && this._nthModalOpened === Modal._modalsOpen) { 10439 this.el.focus(); 10440 } 10441 } 10442 10443 /** 10444 * Animate in modal 10445 */ 10446 10447 }, { 10448 key: "_animateIn", 10449 value: function _animateIn() { 10450 var _this14 = this; 10451 10452 // Set initial styles 10453 $.extend(this.el.style, { 10454 display: 'block', 10455 opacity: 0 10456 }); 10457 $.extend(this.$overlay[0].style, { 10458 display: 'block', 10459 opacity: 0 10460 }); 10461 10462 // Animate overlay 10463 anim({ 10464 targets: this.$overlay[0], 10465 opacity: this.options.opacity, 10466 duration: this.options.inDuration, 10467 easing: 'easeOutQuad' 10468 }); 10469 10470 // Define modal animation options 10471 var enterAnimOptions = { 10472 targets: this.el, 10473 duration: this.options.inDuration, 10474 easing: 'easeOutCubic', 10475 // Handle modal onOpenEnd callback 10476 complete: function () { 10477 if (typeof _this14.options.onOpenEnd === 'function') { 10478 _this14.options.onOpenEnd.call(_this14, _this14.el, _this14._openingTrigger); 10479 } 10480 } 10481 }; 10482 10483 // Bottom sheet animation 10484 if (this.el.classList.contains('bottom-sheet')) { 10485 $.extend(enterAnimOptions, { 10486 bottom: 0, 10487 opacity: 1 10488 }); 10489 anim(enterAnimOptions); 10490 10491 // Normal modal animation 10492 } else { 10493 $.extend(enterAnimOptions, { 10494 top: [this.options.startingTop, this.options.endingTop], 10495 opacity: 1, 10496 scaleX: [0.8, 1], 10497 scaleY: [0.8, 1] 10498 }); 10499 anim(enterAnimOptions); 10500 } 10501 } 10502 10503 /** 10504 * Animate out modal 10505 */ 10506 10507 }, { 10508 key: "_animateOut", 10509 value: function _animateOut() { 10510 var _this15 = this; 10511 10512 // Animate overlay 10513 anim({ 10514 targets: this.$overlay[0], 10515 opacity: 0, 10516 duration: this.options.outDuration, 10517 easing: 'easeOutQuart' 10518 }); 10519 10520 // Define modal animation options 10521 var exitAnimOptions = { 10522 targets: this.el, 10523 duration: this.options.outDuration, 10524 easing: 'easeOutCubic', 10525 // Handle modal ready callback 10526 complete: function () { 10527 _this15.el.style.display = 'none'; 10528 _this15.$overlay.remove(); 10529 10530 // Call onCloseEnd callback 10531 if (typeof _this15.options.onCloseEnd === 'function') { 10532 _this15.options.onCloseEnd.call(_this15, _this15.el); 10533 } 10534 } 10535 }; 10536 10537 // Bottom sheet animation 10538 if (this.el.classList.contains('bottom-sheet')) { 10539 $.extend(exitAnimOptions, { 10540 bottom: '-100%', 10541 opacity: 0 10542 }); 10543 anim(exitAnimOptions); 10544 10545 // Normal modal animation 10546 } else { 10547 $.extend(exitAnimOptions, { 10548 top: [this.options.endingTop, this.options.startingTop], 10549 opacity: 0, 10550 scaleX: 0.8, 10551 scaleY: 0.8 10552 }); 10553 anim(exitAnimOptions); 10554 } 10555 } 10556 10557 /** 10558 * Open Modal 10559 * @param {cash} [$trigger] 10560 */ 10561 10562 }, { 10563 key: "open", 10564 value: function open($trigger) { 10565 if (this.isOpen) { 10566 return; 10567 } 10568 10569 this.isOpen = true; 10570 Modal._modalsOpen++; 10571 this._nthModalOpened = Modal._modalsOpen; 10572 10573 // Set Z-Index based on number of currently open modals 10574 this.$overlay[0].style.zIndex = 1000 + Modal._modalsOpen * 2; 10575 this.el.style.zIndex = 1000 + Modal._modalsOpen * 2 + 1; 10576 10577 // Set opening trigger, undefined indicates modal was opened by javascript 10578 this._openingTrigger = !!$trigger ? $trigger[0] : undefined; 10579 10580 // onOpenStart callback 10581 if (typeof this.options.onOpenStart === 'function') { 10582 this.options.onOpenStart.call(this, this.el, this._openingTrigger); 10583 } 10584 10585 if (this.options.preventScrolling) { 10586 document.body.style.overflow = 'hidden'; 10587 } 10588 10589 this.el.classList.add('open'); 10590 this.el.insertAdjacentElement('afterend', this.$overlay[0]); 10591 10592 if (this.options.dismissible) { 10593 this._handleKeydownBound = this._handleKeydown.bind(this); 10594 this._handleFocusBound = this._handleFocus.bind(this); 10595 document.addEventListener('keydown', this._handleKeydownBound); 10596 document.addEventListener('focus', this._handleFocusBound, true); 10597 } 10598 10599 anim.remove(this.el); 10600 anim.remove(this.$overlay[0]); 10601 this._animateIn(); 10602 10603 // Focus modal 10604 this.el.focus(); 10605 10606 return this; 10607 } 10608 10609 /** 10610 * Close Modal 10611 */ 10612 10613 }, { 10614 key: "close", 10615 value: function close() { 10616 if (!this.isOpen) { 10617 return; 10618 } 10619 10620 this.isOpen = false; 10621 Modal._modalsOpen--; 10622 this._nthModalOpened = 0; 10623 10624 // Call onCloseStart callback 10625 if (typeof this.options.onCloseStart === 'function') { 10626 this.options.onCloseStart.call(this, this.el); 10627 } 10628 10629 this.el.classList.remove('open'); 10630 10631 // Enable body scrolling only if there are no more modals open. 10632 if (Modal._modalsOpen === 0) { 10633 document.body.style.overflow = ''; 10634 } 10635 10636 if (this.options.dismissible) { 10637 document.removeEventListener('keydown', this._handleKeydownBound); 10638 document.removeEventListener('focus', this._handleFocusBound, true); 10639 } 10640 10641 anim.remove(this.el); 10642 anim.remove(this.$overlay[0]); 10643 this._animateOut(); 10644 return this; 10645 } 10646 }], [{ 10647 key: "init", 10648 value: function init(els, options) { 10649 return _get(Modal.__proto__ || Object.getPrototypeOf(Modal), "init", this).call(this, this, els, options); 10650 } 10651 10652 /** 10653 * Get Instance 10654 */ 10655 10656 }, { 10657 key: "getInstance", 10658 value: function getInstance(el) { 10659 var domElem = !!el.jquery ? el[0] : el; 10660 return domElem.M_Modal; 10661 } 10662 }, { 10663 key: "defaults", 10664 get: function () { 10665 return _defaults; 10666 } 10667 }]); 10668 10669 return Modal; 10670 }(Component); 10671 10672 /** 10673 * @static 10674 * @memberof Modal 10675 */ 10676 10677 10678 Modal._modalsOpen = 0; 10679 10680 /** 10681 * @static 10682 * @memberof Modal 10683 */ 10684 Modal._count = 0; 10685 10686 M.Modal = Modal; 10687 10688 if (M.jQueryLoaded) { 10689 M.initializeJqueryWrapper(Modal, 'modal', 'M_Modal'); 10690 } 10691})(cash, M.anime); 10692;(function ($, anim) { 10693 'use strict'; 10694 10695 var _defaults = { 10696 inDuration: 275, 10697 outDuration: 200, 10698 onOpenStart: null, 10699 onOpenEnd: null, 10700 onCloseStart: null, 10701 onCloseEnd: null 10702 }; 10703 10704 /** 10705 * @class 10706 * 10707 */ 10708 10709 var Materialbox = function (_Component4) { 10710 _inherits(Materialbox, _Component4); 10711 10712 /** 10713 * Construct Materialbox instance 10714 * @constructor 10715 * @param {Element} el 10716 * @param {Object} options 10717 */ 10718 function Materialbox(el, options) { 10719 _classCallCheck(this, Materialbox); 10720 10721 var _this16 = _possibleConstructorReturn(this, (Materialbox.__proto__ || Object.getPrototypeOf(Materialbox)).call(this, Materialbox, el, options)); 10722 10723 _this16.el.M_Materialbox = _this16; 10724 10725 /** 10726 * Options for the modal 10727 * @member Materialbox#options 10728 * @prop {Number} [inDuration=275] - Length in ms of enter transition 10729 * @prop {Number} [outDuration=200] - Length in ms of exit transition 10730 * @prop {Function} onOpenStart - Callback function called before materialbox is opened 10731 * @prop {Function} onOpenEnd - Callback function called after materialbox is opened 10732 * @prop {Function} onCloseStart - Callback function called before materialbox is closed 10733 * @prop {Function} onCloseEnd - Callback function called after materialbox is closed 10734 */ 10735 _this16.options = $.extend({}, Materialbox.defaults, options); 10736 10737 _this16.overlayActive = false; 10738 _this16.doneAnimating = true; 10739 _this16.placeholder = $('<div></div>').addClass('material-placeholder'); 10740 _this16.originalWidth = 0; 10741 _this16.originalHeight = 0; 10742 _this16.originInlineStyles = _this16.$el.attr('style'); 10743 _this16.caption = _this16.el.getAttribute('data-caption') || ''; 10744 10745 // Wrap 10746 _this16.$el.before(_this16.placeholder); 10747 _this16.placeholder.append(_this16.$el); 10748 10749 _this16._setupEventHandlers(); 10750 return _this16; 10751 } 10752 10753 _createClass(Materialbox, [{ 10754 key: "destroy", 10755 10756 10757 /** 10758 * Teardown component 10759 */ 10760 value: function destroy() { 10761 this._removeEventHandlers(); 10762 this.el.M_Materialbox = undefined; 10763 10764 // Unwrap image 10765 $(this.placeholder).after(this.el).remove(); 10766 10767 this.$el.removeAttr('style'); 10768 } 10769 10770 /** 10771 * Setup Event Handlers 10772 */ 10773 10774 }, { 10775 key: "_setupEventHandlers", 10776 value: function _setupEventHandlers() { 10777 this._handleMaterialboxClickBound = this._handleMaterialboxClick.bind(this); 10778 this.el.addEventListener('click', this._handleMaterialboxClickBound); 10779 } 10780 10781 /** 10782 * Remove Event Handlers 10783 */ 10784 10785 }, { 10786 key: "_removeEventHandlers", 10787 value: function _removeEventHandlers() { 10788 this.el.removeEventListener('click', this._handleMaterialboxClickBound); 10789 } 10790 10791 /** 10792 * Handle Materialbox Click 10793 * @param {Event} e 10794 */ 10795 10796 }, { 10797 key: "_handleMaterialboxClick", 10798 value: function _handleMaterialboxClick(e) { 10799 // If already modal, return to original 10800 if (this.doneAnimating === false || this.overlayActive && this.doneAnimating) { 10801 this.close(); 10802 } else { 10803 this.open(); 10804 } 10805 } 10806 10807 /** 10808 * Handle Window Scroll 10809 */ 10810 10811 }, { 10812 key: "_handleWindowScroll", 10813 value: function _handleWindowScroll() { 10814 if (this.overlayActive) { 10815 this.close(); 10816 } 10817 } 10818 10819 /** 10820 * Handle Window Resize 10821 */ 10822 10823 }, { 10824 key: "_handleWindowResize", 10825 value: function _handleWindowResize() { 10826 if (this.overlayActive) { 10827 this.close(); 10828 } 10829 } 10830 10831 /** 10832 * Handle Window Resize 10833 * @param {Event} e 10834 */ 10835 10836 }, { 10837 key: "_handleWindowEscape", 10838 value: function _handleWindowEscape(e) { 10839 // ESC key 10840 if (e.keyCode === 27 && this.doneAnimating && this.overlayActive) { 10841 this.close(); 10842 } 10843 } 10844 10845 /** 10846 * Find ancestors with overflow: hidden; and make visible 10847 */ 10848 10849 }, { 10850 key: "_makeAncestorsOverflowVisible", 10851 value: function _makeAncestorsOverflowVisible() { 10852 this.ancestorsChanged = $(); 10853 var ancestor = this.placeholder[0].parentNode; 10854 while (ancestor !== null && !$(ancestor).is(document)) { 10855 var curr = $(ancestor); 10856 if (curr.css('overflow') !== 'visible') { 10857 curr.css('overflow', 'visible'); 10858 if (this.ancestorsChanged === undefined) { 10859 this.ancestorsChanged = curr; 10860 } else { 10861 this.ancestorsChanged = this.ancestorsChanged.add(curr); 10862 } 10863 } 10864 ancestor = ancestor.parentNode; 10865 } 10866 } 10867 10868 /** 10869 * Animate image in 10870 */ 10871 10872 }, { 10873 key: "_animateImageIn", 10874 value: function _animateImageIn() { 10875 var _this17 = this; 10876 10877 var animOptions = { 10878 targets: this.el, 10879 height: [this.originalHeight, this.newHeight], 10880 width: [this.originalWidth, this.newWidth], 10881 left: M.getDocumentScrollLeft() + this.windowWidth / 2 - this.placeholder.offset().left - this.newWidth / 2, 10882 top: M.getDocumentScrollTop() + this.windowHeight / 2 - this.placeholder.offset().top - this.newHeight / 2, 10883 duration: this.options.inDuration, 10884 easing: 'easeOutQuad', 10885 complete: function () { 10886 _this17.doneAnimating = true; 10887 10888 // onOpenEnd callback 10889 if (typeof _this17.options.onOpenEnd === 'function') { 10890 _this17.options.onOpenEnd.call(_this17, _this17.el); 10891 } 10892 } 10893 }; 10894 10895 // Override max-width or max-height if needed 10896 this.maxWidth = this.$el.css('max-width'); 10897 this.maxHeight = this.$el.css('max-height'); 10898 if (this.maxWidth !== 'none') { 10899 animOptions.maxWidth = this.newWidth; 10900 } 10901 if (this.maxHeight !== 'none') { 10902 animOptions.maxHeight = this.newHeight; 10903 } 10904 10905 anim(animOptions); 10906 } 10907 10908 /** 10909 * Animate image out 10910 */ 10911 10912 }, { 10913 key: "_animateImageOut", 10914 value: function _animateImageOut() { 10915 var _this18 = this; 10916 10917 var animOptions = { 10918 targets: this.el, 10919 width: this.originalWidth, 10920 height: this.originalHeight, 10921 left: 0, 10922 top: 0, 10923 duration: this.options.outDuration, 10924 easing: 'easeOutQuad', 10925 complete: function () { 10926 _this18.placeholder.css({ 10927 height: '', 10928 width: '', 10929 position: '', 10930 top: '', 10931 left: '' 10932 }); 10933 10934 // Revert to width or height attribute 10935 if (_this18.attrWidth) { 10936 _this18.$el.attr('width', _this18.attrWidth); 10937 } 10938 if (_this18.attrHeight) { 10939 _this18.$el.attr('height', _this18.attrHeight); 10940 } 10941 10942 _this18.$el.removeAttr('style'); 10943 _this18.originInlineStyles && _this18.$el.attr('style', _this18.originInlineStyles); 10944 10945 // Remove class 10946 _this18.$el.removeClass('active'); 10947 _this18.doneAnimating = true; 10948 10949 // Remove overflow overrides on ancestors 10950 if (_this18.ancestorsChanged.length) { 10951 _this18.ancestorsChanged.css('overflow', ''); 10952 } 10953 10954 // onCloseEnd callback 10955 if (typeof _this18.options.onCloseEnd === 'function') { 10956 _this18.options.onCloseEnd.call(_this18, _this18.el); 10957 } 10958 } 10959 }; 10960 10961 anim(animOptions); 10962 } 10963 10964 /** 10965 * Update open and close vars 10966 */ 10967 10968 }, { 10969 key: "_updateVars", 10970 value: function _updateVars() { 10971 this.windowWidth = window.innerWidth; 10972 this.windowHeight = window.innerHeight; 10973 this.caption = this.el.getAttribute('data-caption') || ''; 10974 } 10975 10976 /** 10977 * Open Materialbox 10978 */ 10979 10980 }, { 10981 key: "open", 10982 value: function open() { 10983 var _this19 = this; 10984 10985 this._updateVars(); 10986 this.originalWidth = this.el.getBoundingClientRect().width; 10987 this.originalHeight = this.el.getBoundingClientRect().height; 10988 10989 // Set states 10990 this.doneAnimating = false; 10991 this.$el.addClass('active'); 10992 this.overlayActive = true; 10993 10994 // onOpenStart callback 10995 if (typeof this.options.onOpenStart === 'function') { 10996 this.options.onOpenStart.call(this, this.el); 10997 } 10998 10999 // Set positioning for placeholder 11000 this.placeholder.css({ 11001 width: this.placeholder[0].getBoundingClientRect().width + 'px', 11002 height: this.placeholder[0].getBoundingClientRect().height + 'px', 11003 position: 'relative', 11004 top: 0, 11005 left: 0 11006 }); 11007 11008 this._makeAncestorsOverflowVisible(); 11009 11010 // Set css on origin 11011 this.$el.css({ 11012 position: 'absolute', 11013 'z-index': 1000, 11014 'will-change': 'left, top, width, height' 11015 }); 11016 11017 // Change from width or height attribute to css 11018 this.attrWidth = this.$el.attr('width'); 11019 this.attrHeight = this.$el.attr('height'); 11020 if (this.attrWidth) { 11021 this.$el.css('width', this.attrWidth + 'px'); 11022 this.$el.removeAttr('width'); 11023 } 11024 if (this.attrHeight) { 11025 this.$el.css('width', this.attrHeight + 'px'); 11026 this.$el.removeAttr('height'); 11027 } 11028 11029 // Add overlay 11030 this.$overlay = $('<div id="materialbox-overlay"></div>').css({ 11031 opacity: 0 11032 }).one('click', function () { 11033 if (_this19.doneAnimating) { 11034 _this19.close(); 11035 } 11036 }); 11037 11038 // Put before in origin image to preserve z-index layering. 11039 this.$el.before(this.$overlay); 11040 11041 // Set dimensions if needed 11042 var overlayOffset = this.$overlay[0].getBoundingClientRect(); 11043 this.$overlay.css({ 11044 width: this.windowWidth + 'px', 11045 height: this.windowHeight + 'px', 11046 left: -1 * overlayOffset.left + 'px', 11047 top: -1 * overlayOffset.top + 'px' 11048 }); 11049 11050 anim.remove(this.el); 11051 anim.remove(this.$overlay[0]); 11052 11053 // Animate Overlay 11054 anim({ 11055 targets: this.$overlay[0], 11056 opacity: 1, 11057 duration: this.options.inDuration, 11058 easing: 'easeOutQuad' 11059 }); 11060 11061 // Add and animate caption if it exists 11062 if (this.caption !== '') { 11063 if (this.$photocaption) { 11064 anim.remove(this.$photoCaption[0]); 11065 } 11066 this.$photoCaption = $('<div class="materialbox-caption"></div>'); 11067 this.$photoCaption.text(this.caption); 11068 $('body').append(this.$photoCaption); 11069 this.$photoCaption.css({ display: 'inline' }); 11070 11071 anim({ 11072 targets: this.$photoCaption[0], 11073 opacity: 1, 11074 duration: this.options.inDuration, 11075 easing: 'easeOutQuad' 11076 }); 11077 } 11078 11079 // Resize Image 11080 var ratio = 0; 11081 var widthPercent = this.originalWidth / this.windowWidth; 11082 var heightPercent = this.originalHeight / this.windowHeight; 11083 this.newWidth = 0; 11084 this.newHeight = 0; 11085 11086 if (widthPercent > heightPercent) { 11087 ratio = this.originalHeight / this.originalWidth; 11088 this.newWidth = this.windowWidth * 0.9; 11089 this.newHeight = this.windowWidth * 0.9 * ratio; 11090 } else { 11091 ratio = this.originalWidth / this.originalHeight; 11092 this.newWidth = this.windowHeight * 0.9 * ratio; 11093 this.newHeight = this.windowHeight * 0.9; 11094 } 11095 11096 this._animateImageIn(); 11097 11098 // Handle Exit triggers 11099 this._handleWindowScrollBound = this._handleWindowScroll.bind(this); 11100 this._handleWindowResizeBound = this._handleWindowResize.bind(this); 11101 this._handleWindowEscapeBound = this._handleWindowEscape.bind(this); 11102 11103 window.addEventListener('scroll', this._handleWindowScrollBound); 11104 window.addEventListener('resize', this._handleWindowResizeBound); 11105 window.addEventListener('keyup', this._handleWindowEscapeBound); 11106 } 11107 11108 /** 11109 * Close Materialbox 11110 */ 11111 11112 }, { 11113 key: "close", 11114 value: function close() { 11115 var _this20 = this; 11116 11117 this._updateVars(); 11118 this.doneAnimating = false; 11119 11120 // onCloseStart callback 11121 if (typeof this.options.onCloseStart === 'function') { 11122 this.options.onCloseStart.call(this, this.el); 11123 } 11124 11125 anim.remove(this.el); 11126 anim.remove(this.$overlay[0]); 11127 11128 if (this.caption !== '') { 11129 anim.remove(this.$photoCaption[0]); 11130 } 11131 11132 // disable exit handlers 11133 window.removeEventListener('scroll', this._handleWindowScrollBound); 11134 window.removeEventListener('resize', this._handleWindowResizeBound); 11135 window.removeEventListener('keyup', this._handleWindowEscapeBound); 11136 11137 anim({ 11138 targets: this.$overlay[0], 11139 opacity: 0, 11140 duration: this.options.outDuration, 11141 easing: 'easeOutQuad', 11142 complete: function () { 11143 _this20.overlayActive = false; 11144 _this20.$overlay.remove(); 11145 } 11146 }); 11147 11148 this._animateImageOut(); 11149 11150 // Remove Caption + reset css settings on image 11151 if (this.caption !== '') { 11152 anim({ 11153 targets: this.$photoCaption[0], 11154 opacity: 0, 11155 duration: this.options.outDuration, 11156 easing: 'easeOutQuad', 11157 complete: function () { 11158 _this20.$photoCaption.remove(); 11159 } 11160 }); 11161 } 11162 } 11163 }], [{ 11164 key: "init", 11165 value: function init(els, options) { 11166 return _get(Materialbox.__proto__ || Object.getPrototypeOf(Materialbox), "init", this).call(this, this, els, options); 11167 } 11168 11169 /** 11170 * Get Instance 11171 */ 11172 11173 }, { 11174 key: "getInstance", 11175 value: function getInstance(el) { 11176 var domElem = !!el.jquery ? el[0] : el; 11177 return domElem.M_Materialbox; 11178 } 11179 }, { 11180 key: "defaults", 11181 get: function () { 11182 return _defaults; 11183 } 11184 }]); 11185 11186 return Materialbox; 11187 }(Component); 11188 11189 M.Materialbox = Materialbox; 11190 11191 if (M.jQueryLoaded) { 11192 M.initializeJqueryWrapper(Materialbox, 'materialbox', 'M_Materialbox'); 11193 } 11194})(cash, M.anime); 11195;(function ($) { 11196 'use strict'; 11197 11198 var _defaults = { 11199 responsiveThreshold: 0 // breakpoint for swipeable 11200 }; 11201 11202 var Parallax = function (_Component5) { 11203 _inherits(Parallax, _Component5); 11204 11205 function Parallax(el, options) { 11206 _classCallCheck(this, Parallax); 11207 11208 var _this21 = _possibleConstructorReturn(this, (Parallax.__proto__ || Object.getPrototypeOf(Parallax)).call(this, Parallax, el, options)); 11209 11210 _this21.el.M_Parallax = _this21; 11211 11212 /** 11213 * Options for the Parallax 11214 * @member Parallax#options 11215 * @prop {Number} responsiveThreshold 11216 */ 11217 _this21.options = $.extend({}, Parallax.defaults, options); 11218 _this21._enabled = window.innerWidth > _this21.options.responsiveThreshold; 11219 11220 _this21.$img = _this21.$el.find('img').first(); 11221 _this21.$img.each(function () { 11222 var el = this; 11223 if (el.complete) $(el).trigger('load'); 11224 }); 11225 11226 _this21._updateParallax(); 11227 _this21._setupEventHandlers(); 11228 _this21._setupStyles(); 11229 11230 Parallax._parallaxes.push(_this21); 11231 return _this21; 11232 } 11233 11234 _createClass(Parallax, [{ 11235 key: "destroy", 11236 11237 11238 /** 11239 * Teardown component 11240 */ 11241 value: function destroy() { 11242 Parallax._parallaxes.splice(Parallax._parallaxes.indexOf(this), 1); 11243 this.$img[0].style.transform = ''; 11244 this._removeEventHandlers(); 11245 11246 this.$el[0].M_Parallax = undefined; 11247 } 11248 }, { 11249 key: "_setupEventHandlers", 11250 value: function _setupEventHandlers() { 11251 this._handleImageLoadBound = this._handleImageLoad.bind(this); 11252 this.$img[0].addEventListener('load', this._handleImageLoadBound); 11253 11254 if (Parallax._parallaxes.length === 0) { 11255 Parallax._handleScrollThrottled = M.throttle(Parallax._handleScroll, 5); 11256 window.addEventListener('scroll', Parallax._handleScrollThrottled); 11257 11258 Parallax._handleWindowResizeThrottled = M.throttle(Parallax._handleWindowResize, 5); 11259 window.addEventListener('resize', Parallax._handleWindowResizeThrottled); 11260 } 11261 } 11262 }, { 11263 key: "_removeEventHandlers", 11264 value: function _removeEventHandlers() { 11265 this.$img[0].removeEventListener('load', this._handleImageLoadBound); 11266 11267 if (Parallax._parallaxes.length === 0) { 11268 window.removeEventListener('scroll', Parallax._handleScrollThrottled); 11269 window.removeEventListener('resize', Parallax._handleWindowResizeThrottled); 11270 } 11271 } 11272 }, { 11273 key: "_setupStyles", 11274 value: function _setupStyles() { 11275 this.$img[0].style.opacity = 1; 11276 } 11277 }, { 11278 key: "_handleImageLoad", 11279 value: function _handleImageLoad() { 11280 this._updateParallax(); 11281 } 11282 }, { 11283 key: "_updateParallax", 11284 value: function _updateParallax() { 11285 var containerHeight = this.$el.height() > 0 ? this.el.parentNode.offsetHeight : 500; 11286 var imgHeight = this.$img[0].offsetHeight; 11287 var parallaxDist = imgHeight - containerHeight; 11288 var bottom = this.$el.offset().top + containerHeight; 11289 var top = this.$el.offset().top; 11290 var scrollTop = M.getDocumentScrollTop(); 11291 var windowHeight = window.innerHeight; 11292 var windowBottom = scrollTop + windowHeight; 11293 var percentScrolled = (windowBottom - top) / (containerHeight + windowHeight); 11294 var parallax = parallaxDist * percentScrolled; 11295 11296 if (!this._enabled) { 11297 this.$img[0].style.transform = ''; 11298 } else if (bottom > scrollTop && top < scrollTop + windowHeight) { 11299 this.$img[0].style.transform = "translate3D(-50%, " + parallax + "px, 0)"; 11300 } 11301 } 11302 }], [{ 11303 key: "init", 11304 value: function init(els, options) { 11305 return _get(Parallax.__proto__ || Object.getPrototypeOf(Parallax), "init", this).call(this, this, els, options); 11306 } 11307 11308 /** 11309 * Get Instance 11310 */ 11311 11312 }, { 11313 key: "getInstance", 11314 value: function getInstance(el) { 11315 var domElem = !!el.jquery ? el[0] : el; 11316 return domElem.M_Parallax; 11317 } 11318 }, { 11319 key: "_handleScroll", 11320 value: function _handleScroll() { 11321 for (var i = 0; i < Parallax._parallaxes.length; i++) { 11322 var parallaxInstance = Parallax._parallaxes[i]; 11323 parallaxInstance._updateParallax.call(parallaxInstance); 11324 } 11325 } 11326 }, { 11327 key: "_handleWindowResize", 11328 value: function _handleWindowResize() { 11329 for (var i = 0; i < Parallax._parallaxes.length; i++) { 11330 var parallaxInstance = Parallax._parallaxes[i]; 11331 parallaxInstance._enabled = window.innerWidth > parallaxInstance.options.responsiveThreshold; 11332 } 11333 } 11334 }, { 11335 key: "defaults", 11336 get: function () { 11337 return _defaults; 11338 } 11339 }]); 11340 11341 return Parallax; 11342 }(Component); 11343 11344 /** 11345 * @static 11346 * @memberof Parallax 11347 */ 11348 11349 11350 Parallax._parallaxes = []; 11351 11352 M.Parallax = Parallax; 11353 11354 if (M.jQueryLoaded) { 11355 M.initializeJqueryWrapper(Parallax, 'parallax', 'M_Parallax'); 11356 } 11357})(cash); 11358;(function ($, anim) { 11359 'use strict'; 11360 11361 var _defaults = { 11362 duration: 300, 11363 onShow: null, 11364 swipeable: false, 11365 responsiveThreshold: Infinity // breakpoint for swipeable 11366 }; 11367 11368 /** 11369 * @class 11370 * 11371 */ 11372 11373 var Tabs = function (_Component6) { 11374 _inherits(Tabs, _Component6); 11375 11376 /** 11377 * Construct Tabs instance 11378 * @constructor 11379 * @param {Element} el 11380 * @param {Object} options 11381 */ 11382 function Tabs(el, options) { 11383 _classCallCheck(this, Tabs); 11384 11385 var _this22 = _possibleConstructorReturn(this, (Tabs.__proto__ || Object.getPrototypeOf(Tabs)).call(this, Tabs, el, options)); 11386 11387 _this22.el.M_Tabs = _this22; 11388 11389 /** 11390 * Options for the Tabs 11391 * @member Tabs#options 11392 * @prop {Number} duration 11393 * @prop {Function} onShow 11394 * @prop {Boolean} swipeable 11395 * @prop {Number} responsiveThreshold 11396 */ 11397 _this22.options = $.extend({}, Tabs.defaults, options); 11398 11399 // Setup 11400 _this22.$tabLinks = _this22.$el.children('li.tab').children('a'); 11401 _this22.index = 0; 11402 _this22._setupActiveTabLink(); 11403 11404 // Setup tabs content 11405 if (_this22.options.swipeable) { 11406 _this22._setupSwipeableTabs(); 11407 } else { 11408 _this22._setupNormalTabs(); 11409 } 11410 11411 // Setup tabs indicator after content to ensure accurate widths 11412 _this22._setTabsAndTabWidth(); 11413 _this22._createIndicator(); 11414 11415 _this22._setupEventHandlers(); 11416 return _this22; 11417 } 11418 11419 _createClass(Tabs, [{ 11420 key: "destroy", 11421 11422 11423 /** 11424 * Teardown component 11425 */ 11426 value: function destroy() { 11427 this._removeEventHandlers(); 11428 this._indicator.parentNode.removeChild(this._indicator); 11429 11430 if (this.options.swipeable) { 11431 this._teardownSwipeableTabs(); 11432 } else { 11433 this._teardownNormalTabs(); 11434 } 11435 11436 this.$el[0].M_Tabs = undefined; 11437 } 11438 11439 /** 11440 * Setup Event Handlers 11441 */ 11442 11443 }, { 11444 key: "_setupEventHandlers", 11445 value: function _setupEventHandlers() { 11446 this._handleWindowResizeBound = this._handleWindowResize.bind(this); 11447 window.addEventListener('resize', this._handleWindowResizeBound); 11448 11449 this._handleTabClickBound = this._handleTabClick.bind(this); 11450 this.el.addEventListener('click', this._handleTabClickBound); 11451 } 11452 11453 /** 11454 * Remove Event Handlers 11455 */ 11456 11457 }, { 11458 key: "_removeEventHandlers", 11459 value: function _removeEventHandlers() { 11460 window.removeEventListener('resize', this._handleWindowResizeBound); 11461 this.el.removeEventListener('click', this._handleTabClickBound); 11462 } 11463 11464 /** 11465 * Handle window Resize 11466 */ 11467 11468 }, { 11469 key: "_handleWindowResize", 11470 value: function _handleWindowResize() { 11471 this._setTabsAndTabWidth(); 11472 11473 if (this.tabWidth !== 0 && this.tabsWidth !== 0) { 11474 this._indicator.style.left = this._calcLeftPos(this.$activeTabLink) + 'px'; 11475 this._indicator.style.right = this._calcRightPos(this.$activeTabLink) + 'px'; 11476 } 11477 } 11478 11479 /** 11480 * Handle tab click 11481 * @param {Event} e 11482 */ 11483 11484 }, { 11485 key: "_handleTabClick", 11486 value: function _handleTabClick(e) { 11487 var _this23 = this; 11488 11489 var tab = $(e.target).closest('li.tab'); 11490 var tabLink = $(e.target).closest('a'); 11491 11492 // Handle click on tab link only 11493 if (!tabLink.length || !tabLink.parent().hasClass('tab')) { 11494 return; 11495 } 11496 11497 if (tab.hasClass('disabled')) { 11498 e.preventDefault(); 11499 return; 11500 } 11501 11502 // Act as regular link if target attribute is specified. 11503 if (!!tabLink.attr('target')) { 11504 return; 11505 } 11506 11507 // Make the old tab inactive. 11508 this.$activeTabLink.removeClass('active'); 11509 var $oldContent = this.$content; 11510 11511 // Update the variables with the new link and content 11512 this.$activeTabLink = tabLink; 11513 this.$content = $(M.escapeHash(tabLink[0].hash)); 11514 this.$tabLinks = this.$el.children('li.tab').children('a'); 11515 11516 // Make the tab active. 11517 this.$activeTabLink.addClass('active'); 11518 var prevIndex = this.index; 11519 this.index = Math.max(this.$tabLinks.index(tabLink), 0); 11520 11521 // Swap content 11522 if (this.options.swipeable) { 11523 if (this._tabsCarousel) { 11524 this._tabsCarousel.set(this.index, function () { 11525 if (typeof _this23.options.onShow === 'function') { 11526 _this23.options.onShow.call(_this23, _this23.$content[0]); 11527 } 11528 }); 11529 } 11530 } else { 11531 if (this.$content.length) { 11532 this.$content[0].style.display = 'block'; 11533 this.$content.addClass('active'); 11534 if (typeof this.options.onShow === 'function') { 11535 this.options.onShow.call(this, this.$content[0]); 11536 } 11537 11538 if ($oldContent.length && !$oldContent.is(this.$content)) { 11539 $oldContent[0].style.display = 'none'; 11540 $oldContent.removeClass('active'); 11541 } 11542 } 11543 } 11544 11545 // Update widths after content is swapped (scrollbar bugfix) 11546 this._setTabsAndTabWidth(); 11547 11548 // Update indicator 11549 this._animateIndicator(prevIndex); 11550 11551 // Prevent the anchor's default click action 11552 e.preventDefault(); 11553 } 11554 11555 /** 11556 * Generate elements for tab indicator. 11557 */ 11558 11559 }, { 11560 key: "_createIndicator", 11561 value: function _createIndicator() { 11562 var _this24 = this; 11563 11564 var indicator = document.createElement('li'); 11565 indicator.classList.add('indicator'); 11566 11567 this.el.appendChild(indicator); 11568 this._indicator = indicator; 11569 11570 setTimeout(function () { 11571 _this24._indicator.style.left = _this24._calcLeftPos(_this24.$activeTabLink) + 'px'; 11572 _this24._indicator.style.right = _this24._calcRightPos(_this24.$activeTabLink) + 'px'; 11573 }, 0); 11574 } 11575 11576 /** 11577 * Setup first active tab link. 11578 */ 11579 11580 }, { 11581 key: "_setupActiveTabLink", 11582 value: function _setupActiveTabLink() { 11583 // If the location.hash matches one of the links, use that as the active tab. 11584 this.$activeTabLink = $(this.$tabLinks.filter('[href="' + location.hash + '"]')); 11585 11586 // If no match is found, use the first link or any with class 'active' as the initial active tab. 11587 if (this.$activeTabLink.length === 0) { 11588 this.$activeTabLink = this.$el.children('li.tab').children('a.active').first(); 11589 } 11590 if (this.$activeTabLink.length === 0) { 11591 this.$activeTabLink = this.$el.children('li.tab').children('a').first(); 11592 } 11593 11594 this.$tabLinks.removeClass('active'); 11595 this.$activeTabLink[0].classList.add('active'); 11596 11597 this.index = Math.max(this.$tabLinks.index(this.$activeTabLink), 0); 11598 11599 if (this.$activeTabLink.length) { 11600 this.$content = $(M.escapeHash(this.$activeTabLink[0].hash)); 11601 this.$content.addClass('active'); 11602 } 11603 } 11604 11605 /** 11606 * Setup swipeable tabs 11607 */ 11608 11609 }, { 11610 key: "_setupSwipeableTabs", 11611 value: function _setupSwipeableTabs() { 11612 var _this25 = this; 11613 11614 // Change swipeable according to responsive threshold 11615 if (window.innerWidth > this.options.responsiveThreshold) { 11616 this.options.swipeable = false; 11617 } 11618 11619 var $tabsContent = $(); 11620 this.$tabLinks.each(function (link) { 11621 var $currContent = $(M.escapeHash(link.hash)); 11622 $currContent.addClass('carousel-item'); 11623 $tabsContent = $tabsContent.add($currContent); 11624 }); 11625 11626 var $tabsWrapper = $('<div class="tabs-content carousel carousel-slider"></div>'); 11627 $tabsContent.first().before($tabsWrapper); 11628 $tabsWrapper.append($tabsContent); 11629 $tabsContent[0].style.display = ''; 11630 11631 // Keep active tab index to set initial carousel slide 11632 var activeTabIndex = this.$activeTabLink.closest('.tab').index(); 11633 11634 this._tabsCarousel = M.Carousel.init($tabsWrapper[0], { 11635 fullWidth: true, 11636 noWrap: true, 11637 onCycleTo: function (item) { 11638 var prevIndex = _this25.index; 11639 _this25.index = $(item).index(); 11640 _this25.$activeTabLink.removeClass('active'); 11641 _this25.$activeTabLink = _this25.$tabLinks.eq(_this25.index); 11642 _this25.$activeTabLink.addClass('active'); 11643 _this25._animateIndicator(prevIndex); 11644 if (typeof _this25.options.onShow === 'function') { 11645 _this25.options.onShow.call(_this25, _this25.$content[0]); 11646 } 11647 } 11648 }); 11649 11650 // Set initial carousel slide to active tab 11651 this._tabsCarousel.set(activeTabIndex); 11652 } 11653 11654 /** 11655 * Teardown normal tabs. 11656 */ 11657 11658 }, { 11659 key: "_teardownSwipeableTabs", 11660 value: function _teardownSwipeableTabs() { 11661 var $tabsWrapper = this._tabsCarousel.$el; 11662 this._tabsCarousel.destroy(); 11663 11664 // Unwrap 11665 $tabsWrapper.after($tabsWrapper.children()); 11666 $tabsWrapper.remove(); 11667 } 11668 11669 /** 11670 * Setup normal tabs. 11671 */ 11672 11673 }, { 11674 key: "_setupNormalTabs", 11675 value: function _setupNormalTabs() { 11676 // Hide Tabs Content 11677 this.$tabLinks.not(this.$activeTabLink).each(function (link) { 11678 if (!!link.hash) { 11679 var $currContent = $(M.escapeHash(link.hash)); 11680 if ($currContent.length) { 11681 $currContent[0].style.display = 'none'; 11682 } 11683 } 11684 }); 11685 } 11686 11687 /** 11688 * Teardown normal tabs. 11689 */ 11690 11691 }, { 11692 key: "_teardownNormalTabs", 11693 value: function _teardownNormalTabs() { 11694 // show Tabs Content 11695 this.$tabLinks.each(function (link) { 11696 if (!!link.hash) { 11697 var $currContent = $(M.escapeHash(link.hash)); 11698 if ($currContent.length) { 11699 $currContent[0].style.display = ''; 11700 } 11701 } 11702 }); 11703 } 11704 11705 /** 11706 * set tabs and tab width 11707 */ 11708 11709 }, { 11710 key: "_setTabsAndTabWidth", 11711 value: function _setTabsAndTabWidth() { 11712 this.tabsWidth = this.$el.width(); 11713 this.tabWidth = Math.max(this.tabsWidth, this.el.scrollWidth) / this.$tabLinks.length; 11714 } 11715 11716 /** 11717 * Finds right attribute for indicator based on active tab. 11718 * @param {cash} el 11719 */ 11720 11721 }, { 11722 key: "_calcRightPos", 11723 value: function _calcRightPos(el) { 11724 return Math.ceil(this.tabsWidth - el.position().left - el[0].getBoundingClientRect().width); 11725 } 11726 11727 /** 11728 * Finds left attribute for indicator based on active tab. 11729 * @param {cash} el 11730 */ 11731 11732 }, { 11733 key: "_calcLeftPos", 11734 value: function _calcLeftPos(el) { 11735 return Math.floor(el.position().left); 11736 } 11737 }, { 11738 key: "updateTabIndicator", 11739 value: function updateTabIndicator() { 11740 this._setTabsAndTabWidth(); 11741 this._animateIndicator(this.index); 11742 } 11743 11744 /** 11745 * Animates Indicator to active tab. 11746 * @param {Number} prevIndex 11747 */ 11748 11749 }, { 11750 key: "_animateIndicator", 11751 value: function _animateIndicator(prevIndex) { 11752 var leftDelay = 0, 11753 rightDelay = 0; 11754 11755 if (this.index - prevIndex >= 0) { 11756 leftDelay = 90; 11757 } else { 11758 rightDelay = 90; 11759 } 11760 11761 // Animate 11762 var animOptions = { 11763 targets: this._indicator, 11764 left: { 11765 value: this._calcLeftPos(this.$activeTabLink), 11766 delay: leftDelay 11767 }, 11768 right: { 11769 value: this._calcRightPos(this.$activeTabLink), 11770 delay: rightDelay 11771 }, 11772 duration: this.options.duration, 11773 easing: 'easeOutQuad' 11774 }; 11775 anim.remove(this._indicator); 11776 anim(animOptions); 11777 } 11778 11779 /** 11780 * Select tab. 11781 * @param {String} tabId 11782 */ 11783 11784 }, { 11785 key: "select", 11786 value: function select(tabId) { 11787 var tab = this.$tabLinks.filter('[href="#' + tabId + '"]'); 11788 if (tab.length) { 11789 tab.trigger('click'); 11790 } 11791 } 11792 }], [{ 11793 key: "init", 11794 value: function init(els, options) { 11795 return _get(Tabs.__proto__ || Object.getPrototypeOf(Tabs), "init", this).call(this, this, els, options); 11796 } 11797 11798 /** 11799 * Get Instance 11800 */ 11801 11802 }, { 11803 key: "getInstance", 11804 value: function getInstance(el) { 11805 var domElem = !!el.jquery ? el[0] : el; 11806 return domElem.M_Tabs; 11807 } 11808 }, { 11809 key: "defaults", 11810 get: function () { 11811 return _defaults; 11812 } 11813 }]); 11814 11815 return Tabs; 11816 }(Component); 11817 11818 M.Tabs = Tabs; 11819 11820 if (M.jQueryLoaded) { 11821 M.initializeJqueryWrapper(Tabs, 'tabs', 'M_Tabs'); 11822 } 11823})(cash, M.anime); 11824;(function ($, anim) { 11825 'use strict'; 11826 11827 var _defaults = { 11828 exitDelay: 200, 11829 enterDelay: 0, 11830 html: null, 11831 margin: 5, 11832 inDuration: 250, 11833 outDuration: 200, 11834 position: 'bottom', 11835 transitionMovement: 10 11836 }; 11837 11838 /** 11839 * @class 11840 * 11841 */ 11842 11843 var Tooltip = function (_Component7) { 11844 _inherits(Tooltip, _Component7); 11845 11846 /** 11847 * Construct Tooltip instance 11848 * @constructor 11849 * @param {Element} el 11850 * @param {Object} options 11851 */ 11852 function Tooltip(el, options) { 11853 _classCallCheck(this, Tooltip); 11854 11855 var _this26 = _possibleConstructorReturn(this, (Tooltip.__proto__ || Object.getPrototypeOf(Tooltip)).call(this, Tooltip, el, options)); 11856 11857 _this26.el.M_Tooltip = _this26; 11858 _this26.options = $.extend({}, Tooltip.defaults, options); 11859 11860 _this26.isOpen = false; 11861 _this26.isHovered = false; 11862 _this26.isFocused = false; 11863 _this26._appendTooltipEl(); 11864 _this26._setupEventHandlers(); 11865 return _this26; 11866 } 11867 11868 _createClass(Tooltip, [{ 11869 key: "destroy", 11870 11871 11872 /** 11873 * Teardown component 11874 */ 11875 value: function destroy() { 11876 $(this.tooltipEl).remove(); 11877 this._removeEventHandlers(); 11878 this.el.M_Tooltip = undefined; 11879 } 11880 }, { 11881 key: "_appendTooltipEl", 11882 value: function _appendTooltipEl() { 11883 var tooltipEl = document.createElement('div'); 11884 tooltipEl.classList.add('material-tooltip'); 11885 this.tooltipEl = tooltipEl; 11886 11887 var tooltipContentEl = document.createElement('div'); 11888 tooltipContentEl.classList.add('tooltip-content'); 11889 tooltipContentEl.innerHTML = this.options.html; 11890 tooltipEl.appendChild(tooltipContentEl); 11891 document.body.appendChild(tooltipEl); 11892 } 11893 }, { 11894 key: "_updateTooltipContent", 11895 value: function _updateTooltipContent() { 11896 this.tooltipEl.querySelector('.tooltip-content').innerHTML = this.options.html; 11897 } 11898 }, { 11899 key: "_setupEventHandlers", 11900 value: function _setupEventHandlers() { 11901 this._handleMouseEnterBound = this._handleMouseEnter.bind(this); 11902 this._handleMouseLeaveBound = this._handleMouseLeave.bind(this); 11903 this._handleFocusBound = this._handleFocus.bind(this); 11904 this._handleBlurBound = this._handleBlur.bind(this); 11905 this.el.addEventListener('mouseenter', this._handleMouseEnterBound); 11906 this.el.addEventListener('mouseleave', this._handleMouseLeaveBound); 11907 this.el.addEventListener('focus', this._handleFocusBound, true); 11908 this.el.addEventListener('blur', this._handleBlurBound, true); 11909 } 11910 }, { 11911 key: "_removeEventHandlers", 11912 value: function _removeEventHandlers() { 11913 this.el.removeEventListener('mouseenter', this._handleMouseEnterBound); 11914 this.el.removeEventListener('mouseleave', this._handleMouseLeaveBound); 11915 this.el.removeEventListener('focus', this._handleFocusBound, true); 11916 this.el.removeEventListener('blur', this._handleBlurBound, true); 11917 } 11918 }, { 11919 key: "open", 11920 value: function open(isManual) { 11921 if (this.isOpen) { 11922 return; 11923 } 11924 isManual = isManual === undefined ? true : undefined; // Default value true 11925 this.isOpen = true; 11926 // Update tooltip content with HTML attribute options 11927 this.options = $.extend({}, this.options, this._getAttributeOptions()); 11928 this._updateTooltipContent(); 11929 this._setEnterDelayTimeout(isManual); 11930 } 11931 }, { 11932 key: "close", 11933 value: function close() { 11934 if (!this.isOpen) { 11935 return; 11936 } 11937 11938 this.isHovered = false; 11939 this.isFocused = false; 11940 this.isOpen = false; 11941 this._setExitDelayTimeout(); 11942 } 11943 11944 /** 11945 * Create timeout which delays when the tooltip closes 11946 */ 11947 11948 }, { 11949 key: "_setExitDelayTimeout", 11950 value: function _setExitDelayTimeout() { 11951 var _this27 = this; 11952 11953 clearTimeout(this._exitDelayTimeout); 11954 11955 this._exitDelayTimeout = setTimeout(function () { 11956 if (_this27.isHovered || _this27.isFocused) { 11957 return; 11958 } 11959 11960 _this27._animateOut(); 11961 }, this.options.exitDelay); 11962 } 11963 11964 /** 11965 * Create timeout which delays when the toast closes 11966 */ 11967 11968 }, { 11969 key: "_setEnterDelayTimeout", 11970 value: function _setEnterDelayTimeout(isManual) { 11971 var _this28 = this; 11972 11973 clearTimeout(this._enterDelayTimeout); 11974 11975 this._enterDelayTimeout = setTimeout(function () { 11976 if (!_this28.isHovered && !_this28.isFocused && !isManual) { 11977 return; 11978 } 11979 11980 _this28._animateIn(); 11981 }, this.options.enterDelay); 11982 } 11983 }, { 11984 key: "_positionTooltip", 11985 value: function _positionTooltip() { 11986 var origin = this.el, 11987 tooltip = this.tooltipEl, 11988 originHeight = origin.offsetHeight, 11989 originWidth = origin.offsetWidth, 11990 tooltipHeight = tooltip.offsetHeight, 11991 tooltipWidth = tooltip.offsetWidth, 11992 newCoordinates = void 0, 11993 margin = this.options.margin, 11994 targetTop = void 0, 11995 targetLeft = void 0; 11996 11997 this.xMovement = 0, this.yMovement = 0; 11998 11999 targetTop = origin.getBoundingClientRect().top + M.getDocumentScrollTop(); 12000 targetLeft = origin.getBoundingClientRect().left + M.getDocumentScrollLeft(); 12001 12002 if (this.options.position === 'top') { 12003 targetTop += -tooltipHeight - margin; 12004 targetLeft += originWidth / 2 - tooltipWidth / 2; 12005 this.yMovement = -this.options.transitionMovement; 12006 } else if (this.options.position === 'right') { 12007 targetTop += originHeight / 2 - tooltipHeight / 2; 12008 targetLeft += originWidth + margin; 12009 this.xMovement = this.options.transitionMovement; 12010 } else if (this.options.position === 'left') { 12011 targetTop += originHeight / 2 - tooltipHeight / 2; 12012 targetLeft += -tooltipWidth - margin; 12013 this.xMovement = -this.options.transitionMovement; 12014 } else { 12015 targetTop += originHeight + margin; 12016 targetLeft += originWidth / 2 - tooltipWidth / 2; 12017 this.yMovement = this.options.transitionMovement; 12018 } 12019 12020 newCoordinates = this._repositionWithinScreen(targetLeft, targetTop, tooltipWidth, tooltipHeight); 12021 $(tooltip).css({ 12022 top: newCoordinates.y + 'px', 12023 left: newCoordinates.x + 'px' 12024 }); 12025 } 12026 }, { 12027 key: "_repositionWithinScreen", 12028 value: function _repositionWithinScreen(x, y, width, height) { 12029 var scrollLeft = M.getDocumentScrollLeft(); 12030 var scrollTop = M.getDocumentScrollTop(); 12031 var newX = x - scrollLeft; 12032 var newY = y - scrollTop; 12033 12034 var bounding = { 12035 left: newX, 12036 top: newY, 12037 width: width, 12038 height: height 12039 }; 12040 12041 var offset = this.options.margin + this.options.transitionMovement; 12042 var edges = M.checkWithinContainer(document.body, bounding, offset); 12043 12044 if (edges.left) { 12045 newX = offset; 12046 } else if (edges.right) { 12047 newX -= newX + width - window.innerWidth; 12048 } 12049 12050 if (edges.top) { 12051 newY = offset; 12052 } else if (edges.bottom) { 12053 newY -= newY + height - window.innerHeight; 12054 } 12055 12056 return { 12057 x: newX + scrollLeft, 12058 y: newY + scrollTop 12059 }; 12060 } 12061 }, { 12062 key: "_animateIn", 12063 value: function _animateIn() { 12064 this._positionTooltip(); 12065 this.tooltipEl.style.visibility = 'visible'; 12066 anim.remove(this.tooltipEl); 12067 anim({ 12068 targets: this.tooltipEl, 12069 opacity: 1, 12070 translateX: this.xMovement, 12071 translateY: this.yMovement, 12072 duration: this.options.inDuration, 12073 easing: 'easeOutCubic' 12074 }); 12075 } 12076 }, { 12077 key: "_animateOut", 12078 value: function _animateOut() { 12079 anim.remove(this.tooltipEl); 12080 anim({ 12081 targets: this.tooltipEl, 12082 opacity: 0, 12083 translateX: 0, 12084 translateY: 0, 12085 duration: this.options.outDuration, 12086 easing: 'easeOutCubic' 12087 }); 12088 } 12089 }, { 12090 key: "_handleMouseEnter", 12091 value: function _handleMouseEnter() { 12092 this.isHovered = true; 12093 this.isFocused = false; // Allows close of tooltip when opened by focus. 12094 this.open(false); 12095 } 12096 }, { 12097 key: "_handleMouseLeave", 12098 value: function _handleMouseLeave() { 12099 this.isHovered = false; 12100 this.isFocused = false; // Allows close of tooltip when opened by focus. 12101 this.close(); 12102 } 12103 }, { 12104 key: "_handleFocus", 12105 value: function _handleFocus() { 12106 if (M.tabPressed) { 12107 this.isFocused = true; 12108 this.open(false); 12109 } 12110 } 12111 }, { 12112 key: "_handleBlur", 12113 value: function _handleBlur() { 12114 this.isFocused = false; 12115 this.close(); 12116 } 12117 }, { 12118 key: "_getAttributeOptions", 12119 value: function _getAttributeOptions() { 12120 var attributeOptions = {}; 12121 var tooltipTextOption = this.el.getAttribute('data-tooltip'); 12122 var positionOption = this.el.getAttribute('data-position'); 12123 12124 if (tooltipTextOption) { 12125 attributeOptions.html = tooltipTextOption; 12126 } 12127 12128 if (positionOption) { 12129 attributeOptions.position = positionOption; 12130 } 12131 return attributeOptions; 12132 } 12133 }], [{ 12134 key: "init", 12135 value: function init(els, options) { 12136 return _get(Tooltip.__proto__ || Object.getPrototypeOf(Tooltip), "init", this).call(this, this, els, options); 12137 } 12138 12139 /** 12140 * Get Instance 12141 */ 12142 12143 }, { 12144 key: "getInstance", 12145 value: function getInstance(el) { 12146 var domElem = !!el.jquery ? el[0] : el; 12147 return domElem.M_Tooltip; 12148 } 12149 }, { 12150 key: "defaults", 12151 get: function () { 12152 return _defaults; 12153 } 12154 }]); 12155 12156 return Tooltip; 12157 }(Component); 12158 12159 M.Tooltip = Tooltip; 12160 12161 if (M.jQueryLoaded) { 12162 M.initializeJqueryWrapper(Tooltip, 'tooltip', 'M_Tooltip'); 12163 } 12164})(cash, M.anime); 12165; /*!
12165 12166 * Waves v0.6.4 12167 * http://fian.my.id/Waves 12168 * 12169 * Copyright 2014 Alfiana E. Sibuea and other contributors 12170 * Released under the MIT license 12171 * https://github.com/fians/Waves/blob/master/LICENSE�
vendor: 6,044 bytes, lines 12171-12381
12171 12172 */ 12173 12174;(function (window) { 12175 'use strict'; 12176 12177 var Waves = Waves || {}; 12178 var $$ = document.querySelectorAll.bind(document); 12179 12180 // Find exact position of element 12181 function isWindow(obj) { 12182 return obj !== null && obj === obj.window; 12183 } 12184 12185 function getWindow(elem) { 12186 return isWindow(elem) ? elem : elem.nodeType === 9 && elem.defaultView; 12187 } 12188 12189 function offset(elem) { 12190 var docElem, 12191 win, 12192 box = { top: 0, left: 0 }, 12193 doc = elem && elem.ownerDocument; 12194 12195 docElem = doc.documentElement; 12196 12197 if (typeof elem.getBoundingClientRect !== typeof undefined) { 12198 box = elem.getBoundingClientRect(); 12199 } 12200 win = getWindow(doc); 12201 return { 12202 top: box.top + win.pageYOffset - docElem.clientTop, 12203 left: box.left + win.pageXOffset - docElem.clientLeft 12204 }; 12205 } 12206 12207 function convertStyle(obj) { 12208 var style = ''; 12209 12210 for (var a in obj) { 12211 if (obj.hasOwnProperty(a)) { 12212 style += a + ':' + obj[a] + ';'; 12213 } 12214 } 12215 12216 return style; 12217 } 12218 12219 var Effect = { 12220 12221 // Effect delay 12222 duration: 750, 12223 12224 show: function (e, element) { 12225 12226 // Disable right click 12227 if (e.button === 2) { 12228 return false; 12229 } 12230 12231 var el = element || this; 12232 12233 // Create ripple 12234 var ripple = document.createElement('div'); 12235 ripple.className = 'waves-ripple'; 12236 el.appendChild(ripple); 12237 12238 // Get click coordinate and element witdh 12239 var pos = offset(el); 12240 var relativeY = e.pageY - pos.top; 12241 var relativeX = e.pageX - pos.left; 12242 var scale = 'scale(' + el.clientWidth / 100 * 10 + ')'; 12243 12244 // Support for touch devices 12245 if ('touches' in e) { 12246 relativeY = e.touches[0].pageY - pos.top; 12247 relativeX = e.touches[0].pageX - pos.left; 12248 } 12249 12250 // Attach data to element 12251 ripple.setAttribute('data-hold', Date.now()); 12252 ripple.setAttribute('data-scale', scale); 12253 ripple.setAttribute('data-x', relativeX); 12254 ripple.setAttribute('data-y', relativeY); 12255 12256 // Set ripple position 12257 var rippleStyle = { 12258 'top': relativeY + 'px', 12259 'left': relativeX + 'px' 12260 }; 12261 12262 ripple.className = ripple.className + ' waves-notransition'; 12263 ripple.setAttribute('style', convertStyle(rippleStyle)); 12264 ripple.className = ripple.className.replace('waves-notransition', ''); 12265 12266 // Scale the ripple 12267 rippleStyle['-webkit-transform'] = scale; 12268 rippleStyle['-moz-transform'] = scale; 12269 rippleStyle['-ms-transform'] = scale; 12270 rippleStyle['-o-transform'] = scale; 12271 rippleStyle.transform = scale; 12272 rippleStyle.opacity = '1'; 12273 12274 rippleStyle['-webkit-transition-duration'] = Effect.duration + 'ms'; 12275 rippleStyle['-moz-transition-duration'] = Effect.duration + 'ms'; 12276 rippleStyle['-o-transition-duration'] = Effect.duration + 'ms'; 12277 rippleStyle['transition-duration'] = Effect.duration + 'ms'; 12278 12279 rippleStyle['-webkit-transition-timing-function'] = 'cubic-bezier(0.250, 0.460, 0.450, 0.940)'; 12280 rippleStyle['-moz-transition-timing-function'] = 'cubic-bezier(0.250, 0.460, 0.450, 0.940)'; 12281 rippleStyle['-o-transition-timing-function'] = 'cubic-bezier(0.250, 0.460, 0.450, 0.940)'; 12282 rippleStyle['transition-timing-function'] = 'cubic-bezier(0.250, 0.460, 0.450, 0.940)'; 12283 12284 ripple.setAttribute('style', convertStyle(rippleStyle)); 12285 }, 12286 12287 hide: function (e) { 12288 TouchHandler.touchup(e); 12289 12290 var el = this; 12291 var width = el.clientWidth * 1.4; 12292 12293 // Get first ripple 12294 var ripple = null; 12295 var ripples = el.getElementsByClassName('waves-ripple'); 12296 if (ripples.length > 0) { 12297 ripple = ripples[ripples.length - 1]; 12298 } else { 12299 return false; 12300 } 12301 12302 var relativeX = ripple.getAttribute('data-x'); 12303 var relativeY = ripple.getAttribute('data-y'); 12304 var scale = ripple.getAttribute('data-scale'); 12305 12306 // Get delay beetween mousedown and mouse leave 12307 var diff = Date.now() - Number(ripple.getAttribute('data-hold')); 12308 var delay = 350 - diff; 12309 12310 if (delay < 0) { 12311 delay = 0; 12312 } 12313 12314 // Fade out ripple after delay 12315 setTimeout(function () { 12316 var style = { 12317 'top': relativeY + 'px', 12318 'left': relativeX + 'px', 12319 'opacity': '0', 12320 12321 // Duration 12322 '-webkit-transition-duration': Effect.duration + 'ms', 12323 '-moz-transition-duration': Effect.duration + 'ms', 12324 '-o-transition-duration': Effect.duration + 'ms', 12325 'transition-duration': Effect.duration + 'ms', 12326 '-webkit-transform': scale, 12327 '-moz-transform': scale, 12328 '-ms-transform': scale, 12329 '-o-transform': scale, 12330 'transform': scale 12331 }; 12332 12333 ripple.setAttribute('style', convertStyle(style)); 12334 12335 setTimeout(function () { 12336 try { 12337 el.removeChild(ripple); 12338 } catch (e) { 12339 return false; 12340 } 12341 }, Effect.duration); 12342 }, delay); 12343 }, 12344 12345 // Little hack to make <input> can perform waves effect 12346 wrapInput: function (elements) { 12347 for (var a = 0; a < elements.length; a++) { 12348 var el = elements[a]; 12349 12350 if (el.tagName.toLowerCase() === 'input') { 12351 var parent = el.parentNode; 12352 12353 // If input already have parent just pass through 12354 if (parent.tagName.toLowerCase() === 'i' && parent.className.indexOf('waves-effect') !== -1) { 12355 continue; 12356 } 12357 12358 // Put element class and style to the specified parent 12359 var wrapper = document.createElement('i'); 12360 wrapper.className = el.className + ' waves-input-wrapper'; 12361 12362 var elementStyle = el.getAttribute('style'); 12363 12364 if (!elementStyle) { 12365 elementStyle = ''; 12366 } 12367 12368 wrapper.setAttribute('style', elementStyle); 12369 12370 el.className = 'waves-button-input'; 12371 el.removeAttribute('style'); 12372 12373 // Put element as child 12374 parent.replaceChild(wrapper, el); 12375 wrapper.appendChild(el); 12376 } 12377 } 12378 } 12379 }; 12380 12381 /**
12381 12382 * Disable mousedown event for 500ms during and after touch 12383 */ 12384 var TouchHandler = { 12385 /* uses an integer rather than bool so there's no issues with 12386 * needing to clear timeouts if another touch event occurred 12387 * within the 500ms. Cannot mouseup between touchstart and 12388 * touchend, nor in the 500ms after touchend. */ 12389 touches: 0, 12390 allowEvent: function (e) { 12391 var allow = true; 12392 12393 if (e.type === 'touchstart') { 12394 TouchHandler.touches += 1; //push 12395 } else if (e.type === 'touchend' || e.type === 'touchcancel') { 12396 setTimeout(function () { 12397 if (TouchHandler.touches > 0) { 12398 TouchHandler.touches -= 1; //pop after 500ms 12399 } 12400 }, 500); 12401 } else if (e.type === 'mousedown' && TouchHandler.touches > 0) { 12402 allow = false;
vendor: 1,944 bytes, lines 12403-12475
12403 } 12404 12405 return allow; 12406 }, 12407 touchup: function (e) { 12408 TouchHandler.allowEvent(e); 12409 } 12410 }; 12411 12412 /** 12413 * Delegated click handler for .waves-effect element. 12414 * returns null when .waves-effect element not in "click tree" 12415 */ 12416 function getWavesEffectElement(e) { 12417 if (TouchHandler.allowEvent(e) === false) { 12418 return null; 12419 } 12420 12421 var element = null; 12422 var target = e.target || e.srcElement; 12423 12424 while (target.parentNode !== null) { 12425 if (!(target instanceof SVGElement) && target.className.indexOf('waves-effect') !== -1) { 12426 element = target; 12427 break; 12428 } 12429 target = target.parentNode; 12430 } 12431 return element; 12432 } 12433 12434 /** 12435 * Bubble the click and show effect if .waves-effect elem was found 12436 */ 12437 function showEffect(e) { 12438 var element = getWavesEffectElement(e); 12439 12440 if (element !== null) { 12441 Effect.show(e, element); 12442 12443 if ('ontouchstart' in window) { 12444 element.addEventListener('touchend', Effect.hide, false); 12445 element.addEventListener('touchcancel', Effect.hide, false); 12446 } 12447 12448 element.addEventListener('mouseup', Effect.hide, false); 12449 element.addEventListener('mouseleave', Effect.hide, false); 12450 element.addEventListener('dragend', Effect.hide, false); 12451 } 12452 } 12453 12454 Waves.displayEffect = function (options) { 12455 options = options || {}; 12456 12457 if ('duration' in options) { 12458 Effect.duration = options.duration; 12459 } 12460 12461 //Wrap input inside <i> tag 12462 Effect.wrapInput($$('.waves-effect')); 12463 12464 if ('ontouchstart' in window) { 12465 document.body.addEventListener('touchstart', showEffect, false); 12466 } 12467 12468 document.body.addEventListener('mousedown', showEffect, false); 12469 }; 12470 12471 /** 12472 * Attach Waves to an input element (or any element which doesn't 12473 * bubble mouseup/mousedown events). 12474 * Intended to be used with dynamically loaded forms/inputs, or 12475 * where the user doesn't want a delegated click handler.�
vendor: 218,864 bytes, lines 12475-19765
12475 12476 */ 12477 Waves.attach = function (element) { 12478 //FUTURE: automatically add waves classes and allow users 12479 // to specify them with an options param? Eg. light/classic/button 12480 if (element.tagName.toLowerCase() === 'input') { 12481 Effect.wrapInput([element]); 12482 element = element.parentNode; 12483 } 12484 12485 if ('ontouchstart' in window) { 12486 element.addEventListener('touchstart', showEffect, false); 12487 } 12488 12489 element.addEventListener('mousedown', showEffect, false); 12490 }; 12491 12492 window.Waves = Waves; 12493 12494 document.addEventListener('DOMContentLoaded', function () { 12495 Waves.displayEffect(); 12496 }, false); 12497})(window); 12498;(function ($, anim) { 12499 'use strict'; 12500 12501 var _defaults = { 12502 html: '', 12503 displayLength: 4000, 12504 inDuration: 300, 12505 outDuration: 375, 12506 classes: '', 12507 completeCallback: null, 12508 activationPercent: 0.8 12509 }; 12510 12511 var Toast = function () { 12512 function Toast(options) { 12513 _classCallCheck(this, Toast); 12514 12515 /** 12516 * Options for the toast 12517 * @member Toast#options 12518 */ 12519 this.options = $.extend({}, Toast.defaults, options); 12520 this.message = this.options.html; 12521 12522 /** 12523 * Describes current pan state toast 12524 * @type {Boolean} 12525 */ 12526 this.panning = false; 12527 12528 /** 12529 * Time remaining until toast is removed 12530 */ 12531 this.timeRemaining = this.options.displayLength; 12532 12533 if (Toast._toasts.length === 0) { 12534 Toast._createContainer(); 12535 } 12536 12537 // Create new toast 12538 Toast._toasts.push(this); 12539 var toastElement = this._createToast(); 12540 toastElement.M_Toast = this; 12541 this.el = toastElement; 12542 this.$el = $(toastElement); 12543 this._animateIn(); 12544 this._setTimer(); 12545 } 12546 12547 _createClass(Toast, [{ 12548 key: "_createToast", 12549 12550 12551 /** 12552 * Create toast and append it to toast container 12553 */ 12554 value: function _createToast() { 12555 var toast = document.createElement('div'); 12556 toast.classList.add('toast'); 12557 12558 // Add custom classes onto toast 12559 if (!!this.options.classes.length) { 12560 $(toast).addClass(this.options.classes); 12561 } 12562 12563 // Set content 12564 if (typeof HTMLElement === 'object' ? this.message instanceof HTMLElement : this.message && typeof this.message === 'object' && this.message !== null && this.message.nodeType === 1 && typeof this.message.nodeName === 'string') { 12565 toast.appendChild(this.message); 12566 12567 // Check if it is jQuery object 12568 } else if (!!this.message.jquery) { 12569 $(toast).append(this.message[0]); 12570 12571 // Insert as html; 12572 } else { 12573 toast.innerHTML = this.message; 12574 } 12575 12576 // Append toasft 12577 Toast._container.appendChild(toast); 12578 return toast; 12579 } 12580 12581 /** 12582 * Animate in toast 12583 */ 12584 12585 }, { 12586 key: "_animateIn", 12587 value: function _animateIn() { 12588 // Animate toast in 12589 anim({ 12590 targets: this.el, 12591 top: 0, 12592 opacity: 1, 12593 duration: this.options.inDuration, 12594 easing: 'easeOutCubic' 12595 }); 12596 } 12597 12598 /** 12599 * Create setInterval which automatically removes toast when timeRemaining >= 0 12600 * has been reached 12601 */ 12602 12603 }, { 12604 key: "_setTimer", 12605 value: function _setTimer() { 12606 var _this29 = this; 12607 12608 if (this.timeRemaining !== Infinity) { 12609 this.counterInterval = setInterval(function () { 12610 // If toast is not being dragged, decrease its time remaining 12611 if (!_this29.panning) { 12612 _this29.timeRemaining -= 20; 12613 } 12614 12615 // Animate toast out 12616 if (_this29.timeRemaining <= 0) { 12617 _this29.dismiss(); 12618 } 12619 }, 20); 12620 } 12621 } 12622 12623 /** 12624 * Dismiss toast with animation 12625 */ 12626 12627 }, { 12628 key: "dismiss", 12629 value: function dismiss() { 12630 var _this30 = this; 12631 12632 window.clearInterval(this.counterInterval); 12633 var activationDistance = this.el.offsetWidth * this.options.activationPercent; 12634 12635 if (this.wasSwiped) { 12636 this.el.style.transition = 'transform .05s, opacity .05s'; 12637 this.el.style.transform = "translateX(" + activationDistance + "px)"; 12638 this.el.style.opacity = 0; 12639 } 12640 12641 anim({ 12642 targets: this.el, 12643 opacity: 0, 12644 marginTop: -40, 12645 duration: this.options.outDuration, 12646 easing: 'easeOutExpo', 12647 complete: function () { 12648 // Call the optional callback 12649 if (typeof _this30.options.completeCallback === 'function') { 12650 _this30.options.completeCallback(); 12651 } 12652 // Remove toast from DOM 12653 _this30.$el.remove(); 12654 Toast._toasts.splice(Toast._toasts.indexOf(_this30), 1); 12655 if (Toast._toasts.length === 0) { 12656 Toast._removeContainer(); 12657 } 12658 } 12659 }); 12660 } 12661 }], [{ 12662 key: "getInstance", 12663 12664 12665 /** 12666 * Get Instance 12667 */ 12668 value: function getInstance(el) { 12669 var domElem = !!el.jquery ? el[0] : el; 12670 return domElem.M_Toast; 12671 } 12672 12673 /** 12674 * Append toast container and add event handlers 12675 */ 12676 12677 }, { 12678 key: "_createContainer", 12679 value: function _createContainer() { 12680 var container = document.createElement('div'); 12681 container.setAttribute('id', 'toast-container'); 12682 12683 // Add event handler 12684 container.addEventListener('touchstart', Toast._onDragStart); 12685 container.addEventListener('touchmove', Toast._onDragMove); 12686 container.addEventListener('touchend', Toast._onDragEnd); 12687 12688 container.addEventListener('mousedown', Toast._onDragStart); 12689 document.addEventListener('mousemove', Toast._onDragMove); 12690 document.addEventListener('mouseup', Toast._onDragEnd); 12691 12692 document.body.appendChild(container); 12693 Toast._container = container; 12694 } 12695 12696 /** 12697 * Remove toast container and event handlers 12698 */ 12699 12700 }, { 12701 key: "_removeContainer", 12702 value: function _removeContainer() { 12703 // Add event handler 12704 document.removeEventListener('mousemove', Toast._onDragMove); 12705 document.removeEventListener('mouseup', Toast._onDragEnd); 12706 12707 $(Toast._container).remove(); 12708 Toast._container = null; 12709 } 12710 12711 /** 12712 * Begin drag handler 12713 * @param {Event} e 12714 */ 12715 12716 }, { 12717 key: "_onDragStart", 12718 value: function _onDragStart(e) { 12719 if (e.target && $(e.target).closest('.toast').length) { 12720 var $toast = $(e.target).closest('.toast'); 12721 var toast = $toast[0].M_Toast; 12722 toast.panning = true; 12723 Toast._draggedToast = toast; 12724 toast.el.classList.add('panning'); 12725 toast.el.style.transition = ''; 12726 toast.startingXPos = Toast._xPos(e); 12727 toast.time = Date.now(); 12728 toast.xPos = Toast._xPos(e); 12729 } 12730 } 12731 12732 /** 12733 * Drag move handler 12734 * @param {Event} e 12735 */ 12736 12737 }, { 12738 key: "_onDragMove", 12739 value: function _onDragMove(e) { 12740 if (!!Toast._draggedToast) { 12741 e.preventDefault(); 12742 var toast = Toast._draggedToast; 12743 toast.deltaX = Math.abs(toast.xPos - Toast._xPos(e)); 12744 toast.xPos = Toast._xPos(e); 12745 toast.velocityX = toast.deltaX / (Date.now() - toast.time); 12746 toast.time = Date.now(); 12747 12748 var totalDeltaX = toast.xPos - toast.startingXPos; 12749 var activationDistance = toast.el.offsetWidth * toast.options.activationPercent; 12750 toast.el.style.transform = "translateX(" + totalDeltaX + "px)"; 12751 toast.el.style.opacity = 1 - Math.abs(totalDeltaX / activationDistance); 12752 } 12753 } 12754 12755 /** 12756 * End drag handler 12757 */ 12758 12759 }, { 12760 key: "_onDragEnd", 12761 value: function _onDragEnd() { 12762 if (!!Toast._draggedToast) { 12763 var toast = Toast._draggedToast; 12764 toast.panning = false; 12765 toast.el.classList.remove('panning'); 12766 12767 var totalDeltaX = toast.xPos - toast.startingXPos; 12768 var activationDistance = toast.el.offsetWidth * toast.options.activationPercent; 12769 var shouldBeDismissed = Math.abs(totalDeltaX) > activationDistance || toast.velocityX > 1; 12770 12771 // Remove toast 12772 if (shouldBeDismissed) { 12773 toast.wasSwiped = true; 12774 toast.dismiss(); 12775 12776 // Animate toast back to original position 12777 } else { 12778 toast.el.style.transition = 'transform .2s, opacity .2s'; 12779 toast.el.style.transform = ''; 12780 toast.el.style.opacity = ''; 12781 } 12782 Toast._draggedToast = null; 12783 } 12784 } 12785 12786 /** 12787 * Get x position of mouse or touch event 12788 * @param {Event} e 12789 */ 12790 12791 }, { 12792 key: "_xPos", 12793 value: function _xPos(e) { 12794 if (e.targetTouches && e.targetTouches.length >= 1) { 12795 return e.targetTouches[0].clientX; 12796 } 12797 // mouse event 12798 return e.clientX; 12799 } 12800 12801 /** 12802 * Remove all toasts 12803 */ 12804 12805 }, { 12806 key: "dismissAll", 12807 value: function dismissAll() { 12808 for (var toastIndex in Toast._toasts) { 12809 Toast._toasts[toastIndex].dismiss(); 12810 } 12811 } 12812 }, { 12813 key: "defaults", 12814 get: function () { 12815 return _defaults; 12816 } 12817 }]); 12818 12819 return Toast; 12820 }(); 12821 12822 /** 12823 * @static 12824 * @memberof Toast 12825 * @type {Array.<Toast>} 12826 */ 12827 12828 12829 Toast._toasts = []; 12830 12831 /** 12832 * @static 12833 * @memberof Toast 12834 */ 12835 Toast._container = null; 12836 12837 /** 12838 * @static 12839 * @memberof Toast 12840 * @type {Toast} 12841 */ 12842 Toast._draggedToast = null; 12843 12844 M.Toast = Toast; 12845 M.toast = function (options) { 12846 return new Toast(options); 12847 }; 12848})(cash, M.anime); 12849;(function ($, anim) { 12850 'use strict'; 12851 12852 var _defaults = { 12853 edge: 'left', 12854 draggable: true, 12855 inDuration: 250, 12856 outDuration: 200, 12857 onOpenStart: null, 12858 onOpenEnd: null, 12859 onCloseStart: null, 12860 onCloseEnd: null, 12861 preventScrolling: true 12862 }; 12863 12864 /** 12865 * @class 12866 */ 12867 12868 var Sidenav = function (_Component8) { 12869 _inherits(Sidenav, _Component8); 12870 12871 /** 12872 * Construct Sidenav instance and set up overlay 12873 * @constructor 12874 * @param {Element} el 12875 * @param {Object} options 12876 */ 12877 function Sidenav(el, options) { 12878 _classCallCheck(this, Sidenav); 12879 12880 var _this31 = _possibleConstructorReturn(this, (Sidenav.__proto__ || Object.getPrototypeOf(Sidenav)).call(this, Sidenav, el, options)); 12881 12882 _this31.el.M_Sidenav = _this31; 12883 _this31.id = _this31.$el.attr('id'); 12884 12885 /** 12886 * Options for the Sidenav 12887 * @member Sidenav#options 12888 * @prop {String} [edge='left'] - Side of screen on which Sidenav appears 12889 * @prop {Boolean} [draggable=true] - Allow swipe gestures to open/close Sidenav 12890 * @prop {Number} [inDuration=250] - Length in ms of enter transition 12891 * @prop {Number} [outDuration=200] - Length in ms of exit transition 12892 * @prop {Function} onOpenStart - Function called when sidenav starts entering 12893 * @prop {Function} onOpenEnd - Function called when sidenav finishes entering 12894 * @prop {Function} onCloseStart - Function called when sidenav starts exiting 12895 * @prop {Function} onCloseEnd - Function called when sidenav finishes exiting 12896 */ 12897 _this31.options = $.extend({}, Sidenav.defaults, options); 12898 12899 /** 12900 * Describes open/close state of Sidenav 12901 * @type {Boolean} 12902 */ 12903 _this31.isOpen = false; 12904 12905 /** 12906 * Describes if Sidenav is fixed 12907 * @type {Boolean} 12908 */ 12909 _this31.isFixed = _this31.el.classList.contains('sidenav-fixed'); 12910 12911 /** 12912 * Describes if Sidenav is being draggeed 12913 * @type {Boolean} 12914 */ 12915 _this31.isDragged = false; 12916 12917 // Window size variables for window resize checks 12918 _this31.lastWindowWidth = window.innerWidth; 12919 _this31.lastWindowHeight = window.innerHeight; 12920 12921 _this31._createOverlay(); 12922 _this31._createDragTarget(); 12923 _this31._setupEventHandlers(); 12924 _this31._setupClasses(); 12925 _this31._setupFixed(); 12926 12927 Sidenav._sidenavs.push(_this31); 12928 return _this31; 12929 } 12930 12931 _createClass(Sidenav, [{ 12932 key: "destroy", 12933 12934 12935 /** 12936 * Teardown component 12937 */ 12938 value: function destroy() { 12939 this._removeEventHandlers(); 12940 this._enableBodyScrolling(); 12941 this._overlay.parentNode.removeChild(this._overlay); 12942 this.dragTarget.parentNode.removeChild(this.dragTarget); 12943 this.el.M_Sidenav = undefined; 12944 this.el.style.transform = ''; 12945 12946 var index = Sidenav._sidenavs.indexOf(this); 12947 if (index >= 0) { 12948 Sidenav._sidenavs.splice(index, 1); 12949 } 12950 } 12951 }, { 12952 key: "_createOverlay", 12953 value: function _createOverlay() { 12954 var overlay = document.createElement('div'); 12955 this._closeBound = this.close.bind(this); 12956 overlay.classList.add('sidenav-overlay'); 12957 12958 overlay.addEventListener('click', this._closeBound); 12959 12960 document.body.appendChild(overlay); 12961 this._overlay = overlay; 12962 } 12963 }, { 12964 key: "_setupEventHandlers", 12965 value: function _setupEventHandlers() { 12966 if (Sidenav._sidenavs.length === 0) { 12967 document.body.addEventListener('click', this._handleTriggerClick); 12968 } 12969 12970 this._handleDragTargetDragBound = this._handleDragTargetDrag.bind(this); 12971 this._handleDragTargetReleaseBound = this._handleDragTargetRelease.bind(this); 12972 this._handleCloseDragBound = this._handleCloseDrag.bind(this); 12973 this._handleCloseReleaseBound = this._handleCloseRelease.bind(this); 12974 this._handleCloseTriggerClickBound = this._handleCloseTriggerClick.bind(this); 12975 12976 this.dragTarget.addEventListener('touchmove', this._handleDragTargetDragBound); 12977 this.dragTarget.addEventListener('touchend', this._handleDragTargetReleaseBound); 12978 this._overlay.addEventListener('touchmove', this._handleCloseDragBound); 12979 this._overlay.addEventListener('touchend', this._handleCloseReleaseBound); 12980 this.el.addEventListener('touchmove', this._handleCloseDragBound); 12981 this.el.addEventListener('touchend', this._handleCloseReleaseBound); 12982 this.el.addEventListener('click', this._handleCloseTriggerClickBound); 12983 12984 // Add resize for side nav fixed 12985 if (this.isFixed) { 12986 this._handleWindowResizeBound = this._handleWindowResize.bind(this); 12987 window.addEventListener('resize', this._handleWindowResizeBound); 12988 } 12989 } 12990 }, { 12991 key: "_removeEventHandlers", 12992 value: function _removeEventHandlers() { 12993 if (Sidenav._sidenavs.length === 1) { 12994 document.body.removeEventListener('click', this._handleTriggerClick); 12995 } 12996 12997 this.dragTarget.removeEventListener('touchmove', this._handleDragTargetDragBound); 12998 this.dragTarget.removeEventListener('touchend', this._handleDragTargetReleaseBound); 12999 this._overlay.removeEventListener('touchmove', this._handleCloseDragBound); 13000 this._overlay.removeEventListener('touchend', this._handleCloseReleaseBound); 13001 this.el.removeEventListener('touchmove', this._handleCloseDragBound); 13002 this.el.removeEventListener('touchend', this._handleCloseReleaseBound); 13003 this.el.removeEventListener('click', this._handleCloseTriggerClickBound); 13004 13005 // Remove resize for side nav fixed 13006 if (this.isFixed) { 13007 window.removeEventListener('resize', this._handleWindowResizeBound); 13008 } 13009 } 13010 13011 /** 13012 * Handle Trigger Click 13013 * @param {Event} e 13014 */ 13015 13016 }, { 13017 key: "_handleTriggerClick", 13018 value: function _handleTriggerClick(e) { 13019 var $trigger = $(e.target).closest('.sidenav-trigger'); 13020 if (e.target && $trigger.length) { 13021 var sidenavId = M.getIdFromTrigger($trigger[0]); 13022 13023 var sidenavInstance = document.getElementById(sidenavId).M_Sidenav; 13024 if (sidenavInstance) { 13025 sidenavInstance.open($trigger); 13026 } 13027 e.preventDefault(); 13028 } 13029 } 13030 13031 /** 13032 * Set variables needed at the beggining of drag 13033 * and stop any current transition. 13034 * @param {Event} e 13035 */ 13036 13037 }, { 13038 key: "_startDrag", 13039 value: function _startDrag(e) { 13040 var clientX = e.targetTouches[0].clientX; 13041 this.isDragged = true; 13042 this._startingXpos = clientX; 13043 this._xPos = this._startingXpos; 13044 this._time = Date.now(); 13045 this._width = this.el.getBoundingClientRect().width; 13046 this._overlay.style.display = 'block'; 13047 this._initialScrollTop = this.isOpen ? this.el.scrollTop : M.getDocumentScrollTop(); 13048 this._verticallyScrolling = false; 13049 anim.remove(this.el); 13050 anim.remove(this._overlay); 13051 } 13052 13053 /** 13054 * Set variables needed at each drag move update tick 13055 * @param {Event} e 13056 */ 13057 13058 }, { 13059 key: "_dragMoveUpdate", 13060 value: function _dragMoveUpdate(e) { 13061 var clientX = e.targetTouches[0].clientX; 13062 var currentScrollTop = this.isOpen ? this.el.scrollTop : M.getDocumentScrollTop(); 13063 this.deltaX = Math.abs(this._xPos - clientX); 13064 this._xPos = clientX; 13065 this.velocityX = this.deltaX / (Date.now() - this._time); 13066 this._time = Date.now(); 13067 if (this._initialScrollTop !== currentScrollTop) { 13068 this._verticallyScrolling = true; 13069 } 13070 } 13071 13072 /** 13073 * Handles Dragging of Sidenav 13074 * @param {Event} e 13075 */ 13076 13077 }, { 13078 key: "_handleDragTargetDrag", 13079 value: function _handleDragTargetDrag(e) { 13080 // Check if draggable 13081 if (!this.options.draggable || this._isCurrentlyFixed() || this._verticallyScrolling) { 13082 return; 13083 } 13084 13085 // If not being dragged, set initial drag start variables 13086 if (!this.isDragged) { 13087 this._startDrag(e); 13088 } 13089 13090 // Run touchmove updates 13091 this._dragMoveUpdate(e); 13092 13093 // Calculate raw deltaX 13094 var totalDeltaX = this._xPos - this._startingXpos; 13095 13096 // dragDirection is the attempted user drag direction 13097 var dragDirection = totalDeltaX > 0 ? 'right' : 'left'; 13098 13099 // Don't allow totalDeltaX to exceed Sidenav width or be dragged in the opposite direction 13100 totalDeltaX = Math.min(this._width, Math.abs(totalDeltaX)); 13101 if (this.options.edge === dragDirection) { 13102 totalDeltaX = 0; 13103 } 13104 13105 /** 13106 * transformX is the drag displacement 13107 * transformPrefix is the initial transform placement 13108 * Invert values if Sidenav is right edge 13109 */ 13110 var transformX = totalDeltaX; 13111 var transformPrefix = 'translateX(-100%)'; 13112 if (this.options.edge === 'right') { 13113 transformPrefix = 'translateX(100%)'; 13114 transformX = -transformX; 13115 } 13116 13117 // Calculate open/close percentage of sidenav, with open = 1 and close = 0 13118 this.percentOpen = Math.min(1, totalDeltaX / this._width); 13119 13120 // Set transform and opacity styles 13121 this.el.style.transform = transformPrefix + " translateX(" + transformX + "px)"; 13122 this._overlay.style.opacity = this.percentOpen; 13123 } 13124 13125 /** 13126 * Handle Drag Target Release 13127 */ 13128 13129 }, { 13130 key: "_handleDragTargetRelease", 13131 value: function _handleDragTargetRelease() { 13132 if (this.isDragged) { 13133 if (this.percentOpen > 0.2) { 13134 this.open(); 13135 } else { 13136 this._animateOut(); 13137 } 13138 13139 this.isDragged = false; 13140 this._verticallyScrolling = false; 13141 } 13142 } 13143 13144 /** 13145 * Handle Close Drag 13146 * @param {Event} e 13147 */ 13148 13149 }, { 13150 key: "_handleCloseDrag", 13151 value: function _handleCloseDrag(e) { 13152 if (this.isOpen) { 13153 // Check if draggable 13154 if (!this.options.draggable || this._isCurrentlyFixed() || this._verticallyScrolling) { 13155 return; 13156 } 13157 13158 // If not being dragged, set initial drag start variables 13159 if (!this.isDragged) { 13160 this._startDrag(e); 13161 } 13162 13163 // Run touchmove updates 13164 this._dragMoveUpdate(e); 13165 13166 // Calculate raw deltaX 13167 var totalDeltaX = this._xPos - this._startingXpos; 13168 13169 // dragDirection is the attempted user drag direction 13170 var dragDirection = totalDeltaX > 0 ? 'right' : 'left'; 13171 13172 // Don't allow totalDeltaX to exceed Sidenav width or be dragged in the opposite direction 13173 totalDeltaX = Math.min(this._width, Math.abs(totalDeltaX)); 13174 if (this.options.edge !== dragDirection) { 13175 totalDeltaX = 0; 13176 } 13177 13178 var transformX = -totalDeltaX; 13179 if (this.options.edge === 'right') { 13180 transformX = -transformX; 13181 } 13182 13183 // Calculate open/close percentage of sidenav, with open = 1 and close = 0 13184 this.percentOpen = Math.min(1, 1 - totalDeltaX / this._width); 13185 13186 // Set transform and opacity styles 13187 this.el.style.transform = "translateX(" + transformX + "px)"; 13188 this._overlay.style.opacity = this.percentOpen; 13189 } 13190 } 13191 13192 /** 13193 * Handle Close Release 13194 */ 13195 13196 }, { 13197 key: "_handleCloseRelease", 13198 value: function _handleCloseRelease() { 13199 if (this.isOpen && this.isDragged) { 13200 if (this.percentOpen > 0.8) { 13201 this._animateIn(); 13202 } else { 13203 this.close(); 13204 } 13205 13206 this.isDragged = false; 13207 this._verticallyScrolling = false; 13208 } 13209 } 13210 13211 /** 13212 * Handles closing of Sidenav when element with class .sidenav-close 13213 */ 13214 13215 }, { 13216 key: "_handleCloseTriggerClick", 13217 value: function _handleCloseTriggerClick(e) { 13218 var $closeTrigger = $(e.target).closest('.sidenav-close'); 13219 if ($closeTrigger.length && !this._isCurrentlyFixed()) { 13220 this.close(); 13221 } 13222 } 13223 13224 /** 13225 * Handle Window Resize 13226 */ 13227 13228 }, { 13229 key: "_handleWindowResize", 13230 value: function _handleWindowResize() { 13231 // Only handle horizontal resizes 13232 if (this.lastWindowWidth !== window.innerWidth) { 13233 if (window.innerWidth > 992) { 13234 this.open(); 13235 } else { 13236 this.close(); 13237 } 13238 } 13239 13240 this.lastWindowWidth = window.innerWidth; 13241 this.lastWindowHeight = window.innerHeight; 13242 } 13243 }, { 13244 key: "_setupClasses", 13245 value: function _setupClasses() { 13246 if (this.options.edge === 'right') { 13247 this.el.classList.add('right-aligned'); 13248 this.dragTarget.classList.add('right-aligned'); 13249 } 13250 } 13251 }, { 13252 key: "_removeClasses", 13253 value: function _removeClasses() { 13254 this.el.classList.remove('right-aligned'); 13255 this.dragTarget.classList.remove('right-aligned'); 13256 } 13257 }, { 13258 key: "_setupFixed", 13259 value: function _setupFixed() { 13260 if (this._isCurrentlyFixed()) { 13261 this.open(); 13262 } 13263 } 13264 }, { 13265 key: "_isCurrentlyFixed", 13266 value: function _isCurrentlyFixed() { 13267 return this.isFixed && window.innerWidth > 992; 13268 } 13269 }, { 13270 key: "_createDragTarget", 13271 value: function _createDragTarget() { 13272 var dragTarget = document.createElement('div'); 13273 dragTarget.classList.add('drag-target'); 13274 document.body.appendChild(dragTarget); 13275 this.dragTarget = dragTarget; 13276 } 13277 }, { 13278 key: "_preventBodyScrolling", 13279 value: function _preventBodyScrolling() { 13280 var body = document.body; 13281 body.style.overflow = 'hidden'; 13282 } 13283 }, { 13284 key: "_enableBodyScrolling", 13285 value: function _enableBodyScrolling() { 13286 var body = document.body; 13287 body.style.overflow = ''; 13288 } 13289 }, { 13290 key: "open", 13291 value: function open() { 13292 if (this.isOpen === true) { 13293 return; 13294 } 13295 13296 this.isOpen = true; 13297 13298 // Run onOpenStart callback 13299 if (typeof this.options.onOpenStart === 'function') { 13300 this.options.onOpenStart.call(this, this.el); 13301 } 13302 13303 // Handle fixed Sidenav 13304 if (this._isCurrentlyFixed()) { 13305 anim.remove(this.el); 13306 anim({ 13307 targets: this.el, 13308 translateX: 0, 13309 duration: 0, 13310 easing: 'easeOutQuad' 13311 }); 13312 this._enableBodyScrolling(); 13313 this._overlay.style.display = 'none'; 13314 13315 // Handle non-fixed Sidenav 13316 } else { 13317 if (this.options.preventScrolling) { 13318 this._preventBodyScrolling(); 13319 } 13320 13321 if (!this.isDragged || this.percentOpen != 1) { 13322 this._animateIn(); 13323 } 13324 } 13325 } 13326 }, { 13327 key: "close", 13328 value: function close() { 13329 if (this.isOpen === false) { 13330 return; 13331 } 13332 13333 this.isOpen = false; 13334 13335 // Run onCloseStart callback 13336 if (typeof this.options.onCloseStart === 'function') { 13337 this.options.onCloseStart.call(this, this.el); 13338 } 13339 13340 // Handle fixed Sidenav 13341 if (this._isCurrentlyFixed()) { 13342 var transformX = this.options.edge === 'left' ? '-105%' : '105%'; 13343 this.el.style.transform = "translateX(" + transformX + ")"; 13344 13345 // Handle non-fixed Sidenav 13346 } else { 13347 this._enableBodyScrolling(); 13348 13349 if (!this.isDragged || this.percentOpen != 0) { 13350 this._animateOut(); 13351 } else { 13352 this._overlay.style.display = 'none'; 13353 } 13354 } 13355 } 13356 }, { 13357 key: "_animateIn", 13358 value: function _animateIn() { 13359 this._animateSidenavIn(); 13360 this._animateOverlayIn(); 13361 } 13362 }, { 13363 key: "_animateSidenavIn", 13364 value: function _animateSidenavIn() { 13365 var _this32 = this; 13366 13367 var slideOutPercent = this.options.edge === 'left' ? -1 : 1; 13368 if (this.isDragged) { 13369 slideOutPercent = this.options.edge === 'left' ? slideOutPercent + this.percentOpen : slideOutPercent - this.percentOpen; 13370 } 13371 13372 anim.remove(this.el); 13373 anim({ 13374 targets: this.el, 13375 translateX: [slideOutPercent * 100 + "%", 0], 13376 duration: this.options.inDuration, 13377 easing: 'easeOutQuad', 13378 complete: function () { 13379 // Run onOpenEnd callback 13380 if (typeof _this32.options.onOpenEnd === 'function') { 13381 _this32.options.onOpenEnd.call(_this32, _this32.el); 13382 } 13383 } 13384 }); 13385 } 13386 }, { 13387 key: "_animateOverlayIn", 13388 value: function _animateOverlayIn() { 13389 var start = 0; 13390 if (this.isDragged) { 13391 start = this.percentOpen; 13392 } else { 13393 $(this._overlay).css({ 13394 display: 'block' 13395 }); 13396 } 13397 13398 anim.remove(this._overlay); 13399 anim({ 13400 targets: this._overlay, 13401 opacity: [start, 1], 13402 duration: this.options.inDuration, 13403 easing: 'easeOutQuad' 13404 }); 13405 } 13406 }, { 13407 key: "_animateOut", 13408 value: function _animateOut() { 13409 this._animateSidenavOut(); 13410 this._animateOverlayOut(); 13411 } 13412 }, { 13413 key: "_animateSidenavOut", 13414 value: function _animateSidenavOut() { 13415 var _this33 = this; 13416 13417 var endPercent = this.options.edge === 'left' ? -1 : 1; 13418 var slideOutPercent = 0; 13419 if (this.isDragged) { 13420 slideOutPercent = this.options.edge === 'left' ? endPercent + this.percentOpen : endPercent - this.percentOpen; 13421 } 13422 13423 anim.remove(this.el); 13424 anim({ 13425 targets: this.el, 13426 translateX: [slideOutPercent * 100 + "%", endPercent * 105 + "%"], 13427 duration: this.options.outDuration, 13428 easing: 'easeOutQuad', 13429 complete: function () { 13430 // Run onOpenEnd callback 13431 if (typeof _this33.options.onCloseEnd === 'function') { 13432 _this33.options.onCloseEnd.call(_this33, _this33.el); 13433 } 13434 } 13435 }); 13436 } 13437 }, { 13438 key: "_animateOverlayOut", 13439 value: function _animateOverlayOut() { 13440 var _this34 = this; 13441 13442 anim.remove(this._overlay); 13443 anim({ 13444 targets: this._overlay, 13445 opacity: 0, 13446 duration: this.options.outDuration, 13447 easing: 'easeOutQuad', 13448 complete: function () { 13449 $(_this34._overlay).css('display', 'none'); 13450 } 13451 }); 13452 } 13453 }], [{ 13454 key: "init", 13455 value: function init(els, options) { 13456 return _get(Sidenav.__proto__ || Object.getPrototypeOf(Sidenav), "init", this).call(this, this, els, options); 13457 } 13458 13459 /** 13460 * Get Instance 13461 */ 13462 13463 }, { 13464 key: "getInstance", 13465 value: function getInstance(el) { 13466 var domElem = !!el.jquery ? el[0] : el; 13467 return domElem.M_Sidenav; 13468 } 13469 }, { 13470 key: "defaults", 13471 get: function () { 13472 return _defaults; 13473 } 13474 }]); 13475 13476 return Sidenav; 13477 }(Component); 13478 13479 /** 13480 * @static 13481 * @memberof Sidenav 13482 * @type {Array.<Sidenav>} 13483 */ 13484 13485 13486 Sidenav._sidenavs = []; 13487 13488 M.Sidenav = Sidenav; 13489 13490 if (M.jQueryLoaded) { 13491 M.initializeJqueryWrapper(Sidenav, 'sidenav', 'M_Sidenav'); 13492 } 13493})(cash, M.anime); 13494;(function ($, anim) { 13495 'use strict'; 13496 13497 var _defaults = { 13498 throttle: 100, 13499 scrollOffset: 200, // offset - 200 allows elements near bottom of page to scroll 13500 activeClass: 'active', 13501 getActiveElement: function (id) { 13502 return 'a[href="#' + id + '"]'; 13503 } 13504 }; 13505 13506 /** 13507 * @class 13508 * 13509 */ 13510 13511 var ScrollSpy = function (_Component9) { 13512 _inherits(ScrollSpy, _Component9); 13513 13514 /** 13515 * Construct ScrollSpy instance 13516 * @constructor 13517 * @param {Element} el 13518 * @param {Object} options 13519 */ 13520 function ScrollSpy(el, options) { 13521 _classCallCheck(this, ScrollSpy); 13522 13523 var _this35 = _possibleConstructorReturn(this, (ScrollSpy.__proto__ || Object.getPrototypeOf(ScrollSpy)).call(this, ScrollSpy, el, options)); 13524 13525 _this35.el.M_ScrollSpy = _this35; 13526 13527 /** 13528 * Options for the modal 13529 * @member Modal#options 13530 * @prop {Number} [throttle=100] - Throttle of scroll handler 13531 * @prop {Number} [scrollOffset=200] - Offset for centering element when scrolled to 13532 * @prop {String} [activeClass='active'] - Class applied to active elements 13533 * @prop {Function} [getActiveElement] - Used to find active element 13534 */ 13535 _this35.options = $.extend({}, ScrollSpy.defaults, options); 13536 13537 // setup 13538 ScrollSpy._elements.push(_this35); 13539 ScrollSpy._count++; 13540 ScrollSpy._increment++; 13541 _this35.tickId = -1; 13542 _this35.id = ScrollSpy._increment; 13543 _this35._setupEventHandlers(); 13544 _this35._handleWindowScroll(); 13545 return _this35; 13546 } 13547 13548 _createClass(ScrollSpy, [{ 13549 key: "destroy", 13550 13551 13552 /** 13553 * Teardown component 13554 */ 13555 value: function destroy() { 13556 ScrollSpy._elements.splice(ScrollSpy._elements.indexOf(this), 1); 13557 ScrollSpy._elementsInView.splice(ScrollSpy._elementsInView.indexOf(this), 1); 13558 ScrollSpy._visibleElements.splice(ScrollSpy._visibleElements.indexOf(this.$el), 1); 13559 ScrollSpy._count--; 13560 this._removeEventHandlers(); 13561 $(this.options.getActiveElement(this.$el.attr('id'))).removeClass(this.options.activeClass); 13562 this.el.M_ScrollSpy = undefined; 13563 } 13564 13565 /** 13566 * Setup Event Handlers 13567 */ 13568 13569 }, { 13570 key: "_setupEventHandlers", 13571 value: function _setupEventHandlers() { 13572 var throttledResize = M.throttle(this._handleWindowScroll, 200); 13573 this._handleThrottledResizeBound = throttledResize.bind(this); 13574 this._handleWindowScrollBound = this._handleWindowScroll.bind(this); 13575 if (ScrollSpy._count === 1) { 13576 window.addEventListener('scroll', this._handleWindowScrollBound); 13577 window.addEventListener('resize', this._handleThrottledResizeBound); 13578 document.body.addEventListener('click', this._handleTriggerClick); 13579 } 13580 } 13581 13582 /** 13583 * Remove Event Handlers 13584 */ 13585 13586 }, { 13587 key: "_removeEventHandlers", 13588 value: function _removeEventHandlers() { 13589 if (ScrollSpy._count === 0) { 13590 window.removeEventListener('scroll', this._handleWindowScrollBound); 13591 window.removeEventListener('resize', this._handleThrottledResizeBound); 13592 document.body.removeEventListener('click', this._handleTriggerClick); 13593 } 13594 } 13595 13596 /** 13597 * Handle Trigger Click 13598 * @param {Event} e 13599 */ 13600 13601 }, { 13602 key: "_handleTriggerClick", 13603 value: function _handleTriggerClick(e) { 13604 var $trigger = $(e.target); 13605 for (var i = ScrollSpy._elements.length - 1; i >= 0; i--) { 13606 var scrollspy = ScrollSpy._elements[i]; 13607 if ($trigger.is('a[href="#' + scrollspy.$el.attr('id') + '"]')) { 13608 e.preventDefault(); 13609 var offset = scrollspy.$el.offset().top + 1; 13610 13611 anim({ 13612 targets: [document.documentElement, document.body], 13613 scrollTop: offset - scrollspy.options.scrollOffset, 13614 duration: 400, 13615 easing: 'easeOutCubic' 13616 }); 13617 break; 13618 } 13619 } 13620 } 13621 13622 /** 13623 * Handle Window Scroll 13624 */ 13625 13626 }, { 13627 key: "_handleWindowScroll", 13628 value: function _handleWindowScroll() { 13629 // unique tick id 13630 ScrollSpy._ticks++; 13631 13632 // viewport rectangle 13633 var top = M.getDocumentScrollTop(), 13634 left = M.getDocumentScrollLeft(), 13635 right = left + window.innerWidth, 13636 bottom = top + window.innerHeight; 13637 13638 // determine which elements are in view 13639 var intersections = ScrollSpy._findElements(top, right, bottom, left); 13640 for (var i = 0; i < intersections.length; i++) { 13641 var scrollspy = intersections[i]; 13642 var lastTick = scrollspy.tickId; 13643 if (lastTick < 0) { 13644 // entered into view 13645 scrollspy._enter(); 13646 } 13647 13648 // update tick id 13649 scrollspy.tickId = ScrollSpy._ticks; 13650 } 13651 13652 for (var _i = 0; _i < ScrollSpy._elementsInView.length; _i++) { 13653 var _scrollspy = ScrollSpy._elementsInView[_i]; 13654 var _lastTick = _scrollspy.tickId; 13655 if (_lastTick >= 0 && _lastTick !== ScrollSpy._ticks) { 13656 // exited from view 13657 _scrollspy._exit(); 13658 _scrollspy.tickId = -1; 13659 } 13660 } 13661 13662 // remember elements in view for next tick 13663 ScrollSpy._elementsInView = intersections; 13664 } 13665 13666 /** 13667 * Find elements that are within the boundary 13668 * @param {number} top 13669 * @param {number} right 13670 * @param {number} bottom 13671 * @param {number} left 13672 * @return {Array.<ScrollSpy>} A collection of elements 13673 */ 13674 13675 }, { 13676 key: "_enter", 13677 value: function _enter() { 13678 ScrollSpy._visibleElements = ScrollSpy._visibleElements.filter(function (value) { 13679 return value.height() != 0; 13680 }); 13681 13682 if (ScrollSpy._visibleElements[0]) { 13683 $(this.options.getActiveElement(ScrollSpy._visibleElements[0].attr('id'))).removeClass(this.options.activeClass); 13684 if (ScrollSpy._visibleElements[0][0].M_ScrollSpy && this.id < ScrollSpy._visibleElements[0][0].M_ScrollSpy.id) { 13685 ScrollSpy._visibleElements.unshift(this.$el); 13686 } else { 13687 ScrollSpy._visibleElements.push(this.$el); 13688 } 13689 } else { 13690 ScrollSpy._visibleElements.push(this.$el); 13691 } 13692 13693 $(this.options.getActiveElement(ScrollSpy._visibleElements[0].attr('id'))).addClass(this.options.activeClass); 13694 } 13695 }, { 13696 key: "_exit", 13697 value: function _exit() { 13698 var _this36 = this; 13699 13700 ScrollSpy._visibleElements = ScrollSpy._visibleElements.filter(function (value) { 13701 return value.height() != 0; 13702 }); 13703 13704 if (ScrollSpy._visibleElements[0]) { 13705 $(this.options.getActiveElement(ScrollSpy._visibleElements[0].attr('id'))).removeClass(this.options.activeClass); 13706 13707 ScrollSpy._visibleElements = ScrollSpy._visibleElements.filter(function (el) { 13708 return el.attr('id') != _this36.$el.attr('id'); 13709 }); 13710 if (ScrollSpy._visibleElements[0]) { 13711 // Check if empty 13712 $(this.options.getActiveElement(ScrollSpy._visibleElements[0].attr('id'))).addClass(this.options.activeClass); 13713 } 13714 } 13715 } 13716 }], [{ 13717 key: "init", 13718 value: function init(els, options) { 13719 return _get(ScrollSpy.__proto__ || Object.getPrototypeOf(ScrollSpy), "init", this).call(this, this, els, options); 13720 } 13721 13722 /** 13723 * Get Instance 13724 */ 13725 13726 }, { 13727 key: "getInstance", 13728 value: function getInstance(el) { 13729 var domElem = !!el.jquery ? el[0] : el; 13730 return domElem.M_ScrollSpy; 13731 } 13732 }, { 13733 key: "_findElements", 13734 value: function _findElements(top, right, bottom, left) { 13735 var hits = []; 13736 for (var i = 0; i < ScrollSpy._elements.length; i++) { 13737 var scrollspy = ScrollSpy._elements[i]; 13738 var currTop = top + scrollspy.options.scrollOffset || 200; 13739 13740 if (scrollspy.$el.height() > 0) { 13741 var elTop = scrollspy.$el.offset().top, 13742 elLeft = scrollspy.$el.offset().left, 13743 elRight = elLeft + scrollspy.$el.width(), 13744 elBottom = elTop + scrollspy.$el.height(); 13745 13746 var isIntersect = !(elLeft > right || elRight < left || elTop > bottom || elBottom < currTop); 13747 13748 if (isIntersect) { 13749 hits.push(scrollspy); 13750 } 13751 } 13752 } 13753 return hits; 13754 } 13755 }, { 13756 key: "defaults", 13757 get: function () { 13758 return _defaults; 13759 } 13760 }]); 13761 13762 return ScrollSpy; 13763 }(Component); 13764 13765 /** 13766 * @static 13767 * @memberof ScrollSpy 13768 * @type {Array.<ScrollSpy>} 13769 */ 13770 13771 13772 ScrollSpy._elements = []; 13773 13774 /** 13775 * @static 13776 * @memberof ScrollSpy 13777 * @type {Array.<ScrollSpy>} 13778 */ 13779 ScrollSpy._elementsInView = []; 13780 13781 /** 13782 * @static 13783 * @memberof ScrollSpy 13784 * @type {Array.<cash>} 13785 */ 13786 ScrollSpy._visibleElements = []; 13787 13788 /** 13789 * @static 13790 * @memberof ScrollSpy 13791 */ 13792 ScrollSpy._count = 0; 13793 13794 /** 13795 * @static 13796 * @memberof ScrollSpy 13797 */ 13798 ScrollSpy._increment = 0; 13799 13800 /** 13801 * @static 13802 * @memberof ScrollSpy 13803 */ 13804 ScrollSpy._ticks = 0; 13805 13806 M.ScrollSpy = ScrollSpy; 13807 13808 if (M.jQueryLoaded) { 13809 M.initializeJqueryWrapper(ScrollSpy, 'scrollSpy', 'M_ScrollSpy'); 13810 } 13811})(cash, M.anime); 13812;(function ($) { 13813 'use strict'; 13814 13815 var _defaults = { 13816 data: {}, // Autocomplete data set 13817 limit: Infinity, // Limit of results the autocomplete shows 13818 onAutocomplete: null, // Callback for when autocompleted 13819 minLength: 1, // Min characters before autocomplete starts 13820 sortFunction: function (a, b, inputString) { 13821 // Sort function for sorting autocomplete results 13822 return a.indexOf(inputString) - b.indexOf(inputString); 13823 } 13824 }; 13825 13826 /** 13827 * @class 13828 * 13829 */ 13830 13831 var Autocomplete = function (_Component10) { 13832 _inherits(Autocomplete, _Component10); 13833 13834 /** 13835 * Construct Autocomplete instance 13836 * @constructor 13837 * @param {Element} el 13838 * @param {Object} options 13839 */ 13840 function Autocomplete(el, options) { 13841 _classCallCheck(this, Autocomplete); 13842 13843 var _this37 = _possibleConstructorReturn(this, (Autocomplete.__proto__ || Object.getPrototypeOf(Autocomplete)).call(this, Autocomplete, el, options)); 13844 13845 _this37.el.M_Autocomplete = _this37; 13846 13847 /** 13848 * Options for the autocomplete 13849 * @member Autocomplete#options 13850 * @prop {Number} duration 13851 * @prop {Number} dist 13852 * @prop {number} shift 13853 * @prop {number} padding 13854 * @prop {Boolean} fullWidth 13855 * @prop {Boolean} indicators 13856 * @prop {Boolean} noWrap 13857 * @prop {Function} onCycleTo 13858 */ 13859 _this37.options = $.extend({}, Autocomplete.defaults, options); 13860 13861 // Setup 13862 _this37.isOpen = false; 13863 _this37.count = 0; 13864 _this37.activeIndex = -1; 13865 _this37.oldVal; 13866 _this37.$inputField = _this37.$el.closest('.input-field'); 13867 _this37.$active = $(); 13868 _this37._mousedown = false; 13869 _this37._setupDropdown(); 13870 13871 _this37._setupEventHandlers(); 13872 return _this37; 13873 } 13874 13875 _createClass(Autocomplete, [{ 13876 key: "destroy", 13877 13878 13879 /** 13880 * Teardown component 13881 */ 13882 value: function destroy() { 13883 this._removeEventHandlers(); 13884 this._removeDropdown(); 13885 this.el.M_Autocomplete = undefined; 13886 } 13887 13888 /** 13889 * Setup Event Handlers 13890 */ 13891 13892 }, { 13893 key: "_setupEventHandlers", 13894 value: function _setupEventHandlers() { 13895 this._handleInputBlurBound = this._handleInputBlur.bind(this); 13896 this._handleInputKeyupAndFocusBound = this._handleInputKeyupAndFocus.bind(this); 13897 this._handleInputKeydownBound = this._handleInputKeydown.bind(this); 13898 this._handleInputClickBound = this._handleInputClick.bind(this); 13899 this._handleContainerMousedownAndTouchstartBound = this._handleContainerMousedownAndTouchstart.bind(this); 13900 this._handleContainerMouseupAndTouchendBound = this._handleContainerMouseupAndTouchend.bind(this); 13901 13902 this.el.addEventListener('blur', this._handleInputBlurBound); 13903 this.el.addEventListener('keyup', this._handleInputKeyupAndFocusBound); 13904 this.el.addEventListener('focus', this._handleInputKeyupAndFocusBound); 13905 this.el.addEventListener('keydown', this._handleInputKeydownBound); 13906 this.el.addEventListener('click', this._handleInputClickBound); 13907 this.container.addEventListener('mousedown', this._handleContainerMousedownAndTouchstartBound); 13908 this.container.addEventListener('mouseup', this._handleContainerMouseupAndTouchendBound); 13909 13910 if (typeof window.ontouchstart !== 'undefined') { 13911 this.container.addEventListener('touchstart', this._handleContainerMousedownAndTouchstartBound); 13912 this.container.addEventListener('touchend', this._handleContainerMouseupAndTouchendBound); 13913 } 13914 } 13915 13916 /** 13917 * Remove Event Handlers 13918 */ 13919 13920 }, { 13921 key: "_removeEventHandlers", 13922 value: function _removeEventHandlers() { 13923 this.el.removeEventListener('blur', this._handleInputBlurBound); 13924 this.el.removeEventListener('keyup', this._handleInputKeyupAndFocusBound); 13925 this.el.removeEventListener('focus', this._handleInputKeyupAndFocusBound); 13926 this.el.removeEventListener('keydown', this._handleInputKeydownBound); 13927 this.el.removeEventListener('click', this._handleInputClickBound); 13928 this.container.removeEventListener('mousedown', this._handleContainerMousedownAndTouchstartBound); 13929 this.container.removeEventListener('mouseup', this._handleContainerMouseupAndTouchendBound); 13930 13931 if (typeof window.ontouchstart !== 'undefined') { 13932 this.container.removeEventListener('touchstart', this._handleContainerMousedownAndTouchstartBound); 13933 this.container.removeEventListener('touchend', this._handleContainerMouseupAndTouchendBound); 13934 } 13935 } 13936 13937 /** 13938 * Setup dropdown 13939 */ 13940 13941 }, { 13942 key: "_setupDropdown", 13943 value: function _setupDropdown() { 13944 var _this38 = this; 13945 13946 this.container = document.createElement('ul'); 13947 this.container.id = "autocomplete-options-" + M.guid(); 13948 $(this.container).addClass('autocomplete-content dropdown-content'); 13949 this.$inputField.append(this.container); 13950 this.el.setAttribute('data-target', this.container.id); 13951 13952 this.dropdown = M.Dropdown.init(this.el, { 13953 autoFocus: false, 13954 closeOnClick: false, 13955 coverTrigger: false, 13956 onItemClick: function (itemEl) { 13957 _this38.selectOption($(itemEl)); 13958 } 13959 }); 13960 13961 // Sketchy removal of dropdown click handler 13962 this.el.removeEventListener('click', this.dropdown._handleClickBound); 13963 } 13964 13965 /** 13966 * Remove dropdown 13967 */ 13968 13969 }, { 13970 key: "_removeDropdown", 13971 value: function _removeDropdown() { 13972 this.container.parentNode.removeChild(this.container); 13973 } 13974 13975 /** 13976 * Handle Input Blur 13977 */ 13978 13979 }, { 13980 key: "_handleInputBlur", 13981 value: function _handleInputBlur() { 13982 if (!this._mousedown) { 13983 this.close(); 13984 this._resetAutocomplete(); 13985 } 13986 } 13987 13988 /** 13989 * Handle Input Keyup and Focus 13990 * @param {Event} e 13991 */ 13992 13993 }, { 13994 key: "_handleInputKeyupAndFocus", 13995 value: function _handleInputKeyupAndFocus(e) { 13996 if (e.type === 'keyup') { 13997 Autocomplete._keydown = false; 13998 } 13999 14000 this.count = 0; 14001 var val = this.el.value.toLowerCase(); 14002 14003 // Don't capture enter or arrow key usage. 14004 if (e.keyCode === 13 || e.keyCode === 38 || e.keyCode === 40) { 14005 return; 14006 } 14007 14008 // Check if the input isn't empty 14009 // Check if focus triggered by tab 14010 if (this.oldVal !== val && (M.tabPressed || e.type !== 'focus')) { 14011 this.open(); 14012 } 14013 14014 // Update oldVal 14015 this.oldVal = val; 14016 } 14017 14018 /** 14019 * Handle Input Keydown 14020 * @param {Event} e 14021 */ 14022 14023 }, { 14024 key: "_handleInputKeydown", 14025 value: function _handleInputKeydown(e) { 14026 Autocomplete._keydown = true; 14027 14028 // Arrow keys and enter key usage 14029 var keyCode = e.keyCode, 14030 liElement = void 0, 14031 numItems = $(this.container).children('li').length; 14032 14033 // select element on Enter 14034 if (keyCode === M.keys.ENTER && this.activeIndex >= 0) { 14035 liElement = $(this.container).children('li').eq(this.activeIndex); 14036 if (liElement.length) { 14037 this.selectOption(liElement); 14038 e.preventDefault(); 14039 } 14040 return; 14041 } 14042 14043 // Capture up and down key 14044 if (keyCode === M.keys.ARROW_UP || keyCode === M.keys.ARROW_DOWN) { 14045 e.preventDefault(); 14046 14047 if (keyCode === M.keys.ARROW_UP && this.activeIndex > 0) { 14048 this.activeIndex--; 14049 } 14050 14051 if (keyCode === M.keys.ARROW_DOWN && this.activeIndex < numItems - 1) { 14052 this.activeIndex++; 14053 } 14054 14055 this.$active.removeClass('active'); 14056 if (this.activeIndex >= 0) { 14057 this.$active = $(this.container).children('li').eq(this.activeIndex); 14058 this.$active.addClass('active'); 14059 } 14060 } 14061 } 14062 14063 /** 14064 * Handle Input Click 14065 * @param {Event} e 14066 */ 14067 14068 }, { 14069 key: "_handleInputClick", 14070 value: function _handleInputClick(e) { 14071 this.open(); 14072 } 14073 14074 /** 14075 * Handle Container Mousedown and Touchstart 14076 * @param {Event} e 14077 */ 14078 14079 }, { 14080 key: "_handleContainerMousedownAndTouchstart", 14081 value: function _handleContainerMousedownAndTouchstart(e) { 14082 this._mousedown = true; 14083 } 14084 14085 /** 14086 * Handle Container Mouseup and Touchend 14087 * @param {Event} e 14088 */ 14089 14090 }, { 14091 key: "_handleContainerMouseupAndTouchend", 14092 value: function _handleContainerMouseupAndTouchend(e) { 14093 this._mousedown = false; 14094 } 14095 14096 /** 14097 * Highlight partial match 14098 */ 14099 14100 }, { 14101 key: "_highlight", 14102 value: function _highlight(string, $el) { 14103 var img = $el.find('img'); 14104 var matchStart = $el.text().toLowerCase().indexOf('' + string.toLowerCase() + ''), 14105 matchEnd = matchStart + string.length - 1, 14106 beforeMatch = $el.text().slice(0, matchStart), 14107 matchText = $el.text().slice(matchStart, matchEnd + 1), 14108 afterMatch = $el.text().slice(matchEnd + 1); 14109 $el.html("<span>" + beforeMatch + "<span class='highlight'>" + matchText + "</span>" + afterMatch + "</span>"); 14110 if (img.length) { 14111 $el.prepend(img); 14112 } 14113 } 14114 14115 /** 14116 * Reset current element position 14117 */ 14118 14119 }, { 14120 key: "_resetCurrentElement", 14121 value: function _resetCurrentElement() { 14122 this.activeIndex = -1; 14123 this.$active.removeClass('active'); 14124 } 14125 14126 /** 14127 * Reset autocomplete elements 14128 */ 14129 14130 }, { 14131 key: "_resetAutocomplete", 14132 value: function _resetAutocomplete() { 14133 $(this.container).empty(); 14134 this._resetCurrentElement(); 14135 this.oldVal = null; 14136 this.isOpen = false; 14137 this._mousedown = false; 14138 } 14139 14140 /** 14141 * Select autocomplete option 14142 * @param {Element} el Autocomplete option list item element 14143 */ 14144 14145 }, { 14146 key: "selectOption", 14147 value: function selectOption(el) { 14148 var text = el.text().trim(); 14149 this.el.value = text; 14150 this.$el.trigger('change'); 14151 this._resetAutocomplete(); 14152 this.close(); 14153 14154 // Handle onAutocomplete callback. 14155 if (typeof this.options.onAutocomplete === 'function') { 14156 this.options.onAutocomplete.call(this, text); 14157 } 14158 } 14159 14160 /** 14161 * Render dropdown content 14162 * @param {Object} data data set 14163 * @param {String} val current input value 14164 */ 14165 14166 }, { 14167 key: "_renderDropdown", 14168 value: function _renderDropdown(data, val) { 14169 var _this39 = this; 14170 14171 this._resetAutocomplete(); 14172 14173 var matchingData = []; 14174 14175 // Gather all matching data 14176 for (var key in data) { 14177 if (data.hasOwnProperty(key) && key.toLowerCase().indexOf(val) !== -1) { 14178 // Break if past limit 14179 if (this.count >= this.options.limit) { 14180 break; 14181 } 14182 14183 var entry = { 14184 data: data[key], 14185 key: key 14186 }; 14187 matchingData.push(entry); 14188 14189 this.count++; 14190 } 14191 } 14192 14193 // Sort 14194 if (this.options.sortFunction) { 14195 var sortFunctionBound = function (a, b) { 14196 return _this39.options.sortFunction(a.key.toLowerCase(), b.key.toLowerCase(), val.toLowerCase()); 14197 }; 14198 matchingData.sort(sortFunctionBound); 14199 } 14200 14201 // Render 14202 for (var i = 0; i < matchingData.length; i++) { 14203 var _entry = matchingData[i]; 14204 var $autocompleteOption = $('<li></li>'); 14205 if (!!_entry.data) { 14206 $autocompleteOption.append("<img src=\"" + _entry.data + "\" class=\"right circle\"><span>" + _entry.key + "</span>"); 14207 } else { 14208 $autocompleteOption.append('<span>' + _entry.key + '</span>'); 14209 } 14210 14211 $(this.container).append($autocompleteOption); 14212 this._highlight(val, $autocompleteOption); 14213 } 14214 } 14215 14216 /** 14217 * Open Autocomplete Dropdown 14218 */ 14219 14220 }, { 14221 key: "open", 14222 value: function open() { 14223 var val = this.el.value.toLowerCase(); 14224 14225 this._resetAutocomplete(); 14226 14227 if (val.length >= this.options.minLength) { 14228 this.isOpen = true; 14229 this._renderDropdown(this.options.data, val); 14230 } 14231 14232 // Open dropdown 14233 if (!this.dropdown.isOpen) { 14234 this.dropdown.open(); 14235 } else { 14236 // Recalculate dropdown when its already open 14237 this.dropdown.recalculateDimensions(); 14238 } 14239 } 14240 14241 /** 14242 * Close Autocomplete Dropdown 14243 */ 14244 14245 }, { 14246 key: "close", 14247 value: function close() { 14248 this.dropdown.close(); 14249 } 14250 14251 /** 14252 * Update Data 14253 * @param {Object} data 14254 */ 14255 14256 }, { 14257 key: "updateData", 14258 value: function updateData(data) { 14259 var val = this.el.value.toLowerCase(); 14260 this.options.data = data; 14261 14262 if (this.isOpen) { 14263 this._renderDropdown(data, val); 14264 } 14265 } 14266 }], [{ 14267 key: "init", 14268 value: function init(els, options) { 14269 return _get(Autocomplete.__proto__ || Object.getPrototypeOf(Autocomplete), "init", this).call(this, this, els, options); 14270 } 14271 14272 /** 14273 * Get Instance 14274 */ 14275 14276 }, { 14277 key: "getInstance", 14278 value: function getInstance(el) { 14279 var domElem = !!el.jquery ? el[0] : el; 14280 return domElem.M_Autocomplete; 14281 } 14282 }, { 14283 key: "defaults", 14284 get: function () { 14285 return _defaults; 14286 } 14287 }]); 14288 14289 return Autocomplete; 14290 }(Component); 14291 14292 /** 14293 * @static 14294 * @memberof Autocomplete 14295 */ 14296 14297 14298 Autocomplete._keydown = false; 14299 14300 M.Autocomplete = Autocomplete; 14301 14302 if (M.jQueryLoaded) { 14303 M.initializeJqueryWrapper(Autocomplete, 'autocomplete', 'M_Autocomplete'); 14304 } 14305})(cash); 14306;(function ($) { 14307 // Function to update labels of text fields 14308 M.updateTextFields = function () { 14309 var input_selector = 'input[type=text], input[type=password], input[type=email], input[type=url], input[type=tel], input[type=number], input[type=search], input[type=date], input[type=time], textarea'; 14310 $(input_selector).each(function (element, index) { 14311 var $this = $(this); 14312 if (element.value.length > 0 || $(element).is(':focus') || element.autofocus || $this.attr('placeholder') !== null) { 14313 $this.siblings('label').addClass('active'); 14314 } else if (element.validity) { 14315 $this.siblings('label').toggleClass('active', element.validity.badInput === true); 14316 } else { 14317 $this.siblings('label').removeClass('active'); 14318 } 14319 }); 14320 }; 14321 14322 M.validate_field = function (object) { 14323 var hasLength = object.attr('data-length') !== null; 14324 var lenAttr = parseInt(object.attr('data-length')); 14325 var len = object[0].value.length; 14326 14327 if (len === 0 && object[0].validity.badInput === false && !object.is(':required')) { 14328 if (object.hasClass('validate')) { 14329 object.removeClass('valid'); 14330 object.removeClass('invalid'); 14331 } 14332 } else { 14333 if (object.hasClass('validate')) { 14334 // Check for character counter attributes 14335 if (object.is(':valid') && hasLength && len <= lenAttr || object.is(':valid') && !hasLength) { 14336 object.removeClass('invalid'); 14337 object.addClass('valid'); 14338 } else { 14339 object.removeClass('valid'); 14340 object.addClass('invalid'); 14341 } 14342 } 14343 } 14344 }; 14345 14346 M.textareaAutoResize = function ($textarea) { 14347 // Wrap if native element 14348 if ($textarea instanceof Element) { 14349 $textarea = $($textarea); 14350 } 14351 14352 if (!$textarea.length) { 14353 console.error('No textarea element found'); 14354 return; 14355 } 14356 14357 // Textarea Auto Resize 14358 var hiddenDiv = $('.hiddendiv').first(); 14359 if (!hiddenDiv.length) { 14360 hiddenDiv = $('<div class="hiddendiv common"></div>'); 14361 $('body').append(hiddenDiv); 14362 } 14363 14364 // Set font properties of hiddenDiv 14365 var fontFamily = $textarea.css('font-family'); 14366 var fontSize = $textarea.css('font-size'); 14367 var lineHeight = $textarea.css('line-height'); 14368 14369 // Firefox can't handle padding shorthand. 14370 var paddingTop = $textarea.css('padding-top'); 14371 var paddingRight = $textarea.css('padding-right'); 14372 var paddingBottom = $textarea.css('padding-bottom'); 14373 var paddingLeft = $textarea.css('padding-left'); 14374 14375 if (fontSize) { 14376 hiddenDiv.css('font-size', fontSize); 14377 } 14378 if (fontFamily) { 14379 hiddenDiv.css('font-family', fontFamily); 14380 } 14381 if (lineHeight) { 14382 hiddenDiv.css('line-height', lineHeight); 14383 } 14384 if (paddingTop) { 14385 hiddenDiv.css('padding-top', paddingTop); 14386 } 14387 if (paddingRight) { 14388 hiddenDiv.css('padding-right', paddingRight); 14389 } 14390 if (paddingBottom) { 14391 hiddenDiv.css('padding-bottom', paddingBottom); 14392 } 14393 if (paddingLeft) { 14394 hiddenDiv.css('padding-left', paddingLeft); 14395 } 14396 14397 // Set original-height, if none 14398 if (!$textarea.data('original-height')) { 14399 $textarea.data('original-height', $textarea.height()); 14400 } 14401 14402 if ($textarea.attr('wrap') === 'off') { 14403 hiddenDiv.css('overflow-wrap', 'normal').css('white-space', 'pre'); 14404 } 14405 14406 hiddenDiv.text($textarea[0].value + '\n'); 14407 var content = hiddenDiv.html().replace(/\n/g, '<br>'); 14408 hiddenDiv.html(content); 14409 14410 // When textarea is hidden, width goes crazy. 14411 // Approximate with half of window size 14412 14413 if ($textarea[0].offsetWidth > 0 && $textarea[0].offsetHeight > 0) { 14414 hiddenDiv.css('width', $textarea.width() + 'px'); 14415 } else { 14416 hiddenDiv.css('width', window.innerWidth / 2 + 'px'); 14417 } 14418 14419 /** 14420 * Resize if the new height is greater than the 14421 * original height of the textarea 14422 */ 14423 if ($textarea.data('original-height') <= hiddenDiv.innerHeight()) { 14424 $textarea.css('height', hiddenDiv.innerHeight() + 'px'); 14425 } else if ($textarea[0].value.length < $textarea.data('previous-length')) { 14426 /** 14427 * In case the new height is less than original height, it 14428 * means the textarea has less text than before 14429 * So we set the height to the original one 14430 */ 14431 $textarea.css('height', $textarea.data('original-height') + 'px'); 14432 } 14433 $textarea.data('previous-length', $textarea[0].value.length); 14434 }; 14435 14436 $(document).ready(function () { 14437 // Text based inputs 14438 var input_selector = 'input[type=text], input[type=password], input[type=email], input[type=url], input[type=tel], input[type=number], input[type=search], input[type=date], input[type=time], textarea'; 14439 14440 // Add active if form auto complete 14441 $(document).on('change', input_selector, function () { 14442 if (this.value.length !== 0 || $(this).attr('placeholder') !== null) { 14443 $(this).siblings('label').addClass('active'); 14444 } 14445 M.validate_field($(this)); 14446 }); 14447 14448 // Add active if input element has been pre-populated on document ready 14449 $(document).ready(function () { 14450 M.updateTextFields(); 14451 }); 14452 14453 // HTML DOM FORM RESET handling 14454 $(document).on('reset', function (e) { 14455 var formReset = $(e.target); 14456 if (formReset.is('form')) { 14457 formReset.find(input_selector).removeClass('valid').removeClass('invalid'); 14458 formReset.find(input_selector).each(function (e) { 14459 if (this.value.length) { 14460 $(this).siblings('label').removeClass('active'); 14461 } 14462 }); 14463 14464 // Reset select (after native reset) 14465 setTimeout(function () { 14466 formReset.find('select').each(function () { 14467 // check if initialized 14468 if (this.M_FormSelect) { 14469 $(this).trigger('change'); 14470 } 14471 }); 14472 }, 0); 14473 } 14474 }); 14475 14476 /** 14477 * Add active when element has focus 14478 * @param {Event} e 14479 */ 14480 document.addEventListener('focus', function (e) { 14481 if ($(e.target).is(input_selector)) { 14482 $(e.target).siblings('label, .prefix').addClass('active'); 14483 } 14484 }, true); 14485 14486 /** 14487 * Remove active when element is blurred 14488 * @param {Event} e 14489 */ 14490 document.addEventListener('blur', function (e) { 14491 var $inputElement = $(e.target); 14492 if ($inputElement.is(input_selector)) { 14493 var selector = '.prefix'; 14494 14495 if ($inputElement[0].value.length === 0 && $inputElement[0].validity.badInput !== true && $inputElement.attr('placeholder') === null) { 14496 selector += ', label'; 14497 } 14498 $inputElement.siblings(selector).removeClass('active'); 14499 M.validate_field($inputElement); 14500 } 14501 }, true); 14502 14503 // Radio and Checkbox focus class 14504 var radio_checkbox = 'input[type=radio], input[type=checkbox]'; 14505 $(document).on('keyup', radio_checkbox, function (e) { 14506 // TAB, check if tabbing to radio or checkbox. 14507 if (e.which === M.keys.TAB) { 14508 $(this).addClass('tabbed'); 14509 var $this = $(this); 14510 $this.one('blur', function (e) { 14511 $(this).removeClass('tabbed'); 14512 }); 14513 return; 14514 } 14515 }); 14516 14517 var text_area_selector = '.materialize-textarea'; 14518 $(text_area_selector).each(function () { 14519 var $textarea = $(this); 14520 /** 14521 * Resize textarea on document load after storing 14522 * the original height and the original length 14523 */ 14524 $textarea.data('original-height', $textarea.height()); 14525 $textarea.data('previous-length', this.value.length); 14526 M.textareaAutoResize($textarea); 14527 }); 14528 14529 $(document).on('keyup', text_area_selector, function () { 14530 M.textareaAutoResize($(this)); 14531 }); 14532 $(document).on('keydown', text_area_selector, function () { 14533 M.textareaAutoResize($(this)); 14534 }); 14535 14536 // File Input Path 14537 $(document).on('change', '.file-field input[type="file"]', function () { 14538 var file_field = $(this).closest('.file-field'); 14539 var path_input = file_field.find('input.file-path'); 14540 var files = $(this)[0].files; 14541 var file_names = []; 14542 for (var i = 0; i < files.length; i++) { 14543 file_names.push(files[i].name); 14544 } 14545 path_input[0].value = file_names.join(', '); 14546 path_input.trigger('change'); 14547 }); 14548 }); // End of $(document).ready 14549})(cash); 14550;(function ($, anim) { 14551 'use strict'; 14552 14553 var _defaults = { 14554 indicators: true, 14555 height: 400, 14556 duration: 500, 14557 interval: 6000 14558 }; 14559 14560 /** 14561 * @class 14562 * 14563 */ 14564 14565 var Slider = function (_Component11) { 14566 _inherits(Slider, _Component11); 14567 14568 /** 14569 * Construct Slider instance and set up overlay 14570 * @constructor 14571 * @param {Element} el 14572 * @param {Object} options 14573 */ 14574 function Slider(el, options) { 14575 _classCallCheck(this, Slider); 14576 14577 var _this40 = _possibleConstructorReturn(this, (Slider.__proto__ || Object.getPrototypeOf(Slider)).call(this, Slider, el, options)); 14578 14579 _this40.el.M_Slider = _this40; 14580 14581 /** 14582 * Options for the modal 14583 * @member Slider#options 14584 * @prop {Boolean} [indicators=true] - Show indicators 14585 * @prop {Number} [height=400] - height of slider 14586 * @prop {Number} [duration=500] - Length in ms of slide transition 14587 * @prop {Number} [interval=6000] - Length in ms of slide interval 14588 */ 14589 _this40.options = $.extend({}, Slider.defaults, options); 14590 14591 // setup 14592 _this40.$slider = _this40.$el.find('.slides'); 14593 _this40.$slides = _this40.$slider.children('li'); 14594 _this40.activeIndex = _this40.$slides.filter(function (item) { 14595 return $(item).hasClass('active'); 14596 }).first().index(); 14597 if (_this40.activeIndex != -1) { 14598 _this40.$active = _this40.$slides.eq(_this40.activeIndex); 14599 } 14600 14601 _this40._setSliderHeight(); 14602 14603 // Set initial positions of captions 14604 _this40.$slides.find('.caption').each(function (el) { 14605 _this40._animateCaptionIn(el, 0); 14606 }); 14607 14608 // Move img src into background-image 14609 _this40.$slides.find('img').each(function (el) { 14610 var placeholderBase64 = 'data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=='; 14611 if ($(el).attr('src') !== placeholderBase64) { 14612 $(el).css('background-image', 'url("' + $(el).attr('src') + '")'); 14613 $(el).attr('src', placeholderBase64); 14614 } 14615 }); 14616 14617 _this40._setupIndicators(); 14618 14619 // Show active slide 14620 if (_this40.$active) { 14621 _this40.$active.css('display', 'block'); 14622 } else { 14623 _this40.$slides.first().addClass('active'); 14624 anim({ 14625 targets: _this40.$slides.first()[0], 14626 opacity: 1, 14627 duration: _this40.options.duration, 14628 easing: 'easeOutQuad' 14629 }); 14630 14631 _this40.activeIndex = 0; 14632 _this40.$active = _this40.$slides.eq(_this40.activeIndex); 14633 14634 // Update indicators 14635 if (_this40.options.indicators) { 14636 _this40.$indicators.eq(_this40.activeIndex).addClass('active'); 14637 } 14638 } 14639 14640 // Adjust height to current slide 14641 _this40.$active.find('img').each(function (el) { 14642 anim({ 14643 targets: _this40.$active.find('.caption')[0], 14644 opacity: 1, 14645 translateX: 0, 14646 translateY: 0, 14647 duration: _this40.options.duration, 14648 easing: 'easeOutQuad' 14649 }); 14650 }); 14651 14652 _this40._setupEventHandlers(); 14653 14654 // auto scroll 14655 _this40.start(); 14656 return _this40; 14657 } 14658 14659 _createClass(Slider, [{ 14660 key: "destroy", 14661 14662 14663 /** 14664 * Teardown component 14665 */ 14666 value: function destroy() { 14667 this.pause(); 14668 this._removeIndicators(); 14669 this._removeEventHandlers(); 14670 this.el.M_Slider = undefined; 14671 } 14672 14673 /** 14674 * Setup Event Handlers 14675 */ 14676 14677 }, { 14678 key: "_setupEventHandlers", 14679 value: function _setupEventHandlers() { 14680 var _this41 = this; 14681 14682 this._handleIntervalBound = this._handleInterval.bind(this); 14683 this._handleIndicatorClickBound = this._handleIndicatorClick.bind(this); 14684 14685 if (this.options.indicators) { 14686 this.$indicators.each(function (el) { 14687 el.addEventListener('click', _this41._handleIndicatorClickBound); 14688 }); 14689 } 14690 } 14691 14692 /** 14693 * Remove Event Handlers 14694 */ 14695 14696 }, { 14697 key: "_removeEventHandlers", 14698 value: function _removeEventHandlers() { 14699 var _this42 = this; 14700 14701 if (this.options.indicators) { 14702 this.$indicators.each(function (el) { 14703 el.removeEventListener('click', _this42._handleIndicatorClickBound); 14704 }); 14705 } 14706 } 14707 14708 /** 14709 * Handle indicator click 14710 * @param {Event} e 14711 */ 14712 14713 }, { 14714 key: "_handleIndicatorClick", 14715 value: function _handleIndicatorClick(e) { 14716 var currIndex = $(e.target).index(); 14717 this.set(currIndex); 14718 } 14719 14720 /** 14721 * Handle Interval 14722 */ 14723 14724 }, { 14725 key: "_handleInterval", 14726 value: function _handleInterval() { 14727 var newActiveIndex = this.$slider.find('.active').index(); 14728 if (this.$slides.length === newActiveIndex + 1) newActiveIndex = 0; 14729 // loop to start 14730 else newActiveIndex += 1; 14731 14732 this.set(newActiveIndex); 14733 } 14734 14735 /** 14736 * Animate in caption 14737 * @param {Element} caption 14738 * @param {Number} duration 14739 */ 14740 14741 }, { 14742 key: "_animateCaptionIn", 14743 value: function _animateCaptionIn(caption, duration) { 14744 var animOptions = { 14745 targets: caption, 14746 opacity: 0, 14747 duration: duration, 14748 easing: 'easeOutQuad' 14749 }; 14750 14751 if ($(caption).hasClass('center-align')) { 14752 animOptions.translateY = -100; 14753 } else if ($(caption).hasClass('right-align')) { 14754 animOptions.translateX = 100; 14755 } else if ($(caption).hasClass('left-align')) { 14756 animOptions.translateX = -100; 14757 } 14758 14759 anim(animOptions); 14760 } 14761 14762 /** 14763 * Set height of slider 14764 */ 14765 14766 }, { 14767 key: "_setSliderHeight", 14768 value: function _setSliderHeight() { 14769 // If fullscreen, do nothing 14770 if (!this.$el.hasClass('fullscreen')) { 14771 if (this.options.indicators) { 14772 // Add height if indicators are present 14773 this.$el.css('height', this.options.height + 40 + 'px'); 14774 } else { 14775 this.$el.css('height', this.options.height + 'px'); 14776 } 14777 this.$slider.css('height', this.options.height + 'px'); 14778 } 14779 } 14780 14781 /** 14782 * Setup indicators 14783 */ 14784 14785 }, { 14786 key: "_setupIndicators", 14787 value: function _setupIndicators() { 14788 var _this43 = this; 14789 14790 if (this.options.indicators) { 14791 this.$indicators = $('<ul class="indicators"></ul>'); 14792 this.$slides.each(function (el, index) { 14793 var $indicator = $('<li class="indicator-item"></li>'); 14794 _this43.$indicators.append($indicator[0]); 14795 }); 14796 this.$el.append(this.$indicators[0]); 14797 this.$indicators = this.$indicators.children('li.indicator-item'); 14798 } 14799 } 14800 14801 /** 14802 * Remove indicators 14803 */ 14804 14805 }, { 14806 key: "_removeIndicators", 14807 value: function _removeIndicators() { 14808 this.$el.find('ul.indicators').remove(); 14809 } 14810 14811 /** 14812 * Cycle to nth item 14813 * @param {Number} index 14814 */ 14815 14816 }, { 14817 key: "set", 14818 value: function set(index) { 14819 var _this44 = this; 14820 14821 // Wrap around indices. 14822 if (index >= this.$slides.length) index = 0;else if (index < 0) index = this.$slides.length - 1; 14823 14824 // Only do if index changes 14825 if (this.activeIndex != index) { 14826 this.$active = this.$slides.eq(this.activeIndex); 14827 var $caption = this.$active.find('.caption'); 14828 this.$active.removeClass('active'); 14829 14830 anim({ 14831 targets: this.$active[0], 14832 opacity: 0, 14833 duration: this.options.duration, 14834 easing: 'easeOutQuad', 14835 complete: function () { 14836 _this44.$slides.not('.active').each(function (el) { 14837 anim({ 14838 targets: el, 14839 opacity: 0, 14840 translateX: 0, 14841 translateY: 0, 14842 duration: 0, 14843 easing: 'easeOutQuad' 14844 }); 14845 }); 14846 } 14847 }); 14848 14849 this._animateCaptionIn($caption[0], this.options.duration); 14850 14851 // Update indicators 14852 if (this.options.indicators) { 14853 this.$indicators.eq(this.activeIndex).removeClass('active'); 14854 this.$indicators.eq(index).addClass('active'); 14855 } 14856 14857 anim({ 14858 targets: this.$slides.eq(index)[0], 14859 opacity: 1, 14860 duration: this.options.duration, 14861 easing: 'easeOutQuad' 14862 }); 14863 14864 anim({ 14865 targets: this.$slides.eq(index).find('.caption')[0], 14866 opacity: 1, 14867 translateX: 0, 14868 translateY: 0, 14869 duration: this.options.duration, 14870 delay: this.options.duration, 14871 easing: 'easeOutQuad' 14872 }); 14873 14874 this.$slides.eq(index).addClass('active'); 14875 this.activeIndex = index; 14876 14877 // Reset interval 14878 this.start(); 14879 } 14880 } 14881 14882 /** 14883 * Pause slider interval 14884 */ 14885 14886 }, { 14887 key: "pause", 14888 value: function pause() { 14889 clearInterval(this.interval); 14890 } 14891 14892 /** 14893 * Start slider interval 14894 */ 14895 14896 }, { 14897 key: "start", 14898 value: function start() { 14899 clearInterval(this.interval); 14900 this.interval = setInterval(this._handleIntervalBound, this.options.duration + this.options.interval); 14901 } 14902 14903 /** 14904 * Move to next slide 14905 */ 14906 14907 }, { 14908 key: "next", 14909 value: function next() { 14910 var newIndex = this.activeIndex + 1; 14911 14912 // Wrap around indices. 14913 if (newIndex >= this.$slides.length) newIndex = 0;else if (newIndex < 0) newIndex = this.$slides.length - 1; 14914 14915 this.set(newIndex); 14916 } 14917 14918 /** 14919 * Move to previous slide 14920 */ 14921 14922 }, { 14923 key: "prev", 14924 value: function prev() { 14925 var newIndex = this.activeIndex - 1; 14926 14927 // Wrap around indices. 14928 if (newIndex >= this.$slides.length) newIndex = 0;else if (newIndex < 0) newIndex = this.$slides.length - 1; 14929 14930 this.set(newIndex); 14931 } 14932 }], [{ 14933 key: "init", 14934 value: function init(els, options) { 14935 return _get(Slider.__proto__ || Object.getPrototypeOf(Slider), "init", this).call(this, this, els, options); 14936 } 14937 14938 /** 14939 * Get Instance 14940 */ 14941 14942 }, { 14943 key: "getInstance", 14944 value: function getInstance(el) { 14945 var domElem = !!el.jquery ? el[0] : el; 14946 return domElem.M_Slider; 14947 } 14948 }, { 14949 key: "defaults", 14950 get: function () { 14951 return _defaults; 14952 } 14953 }]); 14954 14955 return Slider; 14956 }(Component); 14957 14958 M.Slider = Slider; 14959 14960 if (M.jQueryLoaded) { 14961 M.initializeJqueryWrapper(Slider, 'slider', 'M_Slider'); 14962 } 14963})(cash, M.anime); 14964;(function ($, anim) { 14965 $(document).on('click', '.card', function (e) { 14966 if ($(this).children('.card-reveal').length) { 14967 var $card = $(e.target).closest('.card'); 14968 if ($card.data('initialOverflow') === undefined) { 14969 $card.data('initialOverflow', $card.css('overflow') === undefined ? '' : $card.css('overflow')); 14970 } 14971 var $cardReveal = $(this).find('.card-reveal'); 14972 if ($(e.target).is($('.card-reveal .card-title')) || $(e.target).is($('.card-reveal .card-title i'))) { 14973 // Make Reveal animate down and display none 14974 anim({ 14975 targets: $cardReveal[0], 14976 translateY: 0, 14977 duration: 225, 14978 easing: 'easeInOutQuad', 14979 complete: function (anim) { 14980 var el = anim.animatables[0].target; 14981 $(el).css({ display: 'none' }); 14982 $card.css('overflow', $card.data('initialOverflow')); 14983 } 14984 }); 14985 } else if ($(e.target).is($('.card .activator')) || $(e.target).is($('.card .activator i'))) { 14986 $card.css('overflow', 'hidden'); 14987 $cardReveal.css({ display: 'block' }); 14988 anim({ 14989 targets: $cardReveal[0], 14990 translateY: '-100%', 14991 duration: 300, 14992 easing: 'easeInOutQuad' 14993 }); 14994 } 14995 } 14996 }); 14997})(cash, M.anime); 14998;(function ($) { 14999 'use strict'; 15000 15001 var _defaults = { 15002 data: [], 15003 placeholder: '', 15004 secondaryPlaceholder: '', 15005 autocompleteOptions: {}, 15006 limit: Infinity, 15007 onChipAdd: null, 15008 onChipSelect: null, 15009 onChipDelete: null 15010 }; 15011 15012 /** 15013 * @typedef {Object} chip 15014 * @property {String} tag chip tag string 15015 * @property {String} [image] chip avatar image string 15016 */ 15017 15018 /** 15019 * @class 15020 * 15021 */ 15022 15023 var Chips = function (_Component12) { 15024 _inherits(Chips, _Component12); 15025 15026 /** 15027 * Construct Chips instance and set up overlay 15028 * @constructor 15029 * @param {Element} el 15030 * @param {Object} options 15031 */ 15032 function Chips(el, options) { 15033 _classCallCheck(this, Chips); 15034 15035 var _this45 = _possibleConstructorReturn(this, (Chips.__proto__ || Object.getPrototypeOf(Chips)).call(this, Chips, el, options)); 15036 15037 _this45.el.M_Chips = _this45; 15038 15039 /** 15040 * Options for the modal 15041 * @member Chips#options 15042 * @prop {Array} data 15043 * @prop {String} placeholder 15044 * @prop {String} secondaryPlaceholder 15045 * @prop {Object} autocompleteOptions 15046 */ 15047 _this45.options = $.extend({}, Chips.defaults, options); 15048 15049 _this45.$el.addClass('chips input-field'); 15050 _this45.chipsData = []; 15051 _this45.$chips = $(); 15052 _this45._setupInput(); 15053 _this45.hasAutocomplete = Object.keys(_this45.options.autocompleteOptions).length > 0; 15054 15055 // Set input id 15056 if (!_this45.$input.attr('id')) { 15057 _this45.$input.attr('id', M.guid()); 15058 } 15059 15060 // Render initial chips 15061 if (_this45.options.data.length) { 15062 _this45.chipsData = _this45.options.data; 15063 _this45._renderChips(_this45.chipsData); 15064 } 15065 15066 // Setup autocomplete if needed 15067 if (_this45.hasAutocomplete) { 15068 _this45._setupAutocomplete(); 15069 } 15070 15071 _this45._setPlaceholder(); 15072 _this45._setupLabel(); 15073 _this45._setupEventHandlers(); 15074 return _this45; 15075 } 15076 15077 _createClass(Chips, [{ 15078 key: "getData", 15079 15080 15081 /** 15082 * Get Chips Data 15083 */ 15084 value: function getData() { 15085 return this.chipsData; 15086 } 15087 15088 /** 15089 * Teardown component 15090 */ 15091 15092 }, { 15093 key: "destroy", 15094 value: function destroy() { 15095 this._removeEventHandlers(); 15096 this.$chips.remove(); 15097 this.el.M_Chips = undefined; 15098 } 15099 15100 /** 15101 * Setup Event Handlers 15102 */ 15103 15104 }, { 15105 key: "_setupEventHandlers", 15106 value: function _setupEventHandlers() { 15107 this._handleChipClickBound = this._handleChipClick.bind(this); 15108 this._handleInputKeydownBound = this._handleInputKeydown.bind(this); 15109 this._handleInputFocusBound = this._handleInputFocus.bind(this); 15110 this._handleInputBlurBound = this._handleInputBlur.bind(this); 15111 15112 this.el.addEventListener('click', this._handleChipClickBound); 15113 document.addEventListener('keydown', Chips._handleChipsKeydown); 15114 document.addEventListener('keyup', Chips._handleChipsKeyup); 15115 this.el.addEventListener('blur', Chips._handleChipsBlur, true); 15116 this.$input[0].addEventListener('focus', this._handleInputFocusBound); 15117 this.$input[0].addEventListener('blur', this._handleInputBlurBound); 15118 this.$input[0].addEventListener('keydown', this._handleInputKeydownBound); 15119 } 15120 15121 /** 15122 * Remove Event Handlers 15123 */ 15124 15125 }, { 15126 key: "_removeEventHandlers", 15127 value: function _removeEventHandlers() { 15128 this.el.removeEventListener('click', this._handleChipClickBound); 15129 document.removeEventListener('keydown', Chips._handleChipsKeydown); 15130 document.removeEventListener('keyup', Chips._handleChipsKeyup); 15131 this.el.removeEventListener('blur', Chips._handleChipsBlur, true); 15132 this.$input[0].removeEventListener('focus', this._handleInputFocusBound); 15133 this.$input[0].removeEventListener('blur', this._handleInputBlurBound); 15134 this.$input[0].removeEventListener('keydown', this._handleInputKeydownBound); 15135 } 15136 15137 /** 15138 * Handle Chip Click 15139 * @param {Event} e 15140 */ 15141 15142 }, { 15143 key: "_handleChipClick", 15144 value: function _handleChipClick(e) { 15145 var $chip = $(e.target).closest('.chip'); 15146 var clickedClose = $(e.target).is('.close'); 15147 if ($chip.length) { 15148 var index = $chip.index(); 15149 if (clickedClose) { 15150 // delete chip 15151 this.deleteChip(index); 15152 this.$input[0].focus(); 15153 } else { 15154 // select chip 15155 this.selectChip(index); 15156 } 15157 15158 // Default handle click to focus on input 15159 } else { 15160 this.$input[0].focus(); 15161 } 15162 } 15163 15164 /** 15165 * Handle Chips Keydown 15166 * @param {Event} e 15167 */ 15168 15169 }, { 15170 key: "_handleInputFocus", 15171 15172 15173 /** 15174 * Handle Input Focus 15175 */ 15176 value: function _handleInputFocus() { 15177 this.$el.addClass('focus'); 15178 } 15179 15180 /** 15181 * Handle Input Blur 15182 */ 15183 15184 }, { 15185 key: "_handleInputBlur", 15186 value: function _handleInputBlur() { 15187 this.$el.removeClass('focus'); 15188 } 15189 15190 /** 15191 * Handle Input Keydown 15192 * @param {Event} e 15193 */ 15194 15195 }, { 15196 key: "_handleInputKeydown", 15197 value: function _handleInputKeydown(e) { 15198 Chips._keydown = true; 15199 15200 // enter 15201 if (e.keyCode === 13) { 15202 // Override enter if autocompleting. 15203 if (this.hasAutocomplete && this.autocomplete && this.autocomplete.isOpen) { 15204 return; 15205 } 15206 15207 e.preventDefault(); 15208 this.addChip({ 15209 tag: this.$input[0].value 15210 }); 15211 this.$input[0].value = ''; 15212 15213 // delete or left 15214 } else if ((e.keyCode === 8 || e.keyCode === 37) && this.$input[0].value === '' && this.chipsData.length) { 15215 e.preventDefault(); 15216 this.selectChip(this.chipsData.length - 1); 15217 } 15218 } 15219 15220 /** 15221 * Render Chip 15222 * @param {chip} chip 15223 * @return {Element} 15224 */ 15225 15226 }, { 15227 key: "_renderChip", 15228 value: function _renderChip(chip) { 15229 if (!chip.tag) { 15230 return; 15231 } 15232 15233 var renderedChip = document.createElement('div'); 15234 var closeIcon = document.createElement('i'); 15235 renderedChip.classList.add('chip'); 15236 renderedChip.textContent = chip.tag; 15237 renderedChip.setAttribute('tabindex', 0); 15238 $(closeIcon).addClass('material-icons close'); 15239 closeIcon.textContent = 'close'; 15240 15241 // attach image if needed 15242 if (chip.image) { 15243 var img = document.createElement('img'); 15244 img.setAttribute('src', chip.image); 15245 renderedChip.insertBefore(img, renderedChip.firstChild); 15246 } 15247 15248 renderedChip.appendChild(closeIcon); 15249 return renderedChip; 15250 } 15251 15252 /** 15253 * Render Chips 15254 */ 15255 15256 }, { 15257 key: "_renderChips", 15258 value: function _renderChips() { 15259 this.$chips.remove(); 15260 for (var i = 0; i < this.chipsData.length; i++) { 15261 var chipEl = this._renderChip(this.chipsData[i]); 15262 this.$el.append(chipEl); 15263 this.$chips.add(chipEl); 15264 } 15265 15266 // move input to end 15267 this.$el.append(this.$input[0]); 15268 } 15269 15270 /** 15271 * Setup Autocomplete 15272 */ 15273 15274 }, { 15275 key: "_setupAutocomplete", 15276 value: function _setupAutocomplete() { 15277 var _this46 = this; 15278 15279 this.options.autocompleteOptions.onAutocomplete = function (val) { 15280 _this46.addChip({ 15281 tag: val 15282 }); 15283 _this46.$input[0].value = ''; 15284 _this46.$input[0].focus(); 15285 }; 15286 15287 this.autocomplete = M.Autocomplete.init(this.$input[0], this.options.autocompleteOptions); 15288 } 15289 15290 /** 15291 * Setup Input 15292 */ 15293 15294 }, { 15295 key: "_setupInput", 15296 value: function _setupInput() { 15297 this.$input = this.$el.find('input'); 15298 if (!this.$input.length) { 15299 this.$input = $('<input></input>'); 15300 this.$el.append(this.$input); 15301 } 15302 15303 this.$input.addClass('input'); 15304 } 15305 15306 /** 15307 * Setup Label 15308 */ 15309 15310 }, { 15311 key: "_setupLabel", 15312 value: function _setupLabel() { 15313 this.$label = this.$el.find('label'); 15314 if (this.$label.length) { 15315 this.$label.setAttribute('for', this.$input.attr('id')); 15316 } 15317 } 15318 15319 /** 15320 * Set placeholder 15321 */ 15322 15323 }, { 15324 key: "_setPlaceholder", 15325 value: function _setPlaceholder() { 15326 if (this.chipsData !== undefined && !this.chipsData.length && this.options.placeholder) { 15327 $(this.$input).prop('placeholder', this.options.placeholder); 15328 } else if ((this.chipsData === undefined || !!this.chipsData.length) && this.options.secondaryPlaceholder) { 15329 $(this.$input).prop('placeholder', this.options.secondaryPlaceholder); 15330 } 15331 } 15332 15333 /** 15334 * Check if chip is valid 15335 * @param {chip} chip 15336 */ 15337 15338 }, { 15339 key: "_isValid", 15340 value: function _isValid(chip) { 15341 if (chip.hasOwnProperty('tag') && chip.tag !== '') { 15342 var exists = false; 15343 for (var i = 0; i < this.chipsData.length; i++) { 15344 if (this.chipsData[i].tag === chip.tag) { 15345 exists = true; 15346 break; 15347 } 15348 } 15349 return !exists; 15350 } 15351 15352 return false; 15353 } 15354 15355 /** 15356 * Add chip 15357 * @param {chip} chip 15358 */ 15359 15360 }, { 15361 key: "addChip", 15362 value: function addChip(chip) { 15363 if (!this._isValid(chip) || this.chipsData.length >= this.options.limit) { 15364 return; 15365 } 15366 15367 var renderedChip = this._renderChip(chip); 15368 this.$chips.add(renderedChip); 15369 this.chipsData.push(chip); 15370 $(this.$input).before(renderedChip); 15371 this._setPlaceholder(); 15372 15373 // fire chipAdd callback 15374 if (typeof this.options.onChipAdd === 'function') { 15375 this.options.onChipAdd.call(this, this.$el, renderedChip); 15376 } 15377 } 15378 15379 /** 15380 * Delete chip 15381 * @param {Number} chip 15382 */ 15383 15384 }, { 15385 key: "deleteChip", 15386 value: function deleteChip(chipIndex) { 15387 var $chip = this.$chips.eq(chipIndex); 15388 this.$chips.eq(chipIndex).remove(); 15389 this.$chips = this.$chips.filter(function (el) { 15390 return $(el).index() >= 0; 15391 }); 15392 this.chipsData.splice(chipIndex, 1); 15393 this._setPlaceholder(); 15394 15395 // fire chipDelete callback 15396 if (typeof this.options.onChipDelete === 'function') { 15397 this.options.onChipDelete.call(this, this.$el, $chip[0]); 15398 } 15399 } 15400 15401 /** 15402 * Select chip 15403 * @param {Number} chip 15404 */ 15405 15406 }, { 15407 key: "selectChip", 15408 value: function selectChip(chipIndex) { 15409 var $chip = this.$chips.eq(chipIndex); 15410 this._selectedChip = $chip; 15411 $chip[0].focus(); 15412 15413 // fire chipSelect callback 15414 if (typeof this.options.onChipSelect === 'function') { 15415 this.options.onChipSelect.call(this, this.$el, $chip[0]); 15416 } 15417 } 15418 }], [{ 15419 key: "init", 15420 value: function init(els, options) { 15421 return _get(Chips.__proto__ || Object.getPrototypeOf(Chips), "init", this).call(this, this, els, options); 15422 } 15423 15424 /** 15425 * Get Instance 15426 */ 15427 15428 }, { 15429 key: "getInstance", 15430 value: function getInstance(el) { 15431 var domElem = !!el.jquery ? el[0] : el; 15432 return domElem.M_Chips; 15433 } 15434 }, { 15435 key: "_handleChipsKeydown", 15436 value: function _handleChipsKeydown(e) { 15437 Chips._keydown = true; 15438 15439 var $chips = $(e.target).closest('.chips'); 15440 var chipsKeydown = e.target && $chips.length; 15441 15442 // Don't handle keydown inputs on input and textarea 15443 if ($(e.target).is('input, textarea') || !chipsKeydown) { 15444 return; 15445 } 15446 15447 var currChips = $chips[0].M_Chips; 15448 15449 // backspace and delete 15450 if (e.keyCode === 8 || e.keyCode === 46) { 15451 e.preventDefault(); 15452 15453 var selectIndex = currChips.chipsData.length; 15454 if (currChips._selectedChip) { 15455 var index = currChips._selectedChip.index(); 15456 currChips.deleteChip(index); 15457 currChips._selectedChip = null; 15458 15459 // Make sure selectIndex doesn't go negative 15460 selectIndex = Math.max(index - 1, 0); 15461 } 15462 15463 if (currChips.chipsData.length) { 15464 currChips.selectChip(selectIndex); 15465 } 15466 15467 // left arrow key 15468 } else if (e.keyCode === 37) { 15469 if (currChips._selectedChip) { 15470 var _selectIndex = currChips._selectedChip.index() - 1; 15471 if (_selectIndex < 0) { 15472 return; 15473 } 15474 currChips.selectChip(_selectIndex); 15475 } 15476 15477 // right arrow key 15478 } else if (e.keyCode === 39) { 15479 if (currChips._selectedChip) { 15480 var _selectIndex2 = currChips._selectedChip.index() + 1; 15481 15482 if (_selectIndex2 >= currChips.chipsData.length) { 15483 currChips.$input[0].focus(); 15484 } else { 15485 currChips.selectChip(_selectIndex2); 15486 } 15487 } 15488 } 15489 } 15490 15491 /** 15492 * Handle Chips Keyup 15493 * @param {Event} e 15494 */ 15495 15496 }, { 15497 key: "_handleChipsKeyup", 15498 value: function _handleChipsKeyup(e) { 15499 Chips._keydown = false; 15500 } 15501 15502 /** 15503 * Handle Chips Blur 15504 * @param {Event} e 15505 */ 15506 15507 }, { 15508 key: "_handleChipsBlur", 15509 value: function _handleChipsBlur(e) { 15510 if (!Chips._keydown) { 15511 var $chips = $(e.target).closest('.chips'); 15512 var currChips = $chips[0].M_Chips; 15513 15514 currChips._selectedChip = null; 15515 } 15516 } 15517 }, { 15518 key: "defaults", 15519 get: function () { 15520 return _defaults; 15521 } 15522 }]); 15523 15524 return Chips; 15525 }(Component); 15526 15527 /** 15528 * @static 15529 * @memberof Chips 15530 */ 15531 15532 15533 Chips._keydown = false; 15534 15535 M.Chips = Chips; 15536 15537 if (M.jQueryLoaded) { 15538 M.initializeJqueryWrapper(Chips, 'chips', 'M_Chips'); 15539 } 15540 15541 $(document).ready(function () { 15542 // Handle removal of static chips. 15543 $(document.body).on('click', '.chip .close', function () { 15544 var $chips = $(this).closest('.chips'); 15545 if ($chips.length && $chips[0].M_Chips) { 15546 return; 15547 } 15548 $(this).closest('.chip').remove(); 15549 }); 15550 }); 15551})(cash); 15552;(function ($) { 15553 'use strict'; 15554 15555 var _defaults = { 15556 top: 0, 15557 bottom: Infinity, 15558 offset: 0, 15559 onPositionChange: null 15560 }; 15561 15562 /** 15563 * @class 15564 * 15565 */ 15566 15567 var Pushpin = function (_Component13) { 15568 _inherits(Pushpin, _Component13); 15569 15570 /** 15571 * Construct Pushpin instance 15572 * @constructor 15573 * @param {Element} el 15574 * @param {Object} options 15575 */ 15576 function Pushpin(el, options) { 15577 _classCallCheck(this, Pushpin); 15578 15579 var _this47 = _possibleConstructorReturn(this, (Pushpin.__proto__ || Object.getPrototypeOf(Pushpin)).call(this, Pushpin, el, options)); 15580 15581 _this47.el.M_Pushpin = _this47; 15582 15583 /** 15584 * Options for the modal 15585 * @member Pushpin#options 15586 */ 15587 _this47.options = $.extend({}, Pushpin.defaults, options); 15588 15589 _this47.originalOffset = _this47.el.offsetTop; 15590 Pushpin._pushpins.push(_this47); 15591 _this47._setupEventHandlers(); 15592 _this47._updatePosition(); 15593 return _this47; 15594 } 15595 15596 _createClass(Pushpin, [{ 15597 key: "destroy", 15598 15599 15600 /** 15601 * Teardown component 15602 */ 15603 value: function destroy() { 15604 this.el.style.top = null; 15605 this._removePinClasses(); 15606 this._removeEventHandlers(); 15607 15608 // Remove pushpin Inst 15609 var index = Pushpin._pushpins.indexOf(this); 15610 Pushpin._pushpins.splice(index, 1); 15611 } 15612 }, { 15613 key: "_setupEventHandlers", 15614 value: function _setupEventHandlers() { 15615 document.addEventListener('scroll', Pushpin._updateElements); 15616 } 15617 }, { 15618 key: "_removeEventHandlers", 15619 value: function _removeEventHandlers() { 15620 document.removeEventListener('scroll', Pushpin._updateElements); 15621 } 15622 }, { 15623 key: "_updatePosition", 15624 value: function _updatePosition() { 15625 var scrolled = M.getDocumentScrollTop() + this.options.offset; 15626 15627 if (this.options.top <= scrolled && this.options.bottom >= scrolled && !this.el.classList.contains('pinned')) { 15628 this._removePinClasses(); 15629 this.el.style.top = this.options.offset + "px"; 15630 this.el.classList.add('pinned'); 15631 15632 // onPositionChange callback 15633 if (typeof this.options.onPositionChange === 'function') { 15634 this.options.onPositionChange.call(this, 'pinned'); 15635 } 15636 } 15637 15638 // Add pin-top (when scrolled position is above top) 15639 if (scrolled < this.options.top && !this.el.classList.contains('pin-top')) { 15640 this._removePinClasses(); 15641 this.el.style.top = 0; 15642 this.el.classList.add('pin-top'); 15643 15644 // onPositionChange callback 15645 if (typeof this.options.onPositionChange === 'function') { 15646 this.options.onPositionChange.call(this, 'pin-top'); 15647 } 15648 } 15649 15650 // Add pin-bottom (when scrolled position is below bottom) 15651 if (scrolled > this.options.bottom && !this.el.classList.contains('pin-bottom')) { 15652 this._removePinClasses(); 15653 this.el.classList.add('pin-bottom'); 15654 this.el.style.top = this.options.bottom - this.originalOffset + "px"; 15655 15656 // onPositionChange callback 15657 if (typeof this.options.onPositionChange === 'function') { 15658 this.options.onPositionChange.call(this, 'pin-bottom'); 15659 } 15660 } 15661 } 15662 }, { 15663 key: "_removePinClasses", 15664 value: function _removePinClasses() { 15665 // IE 11 bug (can't remove multiple classes in one line) 15666 this.el.classList.remove('pin-top'); 15667 this.el.classList.remove('pinned'); 15668 this.el.classList.remove('pin-bottom'); 15669 } 15670 }], [{ 15671 key: "init", 15672 value: function init(els, options) { 15673 return _get(Pushpin.__proto__ || Object.getPrototypeOf(Pushpin), "init", this).call(this, this, els, options); 15674 } 15675 15676 /** 15677 * Get Instance 15678 */ 15679 15680 }, { 15681 key: "getInstance", 15682 value: function getInstance(el) { 15683 var domElem = !!el.jquery ? el[0] : el; 15684 return domElem.M_Pushpin; 15685 } 15686 }, { 15687 key: "_updateElements", 15688 value: function _updateElements() { 15689 for (var elIndex in Pushpin._pushpins) { 15690 var pInstance = Pushpin._pushpins[elIndex]; 15691 pInstance._updatePosition(); 15692 } 15693 } 15694 }, { 15695 key: "defaults", 15696 get: function () { 15697 return _defaults; 15698 } 15699 }]); 15700 15701 return Pushpin; 15702 }(Component); 15703 15704 /** 15705 * @static 15706 * @memberof Pushpin 15707 */ 15708 15709 15710 Pushpin._pushpins = []; 15711 15712 M.Pushpin = Pushpin; 15713 15714 if (M.jQueryLoaded) { 15715 M.initializeJqueryWrapper(Pushpin, 'pushpin', 'M_Pushpin'); 15716 } 15717})(cash); 15718;(function ($, anim) { 15719 'use strict'; 15720 15721 var _defaults = { 15722 direction: 'top', 15723 hoverEnabled: true, 15724 toolbarEnabled: false 15725 }; 15726 15727 $.fn.reverse = [].reverse; 15728 15729 /** 15730 * @class 15731 * 15732 */ 15733 15734 var FloatingActionButton = function (_Component14) { 15735 _inherits(FloatingActionButton, _Component14); 15736 15737 /** 15738 * Construct FloatingActionButton instance 15739 * @constructor 15740 * @param {Element} el 15741 * @param {Object} options 15742 */ 15743 function FloatingActionButton(el, options) { 15744 _classCallCheck(this, FloatingActionButton); 15745 15746 var _this48 = _possibleConstructorReturn(this, (FloatingActionButton.__proto__ || Object.getPrototypeOf(FloatingActionButton)).call(this, FloatingActionButton, el, options)); 15747 15748 _this48.el.M_FloatingActionButton = _this48; 15749 15750 /** 15751 * Options for the fab 15752 * @member FloatingActionButton#options 15753 * @prop {Boolean} [direction] - Direction fab menu opens 15754 * @prop {Boolean} [hoverEnabled=true] - Enable hover vs click 15755 * @prop {Boolean} [toolbarEnabled=false] - Enable toolbar transition 15756 */ 15757 _this48.options = $.extend({}, FloatingActionButton.defaults, options); 15758 15759 _this48.isOpen = false; 15760 _this48.$anchor = _this48.$el.children('a').first(); 15761 _this48.$menu = _this48.$el.children('ul').first(); 15762 _this48.$floatingBtns = _this48.$el.find('ul .btn-floating'); 15763 _this48.$floatingBtnsReverse = _this48.$el.find('ul .btn-floating').reverse(); 15764 _this48.offsetY = 0; 15765 _this48.offsetX = 0; 15766 15767 _this48.$el.addClass("direction-" + _this48.options.direction); 15768 if (_this48.options.direction === 'top') { 15769 _this48.offsetY = 40; 15770 } else if (_this48.options.direction === 'right') { 15771 _this48.offsetX = -40; 15772 } else if (_this48.options.direction === 'bottom') { 15773 _this48.offsetY = -40; 15774 } else { 15775 _this48.offsetX = 40; 15776 } 15777 _this48._setupEventHandlers(); 15778 return _this48; 15779 } 15780 15781 _createClass(FloatingActionButton, [{ 15782 key: "destroy", 15783 15784 15785 /** 15786 * Teardown component 15787 */ 15788 value: function destroy() { 15789 this._removeEventHandlers(); 15790 this.el.M_FloatingActionButton = undefined; 15791 } 15792 15793 /** 15794 * Setup Event Handlers 15795 */ 15796 15797 }, { 15798 key: "_setupEventHandlers", 15799 value: function _setupEventHandlers() { 15800 this._handleFABClickBound = this._handleFABClick.bind(this); 15801 this._handleOpenBound = this.open.bind(this); 15802 this._handleCloseBound = this.close.bind(this); 15803 15804 if (this.options.hoverEnabled && !this.options.toolbarEnabled) { 15805 this.el.addEventListener('mouseenter', this._handleOpenBound); 15806 this.el.addEventListener('mouseleave', this._handleCloseBound); 15807 } else { 15808 this.el.addEventListener('click', this._handleFABClickBound); 15809 } 15810 } 15811 15812 /** 15813 * Remove Event Handlers 15814 */ 15815 15816 }, { 15817 key: "_removeEventHandlers", 15818 value: function _removeEventHandlers() { 15819 if (this.options.hoverEnabled && !this.options.toolbarEnabled) { 15820 this.el.removeEventListener('mouseenter', this._handleOpenBound); 15821 this.el.removeEventListener('mouseleave', this._handleCloseBound); 15822 } else { 15823 this.el.removeEventListener('click', this._handleFABClickBound); 15824 } 15825 } 15826 15827 /** 15828 * Handle FAB Click 15829 */ 15830 15831 }, { 15832 key: "_handleFABClick", 15833 value: function _handleFABClick() { 15834 if (this.isOpen) { 15835 this.close(); 15836 } else { 15837 this.open(); 15838 } 15839 } 15840 15841 /** 15842 * Handle Document Click 15843 * @param {Event} e 15844 */ 15845 15846 }, { 15847 key: "_handleDocumentClick", 15848 value: function _handleDocumentClick(e) { 15849 if (!$(e.target).closest(this.$menu).length) { 15850 this.close(); 15851 } 15852 } 15853 15854 /** 15855 * Open FAB 15856 */ 15857 15858 }, { 15859 key: "open", 15860 value: function open() { 15861 if (this.isOpen) { 15862 return; 15863 } 15864 15865 if (this.options.toolbarEnabled) { 15866 this._animateInToolbar(); 15867 } else { 15868 this._animateInFAB(); 15869 } 15870 this.isOpen = true; 15871 } 15872 15873 /** 15874 * Close FAB 15875 */ 15876 15877 }, { 15878 key: "close", 15879 value: function close() { 15880 if (!this.isOpen) { 15881 return; 15882 } 15883 15884 if (this.options.toolbarEnabled) { 15885 window.removeEventListener('scroll', this._handleCloseBound, true); 15886 document.body.removeEventListener('click', this._handleDocumentClickBound, true); 15887 this._animateOutToolbar(); 15888 } else { 15889 this._animateOutFAB(); 15890 } 15891 this.isOpen = false; 15892 } 15893 15894 /** 15895 * Classic FAB Menu open 15896 */ 15897 15898 }, { 15899 key: "_animateInFAB", 15900 value: function _animateInFAB() { 15901 var _this49 = this; 15902 15903 this.$el.addClass('active'); 15904 15905 var time = 0; 15906 this.$floatingBtnsReverse.each(function (el) { 15907 anim({ 15908 targets: el, 15909 opacity: 1, 15910 scale: [0.4, 1], 15911 translateY: [_this49.offsetY, 0], 15912 translateX: [_this49.offsetX, 0], 15913 duration: 275, 15914 delay: time, 15915 easing: 'easeInOutQuad' 15916 }); 15917 time += 40; 15918 }); 15919 } 15920 15921 /** 15922 * Classic FAB Menu close 15923 */ 15924 15925 }, { 15926 key: "_animateOutFAB", 15927 value: function _animateOutFAB() { 15928 var _this50 = this; 15929 15930 this.$floatingBtnsReverse.each(function (el) { 15931 anim.remove(el); 15932 anim({ 15933 targets: el, 15934 opacity: 0, 15935 scale: 0.4, 15936 translateY: _this50.offsetY, 15937 translateX: _this50.offsetX, 15938 duration: 175, 15939 easing: 'easeOutQuad', 15940 complete: function () { 15941 _this50.$el.removeClass('active'); 15942 } 15943 }); 15944 }); 15945 } 15946 15947 /** 15948 * Toolbar transition Menu open 15949 */ 15950 15951 }, { 15952 key: "_animateInToolbar", 15953 value: function _animateInToolbar() { 15954 var _this51 = this; 15955 15956 var scaleFactor = void 0; 15957 var windowWidth = window.innerWidth; 15958 var windowHeight = window.innerHeight; 15959 var btnRect = this.el.getBoundingClientRect(); 15960 var backdrop = $('<div class="fab-backdrop"></div>'); 15961 var fabColor = this.$anchor.css('background-color'); 15962 this.$anchor.append(backdrop); 15963 15964 this.offsetX = btnRect.left - windowWidth / 2 + btnRect.width / 2; 15965 this.offsetY = windowHeight - btnRect.bottom; 15966 scaleFactor = windowWidth / backdrop[0].clientWidth; 15967 this.btnBottom = btnRect.bottom; 15968 this.btnLeft = btnRect.left; 15969 this.btnWidth = btnRect.width; 15970 15971 // Set initial state 15972 this.$el.addClass('active'); 15973 this.$el.css({ 15974 'text-align': 'center', 15975 width: '100%', 15976 bottom: 0, 15977 left: 0, 15978 transform: 'translateX(' + this.offsetX + 'px)', 15979 transition: 'none' 15980 }); 15981 this.$anchor.css({ 15982 transform: 'translateY(' + -this.offsetY + 'px)', 15983 transition: 'none' 15984 }); 15985 backdrop.css({ 15986 'background-color': fabColor 15987 }); 15988 15989 setTimeout(function () { 15990 _this51.$el.css({ 15991 transform: '', 15992 transition: 'transform .2s cubic-bezier(0.550, 0.085, 0.680, 0.530), background-color 0s linear .2s' 15993 }); 15994 _this51.$anchor.css({ 15995 overflow: 'visible', 15996 transform: '', 15997 transition: 'transform .2s' 15998 }); 15999 16000 setTimeout(function () { 16001 _this51.$el.css({ 16002 overflow: 'hidden', 16003 'background-color': fabColor 16004 }); 16005 backdrop.css({ 16006 transform: 'scale(' + scaleFactor + ')', 16007 transition: 'transform .2s cubic-bezier(0.550, 0.055, 0.675, 0.190)' 16008 }); 16009 _this51.$menu.children('li').children('a').css({ 16010 opacity: 1 16011 }); 16012 16013 // Scroll to close. 16014 _this51._handleDocumentClickBound = _this51._handleDocumentClick.bind(_this51); 16015 window.addEventListener('scroll', _this51._handleCloseBound, true); 16016 document.body.addEventListener('click', _this51._handleDocumentClickBound, true); 16017 }, 100); 16018 }, 0); 16019 } 16020 16021 /** 16022 * Toolbar transition Menu close 16023 */ 16024 16025 }, { 16026 key: "_animateOutToolbar", 16027 value: function _animateOutToolbar() { 16028 var _this52 = this; 16029 16030 var windowWidth = window.innerWidth; 16031 var windowHeight = window.innerHeight; 16032 var backdrop = this.$el.find('.fab-backdrop'); 16033 var fabColor = this.$anchor.css('background-color'); 16034 16035 this.offsetX = this.btnLeft - windowWidth / 2 + this.btnWidth / 2; 16036 this.offsetY = windowHeight - this.btnBottom; 16037 16038 // Hide backdrop 16039 this.$el.removeClass('active'); 16040 this.$el.css({ 16041 'background-color': 'transparent', 16042 transition: 'none' 16043 }); 16044 this.$anchor.css({ 16045 transition: 'none' 16046 }); 16047 backdrop.css({ 16048 transform: 'scale(0)', 16049 'background-color': fabColor 16050 }); 16051 this.$menu.children('li').children('a').css({ 16052 opacity: '' 16053 }); 16054 16055 setTimeout(function () { 16056 backdrop.remove(); 16057 16058 // Set initial state. 16059 _this52.$el.css({ 16060 'text-align': '', 16061 width: '', 16062 bottom: '', 16063 left: '', 16064 overflow: '', 16065 'background-color': '', 16066 transform: 'translate3d(' + -_this52.offsetX + 'px,0,0)' 16067 }); 16068 _this52.$anchor.css({ 16069 overflow: '', 16070 transform: 'translate3d(0,' + _this52.offsetY + 'px,0)' 16071 }); 16072 16073 setTimeout(function () { 16074 _this52.$el.css({ 16075 transform: 'translate3d(0,0,0)', 16076 transition: 'transform .2s' 16077 }); 16078 _this52.$anchor.css({ 16079 transform: 'translate3d(0,0,0)', 16080 transition: 'transform .2s cubic-bezier(0.550, 0.055, 0.675, 0.190)' 16081 }); 16082 }, 20); 16083 }, 200); 16084 } 16085 }], [{ 16086 key: "init", 16087 value: function init(els, options) { 16088 return _get(FloatingActionButton.__proto__ || Object.getPrototypeOf(FloatingActionButton), "init", this).call(this, this, els, options); 16089 } 16090 16091 /** 16092 * Get Instance 16093 */ 16094 16095 }, { 16096 key: "getInstance", 16097 value: function getInstance(el) { 16098 var domElem = !!el.jquery ? el[0] : el; 16099 return domElem.M_FloatingActionButton; 16100 } 16101 }, { 16102 key: "defaults", 16103 get: function () { 16104 return _defaults; 16105 } 16106 }]); 16107 16108 return FloatingActionButton; 16109 }(Component); 16110 16111 M.FloatingActionButton = FloatingActionButton; 16112 16113 if (M.jQueryLoaded) { 16114 M.initializeJqueryWrapper(FloatingActionButton, 'floatingActionButton', 'M_FloatingActionButton'); 16115 } 16116})(cash, M.anime); 16117;(function ($) { 16118 'use strict'; 16119 16120 var _defaults = { 16121 // Close when date is selected 16122 autoClose: false, 16123 16124 // the default output format for the input field value 16125 format: 'mmm dd, yyyy', 16126 16127 // Used to create date object from current input string 16128 parse: null, 16129 16130 // The initial date to view when first opened 16131 defaultDate: null, 16132 16133 // Make the `defaultDate` the initial selected value 16134 setDefaultDate: false, 16135 16136 disableWeekends: false, 16137 16138 disableDayFn: null, 16139 16140 // First day of week (0: Sunday, 1: Monday etc) 16141 firstDay: 0, 16142 16143 // The earliest date that can be selected 16144 minDate: null, 16145 // Thelatest date that can be selected 16146 maxDate: null, 16147 16148 // Number of years either side, or array of upper/lower range 16149 yearRange: 10, 16150 16151 // used internally (don't config outside) 16152 minYear: 0, 16153 maxYear: 9999, 16154 minMonth: undefined, 16155 maxMonth: undefined, 16156 16157 startRange: null, 16158 endRange: null, 16159 16160 isRTL: false, 16161 16162 // Render the month after year in the calendar title 16163 showMonthAfterYear: false, 16164 16165 // Render days of the calendar grid that fall in the next or previous month 16166 showDaysInNextAndPreviousMonths: false, 16167 16168 // Specify a DOM element to render the calendar in 16169 container: null, 16170 16171 // Show clear button 16172 showClearBtn: false, 16173 16174 // internationalization 16175 i18n: { 16176 cancel: 'Cancel', 16177 clear: 'Clear', 16178 done: 'Ok', 16179 previousMonth: '‹', 16180 nextMonth: '›', 16181 months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], 16182 monthsShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], 16183 weekdays: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], 16184 weekdaysShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], 16185 weekdaysAbbrev: ['S', 'M', 'T', 'W', 'T', 'F', 'S'] 16186 }, 16187 16188 // events array 16189 events: [], 16190 16191 // callback function 16192 onSelect: null, 16193 onOpen: null, 16194 onClose: null, 16195 onDraw: null 16196 }; 16197 16198 /** 16199 * @class 16200 * 16201 */ 16202 16203 var Datepicker = function (_Component15) { 16204 _inherits(Datepicker, _Component15); 16205 16206 /** 16207 * Construct Datepicker instance and set up overlay 16208 * @constructor 16209 * @param {Element} el 16210 * @param {Object} options 16211 */ 16212 function Datepicker(el, options) { 16213 _classCallCheck(this, Datepicker); 16214 16215 var _this53 = _possibleConstructorReturn(this, (Datepicker.__proto__ || Object.getPrototypeOf(Datepicker)).call(this, Datepicker, el, options)); 16216 16217 _this53.el.M_Datepicker = _this53; 16218 16219 _this53.options = $.extend({}, Datepicker.defaults, options); 16220 16221 // make sure i18n defaults are not lost when only few i18n option properties are passed 16222 if (!!options && options.hasOwnProperty('i18n') && typeof options.i18n === 'object') { 16223 _this53.options.i18n = $.extend({}, Datepicker.defaults.i18n, options.i18n); 16224 } 16225 16226 // Remove time component from minDate and maxDate options 16227 if (_this53.options.minDate) _this53.options.minDate.setHours(0, 0, 0, 0); 16228 if (_this53.options.maxDate) _this53.options.maxDate.setHours(0, 0, 0, 0); 16229 16230 _this53.id = M.guid(); 16231 16232 _this53._setupVariables(); 16233 _this53._insertHTMLIntoDOM(); 16234 _this53._setupModal(); 16235 16236 _this53._setupEventHandlers(); 16237 16238 if (!_this53.options.defaultDate) { 16239 _this53.options.defaultDate = new Date(Date.parse(_this53.el.value)); 16240 } 16241 16242 var defDate = _this53.options.defaultDate; 16243 if (Datepicker._isDate(defDate)) { 16244 if (_this53.options.setDefaultDate) { 16245 _this53.setDate(defDate, true); 16246 _this53.setInputValue(); 16247 } else { 16248 _this53.gotoDate(defDate); 16249 } 16250 } else { 16251 _this53.gotoDate(new Date()); 16252 } 16253 16254 /** 16255 * Describes open/close state of datepicker 16256 * @type {Boolean} 16257 */ 16258 _this53.isOpen = false; 16259 return _this53; 16260 } 16261 16262 _createClass(Datepicker, [{ 16263 key: "destroy", 16264 16265 16266 /** 16267 * Teardown component 16268 */ 16269 value: function destroy() { 16270 this._removeEventHandlers(); 16271 this.modal.destroy(); 16272 $(this.modalEl).remove(); 16273 this.destroySelects(); 16274 this.el.M_Datepicker = undefined; 16275 } 16276 }, { 16277 key: "destroySelects", 16278 value: function destroySelects() { 16279 var oldYearSelect = this.calendarEl.querySelector('.orig-select-year'); 16280 if (oldYearSelect) { 16281 M.FormSelect.getInstance(oldYearSelect).destroy(); 16282 } 16283 var oldMonthSelect = this.calendarEl.querySelector('.orig-select-month'); 16284 if (oldMonthSelect) { 16285 M.FormSelect.getInstance(oldMonthSelect).destroy(); 16286 } 16287 } 16288 }, { 16289 key: "_insertHTMLIntoDOM", 16290 value: function _insertHTMLIntoDOM() { 16291 if (this.options.showClearBtn) { 16292 $(this.clearBtn).css({ visibility: '' }); 16293 this.clearBtn.innerHTML = this.options.i18n.clear; 16294 } 16295 16296 this.doneBtn.innerHTML = this.options.i18n.done; 16297 this.cancelBtn.innerHTML = this.options.i18n.cancel; 16298 16299 if (this.options.container) { 16300 this.$modalEl.appendTo(this.options.container); 16301 } else { 16302 this.$modalEl.insertBefore(this.el); 16303 } 16304 } 16305 }, { 16306 key: "_setupModal", 16307 value: function _setupModal() { 16308 var _this54 = this; 16309 16310 this.modalEl.id = 'modal-' + this.id; 16311 this.modal = M.Modal.init(this.modalEl, { 16312 onCloseEnd: function () { 16313 _this54.isOpen = false; 16314 } 16315 }); 16316 } 16317 }, { 16318 key: "toString", 16319 value: function toString(format) { 16320 var _this55 = this; 16321 16322 format = format || this.options.format; 16323 if (!Datepicker._isDate(this.date)) { 16324 return ''; 16325 } 16326 16327 var formatArray = format.split(/(d{1,4}|m{1,4}|y{4}|yy|!.)/g); 16328 var formattedDate = formatArray.map(function (label) { 16329 if (_this55.formats[label]) { 16330 return _this55.formats[label](); 16331 } 16332 16333 return label; 16334 }).join(''); 16335 return formattedDate; 16336 } 16337 }, { 16338 key: "setDate", 16339 value: function setDate(date, preventOnSelect) { 16340 if (!date) { 16341 this.date = null; 16342 this._renderDateDisplay(); 16343 return this.draw(); 16344 } 16345 if (typeof date === 'string') { 16346 date = new Date(Date.parse(date)); 16347 } 16348 if (!Datepicker._isDate(date)) { 16349 return; 16350 } 16351 16352 var min = this.options.minDate, 16353 max = this.options.maxDate; 16354 16355 if (Datepicker._isDate(min) && date < min) { 16356 date = min; 16357 } else if (Datepicker._isDate(max) && date > max) { 16358 date = max; 16359 } 16360 16361 this.date = new Date(date.getTime()); 16362 16363 this._renderDateDisplay(); 16364 16365 Datepicker._setToStartOfDay(this.date); 16366 this.gotoDate(this.date); 16367 16368 if (!preventOnSelect && typeof this.options.onSelect === 'function') { 16369 this.options.onSelect.call(this, this.date); 16370 } 16371 } 16372 }, { 16373 key: "setInputValue", 16374 value: function setInputValue() { 16375 this.el.value = this.toString(); 16376 this.$el.trigger('change', { firedBy: this }); 16377 } 16378 }, { 16379 key: "_renderDateDisplay", 16380 value: function _renderDateDisplay() { 16381 var displayDate = Datepicker._isDate(this.date) ? this.date : new Date(); 16382 var i18n = this.options.i18n; 16383 var day = i18n.weekdaysShort[displayDate.getDay()]; 16384 var month = i18n.monthsShort[displayDate.getMonth()]; 16385 var date = displayDate.getDate(); 16386 this.yearTextEl.innerHTML = displayDate.getFullYear(); 16387 this.dateTextEl.innerHTML = day + ", " + month + " " + date; 16388 } 16389 16390 /** 16391 * change view to a specific date 16392 */ 16393 16394 }, { 16395 key: "gotoDate", 16396 value: function gotoDate(date) { 16397 var newCalendar = true; 16398 16399 if (!Datepicker._isDate(date)) { 16400 return; 16401 } 16402 16403 if (this.calendars) { 16404 var firstVisibleDate = new Date(this.calendars[0].year, this.calendars[0].month, 1), 16405 lastVisibleDate = new Date(this.calendars[this.calendars.length - 1].year, this.calendars[this.calendars.length - 1].month, 1), 16406 visibleDate = date.getTime(); 16407 // get the end of the month 16408 lastVisibleDate.setMonth(lastVisibleDate.getMonth() + 1); 16409 lastVisibleDate.setDate(lastVisibleDate.getDate() - 1); 16410 newCalendar = visibleDate < firstVisibleDate.getTime() || lastVisibleDate.getTime() < visibleDate; 16411 } 16412 16413 if (newCalendar) { 16414 this.calendars = [{ 16415 month: date.getMonth(), 16416 year: date.getFullYear() 16417 }]; 16418 } 16419 16420 this.adjustCalendars(); 16421 } 16422 }, { 16423 key: "adjustCalendars", 16424 value: function adjustCalendars() { 16425 this.calendars[0] = this.adjustCalendar(this.calendars[0]); 16426 this.draw(); 16427 } 16428 }, { 16429 key: "adjustCalendar", 16430 value: function adjustCalendar(calendar) { 16431 if (calendar.month < 0) { 16432 calendar.year -= Math.ceil(Math.abs(calendar.month) / 12); 16433 calendar.month += 12; 16434 } 16435 if (calendar.month > 11) { 16436 calendar.year += Math.floor(Math.abs(calendar.month) / 12); 16437 calendar.month -= 12; 16438 } 16439 return calendar; 16440 } 16441 }, { 16442 key: "nextMonth", 16443 value: function nextMonth() { 16444 this.calendars[0].month++; 16445 this.adjustCalendars(); 16446 } 16447 }, { 16448 key: "prevMonth", 16449 value: function prevMonth() { 16450 this.calendars[0].month--; 16451 this.adjustCalendars(); 16452 } 16453 }, { 16454 key: "render", 16455 value: function render(year, month, randId) { 16456 var opts = this.options, 16457 now = new Date(), 16458 days = Datepicker._getDaysInMonth(year, month), 16459 before = new Date(year, month, 1).getDay(), 16460 data = [], 16461 row = []; 16462 Datepicker._setToStartOfDay(now); 16463 if (opts.firstDay > 0) { 16464 before -= opts.firstDay; 16465 if (before < 0) { 16466 before += 7; 16467 } 16468 } 16469 var previousMonth = month === 0 ? 11 : month - 1, 16470 nextMonth = month === 11 ? 0 : month + 1, 16471 yearOfPreviousMonth = month === 0 ? year - 1 : year, 16472 yearOfNextMonth = month === 11 ? year + 1 : year, 16473 daysInPreviousMonth = Datepicker._getDaysInMonth(yearOfPreviousMonth, previousMonth); 16474 var cells = days + before, 16475 after = cells; 16476 while (after > 7) { 16477 after -= 7; 16478 } 16479 cells += 7 - after; 16480 var isWeekSelected = false; 16481 for (var i = 0, r = 0; i < cells; i++) { 16482 var day = new Date(year, month, 1 + (i - before)), 16483 isSelected = Datepicker._isDate(this.date) ? Datepicker._compareDates(day, this.date) : false, 16484 isToday = Datepicker._compareDates(day, now), 16485 hasEvent = opts.events.indexOf(day.toDateString()) !== -1 ? true : false, 16486 isEmpty = i < before || i >= days + before, 16487 dayNumber = 1 + (i - before), 16488 monthNumber = month, 16489 yearNumber = year, 16490 isStartRange = opts.startRange && Datepicker._compareDates(opts.startRange, day), 16491 isEndRange = opts.endRange && Datepicker._compareDates(opts.endRange, day), 16492 isInRange = opts.startRange && opts.endRange && opts.startRange < day && day < opts.endRange, 16493 isDisabled = opts.minDate && day < opts.minDate || opts.maxDate && day > opts.maxDate || opts.disableWeekends && Datepicker._isWeekend(day) || opts.disableDayFn && opts.disableDayFn(day); 16494 16495 if (isEmpty) { 16496 if (i < before) { 16497 dayNumber = daysInPreviousMonth + dayNumber; 16498 monthNumber = previousMonth; 16499 yearNumber = yearOfPreviousMonth; 16500 } else { 16501 dayNumber = dayNumber - days; 16502 monthNumber = nextMonth; 16503 yearNumber = yearOfNextMonth; 16504 } 16505 } 16506 16507 var dayConfig = { 16508 day: dayNumber, 16509 month: monthNumber, 16510 year: yearNumber, 16511 hasEvent: hasEvent, 16512 isSelected: isSelected, 16513 isToday: isToday, 16514 isDisabled: isDisabled, 16515 isEmpty: isEmpty, 16516 isStartRange: isStartRange, 16517 isEndRange: isEndRange, 16518 isInRange: isInRange, 16519 showDaysInNextAndPreviousMonths: opts.showDaysInNextAndPreviousMonths 16520 }; 16521 16522 row.push(this.renderDay(dayConfig)); 16523 16524 if (++r === 7) { 16525 data.push(this.renderRow(row, opts.isRTL, isWeekSelected)); 16526 row = []; 16527 r = 0; 16528 isWeekSelected = false; 16529 } 16530 } 16531 return this.renderTable(opts, data, randId); 16532 } 16533 }, { 16534 key: "renderDay", 16535 value: function renderDay(opts) { 16536 var arr = []; 16537 var ariaSelected = 'false'; 16538 if (opts.isEmpty) { 16539 if (opts.showDaysInNextAndPreviousMonths) { 16540 arr.push('is-outside-current-month'); 16541 arr.push('is-selection-disabled'); 16542 } else { 16543 return '<td class="is-empty"></td>'; 16544 } 16545 } 16546 if (opts.isDisabled) { 16547 arr.push('is-disabled'); 16548 } 16549 16550 if (opts.isToday) { 16551 arr.push('is-today'); 16552 } 16553 if (opts.isSelected) { 16554 arr.push('is-selected'); 16555 ariaSelected = 'true'; 16556 } 16557 if (opts.hasEvent) { 16558 arr.push('has-event'); 16559 } 16560 if (opts.isInRange) { 16561 arr.push('is-inrange'); 16562 } 16563 if (opts.isStartRange) { 16564 arr.push('is-startrange'); 16565 } 16566 if (opts.isEndRange) { 16567 arr.push('is-endrange'); 16568 } 16569 return "<td data-day=\"" + opts.day + "\" class=\"" + arr.join(' ') + "\" aria-selected=\"" + ariaSelected + "\">" + ("<button class=\"datepicker-day-button\" type=\"button\" data-year=\"" + opts.year + "\" data-month=\"" + opts.month + "\" data-day=\"" + opts.day + "\">" + opts.day + "</button>") + '</td>'; 16570 } 16571 }, { 16572 key: "renderRow", 16573 value: function renderRow(days, isRTL, isRowSelected) { 16574 return '<tr class="datepicker-row' + (isRowSelected ? ' is-selected' : '') + '">' + (isRTL ? days.reverse() : days).join('') + '</tr>'; 16575 } 16576 }, { 16577 key: "renderTable", 16578 value: function renderTable(opts, data, randId) { 16579 return '<div class="datepicker-table-wrapper"><table cellpadding="0" cellspacing="0" class="datepicker-table" role="grid" aria-labelledby="' + randId + '">' + this.renderHead(opts) + this.renderBody(data) + '</table></div>'; 16580 } 16581 }, { 16582 key: "renderHead", 16583 value: function renderHead(opts) { 16584 var i = void 0, 16585 arr = []; 16586 for (i = 0; i < 7; i++) { 16587 arr.push("<th scope=\"col\"><abbr title=\"" + this.renderDayName(opts, i) + "\">" + this.renderDayName(opts, i, true) + "</abbr></th>"); 16588 } 16589 return '<thead><tr>' + (opts.isRTL ? arr.reverse() : arr).join('') + '</tr></thead>'; 16590 } 16591 }, { 16592 key: "renderBody", 16593 value: function renderBody(rows) { 16594 return '<tbody>' + rows.join('') + '</tbody>'; 16595 } 16596 }, { 16597 key: "renderTitle", 16598 value: function renderTitle(instance, c, year, month, refYear, randId) { 16599 var i = void 0, 16600 j = void 0, 16601 arr = void 0, 16602 opts = this.options, 16603 isMinYear = year === opts.minYear, 16604 isMaxYear = year === opts.maxYear, 16605 html = '<div id="' + randId + '" class="datepicker-controls" role="heading" aria-live="assertive">', 16606 monthHtml = void 0, 16607 yearHtml = void 0, 16608 prev = true, 16609 next = true; 16610 16611 for (arr = [], i = 0; i < 12; i++) { 16612 arr.push('<option value="' + (year === refYear ? i - c : 12 + i - c) + '"' + (i === month ? ' selected="selected"' : '') + (isMinYear && i < opts.minMonth || isMaxYear && i > opts.maxMonth ? 'disabled="disabled"' : '') + '>' + opts.i18n.months[i] + '</option>'); 16613 } 16614 16615 monthHtml = '<select class="datepicker-select orig-select-month" tabindex="-1">' + arr.join('') + '</select>'; 16616 16617 if ($.isArray(opts.yearRange)) { 16618 i = opts.yearRange[0]; 16619 j = opts.yearRange[1] + 1; 16620 } else { 16621 i = year - opts.yearRange; 16622 j = 1 + year + opts.yearRange; 16623 } 16624 16625 for (arr = []; i < j && i <= opts.maxYear; i++) { 16626 if (i >= opts.minYear) { 16627 arr.push("<option value=\"" + i + "\" " + (i === year ? 'selected="selected"' : '') + ">" + i + "</option>"); 16628 } 16629 } 16630 16631 yearHtml = "<select class=\"datepicker-select orig-select-year\" tabindex=\"-1\">" + arr.join('') + "</select>"; 16632 16633 var leftArrow = '<svg fill="#000000" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"/><path d="M0-.5h24v24H0z" fill="none"/></svg>'; 16634 html += "<button class=\"month-prev" + (prev ? '' : ' is-disabled') + "\" type=\"button\">" + leftArrow + "</button>"; 16635 16636 html += '<div class="selects-container">'; 16637 if (opts.showMonthAfterYear) { 16638 html += yearHtml + monthHtml; 16639 } else { 16640 html += monthHtml + yearHtml; 16641 } 16642 html += '</div>'; 16643 16644 if (isMinYear && (month === 0 || opts.minMonth >= month)) { 16645 prev = false; 16646 } 16647 16648 if (isMaxYear && (month === 11 || opts.maxMonth <= month)) { 16649 next = false; 16650 } 16651 16652 var rightArrow = '<svg fill="#000000" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"/><path d="M0-.25h24v24H0z" fill="none"/></svg>'; 16653 html += "<button class=\"month-next" + (next ? '' : ' is-disabled') + "\" type=\"button\">" + rightArrow + "</button>"; 16654 16655 return html += '</div>'; 16656 } 16657 16658 /** 16659 * refresh the HTML 16660 */ 16661 16662 }, { 16663 key: "draw", 16664 value: function draw(force) { 16665 if (!this.isOpen && !force) { 16666 return; 16667 } 16668 var opts = this.options, 16669 minYear = opts.minYear, 16670 maxYear = opts.maxYear, 16671 minMonth = opts.minMonth, 16672 maxMonth = opts.maxMonth, 16673 html = '', 16674 randId = void 0; 16675 16676 if (this._y <= minYear) { 16677 this._y = minYear; 16678 if (!isNaN(minMonth) && this._m < minMonth) { 16679 this._m = minMonth; 16680 } 16681 } 16682 if (this._y >= maxYear) { 16683 this._y = maxYear; 16684 if (!isNaN(maxMonth) && this._m > maxMonth) { 16685 this._m = maxMonth; 16686 } 16687 } 16688 16689 randId = 'datepicker-title-' + Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 2); 16690 16691 for (var c = 0; c < 1; c++) { 16692 this._renderDateDisplay(); 16693 html += this.renderTitle(this, c, this.calendars[c].year, this.calendars[c].month, this.calendars[0].year, randId) + this.render(this.calendars[c].year, this.calendars[c].month, randId); 16694 } 16695 16696 this.destroySelects(); 16697 16698 this.calendarEl.innerHTML = html; 16699 16700 // Init Materialize Select 16701 var yearSelect = this.calendarEl.querySelector('.orig-select-year'); 16702 var monthSelect = this.calendarEl.querySelector('.orig-select-month'); 16703 M.FormSelect.init(yearSelect, { 16704 classes: 'select-year', 16705 dropdownOptions: { container: document.body, constrainWidth: false } 16706 }); 16707 M.FormSelect.init(monthSelect, { 16708 classes: 'select-month', 16709 dropdownOptions: { container: document.body, constrainWidth: false } 16710 }); 16711 16712 // Add change handlers for select 16713 yearSelect.addEventListener('change', this._handleYearChange.bind(this)); 16714 monthSelect.addEventListener('change', this._handleMonthChange.bind(this)); 16715 16716 if (typeof this.options.onDraw === 'function') { 16717 this.options.onDraw(this); 16718 } 16719 } 16720 16721 /** 16722 * Setup Event Handlers 16723 */ 16724 16725 }, { 16726 key: "_setupEventHandlers", 16727 value: function _setupEventHandlers() { 16728 this._handleInputKeydownBound = this._handleInputKeydown.bind(this); 16729 this._handleInputClickBound = this._handleInputClick.bind(this); 16730 this._handleInputChangeBound = this._handleInputChange.bind(this); 16731 this._handleCalendarClickBound = this._handleCalendarClick.bind(this); 16732 this._finishSelectionBound = this._finishSelection.bind(this); 16733 this._handleMonthChange = this._handleMonthChange.bind(this); 16734 this._closeBound = this.close.bind(this); 16735 16736 this.el.addEventListener('click', this._handleInputClickBound); 16737 this.el.addEventListener('keydown', this._handleInputKeydownBound); 16738 this.el.addEventListener('change', this._handleInputChangeBound); 16739 this.calendarEl.addEventListener('click', this._handleCalendarClickBound); 16740 this.doneBtn.addEventListener('click', this._finishSelectionBound); 16741 this.cancelBtn.addEventListener('click', this._closeBound); 16742 16743 if (this.options.showClearBtn) { 16744 this._handleClearClickBound = this._handleClearClick.bind(this); 16745 this.clearBtn.addEventListener('click', this._handleClearClickBound); 16746 } 16747 } 16748 }, { 16749 key: "_setupVariables", 16750 value: function _setupVariables() { 16751 var _this56 = this; 16752 16753 this.$modalEl = $(Datepicker._template); 16754 this.modalEl = this.$modalEl[0]; 16755 16756 this.calendarEl = this.modalEl.querySelector('.datepicker-calendar'); 16757 16758 this.yearTextEl = this.modalEl.querySelector('.year-text'); 16759 this.dateTextEl = this.modalEl.querySelector('.date-text'); 16760 if (this.options.showClearBtn) { 16761 this.clearBtn = this.modalEl.querySelector('.datepicker-clear'); 16762 } 16763 this.doneBtn = this.modalEl.querySelector('.datepicker-done'); 16764 this.cancelBtn = this.modalEl.querySelector('.datepicker-cancel'); 16765 16766 this.formats = { 16767 d: function () { 16768 return _this56.date.getDate(); 16769 }, 16770 dd: function () { 16771 var d = _this56.date.getDate(); 16772 return (d < 10 ? '0' : '') + d; 16773 }, 16774 ddd: function () { 16775 return _this56.options.i18n.weekdaysShort[_this56.date.getDay()]; 16776 }, 16777 dddd: function () { 16778 return _this56.options.i18n.weekdays[_this56.date.getDay()]; 16779 }, 16780 m: function () { 16781 return _this56.date.getMonth() + 1; 16782 }, 16783 mm: function () { 16784 var m = _this56.date.getMonth() + 1; 16785 return (m < 10 ? '0' : '') + m; 16786 }, 16787 mmm: function () { 16788 return _this56.options.i18n.monthsShort[_this56.date.getMonth()]; 16789 }, 16790 mmmm: function () { 16791 return _this56.options.i18n.months[_this56.date.getMonth()]; 16792 }, 16793 yy: function () { 16794 return ('' + _this56.date.getFullYear()).slice(2); 16795 }, 16796 yyyy: function () { 16797 return _this56.date.getFullYear(); 16798 } 16799 }; 16800 } 16801 16802 /** 16803 * Remove Event Handlers 16804 */ 16805 16806 }, { 16807 key: "_removeEventHandlers", 16808 value: function _removeEventHandlers() { 16809 this.el.removeEventListener('click', this._handleInputClickBound); 16810 this.el.removeEventListener('keydown', this._handleInputKeydownBound); 16811 this.el.removeEventListener('change', this._handleInputChangeBound); 16812 this.calendarEl.removeEventListener('click', this._handleCalendarClickBound); 16813 } 16814 }, { 16815 key: "_handleInputClick", 16816 value: function _handleInputClick() { 16817 this.open(); 16818 } 16819 }, { 16820 key: "_handleInputKeydown", 16821 value: function _handleInputKeydown(e) { 16822 if (e.which === M.keys.ENTER) { 16823 e.preventDefault(); 16824 this.open(); 16825 } 16826 } 16827 }, { 16828 key: "_handleCalendarClick", 16829 value: function _handleCalendarClick(e) { 16830 if (!this.isOpen) { 16831 return; 16832 } 16833 16834 var $target = $(e.target); 16835 if (!$target.hasClass('is-disabled')) { 16836 if ($target.hasClass('datepicker-day-button') && !$target.hasClass('is-empty') && !$target.parent().hasClass('is-disabled')) { 16837 this.setDate(new Date(e.target.getAttribute('data-year'), e.target.getAttribute('data-month'), e.target.getAttribute('data-day'))); 16838 if (this.options.autoClose) { 16839 this._finishSelection(); 16840 } 16841 } else if ($target.closest('.month-prev').length) { 16842 this.prevMonth(); 16843 } else if ($target.closest('.month-next').length) { 16844 this.nextMonth(); 16845 } 16846 } 16847 } 16848 }, { 16849 key: "_handleClearClick", 16850 value: function _handleClearClick() { 16851 this.date = null; 16852 this.setInputValue(); 16853 this.close(); 16854 } 16855 }, { 16856 key: "_handleMonthChange", 16857 value: function _handleMonthChange(e) { 16858 this.gotoMonth(e.target.value); 16859 } 16860 }, { 16861 key: "_handleYearChange", 16862 value: function _handleYearChange(e) { 16863 this.gotoYear(e.target.value); 16864 } 16865 16866 /** 16867 * change view to a specific month (zero-index, e.g. 0: January) 16868 */ 16869 16870 }, { 16871 key: "gotoMonth", 16872 value: function gotoMonth(month) { 16873 if (!isNaN(month)) { 16874 this.calendars[0].month = parseInt(month, 10); 16875 this.adjustCalendars(); 16876 } 16877 } 16878 16879 /** 16880 * change view to a specific full year (e.g. "2012") 16881 */ 16882 16883 }, { 16884 key: "gotoYear", 16885 value: function gotoYear(year) { 16886 if (!isNaN(year)) { 16887 this.calendars[0].year = parseInt(year, 10); 16888 this.adjustCalendars(); 16889 } 16890 } 16891 }, { 16892 key: "_handleInputChange", 16893 value: function _handleInputChange(e) { 16894 var date = void 0; 16895 16896 // Prevent change event from being fired when triggered by the plugin 16897 if (e.firedBy === this) { 16898 return; 16899 } 16900 if (this.options.parse) { 16901 date = this.options.parse(this.el.value, this.options.format); 16902 } else { 16903 date = new Date(Date.parse(this.el.value)); 16904 } 16905 16906 if (Datepicker._isDate(date)) { 16907 this.setDate(date); 16908 } 16909 } 16910 }, { 16911 key: "renderDayName", 16912 value: function renderDayName(opts, day, abbr) { 16913 day += opts.firstDay; 16914 while (day >= 7) { 16915 day -= 7; 16916 } 16917 return abbr ? opts.i18n.weekdaysAbbrev[day] : opts.i18n.weekdays[day]; 16918 } 16919 16920 /** 16921 * Set input value to the selected date and close Datepicker 16922 */ 16923 16924 }, { 16925 key: "_finishSelection", 16926 value: function _finishSelection() { 16927 this.setInputValue(); 16928 this.close(); 16929 } 16930 16931 /** 16932 * Open Datepicker 16933 */ 16934 16935 }, { 16936 key: "open", 16937 value: function open() { 16938 if (this.isOpen) { 16939 return; 16940 } 16941 16942 this.isOpen = true; 16943 if (typeof this.options.onOpen === 'function') { 16944 this.options.onOpen.call(this); 16945 } 16946 this.draw(); 16947 this.modal.open(); 16948 return this; 16949 } 16950 16951 /** 16952 * Close Datepicker 16953 */ 16954 16955 }, { 16956 key: "close", 16957 value: function close() { 16958 if (!this.isOpen) { 16959 return; 16960 } 16961 16962 this.isOpen = false; 16963 if (typeof this.options.onClose === 'function') { 16964 this.options.onClose.call(this); 16965 } 16966 this.modal.close(); 16967 return this; 16968 } 16969 }], [{ 16970 key: "init", 16971 value: function init(els, options) { 16972 return _get(Datepicker.__proto__ || Object.getPrototypeOf(Datepicker), "init", this).call(this, this, els, options); 16973 } 16974 }, { 16975 key: "_isDate", 16976 value: function _isDate(obj) { 16977 return (/Date/.test(Object.prototype.toString.call(obj)) && !isNaN(obj.getTime()) 16978 ); 16979 } 16980 }, { 16981 key: "_isWeekend", 16982 value: function _isWeekend(date) { 16983 var day = date.getDay(); 16984 return day === 0 || day === 6; 16985 } 16986 }, { 16987 key: "_setToStartOfDay", 16988 value: function _setToStartOfDay(date) { 16989 if (Datepicker._isDate(date)) date.setHours(0, 0, 0, 0); 16990 } 16991 }, { 16992 key: "_getDaysInMonth", 16993 value: function _getDaysInMonth(year, month) { 16994 return [31, Datepicker._isLeapYear(year) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month]; 16995 } 16996 }, { 16997 key: "_isLeapYear", 16998 value: function _isLeapYear(year) { 16999 // solution by Matti Virkkunen: http://stackoverflow.com/a/4881951 17000 return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0; 17001 } 17002 }, { 17003 key: "_compareDates", 17004 value: function _compareDates(a, b) { 17005 // weak date comparison (use setToStartOfDay(date) to ensure correct result) 17006 return a.getTime() === b.getTime(); 17007 } 17008 }, { 17009 key: "_setToStartOfDay", 17010 value: function _setToStartOfDay(date) { 17011 if (Datepicker._isDate(date)) date.setHours(0, 0, 0, 0); 17012 } 17013 17014 /** 17015 * Get Instance 17016 */ 17017 17018 }, { 17019 key: "getInstance", 17020 value: function getInstance(el) { 17021 var domElem = !!el.jquery ? el[0] : el; 17022 return domElem.M_Datepicker; 17023 } 17024 }, { 17025 key: "defaults", 17026 get: function () { 17027 return _defaults; 17028 } 17029 }]); 17030 17031 return Datepicker; 17032 }(Component); 17033 17034 Datepicker._template = ['<div class= "modal datepicker-modal">', '<div class="modal-content datepicker-container">', '<div class="datepicker-date-display">', '<span class="year-text"></span>', '<span class="date-text"></span>', '</div>', '<div class="datepicker-calendar-container">', '<div class="datepicker-calendar"></div>', '<div class="datepicker-footer">', '<button class="btn-flat datepicker-clear waves-effect" style="visibility: hidden;" type="button"></button>', '<div class="confirmation-btns">', '<button class="btn-flat datepicker-cancel waves-effect" type="button"></button>', '<button class="btn-flat datepicker-done waves-effect" type="button"></button>', '</div>', '</div>', '</div>', '</div>', '</div>'].join(''); 17035 17036 M.Datepicker = Datepicker; 17037 17038 if (M.jQueryLoaded) { 17039 M.initializeJqueryWrapper(Datepicker, 'datepicker', 'M_Datepicker'); 17040 } 17041})(cash); 17042;(function ($) { 17043 'use strict'; 17044 17045 var _defaults = { 17046 dialRadius: 135, 17047 outerRadius: 105, 17048 innerRadius: 70, 17049 tickRadius: 20, 17050 duration: 350, 17051 container: null, 17052 defaultTime: 'now', // default time, 'now' or '13:14' e.g. 17053 fromNow: 0, // Millisecond offset from the defaultTime 17054 showClearBtn: false, 17055 17056 // internationalization 17057 i18n: { 17058 cancel: 'Cancel', 17059 clear: 'Clear', 17060 done: 'Ok' 17061 }, 17062 17063 autoClose: false, // auto close when minute is selected 17064 twelveHour: true, // change to 12 hour AM/PM clock from 24 hour 17065 vibrate: true, // vibrate the device when dragging clock hand 17066 17067 // Callbacks 17068 onOpenStart: null, 17069 onOpenEnd: null, 17070 onCloseStart: null, 17071 onCloseEnd: null, 17072 onSelect: null 17073 }; 17074 17075 /** 17076 * @class 17077 * 17078 */ 17079 17080 var Timepicker = function (_Component16) { 17081 _inherits(Timepicker, _Component16); 17082 17083 function Timepicker(el, options) { 17084 _classCallCheck(this, Timepicker); 17085 17086 var _this57 = _possibleConstructorReturn(this, (Timepicker.__proto__ || Object.getPrototypeOf(Timepicker)).call(this, Timepicker, el, options)); 17087 17088 _this57.el.M_Timepicker = _this57; 17089 17090 _this57.options = $.extend({}, Timepicker.defaults, options); 17091 17092 _this57.id = M.guid(); 17093 _this57._insertHTMLIntoDOM(); 17094 _this57._setupModal(); 17095 _this57._setupVariables(); 17096 _this57._setupEventHandlers(); 17097 17098 _this57._clockSetup(); 17099 _this57._pickerSetup(); 17100 return _this57; 17101 } 17102 17103 _createClass(Timepicker, [{ 17104 key: "destroy", 17105 17106 17107 /** 17108 * Teardown component 17109 */ 17110 value: function destroy() { 17111 this._removeEventHandlers(); 17112 this.modal.destroy(); 17113 $(this.modalEl).remove(); 17114 this.el.M_Timepicker = undefined; 17115 } 17116 17117 /** 17118 * Setup Event Handlers 17119 */ 17120 17121 }, { 17122 key: "_setupEventHandlers", 17123 value: function _setupEventHandlers() { 17124 this._handleInputKeydownBound = this._handleInputKeydown.bind(this); 17125 this._handleInputClickBound = this._handleInputClick.bind(this); 17126 this._handleClockClickStartBound = this._handleClockClickStart.bind(this); 17127 this._handleDocumentClickMoveBound = this._handleDocumentClickMove.bind(this); 17128 this._handleDocumentClickEndBound = this._handleDocumentClickEnd.bind(this); 17129 17130 this.el.addEventListener('click', this._handleInputClickBound); 17131 this.el.addEventListener('keydown', this._handleInputKeydownBound); 17132 this.plate.addEventListener('mousedown', this._handleClockClickStartBound); 17133 this.plate.addEventListener('touchstart', this._handleClockClickStartBound); 17134 17135 $(this.spanHours).on('click', this.showView.bind(this, 'hours')); 17136 $(this.spanMinutes).on('click', this.showView.bind(this, 'minutes')); 17137 } 17138 }, { 17139 key: "_removeEventHandlers", 17140 value: function _removeEventHandlers() { 17141 this.el.removeEventListener('click', this._handleInputClickBound); 17142 this.el.removeEventListener('keydown', this._handleInputKeydownBound); 17143 } 17144 }, { 17145 key: "_handleInputClick", 17146 value: function _handleInputClick() { 17147 this.open(); 17148 } 17149 }, { 17150 key: "_handleInputKeydown", 17151 value: function _handleInputKeydown(e) { 17152 if (e.which === M.keys.ENTER) { 17153 e.preventDefault(); 17154 this.open(); 17155 } 17156 } 17157 }, { 17158 key: "_handleClockClickStart", 17159 value: function _handleClockClickStart(e) { 17160 e.preventDefault(); 17161 var clockPlateBR = this.plate.getBoundingClientRect(); 17162 var offset = { x: clockPlateBR.left, y: clockPlateBR.top }; 17163 17164 this.x0 = offset.x + this.options.dialRadius; 17165 this.y0 = offset.y + this.options.dialRadius; 17166 this.moved = false; 17167 var clickPos = Timepicker._Pos(e); 17168 this.dx = clickPos.x - this.x0; 17169 this.dy = clickPos.y - this.y0; 17170 17171 // Set clock hands 17172 this.setHand(this.dx, this.dy, false); 17173 17174 // Mousemove on document 17175 document.addEventListener('mousemove', this._handleDocumentClickMoveBound); 17176 document.addEventListener('touchmove', this._handleDocumentClickMoveBound); 17177 17178 // Mouseup on document 17179 document.addEventListener('mouseup', this._handleDocumentClickEndBound); 17180 document.addEventListener('touchend', this._handleDocumentClickEndBound); 17181 } 17182 }, { 17183 key: "_handleDocumentClickMove", 17184 value: function _handleDocumentClickMove(e) { 17185 e.preventDefault(); 17186 var clickPos = Timepicker._Pos(e); 17187 var x = clickPos.x - this.x0; 17188 var y = clickPos.y - this.y0; 17189 this.moved = true; 17190 this.setHand(x, y, false, true); 17191 } 17192 }, { 17193 key: "_handleDocumentClickEnd", 17194 value: function _handleDocumentClickEnd(e) { 17195 var _this58 = this; 17196 17197 e.preventDefault(); 17198 document.removeEventListener('mouseup', this._handleDocumentClickEndBound); 17199 document.removeEventListener('touchend', this._handleDocumentClickEndBound); 17200 var clickPos = Timepicker._Pos(e); 17201 var x = clickPos.x - this.x0; 17202 var y = clickPos.y - this.y0; 17203 if (this.moved && x === this.dx && y === this.dy) { 17204 this.setHand(x, y); 17205 } 17206 17207 if (this.currentView === 'hours') { 17208 this.showView('minutes', this.options.duration / 2); 17209 } else if (this.options.autoClose) { 17210 $(this.minutesView).addClass('timepicker-dial-out'); 17211 setTimeout(function () { 17212 _this58.done(); 17213 }, this.options.duration / 2); 17214 } 17215 17216 if (typeof this.options.onSelect === 'function') { 17217 this.options.onSelect.call(this, this.hours, this.minutes); 17218 } 17219 17220 // Unbind mousemove event 17221 document.removeEventListener('mousemove', this._handleDocumentClickMoveBound); 17222 document.removeEventListener('touchmove', this._handleDocumentClickMoveBound); 17223 } 17224 }, { 17225 key: "_insertHTMLIntoDOM", 17226 value: function _insertHTMLIntoDOM() { 17227 this.$modalEl = $(Timepicker._template); 17228 this.modalEl = this.$modalEl[0]; 17229 this.modalEl.id = 'modal-' + this.id; 17230 17231 // Append popover to input by default 17232 var containerEl = document.querySelector(this.options.container); 17233 if (this.options.container && !!containerEl) { 17234 this.$modalEl.appendTo(containerEl); 17235 } else { 17236 this.$modalEl.insertBefore(this.el); 17237 } 17238 } 17239 }, { 17240 key: "_setupModal", 17241 value: function _setupModal() { 17242 var _this59 = this; 17243 17244 this.modal = M.Modal.init(this.modalEl, { 17245 onOpenStart: this.options.onOpenStart, 17246 onOpenEnd: this.options.onOpenEnd, 17247 onCloseStart: this.options.onCloseStart, 17248 onCloseEnd: function () { 17249 if (typeof _this59.options.onCloseEnd === 'function') { 17250 _this59.options.onCloseEnd.call(_this59); 17251 } 17252 _this59.isOpen = false; 17253 } 17254 }); 17255 } 17256 }, { 17257 key: "_setupVariables", 17258 value: function _setupVariables() { 17259 this.currentView = 'hours'; 17260 this.vibrate = navigator.vibrate ? 'vibrate' : navigator.webkitVibrate ? 'webkitVibrate' : null; 17261 17262 this._canvas = this.modalEl.querySelector('.timepicker-canvas'); 17263 this.plate = this.modalEl.querySelector('.timepicker-plate'); 17264 17265 this.hoursView = this.modalEl.querySelector('.timepicker-hours'); 17266 this.minutesView = this.modalEl.querySelector('.timepicker-minutes'); 17267 this.spanHours = this.modalEl.querySelector('.timepicker-span-hours'); 17268 this.spanMinutes = this.modalEl.querySelector('.timepicker-span-minutes'); 17269 this.spanAmPm = this.modalEl.querySelector('.timepicker-span-am-pm'); 17270 this.footer = this.modalEl.querySelector('.timepicker-footer'); 17271 this.amOrPm = 'PM'; 17272 } 17273 }, { 17274 key: "_pickerSetup", 17275 value: function _pickerSetup() { 17276 var $clearBtn = $("<button class=\"btn-flat timepicker-clear waves-effect\" style=\"visibility: hidden;\" type=\"button\" tabindex=\"" + (this.options.twelveHour ? '3' : '1') + "\">" + this.options.i18n.clear + "</button>").appendTo(this.footer).on('click', this.clear.bind(this)); 17277 if (this.options.showClearBtn) { 17278 $clearBtn.css({ visibility: '' }); 17279 } 17280 17281 var confirmationBtnsContainer = $('<div class="confirmation-btns"></div>'); 17282 $('<button class="btn-flat timepicker-close waves-effect" type="button" tabindex="' + (this.options.twelveHour ? '3' : '1') + '">' + this.options.i18n.cancel + '</button>').appendTo(confirmationBtnsContainer).on('click', this.close.bind(this)); 17283 $('<button class="btn-flat timepicker-close waves-effect" type="button" tabindex="' + (this.options.twelveHour ? '3' : '1') + '">' + this.options.i18n.done + '</button>').appendTo(confirmationBtnsContainer).on('click', this.done.bind(this)); 17284 confirmationBtnsContainer.appendTo(this.footer); 17285 } 17286 }, { 17287 key: "_clockSetup", 17288 value: function _clockSetup() { 17289 if (this.options.twelveHour) { 17290 this.$amBtn = $('<div class="am-btn">AM</div>'); 17291 this.$pmBtn = $('<div class="pm-btn">PM</div>'); 17292 this.$amBtn.on('click', this._handleAmPmClick.bind(this)).appendTo(this.spanAmPm); 17293 this.$pmBtn.on('click', this._handleAmPmClick.bind(this)).appendTo(this.spanAmPm); 17294 } 17295 17296 this._buildHoursView(); 17297 this._buildMinutesView(); 17298 this._buildSVGClock(); 17299 } 17300 }, { 17301 key: "_buildSVGClock", 17302 value: function _buildSVGClock() { 17303 // Draw clock hands and others 17304 var dialRadius = this.options.dialRadius; 17305 var tickRadius = this.options.tickRadius; 17306 var diameter = dialRadius * 2; 17307 17308 var svg = Timepicker._createSVGEl('svg'); 17309 svg.setAttribute('class', 'timepicker-svg'); 17310 svg.setAttribute('width', diameter); 17311 svg.setAttribute('height', diameter); 17312 var g = Timepicker._createSVGEl('g'); 17313 g.setAttribute('transform', 'translate(' + dialRadius + ',' + dialRadius + ')'); 17314 var bearing = Timepicker._createSVGEl('circle'); 17315 bearing.setAttribute('class', 'timepicker-canvas-bearing'); 17316 bearing.setAttribute('cx', 0); 17317 bearing.setAttribute('cy', 0); 17318 bearing.setAttribute('r', 4); 17319 var hand = Timepicker._createSVGEl('line'); 17320 hand.setAttribute('x1', 0); 17321 hand.setAttribute('y1', 0); 17322 var bg = Timepicker._createSVGEl('circle'); 17323 bg.setAttribute('class', 'timepicker-canvas-bg'); 17324 bg.setAttribute('r', tickRadius); 17325 g.appendChild(hand); 17326 g.appendChild(bg); 17327 g.appendChild(bearing); 17328 svg.appendChild(g); 17329 this._canvas.appendChild(svg); 17330 17331 this.hand = hand; 17332 this.bg = bg; 17333 this.bearing = bearing; 17334 this.g = g; 17335 } 17336 }, { 17337 key: "_buildHoursView", 17338 value: function _buildHoursView() { 17339 var $tick = $('<div class="timepicker-tick"></div>'); 17340 // Hours view 17341 if (this.options.twelveHour) { 17342 for (var i = 1; i < 13; i += 1) { 17343 var tick = $tick.clone(); 17344 var radian = i / 6 * Math.PI; 17345 var radius = this.options.outerRadius; 17346 tick.css({ 17347 left: this.options.dialRadius + Math.sin(radian) * radius - this.options.tickRadius + 'px', 17348 top: this.options.dialRadius - Math.cos(radian) * radius - this.options.tickRadius + 'px' 17349 }); 17350 tick.html(i === 0 ? '00' : i); 17351 this.hoursView.appendChild(tick[0]); 17352 // tick.on(mousedownEvent, mousedown); 17353 } 17354 } else { 17355 for (var _i2 = 0; _i2 < 24; _i2 += 1) { 17356 var _tick = $tick.clone(); 17357 var _radian = _i2 / 6 * Math.PI; 17358 var inner = _i2 > 0 && _i2 < 13; 17359 var _radius = inner ? this.options.innerRadius : this.options.outerRadius; 17360 _tick.css({ 17361 left: this.options.dialRadius + Math.sin(_radian) * _radius - this.options.tickRadius + 'px', 17362 top: this.options.dialRadius - Math.cos(_radian) * _radius - this.options.tickRadius + 'px' 17363 }); 17364 _tick.html(_i2 === 0 ? '00' : _i2); 17365 this.hoursView.appendChild(_tick[0]); 17366 // tick.on(mousedownEvent, mousedown); 17367 } 17368 } 17369 } 17370 }, { 17371 key: "_buildMinutesView", 17372 value: function _buildMinutesView() { 17373 var $tick = $('<div class="timepicker-tick"></div>'); 17374 // Minutes view 17375 for (var i = 0; i < 60; i += 5) { 17376 var tick = $tick.clone(); 17377 var radian = i / 30 * Math.PI; 17378 tick.css({ 17379 left: this.options.dialRadius + Math.sin(radian) * this.options.outerRadius - this.options.tickRadius + 'px', 17380 top: this.options.dialRadius - Math.cos(radian) * this.options.outerRadius - this.options.tickRadius + 'px' 17381 }); 17382 tick.html(Timepicker._addLeadingZero(i)); 17383 this.minutesView.appendChild(tick[0]); 17384 } 17385 } 17386 }, { 17387 key: "_handleAmPmClick", 17388 value: function _handleAmPmClick(e) { 17389 var $btnClicked = $(e.target); 17390 this.amOrPm = $btnClicked.hasClass('am-btn') ? 'AM' : 'PM'; 17391 this._updateAmPmView(); 17392 } 17393 }, { 17394 key: "_updateAmPmView", 17395 value: function _updateAmPmView() { 17396 if (this.options.twelveHour) { 17397 this.$amBtn.toggleClass('text-primary', this.amOrPm === 'AM'); 17398 this.$pmBtn.toggleClass('text-primary', this.amOrPm === 'PM'); 17399 } 17400 } 17401 }, { 17402 key: "_updateTimeFromInput", 17403 value: function _updateTimeFromInput() { 17404 // Get the time 17405 var value = ((this.el.value || this.options.defaultTime || '') + '').split(':'); 17406 if (this.options.twelveHour && !(typeof value[1] === 'undefined')) { 17407 if (value[1].toUpperCase().indexOf('AM') > 0) { 17408 this.amOrPm = 'AM'; 17409 } else { 17410 this.amOrPm = 'PM'; 17411 } 17412 value[1] = value[1].replace('AM', '').replace('PM', ''); 17413 } 17414 if (value[0] === 'now') { 17415 var now = new Date(+new Date() + this.options.fromNow); 17416 value = [now.getHours(), now.getMinutes()]; 17417 if (this.options.twelveHour) { 17418 this.amOrPm = value[0] >= 12 && value[0] < 24 ? 'PM' : 'AM'; 17419 } 17420 } 17421 this.hours = +value[0] || 0; 17422 this.minutes = +value[1] || 0; 17423 this.spanHours.innerHTML = this.hours; 17424 this.spanMinutes.innerHTML = Timepicker._addLeadingZero(this.minutes); 17425 17426 this._updateAmPmView(); 17427 } 17428 }, { 17429 key: "showView", 17430 value: function showView(view, delay) { 17431 if (view === 'minutes' && $(this.hoursView).css('visibility') === 'visible') { 17432 // raiseCallback(this.options.beforeHourSelect); 17433 } 17434 var isHours = view === 'hours', 17435 nextView = isHours ? this.hoursView : this.minutesView, 17436 hideView = isHours ? this.minutesView : this.hoursView; 17437 this.currentView = view; 17438 17439 $(this.spanHours).toggleClass('text-primary', isHours); 17440 $(this.spanMinutes).toggleClass('text-primary', !isHours); 17441 17442 // Transition view 17443 hideView.classList.add('timepicker-dial-out'); 17444 $(nextView).css('visibility', 'visible').removeClass('timepicker-dial-out'); 17445 17446 // Reset clock hand 17447 this.resetClock(delay); 17448 17449 // After transitions ended 17450 clearTimeout(this.toggleViewTimer); 17451 this.toggleViewTimer = setTimeout(function () { 17452 $(hideView).css('visibility', 'hidden'); 17453 }, this.options.duration); 17454 } 17455 }, { 17456 key: "resetClock", 17457 value: function resetClock(delay) { 17458 var view = this.currentView, 17459 value = this[view], 17460 isHours = view === 'hours', 17461 unit = Math.PI / (isHours ? 6 : 30), 17462 radian = value * unit, 17463 radius = isHours && value > 0 && value < 13 ? this.options.innerRadius : this.options.outerRadius, 17464 x = Math.sin(radian) * radius, 17465 y = -Math.cos(radian) * radius, 17466 self = this; 17467 17468 if (delay) { 17469 $(this.canvas).addClass('timepicker-canvas-out'); 17470 setTimeout(function () { 17471 $(self.canvas).removeClass('timepicker-canvas-out'); 17472 self.setHand(x, y); 17473 }, delay); 17474 } else { 17475 this.setHand(x, y); 17476 } 17477 } 17478 }, { 17479 key: "setHand", 17480 value: function setHand(x, y, roundBy5) { 17481 var _this60 = this; 17482 17483 var radian = Math.atan2(x, -y), 17484 isHours = this.currentView === 'hours', 17485 unit = Math.PI / (isHours || roundBy5 ? 6 : 30), 17486 z = Math.sqrt(x * x + y * y), 17487 inner = isHours && z < (this.options.outerRadius + this.options.innerRadius) / 2, 17488 radius = inner ? this.options.innerRadius : this.options.outerRadius; 17489 17490 if (this.options.twelveHour) { 17491 radius = this.options.outerRadius; 17492 } 17493 17494 // Radian should in range [0, 2PI] 17495 if (radian < 0) { 17496 radian = Math.PI * 2 + radian; 17497 } 17498 17499 // Get the round value 17500 var value = Math.round(radian / unit); 17501 17502 // Get the round radian 17503 radian = value * unit; 17504 17505 // Correct the hours or minutes 17506 if (this.options.twelveHour) { 17507 if (isHours) { 17508 if (value === 0) value = 12; 17509 } else { 17510 if (roundBy5) value *= 5; 17511 if (value === 60) value = 0; 17512 } 17513 } else { 17514 if (isHours) { 17515 if (value === 12) { 17516 value = 0; 17517 } 17518 value = inner ? value === 0 ? 12 : value : value === 0 ? 0 : value + 12; 17519 } else { 17520 if (roundBy5) { 17521 value *= 5; 17522 } 17523 if (value === 60) { 17524 value = 0; 17525 } 17526 } 17527 } 17528 17529 // Once hours or minutes changed, vibrate the device 17530 if (this[this.currentView] !== value) { 17531 if (this.vibrate && this.options.vibrate) { 17532 // Do not vibrate too frequently 17533 if (!this.vibrateTimer) { 17534 navigator[this.vibrate](10); 17535 this.vibrateTimer = setTimeout(function () { 17536 _this60.vibrateTimer = null; 17537 }, 100); 17538 } 17539 } 17540 } 17541 17542 this[this.currentView] = value; 17543 if (isHours) { 17544 this['spanHours'].innerHTML = value; 17545 } else { 17546 this['spanMinutes'].innerHTML = Timepicker._addLeadingZero(value); 17547 } 17548 17549 // Set clock hand and others' position 17550 var cx1 = Math.sin(radian) * (radius - this.options.tickRadius), 17551 cy1 = -Math.cos(radian) * (radius - this.options.tickRadius), 17552 cx2 = Math.sin(radian) * radius, 17553 cy2 = -Math.cos(radian) * radius; 17554 this.hand.setAttribute('x2', cx1); 17555 this.hand.setAttribute('y2', cy1); 17556 this.bg.setAttribute('cx', cx2); 17557 this.bg.setAttribute('cy', cy2); 17558 } 17559 }, { 17560 key: "open", 17561 value: function open() { 17562 if (this.isOpen) { 17563 return; 17564 } 17565 17566 this.isOpen = true; 17567 this._updateTimeFromInput(); 17568 this.showView('hours'); 17569 17570 this.modal.open(); 17571 } 17572 }, { 17573 key: "close", 17574 value: function close() { 17575 if (!this.isOpen) { 17576 return; 17577 } 17578 17579 this.isOpen = false; 17580 this.modal.close(); 17581 } 17582 17583 /** 17584 * Finish timepicker selection. 17585 */ 17586 17587 }, { 17588 key: "done", 17589 value: function done(e, clearValue) { 17590 // Set input value 17591 var last = this.el.value; 17592 var value = clearValue ? '' : Timepicker._addLeadingZero(this.hours) + ':' + Timepicker._addLeadingZero(this.minutes); 17593 this.time = value; 17594 if (!clearValue && this.options.twelveHour) { 17595 value = value + " " + this.amOrPm; 17596 } 17597 this.el.value = value; 17598 17599 // Trigger change event 17600 if (value !== last) { 17601 this.$el.trigger('change'); 17602 } 17603 17604 this.close(); 17605 this.el.focus(); 17606 } 17607 }, { 17608 key: "clear", 17609 value: function clear() { 17610 this.done(null, true); 17611 } 17612 }], [{ 17613 key: "init", 17614 value: function init(els, options) { 17615 return _get(Timepicker.__proto__ || Object.getPrototypeOf(Timepicker), "init", this).call(this, this, els, options); 17616 } 17617 }, { 17618 key: "_addLeadingZero", 17619 value: function _addLeadingZero(num) { 17620 return (num < 10 ? '0' : '') + num; 17621 } 17622 }, { 17623 key: "_createSVGEl", 17624 value: function _createSVGEl(name) { 17625 var svgNS = 'http://www.w3.org/2000/svg'; 17626 return document.createElementNS(svgNS, name); 17627 } 17628 17629 /** 17630 * @typedef {Object} Point 17631 * @property {number} x The X Coordinate 17632 * @property {number} y The Y Coordinate 17633 */ 17634 17635 /** 17636 * Get x position of mouse or touch event 17637 * @param {Event} e 17638 * @return {Point} x and y location 17639 */ 17640 17641 }, { 17642 key: "_Pos", 17643 value: function _Pos(e) { 17644 if (e.targetTouches && e.targetTouches.length >= 1) { 17645 return { x: e.targetTouches[0].clientX, y: e.targetTouches[0].clientY }; 17646 } 17647 // mouse event 17648 return { x: e.clientX, y: e.clientY }; 17649 } 17650 17651 /** 17652 * Get Instance 17653 */ 17654 17655 }, { 17656 key: "getInstance", 17657 value: function getInstance(el) { 17658 var domElem = !!el.jquery ? el[0] : el; 17659 return domElem.M_Timepicker; 17660 } 17661 }, { 17662 key: "defaults", 17663 get: function () { 17664 return _defaults; 17665 } 17666 }]); 17667 17668 return Timepicker; 17669 }(Component); 17670 17671 Timepicker._template = ['<div class= "modal timepicker-modal">', '<div class="modal-content timepicker-container">', '<div class="timepicker-digital-display">', '<div class="timepicker-text-container">', '<div class="timepicker-display-column">', '<span class="timepicker-span-hours text-primary"></span>', ':', '<span class="timepicker-span-minutes"></span>', '</div>', '<div class="timepicker-display-column timepicker-display-am-pm">', '<div class="timepicker-span-am-pm"></div>', '</div>', '</div>', '</div>', '<div class="timepicker-analog-display">', '<div class="timepicker-plate">', '<div class="timepicker-canvas"></div>', '<div class="timepicker-dial timepicker-hours"></div>', '<div class="timepicker-dial timepicker-minutes timepicker-dial-out"></div>', '</div>', '<div class="timepicker-footer"></div>', '</div>', '</div>', '</div>'].join(''); 17672 17673 M.Timepicker = Timepicker; 17674 17675 if (M.jQueryLoaded) { 17676 M.initializeJqueryWrapper(Timepicker, 'timepicker', 'M_Timepicker'); 17677 } 17678})(cash); 17679;(function ($) { 17680 'use strict'; 17681 17682 var _defaults = {}; 17683 17684 /** 17685 * @class 17686 * 17687 */ 17688 17689 var CharacterCounter = function (_Component17) { 17690 _inherits(CharacterCounter, _Component17); 17691 17692 /** 17693 * Construct CharacterCounter instance 17694 * @constructor 17695 * @param {Element} el 17696 * @param {Object} options 17697 */ 17698 function CharacterCounter(el, options) { 17699 _classCallCheck(this, CharacterCounter); 17700 17701 var _this61 = _possibleConstructorReturn(this, (CharacterCounter.__proto__ || Object.getPrototypeOf(CharacterCounter)).call(this, CharacterCounter, el, options)); 17702 17703 _this61.el.M_CharacterCounter = _this61; 17704 17705 /** 17706 * Options for the character counter 17707 */ 17708 _this61.options = $.extend({}, CharacterCounter.defaults, options); 17709 17710 _this61.isInvalid = false; 17711 _this61.isValidLength = false; 17712 _this61._setupCounter(); 17713 _this61._setupEventHandlers(); 17714 return _this61; 17715 } 17716 17717 _createClass(CharacterCounter, [{ 17718 key: "destroy", 17719 17720 17721 /** 17722 * Teardown component 17723 */ 17724 value: function destroy() { 17725 this._removeEventHandlers(); 17726 this.el.CharacterCounter = undefined; 17727 this._removeCounter(); 17728 } 17729 17730 /** 17731 * Setup Event Handlers 17732 */ 17733 17734 }, { 17735 key: "_setupEventHandlers", 17736 value: function _setupEventHandlers() { 17737 this._handleUpdateCounterBound = this.updateCounter.bind(this); 17738 17739 this.el.addEventListener('focus', this._handleUpdateCounterBound, true); 17740 this.el.addEventListener('input', this._handleUpdateCounterBound, true); 17741 } 17742 17743 /** 17744 * Remove Event Handlers 17745 */ 17746 17747 }, { 17748 key: "_removeEventHandlers", 17749 value: function _removeEventHandlers() { 17750 this.el.removeEventListener('focus', this._handleUpdateCounterBound, true); 17751 this.el.removeEventListener('input', this._handleUpdateCounterBound, true); 17752 } 17753 17754 /** 17755 * Setup counter element 17756 */ 17757 17758 }, { 17759 key: "_setupCounter", 17760 value: function _setupCounter() { 17761 this.counterEl = document.createElement('span'); 17762 $(this.counterEl).addClass('character-counter').css({ 17763 float: 'right', 17764 'font-size': '12px', 17765 height: 1 17766 }); 17767 17768 this.$el.parent().append(this.counterEl); 17769 } 17770 17771 /** 17772 * Remove counter element 17773 */ 17774 17775 }, { 17776 key: "_removeCounter", 17777 value: function _removeCounter() { 17778 $(this.counterEl).remove(); 17779 } 17780 17781 /** 17782 * Update counter 17783 */ 17784 17785 }, { 17786 key: "updateCounter", 17787 value: function updateCounter() { 17788 var maxLength = +this.$el.attr('data-length'), 17789 actualLength = this.el.value.length; 17790 this.isValidLength = actualLength <= maxLength; 17791 var counterString = actualLength; 17792 17793 if (maxLength) { 17794 counterString += '/' + maxLength; 17795 this._validateInput(); 17796 } 17797 17798 $(this.counterEl).html(counterString); 17799 } 17800 17801 /** 17802 * Add validation classes 17803 */ 17804 17805 }, { 17806 key: "_validateInput", 17807 value: function _validateInput() { 17808 if (this.isValidLength && this.isInvalid) { 17809 this.isInvalid = false; 17810 this.$el.removeClass('invalid'); 17811 } else if (!this.isValidLength && !this.isInvalid) { 17812 this.isInvalid = true; 17813 this.$el.removeClass('valid'); 17814 this.$el.addClass('invalid'); 17815 } 17816 } 17817 }], [{ 17818 key: "init", 17819 value: function init(els, options) { 17820 return _get(CharacterCounter.__proto__ || Object.getPrototypeOf(CharacterCounter), "init", this).call(this, this, els, options); 17821 } 17822 17823 /** 17824 * Get Instance 17825 */ 17826 17827 }, { 17828 key: "getInstance", 17829 value: function getInstance(el) { 17830 var domElem = !!el.jquery ? el[0] : el; 17831 return domElem.M_CharacterCounter; 17832 } 17833 }, { 17834 key: "defaults", 17835 get: function () { 17836 return _defaults; 17837 } 17838 }]); 17839 17840 return CharacterCounter; 17841 }(Component); 17842 17843 M.CharacterCounter = CharacterCounter; 17844 17845 if (M.jQueryLoaded) { 17846 M.initializeJqueryWrapper(CharacterCounter, 'characterCounter', 'M_CharacterCounter'); 17847 } 17848})(cash); 17849;(function ($) { 17850 'use strict'; 17851 17852 var _defaults = { 17853 duration: 200, // ms 17854 dist: -100, // zoom scale TODO: make this more intuitive as an option 17855 shift: 0, // spacing for center image 17856 padding: 0, // Padding between non center items 17857 numVisible: 5, // Number of visible items in carousel 17858 fullWidth: false, // Change to full width styles 17859 indicators: false, // Toggle indicators 17860 noWrap: false, // Don't wrap around and cycle through items. 17861 onCycleTo: null // Callback for when a new slide is cycled to. 17862 }; 17863 17864 /** 17865 * @class 17866 * 17867 */ 17868 17869 var Carousel = function (_Component18) { 17870 _inherits(Carousel, _Component18); 17871 17872 /** 17873 * Construct Carousel instance 17874 * @constructor 17875 * @param {Element} el 17876 * @param {Object} options 17877 */ 17878 function Carousel(el, options) { 17879 _classCallCheck(this, Carousel); 17880 17881 var _this62 = _possibleConstructorReturn(this, (Carousel.__proto__ || Object.getPrototypeOf(Carousel)).call(this, Carousel, el, options)); 17882 17883 _this62.el.M_Carousel = _this62; 17884 17885 /** 17886 * Options for the carousel 17887 * @member Carousel#options 17888 * @prop {Number} duration 17889 * @prop {Number} dist 17890 * @prop {Number} shift 17891 * @prop {Number} padding 17892 * @prop {Number} numVisible 17893 * @prop {Boolean} fullWidth 17894 * @prop {Boolean} indicators 17895 * @prop {Boolean} noWrap 17896 * @prop {Function} onCycleTo 17897 */ 17898 _this62.options = $.extend({}, Carousel.defaults, options); 17899 17900 // Setup 17901 _this62.hasMultipleSlides = _this62.$el.find('.carousel-item').length > 1; 17902 _this62.showIndicators = _this62.options.indicators && _this62.hasMultipleSlides; 17903 _this62.noWrap = _this62.options.noWrap || !_this62.hasMultipleSlides; 17904 _this62.pressed = false; 17905 _this62.dragged = false; 17906 _this62.offset = _this62.target = 0; 17907 _this62.images = []; 17908 _this62.itemWidth = _this62.$el.find('.carousel-item').first().innerWidth(); 17909 _this62.itemHeight = _this62.$el.find('.carousel-item').first().innerHeight(); 17910 _this62.dim = _this62.itemWidth * 2 + _this62.options.padding || 1; // Make sure dim is non zero for divisions. 17911 _this62._autoScrollBound = _this62._autoScroll.bind(_this62); 17912 _this62._trackBound = _this62._track.bind(_this62); 17913 17914 // Full Width carousel setup 17915 if (_this62.options.fullWidth) { 17916 _this62.options.dist = 0; 17917 _this62._setCarouselHeight(); 17918 17919 // Offset fixed items when indicators. 17920 if (_this62.showIndicators) { 17921 _this62.$el.find('.carousel-fixed-item').addClass('with-indicators'); 17922 } 17923 } 17924 17925 // Iterate through slides 17926 _this62.$indicators = $('<ul class="indicators"></ul>'); 17927 _this62.$el.find('.carousel-item').each(function (el, i) { 17928 _this62.images.push(el); 17929 if (_this62.showIndicators) { 17930 var $indicator = $('<li class="indicator-item"></li>'); 17931 17932 // Add active to first by default. 17933 if (i === 0) { 17934 $indicator[0].classList.add('active'); 17935 } 17936 17937 _this62.$indicators.append($indicator); 17938 } 17939 }); 17940 if (_this62.showIndicators) { 17941 _this62.$el.append(_this62.$indicators); 17942 } 17943 _this62.count = _this62.images.length; 17944 17945 // Cap numVisible at count 17946 _this62.options.numVisible = Math.min(_this62.count, _this62.options.numVisible); 17947 17948 // Setup cross browser string 17949 _this62.xform = 'transform'; 17950 ['webkit', 'Moz', 'O', 'ms'].every(function (prefix) { 17951 var e = prefix + 'Transform'; 17952 if (typeof document.body.style[e] !== 'undefined') { 17953 _this62.xform = e; 17954 return false; 17955 } 17956 return true; 17957 }); 17958 17959 _this62._setupEventHandlers(); 17960 _this62._scroll(_this62.offset); 17961 return _this62; 17962 } 17963 17964 _createClass(Carousel, [{ 17965 key: "destroy", 17966 17967 17968 /** 17969 * Teardown component 17970 */ 17971 value: function destroy() { 17972 this._removeEventHandlers(); 17973 this.el.M_Carousel = undefined; 17974 } 17975 17976 /** 17977 * Setup Event Handlers 17978 */ 17979 17980 }, { 17981 key: "_setupEventHandlers", 17982 value: function _setupEventHandlers() { 17983 var _this63 = this; 17984 17985 this._handleCarouselTapBound = this._handleCarouselTap.bind(this); 17986 this._handleCarouselDragBound = this._handleCarouselDrag.bind(this); 17987 this._handleCarouselReleaseBound = this._handleCarouselRelease.bind(this); 17988 this._handleCarouselClickBound = this._handleCarouselClick.bind(this); 17989 17990 if (typeof window.ontouchstart !== 'undefined') { 17991 this.el.addEventListener('touchstart', this._handleCarouselTapBound); 17992 this.el.addEventListener('touchmove', this._handleCarouselDragBound); 17993 this.el.addEventListener('touchend', this._handleCarouselReleaseBound); 17994 } 17995 17996 this.el.addEventListener('mousedown', this._handleCarouselTapBound); 17997 this.el.addEventListener('mousemove', this._handleCarouselDragBound); 17998 this.el.addEventListener('mouseup', this._handleCarouselReleaseBound); 17999 this.el.addEventListener('mouseleave', this._handleCarouselReleaseBound); 18000 this.el.addEventListener('click', this._handleCarouselClickBound); 18001 18002 if (this.showIndicators && this.$indicators) { 18003 this._handleIndicatorClickBound = this._handleIndicatorClick.bind(this); 18004 this.$indicators.find('.indicator-item').each(function (el, i) { 18005 el.addEventListener('click', _this63._handleIndicatorClickBound); 18006 }); 18007 } 18008 18009 // Resize 18010 var throttledResize = M.throttle(this._handleResize, 200); 18011 this._handleThrottledResizeBound = throttledResize.bind(this); 18012 18013 window.addEventListener('resize', this._handleThrottledResizeBound); 18014 } 18015 18016 /** 18017 * Remove Event Handlers 18018 */ 18019 18020 }, { 18021 key: "_removeEventHandlers", 18022 value: function _removeEventHandlers() { 18023 var _this64 = this; 18024 18025 if (typeof window.ontouchstart !== 'undefined') { 18026 this.el.removeEventListener('touchstart', this._handleCarouselTapBound); 18027 this.el.removeEventListener('touchmove', this._handleCarouselDragBound); 18028 this.el.removeEventListener('touchend', this._handleCarouselReleaseBound); 18029 } 18030 this.el.removeEventListener('mousedown', this._handleCarouselTapBound); 18031 this.el.removeEventListener('mousemove', this._handleCarouselDragBound); 18032 this.el.removeEventListener('mouseup', this._handleCarouselReleaseBound); 18033 this.el.removeEventListener('mouseleave', this._handleCarouselReleaseBound); 18034 this.el.removeEventListener('click', this._handleCarouselClickBound); 18035 18036 if (this.showIndicators && this.$indicators) { 18037 this.$indicators.find('.indicator-item').each(function (el, i) { 18038 el.removeEventListener('click', _this64._handleIndicatorClickBound); 18039 }); 18040 } 18041 18042 window.removeEventListener('resize', this._handleThrottledResizeBound); 18043 } 18044 18045 /** 18046 * Handle Carousel Tap 18047 * @param {Event} e 18048 */ 18049 18050 }, { 18051 key: "_handleCarouselTap", 18052 value: function _handleCarouselTap(e) { 18053 // Fixes firefox draggable image bug 18054 if (e.type === 'mousedown' && $(e.target).is('img')) { 18055 e.preventDefault(); 18056 } 18057 this.pressed = true; 18058 this.dragged = false; 18059 this.verticalDragged = false; 18060 this.reference = this._xpos(e); 18061 this.referenceY = this._ypos(e); 18062 18063 this.velocity = this.amplitude = 0; 18064 this.frame = this.offset; 18065 this.timestamp = Date.now(); 18066 clearInterval(this.ticker); 18067 this.ticker = setInterval(this._trackBound, 100); 18068 } 18069 18070 /** 18071 * Handle Carousel Drag 18072 * @param {Event} e 18073 */ 18074 18075 }, { 18076 key: "_handleCarouselDrag", 18077 value: function _handleCarouselDrag(e) { 18078 var x = void 0, 18079 y = void 0, 18080 delta = void 0, 18081 deltaY = void 0; 18082 if (this.pressed) { 18083 x = this._xpos(e); 18084 y = this._ypos(e); 18085 delta = this.reference - x; 18086 deltaY = Math.abs(this.referenceY - y); 18087 if (deltaY < 30 && !this.verticalDragged) { 18088 // If vertical scrolling don't allow dragging. 18089 if (delta > 2 || delta < -2) { 18090 this.dragged = true; 18091 this.reference = x; 18092 this._scroll(this.offset + delta); 18093 } 18094 } else if (this.dragged) { 18095 // If dragging don't allow vertical scroll. 18096 e.preventDefault(); 18097 e.stopPropagation(); 18098 return false; 18099 } else { 18100 // Vertical scrolling. 18101 this.verticalDragged = true; 18102 } 18103 } 18104 18105 if (this.dragged) { 18106 // If dragging don't allow vertical scroll. 18107 e.preventDefault(); 18108 e.stopPropagation(); 18109 return false; 18110 } 18111 } 18112 18113 /** 18114 * Handle Carousel Release 18115 * @param {Event} e 18116 */ 18117 18118 }, { 18119 key: "_handleCarouselRelease", 18120 value: function _handleCarouselRelease(e) { 18121 if (this.pressed) { 18122 this.pressed = false; 18123 } else { 18124 return; 18125 } 18126 18127 clearInterval(this.ticker); 18128 this.target = this.offset; 18129 if (this.velocity > 10 || this.velocity < -10) { 18130 this.amplitude = 0.9 * this.velocity; 18131 this.target = this.offset + this.amplitude; 18132 } 18133 this.target = Math.round(this.target / this.dim) * this.dim; 18134 18135 // No wrap of items. 18136 if (this.noWrap) { 18137 if (this.target >= this.dim * (this.count - 1)) { 18138 this.target = this.dim * (this.count - 1); 18139 } else if (this.target < 0) { 18140 this.target = 0; 18141 } 18142 } 18143 this.amplitude = this.target - this.offset; 18144 this.timestamp = Date.now(); 18145 requestAnimationFrame(this._autoScrollBound); 18146 18147 if (this.dragged) { 18148 e.preventDefault(); 18149 e.stopPropagation(); 18150 } 18151 return false; 18152 } 18153 18154 /** 18155 * Handle Carousel CLick 18156 * @param {Event} e 18157 */ 18158 18159 }, { 18160 key: "_handleCarouselClick", 18161 value: function _handleCarouselClick(e) { 18162 // Disable clicks if carousel was dragged. 18163 if (this.dragged) { 18164 e.preventDefault(); 18165 e.stopPropagation(); 18166 return false; 18167 } else if (!this.options.fullWidth) { 18168 var clickedIndex = $(e.target).closest('.carousel-item').index(); 18169 var diff = this._wrap(this.center) - clickedIndex; 18170 18171 // Disable clicks if carousel was shifted by click 18172 if (diff !== 0) { 18173 e.preventDefault(); 18174 e.stopPropagation(); 18175 } 18176 this._cycleTo(clickedIndex); 18177 } 18178 } 18179 18180 /** 18181 * Handle Indicator CLick 18182 * @param {Event} e 18183 */ 18184 18185 }, { 18186 key: "_handleIndicatorClick", 18187 value: function _handleIndicatorClick(e) { 18188 e.stopPropagation(); 18189 18190 var indicator = $(e.target).closest('.indicator-item'); 18191 if (indicator.length) { 18192 this._cycleTo(indicator.index()); 18193 } 18194 } 18195 18196 /** 18197 * Handle Throttle Resize 18198 * @param {Event} e 18199 */ 18200 18201 }, { 18202 key: "_handleResize", 18203 value: function _handleResize(e) { 18204 if (this.options.fullWidth) { 18205 this.itemWidth = this.$el.find('.carousel-item').first().innerWidth(); 18206 this.imageHeight = this.$el.find('.carousel-item.active').height(); 18207 this.dim = this.itemWidth * 2 + this.options.padding; 18208 this.offset = this.center * 2 * this.itemWidth; 18209 this.target = this.offset; 18210 this._setCarouselHeight(true); 18211 } else { 18212 this._scroll(); 18213 } 18214 } 18215 18216 /** 18217 * Set carousel height based on first slide 18218 * @param {Booleam} imageOnly - true for image slides 18219 */ 18220 18221 }, { 18222 key: "_setCarouselHeight", 18223 value: function _setCarouselHeight(imageOnly) { 18224 var _this65 = this; 18225 18226 var firstSlide = this.$el.find('.carousel-item.active').length ? this.$el.find('.carousel-item.active').first() : this.$el.find('.carousel-item').first(); 18227 var firstImage = firstSlide.find('img').first(); 18228 if (firstImage.length) { 18229 if (firstImage[0].complete) { 18230 // If image won't trigger the load event 18231 var imageHeight = firstImage.height(); 18232 if (imageHeight > 0) { 18233 this.$el.css('height', imageHeight + 'px'); 18234 } else { 18235 // If image still has no height, use the natural dimensions to calculate 18236 var naturalWidth = firstImage[0].naturalWidth; 18237 var naturalHeight = firstImage[0].naturalHeight; 18238 var adjustedHeight = this.$el.width() / naturalWidth * naturalHeight; 18239 this.$el.css('height', adjustedHeight + 'px'); 18240 } 18241 } else { 18242 // Get height when image is loaded normally 18243 firstImage.one('load', function (el, i) { 18244 _this65.$el.css('height', el.offsetHeight + 'px'); 18245 }); 18246 } 18247 } else if (!imageOnly) { 18248 var slideHeight = firstSlide.height(); 18249 this.$el.css('height', slideHeight + 'px'); 18250 } 18251 } 18252 18253 /** 18254 * Get x position from event 18255 * @param {Event} e 18256 */ 18257 18258 }, { 18259 key: "_xpos", 18260 value: function _xpos(e) { 18261 // touch event 18262 if (e.targetTouches && e.targetTouches.length >= 1) { 18263 return e.targetTouches[0].clientX; 18264 } 18265 18266 // mouse event 18267 return e.clientX; 18268 } 18269 18270 /** 18271 * Get y position from event 18272 * @param {Event} e 18273 */ 18274 18275 }, { 18276 key: "_ypos", 18277 value: function _ypos(e) { 18278 // touch event 18279 if (e.targetTouches && e.targetTouches.length >= 1) { 18280 return e.targetTouches[0].clientY; 18281 } 18282 18283 // mouse event 18284 return e.clientY; 18285 } 18286 18287 /** 18288 * Wrap index 18289 * @param {Number} x 18290 */ 18291 18292 }, { 18293 key: "_wrap", 18294 value: function _wrap(x) { 18295 return x >= this.count ? x % this.count : x < 0 ? this._wrap(this.count + x % this.count) : x; 18296 } 18297 18298 /** 18299 * Tracks scrolling information 18300 */ 18301 18302 }, { 18303 key: "_track", 18304 value: function _track() { 18305 var now = void 0, 18306 elapsed = void 0, 18307 delta = void 0, 18308 v = void 0; 18309 18310 now = Date.now(); 18311 elapsed = now - this.timestamp; 18312 this.timestamp = now; 18313 delta = this.offset - this.frame; 18314 this.frame = this.offset; 18315 18316 v = 1000 * delta / (1 + elapsed); 18317 this.velocity = 0.8 * v + 0.2 * this.velocity; 18318 } 18319 18320 /** 18321 * Auto scrolls to nearest carousel item. 18322 */ 18323 18324 }, { 18325 key: "_autoScroll", 18326 value: function _autoScroll() { 18327 var elapsed = void 0, 18328 delta = void 0; 18329 18330 if (this.amplitude) { 18331 elapsed = Date.now() - this.timestamp; 18332 delta = this.amplitude * Math.exp(-elapsed / this.options.duration); 18333 if (delta > 2 || delta < -2) { 18334 this._scroll(this.target - delta); 18335 requestAnimationFrame(this._autoScrollBound); 18336 } else { 18337 this._scroll(this.target); 18338 } 18339 } 18340 } 18341 18342 /** 18343 * Scroll to target 18344 * @param {Number} x 18345 */ 18346 18347 }, { 18348 key: "_scroll", 18349 value: function _scroll(x) { 18350 var _this66 = this; 18351 18352 // Track scrolling state 18353 if (!this.$el.hasClass('scrolling')) { 18354 this.el.classList.add('scrolling'); 18355 } 18356 if (this.scrollingTimeout != null) { 18357 window.clearTimeout(this.scrollingTimeout); 18358 } 18359 this.scrollingTimeout = window.setTimeout(function () { 18360 _this66.$el.removeClass('scrolling'); 18361 }, this.options.duration); 18362 18363 // Start actual scroll 18364 var i = void 0, 18365 half = void 0, 18366 delta = void 0, 18367 dir = void 0, 18368 tween = void 0, 18369 el = void 0, 18370 alignment = void 0, 18371 zTranslation = void 0, 18372 tweenedOpacity = void 0, 18373 centerTweenedOpacity = void 0; 18374 var lastCenter = this.center; 18375 var numVisibleOffset = 1 / this.options.numVisible; 18376 18377 this.offset = typeof x === 'number' ? x : this.offset; 18378 this.center = Math.floor((this.offset + this.dim / 2) / this.dim); 18379 delta = this.offset - this.center * this.dim; 18380 dir = delta < 0 ? 1 : -1; 18381 tween = -dir * delta * 2 / this.dim; 18382 half = this.count >> 1; 18383 18384 if (this.options.fullWidth) { 18385 alignment = 'translateX(0)'; 18386 centerTweenedOpacity = 1; 18387 } else { 18388 alignment = 'translateX(' + (this.el.clientWidth - this.itemWidth) / 2 + 'px) '; 18389 alignment += 'translateY(' + (this.el.clientHeight - this.itemHeight) / 2 + 'px)'; 18390 centerTweenedOpacity = 1 - numVisibleOffset * tween; 18391 } 18392 18393 // Set indicator active 18394 if (this.showIndicators) { 18395 var diff = this.center % this.count; 18396 var activeIndicator = this.$indicators.find('.indicator-item.active'); 18397 if (activeIndicator.index() !== diff) { 18398 activeIndicator.removeClass('active'); 18399 this.$indicators.find('.indicator-item').eq(diff)[0].classList.add('active'); 18400 } 18401 } 18402 18403 // center 18404 // Don't show wrapped items. 18405 if (!this.noWrap || this.center >= 0 && this.center < this.count) { 18406 el = this.images[this._wrap(this.center)]; 18407 18408 // Add active class to center item. 18409 if (!$(el).hasClass('active')) { 18410 this.$el.find('.carousel-item').removeClass('active'); 18411 el.classList.add('active'); 18412 } 18413 var transformString = alignment + " translateX(" + -delta / 2 + "px) translateX(" + dir * this.options.shift * tween * i + "px) translateZ(" + this.options.dist * tween + "px)"; 18414 this._updateItemStyle(el, centerTweenedOpacity, 0, transformString); 18415 } 18416 18417 for (i = 1; i <= half; ++i) { 18418 // right side 18419 if (this.options.fullWidth) { 18420 zTranslation = this.options.dist; 18421 tweenedOpacity = i === half && delta < 0 ? 1 - tween : 1; 18422 } else { 18423 zTranslation = this.options.dist * (i * 2 + tween * dir); 18424 tweenedOpacity = 1 - numVisibleOffset * (i * 2 + tween * dir); 18425 } 18426 // Don't show wrapped items. 18427 if (!this.noWrap || this.center + i < this.count) { 18428 el = this.images[this._wrap(this.center + i)]; 18429 var _transformString = alignment + " translateX(" + (this.options.shift + (this.dim * i - delta) / 2) + "px) translateZ(" + zTranslation + "px)"; 18430 this._updateItemStyle(el, tweenedOpacity, -i, _transformString); 18431 } 18432 18433 // left side 18434 if (this.options.fullWidth) { 18435 zTranslation = this.options.dist; 18436 tweenedOpacity = i === half && delta > 0 ? 1 - tween : 1; 18437 } else { 18438 zTranslation = this.options.dist * (i * 2 - tween * dir); 18439 tweenedOpacity = 1 - numVisibleOffset * (i * 2 - tween * dir); 18440 } 18441 // Don't show wrapped items. 18442 if (!this.noWrap || this.center - i >= 0) { 18443 el = this.images[this._wrap(this.center - i)]; 18444 var _transformString2 = alignment + " translateX(" + (-this.options.shift + (-this.dim * i - delta) / 2) + "px) translateZ(" + zTranslation + "px)"; 18445 this._updateItemStyle(el, tweenedOpacity, -i, _transformString2); 18446 } 18447 } 18448 18449 // center 18450 // Don't show wrapped items. 18451 if (!this.noWrap || this.center >= 0 && this.center < this.count) { 18452 el = this.images[this._wrap(this.center)]; 18453 var _transformString3 = alignment + " translateX(" + -delta / 2 + "px) translateX(" + dir * this.options.shift * tween + "px) translateZ(" + this.options.dist * tween + "px)"; 18454 this._updateItemStyle(el, centerTweenedOpacity, 0, _transformString3); 18455 } 18456 18457 // onCycleTo callback 18458 var $currItem = this.$el.find('.carousel-item').eq(this._wrap(this.center)); 18459 if (lastCenter !== this.center && typeof this.options.onCycleTo === 'function') { 18460 this.options.onCycleTo.call(this, $currItem[0], this.dragged); 18461 } 18462 18463 // One time callback 18464 if (typeof this.oneTimeCallback === 'function') { 18465 this.oneTimeCallback.call(this, $currItem[0], this.dragged); 18466 this.oneTimeCallback = null; 18467 } 18468 } 18469 18470 /** 18471 * Cycle to target 18472 * @param {Element} el 18473 * @param {Number} opacity 18474 * @param {Number} zIndex 18475 * @param {String} transform 18476 */ 18477 18478 }, { 18479 key: "_updateItemStyle", 18480 value: function _updateItemStyle(el, opacity, zIndex, transform) { 18481 el.style[this.xform] = transform; 18482 el.style.zIndex = zIndex; 18483 el.style.opacity = opacity; 18484 el.style.visibility = 'visible'; 18485 } 18486 18487 /** 18488 * Cycle to target 18489 * @param {Number} n 18490 * @param {Function} callback 18491 */ 18492 18493 }, { 18494 key: "_cycleTo", 18495 value: function _cycleTo(n, callback) { 18496 var diff = this.center % this.count - n; 18497 18498 // Account for wraparound. 18499 if (!this.noWrap) { 18500 if (diff < 0) { 18501 if (Math.abs(diff + this.count) < Math.abs(diff)) { 18502 diff += this.count; 18503 } 18504 } else if (diff > 0) { 18505 if (Math.abs(diff - this.count) < diff) { 18506 diff -= this.count; 18507 } 18508 } 18509 } 18510 18511 this.target = this.dim * Math.round(this.offset / this.dim); 18512 // Next 18513 if (diff < 0) { 18514 this.target += this.dim * Math.abs(diff); 18515 18516 // Prev 18517 } else if (diff > 0) { 18518 this.target -= this.dim * diff; 18519 } 18520 18521 // Set one time callback 18522 if (typeof callback === 'function') { 18523 this.oneTimeCallback = callback; 18524 } 18525 18526 // Scroll 18527 if (this.offset !== this.target) { 18528 this.amplitude = this.target - this.offset; 18529 this.timestamp = Date.now(); 18530 requestAnimationFrame(this._autoScrollBound); 18531 } 18532 } 18533 18534 /** 18535 * Cycle to next item 18536 * @param {Number} [n] 18537 */ 18538 18539 }, { 18540 key: "next", 18541 value: function next(n) { 18542 if (n === undefined || isNaN(n)) { 18543 n = 1; 18544 } 18545 18546 var index = this.center + n; 18547 if (index >= this.count || index < 0) { 18548 if (this.noWrap) { 18549 return; 18550 } 18551 18552 index = this._wrap(index); 18553 } 18554 this._cycleTo(index); 18555 } 18556 18557 /** 18558 * Cycle to previous item 18559 * @param {Number} [n] 18560 */ 18561 18562 }, { 18563 key: "prev", 18564 value: function prev(n) { 18565 if (n === undefined || isNaN(n)) { 18566 n = 1; 18567 } 18568 18569 var index = this.center - n; 18570 if (index >= this.count || index < 0) { 18571 if (this.noWrap) { 18572 return; 18573 } 18574 18575 index = this._wrap(index); 18576 } 18577 18578 this._cycleTo(index); 18579 } 18580 18581 /** 18582 * Cycle to nth item 18583 * @param {Number} [n] 18584 * @param {Function} callback 18585 */ 18586 18587 }, { 18588 key: "set", 18589 value: function set(n, callback) { 18590 if (n === undefined || isNaN(n)) { 18591 n = 0; 18592 } 18593 18594 if (n > this.count || n < 0) { 18595 if (this.noWrap) { 18596 return; 18597 } 18598 18599 n = this._wrap(n); 18600 } 18601 18602 this._cycleTo(n, callback); 18603 } 18604 }], [{ 18605 key: "init", 18606 value: function init(els, options) { 18607 return _get(Carousel.__proto__ || Object.getPrototypeOf(Carousel), "init", this).call(this, this, els, options); 18608 } 18609 18610 /** 18611 * Get Instance 18612 */ 18613 18614 }, { 18615 key: "getInstance", 18616 value: function getInstance(el) { 18617 var domElem = !!el.jquery ? el[0] : el; 18618 return domElem.M_Carousel; 18619 } 18620 }, { 18621 key: "defaults", 18622 get: function () { 18623 return _defaults; 18624 } 18625 }]); 18626 18627 return Carousel; 18628 }(Component); 18629 18630 M.Carousel = Carousel; 18631 18632 if (M.jQueryLoaded) { 18633 M.initializeJqueryWrapper(Carousel, 'carousel', 'M_Carousel'); 18634 } 18635})(cash); 18636;(function ($) { 18637 'use strict'; 18638 18639 var _defaults = { 18640 onOpen: undefined, 18641 onClose: undefined 18642 }; 18643 18644 /** 18645 * @class 18646 * 18647 */ 18648 18649 var TapTarget = function (_Component19) { 18650 _inherits(TapTarget, _Component19); 18651 18652 /** 18653 * Construct TapTarget instance 18654 * @constructor 18655 * @param {Element} el 18656 * @param {Object} options 18657 */ 18658 function TapTarget(el, options) { 18659 _classCallCheck(this, TapTarget); 18660 18661 var _this67 = _possibleConstructorReturn(this, (TapTarget.__proto__ || Object.getPrototypeOf(TapTarget)).call(this, TapTarget, el, options)); 18662 18663 _this67.el.M_TapTarget = _this67; 18664 18665 /** 18666 * Options for the select 18667 * @member TapTarget#options 18668 * @prop {Function} onOpen - Callback function called when feature discovery is opened 18669 * @prop {Function} onClose - Callback function called when feature discovery is closed 18670 */ 18671 _this67.options = $.extend({}, TapTarget.defaults, options); 18672 18673 _this67.isOpen = false; 18674 18675 // setup 18676 _this67.$origin = $('#' + _this67.$el.attr('data-target')); 18677 _this67._setup(); 18678 18679 _this67._calculatePositioning(); 18680 _this67._setupEventHandlers(); 18681 return _this67; 18682 } 18683 18684 _createClass(TapTarget, [{ 18685 key: "destroy", 18686 18687 18688 /** 18689 * Teardown component 18690 */ 18691 value: function destroy() { 18692 this._removeEventHandlers(); 18693 this.el.TapTarget = undefined; 18694 } 18695 18696 /** 18697 * Setup Event Handlers 18698 */ 18699 18700 }, { 18701 key: "_setupEventHandlers", 18702 value: function _setupEventHandlers() { 18703 this._handleDocumentClickBound = this._handleDocumentClick.bind(this); 18704 this._handleTargetClickBound = this._handleTargetClick.bind(this); 18705 this._handleOriginClickBound = this._handleOriginClick.bind(this); 18706 18707 this.el.addEventListener('click', this._handleTargetClickBound); 18708 this.originEl.addEventListener('click', this._handleOriginClickBound); 18709 18710 // Resize 18711 var throttledResize = M.throttle(this._handleResize, 200); 18712 this._handleThrottledResizeBound = throttledResize.bind(this); 18713 18714 window.addEventListener('resize', this._handleThrottledResizeBound); 18715 } 18716 18717 /** 18718 * Remove Event Handlers 18719 */ 18720 18721 }, { 18722 key: "_removeEventHandlers", 18723 value: function _removeEventHandlers() { 18724 this.el.removeEventListener('click', this._handleTargetClickBound); 18725 this.originEl.removeEventListener('click', this._handleOriginClickBound); 18726 window.removeEventListener('resize', this._handleThrottledResizeBound); 18727 } 18728 18729 /** 18730 * Handle Target Click 18731 * @param {Event} e 18732 */ 18733 18734 }, { 18735 key: "_handleTargetClick", 18736 value: function _handleTargetClick(e) { 18737 this.open(); 18738 } 18739 18740 /** 18741 * Handle Origin Click 18742 * @param {Event} e 18743 */ 18744 18745 }, { 18746 key: "_handleOriginClick", 18747 value: function _handleOriginClick(e) { 18748 this.close(); 18749 } 18750 18751 /** 18752 * Handle Resize 18753 * @param {Event} e 18754 */ 18755 18756 }, { 18757 key: "_handleResize", 18758 value: function _handleResize(e) { 18759 this._calculatePositioning(); 18760 } 18761 18762 /** 18763 * Handle Resize 18764 * @param {Event} e 18765 */ 18766 18767 }, { 18768 key: "_handleDocumentClick", 18769 value: function _handleDocumentClick(e) { 18770 if (!$(e.target).closest('.tap-target-wrapper').length) { 18771 this.close(); 18772 e.preventDefault(); 18773 e.stopPropagation(); 18774 } 18775 } 18776 18777 /** 18778 * Setup Tap Target 18779 */ 18780 18781 }, { 18782 key: "_setup", 18783 value: function _setup() { 18784 // Creating tap target 18785 this.wrapper = this.$el.parent()[0]; 18786 this.waveEl = $(this.wrapper).find('.tap-target-wave')[0]; 18787 this.originEl = $(this.wrapper).find('.tap-target-origin')[0]; 18788 this.contentEl = this.$el.find('.tap-target-content')[0]; 18789 18790 // Creating wrapper 18791 if (!$(this.wrapper).hasClass('.tap-target-wrapper')) { 18792 this.wrapper = document.createElement('div'); 18793 this.wrapper.classList.add('tap-target-wrapper'); 18794 this.$el.before($(this.wrapper)); 18795 this.wrapper.append(this.el); 18796 } 18797 18798 // Creating content 18799 if (!this.contentEl) { 18800 this.contentEl = document.createElement('div'); 18801 this.contentEl.classList.add('tap-target-content'); 18802 this.$el.append(this.contentEl); 18803 } 18804 18805 // Creating foreground wave 18806 if (!this.waveEl) { 18807 this.waveEl = document.createElement('div'); 18808 this.waveEl.classList.add('tap-target-wave'); 18809 18810 // Creating origin 18811 if (!this.originEl) { 18812 this.originEl = this.$origin.clone(true, true); 18813 this.originEl.addClass('tap-target-origin'); 18814 this.originEl.removeAttr('id'); 18815 this.originEl.removeAttr('style'); 18816 this.originEl = this.originEl[0]; 18817 this.waveEl.append(this.originEl); 18818 } 18819 18820 this.wrapper.append(this.waveEl); 18821 } 18822 } 18823 18824 /** 18825 * Calculate positioning 18826 */ 18827 18828 }, { 18829 key: "_calculatePositioning", 18830 value: function _calculatePositioning() { 18831 // Element or parent is fixed position? 18832 var isFixed = this.$origin.css('position') === 'fixed'; 18833 if (!isFixed) { 18834 var parents = this.$origin.parents(); 18835 for (var i = 0; i < parents.length; i++) { 18836 isFixed = $(parents[i]).css('position') == 'fixed'; 18837 if (isFixed) { 18838 break; 18839 } 18840 } 18841 } 18842 18843 // Calculating origin 18844 var originWidth = this.$origin.outerWidth(); 18845 var originHeight = this.$origin.outerHeight(); 18846 var originTop = isFixed ? this.$origin.offset().top - M.getDocumentScrollTop() : this.$origin.offset().top; 18847 var originLeft = isFixed ? this.$origin.offset().left - M.getDocumentScrollLeft() : this.$origin.offset().left; 18848 18849 // Calculating screen 18850 var windowWidth = window.innerWidth; 18851 var windowHeight = window.innerHeight; 18852 var centerX = windowWidth / 2; 18853 var centerY = windowHeight / 2; 18854 var isLeft = originLeft <= centerX; 18855 var isRight = originLeft > centerX; 18856 var isTop = originTop <= centerY; 18857 var isBottom = originTop > centerY; 18858 var isCenterX = originLeft >= windowWidth * 0.25 && originLeft <= windowWidth * 0.75; 18859 18860 // Calculating tap target 18861 var tapTargetWidth = this.$el.outerWidth(); 18862 var tapTargetHeight = this.$el.outerHeight(); 18863 var tapTargetTop = originTop + originHeight / 2 - tapTargetHeight / 2; 18864 var tapTargetLeft = originLeft + originWidth / 2 - tapTargetWidth / 2; 18865 var tapTargetPosition = isFixed ? 'fixed' : 'absolute'; 18866 18867 // Calculating content 18868 var tapTargetTextWidth = isCenterX ? tapTargetWidth : tapTargetWidth / 2 + originWidth; 18869 var tapTargetTextHeight = tapTargetHeight / 2; 18870 var tapTargetTextTop = isTop ? tapTargetHeight / 2 : 0; 18871 var tapTargetTextBottom = 0; 18872 var tapTargetTextLeft = isLeft && !isCenterX ? tapTargetWidth / 2 - originWidth : 0; 18873 var tapTargetTextRight = 0; 18874 var tapTargetTextPadding = originWidth; 18875 var tapTargetTextAlign = isBottom ? 'bottom' : 'top'; 18876 18877 // Calculating wave 18878 var tapTargetWaveWidth = originWidth > originHeight ? originWidth * 2 : originWidth * 2; 18879 var tapTargetWaveHeight = tapTargetWaveWidth; 18880 var tapTargetWaveTop = tapTargetHeight / 2 - tapTargetWaveHeight / 2; 18881 var tapTargetWaveLeft = tapTargetWidth / 2 - tapTargetWaveWidth / 2; 18882 18883 // Setting tap target 18884 var tapTargetWrapperCssObj = {}; 18885 tapTargetWrapperCssObj.top = isTop ? tapTargetTop + 'px' : ''; 18886 tapTargetWrapperCssObj.right = isRight ? windowWidth - tapTargetLeft - tapTargetWidth + 'px' : ''; 18887 tapTargetWrapperCssObj.bottom = isBottom ? windowHeight - tapTargetTop - tapTargetHeight + 'px' : ''; 18888 tapTargetWrapperCssObj.left = isLeft ? tapTargetLeft + 'px' : ''; 18889 tapTargetWrapperCssObj.position = tapTargetPosition; 18890 $(this.wrapper).css(tapTargetWrapperCssObj); 18891 18892 // Setting content 18893 $(this.contentEl).css({ 18894 width: tapTargetTextWidth + 'px', 18895 height: tapTargetTextHeight + 'px', 18896 top: tapTargetTextTop + 'px', 18897 right: tapTargetTextRight + 'px', 18898 bottom: tapTargetTextBottom + 'px', 18899 left: tapTargetTextLeft + 'px', 18900 padding: tapTargetTextPadding + 'px', 18901 verticalAlign: tapTargetTextAlign 18902 }); 18903 18904 // Setting wave 18905 $(this.waveEl).css({ 18906 top: tapTargetWaveTop + 'px', 18907 left: tapTargetWaveLeft + 'px', 18908 width: tapTargetWaveWidth + 'px', 18909 height: tapTargetWaveHeight + 'px' 18910 }); 18911 } 18912 18913 /** 18914 * Open TapTarget 18915 */ 18916 18917 }, { 18918 key: "open", 18919 value: function open() { 18920 if (this.isOpen) { 18921 return; 18922 } 18923 18924 // onOpen callback 18925 if (typeof this.options.onOpen === 'function') { 18926 this.options.onOpen.call(this, this.$origin[0]); 18927 } 18928 18929 this.isOpen = true; 18930 this.wrapper.classList.add('open'); 18931 18932 document.body.addEventListener('click', this._handleDocumentClickBound, true); 18933 document.body.addEventListener('touchend', this._handleDocumentClickBound); 18934 } 18935 18936 /** 18937 * Close Tap Target 18938 */ 18939 18940 }, { 18941 key: "close", 18942 value: function close() { 18943 if (!this.isOpen) { 18944 return; 18945 } 18946 18947 // onClose callback 18948 if (typeof this.options.onClose === 'function') { 18949 this.options.onClose.call(this, this.$origin[0]); 18950 } 18951 18952 this.isOpen = false; 18953 this.wrapper.classList.remove('open'); 18954 18955 document.body.removeEventListener('click', this._handleDocumentClickBound, true); 18956 document.body.removeEventListener('touchend', this._handleDocumentClickBound); 18957 } 18958 }], [{ 18959 key: "init", 18960 value: function init(els, options) { 18961 return _get(TapTarget.__proto__ || Object.getPrototypeOf(TapTarget), "init", this).call(this, this, els, options); 18962 } 18963 18964 /** 18965 * Get Instance 18966 */ 18967 18968 }, { 18969 key: "getInstance", 18970 value: function getInstance(el) { 18971 var domElem = !!el.jquery ? el[0] : el; 18972 return domElem.M_TapTarget; 18973 } 18974 }, { 18975 key: "defaults", 18976 get: function () { 18977 return _defaults; 18978 } 18979 }]); 18980 18981 return TapTarget; 18982 }(Component); 18983 18984 M.TapTarget = TapTarget; 18985 18986 if (M.jQueryLoaded) { 18987 M.initializeJqueryWrapper(TapTarget, 'tapTarget', 'M_TapTarget'); 18988 } 18989})(cash); 18990;(function ($) { 18991 'use strict'; 18992 18993 var _defaults = { 18994 classes: '', 18995 dropdownOptions: {} 18996 }; 18997 18998 /** 18999 * @class 19000 * 19001 */ 19002 19003 var FormSelect = function (_Component20) { 19004 _inherits(FormSelect, _Component20); 19005 19006 /** 19007 * Construct FormSelect instance 19008 * @constructor 19009 * @param {Element} el 19010 * @param {Object} options 19011 */ 19012 function FormSelect(el, options) { 19013 _classCallCheck(this, FormSelect); 19014 19015 // Don't init if browser default version 19016 var _this68 = _possibleConstructorReturn(this, (FormSelect.__proto__ || Object.getPrototypeOf(FormSelect)).call(this, FormSelect, el, options)); 19017 19018 if (_this68.$el.hasClass('browser-default')) { 19019 return _possibleConstructorReturn(_this68); 19020 } 19021 19022 _this68.el.M_FormSelect = _this68; 19023 19024 /** 19025 * Options for the select 19026 * @member FormSelect#options 19027 */ 19028 _this68.options = $.extend({}, FormSelect.defaults, options); 19029 19030 _this68.isMultiple = _this68.$el.prop('multiple'); 19031 19032 // Setup 19033 _this68.el.tabIndex = -1; 19034 _this68._keysSelected = {}; 19035 _this68._valueDict = {}; // Maps key to original and generated option element. 19036 _this68._setupDropdown(); 19037 19038 _this68._setupEventHandlers(); 19039 return _this68; 19040 } 19041 19042 _createClass(FormSelect, [{ 19043 key: "destroy", 19044 19045 19046 /** 19047 * Teardown component 19048 */ 19049 value: function destroy() { 19050 this._removeEventHandlers(); 19051 this._removeDropdown(); 19052 this.el.M_FormSelect = undefined; 19053 } 19054 19055 /** 19056 * Setup Event Handlers 19057 */ 19058 19059 }, { 19060 key: "_setupEventHandlers", 19061 value: function _setupEventHandlers() { 19062 var _this69 = this; 19063 19064 this._handleSelectChangeBound = this._handleSelectChange.bind(this); 19065 this._handleOptionClickBound = this._handleOptionClick.bind(this); 19066 this._handleInputClickBound = this._handleInputClick.bind(this); 19067 19068 $(this.dropdownOptions).find('li:not(.optgroup)').each(function (el) { 19069 el.addEventListener('click', _this69._handleOptionClickBound); 19070 }); 19071 this.el.addEventListener('change', this._handleSelectChangeBound); 19072 this.input.addEventListener('click', this._handleInputClickBound); 19073 } 19074 19075 /** 19076 * Remove Event Handlers 19077 */ 19078 19079 }, { 19080 key: "_removeEventHandlers", 19081 value: function _removeEventHandlers() { 19082 var _this70 = this; 19083 19084 $(this.dropdownOptions).find('li:not(.optgroup)').each(function (el) { 19085 el.removeEventListener('click', _this70._handleOptionClickBound); 19086 }); 19087 this.el.removeEventListener('change', this._handleSelectChangeBound); 19088 this.input.removeEventListener('click', this._handleInputClickBound); 19089 } 19090 19091 /** 19092 * Handle Select Change 19093 * @param {Event} e 19094 */ 19095 19096 }, { 19097 key: "_handleSelectChange", 19098 value: function _handleSelectChange(e) { 19099 this._setValueToInput(); 19100 } 19101 19102 /** 19103 * Handle Option Click 19104 * @param {Event} e 19105 */ 19106 19107 }, { 19108 key: "_handleOptionClick", 19109 value: function _handleOptionClick(e) { 19110 e.preventDefault(); 19111 var option = $(e.target).closest('li')[0]; 19112 var key = option.id; 19113 if (!$(option).hasClass('disabled') && !$(option).hasClass('optgroup') && key.length) { 19114 var selected = true; 19115 19116 if (this.isMultiple) { 19117 // Deselect placeholder option if still selected. 19118 var placeholderOption = $(this.dropdownOptions).find('li.disabled.selected'); 19119 if (placeholderOption.length) { 19120 placeholderOption.removeClass('selected'); 19121 placeholderOption.find('input[type="checkbox"]').prop('checked', false); 19122 this._toggleEntryFromArray(placeholderOption[0].id); 19123 } 19124 selected = this._toggleEntryFromArray(key); 19125 } else { 19126 $(this.dropdownOptions).find('li').removeClass('selected'); 19127 $(option).toggleClass('selected', selected); 19128 } 19129 19130 // Set selected on original select option 19131 // Only trigger if selected state changed 19132 var prevSelected = $(this._valueDict[key].el).prop('selected'); 19133 if (prevSelected !== selected) { 19134 $(this._valueDict[key].el).prop('selected', selected); 19135 this.$el.trigger('change'); 19136 } 19137 } 19138 19139 e.stopPropagation(); 19140 } 19141 19142 /** 19143 * Handle Input Click 19144 */ 19145 19146 }, { 19147 key: "_handleInputClick", 19148 value: function _handleInputClick() { 19149 if (this.dropdown && this.dropdown.isOpen) { 19150 this._setValueToInput(); 19151 this._setSelectedStates(); 19152 } 19153 } 19154 19155 /** 19156 * Setup dropdown 19157 */ 19158 19159 }, { 19160 key: "_setupDropdown", 19161 value: function _setupDropdown() { 19162 var _this71 = this; 19163 19164 this.wrapper = document.createElement('div'); 19165 $(this.wrapper).addClass('select-wrapper ' + this.options.classes); 19166 this.$el.before($(this.wrapper)); 19167 this.wrapper.appendChild(this.el); 19168 19169 if (this.el.disabled) { 19170 this.wrapper.classList.add('disabled'); 19171 } 19172 19173 // Create dropdown 19174 this.$selectOptions = this.$el.children('option, optgroup'); 19175 this.dropdownOptions = document.createElement('ul'); 19176 this.dropdownOptions.id = "select-options-" + M.guid(); 19177 $(this.dropdownOptions).addClass('dropdown-content select-dropdown ' + (this.isMultiple ? 'multiple-select-dropdown' : '')); 19178 19179 // Create dropdown structure. 19180 if (this.$selectOptions.length) { 19181 this.$selectOptions.each(function (el) { 19182 if ($(el).is('option')) { 19183 // Direct descendant option. 19184 var optionEl = void 0; 19185 if (_this71.isMultiple) { 19186 optionEl = _this71._appendOptionWithIcon(_this71.$el, el, 'multiple'); 19187 } else { 19188 optionEl = _this71._appendOptionWithIcon(_this71.$el, el); 19189 } 19190 19191 _this71._addOptionToValueDict(el, optionEl); 19192 } else if ($(el).is('optgroup')) { 19193 // Optgroup. 19194 var selectOptions = $(el).children('option'); 19195 $(_this71.dropdownOptions).append($('<li class="optgroup"><span>' + el.getAttribute('label') + '</span></li>')[0]); 19196 19197 selectOptions.each(function (el) { 19198 var optionEl = _this71._appendOptionWithIcon(_this71.$el, el, 'optgroup-option'); 19199 _this71._addOptionToValueDict(el, optionEl); 19200 }); 19201 } 19202 }); 19203 } 19204 19205 this.$el.after(this.dropdownOptions); 19206 19207 // Add input dropdown 19208 this.input = document.createElement('input'); 19209 $(this.input).addClass('select-dropdown dropdown-trigger'); 19210 this.input.setAttribute('type', 'text'); 19211 this.input.setAttribute('readonly', 'true'); 19212 this.input.setAttribute('data-target', this.dropdownOptions.id); 19213 if (this.el.disabled) { 19214 $(this.input).prop('disabled', 'true'); 19215 } 19216 19217 this.$el.before(this.input); 19218 this._setValueToInput(); 19219 19220 // Add caret 19221 var dropdownIcon = $('<svg class="caret" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>'); 19222 this.$el.before(dropdownIcon[0]); 19223 19224 // Initialize dropdown 19225 if (!this.el.disabled) { 19226 var dropdownOptions = $.extend({}, this.options.dropdownOptions); 19227 19228 // Add callback for centering selected option when dropdown content is scrollable 19229 dropdownOptions.onOpenEnd = function (el) { 19230 var selectedOption = $(_this71.dropdownOptions).find('.selected').first(); 19231 19232 if (selectedOption.length) { 19233 // Focus selected option in dropdown 19234 M.keyDown = true; 19235 _this71.dropdown.focusedIndex = selectedOption.index(); 19236 _this71.dropdown._focusFocusedItem(); 19237 M.keyDown = false; 19238 19239 // Handle scrolling to selected option 19240 if (_this71.dropdown.isScrollable) { 19241 var scrollOffset = selectedOption[0].getBoundingClientRect().top - _this71.dropdownOptions.getBoundingClientRect().top; // scroll to selected option 19242 scrollOffset -= _this71.dropdownOptions.clientHeight / 2; // center in dropdown 19243 _this71.dropdownOptions.scrollTop = scrollOffset; 19244 } 19245 } 19246 }; 19247 19248 if (this.isMultiple) { 19249 dropdownOptions.closeOnClick = false; 19250 } 19251 this.dropdown = M.Dropdown.init(this.input, dropdownOptions); 19252 } 19253 19254 // Add initial selections 19255 this._setSelectedStates(); 19256 } 19257 19258 /** 19259 * Add option to value dict 19260 * @param {Element} el original option element 19261 * @param {Element} optionEl generated option element 19262 */ 19263 19264 }, { 19265 key: "_addOptionToValueDict", 19266 value: function _addOptionToValueDict(el, optionEl) { 19267 var index = Object.keys(this._valueDict).length; 19268 var key = this.dropdownOptions.id + index; 19269 var obj = {}; 19270 optionEl.id = key; 19271 19272 obj.el = el; 19273 obj.optionEl = optionEl; 19274 this._valueDict[key] = obj; 19275 } 19276 19277 /** 19278 * Remove dropdown 19279 */ 19280 19281 }, { 19282 key: "_removeDropdown", 19283 value: function _removeDropdown() { 19284 $(this.wrapper).find('.caret').remove(); 19285 $(this.input).remove(); 19286 $(this.dropdownOptions).remove(); 19287 $(this.wrapper).before(this.$el); 19288 $(this.wrapper).remove(); 19289 } 19290 19291 /** 19292 * Setup dropdown 19293 * @param {Element} select select element 19294 * @param {Element} option option element from select 19295 * @param {String} type 19296 * @return {Element} option element added 19297 */ 19298 19299 }, { 19300 key: "_appendOptionWithIcon", 19301 value: function _appendOptionWithIcon(select, option, type) { 19302 // Add disabled attr if disabled 19303 var disabledClass = option.disabled ? 'disabled ' : ''; 19304 var optgroupClass = type === 'optgroup-option' ? 'optgroup-option ' : ''; 19305 var multipleCheckbox = this.isMultiple ? "<label><input type=\"checkbox\"" + disabledClass + "\"/><span>" + option.innerHTML + "</span></label>" : option.innerHTML; 19306 var liEl = $('<li></li>'); 19307 var spanEl = $('<span></span>'); 19308 spanEl.html(multipleCheckbox); 19309 liEl.addClass(disabledClass + " " + optgroupClass); 19310 liEl.append(spanEl); 19311 19312 // add icons 19313 var iconUrl = option.getAttribute('data-icon'); 19314 if (!!iconUrl) { 19315 var imgEl = $("<img alt=\"\" src=\"" + iconUrl + "\">"); 19316 liEl.prepend(imgEl); 19317 } 19318 19319 // Check for multiple type. 19320 $(this.dropdownOptions).append(liEl[0]); 19321 return liEl[0]; 19322 } 19323 19324 /** 19325 * Toggle entry from option 19326 * @param {String} key Option key 19327 * @return {Boolean} if entry was added or removed 19328 */ 19329 19330 }, { 19331 key: "_toggleEntryFromArray", 19332 value: function _toggleEntryFromArray(key) { 19333 var notAdded = !this._keysSelected.hasOwnProperty(key); 19334 var $optionLi = $(this._valueDict[key].optionEl); 19335 19336 if (notAdded) { 19337 this._keysSelected[key] = true; 19338 } else { 19339 delete this._keysSelected[key]; 19340 } 19341 19342 $optionLi.toggleClass('selected', notAdded); 19343 19344 // Set checkbox checked value 19345 $optionLi.find('input[type="checkbox"]').prop('checked', notAdded); 19346 19347 // use notAdded instead of true (to detect if the option is selected or not) 19348 $optionLi.prop('selected', notAdded); 19349 19350 return notAdded; 19351 } 19352 19353 /** 19354 * Set text value to input 19355 */ 19356 19357 }, { 19358 key: "_setValueToInput", 19359 value: function _setValueToInput() { 19360 var values = []; 19361 var options = this.$el.find('option'); 19362 19363 options.each(function (el) { 19364 if ($(el).prop('selected')) { 19365 var text = $(el).text(); 19366 values.push(text); 19367 } 19368 }); 19369 19370 if (!values.length) { 19371 var firstDisabled = this.$el.find('option:disabled').eq(0); 19372 if (firstDisabled.length && firstDisabled[0].value === '') { 19373 values.push(firstDisabled.text()); 19374 } 19375 } 19376 19377 this.input.value = values.join(', '); 19378 } 19379 19380 /** 19381 * Set selected state of dropdown to match actual select element 19382 */ 19383 19384 }, { 19385 key: "_setSelectedStates", 19386 value: function _setSelectedStates() { 19387 this._keysSelected = {}; 19388 19389 for (var key in this._valueDict) { 19390 var option = this._valueDict[key]; 19391 var optionIsSelected = $(option.el).prop('selected'); 19392 $(option.optionEl).find('input[type="checkbox"]').prop('checked', optionIsSelected); 19393 if (optionIsSelected) { 19394 this._activateOption($(this.dropdownOptions), $(option.optionEl)); 19395 this._keysSelected[key] = true; 19396 } else { 19397 $(option.optionEl).removeClass('selected'); 19398 } 19399 } 19400 } 19401 19402 /** 19403 * Make option as selected and scroll to selected position 19404 * @param {jQuery} collection Select options jQuery element 19405 * @param {Element} newOption element of the new option 19406 */ 19407 19408 }, { 19409 key: "_activateOption", 19410 value: function _activateOption(collection, newOption) { 19411 if (newOption) { 19412 if (!this.isMultiple) { 19413 collection.find('li.selected').removeClass('selected'); 19414 } 19415 var option = $(newOption); 19416 option.addClass('selected'); 19417 } 19418 } 19419 19420 /** 19421 * Get Selected Values 19422 * @return {Array} Array of selected values 19423 */ 19424 19425 }, { 19426 key: "getSelectedValues", 19427 value: function getSelectedValues() { 19428 var selectedValues = []; 19429 for (var key in this._keysSelected) { 19430 selectedValues.push(this._valueDict[key].el.value); 19431 } 19432 return selectedValues; 19433 } 19434 }], [{ 19435 key: "init", 19436 value: function init(els, options) { 19437 return _get(FormSelect.__proto__ || Object.getPrototypeOf(FormSelect), "init", this).call(this, this, els, options); 19438 } 19439 19440 /** 19441 * Get Instance 19442 */ 19443 19444 }, { 19445 key: "getInstance", 19446 value: function getInstance(el) { 19447 var domElem = !!el.jquery ? el[0] : el; 19448 return domElem.M_FormSelect; 19449 } 19450 }, { 19451 key: "defaults", 19452 get: function () { 19453 return _defaults; 19454 } 19455 }]); 19456 19457 return FormSelect; 19458 }(Component); 19459 19460 M.FormSelect = FormSelect; 19461 19462 if (M.jQueryLoaded) { 19463 M.initializeJqueryWrapper(FormSelect, 'formSelect', 'M_FormSelect'); 19464 } 19465})(cash); 19466;(function ($, anim) { 19467 'use strict'; 19468 19469 var _defaults = {}; 19470 19471 /** 19472 * @class 19473 * 19474 */ 19475 19476 var Range = function (_Component21) { 19477 _inherits(Range, _Component21); 19478 19479 /** 19480 * Construct Range instance 19481 * @constructor 19482 * @param {Element} el 19483 * @param {Object} options 19484 */ 19485 function Range(el, options) { 19486 _classCallCheck(this, Range); 19487 19488 var _this72 = _possibleConstructorReturn(this, (Range.__proto__ || Object.getPrototypeOf(Range)).call(this, Range, el, options)); 19489 19490 _this72.el.M_Range = _this72; 19491 19492 /** 19493 * Options for the range 19494 * @member Range#options 19495 */ 19496 _this72.options = $.extend({}, Range.defaults, options); 19497 19498 _this72._mousedown = false; 19499 19500 // Setup 19501 _this72._setupThumb(); 19502 19503 _this72._setupEventHandlers(); 19504 return _this72; 19505 } 19506 19507 _createClass(Range, [{ 19508 key: "destroy", 19509 19510 19511 /** 19512 * Teardown component 19513 */ 19514 value: function destroy() { 19515 this._removeEventHandlers(); 19516 this._removeThumb(); 19517 this.el.M_Range = undefined; 19518 } 19519 19520 /** 19521 * Setup Event Handlers 19522 */ 19523 19524 }, { 19525 key: "_setupEventHandlers", 19526 value: function _setupEventHandlers() { 19527 this._handleRangeChangeBound = this._handleRangeChange.bind(this); 19528 this._handleRangeMousedownTouchstartBound = this._handleRangeMousedownTouchstart.bind(this); 19529 this._handleRangeInputMousemoveTouchmoveBound = this._handleRangeInputMousemoveTouchmove.bind(this); 19530 this._handleRangeMouseupTouchendBound = this._handleRangeMouseupTouchend.bind(this); 19531 this._handleRangeBlurMouseoutTouchleaveBound = this._handleRangeBlurMouseoutTouchleave.bind(this); 19532 19533 this.el.addEventListener('change', this._handleRangeChangeBound); 19534 19535 this.el.addEventListener('mousedown', this._handleRangeMousedownTouchstartBound); 19536 this.el.addEventListener('touchstart', this._handleRangeMousedownTouchstartBound); 19537 19538 this.el.addEventListener('input', this._handleRangeInputMousemoveTouchmoveBound); 19539 this.el.addEventListener('mousemove', this._handleRangeInputMousemoveTouchmoveBound); 19540 this.el.addEventListener('touchmove', this._handleRangeInputMousemoveTouchmoveBound); 19541 19542 this.el.addEventListener('mouseup', this._handleRangeMouseupTouchendBound); 19543 this.el.addEventListener('touchend', this._handleRangeMouseupTouchendBound); 19544 19545 this.el.addEventListener('blur', this._handleRangeBlurMouseoutTouchleaveBound); 19546 this.el.addEventListener('mouseout', this._handleRangeBlurMouseoutTouchleaveBound); 19547 this.el.addEventListener('touchleave', this._handleRangeBlurMouseoutTouchleaveBound); 19548 } 19549 19550 /** 19551 * Remove Event Handlers 19552 */ 19553 19554 }, { 19555 key: "_removeEventHandlers", 19556 value: function _removeEventHandlers() { 19557 this.el.removeEventListener('change', this._handleRangeChangeBound); 19558 19559 this.el.removeEventListener('mousedown', this._handleRangeMousedownTouchstartBound); 19560 this.el.removeEventListener('touchstart', this._handleRangeMousedownTouchstartBound); 19561 19562 this.el.removeEventListener('input', this._handleRangeInputMousemoveTouchmoveBound); 19563 this.el.removeEventListener('mousemove', this._handleRangeInputMousemoveTouchmoveBound); 19564 this.el.removeEventListener('touchmove', this._handleRangeInputMousemoveTouchmoveBound); 19565 19566 this.el.removeEventListener('mouseup', this._handleRangeMouseupTouchendBound); 19567 this.el.removeEventListener('touchend', this._handleRangeMouseupTouchendBound); 19568 19569 this.el.removeEventListener('blur', this._handleRangeBlurMouseoutTouchleaveBound); 19570 this.el.removeEventListener('mouseout', this._handleRangeBlurMouseoutTouchleaveBound); 19571 this.el.removeEventListener('touchleave', this._handleRangeBlurMouseoutTouchleaveBound); 19572 } 19573 19574 /** 19575 * Handle Range Change 19576 * @param {Event} e 19577 */ 19578 19579 }, { 19580 key: "_handleRangeChange", 19581 value: function _handleRangeChange() { 19582 $(this.value).html(this.$el.val()); 19583 19584 if (!$(this.thumb).hasClass('active')) { 19585 this._showRangeBubble(); 19586 } 19587 19588 var offsetLeft = this._calcRangeOffset(); 19589 $(this.thumb).addClass('active').css('left', offsetLeft + 'px'); 19590 } 19591 19592 /** 19593 * Handle Range Mousedown and Touchstart 19594 * @param {Event} e 19595 */ 19596 19597 }, { 19598 key: "_handleRangeMousedownTouchstart", 19599 value: function _handleRangeMousedownTouchstart(e) { 19600 // Set indicator value 19601 $(this.value).html(this.$el.val()); 19602 19603 this._mousedown = true; 19604 this.$el.addClass('active'); 19605 19606 if (!$(this.thumb).hasClass('active')) { 19607 this._showRangeBubble(); 19608 } 19609 19610 if (e.type !== 'input') { 19611 var offsetLeft = this._calcRangeOffset(); 19612 $(this.thumb).addClass('active').css('left', offsetLeft + 'px'); 19613 } 19614 } 19615 19616 /** 19617 * Handle Range Input, Mousemove and Touchmove 19618 */ 19619 19620 }, { 19621 key: "_handleRangeInputMousemoveTouchmove", 19622 value: function _handleRangeInputMousemoveTouchmove() { 19623 if (this._mousedown) { 19624 if (!$(this.thumb).hasClass('active')) { 19625 this._showRangeBubble(); 19626 } 19627 19628 var offsetLeft = this._calcRangeOffset(); 19629 $(this.thumb).addClass('active').css('left', offsetLeft + 'px'); 19630 $(this.value).html(this.$el.val()); 19631 } 19632 } 19633 19634 /** 19635 * Handle Range Mouseup and Touchend 19636 */ 19637 19638 }, { 19639 key: "_handleRangeMouseupTouchend", 19640 value: function _handleRangeMouseupTouchend() { 19641 this._mousedown = false; 19642 this.$el.removeClass('active'); 19643 } 19644 19645 /** 19646 * Handle Range Blur, Mouseout and Touchleave 19647 */ 19648 19649 }, { 19650 key: "_handleRangeBlurMouseoutTouchleave", 19651 value: function _handleRangeBlurMouseoutTouchleave() { 19652 if (!this._mousedown) { 19653 var paddingLeft = parseInt(this.$el.css('padding-left')); 19654 var marginLeft = 7 + paddingLeft + 'px'; 19655 19656 if ($(this.thumb).hasClass('active')) { 19657 anim.remove(this.thumb); 19658 anim({ 19659 targets: this.thumb, 19660 height: 0, 19661 width: 0, 19662 top: 10, 19663 easing: 'easeOutQuad', 19664 marginLeft: marginLeft, 19665 duration: 100 19666 }); 19667 } 19668 $(this.thumb).removeClass('active'); 19669 } 19670 } 19671 19672 /** 19673 * Setup dropdown 19674 */ 19675 19676 }, { 19677 key: "_setupThumb", 19678 value: function _setupThumb() { 19679 this.thumb = document.createElement('span'); 19680 this.value = document.createElement('span'); 19681 $(this.thumb).addClass('thumb'); 19682 $(this.value).addClass('value'); 19683 $(this.thumb).append(this.value); 19684 this.$el.after(this.thumb); 19685 } 19686 19687 /** 19688 * Remove dropdown 19689 */ 19690 19691 }, { 19692 key: "_removeThumb", 19693 value: function _removeThumb() { 19694 $(this.thumb).remove(); 19695 } 19696 19697 /** 19698 * morph thumb into bubble 19699 */ 19700 19701 }, { 19702 key: "_showRangeBubble", 19703 value: function _showRangeBubble() { 19704 var paddingLeft = parseInt($(this.thumb).parent().css('padding-left')); 19705 var marginLeft = -7 + paddingLeft + 'px'; // TODO: fix magic number? 19706 anim.remove(this.thumb); 19707 anim({ 19708 targets: this.thumb, 19709 height: 30, 19710 width: 30, 19711 top: -30, 19712 marginLeft: marginLeft, 19713 duration: 300, 19714 easing: 'easeOutQuint' 19715 }); 19716 } 19717 19718 /** 19719 * Calculate the offset of the thumb 19720 * @return {Number} offset in pixels 19721 */ 19722 19723 }, { 19724 key: "_calcRangeOffset", 19725 value: function _calcRangeOffset() { 19726 var width = this.$el.width() - 15; 19727 var max = parseFloat(this.$el.attr('max')) || 100; // Range default max 19728 var min = parseFloat(this.$el.attr('min')) || 0; // Range default min 19729 var percent = (parseFloat(this.$el.val()) - min) / (max - min); 19730 return percent * width; 19731 } 19732 }], [{ 19733 key: "init", 19734 value: function init(els, options) { 19735 return _get(Range.__proto__ || Object.getPrototypeOf(Range), "init", this).call(this, this, els, options); 19736 } 19737 19738 /** 19739 * Get Instance 19740 */ 19741 19742 }, { 19743 key: "getInstance", 19744 value: function getInstance(el) { 19745 var domElem = !!el.jquery ? el[0] : el; 19746 return domElem.M_Range; 19747 } 19748 }, { 19749 key: "defaults", 19750 get: function () { 19751 return _defaults; 19752 } 19753 }]); 19754 19755 return Range; 19756 }(Component); 19757 19758 M.Range = Range; 19759 19760 if (M.jQueryLoaded) { 19761 M.initializeJqueryWrapper(Range, 'range', 'M_Range'); 19762 } 19763 19764 Range.init($('input[type=range]')); 19765})(cash, M.anime);
vendor: 40,273 bytes, lines 19766-20730
19766 19767/*! 19768 * jQuery Validation Plugin v1.21.0 19769 * 19770 * https://jqueryvalidation.org/ 19771 * 19772 * Copyright (c) 2024 JÃķrn Zaefferer 19773 * Released under the MIT license 19774 */ 19775(function( factory ) { 19776 if ( typeof define === "function" && define.amd ) { 19777 define( ["jquery"], factory ); 19778 } else if (typeof module === "object" && module.exports) { 19779 module.exports = factory( require( "jquery" ) ); 19780 } else { 19781 factory( jQuery ); 19782 } 19783}(function( $ ) { 19784 19785 $.extend( $.fn, { 19786 19787 // https://jqueryvalidation.org/validate/ 19788 validate: function( options ) { 19789 19790 // If nothing is selected, return nothing; can't chain anyway 19791 if ( !this.length ) { 19792 if ( options && options.debug && window.console ) { 19793 console.warn( "Nothing selected, can't validate, returning nothing." ); 19794 } 19795 return; 19796 } 19797 19798 // Check if a validator for this form was already created 19799 var validator = $.data( this[ 0 ], "validator" ); 19800 if ( validator ) { 19801 return validator; 19802 } 19803 19804 // Add novalidate tag if HTML5. 19805 this.attr( "novalidate", "novalidate" ); 19806 19807 validator = new $.validator( options, this[ 0 ] ); 19808 $.data( this[ 0 ], "validator", validator ); 19809 19810 if ( validator.settings.onsubmit ) { 19811 19812 this.on( "click.validate", ":submit", function( event ) { 19813 19814 // Track the used submit button to properly handle scripted 19815 // submits later. 19816 validator.submitButton = event.currentTarget; 19817 19818 // Allow suppressing validation by adding a cancel class to the submit button 19819 if ( $( this ).hasClass( "cancel" ) ) { 19820 validator.cancelSubmit = true; 19821 } 19822 19823 // Allow suppressing validation by adding the html5 formnovalidate attribute to the submit button 19824 if ( $( this ).attr( "formnovalidate" ) !== undefined ) { 19825 validator.cancelSubmit = true; 19826 } 19827 } ); 19828 19829 // Validate the form on submit 19830 this.on( "submit.validate", function( event ) { 19831 if ( validator.settings.debug ) { 19832 19833 // Prevent form submit to be able to see console output 19834 event.preventDefault(); 19835 } 19836 19837 function handle() { 19838 var hidden, result; 19839 19840 // Insert a hidden input as a replacement for the missing submit button 19841 // The hidden input is inserted in two cases: 19842 // - A user defined a `submitHandler` 19843 // - There was a pending request due to `remote` method and `stopRequest()` 19844 // was called to submit the form in case it's valid 19845 if ( validator.submitButton && ( validator.settings.submitHandler || validator.formSubmitted ) ) { 19846 hidden = $( "<input type='hidden'/>" ) 19847 .attr( "name", validator.submitButton.name ) 19848 .val( $( validator.submitButton ).val() ) 19849 .appendTo( validator.currentForm ); 19850 } 19851 19852 if ( validator.settings.submitHandler && !validator.settings.debug ) { 19853 result = validator.settings.submitHandler.call( validator, validator.currentForm, event ); 19854 if ( hidden ) { 19855 19856 // And clean up afterwards; thanks to no-block-scope, hidden can be referenced 19857 hidden.remove(); 19858 } 19859 if ( result !== undefined ) { 19860 return result; 19861 } 19862 return false; 19863 } 19864 return true; 19865 } 19866 19867 // Prevent submit for invalid forms or custom submit handlers 19868 if ( validator.cancelSubmit ) { 19869 validator.cancelSubmit = false; 19870 return handle(); 19871 } 19872 if ( validator.form() ) { 19873 if ( validator.pendingRequest ) { 19874 validator.formSubmitted = true; 19875 return false; 19876 } 19877 return handle(); 19878 } else { 19879 validator.focusInvalid(); 19880 return false; 19881 } 19882 } ); 19883 } 19884 19885 return validator; 19886 }, 19887 19888 // https://jqueryvalidation.org/valid/ 19889 valid: function() { 19890 var valid, validator, errorList; 19891 19892 if ( $( this[ 0 ] ).is( "form" ) ) { 19893 valid = this.validate().form(); 19894 } else { 19895 errorList = []; 19896 valid = true; 19897 validator = $( this[ 0 ].form ).validate(); 19898 this.each( function() { 19899 valid = validator.element( this ) && valid; 19900 if ( !valid ) { 19901 errorList = errorList.concat( validator.errorList ); 19902 } 19903 } ); 19904 validator.errorList = errorList; 19905 } 19906 return valid; 19907 }, 19908 19909 // https://jqueryvalidation.org/rules/ 19910 rules: function( command, argument ) { 19911 var element = this[ 0 ], 19912 isContentEditable = typeof this.attr( "contenteditable" ) !== "undefined" && this.attr( "contenteditable" ) !== "false", 19913 settings, staticRules, existingRules, data, param, filtered; 19914 19915 // If nothing is selected, return empty object; can't chain anyway 19916 if ( element == null ) { 19917 return; 19918 } 19919 19920 if ( !element.form && isContentEditable ) { 19921 element.form = this.closest( "form" )[ 0 ]; 19922 element.name = this.attr( "name" ); 19923 } 19924 19925 if ( element.form == null ) { 19926 return; 19927 } 19928 19929 if ( command ) { 19930 settings = $.data( element.form, "validator" ).settings; 19931 staticRules = settings.rules; 19932 existingRules = $.validator.staticRules( element ); 19933 switch ( command ) { 19934 case "add": 19935 $.extend( existingRules, $.validator.normalizeRule( argument ) ); 19936 19937 // Remove messages from rules, but allow them to be set separately 19938 delete existingRules.messages; 19939 staticRules[ element.name ] = existingRules; 19940 if ( argument.messages ) { 19941 settings.messages[ element.name ] = $.extend( settings.messages[ element.name ], argument.messages ); 19942 } 19943 break; 19944 case "remove": 19945 if ( !argument ) { 19946 delete staticRules[ element.name ]; 19947 return existingRules; 19948 } 19949 filtered = {}; 19950 $.each( argument.split( /\s/ ), function( index, method ) { 19951 filtered[ method ] = existingRules[ method ]; 19952 delete existingRules[ method ]; 19953 } ); 19954 return filtered; 19955 } 19956 } 19957 19958 data = $.validator.normalizeRules( 19959 $.extend( 19960 {}, 19961 $.validator.classRules( element ), 19962 $.validator.attributeRules( element ), 19963 $.validator.dataRules( element ), 19964 $.validator.staticRules( element ) 19965 ), element ); 19966 19967 // Make sure required is at front 19968 if ( data.required ) { 19969 param = data.required; 19970 delete data.required; 19971 data = $.extend( { required: param }, data ); 19972 } 19973 19974 // Make sure remote is at back 19975 if ( data.remote ) { 19976 param = data.remote; 19977 delete data.remote; 19978 data = $.extend( data, { remote: param } ); 19979 } 19980 19981 return data; 19982 } 19983 } ); 19984 19985// JQuery trim is deprecated, provide a trim method based on String.prototype.trim 19986 var trim = function( str ) { 19987 19988 // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trim#Polyfill 19989 return str.replace( /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "" ); 19990 }; 19991 19992// Custom selectors 19993 $.extend( $.expr.pseudos || $.expr[ ":" ], { // '|| $.expr[ ":" ]' here enables backwards compatibility to jQuery 1.7. Can be removed when dropping jQ 1.7.x support 19994 19995 // https://jqueryvalidation.org/blank-selector/ 19996 blank: function( a ) { 19997 return !trim( "" + $( a ).val() ); 19998 }, 19999 20000 // https://jqueryvalidation.org/filled-selector/ 20001 filled: function( a ) { 20002 var val = $( a ).val(); 20003 return val !== null && !!trim( "" + val ); 20004 }, 20005 20006 // https://jqueryvalidation.org/unchecked-selector/ 20007 unchecked: function( a ) { 20008 return !$( a ).prop( "checked" ); 20009 } 20010 } ); 20011 20012// Constructor for validator 20013 $.validator = function( options, form ) { 20014 this.settings = $.extend( true, {}, $.validator.defaults, options ); 20015 this.currentForm = form; 20016 this.init(); 20017 }; 20018 20019// https://jqueryvalidation.org/jQuery.validator.format/ 20020 $.validator.format = function( source, params ) { 20021 if ( arguments.length === 1 ) { 20022 return function() { 20023 var args = $.makeArray( arguments ); 20024 args.unshift( source ); 20025 return $.validator.format.apply( this, args ); 20026 }; 20027 } 20028 if ( params === undefined ) { 20029 return source; 20030 } 20031 if ( arguments.length > 2 && params.constructor !== Array ) { 20032 params = $.makeArray( arguments ).slice( 1 ); 20033 } 20034 if ( params.constructor !== Array ) { 20035 params = [ params ]; 20036 } 20037 $.each( params, function( i, n ) { 20038 source = source.replace( new RegExp( "\\{" + i + "\\}", "g" ), function() { 20039 return n; 20040 } ); 20041 } ); 20042 return source; 20043 }; 20044 20045 $.extend( $.validator, { 20046 20047 defaults: { 20048 messages: {}, 20049 groups: {}, 20050 rules: {}, 20051 errorClass: "error", 20052 pendingClass: "pending", 20053 validClass: "valid", 20054 errorElement: "label", 20055 focusCleanup: false, 20056 focusInvalid: true, 20057 errorContainer: $( [] ), 20058 errorLabelContainer: $( [] ), 20059 onsubmit: true, 20060 ignore: ":hidden", 20061 ignoreTitle: false, 20062 customElements: [], 20063 onfocusin: function( element ) { 20064 this.lastActive = element; 20065 20066 // Hide error label and remove error class on focus if enabled 20067 if ( this.settings.focusCleanup ) { 20068 if ( this.settings.unhighlight ) { 20069 this.settings.unhighlight.call( this, element, this.settings.errorClass, this.settings.validClass ); 20070 } 20071 this.hideThese( this.errorsFor( element ) ); 20072 } 20073 }, 20074 onfocusout: function( element ) { 20075 if ( !this.checkable( element ) && ( element.name in this.submitted || !this.optional( element ) ) ) { 20076 this.element( element ); 20077 } 20078 }, 20079 onkeyup: function( element, event ) { 20080 20081 // Avoid revalidate the field when pressing one of the following keys 20082 // Shift => 16 20083 // Ctrl => 17 20084 // Alt => 18 20085 // Caps lock => 20 20086 // End => 35 20087 // Home => 36 20088 // Left arrow => 37 20089 // Up arrow => 38 20090 // Right arrow => 39 20091 // Down arrow => 40 20092 // Insert => 45 20093 // Num lock => 144 20094 // AltGr key => 225 20095 var excludedKeys = [ 20096 16, 17, 18, 20, 35, 36, 37, 20097 38, 39, 40, 45, 144, 225 20098 ]; 20099 20100 if ( event.which === 9 && this.elementValue( element ) === "" || $.inArray( event.keyCode, excludedKeys ) !== -1 ) { 20101 return; 20102 } else if ( element.name in this.submitted || element.name in this.invalid ) { 20103 this.element( element ); 20104 } 20105 }, 20106 onclick: function( element ) { 20107 20108 // Click on selects, radiobuttons and checkboxes 20109 if ( element.name in this.submitted ) { 20110 this.element( element ); 20111 20112 // Or option elements, check parent select in that case 20113 } else if ( element.parentNode.name in this.submitted ) { 20114 this.element( element.parentNode ); 20115 } 20116 }, 20117 highlight: function( element, errorClass, validClass ) { 20118 if ( element.type === "radio" ) { 20119 this.findByName( element.name ).addClass( errorClass ).removeClass( validClass ); 20120 } else { 20121 $( element ).addClass( errorClass ).removeClass( validClass ); 20122 } 20123 }, 20124 unhighlight: function( element, errorClass, validClass ) { 20125 if ( element.type === "radio" ) { 20126 this.findByName( element.name ).removeClass( errorClass ).addClass( validClass ); 20127 } else { 20128 $( element ).removeClass( errorClass ).addClass( validClass ); 20129 } 20130 } 20131 }, 20132 20133 // https://jqueryvalidation.org/jQuery.validator.setDefaults/ 20134 setDefaults: function( settings ) { 20135 $.extend( $.validator.defaults, settings ); 20136 }, 20137 20138 messages: { 20139 required: "This field is required.", 20140 remote: "Please fix this field.", 20141 email: "Please enter a valid email address.", 20142 url: "Please enter a valid URL.", 20143 date: "Please enter a valid date.", 20144 dateISO: "Please enter a valid date (ISO).", 20145 number: "Please enter a valid number.", 20146 digits: "Please enter only digits.", 20147 equalTo: "Please enter the same value again.", 20148 maxlength: $.validator.format( "Please enter no more than {0} characters." ), 20149 minlength: $.validator.format( "Please enter at least {0} characters." ), 20150 rangelength: $.validator.format( "Please enter a value between {0} and {1} characters long." ), 20151 range: $.validator.format( "Please enter a value between {0} and {1}." ), 20152 max: $.validator.format( "Please enter a value less than or equal to {0}." ), 20153 min: $.validator.format( "Please enter a value greater than or equal to {0}." ), 20154 step: $.validator.format( "Please enter a multiple of {0}." ) 20155 }, 20156 20157 autoCreateRanges: false, 20158 20159 prototype: { 20160 20161 init: function() { 20162 this.labelContainer = $( this.settings.errorLabelContainer ); 20163 this.errorContext = this.labelContainer.length && this.labelContainer || $( this.currentForm ); 20164 this.containers = $( this.settings.errorContainer ).add( this.settings.errorLabelContainer ); 20165 this.submitted = {}; 20166 this.valueCache = {}; 20167 this.pendingRequest = 0; 20168 this.pending = {}; 20169 this.invalid = {}; 20170 this.reset(); 20171 20172 var currentForm = this.currentForm, 20173 groups = ( this.groups = {} ), 20174 rules; 20175 $.each( this.settings.groups, function( key, value ) { 20176 if ( typeof value === "string" ) { 20177 value = value.split( /\s/ ); 20178 } 20179 $.each( value, function( index, name ) { 20180 groups[ name ] = key; 20181 } ); 20182 } ); 20183 rules = this.settings.rules; 20184 $.each( rules, function( key, value ) { 20185 rules[ key ] = $.validator.normalizeRule( value ); 20186 } ); 20187 20188 function delegate( event ) { 20189 var isContentEditable = typeof $( this ).attr( "contenteditable" ) !== "undefined" && $( this ).attr( "contenteditable" ) !== "false"; 20190 20191 // Set form expando on contenteditable 20192 if ( !this.form && isContentEditable ) { 20193 this.form = $( this ).closest( "form" )[ 0 ]; 20194 this.name = $( this ).attr( "name" ); 20195 } 20196 20197 // Ignore the element if it belongs to another form. This will happen mainly 20198 // when setting the `form` attribute of an input to the id of another form. 20199 if ( currentForm !== this.form ) { 20200 return; 20201 } 20202 20203 var validator = $.data( this.form, "validator" ), 20204 eventType = "on" + event.type.replace( /^validate/, "" ), 20205 settings = validator.settings; 20206 if ( settings[ eventType ] && !$( this ).is( settings.ignore ) ) { 20207 settings[ eventType ].call( validator, this, event ); 20208 } 20209 } 20210 var focusListeners = [ ":text", "[type='password']", "[type='file']", "select", "textarea", "[type='number']", "[type='search']", 20211 "[type='tel']", "[type='url']", "[type='email']", "[type='datetime']", "[type='date']", "[type='month']", 20212 "[type='week']", "[type='time']", "[type='datetime-local']", "[type='range']", "[type='color']", 20213 "[type='radio']", "[type='checkbox']", "[contenteditable]", "[type='button']" ]; 20214 var clickListeners = [ "select", "option", "[type='radio']", "[type='checkbox']" ]; 20215 $( this.currentForm ) 20216 .on( "focusin.validate focusout.validate keyup.validate", focusListeners.concat( this.settings.customElements ).join( ", " ), delegate ) 20217 20218 // Support: Chrome, oldIE 20219 // "select" is provided as event.target when clicking a option 20220 .on( "click.validate", clickListeners.concat( this.settings.customElements ).join( ", " ), delegate ); 20221 20222 if ( this.settings.invalidHandler ) { 20223 $( this.currentForm ).on( "invalid-form.validate", this.settings.invalidHandler ); 20224 } 20225 }, 20226 20227 // https://jqueryvalidation.org/Validator.form/ 20228 form: function() { 20229 this.checkForm(); 20230 $.extend( this.submitted, this.errorMap ); 20231 this.invalid = $.extend( {}, this.errorMap ); 20232 if ( !this.valid() ) { 20233 $( this.currentForm ).triggerHandler( "invalid-form", [ this ] ); 20234 } 20235 this.showErrors(); 20236 return this.valid(); 20237 }, 20238 20239 checkForm: function() { 20240 this.prepareForm(); 20241 for ( var i = 0, elements = ( this.currentElements = this.elements() ); elements[ i ]; i++ ) { 20242 this.check( elements[ i ] ); 20243 } 20244 return this.valid(); 20245 }, 20246 20247 // https://jqueryvalidation.org/Validator.element/ 20248 element: function( element ) { 20249 var cleanElement = this.clean( element ), 20250 checkElement = this.validationTargetFor( cleanElement ), 20251 v = this, 20252 result = true, 20253 rs, group; 20254 20255 if ( checkElement === undefined ) { 20256 delete this.invalid[ cleanElement.name ]; 20257 } else { 20258 this.prepareElement( checkElement ); 20259 this.currentElements = $( checkElement ); 20260 20261 // If this element is grouped, then validate all group elements already 20262 // containing a value 20263 group = this.groups[ checkElement.name ]; 20264 if ( group ) { 20265 $.each( this.groups, function( name, testgroup ) { 20266 if ( testgroup === group && name !== checkElement.name ) { 20267 cleanElement = v.validationTargetFor( v.clean( v.findByName( name ) ) ); 20268 if ( cleanElement && cleanElement.name in v.invalid ) { 20269 v.currentElements.push( cleanElement ); 20270 result = v.check( cleanElement ) && result; 20271 } 20272 } 20273 } ); 20274 } 20275 20276 rs = this.check( checkElement ) !== false; 20277 result = result && rs; 20278 if ( rs ) { 20279 this.invalid[ checkElement.name ] = false; 20280 } else { 20281 this.invalid[ checkElement.name ] = true; 20282 } 20283 20284 if ( !this.numberOfInvalids() ) { 20285 20286 // Hide error containers on last error 20287 this.toHide = this.toHide.add( this.containers ); 20288 } 20289 this.showErrors(); 20290 20291 // Add aria-invalid status for screen readers 20292 $( element ).attr( "aria-invalid", !rs ); 20293 } 20294 20295 return result; 20296 }, 20297 20298 // https://jqueryvalidation.org/Validator.showErrors/ 20299 showErrors: function( errors ) { 20300 if ( errors ) { 20301 var validator = this; 20302 20303 // Add items to error list and map 20304 $.extend( this.errorMap, errors ); 20305 this.errorList = $.map( this.errorMap, function( message, name ) { 20306 return { 20307 message: message, 20308 element: validator.findByName( name )[ 0 ] 20309 }; 20310 } ); 20311 20312 // Remove items from success list 20313 this.successList = $.grep( this.successList, function( element ) { 20314 return !( element.name in errors ); 20315 } ); 20316 } 20317 if ( this.settings.showErrors ) { 20318 this.settings.showErrors.call( this, this.errorMap, this.errorList ); 20319 } else { 20320 this.defaultShowErrors(); 20321 } 20322 }, 20323 20324 // https://jqueryvalidation.org/Validator.resetForm/ 20325 resetForm: function() { 20326 if ( $.fn.resetForm ) { 20327 $( this.currentForm ).resetForm(); 20328 } 20329 this.invalid = {}; 20330 this.submitted = {}; 20331 this.prepareForm(); 20332 this.hideErrors(); 20333 var elements = this.elements() 20334 .removeData( "previousValue" ) 20335 .removeAttr( "aria-invalid" ); 20336 20337 this.resetElements( elements ); 20338 }, 20339 20340 resetElements: function( elements ) { 20341 var i; 20342 20343 if ( this.settings.unhighlight ) { 20344 for ( i = 0; elements[ i ]; i++ ) { 20345 this.settings.unhighlight.call( this, elements[ i ], 20346 this.settings.errorClass, "" ); 20347 this.findByName( elements[ i ].name ).removeClass( this.settings.validClass ); 20348 } 20349 } else { 20350 elements 20351 .removeClass( this.settings.errorClass ) 20352 .removeClass( this.settings.validClass ); 20353 } 20354 }, 20355 20356 numberOfInvalids: function() { 20357 return this.objectLength( this.invalid ); 20358 }, 20359 20360 objectLength: function( obj ) { 20361 /* jshint unused: false */ 20362 var count = 0, 20363 i; 20364 for ( i in obj ) { 20365 20366 // This check allows counting elements with empty error 20367 // message as invalid elements 20368 if ( obj[ i ] !== undefined && obj[ i ] !== null && obj[ i ] !== false ) { 20369 count++; 20370 } 20371 } 20372 return count; 20373 }, 20374 20375 hideErrors: function() { 20376 this.hideThese( this.toHide ); 20377 }, 20378 20379 hideThese: function( errors ) { 20380 errors.not( this.containers ).text( "" ); 20381 this.addWrapper( errors ).hide(); 20382 }, 20383 20384 valid: function() { 20385 return this.size() === 0; 20386 }, 20387 20388 size: function() { 20389 return this.errorList.length; 20390 }, 20391 20392 focusInvalid: function() { 20393 if ( this.settings.focusInvalid ) { 20394 try { 20395 $( this.findLastActive() || this.errorList.length && this.errorList[ 0 ].element || [] ) 20396 .filter( ":visible" ) 20397 .trigger( "focus" ) 20398 20399 // Manually trigger focusin event; without it, focusin handler isn't called, findLastActive won't have anything to find 20400 .trigger( "focusin" ); 20401 } catch ( e ) { 20402 20403 // Ignore IE throwing errors when focusing hidden elements 20404 } 20405 } 20406 }, 20407 20408 findLastActive: function() { 20409 var lastActive = this.lastActive; 20410 return lastActive && $.grep( this.errorList, function( n ) { 20411 return n.element.name === lastActive.name; 20412 } ).length === 1 && lastActive; 20413 }, 20414 20415 elements: function() { 20416 var validator = this, 20417 rulesCache = {}, 20418 selectors = [ "input", "select", "textarea", "[contenteditable]" ]; 20419 20420 // Select all valid inputs inside the form (no submit or reset buttons) 20421 return $( this.currentForm ) 20422 .find( selectors.concat( this.settings.customElements ).join( ", " ) ) 20423 .not( ":submit, :reset, :image, :disabled" ) 20424 .not( this.settings.ignore ) 20425 .filter( function() { 20426 var name = this.name || $( this ).attr( "name" ); // For contenteditable 20427 var isContentEditable = typeof $( this ).attr( "contenteditable" ) !== "undefined" && $( this ).attr( "contenteditable" ) !== "false"; 20428 20429 if ( !name && validator.settings.debug && window.console ) { 20430 console.error( "%o has no name assigned", this ); 20431 } 20432 20433 // Set form expando on contenteditable 20434 if ( isContentEditable ) { 20435 this.form = $( this ).closest( "form" )[ 0 ]; 20436 this.name = name; 20437 } 20438 20439 // Ignore elements that belong to other/nested forms 20440 if ( this.form !== validator.currentForm ) { 20441 return false; 20442 } 20443 20444 // Select only the first element for each name, and only those with rules specified 20445 if ( name in rulesCache || !validator.objectLength( $( this ).rules() ) ) { 20446 return false; 20447 } 20448 20449 rulesCache[ name ] = true; 20450 return true; 20451 } ); 20452 }, 20453 20454 clean: function( selector ) { 20455 return $( selector )[ 0 ]; 20456 }, 20457 20458 errors: function() { 20459 var errorClass = this.settings.errorClass.split( " " ).join( "." ); 20460 return $( this.settings.errorElement + "." + errorClass, this.errorContext ); 20461 }, 20462 20463 resetInternals: function() { 20464 this.successList = []; 20465 this.errorList = []; 20466 this.errorMap = {}; 20467 this.toShow = $( [] ); 20468 this.toHide = $( [] ); 20469 }, 20470 20471 reset: function() { 20472 this.resetInternals(); 20473 this.currentElements = $( [] ); 20474 }, 20475 20476 prepareForm: function() { 20477 this.reset(); 20478 this.toHide = this.errors().add( this.containers ); 20479 }, 20480 20481 prepareElement: function( element ) { 20482 this.reset(); 20483 this.toHide = this.errorsFor( element ); 20484 }, 20485 20486 elementValue: function( element ) { 20487 var $element = $( element ), 20488 type = element.type, 20489 isContentEditable = typeof $element.attr( "contenteditable" ) !== "undefined" && $element.attr( "contenteditable" ) !== "false", 20490 val, idx; 20491 20492 if ( type === "radio" || type === "checkbox" ) { 20493 return this.findByName( element.name ).filter( ":checked" ).val(); 20494 } else if ( type === "number" && typeof element.validity !== "undefined" ) { 20495 return element.validity.badInput ? "NaN" : $element.val(); 20496 } 20497 20498 if ( isContentEditable ) { 20499 val = $element.text(); 20500 } else { 20501 val = $element.val(); 20502 } 20503 20504 if ( type === "file" ) { 20505 20506 // Modern browser (chrome & safari) 20507 if ( val.substr( 0, 12 ) === "C:\\fakepath\\" ) { 20508 return val.substr( 12 ); 20509 } 20510 20511 // Legacy browsers 20512 // Unix-based path 20513 idx = val.lastIndexOf( "/" ); 20514 if ( idx >= 0 ) { 20515 return val.substr( idx + 1 ); 20516 } 20517 20518 // Windows-based path 20519 idx = val.lastIndexOf( "\\" ); 20520 if ( idx >= 0 ) { 20521 return val.substr( idx + 1 ); 20522 } 20523 20524 // Just the file name 20525 return val; 20526 } 20527 20528 if ( typeof val === "string" ) { 20529 return val.replace( /\r/g, "" ); 20530 } 20531 return val; 20532 }, 20533 20534 check: function( element ) { 20535 element = this.validationTargetFor( this.clean( element ) ); 20536 20537 var rules = $( element ).rules(), 20538 rulesCount = $.map( rules, function( n, i ) { 20539 return i; 20540 } ).length, 20541 dependencyMismatch = false, 20542 val = this.elementValue( element ), 20543 result, method, rule, normalizer; 20544 20545 // Abort any pending Ajax request from a previous call to this method. 20546 this.abortRequest( element ); 20547 20548 // Prioritize the local normalizer defined for this element over the global one 20549 // if the former exists, otherwise user the global one in case it exists. 20550 if ( typeof rules.normalizer === "function" ) { 20551 normalizer = rules.normalizer; 20552 } else if ( typeof this.settings.normalizer === "function" ) { 20553 normalizer = this.settings.normalizer; 20554 } 20555 20556 // If normalizer is defined, then call it to retreive the changed value instead 20557 // of using the real one. 20558 // Note that `this` in the normalizer is `element`. 20559 if ( normalizer ) { 20560 val = normalizer.call( element, val ); 20561 20562 // Delete the normalizer from rules to avoid treating it as a pre-defined method. 20563 delete rules.normalizer; 20564 } 20565 20566 for ( method in rules ) { 20567 rule = { method: method, parameters: rules[ method ] }; 20568 try { 20569 result = $.validator.methods[ method ].call( this, val, element, rule.parameters ); 20570 20571 // If a method indicates that the field is optional and therefore valid, 20572 // don't mark it as valid when there are no other rules 20573 if ( result === "dependency-mismatch" && rulesCount === 1 ) { 20574 dependencyMismatch = true; 20575 continue; 20576 } 20577 dependencyMismatch = false; 20578 20579 if ( result === "pending" ) { 20580 this.toHide = this.toHide.not( this.errorsFor( element ) ); 20581 return; 20582 } 20583 20584 if ( !result ) { 20585 this.formatAndAdd( element, rule ); 20586 return false; 20587 } 20588 } catch ( e ) { 20589 if ( this.settings.debug && window.console ) { 20590 console.log( "Exception occurred when checking element " + element.id + ", check the '" + rule.method + "' method.", e ); 20591 } 20592 if ( e instanceof TypeError ) { 20593 e.message += ". Exception occurred when checking element " + element.id + ", check the '" + rule.method + "' method."; 20594 } 20595 20596 throw e; 20597 } 20598 } 20599 if ( dependencyMismatch ) { 20600 return; 20601 } 20602 if ( this.objectLength( rules ) ) { 20603 this.successList.push( element ); 20604 } 20605 return true; 20606 }, 20607 20608 // Return the custom message for the given element and validation method 20609 // specified in the element's HTML5 data attribute 20610 // return the generic message if present and no method specific message is present 20611 customDataMessage: function( element, method ) { 20612 return $( element ).data( "msg" + method.charAt( 0 ).toUpperCase() + 20613 method.substring( 1 ).toLowerCase() ) || $( element ).data( "msg" ); 20614 }, 20615 20616 // Return the custom message for the given element name and validation method 20617 customMessage: function( name, method ) { 20618 var m = this.settings.messages[ name ]; 20619 return m && ( m.constructor === String ? m : m[ method ] ); 20620 }, 20621 20622 // Return the first defined argument, allowing empty strings 20623 findDefined: function() { 20624 for ( var i = 0; i < arguments.length; i++ ) { 20625 if ( arguments[ i ] !== undefined ) { 20626 return arguments[ i ]; 20627 } 20628 } 20629 return undefined; 20630 }, 20631 20632 // The second parameter 'rule' used to be a string, and extended to an object literal 20633 // of the following form: 20634 // rule = { 20635 // method: "method name", 20636 // parameters: "the given method parameters" 20637 // } 20638 // 20639 // The old behavior still supported, kept to maintain backward compatibility with 20640 // old code, and will be removed in the next major release. 20641 defaultMessage: function( element, rule ) { 20642 if ( typeof rule === "string" ) { 20643 rule = { method: rule }; 20644 } 20645 20646 var message = this.findDefined( 20647 this.customMessage( element.name, rule.method ), 20648 this.customDataMessage( element, rule.method ), 20649 20650 // 'title' is never undefined, so handle empty string as undefined 20651 !this.settings.ignoreTitle && element.title || undefined, 20652 $.validator.messages[ rule.method ], 20653 "<strong>Warning: No message defined for " + element.name + "</strong>" 20654 ), 20655 theregex = /\$?\{(\d+)\}/g; 20656 if ( typeof message === "function" ) { 20657 message = message.call( this, rule.parameters, element ); 20658 } else if ( theregex.test( message ) ) { 20659 message = $.validator.format( message.replace( theregex, "{$1}" ), rule.parameters ); 20660 } 20661 20662 return message; 20663 }, 20664 20665 formatAndAdd: function( element, rule ) { 20666 var message = this.defaultMessage( element, rule ); 20667 20668 this.errorList.push( { 20669 message: message, 20670 element: element, 20671 method: rule.method 20672 } ); 20673 20674 this.errorMap[ element.name ] = message; 20675 this.submitted[ element.name ] = message; 20676 }, 20677 20678 addWrapper: function( toToggle ) { 20679 if ( this.settings.wrapper ) { 20680 toToggle = toToggle.add( toToggle.parent( this.settings.wrapper ) ); 20681 } 20682 return toToggle; 20683 }, 20684 20685 defaultShowErrors: function() { 20686 var i, elements, error; 20687 for ( i = 0; this.errorList[ i ]; i++ ) { 20688 error = this.errorList[ i ]; 20689 if ( this.settings.highlight ) { 20690 this.settings.highlight.call( this, error.element, this.settings.errorClass, this.settings.validClass ); 20691 } 20692 this.showLabel( error.element, error.message ); 20693 } 20694 if ( this.errorList.length ) { 20695 this.toShow = this.toShow.add( this.containers ); 20696 } 20697 if ( this.settings.success ) { 20698 for ( i = 0; this.successList[ i ]; i++ ) { 20699 this.showLabel( this.successList[ i ] ); 20700 } 20701 } 20702 if ( this.settings.unhighlight ) { 20703 for ( i = 0, elements = this.validElements(); elements[ i ]; i++ ) { 20704 this.settings.unhighlight.call( this, elements[ i ], this.settings.errorClass, this.settings.validClass ); 20705 } 20706 } 20707 this.toHide = this.toHide.not( this.toShow ); 20708 this.hideErrors(); 20709 this.addWrapper( this.toShow ).show(); 20710 }, 20711 20712 validElements: function() { 20713 return this.currentElements.not( this.invalidElements() ); 20714 }, 20715 20716 invalidElements: function() { 20717 return $( this.errorList ).map( function() { 20718 return this.element; 20719 } ); 20720 }, 20721 20722 showLabel: function( element, message ) { 20723 var place, group, errorID, v, 20724 error = this.errorsFor( element ), 20725 elementID = this.idOrName( element ), 20726 describedBy = $( element ).attr( "aria-describedby" ); 20727 20728 if ( error.length ) { 20729 20730 // Refresh error/success class
20731 error.removeClass( this.settings.validClass ).addClass( this.settings.errorClass ); 20732 20733 // Replace message on existing label 20734 if ( this.settings && this.settings.escapeHtml ) { 20735 error.text( message || "" ); 20736 } else { 20737 error.html( message || "" ); 20738 } 20739 } else { 20740 20741 // Create error element 20742 error = $( "<" + this.settings.errorElement + ">" ) 20743 .attr( "id", elementID + "-error" ) 20744 .addClass( this.settings.errorClass ); 20745 20746 if ( this.settings && this.settings.escapeHtml ) { 20747 error.text( message || "" ); 20748 } else { 20749 error.html( message || "" ); 20750 } 20751 20752 // Maintain reference to the element to be placed into the DOM 20753 place = error; 20754 if ( this.settings.wrapper ) { 20755 20756 // Make sure the element is visible, even in IE 20757 // actually showing the wrapped element is handled elsewhere 20758 place = error.hide().show().wrap( "<" + this.settings.wrapper + "/>" ).parent(); 20759 } 20760 if ( this.labelContainer.length ) { 20761 this.labelContainer.append( place ); 20762 } else if ( this.settings.errorPlacement ) { 20763 this.settings.errorPlacement.call( this, place, $( element ) ); 20764 } else { 20765 place.insertAfter( element ); 20766 } 20767 20768 // Link error back to the element 20769 if ( error.is( "label" ) ) { 20770 20771 // If the error is a label, then associate using 'for' 20772 error.attr( "for", elementID ); 20773 20774 // If the element is not a child of an associated label, then it's necessary 20775 // to explicitly apply aria-describedby 20776 } else if ( error.parents( "label[for='" + this.escapeCssMeta( elementID ) + "']" ).length === 0 ) { 20777 errorID = error.attr( "id" ); 20778 20779 // Respect existing non-error aria-describedby 20780 if ( !describedBy ) { 20781 describedBy = errorID; 20782 } else if ( !describedBy.match( new RegExp( "\\b" + this.escapeCssMeta( errorID ) + "\\b" ) ) ) { 20783 20784 // Add to end of list if not already present 20785 describedBy += " " + errorID; 20786 } 20787 $( element ).attr( "aria-describedby", describedBy ); 20788 20789 // If this element is grouped, then assign to all elements in the same group 20790 group = this.groups[ element.name ]; 20791 if ( group ) { 20792 v = this; 20793 $.each( v.groups, function( name, testgroup ) { 20794 if ( testgroup === group ) { 20795 $( "[name='" + v.escapeCssMeta( name ) + "']", v.currentForm ) 20796 .attr( "aria-describedby", error.attr( "id" ) ); 20797 } 20798 } ); 20799 } 20800 } 20801 } 20802 if ( !message && this.settings.success ) { 20803 error.text( "" ); 20804 if ( typeof this.settings.success === "string" ) { 20805 error.addClass( this.settings.success ); 20806 } else { 20807 this.settings.success( error, element ); 20808 } 20809 } 20810 this.toShow = this.toShow.add( error ); 20811 }, 20812 20813 errorsFor: function( element ) { 20814 var name = this.escapeCssMeta( this.idOrName( element ) ), 20815 describer = $( element ).attr( "aria-describedby" ), 20816 selector = "label[for='" + name + "'], label[for='" + name + "'] *"; 20817 20818 // 'aria-describedby' should directly reference the error element 20819 if ( describer ) { 20820 selector = selector + ", #" + this.escapeCssMeta( describer ) 20821 .replace( /\s+/g, ", #" ); 20822 } 20823 20824 return this 20825 .errors() 20826 .filter( selector ); 20827 }, 20828 20829 // See https://api.jquery.com/category/selectors/, for CSS 20830 // meta-characters that should be escaped in order to be used with JQuery 20831 // as a literal part of a name/id or any selector. 20832 escapeCssMeta: function( string ) { 20833 if ( string === undefined ) { 20834 return ""; 20835 } 20836 20837 return string.replace( /([\\!"#$%&'()*+,./:;<=>?@\[\]^`{|}~])/g, "\\$1" ); 20838 }, 20839 20840 idOrName: function( element ) { 20841 return this.groups[ element.name ] || ( this.checkable( element ) ? element.name : element.i
vendor: 26,702 bytes, lines 20841-21464
20841d || element.name ); 20842 }, 20843 20844 validationTargetFor: function( element ) { 20845 20846 // If radio/checkbox, validate first element in group instead 20847 if ( this.checkable( element ) ) { 20848 element = this.findByName( element.name ); 20849 } 20850 20851 // Always apply ignore filter 20852 return $( element ).not( this.settings.ignore )[ 0 ]; 20853 }, 20854 20855 checkable: function( element ) { 20856 return ( /radio|checkbox/i ).test( element.type ); 20857 }, 20858 20859 findByName: function( name ) { 20860 return $( this.currentForm ).find( "[name='" + this.escapeCssMeta( name ) + "']" ); 20861 }, 20862 20863 getLength: function( value, element ) { 20864 switch ( element.nodeName.toLowerCase() ) { 20865 case "select": 20866 return $( "option:selected", element ).length; 20867 case "input": 20868 if ( this.checkable( element ) ) { 20869 return this.findByName( element.name ).filter( ":checked" ).length; 20870 } 20871 } 20872 return value.length; 20873 }, 20874 20875 depend: function( param, element ) { 20876 return this.dependTypes[ typeof param ] ? this.dependTypes[ typeof param ]( param, element ) : true; 20877 }, 20878 20879 dependTypes: { 20880 "boolean": function( param ) { 20881 return param; 20882 }, 20883 "string": function( param, element ) { 20884 return !!$( param, element.form ).length; 20885 }, 20886 "function": function( param, element ) { 20887 return param( element ); 20888 } 20889 }, 20890 20891 optional: function( element ) { 20892 var val = this.elementValue( element ); 20893 return !$.validator.methods.required.call( this, val, element ) && "dependency-mismatch"; 20894 }, 20895 20896 elementAjaxPort: function( element ) { 20897 return "validate" + element.name; 20898 }, 20899 20900 startRequest: function( element ) { 20901 if ( !this.pending[ element.name ] ) { 20902 this.pendingRequest++; 20903 $( element ).addClass( this.settings.pendingClass ); 20904 this.pending[ element.name ] = true; 20905 } 20906 }, 20907 20908 stopRequest: function( element, valid ) { 20909 this.pendingRequest--; 20910 20911 // Sometimes synchronization fails, make sure pendingRequest is never < 0 20912 if ( this.pendingRequest < 0 ) { 20913 this.pendingRequest = 0; 20914 } 20915 delete this.pending[ element.name ]; 20916 $( element ).removeClass( this.settings.pendingClass ); 20917 if ( valid && this.pendingRequest === 0 && this.formSubmitted && this.form() && this.pendingRequest === 0 ) { 20918 $( this.currentForm ).trigger( "submit" ); 20919 20920 // Remove the hidden input that was used as a replacement for the 20921 // missing submit button. The hidden input is added by `handle()` 20922 // to ensure that the value of the used submit button is passed on 20923 // for scripted submits triggered by this method 20924 if ( this.submitButton ) { 20925 $( "input:hidden[name='" + this.submitButton.name + "']", this.currentForm ).remove(); 20926 } 20927 20928 this.formSubmitted = false; 20929 } else if ( !valid && this.pendingRequest === 0 && this.formSubmitted ) { 20930 $( this.currentForm ).triggerHandler( "invalid-form", [ this ] ); 20931 this.formSubmitted = false; 20932 } 20933 }, 20934 20935 abortRequest: function( element ) { 20936 var port; 20937 20938 if ( this.pending[ element.name ] ) { 20939 port = this.elementAjaxPort( element ); 20940 $.ajaxAbort( port ); 20941 20942 this.pendingRequest--; 20943 20944 // Sometimes synchronization fails, make sure pendingRequest is never < 0 20945 if ( this.pendingRequest < 0 ) { 20946 this.pendingRequest = 0; 20947 } 20948 20949 delete this.pending[ element.name ]; 20950 $( element ).removeClass( this.settings.pendingClass ); 20951 } 20952 }, 20953 20954 previousValue: function( element, method ) { 20955 method = typeof method === "string" && method || "remote"; 20956 20957 return $.data( element, "previousValue" ) || $.data( element, "previousValue", { 20958 old: null, 20959 valid: true, 20960 message: this.defaultMessage( element, { method: method } ) 20961 } ); 20962 }, 20963 20964 // Cleans up all forms and elements, removes validator-specific events 20965 destroy: function() { 20966 this.resetForm(); 20967 20968 $( this.currentForm ) 20969 .off( ".validate" ) 20970 .removeData( "validator" ) 20971 .find( ".validate-equalTo-blur" ) 20972 .off( ".validate-equalTo" ) 20973 .removeClass( "validate-equalTo-blur" ) 20974 .find( ".validate-lessThan-blur" ) 20975 .off( ".validate-lessThan" ) 20976 .removeClass( "validate-lessThan-blur" ) 20977 .find( ".validate-lessThanEqual-blur" ) 20978 .off( ".validate-lessThanEqual" ) 20979 .removeClass( "validate-lessThanEqual-blur" ) 20980 .find( ".validate-greaterThanEqual-blur" ) 20981 .off( ".validate-greaterThanEqual" ) 20982 .removeClass( "validate-greaterThanEqual-blur" ) 20983 .find( ".validate-greaterThan-blur" ) 20984 .off( ".validate-greaterThan" ) 20985 .removeClass( "validate-greaterThan-blur" ); 20986 } 20987 20988 }, 20989 20990 classRuleSettings: { 20991 required: { required: true }, 20992 email: { email: true }, 20993 url: { url: true }, 20994 date: { date: true }, 20995 dateISO: { dateISO: true }, 20996 number: { number: true }, 20997 digits: { digits: true }, 20998 creditcard: { creditcard: true } 20999 }, 21000 21001 addClassRules: function( className, rules ) { 21002 if ( className.constructor === String ) { 21003 this.classRuleSettings[ className ] = rules; 21004 } else { 21005 $.extend( this.classRuleSettings, className ); 21006 } 21007 }, 21008 21009 classRules: function( element ) { 21010 var rules = {}, 21011 classes = $( element ).attr( "class" ); 21012 21013 if ( classes ) { 21014 $.each( classes.split( " " ), function() { 21015 if ( this in $.validator.classRuleSettings ) { 21016 $.extend( rules, $.validator.classRuleSettings[ this ] ); 21017 } 21018 } ); 21019 } 21020 return rules; 21021 }, 21022 21023 normalizeAttributeRule: function( rules, type, method, value ) { 21024 21025 // Convert the value to a number for number inputs, and for text for backwards compability 21026 // allows type="date" and others to be compared as strings 21027 if ( /min|max|step/.test( method ) && ( type === null || /number|range|text/.test( type ) ) ) { 21028 value = Number( value ); 21029 21030 // Support Opera Mini, which returns NaN for undefined minlength 21031 if ( isNaN( value ) ) { 21032 value = undefined; 21033 } 21034 } 21035 21036 if ( value || value === 0 ) { 21037 rules[ method ] = value; 21038 } else if ( type === method && type !== "range" ) { 21039 21040 // Exception: the jquery validate 'range' method 21041 // does not test for the html5 'range' type 21042 rules[ type === "date" ? "dateISO" : method ] = true; 21043 } 21044 }, 21045 21046 attributeRules: function( element ) { 21047 var rules = {}, 21048 $element = $( element ), 21049 type = element.getAttribute( "type" ), 21050 method, value; 21051 21052 for ( method in $.validator.methods ) { 21053 21054 // Support for <input required> in both html5 and older browsers 21055 if ( method === "required" ) { 21056 value = element.getAttribute( method ); 21057 21058 // Some browsers return an empty string for the required attribute 21059 // and non-HTML5 browsers might have required="" markup 21060 if ( value === "" ) { 21061 value = true; 21062 } 21063 21064 // Force non-HTML5 browsers to return bool 21065 value = !!value; 21066 } else { 21067 value = $element.attr( method ); 21068 } 21069 21070 this.normalizeAttributeRule( rules, type, method, value ); 21071 } 21072 21073 // 'maxlength' may be returned as -1, 2147483647 ( IE ) and 524288 ( safari ) for text inputs 21074 if ( rules.maxlength && /-1|2147483647|524288/.test( rules.maxlength ) ) { 21075 delete rules.maxlength; 21076 } 21077 21078 return rules; 21079 }, 21080 21081 dataRules: function( element ) { 21082 var rules = {}, 21083 $element = $( element ), 21084 type = element.getAttribute( "type" ), 21085 method, value; 21086 21087 for ( method in $.validator.methods ) { 21088 value = $element.data( "rule" + method.charAt( 0 ).toUpperCase() + method.substring( 1 ).toLowerCase() ); 21089 21090 // Cast empty attributes like `data-rule-required` to `true` 21091 if ( value === "" ) { 21092 value = true; 21093 } 21094 21095 this.normalizeAttributeRule( rules, type, method, value ); 21096 } 21097 return rules; 21098 }, 21099 21100 staticRules: function( element ) { 21101 var rules = {}, 21102 validator = $.data( element.form, "validator" ); 21103 21104 if ( validator.settings.rules ) { 21105 rules = $.validator.normalizeRule( validator.settings.rules[ element.name ] ) || {}; 21106 } 21107 return rules; 21108 }, 21109 21110 normalizeRules: function( rules, element ) { 21111 21112 // Handle dependency check 21113 $.each( rules, function( prop, val ) { 21114 21115 // Ignore rule when param is explicitly false, eg. required:false 21116 if ( val === false ) { 21117 delete rules[ prop ]; 21118 return; 21119 } 21120 if ( val.param || val.depends ) { 21121 var keepRule = true; 21122 switch ( typeof val.depends ) { 21123 case "string": 21124 keepRule = !!$( val.depends, element.form ).length; 21125 break; 21126 case "function": 21127 keepRule = val.depends.call( element, element ); 21128 break; 21129 } 21130 if ( keepRule ) { 21131 rules[ prop ] = val.param !== undefined ? val.param : true; 21132 } else { 21133 $.data( element.form, "validator" ).resetElements( $( element ) ); 21134 delete rules[ prop ]; 21135 } 21136 } 21137 } ); 21138 21139 // Evaluate parameters 21140 $.each( rules, function( rule, parameter ) { 21141 rules[ rule ] = typeof parameter === "function" && rule !== "normalizer" ? parameter( element ) : parameter; 21142 } ); 21143 21144 // Clean number parameters 21145 $.each( [ "minlength", "maxlength" ], function() { 21146 if ( rules[ this ] ) { 21147 rules[ this ] = Number( rules[ this ] ); 21148 } 21149 } ); 21150 $.each( [ "rangelength", "range" ], function() { 21151 var parts; 21152 if ( rules[ this ] ) { 21153 if ( Array.isArray( rules[ this ] ) ) { 21154 rules[ this ] = [ Number( rules[ this ][ 0 ] ), Number( rules[ this ][ 1 ] ) ]; 21155 } else if ( typeof rules[ this ] === "string" ) { 21156 parts = rules[ this ].replace( /[\[\]]/g, "" ).split( /[\s,]+/ ); 21157 rules[ this ] = [ Number( parts[ 0 ] ), Number( parts[ 1 ] ) ]; 21158 } 21159 } 21160 } ); 21161 21162 if ( $.validator.autoCreateRanges ) { 21163 21164 // Auto-create ranges 21165 if ( rules.min != null && rules.max != null ) { 21166 rules.range = [ rules.min, rules.max ]; 21167 delete rules.min; 21168 delete rules.max; 21169 } 21170 if ( rules.minlength != null && rules.maxlength != null ) { 21171 rules.rangelength = [ rules.minlength, rules.maxlength ]; 21172 delete rules.minlength; 21173 delete rules.maxlength; 21174 } 21175 } 21176 21177 return rules; 21178 }, 21179 21180 // Converts a simple string to a {string: true} rule, e.g., "required" to {required:true} 21181 normalizeRule: function( data ) { 21182 if ( typeof data === "string" ) { 21183 var transformed = {}; 21184 $.each( data.split( /\s/ ), function() { 21185 transformed[ this ] = true; 21186 } ); 21187 data = transformed; 21188 } 21189 return data; 21190 }, 21191 21192 // https://jqueryvalidation.org/jQuery.validator.addMethod/ 21193 addMethod: function( name, method, message ) { 21194 $.validator.methods[ name ] = method; 21195 $.validator.messages[ name ] = message !== undefined ? message : $.validator.messages[ name ]; 21196 if ( method.length < 3 ) { 21197 $.validator.addClassRules( name, $.validator.normalizeRule( name ) ); 21198 } 21199 }, 21200 21201 // https://jqueryvalidation.org/jQuery.validator.methods/ 21202 methods: { 21203 21204 // https://jqueryvalidation.org/required-method/ 21205 required: function( value, element, param ) { 21206 21207 // Check if dependency is met 21208 if ( !this.depend( param, element ) ) { 21209 return "dependency-mismatch"; 21210 } 21211 if ( element.nodeName.toLowerCase() === "select" ) { 21212 21213 // Could be an array for select-multiple or a string, both are fine this way 21214 var val = $( element ).val(); 21215 return val && val.length > 0; 21216 } 21217 if ( this.checkable( element ) ) { 21218 return this.getLength( value, element ) > 0; 21219 } 21220 return value !== undefined && value !== null && value.length > 0; 21221 }, 21222 21223 // https://jqueryvalidation.org/email-method/ 21224 email: function( value, element ) { 21225 21226 // From https://html.spec.whatwg.org/multipage/forms.html#valid-e-mail-address 21227 // Retrieved 2014-01-14 21228 // If you have a problem with this implementation, report a bug against the above spec 21229 // Or use custom methods to implement your own email validation 21230 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 ); 21231 }, 21232 21233 // https://jqueryvalidation.org/url-method/ 21234 url: function( value, element ) { 21235 21236 // Copyright (c) 2010-2013 Diego Perini, MIT licensed 21237 // https://gist.github.com/dperini/729294 21238 // see also https://mathiasbynens.be/demo/url-regex 21239 // modified to allow protocol-relative URLs 21240 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 ); 21241 }, 21242 21243 // https://jqueryvalidation.org/date-method/ 21244 date: ( function() { 21245 var called = false; 21246 21247 return function( value, element ) { 21248 if ( !called ) { 21249 called = true; 21250 if ( this.settings.debug && window.console ) { 21251 console.warn( 21252 "The `date` method is deprecated and will be removed in version '2.0.0'.\n" + 21253 "Please don't use it, since it relies on the Date constructor, which\n" + 21254 "behaves very differently across browsers and locales. Use `dateISO`\n" + 21255 "instead or one of the locale specific methods in `localizations/`\n" + 21256 "and `additional-methods.js`." 21257 ); 21258 } 21259 } 21260 21261 return this.optional( element ) || !/Invalid|NaN/.test( new Date( value ).toString() ); 21262 }; 21263 }() ), 21264 21265 // https://jqueryvalidation.org/dateISO-method/ 21266 dateISO: function( value, element ) { 21267 return this.optional( element ) || /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test( value ); 21268 }, 21269 21270 // https://jqueryvalidation.org/number-method/ 21271 number: function( value, element ) { 21272 return this.optional( element ) || /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:-?\.\d+)?$/.test( value ); 21273 }, 21274 21275 // https://jqueryvalidation.org/digits-method/ 21276 digits: function( value, element ) { 21277 return this.optional( element ) || /^\d+$/.test( value ); 21278 }, 21279 21280 // https://jqueryvalidation.org/minlength-method/ 21281 minlength: function( value, element, param ) { 21282 var length = Array.isArray( value ) ? value.length : this.getLength( value, element ); 21283 return this.optional( element ) || length >= param; 21284 }, 21285 21286 // https://jqueryvalidation.org/maxlength-method/ 21287 maxlength: function( value, element, param ) { 21288 var length = Array.isArray( value ) ? value.length : this.getLength( value, element ); 21289 return this.optional( element ) || length <= param; 21290 }, 21291 21292 // https://jqueryvalidation.org/rangelength-method/ 21293 rangelength: function( value, element, param ) { 21294 var length = Array.isArray( value ) ? value.length : this.getLength( value, element ); 21295 return this.optional( element ) || ( length >= param[ 0 ] && length <= param[ 1 ] ); 21296 }, 21297 21298 // https://jqueryvalidation.org/min-method/ 21299 min: function( value, element, param ) { 21300 return this.optional( element ) || value >= param; 21301 }, 21302 21303 // https://jqueryvalidation.org/max-method/ 21304 max: function( value, element, param ) { 21305 return this.optional( element ) || value <= param; 21306 }, 21307 21308 // https://jqueryvalidation.org/range-method/ 21309 range: function( value, element, param ) { 21310 return this.optional( element ) || ( value >= param[ 0 ] && value <= param[ 1 ] ); 21311 }, 21312 21313 // https://jqueryvalidation.org/step-method/ 21314 step: function( value, element, param ) { 21315 var type = $( element ).attr( "type" ), 21316 errorMessage = "Step attribute on input type " + type + " is not supported.", 21317 supportedTypes = [ "text", "number", "range" ], 21318 re = new RegExp( "\\b" + type + "\\b" ), 21319 notSupported = type && !re.test( supportedTypes.join() ), 21320 decimalPlaces = function( num ) { 21321 var match = ( "" + num ).match( /(?:\.(\d+))?$/ ); 21322 if ( !match ) { 21323 return 0; 21324 } 21325 21326 // Number of digits right of decimal point. 21327 return match[ 1 ] ? match[ 1 ].length : 0; 21328 }, 21329 toInt = function( num ) { 21330 return Math.round( num * Math.pow( 10, decimals ) ); 21331 }, 21332 valid = true, 21333 decimals; 21334 21335 // Works only for text, number and range input types 21336 // TODO find a way to support input types date, datetime, datetime-local, month, time and week 21337 if ( notSupported ) { 21338 throw new Error( errorMessage ); 21339 } 21340 21341 decimals = decimalPlaces( param ); 21342 21343 // Value can't have too many decimals 21344 if ( decimalPlaces( value ) > decimals || toInt( value ) % toInt( param ) !== 0 ) { 21345 valid = false; 21346 } 21347 21348 return this.optional( element ) || valid; 21349 }, 21350 21351 // https://jqueryvalidation.org/equalTo-method/ 21352 equalTo: function( value, element, param ) { 21353 21354 // Bind to the blur event of the target in order to revalidate whenever the target field is updated 21355 var target = $( param ); 21356 if ( this.settings.onfocusout && target.not( ".validate-equalTo-blur" ).length ) { 21357 target.addClass( "validate-equalTo-blur" ).on( "blur.validate-equalTo", function() { 21358 $( element ).valid(); 21359 } ); 21360 } 21361 return value === target.val(); 21362 }, 21363 21364 // https://jqueryvalidation.org/remote-method/ 21365 remote: function( value, element, param, method ) { 21366 if ( this.optional( element ) ) { 21367 return "dependency-mismatch"; 21368 } 21369 21370 method = typeof method === "string" && method || "remote"; 21371 21372 var previous = this.previousValue( element, method ), 21373 validator, data, optionDataString; 21374 21375 if ( !this.settings.messages[ element.name ] ) { 21376 this.settings.messages[ element.name ] = {}; 21377 } 21378 previous.originalMessage = previous.originalMessage || this.settings.messages[ element.name ][ method ]; 21379 this.settings.messages[ element.name ][ method ] = previous.message; 21380 21381 param = typeof param === "string" && { url: param } || param; 21382 optionDataString = $.param( $.extend( { data: value }, param.data ) ); 21383 if ( previous.valid !== null && previous.old === optionDataString ) { 21384 return previous.valid; 21385 } 21386 21387 previous.old = optionDataString; 21388 previous.valid = null; 21389 validator = this; 21390 this.startRequest( element ); 21391 data = {}; 21392 data[ element.name ] = value; 21393 $.ajax( $.extend( true, { 21394 mode: "abort", 21395 port: this.elementAjaxPort( element ), 21396 dataType: "json", 21397 data: data, 21398 context: validator.currentForm, 21399 success: function( response ) { 21400 var valid = response === true || response === "true", 21401 errors, message, submitted; 21402 21403 validator.settings.messages[ element.name ][ method ] = previous.originalMessage; 21404 if ( valid ) { 21405 submitted = validator.formSubmitted; 21406 validator.toHide = validator.errorsFor( element ); 21407 validator.formSubmitted = submitted; 21408 validator.successList.push( element ); 21409 validator.invalid[ element.name ] = false; 21410 validator.showErrors(); 21411 } else { 21412 errors = {}; 21413 message = response || validator.defaultMessage( element, { method: method, parameters: value } ); 21414 errors[ element.name ] = previous.message = message; 21415 validator.invalid[ element.name ] = true; 21416 validator.showErrors( errors ); 21417 } 21418 previous.valid = valid; 21419 validator.stopRequest( element, valid ); 21420 } 21421 }, param ) ); 21422 return "pending"; 21423 } 21424 } 21425 21426 } ); 21427 21428// Ajax mode: abort 21429// usage: $.ajax({ mode: "abort"[, port: "uniqueport"]}); 21430// $.ajaxAbort( port ); 21431// if mode:"abort" is used, the previous request on that port (port can be undefined) is aborted via XMLHttpRequest.abort() 21432 21433 var pendingRequests = {}, 21434 ajax; 21435 21436// Use a prefilter if available (1.5+) 21437 if ( $.ajaxPrefilter ) { 21438 $.ajaxPrefilter( function( settings, _, xhr ) { 21439 var port = settings.port; 21440 if ( settings.mode === "abort" ) { 21441 $.ajaxAbort( port ); 21442 pendingRequests[ port ] = xhr; 21443 } 21444 } ); 21445 } else { 21446 21447 // Proxy ajax 21448 ajax = $.ajax; 21449 $.ajax = function( settings ) { 21450 var mode = ( "mode" in settings ? settings : $.ajaxSettings ).mode, 21451 port = ( "port" in settings ? settings : $.ajaxSettings ).port; 21452 if ( mode === "abort" ) { 21453 $.ajaxAbort( port ); 21454 pendingRequests[ port ] = ajax.apply( this, arguments ); 21455 return pendingRequests[ port ]; 21456 } 21457 return ajax.apply( this, arguments ); 21458 }; 21459 } 21460 21461// Abort the previous request without sending a new one 21462 $.ajaxAbort = function( port ) { 21463 if ( pendingRequests[ port ] ) { 21464 pendingRequests[ port ].abort();
21465 delete pendingRequests[ port ]; 21466 } 21467 }; 21468 return $; 21469})); 21470/*! For license information please see bundle.js.LICENSE.txt */ 21471!function(){var t={569:function(t,e,n){var i=n(794);t.exports=function(t){if(!i(t))throw TypeError(String(t)+" is not an object");return t}},494:function(t,e,n){var i=n(544);t.exports=!i((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},668:function(t,e,n){var i=n(583),r=n(794),o=i.document,a=r(o)&&r(o.createElement);t.exports=function(t){return a?o.createElement(t):{}}},544:function(t){t.exports=function(t){try{return!!t()}catch(t){return!0}}},583:function(t,e,n){var i=function(t){return t&&t.Math==Math&&t};t.exports=i("object"==typeof globalThis&&globalThis)||i("object"==typeof window&&window)||i("object"==typeof self&&self)||i("object"==typeof n.g&&n.g)||function(){return this}()||Function("return this")()},275:function(t,e,n){var i=n(494),r=n(544),o=n(668);t.exports=!i&&!r((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},794:function(t){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},615:function(t,e,n){var i=n(494),r=n(275),o=n(569),a=n(670),s=Object.defineProperty;e.f=i?s:function(t,e,n){if(o(t),e=a(e,!0),o(n),r)try{return s(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},670:function(t,e,n){var i=n(794);t.exports=function(t,e){if(!i(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!i(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!i(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!i(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")}},458:function(t,e,n){var i=n(494),r=n(615).f,o=Function.prototype,a=o.toString,s=/^\s*function ([^ (]*)/,u="name";i&&!(u in o)&&r(o,u,{configurable:!0,get:function(){try{return a.call(this).match(s)[1]}catch(t){return""}}})}},e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={exports:{}};return t[i](r,r.exports,n),r.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),function(){var t;n.g.importScripts&&(t=n.g.location+"");var e=n.g.document;if(!t&&e&&(e.currentScript&&(t=e.currentScript.src),!t)){var i=e.getElementsByTagName("script");i.length&&(t=i[i.length-1].src)}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=t}(),function(){"use strict";n.p}(),function(){"use strict";n(458);var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};function e(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}var i=function(){return(i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)};function r(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],i=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function o(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,r,o=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(t){r={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return a}function a(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(o(arguments[e]));return t}var s=function(){function t(t){void 0===t&&(t={}),this.adapter=t}return Object.defineProperty(t,"cssClasses",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{}},enumerable:!0,configurable:!0}),t.prototype.init=function(){},t.prototype.destroy=function(){},t}(),u=function(){function t(t,e){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];this.root=t,this.initialize.apply(this,a(n)),this.foundation=void 0===e?this.getDefaultFoundation():e,this.foundation.init(),this.initialSyncWithDOM()}return t.attachTo=function(e){return new t(e,new s({}))},t.prototype.initialize=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},t.prototype.getDefaultFoundation=function(){throw new Error("Subclasses must override getDefaultFoundation to return a properly configured foundation class")},t.prototype.initialSyncWithDOM=function(){},t.prototype.destroy=function(){this.foundation.destroy()},t.prototype.listen=function(t,e,n){this.root.addEventListener(t,e,n)},t.prototype.unlisten=function(t,e,n){this.root.removeEventListener(t,e,n)},t.prototype.emit=function(t,e,n){var i;void 0===n&&(n=!1),"function"==typeof CustomEvent?i=new CustomEvent(t,{bubbles:n,detail:e}):(i=document.createEvent("CustomEvent")).initCustomEvent(t,n,!1,e),this.root.dispatchEvent(i)},t}();function c(t,e){if(t.closest)return t.closest(e);for(var n=t;n;){if(d(n,e))return n;n=n.parentElement}return null}function d(t,e){return(t.matches||t.webkitMatchesSelector||t.msMatchesSelector).call(t,e)}var l,h,p,f={LABEL_FLOAT_ABOVE:"mdc-floating-label--float-above",LABEL_REQUIRED:"mdc-floating-label--required",LABEL_SHAKE:"mdc-floating-label--shake",ROOT:"mdc-floating-label"},m=function(t){function n(e){var r=t.call(this,i(i({},n.defaultAdapter),e))||this;return r.shakeAnimationEndHandler_=function(){return r.handleShakeAnimationEnd_()},r}
21471return e(n,t),Object.defineProperty(n,"cssClasses",{get:function(){return f},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},getWidth:function(){return 0},registerInteractionHandler:function(){},deregisterInteractionHandler:function(){}}},enumerable:!0,configurable:!0}),n.prototype.init=function(){this.adapter.registerInteractionHandler("animationend",this.shakeAnimationEndHandler_)},n.prototype.destroy=function(){this.adapter.deregisterInteractionHandler("animationend",this.shakeAnimationEndHandler_)},n.prototype.getWidth=function(){return this.adapter.getWidth()},n.prototype.shake=function(t){var e=n.cssClasses.LABEL_SHAKE;t?this.adapter.addClass(e):this.adapter.removeClass(e)},n.prototype.float=function(t){var e=n.cssClasses,i=e.LABEL_FLOAT_ABOVE,r=e.LABEL_SHAKE;t?this.adapter.addClass(i):(this.adapter.removeClass(i),this.adapter.removeClass(r))},n.prototype.setRequired=function(t){var e=n.cssClasses.LABEL_REQUIRED;t?this.adapter.addClass(e):this.adapter.removeClass(e)},n.prototype.handleShakeAnimationEnd_=function(){var t=n.cssClasses.LABEL_SHAKE;this.adapter.removeClass(t)},n}(s),E=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.attachTo=function(t){return new n(t)},n.prototype.shake=function(t){this.foundation.shake(t)},n.prototype.float=function(t){this.foundation.float(t)},n.prototype.setRequired=function(t){this.foundation.setRequired(t)},n.prototype.getWidth=function(){return this.foundation.getWidth()},n.prototype.getDefaultFoundation=function(){var t=this;return new m({addClass:function(e){return t.root.classList.add(e)},removeClass:function(e){return t.root.classList.remove(e)},getWidth:function(){return function(t){var e=t;if(null!==e.offsetParent)return e.scrollWidth;var n=e.cloneNode(!0);n.style.setProperty("position","absolute"),n.style.setProperty("transform","translate(-9999px, -9999px)"),document.documentElement.appendChild(n);var i=n.scrollWidth;return document.documentElement.removeChild(n),i}(t.root)},registerInteractionHandler:function(e,n){return t.listen(e,n)},deregisterInteractionHandler:function(e,n){return t.unlisten(e,n)}})},n}(u),I={LINE_RIPPLE_ACTIVE:"mdc-line-ripple--active",LINE_RIPPLE_DEACTIVATING:"mdc-line-ripple--deactivating"},_=function(t){function n(e){var r=t.call(this,i(i({},n.defaultAdapter),e))||this;return r.transitionEndHandler_=function(t){return r.handleTransitionEnd(t)},r}return e(n,t),Object.defineProperty(n,"cssClasses",{get:function(){return I},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},setStyle:function(){},registerEventHandler:function(){},deregisterEventHandler:function(){}}},enumerable:!0,configurable:!0}),n.prototype.init=function(){this.adapter.registerEventHandler("transitionend",this.transitionEndHandler_)},n.prototype.destroy=function(){this.adapter.deregisterEventHandler("transitionend",this.transitionEndHandler_)},n.prototype.activate=function(){this.adapter.removeClass(I.LINE_RIPPLE_DEACTIVATING),this.adapter.addClass(I.LINE_RIPPLE_ACTIVE)},n.prototype.setRippleCenter=function(t){this.adapter.setStyle("transform-origin",t+"px center")},n.prototype.deactivate=function(){this.adapter.addClass(I.LINE_RIPPLE_DEACTIVATING)},n.prototype.handleTransitionEnd=function(t){var e=this.adapter.hasClass(I.LINE_RIPPLE_DEACTIVATING);"opacity"===t.propertyName&&e&&(this.adapter.removeClass(I.LINE_RIPPLE_ACTIVE),this.adapter.removeClass(I.LINE_RIPPLE_DEACTIVATING))},n}(s),y=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.attachTo=function(t){return new n(t)},n.prototype.activate=function(){this.foundation.activate()},n.prototype.deactivate=function(){this.foundation.deactivate()},n.prototype.setRippleCenter=function(t){this.foundation.setRippleCenter(t)},n.prototype.getDefaultFoundation=function(){var t=this;return new _({addClass:function(e){return t.root.classList.add(e)},removeClass:function(e){return t.root.classList.remove(e)},hasClass:function(e){return t.root.classList.contains(e)},setStyle:function(e,n){return t.root.style.setProperty(e,n)},registerEventHandler:function(e,n){return t.listen(e,n)},deregisterEventHandler:function(e,n){return t.unlisten(e,n)}})},n}(u),g={ANCHOR:"mdc-menu-surface--anchor",ANIMATING_CLOSED:"mdc-menu-surface--animating-closed",AN
vendor: 10,942 bytes, line 21471
21471IMATING_OPEN:"mdc-menu-surface--animating-open",FIXED:"mdc-menu-surface--fixed",IS_OPEN_BELOW:"mdc-menu-surface--is-open-below",OPEN:"mdc-menu-surface--open",ROOT:"mdc-menu-surface"},C={CLOSED_EVENT:"MDCMenuSurface:closed",CLOSING_EVENT:"MDCMenuSurface:closing",OPENED_EVENT:"MDCMenuSurface:opened",FOCUSABLE_ELEMENTS:["button:not(:disabled)",'[href]:not([aria-disabled="true"])',"input:not(:disabled)","select:not(:disabled)","textarea:not(:disabled)",'[tabindex]:not([tabindex="-1"]):not([aria-disabled="true"])'].join(", ")},A={TRANSITION_OPEN_DURATION:120,TRANSITION_CLOSE_DURATION:75,MARGIN_TO_EDGE:32,ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO:.67};!function(t){t[t.BOTTOM=1]="BOTTOM",t[t.CENTER=2]="CENTER",t[t.RIGHT=4]="RIGHT",t[t.FLIP_RTL=8]="FLIP_RTL"}(l||(l={})),function(t){t[t.TOP_LEFT=0]="TOP_LEFT",t[t.TOP_RIGHT=4]="TOP_RIGHT",t[t.BOTTOM_LEFT=1]="BOTTOM_LEFT",t[t.BOTTOM_RIGHT=5]="BOTTOM_RIGHT",t[t.TOP_START=8]="TOP_START",t[t.TOP_END=12]="TOP_END",t[t.BOTTOM_START=9]="BOTTOM_START",t[t.BOTTOM_END=13]="BOTTOM_END"}(h||(h={}));var T={LIST_ITEM_ACTIVATED_CLASS:"mdc-list-item--activated",LIST_ITEM_CLASS:"mdc-list-item",LIST_ITEM_DISABLED_CLASS:"mdc-list-item--disabled",LIST_ITEM_SELECTED_CLASS:"mdc-list-item--selected",LIST_ITEM_TEXT_CLASS:"mdc-list-item__text",LIST_ITEM_PRIMARY_TEXT_CLASS:"mdc-list-item__primary-text",ROOT:"mdc-list"},v={ACTION_EVENT:"MDCList:action",ARIA_CHECKED:"aria-checked",ARIA_CHECKED_CHECKBOX_SELECTOR:'[role="checkbox"][aria-checked="true"]',ARIA_CHECKED_RADIO_SELECTOR:'[role="radio"][aria-checked="true"]',ARIA_CURRENT:"aria-current",ARIA_DISABLED:"aria-disabled",ARIA_ORIENTATION:"aria-orientation",ARIA_ORIENTATION_HORIZONTAL:"horizontal",ARIA_ROLE_CHECKBOX_SELECTOR:'[role="checkbox"]',ARIA_SELECTED:"aria-selected",ARIA_INTERACTIVE_ROLES_SELECTOR:'[role="listbox"], [role="menu"]',ARIA_MULTI_SELECTABLE_SELECTOR:'[aria-multiselectable="true"]',CHECKBOX_RADIO_SELECTOR:'input[type="checkbox"], input[type="radio"]',CHECKBOX_SELECTOR:'input[type="checkbox"]',CHILD_ELEMENTS_TO_TOGGLE_TABINDEX:"button:not(:disabled), a",FOCUSABLE_CHILD_ELEMENTS:'button:not(:disabled), a, input[type="radio"]:not(:disabled), input[type="checkbox"]:not(:disabled)',RADIO_SELECTOR:'input[type="radio"]',SELECTED_ITEM_SELECTOR:'[aria-selected="true"], [aria-current="true"]'},b={UNSET_INDEX:-1,TYPEAHEAD_BUFFER_CLEAR_TIMEOUT_MS:300},S=((p={})[""+T.LIST_ITEM_ACTIVATED_CLASS]="mdc-evolution-list-item--activated",p[""+T.LIST_ITEM_CLASS]="mdc-evolution-list-item",p[""+T.LIST_ITEM_DISABLED_CLASS]="mdc-evolution-list-item--disabled",p[""+T.LIST_ITEM_SELECTED_CLASS]="mdc-evolution-list-item--selected",p[""+T.LIST_ITEM_PRIMARY_TEXT_CLASS]="mdc-evolution-list-item__primary-text",p[""+T.ROOT]="mdc-evolution-list",p),O="Backspace",L="Enter",x="Spacebar",R="PageUp",D="PageDown",w="End",N="Home",H="ArrowLeft",M="ArrowUp",P="ArrowRight",F="ArrowDown",k="Delete",B="Escape",V=new Set;V.add(O),V.add(L),V.add(x),V.add(R),V.add(D),V.add(w),V.add(N),V.add(H),V.add(M),V.add(P),V.add(F),V.add(k),V.add(B);var U=new Map;U.set(8,O),U.set(13,L),U.set(32,x),U.set(33,R),U.set(34,D),U.set(35,w),U.set(36,N),U.set(37,H),U.set(38,M),U.set(39,P),U.set(40,F),U.set(46,k),U.set(27,B);var j=new Set;function q(t){var e=t.key;return V.has(e)?e:U.get(t.keyCode)||"Unknown"}j.add(R),j.add(D),j.add(w),j.add(N),j.add(H),j.add(M),j.add(P),j.add(F);var G=["input","button","textarea","select"],W=function(t){var e=t.target;if(e){var n=(""+e.tagName).toLowerCase();-1===G.indexOf(n)&&t.preventDefault()}};function X(t,e){var n,i=t.nextChar,r=t.focusItemAtIndex,o=t.sortedIndexByFirstChar,a=t.focusedItemIndex,s=t.skipFocus,u=t.isItemAtIndexDisabled;return clearTimeout(e.bufferClearTimeout),e.bufferClearTimeout=setTimeout((function(){z(e)}),b.TYPEAHEAD_BUFFER_CLEAR_TIMEOUT_MS),e.typeaheadBuffer=e.typeaheadBuffer+i,-1===(n=1===e.typeaheadBuffer.length?function(t,e,n,i){var r=i.typeaheadBuffer[0],o=t.get(r);if(!o)return-1;if(r===i.currentFirstChar&&o[i.sortedIndexCursor].index===e){i.sortedIndexCursor=(i.sortedIndexCursor+1)%o.length;var a=o[i.sortedIndexCursor].index;if(!n(a))return a}i.currentFirstChar=r;var s,u=-1;for(s=0;s<o.length;s++)if(!n(o[s].index)){u=s;break}for(;s<o.length;s++)if(o[s].index>e&&!n(o[s].index)){u=s;break}return-1!==u?(i.sortedIndexCursor=u,o[i.sortedIndexCursor].index):-1}(o,a,u,e):function(t,e,n){var i=n.typeaheadBuffer[0],r=t.get(i);if(!r)return-1;var o=r[n.sortedIndexCursor];if(0===o.text.lastIndexOf(n.typeaheadBuffer,0)&&!e(o.index))return o.index;for(var a=(n.sortedIndexCursor+1)%r.length,s=-1;a!==n.sortedIndexCursor;){var u=r[a],c=0===u.text.lastIndexOf(n.typeaheadBuffer,0),d=!e(u.index);if(c&&d){s=a;break}a=(a+1)%r.length}return-1!==s?(n.sortedIndexCursor=s,r[n.sortedIndexCursor].index):-1}(o,u,e))||s||r(n),n}function K(t){return t.typeaheadBuffer.length>0}function z(t){t.typeaheadBuffer=""}function Y(t,e){var n=t.event,i=t.isTargetListItem,r=t.focusedItemIndex,o=t.focusItemAtIndex,a=t.sortedIndexByFirstChar,s=t.isItemAtIndexDisabled,u="ArrowLeft"===q(n),c="ArrowUp"===q(n),d="ArrowRight"===q(n),l="ArrowDown"===q(n),h="Home"===q(n),p="End"===q(n),f="Enter"===q(n),m="Spacebar"===q(n);return u||c||d||l||h||p||f?-1:m||1!==n.key.length?m?(i&&W(n),i&&K(e)?X({focusItemAtIndex:o,focusedItemIndex:r,nextChar:" ",sortedIndexByFirstChar:a,skipFocus:!1,isItemAtIndexDisabled:s},e):-1):-1:(W(n),X({focusItemAtIndex:o,focusedItemIndex:r,nextChar:n.key.toLowerCase(),sortedIndexByFirstChar:a,skipFocus:!1,isItemAtIndexDisabled:s},e))}var Q=function(t){function n(e){var r=t.call(this,i(i({},n.defaultAdapter),e))||this;return r.wrapFocus_=!1,r.isVertical_=!0,r.isSingleSelectionList_=!1,r.selectedIndex_=b.UNSET_INDEX,r.focusedItemIndex=b.UNSET_INDEX,r.useActivatedClass_=!1,r.useSelectedAttr_=!1,r.ariaCurrentAttrValue_=null,r.isCheckboxList_=!1,r.isRadioList_=!1,r.hasTypeahead=!1,r.typeaheadState={bufferClearTimeout:0,currentFirstChar:"",sortedIndexCursor:0,typeaheadBuffer:""},r.sortedIndexByFirstChar=new Map,r}return e(n,t),Object.defineProperty(n,"strings",{get:function(){return v},enumerable:!0,configurable:!0}),Object.defineProperty(n,"cssClasses",{get:function(){return T},enumerable:!0,configurable:!0}),Object.defineProperty(n,"numbers",{get:function(){return b},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addClassForElementIndex:function(){},focusItemAtIndex:function(){},getAttributeForElementIndex:function(){return null},getFocusedElementIndex:function(){return 0},getListItemCount:function(){return 0},hasCheckboxAtIndex:function(){return!1},hasRadioAtIndex:function(){return!1},isCheckboxCheckedAtIndex:function(){return!1},isFocusInsideList:function(){return!1},isRootFocused:function(){return!1},listItemAtIndexHasClass:function(){return!1},notifyAction:function(){},removeClassForElementIndex:function(){},setAttributeForElementIndex:function(){},setCheckedCheckboxOrRadioAtIndex:function(){},setTabIndexForListItemChildren:function(){},getPrimaryTextAtIndex:function(){return""}}},enumerable:!0,configurable:!0}),n.prototype.layout=function(){0!==this.adapter.getListItemCount()&&(this.adapter.hasCheckboxAtIndex(0)?this.isCheckboxList_=!0:this.adapter.hasRadioAtIndex(0)?this.isRadioList_=!0:this.maybeInitializeSingleSelection(),this.hasTypeahead&&(this.sortedIndexByFirstChar=this.typeaheadInitSortedIndex()))},n.prototype.setWrapFocus=function(t){this.wrapFocus_=t},n.prototype.setVerticalOrientation=function(t){this.isVertical_=t},n.prototype.setSingleSelection=function(t){this.isSingleSelectionList_=t,t&&this.maybeInitializeSingleSelection()},n.prototype.maybeInitializeSingleSelection=function(){for(var t=this.adapter.getListItemCount(),e=0;e<t;e++){var n=this.adapter.listItemAtIndexHasClass(e,T.LIST_ITEM_SELECTED_CLASS),i=this.adapter.listItemAtIndexHasClass(e,T.LIST_ITEM_ACTIVATED_CLASS);if(n||i)return i&&this.setUseActivatedClass(!0),this.isSingleSelectionList_=!0,void(this.selectedIndex_=e)}},n.prototype.setHasTypeahead=function(t){this.hasTypeahead=t,t&&(this.sortedIndexByFirstChar=this.typeaheadInitSortedIndex())},n.prototype.isTypeaheadInProgress=function(){return this.hasTypeahead&&K(this.typeaheadState)},n.prototype.setUseActivatedClass=function(t){this.useActivatedClass_=t},n.prototype.setUseSelectedAttribute=function(t){this.useSelectedAttr_=t},n.prototype.getSelectedIndex=function(){return this.selectedIndex_},n.prototype.setSelectedIndex=function(t){this.isIndexValid_(t)&&(this.isCheckboxList_?this.setCheckboxAtIndex_(t):this.isRadioList_?this.setRadioAtIndex_(t):this.setSingleSelectionAtIndex_(t))},n.prototype.handleFocusIn=function(t,e){e>=0&&(this.focusedItemIndex=e,this.adapter.setAttributeForElementIndex(e,"tabindex","0"),this.adapter.setTabIndexForListItemChildren(e,"0"))},n.prototype.handleFocusOut=function(t,e){var n=this;e>=0&&(this.adapter.setAttributeForElementIndex(e,"tabindex","-1"),this.adapter.setTabIndexForListItemChildren(e,"-1")),setTimeout((function(){n.adapter.isFocusInsideList()||n.setTabindexToFirstSelectedOrFocusedItem()}),0)},n.prototype.handleKeydown=function(t,e,n){var i=this,r="ArrowLeft"===q(t),o="ArrowUp"===q(t),a="ArrowRight"===q(t),s="ArrowDown"===q(t),u="Home"===q(t),c="End"===q(t),d="Enter"===q(t),l="Spacebar"===q(t),h="A"===t.key||"a"===t.key;if(this.adapter.isRootFocused())o||c?(t.preventDefault(),this.focusLastElement()):(s||u)&&(t.preventDefault(),this.focusFirstElement()),this.hasTypeahead&&Y({event:t,focusItemAtIndex:function(t){i.focusItemAtIndex(t)},focusedItemIndex:-1,isTargetListItem:e,sortedIndexByFirstChar:this.sortedIndexByFirstChar,isItemAtIndexDisabled:function(t){return i.adapter.listItemAtIndexHasClass(t,T.LIST_ITEM_DISABLED_CLASS)}},this.typeaheadState);else{var p=this.adapter.getFocusedElementIndex();if(!(-1===p&&(p=n)<0)){if(this.isVertical_&&s||!this.isVertical_&&a)W(t),this.focusNextElement(p);else if(this.isVertical_&&o||!this.isVertical_&&r)W(t),this.focusPrevElement(p);else if(u)W(t),this.focusFirstElement();else if(c)W(t),this.focusLastElement();else if(h&&t.ctrlKey&&this.isCheckboxList_)t.preventDefault(),this.toggleAll(this.selectedIndex_===b.UNSET_INDEX?[]:this.selectedIndex_);else if((d||l)&&e){var f=t.target;if(f&&"A"===f.tagName&&d)return;if(W(t),this.adapter.listItemAtIndexHasClass(p,T.LIST_ITEM_DISABLED_CLASS))return;this.isTypeaheadInProgress()||(this.isSelectableList_()&&this.setSelectedIndexOnAction_(p),this.adapter.notifyAction(p))}this.hasTypeahead&&Y({event:t,focusItemAtIndex:function(t){i.focusItemAtIndex(t)},focusedItemIndex:this.focusedItemIndex,isTargetListItem:e,sortedIndexByFirstChar:this.sortedIndexByFirstChar,isItemAtIndexDisabled:function(t){return i.adapter.listItemAtIndexHasClass(t,T.LIST_ITEM_DISABLED_CLASS)}},this.typeaheadState)}}},n.prototype.handleClick=function(t,e){t!==b.UNSET_INDEX&&(this.adapter.listItemAtIndexHasClass(t,T.LIST_ITEM_DISABLED_CLASS)||(this.isSelectableList_()&&this.setSelectedIndexOnAction_(t,e),this.adapter.notifyAction(t)))}
21471,n.prototype.focusNextElement=function(t){var e=t+1;if(e>=this.adapter.getListItemCount()){if(!this.wrapFocus_)return t;e=0}return this.focusItemAtIndex(e),e},n.prototype.focusPrevElement=function(t){var e=t-1;if(e<0){if(!this.wrapFocus_)return t;e=this.adapter.getListItemCount()-1}return this.focusItemAtIndex(e),e},n.prototype.focusFirstElement=function(){return this.focusItemAtIndex(0),0},n.prototype.focusLastElement=function(){var t=this.adapter.getListItemCount()-1;return this.focusItemAtIndex(t),t},n.prototype.focusInitialElement=function(){var t=this.getFirstSelectedOrFocusedItemIndex();return this.focusItemAtIndex(t),t},n.prototype.setEnabled=function(t,e){this.isIndexValid_(t)&&(e?(this.adapter.removeClassForElementIndex(t,T.LIST_ITEM_DISABLED_CLASS),this.adapter.setAttributeForElementIndex(t,v.ARIA_DISABLED,"false")):(this.adapter.addClassForElementIndex(t,T.LIST_ITEM_DISABLED_CLASS),this.adapter.setAttributeForElementIndex(t,v.ARIA_DISABLED,"true")))},n.prototype.setSingleSelectionAtIndex_=function(t){if(this.selectedIndex_!==t){var e=T.LIST_ITEM_SELECTED_CLASS;this.useActivatedClass_&&(e=T.LIST_ITEM_ACTIVATED_CLASS),this.selectedIndex_!==b.UNSET_INDEX&&this.adapter.removeClassForElementIndex(this.selectedIndex_,e),this.setAriaForSingleSelectionAtIndex_(t),this.setTabindexAtIndex(t),t!==b.UNSET_INDEX&&this.adapter.addClassForElementIndex(t,e),this.selectedIndex_=t}},n.prototype.setAriaForSingleSelectionAtIndex_=function(t){this.selectedIndex_===b.UNSET_INDEX&&(this.ariaCurrentAttrValue_=this.adapter.getAttributeForElementIndex(t,v.ARIA_CURRENT));var e=null!==this.ariaCurrentAttrValue_,n=e?v.ARIA_CURRENT:v.ARIA_SELECTED;if(this.selectedIndex_!==b.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(this.selectedIndex_,n,"false"),t!==b.UNSET_INDEX){var i=e?this.ariaCurrentAttrValue_:"true";this.adapter.setAttributeForElementIndex(t,n,i)}},n.prototype.getSelectionAttribute=function(){return this.useSelectedAttr_?v.ARIA_SELECTED:v.ARIA_CHECKED},n.prototype.setRadioAtIndex_=function(t){var e=this.getSelectionAttribute();this.adapter.setCheckedCheckboxOrRadioAtIndex(t,!0),this.selectedIndex_!==b.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(this.selectedIndex_,e,"false"),this.adapter.setAttributeForElementIndex(t,e,"true"),this.selectedIndex_=t},n.prototype.setCheckboxAtIndex_=function(t){for(var e=this.getSelectionAttribute(),n=0;n<this.adapter.getListItemCount();n++){var i=!1;t.indexOf(n)>=0&&(i=!0),this.adapter.setCheckedCheckboxOrRadioAtIndex(n,i),this.adapter.setAttributeForElementIndex(n,e,i?"true":"false")}this.selectedIndex_=t},n.prototype.setTabindexAtIndex=function(t){this.focusedItemIndex===b.UNSET_INDEX&&0!==t?this.adapter.setAttributeForElementIndex(0,"tabindex","-1"):this.focusedItemIndex>=0&&this.focusedItemIndex!==t&&this.adapter.setAttributeForElementIndex(this.focusedItemIndex,"tabindex","-1"),this.selectedIndex_ instanceof Array||this.selectedIndex_===t||this.adapter.setAttributeForElementIndex(this.selectedIndex_,"tabindex","-1"),t!==b.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(t,"tabindex","0")},n.prototype.isSelectableList_=function(){return this.isSingleSelectionList_||this.isCheckboxList_||this.isRadioList_},n.prototype.setTabindexToFirstSelectedOrFocusedItem=function(){var t=this.getFirstSelectedOrFocusedItemIndex();this.setTabindexAtIndex(t)},n.prototype.getFirstSelectedOrFocusedItemIndex=function(){var t=this.focusedItemIndex>=0?this.focusedItemIndex:0;return this.isSelectableList_()&&("number"==typeof this.selectedIndex_&&this.selectedIndex_!==b.UNSET_INDEX?t=this.selectedIndex_:this.selectedIndex_ instanceof Array&&this.selectedIndex_.length>0&&(t=this.selectedIndex_.reduce((function(t,e){return Math.min(t,e)})))),t},n.prototype.isIndexValid_=function(t){var e=this;if(t instanceof Array){if(!this.isCheckboxList_)throw new Error("MDCListFoundation: Array of index is only supported for checkbox based list");return 0===t.length||t.some((function(t){return e.isIndexInRange_(t)}))}if("number"==typeof t){if(this.isCheckboxList_)throw new Error("MDCListFoundation: Expected array of index for checkbox based list but got number: "+t);return this.isIndexInRange_(t)||this.isSingleSelectionList_&&t===b.UNSET_INDEX}return!1},n.prototype.isIndexInRange_=function(t){var e=this.adapter.getListItemCount();return t>=0&&t<e},n.prototype.setSelectedIndexOnAction_=function(t,e){void 0===e&&(e=!0),this.isCheckboxList_?this.toggleCheckboxAtIndex_(t,e):this.setSelectedIndex(t)},n.prototype.toggleCheckboxAtIndex_=function(t,e){var n=this.getSelectionAttribute(),i=this.adapter.isCheckboxCheckedAtIndex(t);e&&(i=!i,this.adapter.setCheckedCheckboxOrRadioAtIndex(t,i)),this.adapter.setAttributeForElementIndex(t,n,i?"true":"false");var r=this.selectedIndex_===b.UNSET_INDEX?[]:this.selectedIndex_.slice();i?r.push(t):r=r.filter((function(e){return e!==t})),this.selectedIndex_=r}
vendor: 9,269 bytes, line 21471
21471,n.prototype.focusItemAtIndex=function(t){this.adapter.focusItemAtIndex(t),this.focusedItemIndex=t},n.prototype.toggleAll=function(t){var e=this.adapter.getListItemCount();if(t.length===e)this.setCheckboxAtIndex_([]);else{for(var n=[],i=0;i<e;i++)(!this.adapter.listItemAtIndexHasClass(i,T.LIST_ITEM_DISABLED_CLASS)||t.indexOf(i)>-1)&&n.push(i);this.setCheckboxAtIndex_(n)}},n.prototype.typeaheadMatchItem=function(t,e,n){var i=this;return void 0===n&&(n=!1),X({focusItemAtIndex:function(t){i.focusItemAtIndex(t)},focusedItemIndex:e||this.focusedItemIndex,nextChar:t,sortedIndexByFirstChar:this.sortedIndexByFirstChar,skipFocus:n,isItemAtIndexDisabled:function(t){return i.adapter.listItemAtIndexHasClass(t,T.LIST_ITEM_DISABLED_CLASS)}},this.typeaheadState)},n.prototype.typeaheadInitSortedIndex=function(){return function(t,e){for(var n=new Map,i=0;i<t;i++){var r=e(i).trim();if(r){var o=r[0].toLowerCase();n.has(o)||n.set(o,[]),n.get(o).push({text:r.toLowerCase(),index:i})}}return n.forEach((function(t){t.sort((function(t,e){return t.index-e.index}))})),n}(this.adapter.getListItemCount(),this.adapter.getPrimaryTextAtIndex)},n.prototype.clearTypeaheadBuffer=function(){z(this.typeaheadState)},n}(s),Z=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),Object.defineProperty(n.prototype,"vertical",{set:function(t){this.foundation.setVerticalOrientation(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"listElements",{get:function(){return Array.from(this.root.querySelectorAll("."+this.classNameMap[T.LIST_ITEM_CLASS]))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"wrapFocus",{set:function(t){this.foundation.setWrapFocus(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"typeaheadInProgress",{get:function(){return this.foundation.isTypeaheadInProgress()},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"hasTypeahead",{set:function(t){this.foundation.setHasTypeahead(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"singleSelection",{set:function(t){this.foundation.setSingleSelection(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"selectedIndex",{get:function(){return this.foundation.getSelectedIndex()},set:function(t){this.foundation.setSelectedIndex(t)},enumerable:!0,configurable:!0}),n.attachTo=function(t){return new n(t)},n.prototype.initialSyncWithDOM=function(){this.isEvolutionEnabled="evolution"in this.root.dataset,this.classNameMap=this.isEvolutionEnabled?S:Object.values(T).reduce((function(t,e){return t[e]=e,t}),{}),this.handleClick=this.handleClickEvent.bind(this),this.handleKeydown=this.handleKeydownEvent.bind(this),this.focusInEventListener=this.handleFocusInEvent.bind(this),this.focusOutEventListener=this.handleFocusOutEvent.bind(this),this.listen("keydown",this.handleKeydown),this.listen("click",this.handleClick),this.listen("focusin",this.focusInEventListener),this.listen("focusout",this.focusOutEventListener),this.layout(),this.initializeListType(),this.ensureFocusable()},n.prototype.destroy=function(){this.unlisten("keydown",this.handleKeydown),this.unlisten("click",this.handleClick),this.unlisten("focusin",this.focusInEventListener),this.unlisten("focusout",this.focusOutEventListener)},n.prototype.layout=function(){var t=this.root.getAttribute(v.ARIA_ORIENTATION);this.vertical=t!==v.ARIA_ORIENTATION_HORIZONTAL;var e="."+this.classNameMap[T.LIST_ITEM_CLASS]+":not([tabindex])",n="."+this.classNameMap[T.LIST_ITEM_CLASS]+" "+v.FOCUSABLE_CHILD_ELEMENTS;Array.prototype.forEach.call(this.root.querySelectorAll(e),(function(t){t.setAttribute("tabindex","-1")})),Array.prototype.forEach.call(this.root.querySelectorAll(n),(function(t){t.setAttribute("tabindex","-1")})),this.isEvolutionEnabled&&this.foundation.setUseSelectedAttribute(!0),this.foundation.layout()},n.prototype.getPrimaryText=function(t){var e,n=t.querySelector("."+this.classNameMap[T.LIST_ITEM_PRIMARY_TEXT_CLASS]);if(this.isEvolutionEnabled||n)return null!==(e=null==n?void 0:n.textContent)&&void 0!==e?e:"";var i=t.querySelector("."+this.classNameMap[T.LIST_ITEM_TEXT_CLASS]);return i&&i.textContent||""},n.prototype.initializeListType=function(){var t=this;if(this.isInteractive=d(this.root,v.ARIA_INTERACTIVE_ROLES_SELECTOR),this.isEvolutionEnabled&&this.isInteractive){var e=Array.from(this.root.querySelectorAll(v.SELECTED_ITEM_SELECTOR),(function(e){return t.listElements.indexOf(e)}));d(this.root,v.ARIA_MULTI_SELECTABLE_SELECTOR)?this.selectedIndex=e:e.length>0&&(this.selectedIndex=e[0])}else{var n=this.root.querySelectorAll(v.ARIA_ROLE_CHECKBOX_SELECTOR),i=this.root.querySelector(v.ARIA_CHECKED_RADIO_SELECTOR);if(n.length){var r=this.root.querySelectorAll(v.ARIA_CHECKED_CHECKBOX_SELECTOR);this.selectedIndex=Array.from(r,(function(e){return t.listElements.indexOf(e)}))}else i&&(this.selectedIndex=this.listElements.indexOf(i))}},n.prototype.setEnabled=function(t,e){this.foundation.setEnabled(t,e)},n.prototype.typeaheadMatchItem=function(t,e){return this.foundation.typeaheadMatchItem(t,e,!0)},n.prototype.getDefaultFoundation=function(){var t=this;return new Q({addClassForElementIndex:function(e,n){var i=t.listElements[e];i&&i.classList.add(t.classNameMap[n])},focusItemAtIndex:function(e){var n=t.listElements[e];n&&n.focus()},getAttributeForElementIndex:function(e,n){return t.listElements[e].getAttribute(n)},getFocusedElementIndex:function(){return t.listElements.indexOf(document.activeElement)},getListItemCount:function(){return t.listElements.length},getPrimaryTextAtIndex:function(e){return t.getPrimaryText(t.listElements[e])},hasCheckboxAtIndex:function(e){return!!t.listElements[e].querySelector(v.CHECKBOX_SELECTOR)},hasRadioAtIndex:function(e){return!!t.listElements[e].querySelector(v.RADIO_SELECTOR)},isCheckboxCheckedAtIndex:function(e){return t.listElements[e].querySelector(v.CHECKBOX_SELECTOR).checked},isFocusInsideList:function(){return t.root!==document.activeElement&&t.root.contains(document.activeElement)},isRootFocused:function(){return document.activeElement===t.root},listItemAtIndexHasClass:function(e,n){return t.listElements[e].classList.contains(t.classNameMap[n])},notifyAction:function(e){t.emit(v.ACTION_EVENT,{index:e},!0)},removeClassForElementIndex:function(e,n){var i=t.listElements[e];i&&i.classList.remove(t.classNameMap[n])},setAttributeForElementIndex:function(e,n,i){var r=t.listElements[e];r&&r.setAttribute(n,i)},setCheckedCheckboxOrRadioAtIndex:function(e,n){var i=t.listElements[e].querySelector(v.CHECKBOX_RADIO_SELECTOR);i.checked=n;var r=document.createEvent("Event");r.initEvent("change",!0,!0),i.dispatchEvent(r)},setTabIndexForListItemChildren:function(e,n){var i=t.listElements[e],r="."+t.classNameMap[T.LIST_ITEM_CLASS]+" "+v.CHILD_ELEMENTS_TO_TOGGLE_TABINDEX;Array.prototype.forEach.call(i.querySelectorAll(r),(function(t){t.setAttribute("tabindex",n)}))}})},n.prototype.ensureFocusable=function(){if(this.isEvolutionEnabled&&this.isInteractive&&!this.root.querySelector("."+this.classNameMap[T.LIST_ITEM_CLASS]+'[tabindex="0"]')){var t=this.initialFocusIndex();-1!==t&&(this.listElements[t].tabIndex=0)}},n.prototype.initialFocusIndex=function(){if(this.selectedIndex instanceof Array&&this.selectedIndex.length>0)return this.selectedIndex[0];if("number"==typeof this.selectedIndex&&this.selectedIndex!==b.UNSET_INDEX)return this.selectedIndex;var t=this.root.querySelector("."+this.classNameMap[T.LIST_ITEM_CLASS]+":not(."+this.classNameMap[T.LIST_ITEM_DISABLED_CLASS]+")");return null===t?-1:this.getListItemIndex(t)},n.prototype.getListItemIndex=function(t){var e=c(t,"."+this.classNameMap[T.LIST_ITEM_CLASS]+", ."+this.classNameMap[T.ROOT]);return e&&d(e,"."+this.classNameMap[T.LIST_ITEM_CLASS])?this.listElements.indexOf(e):-1},n.prototype.handleFocusInEvent=function(t){var e=this.getListItemIndex(t.target);this.foundation.handleFocusIn(t,e)},n.prototype.handleFocusOutEvent=function(t){var e=this.getListItemIndex(t.target);this.foundation.handleFocusOut(t,e)},n.prototype.handleKeydownEvent=function(t){var e=this.getListItemIndex(t.target),n=t.target;this.foundation.handleKeydown(t,n.classList.contains(this.classNameMap[T.LIST_ITEM_CLASS]),e)},n.prototype.handleClickEvent=function(t){var e=this.getListItemIndex(t.target),n=!d(t.target,v.CHECKBOX_RADIO_SELECTOR);this.foundation.handleClick(e,n)},n}(u),$=function(t){function n(e){var r=t.call(this,i(i({},n.defaultAdapter),e))||this;return r.isSurfaceOpen=!1,r.isQuickOpen=!1,r.isHoistedElement=!1,r.isFixedPosition=!1,r.openAnimationEndTimerId=0,r.closeAnimationEndTimerId=0,r.animationRequestId=0,r.anchorCorner=h.TOP_START,r.originCorner=h.TOP_START,r.anchorMargin={top:0,right:0,bottom:0,left:0},r.position={x:0,y:0},r}return e(n,t),Object.defineProperty(n,"cssClasses",{get:function(){return g},enumerable:!0,configurable:!0}),Object.defineProperty(n,"strings",{get:function(){return C},enumerable:!0,configurable:!0}),Object.defineProperty(n,"numbers",{get:function(){return A},enumerable:!0,configurable:!0}),Object.defineProperty(n,"Corner",{get:function(){return h},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1}
vendor: 18,421 bytes, line 21471
21471,hasAnchor:function(){return!1},isElementInContainer:function(){return!1},isFocused:function(){return!1},isRtl:function(){return!1},getInnerDimensions:function(){return{height:0,width:0}},getAnchorDimensions:function(){return null},getWindowDimensions:function(){return{height:0,width:0}},getBodyDimensions:function(){return{height:0,width:0}},getWindowScroll:function(){return{x:0,y:0}},setPosition:function(){},setMaxHeight:function(){},setTransformOrigin:function(){},saveFocus:function(){},restoreFocus:function(){},notifyClose:function(){},notifyOpen:function(){},notifyClosing:function(){}}},enumerable:!0,configurable:!0}),n.prototype.init=function(){var t=n.cssClasses,e=t.ROOT,i=t.OPEN;if(!this.adapter.hasClass(e))throw new Error(e+" class required in root element.");this.adapter.hasClass(i)&&(this.isSurfaceOpen=!0)},n.prototype.destroy=function(){clearTimeout(this.openAnimationEndTimerId),clearTimeout(this.closeAnimationEndTimerId),cancelAnimationFrame(this.animationRequestId)},n.prototype.setAnchorCorner=function(t){this.anchorCorner=t},n.prototype.flipCornerHorizontally=function(){this.originCorner=this.originCorner^l.RIGHT},n.prototype.setAnchorMargin=function(t){this.anchorMargin.top=t.top||0,this.anchorMargin.right=t.right||0,this.anchorMargin.bottom=t.bottom||0,this.anchorMargin.left=t.left||0},n.prototype.setIsHoisted=function(t){this.isHoistedElement=t},n.prototype.setFixedPosition=function(t){this.isFixedPosition=t},n.prototype.setAbsolutePosition=function(t,e){this.position.x=this.isFinite(t)?t:0,this.position.y=this.isFinite(e)?e:0},n.prototype.setQuickOpen=function(t){this.isQuickOpen=t},n.prototype.isOpen=function(){return this.isSurfaceOpen},n.prototype.open=function(){var t=this;this.isSurfaceOpen||(this.adapter.saveFocus(),this.isQuickOpen?(this.isSurfaceOpen=!0,this.adapter.addClass(n.cssClasses.OPEN),this.dimensions=this.adapter.getInnerDimensions(),this.autoposition(),this.adapter.notifyOpen()):(this.adapter.addClass(n.cssClasses.ANIMATING_OPEN),this.animationRequestId=requestAnimationFrame((function(){t.adapter.addClass(n.cssClasses.OPEN),t.dimensions=t.adapter.getInnerDimensions(),t.autoposition(),t.openAnimationEndTimerId=setTimeout((function(){t.openAnimationEndTimerId=0,t.adapter.removeClass(n.cssClasses.ANIMATING_OPEN),t.adapter.notifyOpen()}),A.TRANSITION_OPEN_DURATION)})),this.isSurfaceOpen=!0))},n.prototype.close=function(t){var e=this;if(void 0===t&&(t=!1),this.isSurfaceOpen){if(this.adapter.notifyClosing(),this.isQuickOpen)return this.isSurfaceOpen=!1,t||this.maybeRestoreFocus(),this.adapter.removeClass(n.cssClasses.OPEN),this.adapter.removeClass(n.cssClasses.IS_OPEN_BELOW),void this.adapter.notifyClose();this.adapter.addClass(n.cssClasses.ANIMATING_CLOSED),requestAnimationFrame((function(){e.adapter.removeClass(n.cssClasses.OPEN),e.adapter.removeClass(n.cssClasses.IS_OPEN_BELOW),e.closeAnimationEndTimerId=setTimeout((function(){e.closeAnimationEndTimerId=0,e.adapter.removeClass(n.cssClasses.ANIMATING_CLOSED),e.adapter.notifyClose()}),A.TRANSITION_CLOSE_DURATION)})),this.isSurfaceOpen=!1,t||this.maybeRestoreFocus()}},n.prototype.handleBodyClick=function(t){var e=t.target;this.adapter.isElementInContainer(e)||this.close()},n.prototype.handleKeydown=function(t){var e=t.keyCode;("Escape"===t.key||27===e)&&this.close()},n.prototype.autoposition=function(){var t;this.measurements=this.getAutoLayoutmeasurements();var e=this.getoriginCorner(),i=this.getMenuSurfaceMaxHeight(e),r=this.hasBit(e,l.BOTTOM)?"bottom":"top",o=this.hasBit(e,l.RIGHT)?"right":"left",a=this.getHorizontalOriginOffset(e),s=this.getVerticalOriginOffset(e),u=this.measurements,c=u.anchorSize,d=u.surfaceSize,h=((t={})[o]=a,t[r]=s,t);c.width/d.width>A.ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO&&(o="center"),(this.isHoistedElement||this.isFixedPosition)&&this.adjustPositionForHoistedElement(h),this.adapter.setTransformOrigin(o+" "+r),this.adapter.setPosition(h),this.adapter.setMaxHeight(i?i+"px":""),this.hasBit(e,l.BOTTOM)||this.adapter.addClass(n.cssClasses.IS_OPEN_BELOW)},n.prototype.getAutoLayoutmeasurements=function(){var t=this.adapter.getAnchorDimensions(),e=this.adapter.getBodyDimensions(),n=this.adapter.getWindowDimensions(),i=this.adapter.getWindowScroll();return t||(t={top:this.position.y,right:this.position.x,bottom:this.position.y,left:this.position.x,width:0,height:0}),{anchorSize:t,bodySize:e,surfaceSize:this.dimensions,viewportDistance:{top:t.top,right:n.width-t.right,bottom:n.height-t.bottom,left:t.left},viewportSize:n,windowScroll:i}},n.prototype.getoriginCorner=function(){var t,e,i=this.originCorner,r=this.measurements,o=r.viewportDistance,a=r.anchorSize,s=r.surfaceSize,u=n.numbers.MARGIN_TO_EDGE;this.hasBit(this.anchorCorner,l.BOTTOM)?(t=o.top-u+this.anchorMargin.bottom,e=o.bottom-u-this.anchorMargin.bottom):(t=o.top-u+this.anchorMargin.top,e=o.bottom-u+a.height-this.anchorMargin.top),!(e-s.height>0)&&t>e&&(i=this.setBit(i,l.BOTTOM));var c,d,h,p=this.adapter.isRtl(),f=this.hasBit(this.anchorCorner,l.FLIP_RTL),m=this.hasBit(this.anchorCorner,l.RIGHT)||this.hasBit(i,l.RIGHT);(h=p&&f?!m:m)?(c=o.left+a.width+this.anchorMargin.right,d=o.right-this.anchorMargin.right):(c=o.left+this.anchorMargin.left,d=o.right+a.width-this.anchorMargin.left);var E=c-s.width>0,I=d-s.width>0,_=this.hasBit(i,l.FLIP_RTL)&&this.hasBit(i,l.RIGHT);return I&&_&&p||!E&&_?i=this.unsetBit(i,l.RIGHT):(E&&h&&p||E&&!h&&m||!I&&c>=d)&&(i=this.setBit(i,l.RIGHT)),i},n.prototype.getMenuSurfaceMaxHeight=function(t){var e=this.measurements.viewportDistance,i=0,r=this.hasBit(t,l.BOTTOM),o=this.hasBit(this.anchorCorner,l.BOTTOM),a=n.numbers.MARGIN_TO_EDGE;return r?(i=e.top+this.anchorMargin.top-a,o||(i+=this.measurements.anchorSize.height)):(i=e.bottom-this.anchorMargin.bottom+this.measurements.anchorSize.height-a,o&&(i-=this.measurements.anchorSize.height)),i},n.prototype.getHorizontalOriginOffset=function(t){var e=this.measurements.anchorSize,n=this.hasBit(t,l.RIGHT),i=this.hasBit(this.anchorCorner,l.RIGHT);if(n){var r=i?e.width-this.anchorMargin.left:this.anchorMargin.right;return this.isHoistedElement||this.isFixedPosition?r-(this.measurements.viewportSize.width-this.measurements.bodySize.width):r}return i?e.width-this.anchorMargin.right:this.anchorMargin.left},n.prototype.getVerticalOriginOffset=function(t){var e=this.measurements.anchorSize,n=this.hasBit(t,l.BOTTOM),i=this.hasBit(this.anchorCorner,l.BOTTOM);return n?i?e.height-this.anchorMargin.top:-this.anchorMargin.bottom:i?e.height+this.anchorMargin.bottom:this.anchorMargin.top},n.prototype.adjustPositionForHoistedElement=function(t){var e,n,i=this.measurements,o=i.windowScroll,a=i.viewportDistance,s=Object.keys(t);try{for(var u=r(s),c=u.next();!c.done;c=u.next()){var d=c.value,l=t[d]||0;l+=a[d],this.isFixedPosition||("top"===d?l+=o.y:"bottom"===d?l-=o.y:"left"===d?l+=o.x:l-=o.x),t[d]=l}}catch(t){e={error:t}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(e)throw e.error}}},n.prototype.maybeRestoreFocus=function(){var t=this.adapter.isFocused(),e=document.activeElement&&this.adapter.isElementInContainer(document.activeElement);(t||e)&&this.adapter.restoreFocus()},n.prototype.hasBit=function(t,e){return Boolean(t&e)},n.prototype.setBit=function(t,e){return t|e},n.prototype.unsetBit=function(t,e){return t^e},n.prototype.isFinite=function(t){return"number"==typeof t&&isFinite(t)},n}(s),J={animation:{prefixed:"-webkit-animation",standard:"animation"},transform:{prefixed:"-webkit-transform",standard:"transform"},transition:{prefixed:"-webkit-transition",standard:"transition"}},tt={animationend:{cssProperty:"animation",prefixed:"webkitAnimationEnd",standard:"animationend"},animationiteration:{cssProperty:"animation",prefixed:"webkitAnimationIteration",standard:"animationiteration"},animationstart:{cssProperty:"animation",prefixed:"webkitAnimationStart",standard:"animationstart"},transitionend:{cssProperty:"transition",prefixed:"webkitTransitionEnd",standard:"transitionend"}};function et(t){return Boolean(t.document)&&"function"==typeof t.document.createElement}function nt(t,e){if(et(t)&&e in J){var n=t.document.createElement("div"),i=J[e],r=i.standard,o=i.prefixed;return r in n.style?r:o}return e}function it(t,e){if(et(t)&&e in tt){var n=t.document.createElement("div"),i=tt[e],r=i.standard,o=i.prefixed;return i.cssProperty in n.style?r:o}return e}var rt,ot=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.attachTo=function(t){return new n(t)},n.prototype.initialSyncWithDOM=function(){var t=this,e=this.root.parentElement;this.anchorElement=e&&e.classList.contains(g.ANCHOR)?e:null,this.root.classList.contains(g.FIXED)&&this.setFixedPosition(!0),this.handleKeydown=function(e){t.foundation.handleKeydown(e)},this.handleBodyClick=function(e){t.foundation.handleBodyClick(e)},this.registerBodyClickListener=function(){document.body.addEventListener("click",t.handleBodyClick,{capture:!0})},this.deregisterBodyClickListener=function(){document.body.removeEventListener("click",t.handleBodyClick,{capture:!0})},this.listen("keydown",this.handleKeydown),this.listen(C.OPENED_EVENT,this.registerBodyClickListener),this.listen(C.CLOSED_EVENT,this.deregisterBodyClickListener)},n.prototype.destroy=function(){this.unlisten("keydown",this.handleKeydown),this.unlisten(C.OPENED_EVENT,this.registerBodyClickListener),this.unlisten(C.CLOSED_EVENT,this.deregisterBodyClickListener),t.prototype.destroy.call(this)},n.prototype.isOpen=function(){return this.foundation.isOpen()},n.prototype.open=function(){this.foundation.open()},n.prototype.close=function(t){void 0===t&&(t=!1),this.foundation.close(t)},Object.defineProperty(n.prototype,"quickOpen",{set:function(t){this.foundation.setQuickOpen(t)},enumerable:!0,configurable:!0}),n.prototype.setIsHoisted=function(t){this.foundation.setIsHoisted(t)},n.prototype.setMenuSurfaceAnchorElement=function(t){this.anchorElement=t},n.prototype.setFixedPosition=function(t){t?this.root.classList.add(g.FIXED):this.root.classList.remove(g.FIXED),this.foundation.setFixedPosition(t)},n.prototype.setAbsolutePosition=function(t,e){this.foundation.setAbsolutePosition(t,e),this.setIsHoisted(!0)},n.prototype.setAnchorCorner=function(t){this.foundation.setAnchorCorner(t)},n.prototype.setAnchorMargin=function(t){this.foundation.setAnchorMargin(t)},n.prototype.getDefaultFoundation=function(){var t=this;return new $({addClass:function(e){return t.root.classList.add(e)},removeClass:function(e){return t.root.classList.remove(e)},hasClass:function(e){return t.root.classList.contains(e)},hasAnchor:function(){return!!t.anchorElement},notifyClose:function(){return t.emit($.strings.CLOSED_EVENT,{})},notifyClosing:function(){t.emit($.strings.CLOSING_EVENT,{})},notifyOpen:function(){return t.emit($.strings.OPENED_EVENT,{})},isElementInContainer:function(e){return t.root.contains(e)},isRtl:function(){return"rtl"===getComputedStyle(t.root).getPropertyValue("direction")},setTransformOrigin:function(e){var n=nt(window,"transform")+"-origin";t.root.style.setProperty(n,e)},isFocused:function(){return document.activeElement===t.root},saveFocus:function(){t.previousFocus=document.activeElement},restoreFocus:function(){t.root.contains(document.activeElement)&&t.previousFocus&&t.previousFocus.focus&&t.previousFocus.focus()},getInnerDimensions:function(){return{width:t.root.offsetWidth,height:t.root.offsetHeight}},getAnchorDimensions:function(){return t.anchorElement?t.anchorElement.getBoundingClientRect():null},getWindowDimensions:function(){return{width:window.innerWidth,height:window.innerHeight}},getBodyDimensions:function(){return{width:document.body.clientWidth,height:document.body.clientHeight}},getWindowScroll:function(){return{x:window.pageXOffset,y:window.pageYOffset}},setPosition:function(e){var n=t.root;n.style.left="left"in e?e.left+"px":"",n.style.right="right"in e?e.right+"px":"",n.style.top="top"in e?e.top+"px":"",n.style.bottom="bottom"in e?e.bottom+"px":""},setMaxHeight:function(e){t.root.style.maxHeight=e}})},n}(u),at={MENU_SELECTED_LIST_ITEM:"mdc-menu-item--selected",MENU_SELECTION_GROUP:"mdc-menu__selection-group",ROOT:"mdc-menu"},st={ARIA_CHECKED_ATTR:"aria-checked",ARIA_DISABLED_ATTR:"aria-disabled",CHECKBOX_SELECTOR:'input[type="checkbox"]',LIST_SELECTOR:".mdc-list",SELECTED_EVENT:"MDCMenu:selected"},ut={FOCUS_ROOT_INDEX:-1};!function(t){t[t.NONE=0]="NONE",t[t.LIST_ROOT=1]="LIST_ROOT",t[t.FIRST_ITEM=2]="FIRST_ITEM",t[t.LAST_ITEM=3]="LAST_ITEM"}(rt||(rt={}));var ct=function(t){function n(e){var r=t.call(this,i(i({},n.defaultAdapter),e))||this;return r.closeAnimationEndTimerId_=0,r.defaultFocusState_=rt.LIST_ROOT,r}return e(n,t),Object.defineProperty(n,"cssClasses",{get:function(){return at},enumerable:!0,configurable:!0}),Object.defineProperty(n,"strings",{get:function(){return st},enumerable:!0,configurable:!0}),Object.defineProperty(n,"numbers",{get:function(){return ut},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addClassToElementAtIndex:function(){},removeClassFromElementAtIndex:function(){},addAttributeToElementAtIndex:function(){},removeAttributeFromElementAtIndex:function(){},elementContainsClass:function(){return!1},closeSurface:function(){},getElementIndex:function(){return-1},notifySelected:function(){},getMenuItemCount:function(){return 0},focusItemAtIndex:function(){},focusListRoot:function(){},getSelectedSiblingOfItemAtIndex:function(){return-1},isSelectableItemAtIndex:function(){return!1}}},enumerable:!0,configurable:!0}),n.prototype.destroy=function(){this.closeAnimationEndTimerId_&&clearTimeout(this.closeAnimationEndTimerId_),this.adapter.closeSurface()},n.prototype.handleKeydown=function(t){var e=t.key,n=t.keyCode;("Tab"===e||9===n)&&this.adapter.closeSurface(!0)},n.prototype.handleItemAction=function(t){var e=this,n=this.adapter.getElementIndex(t);n<0||(this.adapter.notifySelected({index:n}),this.adapter.closeSurface(),this.closeAnimationEndTimerId_=setTimeout((function(){var n=e.adapter.getElementIndex(t);n>=0&&e.adapter.isSelectableItemAtIndex(n)&&e.setSelectedIndex(n)}),$.numbers.TRANSITION_CLOSE_DURATION))},n.prototype.handleMenuSurfaceOpened=function(){switch(this.defaultFocusState_){case rt.FIRST_ITEM:this.adapter.focusItemAtIndex(0);break;case rt.LAST_ITEM:this.adapter.focusItemAtIndex(this.adapter.getMenuItemCount()-1);break;case rt.NONE:break;default:this.adapter.focusListRoot()}},n.prototype.setDefaultFocusState=function(t){this.defaultFocusState_=t},n.prototype.setSelectedIndex=function(t){if(this.validatedIndex_(t),!this.adapter.isSelectableItemAtIndex(t))throw new Error("MDCMenuFoundation: No selection group at specified index.");var e=this.adapter.getSelectedSiblingOfItemAtIndex(t);e>=0&&(this.adapter.removeAttributeFromElementAtIndex(e,st.ARIA_CHECKED_ATTR),this.adapter.removeClassFromElementAtIndex(e,at.MENU_SELECTED_LIST_ITEM)),this.adapter.addClassToElementAtIndex(t,at.MENU_SELECTED_LIST_ITEM),this.adapter.addAttributeToElementAtIndex(t,st.ARIA_CHECKED_ATTR,"true")},n.prototype.setEnabled=function(t,e){this.validatedIndex_(t),e?(this.adapter.removeClassFromElementAtIndex(t,T.LIST_ITEM_DISABLED_CLASS),this.adapter.addAttributeToElementAtIndex(t,st.ARIA_DISABLED_ATTR,"false")):(this.adapter.addClassToElementAtIndex(t,T.LIST_ITEM_DISABLED_CLASS),this.adapter.addAttributeToElementAtIndex(t,st.ARIA_DISABLED_ATTR,"true"))},n.prototype.validatedIndex_=function(t){var e=this.adapter.getMenuItemCount();if(!(t>=0&&t<e))throw new Error("MDCMenuFoundation: No list item at specified index.")},n}(s),dt=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.attachTo=function(t){return new n(t)},n.prototype.initialize=function(t,e){void 0===t&&(t=function(t){return new ot(t)}),void 0===e&&(e=function(t){return new Z(t)}),this.menuSurfaceFactory_=t,this.listFactory_=e},n.prototype.initialSyncWithDOM=function(){var t=this;this.menuSurface_=this.menuSurfaceFactory_(this.root);var e=this.root.querySelector(st.LIST_SELECTOR);e?(this.list_=this.listFactory_(e),this.list_.wrapFocus=!0):this.list_=null,this.handleKeydown_=function(e){return t.foundation.handleKeydown(e)},this.handleItemAction_=function(e){return t.foundation.handleItemAction(t.items[e.detail.index])},this.handleMenuSurfaceOpened_=function(){return t.foundation.handleMenuSurfaceOpened()},this.menuSurface_.listen($.strings.OPENED_EVENT,this.handleMenuSurfaceOpened_),this.listen("keydown",this.handleKeydown_),this.listen(Q.strings.ACTION_EVENT,this.handleItemAction_)},n.prototype.destroy=function(){this.list_&&this.list_.destroy(),this.menuSurface_.destroy(),this.menuSurface_.unlisten($.strings.OPENED_EVENT,this.handleMenuSurfaceOpened_),this.unlisten("keydown",this.handleKeydown_),this.unlisten(Q.strings.ACTION_EVENT,this.handleItemAction_),t.prototype.destroy.call(this)},Object.defineProperty(n.prototype,"open",{get:function(){return this.menuSurface_.isOpen()},set:function(t){t?this.menuSurface_.open():this.menuSurface_.close()},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"wrapFocus",{get:function(){return!!this.list_&&this.list_.wrapFocus},set:function(t){this.list_&&(this.list_.wrapFocus=t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"hasTypeahead",{set:function(t){this.list_&&(this.list_.hasTypeahead=t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"typeaheadInProgress",{get:function(){return!!this.list_&&this.list_.typeaheadInProgress},enumerable:!0,configurable:!0}),n.prototype.typeaheadMatchItem=function(t,e){return this.list_?this.list_.typeaheadMatchItem(t,e):-1},n.prototype.layout=function(){this.list_&&this.list_.layout()},Object.defineProperty(n.prototype,"items",{get:function(){return this.list_?this.list_.listElements:[]},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"singleSelection",{set:function(t){this.list_&&(this.list_.singleSelection=t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"selectedIndex",{get:function(){return this.list_?this.list_.selectedIndex:b.UNSET_INDEX},set:function(t){this.list_&&(this.list_.selectedIndex=t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"quickOpen",{set:function(t){this.menuSurface_.quickOpen=t},enumerable:!0,configurable:!0}),n.prototype.setDefaultFocusState=function(t){this.foundation.setDefaultFocusState(t)},n.prototype.setAnchorCorner=function(t){this.menuSurface_.setAnchor
21471Corner(t)},n.prototype.setAnchorMargin=function(t){this.menuSurface_.setAnchorMargin(t)},n.prototype.setSelectedIndex=function(t){this.foundation.setSelectedIndex(t)},n.prototype.setEnabled=function(t,e){this.foundation.setEnabled(t,e)},n.prototype.getOptionByIndex=function(t){return t<this.items.length?this.items[t]:null},n.prototype.getPrimaryTextAtIndex=function(t){var e=this.getOptionByIndex(t);return e&&this.list_&&this.list_.getPrimaryText(e)||""},n.prototype.setFixedPosition=function(t){this.menuSurface_.setFixedPosition(t)},n.prototype.setIsHoisted=function(t){this.menuSurface_.setIsHoisted(t)},n.prototype.setAbsolutePosition=function(t,e){this.menuSurface_.setAbsolutePosition(t,e)},n.prototype.setAnchorElement=function(t){this.menuSurface_.anchorElement=t},n.prototype.getDefaultFoundation=function(){var t=this;return new ct({addClassToElementAtIndex:function(e,n){t.items[e].classList.add(n)},removeClassFromElementAtIndex:function(e,n){t.items[e].classList.remove(n)},addAttributeToElementAtIndex:function(e,n,i){t.items[e].setAttribute(n,i)},removeAttributeFromElementAtIndex:function(e,n){t.items[e].removeAttribute(n)},elementContainsClass:function(t,e){return t.classList.contains(e)},closeSurface:function(e){return t.menuSurface_.close(e)},getElementIndex:function(e){return t.items.indexOf(e)},notifySelected:function(e){return t.emit(st.SELECTED_EVENT,{index:e.index,item:t.items[e.index]})},getMenuItemCount:function(){return t.items.length},focusItemAtIndex:function(e){return t.items[e].focus()},focusListRoot:function(){return t.root.querySelector(st.LIST_SELECTOR).focus()},isSelectableItemAtIndex:function(e){return!!c(t.items[e],"."+at.MENU_SELECTION_GROUP)},getSelectedSiblingOfItemAtIndex:function(e){var n=c(t.items[e],"."+at.MENU_SELECTION_GROUP).querySelector("."+at.MENU_SELECTED_LIST_ITEM);return n?t.items.indexOf(n):-1}})},n}(u),lt={NOTCH_ELEMENT_SELECTOR:".mdc-notched-outline__notch"},ht={NOTCH_ELEMENT_PADDING:8},pt={NO_LABEL:"mdc-notched-outline--no-label",OUTLINE_NOTCHED:"mdc-notched-outline--notched",OUTLINE_UPGRADED:"mdc-notched-outline--upgraded"},ft=function(t){function n(e){return t.call(this,i(i({},n.defaultAdapter),e))||this}return e(n,t),Object.defineProperty(n,"strings",{get:function(){return lt},enumerable:!0,configurable:!0}),Object.defineProperty(n,"cssClasses",{get:function(){return pt},enumerable:!0,configurable:!0}),Object.defineProperty(n,"numbers",{get:function(){return ht},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},setNotchWidthProperty:function(){},removeNotchWidthProperty:function(){}}},enumerable:!0,configurable:!0}),n.prototype.notch=function(t){var e=n.cssClasses.OUTLINE_NOTCHED;t>0&&(t+=ht.NOTCH_ELEMENT_PADDING),this.adapter.setNotchWidthProperty(t),this.adapter.addClass(e)},n.prototype.closeNotch=function(){var t=n.cssClasses.OUTLINE_NOTCHED;this.adapter.removeClass(t),this.adapter.removeNotchWidthProperty()},n}(s),mt=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.attachTo=function(t){return new n(t)},n.prototype.initialSyncWithDOM=function(){this.notchElement_=this.root.querySelector(lt.NOTCH_ELEMENT_SELECTOR);var t=this.root.querySelector("."+m.cssClasses.ROOT);t?(t.style.transitionDuration="0s",this.root.classList.add(pt.OUTLINE_UPGRADED),requestAnimationFrame((function(){t.style.transitionDuration=""}))):this.root.classList.add(pt.NO_LABEL)},n.prototype.notch=function(t){this.foundation.notch(t)},n.prototype.closeNotch=function(){this.foundation.closeNotch()},n.prototype.getDefaultFoundation=function(){var t=this;return new ft({addClass:function(e){return t.root.classList.add(e)},removeClass:function(e){return t.root.classList.remove(e)},setNotchWidthProperty:function(e){return t.notchElement_.style.setProperty("width",e+"px")},removeNotchWidthProperty:function(){return t.notchElement_.style.removeProperty("width")}})},n}(u);function Et(t){return void 0===t&&(t=window),!!function(t){void 0===t&&(t=window);var e=!1;try{var n={get passive(){return e=!0,!1}},i=function(){};t.document.addEventListener("test",i,n),t.document.removeEventListener("test",i,n)}catch(t){e=!1}return e}(t)&&{passive:!0}}var It,_t,yt={BG_FOCUSED:"mdc-ripple-upgraded--background-focused",FG_ACTIVATION:"mdc-ripple-upgraded--foreground-activation",FG_DEACTIVATION:"mdc-ripple-upgraded--foreground-deactivation",ROOT:"mdc-ripple-upgraded",UNBOUNDED:"mdc-ripple-upgraded--unbounded"},gt={VAR_FG_SCALE:"--mdc-ripple-fg-scale",VAR_FG_SIZE:"--mdc-ripple-fg-size",VAR_FG_TRANSLATE_END:"--mdc-ripple-fg-translate-end",VAR_FG_TRANSLATE_START:"--mdc-ripple-fg-translate-start",VAR_LEFT:"--mdc-ripple-left",VAR_TOP:"--mdc-ripple-top"},Ct={DEACTIVATION_TIMEOUT_MS:225,FG_DEACTIVATION_MS:150,INITIAL_ORIGIN_SCALE:.6,PADDING:10,TAP_DELAY_MS:300},At=["touchstart","pointerdown","mousedown","keydown"],Tt=["touchend","pointerup","mouseup","contextmenu"],vt=[],bt=function(t){function n(e){var r=t.call(this,i(i({},n.defaultAdapter),e))||this;return r.activationAnimationHasEnded_=!1,r.activationTimer_=0,r.fgDeactivationRemovalTimer_=0,r.fgScale_="
214710",r.frame_={width:0,height:0},r.initialSize_=0,r.layoutFrame_=0,r.maxRadius_=0,r.unboundedCoords_={left:0,top:0},r.activationState_=r.defaultActivationState_(),r.activationTimerCallback_=function(){r.activationAnimationHasEnded_=!0,r.runDeactivationUXLogicIfReady_()},r.activateHandler_=function(t){return r.activate_(t)},r.deactivateHandler_=function(){return r.deactivate_()},r.focusHandler_=function(){return r.handleFocus()},r.blurHandler_=function(){return r.handleBlur()},r.resizeHandler_=function(){return r.layout()},r}return e(n,t),Object.defineProperty(n,"cssClasses",{get:function(){return yt},enumerable:!0,configurable:!0}),Object.defineProperty(n,"strings",{get:function(){return gt},enumerable:!0,configurable:!0}),Object.defineProperty(n,"numbers",{get:function(){return Ct},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addClass:function(){},browserSupportsCssVars:function(){return!0},computeBoundingRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},containsEventTarget:function(){return!0},deregisterDocumentInteractionHandler:function(){},deregisterInteractionHandler:function(){},deregisterResizeHandler:function(){},getWindowPageOffset:function(){return{x:0,y:0}},isSurfaceActive:function(){return!0},isSurfaceDisabled:function(){return!0},isUnbounded:function(){return!0},registerDocumentInteractionHandler:function(){},registerInteractionHandler:function(){},registerResizeHandler:function(){},removeClass:function(){},updateCssVariable:function(){}}},enumerable:!0,configurable:!0}),n.prototype.init=function(){var t=this,e=this.supportsPressRipple_();if(this.registerRootHandlers_(e),e){var i=n.cssClasses,r=i.ROOT,o=i.UNBOUNDED;requestAnimationFrame((function(){t.adapter.addClass(r),t.adapter.isUnbounded()&&(t.adapter.addClass(o),t.layoutInternal_())}))}},n.prototype.destroy=function(){var t=this;if(this.supportsPressRipple_()){this.activationTimer_&&(clearTimeout(this.activationTimer_),this.activationTimer_=0,this.adapter.removeClass(n.cssClasses.FG_ACTIVATION)),this.fgDeactivationRemovalTimer_&&(clearTimeout(this.fgDeactivationRemovalTimer_),this.fgDeactivationRemovalTimer_=0,this.adapter.removeClass(n.cssClasses.FG_DEACTIVATION));var e=n.cssClasses,i=e.ROOT,r=e.UNBOUNDED;requestAnimationFrame((function(){t.adapter.removeClass(i),t.adapter.removeClass(r),t.removeCssVars_()}))}this.deregisterRootHandlers_(),this.deregisterDeactivationHandlers_()},n.prototype.activate=function(t){this.activate_(t)},n.prototype.deactivate=function(){this.deactivate_()},n.prototype.layout=function(){var t=this;this.layoutFrame_&&cancelAnimationFrame(this.layoutFrame_),this.layoutFrame_=requestAnimationFrame((function(){t.layoutInternal_(),t.layoutFrame_=0}))},n.prototype.setUnbounded=function(t){var e=n.cssClasses.UNBOUNDED;t?this.adapter.addClass(e):this.adapter.removeClass(e)},n.prototype.handleFocus=function(){var t=this;requestAnimationFrame((function(){return t.adapter.addClass(n.cssClasses.BG_FOCUSED)}))},n.prototype.handleBlur=function(){var t=this;requestAnimationFrame((function(){return t.adapter.removeClass(n.cssClasses.BG_FOCUSED)}))},n.prototype.supportsPressRipple_=function(){return this.adapter.browserSupportsCssVars()},n.prototype.defaultActivationState_=function(){return{activationEvent:void 0,hasDeactivationUXRun:!1,isActivated:!1,isProgrammatic:!1,wasActivatedByPointer:!1,wasElementMadeActive:!1}},n.prototype.registerRootHandlers_=function(t){var e=this;t&&(At.forEach((function(t){e.adapter.registerInteractionHandler(t,e.activateHandler_)})),this.adapter.isUnbounded()&&this.adapter.registerResizeHandler(this.resizeHandler_)),this.adapter.registerInteractionHandler("focus",this.focusHandler_),this.adapter.registerInteractionHandler("blur",this.blurHandler_)},n.prototype.registerDeactivationHandlers_=function(t){var e=this;"keydown"===t.type?this.adapter.registerInteractionHandler("keyup",this.deactivateHandler_):Tt.forEach((function(t){e.adapter.registerDocumentInteractionHandler(t,e.deactivateHandler_)}))},n.prototype.deregisterRootHandlers_=function(){var t=this;At.forEach((function(e){t.adapter.deregisterInteractionHandler(e,t.activateHandler_)})),this.adapter.deregisterInteractionHandler("focus",this.focusHandler_),this.adapter.deregisterInteractionHandler("blur",this.blurHandler_),this.adapter.isUnbounded()&&this.adapter.deregisterResizeHandler(this.resizeHandler_)},n.prototype.deregisterDeactivationHandlers_=function(){var t=this;this.adapter.deregisterInteractionHandler("keyup",this.deactivateHandler_),Tt.forEach((function(e){t.adapter.deregisterDocumentInteractionHandler(e,t.deactivateHandler_)}))},n.prototype.removeCssVars_=function(){var t=this,e=n.strings;Object.keys(e).forEach((function(n){0===n.indexOf("VAR_")&&t.adapter.updateCssVariable(e[n],null)}))},n.prototype.activate_=function(t){var e=this;if(!this.adapter.isSurfaceDisabled()){var n=this.activationState_;if(!n.isActivated){var i=this.previousActivationEvent_;i&&void 0!==t&&i.type!==t.type||(n.isActivated=!0,n.isProgrammatic=void 0===t,n.activationEvent=t,n.wasActivatedByPointer=!n.isProgrammatic&&void 0!==t&&("mousedown"===t.type||"touchstart"===t.type||"pointerdown"===t.type),void 0!==t&&vt.length>0&&vt.some((function(t){return e.adapter.containsEventTarget(t)}))?this.resetActivationState_():(void 0!==t&&(vt.push(t.target),this.registerDeactivationHandlers_(t)),n.wasElementMadeActive=this.checkElementMadeActive_(t),n.wasElementMadeActive&&this.animateActivation_(),requestAnimationFrame((function(){vt=[],n.wasElementMadeActive||void 0===t||" "!==t.key&&32!==t.keyCode||(n.wasElementMadeActive=e.checkElementMadeActive_(t),n.wasElementMadeActive&&e.animateActivation_()),n.wasElementMadeActive||(e.activationState_=e.defaultActivationState_())}))))}}},n.prototype.checkElementMadeActive_=function(t){return void 0===t||"keydown"!==t.type||this.adapter.isSurfaceActive()},n.prototype.animateActivation_=function(){var t=this,e=n.strings,i=e.VAR_FG_TRANSLATE_START,r=e.VAR_FG_TRANSLATE_END,o=n.cssClasse
21471s,a=o.FG_DEACTIVATION,s=o.FG_ACTIVATION,u=n.numbers.DEACTIVATION_TIMEOUT_MS;this.layoutInternal_();var c="",d="";if(!this.adapter.isUnbounded()){var l=this.getFgTranslationCoordinates_(),h=l.startPoint,p=l.endPoint;c=h.x+"px, "+h.y+"px",d=p.x+"px, "+p.y+"px"}this.adapter.updateCssVariable(i,c),this.adapter.updateCssVariable(r,d),clearTimeout(this.activationTimer_),clearTimeout(this.fgDeactivationRemovalTimer_),this.rmBoundedActivationClasses_(),this.adapter.removeClass(a),this.adapter.computeBoundingRect(),this.adapter.addClass(s),this.activationTimer_=setTimeout((function(){return t.activationTimerCallback_()}),u)},n.prototype.getFgTranslationCoordinates_=function(){var t,e=this.activationState_,n=e.activationEvent;return{startPoint:t={x:(t=e.wasActivatedByPointer?function(t,e,n){if(!t)return{x:0,y:0};var i,r,o=e.x,a=e.y,s=o+n.left,u=a+n.top;if("touchstart"===t.type){var c=t;i=c.changedTouches[0].pageX-s,r=c.changedTouches[0].pageY-u}else{var d=t;i=d.pageX-s,r=d.pageY-u}return{x:i,y:r}}(n,this.adapter.getWindowPageOffset(),this.adapter.computeBoundingRect()):{x:this.frame_.width/2,y:this.frame_.height/2}).x-this.initialSize_/2,y:t.y-this.initialSize_/2},endPoint:{x:this.frame_.width/2-this.initialSize_/2,y:this.frame_.height/2-this.initialSize_/2}}},n.prototype.runDeactivationUXLogicIfReady_=function(){var t=this,e=n.cssClasses.FG_DEACTIVATION,i=this.activationState_,r=i.hasDeactivationUXRun,o=i.isActivated;(r||!o)&&this.activationAnimationHasEnded_&&(this.rmBoundedActivationClasses_(),this.adapter.addClass(e),this.fgDeactivationRemovalTimer_=setTimeout((function(){t.adapter.removeClass(e)}),Ct.FG_DEACTIVATION_MS))},n.prototype.rmBoundedActivationClasses_=function(){var t=n.cssClasses.FG_ACTIVATION;this.adapter.removeClass(t),this.activationAnimationHasEnded_=!1,this.adapter.computeBoundingRect()},n.prototype.resetActivationState_=function(){var t=this;this.previousActivationEvent_=this.activationState_.activationEvent,this.activationState_=this.defaultActivationState_(),setTimeout((function(){return t.previousActivationEvent_=void 0}),n.numbers.TAP_DELAY_MS)},n.prototype.deactivate_=function(){var t=this,e=this.activationState_;if(e.isActivated){var n=i({},e);e.isProgrammatic?(requestAnimationFrame((function(){return t.animateDeactivation_(n)})),this.resetActivationState_()):(this.deregisterDeactivationHandlers_(),requestAnimationFrame((function(){t.activationState_.hasDeactivationUXRun=!0,t.animateDeactivation_(n),t.resetActivationState_()})))}},n.prototype.animateDeactivation_=function(t){var e=t.wasActivatedByPointer,n=t.wasElementMadeActive;(e||n)&&this.runDeactivationUXLogicIfReady_()},n.prototype.layoutInternal_=function(){this.frame_=this.adapter.computeBoundingRect();var t=Math.max(this.frame_.height,this.frame_.width);this.maxRadius_=this.adapter.isUnbounded()?t:Math.sqrt(Math.pow(this.frame_.width,2)+Math.pow(this.frame_.height,2))+n.numbers.PADDING;var e=Math.floor(t*n.numbers.INITIAL_ORIGIN_SCALE);this.adapter.isUnbounded()&&e%2!=0?this.initialSize_=e-1:this.initialSize_=e,this.fgScale_=""+this.maxRadius_/this.initialSize_,this.updateLayoutCssVars_()},n.prototype.updateLayoutCssVars_=function(){var t=n.strings,e=t.VAR_FG_SIZE,i=t.VAR_LEFT,r=t.VAR_TOP,o=t.VAR_FG_SCALE;this.adapter.updateCssVariable(e,this.initialSize_+"px"),this.adapter.updateCssVariable(o,this.fgScale_),this.adapter.isUnbounded()&&(this.unboundedCoords_={left:Math.round(this.frame_.width/2-this.initialSize_/2),top:Math.round(this.frame_.height/2-this.initialSize_/2)},this.adapter.updateCssVariable(i,this.unboundedCoords_.left+"px"),this.adapter.updateCssVariable(r,this.unboundedCoords_.top+"px"))},n}(s),St=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.disabled=!1,e}return e(n,t),n.attachTo=function(t,e){void 0===e&&(e={isUnbounded:void 0});var i=new n(t);return void 0!==e.isUnbounded&&(i.unbounded=e.isUnbounded),i},n.createAdapter=function(t){return{addClass:function(e){return t.root.classList.add(e)},browserSupportsCssVars:function(){return function(t,e){void 0===e&&(e=!1);var n,i=window.CSS;if("boolean"==typeof It&&!e)return It;if(!i||"function"!=typeof i.supports)return!1;var r=i.supports("--css-vars","yes"),o=i.supports("(--css-vars: yes
21471)")&&i.supports("color","#00000000");return n=r||o,e||(It=n),n}()},computeBoundingRect:function(){return t.root.getBoundingClientRect()},containsEventTarget:function(e){return t.root.contains(e)},deregisterDocumentInteractionHandler:function(t,e){return document.documentElement.removeEventListener(t,e,Et())},deregisterInteractionHandler:function(e,n){return t.root.removeEventListener(e,n,Et())},deregisterResizeHandler:function(t){return window.removeEventListener("resize",t)},getWindowPageOffset:function(){return{x:window.pageXOffset,y:window.pageYOffset}},isSurfaceActive:function(){return d(t.root,":active")},isSurfaceDisabled:function(){return Boolean(t.disabled)},isUnbounded:function(){return Boolean(t.unbounded)},registerDocumentInteractionHandler:function(t,e){return document.documentElement.addEventListener(t,e,Et())},registerInteractionHandler:function(e,n){return t.root.addEventListener(e,n,Et())},registerResizeHandler:function(t){return window.addEventListener("resize",t)},removeClass:function(e){return t.root.classList.remove(e)},updateCssVariable:function(e,n){return t.root.style.setProperty(e,n)}}},Object.defineProperty(n.prototype,"unbounded",{get:function(){return Boolean(this.unbounded_)},set:function(t){this.unbounded_=Boolean(t),this.setUnbounded_()},enumerable:!0,configurable:!0}),n.prototype.activate=function(){this.foundation.activate()},n.prototype.deactivate=function(){this.foundation.deactivate()},n.prototype.layout=function(){this.foundation.layout()},n.prototype.getDefaultFoundation=function(){return new bt(n.createAdapter(this))},n.prototype.initialSyncWithDOM=function(){var t=this.root;this.unbounded="mdcRippleIsUnbounded"in t.dataset},n.prototype.setUnbounded_=function(){this.foundation.setUnbounded(Boolean(this.unbounded_))},n}(u),Ot={ACTIVATED:"mdc-select--activated",DISABLED:"mdc-select--disabled",FOCUSED:"mdc-select--focused",INVALID:"mdc-select--invalid",MENU_INVALID:"mdc-select__menu--invalid",OUTLINED:"mdc-select--outlined",REQUIRED:"mdc-select--required",ROOT:"mdc-select",WITH_LEADING_ICON:"mdc-select--with-leading-icon"},Lt={ARIA_CONTROLS:"aria-controls",ARIA_DESCRIBEDBY:"aria-describedby",ARIA_SELECTED_ATTR:"aria-selected",CHANGE_EVENT:"MDCSelect:change",HIDDEN_INPUT_SELECTOR:'input[type="hidden"]',LABEL_SELECTOR:".mdc-floating-label",LEADING_ICON_SELECTOR:".mdc-select__icon",LINE_RIPPLE_SELECTOR:".mdc-line-ripple",MENU_SELECTOR:".mdc-select__menu",OUTLINE_SELECTOR:".mdc-notched-outline",SELECTED_TEXT_SELECTOR:".mdc-select__selected-text",SELECT_ANCHOR_SELECTOR:".mdc-select__anchor",VALUE_ATTR:"data-value"},xt={LABEL_SCALE:.75,UNSET_INDEX:-1,CLICK_DEBOUNCE_TIMEOUT_MS:330},Rt=function(t){function n(e,r){void 0===r&&(r={});var o=t.call(this,i(i({},n.defaultAdapter),e))||this;return o.disabled=!1,o.isMenuOpen=!1,o.useDefaultValidation=!0,o.customValidity=!0,o.lastSelectedIndex=xt.UNSET_INDEX,o.clickDebounceTimeout=0,o.recentlyClicked=!1,o.leadingIcon=r.leadingIcon,o.helperText=r.helperText,o}return e(n,t),Object.defineProperty(n,"cssClasses",{get:function(){return Ot},enumerable:!0,configurable:!0}),Object.defineProperty(n,"numbers",{get:function(){return xt},enumerable:!0,configurable:!0}),Object.defineProperty(n,"strings",{get:function(){return Lt},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},activateBottomLine:function(){},deactivateBottomLine:function(){},getSelectedIndex:function(){return-1},setSelectedIndex:function(){},hasLabel:function(){return!1},floatLabel:function(){},getLabelWidth:function(){return 0},setLabelRequired:function(){},hasOutline:function(){return!1},notchOutline:function(){},closeOutline:function(){},setRippleCenter:function(){},notifyChange:function(){},setSelectedText:function(){},isSelectAnchorFocused:function(){return!1},getSelectAnchorAttr:function(){return""},setSelectAnchorAttr:function(){},removeSelectAnchorAttr:function(){},addMenuClass:function(){},removeMenuClass:function(){},openMenu:function(){},closeMenu:function(){},getAnchorElement:function(){return null},setMenuAnchorElement:function(){},setMenuAnchorCorner:function(){},setMenuWrapFocus:function(){},focusMenuItemAtIndex:function(){},getMenuItemCount:function(){return 0}
21471,getMenuItemValues:function(){return[]},getMenuItemTextAtIndex:function(){return""},isTypeaheadInProgress:function(){return!1},typeaheadMatchItem:function(){return-1}}},enumerable:!0,configurable:!0}),n.prototype.getSelectedIndex=function(){return this.adapter.getSelectedIndex()},n.prototype.setSelectedIndex=function(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=!1),t>=this.adapter.getMenuItemCount()||(t===xt.UNSET_INDEX?this.adapter.setSelectedText(""):this.adapter.setSelectedText(this.adapter.getMenuItemTextAtIndex(t).trim()),this.adapter.setSelectedIndex(t),e&&this.adapter.closeMenu(),n||this.lastSelectedIndex===t||this.handleChange(),this.lastSelectedIndex=t)},n.prototype.setValue=function(t,e){void 0===e&&(e=!1);var n=this.adapter.getMenuItemValues().indexOf(t);this.setSelectedIndex(n,!1,e)},n.prototype.getValue=function(){var t=this.adapter.getSelectedIndex(),e=this.adapter.getMenuItemValues();return t!==xt.UNSET_INDEX?e[t]:""},n.prototype.getDisabled=function(){return this.disabled},n.prototype.setDisabled=function(t){this.disabled=t,this.disabled?(this.adapter.addClass(Ot.DISABLED),this.adapter.closeMenu()):this.adapter.removeClass(Ot.DISABLED),this.leadingIcon&&this.leadingIcon.setDisabled(this.disabled),this.disabled?this.adapter.removeSelectAnchorAttr("tabindex"):this.adapter.setSelectAnchorAttr("tabindex","0"),this.adapter.setSelectAnchorAttr("aria-disabled",this.disabled.toString())},n.prototype.openMenu=function(){this.adapter.addClass(Ot.ACTIVATED),this.adapter.openMenu(),this.isMenuOpen=!0,this.adapter.setSelectAnchorAttr("aria-expanded","true")},n.prototype.setHelperTextContent=function(t){this.helperText&&this.helperText.setContent(t)},n.prototype.layout=function(){if(this.adapter.hasLabel()){var t=this.getValue().length>0,e=this.adapter.hasClass(Ot.FOCUSED),n=t||e,i=this.adapter.hasClass(Ot.REQUIRED);this.notchOutline(n),this.adapter.floatLabel(n),this.adapter.setLabelRequired(i)}},n.prototype.layoutOptions=function(){var t=this.adapter.getMenuItemV
21471alues().indexOf(this.getValue());this.setSelectedIndex(t,!1,!0)},n.prototype.handleMenuOpened=function(){if(0!==this.adapter.getMenuItemValues().length){var t=this.getSelectedIndex(),e=t>=0?t:0;this.adapter.focusMenuItemAtIndex(e)}},n.prototype.handleMenuClosing=function(){this.adapter.setSelectAnchorAttr("aria-expanded","false")},n.prototype.handleMenuClosed=function(){this.adapter.removeClass(Ot.ACTIVATED),this.isMenuOpen=!1,this.adapter.isSelectAnchorFocused()||this.blur()},n.prototype.handleChange=function(){this.layout(),this.adapter.notifyChange(this.getValue()),this.adapter.hasClass(Ot.REQUIRED)&&this.useDefaultValidation&&this.setValid(this.isValid())},n.prototype.handleMenuItemAction=function(t){this.setSelectedIndex(t,!0)},n.prototype.handleFocus=function(){this.adapter.addClass(Ot.FOCUSED),this.layout(),this.adapter.activateBottomLine()},n.prototype.handleBlur=function(){this.isMenuOpen||this.blur()},n.prototype.handleClick=function(t){this.disabled||this.recentlyClicked||(this.setClickDebounceTimeout(),this.isMenuOpen?this.adapter.closeMenu():(this.adapter.setRippleCenter(t),this.openMenu()))},n.prototype.handleKeydown=function(t){if(!this.isMenuOpen&&this.adapter.hasClass(Ot.FOCUSED)){var e=q(t)===L,n=q(t)===x,i=q(t)===M,r=q(t)===F;if(!n&&t.key&&1===t.key.length||n&&this.adapter.isTypeaheadInProgress()){var o=n?" ":t.key,a=this.adapter.typeaheadMatchItem(o,this.getSelectedIndex());return a>=0&&this.setSelectedIndex(a),void t.preventDefault()}(e||n||i||r)&&(i&&this.getSelectedIndex()>0?this.setSelectedIndex(this.getSelectedIndex()-1):r&&this.getSelectedIndex()<this.adapter.getMenuItemCount()-1&&this.setSelectedIndex(this.getSelectedIndex()+1),this.openMenu(),t.preventDefault())}},n.prototype.notchOutline=function(t){if(this.adapter.hasOutline()){var e=this.adapter.hasClass(Ot.FOCUSED);if(t){var n=xt.LABEL_SCALE,i=this.adapter.getLabelWidth()*n;this.adapter.notchOutline(i)}else e||this.adapter.closeOutline()}},n.prototype.setLeadingIconAriaLabel=function(t){this.leadingIcon&&this.leadingIcon.setAriaLabel(t)},n.prototype.setLeadingIconContent=function(t){this.leadingIcon&&this.leadingIcon.setContent(t)},n.prototype.setUseDefaultValidation=function(t){this.useDefaultValidation=t},n.prototype.setValid=function(t){this.useDefaultValidation||(this.customValidity=t),this.adapter.setSelectAnchorAttr("aria-invalid",(!t).toString()),t?(this.adapter.removeClass(Ot.INVALID),this.adapter.removeMenuClass(Ot.MENU_INVALID)):(this.adapter.addClass(Ot.INVALID),this.adapter.addMenuClass(Ot.MENU_INVALID)),this.syncHelperTextValidity(t)},n.prototype.isValid=function(){return this.useDefaultValidation&&this.adapter.hasClass(Ot.REQUIRED)&&!this.adapter.hasClass(Ot.DISABLED)?this.getSelectedIndex()!==xt.UNSET_INDEX&&(0!==this.getSelectedIndex()||Boolean(this.getValue())):this.customValidity},n.prototype.setRequired=function(t){t?this.adapter.addClass(Ot.REQUIRED):this.adapter.removeClass(Ot.REQUIRED),this.adapter.setSelectAnchorAttr("aria-required",t.toString()),this.adapter.setLabelRequired(t)},n.prototype.getRequired=function(){return"true"===this.adapter.getSelectAnchorAttr("aria-required")},n.prototype.init=function(){var t=this.adapter.getAnchorElement();t&&(this.adapter.setMenuAnchorElement(t),this.adapter.setMenuAnchorCorner(h.BOTTOM_START)),this.adapter.setMenuWrapFocus(!1),this.setDisabled(this.adapter.hasClass(Ot.DISABLED)),this.syncHelperTextValidity(!this.adapter.hasClass(Ot.INVALID)),this.layout(),this.layoutOptions()},n.prototype.blur=function(){this.adapter.removeClass(Ot.FOCUSED),this.layout(),this.adapter.deactivateBottomLine(),this.adapter.hasClass(Ot.REQUIRED)&&this.useDefaultValidation&&this.setValid(this.isValid())},n.prototype.syncHelperTextValidity=function(t){if(this.helperText){this.helperText.setValidity(t);var e=this.helperText.isVisible(),n=this.helperText.getId();e&&n?this.adapter.setSelectAnchorAttr(Lt.ARIA_DESCRIBEDBY,n):this.adapter.removeSelectAnchorAttr(Lt.ARIA_DESCRIBEDBY)}},n.prototype.setClickDebounceTimeout=function(){var t=this;clearTimeout(this.clickDebounceTimeout),this.clickDebounceTimeout=setTimeout((function(){t.recentlyClicked=!1}),xt.CLICK_DEBOUNCE_TIMEOUT_MS),this.recentlyClicked=!0},n}(s),Dt={ARIA_HIDDEN:"aria-hidden",ROLE:"role"}
vendor: 2,638 bytes, line 21471
21471,wt={HELPER_TEXT_VALIDATION_MSG:"mdc-select-helper-text--validation-msg",HELPER_TEXT_VALIDATION_MSG_PERSISTENT:"mdc-select-helper-text--validation-msg-persistent"},Nt=function(t){function n(e){return t.call(this,i(i({},n.defaultAdapter),e))||this}return e(n,t),Object.defineProperty(n,"cssClasses",{get:function(){return wt},enumerable:!0,configurable:!0}),Object.defineProperty(n,"strings",{get:function(){return Dt},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},setAttr:function(){},getAttr:function(){return null},removeAttr:function(){},setContent:function(){}}},enumerable:!0,configurable:!0}),n.prototype.getId=function(){return this.adapter.getAttr("id")},n.prototype.isVisible=function(){return"true"!==this.adapter.getAttr(Dt.ARIA_HIDDEN)},n.prototype.setContent=function(t){this.adapter.setContent(t)},n.prototype.setValidation=function(t){t?this.adapter.addClass(wt.HELPER_TEXT_VALIDATION_MSG):this.adapter.removeClass(wt.HELPER_TEXT_VALIDATION_MSG)},n.prototype.setValidationMsgPersistent=function(t){t?this.adapter.addClass(wt.HELPER_TEXT_VALIDATION_MSG_PERSISTENT):this.adapter.removeClass(wt.HELPER_TEXT_VALIDATION_MSG_PERSISTENT)},n.prototype.setValidity=function(t){if(this.adapter.hasClass(wt.HELPER_TEXT_VALIDATION_MSG)){var e=this.adapter.hasClass(wt.HELPER_TEXT_VALIDATION_MSG_PERSISTENT);if(!t||e)return this.showToScreenReader(),void(t?this.adapter.removeAttr(Dt.ROLE):this.adapter.setAttr(Dt.ROLE,"alert"));this.adapter.removeAttr(Dt.ROLE),this.hide()}},n.prototype.showToScreenReader=function(){this.adapter.removeAttr(Dt.ARIA_HIDDEN)},n.prototype.hide=function(){this.adapter.setAttr(Dt.ARIA_HIDDEN,"true")},n}(s),Ht=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.attachTo=function(t){return new n(t)},Object.defineProperty(n.prototype,"foundationForSelect",{get:function(){return this.foundation},enumerable:!0,configurable:!0}),n.prototype.getDefaultFoundation=function(){var t=this;return new Nt({addClass:function(e){return t.root.classList.add(e)},removeClass:function(e){return t.root.classList.remove(e)},hasClass:function(e){return t.root.classList.contains(e)},getAttr:function(e){return t.root.getAttribute(e)},setAttr:function(e,n){return t.root.setAttribute(e,n)},removeAttr:function(e){return t.root.removeAttribute(e)},setContent:function(e){t.root.textContent=e}})},n}(u),Mt={ICON_EVENT:"MDCSelect:icon",ICON_ROLE:"button"},Pt=["click","keydown"],Ft=function(t){function n(e){var r=t.call(this,i(i({},n.defaultAdapter),e))||this;
21471return r.savedTabIndex_=null,r.interactionHandler_=function(t){return r.handleInteraction(t)},r}return e(n,t),Object.defineProperty(n,"strings",{get:function(){return Mt},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{getAttr:function(){return null},setAttr:function(){},removeAttr:function(){},setContent:function(){},registerInteractionHandler:function(){},deregisterInteractionHandler:function(){},notifyIconAction:function(){}}},enumerable:!0,configurable:!0}),n.prototype.init=function(){var t=this;this.savedTabIndex_=this.adapter.getAttr("tabindex"),Pt.forEach((function(e){t.adapter.registerInteractionHandler(e,t.interactionHandler_)}))},n.prototype.destroy=function(){var t=this;Pt.forEach((function(e){t.adapter.deregisterInteractionHandler(e,t.interactionHandler_)}))},n.prototype.setDisabled=function(t){this.savedTabIndex_&&(t?(this.adapter.setAttr("tabindex","-1"),this.adapter.removeAttr("role")):(this.adapter.setAttr("tabindex",this.savedTabIndex_),this.adapter.setAttr("role",Mt.ICON_ROLE)))},n.prototype.setAriaLabel=function(t){this.adapter.setAttr("aria-label",t)},n.prototype.setContent=function(t){this.adapter.setContent(t)},n.prototype.handleInteraction=function(t){var e="Enter"===t.key||13===t.keyCode;("click"===t.type||e)&&this.adapter.notifyIconAction()},n}(s),kt=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.attachTo=function(t){return new n(t)},Object.defineProperty(n.prototype,"foundationForSelect",{get:function(){return this.foundation},enumerable:!0,configurable:!0}),n.prototype.getDefaultFoundation=function(){var t=this;return new Ft({getAttr:function(e){return t.root.getAttribute(e)},setAttr:function(e,n){return t.root.setAttribute(e,n)},removeAttr:function(e){return t.root.removeAttribute(e)},setContent:function(e){t.root.textContent=e},registerInteractionHandler:function(e,n){return t.listen(e,n)},deregisterInteractionHandler:function(e,n){return t.unlisten(e,n)},notifyIconAction:function(){return t.emit(Ft.strings.ICON_EVENT,{},!0)}})},n}(u),Bt=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.attachTo=function(t){return new n(t)},n.prototype.initialize=function(t,e,n,i,r,o){if(void 0===t&&(t=function(t){return new E(t)}),void 0===e&&(e=function(t){return new y(t)}),void 0===n&&(n=function(t){return new mt(t)}),void 0===i&&(i=function(t){return new dt(t)}),void 0===r&&(r=function(t){return new kt(t)}),void 0===o&&(o=function(t){return new Ht(t)}),this.selectAnchor=this.root.querySelector(Lt.SELECT_ANCHOR_SELECTOR),this.selectedText=this.root.querySelector(Lt.SELECTED_TEXT_SELECTOR),this.hiddenInput=this.root.querySelector(Lt.HIDDEN_INPUT_SELECTOR),!this.selectedText)throw new Error("MDCSelect: Missing required element: The following selector must be present: '"+Lt.SELECTED_TEXT_SELECTOR+"'");if(this.selectAnchor.hasAttribute(Lt.ARIA_CONTROLS)){var a=document.getElementById(this.selectAnchor.getAttribute(Lt.ARIA_CONTROLS));a&&(this.helperText=o(a))}this.menuSetup(i);var s=this.root.querySelector(Lt.LABEL_SELECTOR);this.label=s?t(s):null;var u=this.root.querySelector(Lt.LINE_RIPPLE_SELECTOR);this.lineRipple=u?e(u):null;var c=this.root.querySelector(Lt.OUTLINE_SELECTOR);this.outline=c?n(c):null;var d=this.root.querySelector(Lt.LEADING_ICON_SELECTOR);d&&(this.leadingIcon=r(d)),this.root.classList.contains(Ot.OUTLINED)||(this.ripple=this.createRipple())},n.prototype.initialSyncWithDOM=function(){var t=this;if(this.handleFocus=function(){t.foundation.handleFocus()},this.handleBlur=function(){t.foundation.handleBlur()},this.handleClick=function(e){t.selectAnchor.focus(),t.foundation.handleClick(t.getNormalizedXCoordinate(e))},this.handleKeydown=function(e){t.foundation.handleKeydown(e)},this.handleMenuItemAction=function(e){t.foundation.handleMenuItemAction(e.detail.index)},this.handleMenuOpened=function(){t.foundation.handleMenuOpened()},this.handleMenuClosed=function(){t.foundation.handleMenuClosed()},this.handleMenuClosing=function(){t.foundation.handleMenuClosing()},this.selectAnchor.addEventListener("focus",this.handleFocus),this.selectAnchor.addEventListener("blur",this.handleBlur),this.selectAnchor.addEventListener("click",this.handleClick),this.selectAnchor.addEventListener("keydown",this.handleKeydown),this.menu.listen(C.CLOSED_EVENT,this.handleMenuClosed),this.menu.listen(C.CLOSING_EVENT,this.handleMenuClosing),this.menu.listen(C.OPENED_EVENT,this.handleMenuOpened),this.menu.listen(st.SELECTED_EVENT,this.handleMenuItemAction),this.hiddenInput){if(this.hiddenInput.value)return this.foundation.setValue(this.hiddenInput.value,!0),void this.foundation.layout();this.hiddenInput.value=this.value}},n.prototype.destroy=function(){this.selectAnchor.removeEventListener("focus",this.handleFocus),this.selectAnchor.removeEventListener("blur",this.handleBlur),this.selectAnchor.removeEventListener("keydown",this.handleKeydown),this.selectAnchor.removeEventListener("click",this.handleClick),this.menu.unlisten(C.CLOSED_EVENT,this.handleMenuClosed),this.menu.unlisten(C.OPENED_EVENT,this.handleMenuOpened),this.menu.unlisten(st.SELECTED_EVENT,this.handleMenuItemAction),this.menu.destroy(),this.ripple&&this.ripple.destroy(),this.outline&&this.outline.destroy(),this.leadingIcon&&this.leadingIcon.destroy(),this.helperText&&this.helperText.destroy(),t.prototype.destroy.call(this)},Object.defineProperty(n.prototype,"value",{get:function(){return this.foundation.getValue()},set:function(t){this.foundation.setValue(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"selectedIndex",{get:function(){return this.foundation.getSelectedIndex()},set:function(t){this.foundation.setSelectedIndex(t,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"disabled",{get:function(){return this.foundation.getDisabled()},set:function(t){this.foundation.setDisabled(t),this.hiddenInput&&(this.hiddenInput.disabled=t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"leadingIconAriaLabel",{set:function(t){this.foundation.setLeadingIconAriaLabel(t)}
21471,enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"leadingIconContent",{set:function(t){this.foundation.setLeadingIconContent(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"helperTextContent",{set:function(t){this.foundation.setHelperTextContent(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"useDefaultValidation",{set:function(t){this.foundation.setUseDefaultValidation(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"valid",{get:function(){return this.foundation.isValid()},set:function(t){this.foundation.setValid(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"required",{get:function(){return this.foundation.getRequired()},set:function(t){this.foundation.setRequired(t)},enumerable:!0,configurable:!0}),n.prototype.layout=function(){this.foundation.layout()},n.prototype.layoutOptions=function(){this.foundation.layoutOptions(),this.menu.layout(),this.menuItemValues=this.menu.items.map((function(t){return t.getAttribute(Lt.VALUE_ATTR)||""})),this.hiddenInput&&(this.hiddenInput.value=this.value)},n.prototype.getDefaultFoundation=function(){var t=i(i(i(i({},this.getSelectAdapterMethods()),this.getCommonAdapterMethods()),this.getOutlineAdapterMethods()),this.getLabelAdapterMethods());return new Rt(t,this.getFoundationMap())},n.prototype.menuSetup=function(t){this.menuElement=this.root.querySelector(Lt.MENU_SELECTOR),this.menu=t(this.menuElement),this.menu.hasTypeahead=!0,this.menu.singleSelection=!0,this.menuItemValues=this.menu.items.map((function(t){return t.getAttribute(Lt.VALUE_ATTR)||""}))},n.prototype.createRipple=function(){var t=this,e=i(i({},St.createAdapter({root:this.selectAnchor})),{registerInteractionHandler:function(e,n){t.selectAnchor.addEventListener(e,n)},deregisterInteractionHandler:function(e,n){t.selectAnchor.removeEventListener(e,n)}});return new St(this.selectAnchor,new bt(e))},n.prototype.getSelectAdapterMethods=function(){var t=this;return{getMenuItemAttr:function(t,e){return t.getAttribute(e)},setSelectedText:function(e){t.selectedText.textContent=e},isSelectAnchorFocused:function(){return document.activeElement===t.selectAnchor},getSelectAnchorAttr:function(e){return t.selectAnchor.getAttribute(e)},setSelectAnchorAttr:function(e,n){t.selectAnchor.setAttribute(e,n)},removeSelectAnchorAttr:function(e){t.selectAnchor.removeAttribute(e)},addMenuClass:function(e){t.menuElement.classList.add(e)},removeMenuClass:function(e){t.menuElement.classList.remove(e)},openMenu:function(){t.menu.open=!0},closeMenu:function(){t.menu.open=!1},getAnchorElement:function(){return t.root.querySelector(Lt.SELECT_ANCHOR_SELECTOR)},setMenuAnchorElement:function(e){t.menu.setAnchorElement(e)},setMenuAnchorCorner:function(e){t.menu.setAnchorCorner(e)},setMenuWrapFocus:function(e){t.menu.wrapFocus=e},getSelectedIndex:function(){var e=t.menu.selectedIndex;return e instanceof Array?e[0]:e},setSelectedIndex:function(e){t.menu.selectedIndex=e},focusMenuItemAtIndex:function(e){t.menu.items[e].focus()},getMenuItemCount:function(){return t.menu.items.length}
21471,getMenuItemValues:function(){return t.menuItemValues},getMenuItemTextAtIndex:function(e){return t.menu.getPrimaryTextAtIndex(e)},isTypeaheadInProgress:function(){return t.menu.typeaheadInProgress},typeaheadMatchItem:function(e,n){return t.menu.typeaheadMatchItem(e,n)}}},n.prototype.getCommonAdapterMethods=function(){var t=this;return{addClass:function(e){t.root.classList.add(e)},removeClass:function(e){t.root.classList.remove(e)},hasClass:function(e){return t.root.classList.contains(e)},setRippleCenter:function(e){t.lineRipple&&t.lineRipple.setRippleCenter(e)},activateBottomLine:function(){t.lineRipple&&t.lineRipple.activate()},deactivateBottomLine:function(){t.lineRipple&&t.lineRipple.deactivate()},notifyChange:function(e){var n=t.selectedIndex;t.emit(Lt.CHANGE_EVENT,{value:e,index:n},!0),t.hiddenInput&&(t.hiddenInput.value=e)}}},n.prototype.getOutlineAdapterMethods=function(){var t=this;return{hasOutline:function(){return Boolean(t.outline)},notchOutline:function(e){t.outline&&t.outline.notch(e)},closeOutline:function(){t.outline&&t.outline.closeNotch()}}},n.prototype.getLabelAdapterMethods=function(){var t=this;return{hasLabel:function(){return!!t.label},floatLabel:function(e){t.label&&t.label.float(e)},getLabelWidth:function(){return t.label?t.label.getWidth():0},setLabelRequired:function(e){t.label&&t.label.setRequired(e)}}},n.prototype.getNormalizedXCoordinate=function(t){var e=t.target.getBoundingClientRect();return(this.isTouchEvent(t)?t.touches[0].clientX:t.clientX)-e.left},n.prototype.isTouchEvent=function(t){return Boolean(t.touches)},n.prototype.getFoundationMap=function(){return{helperText:this.helperText?this.helperText.foundationForSelect:void 0,leadingIcon:this.leadingIcon?this.leadingIcon.foundationForSelect:void 0}},n}(u),Vt={ROOT:"mdc-text-field-character-counter"},Ut={ROOT_SELECTOR:"."+Vt.ROOT},jt=function(t){function n(e){return t.call(this,i(i({},n.defaultAdapter),e))||this}return e(n,t),Object.defineProperty(n,"cssClasses",{get:function(){return Vt},enumerable:!0,configurable:!0}),Object.defineProperty(n,"strings",{get:function(){return Ut},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{setContent:function(){}}},enumerable:!0,configurable:!0}),n.prototype.setCounterValue=function(t,e){t=Math.min(t,e),this.adapter.setContent(t+" / "+e)},n}(s),qt=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.attachTo=function(t){return new n(t)},Object.defineProperty(n.prototype,"foundationForTextField",{get:function(){return this.foundation},enumerable:!0,configurable:!0}),n.prototype.getDefaultFoundation=function(){var t=this;return new jt({setContent:function(e){t.root.textContent=e}})},n}(u),Gt={ARIA_CONTROLS:"aria-controls",ARIA_DESCRIBEDBY:"aria-describedby",INPUT_SELECTOR:".mdc-text-field__input",LABEL_SELECTOR:".mdc-floating-label",LEADING_ICON_SELECTOR:".mdc-text-field__icon--leading",LINE_RIPPLE_SELECTOR:".mdc-line-ripple",OUTLINE_SELECTOR:".mdc-notched-outline",PREFIX_SELECTOR:".mdc-text-field__affix--prefix",SUFFIX_SELECTOR:".mdc-text-field__affix--suffix",TRAILING_ICON_SELECTOR:".mdc-text-field__icon--trailing"},Wt={DISABLED:"mdc-text-field--disabled",FOCUSED:"mdc-text-field--focused",HELPER_LINE:"mdc-text-field-helper-line",INVALID:"mdc-text-field--invalid",LABEL_FLOATING:"mdc-text-field--label-floating",NO_LABEL:"mdc-text-field--no-label",OUTLINED:"mdc-text-field--outlined",ROOT:"mdc-text-field",TEXTAREA:"mdc-text-field--textarea",WITH_LEADING_ICON:"mdc-text-field--with-leading-icon",WITH_TRAILING_ICON:"mdc-text-field--with-trailing-icon"},Xt={LABEL_SCALE:.75},Kt=["pattern","min","max","required","step","minlength","maxlength"],zt=["color","date","datetime-local","month","range","time","week"],Yt=["mousedown","touchstart"],Qt=["click","keydown"],Zt=function(t){function n(e,r){void 0===r&&(r={});var o=t.call(this,i(i({},n.defaultAdapter),e))||this;return o.isFocused_=!1,o.receivedUserInput_=!1,o.isValid_=!0,o.useNativeValidation_=!0,o.validateOnValueChange_=!0,o.helperText_=r.helperText,o.characterCounter_=r.characterCounter,o.leadingIcon_=r.leadingIcon,o.trailingIcon_=r.trailingIcon,o.inputFocusHandler_=function(){return o.activateFocus()},o.inputBlurHandler_=function(){return o.deactivateFocus()},o.inputInputHandler_=function(){return o.handleInput()},o.setPointerXOffset_=function(t){return o.setTransformOrigin(t)},o.textFieldInteractionHandler_=function(){return o.handleTextFieldInteraction()},o.validationAttributeChangeHandler_=function(t){return o.handleValidationAttributeChange(t)}
vendor: 4,228 bytes, line 21471
21471,o}return e(n,t),Object.defineProperty(n,"cssClasses",{get:function(){return Wt},enumerable:!0,configurable:!0}),Object.defineProperty(n,"strings",{get:function(){return Gt},enumerable:!0,configurable:!0}),Object.defineProperty(n,"numbers",{get:function(){return Xt},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"shouldAlwaysFloat_",{get:function(){var t=this.getNativeInput_().type;return zt.indexOf(t)>=0},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"shouldFloat",{get:function(){return this.shouldAlwaysFloat_||this.isFocused_||!!this.getValue()||this.isBadInput_()},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"shouldShake",{get:function(){return!this.isFocused_&&!this.isValid()&&!!this.getValue()},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!0},setInputAttr:function(){},removeInputAttr:function(){},registerTextFieldInteractionHandler:function(){},deregisterTextFieldInteractionHandler:function(){},registerInputInteractionHandler:function(){},deregisterInputInteractionHandler:function(){},registerValidationAttributeChangeHandler:function(){return new MutationObserver((function(){}))},deregisterValidationAttributeChangeHandler:function(){},getNativeInput:function(){return null},isFocused:function(){return!1},activateLineRipple:function(){},deactivateLineRipple:function(){},setLineRippleTransformOrigin:function(){},shakeLabel:function(){},floatLabel:function(){},setLabelRequired:function(){},hasLabel:function(){return!1},getLabelWidth:function(){return 0},hasOutline:function(){return!1},notchOutline:function(){},closeOutline:function(){}}},enumerable:!0,configurable:!0}),n.prototype.init=function(){var t=this;this.adapter.hasLabel()&&this.getNativeInput_().required&&this.adapter.setLabelRequired(!0),this.adapter.isFocused()?this.inputFocusHandler_():this.adapter.hasLabel()&&this.shouldFloat&&(this.notchOutline(!0),this.adapter.floatLabel(!0),this.styleFloating_(!0)),this.adapter.registerInputInteractionHandler("focus",this.inputFocusHandler_),this.adapter.registerInputInteractionHandler("blur",this.inputBlurHandler_),this.adapter.registerInputInteractionHandler("input",this.inputInputHandler_),Yt.forEach((function(e){t.adapter.registerInputInteractionHandler(e,t.setPointerXOffset_)})),Qt.forEach((function(e){t.adapter.registerTextFieldInteractionHandler(e,t.textFieldInteractionHandler_)})),this.validationObserver_=this.adapter.registerValidationAttributeChangeHandler(this.validationAttributeChangeHandler_),this.setCharacterCounter_(this.getValue().length)},n.prototype.destroy=function(){var t=this;this.adapter.deregisterInputInteractionHandler("focus",this.inputFocusHandler_),this.adapter.deregisterInputInteractionHandler("blur",this.inputBlurHandler_),this.adapter.deregisterInputInteractionHandler("input",this.inputInputHandler_),Yt.forEach((function(e){t.adapter.deregisterInputInteractionHandler(e,t.setPointerXOffset_)})),Qt.forEach((function(e){t.adapter.deregisterTextFieldInteractionHandler(e,t.textFieldInteractionHandler_)})),this.adapter.deregisterValidationAttributeChangeHandler(this.validationObserver_)},n.prototype.handleTextFieldInteraction=function(){var t=this.adapter.getNativeInput();t&&t.disabled||(this.receivedUserInput_=!0)},n.prototype.handleValidationAttributeChange=function(t){var e=this;t.some((function(t){return Kt.indexOf(t)>-1&&(e.styleValidity_(!0),e.adapter.setLabelRequired(e.getNativeInput_().required),!0)})),t.indexOf("maxlength")>-1&&this.setCharacterCounter_(this.getValue().length)},n.prototype.notchOutline=function(t){if(this.adapter.hasOutline()&&this.adapter.hasLabel())if(t){var e=this.adapter.getLabelWidth()*Xt.LABEL_SCALE;this.adapter.notchOutline(e)}else this.adapter.closeOutline()},n.prototype.activateFocus=function(){this.isFocused_=!0,this.styleFocused_(this.isFocused_),this.adapter.activateLineRipple(),this.adapter.hasLabel()&&(this.notchOutline(this.shouldFloat),this.adapter.floatLabel(this.shouldFloat),this.styleFloating_(this.shouldFloat),this.adapter.shakeLabel(this.shouldShake)),!this.helperText_||!this.helperText_.isPersistent
vendor: 4,137 bytes, line 21471
21471()&&this.helperText_.isValidation()&&this.isValid_||this.helperText_.showToScreenReader()},n.prototype.setTransformOrigin=function(t){if(!this.isDisabled()&&!this.adapter.hasOutline()){var e=t.touches,n=e?e[0]:t,i=n.target.getBoundingClientRect(),r=n.clientX-i.left;this.adapter.setLineRippleTransformOrigin(r)}},n.prototype.handleInput=function(){this.autoCompleteFocus(),this.setCharacterCounter_(this.getValue().length)},n.prototype.autoCompleteFocus=function(){this.receivedUserInput_||this.activateFocus()},n.prototype.deactivateFocus=function(){this.isFocused_=!1,this.adapter.deactivateLineRipple();var t=this.isValid();this.styleValidity_(t),this.styleFocused_(this.isFocused_),this.adapter.hasLabel()&&(this.notchOutline(this.shouldFloat),this.adapter.floatLabel(this.shouldFloat),this.styleFloating_(this.shouldFloat),this.adapter.shakeLabel(this.shouldShake)),this.shouldFloat||(this.receivedUserInput_=!1)},n.prototype.getValue=function(){return this.getNativeInput_().value},n.prototype.setValue=function(t){if(this.getValue()!==t&&(this.getNativeInput_().value=t),this.setCharacterCounter_(t.length),this.validateOnValueChange_){var e=this.isValid();this.styleValidity_(e)}this.adapter.hasLabel()&&(this.notchOutline(this.shouldFloat),this.adapter.floatLabel(this.shouldFloat),this.styleFloating_(this.shouldFloat),this.validateOnValueChange_&&this.adapter.shakeLabel(this.shouldShake))},n.prototype.isValid=function(){return this.useNativeValidation_?this.isNativeInputValid_():this.isValid_},n.prototype.setValid=function(t){this.isValid_=t,this.styleValidity_(t);var e=!t&&!this.isFocused_&&!!this.getValue();this.adapter.hasLabel()&&this.adapter.shakeLabel(e)},n.prototype.setValidateOnValueChange=function(t){this.validateOnValueChange_=t},n.prototype.getValidateOnValueChange=function(){return this.validateOnValueChange_},n.prototype.setUseNativeValidation=function(t){this.useNativeValidation_=t},n.prototype.isDisabled=function(){return this.getNativeInput_().disabled},n.prototype.setDisabled=function(t){this.getNativeInput_().disabled=t,this.styleDisabled_(t)},n.prototype.setHelperTextContent=function(t){this.helperText_&&this.helperText_.setContent(t)},n.prototype.setLeadingIconAriaLabel=function(t){this.leadingIcon_&&this.leadingIcon_.setAriaLabel(t)},n.prototype.setLeadingIconContent=function(t){this.leadingIcon_&&this.leadingIcon_.setContent(t)},n.prototype.setTrailingIconAriaLabel=function(t){this.trailingIcon_&&this.trailingIcon_.setAriaLabel(t)},n.prototype.setTrailingIconContent=function(t){this.trailingIcon_&&this.trailingIcon_.setContent(t)},n.prototype.setCharacterCounter_=function(t){if(this.characterCounter_){var e=this.getNativeInput_().maxLength;if(-1===e)throw new Error("MDCTextFieldFoundation: Expected maxlength html property on text input or textarea.");this.characterCounter_.setCounterValue(t,e)}},n.prototype.isBadInput_=function(){return this.getNativeInput_().validity.badInput||!1},n.prototype.isNativeInputValid_=function(){return this.getNativeInput_().validity.valid},n.prototype.styleValidity_=function(t){var e=n.cssClasses.INVALID;if(t?this.adapter.removeClass(e):this.adapter.addClass(e),this.helperText_){if(this.helperText_.setValidity(t),!this.helperText_.isValidation())return;var i=this.helperText_.isVisible(),r=this.helperText_.getId();i&&r?this.adapter.setInputAttr(Gt.ARIA_DESCRIBEDBY,r):this.adapter.removeInputAttr(Gt.ARIA_DESCRIBEDBY)}},n.prototype.styleFocused_=function(t){var e=n.cssClasses.FOCUSED;t?this.adapter.addClass(e):this.adapter.removeClass(e)},n.prototype.styleDisabled_=function(t){var e=n.cssClasses,i=e.DISABLED,r=e.INVALID;t?(this.adapter.addClass(i),this.adapter.removeClass(r)):this.adapter.removeClass(i),this.leadingIcon_&&this.leadingIcon_.setDisabled(t),this.trailingIcon_&&this.trailingIcon_.setDisabled(t)},n.prototype.styleFloating_=function(t){var e=n.cssClasses.LABEL_FLOATING;t?this.adapter.addClass(e):this.adapter.removeClass(e)},n.prototype.getNativeInput_=function(){return(this.adapter?this.adapter.getNativeInput():null)||{disabled:!1,maxLength:-1,required:!1,type:"input",validity:{badInput:!1,valid:!0},value:""}},n}
vendor: 2,849 bytes, line 21471
21471(s),$t={HELPER_TEXT_PERSISTENT:"mdc-text-field-helper-text--persistent",HELPER_TEXT_VALIDATION_MSG:"mdc-text-field-helper-text--validation-msg",ROOT:"mdc-text-field-helper-text"},Jt={ARIA_HIDDEN:"aria-hidden",ROLE:"role",ROOT_SELECTOR:"."+$t.ROOT},te=function(t){function n(e){return t.call(this,i(i({},n.defaultAdapter),e))||this}return e(n,t),Object.defineProperty(n,"cssClasses",{get:function(){return $t},enumerable:!0,configurable:!0}),Object.defineProperty(n,"strings",{get:function(){return Jt},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},getAttr:function(){return null},setAttr:function(){},removeAttr:function(){},setContent:function(){}}},enumerable:!0,configurable:!0}),n.prototype.getId=function(){return this.adapter.getAttr("id")},n.prototype.isVisible=function(){return"true"!==this.adapter.getAttr(Jt.ARIA_HIDDEN)},n.prototype.setContent=function(t){this.adapter.setContent(t)},n.prototype.isPersistent=function(){return this.adapter.hasClass($t.HELPER_TEXT_PERSISTENT)},n.prototype.setPersistent=function(t){t?this.adapter.addClass($t.HELPER_TEXT_PERSISTENT):this.adapter.removeClass($t.HELPER_TEXT_PERSISTENT)},n.prototype.isValidation=function(){return this.adapter.hasClass($t.HELPER_TEXT_VALIDATION_MSG)},n.prototype.setValidation=function(t){t?this.adapter.addClass($t.HELPER_TEXT_VALIDATION_MSG):this.adapter.removeClass($t.HELPER_TEXT_VALIDATION_MSG)},n.prototype.showToScreenReader=function(){this.adapter.removeAttr(Jt.ARIA_HIDDEN)},n.prototype.setValidity=function(t){var e=this.adapter.hasClass($t.HELPER_TEXT_PERSISTENT),n=this.adapter.hasClass($t.HELPER_TEXT_VALIDATION_MSG)&&!t;n?(this.showToScreenReader(),this.adapter.setAttr(Jt.ROLE,"alert")):this.adapter.removeAttr(Jt.ROLE),e||n||this.hide_()},n.prototype.hide_=function(){this.adapter.setAttr(Jt.ARIA_HIDDEN,"true")},n}(s),ee=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.attachTo=function(t){return new n(t)},Object.defineProperty(n.prototype,"foundationForTextField",{get:function(){return this.foundation},enumerable:!0,configurable:!0}),n.prototype.getDefaultFoundation=function(){var t=this;return new te({addClass:function(e){return t.root.classList.add(e)},removeClass:function(e){return t.root.classList.remove(e)},hasClass:function(e){return t.root.classList.contains(e)},getAttr:function(e){return t.root.getAttribute(e)},setAttr:function(e,n){return t.root.setAttribute(e,n)},removeAttr:function(e){return t.root.removeAttribute(e)},setContent:function(e){t.root.textContent=e}})},n}(u),ne={ICON_EVENT:"MDCTextField:icon",ICON_ROLE:"button"},ie={ROOT:"mdc-text-field__icon"},re=["click","keydown"],oe=function(t){function n(e){var r=t.call(this,i(i({},n.defaultAdapter),e))||this;
vendor: 6,032 bytes, line 21471
21471return r.savedTabIndex_=null,r.interactionHandler_=function(t){return r.handleInteraction(t)},r}return e(n,t),Object.defineProperty(n,"strings",{get:function(){return ne},enumerable:!0,configurable:!0}),Object.defineProperty(n,"cssClasses",{get:function(){return ie},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{getAttr:function(){return null},setAttr:function(){},removeAttr:function(){},setContent:function(){},registerInteractionHandler:function(){},deregisterInteractionHandler:function(){},notifyIconAction:function(){}}},enumerable:!0,configurable:!0}),n.prototype.init=function(){var t=this;this.savedTabIndex_=this.adapter.getAttr("tabindex"),re.forEach((function(e){t.adapter.registerInteractionHandler(e,t.interactionHandler_)}))},n.prototype.destroy=function(){var t=this;re.forEach((function(e){t.adapter.deregisterInteractionHandler(e,t.interactionHandler_)}))},n.prototype.setDisabled=function(t){this.savedTabIndex_&&(t?(this.adapter.setAttr("tabindex","-1"),this.adapter.removeAttr("role")):(this.adapter.setAttr("tabindex",this.savedTabIndex_),this.adapter.setAttr("role",ne.ICON_ROLE)))},n.prototype.setAriaLabel=function(t){this.adapter.setAttr("aria-label",t)},n.prototype.setContent=function(t){this.adapter.setContent(t)},n.prototype.handleInteraction=function(t){var e="Enter"===t.key||13===t.keyCode;("click"===t.type||e)&&(t.preventDefault(),this.adapter.notifyIconAction())},n}(s),ae=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.attachTo=function(t){return new n(t)},Object.defineProperty(n.prototype,"foundationForTextField",{get:function(){return this.foundation},enumerable:!0,configurable:!0}),n.prototype.getDefaultFoundation=function(){var t=this;return new oe({getAttr:function(e){return t.root.getAttribute(e)},setAttr:function(e,n){return t.root.setAttribute(e,n)},removeAttr:function(e){return t.root.removeAttribute(e)},setContent:function(e){t.root.textContent=e},registerInteractionHandler:function(e,n){return t.listen(e,n)},deregisterInteractionHandler:function(e,n){return t.unlisten(e,n)},notifyIconAction:function(){return t.emit(oe.strings.ICON_EVENT,{},!0)}})},n}(u),se=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.attachTo=function(t){return new n(t)},n.prototype.initialize=function(t,e,n,i,r,o,a){void 0===t&&(t=function(t,e){return new St(t,e)}),void 0===e&&(e=function(t){return new y(t)}),void 0===n&&(n=function(t){return new ee(t)}),void 0===i&&(i=function(t){return new qt(t)}),void 0===r&&(r=function(t){return new ae(t)}),void 0===o&&(o=function(t){return new E(t)}),void 0===a&&(a=function(t){return new mt(t)}),this.input_=this.root.querySelector(Gt.INPUT_SELECTOR);var s=this.root.querySelector(Gt.LABEL_SELECTOR);this.label_=s?o(s):null;var u=this.root.querySelector(Gt.LINE_RIPPLE_SELECTOR);this.lineRipple_=u?e(u):null;var c=this.root.querySelector(Gt.OUTLINE_SELECTOR);this.outline_=c?a(c):null;var d=te.strings,l=this.root.nextElementSibling,h=l&&l.classList.contains(Wt.HELPER_LINE),p=h&&l&&l.querySelector(d.ROOT_SELECTOR);this.helperText_=p?n(p):null;var f=jt.strings,m=this.root.querySelector(f.ROOT_SELECTOR);!m&&h&&l&&(m=l.querySelector(f.ROOT_SELECTOR)),this.characterCounter_=m?i(m):null;var I=this.root.querySelector(Gt.LEADING_ICON_SELECTOR);this.leadingIcon_=I?r(I):null;var _=this.root.querySelector(Gt.TRAILING_ICON_SELECTOR);this.trailingIcon_=_?r(_):null,this.prefix_=this.root.querySelector(Gt.PREFIX_SELECTOR),this.suffix_=this.root.querySelector(Gt.SUFFIX_SELECTOR),this.ripple=this.createRipple_(t)},n.prototype.destroy=function(){this.ripple&&this.ripple.destroy(),this.lineRipple_&&this.lineRipple_.destroy(),this.helperText_&&this.helperText_.destroy(),this.characterCounter_&&this.characterCounter_.destroy(),this.leadingIcon_&&this.leadingIcon_.destroy(),this.trailingIcon_&&this.trailingIcon_.destroy(),this.label_&&this.label_.destroy(),this.outline_&&this.outline_.destroy(),t.prototype.destroy.call(this)},n.prototype.initialSyncWithDOM=function(){this.disabled=this.input_.disabled},Object.defineProperty(n.prototype,"value",{get:function(){return this.foundation.getValue()},set:function(t){this.foundation.setValue(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"disabled",{get:function(){return this.foundation.isDisabled()},set:function(t){this.foundation.setDisabled(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"valid",{get:function(){return this.foundation.isValid()},set:function(t){this.foundation.setValid(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"required",{get:function(){return this.input_.required},set:function(t){this.input_.required=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"pattern",{get:function(){return this.input_.pattern},set:function(t){this.input_.pattern=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"minLength",{get:function(){return this.input_.minLength},set:function(t){this.input_.minLength=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"maxLength",{get:function(){return this.input_.maxLength},set:function(t){t<0?this.input_.removeAttribute("maxLength"):this.input_.maxLength=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"min",{get:function(){return this.input_.min},set:function(t){this.input_.min=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"max",{get:function(){return this.input_.max},set:function(t){this.input_.max=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"step",{get:function(){return this.input_.step},set:function(t){this.input_.step=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"helperTextContent",{set:function(t){this.foundation.setHelperTextContent(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"leadingIconAriaLabel",{set:function(t){this.foundation.setLeadingIconAriaLabel(t)}
vendor: 4,242 bytes, line 21471
21471,enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"leadingIconContent",{set:function(t){this.foundation.setLeadingIconContent(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"trailingIconAriaLabel",{set:function(t){this.foundation.setTrailingIconAriaLabel(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"trailingIconContent",{set:function(t){this.foundation.setTrailingIconContent(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"useNativeValidation",{set:function(t){this.foundation.setUseNativeValidation(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"prefixText",{get:function(){return this.prefix_?this.prefix_.textContent:null},set:function(t){this.prefix_&&(this.prefix_.textContent=t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"suffixText",{get:function(){return this.suffix_?this.suffix_.textContent:null},set:function(t){this.suffix_&&(this.suffix_.textContent=t)},enumerable:!0,configurable:!0}),n.prototype.focus=function(){this.input_.focus()},n.prototype.layout=function(){var t=this.foundation.shouldFloat;this.foundation.notchOutline(t)},n.prototype.getDefaultFoundation=function(){var t=i(i(i(i(i({},this.getRootAdapterMethods_()),this.getInputAdapterMethods_()),this.getLabelAdapterMethods_()),this.getLineRippleAdapterMethods_()),this.getOutlineAdapterMethods_());return new Zt(t,this.getFoundationMap_())},n.prototype.getRootAdapterMethods_=function(){var t=this;return{addClass:function(e){return t.root.classList.add(e)},removeClass:function(e){return t.root.classList.remove(e)},hasClass:function(e){return t.root.classList.contains(e)},registerTextFieldInteractionHandler:function(e,n){t.listen(e,n)},deregisterTextFieldInteractionHandler:function(e,n){t.unlisten(e,n)},registerValidationAttributeChangeHandler:function(e){var n=new MutationObserver((function(t){return e(function(t){return t.map((function(t){return t.attributeName})).filter((function(t){return t}))}(t))}));return n.observe(t.input_,{attributes:!0}),n},deregisterValidationAttributeChangeHandler:function(t){t.disconnect()}}},n.prototype.getInputAdapterMethods_=function(){var t=this;return{getNativeInput:function(){return t.input_},setInputAttr:function(e,n){t.input_.setAttribute(e,n)},removeInputAttr:function(e){t.input_.removeAttribute(e)},isFocused:function(){return document.activeElement===t.input_},registerInputInteractionHandler:function(e,n){t.input_.addEventListener(e,n,Et())},deregisterInputInteractionHandler:function(e,n){t.input_.removeEventListener(e,n,Et())}}},n.prototype.getLabelAdapterMethods_=function(){var t=this;return{floatLabel:function(e){return t.label_&&t.label_.float(e)},getLabelWidth:function(){return t.label_?t.label_.getWidth():0},hasLabel:function(){return Boolean(t.label_)},shakeLabel:function(e){return t.label_&&t.label_.shake(e)},setLabelRequired:function(e){return t.label_&&t.label_.setRequired(e)}}},n.prototype.getLineRippleAdapterMethods_=function(){var t=this;return{activateLineRipple:function(){t.lineRipple_&&t.lineRipple_.activate()},deactivateLineRipple:function(){t.lineRipple_&&t.lineRipple_.deactivate()},setLineRippleTransformOrigin:function(e){t.lineRipple_&&t.lineRipple_.setRippleCenter(e)}}},n.prototype.getOutlineAdapterMethods_=function(){var t=this;return{closeOutline:function(){return t.outline_&&t.outline_.closeNotch()},hasOutline:function(){return Boolean(t.outline_)},notchOutline:function(e){return t.outline_&&t.outline_.notch(e)}}},n.prototype.getFoundationMap_=function(){return{characterCounter:this.characterCounter_?this.characterCounter_.foundationForTextField:void 0,helperText:this.helperText_?this.helperText_.foundationForTextField:void 0,leadingIcon:this.leadingIcon_?this.leadingIcon_.foundationForTextField:void 0,trailingIcon:this.trailingIcon_?this.trailingIcon_.foundationForTextField:void 0}},n.prototype.createRipple_=function(t){var e=this,n=this.root.classList.contains(Wt.TEXTAREA),r=this.root.classList.contains(Wt.OUTLINED);if(n||r)return null;var o=i(i({},St.createAdapter(this)),{isSurfaceActive:function(){return d(e.input_,":active")},registerInteractionHandler:function(t,n){return e.input_.addEventListener(t,n,Et
21471())},deregisterInteractionHandler:function(t,n){return e.input_.removeEventListener(t,n,Et())}});return t(this.root,new bt(o))},n}(u),ue={ANIM_CHECKED_INDETERMINATE:"mdc-checkbox--anim-checked-indeterminate",ANIM_CHECKED_UNCHECKED:"mdc-checkbox--anim-checked-unchecked",ANIM_INDETERMINATE_CHECKED:"mdc-checkbox--anim-indeterminate-checked",ANIM_INDETERMINATE_UNCHECKED:"mdc-checkbox--anim-indeterminate-unchecked",ANIM_UNCHECKED_CHECKED:"mdc-checkbox--anim-unchecked-checked",ANIM_UNCHECKED_INDETERMINATE:"mdc-checkbox--anim-unchecked-indeterminate",BACKGROUND:"mdc-checkbox__background",CHECKED:"mdc-checkbox--checked",CHECKMARK:"mdc-checkbox__checkmark",CHECKMARK_PATH:"mdc-checkbox__checkmark-path",DISABLED:"mdc-checkbox--disabled",INDETERMINATE:"mdc-checkbox--indeterminate",MIXEDMARK:"mdc-checkbox__mixedmark",NATIVE_CONTROL:"mdc-checkbox__native-control",ROOT:"mdc-checkbox",SELECTED:"mdc-checkbox--selected",UPGRADED:"mdc-checkbox--upgraded"},ce={ARIA_CHECKED_ATTR:"aria-checked",ARIA_CHECKED_INDETERMINATE_VALUE:"mixed",DATA_INDETERMINATE_ATTR:"data-indeterminate",NATIVE_CONTROL_SELECTOR:".mdc-checkbox__native-control",TRANSITION_STATE_CHECKED:"checked",TRANSITION_STATE_INDETERMINATE:"indeterminate",TRANSITION_STATE_INIT:"init",TRANSITION_STATE_UNCHECKED:"unchecked"},de={ANIM_END_LATCH_MS:250},le=function(t){function n(e){var r=t.call(this,i(i({},n.defaultAdapter),e))||this;return r.currentCheckState_=ce.TRANSITION_STATE_INIT,r.currentAnimationClass_="",r.animEndLatchTimer_=0,r.enableAnimationEndHandler_=!1,r}return e(n,t),Object.defineProperty(n,"cssClasses",{get:function(){return ue},enumerable:!0,configurable:!0}),Object.defineProperty(n,"strings",{get:function(){return ce},enumerable:!0,configurable:!0}),Object.defineProperty(n,"numbers",{get:function(){return de},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addClass:function(){},forceLayout:function(){},hasNativeControl:function(){return!1},isAttachedToDOM:function(){return!1},isChecked:function(){return!1},isIndeterminate:function(){return!1},removeClass:function(){},removeNativeControlAttr:function(){},setNativeControlAttr:function(){},setNativeControlDisabled:function(){}}},enumerable:!0,configurable:!0}),n.prototype.init=function(){this.currentCheckState_=this.determineCheckState_(),this.updateAriaChecked_(),this.adapter.addClass(ue.UPGRADED)},n.prototype.destroy=function(){clearTimeout(this.animEndLatchTimer_)},n.prototype.setDisabled=function(t){this.adapter.setNativeControlDisabled(t),t?this.adapter.addClass(ue.DISABLED):this.adapter.removeClass(ue.DISABLED)},n.prototype.handleAnimationEnd=function(){var t=this;this.enableAnimationEndHandler_&&(clearTimeout(this.animEndLatchTimer_),this.animEndLatchTimer_=setTimeout((function(){t.adapter.removeClass(t.currentAnimationClass_),t.enableAnimationEndHandler_=!1}),de.ANIM_END_LATCH_MS))},n.prototype.handleChange=function(){this.transitionCheckState_()},n.prototype.transitionCheckState_=function(){if(this.adapter.hasNativeControl()){var t=this.currentCheckState_,e=this.determineCheckState_();if(t!==e){this.updateAriaChecked_();var n=ue.SELECTED;e===ce.TRANSITION_STATE_UNCHECKED?this.adapter.removeClass(n):this.adapter.addClass(n),this.currentAnimationClass_.length>0&&(clearTimeout(this.animEndLatchTimer_),this.adapter.forceLayout(),this.adapter.removeClass(this.currentAnimationClass_)),this.currentAnimationClass_=this.getTransitionAnimationClass_(t,e),this.currentCheckState_=e,this.adapter.isAttachedToDOM()&&this.currentAnimationClass_.length>0&&(this.adapter.addClass(this.currentAnimationClass_),this.enableAnimationEndHandler_=!0)}}},n.prototype.determineCheckState_=function(){var t=ce.TRANSITION_STATE_INDETERMINATE,e=ce.TRANSITION_STATE_CHECKED,n=ce.TRANSITION_STATE_UNCHECKED;return this.adapter.isIndeterminate()?t:this.adapter.isChecked()?e:n},n.prototype.getTransitionAnimationClass_=function(t,e){var i=ce.TRANSITION_STATE_INIT,r=ce.TRANSITION_STATE_CHECKED,o=ce.TRANSITION_STATE_UNCHECKED,a=n.cssClasses,s=a.ANIM_UNCHECKED_CHECKED,u=a.ANIM_UNCHECKED_INDETERMINATE,c=a.ANIM_CHECKED_UNCHECKED,d=a.ANIM_CHECKED_INDETERMINATE,l=a.ANIM_INDETERMINATE_CHECKED,h=a.ANIM_INDETERMINATE_UNCHECKED;switch(t){case i:return e===o?"":e===r?l:h;case o:return e===r?s:u;case r:return e===o?c:d;default:return e===r?l:h}},n.prototype.updateAriaChecked_=function(){this.adapter.isIndeterminate()?this.adapter.setNativeControlAttr(ce.ARIA_CHECKED_ATTR,ce.ARIA_CHECKED_INDETERMINATE_VALUE):this.adapter.removeNativeControlAttr(ce.ARIA_CHECKED_ATTR)},n}(s),he=["checked","indeterminate"],pe=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.ripple_=e.createRipple_(),e}return e(n,t),n.attachTo=function(t){return new n(t)},Object.defineProperty(n.prototype,"ripple",{get:function(){return this.ripple_},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"checked",{get:function(){return this.nativeControl_.checked},set:function(t){this.nativeControl_.checked=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"indeterminate",{get:function(){return this.nativeControl_.indeterminate},set:function(t){this.nativeControl_.indeterminate=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"disabled",{get:function(){return this.nativeControl_.disabled},set:function(t){this.foundation.setDisabled(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){return this.nativeControl_.value},set:function(t){this.nativeControl_.value=t},enumerable:!0,configurable:!0}),n.prototype.initialize=function(){var t=ce.DATA_INDETERMINATE_ATTR;this.nativeControl_.indeterminate="true"===this.nativeControl_.getAttribute(t),this.nativeControl_.removeAttribute(t)},n.prototype.initialSyncWithDOM=function(){var t=this;this.handleChange_=function(){return t.foundation.handleChange()},this.handleAnimationEnd_=function(){return t.foundation.handleAnimationEnd()},this.nativeControl_.addEventListener("change",this.handleChange_),this.listen(it(window,"animationend"),this.handleAnimationEnd_),this.installPropertyChangeHooks_()},n.prototype.destroy=function(){this.ripple_.destroy(),this.nativeControl_.removeEventListener("change",this.handleChange_),this.unlisten(it(window,"animationend"),this.handleAnimationEnd_),this.uninstallPropertyChangeHooks_(),t.prototype.destroy.call(this)},n.prototype.getDefaultFoundation=function(){var t=this;return new le({addClass:function(e){return t.root.classList.add(e)},forceLayout:function(){return t.root.offsetWidth},hasNativeControl:function(){return!!t.nativeControl_},isAttachedToDOM:function(){return Boolean(t.root.parentNode)},isChecked:function(){return t.checked},isIndeterminate:function(){return t.indeterminate},removeClass:function(e){t.root.classList.remove(e)},removeNativeControlAttr:function(e){t.nativeControl_.removeAttribute(e)},setNativeControlAttr:function(e,n){t.nativeControl_.setAttribute(e,n)},setNativeControlDisabled:function(e){t.nativeControl_.disabled=e}})},n.prototype.createRipple_=function(){var t=this,e=i(i({},St.createAdapter(this)),{deregisterInteractionHandler:function(e,n){return t.nativeControl_.removeEventListener(e,n,Et())},isSurfaceActive:function(){return d(t.nativeControl_,":active")},isUnbounded:function(){return!0},registerInteractionHandler:function(e,n){return t.nativeControl_.addEventListener(e,n,Et())}});return new St(this.root,new bt(e))},n.prototype.installPropertyChangeHooks_=function(){var t=this,e=this.nativeControl_,n=Object.getPrototypeOf(e);he.forEach((function(i){var r=Object.getOwnPropertyDescriptor(n,i);if(fe(r)){var o=r.get,a={configurable:r.configurable,enumerable:r.enumerable,get:o,set:function(n){r.set.call(e,n),t.foundation.handleChange()}};Object.defineProperty(e,i,a)}}))},n.prototype.uninstallPropertyChangeHooks_=function(){var t=this.nativeControl_,e=Object.getPrototypeOf(t);he.forEach((function(n){var i=Object.getOwnPropertyDescriptor(e,n);fe(i)&&Object.defineProperty(t,n,i)}))},Object.defineProperty(n.prototype,"nativeControl_",{get:function(){var t=ce.NATIVE_CONTROL_SELECTOR,e=this.root.querySelector(t);if(!e)throw new Error("Checkbox component requires a "+t+" element");return e},enumerable:!0,configurable:!0}),n}(u);function fe(t){return!!t&&"function"==typeof t.set}!function(t){t.RICH="mdc-tooltip--rich",t.SHOWN="mdc-tooltip--shown",t.SHOWING="mdc-tooltip--showing",t.SHOWING_TRANSITION="mdc-tooltip--showing-transition",t.HIDE="mdc-tooltip--hide",t.HIDE_TRANSITION="mdc-tooltip--hide-transition",t.MULTILINE_TOOLTIP="mdc-tooltip--multiline",t.SURFACE="mdc-tooltip__surface"}(_t||(_t={}));var me,Ee,Ie;!function(t){t[t.DETECTED=0]="DETECTED",t[t.START=1]="START",t[t.CENTER=2]="CENTER",t[t.END=3]="END"}(me||(me={})),function(t){t[t.DETECTED=0]="DETECTED",t[t.ABOVE=1]="ABOVE",t[t.BELOW=2]="BELOW"}(Ee||(Ee={})),function(t){t[t.BOUNDED=0]="BOUNDED",t[t.UNBOUNDED=1]="UNBOUNDED"}(Ie||(Ie={}));var _e,ye="left",ge="right",Ce="center",Ae="bottom",Te=function(){function t(){this.rafIDs=new Map}return t.prototype.request=function(t,e){var n=this;this.cancel(t);var i=requestAnimationFrame((function(i){n.rafIDs.delete(t),e(i)}));this.rafIDs.set(t,i)},t.prototype.cancel=function(t){var e=this.rafIDs.get(t);e&&(cancelAnimationFrame(e),this.rafIDs.delete(t))},t.prototype.cancelAll=function(){var t=this;this.rafIDs.forEach((function(e,n){t.cancel(n)}))},t.prototype.getQueue=function(){var t=[];return this.rafIDs.forEach((function(e,n){t.push(n)})),t},t}(),ve=_t.RICH,be=_t.SHOWN,Se=_t.SHOWING,Oe=_t.SHOWING_TRANSITION,Le=_t.HIDE,xe=_t.HIDE_TRANSITION,Re=_t.MULTILINE_TOOLTIP;!function(t){t.POLL_ANCHOR="poll_anchor"}(_e||(_e={}));var De,we="undefined"!=typeof window,Ne=function(t){function n(e){var r=t.call(this,i(i({},n.defaultAdapter),e))||this;return r.tooltipShown=!1,r.anchorGap=4,r.xTooltipPos=me.DETECTED,r.yTooltipPos=Ee.DETECTED,r.minViewportTooltipThreshold=8,r.hideDelayMs=600,r.showDelayMs=500,r.anchorRect=null,r.parentRect=null,r.frameId=null,r.hideTimeout=null,r.showTimeout=null,r.animFrame=new Te,r.documentClickHandler=function(t){r.handleDocumentClick(t)},r.documentKeydownHandler=function(t){r.handleKeydown(t)},r.richTooltipMouseEnterHandler=function(){r.handleRichTooltipMouseEnter()},r.richTooltipMouseLeaveHandler=function(){r.handleRichTooltipMouseLeave()},r.richTooltipFocusOutHandler=function(t){r.handleRichTooltipFocusOut(t)},r.windowScrollHandler=function(){r.handleWindowChangeEvent()},r.windowResizeHandler=function(){r.handleWindowChangeEvent()},r}return e(n,t),Object.defineProperty(n,"defaultAdapter",{get:function(){return{getAttribute:function(){return null},setAttribute:function(){},addClass:function(){},hasClass:function(){return!1},removeClass:function(){},getComputedStyleProperty:function(){return""},setStyleProperty:function(){},setSurfaceStyleProperty:function(){},getViewportWidth:function(){return 0}
21471,getViewportHeight:function(){return 0},getTooltipSize:function(){return{width:0,height:0}},getAnchorBoundingRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},getParentBoundingRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},getAnchorAttribute:function(){return null},setAnchorAttribute:function(){return null},isRTL:function(){return!1},anchorContainsElement:function(){return!1},tooltipContainsElement:function(){return!1},focusAnchorElement:function(){},registerEventHandler:function(){},deregisterEventHandler:function(){},registerDocumentEventHandler:function(){},deregisterDocumentEventHandler:function(){},registerWindowEventHandler:function(){},deregisterWindowEventHandler:function(){},notifyHidden:function(){}}},enumerable:!0,configurable:!0}),n.prototype.init=function(){this.richTooltip=this.adapter.hasClass(ve),this.persistentTooltip="true"===this.adapter.getAttribute("data-mdc-tooltip-persistent"),this.interactiveTooltip=!!this.adapter.getAnchorAttribute("aria-expanded")&&"dialog"===this.adapter.getAnchorAttribute("aria-haspopup")},n.prototype.isShown=function(){return this.tooltipShown},n.prototype.isRich=function(){return this.richTooltip},n.prototype.isPersistent=function(){return this.persistentTooltip},n.prototype.handleAnchorMouseEnter=function(){var t=this;this.tooltipShown?this.show():(this.clearHideTimeout(),this.showTimeout=setTimeout((function(){t.show()}),this.showDelayMs))},n.prototype.handleAnchorFocus=function(t){var e=this,n=t.relatedTarget;n instanceof HTMLElement&&this.adapter.tooltipContainsElement(n)||(this.showTimeout=setTimeout((function(){e.show()}),this.showDelayMs))},n.prototype.handleAnchorMouseLeave=function(){var t=this;this.clearShowTimeout(),this.hideTimeout=setTimeout((function(){t.hide()}),this.hideDelayMs)},n.prototype.handleAnchorBlur=function(t){this.richTooltip&&t.relatedTarget instanceof HTMLElement&&this.adapter.tooltipContainsElement(t.relatedTarget)||this.hide()},n.prototype.handleAnchorClick=function(){this.tooltipShown?this.hide():this.show()},n.prototype.handleDocumentClick=function(t){var e=t.target instanceof HTMLElement&&(this.adapter.anchorContainsElement(t.target)||this.adapter.tooltipContainsElement(t.target));this.richTooltip&&this.persistentTooltip&&e||this.hide()},n.prototype.handleKeydown=function(t){q(t)===B&&(document.activeElement instanceof HTMLElement&&this.adapter.tooltipContainsElement(document.activeElement)&&this.adapter.focusAnchorElement(),this.hide())},n.prototype.handleRichTooltipMouseEnter=function(){this.show()},n.prototype.handleRichTooltipMouseLeave=function(){var t=this;this.clearShowTimeout(),this.hideTimeout=setTimeout((function(){t.hide()}),this.hideDelayMs)},n.prototype.handleRichTooltipFocusOut=function(t){t.relatedTarget instanceof HTMLElement&&(this.adapter.anchorContainsElement(t.relatedTarget)||this.adapter.tooltipContainsElement(t.relatedTarget))||this.hide()},n.prototype.handleWindowChangeEvent=function(){var t=this;this.animFrame.request(_e.POLL_ANCHOR,(function(){t.repositionTooltipOnAnchorMove()}))},n.prototype.show=function(){var t=this;this.clearHideTimeout(),this.clearShowTimeout(),this.tooltipShown||(this.tooltipShown=!0,this.parseShowTooltipOptions().hideFromScreenreader||this.adapter.setAttribute("aria-hidden","false"),this.richTooltip&&(this.interactiveTooltip&&this.adapter.setAnchorAttribute("aria-expanded","true"),this.adapter.registerEventHandler("focusout",this.richTooltipFocusOutHandler),this.persistentTooltip||(this.adapter.registerEventHandler("mouseenter",this.richTooltipMouseEnterHandler),this.adapter.registerEventHandler("mouseleave",this.richTooltipMouseLeaveHandler))),this.adapter.removeClass(Le),this.adapter.addClass(Se),this.isTooltipMultiline()&&!this.richTooltip&&this.adapter.addClass(Re),this.anchorRect=this.adapter.getAnchorBoundingRect(),this.parentRect=this.adapter.getParentBoundingRect(),this.richTooltip?this.positionRichTooltip():this.positionPlainTooltip(),this.adapter.registerDocumentEventHandler("click",this.documentClickHandler),this.adapter.registerDocumentEventHandler("keydown",this.documentKeydownHandler),this.adapter.registerWindowEventHandler("scroll",this.windowScrollHandler),this.adapter.registerWindowEventHandler("resize",this.windowResizeHandler),this.frameId=requestAnimationFrame((function(){t.clearAllAnimationClasses(),t.adapter.addClass(be),t.adapter.addClass(Oe)})))},n.prototype.hide=function(){this.clearHideTimeout(),this.clearShowTimeout(),this.tooltipShown&&(this.frameId&&cancelAnimationFrame(this.frameId),this.tooltipShown=!1,this.adapter.setAttribute("aria-hidden","true"),this.adapter.deregisterEventHandler("focusout",this.richTooltipFocusOutHandler),this.richTooltip&&(this.interactiveTooltip&&this.adapter.setAnchorAttribute("aria-expanded","fal
21471se"),this.persistentTooltip||(this.adapter.deregisterEventHandler("mouseenter",this.richTooltipMouseEnterHandler),this.adapter.deregisterEventHandler("mouseleave",this.richTooltipMouseLeaveHandler))),this.clearAllAnimationClasses(),this.adapter.addClass(Le),this.adapter.addClass(xe),this.adapter.removeClass(be),this.adapter.deregisterDocumentEventHandler("click",this.documentClickHandler),this.adapter.deregisterDocumentEventHandler("keydown",this.documentKeydownHandler),this.adapter.deregisterWindowEventHandler("scroll",this.windowScrollHandler),this.adapter.deregisterWindowEventHandler("resize",this.windowResizeHandler))},n.prototype.handleTransitionEnd=function(){var t=this.adapter.hasClass(Le);this.adapter.removeClass(Se),this.adapter.removeClass(Oe),this.adapter.removeClass(Le),this.adapter.removeClass(xe),t&&this.adapter.notifyHidden()},n.prototype.clearAllAnimationClasses=function(){this.adapter.removeClass(Oe),this.adapter.removeClass(xe)},n.prototype.setTooltipPosition=function(t){var e=t.xPos,n=t.yPos;e&&(this.xTooltipPos=e),n&&(this.yTooltipPos=n)},n.prototype.setAnchorBoundaryType=function(t){t===Ie.UNBOUNDED?this.anchorGap=8:this.anchorGap=4},n.prototype.parseShowTooltipOptions=function(){return{hideFromScreenreader:Boolean(this.adapter.getAnchorAttribute("data-tooltip-id"))}},n.prototype.isTooltipMultiline=function(){var t=this.adapter.getTooltipSize();return t.height>24&&t.width>=200},n.prototype.positionPlainTooltip=function(){var t=this.calculateTooltipStyles(this.anchorRect),e=t.top,n=t.yTransformOrigin,i=t.left,r=t.xTransformOrigin,o=we?nt(window,"transform"):"transform";this.adapter.setSurfaceStyleProperty(o+"-origin",n+" "+r),this.adapter.setStyleProperty("top",e+"px"),this.adapter.setStyleProperty("left",i+"px")},n.prototype.positionRichTooltip=function(){var t,e,n,i,r=this.adapter.getComputedStyleProperty("width");this.adapter.setStyleProperty("width",r);var o=this.calculateTooltipStyles(this.anchorRect),a=o.top,s=o.yTransformOrigin,u=o.left,c=o.xTransformOrigin,d=we?nt(window,"transform"):"transform";this.adapter.setSurfaceStyleProperty(d+"-origin",s+" "+c);var l=u-(null!==(e=null===(t=this.parentRect)||void 0===t?void 0:t.left)&&void 0!==e?e:0),h=a-(null!==(i=null===(n=this.parentRect)||void 0===n?void 0:n.top)&&void 0!==i?i:0);this.adapter.setStyleProperty("top",h+"px"),this.adapter.setStyleProperty("left",l+"px")},n.prototype.calculateTooltipStyles=function(t){if(!t)return{top:0,left:0};var e=this.adapter.getTooltipSize(),n=this.calculateYTooltipDistance(t,e.height),i=this.calculateXTooltipDistance(t,e.width);return{top:n.distance,yTransformOrigin:n.yTransformOrigin,left:i.distance,xTransformOrigin:i.xTransformOrigin}},n.prototype.calculateXTooltipDistance=function(t,e){var n,i,r,o,a,s=!this.adapter.isRTL();this.richTooltip?(n=s?t.left-e:t.right,i=s?t.right:t.left-e,o=s?ge:ye,a=s?ye:ge):(n=s?t.left:t.right-e,i=s?t.right-e:t.left,r=t.left+(t.width-e)/2,o=s?ye:ge,a=s?ge:ye);var u=this.richTooltip?this.determineValidPositionOptions(n,i):this.determineValidPositionOptions(r,n,i);return this.xTooltipPos===me.START&&u.has(n)?{distance:n,xTransformOrigin:o}:this.xTooltipPos===me.END&&u.has(i)?{distance:i,xTransformOrigin:a}:this.xTooltipPos===me.CENTER&&u.has(r)?{distance:r,xTransformOrigin:Ce}:(this.richTooltip?[{distance:i,xTransformOrigin:a},{distance:n,xTransformOrigin:o}]:[{distance:r,xTransformOrigin:Ce},{distance:n,xTransformOrigin:o},{distance:i,xTransformOrigin:a}]).find((function(t){var e=t.distance;return u.has(e)}))||(t.left<0?{distance:this.minViewportTooltipThreshold,xTransformOrigin:ye}:{distance:this.adapter.getViewportWidth()-(e+this.minViewportTooltipThreshold),xTransformOrigin:ge})},n.prototype.determineValidPositionOptions=function(){for(var t,e,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var o=new Set,a=new Set;try{for(var s=r(n),u=s.next();!u.done;u=s.next()){var c=u.value;this.positionHonorsViewportThreshold(c)?o.add(c):this.positionDoesntCollideWithViewport(c)&&a.add(c)}}catch(e){t={error:e}}finally{try{u&&!u.done&&(e=s.return)&&e.call(s)}finally{if(t)throw t.error}}return o.size?o:a},n.prototype.positionHonorsViewportThreshold=function(t){var e=this.adapter.getViewportWidth();return t+this.adapter.getTooltipSize().width<=e-this.minViewportTooltipThreshold&&t>=this.minViewportTooltipThreshold},n.prototype.positionDoesntCollideWithViewport=function(t){var e=this.adapter.getViewportWidth();return t+this.adapter.getTooltipSize().width<=e&&t>=0},n.prototype.calculateYTooltipDistance=function(t,e){var n=t.bottom+this.anchorGap,i=t.top-(this.anchorGap+e),r=this.determineValidYPositionOptions(i,n);return this.yTooltipPos===Ee.ABOVE&&r.has(i)?{distance:i,yTransformOrigin:Ae}:this.yTooltipPos===Ee.BELOW&&r.has(n)||r.has(n)?{distance:n,yTransformOrigin:"top"}:r.has(i)?{distance:i,yTransformOrigin:Ae}:{distance:n,yTransformOrigin:"top"}},n.prototype.determineValidYPositionOptions=function(t,e){var n=new Set,i=new Set;return this.yPositionHonorsViewportThreshold(t)?n.add(t):this.yPositionDoesntCollideWithViewport(t)&&i.add(t),this.yPositionHonorsViewportThreshold(e)?n.add(e):this.yPositionDoesntCollideWithViewport(e)&&i.add(e),n.size?n:i},n.prototype.yPositionHonorsViewportThreshold=function(t){var e=this.adapter.getViewportHe
21471ight();return t+this.adapter.getTooltipSize().height+this.minViewportTooltipThreshold<=e&&t>=this.minViewportTooltipThreshold},n.prototype.yPositionDoesntCollideWithViewport=function(t){var e=this.adapter.getViewportHeight();return t+this.adapter.getTooltipSize().height<=e&&t>=0},n.prototype.repositionTooltipOnAnchorMove=function(){var t=this.adapter.getAnchorBoundingRect();t&&this.anchorRect&&(t.top===this.anchorRect.top&&t.left===this.anchorRect.left&&t.height===this.anchorRect.height&&t.width===this.anchorRect.width||(this.anchorRect=t,this.parentRect=this.adapter.getParentBoundingRect(),this.richTooltip?this.positionRichTooltip():this.positionPlainTooltip()))},n.prototype.clearShowTimeout=function(){this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=null)},n.prototype.clearHideTimeout=function(){this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=null)},n.prototype.destroy=function(){this.frameId&&(cancelAnimationFrame(this.frameId),this.frameId=null),this.clearHideTimeout(),this.clearShowTimeout(),this.adapter.removeClass(be),this.adapter.removeClass(Oe),this.adapter.removeClass(Se),this.adapter.removeClass(Le),this.adapter.removeClass(xe),this.richTooltip&&(this.adapter.deregisterEventHandler("focusout",this.richTooltipFocusOutHandler),this.persistentTooltip||(this.adapter.deregisterEventHandler("mouseenter",this.richTooltipMouseEnterHandler),this.adapter.deregisterEventHandler("mouseleave",this.richTooltipMouseLeaveHandler))),this.adapter.deregisterDocumentEventHandler("click",this.documentClickHandler),this.adapter.deregisterDocumentEventHandler("keydown",this.documentKeydownHandler),this.adapter.deregisterWindowEventHandler("scroll",this.windowScrollHandler),this.adapter.deregisterWindowEventHandler("resize",this.windowResizeHandler),this.animFrame.cancelAll()},n}(s),He=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.attachTo=function(t){return new n(t)},n.prototype.initialize=function(){var t=this.root.getAttribute("id");if(!t)throw new Error("MDCTooltip: Tooltip component must have an id.");var e=document.querySelector('[aria-describedby="'+t+'"]')||document.querySelector('[data-tooltip-id="'+t+'"]');if(!e)throw new Error("MDCTooltip: Tooltip component requires an anchor element annotated with [aria-describedby] or [data-tooltip-id] anchor element.");this.anchorElem=e},n.prototype.initialSyncWithDOM=function(){var t=this;this.isTooltipRich=this.foundation.isRich(),this.isTooltipPersistent=this.foundation.isPersistent(),this.handleMouseEnter=function(){t.foundation.handleAnchorMouseEnter()},this.handleFocus=function(e){t.foundation.handleAnchorFocus(e)},this.handleMouseLeave=function(){t.foundation.handleAnchorMouseLeave()},this.handleBlur=function(e){t.foundation.handleAnchorBlur(e)},this.handleTransitionEnd=function(){t.foundation.handleTransitionEnd()},this.handleClick=function(){t.foundation.handleAnchorClick()},this.anchorElem.addEventListener("blur",this.handleBlur),this.isTooltipRich&&this.isTooltipPersistent?this.anchorElem.addEventListener("click",this.handleClick):(this.anchorElem.addEventListener("mouseenter",this.handleMouseEnter),this.anchorElem.addEventListener("focus",this.handleFocus),this.anchorElem.addEventListener("mouseleave",this.handleMouseLeave)),this.listen("transitionend",this.handleTransitionEnd)},n.prototype.destroy=function(){this.anchorElem&&(this.anchorElem.removeEventListener("blur",this.handleBlur),this.isTooltipRich&&this.isTooltipPersistent?this.anchorElem.removeEventListener("click",this.handleClick):(this.anchorElem.removeEventListener("mouseenter",this.handleMouseEnter),this.anchorElem.removeEventListener("focus",this.handleFocus),this.anchorElem.removeEventListener("mouseleave",this.handleMouseLeave))),this.unlisten("transitionend",this.handleTransitionEnd),t.prototype.destroy.call(this)},n.prototype.setTooltipPosition=function(t){this.foundation.setTooltipPosition(t)},n.prototype.setAnchorBoundaryType=function(t){this.foundation.setAnchorBoundaryType(t)},n.prototype.hide=function(){this.foundation.hide()},n.prototype.isShown=function(){this.foundation.isShown()},n.prototype.getDefaultFoundation=function(){var t=this;return new Ne({getAttribute:function(e){return t.root.getAttribute(e)},setAttribute:function(e,n){t.root.setAttribute(e,n)},addClass:function(e){t.root.classList.add(e)},hasClass:function(e){return t.root.classList.contains(e)},removeClass:function(e){t.root.classList.remove(e)},getComputedStyleProperty:function(e){return window.getComputedStyle(t.root).getPropertyValue(e)},setStyleProperty:function(e,n){t.root.style.setProperty(e,n)},setSurfaceStyleProperty:function(e,n){var i=t.root.querySelector("."+_t.SURFACE);null==i||i.style.setProperty(e,n)},getViewportWidth:function(){return window.innerWidth}
21471,getViewportHeight:function(){return window.innerHeight},getTooltipSize:function(){return{width:t.root.offsetWidth,height:t.root.offsetHeight}},getAnchorBoundingRect:function(){return t.anchorElem?t.anchorElem.getBoundingClientRect():null},getParentBoundingRect:function(){var e,n;return null!==(n=null===(e=t.root.parentElement)||void 0===e?void 0:e.getBoundingClientRect())&&void 0!==n?n:null},getAnchorAttribute:function(e){return t.anchorElem?t.anchorElem.getAttribute(e):null},setAnchorAttribute:function(e,n){var i;null===(i=t.anchorElem)||void 0===i||i.setAttribute(e,n)},isRTL:function(){return"rtl"===getComputedStyle(t.root).direction},anchorContainsElement:function(e){var n;return!!(null===(n=t.anchorElem)||void 0===n?void 0:n.contains(e))},tooltipContainsElement:function(e){return t.root.contains(e)},focusAnchorElement:function(){var e;null===(e=t.anchorElem)||void 0===e||e.focus()},registerEventHandler:function(e,n){t.root instanceof HTMLElement&&t.root.addEventListener(e,n)},deregisterEventHandler:function(e,n){t.root instanceof HTMLElement&&t.root.removeEventListener(e,n)},registerDocumentEventHandler:function(t,e){document.body.addEventListener(t,e)},deregisterDocumentEventHandler:function(t,e){document.body.removeEventListener(t,e)},registerWindowEventHandler:function(t,e){window.addEventListener(t,e)},deregisterWindowEventHandler:function(t,e){window.removeEventListener(t,e)},notifyHidden:function(){t.emit("MDCTooltip:hidden",{})}})},n}(u),Me={NATIVE_CONTROL_SELECTOR:".mdc-radio__native-control"},Pe={DISABLED:"mdc-radio--disabled",ROOT:"mdc-radio"},Fe=function(t){function n(e){return t.call(this,i(i({},n.defaultAdapter),e))||this}return e(n,t),Object.defineProperty(n,"cssClasses",{get:function(){return Pe},enumerable:!0,configurable:!0}),Object.defineProperty(n,"strings",{get:function(){return Me},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},setNativeControlDisabled:function(){}}},enumerable:!0,configurable:!0}),n.prototype.setDisabled=function(t){var e=n.cssClasses.DISABLED;this.adapter.setNativeControlDisabled(t),t?this.adapter.addClass(e):this.adapter.removeClass(e)},n}(s),ke=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.ripple_=e.createRipple_(),e}return e(n,t),n.attachTo=function(t){return new n(t)},Object.defineProperty(n.prototype,"checked",{get:function(){return this.nativeControl_.checked},set:function(t){this.nativeControl_.checked=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"disabled",{get:function(){return this.nativeControl_.disabled},set:function(t){this.foundation.setDisabled(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){return this.nativeControl_.value},set:function(t){this.nativeControl_.value=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"ripple",{get:function(){return this.ripple_},enumerable:!0,configurable:!0}),n.prototype.destroy=function(){this.ripple_.destroy(),t.prototype.destroy.call(this)},n.prototype.getDefaultFoundation=function(){var t=this;return new Fe({addClass:function(e){return t.root.classList.add(e)},removeClass:function(e){return t.root.classList.remove(e)},setNativeControlDisabled:function(e){return t.nativeControl_.disabled=e}})},n.prototype.createRipple_=function(){var t=this,e=i(i({},St.createAdapter(this)),{registerInteractionHandler:function(e,n){return t.nativeControl_.addEventListener(e,n,Et())},deregisterInteractionHandler:function(e,n){return t.nativeControl_.removeEventListener(e,n,Et())},isSurfaceActive:function(){return!1},isUnbounded:function(){return!0}});return new St(this.root,new bt(e))},Object.defineProperty(n.prototype,"nativeControl_",{get:function(){var t=Fe.strings.NATIVE_CONTROL_SELECTOR,e=this.root.querySelector(t);if(!e)throw new Error("Radio component requires a "+t+" element");return e},enumerable:!0,configurable:!0}),n}(u),Be={CLOSED_CLASS:"mdc-linear-progress--closed",CLOSED_ANIMATION_OFF_CLASS:"mdc-linear-progress--closed-animation-off",INDETERMINATE_CLASS:"mdc-linear-progress--indeterminate",REVERSED_CLASS:"mdc-linear-progress--reversed",ANIMATION_READY_CLASS:"mdc-linear-progress--animation-ready"},Ve={ARIA_VALUEMAX:"aria-valuemax",ARIA_VALUEMIN:"aria-valuemin",ARIA_VALUENOW:"aria-valuenow",BUFFER_BAR_SELECTOR:".mdc-linear-progress__buffer-bar",FLEX_BASIS:"flex-basis",PRIMARY_BAR_SELECTOR:".mdc-linear-progress__primary-bar"},Ue=function(t){function n(e){var r=t.call(this,i(i({},n.defaultAdapter),e))||this;return r.observer=null,r}
21471return e(n,t),Object.defineProperty(n,"cssClasses",{get:function(){return Be},enumerable:!0,configurable:!0}),Object.defineProperty(n,"strings",{get:function(){return Ve},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addClass:function(){},attachResizeObserver:function(){return null},forceLayout:function(){},getWidth:function(){return 0},hasClass:function(){return!1},setBufferBarStyle:function(){return null},setPrimaryBarStyle:function(){return null},setStyle:function(){},removeAttribute:function(){},removeClass:function(){},setAttribute:function(){}}},enumerable:!0,configurable:!0}),n.prototype.init=function(){var t=this;this.isDeterminate=!this.adapter.hasClass(Be.INDETERMINATE_CLASS),this.adapter.addClass(Be.ANIMATION_READY_CLASS),this.progress=0,this.buffer=1,this.observer=this.adapter.attachResizeObserver((function(e){var n,i;if(!t.isDeterminate)try{for(var o=r(e),a=o.next();!a.done;a=o.next()){var s=a.value;s.contentRect&&t.calculateAndSetDimensions(s.contentRect.width)}}catch(t){n={error:t}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}})),!this.isDeterminate&&this.observer&&this.calculateAndSetDimensions(this.adapter.getWidth())},n.prototype.setDeterminate=function(t){if(this.isDeterminate=t,this.isDeterminate)return this.adapter.removeClass(Be.INDETERMINATE_CLASS),this.adapter.setAttribute(Ve.ARIA_VALUENOW,this.progress.toString()),this.adapter.setAttribute(Ve.ARIA_VALUEMAX,"1"),this.adapter.setAttribute(Ve.ARIA_VALUEMIN,"0"),this.setPrimaryBarProgress(this.progress),void this.setBufferBarProgress(this.buffer);this.observer&&this.calculateAndSetDimensions(this.adapter.getWidth()),this.adapter.addClass(Be.INDETERMINATE_CLASS),this.adapter.removeAttribute(Ve.ARIA_VALUENOW),this.adapter.removeAttribute(Ve.ARIA_VALUEMAX),this.adapter.removeAttribute(Ve.ARIA_VALUEMIN),this.setPrimaryBarProgress(1),this.setBufferBarProgress(1)},n.prototype.getDeterminate=function(){return this.isDeterminate},n.prototype.setProgress=function(t){this.progress=t,this.isDeterminate&&(this.setPrimaryBarProgress(t),this.adapter.setAttribute(Ve.ARIA_VALUENOW,t.toString()))},n.prototype.getProgress=function(){return this.progress},n.prototype.setBuffer=function(t){this.buffer=t,this.isDeterminate&&this.setBufferBarProgress(t)},n.prototype.open=function(){this.adapter.removeClass(Be.CLOSED_CLASS),this.adapter.removeClass(Be.CLOSED_ANIMATION_OFF_CLASS)},n.prototype.close=function(){this.adapter.addClass(Be.CLOSED_CLASS)},n.prototype.handleTransitionEnd=function(){this.adapter.hasClass(Be.CLOSED_CLASS)&&this.adapter.addClass(Be.CLOSED_ANIMATION_OFF_CLASS)},n.prototype.destroy=function(){t.prototype.destroy.call(this),this.observer&&this.observer.disconnect()},n.prototype.restartAnimation=function(){this.adapter.removeClass(Be.ANIMATION_READY_CLASS),this.adapter.forceLayout(),this.adapter.addClass(Be.ANIMATION_READY_CLASS)},n.prototype.setPrimaryBarProgress=function(t){var e="scaleX("+t+")",n="undefined"!=typeof window?nt(window,"transform"):"transform";this.adapter.setPrimaryBarStyle(n,e)},n.prototype.setBufferBarProgress=function(t){var e=100*t+"%";this.adapter.setBufferBarStyle(Ve.FLEX_BASIS,e)},n.prototype.calculateAndSetDimensions=function(t){var e=.8367142*t,n=2.00611057*t,i=.37651913*t,r=.84386165*t,o=1.60277782*t;this.adapter.setStyle("--mdc-linear-progress-primary-half",e+"px"),this.adapter.setStyle("--mdc-linear-progress-primary-half-neg",-e+"px"),this.adapter.setStyle("--mdc-linear-progress-primary-full",n+"px"),this.adapter.setStyle("--mdc-linear-progress-primary-full-neg",-n+"px"),this.adapter.setStyle("--mdc-linear-progress-secondary-quarter",i+"px"),this.adapter.setStyle("--mdc-linear-progress-secondary-quarter-neg",-i+"px"),this.adapter.setStyle("--mdc-linear-progress-secondary-half",r+"px"),this.adapter.setStyle("--mdc-linear-progress-secondary-half-neg",-r+"px"),this.adapter.setStyle("--mdc-linear-progress-secondary-full",o+"px"),this.adapter.setStyle("--mdc-linear-progress-secondary-full-neg",-o+"px"),this.restartAnimation()},n}(s),je=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.attachTo=function(t){return new n(t)},Object.defineProperty(n.prototype,"determinate",{set:function(t){this.foundation.setDeterminate(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"progress",{set:function(t){this.foundation.setProgress(t)},enumerable:!0,configurable:!0}
21471),Object.defineProperty(n.prototype,"buffer",{set:function(t){this.foundation.setBuffer(t)},enumerable:!0,configurable:!0}),n.prototype.open=function(){this.foundation.open()},n.prototype.close=function(){this.foundation.close()},n.prototype.initialSyncWithDOM=function(){var t=this;this.root.addEventListener("transitionend",(function(){t.foundation.handleTransitionEnd()}))},n.prototype.getDefaultFoundation=function(){var t=this;return new Ue({addClass:function(e){t.root.classList.add(e)},forceLayout:function(){t.root.getBoundingClientRect()},setBufferBarStyle:function(e,n){var i=t.root.querySelector(Ue.strings.BUFFER_BAR_SELECTOR);i&&i.style.setProperty(e,n)},setPrimaryBarStyle:function(e,n){var i=t.root.querySelector(Ue.strings.PRIMARY_BAR_SELECTOR);i&&i.style.setProperty(e,n)},hasClass:function(e){return t.root.classList.contains(e)},removeAttribute:function(e){t.root.removeAttribute(e)},removeClass:function(e){t.root.classList.remove(e)},setAttribute:function(e,n){t.root.setAttribute(e,n)},setStyle:function(e,n){t.root.style.setProperty(e,n)},attachResizeObserver:function(e){var n=window.ResizeObserver;if(n){var i=new n(e);return i.observe(t.root),i}return null},getWidth:function(){return t.root.offsetWidth}})},n}(u),qe="mdc-data-table__header-cell--sorted",Ge="mdc-data-table__header-cell--sorted-descending",We="mdc-data-table--in-progress",Xe="mdc-data-table__row--selected",Ke="data-row-id",ze={CONTENT:".mdc-data-table__content",HEADER_CELL:".mdc-data-table__header-cell",HEADER_CELL_WITH_SORT:".mdc-data-table__header-cell--with-sort",HEADER_ROW:".mdc-data-table__header-row",HEADER_ROW_CHECKBOX:".mdc-data-table__header-row-checkbox",PROGRESS_INDICATOR:".mdc-data-table__progress-indicator",ROW:".mdc-data-table__row",ROW_CHECKBOX:".mdc-data-table__row-checkbox",ROW_SELECTED:".mdc-data-table__row--selected",SORT_ICON_BUTTON:".mdc-data-table__sort-icon-button",SORT_STATUS_LABEL:".mdc-data-table__sort-status-label"},Ye="aria-selected",Qe="aria-sort";!function(t){t.ASCENDING="ascending",t.DESCENDING="descending",t.NONE="none",t.OTHER="other"}(De||(De={}));for(var Ze=function(t){function n(e){return t.call(this,i(i({},n.defaultAdapter),e))||this}return e(n,t),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addClass:function(){},addClassAtRowIndex:function(){},getAttributeByHeaderCellIndex:function(){return""},getHeaderCellCount:function(){return 0},getHeaderCellElements:function(){return[]},getRowCount:function(){return 0},getRowElements:function(){return[]},getRowIdAtIndex:function(){return""},getRowIndexByChildElement:function(){return 0},getSelectedRowCount:function(){return 0},getTableContainerHeight:function(){return 0},getTableHeaderHeight:function(){return 0},isCheckboxAtRowIndexChecked:function(){return!1},isHeaderRowCheckboxChecked:function(){return!1},isRowsSelectable:function(){return!1},notifyRowSelectionChanged:function(){},notifySelectedAll:function(){},notifySortAction:function(){},notifyUnselectedAll:function(){},registerHeaderRowCheckbox:function(){},registerRowCheckboxes:function(){},removeClass:function(){},removeClassAtRowIndex:function(){},removeClassNameByHeaderCellIndex:function(){},setAttributeAtRowIndex:function(){},setAttributeByHeaderCellIndex:function(){},setClassNameByHeaderCellIndex:function(){},setHeaderRowCheckboxChecked:function(){},setHeaderRowCheckboxIndeterminate:function(){},setProgressIndicatorStyles:function(){},setRowCheckboxCheckedAtIndex:function(){},setSortStatusLabelByHeaderCellIndex:function(){}}},enumerable:!0,configurable:!0}),n.prototype.layout=function(){this.adapter.isRowsSelectable()&&(this.adapter.registerHeaderRowCheckbox(),this.adapter.registerRowCheckboxes(),this.setHeaderRowCheckboxState())},n.prototype.layoutAsync=function(){return t=this,e=void 0,i=function(){return function(t,e){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(t){switch(t.label){case 0:return this.adapter.isRowsSelectable()?[4,this.adapter.registerHeaderRowCheckbox()]:[3,3];case 1:return t.sent(),[4,this.adapter.registerRowCheckboxes()];case 2:t.sent(),this.setHeaderRowCheckboxState(),t.label=3;case 3:return[2]}}
21471))},new((n=void 0)||(n=Promise))((function(r,o){function a(t){try{u(i.next(t))}catch(t){o(t)}}function s(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((i=i.apply(t,e||[])).next())}));var t,e,n,i},n.prototype.getRows=function(){return this.adapter.getRowElements()},n.prototype.getHeaderCells=function(){return this.adapter.getHeaderCellElements()},n.prototype.setSelectedRowIds=function(t){for(var e=0;e<this.adapter.getRowCount();e++){var n=this.adapter.getRowIdAtIndex(e),i=!1;n&&t.indexOf(n)>=0&&(i=!0),this.adapter.setRowCheckboxCheckedAtIndex(e,i),this.selectRowAtIndex(e,i)}this.setHeaderRowCheckboxState()},n.prototype.getRowIds=function(){for(var t=[],e=0;e<this.adapter.getRowCount();e++)t.push(this.adapter.getRowIdAtIndex(e));return t},n.prototype.getSelectedRowIds=function(){for(var t=[],e=0;e<this.adapter.getRowCount();e++)this.adapter.isCheckboxAtRowIndexChecked(e)&&t.push(this.adapter.getRowIdAtIndex(e));return t},n.prototype.handleHeaderRowCheckboxChange=function(){for(var t=this.adapter.isHeaderRowCheckboxChecked(),e=0;e<this.adapter.getRowCount();e++)this.adapter.setRowCheckboxCheckedAtIndex(e,t),this.selectRowAtIndex(e,t);t?this.adapter.notifySelectedAll():this.adapter.notifyUnselectedAll()},n.prototype.handleRowCheckboxChange=function(t){var e=this.adapter.getRowIndexByChildElement(t.target);if(-1!==e){var n=this.adapter.isCheckboxAtRowIndexChecked(e);this.selectRowAtIndex(e,n),this.setHeaderRowCheckboxState();var i=this.adapter.getRowIdAtIndex(e);this.adapter.notifyRowSelectionChanged({rowId:i,rowIndex:e,selected:n})}},n.prototype.handleSortAction=function(t){for(var e=t.columnId,n=t.columnIndex,i=t.headerCell,r=0;r<this.adapter.getHeaderCellCount();r++)r!==n&&(this.adapter.removeClassNameByHeaderCellIndex(r,qe),this.adapter.removeClassNameByHeaderCellIndex(r,Ge),this.adapter.setAttributeByHeaderCellIndex(r,Qe,De.NONE),this.adapter.setSortStatusLabelByHeaderCellIndex(r,De.NONE));this.adapter.setClassNameByHeaderCellIndex(n,qe);var o=this.adapter.getAttributeByHeaderCellIndex(n,Qe),a=De.NONE;o===De.ASCENDING?(this.adapter.setClassNameByHeaderCellIndex(n,Ge),this.adapter.setAttributeByHeaderCellIndex(n,Qe,De.DESCENDING),a=De.DESCENDING):o===De.DESCENDING?(this.adapter.removeClassNameByHeaderCellIndex(n,Ge),this.adapter.setAttributeByHeaderCellIndex(n,Qe,De.ASCENDING),a=De.ASCENDING):(this.adapter.setAttributeByHeaderCellIndex(n,Qe,De.ASCENDING),a=De.ASCENDING),this.adapter.setSortStatusLabelByHeaderCellIndex(n,a),this.adapter.notifySortAction({columnId:e,columnIndex:n,headerCell:i,sortValue:a})},n.prototype.showProgress=function(){var t=this.adapter.getTableHeaderHeight(),e=this.adapter.getTableContainerHeight()-t,n=t;this.adapter.setProgressIndicatorStyles({height:e+"px",top:n+"px"}),this.adapter.addClass(We)},n.prototype.hideProgress=function(){this.adapter.removeClass(We)},n.prototype.setHeaderRowCheckboxState=function(){0===this.adapter.getSelectedRowCount()?(this.adapter.setHeaderRowCheckboxChecked(!1),this.adapter.setHeaderRowCheckboxIndeterminate(!1)):this.adapter.getSelectedRowCount()===this.adapter.getRowCount()?(this.adapter.setHeaderRowCheckboxChecked(!0),this.adapter.setHeaderRowCheckboxIndeterminate(!1)):(this.adapter.setHeaderRowCheckboxIndeterminate(!0),this.adapter.setHeaderRowCheckboxChecked(!1))},n.prototype.selectRowAtIndex=function(t,e){e?(this.adapter.addClassAtRowIndex(t,Xe),this.adapter.setAttributeAtRowIndex(t,Ye,"true")):(this.adapter.removeClassAtRowIndex(t,Xe),this.adapter.setAttributeAtRowIndex(t,Ye,"false"))},n}(s),$e=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.attachTo=function(t){return new n(t)},n.prototype.initialize=function(t){void 0===t&&(t=function(t){return new pe(t)}),this.checkboxFactory=t},n.prototype.initialSyncWithDOM=function(){var t=this;this.headerRow=this.root.querySelector(".mdc-data-table__header-row"),this.handleHeaderRowCheckboxChange=function(){t.foundation.handleHeaderRowCheckboxChange()},this.headerRow.addEventListener("change",this.handleHeaderRowCheckboxChange),this.headerRowClickListener=function(e){t.handleHeaderRowClick(e)},this.headerRow.addEventListener("click",this.headerRowClickListener),this.content=this.root.querySelector(".mdc-data-table__content"),this.handleRowCheckboxChange=function(e){t.foundation.handleRowCheckboxChange(e)},this.content.addEventListener("change",this.handleRowCheckboxChange),this.layout()},n.prototype.layout=function(){this.foundation.layout()},n.prototype.getHeaderCells=function(){return[].slice.call(this.root.querySelectorAll(ze.HEADER_CELL))},n.prototype.getRows=function(){return this.foundation.getRows()},n.prototype.getSelectedRowIds=function(){return this.foundation.getSelectedRowIds()},n.prototype.setSelectedRowIds=function(t){this.foundation.setSelectedRowIds(t)},n.prototype.showProgress=function(){this.getLinearProgress().open(),this.foundation.showProgress()},n.prototype.hideProgress=function(){this.foundation.hideProgress(),this.getLinearProgress().close()},n.prototype.destroy=function(){var t,e;if(this.handleHeaderRowCheckboxChange&&this.headerRow.removeEventListener("change",this.handleHeaderRowCheckboxChange),this.headerRowClickListener&&this.headerRow.removeEventListener("click",this.headerRowClickListener),this.handleRowCheckboxChange&&this.content.removeEventListener("change",this.handleRowCheckboxChange),this.headerRowCheckbox&&this.headerRowCheckbox.destroy(),this.rowCheckboxList)try{for(var n=r(this.rowCheckboxList),i=n.next();!i.done;i=n.next())i.value.destroy()}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}},n.prototype.getDefaultFoundation=function(){var t=this;return new Ze({addClass:function(e){t.root.classList.add(e)},removeClass:function(e){t.root.classList.remove(e)},getHeaderCellElements:function(){return t.getHeaderCells()},getHeaderCellCount:function(){return t.getHeaderCells().length},getAttributeByHeaderCellIndex:function(e,n){return t.getHeaderCells()[e].getAttribute(n)},setAttributeByHeaderCellIndex:function(e,n,i){t.getHeaderCells()[e].setAttribute(n,i)},setClassNameByHeaderCellIndex:function(e,n){t.getHeaderCells()[e].classList.add(n)},removeClassNameByHeaderCellIndex:function(e,n){t.getHeaderCells()[e].classList.remove(n)},notifySortAction:function(e){t.emit("MDCDataTable:sorted",e,!0)},getTableContainerHeight:function(){var e=t.root.querySelector(".mdc-data-table__table-container");if(!e)throw new Error("MDCDataTable: Table container element not found.");return e.getBoundingClientRect().height},getTableHeaderHeight:function(){var e=t.root.querySelector(ze.HEADER_ROW);
21471if(!e)throw new Error("MDCDataTable: Table header element not found.");return e.getBoundingClientRect().height},setProgressIndicatorStyles:function(e){var n=t.root.querySelector(ze.PROGRESS_INDICATOR);if(!n)throw new Error("MDCDataTable: Progress indicator element not found.");n.style.setProperty("height",e.height),n.style.setProperty("top",e.top)},addClassAtRowIndex:function(e,n){t.getRows()[e].classList.add(n)},getRowCount:function(){return t.getRows().length},getRowElements:function(){return[].slice.call(t.root.querySelectorAll(ze.ROW))},getRowIdAtIndex:function(e){return t.getRows()[e].getAttribute(Ke)},getRowIndexByChildElement:function(e){return t.getRows().indexOf(c(e,ze.ROW))},getSelectedRowCount:function(){return t.root.querySelectorAll(ze.ROW_SELECTED).length},isCheckboxAtRowIndexChecked:function(e){return t.rowCheckboxList[e].checked},isHeaderRowCheckboxChecked:function(){return t.headerRowCheckbox.checked},isRowsSelectable:function(){return!!t.root.querySelector(ze.ROW_CHECKBOX)||!!t.root.querySelector(ze.HEADER_ROW_CHECKBOX)},notifyRowSelectionChanged:function(e){t.emit("MDCDataTable:rowSelectionChanged",{row:t.getRowByIndex(e.rowIndex),rowId:t.getRowIdByIndex(e.rowIndex),rowIndex:e.rowIndex,selected:e.selected},!0)},notifySelectedAll:function(){t.emit("MDCDataTable:selectedAll",{},!0)},notifyUnselectedAll:function(){t.emit("MDCDataTable:unselectedAll",{},!0)},registerHeaderRowCheckbox:function(){t.headerRowCheckbox&&t.headerRowCheckbox.destroy();var e=t.root.querySelector(ze.HEADER_ROW_CHECKBOX);t.headerRowCheckbox=t.checkboxFactory(e)},registerRowCheckboxes:function(){t.rowCheckboxList&&t.rowCheckboxList.forEach((function(t){t.destroy()})),t.rowCheckboxList=[],t.getRows().forEach((function(e){var n=t.checkboxFactory(e.querySelector(ze.ROW_CHECKBOX));t.rowCheckboxList.push(n)}))},removeClassAtRowIndex:function(e,n){t.getRows()[e].classList.remove(n)},setAttributeAtRowIndex:function(e,n,i){t.getRows()[e].setAttribute(n,i)},setHeaderRowCheckboxChecked:function(e){t.headerRowCheckbox.checked=e},setHeaderRowCheckboxIndeterminate:function(e){t.headerRowCheckbox.indeterminate=e},setRowCheckboxCheckedAtIndex:function(e,n){t.rowCheckboxList[e].checked=n},setSortStatusLabelByHeaderCellIndex:function(e,n){var i=t.getHeaderCells()[e].querySelector(ze.SORT_STATUS_LABEL);i&&(i.textContent=t.getSortStatusMessageBySortValue(n))}})},n.prototype.getRowByIndex=function(t){return this.getRows()[t]},n.prototype.getRowIdByIndex=function(t){return this.getRowByIndex(t).getAttribute(Ke)},n.prototype.handleHeaderRowClick=function(t){var e=c(t.target,ze.HEADER_CELL_WITH_SORT);if(e){var n=e.getAttribute("data-column-id"),i=this.getHeaderCells().indexOf(e);-1!==i&&this.foundation.handleSortAction({columnId:n,columnIndex:i,headerCell:e})}},n.prototype.getSortStatusMessageBySortValue=function(t){switch(t){case De.ASCENDING:return"Sorted in ascending order";case De.DESCENDING:return"Sorted in descending order";default:return""}},n.prototype.getLinearProgressElement=function(){var t=this.root.querySelector(".mdc-data-table__linear-progress");if(!t)throw new Error("MDCDataTable: linear progress element is not found.");return t},n.prototype.getLinearProgress=function(){if(!this.linearProgress){var t=this.getLinearProgressElement();this.linearProgress=new je(t)}return this.linearProgress},n}(u),Je={ROOT:"mdc-form-field"},tn={LABEL_SELECTOR:".mdc-form-field > label"},en=function(t){function n(e){var r=t.call(this,i(i({},n.defaultAdapter),e))||this;return r.click=function(){r.handleClick()},r}return e(n,t),Object.defineProperty(n,"cssClasses",{get:function(){return Je},enumerable:!0,configurable:!0}),Object.defineProperty(n,"strings",{get:function(){return tn},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{activateInputRipple:function(){},deactivateInputRipple:function(){},deregisterInteractionHandler:function(){},registerInteractionHandler:function(){}}},enumerable:!0,configurable:!0}),n.prototype.init=function(){this.adapter.registerInteractionHandler("click",this.click)},n.prototype.destroy=function(){this.adapter.deregisterInteractionHandler("click",this.click)},n.prototype.handleClick=function(){var t=this;this.adapter.activateInputRipple(),requestAnimationFrame((function(){t.adapter.deactivateInputRipple()}
21471))},n}(s),nn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return e(n,t),n.attachTo=function(t){return new n(t)},n.prototype.labelEl=function(){var t=en.strings.LABEL_SELECTOR;return this.root.querySelector(t)},n.prototype.getDefaultFoundation=function(){var t=this;return new en({activateInputRipple:function(){t.input&&t.input.ripple&&t.input.ripple.activate()},deactivateInputRipple:function(){t.input&&t.input.ripple&&t.input.ripple.deactivate()},deregisterInteractionHandler:function(e,n){var i=t.labelEl();i&&i.removeEventListener(e,n)},registerInteractionHandler:function(e,n){var i=t.labelEl();i&&i.addEventListener(e,n)}})},n}(u),rn=document.querySelectorAll(".mdc-form-field"),on=document.querySelectorAll(".mdc-select"),an=document.querySelectorAll(".mdc-select-helper-text"),sn=document.querySelectorAll(".mdc-text-field"),un=document.querySelectorAll(".mdc-tooltip"),cn=document.querySelectorAll(".mdc-radio"),dn=document.querySelectorAll(".mdc-checkbox"),ln=document.querySelectorAll(".mdc-data-table"),hn={},pn={},fn={},mn={},En={},In={},_n={},yn={},gn=0;gn<on.length;gn++)hn[on[gn].children[0].name]=new Bt(on[gn]);for(var Cn=0;Cn<an.length;Cn++)pn[an[Cn].id]=new Ht(an[Cn]);for(var An=0;An<sn.length;An++)fn[sn[An].querySelector(".mdc-text-field__input").id]=new se(sn[An]);for(var Tn=0;Tn<un.length;Tn++){var vn=new He(un[Tn]);mn[vn.root.id]=vn}for(var bn=0;bn<dn.length;bn++){var Sn=new pe(dn[bn]);En[Sn.root.firstElementChild.id]=Sn}for(var On=0;On<cn.length;On++)In[cn[On].firstElementChild.id]=new ke(cn[On]);for(var Ln=0;Ln<ln.length;Ln++)_n[ln[Ln].id]=new $e(ln[Ln]);for(var xn=0;xn<rn.length;xn++)yn[rn[xn].id]=new nn(rn[xn]);window.mdcFormFields=yn,window.mdSelects=hn,window.mdHelperTexts=pn,window.mdTextFields=fn,window.mdTooltips=mn,window.mdCheckboxes=En,window.mdRadios=In,window.mdcTables=_n}()}(); 21472/**! 21473 * @fileOverview Kickass library to create and place poppers near their reference elements. 21474 * @version 1.16.1 21475 * @license 21476 * Copyright (c) 2016 Federico Zivolo and contributors 21477 * 21478 * Permission is hereby granted, free of charge, to any person obtaining a copy 21479 * of this software and associated documentation files (the "Software"), to deal 21480 * in the Software without restriction, including without limitation the rights 21481 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 21482 * copies of the Software, and to permit persons to whom the Software is 21483 * furnished to do so, subject to the following conditions: 21484 * 21485 * The above copyright notice and this permission notice shall be included in all 21486 * copies or substantial portions of the Software. 21487 * 21488 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21489 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21490 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21491 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21492 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21493 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21494 * SOFTWARE. 21495 */ 21496(function (global, factory) { 21497 typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : 21498 typeof define === 'function' && define.amd ? define(factory) : 21499 (global.Popper = factory()); 21500}(this, (function () { 'use strict'; 21501 21502var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && typeof navigator !== 'undefined'; 21503 21504var timeoutDuration = function () { 21505 var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox']; 21506 for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) { 21507 if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) { 21508 return 1; 21509 } 21510 } 21511 return 0; 21512}(); 21513 21514function microtaskDebounce(fn) { 21515 var called = false; 21516 return function () { 21517 if (called) { 21518 return; 21519 } 21520 called = true; 21521 window.Promise.resolve().then(function () { 21522 called = false; 21523 fn(); 21524 }); 21525 }; 21526} 21527 21528function taskDebounce(fn) { 21529 var scheduled = false; 21530 return function () { 21531 if (!scheduled) { 21532 scheduled = true; 21533 setTimeout(function () { 21534 scheduled = false; 21535 fn(); 21536 }, timeoutDuration); 21537 } 21538 }; 21539} 21540 21541var supportsMicroTasks = isBrowser && window.Promise; 21542 21543/** 21544* Create a debounced version of a method, that's asynchronously deferred 21545* but called in the minimum time possible. 21546* 21547* @method 21548* @memberof Popper.Utils
vendor: 4,054 bytes, lines 21549-21691
21549* @argument {Function} fn 21550* @returns {Function} 21551*/ 21552var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce; 21553 21554/** 21555 * Check if the given variable is a function 21556 * @method 21557 * @memberof Popper.Utils 21558 * @argument {Any} functionToCheck - variable to check 21559 * @returns {Boolean} answer to: is a function? 21560 */ 21561function isFunction(functionToCheck) { 21562 var getType = {}; 21563 return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]'; 21564} 21565 21566/** 21567 * Get CSS computed property of the given element 21568 * @method 21569 * @memberof Popper.Utils 21570 * @argument {Eement} element 21571 * @argument {String} property 21572 */ 21573function getStyleComputedProperty(element, property) { 21574 if (element.nodeType !== 1) { 21575 return []; 21576 } 21577 // NOTE: 1 DOM access here 21578 var window = element.ownerDocument.defaultView; 21579 var css = window.getComputedStyle(element, null); 21580 return property ? css[property] : css; 21581} 21582 21583/** 21584 * Returns the parentNode or the host of the element 21585 * @method 21586 * @memberof Popper.Utils 21587 * @argument {Element} element 21588 * @returns {Element} parent 21589 */ 21590function getParentNode(element) { 21591 if (element.nodeName === 'HTML') { 21592 return element; 21593 } 21594 return element.parentNode || element.host; 21595} 21596 21597/** 21598 * Returns the scrolling parent of the given element 21599 * @method 21600 * @memberof Popper.Utils 21601 * @argument {Element} element 21602 * @returns {Element} scroll parent 21603 */ 21604function getScrollParent(element) { 21605 // Return body, `getScroll` will take care to get the correct `scrollTop` from it 21606 if (!element) { 21607 return document.body; 21608 } 21609 21610 switch (element.nodeName) { 21611 case 'HTML': 21612 case 'BODY': 21613 return element.ownerDocument.body; 21614 case '#document': 21615 return element.body; 21616 } 21617 21618 // Firefox want us to check `-x` and `-y` variations as well 21619 21620 var _getStyleComputedProp = getStyleComputedProperty(element), 21621 overflow = _getStyleComputedProp.overflow, 21622 overflowX = _getStyleComputedProp.overflowX, 21623 overflowY = _getStyleComputedProp.overflowY; 21624 21625 if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) { 21626 return element; 21627 } 21628 21629 return getScrollParent(getParentNode(element)); 21630} 21631 21632/** 21633 * Returns the reference node of the reference object, or the reference object itself. 21634 * @method 21635 * @memberof Popper.Utils 21636 * @param {Element|Object} reference - the reference element (the popper will be relative to this) 21637 * @returns {Element} parent 21638 */ 21639function getReferenceNode(reference) { 21640 return reference && reference.referenceNode ? reference.referenceNode : reference; 21641} 21642 21643var isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode); 21644var isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent); 21645 21646/** 21647 * Determines if the browser is Internet Explorer 21648 * @method 21649 * @memberof Popper.Utils 21650 * @param {Number} version to check 21651 * @returns {Boolean} isIE 21652 */ 21653function isIE(version) { 21654 if (version === 11) { 21655 return isIE11; 21656 } 21657 if (version === 10) { 21658 return isIE10; 21659 } 21660 return isIE11 || isIE10; 21661} 21662 21663/** 21664 * Returns the offset parent of the given element 21665 * @method 21666 * @memberof Popper.Utils 21667 * @argument {Element} element 21668 * @returns {Element} offset parent 21669 */ 21670function getOffsetParent(element) { 21671 if (!element) { 21672 return document.documentElement; 21673 } 21674 21675 var noOffsetParent = isIE(10) ? document.body : null; 21676 21677 // NOTE: 1 DOM access here 21678 var offsetParent = element.offsetParent || null; 21679 // Skip hidden elements which don't have an offsetParent 21680 while (offsetParent === noOffsetParent && element.nextElementSibling) { 21681 offsetParent = (element = element.nextElementSibling).offsetParent; 21682 } 21683 21684 var nodeName = offsetParent && offsetParent.nodeName; 21685 21686 if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') { 21687 return element ? element.ownerDocument.documentElement : document.documentElement; 21688 } 21689 21690 // .offsetParent will return the closest TH, TD or TABLE in case 21691 // no offsetParent is present, I hate this job...
vendor: 1,708 bytes, lines 21692-21747
21692 if (['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') { 21693 return getOffsetParent(offsetParent); 21694 } 21695 21696 return offsetParent; 21697} 21698 21699function isOffsetContainer(element) { 21700 var nodeName = element.nodeName; 21701 21702 if (nodeName === 'BODY') { 21703 return false; 21704 } 21705 return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element; 21706} 21707 21708/** 21709 * Finds the root node (document, shadowDOM root) of the given element 21710 * @method 21711 * @memberof Popper.Utils 21712 * @argument {Element} node 21713 * @returns {Element} root node 21714 */ 21715function getRoot(node) { 21716 if (node.parentNode !== null) { 21717 return getRoot(node.parentNode); 21718 } 21719 21720 return node; 21721} 21722 21723/** 21724 * Finds the offset parent common to the two provided nodes 21725 * @method 21726 * @memberof Popper.Utils 21727 * @argument {Element} element1 21728 * @argument {Element} element2 21729 * @returns {Element} common offset parent 21730 */ 21731function findCommonOffsetParent(element1, element2) { 21732 // This check is needed to avoid errors in case one of the elements isn't defined for any reason 21733 if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) { 21734 return document.documentElement; 21735 } 21736 21737 // Here we make sure to give as "start" the element that comes first in the DOM 21738 var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING; 21739 var start = order ? element1 : element2; 21740 var end = order ? element2 : element1; 21741 21742 // Get common ancestor container 21743 var range = document.createRange(); 21744 range.setStart(start, 0); 21745 range.setEnd(end, 0); 21746 var commonAncestorContainer = range.commonAncestorContainer; 21747
vendor: 9,541 bytes, lines 21748-22029
21748 // Both nodes are inside #document 21749 21750 if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) { 21751 if (isOffsetContainer(commonAncestorContainer)) { 21752 return commonAncestorContainer; 21753 } 21754 21755 return getOffsetParent(commonAncestorContainer); 21756 } 21757 21758 // one of the nodes is inside shadowDOM, find which one 21759 var element1root = getRoot(element1); 21760 if (element1root.host) { 21761 return findCommonOffsetParent(element1root.host, element2); 21762 } else { 21763 return findCommonOffsetParent(element1, getRoot(element2).host); 21764 } 21765} 21766 21767/** 21768 * Gets the scroll value of the given element in the given side (top and left) 21769 * @method 21770 * @memberof Popper.Utils 21771 * @argument {Element} element 21772 * @argument {String} side `top` or `left` 21773 * @returns {number} amount of scrolled pixels 21774 */ 21775function getScroll(element) { 21776 var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top'; 21777 21778 var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft'; 21779 var nodeName = element.nodeName; 21780 21781 if (nodeName === 'BODY' || nodeName === 'HTML') { 21782 var html = element.ownerDocument.documentElement; 21783 var scrollingElement = element.ownerDocument.scrollingElement || html; 21784 return scrollingElement[upperSide]; 21785 } 21786 21787 return element[upperSide]; 21788} 21789 21790/* 21791 * Sum or subtract the element scroll values (left and top) from a given rect object 21792 * @method 21793 * @memberof Popper.Utils 21794 * @param {Object} rect - Rect object you want to change 21795 * @param {HTMLElement} element - The element from the function reads the scroll values 21796 * @param {Boolean} subtract - set to true if you want to subtract the scroll values 21797 * @return {Object} rect - The modifier rect object 21798 */ 21799function includeScroll(rect, element) { 21800 var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; 21801 21802 var scrollTop = getScroll(element, 'top'); 21803 var scrollLeft = getScroll(element, 'left'); 21804 var modifier = subtract ? -1 : 1; 21805 rect.top += scrollTop * modifier; 21806 rect.bottom += scrollTop * modifier; 21807 rect.left += scrollLeft * modifier; 21808 rect.right += scrollLeft * modifier; 21809 return rect; 21810} 21811 21812/* 21813 * Helper to detect borders of a given element 21814 * @method 21815 * @memberof Popper.Utils 21816 * @param {CSSStyleDeclaration} styles 21817 * Result of `getStyleComputedProperty` on the given element 21818 * @param {String} axis - `x` or `y` 21819 * @return {number} borders - The borders size of the given axis 21820 */ 21821 21822function getBordersSize(styles, axis) { 21823 var sideA = axis === 'x' ? 'Left' : 'Top'; 21824 var sideB = sideA === 'Left' ? 'Right' : 'Bottom'; 21825 21826 return parseFloat(styles['border' + sideA + 'Width']) + parseFloat(styles['border' + sideB + 'Width']); 21827} 21828 21829function getSize(axis, body, html, computedStyle) { 21830 return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? parseInt(html['offset' + axis]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')]) : 0); 21831} 21832 21833function getWindowSizes(document) { 21834 var body = document.body; 21835 var html = document.documentElement; 21836 var computedStyle = isIE(10) && getComputedStyle(html); 21837 21838 return { 21839 height: getSize('Height', body, html, computedStyle), 21840 width: getSize('Width', body, html, computedStyle) 21841 }; 21842} 21843 21844var classCallCheck = function (instance, Constructor) { 21845 if (!(instance instanceof Constructor)) { 21846 throw new TypeError("Cannot call a class as a function"); 21847 } 21848}; 21849 21850var createClass = function () { 21851 function defineProperties(target, props) { 21852 for (var i = 0; i < props.length; i++) { 21853 var descriptor = props[i]; 21854 descriptor.enumerable = descriptor.enumerable || false; 21855 descriptor.configurable = true; 21856 if ("value" in descriptor) descriptor.writable = true; 21857 Object.defineProperty(target, descriptor.key, descriptor); 21858 } 21859 } 21860 21861 return function (Constructor, protoProps, staticProps) { 21862 if (protoProps) defineProperties(Constructor.prototype, protoProps); 21863 if (staticProps) defineProperties(Constructor, staticProps); 21864 return Constructor; 21865 }; 21866}(); 21867 21868 21869 21870 21871 21872var defineProperty = function (obj, key, value) { 21873 if (key in obj) { 21874 Object.defineProperty(obj, key, { 21875 value: value, 21876 enumerable: true, 21877 configurable: true, 21878 writable: true 21879 }); 21880 } else { 21881 obj[key] = value; 21882 } 21883 21884 return obj; 21885}; 21886 21887var _extends = Object.assign || function (target) { 21888 for (var i = 1; i < arguments.length; i++) { 21889 var source = arguments[i]; 21890 21891 for (var key in source) { 21892 if (Object.prototype.hasOwnProperty.call(source, key)) { 21893 target[key] = source[key]; 21894 } 21895 } 21896 } 21897 21898 return target; 21899}; 21900 21901/** 21902 * Given element offsets, generate an output similar to getBoundingClientRect 21903 * @method 21904 * @memberof Popper.Utils 21905 * @argument {Object} offsets 21906 * @returns {Object} ClientRect like output 21907 */ 21908function getClientRect(offsets) { 21909 return _extends({}, offsets, { 21910 right: offsets.left + offsets.width, 21911 bottom: offsets.top + offsets.height 21912 }); 21913} 21914 21915/** 21916 * Get bounding client rect of given element 21917 * @method 21918 * @memberof Popper.Utils 21919 * @param {HTMLElement} element 21920 * @return {Object} client rect 21921 */ 21922function getBoundingClientRect(element) { 21923 var rect = {}; 21924 21925 // IE10 10 FIX: Please, don't ask, the element isn't 21926 // considered in DOM in some circumstances... 21927 // This isn't reproducible in IE10 compatibility mode of IE11 21928 try { 21929 if (isIE(10)) { 21930 rect = element.getBoundingClientRect(); 21931 var scrollTop = getScroll(element, 'top'); 21932 var scrollLeft = getScroll(element, 'left'); 21933 rect.top += scrollTop; 21934 rect.left += scrollLeft; 21935 rect.bottom += scrollTop; 21936 rect.right += scrollLeft; 21937 } else { 21938 rect = element.getBoundingClientRect(); 21939 } 21940 } catch (e) {} 21941 21942 var result = { 21943 left: rect.left, 21944 top: rect.top, 21945 width: rect.right - rect.left, 21946 height: rect.bottom - rect.top 21947 }; 21948 21949 // subtract scrollbar size from sizes 21950 var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {}; 21951 var width = sizes.width || element.clientWidth || result.width; 21952 var height = sizes.height || element.clientHeight || result.height; 21953 21954 var horizScrollbar = element.offsetWidth - width; 21955 var vertScrollbar = element.offsetHeight - height; 21956 21957 // if an hypothetical scrollbar is detected, we must be sure it's not a `border` 21958 // we make this check conditional for performance reasons 21959 if (horizScrollbar || vertScrollbar) { 21960 var styles = getStyleComputedProperty(element); 21961 horizScrollbar -= getBordersSize(styles, 'x'); 21962 vertScrollbar -= getBordersSize(styles, 'y'); 21963 21964 result.width -= horizScrollbar; 21965 result.height -= vertScrollbar; 21966 } 21967 21968 return getClientRect(result); 21969} 21970 21971function getOffsetRectRelativeToArbitraryNode(children, parent) { 21972 var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; 21973 21974 var isIE10 = isIE(10); 21975 var isHTML = parent.nodeName === 'HTML'; 21976 var childrenRect = getBoundingClientRect(children); 21977 var parentRect = getBoundingClientRect(parent); 21978 var scrollParent = getScrollParent(children); 21979 21980 var styles = getStyleComputedProperty(parent); 21981 var borderTopWidth = parseFloat(styles.borderTopWidth); 21982 var borderLeftWidth = parseFloat(styles.borderLeftWidth); 21983 21984 // In cases where the parent is fixed, we must ignore negative scroll in offset calc 21985 if (fixedPosition && isHTML) { 21986 parentRect.top = Math.max(parentRect.top, 0); 21987 parentRect.left = Math.max(parentRect.left, 0); 21988 } 21989 var offsets = getClientRect({ 21990 top: childrenRect.top - parentRect.top - borderTopWidth, 21991 left: childrenRect.left - parentRect.left - borderLeftWidth, 21992 width: childrenRect.width, 21993 height: childrenRect.height 21994 }); 21995 offsets.marginTop = 0; 21996 offsets.marginLeft = 0; 21997 21998 // Subtract margins of documentElement in case it's being used as parent 21999 // we do this only on HTML because it's the only element that behaves 22000 // differently when margins are applied to it. The margins are included in 22001 // the box of the documentElement, in the other cases not. 22002 if (!isIE10 && isHTML) { 22003 var marginTop = parseFloat(styles.marginTop); 22004 var marginLeft = parseFloat(styles.marginLeft); 22005 22006 offsets.top -= borderTopWidth - marginTop; 22007 offsets.bottom -= borderTopWidth - marginTop; 22008 offsets.left -= borderLeftWidth - marginLeft; 22009 offsets.right -= borderLeftWidth - marginLeft; 22010 22011 // Attach marginTop and marginLeft because in some circumstances we may need them 22012 offsets.marginTop = marginTop; 22013 offsets.marginLeft = marginLeft; 22014 } 22015 22016 if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') { 22017 offsets = includeScroll(offsets, parent); 22018 } 22019 22020 return offsets; 22021} 22022 22023function getViewportOffsetRectRelativeToArtbitraryNode(element) { 22024 var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 22025 22026 var html = element.ownerDocument.documentElement; 22027 var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html); 22028 var width = Math.max(html.clientWidth, window.innerWidth || 0); 22029 var height = Math.max(html.clientHeight, window.innerHeight || 0
vendor: 5,628 bytes, lines 22029-22201
22029); 22030 22031 var scrollTop = !excludeScroll ? getScroll(html) : 0; 22032 var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0; 22033 22034 var offset = { 22035 top: scrollTop - relativeOffset.top + relativeOffset.marginTop, 22036 left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft, 22037 width: width, 22038 height: height 22039 }; 22040 22041 return getClientRect(offset); 22042} 22043 22044/** 22045 * Check if the given element is fixed or is inside a fixed parent 22046 * @method 22047 * @memberof Popper.Utils 22048 * @argument {Element} element 22049 * @argument {Element} customContainer 22050 * @returns {Boolean} answer to "isFixed?" 22051 */ 22052function isFixed(element) { 22053 var nodeName = element.nodeName; 22054 if (nodeName === 'BODY' || nodeName === 'HTML') { 22055 return false; 22056 } 22057 if (getStyleComputedProperty(element, 'position') === 'fixed') { 22058 return true; 22059 } 22060 var parentNode = getParentNode(element); 22061 if (!parentNode) { 22062 return false; 22063 } 22064 return isFixed(parentNode); 22065} 22066 22067/** 22068 * Finds the first parent of an element that has a transformed property defined 22069 * @method 22070 * @memberof Popper.Utils 22071 * @argument {Element} element 22072 * @returns {Element} first transformed parent or documentElement 22073 */ 22074 22075function getFixedPositionOffsetParent(element) { 22076 // This check is needed to avoid errors in case one of the elements isn't defined for any reason 22077 if (!element || !element.parentElement || isIE()) { 22078 return document.documentElement; 22079 } 22080 var el = element.parentElement; 22081 while (el && getStyleComputedProperty(el, 'transform') === 'none') { 22082 el = el.parentElement; 22083 } 22084 return el || document.documentElement; 22085} 22086 22087/** 22088 * Computed the boundaries limits and return them 22089 * @method 22090 * @memberof Popper.Utils 22091 * @param {HTMLElement} popper 22092 * @param {HTMLElement} reference 22093 * @param {number} padding 22094 * @param {HTMLElement} boundariesElement - Element used to define the boundaries 22095 * @param {Boolean} fixedPosition - Is in fixed position mode 22096 * @returns {Object} Coordinates of the boundaries 22097 */ 22098function getBoundaries(popper, reference, padding, boundariesElement) { 22099 var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; 22100 22101 // NOTE: 1 DOM access here 22102 22103 var boundaries = { top: 0, left: 0 }; 22104 var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference)); 22105 22106 // Handle viewport case 22107 if (boundariesElement === 'viewport') { 22108 boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition); 22109 } else { 22110 // Handle other cases based on DOM element used as boundaries 22111 var boundariesNode = void 0; 22112 if (boundariesElement === 'scrollParent') { 22113 boundariesNode = getScrollParent(getParentNode(reference)); 22114 if (boundariesNode.nodeName === 'BODY') { 22115 boundariesNode = popper.ownerDocument.documentElement; 22116 } 22117 } else if (boundariesElement === 'window') { 22118 boundariesNode = popper.ownerDocument.documentElement; 22119 } else { 22120 boundariesNode = boundariesElement; 22121 } 22122 22123 var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition); 22124 22125 // In case of HTML, we need a different computation 22126 if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) { 22127 var _getWindowSizes = getWindowSizes(popper.ownerDocument), 22128 height = _getWindowSizes.height, 22129 width = _getWindowSizes.width; 22130 22131 boundaries.top += offsets.top - offsets.marginTop; 22132 boundaries.bottom = height + offsets.top; 22133 boundaries.left += offsets.left - offsets.marginLeft; 22134 boundaries.right = width + offsets.left; 22135 } else { 22136 // for all the other DOM elements, this one is good 22137 boundaries = offsets; 22138 } 22139 } 22140 22141 // Add paddings 22142 padding = padding || 0; 22143 var isPaddingNumber = typeof padding === 'number'; 22144 boundaries.left += isPaddingNumber ? padding : padding.left || 0; 22145 boundaries.top += isPaddingNumber ? padding : padding.top || 0; 22146 boundaries.right -= isPaddingNumber ? padding : padding.right || 0; 22147 boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0; 22148 22149 return boundaries; 22150} 22151 22152function getArea(_ref) { 22153 var width = _ref.width, 22154 height = _ref.height; 22155 22156 return width * height; 22157} 22158 22159/** 22160 * Utility used to transform the `auto` placement to the placement with more 22161 * available space. 22162 * @method 22163 * @memberof Popper.Utils 22164 * @argument {Object} data - The data object generated by update method 22165 * @argument {Object} options - Modifiers configuration and options 22166 * @returns {Object} The data object, properly modified 22167 */ 22168function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) { 22169 var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0; 22170 22171 if (placement.indexOf('auto') === -1) { 22172 return placement; 22173 } 22174 22175 var boundaries = getBoundaries(popper, reference, padding, boundariesElement); 22176 22177 var rects = { 22178 top: { 22179 width: boundaries.width, 22180 height: refRect.top - boundaries.top 22181 }, 22182 right: { 22183 width: boundaries.right - refRect.right, 22184 height: boundaries.height 22185 }, 22186 bottom: { 22187 width: boundaries.width, 22188 height: boundaries.bottom - refRect.bottom 22189 }, 22190 left: { 22191 width: refRect.left - boundaries.left, 22192 height: boundaries.height 22193 } 22194 }; 22195 22196 var sortedAreas = Object.keys(rects).map(function (key) { 22197 return _extends({ 22198 key: key 22199 }, rects[key], { 22200 area: getArea(rects[key]) 22201 });
vendor: 1,466 bytes, lines 22202-22241
22202 }).sort(function (a, b) { 22203 return b.area - a.area; 22204 }); 22205 22206 var filteredAreas = sortedAreas.filter(function (_ref2) { 22207 var width = _ref2.width, 22208 height = _ref2.height; 22209 return width >= popper.clientWidth && height >= popper.clientHeight; 22210 }); 22211 22212 var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key; 22213 22214 var variation = placement.split('-')[1]; 22215 22216 return computedPlacement + (variation ? '-' + variation : ''); 22217} 22218 22219/** 22220 * Get offsets to the reference element 22221 * @method 22222 * @memberof Popper.Utils 22223 * @param {Object} state 22224 * @param {Element} popper - the popper element 22225 * @param {Element} reference - the reference element (the popper will be relative to this) 22226 * @param {Element} fixedPosition - is in fixed position mode 22227 * @returns {Object} An object containing the offsets which will be applied to the popper 22228 */ 22229function getReferenceOffsets(state, popper, reference) { 22230 var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; 22231 22232 var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference)); 22233 return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition); 22234} 22235 22236/** 22237 * Get the outer sizes of the given element (offset size + margins) 22238 * @method 22239 * @memberof Popper.Utils 22240 * @argument {Element} element 22241 * @returns {Object}
vendor: 4,872 bytes, lines 22241-22390
22241 object containing width and height properties 22242 */ 22243function getOuterSizes(element) { 22244 var window = element.ownerDocument.defaultView; 22245 var styles = window.getComputedStyle(element); 22246 var x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0); 22247 var y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0); 22248 var result = { 22249 width: element.offsetWidth + y, 22250 height: element.offsetHeight + x 22251 }; 22252 return result; 22253} 22254 22255/** 22256 * Get the opposite placement of the given one 22257 * @method 22258 * @memberof Popper.Utils 22259 * @argument {String} placement 22260 * @returns {String} flipped placement 22261 */ 22262function getOppositePlacement(placement) { 22263 var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' }; 22264 return placement.replace(/left|right|bottom|top/g, function (matched) { 22265 return hash[matched]; 22266 }); 22267} 22268 22269/** 22270 * Get offsets to the popper 22271 * @method 22272 * @memberof Popper.Utils 22273 * @param {Object} position - CSS position the Popper will get applied 22274 * @param {HTMLElement} popper - the popper element 22275 * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this) 22276 * @param {String} placement - one of the valid placement options 22277 * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper 22278 */ 22279function getPopperOffsets(popper, referenceOffsets, placement) { 22280 placement = placement.split('-')[0]; 22281 22282 // Get popper node sizes 22283 var popperRect = getOuterSizes(popper); 22284 22285 // Add position, width and height to our offsets object 22286 var popperOffsets = { 22287 width: popperRect.width, 22288 height: popperRect.height 22289 }; 22290 22291 // depending by the popper placement we have to compute its offsets slightly differently 22292 var isHoriz = ['right', 'left'].indexOf(placement) !== -1; 22293 var mainSide = isHoriz ? 'top' : 'left'; 22294 var secondarySide = isHoriz ? 'left' : 'top'; 22295 var measurement = isHoriz ? 'height' : 'width'; 22296 var secondaryMeasurement = !isHoriz ? 'height' : 'width'; 22297 22298 popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2; 22299 if (placement === secondarySide) { 22300 popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement]; 22301 } else { 22302 popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)]; 22303 } 22304 22305 return popperOffsets; 22306} 22307 22308/** 22309 * Mimics the `find` method of Array 22310 * @method 22311 * @memberof Popper.Utils 22312 * @argument {Array} arr 22313 * @argument prop 22314 * @argument value 22315 * @returns index or -1 22316 */ 22317function find(arr, check) { 22318 // use native find if supported 22319 if (Array.prototype.find) { 22320 return arr.find(check); 22321 } 22322 22323 // use `filter` to obtain the same behavior of `find` 22324 return arr.filter(check)[0]; 22325} 22326 22327/** 22328 * Return the index of the matching object 22329 * @method 22330 * @memberof Popper.Utils 22331 * @argument {Array} arr 22332 * @argument prop 22333 * @argument value 22334 * @returns index or -1 22335 */ 22336function findIndex(arr, prop, value) { 22337 // use native findIndex if supported 22338 if (Array.prototype.findIndex) { 22339 return arr.findIndex(function (cur) { 22340 return cur[prop] === value; 22341 }); 22342 } 22343 22344 // use `find` + `indexOf` if `findIndex` isn't supported 22345 var match = find(arr, function (obj) { 22346 return obj[prop] === value; 22347 }); 22348 return arr.indexOf(match); 22349} 22350 22351/** 22352 * Loop trough the list of modifiers and run them in order, 22353 * each of them will then edit the data object. 22354 * @method 22355 * @memberof Popper.Utils 22356 * @param {dataObject} data 22357 * @param {Array} modifiers 22358 * @param {String} ends - Optional modifier name used as stopper 22359 * @returns {dataObject} 22360 */ 22361function runModifiers(modifiers, data, ends) { 22362 var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends)); 22363 22364 modifiersToRun.forEach(function (modifier) { 22365 if (modifier['function']) { 22366 // eslint-disable-line dot-notation 22367 console.warn('`modifier.function` is deprecated, use `modifier.fn`!'); 22368 } 22369 var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation 22370 if (modifier.enabled && isFunction(fn)) { 22371 // Add properties to offsets to make them a complete clientRect object 22372 // we do this before each modifier to make sure the previous one doesn't 22373 // mess with these values 22374 data.offsets.popper = getClientRect(data.offsets.popper); 22375 data.offsets.reference = getClientRect(data.offsets.reference); 22376 22377 data = fn(data, modifier); 22378 } 22379 }); 22380 22381 return data; 22382} 22383 22384/** 22385 * Updates the position of the popper, computing the new offsets and applying 22386 * the new style.<br /> 22387 * Prefer `scheduleUpdate` over `update` because of performance reasons. 22388 * @method 22389 * @memberof Popper 22390 */
vendor: 41,728 bytes, lines 22391-23554
22391function update() { 22392 // if popper is destroyed, don't perform any further update 22393 if (this.state.isDestroyed) { 22394 return; 22395 } 22396 22397 var data = { 22398 instance: this, 22399 styles: {}, 22400 arrowStyles: {}, 22401 attributes: {}, 22402 flipped: false, 22403 offsets: {} 22404 }; 22405 22406 // compute reference element offsets 22407 data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed); 22408 22409 // compute auto placement, store placement inside the data object, 22410 // modifiers will be able to edit `placement` if needed 22411 // and refer to originalPlacement to know the original value 22412 data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding); 22413 22414 // store the computed placement inside `originalPlacement` 22415 data.originalPlacement = data.placement; 22416 22417 data.positionFixed = this.options.positionFixed; 22418 22419 // compute the popper offsets 22420 data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement); 22421 22422 data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute'; 22423 22424 // run the modifiers 22425 data = runModifiers(this.modifiers, data); 22426 22427 // the first `update` will call `onCreate` callback 22428 // the other ones will call `onUpdate` callback 22429 if (!this.state.isCreated) { 22430 this.state.isCreated = true; 22431 this.options.onCreate(data); 22432 } else { 22433 this.options.onUpdate(data); 22434 } 22435} 22436 22437/** 22438 * Helper used to know if the given modifier is enabled. 22439 * @method 22440 * @memberof Popper.Utils 22441 * @returns {Boolean} 22442 */ 22443function isModifierEnabled(modifiers, modifierName) { 22444 return modifiers.some(function (_ref) { 22445 var name = _ref.name, 22446 enabled = _ref.enabled; 22447 return enabled && name === modifierName; 22448 }); 22449} 22450 22451/** 22452 * Get the prefixed supported property name 22453 * @method 22454 * @memberof Popper.Utils 22455 * @argument {String} property (camelCase) 22456 * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix) 22457 */ 22458function getSupportedPropertyName(property) { 22459 var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O']; 22460 var upperProp = property.charAt(0).toUpperCase() + property.slice(1); 22461 22462 for (var i = 0; i < prefixes.length; i++) { 22463 var prefix = prefixes[i]; 22464 var toCheck = prefix ? '' + prefix + upperProp : property; 22465 if (typeof document.body.style[toCheck] !== 'undefined') { 22466 return toCheck; 22467 } 22468 } 22469 return null; 22470} 22471 22472/** 22473 * Destroys the popper. 22474 * @method 22475 * @memberof Popper 22476 */ 22477function destroy() { 22478 this.state.isDestroyed = true; 22479 22480 // touch DOM only if `applyStyle` modifier is enabled 22481 if (isModifierEnabled(this.modifiers, 'applyStyle')) { 22482 this.popper.removeAttribute('x-placement'); 22483 this.popper.style.position = ''; 22484 this.popper.style.top = ''; 22485 this.popper.style.left = ''; 22486 this.popper.style.right = ''; 22487 this.popper.style.bottom = ''; 22488 this.popper.style.willChange = ''; 22489 this.popper.style[getSupportedPropertyName('transform')] = ''; 22490 } 22491 22492 this.disableEventListeners(); 22493 22494 // remove the popper if user explicitly asked for the deletion on destroy 22495 // do not use `remove` because IE11 doesn't support it 22496 if (this.options.removeOnDestroy) { 22497 this.popper.parentNode.removeChild(this.popper); 22498 } 22499 return this; 22500} 22501 22502/** 22503 * Get the window associated with the element 22504 * @argument {Element} element 22505 * @returns {Window} 22506 */ 22507function getWindow(element) { 22508 var ownerDocument = element.ownerDocument; 22509 return ownerDocument ? ownerDocument.defaultView : window; 22510} 22511 22512function attachToScrollParents(scrollParent, event, callback, scrollParents) { 22513 var isBody = scrollParent.nodeName === 'BODY'; 22514 var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent; 22515 target.addEventListener(event, callback, { passive: true }); 22516 22517 if (!isBody) { 22518 attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents); 22519 } 22520 scrollParents.push(target); 22521} 22522 22523/** 22524 * Setup needed event listeners used to update the popper position 22525 * @method 22526 * @memberof Popper.Utils 22527 * @private 22528 */ 22529function setupEventListeners(reference, options, state, updateBound) { 22530 // Resize event listener on window 22531 state.updateBound = updateBound; 22532 getWindow(reference).addEventListener('resize', state.updateBound, { passive: true }); 22533 22534 // Scroll event listener on scroll parents 22535 var scrollElement = getScrollParent(reference); 22536 attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents); 22537 state.scrollElement = scrollElement; 22538 state.eventsEnabled = true; 22539 22540 return state; 22541} 22542 22543/** 22544 * It will add resize/scroll events and start recalculating 22545 * position of the popper element when they are triggered. 22546 * @method 22547 * @memberof Popper 22548 */ 22549function enableEventListeners() { 22550 if (!this.state.eventsEnabled) { 22551 this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate); 22552 } 22553} 22554 22555/** 22556 * Remove event listeners used to update the popper position 22557 * @method 22558 * @memberof Popper.Utils 22559 * @private 22560 */ 22561function removeEventListeners(reference, state) { 22562 // Remove resize event listener on window 22563 getWindow(reference).removeEventListener('resize', state.updateBound); 22564 22565 // Remove scroll event listener on scroll parents 22566 state.scrollParents.forEach(function (target) { 22567 target.removeEventListener('scroll', state.updateBound); 22568 }); 22569 22570 // Reset state 22571 state.updateBound = null; 22572 state.scrollParents = []; 22573 state.scrollElement = null; 22574 state.eventsEnabled = false; 22575 return state; 22576} 22577 22578/** 22579 * It will remove resize/scroll events and won't recalculate popper position 22580 * when they are triggered. It also won't trigger `onUpdate` callback anymore, 22581 * unless you call `update` method manually. 22582 * @method 22583 * @memberof Popper 22584 */ 22585function disableEventListeners() { 22586 if (this.state.eventsEnabled) { 22587 cancelAnimationFrame(this.scheduleUpdate); 22588 this.state = removeEventListeners(this.reference, this.state); 22589 } 22590} 22591 22592/** 22593 * Tells if a given input is a number 22594 * @method 22595 * @memberof Popper.Utils 22596 * @param {*} input to check 22597 * @return {Boolean} 22598 */ 22599function isNumeric(n) { 22600 return n !== '' && !isNaN(parseFloat(n)) && isFinite(n); 22601} 22602 22603/** 22604 * Set the style to the given popper 22605 * @method 22606 * @memberof Popper.Utils 22607 * @argument {Element} element - Element to apply the style to 22608 * @argument {Object} styles 22609 * Object with a list of properties and values which will be applied to the element 22610 */ 22611function setStyles(element, styles) { 22612 Object.keys(styles).forEach(function (prop) { 22613 var unit = ''; 22614 // add unit if the value is numeric and is one of the following 22615 if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) { 22616 unit = 'px'; 22617 } 22618 element.style[prop] = styles[prop] + unit; 22619 }); 22620} 22621 22622/** 22623 * Set the attributes to the given popper 22624 * @method 22625 * @memberof Popper.Utils 22626 * @argument {Element} element - Element to apply the attributes to 22627 * @argument {Object} styles 22628 * Object with a list of properties and values which will be applied to the element 22629 */ 22630function setAttributes(element, attributes) { 22631 Object.keys(attributes).forEach(function (prop) { 22632 var value = attributes[prop]; 22633 if (value !== false) { 22634 element.setAttribute(prop, attributes[prop]); 22635 } else { 22636 element.removeAttribute(prop); 22637 } 22638 }); 22639} 22640 22641/** 22642 * @function 22643 * @memberof Modifiers 22644 * @argument {Object} data - The data object generated by `update` method 22645 * @argument {Object} data.styles - List of style properties - values to apply to popper element 22646 * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element 22647 * @argument {Object} options - Modifiers configuration and options 22648 * @returns {Object} The same data object 22649 */ 22650function applyStyle(data) { 22651 // any property present in `data.styles` will be applied to the popper, 22652 // in this way we can make the 3rd party modifiers add custom styles to it 22653 // Be aware, modifiers could override the properties defined in the previous 22654 // lines of this modifier! 22655 setStyles(data.instance.popper, data.styles); 22656 22657 // any property present in `data.attributes` will be applied to the popper, 22658 // they will be set as HTML attributes of the element 22659 setAttributes(data.instance.popper, data.attributes); 22660 22661 // if arrowElement is defined and arrowStyles has some properties 22662 if (data.arrowElement && Object.keys(data.arrowStyles).length) { 22663 setStyles(data.arrowElement, data.arrowStyles); 22664 } 22665 22666 return data; 22667} 22668 22669/** 22670 * Set the x-placement attribute before everything else because it could be used 22671 * to add margins to the popper margins needs to be calculated to get the 22672 * correct popper offsets. 22673 * @method 22674 * @memberof Popper.modifiers 22675 * @param {HTMLElement} reference - The reference element used to position the popper 22676 * @param {HTMLElement} popper - The HTML element used as popper 22677 * @param {Object} options - Popper.js options 22678 */ 22679function applyStyleOnLoad(reference, popper, options, modifierOptions, state) { 22680 // compute reference element offsets 22681 var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed); 22682 22683 // compute auto placement, store placement inside the data object, 22684 // modifiers will be able to edit `placement` if needed 22685 // and refer to originalPlacement to know the original value 22686 var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding); 22687 22688 popper.setAttribute('x-placement', placement); 22689 22690 // Apply `position` to popper before anything else because 22691 // without the position applied we can't guarantee correct computations 22692 setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' }); 22693 22694 return options; 22695} 22696 22697/** 22698 * @function 22699 * @memberof Popper.Utils 22700 * @argument {Object} data - The data object generated by `update` method 22701 * @argument {Boolean} shouldRound - If the offsets should be rounded at all 22702 * @returns {Object} The popper's position offsets rounded 22703 * 22704 * The tale of pixel-perfect positioning. It's still not 100% perfect, but as 22705 * good as it can be within reason. 22706 * Discussion here: https://github.com/FezVrasta/popper.js/pull/715 22707 * 22708 * Low DPI screens cause a popper to be blurry if not using full pixels (Safari 22709 * as well on High DPI screens). 22710 * 22711 * Firefox prefers no rounding for positioning and does not have blurriness on 22712 * high DPI screens. 22713 * 22714 * Only horizontal placement and left/right values need to be considered. 22715 */ 22716function getRoundedOffsets(data, shouldRound) { 22717 var _data$offsets = data.offsets, 22718 popper = _data$offsets.popper, 22719 reference = _data$offsets.reference; 22720 var round = Math.round, 22721 floor = Math.floor; 22722 22723 var noRound = function noRound(v) { 22724 return v; 22725 }; 22726 22727 var referenceWidth = round(reference.width); 22728 var popperWidth = round(popper.width); 22729 22730 var isVertical = ['left', 'right'].indexOf(data.placement) !== -1; 22731 var isVariation = data.placement.indexOf('-') !== -1; 22732 var sameWidthParity = referenceWidth % 2 === popperWidth % 2; 22733 var bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1; 22734 22735 var horizontalToInteger = !shouldRound ? noRound : isVertical || isVariation || sameWidthParity ? round : floor; 22736 var verticalToInteger = !shouldRound ? noRound : round; 22737 22738 return { 22739 left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left), 22740 top: verticalToInteger(popper.top), 22741 bottom: verticalToInteger(popper.bottom), 22742 right: horizontalToInteger(popper.right) 22743 }; 22744} 22745 22746var isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent); 22747 22748/** 22749 * @function 22750 * @memberof Modifiers 22751 * @argument {Object} data - The data object generated by `update` method 22752 * @argument {Object} options - Modifiers configuration and options 22753 * @returns {Object} The data object, properly modified 22754 */ 22755function computeStyle(data, options) { 22756 var x = options.x, 22757 y = options.y; 22758 var popper = data.offsets.popper; 22759 22760 // Remove this legacy support in Popper.js v2 22761 22762 var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) { 22763 return modifier.name === 'applyStyle'; 22764 }).gpuAcceleration; 22765 if (legacyGpuAccelerationOption !== undefined) { 22766 console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!'); 22767 } 22768 var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration; 22769 22770 var offsetParent = getOffsetParent(data.instance.popper); 22771 var offsetParentRect = getBoundingClientRect(offsetParent); 22772 22773 // Styles 22774 var styles = { 22775 position: popper.position 22776 }; 22777 22778 var offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox); 22779 22780 var sideA = x === 'bottom' ? 'top' : 'bottom'; 22781 var sideB = y === 'right' ? 'left' : 'right'; 22782 22783 // if gpuAcceleration is set to `true` and transform is supported, 22784 // we use `translate3d` to apply the position to the popper we 22785 // automatically use the supported prefixed version if needed 22786 var prefixedProperty = getSupportedPropertyName('transform'); 22787 22788 // now, let's make a step back and look at this code closely (wtf?) 22789 // If the content of the popper grows once it's been positioned, it 22790 // may happen that the popper gets misplaced because of the new content 22791 // overflowing its reference element 22792 // To avoid this problem, we provide two options (x and y), which allow 22793 // the consumer to define the offset origin. 22794 // If we position a popper on top of a reference element, we can set 22795 // `x` to `top` to make the popper grow towards its top instead of 22796 // its bottom. 22797 var left = void 0, 22798 top = void 0; 22799 if (sideA === 'bottom') { 22800 // when offsetParent is <html> the positioning is relative to the bottom of the screen (excluding the scrollbar) 22801 // and not the bottom of the html element 22802 if (offsetParent.nodeName === 'HTML') { 22803 top = -offsetParent.clientHeight + offsets.bottom; 22804 } else { 22805 top = -offsetParentRect.height + offsets.bottom; 22806 } 22807 } else { 22808 top = offsets.top; 22809 } 22810 if (sideB === 'right') { 22811 if (offsetParent.nodeName === 'HTML') { 22812 left = -offsetParent.clientWidth + offsets.right; 22813 } else { 22814 left = -offsetParentRect.width + offsets.right; 22815 } 22816 } else { 22817 left = offsets.left; 22818 } 22819 if (gpuAcceleration && prefixedProperty) { 22820 styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)'; 22821 styles[sideA] = 0; 22822 styles[sideB] = 0; 22823 styles.willChange = 'transform'; 22824 } else { 22825 // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties 22826 var invertTop = sideA === 'bottom' ? -1 : 1; 22827 var invertLeft = sideB === 'right' ? -1 : 1; 22828 styles[sideA] = top * invertTop; 22829 styles[sideB] = left * invertLeft; 22830 styles.willChange = sideA + ', ' + sideB; 22831 } 22832 22833 // Attributes 22834 var attributes = { 22835 'x-placement': data.placement 22836 }; 22837 22838 // Update `data` attributes, styles and arrowStyles 22839 data.attributes = _extends({}, attributes, data.attributes); 22840 data.styles = _extends({}, styles, data.styles); 22841 data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles); 22842 22843 return data; 22844} 22845 22846/** 22847 * Helper used to know if the given modifier depends from another one.<br /> 22848 * It checks if the needed modifier is listed and enabled. 22849 * @method 22850 * @memberof Popper.Utils 22851 * @param {Array} modifiers - list of modifiers 22852 * @param {String} requestingName - name of requesting modifier 22853 * @param {String} requestedName - name of requested modifier 22854 * @returns {Boolean} 22855 */ 22856function isModifierRequired(modifiers, requestingName, requestedName) { 22857 var requesting = find(modifiers, function (_ref) { 22858 var name = _ref.name; 22859 return name === requestingName; 22860 }); 22861 22862 var isRequired = !!requesting && modifiers.some(function (modifier) { 22863 return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order; 22864 }); 22865 22866 if (!isRequired) { 22867 var _requesting = '`' + requestingName + '`'; 22868 var requested = '`' + requestedName + '`'; 22869 console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!'); 22870 } 22871 return isRequired; 22872} 22873 22874/** 22875 * @function 22876 * @memberof Modifiers 22877 * @argument {Object} data - The data object generated by update method 22878 * @argument {Object} options - Modifiers configuration and options 22879 * @returns {Object} The data object, properly modified 22880 */ 22881function arrow(data, options) { 22882 var _data$offsets$arrow; 22883 22884 // arrow depends on keepTogether in order to work 22885 if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) { 22886 return data; 22887 } 22888 22889 var arrowElement = options.element; 22890 22891 // if arrowElement is a string, suppose it's a CSS selector 22892 if (typeof arrowElement === 'string') { 22893 arrowElement = data.instance.popper.querySelector(arrowElement); 22894 22895 // if arrowElement is not found, don't run the modifier 22896 if (!arrowElement) { 22897 return data; 22898 } 22899 } else { 22900 // if the arrowElement isn't a query selector we must check that the 22901 // provided DOM node is child of its popper node 22902 if (!data.instance.popper.contains(arrowElement)) { 22903 console.warn('WARNING: `arrow.element` must be child of its popper element!'); 22904 return data; 22905 } 22906 } 22907 22908 var placement = data.placement.split('-')[0]; 22909 var _data$offsets = data.offsets, 22910 popper = _data$offsets.popper, 22911 reference = _data$offsets.reference; 22912 22913 var isVertical = ['left', 'right'].indexOf(placement) !== -1; 22914 22915 var len = isVertical ? 'height' : 'width'; 22916 var sideCapitalized = isVertical ? 'Top' : 'Left'; 22917 var side = sideCapitalized.toLowerCase(); 22918 var altSide = isVertical ? 'left' : 'top'; 22919 var opSide = isVertical ? 'bottom' : 'right'; 22920 var arrowElementSize = getOuterSizes(arrowElement)[len]; 22921 22922 // 22923 // extends keepTogether behavior making sure the popper and its 22924 // reference have enough pixels in conjunction 22925 // 22926 22927 // top/left side 22928 if (reference[opSide] - arrowElementSize < popper[side]) { 22929 data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize); 22930 } 22931 // bottom/right side 22932 if (reference[side] + arrowElementSize > popper[opSide]) { 22933 data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide]; 22934 } 22935 data.offsets.popper = getClientRect(data.offsets.popper); 22936 22937 // compute center of the popper 22938 var center = reference[side] + reference[len] / 2 - arrowElementSize / 2; 22939 22940 // Compute the sideValue using the updated popper offsets 22941 // take popper margin in account because we don't have this info available 22942 var css = getStyleComputedProperty(data.instance.popper); 22943 var popperMarginSide = parseFloat(css['margin' + sideCapitalized]); 22944 var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width']); 22945 var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide; 22946 22947 // prevent arrowElement from being placed not contiguously to its popper 22948 sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0); 22949 22950 data.arrowElement = arrowElement; 22951 data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow); 22952 22953 return data; 22954} 22955 22956/** 22957 * Get the opposite placement variation of the given one 22958 * @method 22959 * @memberof Popper.Utils 22960 * @argument {String} placement variation 22961 * @returns {String} flipped placement variation 22962 */ 22963function getOppositeVariation(variation) { 22964 if (variation === 'end') { 22965 return 'start'; 22966 } else if (variation === 'start') { 22967 return 'end'; 22968 } 22969 return variation; 22970} 22971 22972/** 22973 * List of accepted placements to use as values of the `placement` option.<br /> 22974 * Valid placements are: 22975 * - `auto` 22976 * - `top` 22977 * - `right` 22978 * - `bottom` 22979 * - `left` 22980 * 22981 * Each placement can have a variation from this list: 22982 * - `-start` 22983 * - `-end` 22984 * 22985 * Variations are interpreted easily if you think of them as the left to right 22986 * written languages. Horizontally (`top` and `bottom`), `start` is left and `end` 22987 * is right.<br /> 22988 * Vertically (`left` and `right`), `start` is top and `end` is bottom. 22989 * 22990 * Some valid examples are: 22991 * - `top-end` (on top of reference, right aligned) 22992 * - `right-start` (on right of reference, top aligned) 22993 * - `bottom` (on bottom, centered) 22994 * - `auto-end` (on the side with more space available, alignment depends by placement) 22995 * 22996 * @static 22997 * @type {Array} 22998 * @enum {String} 22999 * @readonly 23000 * @method placements 23001 * @memberof Popper 23002 */ 23003var placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start']; 23004 23005// Get rid of `auto` `auto-start` and `auto-end` 23006var validPlacements = placements.slice(3); 23007 23008/** 23009 * Given an initial placement, returns all the subsequent placements 23010 * clockwise (or counter-clockwise). 23011 * 23012 * @method 23013 * @memberof Popper.Utils 23014 * @argument {String} placement - A valid placement (it accepts variations) 23015 * @argument {Boolean} counter - Set to true to walk the placements counterclockwise 23016 * @returns {Array} placements including their variations 23017 */ 23018function clockwise(placement) { 23019 var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 23020 23021 var index = validPlacements.indexOf(placement); 23022 var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index)); 23023 return counter ? arr.reverse() : arr; 23024} 23025 23026var BEHAVIORS = { 23027 FLIP: 'flip', 23028 CLOCKWISE: 'clockwise', 23029 COUNTERCLOCKWISE: 'counterclockwise' 23030}; 23031 23032/** 23033 * @function 23034 * @memberof Modifiers 23035 * @argument {Object} data - The data object generated by update method 23036 * @argument {Object} options - Modifiers configuration and options 23037 * @returns {Object} The data object, properly modified 23038 */ 23039function flip(data, options) { 23040 // if `inner` modifier is enabled, we can't use the `flip` modifier 23041 if (isModifierEnabled(data.instance.modifiers, 'inner')) { 23042 return data; 23043 } 23044 23045 if (data.flipped && data.placement === data.originalPlacement) { 23046 // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides 23047 return data; 23048 } 23049 23050 var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed); 23051 23052 var placement = data.placement.split('-')[0]; 23053 var placementOpposite = getOppositePlacement(placement); 23054 var variation = data.placement.split('-')[1] || ''; 23055 23056 var flipOrder = []; 23057 23058 switch (options.behavior) { 23059 case BEHAVIORS.FLIP: 23060 flipOrder = [placement, placementOpposite]; 23061 break; 23062 case BEHAVIORS.CLOCKWISE: 23063 flipOrder = clockwise(placement); 23064 break; 23065 case BEHAVIORS.COUNTERCLOCKWISE: 23066 flipOrder = clockwise(placement, true); 23067 break; 23068 default: 23069 flipOrder = options.behavior; 23070 } 23071 23072 flipOrder.forEach(function (step, index) { 23073 if (placement !== step || flipOrder.length === index + 1) { 23074 return data; 23075 } 23076 23077 placement = data.placement.split('-')[0]; 23078 placementOpposite = getOppositePlacement(placement); 23079 23080 var popperOffsets = data.offsets.popper; 23081 var refOffsets = data.offsets.reference; 23082 23083 // using floor because the reference offsets may contain decimals we are not going to consider here 23084 var floor = Math.floor; 23085 var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom); 23086 23087 var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left); 23088 var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right); 23089 var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top); 23090 var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom); 23091 23092 var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom; 23093 23094 // flip the variation if required 23095 var isVertical = ['top', 'bottom'].indexOf(placement) !== -1; 23096 23097 // flips variation if reference element overflows boundaries 23098 var flippedVariationByRef = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom); 23099 23100 // flips variation if popper content overflows boundaries 23101 var flippedVariationByContent = !!options.flipVariationsByContent && (isVertical && variation === 'start' && overflowsRight || isVertical && variation === 'end' && overflowsLeft || !isVertical && variation === 'start' && overflowsBottom || !isVertical && variation === 'end' && overflowsTop); 23102 23103 var flippedVariation = flippedVariationByRef || flippedVariationByContent; 23104 23105 if (overlapsRef || overflowsBoundaries || flippedVariation) { 23106 // this boolean to detect any flip loop 23107 data.flipped = true; 23108 23109 if (overlapsRef || overflowsBoundaries) { 23110 placement = flipOrder[index + 1]; 23111 } 23112 23113 if (flippedVariation) { 23114 variation = getOppositeVariation(variation); 23115 } 23116 23117 data.placement = placement + (variation ? '-' + variation : ''); 23118 23119 // this object contains `position`, we want to preserve it along with 23120 // any additional property we may add in the future 23121 data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement)); 23122 23123 data = runModifiers(data.instance.modifiers, data, 'flip'); 23124 } 23125 }); 23126 return data; 23127} 23128 23129/** 23130 * @function 23131 * @memberof Modifiers 23132 * @argument {Object} data - The data object generated by update method 23133 * @argument {Object} options - Modifiers configuration and options 23134 * @returns {Object} The data object, properly modified 23135 */ 23136function keepTogether(data) { 23137 var _data$offsets = data.offsets, 23138 popper = _data$offsets.popper, 23139 reference = _data$offsets.reference; 23140 23141 var placement = data.placement.split('-')[0]; 23142 var floor = Math.floor; 23143 var isVertical = ['top', 'bottom'].indexOf(placement) !== -1; 23144 var side = isVertical ? 'right' : 'bottom'; 23145 var opSide = isVertical ? 'left' : 'top'; 23146 var measurement = isVertical ? 'width' : 'height'; 23147 23148 if (popper[side] < floor(reference[opSide])) { 23149 data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement]; 23150 } 23151 if (popper[opSide] > floor(reference[side])) { 23152 data.offsets.popper[opSide] = floor(reference[side]); 23153 } 23154 23155 return data; 23156} 23157 23158/** 23159 * Converts a string containing value + unit into a px value number 23160 * @function 23161 * @memberof {modifiers~offset} 23162 * @private 23163 * @argument {String} str - Value + unit string 23164 * @argument {String} measurement - `height` or `width` 23165 * @argument {Object} popperOffsets 23166 * @argument {Object} referenceOffsets 23167 * @returns {Number|String} 23168 * Value in pixels, or original string if no values were extracted 23169 */ 23170function toValue(str, measurement, popperOffsets, referenceOffsets) { 23171 // separate value from unit 23172 var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/); 23173 var value = +split[1]; 23174 var unit = split[2]; 23175 23176 // If it's not a number it's an operator, I guess 23177 if (!value) { 23178 return str; 23179 } 23180 23181 if (unit.indexOf('%') === 0) { 23182 var element = void 0; 23183 switch (unit) { 23184 case '%p': 23185 element = popperOffsets; 23186 break; 23187 case '%': 23188 case '%r': 23189 default: 23190 element = referenceOffsets; 23191 } 23192 23193 var rect = getClientRect(element); 23194 return rect[measurement] / 100 * value; 23195 } else if (unit === 'vh' || unit === 'vw') { 23196 // if is a vh or vw, we calculate the size based on the viewport 23197 var size = void 0; 23198 if (unit === 'vh') { 23199 size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); 23200 } else { 23201 size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0); 23202 } 23203 return size / 100 * value; 23204 } else { 23205 // if is an explicit pixel unit, we get rid of the unit and keep the value 23206 // if is an implicit unit, it's px, and we return just the value 23207 return value; 23208 } 23209} 23210 23211/** 23212 * Parse an `offset` string to extrapolate `x` and `y` numeric offsets. 23213 * @function 23214 * @memberof {modifiers~offset} 23215 * @private 23216 * @argument {String} offset 23217 * @argument {Object} popperOffsets 23218 * @argument {Object} referenceOffsets 23219 * @argument {String} basePlacement 23220 * @returns {Array} a two cells array with x and y offsets in numbers 23221 */ 23222function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) { 23223 var offsets = [0, 0]; 23224 23225 // Use height if placement is left or right and index is 0 otherwise use width 23226 // in this way the first offset will use an axis and the second one 23227 // will use the other one 23228 var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1; 23229 23230 // Split the offset string to obtain a list of values and operands 23231 // The regex addresses values with the plus or minus sign in front (+10, -20, etc) 23232 var fragments = offset.split(/(\+|\-)/).map(function (frag) { 23233 return frag.trim(); 23234 }); 23235 23236 // Detect if the offset string contains a pair of values or a single one 23237 // they could be separated by comma or space 23238 var divider = fragments.indexOf(find(fragments, function (frag) { 23239 return frag.search(/,|\s/) !== -1; 23240 })); 23241 23242 if (fragments[divider] && fragments[divider].indexOf(',') === -1) { 23243 console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.'); 23244 } 23245 23246 // If divider is found, we divide the list of values and operands to divide 23247 // them by ofset X and Y. 23248 var splitRegex = /\s*,\s*|\s+/; 23249 var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments]; 23250 23251 // Convert the values with units to absolute pixels to allow our computations 23252 ops = ops.map(function (op, index) { 23253 // Most of the units rely on the orientation of the popper 23254 var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width'; 23255 var mergeWithPrevious = false; 23256 return op 23257 // This aggregates any `+` or `-` sign that aren't considered operators 23258 // e.g.: 10 + +5 => [10, +, +5] 23259 .reduce(function (a, b) { 23260 if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) { 23261 a[a.length - 1] = b; 23262 mergeWithPrevious = true; 23263 return a; 23264 } else if (mergeWithPrevious) { 23265 a[a.length - 1] += b; 23266 mergeWithPrevious = false; 23267 return a; 23268 } else { 23269 return a.concat(b); 23270 } 23271 }, []) 23272 // Here we convert the string values into number values (in px) 23273 .map(function (str) { 23274 return toValue(str, measurement, popperOffsets, referenceOffsets); 23275 }); 23276 }); 23277 23278 // Loop trough the offsets arrays and execute the operations 23279 ops.forEach(function (op, index) { 23280 op.forEach(function (frag, index2) { 23281 if (isNumeric(frag)) { 23282 offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1); 23283 } 23284 }); 23285 }); 23286 return offsets; 23287} 23288 23289/** 23290 * @function 23291 * @memberof Modifiers 23292 * @argument {Object} data - The data object generated by update method 23293 * @argument {Object} options - Modifiers configuration and options 23294 * @argument {Number|String} options.offset=0 23295 * The offset value as described in the modifier description 23296 * @returns {Object} The data object, properly modified 23297 */ 23298function offset(data, _ref) { 23299 var offset = _ref.offset; 23300 var placement = data.placement, 23301 _data$offsets = data.offsets, 23302 popper = _data$offsets.popper, 23303 reference = _data$offsets.reference; 23304 23305 var basePlacement = placement.split('-')[0]; 23306 23307 var offsets = void 0; 23308 if (isNumeric(+offset)) { 23309 offsets = [+offset, 0]; 23310 } else { 23311 offsets = parseOffset(offset, popper, reference, basePlacement); 23312 } 23313 23314 if (basePlacement === 'left') { 23315 popper.top += offsets[0]; 23316 popper.left -= offsets[1]; 23317 } else if (basePlacement === 'right') { 23318 popper.top += offsets[0]; 23319 popper.left += offsets[1]; 23320 } else if (basePlacement === 'top') { 23321 popper.left += offsets[0]; 23322 popper.top -= offsets[1]; 23323 } else if (basePlacement === 'bottom') { 23324 popper.left += offsets[0]; 23325 popper.top += offsets[1]; 23326 } 23327 23328 data.popper = popper; 23329 return data; 23330} 23331 23332/** 23333 * @function 23334 * @memberof Modifiers 23335 * @argument {Object} data - The data object generated by `update` method 23336 * @argument {Object} options - Modifiers configuration and options 23337 * @returns {Object} The data object, properly modified 23338 */ 23339function preventOverflow(data, options) { 23340 var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper); 23341 23342 // If offsetParent is the reference element, we really want to 23343 // go one step up and use the next offsetParent as reference to 23344 // avoid to make this modifier completely useless and look like broken 23345 if (data.instance.reference === boundariesElement) { 23346 boundariesElement = getOffsetParent(boundariesElement); 23347 } 23348 23349 // NOTE: DOM access here 23350 // resets the popper's position so that the document size can be calculated excluding 23351 // the size of the popper element itself 23352 var transformProp = getSupportedPropertyName('transform'); 23353 var popperStyles = data.instance.popper.style; // assignment to help minification 23354 var top = popperStyles.top, 23355 left = popperStyles.left, 23356 transform = popperStyles[transformProp]; 23357 23358 popperStyles.top = ''; 23359 popperStyles.left = ''; 23360 popperStyles[transformProp] = ''; 23361 23362 var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed); 23363 23364 // NOTE: DOM access here 23365 // restores the original style properties after the offsets have been computed 23366 popperStyles.top = top; 23367 popperStyles.left = left; 23368 popperStyles[transformProp] = transform; 23369 23370 options.boundaries = boundaries; 23371 23372 var order = options.priority; 23373 var popper = data.offsets.popper; 23374 23375 var check = { 23376 primary: function primary(placement) { 23377 var value = popper[placement]; 23378 if (popper[placement] < boundaries[placement] && !options.escapeWithReference) { 23379 value = Math.max(popper[placement], boundaries[placement]); 23380 } 23381 return defineProperty({}, placement, value); 23382 }, 23383 secondary: function secondary(placement) { 23384 var mainSide = placement === 'right' ? 'left' : 'top'; 23385 var value = popper[mainSide]; 23386 if (popper[placement] > boundaries[placement] && !options.escapeWithReference) { 23387 value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height)); 23388 } 23389 return defineProperty({}, mainSide, value); 23390 } 23391 }; 23392 23393 order.forEach(function (placement) { 23394 var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary'; 23395 popper = _extends({}, popper, check[side](placement)); 23396 }); 23397 23398 data.offsets.popper = popper; 23399 23400 return data; 23401} 23402 23403/** 23404 * @function 23405 * @memberof Modifiers 23406 * @argument {Object} data - The data object generated by `update` method 23407 * @argument {Object} options - Modifiers configuration and options 23408 * @returns {Object} The data object, properly modified 23409 */ 23410function shift(data) { 23411 var placement = data.placement; 23412 var basePlacement = placement.split('-')[0]; 23413 var shiftvariation = placement.split('-')[1]; 23414 23415 // if shift shiftvariation is specified, run the modifier 23416 if (shiftvariation) { 23417 var _data$offsets = data.offsets, 23418 reference = _data$offsets.reference, 23419 popper = _data$offsets.popper; 23420 23421 var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1; 23422 var side = isVertical ? 'left' : 'top'; 23423 var measurement = isVertical ? 'width' : 'height'; 23424 23425 var shiftOffsets = { 23426 start: defineProperty({}, side, reference[side]), 23427 end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement]) 23428 }; 23429 23430 data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]); 23431 } 23432 23433 return data; 23434} 23435 23436/** 23437 * @function 23438 * @memberof Modifiers 23439 * @argument {Object} data - The data object generated by update method 23440 * @argument {Object} options - Modifiers configuration and options 23441 * @returns {Object} The data object, properly modified 23442 */ 23443function hide(data) { 23444 if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) { 23445 return data; 23446 } 23447 23448 var refRect = data.offsets.reference; 23449 var bound = find(data.instance.modifiers, function (modifier) { 23450 return modifier.name === 'preventOverflow'; 23451 }).boundaries; 23452 23453 if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) { 23454 // Avoid unnecessary DOM access if visibility hasn't changed 23455 if (data.hide === true) { 23456 return data; 23457 } 23458 23459 data.hide = true; 23460 data.attributes['x-out-of-boundaries'] = ''; 23461 } else { 23462 // Avoid unnecessary DOM access if visibility hasn't changed 23463 if (data.hide === false) { 23464 return data; 23465 } 23466 23467 data.hide = false; 23468 data.attributes['x-out-of-boundaries'] = false; 23469 } 23470 23471 return data; 23472} 23473 23474/** 23475 * @function 23476 * @memberof Modifiers 23477 * @argument {Object} data - The data object generated by `update` method 23478 * @argument {Object} options - Modifiers configuration and options 23479 * @returns {Object} The data object, properly modified 23480 */ 23481function inner(data) { 23482 var placement = data.placement; 23483 var basePlacement = placement.split('-')[0]; 23484 var _data$offsets = data.offsets, 23485 popper = _data$offsets.popper, 23486 reference = _data$offsets.reference; 23487 23488 var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1; 23489 23490 var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1; 23491 23492 popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0); 23493 23494 data.placement = getOppositePlacement(placement); 23495 data.offsets.popper = getClientRect(popper); 23496 23497 return data; 23498} 23499 23500/** 23501 * Modifier function, each modifier can have a function of this type assigned 23502 * to its `fn` property.<br /> 23503 * These functions will be called on each update, this means that you must 23504 * make sure they are performant enough to avoid performance bottlenecks. 23505 * 23506 * @function ModifierFn 23507 * @argument {dataObject} data - The data object generated by `update` method 23508 * @argument {Object} options - Modifiers configuration and options 23509 * @returns {dataObject} The data object, properly modified 23510 */ 23511 23512/** 23513 * Modifiers are plugins used to alter the behavior of your poppers.<br /> 23514 * Popper.js uses a set of 9 modifiers to provide all the basic functionalities 23515 * needed by the library. 23516 * 23517 * Usually you don't want to override the `order`, `fn` and `onLoad` props. 23518 * All the other properties are configurations that could be tweaked. 23519 * @namespace modifiers 23520 */ 23521var modifiers = { 23522 /** 23523 * Modifier used to shift the popper on the start or end of its reference 23524 * element.<br /> 23525 * It will read the variation of the `placement` property.<br /> 23526 * It can be one either `-end` or `-start`. 23527 * @memberof modifiers 23528 * @inner 23529 */ 23530 shift: { 23531 /** @prop {number} order=100 - Index used to define the order of execution */ 23532 order: 100, 23533 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 23534 enabled: true, 23535 /** @prop {ModifierFn} */ 23536 fn: shift 23537 }, 23538 23539 /** 23540 * The `offset` modifier can shift your popper on both its axis. 23541 * 23542 * It accepts the following units: 23543 * - `px` or unit-less, interpreted as pixels 23544 * - `%` or `%r`, percentage relative to the length of the reference element 23545 * - `%p`, percentage relative to the length of the popper element 23546 * - `vw`, CSS viewport width unit 23547 * - `vh`, CSS viewport height unit 23548 * 23549 * For length is intended the main axis relative to the placement of the popper.<br /> 23550 * This means that if the placement is `top` or `bottom`, the length will be the 23551 * `width`. In case of `left` or `right`, it will be the `height`. 23552 * 23553 * You can provide a single value (as `Number` or `String`), or a pair of values 23554 * as `String` divided by a comma or one (or more) white space
23554s.<br /> 23555 * The latter is a deprecated method because it leads to confusion and will be 23556 * removed in v2.<br /> 23557 * Additionally, it accepts additions and subtractions between different units. 23558 * Note that multiplications and divisions aren't supported. 23559 * 23560 * Valid examples are: 23561 * ``` 23562 * 10 23563 * '10%' 23564 * '10, 10' 23565 * '10%, 10' 23566 * '10 + 10%' 23567 * '10 - 5vh + 3%' 23568 * '-10px + 5vh, 5px - 6%' 23569 * ``` 23570 * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap 23571 * > with their reference element, unfortunately, you will have to disable the `flip` modifier. 23572 * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373). 23573 * 23574 * @memberof modifiers 23575 * @inner 23576 */ 23577 offset: { 23578 /** @prop {number} order=200 - Index used to define the order of execution */ 23579 order: 200, 23580 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 23581 enabled: true, 23582 /** @prop {ModifierFn} */ 23583 fn: offset, 23584 /** @prop {Number|String} offset=0 23585 * The offset value as described in the modifier description 23586 */ 23587 offset: 0 23588 }, 23589 23590 /** 23591 * Modifier used to prevent the popper from being positioned outside the boundary. 23592 * 23593 * A scenario exists where the reference itself is not within the boundaries.<br /> 23594 * We can say it has "escaped the boundaries" — or just "escaped".<br /> 23595 * In this case we need to decide whether the popper should either: 23596 * 23597 * - detach from the reference and remain "trapped" in the boundaries, or 23598 * - if it should ignore the boundary and "escape with its reference" 23599 * 23600 * When `escapeWithReference` is set to`true` and reference is completely 23601 * outside its boundaries, the popper will overflow (or completely leave) 23602 * the boundaries in order to remain attached to the edge of the reference. 23603 * 23604 * @memberof modifiers 23605 * @inner 23606 */ 23607 preventOverflow: { 23608 /** @prop {number} order=300 - Index used to define the order of execution */ 23609 order: 300, 23610 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 23611 enabled: true, 23612 /** @prop {ModifierFn} */ 23613 fn: preventOverflow, 23614 /** 23615 * @prop {Array} [priority=['left','right','top','bottom']] 23616 * Popper will try to prevent overflow following these priorities by default, 23617 * then, it could overflow on the left and on top of the `boundariesElement` 23618 */ 23619 priority: ['left', 'right', 'top', 'bottom'], 23620 /** 23621 * @prop {number} padding=5 23622 * Amount of pixel used to define a minimum distance between the boundaries 23623 * and the popper. This makes sure the popper always has a little padding 23624 * between the edges of its container 23625 */ 23626 padding: 5, 23627 /** 23628 * @prop {String|HTMLElement} boundariesElement='scrollParent' 23629 * Boundaries used by the modifier. Can be `scrollParent`, `window`, 23630 * `viewport` or any DOM element. 23631 */ 23632 boundariesElement: 'scrollParent' 23633 }, 23634 23635 /** 23636 * Modifier used to make sure the reference and its popper stay near each other 23637 * without leaving any gap between the two. Especially useful when the arrow is 23638 * enabled and you want to ensure that it points to its reference element. 23639 * It cares only about the first axis. You can still have poppers with margin 23640 * between the popper and its reference element. 23641 * @memberof modifiers 23642 * @inner 23643 */ 23644 keepTogether: { 23645 /** @prop {number} order=400 - Index used to define the order of execution */ 23646 order: 400, 23647 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 23648 enabled: true, 23649 /** @prop {ModifierFn} */ 23650 fn: keepTogether 23651 }, 23652 23653 /** 23654 * This modifier is used to move the `arrowElement` of the popper to make 23655 * sure it is positioned between the reference element and its popper element. 23656 * It will read the outer size of the `arrowElement` node to detect how many 23657 * pixels of conjunction are needed. 23658 * 23659 * It has no effect if no `arrowElement` is provided. 23660 * @memberof modifiers 23661 * @inner 23662 */ 23663 arrow: { 23664 /** @prop {number} order=500 - Index used to define the order of execution */ 23665 order: 500, 23666 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 23667 enabled: true, 23668 /** @prop {ModifierFn} */ 23669 fn: arrow, 23670 /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */ 23671 element: '[x-arrow]' 23672 }, 23673 23674 /** 23675 * Modifier used to flip the popper's placement when it starts to overlap its 23676 * reference element. 23677 * 23678 * Requires the `preventOverflow` modifier before it in order to work. 23679 * 23680 * **NOTE:** this modifier will interrupt the current update cycle and will 23681 * restart it if it detects the need to flip the placement. 23682 * @memberof modifiers 23683 * @inner 23684 */ 23685 flip: { 23686 /** @prop {number} order=600 - Index used to define the order of execution */ 23687 order: 600, 23688 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 23689 enabled: true, 23690 /** @prop {ModifierFn} */ 23691 fn: flip, 23692 /** 23693 * @prop {String|Array} behavior='flip' 23694 * The behavior used to change the popper's placement. It can be one of 23695 * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid 23696 * placements (with optional variations) 23697 */ 23698 behavior: 'flip', 23699 /** 23700 * @prop {number} padding=5 23701 * The popper will flip if it hits the edges of the `boundariesElement` 23702 */ 23703 padding: 5, 23704 /** 23705 * @prop {String|HTMLElement} boundariesElement='viewport' 23706 * The element which will define the boundaries of the popper position. 23707 * The popper will never be placed outside of the defined boundaries 23708 * (except if `keepTogether` is enabled) 23709 */ 23710 boundariesElement: 'viewport', 23711 /** 23712 * @prop {Boolean} flipVariations=false 23713 * The popper will switch placement variation between `-start` and `-end` when 23714 * the reference element overlaps its boundaries. 23715 * 23716 * The original placement should have a set variation. 23717 */ 23718 flipVariations: false, 23719 /** 23720 * @prop {Boolean} flipVariationsByContent=false 23721 * The popper will switch placement variation between `-start` and `-end` when 23722 * the popper element overlaps its reference boundaries. 23723 * 23724 * The original placement should have a set variation. 23725 */ 23726 flipVariationsByContent: false 23727 }, 23728 23729 /** 23730 * Modifier used to make the popper flow toward the inner of the reference element. 23731 * By default, when this modifier is disabled, the popper will be placed outside 23732 * the reference element. 23733 * @memberof modifiers 23734 * @inner 23735 */ 23736 inner: { 23737 /** @prop {number} order=700 - Index used to define the order of execution */ 23738 order: 700, 23739 /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */ 23740 enabled: false, 23741 /** @prop {ModifierFn} */ 23742 fn: inner 23743 }, 23744 23745 /** 23746 * Modifier used to hide the popper when its reference element is outside of the 23747 * popper boundaries. It will set a `x-out-of-boundaries` attribute which can 23748 * be used to hide with a CSS selector the popper when its reference is 23749 * out of boundaries. 23750 * 23751 * Requires the `preventOverflow` modifier before it in order to work. 23752 * @memberof modifiers 23753 * @inner 23754 */ 23755 hide: { 23756 /** @prop {number} order=800 - Index used to define the order of execution */ 23757 order: 800, 23758 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 23759 enabled: true, 23760 /** @prop {ModifierFn} */ 23761 fn: hide 23762 }, 23763 23764 /** 23765 * Computes the style that will be applied to the popper element to gets 23766 * properly positioned. 23767 * 23768 * Note that this modifier will not touch the DOM, it just prepares the styles 23769 * so that `applyStyle` modifier can apply it. This separation is useful 23770 * in case you need to replace `applyStyle` with a custom implementation. 23771 * 23772 * This modifier has `850` as `order` value to maintain backward compatibility 23773 * with previous versions of Popper.js. Expect the modifiers ordering method 23774 * to change in future major versions of the library. 23775 * 23776 * @memberof modifiers 23777 * @inner 23778 */ 23779 computeStyle: { 23780 /** @prop {number} order=850 - Index used to define the order of execution */ 23781 order: 850, 23782 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 23783 enabled: true, 23784 /** @prop {ModifierFn} */ 23785 fn: computeStyle, 23786 /** 23787 * @prop {Boolean} gpuAcceleration=true 23788 * If true, it uses the CSS 3D transformation to position the popper. 23789 * Otherwise, it will use the `top` and `left` properties 23790 */ 23791 gpuAcceleration: true, 23792 /** 23793 * @prop {string} [x='bottom'] 23794 * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin. 23795 * Change this if your popper should grow in a direction different from `bottom` 23796 */ 23797 x: 'bottom', 23798 /** 23799 * @prop {string} [x='left'] 23800 * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin. 23801 * Change this if your popper should grow in a direction different from `right` 23802 */ 23803 y: 'right' 23804 }, 23805 23806 /** 23807 * Applies the computed styles to the popper element. 23808 * 23809 * All the DOM manipulations are limited to this modifier. This is useful in case 23810 * you want to integrate Popper.js inside a framework or view library and you 23811 * want to delegate all the DOM manipulations to it. 23812 * 23813 * Note that if you disable this modifier, you must make sure the popper element 23814 * has its position set to `absolute` before Popper.js can do its work! 23815 * 23816 * Just disable this modifier and define your own to achieve the desired effect. 23817 * 23818 * @memberof modifiers 23819 * @inner 23820 */ 23821 applyStyle: { 23822 /** @prop {number} order=900 - Index used to define the order of execution */ 23823 order: 900, 23824 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 23825 enabled: true, 23826 /** @prop {ModifierFn} */
vendor: 4,967 bytes, lines 23827-23965
23827 fn: applyStyle, 23828 /** @prop {Function} */ 23829 onLoad: applyStyleOnLoad, 23830 /** 23831 * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier 23832 * @prop {Boolean} gpuAcceleration=true 23833 * If true, it uses the CSS 3D transformation to position the popper. 23834 * Otherwise, it will use the `top` and `left` properties 23835 */ 23836 gpuAcceleration: undefined 23837 } 23838}; 23839 23840/** 23841 * The `dataObject` is an object containing all the information used by Popper.js. 23842 * This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks. 23843 * @name dataObject 23844 * @property {Object} data.instance The Popper.js instance 23845 * @property {String} data.placement Placement applied to popper 23846 * @property {String} data.originalPlacement Placement originally defined on init 23847 * @property {Boolean} data.flipped True if popper has been flipped by flip modifier 23848 * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper 23849 * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier 23850 * @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`) 23851 * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`) 23852 * @property {Object} data.boundaries Offsets of the popper boundaries 23853 * @property {Object} data.offsets The measurements of popper, reference and arrow elements 23854 * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values 23855 * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values 23856 * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0 23857 */ 23858 23859/** 23860 * Default options provided to Popper.js constructor.<br /> 23861 * These can be overridden using the `options` argument of Popper.js.<br /> 23862 * To override an option, simply pass an object with the same 23863 * structure of the `options` object, as the 3rd argument. For example: 23864 * ``` 23865 * new Popper(ref, pop, { 23866 * modifiers: { 23867 * preventOverflow: { enabled: false } 23868 * } 23869 * }) 23870 * ``` 23871 * @type {Object} 23872 * @static 23873 * @memberof Popper 23874 */ 23875var Defaults = { 23876 /** 23877 * Popper's placement. 23878 * @prop {Popper.placements} placement='bottom' 23879 */ 23880 placement: 'bottom', 23881 23882 /** 23883 * Set this to true if you want popper to position it self in 'fixed' mode 23884 * @prop {Boolean} positionFixed=false 23885 */ 23886 positionFixed: false, 23887 23888 /** 23889 * Whether events (resize, scroll) are initially enabled. 23890 * @prop {Boolean} eventsEnabled=true 23891 */ 23892 eventsEnabled: true, 23893 23894 /** 23895 * Set to true if you want to automatically remove the popper when 23896 * you call the `destroy` method. 23897 * @prop {Boolean} removeOnDestroy=false 23898 */ 23899 removeOnDestroy: false, 23900 23901 /** 23902 * Callback called when the popper is created.<br /> 23903 * By default, it is set to no-op.<br /> 23904 * Access Popper.js instance with `data.instance`. 23905 * @prop {onCreate} 23906 */ 23907 onCreate: function onCreate() {}, 23908 23909 /** 23910 * Callback called when the popper is updated. This callback is not called 23911 * on the initialization/creation of the popper, but only on subsequent 23912 * updates.<br /> 23913 * By default, it is set to no-op.<br /> 23914 * Access Popper.js instance with `data.instance`. 23915 * @prop {onUpdate} 23916 */ 23917 onUpdate: function onUpdate() {}, 23918 23919 /** 23920 * List of modifiers used to modify the offsets before they are applied to the popper. 23921 * They provide most of the functionalities of Popper.js. 23922 * @prop {modifiers} 23923 */ 23924 modifiers: modifiers 23925}; 23926 23927/** 23928 * @callback onCreate 23929 * @param {dataObject} data 23930 */ 23931 23932/** 23933 * @callback onUpdate 23934 * @param {dataObject} data 23935 */ 23936 23937// Utils 23938// Methods 23939var Popper = function () { 23940 /** 23941 * Creates a new Popper.js instance. 23942 * @class Popper 23943 * @param {Element|referenceObject} reference - The reference element used to position the popper 23944 * @param {Element} popper - The HTML / XML element used as the popper 23945 * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults) 23946 * @return {Object} instance - The generated Popper.js instance 23947 */ 23948 function Popper(reference, popper) { 23949 var _this = this; 23950 23951 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; 23952 classCallCheck(this, Popper); 23953 23954 this.scheduleUpdate = function () { 23955 return requestAnimationFrame(_this.update); 23956 }; 23957 23958 // make update() debounced, so that it only runs at most once-per-tick 23959 this.update = debounce(this.update.bind(this)); 23960 23961 // with {} we create a new object with the options inside it 23962 this.options = _extends({}, Popper.Defaults, options); 23963 23964 // init state 23965 this.state = {
vendor: 6,101 bytes, lines 23966-24127
23966 isDestroyed: false, 23967 isCreated: false, 23968 scrollParents: [] 23969 }; 23970 23971 // get reference and popper elements (allow jQuery wrappers) 23972 this.reference = reference && reference.jquery ? reference[0] : reference; 23973 this.popper = popper && popper.jquery ? popper[0] : popper; 23974 23975 // Deep merge modifiers options 23976 this.options.modifiers = {}; 23977 Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) { 23978 _this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {}); 23979 }); 23980 23981 // Refactoring modifiers' list (Object => Array) 23982 this.modifiers = Object.keys(this.options.modifiers).map(function (name) { 23983 return _extends({ 23984 name: name 23985 }, _this.options.modifiers[name]); 23986 }) 23987 // sort the modifiers by order 23988 .sort(function (a, b) { 23989 return a.order - b.order; 23990 }); 23991 23992 // modifiers have the ability to execute arbitrary code when Popper.js get inited 23993 // such code is executed in the same order of its modifier 23994 // they could add new properties to their options configuration 23995 // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`! 23996 this.modifiers.forEach(function (modifierOptions) { 23997 if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) { 23998 modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state); 23999 } 24000 }); 24001 24002 // fire the first update to position the popper in the right place 24003 this.update(); 24004 24005 var eventsEnabled = this.options.eventsEnabled; 24006 if (eventsEnabled) { 24007 // setup event listeners, they will take care of update the position in specific situations 24008 this.enableEventListeners(); 24009 } 24010 24011 this.state.eventsEnabled = eventsEnabled; 24012 } 24013 24014 // We can't use class properties because they don't get listed in the 24015 // class prototype and break stuff like Sinon stubs 24016 24017 24018 createClass(Popper, [{ 24019 key: 'update', 24020 value: function update$$1() { 24021 return update.call(this); 24022 } 24023 }, { 24024 key: 'destroy', 24025 value: function destroy$$1() { 24026 return destroy.call(this); 24027 } 24028 }, { 24029 key: 'enableEventListeners', 24030 value: function enableEventListeners$$1() { 24031 return enableEventListeners.call(this); 24032 } 24033 }, { 24034 key: 'disableEventListeners', 24035 value: function disableEventListeners$$1() { 24036 return disableEventListeners.call(this); 24037 } 24038 24039 /** 24040 * Schedules an update. It will run on the next UI update available. 24041 * @method scheduleUpdate 24042 * @memberof Popper 24043 */ 24044 24045 24046 /** 24047 * Collection of utilities useful when writing custom modifiers. 24048 * Starting from version 1.7, this method is available only if you 24049 * include `popper-utils.js` before `popper.js`. 24050 * 24051 * **DEPRECATION**: This way to access PopperUtils is deprecated 24052 * and will be removed in v2! Use the PopperUtils module directly instead. 24053 * Due to the high instability of the methods contained in Utils, we can't 24054 * guarantee them to follow semver. Use them at your own risk! 24055 * @static 24056 * @private 24057 * @type {Object} 24058 * @deprecated since version 1.8 24059 * @member Utils 24060 * @memberof Popper 24061 */ 24062 24063 }]); 24064 return Popper; 24065}(); 24066 24067/** 24068 * The `referenceObject` is an object that provides an interface compatible with Popper.js 24069 * and lets you use it as replacement of a real DOM node.<br /> 24070 * You can use this method to position a popper relatively to a set of coordinates 24071 * in case you don't have a DOM node to use as reference. 24072 * 24073 * ``` 24074 * new Popper(referenceObject, popperNode); 24075 * ``` 24076 * 24077 * NB: This feature isn't supported in Internet Explorer 10. 24078 * @name referenceObject 24079 * @property {Function} data.getBoundingClientRect 24080 * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method. 24081 * @property {number} data.clientWidth 24082 * An ES6 getter that will return the width of the virtual reference element. 24083 * @property {number} data.clientHeight 24084 * An ES6 getter that will return the height of the virtual reference element. 24085 */ 24086 24087 24088Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils; 24089Popper.placements = placements; 24090Popper.Defaults = Defaults; 24091 24092return Popper; 24093 24094}))); 24095//# sourceMappingURL=popper.js.map 24096/*! 24097 * Bootstrap v4.6.2 (https://getbootstrap.com/) 24098 * Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 24099 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 24100 */ 24101(function (global, factory) { 24102 typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('jquery'), require('popper.js')) : 24103 typeof define === 'function' && define.amd ? define(['exports', 'jquery', 'popper.js'], factory) : 24104 (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.bootstrap = {}, global.jQuery, global.Popper)); 24105})(this, (function (exports, $, Popper) { 'use strict'; 24106 24107 function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } 24108 24109 var $__default = /*#__PURE__*/_interopDefaultLegacy($); 24110 var Popper__default = /*#__PURE__*/_interopDefaultLegacy(Popper); 24111 24112 function _defineProperties(target, props) { 24113 for (var i = 0; i < props.length; i++) { 24114 var descriptor = props[i]; 24115 descriptor.enumerable = descriptor.enumerable || false; 24116 descriptor.configurable = true; 24117 if ("value" in descriptor) descriptor.writable = true; 24118 Object.defineProperty(target, descriptor.key, descriptor); 24119 } 24120 } 24121 24122 function _createClass(Constructor, protoProps, staticProps) { 24123 if (protoProps) _defineProperties(Constructor.prototype, protoProps); 24124 if (staticProps) _defineProperties(Constructor, staticProps); 24125 Object.defineProperty(Constructor, "prototype", { 24126 writable: false 24127 });
vendor: 1,536 bytes, lines 24128-24179
24128 return Constructor; 24129 } 24130 24131 function _extends() { 24132 _extends = Object.assign ? Object.assign.bind() : function (target) { 24133 for (var i = 1; i < arguments.length; i++) { 24134 var source = arguments[i]; 24135 24136 for (var key in source) { 24137 if (Object.prototype.hasOwnProperty.call(source, key)) { 24138 target[key] = source[key]; 24139 } 24140 } 24141 } 24142 24143 return target; 24144 }; 24145 return _extends.apply(this, arguments); 24146 } 24147 24148 function _inheritsLoose(subClass, superClass) { 24149 subClass.prototype = Object.create(superClass.prototype); 24150 subClass.prototype.constructor = subClass; 24151 24152 _setPrototypeOf(subClass, superClass); 24153 } 24154 24155 function _setPrototypeOf(o, p) { 24156 _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { 24157 o.__proto__ = p; 24158 return o; 24159 }; 24160 return _setPrototypeOf(o, p); 24161 } 24162 24163 /** 24164 * -------------------------------------------------------------------------- 24165 * Bootstrap (v4.6.2): util.js 24166 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 24167 * -------------------------------------------------------------------------- 24168 */ 24169 /** 24170 * Private TransitionEnd Helpers 24171 */ 24172 24173 var TRANSITION_END = 'transitionend'; 24174 var MAX_UID = 1000000; 24175 var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp) 24176 24177 function toType(obj) { 24178 if (obj === null || typeof obj === 'undefined') { 24179 return "" + obj;
vendor: 5,149 bytes, lines 24180-24326
24180 } 24181 24182 return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase(); 24183 } 24184 24185 function getSpecialTransitionEndEvent() { 24186 return { 24187 bindType: TRANSITION_END, 24188 delegateType: TRANSITION_END, 24189 handle: function handle(event) { 24190 if ($__default["default"](event.target).is(this)) { 24191 return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params 24192 } 24193 24194 return undefined; 24195 } 24196 }; 24197 } 24198 24199 function transitionEndEmulator(duration) { 24200 var _this = this; 24201 24202 var called = false; 24203 $__default["default"](this).one(Util.TRANSITION_END, function () { 24204 called = true; 24205 }); 24206 setTimeout(function () { 24207 if (!called) { 24208 Util.triggerTransitionEnd(_this); 24209 } 24210 }, duration); 24211 return this; 24212 } 24213 24214 function setTransitionEndSupport() { 24215 $__default["default"].fn.emulateTransitionEnd = transitionEndEmulator; 24216 $__default["default"].event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent(); 24217 } 24218 /** 24219 * Public Util API 24220 */ 24221 24222 24223 var Util = { 24224 TRANSITION_END: 'bsTransitionEnd', 24225 getUID: function getUID(prefix) { 24226 do { 24227 // eslint-disable-next-line no-bitwise 24228 prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here 24229 } while (document.getElementById(prefix)); 24230 24231 return prefix; 24232 }, 24233 getSelectorFromElement: function getSelectorFromElement(element) { 24234 var selector = element.getAttribute('data-target'); 24235 24236 if (!selector || selector === '#') { 24237 var hrefAttr = element.getAttribute('href'); 24238 selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : ''; 24239 } 24240 24241 try { 24242 return document.querySelector(selector) ? selector : null; 24243 } catch (_) { 24244 return null; 24245 } 24246 }, 24247 getTransitionDurationFromElement: function getTransitionDurationFromElement(element) { 24248 if (!element) { 24249 return 0; 24250 } // Get transition-duration of the element 24251 24252 24253 var transitionDuration = $__default["default"](element).css('transition-duration'); 24254 var transitionDelay = $__default["default"](element).css('transition-delay'); 24255 var floatTransitionDuration = parseFloat(transitionDuration); 24256 var floatTransitionDelay = parseFloat(transitionDelay); // Return 0 if element or transition duration is not found 24257 24258 if (!floatTransitionDuration && !floatTransitionDelay) { 24259 return 0; 24260 } // If multiple durations are defined, take the first 24261 24262 24263 transitionDuration = transitionDuration.split(',')[0]; 24264 transitionDelay = transitionDelay.split(',')[0]; 24265 return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER; 24266 }, 24267 reflow: function reflow(element) { 24268 return element.offsetHeight; 24269 }, 24270 triggerTransitionEnd: function triggerTransitionEnd(element) { 24271 $__default["default"](element).trigger(TRANSITION_END); 24272 }, 24273 supportsTransitionEnd: function supportsTransitionEnd() { 24274 return Boolean(TRANSITION_END); 24275 }, 24276 isElement: function isElement(obj) { 24277 return (obj[0] || obj).nodeType; 24278 }, 24279 typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) { 24280 for (var property in configTypes) { 24281 if (Object.prototype.hasOwnProperty.call(configTypes, property)) { 24282 var expectedTypes = configTypes[property]; 24283 var value = config[property]; 24284 var valueType = value && Util.isElement(value) ? 'element' : toType(value); 24285 24286 if (!new RegExp(expectedTypes).test(valueType)) { 24287 throw new Error(componentName.toUpperCase() + ": " + ("Option \"" + property + "\" provided type \"" + valueType + "\" ") + ("but expected type \"" + expectedTypes + "\".")); 24288 } 24289 } 24290 } 24291 }, 24292 findShadowRoot: function findShadowRoot(element) { 24293 if (!document.documentElement.attachShadow) { 24294 return null; 24295 } // Can find the shadow root otherwise it'll return the document 24296 24297 24298 if (typeof element.getRootNode === 'function') { 24299 var root = element.getRootNode(); 24300 return root instanceof ShadowRoot ? root : null; 24301 } 24302 24303 if (element instanceof ShadowRoot) { 24304 return element; 24305 } // when we don't find a shadow root 24306 24307 24308 if (!element.parentNode) { 24309 return null; 24310 } 24311 24312 return Util.findShadowRoot(element.parentNode); 24313 }, 24314 jQueryDetection: function jQueryDetection() { 24315 if (typeof $__default["default"] === 'undefined') { 24316 throw new TypeError('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.'); 24317 } 24318 24319 var version = $__default["default"].fn.jquery.split(' ')[0].split('.'); 24320 var minMajor = 1; 24321 var ltMajor = 2; 24322 var minMinor = 9; 24323 var minPatch = 1; 24324 var maxMajor = 4; 24325 24326 if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >
vendor: 9,313 bytes, lines 24326-24630
24326= maxMajor) { 24327 throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0'); 24328 } 24329 } 24330 }; 24331 Util.jQueryDetection(); 24332 setTransitionEndSupport(); 24333 24334 /** 24335 * Constants 24336 */ 24337 24338 var NAME$a = 'alert'; 24339 var VERSION$a = '4.6.2'; 24340 var DATA_KEY$a = 'bs.alert'; 24341 var EVENT_KEY$a = "." + DATA_KEY$a; 24342 var DATA_API_KEY$7 = '.data-api'; 24343 var JQUERY_NO_CONFLICT$a = $__default["default"].fn[NAME$a]; 24344 var CLASS_NAME_ALERT = 'alert'; 24345 var CLASS_NAME_FADE$5 = 'fade'; 24346 var CLASS_NAME_SHOW$7 = 'show'; 24347 var EVENT_CLOSE = "close" + EVENT_KEY$a; 24348 var EVENT_CLOSED = "closed" + EVENT_KEY$a; 24349 var EVENT_CLICK_DATA_API$6 = "click" + EVENT_KEY$a + DATA_API_KEY$7; 24350 var SELECTOR_DISMISS = '[data-dismiss="alert"]'; 24351 /** 24352 * Class definition 24353 */ 24354 24355 var Alert = /*#__PURE__*/function () { 24356 function Alert(element) { 24357 this._element = element; 24358 } // Getters 24359 24360 24361 var _proto = Alert.prototype; 24362 24363 // Public 24364 _proto.close = function close(element) { 24365 var rootElement = this._element; 24366 24367 if (element) { 24368 rootElement = this._getRootElement(element); 24369 } 24370 24371 var customEvent = this._triggerCloseEvent(rootElement); 24372 24373 if (customEvent.isDefaultPrevented()) { 24374 return; 24375 } 24376 24377 this._removeElement(rootElement); 24378 }; 24379 24380 _proto.dispose = function dispose() { 24381 $__default["default"].removeData(this._element, DATA_KEY$a); 24382 this._element = null; 24383 } // Private 24384 ; 24385 24386 _proto._getRootElement = function _getRootElement(element) { 24387 var selector = Util.getSelectorFromElement(element); 24388 var parent = false; 24389 24390 if (selector) { 24391 parent = document.querySelector(selector); 24392 } 24393 24394 if (!parent) { 24395 parent = $__default["default"](element).closest("." + CLASS_NAME_ALERT)[0]; 24396 } 24397 24398 return parent; 24399 }; 24400 24401 _proto._triggerCloseEvent = function _triggerCloseEvent(element) { 24402 var closeEvent = $__default["default"].Event(EVENT_CLOSE); 24403 $__default["default"](element).trigger(closeEvent); 24404 return closeEvent; 24405 }; 24406 24407 _proto._removeElement = function _removeElement(element) { 24408 var _this = this; 24409 24410 $__default["default"](element).removeClass(CLASS_NAME_SHOW$7); 24411 24412 if (!$__default["default"](element).hasClass(CLASS_NAME_FADE$5)) { 24413 this._destroyElement(element); 24414 24415 return; 24416 } 24417 24418 var transitionDuration = Util.getTransitionDurationFromElement(element); 24419 $__default["default"](element).one(Util.TRANSITION_END, function (event) { 24420 return _this._destroyElement(element, event); 24421 }).emulateTransitionEnd(transitionDuration); 24422 }; 24423 24424 _proto._destroyElement = function _destroyElement(element) { 24425 $__default["default"](element).detach().trigger(EVENT_CLOSED).remove(); 24426 } // Static 24427 ; 24428 24429 Alert._jQueryInterface = function _jQueryInterface(config) { 24430 return this.each(function () { 24431 var $element = $__default["default"](this); 24432 var data = $element.data(DATA_KEY$a); 24433 24434 if (!data) { 24435 data = new Alert(this); 24436 $element.data(DATA_KEY$a, data); 24437 } 24438 24439 if (config === 'close') { 24440 data[config](this); 24441 } 24442 }); 24443 }; 24444 24445 Alert._handleDismiss = function _handleDismiss(alertInstance) { 24446 return function (event) { 24447 if (event) { 24448 event.preventDefault(); 24449 } 24450 24451 alertInstance.close(this); 24452 }; 24453 }; 24454 24455 _createClass(Alert, null, [{ 24456 key: "VERSION", 24457 get: function get() { 24458 return VERSION$a; 24459 } 24460 }]); 24461 24462 return Alert; 24463 }(); 24464 /** 24465 * Data API implementation 24466 */ 24467 24468 24469 $__default["default"](document).on(EVENT_CLICK_DATA_API$6, SELECTOR_DISMISS, Alert._handleDismiss(new Alert())); 24470 /** 24471 * jQuery 24472 */ 24473 24474 $__default["default"].fn[NAME$a] = Alert._jQueryInterface; 24475 $__default["default"].fn[NAME$a].Constructor = Alert; 24476 24477 $__default["default"].fn[NAME$a].noConflict = function () { 24478 $__default["default"].fn[NAME$a] = JQUERY_NO_CONFLICT$a; 24479 return Alert._jQueryInterface; 24480 }; 24481 24482 /** 24483 * Constants 24484 */ 24485 24486 var NAME$9 = 'button'; 24487 var VERSION$9 = '4.6.2'; 24488 var DATA_KEY$9 = 'bs.button'; 24489 var EVENT_KEY$9 = "." + DATA_KEY$9; 24490 var DATA_API_KEY$6 = '.data-api'; 24491 var JQUERY_NO_CONFLICT$9 = $__default["default"].fn[NAME$9]; 24492 var CLASS_NAME_ACTIVE$3 = 'active'; 24493 var CLASS_NAME_BUTTON = 'btn'; 24494 var CLASS_NAME_FOCUS = 'focus'; 24495 var EVENT_CLICK_DATA_API$5 = "click" + EVENT_KEY$9 + DATA_API_KEY$6; 24496 var EVENT_FOCUS_BLUR_DATA_API = "focus" + EVENT_KEY$9 + DATA_API_KEY$6 + " " + ("blur" + EVENT_KEY$9 + DATA_API_KEY$6); 24497 var EVENT_LOAD_DATA_API$2 = "load" + EVENT_KEY$9 + DATA_API_KEY$6; 24498 var SELECTOR_DATA_TOGGLE_CARROT = '[data-toggle^="button"]'; 24499 var SELECTOR_DATA_TOGGLES = '[data-toggle="buttons"]'; 24500 var SELECTOR_DATA_TOGGLE$4 = '[data-toggle="button"]'; 24501 var SELECTOR_DATA_TOGGLES_BUTTONS = '[data-toggle="buttons"] .btn'; 24502 var SELECTOR_INPUT = 'input:not([type="hidden"])'; 24503 var SELECTOR_ACTIVE$2 = '.active'; 24504 var SELECTOR_BUTTON = '.btn'; 24505 /** 24506 * Class definition 24507 */ 24508 24509 var Button = /*#__PURE__*/function () { 24510 function Button(element) { 24511 this._element = element; 24512 this.shouldAvoidTriggerChange = false; 24513 } // Getters 24514 24515 24516 var _proto = Button.prototype; 24517 24518 // Public 24519 _proto.toggle = function toggle() { 24520 var triggerChangeEvent = true; 24521 var addAriaPressed = true; 24522 var rootElement = $__default["default"](this._element).closest(SELECTOR_DATA_TOGGLES)[0]; 24523 24524 if (rootElement) { 24525 var input = this._element.querySelector(SELECTOR_INPUT); 24526 24527 if (input) { 24528 if (input.type === 'radio') { 24529 if (input.checked && this._element.classList.contains(CLASS_NAME_ACTIVE$3)) { 24530 triggerChangeEvent = false; 24531 } else { 24532 var activeElement = rootElement.querySelector(SELECTOR_ACTIVE$2); 24533 24534 if (activeElement) { 24535 $__default["default"](activeElement).removeClass(CLASS_NAME_ACTIVE$3); 24536 } 24537 } 24538 } 24539 24540 if (triggerChangeEvent) { 24541 // if it's not a radio button or checkbox don't add a pointless/invalid checked property to the input 24542 if (input.type === 'checkbox' || input.type === 'radio') { 24543 input.checked = !this._element.classList.contains(CLASS_NAME_ACTIVE$3); 24544 } 24545 24546 if (!this.shouldAvoidTriggerChange) { 24547 $__default["default"](input).trigger('change'); 24548 } 24549 } 24550 24551 input.focus(); 24552 addAriaPressed = false; 24553 } 24554 } 24555 24556 if (!(this._element.hasAttribute('disabled') || this._element.classList.contains('disabled'))) { 24557 if (addAriaPressed) { 24558 this._element.setAttribute('aria-pressed', !this._element.classList.contains(CLASS_NAME_ACTIVE$3)); 24559 } 24560 24561 if (triggerChangeEvent) { 24562 $__default["default"](this._element).toggleClass(CLASS_NAME_ACTIVE$3); 24563 } 24564 } 24565 }; 24566 24567 _proto.dispose = function dispose() { 24568 $__default["default"].removeData(this._element, DATA_KEY$9); 24569 this._element = null; 24570 } // Static 24571 ; 24572 24573 Button._jQueryInterface = function _jQueryInterface(config, avoidTriggerChange) { 24574 return this.each(function () { 24575 var $element = $__default["default"](this); 24576 var data = $element.data(DATA_KEY$9); 24577 24578 if (!data) { 24579 data = new Button(this); 24580 $element.data(DATA_KEY$9, data); 24581 } 24582 24583 data.shouldAvoidTriggerChange = avoidTriggerChange; 24584 24585 if (config === 'toggle') { 24586 data[config](); 24587 } 24588 }); 24589 }; 24590 24591 _createClass(Button, null, [{ 24592 key: "VERSION", 24593 get: function get() { 24594 return VERSION$9; 24595 } 24596 }]); 24597 24598 return Button; 24599 }(); 24600 /** 24601 * Data API implementation 24602 */ 24603 24604 24605 $__default["default"](document).on(EVENT_CLICK_DATA_API$5, SELECTOR_DATA_TOGGLE_CARROT, function (event) { 24606 var button = event.target; 24607 var initialButton = button; 24608 24609 if (!$__default["default"](button).hasClass(CLASS_NAME_BUTTON)) { 24610 button = $__default["default"](button).closest(SELECTOR_BUTTON)[0]; 24611 } 24612 24613 if (!button || button.hasAttribute('disabled') || button.classList.contains('disabled')) { 24614 event.preventDefault(); // work around Firefox bug #1540995 24615 } else { 24616 var inputBtn = button.querySelector(SELECTOR_INPUT); 24617 24618 if (inputBtn && (inputBtn.hasAttribute('disabled') || inputBtn.classList.contains('disabled'))) { 24619 event.preventDefault(); // work around Firefox bug #1540995 24620 24621 return; 24622 } 24623 24624 if (initialButton.tagName === 'INPUT' || button.tagName !== 'LABEL') { 24625 Button._jQueryInterface.call($__default["default"](button), 'toggle', initialButton.tagName === 'INPUT'); 24626 } 24627 } 24628 }).on(EVENT_FOCUS_BLUR_DATA_API, SELECTOR_DATA_TOGGLE_CARROT, function (event) { 24629 var button = $__default["default"](event.target).closest(SELECTOR_BUTTON)[0]; 24630 $__default["default"](button).toggleClass(CLASS_NAME_FOCUS, /^focu
vendor: 18,610 bytes, lines 24630-25177
24630s(in)?$/.test(event.type)); 24631 }); 24632 $__default["default"](window).on(EVENT_LOAD_DATA_API$2, function () { 24633 // ensure correct active class is set to match the controls' actual values/states 24634 // find all checkboxes/readio buttons inside data-toggle groups 24635 var buttons = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLES_BUTTONS)); 24636 24637 for (var i = 0, len = buttons.length; i < len; i++) { 24638 var button = buttons[i]; 24639 var input = button.querySelector(SELECTOR_INPUT); 24640 24641 if (input.checked || input.hasAttribute('checked')) { 24642 button.classList.add(CLASS_NAME_ACTIVE$3); 24643 } else { 24644 button.classList.remove(CLASS_NAME_ACTIVE$3); 24645 } 24646 } // find all button toggles 24647 24648 24649 buttons = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE$4)); 24650 24651 for (var _i = 0, _len = buttons.length; _i < _len; _i++) { 24652 var _button = buttons[_i]; 24653 24654 if (_button.getAttribute('aria-pressed') === 'true') { 24655 _button.classList.add(CLASS_NAME_ACTIVE$3); 24656 } else { 24657 _button.classList.remove(CLASS_NAME_ACTIVE$3); 24658 } 24659 } 24660 }); 24661 /** 24662 * jQuery 24663 */ 24664 24665 $__default["default"].fn[NAME$9] = Button._jQueryInterface; 24666 $__default["default"].fn[NAME$9].Constructor = Button; 24667 24668 $__default["default"].fn[NAME$9].noConflict = function () { 24669 $__default["default"].fn[NAME$9] = JQUERY_NO_CONFLICT$9; 24670 return Button._jQueryInterface; 24671 }; 24672 24673 /** 24674 * Constants 24675 */ 24676 24677 var NAME$8 = 'carousel'; 24678 var VERSION$8 = '4.6.2'; 24679 var DATA_KEY$8 = 'bs.carousel'; 24680 var EVENT_KEY$8 = "." + DATA_KEY$8; 24681 var DATA_API_KEY$5 = '.data-api'; 24682 var JQUERY_NO_CONFLICT$8 = $__default["default"].fn[NAME$8]; 24683 var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key 24684 24685 var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key 24686 24687 var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch 24688 24689 var SWIPE_THRESHOLD = 40; 24690 var CLASS_NAME_CAROUSEL = 'carousel'; 24691 var CLASS_NAME_ACTIVE$2 = 'active'; 24692 var CLASS_NAME_SLIDE = 'slide'; 24693 var CLASS_NAME_RIGHT = 'carousel-item-right'; 24694 var CLASS_NAME_LEFT = 'carousel-item-left'; 24695 var CLASS_NAME_NEXT = 'carousel-item-next'; 24696 var CLASS_NAME_PREV = 'carousel-item-prev'; 24697 var CLASS_NAME_POINTER_EVENT = 'pointer-event'; 24698 var DIRECTION_NEXT = 'next'; 24699 var DIRECTION_PREV = 'prev'; 24700 var DIRECTION_LEFT = 'left'; 24701 var DIRECTION_RIGHT = 'right'; 24702 var EVENT_SLIDE = "slide" + EVENT_KEY$8; 24703 var EVENT_SLID = "slid" + EVENT_KEY$8; 24704 var EVENT_KEYDOWN = "keydown" + EVENT_KEY$8; 24705 var EVENT_MOUSEENTER = "mouseenter" + EVENT_KEY$8; 24706 var EVENT_MOUSELEAVE = "mouseleave" + EVENT_KEY$8; 24707 var EVENT_TOUCHSTART = "touchstart" + EVENT_KEY$8; 24708 var EVENT_TOUCHMOVE = "touchmove" + EVENT_KEY$8; 24709 var EVENT_TOUCHEND = "touchend" + EVENT_KEY$8; 24710 var EVENT_POINTERDOWN = "pointerdown" + EVENT_KEY$8; 24711 var EVENT_POINTERUP = "pointerup" + EVENT_KEY$8; 24712 var EVENT_DRAG_START = "dragstart" + EVENT_KEY$8; 24713 var EVENT_LOAD_DATA_API$1 = "load" + EVENT_KEY$8 + DATA_API_KEY$5; 24714 var EVENT_CLICK_DATA_API$4 = "click" + EVENT_KEY$8 + DATA_API_KEY$5; 24715 var SELECTOR_ACTIVE$1 = '.active'; 24716 var SELECTOR_ACTIVE_ITEM = '.active.carousel-item'; 24717 var SELECTOR_ITEM = '.carousel-item'; 24718 var SELECTOR_ITEM_IMG = '.carousel-item img'; 24719 var SELECTOR_NEXT_PREV = '.carousel-item-next, .carousel-item-prev'; 24720 var SELECTOR_INDICATORS = '.carousel-indicators'; 24721 var SELECTOR_DATA_SLIDE = '[data-slide], [data-slide-to]'; 24722 var SELECTOR_DATA_RIDE = '[data-ride="carousel"]'; 24723 var Default$7 = { 24724 interval: 5000, 24725 keyboard: true, 24726 slide: false, 24727 pause: 'hover', 24728 wrap: true, 24729 touch: true 24730 }; 24731 var DefaultType$7 = { 24732 interval: '(number|boolean)', 24733 keyboard: 'boolean', 24734 slide: '(boolean|string)', 24735 pause: '(string|boolean)', 24736 wrap: 'boolean', 24737 touch: 'boolean' 24738 }; 24739 var PointerType = { 24740 TOUCH: 'touch', 24741 PEN: 'pen' 24742 }; 24743 /** 24744 * Class definition 24745 */ 24746 24747 var Carousel = /*#__PURE__*/function () { 24748 function Carousel(element, config) { 24749 this._items = null; 24750 this._interval = null; 24751 this._activeElement = null; 24752 this._isPaused = false; 24753 this._isSliding = false; 24754 this.touchTimeout = null; 24755 this.touchStartX = 0; 24756 this.touchDeltaX = 0; 24757 this._config = this._getConfig(config); 24758 this._element = element; 24759 this._indicatorsElement = this._element.querySelector(SELECTOR_INDICATORS); 24760 this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0; 24761 this._pointerEvent = Boolean(window.PointerEvent || window.MSPointerEvent); 24762 24763 this._addEventListeners(); 24764 } // Getters 24765 24766 24767 var _proto = Carousel.prototype; 24768 24769 // Public 24770 _proto.next = function next() { 24771 if (!this._isSliding) { 24772 this._slide(DIRECTION_NEXT); 24773 } 24774 }; 24775 24776 _proto.nextWhenVisible = function nextWhenVisible() { 24777 var $element = $__default["default"](this._element); // Don't call next when the page isn't visible 24778 // or the carousel or its parent isn't visible 24779 24780 if (!document.hidden && $element.is(':visible') && $element.css('visibility') !== 'hidden') { 24781 this.next(); 24782 } 24783 }; 24784 24785 _proto.prev = function prev() { 24786 if (!this._isSliding) { 24787 this._slide(DIRECTION_PREV); 24788 } 24789 }; 24790 24791 _proto.pause = function pause(event) { 24792 if (!event) { 24793 this._isPaused = true; 24794 } 24795 24796 if (this._element.querySelector(SELECTOR_NEXT_PREV)) { 24797 Util.triggerTransitionEnd(this._element); 24798 this.cycle(true); 24799 } 24800 24801 clearInterval(this._interval); 24802 this._interval = null; 24803 }; 24804 24805 _proto.cycle = function cycle(event) { 24806 if (!event) { 24807 this._isPaused = false; 24808 } 24809 24810 if (this._interval) { 24811 clearInterval(this._interval); 24812 this._interval = null; 24813 } 24814 24815 if (this._config.interval && !this._isPaused) { 24816 this._updateInterval(); 24817 24818 this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval); 24819 } 24820 }; 24821 24822 _proto.to = function to(index) { 24823 var _this = this; 24824 24825 this._activeElement = this._element.querySelector(SELECTOR_ACTIVE_ITEM); 24826 24827 var activeIndex = this._getItemIndex(this._activeElement); 24828 24829 if (index > this._items.length - 1 || index < 0) { 24830 return; 24831 } 24832 24833 if (this._isSliding) { 24834 $__default["default"](this._element).one(EVENT_SLID, function () { 24835 return _this.to(index); 24836 }); 24837 return; 24838 } 24839 24840 if (activeIndex === index) { 24841 this.pause(); 24842 this.cycle(); 24843 return; 24844 } 24845 24846 var direction = index > activeIndex ? DIRECTION_NEXT : DIRECTION_PREV; 24847 24848 this._slide(direction, this._items[index]); 24849 }; 24850 24851 _proto.dispose = function dispose() { 24852 $__default["default"](this._element).off(EVENT_KEY$8); 24853 $__default["default"].removeData(this._element, DATA_KEY$8); 24854 this._items = null; 24855 this._config = null; 24856 this._element = null; 24857 this._interval = null; 24858 this._isPaused = null; 24859 this._isSliding = null; 24860 this._activeElement = null; 24861 this._indicatorsElement = null; 24862 } // Private 24863 ; 24864 24865 _proto._getConfig = function _getConfig(config) { 24866 config = _extends({}, Default$7, config); 24867 Util.typeCheckConfig(NAME$8, config, DefaultType$7); 24868 return config; 24869 }; 24870 24871 _proto._handleSwipe = function _handleSwipe() { 24872 var absDeltax = Math.abs(this.touchDeltaX); 24873 24874 if (absDeltax <= SWIPE_THRESHOLD) { 24875 return; 24876 } 24877 24878 var direction = absDeltax / this.touchDeltaX; 24879 this.touchDeltaX = 0; // swipe left 24880 24881 if (direction > 0) { 24882 this.prev(); 24883 } // swipe right 24884 24885 24886 if (direction < 0) { 24887 this.next(); 24888 } 24889 }; 24890 24891 _proto._addEventListeners = function _addEventListeners() { 24892 var _this2 = this; 24893 24894 if (this._config.keyboard) { 24895 $__default["default"](this._element).on(EVENT_KEYDOWN, function (event) { 24896 return _this2._keydown(event); 24897 }); 24898 } 24899 24900 if (this._config.pause === 'hover') { 24901 $__default["default"](this._element).on(EVENT_MOUSEENTER, function (event) { 24902 return _this2.pause(event); 24903 }).on(EVENT_MOUSELEAVE, function (event) { 24904 return _this2.cycle(event); 24905 }); 24906 } 24907 24908 if (this._config.touch) { 24909 this._addTouchEventListeners(); 24910 } 24911 }; 24912 24913 _proto._addTouchEventListeners = function _addTouchEventListeners() { 24914 var _this3 = this; 24915 24916 if (!this._touchSupported) { 24917 return; 24918 } 24919 24920 var start = function start(event) { 24921 if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) { 24922 _this3.touchStartX = event.originalEvent.clientX; 24923 } else if (!_this3._pointerEvent) { 24924 _this3.touchStartX = event.originalEvent.touches[0].clientX; 24925 } 24926 }; 24927 24928 var move = function move(event) { 24929 // ensure swiping with one touch and not pinching 24930 _this3.touchDeltaX = event.originalEvent.touches && event.originalEvent.touches.length > 1 ? 0 : event.originalEvent.touches[0].clientX - _this3.touchStartX; 24931 }; 24932 24933 var end = function end(event) { 24934 if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) { 24935 _this3.touchDeltaX = event.originalEvent.clientX - _this3.touchStartX; 24936 } 24937 24938 _this3._handleSwipe(); 24939 24940 if (_this3._config.pause === 'hover') { 24941 // If it's a touch-enabled device, mouseenter/leave are fired as 24942 // part of the mouse compatibility events on first tap - the carousel 24943 // would stop cycling until user tapped out of it; 24944 // here, we listen for touchend, explicitly pause the carousel 24945 // (as if it's the second time we tap on it, mouseenter compat event 24946 // is NOT fired) and after a timeout (to allow for mouse compatibility 24947 // events to fire) we explicitly restart cycling 24948 _this3.pause(); 24949 24950 if (_this3.touchTimeout) { 24951 clearTimeout(_this3.touchTimeout); 24952 } 24953 24954 _this3.touchTimeout = setTimeout(function (event) { 24955 return _this3.cycle(event); 24956 }, TOUCHEVENT_COMPAT_WAIT + _this3._config.interval); 24957 } 24958 }; 24959 24960 $__default["default"](this._element.querySelectorAll(SELECTOR_ITEM_IMG)).on(EVENT_DRAG_START, function (e) { 24961 return e.preventDefault(); 24962 }); 24963 24964 if (this._pointerEvent) { 24965 $__default["default"](this._element).on(EVENT_POINTERDOWN, function (event) { 24966 return start(event); 24967 }); 24968 $__default["default"](this._element).on(EVENT_POINTERUP, function (event) { 24969 return end(event); 24970 }); 24971 24972 this._element.classList.add(CLASS_NAME_POINTER_EVENT); 24973 } else { 24974 $__default["default"](this._element).on(EVENT_TOUCHSTART, function (event) { 24975 return start(event); 24976 }); 24977 $__default["default"](this._element).on(EVENT_TOUCHMOVE, function (event) { 24978 return move(event); 24979 }); 24980 $__default["default"](this._element).on(EVENT_TOUCHEND, function (event) { 24981 return end(event); 24982 }); 24983 } 24984 }; 24985 24986 _proto._keydown = function _keydown(event) { 24987 if (/input|textarea/i.test(event.target.tagName)) { 24988 return; 24989 } 24990 24991 switch (event.which) { 24992 case ARROW_LEFT_KEYCODE: 24993 event.preventDefault(); 24994 this.prev(); 24995 break; 24996 24997 case ARROW_RIGHT_KEYCODE: 24998 event.preventDefault(); 24999 this.next(); 25000 break; 25001 } 25002 }; 25003 25004 _proto._getItemIndex = function _getItemIndex(element) { 25005 this._items = element && element.parentNode ? [].slice.call(element.parentNode.querySelectorAll(SELECTOR_ITEM)) : []; 25006 return this._items.indexOf(element); 25007 }; 25008 25009 _proto._getItemByDirection = function _getItemByDirection(direction, activeElement) { 25010 var isNextDirection = direction === DIRECTION_NEXT; 25011 var isPrevDirection = direction === DIRECTION_PREV; 25012 25013 var activeIndex = this._getItemIndex(activeElement); 25014 25015 var lastItemIndex = this._items.length - 1; 25016 var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex; 25017 25018 if (isGoingToWrap && !this._config.wrap) { 25019 return activeElement; 25020 } 25021 25022 var delta = direction === DIRECTION_PREV ? -1 : 1; 25023 var itemIndex = (activeIndex + delta) % this._items.length; 25024 return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex]; 25025 }; 25026 25027 _proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) { 25028 var targetIndex = this._getItemIndex(relatedTarget); 25029 25030 var fromIndex = this._getItemIndex(this._element.querySelector(SELECTOR_ACTIVE_ITEM)); 25031 25032 var slideEvent = $__default["default"].Event(EVENT_SLIDE, { 25033 relatedTarget: relatedTarget, 25034 direction: eventDirectionName, 25035 from: fromIndex, 25036 to: targetIndex 25037 }); 25038 $__default["default"](this._element).trigger(slideEvent); 25039 return slideEvent; 25040 }; 25041 25042 _proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) { 25043 if (this._indicatorsElement) { 25044 var indicators = [].slice.call(this._indicatorsElement.querySelectorAll(SELECTOR_ACTIVE$1)); 25045 $__default["default"](indicators).removeClass(CLASS_NAME_ACTIVE$2); 25046 25047 var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)]; 25048 25049 if (nextIndicator) { 25050 $__default["default"](nextIndicator).addClass(CLASS_NAME_ACTIVE$2); 25051 } 25052 } 25053 }; 25054 25055 _proto._updateInterval = function _updateInterval() { 25056 var element = this._activeElement || this._element.querySelector(SELECTOR_ACTIVE_ITEM); 25057 25058 if (!element) { 25059 return; 25060 } 25061 25062 var elementInterval = parseInt(element.getAttribute('data-interval'), 10); 25063 25064 if (elementInterval) { 25065 this._config.defaultInterval = this._config.defaultInterval || this._config.interval; 25066 this._config.interval = elementInterval; 25067 } else { 25068 this._config.interval = this._config.defaultInterval || this._config.interval; 25069 } 25070 }; 25071 25072 _proto._slide = function _slide(direction, element) { 25073 var _this4 = this; 25074 25075 var activeElement = this._element.querySelector(SELECTOR_ACTIVE_ITEM); 25076 25077 var activeElementIndex = this._getItemIndex(activeElement); 25078 25079 var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement); 25080 25081 var nextElementIndex = this._getItemIndex(nextElement); 25082 25083 var isCycling = Boolean(this._interval); 25084 var directionalClassName; 25085 var orderClassName; 25086 var eventDirectionName; 25087 25088 if (direction === DIRECTION_NEXT) { 25089 directionalClassName = CLASS_NAME_LEFT; 25090 orderClassName = CLASS_NAME_NEXT; 25091 eventDirectionName = DIRECTION_LEFT; 25092 } else { 25093 directionalClassName = CLASS_NAME_RIGHT; 25094 orderClassName = CLASS_NAME_PREV; 25095 eventDirectionName = DIRECTION_RIGHT; 25096 } 25097 25098 if (nextElement && $__default["default"](nextElement).hasClass(CLASS_NAME_ACTIVE$2)) { 25099 this._isSliding = false; 25100 return; 25101 } 25102 25103 var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName); 25104 25105 if (slideEvent.isDefaultPrevented()) { 25106 return; 25107 } 25108 25109 if (!activeElement || !nextElement) { 25110 // Some weirdness is happening, so we bail 25111 return; 25112 } 25113 25114 this._isSliding = true; 25115 25116 if (isCycling) { 25117 this.pause(); 25118 } 25119 25120 this._setActiveIndicatorElement(nextElement); 25121 25122 this._activeElement = nextElement; 25123 var slidEvent = $__default["default"].Event(EVENT_SLID, { 25124 relatedTarget: nextElement, 25125 direction: eventDirectionName, 25126 from: activeElementIndex, 25127 to: nextElementIndex 25128 }); 25129 25130 if ($__default["default"](this._element).hasClass(CLASS_NAME_SLIDE)) { 25131 $__default["default"](nextElement).addClass(orderClassName); 25132 Util.reflow(nextElement); 25133 $__default["default"](activeElement).addClass(directionalClassName); 25134 $__default["default"](nextElement).addClass(directionalClassName); 25135 var transitionDuration = Util.getTransitionDurationFromElement(activeElement); 25136 $__default["default"](activeElement).one(Util.TRANSITION_END, function () { 25137 $__default["default"](nextElement).removeClass(directionalClassName + " " + orderClassName).addClass(CLASS_NAME_ACTIVE$2); 25138 $__default["default"](activeElement).removeClass(CLASS_NAME_ACTIVE$2 + " " + orderClassName + " " + directionalClassName); 25139 _this4._isSliding = false; 25140 setTimeout(function () { 25141 return $__default["default"](_this4._element).trigger(slidEvent); 25142 }, 0); 25143 }).emulateTransitionEnd(transitionDuration); 25144 } else { 25145 $__default["default"](activeElement).removeClass(CLASS_NAME_ACTIVE$2); 25146 $__default["default"](nextElement).addClass(CLASS_NAME_ACTIVE$2); 25147 this._isSliding = false; 25148 $__default["default"](this._element).trigger(slidEvent); 25149 } 25150 25151 if (isCycling) { 25152 this.cycle(); 25153 } 25154 } // Static 25155 ; 25156 25157 Carousel._jQueryInterface = function _jQueryInterface(config) { 25158 return this.each(function () { 25159 var data = $__default["default"](this).data(DATA_KEY$8); 25160 25161 var _config = _extends({}, Default$7, $__default["default"](this).data()); 25162 25163 if (typeof config === 'object') { 25164 _config = _extends({}, _config, config); 25165 } 25166 25167 var action = typeof config === 'string' ? config : _config.slide; 25168 25169 if (!data) { 25170 data = new Carousel(this, _config); 25171 $__default["default"](this).data(DATA_KEY$8, data); 25172 } 25173 25174 if (typeof config === 'number') { 25175 data.to(config); 25176 } else if (typeof action === 'string') { 25177 if (typeof data[action] === 'undefined') {
vendor: 4,573 bytes, lines 25178-25331
25178 throw new TypeError("No method named \"" + action + "\""); 25179 } 25180 25181 data[action](); 25182 } else if (_config.interval && _config.ride) { 25183 data.pause(); 25184 data.cycle(); 25185 } 25186 }); 25187 }; 25188 25189 Carousel._dataApiClickHandler = function _dataApiClickHandler(event) { 25190 var selector = Util.getSelectorFromElement(this); 25191 25192 if (!selector) { 25193 return; 25194 } 25195 25196 var target = $__default["default"](selector)[0]; 25197 25198 if (!target || !$__default["default"](target).hasClass(CLASS_NAME_CAROUSEL)) { 25199 return; 25200 } 25201 25202 var config = _extends({}, $__default["default"](target).data(), $__default["default"](this).data()); 25203 25204 var slideIndex = this.getAttribute('data-slide-to'); 25205 25206 if (slideIndex) { 25207 config.interval = false; 25208 } 25209 25210 Carousel._jQueryInterface.call($__default["default"](target), config); 25211 25212 if (slideIndex) { 25213 $__default["default"](target).data(DATA_KEY$8).to(slideIndex); 25214 } 25215 25216 event.preventDefault(); 25217 }; 25218 25219 _createClass(Carousel, null, [{ 25220 key: "VERSION", 25221 get: function get() { 25222 return VERSION$8; 25223 } 25224 }, { 25225 key: "Default", 25226 get: function get() { 25227 return Default$7; 25228 } 25229 }]); 25230 25231 return Carousel; 25232 }(); 25233 /** 25234 * Data API implementation 25235 */ 25236 25237 25238 $__default["default"](document).on(EVENT_CLICK_DATA_API$4, SELECTOR_DATA_SLIDE, Carousel._dataApiClickHandler); 25239 $__default["default"](window).on(EVENT_LOAD_DATA_API$1, function () { 25240 var carousels = [].slice.call(document.querySelectorAll(SELECTOR_DATA_RIDE)); 25241 25242 for (var i = 0, len = carousels.length; i < len; i++) { 25243 var $carousel = $__default["default"](carousels[i]); 25244 25245 Carousel._jQueryInterface.call($carousel, $carousel.data()); 25246 } 25247 }); 25248 /** 25249 * jQuery 25250 */ 25251 25252 $__default["default"].fn[NAME$8] = Carousel._jQueryInterface; 25253 $__default["default"].fn[NAME$8].Constructor = Carousel; 25254 25255 $__default["default"].fn[NAME$8].noConflict = function () { 25256 $__default["default"].fn[NAME$8] = JQUERY_NO_CONFLICT$8; 25257 return Carousel._jQueryInterface; 25258 }; 25259 25260 /** 25261 * Constants 25262 */ 25263 25264 var NAME$7 = 'collapse'; 25265 var VERSION$7 = '4.6.2'; 25266 var DATA_KEY$7 = 'bs.collapse'; 25267 var EVENT_KEY$7 = "." + DATA_KEY$7; 25268 var DATA_API_KEY$4 = '.data-api'; 25269 var JQUERY_NO_CONFLICT$7 = $__default["default"].fn[NAME$7]; 25270 var CLASS_NAME_SHOW$6 = 'show'; 25271 var CLASS_NAME_COLLAPSE = 'collapse'; 25272 var CLASS_NAME_COLLAPSING = 'collapsing'; 25273 var CLASS_NAME_COLLAPSED = 'collapsed'; 25274 var DIMENSION_WIDTH = 'width'; 25275 var DIMENSION_HEIGHT = 'height'; 25276 var EVENT_SHOW$4 = "show" + EVENT_KEY$7; 25277 var EVENT_SHOWN$4 = "shown" + EVENT_KEY$7; 25278 var EVENT_HIDE$4 = "hide" + EVENT_KEY$7; 25279 var EVENT_HIDDEN$4 = "hidden" + EVENT_KEY$7; 25280 var EVENT_CLICK_DATA_API$3 = "click" + EVENT_KEY$7 + DATA_API_KEY$4; 25281 var SELECTOR_ACTIVES = '.show, .collapsing'; 25282 var SELECTOR_DATA_TOGGLE$3 = '[data-toggle="collapse"]'; 25283 var Default$6 = { 25284 toggle: true, 25285 parent: '' 25286 }; 25287 var DefaultType$6 = { 25288 toggle: 'boolean', 25289 parent: '(string|element)' 25290 }; 25291 /** 25292 * Class definition 25293 */ 25294 25295 var Collapse = /*#__PURE__*/function () { 25296 function Collapse(element, config) { 25297 this._isTransitioning = false; 25298 this._element = element; 25299 this._config = this._getConfig(config); 25300 this._triggerArray = [].slice.call(document.querySelectorAll("[data-toggle=\"collapse\"][href=\"#" + element.id + "\"]," + ("[data-toggle=\"collapse\"][data-target=\"#" + element.id + "\"]"))); 25301 var toggleList = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE$3)); 25302 25303 for (var i = 0, len = toggleList.length; i < len; i++) { 25304 var elem = toggleList[i]; 25305 var selector = Util.getSelectorFromElement(elem); 25306 var filterElement = [].slice.call(document.querySelectorAll(selector)).filter(function (foundElem) { 25307 return foundElem === element; 25308 }); 25309 25310 if (selector !== null && filterElement.length > 0) { 25311 this._selector = selector; 25312 25313 this._triggerArray.push(elem); 25314 } 25315 } 25316 25317 this._parent = this._config.parent ? this._getParent() : null; 25318 25319 if (!this._config.parent) { 25320 this._addAriaAndCollapsedClass(this._element, this._triggerArray); 25321 } 25322 25323 if (this._config.toggle) { 25324 this.toggle(); 25325 } 25326 } // Getters 25327 25328 25329 var _proto = Collapse.prototype; 25330 25331 // Public
vendor: 6,293 bytes, lines 25332-25508
25332 _proto.toggle = function toggle() { 25333 if ($__default["default"](this._element).hasClass(CLASS_NAME_SHOW$6)) { 25334 this.hide(); 25335 } else { 25336 this.show(); 25337 } 25338 }; 25339 25340 _proto.show = function show() { 25341 var _this = this; 25342 25343 if (this._isTransitioning || $__default["default"](this._element).hasClass(CLASS_NAME_SHOW$6)) { 25344 return; 25345 } 25346 25347 var actives; 25348 var activesData; 25349 25350 if (this._parent) { 25351 actives = [].slice.call(this._parent.querySelectorAll(SELECTOR_ACTIVES)).filter(function (elem) { 25352 if (typeof _this._config.parent === 'string') { 25353 return elem.getAttribute('data-parent') === _this._config.parent; 25354 } 25355 25356 return elem.classList.contains(CLASS_NAME_COLLAPSE); 25357 }); 25358 25359 if (actives.length === 0) { 25360 actives = null; 25361 } 25362 } 25363 25364 if (actives) { 25365 activesData = $__default["default"](actives).not(this._selector).data(DATA_KEY$7); 25366 25367 if (activesData && activesData._isTransitioning) { 25368 return; 25369 } 25370 } 25371 25372 var startEvent = $__default["default"].Event(EVENT_SHOW$4); 25373 $__default["default"](this._element).trigger(startEvent); 25374 25375 if (startEvent.isDefaultPrevented()) { 25376 return; 25377 } 25378 25379 if (actives) { 25380 Collapse._jQueryInterface.call($__default["default"](actives).not(this._selector), 'hide'); 25381 25382 if (!activesData) { 25383 $__default["default"](actives).data(DATA_KEY$7, null); 25384 } 25385 } 25386 25387 var dimension = this._getDimension(); 25388 25389 $__default["default"](this._element).removeClass(CLASS_NAME_COLLAPSE).addClass(CLASS_NAME_COLLAPSING); 25390 this._element.style[dimension] = 0; 25391 25392 if (this._triggerArray.length) { 25393 $__default["default"](this._triggerArray).removeClass(CLASS_NAME_COLLAPSED).attr('aria-expanded', true); 25394 } 25395 25396 this.setTransitioning(true); 25397 25398 var complete = function complete() { 25399 $__default["default"](_this._element).removeClass(CLASS_NAME_COLLAPSING).addClass(CLASS_NAME_COLLAPSE + " " + CLASS_NAME_SHOW$6); 25400 _this._element.style[dimension] = ''; 25401 25402 _this.setTransitioning(false); 25403 25404 $__default["default"](_this._element).trigger(EVENT_SHOWN$4); 25405 }; 25406 25407 var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1); 25408 var scrollSize = "scroll" + capitalizedDimension; 25409 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 25410 $__default["default"](this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 25411 this._element.style[dimension] = this._element[scrollSize] + "px"; 25412 }; 25413 25414 _proto.hide = function hide() { 25415 var _this2 = this; 25416 25417 if (this._isTransitioning || !$__default["default"](this._element).hasClass(CLASS_NAME_SHOW$6)) { 25418 return; 25419 } 25420 25421 var startEvent = $__default["default"].Event(EVENT_HIDE$4); 25422 $__default["default"](this._element).trigger(startEvent); 25423 25424 if (startEvent.isDefaultPrevented()) { 25425 return; 25426 } 25427 25428 var dimension = this._getDimension(); 25429 25430 this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + "px"; 25431 Util.reflow(this._element); 25432 $__default["default"](this._element).addClass(CLASS_NAME_COLLAPSING).removeClass(CLASS_NAME_COLLAPSE + " " + CLASS_NAME_SHOW$6); 25433 var triggerArrayLength = this._triggerArray.length; 25434 25435 if (triggerArrayLength > 0) { 25436 for (var i = 0; i < triggerArrayLength; i++) { 25437 var trigger = this._triggerArray[i]; 25438 var selector = Util.getSelectorFromElement(trigger); 25439 25440 if (selector !== null) { 25441 var $elem = $__default["default"]([].slice.call(document.querySelectorAll(selector))); 25442 25443 if (!$elem.hasClass(CLASS_NAME_SHOW$6)) { 25444 $__default["default"](trigger).addClass(CLASS_NAME_COLLAPSED).attr('aria-expanded', false); 25445 } 25446 } 25447 } 25448 } 25449 25450 this.setTransitioning(true); 25451 25452 var complete = function complete() { 25453 _this2.setTransitioning(false); 25454 25455 $__default["default"](_this2._element).removeClass(CLASS_NAME_COLLAPSING).addClass(CLASS_NAME_COLLAPSE).trigger(EVENT_HIDDEN$4); 25456 }; 25457 25458 this._element.style[dimension] = ''; 25459 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 25460 $__default["default"](this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 25461 }; 25462 25463 _proto.setTransitioning = function setTransitioning(isTransitioning) { 25464 this._isTransitioning = isTransitioning; 25465 }; 25466 25467 _proto.dispose = function dispose() { 25468 $__default["default"].removeData(this._element, DATA_KEY$7); 25469 this._config = null; 25470 this._parent = null; 25471 this._element = null; 25472 this._triggerArray = null; 25473 this._isTransitioning = null; 25474 } // Private 25475 ; 25476 25477 _proto._getConfig = function _getConfig(config) { 25478 config = _extends({}, Default$6, config); 25479 config.toggle = Boolean(config.toggle); // Coerce string values 25480 25481 Util.typeCheckConfig(NAME$7, config, DefaultType$6); 25482 return config; 25483 }; 25484 25485 _proto._getDimension = function _getDimension() { 25486 var hasWidth = $__default["default"](this._element).hasClass(DIMENSION_WIDTH); 25487 return hasWidth ? DIMENSION_WIDTH : DIMENSION_HEIGHT; 25488 }; 25489 25490 _proto._getParent = function _getParent() { 25491 var _this3 = this; 25492 25493 var parent; 25494 25495 if (Util.isElement(this._config.parent)) { 25496 parent = this._config.parent; // It's a jQuery object 25497 25498 if (typeof this._config.parent.jquery !== 'undefined') { 25499 parent = this._config.parent[0]; 25500 } 25501 } else { 25502 parent = document.querySelector(this._config.parent); 25503 } 25504 25505 var selector = "[data-toggle=\"collapse\"][data-parent=\"" + this._config.parent + "\"]"; 25506 var children = [].slice.call(parent.querySelectorAll(selector)); 25507 $__default["default"](children).each(function (i, element) { 25508 _this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]);
vendor: 5,832 bytes, lines 25509-25684
25509 }); 25510 return parent; 25511 }; 25512 25513 _proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) { 25514 var isOpen = $__default["default"](element).hasClass(CLASS_NAME_SHOW$6); 25515 25516 if (triggerArray.length) { 25517 $__default["default"](triggerArray).toggleClass(CLASS_NAME_COLLAPSED, !isOpen).attr('aria-expanded', isOpen); 25518 } 25519 } // Static 25520 ; 25521 25522 Collapse._getTargetFromElement = function _getTargetFromElement(element) { 25523 var selector = Util.getSelectorFromElement(element); 25524 return selector ? document.querySelector(selector) : null; 25525 }; 25526 25527 Collapse._jQueryInterface = function _jQueryInterface(config) { 25528 return this.each(function () { 25529 var $element = $__default["default"](this); 25530 var data = $element.data(DATA_KEY$7); 25531 25532 var _config = _extends({}, Default$6, $element.data(), typeof config === 'object' && config ? config : {}); 25533 25534 if (!data && _config.toggle && typeof config === 'string' && /show|hide/.test(config)) { 25535 _config.toggle = false; 25536 } 25537 25538 if (!data) { 25539 data = new Collapse(this, _config); 25540 $element.data(DATA_KEY$7, data); 25541 } 25542 25543 if (typeof config === 'string') { 25544 if (typeof data[config] === 'undefined') { 25545 throw new TypeError("No method named \"" + config + "\""); 25546 } 25547 25548 data[config](); 25549 } 25550 }); 25551 }; 25552 25553 _createClass(Collapse, null, [{ 25554 key: "VERSION", 25555 get: function get() { 25556 return VERSION$7; 25557 } 25558 }, { 25559 key: "Default", 25560 get: function get() { 25561 return Default$6; 25562 } 25563 }]); 25564 25565 return Collapse; 25566 }(); 25567 /** 25568 * Data API implementation 25569 */ 25570 25571 25572 $__default["default"](document).on(EVENT_CLICK_DATA_API$3, SELECTOR_DATA_TOGGLE$3, function (event) { 25573 // preventDefault only for <a> elements (which change the URL) not inside the collapsible element 25574 if (event.currentTarget.tagName === 'A') { 25575 event.preventDefault(); 25576 } 25577 25578 var $trigger = $__default["default"](this); 25579 var selector = Util.getSelectorFromElement(this); 25580 var selectors = [].slice.call(document.querySelectorAll(selector)); 25581 $__default["default"](selectors).each(function () { 25582 var $target = $__default["default"](this); 25583 var data = $target.data(DATA_KEY$7); 25584 var config = data ? 'toggle' : $trigger.data(); 25585 25586 Collapse._jQueryInterface.call($target, config); 25587 }); 25588 }); 25589 /** 25590 * jQuery 25591 */ 25592 25593 $__default["default"].fn[NAME$7] = Collapse._jQueryInterface; 25594 $__default["default"].fn[NAME$7].Constructor = Collapse; 25595 25596 $__default["default"].fn[NAME$7].noConflict = function () { 25597 $__default["default"].fn[NAME$7] = JQUERY_NO_CONFLICT$7; 25598 return Collapse._jQueryInterface; 25599 }; 25600 25601 /** 25602 * Constants 25603 */ 25604 25605 var NAME$6 = 'dropdown'; 25606 var VERSION$6 = '4.6.2'; 25607 var DATA_KEY$6 = 'bs.dropdown'; 25608 var EVENT_KEY$6 = "." + DATA_KEY$6; 25609 var DATA_API_KEY$3 = '.data-api'; 25610 var JQUERY_NO_CONFLICT$6 = $__default["default"].fn[NAME$6]; 25611 var ESCAPE_KEYCODE$1 = 27; // KeyboardEvent.which value for Escape (Esc) key 25612 25613 var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key 25614 25615 var TAB_KEYCODE = 9; // KeyboardEvent.which value for tab key 25616 25617 var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key 25618 25619 var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key 25620 25621 var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse) 25622 25623 var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + "|" + ARROW_DOWN_KEYCODE + "|" + ESCAPE_KEYCODE$1); 25624 var CLASS_NAME_DISABLED$1 = 'disabled'; 25625 var CLASS_NAME_SHOW$5 = 'show'; 25626 var CLASS_NAME_DROPUP = 'dropup'; 25627 var CLASS_NAME_DROPRIGHT = 'dropright'; 25628 var CLASS_NAME_DROPLEFT = 'dropleft'; 25629 var CLASS_NAME_MENURIGHT = 'dropdown-menu-right'; 25630 var CLASS_NAME_POSITION_STATIC = 'position-static'; 25631 var EVENT_HIDE$3 = "hide" + EVENT_KEY$6; 25632 var EVENT_HIDDEN$3 = "hidden" + EVENT_KEY$6; 25633 var EVENT_SHOW$3 = "show" + EVENT_KEY$6; 25634 var EVENT_SHOWN$3 = "shown" + EVENT_KEY$6; 25635 var EVENT_CLICK = "click" + EVENT_KEY$6; 25636 var EVENT_CLICK_DATA_API$2 = "click" + EVENT_KEY$6 + DATA_API_KEY$3; 25637 var EVENT_KEYDOWN_DATA_API = "keydown" + EVENT_KEY$6 + DATA_API_KEY$3; 25638 var EVENT_KEYUP_DATA_API = "keyup" + EVENT_KEY$6 + DATA_API_KEY$3; 25639 var SELECTOR_DATA_TOGGLE$2 = '[data-toggle="dropdown"]'; 25640 var SELECTOR_FORM_CHILD = '.dropdown form'; 25641 var SELECTOR_MENU = '.dropdown-menu'; 25642 var SELECTOR_NAVBAR_NAV = '.navbar-nav'; 25643 var SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'; 25644 var PLACEMENT_TOP = 'top-start'; 25645 var PLACEMENT_TOPEND = 'top-end'; 25646 var PLACEMENT_BOTTOM = 'bottom-start'; 25647 var PLACEMENT_BOTTOMEND = 'bottom-end'; 25648 var PLACEMENT_RIGHT = 'right-start'; 25649 var PLACEMENT_LEFT = 'left-start'; 25650 var Default$5 = { 25651 offset: 0, 25652 flip: true, 25653 boundary: 'scrollParent', 25654 reference: 'toggle', 25655 display: 'dynamic', 25656 popperConfig: null 25657 }; 25658 var DefaultType$5 = { 25659 offset: '(number|string|function)', 25660 flip: 'boolean', 25661 boundary: '(string|element)', 25662 reference: '(string|element)', 25663 display: 'string', 25664 popperConfig: '(null|object)' 25665 }; 25666 /** 25667 * Class definition 25668 */ 25669 25670 var Dropdown = /*#__PURE__*/function () { 25671 function Dropdown(element, config) { 25672 this._element = element; 25673 this._popper = null; 25674 this._config = this._getConfig(config); 25675 this._menu = this._getMenuElement(); 25676 this._inNavbar = this._detectNavbar(); 25677 25678 this._addEventListeners(); 25679 } // Getters 25680 25681 25682 var _proto = Dropdown.prototype; 25683 25684 // Public
vendor: 4,365 bytes, lines 25685-25806
25685 _proto.toggle = function toggle() { 25686 if (this._element.disabled || $__default["default"](this._element).hasClass(CLASS_NAME_DISABLED$1)) { 25687 return; 25688 } 25689 25690 var isActive = $__default["default"](this._menu).hasClass(CLASS_NAME_SHOW$5); 25691 25692 Dropdown._clearMenus(); 25693 25694 if (isActive) { 25695 return; 25696 } 25697 25698 this.show(true); 25699 }; 25700 25701 _proto.show = function show(usePopper) { 25702 if (usePopper === void 0) { 25703 usePopper = false; 25704 } 25705 25706 if (this._element.disabled || $__default["default"](this._element).hasClass(CLASS_NAME_DISABLED$1) || $__default["default"](this._menu).hasClass(CLASS_NAME_SHOW$5)) { 25707 return; 25708 } 25709 25710 var relatedTarget = { 25711 relatedTarget: this._element 25712 }; 25713 var showEvent = $__default["default"].Event(EVENT_SHOW$3, relatedTarget); 25714 25715 var parent = Dropdown._getParentFromElement(this._element); 25716 25717 $__default["default"](parent).trigger(showEvent); 25718 25719 if (showEvent.isDefaultPrevented()) { 25720 return; 25721 } // Totally disable Popper for Dropdowns in Navbar 25722 25723 25724 if (!this._inNavbar && usePopper) { 25725 // Check for Popper dependency 25726 if (typeof Popper__default["default"] === 'undefined') { 25727 throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org)'); 25728 } 25729 25730 var referenceElement = this._element; 25731 25732 if (this._config.reference === 'parent') { 25733 referenceElement = parent; 25734 } else if (Util.isElement(this._config.reference)) { 25735 referenceElement = this._config.reference; // Check if it's jQuery element 25736 25737 if (typeof this._config.reference.jquery !== 'undefined') { 25738 referenceElement = this._config.reference[0]; 25739 } 25740 } // If boundary is not `scrollParent`, then set position to `static` 25741 // to allow the menu to "escape" the scroll parent's boundaries 25742 // https://github.com/twbs/bootstrap/issues/24251 25743 25744 25745 if (this._config.boundary !== 'scrollParent') { 25746 $__default["default"](parent).addClass(CLASS_NAME_POSITION_STATIC); 25747 } 25748 25749 this._popper = new Popper__default["default"](referenceElement, this._menu, this._getPopperConfig()); 25750 } // If this is a touch-enabled device we add extra 25751 // empty mouseover listeners to the body's immediate children; 25752 // only needed because of broken event delegation on iOS 25753 // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html 25754 25755 25756 if ('ontouchstart' in document.documentElement && $__default["default"](parent).closest(SELECTOR_NAVBAR_NAV).length === 0) { 25757 $__default["default"](document.body).children().on('mouseover', null, $__default["default"].noop); 25758 } 25759 25760 this._element.focus(); 25761 25762 this._element.setAttribute('aria-expanded', true); 25763 25764 $__default["default"](this._menu).toggleClass(CLASS_NAME_SHOW$5); 25765 $__default["default"](parent).toggleClass(CLASS_NAME_SHOW$5).trigger($__default["default"].Event(EVENT_SHOWN$3, relatedTarget)); 25766 }; 25767 25768 _proto.hide = function hide() { 25769 if (this._element.disabled || $__default["default"](this._element).hasClass(CLASS_NAME_DISABLED$1) || !$__default["default"](this._menu).hasClass(CLASS_NAME_SHOW$5)) { 25770 return; 25771 } 25772 25773 var relatedTarget = { 25774 relatedTarget: this._element 25775 }; 25776 var hideEvent = $__default["default"].Event(EVENT_HIDE$3, relatedTarget); 25777 25778 var parent = Dropdown._getParentFromElement(this._element); 25779 25780 $__default["default"](parent).trigger(hideEvent); 25781 25782 if (hideEvent.isDefaultPrevented()) { 25783 return; 25784 } 25785 25786 if (this._popper) { 25787 this._popper.destroy(); 25788 } 25789 25790 $__default["default"](this._menu).toggleClass(CLASS_NAME_SHOW$5); 25791 $__default["default"](parent).toggleClass(CLASS_NAME_SHOW$5).trigger($__default["default"].Event(EVENT_HIDDEN$3, relatedTarget)); 25792 }; 25793 25794 _proto.dispose = function dispose() { 25795 $__default["default"].removeData(this._element, DATA_KEY$6); 25796 $__default["default"](this._element).off(EVENT_KEY$6); 25797 this._element = null; 25798 this._menu = null; 25799 25800 if (this._popper !== null) { 25801 this._popper.destroy(); 25802 25803 this._popper = null; 25804 } 25805 }; 25806
vendor: 6,527 bytes, lines 25807-26004
25807 _proto.update = function update() { 25808 this._inNavbar = this._detectNavbar(); 25809 25810 if (this._popper !== null) { 25811 this._popper.scheduleUpdate(); 25812 } 25813 } // Private 25814 ; 25815 25816 _proto._addEventListeners = function _addEventListeners() { 25817 var _this = this; 25818 25819 $__default["default"](this._element).on(EVENT_CLICK, function (event) { 25820 event.preventDefault(); 25821 event.stopPropagation(); 25822 25823 _this.toggle(); 25824 }); 25825 }; 25826 25827 _proto._getConfig = function _getConfig(config) { 25828 config = _extends({}, this.constructor.Default, $__default["default"](this._element).data(), config); 25829 Util.typeCheckConfig(NAME$6, config, this.constructor.DefaultType); 25830 return config; 25831 }; 25832 25833 _proto._getMenuElement = function _getMenuElement() { 25834 if (!this._menu) { 25835 var parent = Dropdown._getParentFromElement(this._element); 25836 25837 if (parent) { 25838 this._menu = parent.querySelector(SELECTOR_MENU); 25839 } 25840 } 25841 25842 return this._menu; 25843 }; 25844 25845 _proto._getPlacement = function _getPlacement() { 25846 var $parentDropdown = $__default["default"](this._element.parentNode); 25847 var placement = PLACEMENT_BOTTOM; // Handle dropup 25848 25849 if ($parentDropdown.hasClass(CLASS_NAME_DROPUP)) { 25850 placement = $__default["default"](this._menu).hasClass(CLASS_NAME_MENURIGHT) ? PLACEMENT_TOPEND : PLACEMENT_TOP; 25851 } else if ($parentDropdown.hasClass(CLASS_NAME_DROPRIGHT)) { 25852 placement = PLACEMENT_RIGHT; 25853 } else if ($parentDropdown.hasClass(CLASS_NAME_DROPLEFT)) { 25854 placement = PLACEMENT_LEFT; 25855 } else if ($__default["default"](this._menu).hasClass(CLASS_NAME_MENURIGHT)) { 25856 placement = PLACEMENT_BOTTOMEND; 25857 } 25858 25859 return placement; 25860 }; 25861 25862 _proto._detectNavbar = function _detectNavbar() { 25863 return $__default["default"](this._element).closest('.navbar').length > 0; 25864 }; 25865 25866 _proto._getOffset = function _getOffset() { 25867 var _this2 = this; 25868 25869 var offset = {}; 25870 25871 if (typeof this._config.offset === 'function') { 25872 offset.fn = function (data) { 25873 data.offsets = _extends({}, data.offsets, _this2._config.offset(data.offsets, _this2._element)); 25874 return data; 25875 }; 25876 } else { 25877 offset.offset = this._config.offset; 25878 } 25879 25880 return offset; 25881 }; 25882 25883 _proto._getPopperConfig = function _getPopperConfig() { 25884 var popperConfig = { 25885 placement: this._getPlacement(), 25886 modifiers: { 25887 offset: this._getOffset(), 25888 flip: { 25889 enabled: this._config.flip 25890 }, 25891 preventOverflow: { 25892 boundariesElement: this._config.boundary 25893 } 25894 } 25895 }; // Disable Popper if we have a static display 25896 25897 if (this._config.display === 'static') { 25898 popperConfig.modifiers.applyStyle = { 25899 enabled: false 25900 }; 25901 } 25902 25903 return _extends({}, popperConfig, this._config.popperConfig); 25904 } // Static 25905 ; 25906 25907 Dropdown._jQueryInterface = function _jQueryInterface(config) { 25908 return this.each(function () { 25909 var data = $__default["default"](this).data(DATA_KEY$6); 25910 25911 var _config = typeof config === 'object' ? config : null; 25912 25913 if (!data) { 25914 data = new Dropdown(this, _config); 25915 $__default["default"](this).data(DATA_KEY$6, data); 25916 } 25917 25918 if (typeof config === 'string') { 25919 if (typeof data[config] === 'undefined') { 25920 throw new TypeError("No method named \"" + config + "\""); 25921 } 25922 25923 data[config](); 25924 } 25925 }); 25926 }; 25927 25928 Dropdown._clearMenus = function _clearMenus(event) { 25929 if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) { 25930 return; 25931 } 25932 25933 var toggles = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE$2)); 25934 25935 for (var i = 0, len = toggles.length; i < len; i++) { 25936 var parent = Dropdown._getParentFromElement(toggles[i]); 25937 25938 var context = $__default["default"](toggles[i]).data(DATA_KEY$6); 25939 var relatedTarget = { 25940 relatedTarget: toggles[i] 25941 }; 25942 25943 if (event && event.type === 'click') { 25944 relatedTarget.clickEvent = event; 25945 } 25946 25947 if (!context) { 25948 continue; 25949 } 25950 25951 var dropdownMenu = context._menu; 25952 25953 if (!$__default["default"](parent).hasClass(CLASS_NAME_SHOW$5)) { 25954 continue; 25955 } 25956 25957 if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $__default["default"].contains(parent, event.target)) { 25958 continue; 25959 } 25960 25961 var hideEvent = $__default["default"].Event(EVENT_HIDE$3, relatedTarget); 25962 $__default["default"](parent).trigger(hideEvent); 25963 25964 if (hideEvent.isDefaultPrevented()) { 25965 continue; 25966 } // If this is a touch-enabled device we remove the extra 25967 // empty mouseover listeners we added for iOS support 25968 25969 25970 if ('ontouchstart' in document.documentElement) { 25971 $__default["default"](document.body).children().off('mouseover', null, $__default["default"].noop); 25972 } 25973 25974 toggles[i].setAttribute('aria-expanded', 'false'); 25975 25976 if (context._popper) { 25977 context._popper.destroy(); 25978 } 25979 25980 $__default["default"](dropdownMenu).removeClass(CLASS_NAME_SHOW$5); 25981 $__default["default"](parent).removeClass(CLASS_NAME_SHOW$5).trigger($__default["default"].Event(EVENT_HIDDEN$3, relatedTarget)); 25982 } 25983 }; 25984 25985 Dropdown._getParentFromElement = function _getParentFromElement(element) { 25986 var parent; 25987 var selector = Util.getSelectorFromElement(element); 25988 25989 if (selector) { 25990 parent = document.querySelector(selector); 25991 } 25992 25993 return parent || element.parentNode; 25994 } // eslint-disable-next-line complexity 25995 ; 25996 25997 Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) { 25998 // If not input/textarea: 25999 // - And not a key in REGEXP_KEYDOWN => not a dropdown command 26000 // If input/textarea: 26001 // - If space key => not a dropdown command 26002 // - If key is other than escape 26003 // - If key is not up or down => not a dropdown command 26004 // - If trigger inside the menu =>
vendor: 16,384 bytes, lines 26004-26513
26004 not a dropdown command 26005 if (/input|textarea/i.test(event.target.tagName) ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE$1 && (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE || $__default["default"](event.target).closest(SELECTOR_MENU).length) : !REGEXP_KEYDOWN.test(event.which)) { 26006 return; 26007 } 26008 26009 if (this.disabled || $__default["default"](this).hasClass(CLASS_NAME_DISABLED$1)) { 26010 return; 26011 } 26012 26013 var parent = Dropdown._getParentFromElement(this); 26014 26015 var isActive = $__default["default"](parent).hasClass(CLASS_NAME_SHOW$5); 26016 26017 if (!isActive && event.which === ESCAPE_KEYCODE$1) { 26018 return; 26019 } 26020 26021 event.preventDefault(); 26022 event.stopPropagation(); 26023 26024 if (!isActive || event.which === ESCAPE_KEYCODE$1 || event.which === SPACE_KEYCODE) { 26025 if (event.which === ESCAPE_KEYCODE$1) { 26026 $__default["default"](parent.querySelector(SELECTOR_DATA_TOGGLE$2)).trigger('focus'); 26027 } 26028 26029 $__default["default"](this).trigger('click'); 26030 return; 26031 } 26032 26033 var items = [].slice.call(parent.querySelectorAll(SELECTOR_VISIBLE_ITEMS)).filter(function (item) { 26034 return $__default["default"](item).is(':visible'); 26035 }); 26036 26037 if (items.length === 0) { 26038 return; 26039 } 26040 26041 var index = items.indexOf(event.target); 26042 26043 if (event.which === ARROW_UP_KEYCODE && index > 0) { 26044 // Up 26045 index--; 26046 } 26047 26048 if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) { 26049 // Down 26050 index++; 26051 } 26052 26053 if (index < 0) { 26054 index = 0; 26055 } 26056 26057 items[index].focus(); 26058 }; 26059 26060 _createClass(Dropdown, null, [{ 26061 key: "VERSION", 26062 get: function get() { 26063 return VERSION$6; 26064 } 26065 }, { 26066 key: "Default", 26067 get: function get() { 26068 return Default$5; 26069 } 26070 }, { 26071 key: "DefaultType", 26072 get: function get() { 26073 return DefaultType$5; 26074 } 26075 }]); 26076 26077 return Dropdown; 26078 }(); 26079 /** 26080 * Data API implementation 26081 */ 26082 26083 26084 $__default["default"](document).on(EVENT_KEYDOWN_DATA_API, SELECTOR_DATA_TOGGLE$2, Dropdown._dataApiKeydownHandler).on(EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown._dataApiKeydownHandler).on(EVENT_CLICK_DATA_API$2 + " " + EVENT_KEYUP_DATA_API, Dropdown._clearMenus).on(EVENT_CLICK_DATA_API$2, SELECTOR_DATA_TOGGLE$2, function (event) { 26085 event.preventDefault(); 26086 event.stopPropagation(); 26087 26088 Dropdown._jQueryInterface.call($__default["default"](this), 'toggle'); 26089 }).on(EVENT_CLICK_DATA_API$2, SELECTOR_FORM_CHILD, function (e) { 26090 e.stopPropagation(); 26091 }); 26092 /** 26093 * jQuery 26094 */ 26095 26096 $__default["default"].fn[NAME$6] = Dropdown._jQueryInterface; 26097 $__default["default"].fn[NAME$6].Constructor = Dropdown; 26098 26099 $__default["default"].fn[NAME$6].noConflict = function () { 26100 $__default["default"].fn[NAME$6] = JQUERY_NO_CONFLICT$6; 26101 return Dropdown._jQueryInterface; 26102 }; 26103 26104 /** 26105 * Constants 26106 */ 26107 26108 var NAME$5 = 'modal'; 26109 var VERSION$5 = '4.6.2'; 26110 var DATA_KEY$5 = 'bs.modal'; 26111 var EVENT_KEY$5 = "." + DATA_KEY$5; 26112 var DATA_API_KEY$2 = '.data-api'; 26113 var JQUERY_NO_CONFLICT$5 = $__default["default"].fn[NAME$5]; 26114 var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key 26115 26116 var CLASS_NAME_SCROLLABLE = 'modal-dialog-scrollable'; 26117 var CLASS_NAME_SCROLLBAR_MEASURER = 'modal-scrollbar-measure'; 26118 var CLASS_NAME_BACKDROP = 'modal-backdrop'; 26119 var CLASS_NAME_OPEN = 'modal-open'; 26120 var CLASS_NAME_FADE$4 = 'fade'; 26121 var CLASS_NAME_SHOW$4 = 'show'; 26122 var CLASS_NAME_STATIC = 'modal-static'; 26123 var EVENT_HIDE$2 = "hide" + EVENT_KEY$5; 26124 var EVENT_HIDE_PREVENTED = "hidePrevented" + EVENT_KEY$5; 26125 var EVENT_HIDDEN$2 = "hidden" + EVENT_KEY$5; 26126 var EVENT_SHOW$2 = "show" + EVENT_KEY$5; 26127 var EVENT_SHOWN$2 = "shown" + EVENT_KEY$5; 26128 var EVENT_FOCUSIN = "focusin" + EVENT_KEY$5; 26129 var EVENT_RESIZE = "resize" + EVENT_KEY$5; 26130 var EVENT_CLICK_DISMISS$1 = "click.dismiss" + EVENT_KEY$5; 26131 var EVENT_KEYDOWN_DISMISS = "keydown.dismiss" + EVENT_KEY$5; 26132 var EVENT_MOUSEUP_DISMISS = "mouseup.dismiss" + EVENT_KEY$5; 26133 var EVENT_MOUSEDOWN_DISMISS = "mousedown.dismiss" + EVENT_KEY$5; 26134 var EVENT_CLICK_DATA_API$1 = "click" + EVENT_KEY$5 + DATA_API_KEY$2; 26135 var SELECTOR_DIALOG = '.modal-dialog'; 26136 var SELECTOR_MODAL_BODY = '.modal-body'; 26137 var SELECTOR_DATA_TOGGLE$1 = '[data-toggle="modal"]'; 26138 var SELECTOR_DATA_DISMISS$1 = '[data-dismiss="modal"]'; 26139 var SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top'; 26140 var SELECTOR_STICKY_CONTENT = '.sticky-top'; 26141 var Default$4 = { 26142 backdrop: true, 26143 keyboard: true, 26144 focus: true, 26145 show: true 26146 }; 26147 var DefaultType$4 = { 26148 backdrop: '(boolean|string)', 26149 keyboard: 'boolean', 26150 focus: 'boolean', 26151 show: 'boolean' 26152 }; 26153 /** 26154 * Class definition 26155 */ 26156 26157 var Modal = /*#__PURE__*/function () { 26158 function Modal(element, config) { 26159 this._config = this._getConfig(config); 26160 this._element = element; 26161 this._dialog = element.querySelector(SELECTOR_DIALOG); 26162 this._backdrop = null; 26163 this._isShown = false; 26164 this._isBodyOverflowing = false; 26165 this._ignoreBackdropClick = false; 26166 this._isTransitioning = false; 26167 this._scrollbarWidth = 0; 26168 } // Getters 26169 26170 26171 var _proto = Modal.prototype; 26172 26173 // Public 26174 _proto.toggle = function toggle(relatedTarget) { 26175 return this._isShown ? this.hide() : this.show(relatedTarget); 26176 }; 26177 26178 _proto.show = function show(relatedTarget) { 26179 var _this = this; 26180 26181 if (this._isShown || this._isTransitioning) { 26182 return; 26183 } 26184 26185 var showEvent = $__default["default"].Event(EVENT_SHOW$2, { 26186 relatedTarget: relatedTarget 26187 }); 26188 $__default["default"](this._element).trigger(showEvent); 26189 26190 if (showEvent.isDefaultPrevented()) { 26191 return; 26192 } 26193 26194 this._isShown = true; 26195 26196 if ($__default["default"](this._element).hasClass(CLASS_NAME_FADE$4)) { 26197 this._isTransitioning = true; 26198 } 26199 26200 this._checkScrollbar(); 26201 26202 this._setScrollbar(); 26203 26204 this._adjustDialog(); 26205 26206 this._setEscapeEvent(); 26207 26208 this._setResizeEvent(); 26209 26210 $__default["default"](this._element).on(EVENT_CLICK_DISMISS$1, SELECTOR_DATA_DISMISS$1, function (event) { 26211 return _this.hide(event); 26212 }); 26213 $__default["default"](this._dialog).on(EVENT_MOUSEDOWN_DISMISS, function () { 26214 $__default["default"](_this._element).one(EVENT_MOUSEUP_DISMISS, function (event) { 26215 if ($__default["default"](event.target).is(_this._element)) { 26216 _this._ignoreBackdropClick = true; 26217 } 26218 }); 26219 }); 26220 26221 this._showBackdrop(function () { 26222 return _this._showElement(relatedTarget); 26223 }); 26224 }; 26225 26226 _proto.hide = function hide(event) { 26227 var _this2 = this; 26228 26229 if (event) { 26230 event.preventDefault(); 26231 } 26232 26233 if (!this._isShown || this._isTransitioning) { 26234 return; 26235 } 26236 26237 var hideEvent = $__default["default"].Event(EVENT_HIDE$2); 26238 $__default["default"](this._element).trigger(hideEvent); 26239 26240 if (!this._isShown || hideEvent.isDefaultPrevented()) { 26241 return; 26242 } 26243 26244 this._isShown = false; 26245 var transition = $__default["default"](this._element).hasClass(CLASS_NAME_FADE$4); 26246 26247 if (transition) { 26248 this._isTransitioning = true; 26249 } 26250 26251 this._setEscapeEvent(); 26252 26253 this._setResizeEvent(); 26254 26255 $__default["default"](document).off(EVENT_FOCUSIN); 26256 $__default["default"](this._element).removeClass(CLASS_NAME_SHOW$4); 26257 $__default["default"](this._element).off(EVENT_CLICK_DISMISS$1); 26258 $__default["default"](this._dialog).off(EVENT_MOUSEDOWN_DISMISS); 26259 26260 if (transition) { 26261 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 26262 $__default["default"](this._element).one(Util.TRANSITION_END, function (event) { 26263 return _this2._hideModal(event); 26264 }).emulateTransitionEnd(transitionDuration); 26265 } else { 26266 this._hideModal(); 26267 } 26268 }; 26269 26270 _proto.dispose = function dispose() { 26271 [window, this._element, this._dialog].forEach(function (htmlElement) { 26272 return $__default["default"](htmlElement).off(EVENT_KEY$5); 26273 }); 26274 /** 26275 * `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API` 26276 * Do not move `document` in `htmlElements` array 26277 * It will remove `EVENT_CLICK_DATA_API` event that should remain 26278 */ 26279 26280 $__default["default"](document).off(EVENT_FOCUSIN); 26281 $__default["default"].removeData(this._element, DATA_KEY$5); 26282 this._config = null; 26283 this._element = null; 26284 this._dialog = null; 26285 this._backdrop = null; 26286 this._isShown = null; 26287 this._isBodyOverflowing = null; 26288 this._ignoreBackdropClick = null; 26289 this._isTransitioning = null; 26290 this._scrollbarWidth = null; 26291 }; 26292 26293 _proto.handleUpdate = function handleUpdate() { 26294 this._adjustDialog(); 26295 } // Private 26296 ; 26297 26298 _proto._getConfig = function _getConfig(config) { 26299 config = _extends({}, Default$4, config); 26300 Util.typeCheckConfig(NAME$5, config, DefaultType$4); 26301 return config; 26302 }; 26303 26304 _proto._triggerBackdropTransition = function _triggerBackdropTransition() { 26305 var _this3 = this; 26306 26307 var hideEventPrevented = $__default["default"].Event(EVENT_HIDE_PREVENTED); 26308 $__default["default"](this._element).trigger(hideEventPrevented); 26309 26310 if (hideEventPrevented.isDefaultPrevented()) { 26311 return; 26312 } 26313 26314 var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; 26315 26316 if (!isModalOverflowing) { 26317 this._element.style.overflowY = 'hidden'; 26318 } 26319 26320 this._element.classList.add(CLASS_NAME_STATIC); 26321 26322 var modalTransitionDuration = Util.getTransitionDurationFromElement(this._dialog); 26323 $__default["default"](this._element).off(Util.TRANSITION_END); 26324 $__default["default"](this._element).one(Util.TRANSITION_END, function () { 26325 _this3._element.classList.remove(CLASS_NAME_STATIC); 26326 26327 if (!isModalOverflowing) { 26328 $__default["default"](_this3._element).one(Util.TRANSITION_END, function () { 26329 _this3._element.style.overflowY = ''; 26330 }).emulateTransitionEnd(_this3._element, modalTransitionDuration); 26331 } 26332 }).emulateTransitionEnd(modalTransitionDuration); 26333 26334 this._element.focus(); 26335 }; 26336 26337 _proto._showElement = function _showElement(relatedTarget) { 26338 var _this4 = this; 26339 26340 var transition = $__default["default"](this._element).hasClass(CLASS_NAME_FADE$4); 26341 var modalBody = this._dialog ? this._dialog.querySelector(SELECTOR_MODAL_BODY) : null; 26342 26343 if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) { 26344 // Don't move modal's DOM position 26345 document.body.appendChild(this._element); 26346 } 26347 26348 this._element.style.display = 'block'; 26349 26350 this._element.removeAttribute('aria-hidden'); 26351 26352 this._element.setAttribute('aria-modal', true); 26353 26354 this._element.setAttribute('role', 'dialog'); 26355 26356 if ($__default["default"](this._dialog).hasClass(CLASS_NAME_SCROLLABLE) && modalBody) { 26357 modalBody.scrollTop = 0; 26358 } else { 26359 this._element.scrollTop = 0; 26360 } 26361 26362 if (transition) { 26363 Util.reflow(this._element); 26364 } 26365 26366 $__default["default"](this._element).addClass(CLASS_NAME_SHOW$4); 26367 26368 if (this._config.focus) { 26369 this._enforceFocus(); 26370 } 26371 26372 var shownEvent = $__default["default"].Event(EVENT_SHOWN$2, { 26373 relatedTarget: relatedTarget 26374 }); 26375 26376 var transitionComplete = function transitionComplete() { 26377 if (_this4._config.focus) { 26378 _this4._element.focus(); 26379 } 26380 26381 _this4._isTransitioning = false; 26382 $__default["default"](_this4._element).trigger(shownEvent); 26383 }; 26384 26385 if (transition) { 26386 var transitionDuration = Util.getTransitionDurationFromElement(this._dialog); 26387 $__default["default"](this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration); 26388 } else { 26389 transitionComplete(); 26390 } 26391 }; 26392 26393 _proto._enforceFocus = function _enforceFocus() { 26394 var _this5 = this; 26395 26396 $__default["default"](document).off(EVENT_FOCUSIN) // Guard against infinite focus loop 26397 .on(EVENT_FOCUSIN, function (event) { 26398 if (document !== event.target && _this5._element !== event.target && $__default["default"](_this5._element).has(event.target).length === 0) { 26399 _this5._element.focus(); 26400 } 26401 }); 26402 }; 26403 26404 _proto._setEscapeEvent = function _setEscapeEvent() { 26405 var _this6 = this; 26406 26407 if (this._isShown) { 26408 $__default["default"](this._element).on(EVENT_KEYDOWN_DISMISS, function (event) { 26409 if (_this6._config.keyboard && event.which === ESCAPE_KEYCODE) { 26410 event.preventDefault(); 26411 26412 _this6.hide(); 26413 } else if (!_this6._config.keyboard && event.which === ESCAPE_KEYCODE) { 26414 _this6._triggerBackdropTransition(); 26415 } 26416 }); 26417 } else if (!this._isShown) { 26418 $__default["default"](this._element).off(EVENT_KEYDOWN_DISMISS); 26419 } 26420 }; 26421 26422 _proto._setResizeEvent = function _setResizeEvent() { 26423 var _this7 = this; 26424 26425 if (this._isShown) { 26426 $__default["default"](window).on(EVENT_RESIZE, function (event) { 26427 return _this7.handleUpdate(event); 26428 }); 26429 } else { 26430 $__default["default"](window).off(EVENT_RESIZE); 26431 } 26432 }; 26433 26434 _proto._hideModal = function _hideModal() { 26435 var _this8 = this; 26436 26437 this._element.style.display = 'none'; 26438 26439 this._element.setAttribute('aria-hidden', true); 26440 26441 this._element.removeAttribute('aria-modal'); 26442 26443 this._element.removeAttribute('role'); 26444 26445 this._isTransitioning = false; 26446 26447 this._showBackdrop(function () { 26448 $__default["default"](document.body).removeClass(CLASS_NAME_OPEN); 26449 26450 _this8._resetAdjustments(); 26451 26452 _this8._resetScrollbar(); 26453 26454 $__default["default"](_this8._element).trigger(EVENT_HIDDEN$2); 26455 }); 26456 }; 26457 26458 _proto._removeBackdrop = function _removeBackdrop() { 26459 if (this._backdrop) { 26460 $__default["default"](this._backdrop).remove(); 26461 this._backdrop = null; 26462 } 26463 }; 26464 26465 _proto._showBackdrop = function _showBackdrop(callback) { 26466 var _this9 = this; 26467 26468 var animate = $__default["default"](this._element).hasClass(CLASS_NAME_FADE$4) ? CLASS_NAME_FADE$4 : ''; 26469 26470 if (this._isShown && this._config.backdrop) { 26471 this._backdrop = document.createElement('div'); 26472 this._backdrop.className = CLASS_NAME_BACKDROP; 26473 26474 if (animate) { 26475 this._backdrop.classList.add(animate); 26476 } 26477 26478 $__default["default"](this._backdrop).appendTo(document.body); 26479 $__default["default"](this._element).on(EVENT_CLICK_DISMISS$1, function (event) { 26480 if (_this9._ignoreBackdropClick) { 26481 _this9._ignoreBackdropClick = false; 26482 return; 26483 } 26484 26485 if (event.target !== event.currentTarget) { 26486 return; 26487 } 26488 26489 if (_this9._config.backdrop === 'static') { 26490 _this9._triggerBackdropTransition(); 26491 } else { 26492 _this9.hide(); 26493 } 26494 }); 26495 26496 if (animate) { 26497 Util.reflow(this._backdrop); 26498 } 26499 26500 $__default["default"](this._backdrop).addClass(CLASS_NAME_SHOW$4); 26501 26502 if (!callback) { 26503 return; 26504 } 26505 26506 if (!animate) { 26507 callback(); 26508 return; 26509 } 26510 26511 var backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop); 26512 $__default["default"](this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration); 26513 } else
vendor: 5,924 bytes, lines 26513-26638
26513 if (!this._isShown && this._backdrop) { 26514 $__default["default"](this._backdrop).removeClass(CLASS_NAME_SHOW$4); 26515 26516 var callbackRemove = function callbackRemove() { 26517 _this9._removeBackdrop(); 26518 26519 if (callback) { 26520 callback(); 26521 } 26522 }; 26523 26524 if ($__default["default"](this._element).hasClass(CLASS_NAME_FADE$4)) { 26525 var _backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop); 26526 26527 $__default["default"](this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration); 26528 } else { 26529 callbackRemove(); 26530 } 26531 } else if (callback) { 26532 callback(); 26533 } 26534 } // ---------------------------------------------------------------------- 26535 // the following methods are used to handle overflowing modals 26536 // todo (fat): these should probably be refactored out of modal.js 26537 // ---------------------------------------------------------------------- 26538 ; 26539 26540 _proto._adjustDialog = function _adjustDialog() { 26541 var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; 26542 26543 if (!this._isBodyOverflowing && isModalOverflowing) { 26544 this._element.style.paddingLeft = this._scrollbarWidth + "px"; 26545 } 26546 26547 if (this._isBodyOverflowing && !isModalOverflowing) { 26548 this._element.style.paddingRight = this._scrollbarWidth + "px"; 26549 } 26550 }; 26551 26552 _proto._resetAdjustments = function _resetAdjustments() { 26553 this._element.style.paddingLeft = ''; 26554 this._element.style.paddingRight = ''; 26555 }; 26556 26557 _proto._checkScrollbar = function _checkScrollbar() { 26558 var rect = document.body.getBoundingClientRect(); 26559 this._isBodyOverflowing = Math.round(rect.left + rect.right) < window.innerWidth; 26560 this._scrollbarWidth = this._getScrollbarWidth(); 26561 }; 26562 26563 _proto._setScrollbar = function _setScrollbar() { 26564 var _this10 = this; 26565 26566 if (this._isBodyOverflowing) { 26567 // Note: DOMNode.style.paddingRight returns the actual value or '' if not set 26568 // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set 26569 var fixedContent = [].slice.call(document.querySelectorAll(SELECTOR_FIXED_CONTENT)); 26570 var stickyContent = [].slice.call(document.querySelectorAll(SELECTOR_STICKY_CONTENT)); // Adjust fixed content padding 26571 26572 $__default["default"](fixedContent).each(function (index, element) { 26573 var actualPadding = element.style.paddingRight; 26574 var calculatedPadding = $__default["default"](element).css('padding-right'); 26575 $__default["default"](element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this10._scrollbarWidth + "px"); 26576 }); // Adjust sticky content margin 26577 26578 $__default["default"](stickyContent).each(function (index, element) { 26579 var actualMargin = element.style.marginRight; 26580 var calculatedMargin = $__default["default"](element).css('margin-right'); 26581 $__default["default"](element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this10._scrollbarWidth + "px"); 26582 }); // Adjust body padding 26583 26584 var actualPadding = document.body.style.paddingRight; 26585 var calculatedPadding = $__default["default"](document.body).css('padding-right'); 26586 $__default["default"](document.body).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + "px"); 26587 } 26588 26589 $__default["default"](document.body).addClass(CLASS_NAME_OPEN); 26590 }; 26591 26592 _proto._resetScrollbar = function _resetScrollbar() { 26593 // Restore fixed content padding 26594 var fixedContent = [].slice.call(document.querySelectorAll(SELECTOR_FIXED_CONTENT)); 26595 $__default["default"](fixedContent).each(function (index, element) { 26596 var padding = $__default["default"](element).data('padding-right'); 26597 $__default["default"](element).removeData('padding-right'); 26598 element.style.paddingRight = padding ? padding : ''; 26599 }); // Restore sticky content 26600 26601 var elements = [].slice.call(document.querySelectorAll("" + SELECTOR_STICKY_CONTENT)); 26602 $__default["default"](elements).each(function (index, element) { 26603 var margin = $__default["default"](element).data('margin-right'); 26604 26605 if (typeof margin !== 'undefined') { 26606 $__default["default"](element).css('margin-right', margin).removeData('margin-right'); 26607 } 26608 }); // Restore body padding 26609 26610 var padding = $__default["default"](document.body).data('padding-right'); 26611 $__default["default"](document.body).removeData('padding-right'); 26612 document.body.style.paddingRight = padding ? padding : ''; 26613 }; 26614 26615 _proto._getScrollbarWidth = function _getScrollbarWidth() { 26616 // thx d.walsh 26617 var scrollDiv = document.createElement('div'); 26618 scrollDiv.className = CLASS_NAME_SCROLLBAR_MEASURER; 26619 document.body.appendChild(scrollDiv); 26620 var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth; 26621 document.body.removeChild(scrollDiv); 26622 return scrollbarWidth; 26623 } // Static 26624 ; 26625 26626 Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) { 26627 return this.each(function () { 26628 var data = $__default["default"](this).data(DATA_KEY$5); 26629 26630 var _config = _extends({}, Default$4, $__default["default"](this).data(), typeof config === 'object' && config ? config : {}); 26631 26632 if (!data) { 26633 data = new Modal(this, _config); 26634 $__default["default"](this).data(DATA_KEY$5, data); 26635 } 26636 26637 if (typeof config === 'string') { 26638 if (typeof data[config] === 'undefined') {
vendor: 4,144 bytes, lines 26639-26778
26639 throw new TypeError("No method named \"" + config + "\""); 26640 } 26641 26642 data[config](relatedTarget); 26643 } else if (_config.show) { 26644 data.show(relatedTarget); 26645 } 26646 }); 26647 }; 26648 26649 _createClass(Modal, null, [{ 26650 key: "VERSION", 26651 get: function get() { 26652 return VERSION$5; 26653 } 26654 }, { 26655 key: "Default", 26656 get: function get() { 26657 return Default$4; 26658 } 26659 }]); 26660 26661 return Modal; 26662 }(); 26663 /** 26664 * Data API implementation 26665 */ 26666 26667 26668 $__default["default"](document).on(EVENT_CLICK_DATA_API$1, SELECTOR_DATA_TOGGLE$1, function (event) { 26669 var _this11 = this; 26670 26671 var target; 26672 var selector = Util.getSelectorFromElement(this); 26673 26674 if (selector) { 26675 target = document.querySelector(selector); 26676 } 26677 26678 var config = $__default["default"](target).data(DATA_KEY$5) ? 'toggle' : _extends({}, $__default["default"](target).data(), $__default["default"](this).data()); 26679 26680 if (this.tagName === 'A' || this.tagName === 'AREA') { 26681 event.preventDefault(); 26682 } 26683 26684 var $target = $__default["default"](target).one(EVENT_SHOW$2, function (showEvent) { 26685 if (showEvent.isDefaultPrevented()) { 26686 // Only register focus restorer if modal will actually get shown 26687 return; 26688 } 26689 26690 $target.one(EVENT_HIDDEN$2, function () { 26691 if ($__default["default"](_this11).is(':visible')) { 26692 _this11.focus(); 26693 } 26694 }); 26695 }); 26696 26697 Modal._jQueryInterface.call($__default["default"](target), config, this); 26698 }); 26699 /** 26700 * jQuery 26701 */ 26702 26703 $__default["default"].fn[NAME$5] = Modal._jQueryInterface; 26704 $__default["default"].fn[NAME$5].Constructor = Modal; 26705 26706 $__default["default"].fn[NAME$5].noConflict = function () { 26707 $__default["default"].fn[NAME$5] = JQUERY_NO_CONFLICT$5; 26708 return Modal._jQueryInterface; 26709 }; 26710 26711 /** 26712 * -------------------------------------------------------------------------- 26713 * Bootstrap (v4.6.2): tools/sanitizer.js 26714 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 26715 * -------------------------------------------------------------------------- 26716 */ 26717 var uriAttrs = ['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']; 26718 var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i; 26719 var DefaultWhitelist = { 26720 // Global attributes allowed on any supplied element below. 26721 '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN], 26722 a: ['target', 'href', 'title', 'rel'], 26723 area: [], 26724 b: [], 26725 br: [], 26726 col: [], 26727 code: [], 26728 div: [], 26729 em: [], 26730 hr: [], 26731 h1: [], 26732 h2: [], 26733 h3: [], 26734 h4: [], 26735 h5: [], 26736 h6: [], 26737 i: [], 26738 img: ['src', 'srcset', 'alt', 'title', 'width', 'height'], 26739 li: [], 26740 ol: [], 26741 p: [], 26742 pre: [], 26743 s: [], 26744 small: [], 26745 span: [], 26746 sub: [], 26747 sup: [], 26748 strong: [], 26749 u: [], 26750 ul: [] 26751 }; 26752 /** 26753 * A pattern that recognizes a commonly useful subset of URLs that are safe. 26754 * 26755 * Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts 26756 */ 26757 26758 var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^#&/:?]*(?:[#/?]|$))/i; 26759 /** 26760 * A pattern that matches safe data URLs. Only matches image, video and audio types. 26761 * 26762 * Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts 26763 */ 26764 26765 var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i; 26766 26767 function allowedAttribute(attr, allowedAttributeList) { 26768 var attrName = attr.nodeName.toLowerCase(); 26769 26770 if (allowedAttributeList.indexOf(attrName) !== -1) { 26771 if (uriAttrs.indexOf(attrName) !== -1) { 26772 return Boolean(SAFE_URL_PATTERN.test(attr.nodeValue) || DATA_URL_PATTERN.test(attr.nodeValue)); 26773 } 26774 26775 return true; 26776 } 26777 26778 var regExp = allowedAttributeList.filter(function (attrRegex) {
vendor: 7,497 bytes, lines 26779-27028
26779 return attrRegex instanceof RegExp; 26780 }); // Check if a regular expression validates the attribute. 26781 26782 for (var i = 0, len = regExp.length; i < len; i++) { 26783 if (regExp[i].test(attrName)) { 26784 return true; 26785 } 26786 } 26787 26788 return false; 26789 } 26790 26791 function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) { 26792 if (unsafeHtml.length === 0) { 26793 return unsafeHtml; 26794 } 26795 26796 if (sanitizeFn && typeof sanitizeFn === 'function') { 26797 return sanitizeFn(unsafeHtml); 26798 } 26799 26800 var domParser = new window.DOMParser(); 26801 var createdDocument = domParser.parseFromString(unsafeHtml, 'text/html'); 26802 var whitelistKeys = Object.keys(whiteList); 26803 var elements = [].slice.call(createdDocument.body.querySelectorAll('*')); 26804 26805 var _loop = function _loop(i, len) { 26806 var el = elements[i]; 26807 var elName = el.nodeName.toLowerCase(); 26808 26809 if (whitelistKeys.indexOf(el.nodeName.toLowerCase()) === -1) { 26810 el.parentNode.removeChild(el); 26811 return "continue"; 26812 } 26813 26814 var attributeList = [].slice.call(el.attributes); // eslint-disable-next-line unicorn/prefer-spread 26815 26816 var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []); 26817 attributeList.forEach(function (attr) { 26818 if (!allowedAttribute(attr, whitelistedAttributes)) { 26819 el.removeAttribute(attr.nodeName); 26820 } 26821 }); 26822 }; 26823 26824 for (var i = 0, len = elements.length; i < len; i++) { 26825 var _ret = _loop(i); 26826 26827 if (_ret === "continue") continue; 26828 } 26829 26830 return createdDocument.body.innerHTML; 26831 } 26832 26833 /** 26834 * Constants 26835 */ 26836 26837 var NAME$4 = 'tooltip'; 26838 var VERSION$4 = '4.6.2'; 26839 var DATA_KEY$4 = 'bs.tooltip'; 26840 var EVENT_KEY$4 = "." + DATA_KEY$4; 26841 var JQUERY_NO_CONFLICT$4 = $__default["default"].fn[NAME$4]; 26842 var CLASS_PREFIX$1 = 'bs-tooltip'; 26843 var BSCLS_PREFIX_REGEX$1 = new RegExp("(^|\\s)" + CLASS_PREFIX$1 + "\\S+", 'g'); 26844 var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn']; 26845 var CLASS_NAME_FADE$3 = 'fade'; 26846 var CLASS_NAME_SHOW$3 = 'show'; 26847 var HOVER_STATE_SHOW = 'show'; 26848 var HOVER_STATE_OUT = 'out'; 26849 var SELECTOR_TOOLTIP_INNER = '.tooltip-inner'; 26850 var SELECTOR_ARROW = '.arrow'; 26851 var TRIGGER_HOVER = 'hover'; 26852 var TRIGGER_FOCUS = 'focus'; 26853 var TRIGGER_CLICK = 'click'; 26854 var TRIGGER_MANUAL = 'manual'; 26855 var AttachmentMap = { 26856 AUTO: 'auto', 26857 TOP: 'top', 26858 RIGHT: 'right', 26859 BOTTOM: 'bottom', 26860 LEFT: 'left' 26861 }; 26862 var Default$3 = { 26863 animation: true, 26864 template: '<div class="tooltip" role="tooltip">' + '<div class="arrow"></div>' + '<div class="tooltip-inner"></div></div>', 26865 trigger: 'hover focus', 26866 title: '', 26867 delay: 0, 26868 html: false, 26869 selector: false, 26870 placement: 'top', 26871 offset: 0, 26872 container: false, 26873 fallbackPlacement: 'flip', 26874 boundary: 'scrollParent', 26875 customClass: '', 26876 sanitize: true, 26877 sanitizeFn: null, 26878 whiteList: DefaultWhitelist, 26879 popperConfig: null 26880 }; 26881 var DefaultType$3 = { 26882 animation: 'boolean', 26883 template: 'string', 26884 title: '(string|element|function)', 26885 trigger: 'string', 26886 delay: '(number|object)', 26887 html: 'boolean', 26888 selector: '(string|boolean)', 26889 placement: '(string|function)', 26890 offset: '(number|string|function)', 26891 container: '(string|element|boolean)', 26892 fallbackPlacement: '(string|array)', 26893 boundary: '(string|element)', 26894 customClass: '(string|function)', 26895 sanitize: 'boolean', 26896 sanitizeFn: '(null|function)', 26897 whiteList: 'object', 26898 popperConfig: '(null|object)' 26899 }; 26900 var Event$1 = { 26901 HIDE: "hide" + EVENT_KEY$4, 26902 HIDDEN: "hidden" + EVENT_KEY$4, 26903 SHOW: "show" + EVENT_KEY$4, 26904 SHOWN: "shown" + EVENT_KEY$4, 26905 INSERTED: "inserted" + EVENT_KEY$4, 26906 CLICK: "click" + EVENT_KEY$4, 26907 FOCUSIN: "focusin" + EVENT_KEY$4, 26908 FOCUSOUT: "focusout" + EVENT_KEY$4, 26909 MOUSEENTER: "mouseenter" + EVENT_KEY$4, 26910 MOUSELEAVE: "mouseleave" + EVENT_KEY$4 26911 }; 26912 /** 26913 * Class definition 26914 */ 26915 26916 var Tooltip = /*#__PURE__*/function () { 26917 function Tooltip(element, config) { 26918 if (typeof Popper__default["default"] === 'undefined') { 26919 throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)'); 26920 } // Private 26921 26922 26923 this._isEnabled = true; 26924 this._timeout = 0; 26925 this._hoverState = ''; 26926 this._activeTrigger = {}; 26927 this._popper = null; // Protected 26928 26929 this.element = element; 26930 this.config = this._getConfig(config); 26931 this.tip = null; 26932 26933 this._setListeners(); 26934 } // Getters 26935 26936 26937 var _proto = Tooltip.prototype; 26938 26939 // Public 26940 _proto.enable = function enable() { 26941 this._isEnabled = true; 26942 }; 26943 26944 _proto.disable = function disable() { 26945 this._isEnabled = false; 26946 }; 26947 26948 _proto.toggleEnabled = function toggleEnabled() { 26949 this._isEnabled = !this._isEnabled; 26950 }; 26951 26952 _proto.toggle = function toggle(event) { 26953 if (!this._isEnabled) { 26954 return; 26955 } 26956 26957 if (event) { 26958 var dataKey = this.constructor.DATA_KEY; 26959 var context = $__default["default"](event.currentTarget).data(dataKey); 26960 26961 if (!context) { 26962 context = new this.constructor(event.currentTarget, this._getDelegateConfig()); 26963 $__default["default"](event.currentTarget).data(dataKey, context); 26964 } 26965 26966 context._activeTrigger.click = !context._activeTrigger.click; 26967 26968 if (context._isWithActiveTrigger()) { 26969 context._enter(null, context); 26970 } else { 26971 context._leave(null, context); 26972 } 26973 } else { 26974 if ($__default["default"](this.getTipElement()).hasClass(CLASS_NAME_SHOW$3)) { 26975 this._leave(null, this); 26976 26977 return; 26978 } 26979 26980 this._enter(null, this); 26981 } 26982 }; 26983 26984 _proto.dispose = function dispose() { 26985 clearTimeout(this._timeout); 26986 $__default["default"].removeData(this.element, this.constructor.DATA_KEY); 26987 $__default["default"](this.element).off(this.constructor.EVENT_KEY); 26988 $__default["default"](this.element).closest('.modal').off('hide.bs.modal', this._hideModalHandler); 26989 26990 if (this.tip) { 26991 $__default["default"](this.tip).remove(); 26992 } 26993 26994 this._isEnabled = null; 26995 this._timeout = null; 26996 this._hoverState = null; 26997 this._activeTrigger = null; 26998 26999 if (this._popper) { 27000 this._popper.destroy(); 27001 } 27002 27003 this._popper = null; 27004 this.element = null; 27005 this.config = null; 27006 this.tip = null; 27007 }; 27008 27009 _proto.show = function show() { 27010 var _this = this; 27011 27012 if ($__default["default"](this.element).css('display') === 'none') { 27013 throw new Error('Please use show on visible elements'); 27014 } 27015 27016 var showEvent = $__default["default"].Event(this.constructor.Event.SHOW); 27017 27018 if (this.isWithContent() && this._isEnabled) { 27019 $__default["default"](this.element).trigger(showEvent); 27020 var shadowRoot = Util.findShadowRoot(this.element); 27021 var isInTheDom = $__default["default"].contains(shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement, this.element); 27022 27023 if (showEvent.isDefaultPrevented() || !isInTheDom) { 27024 return; 27025 } 27026 27027 var tip = this.getTipElement(); 27028 var tipId = Util.getUID(this.constructor.NAME);
vendor: 4,115 bytes, lines 27029-27138
27029 tip.setAttribute('id', tipId); 27030 this.element.setAttribute('aria-describedby', tipId); 27031 this.setContent(); 27032 27033 if (this.config.animation) { 27034 $__default["default"](tip).addClass(CLASS_NAME_FADE$3); 27035 } 27036 27037 var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement; 27038 27039 var attachment = this._getAttachment(placement); 27040 27041 this.addAttachmentClass(attachment); 27042 27043 var container = this._getContainer(); 27044 27045 $__default["default"](tip).data(this.constructor.DATA_KEY, this); 27046 27047 if (!$__default["default"].contains(this.element.ownerDocument.documentElement, this.tip)) { 27048 $__default["default"](tip).appendTo(container); 27049 } 27050 27051 $__default["default"](this.element).trigger(this.constructor.Event.INSERTED); 27052 this._popper = new Popper__default["default"](this.element, tip, this._getPopperConfig(attachment)); 27053 $__default["default"](tip).addClass(CLASS_NAME_SHOW$3); 27054 $__default["default"](tip).addClass(this.config.customClass); // If this is a touch-enabled device we add extra 27055 // empty mouseover listeners to the body's immediate children; 27056 // only needed because of broken event delegation on iOS 27057 // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html 27058 27059 if ('ontouchstart' in document.documentElement) { 27060 $__default["default"](document.body).children().on('mouseover', null, $__default["default"].noop); 27061 } 27062 27063 var complete = function complete() { 27064 if (_this.config.animation) { 27065 _this._fixTransition(); 27066 } 27067 27068 var prevHoverState = _this._hoverState; 27069 _this._hoverState = null; 27070 $__default["default"](_this.element).trigger(_this.constructor.Event.SHOWN); 27071 27072 if (prevHoverState === HOVER_STATE_OUT) { 27073 _this._leave(null, _this); 27074 } 27075 }; 27076 27077 if ($__default["default"](this.tip).hasClass(CLASS_NAME_FADE$3)) { 27078 var transitionDuration = Util.getTransitionDurationFromElement(this.tip); 27079 $__default["default"](this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 27080 } else { 27081 complete(); 27082 } 27083 } 27084 }; 27085 27086 _proto.hide = function hide(callback) { 27087 var _this2 = this; 27088 27089 var tip = this.getTipElement(); 27090 var hideEvent = $__default["default"].Event(this.constructor.Event.HIDE); 27091 27092 var complete = function complete() { 27093 if (_this2._hoverState !== HOVER_STATE_SHOW && tip.parentNode) { 27094 tip.parentNode.removeChild(tip); 27095 } 27096 27097 _this2._cleanTipClass(); 27098 27099 _this2.element.removeAttribute('aria-describedby'); 27100 27101 $__default["default"](_this2.element).trigger(_this2.constructor.Event.HIDDEN); 27102 27103 if (_this2._popper !== null) { 27104 _this2._popper.destroy(); 27105 } 27106 27107 if (callback) { 27108 callback(); 27109 } 27110 }; 27111 27112 $__default["default"](this.element).trigger(hideEvent); 27113 27114 if (hideEvent.isDefaultPrevented()) { 27115 return; 27116 } 27117 27118 $__default["default"](tip).removeClass(CLASS_NAME_SHOW$3); // If this is a touch-enabled device we remove the extra 27119 // empty mouseover listeners we added for iOS support 27120 27121 if ('ontouchstart' in document.documentElement) { 27122 $__default["default"](document.body).children().off('mouseover', null, $__default["default"].noop); 27123 } 27124 27125 this._activeTrigger[TRIGGER_CLICK] = false; 27126 this._activeTrigger[TRIGGER_FOCUS] = false; 27127 this._activeTrigger[TRIGGER_HOVER] = false; 27128 27129 if ($__default["default"](this.tip).hasClass(CLASS_NAME_FADE$3)) { 27130 var transitionDuration = Util.getTransitionDurationFromElement(tip); 27131 $__default["default"](tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 27132 } else { 27133 complete(); 27134 } 27135 27136 this._hoverState = ''; 27137 }; 27138
vendor: 8,119 bytes, lines 27139-27386
27139 _proto.update = function update() { 27140 if (this._popper !== null) { 27141 this._popper.scheduleUpdate(); 27142 } 27143 } // Protected 27144 ; 27145 27146 _proto.isWithContent = function isWithContent() { 27147 return Boolean(this.getTitle()); 27148 }; 27149 27150 _proto.addAttachmentClass = function addAttachmentClass(attachment) { 27151 $__default["default"](this.getTipElement()).addClass(CLASS_PREFIX$1 + "-" + attachment); 27152 }; 27153 27154 _proto.getTipElement = function getTipElement() { 27155 this.tip = this.tip || $__default["default"](this.config.template)[0]; 27156 return this.tip; 27157 }; 27158 27159 _proto.setContent = function setContent() { 27160 var tip = this.getTipElement(); 27161 this.setElementContent($__default["default"](tip.querySelectorAll(SELECTOR_TOOLTIP_INNER)), this.getTitle()); 27162 $__default["default"](tip).removeClass(CLASS_NAME_FADE$3 + " " + CLASS_NAME_SHOW$3); 27163 }; 27164 27165 _proto.setElementContent = function setElementContent($element, content) { 27166 if (typeof content === 'object' && (content.nodeType || content.jquery)) { 27167 // Content is a DOM node or a jQuery 27168 if (this.config.html) { 27169 if (!$__default["default"](content).parent().is($element)) { 27170 $element.empty().append(content); 27171 } 27172 } else { 27173 $element.text($__default["default"](content).text()); 27174 } 27175 27176 return; 27177 } 27178 27179 if (this.config.html) { 27180 if (this.config.sanitize) { 27181 content = sanitizeHtml(content, this.config.whiteList, this.config.sanitizeFn); 27182 } 27183 27184 $element.html(content); 27185 } else { 27186 $element.text(content); 27187 } 27188 }; 27189 27190 _proto.getTitle = function getTitle() { 27191 var title = this.element.getAttribute('data-original-title'); 27192 27193 if (!title) { 27194 title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title; 27195 } 27196 27197 return title; 27198 } // Private 27199 ; 27200 27201 _proto._getPopperConfig = function _getPopperConfig(attachment) { 27202 var _this3 = this; 27203 27204 var defaultBsConfig = { 27205 placement: attachment, 27206 modifiers: { 27207 offset: this._getOffset(), 27208 flip: { 27209 behavior: this.config.fallbackPlacement 27210 }, 27211 arrow: { 27212 element: SELECTOR_ARROW 27213 }, 27214 preventOverflow: { 27215 boundariesElement: this.config.boundary 27216 } 27217 }, 27218 onCreate: function onCreate(data) { 27219 if (data.originalPlacement !== data.placement) { 27220 _this3._handlePopperPlacementChange(data); 27221 } 27222 }, 27223 onUpdate: function onUpdate(data) { 27224 return _this3._handlePopperPlacementChange(data); 27225 } 27226 }; 27227 return _extends({}, defaultBsConfig, this.config.popperConfig); 27228 }; 27229 27230 _proto._getOffset = function _getOffset() { 27231 var _this4 = this; 27232 27233 var offset = {}; 27234 27235 if (typeof this.config.offset === 'function') { 27236 offset.fn = function (data) { 27237 data.offsets = _extends({}, data.offsets, _this4.config.offset(data.offsets, _this4.element)); 27238 return data; 27239 }; 27240 } else { 27241 offset.offset = this.config.offset; 27242 } 27243 27244 return offset; 27245 }; 27246 27247 _proto._getContainer = function _getContainer() { 27248 if (this.config.container === false) { 27249 return document.body; 27250 } 27251 27252 if (Util.isElement(this.config.container)) { 27253 return $__default["default"](this.config.container); 27254 } 27255 27256 return $__default["default"](document).find(this.config.container); 27257 }; 27258 27259 _proto._getAttachment = function _getAttachment(placement) { 27260 return AttachmentMap[placement.toUpperCase()]; 27261 }; 27262 27263 _proto._setListeners = function _setListeners() { 27264 var _this5 = this; 27265 27266 var triggers = this.config.trigger.split(' '); 27267 triggers.forEach(function (trigger) { 27268 if (trigger === 'click') { 27269 $__default["default"](_this5.element).on(_this5.constructor.Event.CLICK, _this5.config.selector, function (event) { 27270 return _this5.toggle(event); 27271 }); 27272 } else if (trigger !== TRIGGER_MANUAL) { 27273 var eventIn = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSEENTER : _this5.constructor.Event.FOCUSIN; 27274 var eventOut = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSELEAVE : _this5.constructor.Event.FOCUSOUT; 27275 $__default["default"](_this5.element).on(eventIn, _this5.config.selector, function (event) { 27276 return _this5._enter(event); 27277 }).on(eventOut, _this5.config.selector, function (event) { 27278 return _this5._leave(event); 27279 }); 27280 } 27281 }); 27282 27283 this._hideModalHandler = function () { 27284 if (_this5.element) { 27285 _this5.hide(); 27286 } 27287 }; 27288 27289 $__default["default"](this.element).closest('.modal').on('hide.bs.modal', this._hideModalHandler); 27290 27291 if (this.config.selector) { 27292 this.config = _extends({}, this.config, { 27293 trigger: 'manual', 27294 selector: '' 27295 }); 27296 } else { 27297 this._fixTitle(); 27298 } 27299 }; 27300 27301 _proto._fixTitle = function _fixTitle() { 27302 var titleType = typeof this.element.getAttribute('data-original-title'); 27303 27304 if (this.element.getAttribute('title') || titleType !== 'string') { 27305 this.element.setAttribute('data-original-title', this.element.getAttribute('title') || ''); 27306 this.element.setAttribute('title', ''); 27307 } 27308 }; 27309 27310 _proto._enter = function _enter(event, context) { 27311 var dataKey = this.constructor.DATA_KEY; 27312 context = context || $__default["default"](event.currentTarget).data(dataKey); 27313 27314 if (!context) { 27315 context = new this.constructor(event.currentTarget, this._getDelegateConfig()); 27316 $__default["default"](event.currentTarget).data(dataKey, context); 27317 } 27318 27319 if (event) { 27320 context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true; 27321 } 27322 27323 if ($__default["default"](context.getTipElement()).hasClass(CLASS_NAME_SHOW$3) || context._hoverState === HOVER_STATE_SHOW) { 27324 context._hoverState = HOVER_STATE_SHOW; 27325 return; 27326 } 27327 27328 clearTimeout(context._timeout); 27329 context._hoverState = HOVER_STATE_SHOW; 27330 27331 if (!context.config.delay || !context.config.delay.show) { 27332 context.show(); 27333 return; 27334 } 27335 27336 context._timeout = setTimeout(function () { 27337 if (context._hoverState === HOVER_STATE_SHOW) { 27338 context.show(); 27339 } 27340 }, context.config.delay.show); 27341 }; 27342 27343 _proto._leave = function _leave(event, context) { 27344 var dataKey = this.constructor.DATA_KEY; 27345 context = context || $__default["default"](event.currentTarget).data(dataKey); 27346 27347 if (!context) { 27348 context = new this.constructor(event.currentTarget, this._getDelegateConfig()); 27349 $__default["default"](event.currentTarget).data(dataKey, context); 27350 } 27351 27352 if (event) { 27353 context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = false; 27354 } 27355 27356 if (context._isWithActiveTrigger()) { 27357 return; 27358 } 27359 27360 clearTimeout(context._timeout); 27361 context._hoverState = HOVER_STATE_OUT; 27362 27363 if (!context.config.delay || !context.config.delay.hide) { 27364 context.hide(); 27365 return; 27366 } 27367 27368 context._timeout = setTimeout(function () { 27369 if (context._hoverState === HOVER_STATE_OUT) { 27370 context.hide(); 27371 } 27372 }, context.config.delay.hide); 27373 }; 27374 27375 _proto._isWithActiveTrigger = function _isWithActiveTrigger() { 27376 for (var trigger in this._activeTrigger) { 27377 if (this._activeTrigger[trigger]) { 27378 return true; 27379 } 27380 } 27381 27382 return false; 27383 }; 27384 27385 _proto._getConfig = function _getConfig(config) { 27386 var dataAttributes = $__default["default"](this.element).data();
vendor: 8,714 bytes, lines 27387-27708
27387 Object.keys(dataAttributes).forEach(function (dataAttr) { 27388 if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) { 27389 delete dataAttributes[dataAttr]; 27390 } 27391 }); 27392 config = _extends({}, this.constructor.Default, dataAttributes, typeof config === 'object' && config ? config : {}); 27393 27394 if (typeof config.delay === 'number') { 27395 config.delay = { 27396 show: config.delay, 27397 hide: config.delay 27398 }; 27399 } 27400 27401 if (typeof config.title === 'number') { 27402 config.title = config.title.toString(); 27403 } 27404 27405 if (typeof config.content === 'number') { 27406 config.content = config.content.toString(); 27407 } 27408 27409 Util.typeCheckConfig(NAME$4, config, this.constructor.DefaultType); 27410 27411 if (config.sanitize) { 27412 config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn); 27413 } 27414 27415 return config; 27416 }; 27417 27418 _proto._getDelegateConfig = function _getDelegateConfig() { 27419 var config = {}; 27420 27421 if (this.config) { 27422 for (var key in this.config) { 27423 if (this.constructor.Default[key] !== this.config[key]) { 27424 config[key] = this.config[key]; 27425 } 27426 } 27427 } 27428 27429 return config; 27430 }; 27431 27432 _proto._cleanTipClass = function _cleanTipClass() { 27433 var $tip = $__default["default"](this.getTipElement()); 27434 var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX$1); 27435 27436 if (tabClass !== null && tabClass.length) { 27437 $tip.removeClass(tabClass.join('')); 27438 } 27439 }; 27440 27441 _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) { 27442 this.tip = popperData.instance.popper; 27443 27444 this._cleanTipClass(); 27445 27446 this.addAttachmentClass(this._getAttachment(popperData.placement)); 27447 }; 27448 27449 _proto._fixTransition = function _fixTransition() { 27450 var tip = this.getTipElement(); 27451 var initConfigAnimation = this.config.animation; 27452 27453 if (tip.getAttribute('x-placement') !== null) { 27454 return; 27455 } 27456 27457 $__default["default"](tip).removeClass(CLASS_NAME_FADE$3); 27458 this.config.animation = false; 27459 this.hide(); 27460 this.show(); 27461 this.config.animation = initConfigAnimation; 27462 } // Static 27463 ; 27464 27465 Tooltip._jQueryInterface = function _jQueryInterface(config) { 27466 return this.each(function () { 27467 var $element = $__default["default"](this); 27468 var data = $element.data(DATA_KEY$4); 27469 27470 var _config = typeof config === 'object' && config; 27471 27472 if (!data && /dispose|hide/.test(config)) { 27473 return; 27474 } 27475 27476 if (!data) { 27477 data = new Tooltip(this, _config); 27478 $element.data(DATA_KEY$4, data); 27479 } 27480 27481 if (typeof config === 'string') { 27482 if (typeof data[config] === 'undefined') { 27483 throw new TypeError("No method named \"" + config + "\""); 27484 } 27485 27486 data[config](); 27487 } 27488 }); 27489 }; 27490 27491 _createClass(Tooltip, null, [{ 27492 key: "VERSION", 27493 get: function get() { 27494 return VERSION$4; 27495 } 27496 }, { 27497 key: "Default", 27498 get: function get() { 27499 return Default$3; 27500 } 27501 }, { 27502 key: "NAME", 27503 get: function get() { 27504 return NAME$4; 27505 } 27506 }, { 27507 key: "DATA_KEY", 27508 get: function get() { 27509 return DATA_KEY$4; 27510 } 27511 }, { 27512 key: "Event", 27513 get: function get() { 27514 return Event$1; 27515 } 27516 }, { 27517 key: "EVENT_KEY", 27518 get: function get() { 27519 return EVENT_KEY$4; 27520 } 27521 }, { 27522 key: "DefaultType", 27523 get: function get() { 27524 return DefaultType$3; 27525 } 27526 }]); 27527 27528 return Tooltip; 27529 }(); 27530 /** 27531 * jQuery 27532 */ 27533 27534 27535 $__default["default"].fn[NAME$4] = Tooltip._jQueryInterface; 27536 $__default["default"].fn[NAME$4].Constructor = Tooltip; 27537 27538 $__default["default"].fn[NAME$4].noConflict = function () { 27539 $__default["default"].fn[NAME$4] = JQUERY_NO_CONFLICT$4; 27540 return Tooltip._jQueryInterface; 27541 }; 27542 27543 /** 27544 * Constants 27545 */ 27546 27547 var NAME$3 = 'popover'; 27548 var VERSION$3 = '4.6.2'; 27549 var DATA_KEY$3 = 'bs.popover'; 27550 var EVENT_KEY$3 = "." + DATA_KEY$3; 27551 var JQUERY_NO_CONFLICT$3 = $__default["default"].fn[NAME$3]; 27552 var CLASS_PREFIX = 'bs-popover'; 27553 var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g'); 27554 var CLASS_NAME_FADE$2 = 'fade'; 27555 var CLASS_NAME_SHOW$2 = 'show'; 27556 var SELECTOR_TITLE = '.popover-header'; 27557 var SELECTOR_CONTENT = '.popover-body'; 27558 27559 var Default$2 = _extends({}, Tooltip.Default, { 27560 placement: 'right', 27561 trigger: 'click', 27562 content: '', 27563 template: '<div class="popover" role="tooltip">' + '<div class="arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>' 27564 }); 27565 27566 var DefaultType$2 = _extends({}, Tooltip.DefaultType, { 27567 content: '(string|element|function)' 27568 }); 27569 27570 var Event = { 27571 HIDE: "hide" + EVENT_KEY$3, 27572 HIDDEN: "hidden" + EVENT_KEY$3, 27573 SHOW: "show" + EVENT_KEY$3, 27574 SHOWN: "shown" + EVENT_KEY$3, 27575 INSERTED: "inserted" + EVENT_KEY$3, 27576 CLICK: "click" + EVENT_KEY$3, 27577 FOCUSIN: "focusin" + EVENT_KEY$3, 27578 FOCUSOUT: "focusout" + EVENT_KEY$3, 27579 MOUSEENTER: "mouseenter" + EVENT_KEY$3, 27580 MOUSELEAVE: "mouseleave" + EVENT_KEY$3 27581 }; 27582 /** 27583 * Class definition 27584 */ 27585 27586 var Popover = /*#__PURE__*/function (_Tooltip) { 27587 _inheritsLoose(Popover, _Tooltip); 27588 27589 function Popover() { 27590 return _Tooltip.apply(this, arguments) || this; 27591 } 27592 27593 var _proto = Popover.prototype; 27594 27595 // Overrides 27596 _proto.isWithContent = function isWithContent() { 27597 return this.getTitle() || this._getContent(); 27598 }; 27599 27600 _proto.addAttachmentClass = function addAttachmentClass(attachment) { 27601 $__default["default"](this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment); 27602 }; 27603 27604 _proto.getTipElement = function getTipElement() { 27605 this.tip = this.tip || $__default["default"](this.config.template)[0]; 27606 return this.tip; 27607 }; 27608 27609 _proto.setContent = function setContent() { 27610 var $tip = $__default["default"](this.getTipElement()); // We use append for html objects to maintain js events 27611 27612 this.setElementContent($tip.find(SELECTOR_TITLE), this.getTitle()); 27613 27614 var content = this._getContent(); 27615 27616 if (typeof content === 'function') { 27617 content = content.call(this.element); 27618 } 27619 27620 this.setElementContent($tip.find(SELECTOR_CONTENT), content); 27621 $tip.removeClass(CLASS_NAME_FADE$2 + " " + CLASS_NAME_SHOW$2); 27622 } // Private 27623 ; 27624 27625 _proto._getContent = function _getContent() { 27626 return this.element.getAttribute('data-content') || this.config.content; 27627 }; 27628 27629 _proto._cleanTipClass = function _cleanTipClass() { 27630 var $tip = $__default["default"](this.getTipElement()); 27631 var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX); 27632 27633 if (tabClass !== null && tabClass.length > 0) { 27634 $tip.removeClass(tabClass.join('')); 27635 } 27636 } // Static 27637 ; 27638 27639 Popover._jQueryInterface = function _jQueryInterface(config) { 27640 return this.each(function () { 27641 var data = $__default["default"](this).data(DATA_KEY$3); 27642 27643 var _config = typeof config === 'object' ? config : null; 27644 27645 if (!data && /dispose|hide/.test(config)) { 27646 return; 27647 } 27648 27649 if (!data) { 27650 data = new Popover(this, _config); 27651 $__default["default"](this).data(DATA_KEY$3, data); 27652 } 27653 27654 if (typeof config === 'string') { 27655 if (typeof data[config] === 'undefined') { 27656 throw new TypeError("No method named \"" + config + "\""); 27657 } 27658 27659 data[config](); 27660 } 27661 }); 27662 }; 27663 27664 _createClass(Popover, null, [{ 27665 key: "VERSION", 27666 get: // Getters 27667 function get() { 27668 return VERSION$3; 27669 } 27670 }, { 27671 key: "Default", 27672 get: function get() { 27673 return Default$2; 27674 } 27675 }, { 27676 key: "NAME", 27677 get: function get() { 27678 return NAME$3; 27679 } 27680 }, { 27681 key: "DATA_KEY", 27682 get: function get() { 27683 return DATA_KEY$3; 27684 } 27685 }, { 27686 key: "Event", 27687 get: function get() { 27688 return Event; 27689 } 27690 }, { 27691 key: "EVENT_KEY", 27692 get: function get() { 27693 return EVENT_KEY$3; 27694 } 27695 }, { 27696 key: "DefaultType", 27697 get: function get() { 27698 return DefaultType$2; 27699 } 27700 }]); 27701 27702 return Popover; 27703 }(Tooltip); 27704 /** 27705 * jQuery 27706 */ 27707 27708
vendor: 7,922 bytes, lines 27709-27931
27709 $__default["default"].fn[NAME$3] = Popover._jQueryInterface; 27710 $__default["default"].fn[NAME$3].Constructor = Popover; 27711 27712 $__default["default"].fn[NAME$3].noConflict = function () { 27713 $__default["default"].fn[NAME$3] = JQUERY_NO_CONFLICT$3; 27714 return Popover._jQueryInterface; 27715 }; 27716 27717 /** 27718 * Constants 27719 */ 27720 27721 var NAME$2 = 'scrollspy'; 27722 var VERSION$2 = '4.6.2'; 27723 var DATA_KEY$2 = 'bs.scrollspy'; 27724 var EVENT_KEY$2 = "." + DATA_KEY$2; 27725 var DATA_API_KEY$1 = '.data-api'; 27726 var JQUERY_NO_CONFLICT$2 = $__default["default"].fn[NAME$2]; 27727 var CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item'; 27728 var CLASS_NAME_ACTIVE$1 = 'active'; 27729 var EVENT_ACTIVATE = "activate" + EVENT_KEY$2; 27730 var EVENT_SCROLL = "scroll" + EVENT_KEY$2; 27731 var EVENT_LOAD_DATA_API = "load" + EVENT_KEY$2 + DATA_API_KEY$1; 27732 var METHOD_OFFSET = 'offset'; 27733 var METHOD_POSITION = 'position'; 27734 var SELECTOR_DATA_SPY = '[data-spy="scroll"]'; 27735 var SELECTOR_NAV_LIST_GROUP$1 = '.nav, .list-group'; 27736 var SELECTOR_NAV_LINKS = '.nav-link'; 27737 var SELECTOR_NAV_ITEMS = '.nav-item'; 27738 var SELECTOR_LIST_ITEMS = '.list-group-item'; 27739 var SELECTOR_DROPDOWN$1 = '.dropdown'; 27740 var SELECTOR_DROPDOWN_ITEMS = '.dropdown-item'; 27741 var SELECTOR_DROPDOWN_TOGGLE$1 = '.dropdown-toggle'; 27742 var Default$1 = { 27743 offset: 10, 27744 method: 'auto', 27745 target: '' 27746 }; 27747 var DefaultType$1 = { 27748 offset: 'number', 27749 method: 'string', 27750 target: '(string|element)' 27751 }; 27752 /** 27753 * Class definition 27754 */ 27755 27756 var ScrollSpy = /*#__PURE__*/function () { 27757 function ScrollSpy(element, config) { 27758 var _this = this; 27759 27760 this._element = element; 27761 this._scrollElement = element.tagName === 'BODY' ? window : element; 27762 this._config = this._getConfig(config); 27763 this._selector = this._config.target + " " + SELECTOR_NAV_LINKS + "," + (this._config.target + " " + SELECTOR_LIST_ITEMS + ",") + (this._config.target + " " + SELECTOR_DROPDOWN_ITEMS); 27764 this._offsets = []; 27765 this._targets = []; 27766 this._activeTarget = null; 27767 this._scrollHeight = 0; 27768 $__default["default"](this._scrollElement).on(EVENT_SCROLL, function (event) { 27769 return _this._process(event); 27770 }); 27771 this.refresh(); 27772 27773 this._process(); 27774 } // Getters 27775 27776 27777 var _proto = ScrollSpy.prototype; 27778 27779 // Public 27780 _proto.refresh = function refresh() { 27781 var _this2 = this; 27782 27783 var autoMethod = this._scrollElement === this._scrollElement.window ? METHOD_OFFSET : METHOD_POSITION; 27784 var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method; 27785 var offsetBase = offsetMethod === METHOD_POSITION ? this._getScrollTop() : 0; 27786 this._offsets = []; 27787 this._targets = []; 27788 this._scrollHeight = this._getScrollHeight(); 27789 var targets = [].slice.call(document.querySelectorAll(this._selector)); 27790 targets.map(function (element) { 27791 var target; 27792 var targetSelector = Util.getSelectorFromElement(element); 27793 27794 if (targetSelector) { 27795 target = document.querySelector(targetSelector); 27796 } 27797 27798 if (target) { 27799 var targetBCR = target.getBoundingClientRect(); 27800 27801 if (targetBCR.width || targetBCR.height) { 27802 // TODO (fat): remove sketch reliance on jQuery position/offset 27803 return [$__default["default"](target)[offsetMethod]().top + offsetBase, targetSelector]; 27804 } 27805 } 27806 27807 return null; 27808 }).filter(Boolean).sort(function (a, b) { 27809 return a[0] - b[0]; 27810 }).forEach(function (item) { 27811 _this2._offsets.push(item[0]); 27812 27813 _this2._targets.push(item[1]); 27814 }); 27815 }; 27816 27817 _proto.dispose = function dispose() { 27818 $__default["default"].removeData(this._element, DATA_KEY$2); 27819 $__default["default"](this._scrollElement).off(EVENT_KEY$2); 27820 this._element = null; 27821 this._scrollElement = null; 27822 this._config = null; 27823 this._selector = null; 27824 this._offsets = null; 27825 this._targets = null; 27826 this._activeTarget = null; 27827 this._scrollHeight = null; 27828 } // Private 27829 ; 27830 27831 _proto._getConfig = function _getConfig(config) { 27832 config = _extends({}, Default$1, typeof config === 'object' && config ? config : {}); 27833 27834 if (typeof config.target !== 'string' && Util.isElement(config.target)) { 27835 var id = $__default["default"](config.target).attr('id'); 27836 27837 if (!id) { 27838 id = Util.getUID(NAME$2); 27839 $__default["default"](config.target).attr('id', id); 27840 } 27841 27842 config.target = "#" + id; 27843 } 27844 27845 Util.typeCheckConfig(NAME$2, config, DefaultType$1); 27846 return config; 27847 }; 27848 27849 _proto._getScrollTop = function _getScrollTop() { 27850 return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop; 27851 }; 27852 27853 _proto._getScrollHeight = function _getScrollHeight() { 27854 return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight); 27855 }; 27856 27857 _proto._getOffsetHeight = function _getOffsetHeight() { 27858 return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height; 27859 }; 27860 27861 _proto._process = function _process() { 27862 var scrollTop = this._getScrollTop() + this._config.offset; 27863 27864 var scrollHeight = this._getScrollHeight(); 27865 27866 var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight(); 27867 27868 if (this._scrollHeight !== scrollHeight) { 27869 this.refresh(); 27870 } 27871 27872 if (scrollTop >= maxScroll) { 27873 var target = this._targets[this._targets.length - 1]; 27874 27875 if (this._activeTarget !== target) { 27876 this._activate(target); 27877 } 27878 27879 return; 27880 } 27881 27882 if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) { 27883 this._activeTarget = null; 27884 27885 this._clear(); 27886 27887 return; 27888 } 27889 27890 for (var i = this._offsets.length; i--;) { 27891 var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]); 27892 27893 if (isActiveTarget) { 27894 this._activate(this._targets[i]); 27895 } 27896 } 27897 }; 27898 27899 _proto._activate = function _activate(target) { 27900 this._activeTarget = target; 27901 27902 this._clear(); 27903 27904 var queries = this._selector.split(',').map(function (selector) { 27905 return selector + "[data-target=\"" + target + "\"]," + selector + "[href=\"" + target + "\"]"; 27906 }); 27907 27908 var $link = $__default["default"]([].slice.call(document.querySelectorAll(queries.join(',')))); 27909 27910 if ($link.hasClass(CLASS_NAME_DROPDOWN_ITEM)) { 27911 $link.closest(SELECTOR_DROPDOWN$1).find(SELECTOR_DROPDOWN_TOGGLE$1).addClass(CLASS_NAME_ACTIVE$1); 27912 $link.addClass(CLASS_NAME_ACTIVE$1); 27913 } else { 27914 // Set triggered link as active 27915 $link.addClass(CLASS_NAME_ACTIVE$1); // Set triggered links parents as active 27916 // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor 27917 27918 $link.parents(SELECTOR_NAV_LIST_GROUP$1).prev(SELECTOR_NAV_LINKS + ", " + SELECTOR_LIST_ITEMS).addClass(CLASS_NAME_ACTIVE$1); // Handle special case when .nav-link is inside .nav-item 27919 27920 $link.parents(SELECTOR_NAV_LIST_GROUP$1).prev(SELECTOR_NAV_ITEMS).children(SELECTOR_NAV_LINKS).addClass(CLASS_NAME_ACTIVE$1); 27921 } 27922 27923 $__default["default"](this._scrollElement).trigger(EVENT_ACTIVATE, { 27924 relatedTarget: target 27925 }); 27926 }; 27927 27928 _proto._clear = function _clear() { 27929 [].slice.call(document.querySelectorAll(this._selector)).filter(function (node) { 27930 return node.classList.contains(CLASS_NAME_ACTIVE$1); 27931 }
vendor: 14,160 bytes, lines 27931-28394
27931).forEach(function (node) { 27932 return node.classList.remove(CLASS_NAME_ACTIVE$1); 27933 }); 27934 } // Static 27935 ; 27936 27937 ScrollSpy._jQueryInterface = function _jQueryInterface(config) { 27938 return this.each(function () { 27939 var data = $__default["default"](this).data(DATA_KEY$2); 27940 27941 var _config = typeof config === 'object' && config; 27942 27943 if (!data) { 27944 data = new ScrollSpy(this, _config); 27945 $__default["default"](this).data(DATA_KEY$2, data); 27946 } 27947 27948 if (typeof config === 'string') { 27949 if (typeof data[config] === 'undefined') { 27950 throw new TypeError("No method named \"" + config + "\""); 27951 } 27952 27953 data[config](); 27954 } 27955 }); 27956 }; 27957 27958 _createClass(ScrollSpy, null, [{ 27959 key: "VERSION", 27960 get: function get() { 27961 return VERSION$2; 27962 } 27963 }, { 27964 key: "Default", 27965 get: function get() { 27966 return Default$1; 27967 } 27968 }]); 27969 27970 return ScrollSpy; 27971 }(); 27972 /** 27973 * Data API implementation 27974 */ 27975 27976 27977 $__default["default"](window).on(EVENT_LOAD_DATA_API, function () { 27978 var scrollSpys = [].slice.call(document.querySelectorAll(SELECTOR_DATA_SPY)); 27979 var scrollSpysLength = scrollSpys.length; 27980 27981 for (var i = scrollSpysLength; i--;) { 27982 var $spy = $__default["default"](scrollSpys[i]); 27983 27984 ScrollSpy._jQueryInterface.call($spy, $spy.data()); 27985 } 27986 }); 27987 /** 27988 * jQuery 27989 */ 27990 27991 $__default["default"].fn[NAME$2] = ScrollSpy._jQueryInterface; 27992 $__default["default"].fn[NAME$2].Constructor = ScrollSpy; 27993 27994 $__default["default"].fn[NAME$2].noConflict = function () { 27995 $__default["default"].fn[NAME$2] = JQUERY_NO_CONFLICT$2; 27996 return ScrollSpy._jQueryInterface; 27997 }; 27998 27999 /** 28000 * Constants 28001 */ 28002 28003 var NAME$1 = 'tab'; 28004 var VERSION$1 = '4.6.2'; 28005 var DATA_KEY$1 = 'bs.tab'; 28006 var EVENT_KEY$1 = "." + DATA_KEY$1; 28007 var DATA_API_KEY = '.data-api'; 28008 var JQUERY_NO_CONFLICT$1 = $__default["default"].fn[NAME$1]; 28009 var CLASS_NAME_DROPDOWN_MENU = 'dropdown-menu'; 28010 var CLASS_NAME_ACTIVE = 'active'; 28011 var CLASS_NAME_DISABLED = 'disabled'; 28012 var CLASS_NAME_FADE$1 = 'fade'; 28013 var CLASS_NAME_SHOW$1 = 'show'; 28014 var EVENT_HIDE$1 = "hide" + EVENT_KEY$1; 28015 var EVENT_HIDDEN$1 = "hidden" + EVENT_KEY$1; 28016 var EVENT_SHOW$1 = "show" + EVENT_KEY$1; 28017 var EVENT_SHOWN$1 = "shown" + EVENT_KEY$1; 28018 var EVENT_CLICK_DATA_API = "click" + EVENT_KEY$1 + DATA_API_KEY; 28019 var SELECTOR_DROPDOWN = '.dropdown'; 28020 var SELECTOR_NAV_LIST_GROUP = '.nav, .list-group'; 28021 var SELECTOR_ACTIVE = '.active'; 28022 var SELECTOR_ACTIVE_UL = '> li > .active'; 28023 var SELECTOR_DATA_TOGGLE = '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]'; 28024 var SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle'; 28025 var SELECTOR_DROPDOWN_ACTIVE_CHILD = '> .dropdown-menu .active'; 28026 /** 28027 * Class definition 28028 */ 28029 28030 var Tab = /*#__PURE__*/function () { 28031 function Tab(element) { 28032 this._element = element; 28033 } // Getters 28034 28035 28036 var _proto = Tab.prototype; 28037 28038 // Public 28039 _proto.show = function show() { 28040 var _this = this; 28041 28042 if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $__default["default"](this._element).hasClass(CLASS_NAME_ACTIVE) || $__default["default"](this._element).hasClass(CLASS_NAME_DISABLED) || this._element.hasAttribute('disabled')) { 28043 return; 28044 } 28045 28046 var target; 28047 var previous; 28048 var listElement = $__default["default"](this._element).closest(SELECTOR_NAV_LIST_GROUP)[0]; 28049 var selector = Util.getSelectorFromElement(this._element); 28050 28051 if (listElement) { 28052 var itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? SELECTOR_ACTIVE_UL : SELECTOR_ACTIVE; 28053 previous = $__default["default"].makeArray($__default["default"](listElement).find(itemSelector)); 28054 previous = previous[previous.length - 1]; 28055 } 28056 28057 var hideEvent = $__default["default"].Event(EVENT_HIDE$1, { 28058 relatedTarget: this._element 28059 }); 28060 var showEvent = $__default["default"].Event(EVENT_SHOW$1, { 28061 relatedTarget: previous 28062 }); 28063 28064 if (previous) { 28065 $__default["default"](previous).trigger(hideEvent); 28066 } 28067 28068 $__default["default"](this._element).trigger(showEvent); 28069 28070 if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) { 28071 return; 28072 } 28073 28074 if (selector) { 28075 target = document.querySelector(selector); 28076 } 28077 28078 this._activate(this._element, listElement); 28079 28080 var complete = function complete() { 28081 var hiddenEvent = $__default["default"].Event(EVENT_HIDDEN$1, { 28082 relatedTarget: _this._element 28083 }); 28084 var shownEvent = $__default["default"].Event(EVENT_SHOWN$1, { 28085 relatedTarget: previous 28086 }); 28087 $__default["default"](previous).trigger(hiddenEvent); 28088 $__default["default"](_this._element).trigger(shownEvent); 28089 }; 28090 28091 if (target) { 28092 this._activate(target, target.parentNode, complete); 28093 } else { 28094 complete(); 28095 } 28096 }; 28097 28098 _proto.dispose = function dispose() { 28099 $__default["default"].removeData(this._element, DATA_KEY$1); 28100 this._element = null; 28101 } // Private 28102 ; 28103 28104 _proto._activate = function _activate(element, container, callback) { 28105 var _this2 = this; 28106 28107 var activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? $__default["default"](container).find(SELECTOR_ACTIVE_UL) : $__default["default"](container).children(SELECTOR_ACTIVE); 28108 var active = activeElements[0]; 28109 var isTransitioning = callback && active && $__default["default"](active).hasClass(CLASS_NAME_FADE$1); 28110 28111 var complete = function complete() { 28112 return _this2._transitionComplete(element, active, callback); 28113 }; 28114 28115 if (active && isTransitioning) { 28116 var transitionDuration = Util.getTransitionDurationFromElement(active); 28117 $__default["default"](active).removeClass(CLASS_NAME_SHOW$1).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 28118 } else { 28119 complete(); 28120 } 28121 }; 28122 28123 _proto._transitionComplete = function _transitionComplete(element, active, callback) { 28124 if (active) { 28125 $__default["default"](active).removeClass(CLASS_NAME_ACTIVE); 28126 var dropdownChild = $__default["default"](active.parentNode).find(SELECTOR_DROPDOWN_ACTIVE_CHILD)[0]; 28127 28128 if (dropdownChild) { 28129 $__default["default"](dropdownChild).removeClass(CLASS_NAME_ACTIVE); 28130 } 28131 28132 if (active.getAttribute('role') === 'tab') { 28133 active.setAttribute('aria-selected', false); 28134 } 28135 } 28136 28137 $__default["default"](element).addClass(CLASS_NAME_ACTIVE); 28138 28139 if (element.getAttribute('role') === 'tab') { 28140 element.setAttribute('aria-selected', true); 28141 } 28142 28143 Util.reflow(element); 28144 28145 if (element.classList.contains(CLASS_NAME_FADE$1)) { 28146 element.classList.add(CLASS_NAME_SHOW$1); 28147 } 28148 28149 var parent = element.parentNode; 28150 28151 if (parent && parent.nodeName === 'LI') { 28152 parent = parent.parentNode; 28153 } 28154 28155 if (parent && $__default["default"](parent).hasClass(CLASS_NAME_DROPDOWN_MENU)) { 28156 var dropdownElement = $__default["default"](element).closest(SELECTOR_DROPDOWN)[0]; 28157 28158 if (dropdownElement) { 28159 var dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(SELECTOR_DROPDOWN_TOGGLE)); 28160 $__default["default"](dropdownToggleList).addClass(CLASS_NAME_ACTIVE); 28161 } 28162 28163 element.setAttribute('aria-expanded', true); 28164 } 28165 28166 if (callback) { 28167 callback(); 28168 } 28169 } // Static 28170 ; 28171 28172 Tab._jQueryInterface = function _jQueryInterface(config) { 28173 return this.each(function () { 28174 var $this = $__default["default"](this); 28175 var data = $this.data(DATA_KEY$1); 28176 28177 if (!data) { 28178 data = new Tab(this); 28179 $this.data(DATA_KEY$1, data); 28180 } 28181 28182 if (typeof config === 'string') { 28183 if (typeof data[config] === 'undefined') { 28184 throw new TypeError("No method named \"" + config + "\""); 28185 } 28186 28187 data[config](); 28188 } 28189 }); 28190 }; 28191 28192 _createClass(Tab, null, [{ 28193 key: "VERSION", 28194 get: function get() { 28195 return VERSION$1; 28196 } 28197 }]); 28198 28199 return Tab; 28200 }(); 28201 /** 28202 * Data API implementation 28203 */ 28204 28205 28206 $__default["default"](document).on(EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) { 28207 event.preventDefault(); 28208 28209 Tab._jQueryInterface.call($__default["default"](this), 'show'); 28210 }); 28211 /** 28212 * jQuery 28213 */ 28214 28215 $__default["default"].fn[NAME$1] = Tab._jQueryInterface; 28216 $__default["default"].fn[NAME$1].Constructor = Tab; 28217 28218 $__default["default"].fn[NAME$1].noConflict = function () { 28219 $__default["default"].fn[NAME$1] = JQUERY_NO_CONFLICT$1; 28220 return Tab._jQueryInterface; 28221 }; 28222 28223 /** 28224 * Constants 28225 */ 28226 28227 var NAME = 'toast'; 28228 var VERSION = '4.6.2'; 28229 var DATA_KEY = 'bs.toast'; 28230 var EVENT_KEY = "." + DATA_KEY; 28231 var JQUERY_NO_CONFLICT = $__default["default"].fn[NAME]; 28232 var CLASS_NAME_FADE = 'fade'; 28233 var CLASS_NAME_HIDE = 'hide'; 28234 var CLASS_NAME_SHOW = 'show'; 28235 var CLASS_NAME_SHOWING = 'showing'; 28236 var EVENT_CLICK_DISMISS = "click.dismiss" + EVENT_KEY; 28237 var EVENT_HIDE = "hide" + EVENT_KEY; 28238 var EVENT_HIDDEN = "hidden" + EVENT_KEY; 28239 var EVENT_SHOW = "show" + EVENT_KEY; 28240 var EVENT_SHOWN = "shown" + EVENT_KEY; 28241 var SELECTOR_DATA_DISMISS = '[data-dismiss="toast"]'; 28242 var Default = { 28243 animation: true, 28244 autohide: true, 28245 delay: 500 28246 }; 28247 var DefaultType = { 28248 animation: 'boolean', 28249 autohide: 'boolean', 28250 delay: 'number' 28251 }; 28252 /** 28253 * Class definition 28254 */ 28255 28256 var Toast = /*#__PURE__*/function () { 28257 function Toast(element, config) { 28258 this._element = element; 28259 this._config = this._getConfig(config); 28260 this._timeout = null; 28261 28262 this._setListeners(); 28263 } // Getters 28264 28265 28266 var _proto = Toast.prototype; 28267 28268 // Public 28269 _proto.show = function show() { 28270 var _this = this; 28271 28272 var showEvent = $__default["default"].Event(EVENT_SHOW); 28273 $__default["default"](this._element).trigger(showEvent); 28274 28275 if (showEvent.isDefaultPrevented()) { 28276 return; 28277 } 28278 28279 this._clearTimeout(); 28280 28281 if (this._config.animation) { 28282 this._element.classList.add(CLASS_NAME_FADE); 28283 } 28284 28285 var complete = function complete() { 28286 _this._element.classList.remove(CLASS_NAME_SHOWING); 28287 28288 _this._element.classList.add(CLASS_NAME_SHOW); 28289 28290 $__default["default"](_this._element).trigger(EVENT_SHOWN); 28291 28292 if (_this._config.autohide) { 28293 _this._timeout = setTimeout(function () { 28294 _this.hide(); 28295 }, _this._config.delay); 28296 } 28297 }; 28298 28299 this._element.classList.remove(CLASS_NAME_HIDE); 28300 28301 Util.reflow(this._element); 28302 28303 this._element.classList.add(CLASS_NAME_SHOWING); 28304 28305 if (this._config.animation) { 28306 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 28307 $__default["default"](this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 28308 } else { 28309 complete(); 28310 } 28311 }; 28312 28313 _proto.hide = function hide() { 28314 if (!this._element.classList.contains(CLASS_NAME_SHOW)) { 28315 return; 28316 } 28317 28318 var hideEvent = $__default["default"].Event(EVENT_HIDE); 28319 $__default["default"](this._element).trigger(hideEvent); 28320 28321 if (hideEvent.isDefaultPrevented()) { 28322 return; 28323 } 28324 28325 this._close(); 28326 }; 28327 28328 _proto.dispose = function dispose() { 28329 this._clearTimeout(); 28330 28331 if (this._element.classList.contains(CLASS_NAME_SHOW)) { 28332 this._element.classList.remove(CLASS_NAME_SHOW); 28333 } 28334 28335 $__default["default"](this._element).off(EVENT_CLICK_DISMISS); 28336 $__default["default"].removeData(this._element, DATA_KEY); 28337 this._element = null; 28338 this._config = null; 28339 } // Private 28340 ; 28341 28342 _proto._getConfig = function _getConfig(config) { 28343 config = _extends({}, Default, $__default["default"](this._element).data(), typeof config === 'object' && config ? config : {}); 28344 Util.typeCheckConfig(NAME, config, this.constructor.DefaultType); 28345 return config; 28346 }; 28347 28348 _proto._setListeners = function _setListeners() { 28349 var _this2 = this; 28350 28351 $__default["default"](this._element).on(EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, function () { 28352 return _this2.hide(); 28353 }); 28354 }; 28355 28356 _proto._close = function _close() { 28357 var _this3 = this; 28358 28359 var complete = function complete() { 28360 _this3._element.classList.add(CLASS_NAME_HIDE); 28361 28362 $__default["default"](_this3._element).trigger(EVENT_HIDDEN); 28363 }; 28364 28365 this._element.classList.remove(CLASS_NAME_SHOW); 28366 28367 if (this._config.animation) { 28368 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 28369 $__default["default"](this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 28370 } else { 28371 complete(); 28372 } 28373 }; 28374 28375 _proto._clearTimeout = function _clearTimeout() { 28376 clearTimeout(this._timeout); 28377 this._timeout = null; 28378 } // Static 28379 ; 28380 28381 Toast._jQueryInterface = function _jQueryInterface(config) { 28382 return this.each(function () { 28383 var $element = $__default["default"](this); 28384 var data = $element.data(DATA_KEY); 28385 28386 var _config = typeof config === 'object' && config; 28387 28388 if (!data) { 28389 data = new Toast(this, _config); 28390 $element.data(DATA_KEY, data); 28391 } 28392 28393 if (typeof config === 'string') { 28394 if (typeof data[config] === 'undefined') {
28395 throw new TypeError("No method named \"" + config + "\""); 28396 } 28397 28398 data[config](this); 28399 } 28400 }); 28401 }; 28402 28403 _createClass(Toast, null, [{ 28404 key: "VERSION", 28405 get: function get() { 28406 return VERSION; 28407 } 28408 }, { 28409 key: "DefaultType", 28410 get: function get() { 28411 return DefaultType; 28412 } 28413 }, { 28414 key: "Default", 28415 get: function get() { 28416 return Default; 28417 } 28418 }]); 28419 28420 return Toast; 28421 }(); 28422 /** 28423 * jQuery 28424 */ 28425 28426 28427 $__default["default"].fn[NAME] = Toast._jQueryInterface; 28428 $__default["default"].fn[NAME].Constructor = Toast; 28429 28430 $__default["default"].fn[NAME].noConflict = function () { 28431 $__default["default"].fn[NAME] = JQUERY_NO_CONFLICT; 28432 return Toast._jQueryInterface; 28433 }; 28434 28435 exports.Alert = Alert; 28436 exports.Button = Button; 28437 exports.Carousel = Carousel; 28438 exports.Collapse = Collapse; 28439 exports.Dropdown = Dropdown; 28440 exports.Modal = Modal; 28441 exports.Popover = Popover; 28442 exports.Scrollspy = ScrollSpy; 28443 exports.Tab = Tab; 28444 exports.Toast = Toast; 28445 exports.Tooltip = Tooltip; 28446 exports.Util = Util; 28447 28448 Object.defineProperty(exports, '__esModule', { value: true }); 28449 28450})); 28451//# sourceMappingURL=bootstrap.js.map 28452 28453var POST_MEETANDGREET_SEMINARs_URL = ""; 28454var ADD_SEMINAR_CUSTOMER_URL = ""; 28455var GET_POSTALCODE_URL = ""; 28456var GET_HEALTHSTORE_SEARCHLOCATIONS_URL = ""; 28457var CREATE_LEAD_URL = ""; 28458var FIND_FIELD_AGENT_URL = ""; 28459var GET_USER_URL = ""; 28460var GET_COUNTIES_URL = ""; 28461var GET_TASKS_URL = ""; 28462var GET_AUTO_ASSIGNUSER = ""; 28463var GET_STORE_LOCATIONS_URL = ""; 28464var GET_STORE_AVAILABILITY = ""; 28465var ADD_TASK = ""; 28466var UPDATE_TASK = ""; 28467 28468//MBR API's 28469var MBR_CANCEL_API = ""; 28470var MBR_GETEVENTS_API = ""; 28471var MBR_ADD_RESERVATION_API = ""; 28472var MBR_VALIDATE_MEMBER_API = ""; 28473var MBR_GET_RESERVATION_API = ""; 28474 28475//PURL API's 28476var PURL_ADD_CUSTOMER_API = ""; 28477 28478//MEDICARE HRA QUIZ API'S 28479var ADD_CONTACT = ""; 28480var ADD_QUIZ_ANSWERS = ""; 28481 28482var ENV = ""; 28483var ENVIRONMENT = ""; 28484 28485//This is the place where ALL API declaration should happen 28486function globalApiCall() { 28487 28488 switch (window.location.origin) { 28489 case "http://localhost:4502": 28490 //THE URLS PLACED WITHIN THIS CASE ARE SPECIFIC TO THE LOCAL DEV ENVIRONMENT 28491 28492 //Please use the local json path if API is not available 28493 POST_MEETANDGREET_SEMINARs_URL = "https://apiintdev.hmhs.com/AgentCubed/Customer/ext/GetSeminars"; 28494 ADD_SEMINAR_CUSTOMER_URL = "https://apiintdev.hmhs.com/AgentCubed/Customer/ext/AddSeminarCustomer"; 28495 GET_POSTALCODE_URL = "https://apiintdev.hmhs.com/AgentCubed/AddressInfo/ext/GetZipPostalCodes"; 28496 GET_HEALTHSTORE_SEARCHLOCATIONS_URL = ""; 28497 CREATE_LEAD_URL = "https://apiwebqa.hmhs.com/AgentCubed/dmxcrl/v1/create-lead"; 28498 FIND_FIELD_AGENT_URL = "https://apiintdev.hmhs.com/AgentCubed/User/ext/FindFieldAgentsByServiceArea"; 28499 GET_USER_URL = "https://apiintdev.hmhs.com/AgentCubed/User/ext/GetUser"; 28500 GET_COUNTIES_URL = "https://apiqa.hmhs.com/cmcrst/zipCode/countyList"; 28501 GET_TASKS_URL = "https://apiintdev.hmhs.com/AgentCubed/Fulfillment/ext/GetTasks"; 28502 GET_AUTO_ASSIGNUSER = "https://apiintdev.hmhs.com/AgentCubed/User/ext/AddTaskAndAutoAssignUser"; 28503 GET_STORE_LOCATIONS_URL = "https://apiintdev.hmhs.com/AgentCubed/AddressInfo/ext/SearchStoreLocations"; 28504 GET_STORE_AVAILABILITY = "https://apiintdev.hmhs.com/AgentCubed/AddressInfo/ext/GetCalendarAvailability"; 28505 ADD_TASK = "https://apiintdev.hmhs.com/AgentCubed/User/ext/AddTask"; 28506 UPDATE_TASK = "https://apiintdev.hmhs.com/AgentCubed/User/ext/UpdateTask"; 28507 28508 //MBR API'S 28509 MBR_CANCEL_API = "https://apiwebqa.hmhs.com/dmxmbr/v1/ext/cancel-reservation"; 28510 MBR_GETEVENTS_API = "https://apiwebqa.hmhs.com/dmxmbr/v1/ext/get-events"; 28511 MBR_ADD_RESERVATION_API = "https://apiwebqa.hmhs.com/dmxmbr/v1/ext/add-reservation"; 28512 MBR_VALIDATE_MEMBER_API = "https://apiwebqa.hmhs.com/dmxmbr/v1/ext/validate-member-umi"; 28513 MBR_GET_RESERVATION_API = "https://apiwebqa.hmhs.com/dmxmbr/v1/ext/get-reservation"; 28514 28515 //PURL API'S
28516 PURL_ADD_CUSTOMER_API = "https://apidev.hmhs.com/dmxcdt/v1/ext/add-customer-data"; 28517 28518 //MEDICARE HRA QUIZ API'S 28519 ADD_CONTACT = "https://apidev.hmhs.com/health-risk-assessments/v1/ext/addContact"; 28520 ADD_QUIZ_ANSWERS = "https://apidev.hmhs.com/health-risk-assessments/v1/ext/addQuizAnswers"; 28521 28522 //ENVIRONMENT VARIABLES 28523 ENV = "tenv2"; 28524 ENVIRONMENT = "test"; 28525 28526 break; 28527 28528 case "https://newtenv1.highmark.com": 28529 case "https://aemtenv1.highmark.com": 28530 //THE URLS PLACED WITHIN THIS CASE ARE SPECIFIC TO THE TENV2 ENVIRONMENT 28531 28532 //These URLs are purposely pointing to the QA Environment 28533 POST_MEETANDGREET_SEMINARs_URL = "https://apiwebqa.hmhs.com/AgentCubed/Customer/ext/GetSeminars"; 28534 ADD_SEMINAR_CUSTOMER_URL = "https://apiwebqa.hmhs.com/AgentCubed/Customer/ext/AddSeminarCustomer"; 28535 GET_POSTALCODE_URL = "https://apiwebqa.hmhs.com/AgentCubed/AddressInfo/ext/GetZipPostalCodes"; 28536 GET_HEALTHSTORE_SEARCHLOCATIONS_URL = ""; 28537 CREATE_LEAD_URL = "https://apiwebqa.hmhs.com/AgentCubed/dmxcrl/v1/create-lead"; 28538 FIND_FIELD_AGENT_URL = "https://apiwebqa.hmhs.com/AgentCubed/User/ext/FindFieldAgentsByServiceArea"; 28539 GET_USER_URL = "https://apiwebqa.hmhs.com/AgentCubed/User/ext/GetUser"; 28540 GET_COUNTIES_URL = "https://apiqa.hmhs.com/cmcrst/zipCode/countyList"; 28541 GET_TASKS_URL = "https://apiwebqa.hmhs.com/AgentCubed/Fulfillment/ext/GetTasks"; 28542 GET_AUTO_ASSIGNUSER = "https://apiwebqa.hmhs.com/AgentCubed/User/ext/AddTaskAndAutoAssignUser"; 28543 GET_STORE_LOCATIONS_URL = "https://apiintdev.hmhs.com/AgentCubed/AddressInfo/ext/SearchStoreLocations"; 28544 GET_STORE_AVAILABILITY = "https://apiintdev.hmhs.com/AgentCubed/AddressInfo/ext/GetCalendarAvailability"; 28545 ADD_TASK = "https://apiintdev.hmhs.com/AgentCubed/User/ext/AddTask"; 28546 UPDATE_TASK = "https://apiintdev.hmhs.com/AgentCubed/User/ext/UpdateTask"; 28547 28548 //MBR API'S 28549 MBR_CANCEL_API = "https://apiwebqa.hmhs.com/dmxmbr/v1/ext/cancel-reservation"; 28550 MBR_GETEVENTS_API = "https://apiwebqa.hmhs.com/dmxmbr/v1/ext/get-events"; 28551 MBR_ADD_RESERVATION_API = "https://apiwebqa.hmhs.com/dmxmbr/v1/ext/add-reservation"; 28552 MBR_VALIDATE_MEMBER_API = "https://apiwebqa.hmhs.com/dmxmbr/v1/ext/validate-member-umi"; 28553 MBR_GET_RESERVATION_API = "https://apiwebqa.hmhs.com/dmxmbr/v1/ext/get-reservation"; 28554 28555 //PURL API'S 28556 PURL_ADD_CUSTOMER_API = "https://apidev.hmhs.com/dmxcdt/v1/ext/add-customer-data"; 28557 28558 //MEDICARE HRA QUIZ API'S 28559 ADD_CONTACT = "https://apidev.hmhs.com/health-risk-assessments/v1/ext/addContact"; 28560 ADD_QUIZ_ANSWERS = "https://apidev.hmhs.com/health-risk-assessments/v1/ext/addQuizAnswers"; 28561 28562 //ENVIRONMENT VARIABLES 28563 ENV = "tenv1"; 28564 ENVIRONMENT = "test"; 28565 28566 break; 28567 case "https://newtenv2.highmark.com": 28568 case "https://aemtenv2.highmark.com": 28569 case "http://lnbraemd01.highmark.com:4514": 28570 //THE URLS PLACED WITHIN THIS CASE ARE SPECIFIC TO THE TENV2 ENVIRONMENT 28571 28572 //These URLs are purposely pointing to the QA Environment 28573 POST_MEETANDGREET_SEMINARs_URL = "https://apiwebqa.hmhs.com/AgentCubed/Customer/ext/GetSeminars"; 28574 ADD_SEMINAR_CUSTOMER_URL = "https://apiwebqa.hmhs.com/AgentCubed/Customer/ext/AddSeminarCustomer"; 28575 GET_POSTALCODE_URL = "https://apiwebqa.hmhs.com/AgentCubed/AddressInfo/ext/GetZipPostalCodes"; 28576 GET_HEALTHSTORE_SEARCHLOCATIONS_URL = ""; 28577 CREATE_LEAD_URL = "https://apiwebqa.hmhs.com/AgentCubed/dmxcrl/v1/create-lead"; 28578 FIND_FIELD_AGENT_URL = "https://apiwebqa.hmhs.com/AgentCubed/User/ext/FindFieldAgentsByServiceArea"; 28579 GET_USER_URL = "https://apiwebqa.hmhs.com/AgentCubed/User/ext/GetUser"; 28580 GET_COUNTIES_URL = "https://apiqa.hmhs.com/cmcrst/zipCode/countyList"; 28581 GET_TASKS_URL = "https://apiwebqa.hmhs.com/AgentCubed/Fulfillment/ext/GetTasks"; 28582 GET_AUTO_ASSIGNUSER = "https://apiwebqa.hmhs.com/AgentCubed/User/ext/AddTaskAndAutoAssignUser"; 28583 GET_STORE_LOCATIONS_URL = "https://apiintdev.hmhs.com/AgentCubed/AddressInfo/ext/SearchStoreLocations";
28584 GET_STORE_AVAILABILITY = "https://apiintdev.hmhs.com/AgentCubed/AddressInfo/ext/GetCalendarAvailability"; 28585 ADD_TASK = "https://apiintdev.hmhs.com/AgentCubed/User/ext/AddTask"; 28586 UPDATE_TASK = "https://apiintdev.hmhs.com/AgentCubed/User/ext/UpdateTask"; 28587 28588 //MBR API'S 28589 MBR_CANCEL_API = "https://apiwebqa.hmhs.com/dmxmbr/v1/ext/cancel-reservation"; 28590 MBR_GETEVENTS_API = "https://apiwebqa.hmhs.com/dmxmbr/v1/ext/get-events"; 28591 MBR_ADD_RESERVATION_API = "https://apiwebqa.hmhs.com/dmxmbr/v1/ext/add-reservation"; 28592 MBR_VALIDATE_MEMBER_API = "https://apiwebqa.hmhs.com/dmxmbr/v1/ext/validate-member-umi"; 28593 MBR_GET_RESERVATION_API = "https://apiwebqa.hmhs.com/dmxmbr/v1/ext/get-reservation"; 28594 28595 //PURL API'S 28596 PURL_ADD_CUSTOMER_API = "https://apidev.hmhs.com/dmxcdt/v1/ext/add-customer-data"; 28597 28598 //MEDICARE HRA QUIZ API'S 28599 ADD_CONTACT = "https://apidev.hmhs.com/health-risk-assessments/v1/ext/addContact"; 28600 ADD_QUIZ_ANSWERS = "https://apidev.hmhs.com/health-risk-assessments/v1/ext/addQuizAnswers"; 28601 28602 //ENVIRONMENT VARIABLES 28603 ENV = "tenv2"; 28604 ENVIRONMENT = "test"; 28605 28606 break; 28607 case "https://aemtenv3.highmark.com": 28608 case "https://newtenv3.highmark.com": 28609 //THE URLS PLACED WITHIN THIS CASE ARE SPECIFIC TO THE TENV3 ENVIRONMENT 28610 28611 POST_MEETANDGREET_SEMINARs_URL = "https://apiwebqa.hmhs.com/AgentCubed/Customer/ext/GetSeminars"; 28612 ADD_SEMINAR_CUSTOMER_URL = "https://apiwebqa.hmhs.com/AgentCubed/Customer/ext/AddSeminarCustomer"; 28613 GET_POSTALCODE_URL = "https://apiwebqa.hmhs.com/AgentCubed/AddressInfo/ext/GetZipPostalCodes"; 28614 GET_HEALTHSTORE_SEARCHLOCATIONS_URL = ""; 28615 CREATE_LEAD_URL = "https://apiwebqa.hmhs.com/AgentCubed/dmxcrl/v1/create-lead"; 28616 FIND_FIELD_AGENT_URL = "https://apiwebqa.hmhs.com/AgentCubed/User/ext/FindFieldAgentsByServiceArea"; 28617 GET_USER_URL = "https://apiwebqa.hmhs.com/AgentCubed/User/ext/GetUser"; 28618 GET_COUNTIES_URL = "https://api.hmhs.com/cmcrst/zipCode/countyList"; 28619 GET_TASKS_URL = "https://apiwebqa.hmhs.com/AgentCubed/Fulfillment/ext/GetTasks"; 28620 GET_AUTO_ASSIGNUSER = "https://apiwebqa.hmhs.com/AgentCubed/User/ext/AddTaskAndAutoAssignUser"; 28621 GET_STORE_LOCATIONS_URL = "https://apiwebqa.hmhs.com/AgentCubed/AddressInfo/ext/SearchStoreLocations"; 28622 GET_STORE_AVAILABILITY = "https://apiwebqa.hmhs.com/AgentCubed/AddressInfo/ext/GetCalendarAvailability"; 28623 ADD_TASK = "https://apiwebqa.hmhs.com/AgentCubed/User/ext/AddTask"; 28624 UPDATE_TASK = "https://apiwebqa.hmhs.com/AgentCubed/User/ext/UpdateTask"; 28625 28626 //MBR API'S 28627 MBR_CANCEL_API = "https://apiwebqa.hmhs.com/dmxmbr/v1/ext/cancel-reservation"; 28628 MBR_GETEVENTS_API = "https://apiwebqa.hmhs.com/dmxmbr/v1/ext/get-events"; 28629 MBR_ADD_RESERVATION_API = "https://apiwebqa.hmhs.com/dmxmbr/v1/ext/add-reservation"; 28630 MBR_VALIDATE_MEMBER_API = "https://apiwebqa.hmhs.com/dmxmbr/v1/ext/validate-member-umi"; 28631 MBR_GET_RESERVATION_API = "https://apiwebqa.hmhs.com/dmxmbr/v1/ext/get-reservation"; 28632 28633 //PURL API'S 28634 PURL_ADD_CUSTOMER_API = "https://apiwebqa.hmhs.com/dmxcdt/v1/ext/add-customer-data"; 28635 28636 //MEDICARE HRA QUIZ API'S 28637 ADD_CONTACT = "https://apiqa.hmhs.com/health-risk-assessments/v1/ext/addContact"; 28638 ADD_QUIZ_ANSWERS = "https://apiqa.hmhs.com/health-risk-assessments/v1/ext/addQuizAnswers"; 28639 28640 //ENVIRONMENT VARIABLES 28641 ENV = "tenv3"; 28642 ENVIRONMENT = "test"; 28643 28644 case "https://aemtenvb.highmark.com": 28645 case "https://newtenvb.highmark.com": 28646 //THE URLS PLACED WITHIN THIS CASE ARE SPECIFIC TO THE TENV3 ENVIRONMENT 28647 28648 POST_MEETANDGREET_SEMINARs_URL = "https://apiwebqa.hmhs.com/AgentCubed/Customer/ext/GetSeminars"; 28649 ADD_SEMINAR_CUSTOMER_URL = "https://apiwebqa.hmhs.com/AgentCubed/Customer/ext/AddSeminarCustomer"; 28650 GET_POSTALCODE_URL = "https://apiwebqa.hmhs.com/AgentCubed/AddressInfo/ext/GetZipPostalCodes"; 28651 GET_HEALTHSTORE_SEARCHLOCATIONS_URL = ""; 28652 CREATE_LEAD_URL = "https://apiwebqa.hmhs.com/AgentCubed/dmxcrl/v1/create-lead"; 28653 FIND_FIELD_AGENT_URL = "https://apiwebqa.hmhs.com/AgentCubed/User/ext/FindFieldAgentsByServiceArea"; 28654 GET_USER_URL = "https://apiwebqa.hmhs.com/AgentCubed/User/ext/GetUser"; 28655 GET_COUNTIES_URL = "https://apiqa.hmhs.com/cmcrst/zipCode/countyList"; 28656 GET_TASKS_URL = "https://apiwebqa.hmhs.com/AgentCubed/Fulfillment/ext/GetTasks"; 28657 GET_AUTO_ASSIGNUSER = "https://apiwebqa.hmhs.com/AgentCubed/User/ext/AddTaskAndAutoAssignUser";
28658 GET_STORE_LOCATIONS_URL = "https://apiwebqa.hmhs.com/AgentCubed/AddressInfo/ext/SearchStoreLocations"; 28659 GET_STORE_AVAILABILITY = "https://apiwebqa.hmhs.com/AgentCubed/AddressInfo/ext/GetCalendarAvailability"; 28660 ADD_TASK = "https://apiwebqa.hmhs.com/AgentCubed/User/ext/AddTask"; 28661 UPDATE_TASK = "https://apiwebqa.hmhs.com/AgentCubed/User/ext/UpdateTask"; 28662 28663 //MBR API'S 28664 MBR_CANCEL_API = "https://apiwebqa.hmhs.com/dmxmbr/v1/ext/cancel-reservation"; 28665 MBR_GETEVENTS_API = "https://apiwebqa.hmhs.com/dmxmbr/v1/ext/get-events"; 28666 MBR_ADD_RESERVATION_API = "https://apiwebqa.hmhs.com/dmxmbr/v1/ext/add-reservation"; 28667 MBR_VALIDATE_MEMBER_API = "https://apiwebqa.hmhs.com/dmxmbr/v1/ext/validate-member-umi"; 28668 MBR_GET_RESERVATION_API = "https://apiwebqa.hmhs.com/dmxmbr/v1/ext/get-reservation"; 28669 28670 //PURL API'S 28671 PURL_ADD_CUSTOMER_API = "https://apiwebqa.hmhs.com/dmxcdt/v1/ext/add-customer-data"; 28672 28673 //MEDICARE HRA QUIZ API'S 28674 ADD_CONTACT = "https://apiqa.hmhs.com/health-risk-assessments/v1/ext/addContact"; 28675 ADD_QUIZ_ANSWERS = "https://apiqa.hmhs.com/health-risk-assessments/v1/ext/addQuizAnswers"; 28676 28677 //ENVIRONMENT VARIABLES 28678 ENV = "tenvb"; 28679 ENVIRONMENT = "test"; 28680 28681 break; 28682 case "https://new.highmark.com": 28683 case "https://aem.highmark.com": 28684 case "https://highmark.com": 28685 case "https://www.highmark.com": 28686 //THE URLS PLACED WITHIN THIS CASE ARE SPECIFIC TO THE PRODUCTION ENVIRONMENT 28687 28688 POST_MEETANDGREET_SEMINARs_URL = "https://apiweb.hmhs.com/AgentCubed/Customer/ext/GetSeminars"; 28689 ADD_SEMINAR_CUSTOMER_URL = "https://apiweb.hmhs.com/AgentCubed/Customer/ext/AddSeminarCustomer"; 28690 GET_POSTALCODE_URL = "https://apiweb.hmhs.com/AgentCubed/AddressInfo/ext/GetZipPostalCodes"; 28691 GET_HEALTHSTORE_SEARCHLOCATIONS_URL = ""; 28692 CREATE_LEAD_URL = "https://apiweb.hmhs.com/AgentCubed/dmxcrl/v1/create-lead"; 28693 FIND_FIELD_AGENT_URL = "https://apiweb.hmhs.com/AgentCubed/User/ext/FindFieldAgentsByServiceArea"; 28694 GET_USER_URL = "https://apiweb.hmhs.com/AgentCubed/User/ext/GetUser"; 28695 GET_COUNTIES_URL = "https://api.hmhs.com/cmcrst/zipCode/countyList"; 28696 GET_TASKS_URL = "https://apiweb.hmhs.com/AgentCubed/Fulfillment/ext/GetTasks"; 28697 GET_AUTO_ASSIGNUSER = "https://apiweb.hmhs.com/AgentCubed/User/ext/AddTaskAndAutoAssignUser"; 28698 GET_STORE_LOCATIONS_URL = "https://apiweb.hmhs.com/AgentCubed/AddressInfo/ext/SearchStoreLocations"; 28699 GET_STORE_AVAILABILITY = "https://apiweb.hmhs.com/AgentCubed/AddressInfo/ext/GetCalendarAvailability"; 28700 ADD_TASK = "https://apiweb.hmhs.com/AgentCubed/User/ext/AddTask"; 28701 UPDATE_TASK = "https://apiweb.hmhs.com/AgentCubed/User/ext/UpdateTask"; 28702 28703 //MBR API'S 28704 MBR_CANCEL_API = "https://apiweb.hmhs.com/dmxmbr/v1/ext/cancel-reservation"; 28705 MBR_GETEVENTS_API = "https://apiweb.hmhs.com/dmxmbr/v1/ext/get-events"; 28706 MBR_ADD_RESERVATION_API = "https://apiweb.hmhs.com/dmxmbr/v1/ext/add-reservation"; 28707 MBR_VALIDATE_MEMBER_API = "https://apiweb.hmhs.com/dmxmbr/v1/ext/validate-member-umi"; 28708 MBR_GET_RESERVATION_API = "https://apiweb.hmhs.com/dmxmbr/v1/ext/get-reservation"; 28709 28710 //PURL API'S 28711 PURL_ADD_CUSTOMER_API = "https://apiweb.hmhs.com/dmxcdt/v1/ext/add-customer-data"; 28712 28713 //MEDICARE HRA QUIZ API'S 28714 ADD_CONTACT = "https://api.hmhs.com/health-risk-assessments/v1/ext/addContact"; 28715 ADD_QUIZ_ANSWERS = "https://api.hmhs.com/health-risk-assessments/v1/ext/addQuizAnswers"; 28716 28717 //ENVIRONMENT VARIABLES 28718 ENV = ""; 28719 ENVIRONMENT = "prod"; 28720 28721 break; 28722 } 28723 28724} 28725 28726function setCookie(cname, cvalue, exdays) { 28727 var d = new Date(); 28728 //d.setTime(d.getTime() + 3600 * 1000); 28729 d.setDate(d.getDate() * 12); 28730 var expires = 'expires=' + d.toUTCString(); 28731 document.cookie = cname + '=' + cvalue + '; ' + expires + '; path=/'; 28732 console.log("after set cookie:", document.cookie); 28733} 28734 28735 28736 28737 28738function getCookie(name) { 28739 var re = new RegExp(name + '=([^;]+)'); 28740 var value = re.exec(document.cookie); 28741 return value !== null ? unescape(value[1]) : null; 28742} 28743 28744function deleteCookie(cname) { 28745 document.cookie = cname + '=;' + 'expires= 01 Jan 1970; path=/;'; 28746 console.log("after deleting cookie:", document.cookie); 28747} 28748 28749var leadSourceKey = ""; 28750var groupWebLeadId = ""; 28751var hmhskeyId = ""; 28752var xapikey = ""; 28753var offercodeArray=[]; 28754var new_leadSourceKey;
28755var agent_code =""; 28756 28757var countyListKey = "836d554d-0f86-4972-b838-93729c4dd692"; 28758var countyListToken = "MSwzLDcsMTg=" 28759 28760//funtion to fetch Lead Source key based on offer code 28761 function getLSKbyOffercode(code) { 28762 offercodeArray = getLeadSourceKey(); 28763 return offercodeArray.filter( 28764 function(offercodeArray){ return offercodeArray.offer_code == code } 28765 ); 28766} 28767 28768function GetQueryStringParams(sParam) { 28769 var sPageURL = window.location.search.substring(1); 28770   var sURLVariables = sPageURL.split('&'); 28771   for (var i = 0; i < sURLVariables.length; i++) { 28772       var sParameterName = sURLVariables[i].split('='); 28773       if (sParameterName[0] == sParam) { 28774           return sParameterName[1]; 28775       } 28776   } 28777} 28778//This is the place where ALL API declaration should happen 28779function setLeadSourceKey(confirmationType) { 28780 28781 var urlOffercode = GetQueryStringParams('offercode'); 28782 if((confirmationType !== "aca-preSeason-oep") && (confirmationType !== "aca-preSeason-social") && (confirmationType !== "aca-preSeason-search")){ 28783 if(urlOffercode) 28784 { 28785 setCookie("urlOffercode", urlOffercode,1); 28786 if(getLSKbyOffercode(urlOffercode)[0]) //assign LSK only if offer code is valid 28787 { 28788 new_leadSourceKey=getLSKbyOffercode(urlOffercode)[0].Lead_Source_Key; 28789 } 28790 } 28791 } 28792 28793 28794 switch(window.location.origin){ 28795 case "http://localhost:4502": 28796 case "https://newtenv1.highmark.com": 28797 case "https://newtenv2.highmark.com": 28798 case "https://newtenv3.highmark.com": 28799 case "https://newtenvb.highmark.com": 28800 case "https://aemtenv1.highmark.com": 28801 case "https://aemtenv2.highmark.com": 28802 case "https://aemtenv3.highmark.com": 28803 case "https://aemtenvb.highmark.com": 28804 case "http://lnbraemd01.highmark.com:4514": 28805 28806 if((confirmationType !== "aca-preSeason-oep") && (confirmationType !== "aca-preSeason-social") && (confirmationType !== "aca-preSeason-search")){ 28807 if((urlOffercode || getCookie("urlOffercode")) && (getLSKbyOffercode(getCookie("urlOffercode"))[0])) 28808 { 28809 if(getCookie("urlOffercode")) 28810 { 28811 //assign LSK only if offer code is valid 28812 new_leadSourceKey=getLSKbyOffercode(getCookie("urlOffercode"))[0].Lead_Source_Key; 28813 leadSourceKey=new_leadSourceKey; 28814 } 28815 28816 } 28817 } 28818 if(confirmationType == '' && sessionStorage.getItem("aca-eventType") == "Phone"){ 28819 agent_code = [ 28820 { 28821 "agent_ID": "7d671ebf-7886-4cbe-9eef-7a93734d590c", 28822 28823 }, 28824 { 28825 "agent_ID": "2664a7f4-a2ee-44a7-a2dd-d638c0637bd0", 28826 }, 28827 ]; 28828 } 28829 else 28830 { 28831 28832 switch(confirmationType){ 28833 case "medicare-advisor": 28834 case "hmk-medicareadvisor-callback": 28835 leadSourceKey = "cd2a8007-0cf4-40f1-8e69-60d908e683b9"; 28836 break; 28837 case "face-face": 28838 case "hmk-facetoface-callback": 28839 leadSourceKey = "35b7a6b2-8db5-4df3-9e78-7d987feea20e"; 28840 break; 28841 case "meet-and-greet": 28842 case "hmk-meetandgreet-callback": 28843 leadSourceKey = "f608c2ca-7c61-4365-92ea-9ef815a8feb2"; 28844 break; 28845 case "medicare-options-seminar": 28846 case "hmk-seminaroptions-callback": 28847 leadSourceKey = "e8265890-7c0c-417b-a822-717a832c337c"; 28848 break; 28849 case "visit-store": 28850 case "hmk-visitstore-callback": 28851 leadSourceKey = "3363018f-2a74-4949-ac17-060d58cdd2c5"; 28852 break; 28853 case "hmk-reservehome-callback": 28854 leadSourceKey = "e81969fc-8334-44ef-ab81-d739edb27799"; 28855 break; 28856 case "hmk-directstoretiles-callback": 28857 leadSourceKey = "d90bea7e-5eca-42bd-a36d-79bd2b180d50"; 28858 break;
28859 case "meet-and-greet-webinar": 28860 leadSourceKey = "5374d3cd-b579-4091-8d5f-ba5bc7c9339b"; 28861 break; 28862 case "medicare-open-house-inPerson": 28863 leadSourceKey = "2910072d-5822-4b7e-98fb-b744115f0f2a"; 28864 break; 28865 case "medicare-options-webinar": 28866 leadSourceKey = "e8265890-7c0c-417b-a822-717a832c337c"; 28867 break; 28868 case "aca-inPerson": 28869 leadSourceKey = "5099c08e-6751-4189-92ec-76f730ace380"; 28870 break; 28871 case "aca-virtual": 28872 leadSourceKey = "dce91ea8-6441-4b01-9ad5-37f3468a3ed9"; 28873 break; 28874 case "aca-phone": 28875 leadSourceKey = "74e7d0ba-ff68-433c-9c51-6800fa5ac6f2"; 28876 break; 28877 case "aca-preSeason-oep": 28878 leadSourceKey = "71fd7223-3ce4-426b-8d45-54ca743f7031"; 28879 break; 28880 case "aca-preSeason-social": 28881 leadSourceKey = "f66e6891-e7e8-467d-b563-c925cc8da525"; 28882 break; 28883 case "aca-preSeason-search": 28884 leadSourceKey = "1dfaa507-c1eb-4a77-8a5e-27782fdb1196"; 28885 break; 28886 28887 } 28888 } 28889 groupWebLeadId = "457489"; 28890 if(window.location.origin.indexOf("tenv3") != -1) { 28891 hmhskeyId = "d90bea7e-5eca-42bd-a36d-79bd2b180d50"; 28892 } else { 28893 hmhskeyId = "d90bea7e-5eca-42bd-a36d-79bd2b180d50"; 28894 } 28895 xapikey = "AIzaSyD9eT-VBvQks0rrUiHIYvIgkV8KrknuMSA"; 28896 28897 return { 28898 leadSourceKey: leadSourceKey, 28899 groupWebLeadId: groupWebLeadId, 28900 hmhskeyId: hmhskeyId, 28901 xapikey: xapikey, 28902 agent_code : agent_code, 28903 }; 28904 break; 28905 case "https://new.highmark.com": 28906 case "https://aem.highmark.com": 28907 case "https://highmark.com": 28908 case "https://www.highmark.com": 28909 28910 if((confirmationType !== "aca-preSeason-oep") && (confirmationType !== "aca-preSeason-social") && (confirmationType !== "aca-preSeason-search")){ 28911 if((urlOffercode || getCookie("urlOffercode")) && (getLSKbyOffercode(getCookie("urlOffercode"))[0])) 28912 { 28913 if(getCookie("urlOffercode")) 28914 { 28915 new_leadSourceKey=getLSKbyOffercode(getCookie("urlOffercode"))[0].Lead_Source_Key; 28916 leadSourceKey=new_leadSourceKey; 28917 } 28918 28919 } 28920 } 28921 if(confirmationType == '' && sessionStorage.getItem("aca-eventType") == "Phone"){ 28922 agent_code = [ 28923 { 28924 "agent_ID": "48cba096-b29e-4d3c-8a59-c69412d3d19d", 28925 }, 28926 { 28927 "agent_ID": "3c7866ad-0c06-428f-a39e-692762b28f67", 28928 }, 28929 ]; 28930 } 28931 else 28932 { 28933 28934 28935 //This is for Production environment only 28936 switch(confirmationType){ 28937 case "medicare-advisor": 28938 case "hmk-medicareadvisor-callback": 28939 leadSourceKey = "2a507e05-8244-4af2-b0ca-34fe270a403e"; 28940 break; 28941 case "face-face": 28942 case "hmk-facetoface-callback": 28943 leadSourceKey = "d340fcba-2141-414c-8196-22266ba87ada"; 28944 break; 28945 case "meet-and-greet": 28946 case "hmk-meetandgreet-callback": 28947 leadSourceKey = "b119ee93-3b8c-4556-aa5c-7921813779fc"; 28948 break; 28949 case "medicare-options-seminar": 28950 case "hmk-seminaroptions-callback": 28951 leadSourceKey = "6de87c2a-9759-486a-82ea-846229a8f263"; 28952 break; 28953 case "visit-store": 28954 case "hmk-visitstore-callback": 28955 leadSourceKey = "1a56b1f0-1d16-4cff-a548-725199874b5c"; 28956 break; 28957 case "hmk-reservehome-callback":
28958 leadSourceKey = "558a1866-26a9-4158-b63d-926bde11771c"; 28959 break; 28960 case "hmk-directstoretiles-callback": 28961 leadSourceKey = "d90bea7e-5eca-42bd-a36d-79bd2b180d50"; 28962 break; 28963 case "meet-and-greet-webinar": 28964 leadSourceKey = "16100db5-1133-4222-9eaa-0805ab0e1805"; 28965 break; 28966 case "medicare-options-webinar": 28967 leadSourceKey = "ac6860a6-111c-4810-a418-0a505525a20c"; 28968 break; 28969 case "medicare-open-house-inPerson": 28970 leadSourceKey = "5c64dbea-0353-4a67-ab08-3cf322baf92b"; 28971 break; 28972 case "medicare-options-webinar": 28973 leadSourceKey = "ac6860a6-111c-4810-a418-0a505525a20c"; 28974 break; 28975 case "aca-inPerson": 28976 leadSourceKey = "4c084720-f8ef-43cf-b95a-015fe9a2ee9b"; 28977 break; 28978 case "aca-virtual": 28979 leadSourceKey = "b57cde63-dbd8-4f13-b306-f19668cfaabc"; 28980 break; 28981 case "aca-phone": 28982 leadSourceKey = "ad9e7a93-9ca1-416b-b527-52ee3a512886"; 28983 break; 28984 case "aca-preSeason-oep": 28985 leadSourceKey = "de9c9578-7c6e-4823-90af-6c4009d113ff"; 28986 break; 28987 case "aca-preSeason-social": 28988 leadSourceKey = "755182f5-79d3-4318-8484-fb3296552e02"; 28989 break; 28990 case "aca-preSeason-search": 28991 leadSourceKey = "70275be5-2c28-41fe-845b-708adcd074e1"; 28992 break; 28993 } 28994 } 28995 groupWebLeadId = "835552"; 28996 hmhskeyId = "d90bea7e-5eca-42bd-a36d-79bd2b180d50"; 28997 xapikey = ""; 28998 return { 28999 leadSourceKey: leadSourceKey, 29000 groupWebLeadId: groupWebLeadId, 29001 hmhskeyId: hmhskeyId, 29002 xapikey: xapikey, 29003 agent_code : agent_code, 29004 }; 29005 break; 29006 } 29007} 29008 29009/** 29010 * This file will check to see if the webpage has a userZIP cookie. 29011 * If it does, the "My Location" link in the header bar and in the mobile 29012 * navigation will change to the zip code that is cookied. If the user updates 29013 * their location, the link will change to the updated zip code. If the 29014 * cookie is not present at all, the link will remain "My Location". 29015 */ 29016 29017$(document).ready(function () { 29018 userZipCookie = getCookie("userZIP"); 29019 29020 if (userZipCookie) { 29021 $(".newheaderbar #mylocation").html(userZipCookie); 29022 $(".mobilenavigation #mylocation-mobile").html(userZipCookie); 29023 $(".empmobilenav #mylocation").html(userZipCookie); 29024 //.newmobilenav does not have a location. 29025 } 29026}); 29027/** 29028 * This file will check to see if a link was clicked, if said link has a href value and 29029 * if the current page is part of the Highmark Wholecare site / a Beahavioral Health 29030 * page. If the page is part of either of those categories and the href contains an 29031 * external link, an alert will display to the user to let them know they will be navigating 29032 * to a third party website. 29033 */ 29034 29035$(document).ready(function () { 29036 $(document).on('click', 'a', function () { 29037 if ($(this).attr("href")) { 29038 var linkCheck = $(this).attr("href").toLowerCase(); 29039 29040 //the current page is part of the highmark wholecare site 29041 if (window.location.href.indexOf('highmark.com/wholecare') > -1) { 29042 var message = "You are now leaving the Highmark Wholecare® website for another website. If you do not wish to do this, choose \"Cancel\"."; 29043 29044 //http exists in the href, but highmark.com, /wholecare, gateway, .pdf and download? don't 29045 if (linkCheck.indexOf('http') > -1 && (linkCheck.indexOf('highmark') < 0 && linkCheck.indexOf('/wholecare') < 0 && linkCheck.indexOf('gateway') < 0 && linkCheck.indexOf('.pdf') < 0 && linkCheck.indexOf('download?') < 0)) { 29046 if (confirm(message)) { 29047 return true; 29048 } else { 29049 return false;
29050 } 29051 } 29052 }else 29053 29054 //the current page is part of the behavioral health site 29055 if (window.location.href.indexOf('highmark.com/resources/mental-health-services') > -1) { 29056 var message = "The above link will bring you to a third-party website, owned and operated by an independent party over which Highmark Health has no control. Any use of the third-party website and any information you provide will be subject to and governed by the terms of the third-party website, including those relating to confidentiality, data privacy and security."; 29057 29058 //http exists in the href, but highmark.com, /resources/mental-health-services, gateway, .pdf and download? don't 29059 if (linkCheck.indexOf('http') > -1 && (linkCheck.indexOf('highmark') < 0 && linkCheck.indexOf('/resources/mental-health-services') < 0 && linkCheck.indexOf('gateway') < 0 && linkCheck.indexOf('.pdf') < 0 && linkCheck.indexOf('download?') < 0)) { 29060 if (confirm(message)) { 29061 return true; 29062 } else { 29063 return false; 29064 } 29065 } 29066 } else 29067 29068 //the current page is part of highmark.com or one of its sub-domains or you are testing locally 29069 if (window.location.href.indexOf('highmark.com') > -1 || window.location.href.indexOf('localhost:')) { 29070 var message = "The above link will bring you to a third-party website, owned and operated by an independent party over which Highmark Health has no control. Any use of the third-party website and any information you provide will be subject to and governed by the terms of the third-party website, including those relating to confidentiality, data privacy and security."; 29071 29072 29073 //http exists in the href, but highmark.com, /wholecare, gateway, .pdf and download? don't 29074 if (linkCheck.indexOf('http') > -1 29075 29076 //exceptions that will not display the alert 29077 && (linkCheck.indexOf('highmark.com') < 0 29078 && linkCheck.indexOf('gateway') < 0 29079 && linkCheck.indexOf('.pdf') < 0 29080 && linkCheck.indexOf('download?') < 0 29081 && linkCheck.indexOf("hmw.healthtrioconnect.com") < 0 29082 && linkCheck.indexOf("hhode.healthtrioconnect.com") < 0 29083 && linkCheck.indexOf("myhighmark.com") < 0 29084 && linkCheck.indexOf("highmarkhealth.org") < 0 29085 && linkCheck.indexOf("highmarkprc.com") < 0 29086 && linkCheck.indexOf("highmarkdirect.com") < 0 29087 && linkCheck.indexOf("highmark.healthsherpa.com") < 0 29088 && linkCheck.indexOf("highmarkhealthoptions.com") < 0) 29089 ) { 29090 if (confirm(message)) { 29091 return true; 29092 } else { 29093 return false; 29094 } 29095 } 29096 } 29097 } 29098 }); 29099}); 29100(function ($) { 29101 29102 var limit = 10; 29103 29104 $('#site-search-input').focusin(function () { 29105 $('#site-search-input').attr('placeholder', 'Search'); 29106 $('#site-search-icon').addClass('site-search-icon-focus'); 29107 $('.site-search-icon').removeClass('site-search-icon'); 29108 var searchTerm = $('#site-search-input').val(); 29109 if (searchTerm === undefined || searchTerm === "") { 29110 $('#clear-icon').addClass('clear-icon'); 29111 $('#clear-icon').removeClass('clear-icon-focus'); 29112 } else { 29113 $('#clear-icon').addClass('clear-icon-focus'); 29114 $('#clear-icon').removeClass('clear-icon'); 29115 } 29116 return false; 29117 }); 29118 29119 $('#site-search-container').focusout(function () { 29120 var searchTerm = $('#site-search-input').val(); 29121 if (searchTerm === undefined || searchTerm === "") { 29122 $('#site-search-input').removeClass('site-search-input-focus'); 29123 $('#site-search-input').attr('placeholder', ''); 29124 $('.site-search-icon-focus').addClass('site-search-icon'); 29125 $('#clear-icon').addClass('clear-icon'); 29126 $('.site-search-icon-focus').removeClass('site-search-icon-focus'); 29127 $('#clear-icon').removeClass('clear-icon-focus'); 29128 } else { 29129 window.setTimeout(function () { 29130 $('#site-search-input').addClass('site-search-input-focus'); 29131 $('#clear-icon').addClass('clear-icon-focus'); 29132 $('#clear-icon').removeClass('clear-icon'); 29133 }, 50); 29134 } 29135 return false;
29136 }); 29137 29138 $('#site-search-input').on('input', function () { 29139 var searchTerm = $('#site-search-input').val(); 29140 if (searchTerm === undefined || searchTerm === "") { 29141 $('#clear-icon').addClass('clear-icon'); 29142 $('#clear-icon').removeClass('clear-icon-focus'); 29143 } else { 29144 $('#clear-icon').addClass('clear-icon-focus'); 29145 $('#clear-icon').removeClass('clear-icon'); 29146 } 29147 return false; 29148 }); 29149 29150 $('#clear-icon').on('click', function (e) { 29151 startSearching(); 29152 }); 29153 29154 $('#site-search-input').on('keypress', function (e) { 29155 if (e.which === 13) { 29156 e.preventDefault(); 29157 //Disable textbox to prevent multiple submit 29158 startSearching(); 29159 } 29160 }); 29161 29162 function startSearching() { 29163 $('#site-search-input').attr("disabled", "disabled"); 29164 var searchTerm = $('#site-search-input').val(); 29165 var currentURL = window.location.href; 29166 29167 if (!(searchTerm === undefined || searchTerm === "")) { 29168 29169 if (currentURL.includes("/employer")) { 29170 if (getAEMmode == null) { 29171 window.location = window.location.origin + "/employer/search?searchTerm=" + searchTerm + "&start=10"; 29172 29173 } else { 29174 window.location = window.location.origin + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/search.html?searchTerm=" + searchTerm + "&start=10"; 29175 } 29176 } 29177 else if (currentURL.includes("/wholecare")) { 29178 if (getAEMmode == null) { 29179 window.location = window.location.origin + "/wholecare/search?searchTerm=" + searchTerm + "&start=10"; 29180 29181 } else { 29182 window.location = window.location.origin + "/content/digital-marketing/en/highmark/highmarkdotcom/home/wholecare/search.html?searchTerm=" + searchTerm + "&start=10"; 29183 } 29184 } 29185 else { 29186 if (getAEMmode == null) { 29187 window.location = window.location.origin + "/search?searchTerm=" + searchTerm + "&start=10"; 29188 29189 } else { 29190 window.location = window.location.origin + "/content/digital-marketing/en/highmark/highmarkdotcom/home/search.html?searchTerm=" + searchTerm + "&start=10"; 29191 } 29192 } 29193 29194 } 29195 //Enable the textbox again if needed. 29196 $('#site-search-input').removeAttr("disabled"); 29197 } 29198})(jQuery); 29199 29200/** All custom form validations and submission logic 29201 */ 29202 29203/* UtsUtil is defined later in this same dmxhmk.global bundle (utility-for-uts-parameter.js). 29204 * This file is not wrapped in an IIFE, so a local `UtsUtil` declaration here would sit in the 29205 * global lexical scope and shadow the real window.UtsUtil for every script on the page. 29206 * Route the spinner calls through these helpers instead: they resolve window.UtsUtil per call 29207 * and fall back to toggling the overlay directly, so a partially loaded bundle can never leave 29208 * the spinner stuck on top of the form. */ 29209function hmkShowSpinner($el) { 29210 if (window.UtsUtil && typeof window.UtsUtil.showSpinner === "function") { 29211 window.UtsUtil.showSpinner($el); 29212 return; 29213 } 29214 $el.find(".global__spinner").addClass("is-active").attr("aria-hidden", "false"); 29215} 29216 29217function hmkHideSpinner($el) { 29218 if (window.UtsUtil && typeof window.UtsUtil.hideSpinner === "function") { 29219 window.UtsUtil.hideSpinner($el); 29220 return; 29221 } 29222 $el.find(".global__spinner").removeClass("is-active").attr("aria-hidden", "true"); 29223} 29224 29225/**(function(window, $, document) { **/ 29226$(document).ready(function () { 29227 29228 if (document.getElementById("employerform")) { 29229 document.getElementById("employerform").reset(); 29230 } 29231 29232 /*setTimeout(formGaId, 5000);*/ 29233 29234 checkBoxValidation(); 29235 window._DataToPostMedicareForm = new FormDataObject(); 29236 //checkIfFormIsSubmitted(); 29237 29238 if ($('#phone').length > 0) 29239 $('#phone').inputmask({ "mask": "(999) 999-9999" }); 29240 29241 if ($('#employerform .floating-input.datepicker').length > 0) { 29242 $('#employerform .floating-input.datepicker').datepicker({ 29243 minDate: new Date(), 29244 format: 'mm/dd/yyyy', 29245 onOpen: function (e) { 29246 var that = this; 29247 that.hasEvent = false;
29248 } 29249 }); 29250 } 29251 29252 if (document.getElementById('UTM_Campaign_Value__c')) { 29253 29254 if (window.location.href && window.location.href.split('?') && 29255 window.location.href.split('?')[1]) { 29256 var params = window.location.href.split('?')[1].split('&'); 29257 if (params) { 29258 var utm_value = params.filter(function (each) { return each.includes('utm_campaign') }); 29259 if (utm_value && utm_value.length > 0 && utm_value[0]) utm_value = utm_value[0]; 29260 else utm_value = null; 29261 if (utm_value && utm_value.split('=') && utm_value.split('=')[1]) 29262 document.getElementById('UTM_Campaign_Value__c').value = utm_value.split('=')[1]; 29263 } 29264 } 29265 } 29266 29267 29268 if (document.getElementById('lead_source')) { 29269 29270 var uri = window.location.toString(); 29271 29272 if (uri.indexOf("?") > 0) { 29273 var clean_uri = uri.substring(0, uri.indexOf("?")); 29274 $('#lead_source').attr('value', clean_uri); 29275 } 29276 else { 29277 $('#lead_source').attr('value', window.location.href); 29278 } 29279 } 29280 29281}) 29282 29283function validateForm(form, event) { 29284 /* var response = grecaptcha.getResponse(); 29285 if(response==null || response=="") 29286 { 29287 $("#captcha-error").css("display","block"); 29288 return false; 29289 } 29290 else 29291 { 29292 }*/ 29293 if (form.noValidate) { 29294 event.preventDefault(); 29295 $('.error-constraint').hide(); 29296 toggleValidation(form); 29297 } else { 29298 return; 29299 } 29300} 29301/** 29302toggle validation state 29303 */ 29304 29305function formReset(formObj, event) { 29306 formObj.form.reset(); 29307 grecaptcha.reset(); 29308 $('.error-constraint').hide(); 29309 $('.error-custom').hide(); 29310 $('.error-pattern').hide(); 29311 $('.error-maxlength').hide(); 29312} 29313 29314/*function formGaId() { 29315 if (document.getElementById('GA_Client_ID_c__c')) { 29316 document.getElementById('GA_Client_ID_c__c').value = getCookie("_ga"); 29317 } 29318}*/ 29319 29320function toggleValidation(form) { 29321 var emailValue; 29322 var _formElementsToValidate = []; 29323 _formElementsToValidate.push($(form).find('input,textarea,select').filter('[required]:visible,:checked,input')); 29324 29325 29326 if (!form.checkValidity()) { 29327 $.each(_formElementsToValidate[0], function (index, value) { 29328 29329 if (this.type == "radio" && this.validationMessage !== "") { 29330 var errorMessage = $(this).parent().parent().children(".error-constraint"); 29331 ($(errorMessage).text().trim().length > 0 ? $(errorMessage).show() : $(errorMessage).html(this.validationMessage).show()); 29332 scrollToView(this); 29333 return false; 29334 } else if (this.type == "radio" && this.validationMessage == "") { 29335 $(this).parent().parent().children(".error-constraint").hide(); 29336 } else if (this.type == "checkbox" && this.validationMessage !== "") { 29337 var errorMessage = $(this).parent().parent().children(".error-constraint"); 29338 ($(errorMessage).text().trim().length > 0 ? $(errorMessage).show() : $(errorMessage).html(this.validationMessage).show()); 29339 scrollToView(this); 29340 return false; 29341 } else if (this.type == "checkbox" && this.validationMessage == "") { 29342 $(this).parent().parent().children(".error-constraint").hide(); 29343 } else if (this.type == "email" && this.value == "") { 29344 var errorMessage = $(this).parent().children(".error-constraint"); 29345 if ($(errorMessage)) { 29346 $(errorMessage).html(this.validationMessage).show(); 29347 scrollToView(this); 29348 } 29349 return false; 29350 } else if (this.validity.valid == false) { 29351 var errorMessage = $(this).parent().children(".error-constraint"); 29352 var constraintMessage = $(this).parent().parent(); 29353 $(this).parent().addClass('floating-error'); 29354 $(this).parent().children(".required-field").hide(); 29355 29356 if (this.validity.valueMissing == true) { 29357 29358 $(errorMessage).html(this.validationMessage).show() 29359 29360 } 29361 else { 29362 29363 ($(constraintMessage).attr('data-cmp-constraint-message') ? $(errorMessage).html($(constraintMessage).attr('data-cmp-constraint-message')).show() : $(errorMessage).html(this.validationMessage).show()); 29364 } 29365 scrollToView(this); 29366 return false;
29367 } else { 29368 $(this).parent().children(".error-constraint").hide(); 29369 $(this).parent().removeClass('floating-error'); 29370 $(this).parent().children(".required-field").show(); 29371 } 29372 29373 }); 29374 } else { // if valid, turn off all validation messages 29375 var emailValue; 29376 var confirmError = false; 29377 var validations = []; 29378 validations.push($(form).find('input').filter('input[type=email]')); 29379 $.each(validations[0], function (index, value) { 29380 if (this.type === "email") { 29381 if (this.id.indexOf("confirm") !== -1) { 29382 if (this.value === emailValue) { 29383 return true; 29384 } else { 29385 var errorMessage = $(this).parent().children(".error-constraint"); 29386 var constraintMessage = $(this).parent().parent(); 29387 ($(constraintMessage).attr('data-cmp-constraint-message') ? $(errorMessage).html($(constraintMessage).attr('data-cmp-constraint-message')).show() : $(errorMessage).show()); 29388 confirmError = true; 29389 return false; 29390 } 29391 } else { 29392 emailValue = this.value; 29393 } 29394 } 29395 }); 29396 29397 29398 var zipValidations = []; 29399 29400 zipValidations.push($(form).find('input').filter('input[id=zip]')); 29401 29402 $.each(zipValidations[0], function (index, value) { 29403 29404 if (this.id === "zip") { 29405 29406 if ($(this).parent().hasClass('floating-error')) { 29407 confirmError = true; 29408 $('#zip').parent().children(".error-constraint").show(); 29409 $('#zip').parent().children(".error-constraint").html("We’re sorry, we do not offer small or large business plans with the ZIP code you entered."); 29410 scrollToView(this); 29411 return false; 29412 29413 } else { 29414 $('#zip').parent().removeClass('floating-error'); 29415 $('#zip').parent().children(".required-field").show(); 29416 $('#zip').parent().children(".error-constraint").hide(); 29417 return true; 29418 29419 } 29420 29421 } 29422 }); 29423 29424 29425 var phValidations = []; 29426 29427 phValidations.push($(form).find('input').filter('input[id=phone]')); 29428 29429 $.each(phValidations[0], function (index, value) { 29430 29431 if (this.id === "phone") { 29432 var tmp = this.value;; 29433 var errorMessage = $(this).parent().children(".error-constraint"); 29434 var constraintMessage = "Can't be in formats (111) 111-1111 and (111) XXX-XXXX."; 29435 29436 tmp = tmp.replace("(", ""); 29437 tmp = tmp.replace(")", ""); 29438 tmp = tmp.replace(" ", ""); 29439 tmp = tmp.replace("-", ""); 29440 29441 if (tmp && tmp.length == 10) { 29442 var pattern = /(\d)\1{9}/g; 29443 var pattern2 = /(\d)\1{2}/g; 29444 if ((pattern.test(tmp) || pattern2.test(tmp.substr(0, 3)))) { 29445 29446 29447 $(errorMessage).html(constraintMessage).show(); 29448 confirmError = true; 29449 $(this).parent().addClass('floating-error'); 29450 $(this).parent().children(".required-field").hide(); 29451 scrollToView(this); 29452 return false; 29453 29454 } else { 29455 29456 $('#phone').parent().children(".error-pattern").hide(); 29457 $(this).parent().removeClass('floating-error'); 29458 return true; 29459 } 29460 } 29461 29462 } 29463 }); 29464 29465 var descValidations = []; 29466 29467 descValidations.push($(form).find('input').filter('input[id=description]')); 29468 29469 $.each(descValidations[0], function (index, value) { 29470 if (this.id === "description") { 29471 var radioBtns = document.getElementsByName('00Nf400000UB6RZ'); 29472 var required = false;
29473 29474 if (radioBtns && radioBtns.length > 0 && radioBtns[0].checked) { 29475 required = true; 29476 } 29477 29478 var errorMessage = $(this).parent().children(".error-constraint"); 29479 var constraintMessage = "If work with a broker is Yes, Name is required."; 29480 29481 if (required && this.value.length > 0) { 29482 confirmError = true; 29483 $(errorMessage).html(constraintMessage).show(); 29484 $(this).parent().addClass('floating-error'); 29485 $(this).parent().children(".required-field").show(); 29486 scrollToView(this); 29487 return false; 29488 } else { 29489 $(errorMessage).html(constraintMessage).hide(); 29490 $('#description').parent().children(".error-pattern").hide(); 29491 $(this).parent().removeClass('floating-error'); 29492 return true; 29493 } 29494 } 29495 }); 29496 29497 29498 if (confirmError) { 29499 return; 29500 29501 }else { 29502 // validate the recaptcha and then post the data 29503 checkRecaptchaAndSubmit(); 29504 29505 } 29506 } 29507 } 29508 29509 29510 29511 29512function checkRecaptchaAndSubmit() { 29513 var $container = $('.reserve-form-container'); 29514 hmkShowSpinner($container); 29515 const SITE_KEY = "6LexyEYrAAAAAGvaU6n1vMNlWdPj7ZP_-tJ5svtR"; 29516 const ACTION = "hmk_forms"; 29517 grecaptcha.ready(function () { 29518 grecaptcha.execute(SITE_KEY, { action: ACTION }) 29519 .then(function (token) { 29520 if (!token) { 29521 trackDatalayer('form error', 'recaptcha token error submiting the form', function () { 29522 console.error("Empty reCAPTCHA token"); 29523 return; //bot 29524 }); 29525 }else{ 29526 //validate token 29527 $.ajax({ 29528 method: 'POST', 29529 async: false, 29530 url: '/bin/hmk/validateRecaptchaVThreeToken', 29531 contentType: 'application/json; charset=utf-8', 29532 data: JSON.stringify({ 29533 recaptchaToken: token, 29534 29535 }), 29536 dataType: 'json', 29537 crossDomain: true, 29538 success: function(result) { 29539 if (result){ 29540 trackDatalayer('form submit', 'successful submission', function () { 29541 postFormData(form); 29542 }); 29543 29544 } else { 29545 hmkHideSpinner($container); 29546 } 29547 29548 }, 29549 error: function(jqXHR, textStatus, errorThrown) { 29550 trackDatalayer('form error', 'error validating recaptcha token', function () { 29551 console.error("reCAPTCHA err"); 29552 return; //bot 29553 }); 29554 29555 } 29556 }); 29557 } 29558 29559 }) 29560 .catch(function (err) { 29561 29562 trackDatalayer('form error', 'recaptcha token error submiting the form', function () { 29563 console.error("reCAPTCHA err", err); 29564 return; //bot 29565 }); 29566 29567 }); 29568 }); 29569 } 29570 29571 function trackDatalayer(formEvent, formSubject, callback) { 29572 var $container = $('.reserve-form-container'); 29573 hmkHideSpinner($container); 29574 window.adobeDataLayer = window.adobeDataLayer || []; 29575 window.adobeDataLayer.push({ 29576 event: formEvent, 29577 form: { 29578 "name": "employerform", 29579 "subject": formSubject 29580 } 29581 }); 29582 29583 29584 // Execute callback after a short delay to ensure data layer processing 29585 if (callback && typeof callback === 'function') { 29586 setTimeout(callback, 100); // Reduced delay since we're using callback pattern 29587 } 29588 } 29589 29590function scrollToView(el) { 29591 var position = $(el).offset().top; 29592 // $("body, html").animate({ 29593 // scrollTop: position 29594 // }, 500); 29595 var s = $('html').scrollTop(position) || $('body').scrollTop(position); 29596} 29597 29598function checkBoxValidation() { 29599 var requiredCheckboxes = $(':checkbox[required]'); 29600 var requiredRadioboxes = $(':radio[required]'); 29601 requiredCheckboxes.change(function () { 29602 var clickedBox = this.name; 29603 var relatedCheckboxes = $("input[name=" + clickedBox + "]"); 29604 if (relatedCheckboxes.is(':checked')) { 29605 relatedCheckboxes.removeAttr('required'); 29606 } else { 29607 relatedCheckboxes.attr('required', 'required'); 29608 } 29609 }); 29610 requiredRadioboxes.change(function () { 29611 var clickedRadio = this.name; 29612 var relatedRadioBoxes = $("input[name=" + clickedRadio + "]"); 29613 if (relatedRadioBoxes.is(':checked')) { 29614 relatedRadioBoxes.removeAttr('required'); 29615 } else { 29616 relatedRadioBoxes.attr('required', 'required'); 29617 } 29618 }); 29619} 29620//make the post call with form data 29621function postFormData(_form) { 29622 29623 // check if form is placed in a tab 29624 var _parent = $(_form).parents("div#tabOneContent"); 29625 if (_parent.length > 0) { 29626 //toggle the active state between tabs 29627 $("ul#timlineTabs").children("li").removeClass("active"); 29628 $("a#tabTwo").parent("li").addClass("active"); 29629 $(_parent).parents("div.tabcontent").find("div.tab-pane").removeClass("active"); 29630 $(_parent).parents("div.tabcontent").find("div#tabTwoContent").removeClass("fade"); 29631 $(_parent).parents("div.tabcontent").find("div#tabTwoContent").addClass("active"); 29632 buildFormFields2(_form); 29633 29634 } else { 29635 addPreviousFormElementsIntoDom(_form); 29636 $(_form).submit(); 29637 } 29638} 29639 29640function addPreviousFormElementsIntoDom(_form) { 29641 var divEl = $("<div style='display:none;'></div>"); 29642 $.each(_DataToPostMedicareForm.data2[0], function (index, value) { 29643 $(divEl).append(value); 29644 }); 29645 29646 $(_form).append(divEl); 29647 $(_form).removeAttr('novalidate'); 29648} 29649 29650//build fields from previous tab and insert into next form tab 29651 29652function buildFormFields2(_form) { 29653 //var _formFields = []; 29654 _DataToPostMedicareForm.data2.push($(_form).find('input,textarea,select').not(':submit')); 29655} 29656 29657//allows multiple step forms to add all fields into one object 29658function buildFormFields(_form) { 29659 var _formFields = []; 29660 _formFields.push($(_form).find('input,textarea,select').not(':submit')); 29661 var _checkboxesValues = []; 29662 $.each(_formFields[0], function (index, value) {
29663 if (this.type == "radio") { 29664 if ($(this).is(':checked')) { 29665 _DataToPostMedicareForm.addIntoFormObject(this.name, this.value); 29666 } 29667 } else if (this.type == "checkbox") { 29668 if ($(this).is(':checked')) { 29669 if (!(_DataToPostMedicareForm.data[this.name])) { // if its a checkbox and checked, and yet the field is not added into the object 29670 _checkboxesValues = []; 29671 _checkboxesValues.push(this.value) 29672 _DataToPostMedicareForm.addIntoFormObject(this.name, _checkboxesValues); 29673 } else { // if the field is already added in to the object 29674 _checkboxesValues.push(this.value) 29675 _DataToPostMedicareForm.addIntoFormObject(this.name, _checkboxesValues); 29676 } 29677 29678 } 29679 29680 } else { 29681 _DataToPostMedicareForm.addIntoFormObject(this.name, this.value); 29682 } 29683 29684 }); 29685} 29686 29687//constructor to create empty form fields, and we will keep on adding to it 29688function FormDataObject() { 29689 this.status = {}; 29690 this.data = {}; 29691 this.data2 = []; 29692 this.addIntoFormObject = function (name, value) { 29693 this.data[name] = value; 29694 } 29695 29696} 29697 29698 29699function onInputChange(id) { 29700 var x = document.getElementById(id); 29701 29702 var sibling = document.getElementById(id).nextElementSibling.nextElementSibling; // input > label > span 29703 29704 if (x.value) { 29705 sibling.classList.add("floating-success"); 29706 } else { 29707 sibling.classList.remove("floating-success"); 29708 } 29709} 29710 29711function onSelectChange(selectElement) { 29712 let selectedOption = selectElement.options[selectElement.selectedIndex]; 29713 let selectedValue = selectedOption.value; 29714 selectElement.setAttribute('value', selectedValue); 29715 if (selectedValue !== '') { 29716 selectElement.parentElement.classList.add('value-selected'); 29717 } else { 29718 selectElement.parentElement.classList.remove('value-selected'); 29719 } 29720 } 29721 29722 29723 29724function checkIfFormIsSubmitted() { 29725 var _formSubmitted = window.location.search.search('submitted=true'); 29726 var _navigationType = window.performance.navigation.type; 29727 if (_formSubmitted !== -1 && _navigationType === 0) { 29728 $("ul#timlineTabs").children("li").removeClass("active"); 29729 $("a#tabThree").parent("li").addClass("active"); 29730 $("div.tabcontent").find("div.tab-pane").removeClass("active in"); 29731 $("div.tabcontent").find("div#tabThreeContent").addClass("active in"); 29732 } 29733} 29734 29735 29736// To validate zip code on get started form page 29737 29738fromMaxcount = 0, zipEnterKeyPress = 0, invalidFormat = 1; 29739 29740 29741$("#zip").on('keyup', function (e) { 29742 if (window.location.href.indexOf("get-started") === -1) { 29743 return; 29744 } 29745 29746 if ($('#zip').val().length == 5) { 29747 validateGetStartedZIP(jQuery("#zip").val()); 29748 } else if ($('#zip').val().length > 5) { 29749 $('#zip').parent().addClass('floating-error'); 29750 $('#zip').parent().children(".required-field").hide(); 29751 $('#zip').parent().children(".error-constraint").show(); 29752 $('#zip').parent().children(".error-constraint").html("Please enter a valid zipcode"); 29753 } else { 29754 $('#zip').parent().removeClass('floating-error'); 29755 $('#zip').parent().children(".required-field").show(); 29756 $('#zip').parent().children(".error-constraint").hide(); 29757 } 29758 29759}) 29760 29761 29762var ZIPentered = 0; 29763 29764function validateGetStartedZIP(ZIPentered) { 29765 29766 29767 var validFormat = $('#zip').val().match(/^(?!00000)(?!11111)(?!22222)(?!33333)(?!44444)(?!55555)(?!66666)(?!77777)(?!88888)(?!99999)\d{5}$/); 29768 29769 if (validFormat == null) { 29770 $('#zip').parent().addClass('floating-error'); 29771 $('#zip').parent().children(".required-field").hide(); 29772 $('#zip').parent().children(".error-constraint").show(); 29773 $('#zip').parent().children(".error-constraint").html("Please enter a valid zipcode"); 29774 return; 29775 } 29776 29777 globalApiCall(); 29778 29779 var validZipEmployer = false; 29780 29781 $.ajax({ 29782 method: 'GET', 29783 async: false, 29784 url: '/bin/dmxhmk/countyList', 29785 contentType: 'application/json; charset=utf-8', 29786 data: { "zipCode": ZIPentered}, 29787 dataType: 'json', 29788 crossDomain: true, 29789 success: function(result) { 29790 if (result.payload.countyList){ 29791 var zip_region = result.payload.countyList[0].region; 29792 if(zip_region == "CPA") { 29793 const blockedPennsylvaniaCounties = [ 29794 'BUCKS', 29795 'MONTGOMERY', 29796 'PHILADELPHIA', 29797 'DELAWARE', /*PA only*/ 29798 'CHESTER' 29799 ]; 29800 for(var j = 0; j <result.payload.countyList.length; j++) { 29801 if(blockedPennsylvaniaCounties.includes(result.payload.countyList[j].county)) { 29802 validZipEmployer = false;
29803 break; 29804 }else{ 29805 validZipEmployer = true; 29806 } 29807 } 29808 29809 } 29810 else { 29811 validZipEmployer = false; 29812 } 29813 29814 } 29815 else { 29816 validZipEmployer = false; 29817 } 29818 29819 if (validZipEmployer) { 29820 $('#zip').parent().removeClass('floating-error'); 29821 $('#zip').parent().children(".required-field").show(); 29822 $('#zip').parent().children(".error-constraint").hide(); 29823 } else { 29824 $('#zip').parent().addClass('floating-error'); 29825 $('#zip').parent().children(".required-field").hide(); 29826 $('#zip').parent().children(".error-constraint").show(); 29827 $('#zip').parent().children(".error-constraint").html("We’re sorry, we do not offer small or large business plans with the ZIP code you entered."); 29828 } 29829 }, 29830 error: function(jqXHR, textStatus, errorThrown) { 29831 $('#zip').parent().addClass('floating-error'); 29832 $('#zip').parent().children(".required-field").hide(); 29833 $('#zip').parent().children(".error-constraint").show(); 29834 $('#zip').parent().children(".error-constraint").html("Please enter a valid zipcode"); 29835 return; 29836 } 29837 }); 29838 29839} 29840 29841 29842/**})(window, jQuery, document); **/ 29843 29844var pageRegion, regionMatch = 0, 29845 isRegionalPage = 0, 29846 isCorrectRegion = 0, 29847 userRegionCookie, userZipCookie, getAEMmode, subpage, pdfname, employerPageRegion, reservationforSEPA = true; 29848 29849function GetQueryStringParams(sParam) { 29850 var sPageURL = window.location.search.substring(1); 29851 var sURLVariables = sPageURL.split('&'); 29852 for (var i = 0; i < sURLVariables.length; i++) { 29853 var sParameterName = sURLVariables[i].split('='); 29854 if (sParameterName[0] == sParam) { 29855 return sParameterName[1]; 29856 } 29857 } 29858} 29859 29860 29861$(window).on('load', function(){ 29862 29863 //appending hidden field to keep track of referrer 29864 input = jQuery('<input type="hidden" id="menu-selected">'); 29865 $("#txt-zipcode").append(input); 29866 $("#txt-zipcode").attr('maxlength', '5'); 29867 $("#txt-zipcode").attr('type', 'tel'); 29868 29869 if (userRegionCookie) { 29870 jQuery("#txt-zipcode").val(userZipCookie); 29871 } 29872 29873 // executes when complete page is fully loaded, including all frames, objects and images 29874 var currentPath = window.location.pathname; 29875 var wcmMode = GetQueryStringParams('wcmmode'); 29876 subpage = GetQueryStringParams('subpage'); 29877 getAEMmode = getCookie("wcmmode"); 29878 29879 //code to set the AEP start and end date 29880 //AEP start date=10/01 29881 //New AEP start date 09/20 29882 //AEP end date=12/07 29883 currentDate = new Date(); 29884 currentyear = currentDate.getFullYear(); 29885 //Set the AEP Start Date to 9/20 for prod and 8/20 for rest of the environments for early testing. 29886 if ((window.location.href.indexOf("https://www.highmark.com") != -1) || (window.location.href.indexOf("https://highmark.com") != -1)) { 29887 AEPstartdate = new Date(currentyear, 08, 20); //month values start from 0-11 29888 } 29889 else { 29890 AEPstartdate = new Date(currentyear, 07, 20); 29891 29892 } 29893 AEPenddate = new Date(currentyear, 11, 07); 29894 userRegionCookie = getCookie("userRegion"); 29895 if (getAEMmode != "edit" || getAEMmode == undefined || getAEMmode == null) { 29896 if (userRegionCookie == "western-new-york" || userRegionCookie == "northeastern-new-york") { 29897 $("#ny-aep-lc-one").show(); 29898 $("#ny-aep-meeting-options-table").show(); 29899 $("#non-aep-lc-one").hide(); 29900 $("#non-aep-lc-two").hide(); 29901 $("#non-aep-lc-three").hide(); 29902 $("#non-aep-meeting-options-table").hide(); 29903 $("#aep-lc-one").hide(); 29904 $("#aep-lc-two").hide(); 29905 $("#aep-lc-three").hide(); 29906 $("#aep-lc-four").hide(); 29907 $("#aep-meeting-options-table").hide(); 29908 $("#MBR-landing-page-active-AEP-div").hide(); 29909 $("#visit-store-text").hide(); 29910 $("#ny-visit-store-text").show(); 29911 $("#community-meeting-text").hide(); 29912 $("#ny-community-meeting-text").show(); 29913 if (currentDate > AEPstartdate && currentDate < AEPenddate) { 29914 $("#ny-mbr-cta-aep-div").show(); 29915 } 29916 else { 29917 $("#ny-mbr-cta-aep-div").hide(); 29918 } 29919 } else if (currentDate > AEPstartdate && currentDate < AEPenddate) { 29920 if (userRegionCookie == "west-virginia" || userRegionCookie == "delaware") { 29921 $("#medicare-highmark-health-store-visit-today-card-1").hide(); 29922 $("#medicare-highmark-health-store-visit-today-card-2").hide(); 29923 } else if (userRegionCookie == "southeastern-pennsylvania") { 29924 $("#main-nav-aca-redirect").hide(); 29925 $("#main-nav-aca-redirect-medicare").hide(); 29926 $("#tab-nav-aca-redirect").hide(); 29927 $("#tab-nav-reservation-medicare").hide(); 29928 $("#main-nav-reservation-medicare-mobile").hide(); 29929 } else { 29930 $("#medicare-highmark-health-store-visit-today-card-1").show(); 29931 $("#medicare-highmark-health-store-visit-today-card-2").show(); 29932 } 29933 //During AEP period 29934 $("#non-aep-lc-one").hide(); 29935 $("#non-aep-lc-two").hide(); 29936 $("#non-aep-lc-three").hide(); 29937 $("#non-aep-meeting-options-table").hide(); 29938 $("#aep-lc-one").show(); 29939 $("#aep-lc-two").show(); 29940 $("#aep-lc-three").show(); 29941 $("#aep-lc-four").show(); 29942 $("#aep-meeting-options-table").show(); 29943 $("#MBR-landing-page-active-AEP-div").show(); 29944 $("#ny-aep-lc-one").hide(); 29945 $("#ny-aep-meeting-options-table").hide(); 29946 $("#visit-store-text").show(); 29947 $("#ny-visit-store-text").hide(); 29948 $("#community-meeting-text").show(); 29949 $("#ny-community-meeting-text").hide(); 29950 $("#ny-mbr-cta-aep-div").hide(); 29951 } else { 29952 if (userRegionCookie == "west-virginia" || userRegionCookie == "delaware") { 29953 $("#medicare-highmark-health-store-visit-today-card-1").hide(); 29954 $("#medicare-highmark-health-store-visit-today-card-2").hide(); 29955 } else if (userRegionCookie == "southeastern-pennsylvania") { 29956 $("#main-nav-aca-redirect").hide(); 29957 $("#main-nav-aca-redirect-medicare").hide(); 29958 $("#tab-nav-aca-redirect").hide(); 29959 $("#tab-nav-reservation-medicare").hide(); 29960 $("#main-nav-reservation-medicare-mobile").hide(); 29961 } else { 29962 $("#medicare-highmark-health-store-visit-today-card-1").show(); 29963 $("#medicare-highmark-health-store-visit-today-card-2").show(); 29964 } 29965 //pre-post AEP 29966 $("#non-aep-lc-one").show(); 29967 $("#non-aep-lc-two").show(); 29968 $("#non-aep-lc-three").show(); 29969 $("#non-aep-meeting-options-table").show(); 29970 $("#aep-lc-one").hide(); 29971 $("#aep-lc-two").hide(); 29972 $("#aep-lc-three").hide(); 29973 $("#aep-lc-four").hide(); 29974 $("#aep-meeting-options-table").hide(); 29975 $("#MBR-landing-page-active-AEP-div").hide(); 29976 $("#ny-aep-lc-one").hide(); 29977 $("#ny-aep-meeting-options-table").hide(); 29978 $("#visit-store-text").show(); 29979 $("#ny-visit-store-text").hide(); 29980 $("#community-meeting-text").show(); 29981 $("#ny-community-meeting-text").hide(); 29982 $("#ny-mbr-cta-aep-div").hide(); 29983 } 29984 29985 //HMK link shortening 29986 var publishedSites = ['www.highmark.com', 'highmark.com', 'newtenv1.highmark.com', 'newtenv2.highmark.com', 'newtenv3.highmark.com', 'newtenvb.highmark.com']; 29987 var isPublished = publishedSites.includes(window.location.hostname); 29988 if (isPublished) { 29989 $('a').each(function () { 29990 var oldUrl = $(this).attr("href"); 29991 29992 if (oldUrl === '/content/digital-marketing/en/highmark/highmarkdotcom/home') { 29993 var newUrl = oldUrl.replace('/content/digital-marketing/en/highmark/highmarkdotcom/home', "/"); 29994 $(this).attr("href", newUrl); 29995 } else if (oldUrl !== null && oldUrl !== undefined && oldUrl.indexOf('/content/digital-marketing/en/highmark/highmarkdotcom/home') !== -1) { 29996 var newUrl = oldUrl.replace('/content/digital-marketing/en/highmark/highmarkdotcom/home', ""); 29997 $(this).attr("href", newUrl); 29998 } 29999 }); 30000 } 30001 30002 //HNAS link shortening 30003 var publishedSitesHNAS = ['newtenv2.hnas.com', 'newtenvb.hnas.com', 'newtenv3.hnas.com', 'hnas.com', 'www.hnas.com']; 30004 var isPublishedHNAS = publishedSitesHNAS.includes(window.location.hostname); 30005 if (isPublishedHNAS) { 30006 $('a').each(function () { 30007 var oldUrl = $(this).attr("href"); 30008 30009 if (oldUrl === '/content/digital-marketing/en/highmark/HNAS/home') { 30010 var newUrl = oldUrl.replace('/content/digital-marketing/en/highmark/HNAS/home', "/"); 30011 $(this).attr("href", newUrl); 30012 } else if (oldUrl !== null && oldUrl !== undefined && oldUrl.indexOf('/content/digital-marketing/en/highmark/HNAS/home') !== -1) { 30013 var newUrl = oldUrl.replace('/content/digital-marketing/en/highmark/HNAS/home', ""); 30014 $(this).attr("href", newUrl); 30015 } 30016 }); 30017 } 30018 30019 // AllmyHealth Link shortning 30020 var publishedSitesAMH = ['tenv2.allmyhealth.com', 'tenvb.allmyhealth.com', 'tenv3.allmyhealth.com', 'allmyhealth.com', 'www.allmyhealth.com']; 30021 var publishedSitesAMH = publishedSitesAMH.includes(window.location.hostname); 30022 if (publishedSitesAMH) { 30023 $('a').each(function () { 30024 var oldUrl = $(this).attr("href"); 30025 30026 if (oldUrl === '/content/digital-marketing/en/highmark/allmyhealth') { 30027 var newUrl = oldUrl.replace('/content/digital-marketing/en/highmark/allmyhealth', "/"); 30028 $(this).attr("href", newUrl); 30029 } else if (oldUrl !== null && oldUrl !== undefined && oldUrl.indexOf('/content/digital-marketing/en/highmark/allmyhealth') !== -1) { 30030 var newUrl = oldUrl.replace('/content/digital-marketing/en/highmark/allmyhealth', ""); 30031 $(this).attr("href", newUrl); 30032 } 30033 }); 30034 } 30035 30036 //Beneficity Link Shortening
30037 var publishedSitesBEN = ['tenv2.beneficity.com', 'tenvb.beneficity.com', 'tenv3.beneficity.com', 'beneficity.com', 'www.beneficity.com' ]; 30038 var publishedSitesBEN = publishedSitesBEN.includes(window.location.hostname); 30039 if (publishedSitesBEN) { 30040 $('a').each(function () { 30041 var oldUrl = $(this).attr("href"); 30042 30043 if (oldUrl === '/content/digital-marketing/en/highmark/beneficity') { 30044 var newUrl = oldUrl.replace('/content/digital-marketing/en/highmark/beneficity', "/"); 30045 $(this).attr("href", newUrl); 30046 } else if (oldUrl !== null && oldUrl !== undefined && oldUrl.indexOf('/content/digital-marketing/en/highmark/beneficity') !== -1) { 30047 var newUrl = oldUrl.replace('/content/digital-marketing/en/highmark/beneficity', ""); 30048 $(this).attr("href", newUrl); 30049 } 30050 }); 30051 } 30052 } 30053 30054 if (wcmMode) { 30055 setCookie("wcmmode", wcmMode); 30056 } 30057 30058 if (getAEMmode != "edit" || getAEMmode == undefined || getAEMmode == null) { 30059 30060 var l = getLocation(window.location.href); 30061 pageRegion = l.pathname.split("/").filter(Boolean); 30062 var url = window.location.href.split("region="); 30063 var region = url[1]; 30064 if ((region == 'BS') || (region == 'BLUESHIELD')) { 30065 setCookie("userRegion", "central-pennsylvania"); 30066 } else if (region == 'BCBS') { 30067 setCookie("userRegion", "western-pennsylvania"); 30068 } else if (region == 'BCBSWV') { 30069 setCookie("userRegion", "west-virginia"); 30070 } else if (region == 'BCBS') { 30071 setCookie("userRegion", "northeastern-pennsylvania"); 30072 } else if (region == 'BCBSDE') { 30073 setCookie("userRegion", "delaware"); 30074 } 30075 else if (region == 'BCBSWNY') { 30076 setCookie("userRegion", "western-new-york"); 30077 } 30078 else if (region == 'BSNENY') { 30079 setCookie("userRegion", "northeastern-new-york"); 30080 } 30081 userRegionCookie = getCookie("userRegion"); 30082 userZipCookie = getCookie("userZIP"); 30083 if (userRegionCookie && userRegionCookie != "western-pennsylvania" && userRegionCookie != "northeastern-pennsylvania") { 30084 $("#visit-today").prop("disabled", true); 30085 $("#vs-region-txt").css("display", "block"); 30086 } else { 30087 $("#visit-today").prop("disabled", false); 30088 $("#vs-region-txt").css("display", "none"); 30089 } 30090 30091 30092 var location = window.location.href; 30093 var referrer = getCookie("Referrer"); 30094 var RegionCookie = getCookie("userRegion"); 30095 30096 //avoid zipcode gate if URL has from zg=false 30097 if (location.indexOf("?zg=false") > 0) { 30098 30099 if (referrer.indexOf("/medical-policy") > 0) { 30100 var referrerSplit = referrer.split("/").filter(Boolean); 30101 var referrerRegion; 30102 30103 //check which region is in the referrer 30104 for (var j = 0; j < referrerSplit.length; j++) { 30105 if (referrerSplit[j] == "central-pennsylvania") { 30106 referrerRegion = "central-pennsylvania"; 30107 } else if (referrerSplit[j] == "western-pennsylvania") { 30108 referrerRegion = "western-pennsylvania"; 30109 } else if (referrerSplit[j] == "west-virginia") { 30110 referrerRegion = "west-virginia"; 30111 } else if (referrerSplit[j] == "northeastern-pennsylvania") { 30112 referrerRegion = "northeastern-pennsylvania"; 30113 } else if (referrerSplit[j] == "delaware") { 30114 referrerRegion = "delaware"; 30115 } else if (referrerSplit[j] == "western-new-york") { 30116 referrerRegion = "western-new-york"; 30117 } else if (referrerSplit[j] == "northeastern-new-york") { 30118 referrerRegion = "northeastern-new-york"; 30119 } else if (referrerSplit[j] == "southeastern-pennsylvania") { 30120 referrerRegion = "southeastern-pennsylvania"; 30121 } 30122 } 30123 30124 //if the region in the referrer and the url do not match, swap the 30125 //region in the referrer with the value in the userRegion cookie 30126 if (referrerRegion && (RegionCookie != referrerRegion)) { 30127 referrer = referrer.replace(referrerRegion, RegionCookie); 30128 if (referrer.indexOf("?zg=false") == -1) { 30129 referrer = referrer + "?zg=false"; 30130 }
30131 setCookie("Referrer", referrer); 30132 window.location.href = referrer; 30133 } 30134 } 30135 30136 if (RegionCookie) { 30137 changeBrandLogo(); 30138 } 30139 30140 return; 30141 }; 30142 30143 if (window.location.href.indexOf("meet-medicare-advisor?zip=") != -1) { 30144 var offset = window.location.href.indexOf("zip="); 30145 zipcode = window.location.href.substr(offset + 4, 5); 30146 if (window.location.href.indexOf("/meet-medicare-advisor") != -1) { 30147 sessionStorage.setItem("from", "medicareQuiz"); 30148 } 30149 setCookie("menu-selected", "advisor-page");// then check for advisor page like other 30150 redirecttoZipcodeGate(zipcode); 30151 30152 } 30153 30154 if (userRegionCookie) { 30155 changeBrandLogo(); 30156 } 30157 30158 //check if it is a regional page 30159 for (var i = 0; i < pageRegion.length; i++) { 30160 if (pageRegion[i] == "central-pennsylvania" || pageRegion[i] == "western-pennsylvania" || pageRegion[i] == "west-virginia" || pageRegion[i] == "northeastern-pennsylvania" || pageRegion[i] == "delaware" || pageRegion[i] == "western-new-york" || pageRegion[i] == "northeastern-new-york" || pageRegion[i] == "southeastern-pennsylvania") { 30161 isRegionalPage = 1; 30162 str = pageRegion[i].replace(/-/g, ' ').toLowerCase().replace(/\b[a-z]/g, function (letter) { 30163 return letter.toUpperCase(); 30164 }); 30165 break; 30166 } 30167 } 30168 30169 //Check if user is cookied, if yes check if user is on correct page as per cookied region 30170 if (isRegionalPage == 1) { 30171 if (userRegionCookie != null && !(GetQueryStringParams('zip'))) { 30172 30173 for (var i = 0; i < pageRegion.length; i++) { 30174 if (pageRegion[i] != userRegionCookie) { 30175 regionMatch = 0; 30176 } else { 30177 regionMatch = 1; 30178 break; 30179 } 30180 } 30181 if (!regionMatch) { 30182 var elmnt = document.getElementById("highmark-dotcom"); 30183 elmnt.scrollIntoView(); 30184 redirecttoZipcodeGate(); 30185 30186 } 30187 } 30188 else if (userRegionCookie == null && !GetQueryStringParams("zip")) { 30189 30190 var pathname = window.location.pathname; 30191 if (pathname == "/western-pennsylvania/chip") { 30192 setCookie("menu-selected", "chip-main-nav"); 30193 } 30194 redirecttoZipcodeGate(); 30195 } 30196 else if (GetQueryStringParams("zip")) { 30197 //validate if it is correct ZIP 30198 validateZIP(GetQueryStringParams("zip")); 30199 } 30200 } 30201 30202 } //end of getAEMmode function 30203 30204 //If user visits medicare 11 form and zipcode cookie is not available, redirect to medicare-11 zipgate page 30205 if ((window.location.href.indexOf("/campaigns/medicare-11-form") != -1) || (window.location.href.indexOf("/campaigns/medicare-11-medicare-central") != -1)) { 30206 const offercode = GetQueryStringParams("offercode") || GetQueryStringParams("offer_code"); 30207 30208 if (offercode) { 30209 sessionStorage.setItem("offerCode", offercode); 30210 } 30211 if (!getCookie("userZIP")) { 30212 if (getAEMmode != "edit") { 30213 30214 if (getAEMmode) { 30215 window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/campaigns/medicare-11-offer.html"; 30216 } 30217 else 30218 { 30219 window.location.href = window.location.protocol + "//" + window.location.host + "/campaigns/medicare-11-offer"; 30220 } 30221 } 30222 } 30223 } 30224}); 30225 30226 30227//code to prevent entering alphabets in zip field 30228jQuery("#txt-zipcode").keydown(function (e) { 30229 if (e.shiftKey || e.ctrlKey || e.altKey) { // if shift, ctrl or alt keys held down 30230 // Prevent character input 30231 e.preventDefault(); 30232 } 30233 $(".error-constraint").html(""); 30234 $(".error-constraint").css({ "display": "none" }); 30235 $("#txt-zipcode").css({ "border": "2px solid #0078C1" }); 30236 $("label[for=txt-zipcode]").css({ "color": "#0078C1" }); 30237}); 30238 30239 30240 30241jQuery("#txt-zipcode").focus(function () { 30242 $(".error-constraint").html(""); 30243 $(".error-constraint").css({ "display": "none" }); 30244 $("#txt-zipcode").css({ "border": "2px solid #0078C1" }); 30245 $("label[for=txt-zipcode]").css({ "color": "#0078C1" }); 30246}); 30247 30248jQuery("#btnAlertClose").click(function () { 30249 jQuery("#divInvalidZIP").fadeOut(); 30250}); 30251 30252 30253 30254var getLocation = function (href) { 30255 var l = document.createElement("a"); 30256 l.href = href; 30257 return l; 30258}; 30259 30260//validate zipcode- function gets executed on keyup event in zipcode textbox 30261var interval1, interval2, interval3, interval4, interval5; 30262var closeSeconds1 = closeSeconds2 = closeSeconds3 = closeSeconds4 = closeSeconds5 = 7; 30263jQuery("#btn-zipcode-enter").click(function (e) { 30264 validateZIP(jQuery("#txt-zipcode").val()); 30265}); 30266 30267$("#btn-zipcode-enter").keyup(function (event) { 30268 if (event.which === 13) { 30269 validateZIP(jQuery("#txt-zipcode").val()); 30270 } 30271}); 30272var ZIPentered = 0, employerRegionalPage; 30273 30274function validateZIP(ZIPentered) { //function to check if zip entered is correct 30275 var ua = window.navigator.userAgent; 30276 var msie = ua.indexOf("MSIE "); 30277 $("div.loading").css("display", "block"); 30278 if (msie == -1) { 30279 var t1 = performance.now(); 30280 console.log("zipcodepicker start", t1); 30281 } 30282
30283 var validZip = 0, userRegion, userZIP, userCounty; 30284 globalApiCall(); 30285 var dataObj = { 30286 "payload": { 30287 "zipCode": ZIPentered 30288 } 30289 }; 30290 $.ajax({ 30291 method: 'POST', 30292 async: false, 30293 url: GET_COUNTIES_URL, 30294 headers: { 'x-hmhs-keyId': countyListKey, 'ddToken': countyListToken }, 30295 contentType: 'application/json; charset=utf-8', 30296 data: JSON.stringify(dataObj), 30297 dataType: 'json', 30298 crossDomain: true, 30299 success: function (result) { 30300 if (result.payload.countyList) { 30301 var zip_region = result.payload.countyList[0].region; 30302 userCounty = result.payload.countyList[0].county; 30303 setCookie("userCounty", userCounty.toLowerCase()); 30304 if (zip_region == "WPA") { 30305 userRegion = "western-pennsylvania"; 30306 validZip = 1; 30307 } 30308 else if (zip_region == "WV") { 30309 userRegion = "west-virginia"; 30310 validZip = 1; 30311 } 30312 else if (zip_region == "NEPA") { 30313 userRegion = "northeastern-pennsylvania"; 30314 validZip = 1; 30315 } 30316 30317 else if (zip_region == "DE") { 30318 userRegion = "delaware"; 30319 validZip = 1; 30320 } 30321 else if (zip_region == "SEPA") { 30322 userRegion = "southeastern-pennsylvania"; 30323 validZip = 1; 30324 } 30325 else if (zip_region == "CPA") { 30326 userRegion = "central-pennsylvania"; 30327 validZip = 1; 30328 } 30329 else if (zip_region == "WNY") { 30330 userRegion = "western-new-york"; 30331 validZip = 1; 30332 } 30333 else if (zip_region == "NENY") { 30334 userRegion = "northeastern-new-york"; 30335 validZip = 1; 30336 } 30337 else { 30338 validZip = 0; 30339 } 30340 30341 } 30342 else { 30343 validZip = 0; 30344 } 30345 30346 //handling not a vlid zip part 30347 if (!validZip && GetQueryStringParams("zip")) { 30348 $(".error-constraint").html("Please enter a valid zipcode"); 30349 $(".error-constraint").css({ "display": "inline", "color": "#B70C0C" }); 30350 $(".error-constraint").removeClass("floating-success"); 30351 30352 } else if (!validZip && !GetQueryStringParams("zip")) { 30353 if (!GetQueryStringParams("profile")) //do not display zipcode on agent profile page 30354 { 30355 $(".error-constraint").html("Please enter a valid zipcode"); 30356 $(".error-constraint").css({ "display": "inline", "color": "#B70C0C" }); 30357 $(".error-constraint").removeClass("floating-success"); 30358 $("#txt-zipcode").css({ "border": "2px solid #B70C0C" }); 30359 $("label[for=txt-zipcode]").css({ "color": "#B70C0C" }); 30360 } 30361 } else if (validZip && isRegionalPage && !isCorrectRegion) //correct ZIP, incorrect region..check if only it's a regional page 30362 { 30363 $(".error-constraint").html("Please enter a valid zipcode"); 30364 $(".error-constraint").css({ "display": "inline", "color": "#B70C0C" }); 30365 $(".error-constraint").removeClass("floating-success"); 30366 $("#txt-zipcode").css({ "border": "2px solid #B70C0C" }); 30367 $("label[for=txt-zipcode]").css({ "color": "#B70C0C" }); 30368 } else { //if zip entered is valid 30369 30370 if (GetQueryStringParams("zip") && !jQuery("#txt-zipcode").val()) { 30371 setCookie("userZIP", GetQueryStringParams("zip")); 30372 } else { 30373 setCookie("userZIP", jQuery("#txt-zipcode").val()); 30374 } 30375 30376 setCookie("Referrer", document.referrer); 30377 $("#txt-zipcode").siblings().html(""); 30378 $("#txt-zipcode").siblings().css({ "display": "none" });
30379 setCookie("userRegion", userRegion); 30380 userZIP = getCookie("userZIP"); 30381 menuSelected = getCookie("menu-selected"); 30382 preZipPage = sessionStorage.getItem("preZipPage"); 30383 if ( preZipPage != null || preZipPage != undefined) { 30384 window.location.href = preZipPage; 30385 sessionStorage.removeItem("preZipPage"); 30386 } 30387 else if (menuSelected == null && (document.referrer.indexOf('chip') > -1)) { 30388 if (userRegion == "western-new-york" || userRegion == "west-virginia" || userRegion == "delaware" || userRegion == "northeastern-new-york" || userRegion == "southeastern-pennsylvania") { 30389 window.location.href = window.location.protocol + "//" + window.location.host + "/" + userRegion + "/chip"; 30390 } 30391 else { 30392 const referrerPathname = new URL(document.referrer) 30393 const referrerPathnameRegion = referrerPathname.pathname.split('/')[1]; 30394 window.location.href = getCookie("Referrer").replace(referrerPathnameRegion, userRegion); 30395 } 30396 } 30397 30398 else if (menuSelected == null && (document.referrer.indexOf('individual-families') > -1)) { 30399 30400 const referrerPathname = new URL(document.referrer) 30401 const referrerPathnameRegion = referrerPathname.pathname.split('/')[1]; 30402 window.location.href = getCookie("Referrer").replace(referrerPathnameRegion, userRegion); 30403 30404 30405 } 30406 30407 else if (menuSelected == null && (document.referrer.indexOf('social-determinants-of-health') > -1)) { 30408 30409 const referrerPathname = new URL(document.referrer) 30410 const referrerPathnameRegion = referrerPathname.pathname.split('/')[1]; 30411 window.location.href = getCookie("Referrer").replace(referrerPathnameRegion, userRegion); 30412 30413 } 30414 else if (menuSelected == null && window.location.href.indexOf("/reservations/medicare/zipcode-gate-login") !== -1) { 30415 if (userRegion == "southeastern-pennsylvania" && !reservationforSEPA) { 30416 window.location.href = window.location.protocol + "//" + window.location.host + "/404"; 30417 } else { 30418 window.location.href = window.location.protocol + "//" + window.location.host + "/reservations/medicare"; 30419 } 30420 } 30421 else if (menuSelected == 'reservation-subpage' && window.location.href.indexOf("/reservations/medicare/zipcode-gate-login") !== -1) { 30422 if (userRegion == "southeastern-pennsylvania" && !reservationforSEPA) { 30423 window.location.href = window.location.protocol + "//" + window.location.host + "/404"; 30424 } 30425 else { 30426 window.location.href = getCookie("pageRequested"); 30427 } 30428 } 30429 30430 else if ((document.referrer.indexOf('employer') > -1)) { 30431 if ((document.referrer.indexOf('wpa') > -1)) { 30432 employerPageRegion = "western-pennsylavnia"; 30433 employerPageRegionCode = "wpa"; 30434 employerRegionalPage = 1; 30435 } 30436 else if ((document.referrer.indexOf('cpa') > -1)) { 30437 employerPageRegion = "central-pennsylavnia"; 30438 employerPageRegionCode = "cpa"; 30439 employerRegionalPage = 1; 30440 } 30441 else if ((document.referrer.indexOf('nepa') > -1)) { 30442 employerPageRegion = "northeastern-pennsylavnia"; 30443 employerPageRegionCode = "nepa"; 30444 employerRegionalPage = 1; 30445 } 30446 else if ((document.referrer.indexOf('wv') > -1)) { 30447 employerPageRegion = "west-virginia"; 30448 employerPageRegionCode = "wv"; 30449 employerRegionalPage = 1; 30450 } 30451 else if ((document.referrer.indexOf('de') > -1)) { 30452 employerPageRegion = "delware"; 30453 employerPageRegionCode = "de"; 30454 employerRegionalPage = 1; 30455 } 30456 else if ((document.referrer.indexOf('sepa') > -1)) { 30457 employerPageRegion = "southeastern-pennsylvania"; 30458 employerPageRegionCode = "sepa"; 30459 employerRegionalPage = 1; 30460 } 30461 30462 if (employerRegionalPage == 1 && employerPageRegionCode) { 30463 if (getCookie("menu-selected") == null) { 30464 if (getCookie("Referrer")) { 30465 //window.location.href=getCookie("Referrer"); 30466 if (userRegion == "western-pennsylvania") { regionCode = "wpa"; } 30467 else if (userRegion == "central-pennsylvania") { regionCode = "cpa"; } 30468 else if (userRegion == "northeastern-pennsylvania") { regionCode = "nepa"; } 30469 else if (userRegion == "west-virginia") { regionCode = "wv"; } 30470 else if (userRegion == "delaware") { regionCode = "de"; } 30471 else if (userRegion == "northeastern-new-york") { regionCode = "neny"; } 30472 else if (userRegion == "western-new-york") { regionCode = "wny"; } 30473 else if (userRegion == "southeastern-pennsylvania") { regionCode = "sepa"; } 30474 30475 window.location.href = getCookie("Referrer").replace(employerPageRegionCode, regionCode); //replace employerPageRegionCode with new region userRegion 30476 } 30477 } 30478 } 30479 else if (getCookie("menu-selected") == null) { 30480 if (getCookie("Referrer")) { 30481 window.location.href = getCookie("Referrer"); 30482 } 30483 } 30484 } 30485 else if ((document.referrer.indexOf('/campaigns/medicare-11-form') > -1)) { 30486 if((document.referrer.indexOf('offercode') > -1) || (document.referrer.indexOf('offer_code') > -1)){ 30487 window.location.href = window.location.protocol + "//" + window.location.host + "/campaigns/medicare-11-form?offercode="+sessionStorage.getItem("offerCode"); 30488 } 30489 else{ 30490 window.location.href = window.location.protocol + "//" + window.location.host + "/campaigns/medicare-11-form"; 30491 } 30492 } 30493 else if ((getCookie("menu-selected") == null) && (document.referrer.indexOf('employer') <= -1)) { 30494 if (getCookie("Referrer") != null) { 30495 window.location.href = getCookie("Referrer"); 30496 } 30497 else { 30498 redirecttoZipcodeGate(); 30499 } 30500 } 30501 30502 if (getCookie("menu-selected") == "member-login") { 30503 if (userRegion == "western-pennsylvania" || userRegion == "northeastern-pennsylvania") { 30504 30505 window.open("https://www.highmarkbcbs.com/home/", "_blank"); 30506 } 30507 else if (userRegion == "central-pennsylvania" || userRegion == "southeastern-pennsylvania") { 30508 window.open("https://www.highmarkblueshield.com/", "_blank"); 30509 30510 } 30511 else if (userRegion == "west-virginia") { 30512 window.open("https://www.highmarkbcbswv.com/home/", "_blank"); 30513 30514 } 30515 else if (userRegion == "delaware") { 30516 window.open("https://www.highmarkbcbsde.com/home/", "_blank"); 30517 30518 } 30519 window.location.href = getCookie("Referrer"); 30520 30521 } else if (getCookie("menu-selected") == "employer-member-login") { 30522 if (userRegion == "western-pennsylvania" || userRegion == "northeastern-pennsylvania") { 30523 30524 window.open("https://www.highmarkbcbs.com/home/", "_blank"); 30525 } 30526 else if (userRegion == "central-pennsylvania" || userRegion == "southeastern-pennsylvania") { 30527 window.open("https://www.highmarkblueshield.com/", "_blank"); 30528 30529 } 30530 else if (userRegion == "west-virginia") { 30531 window.open("https://www.highmarkbcbswv.com/home/", "_blank"); 30532 30533 } 30534 else if (userRegion == "delaware") { 30535 window.open("https://www.highmarkbcbsde.com/home/", "_blank"); 30536 30537 } 30538 else if (userRegion == "western-new-york") { 30539 window.open("https://www.highmarkbcbs.com/home/", "_blank"); 30540 30541 } 30542 else if (userRegion == "northeastern-new-york") { 30543 window.open("https://www.highmarkblueshield.com/home/", "_blank"); 30544 30545 } 30546 window.location.href = getCookie("Referrer"); 30547 30548 } 30549 else if (getCookie("menu-selected") == "medical-policy") { 30550 window.location.href = window.location.protocol + "//" + window.location.host + "/" + userRegion + "/medical-policy?zg=false"; 30551 } 30552 30553 else if (getCookie("menu-selected") == "sdoh-learnmore") { 30554 window.location.href = window.location.protocol + "//" + window.location.host + "/" + userRegion + "/social-determinants-of-health/the-80percent-project"; 30555 } 30556 30557 else if (getCookie("menu-selected") == "provider-resource-center") { 30558 if (userRegion == "central-pennsylvania" || userRegion == "northeastern-pennsylvania" || userRegion == "southeastern-pennsylvania") { 30559 30560 window.open("https://hbs.highmarkprc.com/", "_blank"); 30561 } 30562 else if (userRegion == "western-pennsylvania") { 30563 window.open("https://hbcbs.highmarkprc.com/", "_blank"); 30564 30565 } 30566 else if (userRegion == "west-virginia") { 30567 window.open("https://hwvbcbs.highmarkprc.com/", "_blank"); 30568 } 30569 else if (userRegion == "delaware") { 30570 window.open("https://hdebcbs.highmarkprc.com/", "_blank"); 30571 } 30572 window.location.href = getCookie("Referrer"); 30573 } 30574 else if (getCookie("menu-selected") == "member-portal") { 30575 if (userRegion) { 30576 if (userRegion == "central-pennsylvania" || userRegion == "southeastern-pennsylvania") { 30577 window.open("https://www.highmarkblueshield.com/home/", "_blank"); 30578 } 30579 else if (userRegion == "western-pennsylvania" || userRegion == "northeastern-pennsylvania") { 30580 window.open("https://www.highmarkbcbs.com/home/", "_blank"); 30581 30582 } 30583 else if (userRegion == "west-virginia") { 30584 window.open("https://www.highmarkbcbswv.com/home/", "_blank"); 30585 } 30586 else if (userRegion == "delaware") { 30587 window.open("https://www.highmarkbcbsde.com/home/", "_blank"); 30588 } 30589 else if (userRegion == "western-new-york") { 30590 window.open("https://member.highmark.com/", "_blank"); 30591 } 30592 else if (userRegion == "northeastern-new-york") { 30593 window.open("https://member.highmark.com/", "_blank"); 30594 } 30595 window.location.href = getCookie("Referrer"); 30596 } 30597 } 30598 else if (getCookie("menu-selected") == "find-a-doctor") { 30599 if (userRegion == "western-pennsylvania" || userRegion == "northeastern-pennsylvania") { 30600 window.open("https://www.highmarkbcbs.com/find-a-doctor/#/home", "_blank"); 30601 } 30602 else if (userRegion == "central-pennsylvania") { 30603 window.open("https://www.highmarkblueshield.com/find-a-doctor/#/home", "_blank"); 30604 } 30605 else if (userRegion == "west-virginia") { 30606 window.open("https://www.highmarkbcbswv.com/find-a-doctor/", "_blank"); 30607 } 30608 else if (userRegion == "delaware") { 30609 window.open("https://www.highmarkbcbsde.com/find-a-doctor/", "_blank"); 30610 } 30611 else if (userRegion == "southeastern-pennsylvania") { 30612 window.open("https://highmark.sapphirecareselect.com/?ci=hbs", "_blank"); 30613 } 30614 window.location.href = getCookie("Referrer"); 30615 } 30616 else if (getCookie("menu-selected") == "CHIP") { 30617 window.open(window.location.protocol + "//" + window.location.host + "/" + userRegion + "/chip"); 30618 window.location.href = getCookie("Referrer"); 30619 } 30620 else if (getCookie("menu-selected") == "Employer-plans") { 30621 window.open(window.location.protocol + "//" + window.location.host + "/employer/solutions", "_self"); 30622 window.location.href = getCookie("Referrer"); 30623 } 30624 else if (getCookie("menu-selected") == "Employer-blues-oncall") { 30625 window.open(window.location.protocol + "//" + window.location.host + "/employer/client-resources/onboarding-tools", "_blank"); 30626 window.location.href = getCookie("Referrer"); 30627 } 30628 else if (getCookie("menu-selected") == "Employer-contact-us") { 30629 window.open(window.location.protocol + "//" + window.location.host + "/employer/get-started", "_blank"); 30630 window.location.href = getCookie("Referrer"); 30631 } 30632 else if (getCookie("menu-selected") == "Employer-link") { 30633 window.open(window.location.protocol + "//" + window.location.host + "/employer", "_blank"); 30634 window.location.href = getCookie("Referrer"); 30635 } 30636 else if (getCookie("menu-selected") == "Additional-services") { 30637 window.location.href = window.location.protocol + "//" + window.location.host + "/" + userRegion + "/individual-families/additional-products"; 30638 } 30639 30640 30641 else if (getCookie("menu-selected") == "shop-individual-family-plans") { 30642 window.location.href = window.location.protocol + "//" + window.location.host + "/" + userRegion + "/individual-families/shop-individuals-families"; 30643 } 30644 else if (getCookie("menu-selected") == "understanding-health-insurance") { 30645 window.location.href = window.location.protocol + "//" + window.location.host + "/" + userRegion + "/individual-families/understanding-health-insurance"; 30646 } 30647 else if (getCookie("menu-selected") == "special-enrollment-period") { 30648 window.location.href = window.location.protocol + "//" + window.location.host + "/" + userRegion + "/individual-families/special-enrollment-period"; 30649 } 30650 else if (getCookie("menu-selected") == "doctors-and-drugs") { 30651 window.location.href = window.location.protocol + "//" + window.location.host + "/" + userRegion + "/individual-families/doctors-drugs"; 30652 } 30653 else if (getCookie("m
30653enu-selected") == "dental-plans") { 30654 window.location.href = window.location.protocol + "//" + window.location.host + "/" + userRegion + "/individual-families/dental-plans"; 30655 } 30656 else if (getCookie("menu-selected") == "conversion-coverage") { 30657 window.location.href = window.location.protocol + "//" + window.location.host + "/" + userRegion + "/individual-families/special-circumstance-coverage"; 30658 } 30659 else if (getCookie("menu-selected") == "additional-products") { 30660 window.location.href = window.location.protocol + "//" + window.location.host + "/" + userRegion + "/individual-families/additional-products"; 30661 30662 } 30663 else if (getCookie("menu-selected") == "how-to-pick-a-plan") { 30664 window.location.href = window.location.protocol + "//" + window.location.host + "/" + userRegion + "/individual-families/how-to-pick-a-plan"; 30665 30666 } 30667 else if (getCookie("menu-selected") == "chip-main-nav") { 30668 window.location.href = window.location.protocol + "//" + window.location.host + "/" + userRegion + "/chip"; 30669 } 30670 else if (getCookie("menu-selected") == "what-is-chip") { 30671 if (userRegion == "western-pennsylvania" || userRegion == "central-pennsylvania" || userRegion == "northeastern-pennsylvania") { 30672 window.location.href = window.location.protocol + "//" + window.location.host + "/" + userRegion + "/chip/what-is-chip"; 30673 } 30674 else if (userRegion == "west-virginia" || userRegion == "delaware" || userRegion == "western-new-york" || userRegion == "northeastern-new-york" || userRegion == "southeastern-pennsylvania") { 30675 window.location.href = window.location.protocol + "//" + window.location.host + "/" + userRegion + "/chip"; 30676 } 30677 } 30678 else if (getCookie("menu-selected") == "apply-for-chip") { 30679 if (userRegion == "western-pennsylvania" || userRegion == "central-pennsylvania" || userRegion == "northeastern-pennsylvania") { 30680 window.location.href = window.location.protocol + "//" + window.location.host + "/" + userRegion + "/chip/apply-for-chip"; 30681 } 30682 else if (userRegion == "west-virginia" || userRegion == "delaware" || userRegion == "western-new-york" || userRegion == "northeastern-new-york" || userRegion == "southeastern-pennsylvania") { 30683 window.location.href = window.location.protocol + "//" + window.location.host + "/" + userRegion + "/chip"; 30684 } 30685 } 30686 else if (getCookie("menu-selected") == "chip-eligibility-costs") { 30687 if (userRegion == "western-pennsylvania" || userRegion == "central-pennsylvania" || userRegion == "northeastern-pennsylvania") { 30688 window.location.href = window.location.protocol + "//" + window.location.host + "/" + userRegion + "/chip/chip-eligibility-and-costs"; 30689 } 30690 else if (userRegion == "west-virginia" || userRegion == "delaware" || userRegion == "western-new-york" || userRegion == "northeastern-new-york"|| userRegion == "southeastern-pennsylvania") { 30691 window.location.href = window.location.protocol + "//" + window.location.host + "/" + userRegion + "/chip"; 30692 } 30693 } 30694 else if (getCookie("menu-selected") == "chip-resources") { 30695 if (userRegion == "western-pennsylvania" || userRegion == "central-pennsylvania") { 30696 window.location.href = window.location.protocol + "//" + window.location.host + "/" + userRegion + "/chip/chip-resources"; 30697 } 30698 else if (userRegion == "northeastern-pennsylvania") { 30699 window.location.href = window.location.protocol + "//" + window.location.host + "/northeastern-pennsylvania/chip/chip-resources"; 30700 } 30701 else if (userRegion == "west-virginia" || userRegion == "delaware" || userRegion == "western-new-york" || userRegion == "southeastern-pennsylvania") { 30702 window.location.href = window.location.protocol + "//" + window.location.host + "/" + userRegion + "/chip"; 30703 } 30704 else if (userRegion == "northeastern-new-york") { 30705 window.location.href = window.location.protocol + "//" + window.location.host + "/northeastern-new-york/chip"; 30706 } 30707 } 30708 else if (getCookie("menu-selected") == "chip-doctors-and-drugs") { 30709 if (userRegion == "western-pennsylvania" || userRegion == "central-pennsylvania") { 30710 window.location.href = window.location.protocol + "//" + window.location.host + "/" + userRegion + "/chip/doctors-drugs"; 30711 } 30712 else if (userRegion == "northeastern-pennsylvania") { 30713 window.location.href = window.location.protocol + "//" + window.location.host + "/northeastern-pennsylvania/chip/doctors-drugs"; 30714 } 30715 else if (userRegion == "west-virginia" || userRegion == "delaware" || userRegion == "western-new-york" || userRegion == "southeastern-pennsylvania") { 30716 window.location.href = window.location.protocol + "//" + window.location.host + "/" + userRegion + "/chip"; 30717 } 30718 else if (userRegion == "northeastern-new-york") { 30719 window.location.href = window.location.protocol + "//" + window.location.host + "/northeastern-new-york/chip"; 30720 } 30721 } 30722 else if (getCookie("menu-selected") == "chip-special-needs") { 30723 if (userRegion == "western-pennsylvania" || userRegion == "central-pennsylvania" || userRegion == "northeastern-pennsylvania") { 30724 window.location.href = window.location.protocol + "//" + window.location.host + "/" + userRegion + "/chip/chip-special-needs-case-management";
30725 } 30726 else if (userRegion == "west-virginia" || userRegion == "delaware" || userRegion == "western-new-york" || userRegion == "northeastern-new-york" || userRegion == "southeastern-pennsylvania") { 30727 window.location.href = window.location.protocol + "//" + window.location.host + "/" + userRegion + "/chip"; 30728 } 30729 } 30730 else if (getCookie("menu-selected") == "chip-covid-19-alert") { 30731 if (userRegion == "western-pennsylvania" || userRegion == "central-pennsylvania" || userRegion == "northeastern-pennsylvania") { 30732 window.location.href = window.location.protocol + "//" + window.location.host + "/" + userRegion + "/chip/chip-covid-19-alert"; 30733 } 30734 else if (userRegion == "west-virginia" || userRegion == "delaware" || userRegion == "western-new-york" || userRegion == "northeastern-new-york" || userRegion == "southeastern-pennsylvania") { 30735 window.location.href = window.location.protocol + "//" + window.location.host + "/" + userRegion + "/chip"; 30736 } 30737 } 30738 else if (getCookie("menu-selected") == "quality-assurance") { 30739 if (userRegion == "western-pennsylvania") { 30740 window.open(window.location.protocol + "//" + window.location.host + "/content/dam/digital-marketing/en/highmark/highmarkdotcom/pdfs/quality-assurance/CS204330_NCQAPreSale_BRO_BCBS_R2.pdf", "_blank"); 30741 } 30742 else if (userRegion == "northeastern-pennsylvania") { 30743 window.open(window.location.protocol + "//" + window.location.host + "/content/dam/digital-marketing/en/highmark/highmarkdotcom/pdfs/quality-assurance/CS204330_NCQAPreSale_BRO_BCBS_R2.pdf", "_blank"); 30744 } 30745 30746 else if (userRegion == "central-pennsylvania" || userRegion == "southeastern-pennsylvania") { 30747 window.open(window.location.protocol + "//" + window.location.host + "/content/dam/digital-marketing/en/highmark/highmarkdotcom/pdfs/quality-assurance/CS204330_NCQAPreSale_BRO_BS_R2.pdf", "_blank"); 30748 } 30749 else if (userRegion == "west-virginia") { 30750 window.open(window.location.protocol + "//" + window.location.host + "/content/dam/digital-marketing/en/highmark/highmarkdotcom/pdfs/quality-assurance/CS204330_NCQAPreSale_BRO_WV_R2.pdf", "_blank"); 30751 } 30752 else if (userRegion == "delaware") { 30753 window.open(window.location.protocol + "//" + window.location.host + "/content/dam/digital-marketing/en/highmark/highmarkdotcom/pdfs/quality-assurance/CS204330_NCQAPreSale_BRO_DE_R2.pdf", "_blank"); 30754 } 30755 window.location.href = getCookie("Referrer"); 30756 } 30757 else if (getCookie("menu-selected") == "aca-basic-seminar") { 30758 if (userRegion == "western-pennsylvania") { 30759 window.open("https://webinars.on24.com/highmark/IntroToACAWPA1", "_blank"); 30760 } 30761 else if (userRegion == "northeastern-pennsylvania") { 30762 window.open("https://webinars.on24.com/highmark/IntroToACANEPA1", "_blank"); 30763 } 30764 30765 else if (userRegion == "central-pennsylvania" || userRegion == "southeastern-pennsylvania") { 30766 window.open("https://webinars.on24.com/highmark/IntroToACACPA1", "_blank"); 30767 } 30768 else if (userRegion == "west-virginia") { 30769 window.open("https://webinars.on24.com/highmark/IntrotoACAWV1", "_blank"); 30770 } 30771 else if (userRegion == "delaware") { 30772 window.open("https://webinars.on24.com/highmark/IntroToACADE1", "_blank"); 30773 } 30774 window.location.href = getCookie("Referrer"); 30775 } 30776 else if (getCookie("menu-selected") == "main-nav-aca") { 30777 if (userRegion == 'western-new-york') { 30778 window.open(window.location.protocol + "//" + window.location.host + "/wester
30778n-new-york/individual-families", "_self"); 30779 } 30780 else if (userRegion == 'northeastern-new-york') { 30781 window.open(window.location.protocol + "//" + window.location.host + "/northeastern-new-york/individual-families", "_self"); 30782 } 30783 else if (userRegion == 'southeastern-pennsylvania') { 30784 window.open(window.location.protocol + "//" + window.location.host + "/404", "_self"); 30785 } 30786 else { 30787 window.open(window.location.protocol + "//" + window.location.host + "/reservations/aca", "_self"); 30788 } 30789 30790 } 30791 else if (getCookie("menu-selected") == "advisor-page") { 30792 window.location.href = window.location.protocol + "//" + window.location.host + "/reservations/medicare/meet-medicare-advisor"; 30793 } 30794 else if (getCookie("menu-selected") == 'reservation-subpage') { 30795 30796 } 30797 changeBrandLogo(); 30798 } 30799 $("div.loading").css("display", "none"); 30800 }, 30801 error: function (xhr) { 30802 $(".error-constraint").html("Please enter a valid zipcode"); 30803 $(".error-constraint").css({ "display": "inline", "color": "#B70C0C" }); 30804 $(".error-constraint").removeClass("floating-success"); 30805 $("div.loading").css("display", "none"); 30806 return; 30807 } 30808 30809 30810 }); 30811 30812} 30813var intervalnumber; 30814 30815function stopCountdown(intervalnumber) { 30816 var interval = "interval" + intervalnumber; 30817 clearInterval(interval); 30818 jQuery("#divZIPRedirect").fadeOut(); 30819 if (intervalnumber == 1) { 30820 closeSeconds1 = -1; 30821 } else if (intervalnumber == 2) { 30822 closeSeconds2 = -1; 30823 } else if (intervalnumber == 3) { 30824 closeSeconds3 = -1; 30825 } else if (intervalnumber == 4) { 30826 closeSeconds4 = -1; 30827 } else if (intervalnumber == 5) { 30828 closeSeconds5 = -1; 30829 } 30830} 30831 30832function setCookie(cname, cvalue, exdays) { 30833 var d = new Date(); 30834 d.setTime(d.getTime() + 3600 * 24000); 30835 var expires = 'expires=' + d.toUTCString(); 30836 document.cookie = cname + '=' + cvalue + '; ' + expires + '; path=/'; 30837} 30838 30839 30840function getCookie(name) { 30841 var re = new RegExp(name + '=([^;]+)'); 30842 var value = re.exec(document.cookie); 30843 return value !== null ? unescape(value[1]) : null; 30844} 30845 30846 30847 30848jQuery("#hmk-zipcode-gate").click(function () { 30849 30850 setCookie("menu-selected", ""); 30851 30852 if (getAEMmode) { 30853 window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/zipcode-gate-login.html"; 30854 } 30855 else { 30856 window.location.href = window.location.protocol + "//" + window.location.host + "/zipcode-gate-login"; 30857 30858 } 30859 30860 if (userRegionCookie) { 30861 jQuery("#txt-zipcode").val(userZipCookie); 30862 } 30863 30864 30865}); 30866 30867jQuery("#mylocation-mobile").click(function () { 30868 setCookie("menu-selected", ""); 30869 if (getAEMmode) { 30870 window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/zipcode-gate-login.html"; 30871 } 30872 else { 30873 window.location.href = window.location.protocol + "//" + window.location.host + "/zipcode-gate-login"; 30874 } 30875 30876 if (userRegionCookie) { 30877 jQuery("#txt-zipcode").val(userZipCookie); 30878 } 30879 30880}); 30881 30882jQuery("#mylocation").click(function () { 30883 setCookie("menu-selected", ""); 30884 if (getAEMmode) { 30885 window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/zipcode-gate-login.html"; 30886 } 30887 else { 30888 window.location.href = window.location.protocol + "//" + window.location.host + "/zipcode-gate-login"; 30889 } 30890 30891 if (userRegionCookie) { 30892 jQuery("#txt-zipcode").val(userZipCookie); 30893 } 30894 30895}); 30896 30897jQuery("#selectYourState").click(function () { 30898 30899 setCookie("menu-selected", ""); 30900}); 30901 30902jQuery("#hmk-zipcode-gate-mobile").click(function () {
30903 setCookie("menu-selected", ""); 30904 30905 if (getAEMmode) { 30906 window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/zipcode-gate-login.html"; 30907 } 30908 else { 30909 window.location.href = window.location.protocol + "//" + window.location.host + "/zipcode-gate-login"; 30910 } 30911 30912 if (userRegionCookie) { 30913 jQuery("#txt-zipcode").val(userZipCookie); 30914 } 30915}); 30916 30917jQuery("#memberLogin-mobile").click(function () { 30918 30919 if (!userRegionCookie) { 30920 setCookie("menu-selected", "member-login"); 30921 if (userRegionCookie) { 30922 jQuery("#txt-zipcode").val(userZipCookie); 30923 } 30924 else { 30925 if (getAEMmode) { 30926 window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/zipcode-gate-login.html"; 30927 } 30928 else { 30929 window.location.href = window.location.protocol + "//" + window.location.host + "/zipcode-gate-login"; 30930 } 30931 30932 } 30933 } 30934 else { 30935 if (userRegionCookie) { 30936 if (userRegionCookie == "western-pennsylvania" || userRegionCookie == "northeastern-pennsylvania") { jQuery("#memberLogin-mobile").attr("href", "https://www.highmarkbcbs.com/home/"); } 30937 else if (userRegionCookie == "central-pennsylvania" || userRegionCookie == "southeastern-pennsylvania") { jQuery("#memberLogin-mobile").attr("href", "https://www.highmarkblueshield.com/"); } 30938 else if (userRegionCookie == "west-virginia") { jQuery("#memberLogin-mobile").attr("href", "https://www.highmarkbcbswv.com/home/"); } 30939 else if (userRegionCookie == "delaware") { jQuery("#memberLogin-mobile").attr("href", "https://www.highmarkbcbsde.com/home/"); } 30940 else if (userRegionCookie == "western-new-york") { jQuery("#memberLogin-mobile").attr("href", "https://member.highmark.com/"); } 30941 else if (userRegionCookie == "northeastern-new-york") { jQuery("#memberLogin-mobile").attr("href", "https://member.highmark.com/"); } 30942 } 30943 } 30944 30945}); 30946 30947jQuery("[id='employerMemberLogin-mobile']").click(function () { 30948 30949 if (!userRegionCookie) { 30950 setCookie("menu-selected", "employer-member-login"); 30951 if (userRegionCookie) { 30952 jQuery("#txt-zipcode").val(userZipCookie); 30953 } 30954 else { 30955 redirecttoZipcodeGate(); 30956 } 30957 } 30958 else { 30959 if (userRegionCookie) { 30960 if (userRegionCookie == "western-pennsylvania" || userRegionCookie == "northeastern-pennsylvania") { jQuery("[id='employerMemberLogin-mobile']").attr("href", "https://www.highmarkbcbs.com/home/"); } 30961 else if (userRegionCookie == "central-pennsylvania" || userRegionCookie == "southeastern-pennsylvania") { jQuery("[id='employerMemberLogin-mobile']").attr("href", "https://www.highmarkblueshield.com/"); } 30962 else if (userRegionCookie == "west-virginia") { jQuery("[id='employerMemberLogin-mobile']").attr("href", "https://www.highmarkbcbswv.com/home/"); } 30963 else if (userRegionCookie == "delaware") { jQuery("[id='employerMemberLogin-mobile']").attr("href", "https://www.highmarkbcbsde.com/home/"); } 30964 else if (userRegionCookie == "western-new-york") { jQuery("[id='employerMemberLogin-mobile']").attr("href", "https://www.highmarkbcbs.com/home/"); } 30965 else if (userRegionCookie == "northeastern-new-york") { jQuery("[id='employerMemberLogin-mobile']").attr("href", "https://www.highmarkblueshield.com/home/"); } 30966 } 30967 } 30968 30969}); 30970 30971jQuery("[id='memberLogin']").click(function () { 30972 30973 30974 if (!userRegionCookie) { 30975 setCookie("menu-selected", "member-login"); 30976 if (userRegionCookie) { 30977 jQuery("#txt-zipcode").val(userZipCookie); 30978 } 30979 else { 30980 redirecttoZipcodeGate(); 30981 } 30982 } 30983 else { 30984 if (userRegionCookie) { 30985 if (userRegionCookie == "western-pennsylvania" || userRegionCookie == "northeastern-pennsylvania") { jQuery("[id='memberLogin']").attr("href", "https://www.highmarkbcbs.com/home/"); } 30986 else if (userRegionCookie == "central-pennsylvania" || userRegionCookie == "southeastern-pennsylvania") { jQuery("[id='memberLogin']").attr("href", "https://www.highmarkblueshield.com/"); } 30987 else if (userRegionCookie == "west-virginia") { jQuery("[id='memberLogin']").attr("href", "https://www.highmarkbcbswv.com/home/"); } 30988 else if (userRegionCookie == "delaware") { jQuery("[id='memberLogin']").attr("href", "https://www.highmarkbcbsde.com/home/"); } 30989 else if (userRegionCookie == "western-new-york") { jQuery("[id='memberLogin']").attr("href", "https://member.highmark.com/"); } 30990 else if (userRegionCookie == "northeastern-new-york") { jQuery("[id='memberLogin']").attr("href", "https://member.highmark.com/"); } 30991 } 30992 } 30993 30994}); 30995 30996jQuery("[id='employerMemberLogin']").click(function () { 30997 30998 if (!userRegionCookie) {
30999 setCookie("menu-selected", "employer-member-login"); 31000 if (userRegionCookie) { 31001 jQuery("#txt-zipcode").val(userZipCookie); 31002 } 31003 else { 31004 redirecttoZipcodeGate(); 31005 } 31006 } 31007 else { 31008 if (userRegionCookie) { 31009 if (userRegionCookie == "western-pennsylvania" || userRegionCookie == "northeastern-pennsylvania") { jQuery("[id='employerMemberLogin']").attr("href", "https://www.highmarkbcbs.com/home/"); } 31010 else if (userRegionCookie == "central-pennsylvania" || userRegionCookie == "southeastern-pennsylvania") { jQuery("[id='employerMemberLogin']").attr("href", "https://www.highmarkblueshield.com/"); } 31011 else if (userRegionCookie == "west-virginia") { jQuery("[id='employerMemberLogin']").attr("href", "https://www.highmarkbcbswv.com/home/"); } 31012 else if (userRegionCookie == "delaware") { jQuery("[id='employerMemberLogin']").attr("href", "https://www.highmarkbcbsde.com/home/"); } 31013 else if (userRegionCookie == "western-new-york") { jQuery("[id='employerMemberLogin']").attr("href", "https://www.highmarkbcbs.com/home/"); } 31014 else if (userRegionCookie == "northeastern-new-york") { jQuery("[id='employerMemberLogin']").attr("href", "https://www.highmarkblueshield.com/home/"); } 31015 } 31016 } 31017 31018}); 31019 31020jQuery(".hmk-member_button").click(function () { 31021 if (!userRegionCookie) { 31022 setCookie("menu-selected", "member-login"); 31023 if (userRegionCookie) { 31024 jQuery("#txt-zipcode").val(userZipCookie); 31025 } 31026 else { 31027 redirecttoZipcodeGate(); 31028 } 31029 } 31030 else { 31031 if (userRegionCookie) { 31032 if (userRegionCookie == "western-pennsylvania" || userRegionCookie == "northeastern-pennsylvania") { jQuery("[id='memberLogin']").attr("href", "https://www.highmarkbcbs.com/home/"); } 31033 else if (userRegionCookie == "central-pennsylvania" || userRegionCookie == "southeastern-pennsylvania") { jQuery("[id='memberLogin']").attr("href", "https://www.highmarkblueshield.com/"); } 31034 else if (userRegionCookie == "west-virginia") { jQuery("[id='memberLogin']").attr("href", "https://www.highmarkbcbswv.com/home/"); } 31035 else if (userRegionCookie == "delaware") { jQuery("[id='memberLogin']").attr("href", "https://www.highmarkbcbsde.com/home/"); } 31036 else if (userRegionCookie == "western-new-york") { jQuery("#memberLogin").attr("href", "https://member.highmark.com/"); } 31037 else if (userRegionCookie == "northeastern-new-york") { jQuery("#memberLogin").attr("href", "https://member.highmark.com/"); } 31038 } 31039 } 31040 31041}); 31042 31043jQuery("#sdoh-learn-more-link").click(function () { 31044 if (!userRegionCookie) { 31045 setCookie("menu-selected", "sdoh-learnmore"); 31046 if (userRegionCookie) { 31047 jQuery("#txt-zipcode").val(userZipCookie); 31048 } 31049 else { 31050 redirecttoZipcodeGate(); 31051 } 31052 } 31053 else { 31054 jQuery("#sdoh-learn-more-link").attr("href", window.location.protocol + "//" + window.location.host + "/" + userRegionCookie + "/social-determinants-of-health/the-80percent-project"); 31055 } 31056 31057}); 31058 31059jQuery("#provider-resource-center-link").click(function (event) { 31060 event.preventDefault(); 31061 if (!userRegionCookie) { 31062 setCookie("menu-selected", "provider-resource-center"); 31063 redirecttoZipcodeGate(); 31064 31065 } 31066 else { 31067 if (userRegionCookie == "central-pennsylvania" || userRegionCookie == "northeastern-pennsylvania" || userRegionCookie == "southeastern-pennsylvania") { 31068 31069 window.open("https://hbs.highmarkprc.com/", "_blank"); 31070 } 31071 else if (userRegionCookie == "western-pennsylvania") { 31072 window.open("https://hbcbs.highmarkprc.com/", "_blank"); 31073 31074 } 31075 else if (userRegionCookie == "west-virginia") { 31076 window.open("https://hwvbcbs.highmarkprc.com/", "_blank"); 31077 } 31078 else if (userRegionCookie == "delaware") { 31079 window.open("https://hdebcbs.highmarkprc.com/", "_blank"); 31080 } 31081 } 31082}); 31083 31084jQuery(".member-portal-footer-link").click(function (event) { 31085 event.preventDefault(); 31086 if (!userRegionCookie) {
31087 setCookie("menu-selected", "member-portal"); 31088 redirecttoZipcodeGate(); 31089 } 31090 else { 31091 if (userRegionCookie == "central-pennsylvania" || userRegionCookie == "southeastern-pennsylvania") { 31092 window.open("https://www.highmarkblueshield.com/home/", "_blank"); 31093 } 31094 else if (userRegionCookie == "western-pennsylvania" || userRegionCookie == "northeastern-pennsylvania") { 31095 window.open("https://www.highmarkbcbs.com/home/", "_blank"); 31096 } 31097 else if (userRegionCookie == "west-virginia") { 31098 window.open("https://www.highmarkbcbswv.com/home/", "_blank"); 31099 } 31100 else if (userRegionCookie == "delaware") { 31101 window.open("https://www.highmarkbcbsde.com/home/", "_blank"); 31102 } 31103 else if (userRegionCookie == "western-new-york") { 31104 window.open("https://member.highmark.com/", "_blank"); 31105 } 31106 else if (userRegionCookie == "northeastern-new-york") { 31107 window.open("https://member.highmark.com/", "_blank"); 31108 } 31109 31110 } 31111}); 31112 31113 31114jQuery("#medical-policy-link,.medical-policy-link").click(function () { 31115 if (!userRegionCookie) { 31116 setCookie("menu-selected", "medical-policy"); 31117 redirecttoZipcodeGate(); 31118 } 31119 else { 31120 jQuery("#medical-policy-link,.medical-policy-link").attr("href", window.location.protocol + "//" + window.location.host + "/" + userRegionCookie + "/medical-policy?zg=false"); 31121 } 31122}); 31123 31124jQuery("#CHIP-link").click(function () { 31125 if (!userRegionCookie) { 31126 setCookie("menu-selected", "CHIP"); 31127 redirecttoZipcodeGate(); 31128 } 31129 else { 31130 jQuery("[id='chip-main-nav']").attr("href", window.location.protocol + "//" + window.location.host + "/" + userRegionCookie + "/chip"); 31131 } 31132}); 31133 31134jQuery("#Employer-plans-link").click(function () { 31135 if (!userRegionCookie) { 31136 setCookie("menu-selected", "Employer-plans"); 31137 redirecttoZipcodeGate(); 31138 } 31139 else { 31140 if (userRegionCookie) { 31141 jQuery("#Employer-plans-link").attr("href", window.location.protocol + "//" + window.location.host + "/employer/solutions"); 31142 } 31143 } 31144}); 31145 31146jQuery("#Employer-blues-oncall-link").click(function () { 31147 if (!userRegionCookie) { 31148 setCookie("menu-selected", "Employer-blues-oncall"); 31149 redirecttoZipcodeGate(); 31150 } 31151 else { 31152 jQuery("#Employer-blues-oncall-link").attr("href", window.location.protocol + "//" + window.location.host + "/employer/client-resources/onboarding-tools"); 31153 } 31154}); 31155 31156jQuery("#Employer-contact-us-link").click(function () { 31157 if (!userRegionCookie) { 31158 setCookie("menu-selected", "Employer-contact-us"); 31159 redirecttoZipcodeGate(); 31160 } 31161 else { 31162 jQuery("#Employer-contact-us-link").attr("href", window.location.protocol + "//" + window.location.host + "/employer/get-started"); 31163 } 31164}); 31165 31166jQuery("#reservations-zipcode-picker").click(function () { 31167 setCookie("menu-selected", ""); 31168 31169 if (getAEMmode) { 31170 window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/reservations/medicare/zipcode-gate-login.html"; 31171 } 31172 else { 31173 window.location.href = window.location.protocol + "//" + window.location.host + "/reservations/medicare/zipcode-gate-login"; 31174 } 31175 if (userRegionCookie) { 31176 jQuery("#txt-zipcode").val(userZipCookie); 31177 } 31178}); 31179 31180jQuery("#reservations-zipcode-mobile-picker").click(function () { 31181 setCookie("menu-selected", ""); 31182 if (getAEMmode) { 31183 window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/reservations/medicare/zipcode-gate-login.html"; 31184 } 31185 else { 31186 window.location.href = window.location.protocol + "//" + window.location.host + "/reservations/medicare/zipcode-gate-login"; 31187 } 31188 if (userRegionCookie) { 31189 jQuery("#txt-zipcode").val(userZipCookie); 31190 } 31191}); 31192 31193jQuery("#Employer-link").click(function () { 31194 if (!userRegionCookie) { 31195 setCookie("menu-selected", "Employer-link"); 31196 redirecttoZipcodeGate(); 31197 } 31198 else { 31199 jQuery("#Employer-link").attr("href", "https://www.highmarkemployer.com?zip=" + userZipCookie); 31200 } 31201}); 31202 31203jQuery("#Additional-services-link").click(function () { 31204 if (!userRegionCookie) {
31205 setCookie("menu-selected", "Additional-services"); 31206 redirecttoZipcodeGate(); 31207 } 31208 else { 31209 jQuery("[id='additional-products']").attr("href", window.location.protocol + "//" + window.location.host + "/" + userRegionCookie + "/individual-families/additional-products"); 31210 } 31211}); 31212 31213jQuery("#quality-assurance,.quality-assurance").click(function () { 31214 31215 event.preventDefault(); 31216 if (!userRegionCookie) { 31217 setCookie("menu-selected", "quality-assurance"); 31218 redirecttoZipcodeGate(); 31219 } 31220 else { 31221 if (userRegionCookie == "western-pennsylvania") { 31222 window.open(window.location.protocol + "//" + window.location.host + "/content/dam/digital-marketing/en/highmark/highmarkdotcom/pdfs/quality-assurance/CS204330_NCQAPreSale_BRO_BCBS_R2.pdf", "_blank"); 31223 } 31224 else if (userRegionCookie == "northeastern-pennsylvania") { 31225 window.open(window.location.protocol + "//" + window.location.host + "/content/dam/digital-marketing/en/highmark/highmarkdotcom/pdfs/quality-assurance/CS204330_NCQAPreSale_BRO_BCBS_R2.pdf", "_blank"); 31226 } 31227 else if (userRegionCookie == "central-pennsylvania" || userRegionCookie == "southeastern-pennsylvania") { 31228 window.open(window.location.protocol + "//" + window.location.host + "/content/dam/digital-marketing/en/highmark/highmarkdotcom/pdfs/quality-assurance/CS204330_NCQAPreSale_BRO_BS_R2.pdf", "_blank"); 31229 } 31230 else if (userRegionCookie == "west-virginia") { 31231 window.open(window.location.protocol + "//" + window.location.host + "/content/dam/digital-marketing/en/highmark/highmarkdotcom/pdfs/quality-assurance/CS204330_NCQAPreSale_BRO_WV_R2.pdf", "_blank"); 31232 } 31233 else if (userRegionCookie == "delaware") { 31234 window.open(window.location.protocol + "//" + window.location.host + "/content/dam/digital-marketing/en/highmark/highmarkdotcom/pdfs/quality-assurance/CS204330_NCQAPreSale_BRO_DE_R2.pdf", "_blank"); 31235 } 31236 } 31237}); 31238 31239jQuery("#aca-basic-seminar").click(function () { 31240 31241 event.preventDefault(); 31242 if (!userRegionCookie) { 31243 setCookie("menu-selected", "aca-basic-seminar"); 31244 redirecttoZipcodeGate(); 31245 } 31246 else { 31247 if (userRegionCookie == "western-pennsylvania") { 31248 window.open("https://webinars.on24.com/highmark/IntroToACAWPA1", "_blank"); 31249 } 31250 else if (userRegionCookie == "northeastern-pennsylvania") { 31251 window.open("https://webinars.on24.com/highmark/IntroToACANEPA1", "_blank"); 31252 } 31253 else if (userRegionCookie == "central-pennsylvania" || userRegionCookie == "southeastern-pennsylvania") { 31254 window.open("https://webinars.on24.com/highmark/IntroToACACPA1", "_blank"); 31255 } 31256 else if (userRegionCookie == "west-virginia") { 31257 window.open("https://webinars.on24.com/highmark/IntrotoACAWV1", "_blank"); 31258 } 31259 else if (userRegionCookie == "delaware") { 31260 window.open("https://webinars.on24.com/highmark/IntroToACADE1", "_blank"); 31261 } 31262 } 31263}); 31264 31265 31266$(document).on('click', "[id='shop-individual-family-plans']", function () { 31267 if (!userRegionCookie) { 31268 setCookie("menu-selected", "shop-individual-family-plans"); 31269 redirecttoZipcodeGate(); 31270 } 31271 else { 31272 if (getAEMmode) { 31273 jQuery("[id='shop-individual-family-plans']").attr("href", window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/" + userRegionCookie + "/individual-families/shop-individuals-families"); 31274 } 31275 else { 31276 jQuery("[id='shop-individual-family-plans']").attr("href", window.location.protocol + "//" + window.location.host + "/" + userRegionCookie + "/individual-families/shop-individuals-families"); 31277 } 31278 } 31279}); 31280 31281$(document).on('click', "[id='understanding-health-insurance']", function () { 31282 if (!userRegionCookie) { 31283 setCookie("menu-selected", "understanding-health-insurance"); 31284 redirecttoZipcodeGate(); 31285 } 31286 else { 31287 if (getAEMmode) { 31288 jQuery("[id='understanding-health-insurance']").attr("href", window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/" + userRegionCookie + "/individual-families/understanding-health-insurance"); 31289 } 31290 else { 31291 jQuery("[id='understanding-health-insurance']").attr("href", window.location.protocol + "//" + window.location.host + "/" + userRegionCookie + "/individual-families/understanding-health-insurance"); 31292 } 31293 } 31294}); 31295 31296$(document).on('click', "[id='special-enrollment-period']", function () { 31297 if (!userRegionCookie) {
31298 setCookie("menu-selected", "special-enrollment-period"); 31299 redirecttoZipcodeGate(); 31300 } 31301 else { 31302 if (getAEMmode) { 31303 jQuery("[id='special-enrollment-period']").attr("href", window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/" + userRegionCookie + "/individual-families/special-enrollment-period"); 31304 } 31305 else { 31306 jQuery("[id='special-enrollment-period']").attr("href", window.location.protocol + "//" + window.location.host + "/" + userRegionCookie + "/individual-families/special-enrollment-period"); 31307 } 31308 } 31309}); 31310 31311$(document).on('click', "[id='doctors-and-drugs']", function () { 31312 if (!userRegionCookie) { 31313 setCookie("menu-selected", "doctors-and-drugs"); 31314 redirecttoZipcodeGate(); 31315 } 31316 else { 31317 if (getAEMmode) { 31318 jQuery("[id='doctors-and-drugs']").attr("href", window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/" + userRegionCookie + "/individual-families/doctors-drugs"); 31319 } 31320 else { 31321 jQuery("[id='doctors-and-drugs']").attr("href", window.location.protocol + "//" + window.location.host + "/" + userRegionCookie + "/individual-families/doctors-drugs"); 31322 } 31323 } 31324}); 31325 31326 31327$(document).on('click', "[id='dental-plans']", function () { 31328 if (!userRegionCookie) { 31329 setCookie("menu-selected", "dental-plans"); 31330 redirecttoZipcodeGate(); 31331 } 31332 else { 31333 if (getAEMmode) { 31334 jQuery("[id='dental-plans']").attr("href", window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/" + userRegionCookie + "/individual-families/dental-plans"); 31335 } 31336 else { 31337 jQuery("[id='dental-plans']").attr("href", window.location.protocol + "//" + window.location.host + "/" + userRegionCookie + "/individual-families/dental-plans"); 31338 } 31339 } 31340}); 31341 31342$(document).on('click', "[id='conversion-coverage']", function () { 31343 if (!userRegionCookie) { 31344 setCookie("menu-selected", "conversion-coverage"); 31345 redirecttoZipcodeGate(); 31346 } 31347 else { 31348 if (getAEMmode) { 31349 jQuery("[id='conversion-coverage']").attr("href", window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/" + userRegionCookie + "/individual-families/special-circumstance-coverage"); 31350 } 31351 else { 31352 jQuery("[id='conversion-coverage']").attr("href", window.location.protocol + "//" + window.location.host + "/" + userRegionCookie + "/individual-families/special-circumstance-coverage"); 31353 31354 } 31355 } 31356}); 31357 31358$(document).on('click', "[id='additional-products']", function () { 31359 if (!userRegionCookie) { 31360 setCookie("menu-selected", "additional-products"); 31361 redirecttoZipcodeGate(); 31362 } 31363 else { 31364 if (getAEMmode) { 31365 jQuery("[id='additional-products']").attr("href", window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/" + userRegionCookie + "/individual-families/additional-products"); 31366 } 31367 else { 31368 jQuery("[id='additional-products']").attr("href", window.location.protocol + "//" + window.location.host + "/" + userRegionCookie + "/individual-families/additional-products"); 31369 31370 } 31371 } 31372}); 31373 31374$(document).on('click', "[id='how-to-pick-a-plan']", function () { 31375 if (!userRegionCookie) { 31376 setCookie("menu-selected", "how-to-pick-a-plan"); 31377 redirecttoZipcodeGate(); 31378 } 31379 else { 31380 if (getAEMmode) { 31381 jQuery("[id='how-to-pick-a-plan']").attr("href", window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/" + userRegionCookie + "/individual-families/how-to-pick-a-plan"); 31382 } 31383 else { 31384 jQuery("[id='how-to-pick-a-plan']").attr("href", window.location.protocol + "//" + window.location.host + "/" + userRegionCookie + "/individual-families/how-to-pick-a-plan"); 31385 } 31386 } 31387}); 31388 31389$(document).on('click', "[id='chip-main-nav']", function () { 31390 if (!userRegionCookie) {
31391 setCookie("menu-selected", "chip-main-nav"); 31392 redirecttoZipcodeGate(); 31393 } 31394 else { 31395 if (getAEMmode) { 31396 jQuery("[id='chip-main-nav']").attr("href", window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/" + userRegionCookie + "/chip"); 31397 } 31398 else { 31399 jQuery("[id='chip-main-nav']").attr("href", window.location.protocol + "//" + window.location.host + "/" + userRegionCookie + "/chip"); 31400 } 31401 } 31402}); 31403 31404 31405$(document).on('click', "[id='what-is-chip']", function () { 31406 if (!userRegionCookie) { 31407 setCookie("menu-selected", "what-is-chip"); 31408 redirecttoZipcodeGate(); 31409 } 31410 else { 31411 if (userRegionCookie) { 31412 if (userRegionCookie == "western-pennsylvania") { jQuery("[id='what-is-chip']").attr("href", window.location.protocol + "//" + window.location.host + "/western-pennsylvania/chip/what-is-chip"); } 31413 else if (userRegionCookie == "northeastern-pennsylvania") { jQuery("[id='what-is-chip']").attr("href", window.location.protocol + "//" + window.location.host + "/northeastern-pennsylvania/chip/what-is-chip"); } 31414 else if (userRegionCookie == "central-pennsylvania") { jQuery("[id='what-is-chip']").attr("href", window.location.protocol + "//" + window.location.host + "/central-pennsylvania/chip/what-is-chip"); } 31415 else if (userRegionCookie == "west-virginia") { jQuery("[id='what-is-chip']").attr("href", window.location.protocol + "//" + window.location.host + "/west-virginia/chip"); } 31416 else if (userRegionCookie == "delaware") { jQuery("[id='what-is-chip']").attr("href", window.location.protocol + "//" + window.location.host + "/delaware/chip"); } 31417 else if (userRegionCookie == 'western-new-york') { 31418 jQuery("[id='what-is-chip']").attr("href", window.location.protocol + "//" + window.location.host + "/western-new-york/chip"); 31419 } 31420 else if (userRegionCookie == 'northeastern-new-york') { 31421 jQuery("[id='what-is-chip']").attr("href", window.location.protocol + "//" + window.location.host + "/northeastern-new-york/chip"); 31422 } 31423 else if (userRegionCookie == 'southeastern-pennsylvania') { 31424 jQuery("[id='what-is-chip']").attr("href", window.location.protocol + "//" + window.location.host + "/southeastern-pennsylvania/chip"); 31425 } 31426 31427 } 31428 } 31429}); 31430 31431$(document).on('click', "[id='apply-for-chip']", function () { 31432 if (!userRegionCookie) { 31433 setCookie("menu-selected", "apply-for-chip"); 31434 redirecttoZipcodeGate(); 31435 } 31436 else { 31437 if (userRegionCookie) { 31438 if (userRegionCookie == "western-pennsylvania") { jQuery("[id='apply-for-chip']").attr("href", window.location.protocol + "//" + window.location.host + "/western-pennsylvania/chip/apply-for-chip"); } 31439 else if (userRegionCookie == "northeastern-pennsylvania") { jQuery("[id='apply-for-chip']").attr("href", window.location.protocol + "//" + window.location.host + "/northeastern-pennsylvania/chip/apply-for-chip"); } 31440 else if (userRegionCookie == "central-pennsylvania") { jQuery("[id='apply-for-chip']").attr("href", window.location.protocol + "//" + window.location.host + "/central-pennsylvania/chip/apply-for-chip"); } 31441 else if (userRegionCookie == "west-virginia") { jQuery("[id='apply-for-chip']").attr("href", window.location.protocol + "//" + window.location.host + "/west-virginia/chip"); } 31442 else if (userRegionCookie == "delaware") { jQuery("[id='apply-for-chip']").attr("href", window.location.protocol + "//" + window.location.host + "/delaware/chip"); } 31443 else if (userRegionCookie == 'western-new-york') { 31444 jQuery("[id='apply-for-chip']").attr("href", window.location.protocol + "//" + window.location.host + "/western-new-york/chip/apply-for-chip"); 31445 } 31446 else if (userRegionCookie == 'northeastern-new-york') { 31447 jQuery("[id='apply-for-chip']").attr("href", window.location.protocol + "//" + window.location.host + "/northeastern-new-york/chip/apply-for-chip"); 31448 } 31449 else if (userRegionCookie == 'southeastern-pennsylvania') { 31450 jQuery("[id='apply-for-chip']").attr("href", window.location.protocol + "//" + window.location.host + "/southeastern-pennsylvania/chip"); 31451 } 31452 } 31453 } 31454}); 31455 31456$(document).on('click', "[id='chip-eligibility-costs']", function () { 31457 if (!userRegionCookie) {
31458 setCookie("menu-selected", "chip-eligibility-costs"); 31459 redirecttoZipcodeGate(); 31460 } 31461 else { 31462 if (userRegionCookie) { 31463 if (userRegionCookie == "western-pennsylvania") { jQuery("[id='chip-eligibility-costs']").attr("href", window.location.protocol + "//" + window.location.host + "/western-pennsylvania/chip/chip-eligibility-and-costs"); } 31464 else if (userRegionCookie == "northeastern-pennsylvania") { jQuery("[id='chip-eligibility-costs']").attr("href", window.location.protocol + "//" + window.location.host + "/northeastern-pennsylvania/chip/chip-eligibility-and-costs"); } 31465 else if (userRegionCookie == "central-pennsylvania") { jQuery("[id='chip-eligibility-costs']").attr("href", window.location.protocol + "//" + window.location.host + "/central-pennsylvania/chip/chip-eligibility-and-costs"); } 31466 else if (userRegionCookie == "west-virginia") { jQuery("[id='chip-eligibility-costs']").attr("href", window.location.protocol + "//" + window.location.host + "/west-virginia/chip"); } 31467 else if (userRegionCookie == "delaware") { jQuery("[id='chip-eligibility-costs']").attr("href", window.location.protocol + "//" + window.location.host + "/delaware/chip"); } 31468 else if (userRegionCookie == 'western-new-york') { 31469 jQuery("[id='chip-eligibility-costs']").attr("href", window.location.protocol + "//" + window.location.host + "/western-new-york/chip"); 31470 } 31471 else if (userRegionCookie == 'northeastern-new-york') { 31472 jQuery("[id='chip-eligibility-costs']").attr("href", window.location.protocol + "//" + window.location.host + "/northeastern-new-york/chip"); 31473 } 31474 else if (userRegionCookie == 'southeastern-pennsylvania') { 31475 jQuery("[id='chip-eligibility-costs']").attr("href", window.location.protocol + "//" + window.location.host + "/southeastern-pennsylvania/chip"); 31476 } 31477 } 31478 } 31479}); 31480 31481$(document).on('click', "[id='chip-resources']", function () { 31482 if (!userRegionCookie) { 31483 setCookie("menu-selected", "chip-resources"); 31484 redirecttoZipcodeGate(); 31485 } 31486 else { 31487 if (userRegionCookie) { 31488 if (userRegionCookie == "western-pennsylvania") { jQuery("[id='chip-resources']").attr("href", window.location.protocol + "//" + window.location.host + "/western-pennsylvania/chip/chip-resources"); } 31489 else if (userRegionCookie == "northeastern-pennsylvania") { jQuery("[id='chip-resources']").attr("href", window.location.protocol + "//" + window.location.host + "/northeastern-pennsylvania/chip/chip-resources"); } 31490 else if (userRegionCookie == "central-pennsylvania") { jQuery("[id='chip-resources']").attr("href", window.location.protocol + "//" + window.location.host + "/central-pennsylvania/chip/chip-resources"); } 31491 else if (userRegionCookie == "west-virginia") { jQuery("[id='chip-resources']").attr("href", window.location.protocol + "//" + window.location.host + "/west-virginia/chip"); } 31492 else if (userRegionCookie == "delaware") { jQuery("[id='chip-resources']").attr("href", window.location.protocol + "//" + window.location.host + "/delaware/chip"); } 31493 else if (userRegionCookie == 'western-new-york') { 31494 jQuery("[id='chip-resources']").attr("href", window.location.protocol + "//" + window.location.host + "/western-new-york/chip"); 31495 } 31496 else if (userRegionCookie == 'northeastern-new-york') { 31497 jQuery("[id='chip-resources']").attr("href", window.location.protocol + "//" + window.location.host + "/northeastern-new-york/chip"); 31498 } 31499 else if (userRegionCookie == 'southeastern-pennsylvania') { 31500 jQuery("[id='chip-resources']").attr("href", window.location.protocol + "//" + window.location.host + "/southeastern-pennsylvania/chip"); 31501 } 31502 } 31503 } 31504}); 31505 31506$(document).on('click', "[id='chip-doctors-and-drugs']", function () { 31507 if (!userRegionCookie) { 31508 setCookie("menu-selected", "chip-doctors-and-drugs"); 31509 redirecttoZipcodeGate(); 31510 } 31511 else { 31512 if (userRegionCookie) { 31513 if (userRegionCookie == "western-pennsylvania") { jQuery("[id='chip-doctors-and-drugs']").attr("href", window.location.protocol + "//" + window.location.host + "/wester
31513n-pennsylvania/chip/doctors-drugs"); } 31514 if (userRegionCookie == "northeastern-pennsylvania") { jQuery("[id='chip-doctors-and-drugs']").attr("href", window.location.protocol + "//" + window.location.host + "/northeastern-pennsylvania/chip/doctors-drugs"); } 31515 else if (userRegionCookie == "central-pennsylvania") { jQuery("[id='chip-doctors-and-drugs']").attr("href", window.location.protocol + "//" + window.location.host + "/central-pennsylvania/chip/doctors-drugs"); } 31516 else if (userRegionCookie == "west-virginia") { jQuery("[id='chip-doctors-and-drugs']").attr("href", window.location.protocol + "//" + window.location.host + "/west-virginia/chip"); } 31517 else if (userRegionCookie == "delaware") { jQuery("[id='chip-doctors-and-drugs']").attr("href", window.location.protocol + "//" + window.location.host + "/delaware/chip"); } 31518 else if (userRegionCookie == 'western-new-york') { 31519 jQuery("[id='chip-doctors-and-drugs']").attr("href", window.location.protocol + "//" + window.location.host + "/western-new-york/chip"); 31520 } 31521 else if (userRegionCookie == 'northeastern-new-york') { 31522 jQuery("[id='chip-doctors-and-drugs']").attr("href", window.location.protocol + "//" + window.location.host + "/northeastern-new-york/chip"); 31523 } 31524 else if (userRegionCookie == 'southeastern-pennsylvania') { 31525 jQuery("[id='chip-doctors-and-drugs']").attr("href", window.location.protocol + "//" + window.location.host + "/southeastern-pennsylvania/chip"); 31526 } 31527 } 31528 } 31529}); 31530 31531$(document).on('click', "[id='chip-special-needs']", function () { 31532 if (!userRegionCookie) { 31533 setCookie("menu-selected", "chip-special-needs"); 31534 redirecttoZipcodeGate(); 31535 } 31536 else { 31537 if (userRegionCookie) { 31538 if (userRegionCookie == "western-pennsylvania") { jQuery("[id='chip-special-needs']").attr("href", window.location.protocol + "//" + window.location.host + "/western-pennsylvania/chip/chip-special-needs-case-management"); } 31539 if (userRegionCookie == "northeastern-pennsylvania") { jQuery("[id='chip-special-needs']").attr("href", window.location.protocol + "//" + window.location.host + "/northeastern-pennsylvania/chip/chip-special-needs-case-management"); } 31540 else if (userRegionCookie == "central-pennsylvania") { jQuery("[id='chip-special-needs']").attr("href", window.location.protocol + "//" + window.location.host + "/central-pennsylvania/chip/chip-special-needs-case-management"); } 31541 else if (userRegionCookie == "west-virginia") { jQuery("[id='chip-special-needs']").attr("href", window.location.protocol + "//" + window.location.host + "/west-virginia/chip"); } 31542 else if (userRegionCookie == "delaware") { jQuery("[id='chip-special-needs']").attr("href", window.location.protocol + "//" + window.location.host + "/delaware/chip"); } 31543 else if (userRegionCookie == 'western-new-york') { 31544 jQuery("[id='chip-special-needs']").attr("href", window.location.protocol + "//" + window.location.host + "/western-new-york/chip"); 31545 } 31546 else if (userRegionCookie == 'northeastern-new-york') { 31547 jQuery("[id='chip-special-needs']").attr("href", window.location.protocol + "//" + window.location.host + "/northeastern-new-york/chip"); 31548 } 31549 else if (userRegionCookie == 'southeastern-pennsylvania') { 31550 jQuery("[id='chip-special-needs']").attr("href", window.location.protocol + "//" + window.location.host + "/southeastern-pennsylvania/chip"); 31551 } 31552 } 31553 } 31554}); 31555 31556$(document).on('click', "[id='chip-covid-19-alert']", function () { 31557 if (!userRegionCookie) { 31558 setCookie("menu-selected", "chip-covid-19-alert"); 31559 redirecttoZipcodeGate(); 31560 } 31561 else { 31562 if (userRegionCookie == "western-pennsylvania" || userRegionCookie == "northeastern-pennsylvania" || userRegionCookie == "central-pennsylvania") { 31563 jQuery("[id='chip-covid-19-alert']").attr("href", window.location.protocol + "//" + window.location.host + "/" + userRegionCookie + "/chip/chip-covid-19-alert"); 31564 } 31565 else { 31566 jQuery("[id='chip-covid-19-alert']").attr("href", window.location.protocol + "//" + window.location.host + "/" + userRegionCookie + "/chip"); 31567 } 31568 } 31569}); 31570 31571function redirecttoZipcodeGate() { 31572 if(window.location.href.indexOf("levelAccess") === -1 && navigator.userAgent.indexOf("levelAccess") === -1){ 31573 if (getAEMmode) { 31574 window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/zipcode-gate-login.html"; 31575 } 31576 else { 31577 window.location.href = window.location.protocol + "//" + window.location.host + "/zipcode-gate-login"; 31578 } 31579 } 31580} 31581 31582$(document).on('click', "[id='main-nav-aca-redirect']", function () { 31583 if (!userRegionCookie) {
31584 setCookie("menu-selected", "main-nav-aca"); 31585 redirecttoZipcodeGate(); 31586 } 31587 else { 31588 if (userRegionCookie == 'western-new-york' || userRegionCookie == 'northeastern-new-york') { 31589 window.location.href = window.location.protocol + "//" + window.location.host + "/" + userRegionCookie + "/individual-families"; 31590 } 31591 else if (userRegionCookie == "southeastern-pennsylvania") { 31592 window.location.href = window.location.protocol + "//" + window.location.host + "/404"; 31593 } 31594 else { 31595 window.location.href = window.location.protocol + "//" + window.location.host + "/reservations/aca"; 31596 } 31597 } 31598}); 31599 31600 31601var newrequestHeader; 31602 31603function checkMOSevents(workflow) { 31604 return new Promise(function (resolve, reject) { 31605 var startdate = Math.round((new Date()).getTime()); 31606 31607 var targetDate = new Date(); 31608 targetDate.setDate(targetDate.getDate() + 365); 31609 var enddate = Math.round(targetDate.getTime()); 31610 31611 31612 //set carrier_IDField=2 for MOS 31613 if (workflow == "MOS") { carrier_IDField = 2; } 31614 else if (workflow == "") { carrier_IDField = 3; } 31615 else if (workflow == "MG-webinar") { carrier_IDField = 9; } 31616 else { carrier_IDField = 7; } 31617 31618 31619 newrequestHeader = { 31620 "getSeminarsInputField": { 31621 "carrier_IDField": carrier_IDField, 31622 "carrier_IDFieldSpecified": true, 31623 "resultLimitField": 25, 31624 "resultOffsetField": 0, 31625 "seminarDateTimeRangeField": { 31626 "endDateTimeField": "\/Date(" + enddate + ")\/", 31627 "startDateTimeField": "\/Date(" + startdate + "-0400" + ")\/" 31628 }, 31629 "seminarLocationField": { 31630 "itemsElementNameField": [3, 2], 31631 "itemsField": [sessionStorage.getItem("POSTAL_CODE"), 250] 31632 } 31633 } 31634 }; 31635 31636 // globalApiCall(); 31637 var ids = setLeadSourceKey(""); 31638 $.ajax({ 31639 method: 'POST', 31640 url: POST_MEETANDGREET_SEMINARs_URL, 31641 contentType: 'application/json; charset=utf-8', 31642 headers: { 31643 "x-hmhs-keyId": ids.hmhskeyId 31644 }, 31645 data: JSON.stringify(newrequestHeader), 31646 dataType: 'json', 31647 crossDomain: true, 31648 success: function (result) { 31649 31650 seminarslist = result; 31651 if (result["seminarsField"].seminarField.length > 0) { 31652 var tmpseminars = result["seminarsField"].seminarField; 31653 var seminars = []; 31654 tmpseminars.forEach(function (item, index) { 31655 if (item.seminarEventType_IDField == 1 && item.seminarStatus_IDField == 3 && item.remainingCapacityField != "0") { 31656 seminars.push(item); 31657 } 31658 }); 31659 if (seminars.length > 0) { 31660 resolve(seminars); 31661 } else { 31662 resolve(seminars); 31663 } 31664 } else { 31665 resolve(null); 31666 } 31667 }, 31668 error: function (xhr) { 31669 console.log(xhr); 31670 reject(xhr); 31671 } 31672 }); 31673 }); 31674 31675} 31676 31677 31678function changeBrandLogo() { 31679 userZipCookie = getCookie("userZIP"); 31680 if (userZipCookie) { 31681 jQuery("#txt-zipcode").val(userZipCookie); 31682 jQuery(".txtZIPcode-header").val(userZipCookie); 31683 jQuery("#reservations-zipcode-picker").val(userZipCookie); 31684 jQuery("#reservations-zipcode-mobile-picker").val(userZipCookie); 31685 if ((document.location.href.indexOf('reservations') > -1)) { 31686 var reservations = document.getElementById("reservations-zipcode-picker"); 31687 if (reservations) { 31688 if (reservations.className.split(" ").indexOf("inactive-text") < 0) { 31689 getPostalCode(); 31690 } 31691 } 31692 } 31693 31694 } 31695 if (userZipCookie) { 31696
31697 //display zipcode in top right header only if cookie is present 31698 $("#div-zipcode").css("display", "block"); 31699 $("#div-zipcode-mobile").css("display", "block"); 31700 31701 var $hmkreservationsMemberBenefitTemplateScript = $("#memberBenefit-template"); 31702 31703 var $hmkreservationheadermobileTemplateScript = $("hmk-reservation-header-mobile"); 31704 31705 // Call should happen only for Reservations Member Benefit 31706 if ($hmkreservationsMemberBenefitTemplateScript.length) { 31707 //Get Health Store API Call 31708 getHealthStore(); 31709 } 31710 31711 // Call should happen only for Reservations Face to Face schedule call 31712 31713 var $hmkreservationscgedulecall = $("#hmk-reservation-facetoface"); 31714 31715 if ((document.location.href.indexOf('reservations') > -1)) { 31716 if ((userRegionCookie == "central-pennsylvania") || (userRegionCookie == "west-virginia")) { 31717 $("#freedom-blue-ppo").attr("value", "FB(FREEDOM BLUE PPO)"); 31718 $("#security-blue-hmo-pos").attr("value", "SB(SECURITY BLUE HMO-POS)"); 31719 } 31720 else { 31721 $("#freedom-blue-ppo").attr("value", "FB/SB(FREEDOM BLUE PPO)"); 31722 $("#security-blue-hmo-pos").attr("value", "FB/SB(FREEDOM BLUE PPO)"); 31723 } 31724 } 31725 31726 //Get Meet and Greet seminars 31727 if ((document.location.href.indexOf('meet-and-greet') > -1) && (document.location.href.indexOf('reserve-a-spot') == -1)) { 31728 if (document.location.href.indexOf('/meet-and-greet-inperson') > -1) { 31729 getSeminars($("#distance-filter").val(), $("#distance-sort").val()); 31730 } else if (document.location.href.indexOf('/meet-and-greet-webinar') != -1) { 31731 getSeminars(250, $("#distance-sort").val(), 'MG-webinar'); 31732 } 31733 } 31734 else if ((document.location.href.indexOf('medicare-options-seminar') > -1) && (document.location.href.indexOf('reserve-a-spot') == -1)) { 31735 //Get Postal Code API Call 31736 getSeminars($("#distance-filter").val(), $("#distance-sort").val(), 'MOS'); 31737 } 31738 else if ((document.location.href.indexOf('medicare-options-webinar') > -1) && (document.location.href.indexOf('select-event-type') == -1)) { 31739 if (getAEMmode != "edit" || getAEMmode == undefined || getAEMmode == null) { 31740 //code to hide MOS webinas during 10/01-12/07 31741 if (currentDate > AEPstartdate && currentDate < AEPenddate) { 31742 //During AEP period 31743 31744 $("#MOS-active-AEP-div").show(); 31745 $("#MOS-inactive-AEP-div").hide(); 31746 } 31747 else { 31748 //pre-post AEP 31749 $("#MOS-active-AEP-div").hide(); 31750 $("#MOS-inactive-AEP-div").show(); 31751 } 31752 } 31753 31754 if (document.location.href.indexOf('mos-webinars') == -1) { 31755 31756 if ($("input:radio[name=event-type-MOS]:checked").val() == "in-person") { 31757 if (sessionStorage.getItem("County")) //if user comes from MBR workflow 31758 { 31759 setCookie("finalRegion", sessionStorage.getItem("County")); 31760 if (getAEMmode) { 31761 window.location.href = window.location.protocol + '//' + window.location.host + '/' + '/content/digital-marketing/en/highmark/highmarkdotcom/home/reservations/medicare/medicare-options-webinar/select-event-type.html'; 31762 } 31763 else { 31764 window.location.href = window.location.protocol + '//' + window.location.host + '/' + 'reservations/medicare/medicare-options-webinar/select-event-type'; 31765 } 31766 } 31767 else { 31768 getCountyMOS(); 31769 } 31770 } 31771 31772 else { 31773 getCountyMOS(); 31774 } 31775 } 31776 else if ((document.location.href.indexOf('mos-webinars') > -1)) { 31777 getSeminars(250, $("#distance-sort").val(), 'MOS-webinar'); 31778 } 31779 31780 } 31781 else if ((document.location.href.indexOf('select-event-type') > -1)) { 31782 $("div.loading").css("display", "block"); 31783 31784 //code to check if in-person events are available. 31785 checkMOSevents("MOS").then(function (response) { 31786 if (response) { 31787 //alert("response "+response); 31788 if (response.length > 0) { 31789 $('input[name="event-type-MOS"][value="in-person"]').attr('disabled', false); 31790 } 31791 else { 31792 31793 $('input[name="event-type-MOS"][value="in-person"]').attr('disabled', true); 31794 31795 } 31796 31797 } else { 31798 $('input[name="event-type-MOS"][value="in-person"]').attr('disabled', true); 31799 } 31800 }) 31801 .catch(function (err) { 31802 alert("error"); 31803 }); 31804 31805 31806 checkMOSevents("MOS-webinar").then(function (response) { 31807 if (response) { 31808 //alert("response "+response); 31809 if (response.length > 0) { 31810 $('input[name="event-type-MOS"][value="webinar"]').attr('disabled', false); 31811 } 31812 else { 31813 $('input[name="event-type-MOS"][value="webinar"]').attr('disabled', true); 31814 } 31815 $("div.loading").css("display", "none"); 31816 } else { 31817 $('input[name="event-type-MOS"][value="webinar"]').attr('disabled', true); 31818 $("div.loading").css("display", "none"); 31819 } 31820 }) 31821 .catch(function (err) { 31822 //alert("error"); 31823 $("div.loading").css("display", "none"); 31824 }); 31825 31826 } 31827 31828 31829 31830 if ((window.location.href.indexOf('meet-medicare-advisor') != -1) && 31831 (window.location.href.indexOf('meet-medicare-advisor/agent-page') == -1) && 31832 (window.location.href.indexOf('meet-medicare-advisor/make-a-reservation') == -1)) { 31833 var ua = window.navigator.userAgent; 31834 var msie = ua.indexOf("MSIE"); 31835 if (msie == -1) { 31836 var t2 = performance.now(); 31837 console.log("zipcodepicker stop", t2); 31838 } 31839 loadMedicareAdvisor(); 31840 } 31841 if (window.location.pathname == "/reservations/medicare/member-benefit-review/" || window.location.pathname == "/reservations/medicare/member-benefit-review" || window.location.pathname == "/reservations/medicare/member-benefit-review.html") { 31842 loadCounty(); 31843 31844 if ((userRegionCookie == "central-pennsylvania") || (userRegionCookie == "west-virginia")) { 31845 var test = $("#freedom-blue-ppo").attr("value"); 31846 31847 } 31848 } 31849 if (window.location.href.indexOf('meet-medicare-advisor/agent-page?profile=') != -1) { 31850 getPostalCode(); 31851 } 31852 if (window.location.href.indexOf('meet-medicare-advisor/agent-page?profile=') != -1 && sessionStorage.getItem("back") == "true") { 31853 callCounty(); 31854 } 31855 } 31856 31857 //header logo change 31858 userRegionCookie = getCookie("userRegion"); 31859 jQuery("#Employer-contact-us-link").attr("href", window.location.protocol + "//" + window.location.host + "/employer/get-started"); 31860 jQuery("#Employer-blues-oncall-link").attr("href", window.location.protocol + "//" + window.location.host + "/employer/client-resources/onboarding-tools"); 31861 jQuery("#Employer-link").attr("href", window.location.protocol + "//" + window.location.host + "/employer"); 31862 jQuery("#Employer-plans-link").attr("href", window.location.protocol + "//" + window.location.host + "/employer/solutions"); 31863 31864 if (getAEMmode != "edit" || getAEMmode == undefined || getAEMmode == null) { 31865 $("#bs-video,#bcbs-video,#bs-video,#bcbsde-video,#bcbswv-video,#bcbswny-video,#bcbsneny-video,#default-video").addClass("hide"); 31866 } 31867 31868 if (userRegionCookie == "central-pennsylvania") { 31869 31870 if ($("#bs-video")) { $("#bs-video").removeClass("hide"); $("#bs-video").css({ "display": "block" }); $("#default-video").css({ "display": "none" }); } 31871 jQuery("#imgBrandLogo").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bs-logo.svg"); 31872 jQuery(".mobile-logo #imgBrandLogo").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bs-logo.svg"); 31873 jQuery("#rsvImgBrandLogo").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bs-logo.svg"); 31874 jQuery("#rsvImgBrandMobLogo").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bs-logo.svg"); 31875 jQuery("#rsvBrandFooterLogo").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bs-logo.svg"); 31876 jQuery("#rsvBrandFooterLogoWhite").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/images/highmark_logo_bs.svg"); 31877 jQuery('[id="imgBrandLogo-mobile"]').attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bs-logo.svg"); 31878 jQuery("#imgBrandLogo-mobile1").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bs-logo.svg"); 31879 jQuery("#imgBrandLogo-mobile2").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bs-logo.svg"); 31880 jQuery("#imgBrandLogo-footer").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bs-logo.svg"); 31881 jQuery("[id='memberLogin'], #memberLogin-mobile").attr({ href: "https://www.highmarkblueshield.com/home/", target: "_blank" }); 31882 jQuery("[id='employerMemberLogin'], [id='employerMemberLogin-mobile']").attr({ href: "https://www.highmarkblueshield.com/home/", target: "_blank" }); 31883 jQuery('[id="on-demand-webinar-link"]').attr("href", "https://Highmark-Health.dcatalog.com/v/Mastering-Medicare-BS/"); 31884 jQuery(".hmk-member_button").attr("href", "https://www.highmarkblueshield.com/home/"); 31885 jQuery("#provider-resource-center-link").attr("href", "https://hbs.highmarkprc.com/"); 31886 jQuery(".member-portal-footer-link").attr("href", "https://www.highmarkblueshield.com/home/"); 31887 jQuery(".employer-member-portal-footer-link").attr("href", "https://www.highmarkblueshield.com/home/"); 31888 jQuery("#medical-policy-link,.medical-policy-link").attr("href", window.location.protocol + "//" + window.location.host + "/central-pennsylvania/medical-policy?zg=false"); 31889 jQuery("#CHIP-link").attr("href", window.location.protocol + "//" + window.location.host + "/central-pennsylvania/chip"); 31890 jQuery("#Additional-services-link").attr("href", window.location.protocol + "//" + window.location.host + "/central-pennsylvania/individual-families/additional-products"); 31891 jQuery("#quality-assurance").attr("href", window.location.protocol + "//" + window.location.host + "/content/dam/digital-marketing/en/highmark/highmarkdotcom/pdfs/quality-assurance/CS204330_NCQAPreSale_BRO_BS_R2.pdf"); 31892 jQuery("#aca-basic-seminar").attr("href", "https://webinars.on24.com/highmark/IntroToACACPA1"); 31893 jQuery("#sdoh-learn-more-link").attr("href", window.location.protocol + "//" + window.location.host + "/central-pennsylvania/social-
31893determinants-of-health/the-80percent-project"); 31894 31895 } else if (userRegionCookie == "western-pennsylvania") { 31896 31897 if ($("#bcbs-video")) { $("#bcbs-video").removeClass("hide"); $("#bcbs-video").css({ "display": "block" }); $("#default-video").css({ "display": "none" }); } 31898 jQuery("#imgBrandLogo").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bcbs-logo.svg"); 31899 jQuery(".mobile-logo #imgBrandLogo").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bcbs-logo.svg"); 31900 jQuery("#rsvImgBrandLogo").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bcbs-logo.svg"); 31901 jQuery("#rsvImgBrandMobLogo").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bcbs-logo.svg"); 31902 jQuery("#rsvBrandFooterLogo").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bcbs-logo.svg"); 31903 jQuery("#rsvBrandFooterLogoWhite").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/images/highmark_logo_bcbs.svg"); 31904 jQuery('[id="imgBrandLogo-mobile"]').attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bcbs-logo.svg"); 31905 jQuery("#imgBrandLogo-mobile1").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bcbs-logo.svg"); 31906 jQuery("#imgBrandLogo-mobile2").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bcbs-logo.svg"); 31907 jQuery("#imgBrandLogo-footer").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bcbs-logo.svg"); 31908 jQuery("[id='memberLogin'], #memberLogin-mobile").attr({ href: "https://www.highmarkbcbs.com/home/", target: "_blank" }); 31909 jQuery("[id='employerMemberLogin'], [id='employerMemberLogin-mobile']").attr({ href: "https://www.highmarkbcbs.com/home/", target: "_blank" }); 31910 jQuery('[id="on-demand-webinar-link"]').attr("href", "https://Highmark-Health.dcatalog.com/v/Mastering-Medicare-BCBS/"); 31911 jQuery(".hmk-member_button").attr("href", "https://www.highmarkbcbs.com/home/"); 31912 jQuery("#provider-resource-center-link").attr("href", "https://hbcbs.highmarkprc.com/"); 31913 jQuery(".member-portal-footer-link").attr("href", "https://www.highmarkbcbs.com/home/"); 31914 jQuery(".employer-member-portal-footer-link").attr("href", "https://www.highmarkbcbs.com/home/"); 31915 jQuery("#medical-policy-link,.medical-policy-link").attr("href", window.location.protocol + "//" + window.location.host + "/western-pennsylvania/medical-policy?zg=false"); 31916 jQuery("#CHIP-link").attr("href", window.location.protocol + "//" + window.location.host + "/western-pennsylvania/chip"); 31917 jQuery("#Additional-services-link").attr("href", window.location.protocol + "//" + window.location.host + "/western-pennsylvania/individual-families/additional-products"); 31918 jQuery("#quality-assurance").attr("href", window.location.protocol + "//" + window.location.host + "/content/dam/digital-marketing/en/highmark/highmarkdotcom/pdfs/quality-assurance/CS204330_NCQAPreSale_BRO_BCBS_R2.pdf"); 31919 jQuery("#aca-basic-seminar").attr("href", "https://webinars.on24.com/highmark/IntroToACAWPA1"); 31920 jQuery("#sdoh-learn-more-link").attr("href", window.location.protocol + "//" + window.location.host + "/western-pennsylvania/social-
31920determinants-of-health/the-80percent-project"); 31921 31922 } else if (userRegionCookie == "west-virginia") { 31923 31924 if ($("#bcbswv-video")) { $("#bcbswv-video").removeClass("hide"); $("#bcbswv-video").css({ "display": "block" }); $("#default-video").css({ "display": "none" }); } 31925 jQuery("#imgBrandLogo").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bcbswv-logo.svg"); 31926 jQuery(".mobile-logo #imgBrandLogo").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bcbswv-logo.svg"); 31927 jQuery("#rsvImgBrandMobLogo").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bcbswv-logo.svg"); 31928 jQuery("#rsvImgBrandLogo").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bcbswv-logo.svg"); 31929 jQuery("#rsvBrandFooterLogo").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bcbswv-logo.svg"); 31930 jQuery("#rsvBrandFooterLogoWhite").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/images/highmark_logo_bcbs.svg"); 31931 jQuery('[id="imgBrandLogo-mobile"]').attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bcbswv-logo.svg"); 31932 jQuery("#imgBrandLogo-mobile1").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bcbswv-logo.svg"); 31933 jQuery("#imgBrandLogo-mobile2").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bcbswv-logo.svg"); 31934 jQuery("#imgBrandLogo-footer").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bcbswv-logo.svg"); 31935 jQuery("[id='memberLogin'], #memberLogin-mobile").attr({ href: "https://www.highmarkbcbswv.com/home/", target: "_blank" }); 31936 jQuery("[id='employerMemberLogin'], [id='employerMemberLogin-mobile']").attr({ href: "https://www.highmarkbcbswv.com/home/", target: "_blank" }); 31937 jQuery('[id="on-demand-webinar-link"]').attr("href", "https://Highmark-Health.dcatalog.com/v/Mastering-Medicare-BCBS-WV/"); 31938 jQuery(".hmk-member_button").attr("href", "https://www.highmarkbcbswv.com/home/"); 31939 jQuery("#provider-resource-center-link").attr("href", "https://hwvbcbs.highmarkprc.com/"); 31940 jQuery(".member-portal-footer-link").attr("href", "https://www.highmarkbcbswv.com/home/"); 31941 jQuery(".employer-member-portal-footer-link").attr("href", "https://www.highmarkbcbswv.com/home/"); 31942 jQuery("#medical-policy-link,.medical-policy-link").attr("href", window.location.protocol + "//" + window.location.host + "/west-virginia/medical-policy?zg=false"); 31943 jQuery("#CHIP-link").attr("href", window.location.protocol + "//" + window.location.host + "/west-virginia/chip"); 31944 jQuery("#Additional-services-link").attr("href", window.location.protocol + "//" + window.location.host + "/west-virginia/individual-families/additional-products"); 31945 jQuery("#quality-assurance").attr("href", window.location.protocol + "//" + window.location.host + "/content/dam/digital-marketing/en/highmark/highmarkdotcom/pdfs/quality-assurance/CS204330_NCQAPreSale_BRO_WV_R2.pdf"); 31946 jQuery("#aca-basic-seminar").attr("href", "https://webinars.on24.com/highmark/IntrotoACAWV1"); 31947 jQuery("#sdoh-learn-more-link").attr("href", window.location.protocol + "//" + window.location.host + "/western-pennsylvania/social-
31947determinants-of-health/the-80percent-project"); 31948 31949 } else if (userRegionCookie == "northeastern-pennsylvania") { 31950 31951 if ($("#bcbs-video")) { $("#bcbs-video").removeClass("hide"); $("#bcbs-video").css({ "display": "block" }); $("#default-video").css({ "display": "none" }); } 31952 jQuery("#imgBrandLogo").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bcbs-logo.png"); 31953 jQuery(".mobile-logo #imgBrandLogo").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bcbs-logo.png"); 31954 jQuery("#rsvImgBrandLogo").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bcbs-logo.svg"); 31955 jQuery("#rsvImgBrandMobLogo").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bcbs-logo.svg"); 31956 jQuery("#rsvBrandFooterLogo").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bcbs-logo.svg"); 31957 jQuery("#rsvBrandFooterLogoWhite").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/images/highmark_logo_bcbs.svg"); 31958 jQuery('[id="imgBrandLogo-mobile"]').attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bcbs-logo.svg"); 31959 jQuery("#imgBrandLogo-mobile1").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bcbs-logo.svg"); 31960 jQuery("#imgBrandLogo-mobile2").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bcbs-logo.svg"); 31961 jQuery("#imgBrandLogo-footer").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bcbs-logo.svg"); 31962 jQuery("[id='memberLogin'], #memberLogin-mobile").attr({ href: "https://www.highmarkbcbs.com/home/", target: "_blank" }); 31963 jQuery("[id='employerMemberLogin'], [id='employerMemberLogin-mobile']").attr({ href: "https://www.highmarkbcbs.com/home/", target: "_blank" }); 31964 jQuery('[id="on-demand-webinar-link"]').attr("href", "https://Highmark-Health.dcatalog.com/v/Mastering-Medicare-BCBS/"); 31965 jQuery(".hmk-member_button").attr("href", "https://www.highmarkbcbs.com/home/"); 31966 jQuery("#provider-resource-center-link").attr("href", "https://hbs.highmarkprc.com/"); 31967 jQuery(".member-portal-footer-link").attr("href", "https://www.highmarkbcbs.com/home/"); 31968 jQuery(".employer-member-portal-footer-link").attr("href", "https://www.highmarkbcbs.com/home/"); 31969 jQuery("#medical-policy-link,.medical-policy-link").attr("href", window.location.protocol + "//" + window.location.host + "/northeastern-pennsylvania/medical-policy?zg=false"); 31970 jQuery("#CHIP-link").attr("href", window.location.protocol + "//" + window.location.host + "/northeastern-pennsylvania/chip"); 31971 jQuery("#Additional-services-link").attr("href", window.location.protocol + "//" + window.location.host + "/northeastern-pennsylvania/individual-families/additional-products"); 31972 jQuery("#quality-assurance").attr("href", window.location.protocol + "//" + window.location.host + "/content/dam/digital-marketing/en/highmark/highmarkdotcom/pdfs/quality-assurance/CS204330_NCQAPreSale_BRO_BCBS_R2.pdf"); 31973 jQuery("#aca-basic-seminar").attr("href", "https://webinars.on24.com/highmark/IntroToACANEPA1"); 31974 jQuery("#sdoh-learn-more-link").attr("href", window.location.protocol + "//" + window.location.host + "/western-pennsylvania/social-
31974determinants-of-health/the-80percent-project"); 31975 31976 } else if (userRegionCookie == "delaware") { 31977 31978 if ($("#bcbsde-video")) { $("#bcbsde-video").removeClass("hide"); $("#bcbsde-video").css({ "display": "block" }); $("#default-video").css({ "display": "none" }); } 31979 jQuery("#imgBrandLogo").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bcbsde-logo.svg"); 31980 jQuery(".mobile-logo #imgBrandLogo").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bcbsde-logo.svg"); 31981 jQuery("#rsvImgBrandLogo").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bcbsde-logo.svg"); 31982 jQuery("#rsvImgBrandMobLogo").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bcbsde-logo.svg"); 31983 jQuery("#rsvBrandFooterLogo").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bcbsde-logo.svg"); 31984 jQuery("#rsvBrandFooterLogoWhite").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/images/highmark_logo_bcbs.svg"); 31985 jQuery('[id="imgBrandLogo-mobile"]').attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bcbsde-logo.svg"); 31986 jQuery("#imgBrandLogo-mobile1").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bcbsde-logo.svg"); 31987 jQuery("#imgBrandLogo-mobile2").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bcbsde-logo.svg"); 31988 jQuery("#imgBrandLogo-footer").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bcbsde-logo.svg"); 31989 jQuery("[id='memberLogin'], #memberLogin-mobile").attr({ href: "https://www.highmarkbcbsde.com/home/", target: "_blank" }); 31990 jQuery("[id='employerMemberLogin'], [id='employerMemberLogin-mobile']").attr({ href: "https://www.highmarkbcbsde.com/home/", target: "_blank" }); 31991 jQuery('[id="on-demand-webinar-link"]').attr("href", "https://Highmark-Health.dcatalog.com/v/Mastering-Medicare-BCBSDE/"); 31992 31993 jQuery(".hmk-member_button").attr("href", "https://www.highmarkbcbsde.com/home/"); 31994 jQuery("#provider-resource-center-link").attr("href", "https://hdebcbs.highmarkprc.com/"); 31995 jQuery(".member-portal-footer-link").attr("href", "https://www.highmarkbcbsde.com/home/"); 31996 jQuery(".employer-member-portal-footer-link").attr("href", "https://www.highmarkbcbsde.com/home/"); 31997 jQuery("#medical-policy-link,.medical-policy-link").attr("href", window.location.protocol + "//" + window.location.host + "/delaware/medical-policy?zg=false"); 31998 jQuery("#CHIP-link").attr("href", window.location.protocol + "//" + window.location.host + "/delaware/chip"); 31999 jQuery("#Additional-services-link").attr("href", window.location.protocol + "//" + window.location.host + "/delaware/indiv
31999idual-families/additional-products"); 32000 jQuery('#medicare-purl-quiz-div').remove(); 32001 jQuery("#quality-assurance").attr("href", window.location.protocol + "//" + window.location.host + "/content/dam/digital-marketing/en/highmark/highmarkdotcom/pdfs/quality-assurance/CS204330_NCQAPreSale_BRO_DE_R2.pdf"); 32002 jQuery("#aca-basic-seminar").attr("href", "https://webinars.on24.com/highmark/IntroToACADE1"); 32003 jQuery("#sdoh-learn-more-link").attr("href", window.location.protocol + "//" + window.location.host + "/delaware/social-determinants-of-health/the-80percent-project"); 32004 32005 } else if (userRegionCookie == "western-new-york") { 32006 32007 if ($("#bcbswny-video")) { $("#bcbswny-video").removeClass("hide"); $("#bcbswny-video").css({ "display": "block" }); $("#default-video").css({ "display": "none" }); } 32008 jQuery("#imgBrandLogo").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bcbswny-logo.svg"); 32009 jQuery(".mobile-logo #imgBrandLogo").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bcbswny-logo.svg"); 32010 jQuery("#rsvImgBrandLogo").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bcbswny-logo.svg"); 32011 jQuery("#rsvImgBrandMobLogo").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bcbswny-logo.svg"); 32012 jQuery("#rsvBrandFooterLogo").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/images/highmark_logo_bcbs.svg"); 32013 jQuery("#rsvBrandFooterLogoWhite").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/images/highmark_logo_bcbs.svg"); 32014 jQuery('[id="imgBrandLogo-mobile"]').attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bcbswny-logo.svg"); 32015 jQuery("#imgBrandLogo-mobile1").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bcbswny-logo.svg"); 32016 jQuery("#imgBrandLogo-mobile2").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bcbswny-logo.svg"); 32017 jQuery("#imgBrandLogo-footer").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bcbswny-logo.svg"); 32018 jQuery("[id='memberLogin'], #memberLogin-mobile").attr({ href: "https://member.highmark.com/", target: "_blank" }); 32019 jQuery("[id='employerMemberLogin'], [id='employerMemberLogin-mobile']").attr({ href: "https://www.highmarkbcbs.com/home/", target: "_blank" }); 32020 jQuery(".hmk-member_button").attr("href", "https://member.highmark.com/"); 32021 jQuery(".member-portal-footer-link").attr("href", "https://member.highmark.com/"); 32022 jQuery(".employer-member-portal-footer-link").attr("href", "https://www.highmarkbcbs.com/home/"); 32023 jQuery("#medical-policy-link,.medical-policy-link").attr("href", "https://securecms.highmark.com/content/medpolicy/en/highmark/ny/commercial/search.html"); 32024 jQuery('#medicare-purl-quiz-div').remove(); 32025 jQuery("#Additional-services-link").attr("href", window.location.protocol + "//" + window.location.host + "/western-new-york/individual-families/additional-products"); 32026 jQuery("#medical-policy-link,.medical-policy-link").remove(); 32027 jQuery("#main-nav-aca-redirect").remove(); 32028 jQuery("#quality-assurance,.quality-assurance").remove(); 32029 jQuery("#sdoh-learn-more-link").attr("href", window.location.protocol + "//" + window.location.host + "/western-new-york/social-determinants-of-health/the-80percent-project"); 32030 jQuery('[id="on-demand-webinar-link"]').attr("href", "https://highmark-health.dcatalog.com/v/Mastering-Medicare-WNY/"); 32031 32032 32033 } else if (userRegionCookie == "northeastern-new-york") { 32034 32035 if ($("#bcbsneny-video")) { $("#bcbsneny-video").removeClass("hide"); $("#bcbsneny-video").css({ "display": "block" }); $("#default-video").css({ "display": "none" }); } 32036 jQuery("#imgBrandLogo").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bsneny-logo.svg"); 32037 jQuery(".mobile-logo #imgBrandLogo").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bsneny-logo.svg"); 32038 jQuery("#rsvImgBrandLogo").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bsneny-logo.svg"); 32039 jQuery("#rsvImgBrandMobLogo").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bsneny-logo.svg"); 32040 jQuery("#rsvBrandFooterLogo").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/images/highmark_logo_bs.svg"); 32041 jQuery("#rsvBrandFooterLogoWhite").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/images/highmark_logo_bs.svg"); 32042 jQuery('[id="imgBrandLogo-mobile"]').attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bsneny-logo.svg"); 32043 jQuery("#imgBrandLogo-mobile1").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bsneny-logo.svg"); 32044 jQuery("#imgBrandLogo-mobile2").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bsneny-logo.svg"); 32045 jQuery("#imgBrandLogo-footer").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bsneny-logo.svg"); 32046 jQuery("[id='memberLogin'], #memberLogin-mobile").attr({ href: "https://member.highmark.com/", target: "_blank" }); 32047 jQuery("[id='employerMemberLogin'], [id='employerMemberLogin-mobile']").attr({ href: "https://www.highmarkblueshield.com/home/", target: "_blank" }); 32048 jQuery(".hmk-member_button").attr("href", "https://member.highmark.com/"); 32049 jQuery(".member-portal-footer-link").attr("href", "https://member.highmark.com/"); 32050 jQuery(".employer-member-portal-footer-link").attr("href", "https://www.highmarkblueshield.com/home/"); 32051 jQuery("#medical-policy-link,.medical-policy-link").attr("href", "https://securecms.highmark.com/content/medpolicy/en/highmark/ny/commercial/search.html"); 32052 jQuery('#medicare-purl-quiz-div').remove(); 32053 jQuery("#Additional-services-link").attr("href", window.location.protocol + "//" + window.location.host + "/northeastern-new-york/individual-families/additional-products"); 32054 jQuery("#medical-policy-link,.medical-policy-link").remove(); 32055 jQuery("#main-nav-aca-redirect").remove(); 32056 jQuery("#quality-assurance,.quality-assurance").remove(); 32057 jQuery("#sdoh-learn-more-link").attr("href", window.location.protocol + "//" + window.location.host + "northeastern-new-york/social-
32057determinants-of-health/the-80percent-project"); 32058 jQuery('[id="on-demand-webinar-link"]').attr("href", "https://Highmark-Health.dcatalog.com/v/Mastering-Medicare-NENY/"); 32059 32060 } else if (userRegionCookie == "southeastern-pennsylvania") { 32061 32062 if ($("#bs-video")) { $("#bs-video").removeClass("hide"); $("#bs-video").css({ "display": "block" }); $("#default-video").css({ "display": "none" }); } 32063 jQuery("#imgBrandLogo").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bs-logo.svg"); 32064 jQuery(".mobile-logo #imgBrandLogo").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bs-logo.svg"); 32065 jQuery("#rsvImgBrandLogo").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bs-logo.svg"); 32066 jQuery("#rsvImgBrandMobLogo").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bs-logo.svg"); 32067 jQuery("#rsvBrandFooterLogo").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bs-logo.svg"); 32068 jQuery("#rsvBrandFooterLogoWhite").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/images/highmark_logo_bs.svg"); 32069 jQuery('[id="imgBrandLogo-mobile"]').attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bs-logo.svg"); 32070 jQuery("#imgBrandLogo-mobile1").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bs-logo.svg"); 32071 jQuery("#imgBrandLogo-mobile2").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bs-logo.svg"); 32072 jQuery("#imgBrandLogo-footer").attr("src", "/content/dam/digital-marketing/en/highmark/highmarkdotcom/highmark-bs-logo.svg"); 32073 jQuery("[id='memberLogin'], #memberLogin-mobile").attr({ href: "https://www.highmarkblueshield.com/home/", target: "_blank" }); 32074 jQuery("[id='employerMemberLogin'], [id='employerMemberLogin-mobile']").attr({ href: "https://www.highmarkblueshield.com/home/", target: "_blank" }); 32075 jQuery('[id="on-demand-webinar-link"]').attr("href", "https://Highmark-Health.dcatalog.com/v/Mastering-Medicare-BS/"); 32076 jQuery(".hmk-member_button").attr("href", "https://www.highmarkblueshield.com/home/"); 32077 jQuery("#provider-resource-center-link").attr("href", "https://hbs.highmarkprc.com/"); 32078 jQuery(".member-portal-footer-link").attr("href", "https://www.highmarkblueshield.com/home/"); 32079 jQuery(".employer-member-portal-footer-link").attr("href", "https://www.highmarkblueshield.com/home/"); 32080 jQuery("#medical-policy-link,.medical-policy-link").attr("href", window.location.protocol + "//" + window.location.host + "/southeastern-pennsylvania/medical-policy?zg=false"); 32081 jQuery("#CHIP-link").attr("href", window.location.protocol + "//" + window.location.host + "/southeastern-pennsylvania/chip"); 32082 jQuery("#Additional-services-link").attr("href", window.location.protocol + "//" + window.location.host + "/southeastern-pennsylvania/individual-families/additional-products"); 32083 jQuery("#quality-assurance").attr("href", window.location.protocol + "//" + window.location.host + "/content/dam/digital-marketing/en/highmark/highmarkdotcom/pdfs/quality-assurance/CS204330_NCQAPreSale_BRO_BS_R2.pdf"); 32084 jQuery("#aca-basic-seminar").attr("href", "https://webinars.on24.com/highmark/IntroToACACPA1"); 32085 jQuery("#sdoh-learn-more-link").attr("href", window.location.protocol + "//" + window.location.host + "/southeastern-pennsylvania/social-
32085determinants-of-health/the-80percent-project"); 32086 32087 } 32088 32089 $(document).trigger('cookieUpdate'); 32090} 32091 32092var pageRegion, regionMatch = 0, 32093 isRegionalPage = 0, 32094 isCorrectRegion = 0, 32095 userRegionCookie, userZipCookie, getAEMmode, subpage, pdfname, fromMaxcount = 0, zipEnterKeyPress = 0, invalidFormat = 1; 32096 32097var regionCode; 32098 32099function GetQueryStringParams(sParam) { 32100 var sPageURL = window.location.search.substring(1); 32101 var sURLVariables = sPageURL.split('&'); 32102 for (var i = 0; i < sURLVariables.length; i++) { 32103 var sParameterName = sURLVariables[i].split('='); 32104 if (sParameterName[0] == sParam) { 32105 return sParameterName[1]; 32106 } 32107 } 32108} 32109 32110 32111function deleteCookie(cname) { 32112 document.cookie = cname + '=;' + 'expires= 01 Jan 1970; path=/;'; 32113} 32114 32115 32116$(window).on('load', function(){ 32117 32118 32119 if (window.location.href.indexOf("employer") > -1) { 32120 //appending hidden field to keep track of referrer 32121 if (window.location.href.indexOf("/employer/get-started") > -1) { 32122 var formReferrer = getCookie("outsidenationalMarket"); 32123 if (formReferrer == "true") { 32124 $("#getstarted-generaltext").hide(); 32125 $("#getstarted-nationalbusiness").show(); 32126 deleteCookie("outsidenationalMarket"); 32127 } 32128 else { 32129 $("#getstarted-generaltext").show(); 32130 $("#getstarted-nationalbusiness").hide(); 32131 deleteCookie("outsidenationalMarket"); 32132 } 32133 32134 } 32135 input = jQuery('<input type="hidden" id="menu-selected">'); 32136 $("#txt-zipcode").append(input); 32137 32138 if (userRegionCookie) { 32139 jQuery("#txt-zipcode").val(userZipCookie); 32140 } 32141 menuSelectedCookie = getCookie("menu-selected"); 32142 if (menuSelectedCookie) { 32143 if ((menuSelectedCookie.indexOf("small-business") >= 0) || (menuSelectedCookie.indexOf("small-group") >= 0)) { 32144 $("#text-business-size").text("Small Business"); 32145 } 32146 else if ((menuSelectedCookie.indexOf("large-business") >= 0) || (menuSelectedCookie.indexOf("large-group") >= 0)) { 32147 $("#text-business-size").text("Large Business"); 32148 } 32149 if ((menuSelectedCookie.indexOf("national-business") >= 0) || (menuSelectedCookie.indexOf("national-group") >= 0)) { 32150 $("#text-business-size").text("National Business"); 32151 } 32152 } 32153 32154 // executes when complete page is fully loaded, including all frames, objects and images 32155 var currentPath = window.location.pathname; 32156 var wcmMode = GetQueryStringParams('wcmmode'); 32157 subpage = GetQueryStringParams('subpage'); 32158 getAEMmode = getCookie("wcmmode"); 32159 32160 //code to set the AEP start and end date 32161 //AEP start date=10/01 32162 //AEP end date=12/07 32163 currentDate = new Date(); 32164 currentyear = currentDate.getFullYear(); 32165 AEPstartdate = new Date(currentyear, 08, 20); //month values start from 0-11 32166 AEPenddate = new Date(currentyear, 11, 07); 32167 32168 if (getAEMmode != "edit" || getAEMmode == undefined || getAEMmode == null) { 32169 //hide pick a region section on employer zipgate page 32170 $("#pick-a-region").hide(); 32171 } 32172 32173 if (wcmMode) { 32174 setCookie("wcmmode", wcmMode); 32175 } 32176 32177 32178 if (getAEMmode != "edit" || getAEMmode == undefined || getAEMmode == null) { 32179 32180 var l = getLocation(window.location.href); 32181 pageRegion = l.pathname.split("/").filter(Boolean); 32182 var url = window.location.href.split("region="); 32183 var region = url[1]; 32184 if (region == 'BS') { 32185 setCookie("userRegion", "central-pennsylvania"); 32186 } else if (region == 'BCBS') { 32187 setCookie("userRegion", "western-pennsylvania"); 32188 } else if (region == 'BCBSWV') { 32189 setCookie("userRegion", "west-virginia"); 32190 } else if (region == 'BCBS') { 32191 setCookie("userRegion", "northeastern-pennsylvania"); 32192 } else if (region == 'BCBSDE') {
32193 setCookie("userRegion", "delaware"); 32194 } 32195 userRegionCookie = getCookie("userRegion"); 32196 userZipCookie = getCookie("userZIP"); 32197 32198 var RegionCookie = getCookie("userRegion"); 32199 if (RegionCookie) { 32200 changeEmployerBrandLogo() 32201 } 32202 32203 if (userRegionCookie) { 32204 changeEmployerBrandLogo(); 32205 32206 if (getAEMmode) { 32207 if (jQuery("#menu-selected").val() == "member-login") { 32208 //window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/DiscoverHighmark/" + userRegion + "/plans/health-insurance.html"; 32209 } 32210 32211 } else { 32212 if (jQuery("#menu-selected").val() == "member-login") { 32213 //window.location.href = window.location.protocol + "//" + window.location.host + "/" + userRegion + "/plans/health-insurance.html"; 32214 } 32215 } 32216 } 32217 32218 //check if it is a regional page 32219 for (var i = 0; i < pageRegion.length; i++) { 32220 if (pageRegion[i] == "wpa" || pageRegion[i] == "cpa" || pageRegion[i] == "nepa" || pageRegion[i] == "de" || pageRegion[i] == "wv" || pageRegion[i] == "wny" || pageRegion[i] == "neny" || pageRegion[i] == "sepa") { 32221 isRegionalPage = 1; 32222 str = pageRegion[i].replace(/-/g, ' ').toLowerCase().replace(/\b[a-z]/g, function (letter) { 32223 return letter.toUpperCase(); 32224 }); 32225 break; 32226 } else { 32227 if (window.location.href.indexOf("meet-medicare-advisor?zip=") == -1) { 32228 jQuery("#modal-title").text("Welcome"); 32229 jQuery("#modal-subheader").text("Enter your ZIP code so we can show you personalized information."); 32230 } 32231 } 32232 } 32233 32234 if(window.location.href.indexOf('levelAccess') === -1 && navigator.userAgent.indexOf("levelAccess") === -1){ 32235 //Check if user is cookied, if yes check if user is on correct page as per cookied region 32236 if (isRegionalPage == 1) { 32237 if (userRegionCookie != null && !(GetQueryStringParams('zip'))) { 32238 32239 for (var i = 0; i < pageRegion.length; i++) { 32240 if (pageRegion[i] != userRegionCookie) { 32241 if (pageRegion[i] == 'wpa' && userRegionCookie == 'western-pennsylvania') { 32242 regionMatch = 1; 32243 break; 32244 } 32245 else if (pageRegion[i] == 'cpa' && userRegionCookie == 'central-pennsylvania') { 32246 regionMatch = 1; 32247 break; 32248 } 32249 else if (pageRegion[i] == 'nepa' && userRegionCookie == 'northeastern-pennsylvania') { 32250 regionMatch = 1; 32251 break; 32252 } 32253 else if (pageRegion[i] == 'wv' && userRegionCookie == 'west-virginia') { 32254 regionMatch = 1; 32255 break; 32256 } 32257 else if (pageRegion[i] == 'de' && userRegionCookie == 'delaware') { 32258 regionMatch = 1; 32259 break; 32260 } 32261 else if (pageRegion[i] == 'sepa' && userRegionCookie == 'southeastern-pennsylvania') { 32262 regionMatch = 1; 32263 break; 32264 } 32265 else { 32266 regionMatch = 0; 32267 } 32268 32269 32270 32271 } else { 32272 regionMatch = 1; 32273 break; 32274 } 32275 } 32276 if (!regionMatch) { 32277 var elmnt = document.getElementById("highmark-dotcom"); 32278 elmnt.scrollIntoView(); 32279 32280 32281 } 32282 } else if (userRegionCookie == null && !GetQueryStringParams("zip") && window.location.href.indexOf('levelAccess') === -1 && navigator.userAgent.indexOf("levelAccess") === -1) { 32283 32284 if (getAEMmode) { 32285 window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/zipcode-gate-login.html"; 32286 } 32287 else { 32288 window.location.href = window.location.protocol + "//" + window.location.host + "/zipcode-gate-login"; 32289 32290 } 32291 } else if (GetQueryStringParams("zip")) { 32292 //validate if it is correct ZIP 32293 validateEmployerZIP(GetQueryStringParams("zip")); 32294 } 32295 } 32296 } 32297 32298 } //end of getAEMmode function 32299 } 32300}); 32301 32302jQuery("#btnAlertClose").click(function () { 32303 jQuery("#divInvalidZIP").fadeOut(); 32304}); 32305 32306var getLocation = function (href) { 32307 var l = document.createElement("a"); 32308 l.href = href; 32309 return l; 32310}; 32311 32312//validate zipcode- function gets executed on keyup event in zipcode textbox 32313 32314jQuery("#btn-zipcode-enter-solutions").click(function (e) { 32315 if (jQuery("#txt-zipcode").val()) { 32316 fromMaxcount = 0;
32317 var validFormat = $('#txt-zipcode').val().match(/^(?!00000)(?!11111)(?!22222)(?!33333)(?!44444)(?!55555)(?!66666)(?!77777)(?!88888)(?!99999)\d{5}$/); 32318 if (validFormat == null) { 32319 invalidFormat = 0; 32320 } 32321 else { 32322 invalidFormat = 1; 32323 } 32324 validateEmployerZIP(jQuery("#txt-zipcode").val()); 32325 } 32326 else if (!jQuery('#txt-zipcode').val()) { 32327 $(".error-constraint").html("Please enter a valid zipcode"); 32328 $(".error-constraint").css({ "display": "inline" }); 32329 $(".error-constraint").removeClass("floating-success"); 32330 $("#txt-zipcode").css({ "border": "2px solid #B70C0C" }); 32331 $("label[for=txt-zipcode]").css({ "color": "#B70C0C" }); 32332 } 32333 32334}); 32335 32336//function to detect enter from keyboard and submit zipcode 32337$("#txt-zipcode").on('keyup', function (e) { 32338 if ((e.key === 'Enter' || e.keyCode === 13)&& ($('#txt-zipcode').val().length === 5) ) { 32339 32340 console.log('Zip Digit 1') 32341 var validFormat = $('#txt-zipcode').val().match(/^(?!00000)(?!11111)(?!22222)(?!33333)(?!44444)(?!55555)(?!66666)(?!77777)(?!88888)(?!99999)\d{5}$/); 32342 if (validFormat == null) { 32343 invalidFormat = 0; 32344 } 32345 else { 32346 invalidFormat = 1; 32347 32348 if (window.location.href.indexOf("employer") > -1) { 32349 fromMaxcount = 0; 32350 zipEnterKeyPress = 1; 32351 validateEmployerZIP(jQuery("#txt-zipcode").val()); 32352 32353 } 32354 else if(!window.location.href.indexOf("employer") > -1){ 32355 fromMaxcount = 0; 32356 zipEnterKeyPress = 1; 32357 validateZIP(jQuery("#txt-zipcode").val()); 32358 } 32359 32360 } 32361 32362 }else{ 32363 invalidFormat = 0;
32364 console.log('Zip Digit 0') 32365}}); 32366 32367var ZIPentered = 0; 32368 32369function validateEmployerZIP(ZIPentered) { //function to check if zip entered is correct 32370 32371 var menuSelectedCookie = getCookie("menu-selected"); 32372 var validZip = 0, userRegion, userZIP, menuSelected; 32373 globalApiCall(); 32374 var dataObj = { 32375 "payload": { 32376 "zipCode": ZIPentered 32377 } 32378 }; 32379 $.ajax({ 32380 method: 'POST', 32381 async: false, 32382 url: GET_COUNTIES_URL, 32383 headers: { 'x-hmhs-keyId': countyListKey, 'ddToken': countyListToken }, 32384 contentType: 'application/json; charset=utf-8', 32385 data: JSON.stringify(dataObj), 32386 dataType: 'json', 32387 crossDomain: true, 32388 success: function(result) { 32389 if (result.payload.countyList){ 32390 var zip_region = result.payload.countyList[0].region; 32391 if(zip_region == "WPA") { 32392 userRegion = "western-pennsylvania"; 32393 validZip = 1; 32394 } 32395 else if(zip_region == "NEPA") { 32396 userRegion = "northeastern-pennsylvania"; 32397 validZip = 1; 32398 } 32399 else if(zip_region == "WV") { 32400 userRegion = "west-virginia"; 32401 validZip = 1; 32402 } 32403 else if(zip_region == "DE") { 32404 userRegion = "delaware"; 32405 validZip = 1; 32406 } 32407 else if(zip_region == "SEPA") { 32408 if((window.location.href.indexOf("/reservations") != -1)){ 32409 validZip = 0; 32410 }else{ 32411 userRegion = "southeastern-pennsylvania"; 32412 validZip = 1; 32413 } 32414 } 32415 else if(zip_region == "CPA") { 32416 userRegion = "central-pennsylvania"; 32417 validZip = 1; 32418 } 32419 else if(zip_region == "WNY") { 32420 userRegion = "western-new-york"; 32421 validZip = 1; 32422 } 32423 else if(zip_region == "NENY") { 32424 userRegion = "northeastern-new-york"; 32425 validZip = 1; 32426 } 32427 else { 32428 validZip = 0; 32429 } 32430 32431 } 32432 else { 32433 validZip = 0; 32434 } 32435 32436 //handling not a vlid zip part 32437 if (!validZip && GetQueryStringParams("zip")) { 32438 //error error-constraint 32439 $(".error-constraint").html("Please enter a valid zipcode"); 32440 $(".error-constraint").css({ "display": "inline", "color": "#B70C0C" }); 32441 $(".error-constraint").removeClass("floating-success"); 32442 $("#txt-zipcode").css({ "border": "2px solid #B70C0C" }); 32443 $("label[for=txt-zipcode]").css({ "color": "#B70C0C" }); 32444 32445 } 32446 else if (!validZip && ((menuSelectedCookie.indexOf("national-business") >= 0) || (menuSelectedCookie.indexOf("national-group") >= 0))) { 32447 if (invalidFormat == 0) { 32448 $(".error-constraint").html("Please enter a valid zipcode"); 32449 $(".error-constraint").css({ "display": "inline", "color": "#B70C0C" }); 32450 $(".error-constraint").removeClass("floating-success"); 32451 $("#txt-zipcode").css({ "border": "2px solid #B70C0C" }); 32452 $("label[for=txt-zipcode]").css({ "color": "#B70C0C" }); 32453 invalidFormat = 1; 32454 } 32455 else { 32456 32457 if (fromMaxcount == 1 && zipEnterKeyPress == 0) { 32458 $("#btn-zipcode-enter-solutions").html("Next"); 32459 $('#btn-zipcode-enter-solutions').attr("href", window.location.protocol + "//" + window.location.host + "/employer/get-started"); 32460 32461 fromMaxcount = 0; 32462 } else if (zipEnterKeyPress == 1) { 32463 window.location.href = window.location.protocol + "//" + window.location.host + "/employer/get-started";
32464 setCookie("outsidenationalMarket", "true"); 32465 } 32466 else if (fromMaxcount == 0) { 32467 window.location.href = window.location.protocol + "//" + window.location.host + "/employer/get-started"; 32468 setCookie("outsidenationalMarket", "true"); 32469 } 32470 else { 32471 $(".error-constraint").html("Please enter a valid zipcode"); 32472 $(".error-constraint").css({ "display": "inline", "color": "#B70C0C" }); 32473 $(".error-constraint").removeClass("floating-success"); 32474 $("#txt-zipcode").css({ "border": "2px solid #B70C0C" }); 32475 $("label[for=txt-zipcode]").css({ "color": "#B70C0C" }); 32476 } 32477 32478 } 32479 32480 } 32481 else if (!validZip && ((menuSelectedCookie.indexOf("small-business") >= 0) || (menuSelectedCookie.indexOf("small-group") >= 0))) { 32482 if (fromMaxcount == 1) { 32483 $(".error-constraint").html("We’re sorry, we do not offer small or large business plans with the ZIP code you entered."); 32484 $(".error-constraint").css({ "display": "inline", "color": "#B70C0C" }); 32485 $(".error-constraint").removeClass("floating-success"); 32486 $("#txt-zipcode").css({ "border": "2px solid #B70C0C" }); 32487 $("label[for=txt-zipcode]").css({ "color": "#B70C0C" }); 32488 } 32489 else { 32490 $(".error-constraint").html("Please enter a valid zipcode"); 32491 $(".error-constraint").css({ "display": "inline", "color": "#B70C0C" }); 32492 $(".error-constraint").removeClass("floating-success"); 32493 $("#txt-zipcode").css({ "border": "2px solid #B70C0C" }); 32494 $("label[for=txt-zipcode]").css({ "color": "#B70C0C" }); 32495 } 32496 32497 } 32498 else if (!validZip && ((menuSelectedCookie.indexOf("large-business") >= 0) || (menuSelectedCookie.indexOf("large-business") >= 0))) { 32499 if (fromMaxcount == 1) { 32500 $(".error-constraint").html("We’re sorry, we do not offer small or large business plans with the ZIP code you entered."); 32501 $(".error-constraint").css({ "display": "inline", "color": "#B70C0C" }); 32502 $(".error-constraint").removeClass("floating-success"); 32503 $("#txt-zipcode").css({ "border": "2px solid #B70C0C" }); 32504 $("label[for=txt-zipcode]").css({ "color": "#B70C0C" }); 32505 } 32506 else { 32507 $(".error-constraint").html("Please enter a valid zipcode"); 32508 $(".error-constraint").css({ "display": "inline", "color": "#B70C0C" }); 32509 $(".error-constraint").removeClass("floating-success"); 32510 $("#txt-zipcode").css({ "border": "2px solid #B70C0C" }); 32511 $("label[for=txt-zipcode]").css({ "color": "#B70C0C" }); 32512 } 32513 32514 } 32515 else if (!validZip && !GetQueryStringParams("zip")) { 32516 if (!GetQueryStringParams("profile")) //do not display zipcode on agent profile page 32517 { 32518 $(".error-constraint").html("Please enter a valid zipcode"); 32519 $(".error-constraint").css({ "display": "inline", "color": "#B70C0C" }); 32520 $(".error-constraint").removeClass("floating-success"); 32521 $("#txt-zipcode").css({ "border": "2px solid #B70C0C" }); 32522 $("label[for=txt-zipcode]").css({ "color": "#B70C0C" }); 32523 } 32524 } 32525 else if (validZip && isRegionalPage && !isCorrectRegion) //correct ZIP, incorrect region..check if only it's a regional page 32526 { 32527 32528 $(".error-constraint").html("Please enter a valid zipcode"); 32529 $(".error-constraint").css({ "display": "inline", "color": "#B70C0C" }); 32530 $(".error-constraint").removeClass("floating-success"); 32531 $("#txt-zipcode").css({ "border": "2px solid #B70C0C" }); 32532 $("label[for=txt-zipcode]").css({ "color": "#B70C0C" }); 32533 } 32534 else { 32535 32536 if (fromMaxcount == 0) { 32537 //if zip entered is valid 32538 32539 if (GetQueryStringParams("zip") && !jQuery("#txt-zipcode").val()) {
32540 setCookie("userZIP", GetQueryStringParams("zip")); 32541 } else { 32542 setCookie("userZIP", jQuery("#txt-zipcode").val()); 32543 } 32544 32545 setCookie("Referrer", document.referrer); 32546 $("#txt-zipcode").siblings().html(""); 32547 $("#txt-zipcode").siblings().css({ "display": "none" }); 32548 setCookie("userRegion", userRegion); 32549 userZIP = getCookie("userZIP"); 32550 menuSelected = getCookie("menu-selected"); 32551 32552 if (getCookie("userRegion") == "western-pennsylvania") { regionCode = "wpa"; } 32553 else if (getCookie("userRegion") == "central-pennsylvania") { regionCode = "cpa"; } 32554 else if (getCookie("userRegion") == "northeastern-pennsylvania") { regionCode = "nepa"; } 32555 else if (getCookie("userRegion") == "west-virginia") { regionCode = "wv"; } 32556 else if (getCookie("userRegion") == "delaware") { regionCode = "de"; } 32557 else if (getCookie("userRegion") == "western-new-york") { regionCode = "wny"; } 32558 else if (getCookie("userRegion") == "northeastern-new-york") { regionCode = "neny"; } 32559 else if (getCookie("userRegion") == "southeastern-pennsylvania") { regionCode = "sepa"; } 32560 32561 var screenWidth = screen.width; 32562 32563 if (menuSelected == null) { 32564 if (getCookie("Referrer")) { 32565 window.location.href = getCookie("Referrer"); 32566 } 32567 } 32568 else if (screenWidth < 1025) { 32569 32570 var mobileMenuSelected; 32571 32572 if (menuSelected.includes("/wpa/")) { 32573 32574 mobileMenuSelected = menuSelected.replace('/wpa/', '/' + regionCode + '/'); 32575 32576 mobileMenuSelected = mobileMenuSelected + ".html"; 32577 } 32578 else { 32579 32580 mobileMenuSelected = menuSelected.split('.html')[0]; 32581 32582 mobileMenuSelected = mobileMenuSelected + "/" + regionCode + "/medical-plans"; 32583 } 32584 32585 window.location.href = mobileMenuSelected; 32586 } 32587 32588 else if (menuSelected == "small-group-plans-link") { 32589 if (getAEMmode) { 32590 window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/small-business/" + regionCode + "/medical-plans.html"; 32591 } 32592 else { 32593 window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/small-business/" + regionCode + "/medical-plans"; 32594 } 32595 } 32596 else if (menuSelected == "large-group-plans-link") { 32597 if (getAEMmode) { 32598 window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/large-business/" + regionCode + "/medical-plans.html"; 32599 } 32600 else { 32601 window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/large-business/" + regionCode + "/medical-plans"; 32602 } 32603 } 32604 else if (menuSelected == "national-group-plans-link") { 32605 if (getAEMmode) { 32606 window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/national-business/medical-plans.html"; 32607 } 32608 else { 32609 window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/national-business/medical-plans"; 32610 } 32611 } 32612 else if ((menuSelected == "small-business") || (menuSelected == "large-business") || (menuSelected == "national-business") || (menuSelected == "small-business-medical-plans") || (menuSelected == "large-business-medical-plans") || (menuSelected == "national-business-medical-plans")) { 32613 if (getAEMmode) { 32614 if (menuSelected.indexOf("national-business") >= 0) { 32615 $("#text-business-size").text("National Business"); 32616 window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/national-business/medical-plans.html"; 32617 } 32618 else if (menuSelected.indexOf("large-business") >= 0) { 32619 $("#text-business-size").text("Large Business"); 32620 window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/large-business/" + regionCode + "/medical-plans.html"; 32621 } 32622 else if (menuSelected.indexOf("small-business") >= 0) { 32623 $("#text-business-size").text("Small Business"); 32624 window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/small-business/" + regionCode + "/medical-plans.html"; 32625 } 32626 } 32627 else { 32628 if (menuSelected.indexOf("national-business") >= 0) { 32629 window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/national-business/medical-plans"; 32630 } 32631 else if (menuSelected.indexOf("large-business") >= 0) { 32632 window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/large-business/" + regionCode + "/medical-plans"; 32633 } 32634 else if (menuSelected.indexOf("small-business") >= 0) { 32635 window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/small-business/" + regionCode + "/medical-plans"; 32636 } 32637 } 32638 } 32639 else if ((menuSelected == "small-business-pharmacy") || (menuSelected == "large-business-pharmacy") || (menuSelected == "national-business-pharmacy")) { 32640 if (getAEMmode) { 32641 if (menuSelected.indexOf("national-business") >= 0) { 32642 window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/national-business/pharmacy"; 32643 } 32644 else if (menuSelected.indexOf("large-business") >= 0) { 32645 window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/large-business/" + regionCode + "/pharmacy"; 32646 } 32647 else if (menuSelected.indexOf("small-business") >= 0) { 32648 window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/small-business/" + regionCode + "/pharmacy"; 32649 } 32650 32651 } 32652 else { 32653 if (menuSelected.indexOf("national-business") >= 0) { 32654 window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/national-business/pharmacy"; 32655 } 32656 else if (menuSelected.indexOf("large-business") >= 0) { 32657 window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/large-business/" + regionCode + "/pharmacy"; 32658 } 32659 else if (menuSelected.indexOf("small-business") >= 0) { 32660 window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/small-business/" + regionCode + "/pharmacy"; 32661 } 32662 } 32663 } 32664 else if ((menuSelected == "small-business-balanced-funding") || (menuSelected == "large-business-balanced-funding")) { 32665 32666 if (getAEMmode) { 32667 if (menuSelected.indexOf("large-business") >= 0) { 32668 window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/large-business/" + regionCode + "/balanced-funding.html"; 32669 } 32670 else if (menuSelected.indexOf("small-business") >= 0) { 32671 window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/small-business/" + regionCode + "/balanced-funding.html"; 32672 } 32673 } 32674 else { 32675 if (menuSelected.indexOf("large-business") >= 0) { 32676 window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/large-business/" + regionCode + "/balanced-funding"; 32677 } 32678 else if (menuSelected.indexOf("small-business") >= 0) { 32679 window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/small-business/" + regionCode + "/balanced-funding"; 32680 } 32681 } 32682 } 32683 else if ((menuSelected == "small-business-well360-core") || (menuSelected == "large-business-well360-core") || (menuSelected == "national-business-well360-core")) { 32684 if (getAEMmode) { 32685 if (menuSelected.indexOf("national-business") >= 0) { 32686 window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/national-business/well360-core.html"; 32687 } 32688 else if (menuSelected.indexOf("large-business") >= 0) { 32689 window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/large-business/" + regionCode + "/well360-core.html"; 32690 } 32691 else if (menuSelected.indexOf("small-business") >= 0) { 32692 window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/small-business/" + regionCode + "/well360-core.html"; 32693 } 32694 } 32695 else { 32696 if (menuSelected.indexOf("national-business") >= 0) { 32697 window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/national-business/well360-core"; 32698 } 32699 else if (menuSelected.indexOf("large-business") >= 0) { 32700 window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/large-business/" + regionCode + "/well360-core"; 32701 } 32702 else if (menuSelected.indexOf("small-business") >= 0) { 32703 window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/small-business/" + regionCode + "/well360-core"; 32704 } 32705 } 32706 } 32707 32708 32709 else if (getCookie("menu-selected") == "member-portal") { 32710 32711 if (userRegion) { 32712 if (userRegion == "central-pennsylvania" || userRegion == "southeastern-pennsylvania") { 32713 window.open("https://www.highmarkblueshield.com/home/", "_blank"); 32714 } 32715 else if (userRegion == "western-pennsylvania" || userRegion == "northeastern-pennsylvania") { 32716 window.open("https://www.highmarkbcbs.com/home/", "_blank"); 32717 32718 } 32719 else if (userRegion == "west-virginia") { 32720 window.open("https://www.highmarkbcbswv.com/home/", "_blank"); 32721 } 32722 else if (userRegion == "delaware") { 32723 window.open("https://www.highmarkbcbsde.com/home/", "_blank"); 32724 } 32725 window.location.href = getCookie("Referrer"); 32726 } 32727 32728 32729 } 32730 32731 else if (getCookie("menu-selected") == "Employer-blues-oncall") { 32732 window.open("https://www.highmarkemployer.com/engage/blues-on-call?zip=" + userZIP, "_blank"); 32733 window.location.href = getCookie("Referrer"); 32734 } 32735 changeEmployerBrandLogo(); 32736 } 32737 } 32738 }, 32739 error: function(xhr) { 32740 $(".error-constraint").html("Please enter a valid zipcode"); 32741 $(".error-constraint").css({ "display": "inline", "color": "#B70C0C" }); 32742 $(".error-constraint").removeClass("floating-success"); 32743 $("#txt-zipcode").css({ "border": "2px solid #B70C0C" }); 32744 $("label[for=txt-zipcode]").css({ "color": "#B70C0C" });          32745 return; 32746 } 32747 }); 32748} 32749 32750 32751function setCookie(cname, cvalue, exdays) { 32752 var d = new Date(); 32753 d.setTime(d.getTime() + 3600 * 24000); 32754 var expires = 'expires=' + d.toUTCString(); 32755 document.cookie = cname + '=' + cvalue + '; ' + expires + '; path=/'; 32756} 32757 32758 32759function getCookie(name) { 32760 var re = new RegExp(name + '=([^;]+)'); 32761 var value = re.exec(document.cookie); 32762 return value !== null ? unescape(value[1]) : null; 32763} 32764 32765 32766function validateSubNavClick(subNavObject) {
32767 var subNavID = subNavObject.id; 32768 var path; 32769 32770 if (userRegionCookie) { 32771 if (userRegionCookie == "western-pennsylvania") { regionCode = "wpa"; } 32772 else if (userRegionCookie == "central-pennsylvania") { regionCode = "cpa"; } 32773 else if (userRegionCookie == "northeastern-pennsylvania") { regionCode = "nepa"; } 32774 else if (userRegionCookie == "west-virginia") { regionCode = "wv"; } 32775 else if (userRegionCookie == "delaware") { regionCode = "de"; } 32776 else if (userRegionCookie == "western-new-york") { regionCode = "wny"; } 32777 else if (userRegionCookie == "northeastern-new-york") { regionCode = "neny"; } 32778 else if (userRegionCookie == "southeastern-pennsylvania") { regionCode = "sepa"; } 32779 } 32780 32781 if ((jQuery("#" + subNavID).attr("href")) == undefined) { 32782 32783 if (subNavID && (!userRegionCookie)) { 32784 setCookie("menu-selected", subNavID); 32785 if (getAEMmode) { 32786 32787 32788 if (getCookie("menu-selected").indexOf("small-business") >= 0) { 32789 $("#text-business-size").text("Small Business"); 32790 } 32791 else if (getCookie("menu-selected").indexOf("large-business") >= 0) { 32792 $("#text-business-size").text("Large Business"); 32793 } 32794 if (getCookie("menu-selected").indexOf("national-business") >= 0) { 32795 $("#text-business-size").text("National Business"); 32796 } 32797 $("#small-business, #small-business-medical-plans, #small-business-pharmacy, #small-business-balanced-funding, #small-business-well360-core").attr("href", window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/zipcode-gate-login.html"); 32798 $("#large-business, #large-business-medical-plans, #large-business-pharmacy, #large-business-balanced-funding, #large-business-well360-core").attr("href", window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/zipcode-gate-login.html"); 32799 $("#national-business, #national-business-medical-plans, #national-business-pharmacy, #national-business-well360-core").attr("href", window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/zipcode-gate-login.html"); 32800 } 32801 else { 32802 $("#small-business, #small-business, #small-business-medical-plans, #small-business-pharmacy, #small-business-balanced-funding, #small-business-well360-core").attr("href", window.location.protocol + "//" + window.location.host + "/employer/solutions/zipcode-gate-login"); 32803 $("#large-business, #large-business-medical-plans, #large-business-pharmacy, #large-business-balanced-funding, #large-business-well360-core").attr("href", window.location.protocol + "//" + window.location.host + "/employer/solutions/zipcode-gate-login"); 32804 $("#national-business, #national-business-medical-plans, #national-business-pharmacy, #national-business-well360-core").attr("href", window.location.protocol + "//" + window.location.host + "/employer/solutions/zipcode-gate-login"); 32805 } 32806 } 32807 else { 32808 setCookie("menu-selected", subNavID); 32809 32810 //small business navigation links 32811 if ((subNavID == "small-business-medical-plans") || (subNavID == "large-business-medical-plans") || (subNavID == "national-business-medical-plans") || (subNavID == "small-business") || (subNavID == "large-business") || (subNavID == "national-business")) { 32812 if (userRegionCookie) { 32813 jQuery("#txt-zipcode").val(userZipCookie); 32814 if (getAEMmode) { 32815 if (subNavID.indexOf("national-business") >= 0) { 32816 window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/national-business/medical-plans.html"; 32817 } 32818 else if (subNavID.indexOf("large-business") >= 0) { 32819 window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/large-business/" + regionCode + "/medical-plans.html"; 32820 } 32821 else if (subNavID.indexOf("small-business") >= 0) { 32822 window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/small-business/" + regionCode + "/medical-plans.html"; 32823 } 32824 } 32825 else { 32826 if (subNavID.indexOf("national-business") >= 0) { 32827 window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/national-business/medical-plans"; 32828 } 32829 else if (subNavID.indexOf("large-business") >= 0) { 32830 window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/large-business/" + regionCode + "/medical-plans"; 32831 } 32832 else if (subNavID.indexOf("small-business") >= 0) { 32833 window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/small-business/" + regionCode + "/medical-plans"; 32834 } 32835 32836 } 32837 } 32838 } 32839 32840 else if ((subNavID == "small-business-pharmacy") || (subNavID == "large-business-pharmacy") || (subNavID == "national-business-pharmacy")) { 32841 if (userRegionCookie) { 32842 jQuery("#txt-zipcode").val(userZipCookie); 32843 if (getAEMmode) { 32844 if (subNavID.indexOf("national-business") >= 0) { 32845 window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/national-business/pharmacy.html"; 32846 } 32847 else if (subNavID.indexOf("large-business") >= 0) { 32848 window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/large-business/" + regionCode + "/pharmacy.html"; 32849 } 32850 else if (subNavID.indexOf("small-business") >= 0) { 32851 window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/small-business/" + regionCode + "/pharmacy.html"; 32852 } 32853 } 32854 else { 32855 if (subNavID.indexOf("national-business") >= 0) { 32856 window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/national-business/" + regionCode + "/pharmacy"; 32857 } 32858 else if (subNavID.indexOf("large-business") >= 0) { 32859 window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/large-business/" + regionCode + "/pharmacy"; 32860 } 32861 else if (subNavID.indexOf("small-business") >= 0) { 32862 window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/small-business/" + regionCode + "/pharmacy"; 32863 } 32864 32865 } 32866 } 32867 } 32868 else if ((subNavID == "small-business-balanced-funding") || (subNavID == "large-business-balanced-funding")) { 32869 if (userRegionCookie) { 32870 jQuery("#txt-zipcode").val(userZipCookie); 32871 if (getAEMmode) { 32872 if (subNavID.indexOf("large-business") >= 0) { 32873 window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/large-business/" + regionCode + "/balanced-funding.html"; 32874 } 32875 else if (subNavID.indexOf("small-business") >= 0) { 32876 window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/small-business/" + regionCode + "/balanced-funding.html"; 32877 } 32878 } 32879 else { 32880 if (subNavID.indexOf("large-business") >= 0) { 32881 window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/large-business/" + regionCode + "/balanced-funding"; 32882 } 32883 else if (subNavID.indexOf("small-business") >= 0) { 32884 window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/small-business/" + regionCode + "/balanced-funding"; 32885 } 32886 32887 } 32888 } 32889 } 32890 else if ((subNavID == "small-business-well360-core") || (subNavID == "large-business-well360-core") || (subNavID == "national-business-well360-core")) { 32891 if (userRegionCookie) { 32892 jQuery("#txt-zipcode").val(userZipCookie); 32893 if (getAEMmode) { 32894 if (subNavID.indexOf("national-business") >= 0) { 32895 window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/national-business/well360-core.html"; 32896 } 32897 else if (subNavID.indexOf("large-business") >= 0) { 32898 window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/large-business/" + regionCode + "/well360-core.html"; 32899 } 32900 else if (subNavID.indexOf("small-business") >= 0) { 32901 window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/small-business/" + regionCode + "/well360-core.html"; 32902 } 32903 } 32904 else { 32905 if (subNavID.indexOf("national-business") >= 0) { 32906 window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/national-business/" + regionCode + "/well360-core"; 32907 } 32908 else if (subNavID.indexOf("large-business") >= 0) { 32909 window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/large-business/" + regionCode + "/well360-core"; 32910 } 32911 else if (subNavID.indexOf("small-business") >= 0) { 32912 window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/small-business/" + regionCode + "/well360-core"; 32913 } 32914 32915 } 32916 } 32917 } 32918 } 32919 } 32920} 32921 32922if (window.location.href.indexOf("employer") > -1) { 32923 jQuery("#hmk-zipcode-gate").click(function () {
32924 setCookie("menu-selected", ""); 32925 if (getAEMmode) { 32926 window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/zipcode-gate-login.html"; 32927 } 32928 else { 32929 window.location.href = window.location.protocol + "//" + window.location.host + "/zipcode-gate-login"; 32930 } 32931 32932 if (userRegionCookie) { 32933 jQuery("#txt-zipcode").val(userZipCookie); 32934 } 32935 }); 32936 32937 32938 jQuery("#pick-a-region-link").click(function () { 32939 if (getAEMmode != "edit") { 32940 $("#pick-a-region").slideToggle("slow"); 32941 event.preventDefault(); 32942 } 32943 }); 32944 32945 jQuery("#location").click(function () { 32946 setCookie("menu-selected", ""); 32947 if (getAEMmode) { 32948 window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/zipcode-gate-login.html"; 32949 } 32950 else { 32951 window.location.href = window.location.protocol + "//" + window.location.host + "/zipcode-gate-login"; 32952 } 32953 32954 if (userRegionCookie) { 32955 jQuery("#txt-zipcode").val(userZipCookie); 32956 } 32957 }); 32958 32959 jQuery("#selectYourState").click(function () { 32960 setCookie("menu-selected", ""); 32961 var closePopupButton = '<button id="closePopupButton" type="button" class="close" data-dismiss="modal">×</button>'; 32962 32963 jQuery("#closePopupButton").remove(); 32964 jQuery("#modal-header").prepend(closePopupButton); 32965 jQuery("#modal-subheader").text("Enter your ZIP code so we can show you personalized information."); 32966 //var elmnt = document.getElementById("highmark-dotcom"); 32967 //elmnt.scrollIntoView(); 32968 jQuery("#menu-selected").val(""); 32969 jQuery('#myModal').modal('show'); 32970 jQuery("#modal-title").text("Welcome"); 32971 if (userRegionCookie) { 32972 jQuery(".txtZIPcode-header").val(userZipCookie); 32973 } 32974 32975 }); 32976 32977 jQuery("#mylocation").click(function () { 32978 setCookie("menu-selected", ""); 32979 if (getAEMmode) { 32980 window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/zipcode-gate-login.html"; 32981 } 32982 else { 32983 window.location.href = window.location.protocol + "//" + window.location.host + "/zipcode-gate-login"; 32984 } 32985 32986 if (userRegionCookie) { 32987 jQuery("#txt-zipcode").val(userZipCookie); 32988 } 32989 32990 }); 32991 32992 jQuery("#Onboarding").click(function () { 32993 setCookie("menu-selected", "employer-onboarding"); 32994 if (getAEMmode) { 32995 window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/zipcode-gate-login.html"; 32996 } 32997 else { 32998 window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/zipcode-gate-login"; 32999 } 33000 33001 if (userRegionCookie) { 33002 jQuery("#txt-zipcode").val(userZipCookie); 33003 } 33004 }); 33005 33006 33007 jQuery("#small-group-plans-link").click(function () { 33008 33009 if (!userRegionCookie) { 33010 setCookie("menu-selected", "small-group-plans-link"); 33011 if (getAEMmode) { 33012 jQuery("#small-group-plans-link").attr("data", "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/zipcode-gate-login.html"); 33013 window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/zipcode-gate-login.html"; 33014 } 33015 else { 33016 jQuery("#small-group-plans-link").attr("data", "/employer/zipcode-gate-login"); 33017 window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/zipcode-gate-login"; 33018 } 33019 } 33020 else { 33021 if (userRegionCookie) { 33022 if (getAEMmode) { 33023 window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/small-business/" + regionCode + "/medical-plans.html"; 33024 } 33025 else { 33026 window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/small-business/" + regionCode + "/medical-plans"; 33027 } 33028 } 33029 } 33030 33031 }); 33032 33033 jQuery("#large-group-plans-link").click(function () { 33034 33035 if (!userRegionCookie) {
33036 setCookie("menu-selected", "large-group-plans-link"); 33037 if (getAEMmode) { 33038 jQuery("#large-group-plans-link").attr("data", "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/zipcode-gate-login.html"); 33039 window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/zipcode-gate-login.html"; 33040 } 33041 else { 33042 jQuery("#large-group-plans-link").attr("data", "/employer/zipcode-gate-login"); 33043 window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/zipcode-gate-login"; 33044 } 33045 } 33046 else { 33047 if (userRegionCookie) { 33048 if (getAEMmode) { 33049 window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/large-business/" + regionCode + "/medical-plans.html"; 33050 } 33051 else { 33052 window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/large-business/" + regionCode + "/medical-plans"; 33053 } 33054 } 33055 } 33056 33057 }); 33058 33059 jQuery("#national-group-plans-link").click(function () { 33060 33061 if (!userRegionCookie) { 33062 setCookie("menu-selected", "national-group-plans-link"); 33063 if (getAEMmode) { 33064 jQuery("#national-group-plans-link").attr("data", "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/zipcode-gate-login.html"); 33065 window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/zipcode-gate-login.html"; 33066 } 33067 else { 33068 jQuery("#national-group-plans-link").attr("data", "/employer/zipcode-gate-login"); 33069 window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/zipcode-gate-login"; 33070 } 33071 } 33072 else { 33073 if (userRegionCookie) { 33074 if (getAEMmode) { 33075 window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/national-business/medical-plans.html"; 33076 } 33077 else { 33078 window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/national-business/medical-plans"; 33079 } 33080 } 33081 } 33082 33083 }); 33084 33085 jQuery("#wpa-medical-plans-link").click(function () { 33086 33087 var menuSelectedCookie = getCookie("menu-selected"); 33088 33089 setCookie("userZIP", "15222"); 33090 setCookie("userRegion", "western-pennsylvania"); 33091 33092 if (getAEMmode) { 33093 if (menuSelectedCookie.indexOf("small-business") >= 0) { window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/small-business/wpa/medical-plans.html"; } 33094 else if (menuSelectedCookie.indexOf("large-business") >= 0) { window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/large-business/wpa/medical-plans.html"; } 33095 else if (menuSelectedCookie.indexOf("national-business") >= 0) { window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/national-business/medical-plans.html"; } 33096 } 33097 else { 33098 if (menuSelectedCookie.indexOf("small-business") >= 0) { window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/small-business/wpa/medical-plans"; } 33099 else if (menuSelectedCookie.indexOf("large-business") >= 0) { window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/large-business/wpa/medical-plans"; } 33100 else if (menuSelectedCookie.indexOf("national-business") >= 0) { window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/national-business/medical-plans"; } 33101 } 33102 33103 }); 33104 33105 jQuery("#cpa-medical-plans-link").click(function () { 33106 33107 var menuSelectedCookie = getCookie("menu-selected"); 33108
33109 setCookie("userZIP", "18109"); 33110 setCookie("userRegion", "central-pennsylvania"); 33111 33112 if (getAEMmode) { 33113 if (menuSelectedCookie.indexOf("small-business") >= 0) { window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/small-business/cpa/medical-plans.html"; } 33114 else if (menuSelectedCookie.indexOf("large-business") >= 0) { window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/large-business/cpa/medical-plans.html"; } 33115 else if (menuSelectedCookie.indexOf("national-business") >= 0) { window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/national-business/medical-plans.html"; } 33116 } 33117 else { 33118 if (menuSelectedCookie.indexOf("small-business") >= 0) { window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/small-business/cpa/medical-plans"; } 33119 else if (menuSelectedCookie.indexOf("large-business") >= 0) { window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/large-business/cpa/medical-plans"; } 33120 else if (menuSelectedCookie.indexOf("national-business") >= 0) { window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/national-business/medical-plans"; } 33121 } 33122 33123 }); 33124 33125 jQuery("#nepa-medical-plans-link").click(function () { 33126 33127 var menuSelectedCookie = getCookie("menu-selected"); 33128 33129 setCookie("userZIP", "17701"); 33130 setCookie("userRegion", "northeastern-pennsylvania"); 33131 33132 if (getAEMmode) { 33133 if (menuSelectedCookie.indexOf("small-business") >= 0) { window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/small-business/nepa/medical-plans.html"; } 33134 else if (menuSelectedCookie.indexOf("large-business") >= 0) { window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/large-business/nepa/medical-plans.html"; } 33135 else if (menuSelectedCookie.indexOf("national-business") >= 0) { window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/national-business/medical-plans.html"; } 33136 } 33137 else { 33138 if (menuSelectedCookie.indexOf("small-business") >= 0) { window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/small-business/nepa/medical-plans"; } 33139 else if (menuSelectedCookie.indexOf("large-business") >= 0) { window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/large-business/nepa/medical-plans"; } 33140 else if (menuSelectedCookie.indexOf("national-business") >= 0) { window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/national-business/medical-plans"; } 33141 } 33142 33143 }); 33144 jQuery("#wv-medical-plans-link").click(function () { 33145 33146 var menuSelectedCookie = getCookie("menu-selected"); 33147 33148 setCookie("userZIP", "24701"); 33149 setCookie("userRegion", "west-virginia"); 33150 if (getAEMmode) { 33151 if (menuSelectedCookie.indexOf("small-business") >= 0) { window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/small-business/wv/medical-plans.html"; } 33152 else if (menuSelectedCookie.indexOf("large-business") >= 0) { window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/large-business/wv/medical-plans.html"; } 33153 else if (menuSelectedCookie.indexOf("national-business") >= 0) { window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/national-business/medical-plans.html"; } 33154 } 33155 else { 33156 if (menuSelectedCookie.indexOf("small-business") >= 0) { window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/small-business/wv/medical-plans"; } 33157 else if (menuSelectedCookie.indexOf("large-business") >= 0) { window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/large-business/wv/medical-plans"; } 33158 else if (menuSelectedCookie.indexOf("national-business") >= 0) { window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/national-business/medical-plans"; } 33159 } 33160 33161 }); 33162 jQuery("#de-medical-plans-link").click(function () { 33163 33164 var menuSelectedCookie = getCookie("menu-selected"); 33165
33166 setCookie("userZIP", "19701"); 33167 setCookie("userRegion", "delaware"); 33168 if (getAEMmode) { 33169 if (menuSelectedCookie.indexOf("small-business") >= 0) { window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/small-business/de/medical-plans.html"; } 33170 else if (menuSelectedCookie.indexOf("large-business") >= 0) { window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/large-business/de/medical-plans.html"; } 33171 else if (menuSelectedCookie.indexOf("national-business") >= 0) { window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/national-business/medical-plans.html"; } 33172 } 33173 else { 33174 if (menuSelectedCookie.indexOf("small-business") >= 0) { window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/small-business/de/medical-plans"; } 33175 else if (menuSelectedCookie.indexOf("large-business") >= 0) { window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/large-business/de/medical-plans"; } 33176 else if (menuSelectedCookie.indexOf("national-business") >= 0) { window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/national-business/medical-plans"; } 33177 } 33178 33179 }); 33180 33181 jQuery("#wny-medical-plans-link").click(function () { 33182 33183 var menuSelectedCookie = getCookie("menu-selected"); 33184 33185 setCookie("userZIP", "14897"); 33186 setCookie("userRegion", "western-new-york"); 33187 if (getAEMmode) { 33188 if (menuSelectedCookie.indexOf("small-business") >= 0) { window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/small-business/wny/medical-plans.html"; } 33189 else if (menuSelectedCookie.indexOf("large-business") >= 0) { window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/large-business/wny/medical-plans.html"; } 33190 else if (menuSelectedCookie.indexOf("national-business") >= 0) { window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/national-business/medical-plans.html"; } 33191 } 33192 else { 33193 if (menuSelectedCookie.indexOf("small-business") >= 0) { window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/small-business/wny/medical-plans"; } 33194 else if (menuSelectedCookie.indexOf("large-business") >= 0) { window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/large-business/wny/medical-plans"; } 33195 else if (menuSelectedCookie.indexOf("national-business") >= 0) { window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/national-business/medical-plans"; } 33196 } 33197 33198 }); 33199 33200 jQuery("#neny-medical-plans-link").click(function () { 33201 33202 var menuSelectedCookie = getCookie("menu-selected"); 33203 33204 setCookie("userZIP", "12887"); 33205 setCookie("userRegion", "northeastern-new-york"); 33206 if (getAEMmode) { 33207 if (menuSelectedCookie.indexOf("small-business") >= 0) { window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/small-business/neny/medical-plans.html"; } 33208 else if (menuSelectedCookie.indexOf("large-business") >= 0) { window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/large-business/neny/medical-plans.html"; } 33209 else if (menuSelectedCookie.indexOf("national-business") >= 0) { window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/national-business/medical-plans.html"; } 33210 } 33211 else { 33212 if (menuSelectedCookie.indexOf("small-business") >= 0) { window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/small-business/neny/medical-plans"; } 33213 else if (menuSelectedCookie.indexOf("large-business") >= 0) { window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/large-business/neny/medical-plans"; } 33214 else if (menuSelectedCookie.indexOf("national-business") >= 0) { window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/national-business/medical-plans"; } 33215 } 33216 33217 }); 33218 jQuery("#sepa-medical-plans-link").click(function () { 33219 33220 var menuSelectedCookie = getCookie("menu-selected"); 33221
33222 setCookie("userZIP", "19397"); 33223 setCookie("userRegion", "southeastern-pennsylvania"); 33224 33225 if (getAEMmode) { 33226 if (menuSelectedCookie.indexOf("small-business") >= 0) { window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/small-business/sepa/medical-plans.html"; } 33227 else if (menuSelectedCookie.indexOf("large-business") >= 0) { window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/large-business/sepa/medical-plans.html"; } 33228 else if (menuSelectedCookie.indexOf("national-business") >= 0) { window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/national-business/medical-plans.html"; } 33229 } 33230 else { 33231 if (menuSelectedCookie.indexOf("small-business") >= 0) { window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/small-business/sepa/medical-plans"; } 33232 else if (menuSelectedCookie.indexOf("large-business") >= 0) { window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/large-business/sepa/medical-plans"; } 33233 else if (menuSelectedCookie.indexOf("national-business") >= 0) { window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/national-business/medical-plans"; } 33234 } 33235 33236 }); 33237} 33238 33239function changeEmployerBrandLogo() { 33240 userZipCookie = getCookie("userZIP"); 33241 33242 if (userZipCookie) { 33243 jQuery("#txt-zipcode").val(userZipCookie); 33244 jQuery(".txtZIPcode-header").val(userZipCookie); 33245 jQuery("#reservations-zipcode-picker").val(userZipCookie); 33246 jQuery("#reservations-zipcode-mobile-picker").val(userZipCookie); 33247 33248 //display zipcode in top right header only if cookie is present:Reservations website 33249 $("#div-zipcode").css("display", "block"); 33250 $("#div-zipcode-mobile").css("display", "block"); 33251 } 33252 33253 if (userRegionCookie) { 33254 if (userRegionCookie == "western-pennsylvania") { regionCode = "wpa"; } 33255 else if (userRegionCookie == "central-pennsylvania") { regionCode = "cpa"; } 33256 else if (userRegionCookie == "northeastern-pennsylvania") { regionCode = "nepa"; } 33257 else if (userRegionCookie == "west-virginia") { regionCode = "wv"; } 33258 else if (userRegionCookie == "delaware") { regionCode = "de"; } 33259 else if (userRegionCookie == "western-new-york") { regionCode = "wny"; } 33260 else if (userRegionCookie == "northeastern-new-york") { regionCode = "neny"; } 33261 else if (userRegionCookie == "southeastern-pennsylvania") { regionCode = "sepa"; } 33262 } 33263 33264 //header logo change 33265 userRegionCookie = getCookie("userRegion"); 33266 jQuery("#Employer-contact-us-link").attr("href", "https://www.highmarkemployer.com/contact?zip=" + userZipCookie); 33267 jQuery("#Employer-blues-oncall-link").attr("href", "https://www.highmarkemployer.com/engage/blues-on-call?zip=" + userZipCookie); 33268 jQuery("#Employer-link").attr("href", "https://www.highmarkemployer.com?zip=" + userZipCookie); 33269 33270 33271 33272 if (getAEMmode) { //author instance 33273 jQuery("#small-business").attr("href", "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/small-business/" + regionCode + "/medical-plans.html"); 33274 jQuery("#large-business").attr("href", "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/large-business/" + regionCode + "/medical-plans.html"); 33275 jQuery("#national-business").attr("href", "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/national-business/medical-plans.html"); 33276 33277 jQuery("#small-business-medical-plans").attr("href", "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/small-business/" + regionCode + "/medical-plans.html"); 33278 jQuery("#small-business-pharmacy").attr("href", "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/small-business/" + regionCode + "/pharmacy.html"); 33279 jQuery("#small-business-balanced-funding").attr("href", "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/small-business/" + regionCode + "/balanced-funding.html"); 33280 jQuery("#small-business-well360-core").attr("href", "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/small-business/" + regionCode + "/well360-core.html"); 33281 33282 jQuery("#large-business-medical-plans").attr("href", "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/large-business/" + regionCode + "/medical-plans.html"); 33283 jQuery("#large-business-pharmacy").attr("href", "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/large-business/" + regionCode + "/pharmacy.html"); 33284 jQuery("#large-business-balanced-funding").attr("href", "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/large-business/" + regionCode + "/balanced-funding.html"); 33285 jQuery("#large-business-well360-core").attr("href", "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/large-business/" + regionCode + "/well360-core.html"); 33286 33287 jQuery("#national-business-medical-plans").attr("href", "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/national-business/medical-plans.html"); 33288 jQuery("#national-business-pharmacy").attr("href", "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/national-business/pharmacy.html"); 33289 jQuery("#national-business-well360-core").attr("href", "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/national-business/well360-core.html"); 33290 } 33291 else { 33292 jQuery("#small-business").attr("href", window.location.protocol + "//" + window.location.host + "/employer/solutions/small-business/" + regionCode + "/medical-plans"); 33293 jQuery("#large-business").attr("href", window.location.protocol + "//" + window.location.host + "/employer/solutions/large-business/" + regionCode + "/medical-plans"); 33294 jQuery("#national-business").attr("href", window.location.protocol + "//" + window.location.host + "/employer/solutions/national-business/medical-plans"); 33295 33296 jQuery("#small-business-medical-plans").attr("href", window.location.protocol + "//" + window.location.host + "/employer/solutions/small-business/" + regionCode + "/medical-plans"); 33297 jQuery("#small-business-pharmacy").attr("href", window.location.protocol + "//" + window.location.host + "/employer/solutions/small-business/" + regionCode + "/pharmacy"); 33298 jQuery("#small-business-balanced-funding").attr("href", window.location.protocol + "//" + window.location.host + "/employer/solutions/small-business/" + regionCode + "/balanced-funding"); 33299 jQuery("#small-business-well360-core").attr("href", window.location.protocol + "//" + window.location.host + "/employer/solutions/small-business/" + regionCode + "/well360-core"); 33300 33301 jQuery("#large-business-medical-plans").attr("href", window.location.protocol + "//" + window.location.host + "/employer/solutions/large-business/" + regionCode + "/medical-plans"); 33302 jQuery("#large-business-pharmacy").attr("href", window.location.protocol + "//" + window.location.host + "/employer/solutions/large-business/" + regionCode + "/pharmacy"); 33303 jQuery("#large-business-balanced-funding").attr("href", window.location.protocol + "//" + window.location.host + "/employer/solutions/large-business/" + regionCode + "/balanced-funding"); 33304 jQuery("#large-business-well360-core").attr("href", window.location.protocol + "//" + window.location.host + "/employer/solutions/large-business/" + regionCode + "/well360-core"); 33305 33306 jQuery("#national-business-medical-plans").attr("href", window.location.protocol + "//" + window.location.host + "/employer/solutions/national-business/medical-plans"); 33307 jQuery("#national-business-pharmacy").attr("href", window.location.protocol + "//" + window.location.host + "/employer/solutions/national-business/pharmacy"); 33308 jQuery("#national-business-well360-core").attr("href", window.location.protocol + "//" + window.location.host + "/employer/solutions/national-business/well360-core"); 33309 } 33310 33311} 33312 33313 33314$(document).ready(function () { 33315 33316 $('.new-mega-menu-overlay .new-menu-container').html($('.new-main-navigation .main-nav').html()); 33317 //Main nagiation searchbar // when click on search icon searh bar will come 33318 $(document).on('click', '.open-search', function () { 33319 $('.new-mega-menu-overlay').hide(); 33320 $('.search-main .search-input-txt').val(''); 33321 $('.search-main, .search-overlay').show(); 33322 }); 33323 //Main nagiation searchbar // when click on close icon searh bar will be closed 33324 $(document).on('click', '.search-close-icon', function () { 33325 $('.search-main .search-input-txt').val(''); 33326 $('.search-main, .search-overlay').hide(); 33327 }); 33328 33329 var screenWidth = screen.width; 33330 if (screenWidth >= 1025) { 33331 $(document).on('mouseover', '.main-menu li a', function (e) { 33332 33333 e.preventDefault(); 33334 e.stopPropagation(); 33335 33336 33337 $('body').addClass('main-nav-active'); 33338 var $this = $(this), 33339 selectedCls = $this.closest('li').attr('class'), 33340 shadowWidth = 0, 33341 shadowLeft = Math.floor($('.main-nav').offset().left), 33342 shadowHeight = 0, 33343 menuOverlay = $('.new-mega-menu-overlay'), 33344 dropdownSubmenu = $('.dropdown-submenu'); 33345 33346 if (e.target.className === "dropdown-2") { 33347 var leftpx = $this.offset().left - 20 + 'px !important'; 33348 var styleNode = "<style single-column-dropdown-2> .single-column-dropdown-2 { left : " + leftpx + " } </style>"; 33349 $('[single-column-dropdown-2]').remove(); 33350 $(styleNode).insertBefore('body'); 33351 } 33352 33353 if (e.target.className === "dropdown-3") { 33354 var leftpx = $this.offset().left - 20 + 'px !important'; 33355 var styleNode = "<style single-column-dropdown-3> .single-column-dropdown-3 { left : " + leftpx + " } </style>"; 33356 $('[single-column-dropdown-3]').remove(); 33357 $(styleNode).insertBefore('body'); 33358 } 33359 33360 if (e.target.className === "dropdown-4") { 33361 var leftpx = $this.offset().left - 20 + 'px !important'; 33362 var styleNode = "<style single-column-dropdown-4> .single-column-dropdown-4 { left : " + leftpx + " } </style>"; 33363 $('[single-column-dropdown-4]').remove(); 33364 $(styleNode).insertBefore('body'); 33365 } 33366 33367 if (!$this.parents('.new-mega-menu-overlay').length) { 33368 $('.main-nav >ul > li > a, .new-mega-menu-overlay ul > li a').removeClass('active'); 33369 menuOverlay.show().find('a.' + selectedCls).addClass('active'); 33370 shadowWidth = Math.floor(dropdownSubmenu.outerWidth()); 33371 } 33372 if ($this.closest('.new-mega-menu-overlay').length) { 33373 $this.closest('ul').find('a').removeClass('active'); 33374 } 33375 $this.addClass('active'); 33376 shadowWidth = 100 + '%'; 33377 shadowLeft = 0; 33378 shadowHeight = 'inherit'; 33379 menuOverlay.show().css({ 33380 'width': shadowWidth, 33381 'height': shadowHeight 33382 }); 33383 33384 33385 }); 33386 } 33387
33388 $(document).on('click', '#hmk-link-3', function (event) { 33389 event.preventDefault(); 33390 if (screenWidth > 1025) { 33391 var hmkabout = window.location.origin + $("#hmk-link-3").attr("data"); 33392 window.location.href = hmkabout; 33393 } 33394 33395 33396 }); 33397 33398 $(document).on('click', '#hmk-link-4', function (event) { 33399 event.preventDefault(); 33400 if (screenWidth > 1025) { 33401 var hmknewsroom = window.location.origin + $("#hmk-link-4").attr("data"); 33402 window.location.href = hmknewsroom; 33403 } 33404 33405 }); 33406 33407 $(document).on('click', '#hmk-link-1', function (event) { 33408 event.preventDefault(); 33409 if (screenWidth > 1025) { 33410 var hmknewsroom = window.location.origin + $("#hmk-link-1").attr("data"); 33411 window.location.href = hmknewsroom; 33412 } 33413 33414 }); 33415 //Become member page has no child pages, so should always link to page 33416 $(document).on('click', '#hmk-link-2', function (event) { 33417 event.preventDefault(); 33418 //if(screenWidth > 1025){ 33419 var hmknewsroom = window.location.origin + $("#hmk-link-2").attr("data"); 33420 window.location.href = hmknewsroom; 33421 //} 33422 33423 }); 33424 33425 $(document).on('click', '#hmk-link-6', function (event) { 33426 event.preventDefault(); 33427 if (screenWidth > 1025) { 33428 var hmknewsroom = window.location.origin + $("#hmk-link-6").attr("data"); 33429 window.location.href = hmknewsroom; 33430 } 33431 33432 }); 33433 33434 $(document).on('click', '#hmk-link-5', function (event) { 33435 event.preventDefault(); 33436 if (screenWidth > 1025) { 33437 var hmknewsroom = window.location.origin + $("#hmk-link-5").attr("data"); 33438 window.location.href = hmknewsroom; 33439 } 33440 33441 }); 33442 33443 33444 if (screenWidth < 1025) { 33445 33446 33447 $(document).on('click', '.main-menu li a:not(.dropdown-submenu > a, #hmk-link-2)', function (e) { 33448 e.preventDefault(); 33449 e.stopPropagation(); 33450 33451 $('body').addClass('main-nav-active'); 33452 var $this = $(this), 33453 selectedCls = $this.closest('li').attr('class'), 33454 shadowWidth = 0, 33455 shadowLeft = Math.floor($('.main-nav').offset().left), 33456 shadowHeight = 0, 33457 menuOverlay = $('.new-mega-menu-overlay'), 33458 dropdownSubmenu = $('.dropdown-submenu'); 33459 33460 if (!$this.parents('.new-mega-menu-overlay').length) { 33461 $('.main-nav >ul > li > a, .new-mega-menu-overlay ul > li a').removeClass('active'); 33462 menuOverlay.show().find('a.' + selectedCls).addClass('active'); 33463 shadowWidth = Math.floor(dropdownSubmenu.outerWidth()); 33464 } 33465 if ($this.closest('.new-mega-menu-overlay').length) { 33466 $this.closest('ul').find('a').removeClass('active'); 33467 } 33468 $this.addClass('active'); 33469 shadowWidth = 100 + '%'; 33470 shadowLeft = 0; 33471 shadowHeight = 'inherit'; 33472 menuOverlay.show().css({ 33473 'width': shadowWidth, 33474 'height': shadowHeight 33475 }); 33476 33477 }); 33478 33479 33480 } 33481 33482 //This is for Main Navigation component(Configurable Header Navigation Menu) to trigger Adobe CJA 33483 $(document).on('click', ".mainnavigation-link-item", function (event) { 33484 AdobeCJATracking.addClickToDataLayer(event, true); 33485 }); 33486 33487 33488 33489 $(document).on('click', function () { 33490 $('body').removeClass('main-nav-active'); 33491 $('.main-nav ul li, .main-nav ul li a, .new-mega-menu-overlay .first-level li a ').removeClass('active'); 33492 dropdownSubmenu.removeAttr("style").removeClass('dropdown-menu-shadow'); 33493 menuOverlay.removeAttr('style'); 33494 }); 33495 33496 $(document).on('mouseleave', '.new-header-main-navigation', function () { 33497 $('body').removeClass('main-nav-active'); 33498 $('.main-nav ul li, .main-nav ul li a, .new-mega-menu-overlay .first-level li a ').removeClass('active'); 33499 dropdownSubmenu.removeAttr("style").removeClass('dropdown-menu-shadow'); 33500 menuOverlay.removeAttr('style'); 33501 }); 33502 33503 33504 if ($('.new-menu-container>.main-menu>.hmk-link-4>.dropdown-submenu>li>.hmk-link-4-col-1>.hmk-secondlevel-padding').length > 10) { 33505 $('.new-menu-container>.main-menu>.hmk-link-4>.dropdown-submenu>li').after('<li><ul class=\'hmk-link-4-col-2\'></ul></li>'); 33506 $('.new-menu-container>.main-menu>.hmk-link-4>.dropdown-submenu>li>.hmk-link-4-col-1>.hmk-secondlevel-padding').slice(5).appendTo($('.new-menu-container>.main-menu>.hmk-link-4>.dropdown-submenu>li>.hmk-link-4-col-2')); 33507 $('.hmk-link-4>.dropdown-submenu>li>.hmk-link-4-col-1>.hmk-secondlevel-padding').slice(5).remove(); 33508 } 33509 33510 if ($('.new-menu-container>.main-menu>.hmk-link-4>.dropdown-submenu>
33510li>.hmk-link-4-col-2>.hmk-secondlevel-padding').length > 10) { 33511 $('.new-menu-container>.main-menu>.hmk-link-4>.dropdown-submenu>li').slice(1).after('<li><ul class=\'hmk-link-4-col-3\'></ul></li>'); 33512 $('.new-menu-container>.main-menu>.hmk-link-4>.dropdown-submenu>li>.hmk-link-4-col-2>.hmk-secondlevel-padding').slice(5).appendTo($('.new-menu-container>.main-menu>.hmk-link-4>.dropdown-submenu>li>.hmk-link-4-col-3')); 33513 $('.new-menu-container>.main-menu>.hmk-link-4>.dropdown-submenu>li>.hmk-link-4-col-2>.hmk-secondlevel-padding').slice(5).remove(); 33514 } 33515 33516 33517 if ($('.new-menu-container>.main-menu>.hmk-link-1>.dropdown-submenu>li>.hmk-link-1-col-1>.hmk-secondlevel-padding').length > 10) { 33518 $('.new-menu-container>.main-menu>.hmk-link-1>.dropdown-submenu>li').after('<li><ul class=\'hmk-link-1-col-2\'></ul></li>'); 33519 $('.new-menu-container>.main-menu>.hmk-link-1>.dropdown-submenu>li>.hmk-link-1-col-1>.hmk-secondlevel-padding').slice(5).appendTo($('.new-menu-container>.main-menu>.hmk-link-1>.dropdown-submenu>li>.hmk-link-1-col-2')); 33520 $('.new-menu-container>.main-menu>.hmk-link-1>.dropdown-submenu>li>.hmk-link-1-col-1>.hmk-secondlevel-padding').slice(5).remove(); 33521 } 33522 33523 if ($('.new-menu-container>.main-menu>.hmk-link-1>.dropdown-submenu>li>.hmk-link-1-col-2>.hmk-secondlevel-padding').length > 10) { 33524 $('.new-menu-container>.main-menu>.hmk-link-1>.dropdown-submenu>li').after('<li><ul class=\'hmk-link-1-col-3\'></ul></li>'); 33525 $('.new-menu-container>.main-menu>.hmk-link-1>.dropdown-submenu>li>.hmk-link-1-col-2>.hmk-secondlevel-padding').slice(5).appendTo($('.new-menu-container>.main-menu>.hmk-link-1>.dropdown-submenu>li>.hmk-link-1-col-3')); 33526 $('.new-menu-container>.main-menu>.hmk-link-1>.dropdown-submenu>li>.hmk-link-1-col-2>.hmk-secondlevel-padding').slice(5).remove(); 33527 } 33528 33529 if ($('.new-menu-container>.main-menu>.hmk-link-2>.dropdown-submenu>li>.hmk-link-2-col-1>.hmk-secondlevel-padding').length > 10) { 33530 $('.new-menu-container>.main-menu>.hmk-link-2>.dropdown-submenu>li').after('<li><ul class=\'hmk-link-2-col-2\'></ul></li>'); 33531 $('.new-menu-container>.main-menu>.hmk-link-2>.dropdown-submenu>li>.hmk-link-2-col-1>.hmk-secondlevel-padding').slice(5).appendTo($('.new-menu-container>.main-menu>.hmk-link-2>.dropdown-submenu>li>.hmk-link-2-col-2')); 33532 $('.new-menu-container>.main-menu>.hmk-link-2>.dropdown-submenu>li>.hmk-link-2-col-1>.hmk-secondlevel-padding').slice(5).remove(); 33533 } 33534 33535 if ($('.new-menu-container>.main-menu>.hmk-link-2>.dropdown-submenu>li>.hmk-link-2-col-2>.hmk-secondlevel-padding').length > 10) { 33536 $('.new-menu-container>.main-menu>.hmk-link-2>.dropdown-submenu>li').after('<li><ul class=\'hmk-link-2-col-3\'></ul></li>'); 33537 $('.new-menu-container>.main-menu>.hmk-link-2>.dropdown-submenu>li>.hmk-link-2-col-2>.hmk-secondlevel-padding').slice(5).appendTo($('.new-menu-container>.main-menu>.hmk-link-2>.dropdown-submenu>li>.hmk-link-2-col-3')); 33538 $('.new-menu-container>.main-menu>.hmk-link-2>.dropdown-submenu>li>.hmk-link-2-col-2>.hmk-secondlevel-padding').slice(5).remove(); 33539 } 33540 33541 33542 if ($('.new-menu-container>.main-menu>.hmk-link-6>.dropdown-submenu>li>.hmk-link-6-col-1>.hmk-secondlevel-padding').length > 10) { 33543 $('.new-menu-container>.main-menu>.hmk-link-6>.dropdown-submenu>li').after('<li><ul class=\'hmk-link-6-col-2\'></ul></li>'); 33544 $('.new-menu-container>.main-menu>.hmk-link-6>.dropdown-submenu>li>.hmk-link-6-col-1>.hmk-secondlevel-padding').slice(5).appendTo($('.new-menu-container>.main-menu>.hmk-link-6>.dropdown-submenu>li>.hmk-link-6-col-2')); 33545 $('.new-menu-container>.main-menu>.hmk-link-6>.dropdown-submenu>li>.hmk-link-6-col-1>.hmk-secondlevel-padding').slice(5).remove(); 33546 } 33547 33548 if ($('.new-menu-container>.main-menu>.hmk-link-6>.dropdown-submenu>li>.hmk-link-6-col-2>.hmk-secondlevel-padding').length > 10) { 33549 $('.new-menu-container>.main-menu>.hmk-link-6>.dropdown-submenu>li').after('<li><ul class=\'hmk-link-6-col-3\'></ul></li>'); 33550 $('.new-menu-container>.main-menu>.hmk-link-6>.dropdown-submenu>li>.hmk-link-6-col-2>.hmk-secondlevel-padding').slice(5).appendTo($('.new-menu-container>.main-menu>.hmk-link-6>.dropdown-submenu>
33550li>.hmk-link-6-col-3')); 33551 $('.new-menu-container>.main-menu>.hmk-link-6>.dropdown-submenu>li>.hmk-link-6-col-2>.hmk-secondlevel-padding').slice(5).remove(); 33552 } 33553 33554 if ($('.new-menu-container>.main-menu>.hmk-link-5>.dropdown-submenu>li>.hmk-link-5-col-1>.hmk-secondlevel-padding').length > 10) { 33555 $('.new-menu-container>.main-menu>.hmk-link-5>.dropdown-submenu>li').after('<li><ul class=\'hmk-link-5-col-2\'></ul></li>'); 33556 $('.new-menu-container>.main-menu>.hmk-link-5>.dropdown-submenu>li>.hmk-link-5-col-1>.hmk-secondlevel-padding').slice(5).appendTo($('.new-menu-container>.main-menu>.hmk-link-5>.dropdown-submenu>li>.hmk-link-5-col-2')); 33557 $('.new-menu-container>.main-menu>.hmk-link-5>.dropdown-submenu>li>.hmk-link-5-col-1>.hmk-secondlevel-padding').slice(5).remove(); 33558 } 33559 33560 if ($('.new-menu-container>.main-menu>.hmk-link-5>.dropdown-submenu>li>.hmk-link-5-col-2>.hmk-secondlevel-padding').length > 10) { 33561 $('.new-menu-container>.main-menu>.hmk-link-5>.dropdown-submenu>li').after('<li><ul class=\'hmk-link-5-col-3\'></ul></li>'); 33562 $('.new-menu-container>.main-menu>.hmk-link-5>.dropdown-submenu>li>.hmk-link-5-col-2>.hmk-secondlevel-padding').slice(5).appendTo($('.new-menu-container>.main-menu>.hmk-link-5>.dropdown-submenu>li>.hmk-link-5-col-3')); 33563 $('.new-menu-container>.main-menu>.hmk-link-5>.dropdown-submenu>li>.hmk-link-5-col-2>.hmk-secondlevel-padding').slice(5).remove(); 33564 } 33565 33566 if ($('.new-menu-container>.main-menu>.hmk-link-3>.dropdown-submenu>li>.single-col>.hmk-secondlevel-padding').length > 10) { 33567 $('.new-menu-container>.main-menu>.hmk-link-3>.dropdown-submenu>li').after('<li><ul class=\'hmk-link-3-col-2\'></ul></li>'); 33568 $('.new-menu-container>.main-menu>.hmk-link-3>.dropdown-submenu>li>.single-col>.hmk-secondlevel-padding').slice(5).appendTo($('.new-menu-container>.main-menu>.hmk-link-3>.dropdown-submenu>li>.hmk-link-3-col-2')); 33569 $('.new-menu-container>.main-menu>.hmk-link-3>.dropdown-submenu>li>.single-col>.hmk-secondlevel-padding').slice(5).remove(); 33570 } 33571 33572 if ($('.new-menu-container>.main-menu>.hmk-link-3>.dropdown-submenu>li>.hmk-link-3-col-2>.hmk-secondlevel-padding').length > 10) { 33573 $('.new-menu-container>.main-menu>.hmk-link-3>.dropdown-submenu>li').after('<li><ul class=\'hmk-link-3-col-3\'></ul></li>'); 33574 $('.new-menu-container>.main-menu>.hmk-link-3>.dropdown-submenu>li>.hmk-link-3-col-2>.hmk-secondlevel-padding').slice(5).appendTo($('.new-menu-container>.main-menu>.hmk-link-3>.dropdown-submenu>li>.hmk-link-3-col-3')); 33575 $('.new-menu-container>.main-menu>.hmk-link-3>.dropdown-submenu>li>.hmk-link-3-col-2>.hmk-secondlevel-padding').slice(5).remove(); 33576 } 33577 33578}); 33579 33580 33581var maxHeight = 0, 33582 menuOverlay = $('.new-mega-menu-overlay'), 33583 dropdownSubmenu = $('.dropdown-submenu'); 33584 33585function maxHeightChildNav(ele) { 33586 var ele = $(ele); 33587 maxHeight = 0; 33588 ele.removeAttr('style'); 33589 ele.each(function () { 33590 var $this = $(this); 33591 if ($this.height() > maxHeight) { 33592 maxHeight = Math.floor($this.height() + 100); 33593 } 33594 }); 33595 $(ele).height(maxHeight); 33596} 33597 33598$(document).ready(function () { 33599 33600 var path = $("#main-site-search-form").data("search-result-page"); 33601 33602 $(".search-toggler-btn").click(function () { 33603 showSearchBar(); 33604 }); 33605 33606 $(".search-toggler-btn").keypress(function( event ) { 33607 if (event.keyCode === 13) { 33608 showSearchBar(); 33609 } 33610 }); 33611 33612 function showSearchBar(){ 33613 $(".row.nav-bar-row").hide(); 33614 $(".row.search-bar-row").removeClass("d-none"); 33615 var getInput = document.getElementById('site-search-input'); 33616 getInput.focus(); 33617 } 33618 33619 $(".close-toggler-btn").click(function () { 33620 $(".row.nav-bar-row").show(); 33621 $(".row.search-bar-row").addClass("d-none"); 33622 33623 }); 33624 33625 $(".close-toggler-btn").keypress(function( event ) { 33626 if (event.keyCode === 13) { 33627 $(".row.nav-bar-row").show(); 33628 $(".row.search-bar-row").addClass("d-none"); 33629 33630 } 33631 }); 33632 33633}); 33634(function ($) { 33635 var SUB_MENU_COLLAPSE_STATE = { 33636 left: '1000px' 33637 }; 33638 var SUB_MENU_EXPAND_STATE = { 33639 left: '0' 33640 }; 33641 var $sliderMenu = $('#new-menu-expand'); 33642 var mobileNav = $('#new-mobile-header'); 33643 $('#new-toggle-icon').on('click', function () { 33644 $(this).prop('aria-expanded', true); 33645 openSliderMenu(); 33646 $('#new-toggle-icon').addClass('d-none'); 33647 $('.close-icon').removeClass('d-none'); 33648 $('body').addClass('no-scroll');
33649 const totalHeaderHeight = mobileNav.outerHeight() + $('.alertbanner').outerHeight() + $sliderMenu.outerHeight() + 100; 33650 const windowHeight = Math.round(window.outerHeight); 33651 if (totalHeaderHeight > windowHeight) { 33652 $sliderMenu.addClass('menu-expand-scroll') 33653 $('.alertbanner').hide(); 33654 } 33655 }); 33656 33657 $('.close-icon').on('click', function () { 33658 $(this).prop('aria-expanded', false); 33659 $sliderMenu.find('.new-secondary-navs-container').css( 33660 SUB_MENU_COLLAPSE_STATE).addClass('d-none'); 33661 33662 closeSliderMenu(); 33663 33664 if ($sliderMenu.hasClass('menu-expand-scroll')) { 33665 $sliderMenu.removeClass('menu-expand-scroll'); 33666 $('.alertbanner').show(); 33667 } 33668 $('.close-icon').addClass('d-none'); 33669 $('#new-toggle-icon').removeClass('d-none'); 33670 $('body').removeClass('no-scroll'); 33671 }); 33672 33673 function closeSliderMenu() { 33674 if (mobileNav.hasClass('sticky-nav')) { 33675 $sliderMenu.removeClass('open-sticky') 33676 } else { 33677 $sliderMenu.removeClass('open'); 33678 } 33679 } 33680 33681 function openSliderMenu() { 33682 if (mobileNav.hasClass('sticky-nav')) { 33683 $sliderMenu.addClass('open-sticky') 33684 } else { 33685 $sliderMenu.addClass('open'); 33686 } 33687 } 33688 33689 33690 $('#new-menu-expand').on('click', '.close-icon', function () { 33691 $(this).prop('aria-expanded', false); 33692 $sliderMenu.find('.new-secondary-navs-container').css(SUB_MENU_COLLAPSE_STATE).addClass('d-none'); 33693 $sliderMenu.removeClass('open'); 33694 }); 33695 33696 $('.new-m-nav-link-item').on('click', function (e) { 33697 var $subMenu = $(this).parent().find('> .new-secondary-navs-container'); 33698 if ($sliderMenu.hasClass('menu-expand-scroll')) { 33699 $sliderMenu.removeClass('menu-expand-scroll'); 33700 } 33701 if ($subMenu.length) { 33702 e.preventDefault(); 33703 $('#new-menu-expand').data('bc-back', 'false'); 33704 $subMenu.removeClass('d-none').animate(SUB_MENU_EXPAND_STATE, 250, function () { 33705 $subMenu.css({ 33706 // 'overflow-y': 'scroll', 33707 'overflow-x': 'hidden', 33708 '-webkit-overflow-scrolling': 'touch' 33709 }); 33710 }); 33711 return; 33712 } 33713 }); 33714 33715 // Hide Header on on scroll down 33716 var didScroll; 33717 var lastScrollTop = 0; 33718 var delta = 5; 33719 var navbarHeight = $('newmobilenav').outerHeight(); 33720 33721 $(window).scroll(function (event) { 33722 didScroll = true; 33723 }); 33724 33725 setInterval(function () { 33726 if (didScroll && window.matchMedia('(max-width: 768px)').matches) { 33727 hasScrolled(); 33728 didScroll = false; 33729 } 33730 }, 250); 33731 33732 function hasScrolled() { 33733 var st = $(this).scrollTop(); 33734 33735 // Make sure they scroll more than delta 33736 if (Math.abs(lastScrollTop - st) <= delta) { 33737 return; 33738 } 33739 var isPositionFixed = (mobileNav.css('position') == 'fixed'); 33740 33741 if ($(this).scrollTop() < 50 && isPositionFixed) { 33742 mobileNav.removeClass('sticky-nav'); 33743 33744 } 33745 33746 // If they scrolled down and are past the navbar, add class .nav-up. 33747 // This is necessary so you never see what is "behind" the navbar. 33748 if (st > lastScrollTop && st > navbarHeight) { 33749 33750 $('.alertbanner').hide(25); 33751 mobileNav.removeClass('sticky-nav'); 33752 33753 33754 if (!$('#menu-expand').hasClass('open')) { 33755 mobileNav.removeClass('nav-down').addClass('nav-up'); 33756 33757 } 33758 33759 } else { 33760 if (st + $(window).height() < $(document).height()) { 33761 mobileNav.removeClass('nav-up').addClass('nav-down'); 33762 if ($(this).scrollTop() > 50 && !isPositionFixed) { 33763 33764 mobileNav.addClass('sticky-nav'); 33765 33766 } 33767 if (st == 0) { 33768 $('.alertbanner').show(100); 33769 } 33770 } 33771 } 33772 33773 lastScrollTop = st; 33774 } 33775 33776 33777 $('.new-nav-back-btn').on('click', function (e) { 33778 var bdBack = $('#new-menu-expand').data('bc-back'); 33779 if (bdBack === 'true') { 33780 $('#new-menu-expand').data('bc-back', 'false'); 33781 var $subMenu = $(this).closest('.new-secondary-navs-container').closest( 33782 '.new-secondary-navs-container'); 33783 if ($subMenu.length) { 33784 e.preventDefault(); 33785 $('#new-menu-expand').removeClass('open'); 33786 33787 $subMenu.css(SUB_MENU_COLLAPSE_STATE); 33788 $subMenu.parents('.new-secondary-navs-container').css( 33789 SUB_MENU_EXPAND_STATE); 33790 33791 $('#new-menu-expand').addClass('open'); 33792 } 33793 } 33794 else { 33795 33796 var $subMenu = $(this).closest('.new-secondary-navs-container'); 33797 if ($subMenu.length) { 33798 e.preventDefault(); 33799 $subMenu.css({ 'overflow-y': 'none', 'overflow-x': 'hidden' }).animate( 33800 SUB_MENU_COLLAPSE_STATE, 500, function () { 33801 $subMenu.addClass('d-none'); 33802 }); 33803 } 33804 } 33805 33806 }); 33807 // Site search text field event logic for mobile 33808 $('#new-mobile-site-search-input').on('input', function () { 33809 var newSearchTerm = $('#new-mobile-site-search-input').val(); 33810 if (newSearchTerm === undefined || newSearchTerm === "") { 33811 $('#new-mobile-clear-icon').addClass('new-mobile-clear-icon'); 33812 $('#new-mobile-clear-icon').removeClass('new-mobile-clear-icon-focus'); 33813 } else { 33814 $('#new-mobile-clear-icon').addClass('new-mobile-clear-icon-focus'); 33815 $('#new-mobile-clear-icon').removeClass('new-mobile-clear-icon'); 33816 } 33817 return false;
33818 }); 33819 33820 $('#new-mobile-clear-icon').on('click', function () { 33821 $('#new-mobile-clear-icon').addClass('new-mobile-clear-icon'); 33822 $('#new-mobile-clear-icon').removeClass('new-mobile-clear-icon-focus'); 33823 newStartSearching(); 33824 $('#new-mobile-site-search-input').val(''); 33825 }); 33826 33827 $('#new-mobile-site-search-input').on('keypress', function (e) { 33828 if (e.which === 13) { 33829 e.preventDefault(); 33830 //Disable textbox to prevent multiple submit 33831 newStartSearching(); 33832 } 33833 }); 33834 33835 function newStartSearching() { 33836 $('#new-mobile-site-search-input').attr("disabled", "disabled"); 33837 var newSearchTerm = $('#new-mobile-site-search-input').val(); 33838 var currentURL = window.location.href; 33839 if (!(newSearchTerm === undefined || newSearchTerm === "")) { 33840 if (currentURL.includes("/employer")) { 33841 window.location = window.location.origin + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/search?searchTerm=" + newSearchTerm; 33842 } 33843 else { 33844 window.location = window.location.origin + "/content/digital-marketing/en/highmark/highmarkdotcom/home/search?searchTerm=" + newSearchTerm; 33845 } 33846 } 33847 //Enable the textbox again if needed. 33848 $('#new-mobile-site-search-input').removeAttr("disabled"); 33849 } 33850 33851 $('.new-btn-mobile-search').on('click', function (e) { 33852 var iconName = $(this).text().trim() === 'search' ? 'close' : 'search'; 33853 $(this).text(iconName); 33854 $('.mobile-site-main-search-wrapper').toggleClass('d-none'); 33855 $('.new-logo-container').toggleClass('d-none'); 33856 if (iconName == 'close') { 33857 $('.new-mobile-navs-left').removeClass('d-flex'); 33858 $('.new-mobile-navs-left').addClass('d-none'); 33859 } 33860 else { 33861 $('.new-mobile-navs-left').removeClass('d-none'); 33862 $('.new-mobile-navs-left').addClass('d-flex'); 33863 } 33864 }); 33865 33866})(jQuery); 33867 33868(function ($) { 33869 var SUB_MENU_COLLAPSE_STATE = { 33870 left: '1000px' 33871 }; 33872 var SUB_MENU_EXPAND_STATE = { 33873 left: '0' 33874 }; 33875 var $sliderMenu = $('#emp-menu-expand'); 33876 var mobileNav = $('#emp-mobile-header'); 33877 $('#emp-toggle-icon').on('click', function () { 33878 $(this).prop('aria-expanded', true); 33879 openSliderMenu(); 33880 $('#emp-toggle-icon').addClass('d-none'); 33881 $('.emp-close-icon').removeClass('d-none'); 33882 $('body').addClass('no-scroll'); 33883 const totalHeaderHeight = mobileNav.outerHeight() + $('.alertbanner').outerHeight() + $sliderMenu.outerHeight() + 100; 33884 const windowHeight = Math.round(window.outerHeight); 33885 if (totalHeaderHeight > windowHeight) { 33886 $sliderMenu.addClass('menu-expand-scroll') 33887 $('.alertbanner').hide(); 33888 } 33889 }); 33890 33891 $('.emp-close-icon').on('click', function () { 33892 $(this).prop('aria-expanded', false); 33893 $sliderMenu.find('.emp-secondary-navs-container').css( 33894 SUB_MENU_COLLAPSE_STATE).addClass('d-none'); 33895 33896 closeSliderMenu(); 33897 33898 if ($sliderMenu.hasClass('menu-expand-scroll')) { 33899 $sliderMenu.removeClass('menu-expand-scroll'); 33900 $('.alertbanner').show(); 33901 } 33902 $('.emp-close-icon').addClass('d-none'); 33903 $('#emp-toggle-icon').removeClass('d-none'); 33904 $('body').removeClass('no-scroll'); 33905 }); 33906 33907 33908 $('#emp-menu-expand').on('click', '.emp-close-icon', function () { 33909 $(this).prop('aria-expanded', false); 33910 $sliderMenu.find('.emp-secondary-navs-container').css(SUB_MENU_COLLAPSE_STATE).addClass('d-none'); 33911 $sliderMenu.removeClass('open'); 33912 }); 33913 33914 $('.emp-m-nav-link-item').on('click', function (e) { 33915 var $subMenu = $(this).parent().find('> .emp-secondary-navs-container'); 33916 if ($sliderMenu.hasClass('menu-expand-scroll')) { 33917 $sliderMenu.removeClass('menu-expand-scroll'); 33918 } 33919 if ($subMenu.length) { 33920 e.preventDefault(); 33921 $subMenu.removeClass('d-none').animate(SUB_MENU_EXPAND_STATE, 250, function () { 33922 $subMenu.css({ 33923 'overflow-y': 'scroll', 33924 'overflow-x': 'hidden' 33925 }); 33926 }); 33927 return; 33928 } 33929 }); 33930 33931 33932 function closeSliderMenu() { 33933 if (mobileNav.hasClass('sticky-nav')) { 33934 $sliderMenu.removeClass('open-sticky') 33935 } else { 33936 $sliderMenu.removeClass('open'); 33937 } 33938 } 33939 function openSliderMenu() { 33940 if (mobileNav.hasClass('sticky-nav')) { 33941 $sliderMenu.addClass('open-sticky') 33942 } else { 33943 $sliderMenu.addClass('open'); 33944 } 33945 } 33946 33947 var didScroll; 33948 var lastScrollTop = 0; 33949 var delta = 5; 33950 var navbarHeight = $('newmobilenav').outerHeight(); 33951 33952 $(window).scroll(function (event) { 33953 didScroll = true; 33954 }); 33955 33956 setInterval(function () { 33957 if (didScroll && window.matchMedia('(max-width: 768px)').matches) { 33958 hasScrolled(); 33959 didScroll = false;
33960 } 33961 }, 250); 33962 33963 function hasScrolled() { 33964 var st = $(this).scrollTop(); 33965 33966 // Make sure they scroll more than delta 33967 if (Math.abs(lastScrollTop - st) <= delta) { 33968 return; 33969 } 33970 var isPositionFixed = (mobileNav.css('position') == 'fixed'); 33971 33972 if ($(this).scrollTop() < 50 && isPositionFixed) { 33973 mobileNav.removeClass('sticky-nav'); 33974 33975 } 33976 33977 // If they scrolled down and are past the navbar, add class .nav-up. 33978 // This is necessary so you never see what is "behind" the navbar. 33979 if (st > lastScrollTop && st > navbarHeight) { 33980 33981 $('.alertbanner').hide(25); 33982 mobileNav.removeClass('sticky-nav'); 33983 33984 33985 if (!$('#emp-menu-expand').hasClass('open')) { 33986 mobileNav.removeClass('nav-down').addClass('nav-up'); 33987 33988 } 33989 33990 } else { 33991 if (st + $(window).height() < $(document).height()) { 33992 mobileNav.removeClass('nav-up').addClass('nav-down'); 33993 if ($(this).scrollTop() > 50 && !isPositionFixed) { 33994 33995 mobileNav.addClass('sticky-nav'); 33996 33997 } 33998 if (st == 0) { 33999 $('.alertbanner').show(100); 34000 } 34001 } 34002 } 34003 34004 lastScrollTop = st; 34005 } 34006 34007 34008 $('.emp-nav-back-btn').on('click', function (e) { 34009 var bdBack = $('#emp-menu-expand').data('bc-back'); 34010 if (bdBack === 'true') { 34011 $('#emp-menu-expand').data('bc-back', 'false'); 34012 var $subMenu = $(this).closest('.emp-secondary-navs-container').closest( 34013 '.emp-secondary-navs-container'); 34014 if ($subMenu.length) { 34015 e.preventDefault(); 34016 $('#emp-menu-expand').removeClass('open'); 34017 34018 $subMenu.css(SUB_MENU_COLLAPSE_STATE); 34019 $subMenu.parents('.emp-secondary-navs-container').css( 34020 SUB_MENU_EXPAND_STATE); 34021 34022 $('#emp-menu-expand').addClass('open'); 34023 } 34024 } 34025 else { 34026 var $subMenu = $(this).closest('.emp-secondary-navs-container'); 34027 if ($subMenu.length) { 34028 e.preventDefault(); 34029 $subMenu.css({ 34030 'overflow-y': 'none', 34031 'overflow-x': 'hidden' 34032 }).animate(SUB_MENU_COLLAPSE_STATE, 500, function () { 34033 $subMenu.addClass('d-none'); 34034 }); 34035 } 34036 } 34037 }); 34038 // Site search text field event logic for mobile 34039 $('#emp-mobile-site-search-input').on('input', function () { 34040 var empSearchTerm = $('#emp-mobile-site-search-input').val(); 34041 if (empSearchTerm === undefined || empSearchTerm === "") { 34042 $('#emp-mobile-clear-icon').addClass('emp-mobile-clear-icon'); 34043 $('#emp-mobile-clear-icon').removeClass('emp-mobile-clear-icon-focus'); 34044 } else { 34045 $('#emp-mobile-clear-icon').addClass('emp-mobile-clear-icon-focus'); 34046 $('#emp-mobile-clear-icon').removeClass('emp-mobile-clear-icon'); 34047 } 34048 return false; 34049 }); 34050 34051 $('#emp-mobile-clear-icon').on('click', function () { 34052 $('#emp-mobile-clear-icon').addClass('emp-mobile-clear-icon'); 34053 $('#emp-mobile-clear-icon').removeClass('emp-mobile-clear-icon-focus'); 34054 empStartSearching(); 34055 $('#emp-mobile-site-search-input').val(''); 34056 }); 34057 34058 $('#emp-mobile-site-search-input').on('keypress', function (e) { 34059 if (e.which === 13) { 34060 e.preventDefault(); 34061 //Disable textbox to prevent multiple submit 34062 empStartSearching(); 34063 } 34064 }); 34065 34066 function GetQueryStringParams(sParam) { 34067 var sPageURL = window.location.search.substring(1); 34068 var sURLVariables = sPageURL.split('&'); 34069 for (var i = 0; i < sURLVariables.length; i++) { 34070 var sParameterName = sURLVariables[i].split('='); 34071 if (sParameterName[0] == sParam) { 34072 return sParameterName[1]; 34073 } 34074 } 34075 } 34076 34077 $('.emp-m-nav-sol-link-item').on('click', function (e) { 34078 e.preventDefault(); 34079 var userRegionCookie = getCookie("userRegion"); 34080 var userZipCookie = getCookie("userZIP"); 34081 var regionCode; 34082 var baseURL = e.currentTarget.href; 34083 34084 if (userRegionCookie == null) { 34085 34086 setCookie("mobile-menu-selected", baseURL); 34087 34088 if (getAEMmode) { 34089 window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/zipcode-gate-login.html"; 34090 } else { 34091 window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/zipcode-gate-login"; 34092 } 34093 34094 } else { 34095 34096 if (userRegionCookie == "western-pennsylvania") { 34097 regionCode = "wpa"; 34098 } else if (userRegionCookie == "central-pennsylvania") { 34099 regionCode = "cpa"; 34100 } else if (userRegionCookie == "northeastern-pennsylvania") { 34101 regionCode = "nepa"; 34102 } else if (userRegionCookie == "west-virginia") { 34103 regionCode = "wv"; 34104 } else if (userRegionCookie == "delaware") { 34105 regionCode = "de"; 34106 } else if (userRegionCookie == "western-new-york") { 34107 regionCode = "wny"; 34108 } else if (userRegionCookie == "northeastern-new-york") { 34109 regionCode = "neny"; 34110 } else if (userRegionCookie == "southeastern-pennsylvania") { 34111 regionCode = "sepa"; 34112 } 34113 34114 baseURL = baseURL.split('.html')[0]; 34115 baseURL = baseURL + "/" + regionCode + "/medical-plans.html"; 34116 34117 window.location.href = baseURL; 34118 } 34119 34120 }); 34121 34122 $('.emp-nav-child-page').on('click', function (e) { 34123 e.preventDefault(); 34124 var userRegionCookie = getCookie("userRegion"); 34125 var userZipCookie = getCookie("userZIP"); 34126 var regionCode; 34127 var baseURL = e.currentTarget.href; 34128 34129 if (userRegionCookie == null) { 34130 34131 setCookie("mobile-menu-selected", baseURL); 34132 34133 if (getAEMmode) { 34134 window.location.href = window.location.protocol + "//" + window.location.host + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/solutions/zipcode-gate-login.html"; 34135 } else { 34136 window.location.href = window.location.protocol + "//" + window.location.host + "/employer/solutions/zipcode-gate-login"; 34137 } 34138 34139 } else { 34140 34141 if (userRegionCookie == "western-pennsylvania") { 34142 regionCode = "wpa"; 34143 } else if (userRegionCookie == "central-pennsylvania") { 34144 regionCode = "cpa"; 34145 } else if (userRegionCookie == "northeastern-pennsylvania") { 34146 regionCode = "nepa"; 34147 } else if (userRegionCookie == "west-virginia") { 34148 regionCode = "wv"; 34149 } else if (userRegionCookie == "delaware") { 34150 regionCode = "de"; 34151 } else if (userRegionCookie == "western-new-york") { 34152 regionCode = "wny"; 34153 } else if (userRegionCookie == "northeastern-new-york") { 34154 regionCode = "neny"; 34155 } else if (userRegionCookie == "southeastern-pennsylvania") { 34156 regionCode = "sepa"; 34157 } 34158 34159 baseURL = baseURL.replace('/wpa/', '/' + regionCode + '/'); 34160 34161 window.location.href = baseURL + ".html"; 34162 } 34163 34164 }); 34165
34166 function empStartSearching() { 34167 $('#emp-mobile-site-search-input').attr("disabled", "disabled"); 34168 var empSearchTerm = $('#emp-mobile-site-search-input').val(); 34169 var currentURL = window.location.href; 34170 34171 if (!(empSearchTerm === undefined || empSearchTerm === "")) { 34172 34173 if (currentURL.includes("/employer")) { 34174 if (getAEMmode == null) { 34175 window.location = window.location.origin + "/employer/search?searchTerm=" + empSearchTerm + "&start=10"; 34176 } else { 34177 window.location = window.location.origin + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/search.html?searchTerm=" + empSearchTerm + "&start=10"; 34178 } 34179 } else if (currentURL.includes("/wholecare")) { 34180 if (getAEMmode == null) { 34181 window.location = window.location.origin + "/wholecare/search?searchTerm=" + empSearchTerm + "&start=10"; 34182 } else { 34183 window.location = window.location.origin + "/content/digital-marketing/en/highmark/highmarkdotcom/home/wholecare/search.html?searchTerm=" + empSearchTerm + "&start=10"; 34184 } 34185 } else if (getAEMmode == null) { 34186 window.location = window.location.origin + "/search?searchTerm=" + empSearchTerm + "&start=10"; 34187 } else { 34188 window.location = window.location.origin + "/content/digital-marketing/en/highmark/highmarkdotcom/home/search.html?searchTerm=" + empSearchTerm + "&start=10"; 34189 } 34190 } 34191 34192 //Enable the textbox again if needed. 34193 $('#emp-mobile-site-search-input').removeAttr("disabled"); 34194 } 34195 34196 $('.emp-btn-mobile-search').on('click', function (e) { 34197 var iconName = $(this).text().trim() === 'search' ? 'close' : 'search'; 34198 $(this).text(iconName); 34199 $('.emp-mobile-site-main-search-wrapper').toggleClass('d-none'); 34200 $('.emp-logo-container').toggleClass('d-none'); 34201 if (iconName == 'close') { 34202 $('.emp-mobile-navs-left').removeClass('d-flex'); 34203 $('.emp-mobile-navs-left').addClass('d-none'); 34204 } 34205 else { 34206 $('.emp-mobile-navs-left').removeClass('d-none'); 34207 $('.emp-mobile-navs-left').addClass('d-flex'); 34208 } 34209 }); 34210 34211})(jQuery); 34212 34213$(document).ready(function() { 34214 34215 $('.mega-menu-overlay .menu-container').html($('.main-navigation .main-nav').html()); 34216 34217 //Main nagiation searchbar // when click on search icon searh bar will come 34218 $(document).on('click', '.open-search', function() { 34219 $('.mega-menu-overlay').hide(); 34220 $('.search-main .search-input-txt').val(''); 34221 $('.search-main, .search-overlay').show(); 34222 }); 34223 34224 //Main nagiation searchbar // when click on close icon searh bar will be closed 34225 $(document).on('click', '.search-close-icon', function() { 34226 $('.search-main .search-input-txt').val(''); 34227 $('.search-main, .search-overlay').hide(); 34228 }); 34229 34230 // This is an accessbility fix, setting tab index only to Header Menu items 34231 var checkHeaderNode = document.querySelectorAll(".header-redesign"); 34232 var ele = document.querySelector(".header-main-navigation"); 34233 34234 var isVisible = false; 34235 34236 if (ele && ele.nodeType === 1) { 34237 const cs = window.getComputedStyle(ele); 34238 34239 if (cs.display !== 'none' && cs.visibility !== 'hidden') { 34240 isVisible = true; 34241 } 34242 } 34243 if(checkHeaderNode.length > 0){ 34244 34245 var getAllATagNodes = checkHeaderNode[0].querySelectorAll("a"); 34246 if(getAllATagNodes.length > 0){ 34247 for (var i = 0; i < getAllATagNodes.length; i++) { 34248 if(isVisible) 34249 getAllATagNodes[i].tabIndex = i + 1; 34250 var closeTogglerBtn = getAllATagNodes[i].classList.contains("search-toggler-btn"); 34251 if(closeTogglerBtn){ 34252 const siteSearchInput = document.getElementById('site-search-input'); 34253 if(siteSearchInput){ 34254 siteSearchInput.setAttribute('tabindex',i + 2); 34255 } 34256 } 34257 } 34258 } 34259 } 34260 34261 // Flag to suppress the focus/mouseover handler during keyboard navigation 34262 var isKeyboardNav = false;
34263 // Track the currently active parent tab index (0-based) 34264 var activeTabIndex = -1; 34265 34266 var $parentTabs = $('.main-menu > li > a.hmk-main-navigation'); 34267 34268 // Collect all visible focusable links inside the open overlay submenu 34269 function getOverlayMenuLinks() { 34270 return $('.mega-menu-overlay .menu-container .dropdown-submenu:visible a[href]').filter(function() { 34271 return $(this).closest('li').is(':visible'); 34272 }); 34273 } 34274 34275 // Open the overlay for a given tab index 34276 function openOverlayByIndex(index) { 34277 var $tab = $parentTabs.eq(index); 34278 if (!$tab.length) return; 34279 activeTabIndex = index; 34280 var selectedCls = $tab.closest('li').attr('class'); 34281 $('body').addClass('main-nav-active'); 34282 $('.main-nav >ul > li > a, .mega-menu-overlay ul > li a').removeClass('active'); 34283 $('.mega-menu-overlay').show().find('a.' + selectedCls).addClass('active'); 34284 $tab.addClass('active'); 34285 } 34286 34287 // Handle arrow keys on top-level parent tab links (hmk-link-1 through hmk-link-6) 34288 $(document).on('keydown', '.main-menu > li > a.hmk-main-navigation', function(e) { 34289 var keyCode = e.keyCode || e.which; 34290 if ([37, 38, 39, 40,27].indexOf(keyCode) === -1) return; 34291 34292 e.preventDefault(); 34293 e.stopPropagation(); 34294 34295 isKeyboardNav = true; 34296 var tabIndex = $parentTabs.index(this); 34297 34298 if (keyCode === 27) { 34299 $(this).attr("aria-expanded", "false"); 34300 $(this).next('.dropdown-submenu').attr("aria-hidden", "true"); 34301 } 34302 34303 if (keyCode === 39) { 34304 // Right arrow -- move to next parent tab and make it active 34305 var nextIndex = tabIndex + 1; 34306 if (nextIndex < $parentTabs.length) { 34307 openOverlayByIndex(nextIndex); 34308 setTimeout(function() { 34309 $parentTabs.eq(nextIndex).focus(); 34310 isKeyboardNav = false;
34311 }, 50); 34312 } else { 34313 isKeyboardNav = false; 34314 } 34315 } else if (keyCode === 37) { 34316 // Left arrow -- move to previous parent tab and make it active 34317 var prevIndex = tabIndex - 1; 34318 if (prevIndex >= 0) { 34319 openOverlayByIndex(prevIndex); 34320 setTimeout(function() { 34321 $parentTabs.eq(prevIndex).focus(); 34322 isKeyboardNav = false; 34323 }, 50); 34324 } else { 34325 isKeyboardNav = false; 34326 } 34327 } else if (keyCode === 40) { 34328 // Down arrow -- open overlay and focus first child link 34329 openOverlayByIndex(tabIndex); 34330 setTimeout(function() { 34331 var $links = getOverlayMenuLinks(); 34332 if ($links.length) { 34333 $links.eq(0).focus(); 34334 } 34335 isKeyboardNav = false; 34336 }, 50); 34337 } else if (keyCode === 38) { 34338 // Up arrow -- close overlay, stay on current tab 34339 $('body').removeClass('main-nav-active'); 34340 $('.main-nav ul li, .main-nav ul li a, .mega-menu-overlay .first-level li a').removeClass('active'); 34341 $('.mega-menu-overlay').removeAttr('style'); 34342 activeTabIndex = -1; 34343 isKeyboardNav = false;
34344 } 34345 }); 34346 34347 $(document).on('keydown', '.dropdown-submenu > li > a.mainnavigation-link-item, ul > li > a.mainnavigation-link-item', function(e) { 34348 var keyCode = e.keyCode || e.which; 34349 if ([37, 38, 39, 40,27].indexOf(keyCode) === -1) return; 34350 34351 e.preventDefault(); 34352 e.stopPropagation(); 34353 34354 isKeyboardNav = true; 34355 var tabIndex = $parentTabs.index(this); 34356 34357 if (keyCode === 27) { 34358 e.preventDefault(); 34359 e.stopPropagation(); 34360 34361 // same logic you already use for UP arrow close 34362 $('body').removeClass('main-nav-active'); 34363 $('.main-nav ul li, .main-nav ul li a, .mega-menu-overlay .first-level li a').removeClass('active'); 34364 $('.mega-menu-overlay').removeAttr('style'); 34365 activeTabIndex = -1; 34366 // return focus to current parent tab 34367 $(this).focus(); 34368 isKeyboardNav = false; 34369 return; 34370 } 34371 34372 }); 34373 34374 // Handle arrow keys while inside the overlay submenu links 34375 $(document).on('keydown', '.mega-menu-overlay a', function(e) { 34376 var keyCode = e.keyCode || e.which; 34377 if ([37, 38, 39, 40].indexOf(keyCode) === -1) return; 34378 34379 e.preventDefault(); 34380 e.stopPropagation(); 34381 34382 isKeyboardNav = true; 34383 34384 var $links = getOverlayMenuLinks(); 34385 var currentIndex = $links.index(this); 34386 34387 if (keyCode === 40) { 34388 // Down -- next child link, or move to next parent tab at boundary 34389 if ((currentIndex + 1) < $links.length) { 34390 $links.eq(currentIndex + 1).focus(); 34391 isKeyboardNav = false;
34392 } else { 34393 var nextTabIndex = activeTabIndex + 1; 34394 if (nextTabIndex < $parentTabs.length) { 34395 openOverlayByIndex(nextTabIndex); 34396 setTimeout(function() { 34397 $parentTabs.eq(nextTabIndex).focus(); 34398 isKeyboardNav = false; 34399 }, 50); 34400 } else { 34401 isKeyboardNav = false; 34402 } 34403 } 34404 } else if (keyCode === 38) { 34405 // Up -- previous child link, or go back to current parent tab at boundary 34406 if ((currentIndex - 1) >= 0) { 34407 $links.eq(currentIndex - 1).focus(); 34408 isKeyboardNav = false; 34409 } else { 34410 $parentTabs.eq(activeTabIndex).focus(); 34411 isKeyboardNav = false; 34412 } 34413 } else if (keyCode === 39) { 34414 // Right -- move to next parent tab and make it active 34415 var nextTab = activeTabIndex + 1; 34416 if (nextTab < $parentTabs.length) { 34417 openOverlayByIndex(nextTab); 34418 setTimeout(function() { 34419 $parentTabs.eq(nextTab).focus(); 34420 isKeyboardNav = false;
34421 }, 50); 34422 } else { 34423 isKeyboardNav = false; 34424 } 34425 } else if (keyCode === 37) { 34426 // Left -- move to previous parent tab and make it active 34427 var prevTab = activeTabIndex - 1; 34428 if (prevTab >= 0) { 34429 openOverlayByIndex(prevTab); 34430 setTimeout(function() { 34431 $parentTabs.eq(prevTab).focus(); 34432 isKeyboardNav = false; 34433 }, 50); 34434 } else { 34435 isKeyboardNav = false; 34436 } 34437 } 34438 }); 34439 34440 var screenWidth = screen.width; 34441 if (screenWidth >= 1025) { 34442 $(document).on('focus mouseover', '.main-menu li a', function(e) { 34443 // Skip this handler during keyboard navigation to prevent stripping active class 34444 if (isKeyboardNav) return; 34445 34446 e.preventDefault(); 34447 e.stopPropagation(); 34448 34449 $('body').addClass('main-nav-active'); 34450 var $this = $(this), 34451 selectedCls = $this.closest('li').attr('class'), 34452 shadowWidth = 0, 34453 shadowLeft = Math.floor($('.main-nav').offset().left), 34454 shadowHeight = 0, 34455 menuOverlay = $('.mega-menu-overlay'), 34456 dropdownSubmenu = $('.dropdown-submenu'); 34457 34458 if (!$this.parents('.mega-menu-overlay').length) { 34459 $('.main-nav >ul > li > a, .mega-menu-overlay ul > li a').removeClass('active'); 34460 menuOverlay.show().find('a.' + selectedCls).addClass('active'); 34461 shadowWidth = Math.floor(dropdownSubmenu.outerWidth()); 34462 } 34463 if ($this.closest('.mega-menu-overlay').length) { 34464 $this.closest('ul').find('a').removeClass('active'); 34465 } 34466 34467 $this.addClass('active'); 34468 $this.attr("aria-expanded", "true"); 34469 $this.next('.dropdown-submenu').attr("aria-hidden", "false"); 34470 34471 34472 }); 34473 } 34474 34475 34476 if (screenWidth < 1025) { 34477 34478 34479 $(document).on('click', '.main-menu li a:not(.dropdown-submenu > a, #hmk-link-2)', function(e) { 34480 e.preventDefault(); 34481 e.stopPropagation(); 34482 34483 $('body').addClass('main-nav-active'); 34484 var $this = $(this), 34485 selectedCls = $this.closest('li').attr('class'), 34486 shadowWidth = 0, 34487 shadowLeft = Math.floor($('.main-nav').offset().left), 34488 shadowHeight = 0, 34489 menuOverlay = $('.mega-menu-overlay'), 34490 dropdownSubmenu = $('.dropdown-submenu'); 34491 34492 if (!$this.parents('.mega-menu-overlay').length) { 34493 $('.main-nav >ul > li > a, .mega-menu-overlay ul > li a').removeClass('active'); 34494 menuOverlay.show().find('a.' + selectedCls).addClass('active'); 34495 shadowWidth = Math.floor(dropdownSubmenu.outerWidth()); 34496 } 34497 if ($this.closest('.mega-menu-overlay').length) { 34498 $this.closest('ul').find('a').removeClass('active'); 34499 } 34500 $this.addClass('active'); 34501 34502 }); 34503 34504 } 34505 34506 34507 $(document).on('click', function() { 34508 $('body').removeClass('main-nav-active'); 34509 $('.main-nav ul li, .main-nav ul li a, .mega-menu-overlay .first-level li a ').removeClass('active'); 34510 dropdownSubmenu.removeAttr("style").removeClass('dropdown-menu-shadow'); 34511 menuOverlay.removeAttr('style'); 34512 }); 34513 34514 $(document).on('mouseleave', '.header-main-navigation', function() { 34515 $('body').removeClass('main-nav-active'); 34516 $('.main-nav ul li, .main-nav ul li a, .mega-menu-overlay .first-level li a ').removeClass('active'); 34517 34518 $('.main-nav ul li a, .mega-menu-overlay .first-level li a ').attr("aria-expanded", false); 34519 $('.main-nav ul li a, .mega-menu-overlay .first-level li a ').next('.dropdown-submenu').attr('aria-hidden',true); 34520 34521 dropdownSubmenu.removeAttr("style").removeClass('dropdown-menu-shadow'); 34522 menuOverlay.removeAttr('style'); 34523 }); 34524 34525 34526}); 34527 34528 34529var maxHeight = 0, 34530 menuOverlay = $('.mega-menu-overlay'), 34531 dropdownSubmenu = $('.dropdown-submenu'); 34532 34533function maxHeightChildNav(ele) { 34534 var ele = $(ele); 34535 maxHeight = 0; 34536 ele.removeAttr('style'); 34537 ele.each(function() { 34538 var $this = $(this); 34539 if ($this.height() > maxHeight) { 34540 maxHeight = Math.floor($this.height() + 100); 34541 } 34542 }); 34543 $(ele).height(maxHeight); 34544} 34545(function ($) { 34546 var SUB_MENU_COLLAPSE_STATE = { 34547 left: '1000px' 34548 }; 34549 var SUB_MENU_EXPAND_STATE = { 34550 left: '0' 34551 }; 34552 var $sliderMenu = $('#conf-menu-expand'); 34553 var mobileNav = $('.conf-mobile-header'); 34554 $('#conf-toggle-icon').on('click', function () { 34555 $(this).prop('aria-expanded', true); 34556 openSliderMenu(); 34557 $('#conf-toggle-icon').addClass('d-none'); 34558 $('.conf-close-icon').removeClass('d-none'); 34559 $('body').addClass('no-scroll'); 34560 const totalHeaderHeight = mobileNav.outerHeight() + $('.alertbanner').outerHeight() + $
34560sliderMenu.outerHeight() + 100; 34561 const windowHeight = Math.round(window.outerHeight); 34562 if (totalHeaderHeight > windowHeight) { 34563 $sliderMenu.addClass('menu-expand-scroll') 34564 $('.alertbanner').hide(); 34565 } 34566 }); 34567 34568 $('.conf-close-icon').on('click', function () { 34569 $(this).prop('aria-expanded', false); 34570 $sliderMenu.find('.conf-secondary-navs-container').css( 34571 SUB_MENU_COLLAPSE_STATE).addClass('d-none'); 34572 closeSliderMenu(); 34573 if ($sliderMenu.hasClass('menu-expand-scroll')) { 34574 $sliderMenu.removeClass('menu-expand-scroll'); 34575 $('.alertbanner').show(); 34576 } 34577 $('.conf-close-icon').addClass('d-none'); 34578 $('#conf-toggle-icon').removeClass('d-none'); 34579 $('body').removeClass('no-scroll'); 34580 }); 34581 34582 $('#conf-menu-expand').on('click', '.conf-close-icon', function () { 34583 $(this).prop('aria-expanded', false); 34584 $sliderMenu.find('.conf-secondary-navs-container').css(SUB_MENU_COLLAPSE_STATE).addClass('d-none'); 34585 $sliderMenu.removeClass('open'); 34586 }); 34587 34588 $('.conf-m-nav-link-item').on('click', function (e) { 34589 var $subMenu = $(this).parent().find('> .conf-secondary-navs-container'); 34590 if ($sliderMenu.hasClass('menu-expand-scroll')) { 34591 $sliderMenu.removeClass('menu-expand-scroll'); 34592 } 34593 if ($subMenu.length) { 34594 e.preventDefault(); 34595 $subMenu.removeClass('d-none').animate(SUB_MENU_EXPAND_STATE, 250, function () { 34596 $subMenu.css({ 34597 'overflow-y': 'scroll', 34598 'overflow-x': 'hidden' 34599 }); 34600 }); 34601 return; 34602 } 34603 }); 34604 34605 function closeSliderMenu() { 34606 if (mobileNav.hasClass('sticky-nav')) { 34607 $sliderMenu.removeClass('open-sticky') 34608 } else { 34609 $sliderMenu.removeClass('open'); 34610 } 34611 } 34612 34613 function openSliderMenu() { 34614 if (mobileNav.hasClass('sticky-nav')) { 34615 $sliderMenu.addClass('open-sticky') 34616 } else { 34617 $sliderMenu.addClass('open'); 34618 } 34619 } 34620 34621 // Hide Header on on scroll down 34622 var didScroll; 34623 var lastScrollTop = 0; 34624 var delta = 5; 34625 var navbarHeight = $('confmobilenav').outerHeight(); 34626 34627 $(window).scroll(function (event) { 34628 didScroll = true; 34629 }); 34630 34631 setInterval(function () { 34632 if (didScroll && window.matchMedia('(max-width: 768px)').matches) { 34633 hasScrolled(); 34634 didScroll = false; 34635 } 34636 }, 250); 34637 34638 function hasScrolled() { 34639 var st = $(this).scrollTop(); 34640 34641 // Make sure they scroll more than delta 34642 if (Math.abs(lastScrollTop - st) <= delta) { 34643 return; 34644 } 34645 var isPositionFixed = (mobileNav.css('position') == 'fixed'); 34646 34647 if ($(this).scrollTop() < 50 && isPositionFixed) { 34648 mobileNav.removeClass('sticky-nav'); 34649 34650 } 34651 34652 // If they scrolled down and are past the navbar, add class .nav-up. 34653 // This is necessary so you never see what is "behind" the navbar. 34654 if (st > lastScrollTop && st > navbarHeight) { 34655 34656 $('.alertbanner').hide(25); 34657 mobileNav.removeClass('sticky-nav'); 34658 34659 34660 if (!$('#menu-expand').hasClass('open')) { 34661 mobileNav.removeClass('nav-down').addClass('nav-up'); 34662 34663 } 34664 34665 } else { 34666 if (st + $(window).height() < $(document).height()) { 34667 mobileNav.removeClass('nav-up').addClass('nav-down'); 34668 if ($(this).scrollTop() > 50 && !isPositionFixed) { 34669 34670 mobileNav.addClass('sticky-nav'); 34671 34672 } 34673 if (st == 0) { 34674 $('.alertbanner').show(100); 34675 } 34676 } 34677 } 34678 34679 lastScrollTop = st; 34680 } 34681 34682 34683 $('.conf-nav-back-btn').on('click', function (e) { 34684 var bdBack = $('#emp-menu-expand').data('bc-back'); 34685 if (bdBack === 'true') { 34686 $('#emp-menu-expand').data('bc-back', 'false'); 34687 var $subMenu = $(this).closest('.emp-secondary-navs-container').closest( 34688 '.emp-secondary-navs-container'); 34689 if ($subMenu.length) { 34690 e.preventDefault(); 34691 $('#emp-menu-expand').removeClass('open'); 34692 34693 $subMenu.css(SUB_MENU_COLLAPSE_STATE); 34694 $subMenu.parents('.emp-secondary-navs-container').css( 34695 SUB_MENU_EXPAND_STATE); 34696 34697 $('#emp-menu-expand').addClass('open'); 34698 } 34699 } else { 34700 var $subMenu = $(this).closest('.conf-secondary-navs-container'); 34701 if ($subMenu.length) { 34702 e.preventDefault(); 34703 $subMenu.css({ 34704 'overflow-y': 'none', 34705 'overflow-x': 'hidden' 34706 }).animate(SUB_MENU_COLLAPSE_STATE, 500, function () { 34707 $subMenu.addClass('d-none'); 34708 }); 34709 } 34710 } 34711 }); 34712 // Site search text field event logic for mobile 34713 $('#conf-mobile-site-search-input').on('input', function () { 34714 var confSearchTerm = $('#conf-mobile-site-search-input').val(); 34715 if (confSearchTerm === undefined || confSearchTerm === "") { 34716 $('#conf-mobile-clear-icon').addClass('conf-mobile-clear-icon'); 34717 $('#conf-mobile-clear-icon').removeClass('conf-mobile-clear-icon-focus'); 34718 } else { 34719 $('#conf-mobile-clear-icon').addClass('conf-mobile-clear-icon-focus'); 34720 $('#conf-mobile-clear-icon').removeClass('conf-mobile-clear-icon'); 34721 } 34722 return false;
34723 }); 34724 34725 $('#conf-mobile-clear-icon').on('click', function () { 34726 $('#conf-mobile-clear-icon').addClass('conf-mobile-clear-icon'); 34727 $('#conf-mobile-clear-icon').removeClass('conf-mobile-clear-icon-focus'); 34728 confStartSearching(); 34729 $('#conf-mobile-site-search-input').val(''); 34730 }); 34731 34732 $('#conf-mobile-site-search-input').on('keypress', function (e) { 34733 if (e.which === 13) { 34734 e.preventDefault(); 34735 //Disable textbox to prevent multiple submit 34736 confStartSearching(); 34737 } 34738 }); 34739 34740 function confStartSearching() { 34741 $('#conf-mobile-site-search-input').attr("disabled", "disabled"); 34742 var confSearchTerm = $('#conf-mobile-site-search-input').val(); 34743 var currentURL = window.location.href; 34744 if (!(confSearchTerm === undefined || confSearchTerm === "")) { 34745 34746 if (currentURL.includes("/employer")) { 34747 if (getAEMmode == null) { 34748 window.location = window.location.origin + "/employer/search?searchTerm=" + confSearchTerm + "&start=10"; 34749 } else { 34750 window.location = window.location.origin + "/content/digital-marketing/en/highmark/highmarkdotcom/home/employer/search.html?searchTerm=" + confSearchTerm + "&start=10"; 34751 } 34752 } else if (currentURL.includes("/wholecare")) { 34753 if (getAEMmode == null) { 34754 window.location = window.location.origin + "/wholecare/search?searchTerm=" + confSearchTerm + "&start=10"; 34755 } else { 34756 window.location = window.location.origin + "/content/digital-marketing/en/highmark/highmarkdotcom/home/wholecare/search.html?searchTerm=" + confSearchTerm + "&start=10"; 34757 } 34758 } else if (getAEMmode == null) { 34759 window.location = window.location.origin + "/search?searchTerm=" + confSearchTerm + "&start=10"; 34760 } else { 34761 window.location = window.location.origin + "/content/digital-marketing/en/highmark/highmarkdotcom/home/search.html?searchTerm=" + confSearchTerm + "&start=10"; 34762 } 34763 } 34764 //Enable the textbox again if needed. 34765 $('#conf-mobile-site-search-input').removeAttr("disabled"); 34766 } 34767 34768 $('.conf-btn-mobile-search').on('click', function (e) { 34769 var iconName = $(this).text().trim() === 'search' ? 'close' : 'search'; 34770 $(this).text(iconName); 34771 $('.mobile-site-main-search-wrapper').toggleClass('d-none'); 34772 $('.conf-logo-container').toggleClass('d-none'); 34773 if (iconName == 'close') { 34774 $('.conf-mobile-navs-left').removeClass('d-flex'); 34775 $('.conf-mobile-navs-left').addClass('d-none'); 34776 } else { 34777 $('.conf-mobile-navs-left').removeClass('d-none'); 34778 $('.conf-mobile-navs-left').addClass('d-flex'); 34779 } 34780 }); 34781 34782 // ============================================================ 34783 // A11Y FIX: On last tab in mobile menu -> close menu + focus main 34784 // ============================================================ 34785 (function () { 34786 const FOCUSABLE = 34787 'a[href], button:not([disabled]), input:not([disabled]):not([type="hidden"]), ' + 34788 'select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'; 34789 34790 function isMenuOpen() { 34791 return $('#conf-menu-expand').hasClass('open') || $('#conf-menu-expand').hasClass('open-sticky'); 34792 } 34793 34794 function isActuallyVisible(el) { 34795 let cur = el; 34796 while (cur && cur.nodeType === 1) { 34797 const cs = window.getComputedStyle(cur); 34798 if (cs.display === 'none' || cs.visibility === 'hidden') return false; 34799 cur = cur.parentElement; 34800 } 34801 return true; 34802 } 34803 34804 function getMenuFocusables() { 34805 return $('#conf-menu-expand').find(FOCUSABLE).filter(function () { 34806 return isActuallyVisible(this); 34807 }); 34808 } 34809 34810 function focusFirstMainContent() { 34811 let $target = $('main').find(FOCUSABLE).filter(function () { 34812 return isActuallyVisible(this) && $(this).closest('#conf-menu-expand').length === 0; 34813 }).first(); 34814 34815 if (!$target.length) { 34816 $target = $('body').find(FOCUSABLE).filter(function () { 34817 if (!isActuallyVisible(this)) return false;
34818 if ($(this).closest('#conf-menu-expand').length) return false; 34819 if ($(this).closest('header').length) return false; 34820 return true; 34821 }).first(); 34822 } 34823 34824 if ($target.length) $target.focus(); 34825 } 34826 document.addEventListener('keydown', function (e) { 34827 if (e.key !== 'Tab') return; 34828 if (!isMenuOpen()) return; 34829 const $items = getMenuFocusables(); 34830 if (!$items.length) return; 34831 const first = $items.get(0); 34832 const last = $items.get($items.length - 1); 34833 const active = document.activeElement; 34834 if (e.shiftKey && active === first) { 34835 e.preventDefault(); 34836 $('.conf-close-icon:visible').trigger('click'); 34837 setTimeout(function () { 34838 $('#conf-toggle-icon').focus(); 34839 }, 0); 34840 return; 34841 } 34842 34843 // Tab from last -> close and focus main content 34844 if (!e.shiftKey && active === last) { 34845 e.preventDefault(); 34846 // Close menu using existing close logic 34847 $('.conf-close-icon:visible').trigger('click'); 34848 // Focus main after close so focus indicator is not hidden under overlay 34849 setTimeout(function () { 34850 focusFirstMainContent(); 34851 }, 0); 34852 return; 34853 } 34854 }, true); 34855 })(); 34856 34857})(jQuery); 34858 34859$(document).ready(function() { 34860 34861 if ($(".global-footer-disclaimer") != undefined && $(".global-footer-disclaimer").html() != undefined) { 34862 $(".global-footer-disclaimer").html($(".global-footer-disclaimer").html().replace("{currentyear}",new Date().getFullYear())); 34863 } 34864 34865 // Collect all currently focusable footer accordion items in order: 34866 // section titles + visible child links inside open accordions 34867 function getFooterMobileItems() { 34868 var items = []; 34869 $('.footer-list.mobile').each(function() { 34870 var $title = $(this).find('.footer-section-title[role="button"]'); 34871 if ($title.length) items.push($title[0]); 34872 34873 // Only include child links if this accordion is open 34874 var $ul = $(this).find('.collapse'); 34875 if ($ul.hasClass('show')) { 34876 $ul.find('li.footer-link a').each(function() { 34877 items.push(this); 34878 }); 34879 } 34880 }); 34881 return $(items); 34882 } 34883 34884 // Handle keyboard navigation for mobile footer accordion sections 34885 $(document).on('keydown', '.footer-list.mobile .footer-section-title[role="button"], .footer-list.mobile .collapse a', function(e) { 34886 var keyCode = e.keyCode || e.which; 34887 34888 if (keyCode === 13 || keyCode === 32) { 34889 // Enter / Space on section title -- toggle accordion 34890 if ($(this).hasClass('footer-section-title')) { 34891 e.preventDefault(); 34892 $(this).click(); 34893 } 34894 return; 34895 } 34896 34897 if (keyCode !== 38 && keyCode !== 40) return; 34898 e.preventDefault(); 34899 34900 var $items = getFooterMobileItems(); 34901 var currentIndex = $items.index(this); 34902 34903 if (keyCode === 40) { 34904 // Down arrow -- move to next item 34905 if (currentIndex + 1 < $items.length) { 34906 $items.eq(currentIndex + 1).focus(); 34907 } 34908 } else if (keyCode === 38) { 34909 // Up arrow -- move to previous item 34910 if (currentIndex - 1 >= 0) { 34911 $items.eq(currentIndex - 1).focus(); 34912 } 34913 } 34914 }); 34915 34916}); 34917 34918(function (window, document) { 34919 'use strict'; 34920 let UTS_KEY = 'UTS'; 34921 // Publish domains where we should NOT force ".html" 34922 let PUBLISH_HOSTS = [ 34923 'highmark.com', 34924 'newtenv1.highmark.com', 34925 'newtenv2.highmark.com', 34926 'newtenv3.highmark.com' 34927 ]; 34928 let SELECTORS = { 34929 spinner: ".global__spinner" 34930 }; 34931 34932 function getStoredUts() { 34933 try { 34934 return window.sessionStorage.getItem(UTS_KEY); 34935 } catch (e) { 34936 return null; 34937 } 34938 } 34939 34940 // =========================== 34941 // Spinner 34942 // =========================== 34943 function showSpinner($container) { 34944 let $spinner = $container.find(SELECTORS.spinner); 34945 $spinner.addClass("is-active"); 34946 $spinner.attr("aria-hidden", "false"); 34947 } 34948 34949 function hideSpinner($container) { 34950 let $spinner = $container.find(SELECTORS.spinner); 34951 $spinner.removeClass("is-active"); 34952 $spinner.attr("aria-hidden", "true"); 34953 } 34954 34955 function getStoredZip(){ 34956 let data = window.sessionStorage.getItem('hmk-gm-landing'); 34957 if(data){ 34958 let zipVal = JSON.parse(data) != undefined && JSON.parse(data) != "" ? JSON.parse(data).zipCode : null; 34959 if(zipVal){ 34960 return true; 34961 }else{ 34962 return false;
34963 } 34964 }else{ 34965 return false; 34966 } 34967 } 34968 34969 function setStoredUts(value) { 34970 try { 34971 if (value) { 34972 window.sessionStorage.setItem(UTS_KEY, value); 34973 } 34974 } catch (e) { 34975 // ignore 34976 } 34977 } 34978 // Read UTS from current page URL and store it 34979 function persistUtsFromUrl() { 34980 try { 34981 var params = new URLSearchParams(window.location.search); 34982 // Support both UTS and uts 34983 var uts = params.get(UTS_KEY) || params.get(UTS_KEY.toLowerCase()); 34984 if (uts) { 34985 setStoredUts(uts); 34986 } 34987 } catch (e) { 34988 // ignore 34989 } 34990 } 34991 // ------------------------------------------------------- 34992 // Env helpers 34993 // ------------------------------------------------------- 34994 function isPublishHost() { 34995 const host = window.location.hostname.toLowerCase(); 34996 return PUBLISH_HOSTS.some(function (h) { 34997 return host === h || host === 'www.' + h; 34998 }); 34999 } 35000 35001 // Add .html before query/hash if missing 35002 function ensureHtml(url) { 35003 // already contains ".html" before end or before query/hash 35004 if (/\.html($|[?#])/.test(url)) return url; 35005 // split hash 35006 let hashIndex = url.indexOf('#'); 35007 let hash = ''; 35008 let base = url; 35009 if (hashIndex > -1) { 35010 hash = url.substring(hashIndex); 35011 base = url.substring(0, hashIndex); 35012 } 35013 // split query 35014 let qIndex = base.indexOf('?'); 35015 if (qIndex > -1) { 35016 base = base.substring(0, qIndex) + '.html' + base.substring(qIndex); 35017 } else { 35018 base = base + '.html'; 35019 } 35020 return base + hash; 35021 } 35022 35023 function appendUtsToUrl(url) { 35024 let utsValue = getStoredUts(); 35025 if (!utsValue || !url) return url; 35026 let finalUrl = url; 35027 // Only add .html for local/author environments 35028 if (!isPublishHost()) { 35029 finalUrl = ensureHtml(finalUrl); 35030 } 35031 35032 let separator = finalUrl.indexOf('?') > -1 ? '&' : '?'; 35033 return finalUrl + separator + UTS_KEY + '=' + utsValue; 35034 } 35035 35036 function routeWithUts(url) { 35037 if (!url) return; 35038 window.location.href = appendUtsToUrl(url); 35039 } 35040 35041 35042 function updateUtsPosition(newValue) { 35043 35044 let utsValue = getStoredUts(); 35045 if (utsValue) { 35046 const parts = utsValue.split(':'); 35047 35048 // Ensure array length 35049 while (parts.length <= 7) { 35050 parts.push(''); 35051 } 35052 parts[7] = newValue; 35053 window.sessionStorage.setItem(UTS_KEY, parts.join(':')); 35054 35055 }else{ 35056 let setUtsDefault = "XX:XX:XX:XX:XX:XX:XX:" + newValue + ""; 35057 window.sessionStorage.setItem(UTS_KEY, setUtsDefault); 35058 } 35059 } 35060 35061 35062 35063 35064 function getUtsValueAt(position) { 35065 // uts=<channel>:<year>:<CMP>:<MX>:<LOB>:<BusArea>:<Initiative>:<Region>:<Language>:<Touchpoint>:<OfferCode>:<Ad-ID>&<UTM Parameters></UTM> 35066 let utsValue = getStoredUts(); 35067 let parts; 35068 if(utsValue){ 35069 parts = utsValue.split(':'); 35070 if(parts.length >= 11){ 35071 return parts.length >= position ? parts[position - 1] : null; 35072 } 35073 } 35074 return null; 35075 } 35076 35077 let initialized = false; 35078 function init() { 35079 if (initialized) return; 35080 initialized = true; 35081 persistUtsFromUrl(); 35082 } 35083 document.addEventListener('DOMContentLoaded', init); 35084 window.UtsUtil = { 35085 init: init, 35086 getStoredUts: getStoredUts, 35087 appendUtsToUrl: appendUtsToUrl, 35088 routeWithUts: routeWithUts, 35089 getUtsValueAt: getUtsValueAt, 35090 isPublishHost: isPublishHost, 35091 getStoredZip: getStoredZip, 35092 updateUtsPosition: updateUtsPosition, 35093 showSpinner: showSpinner, 35094 hideSpinner: hideSpinner 35095 }; 35096 })(window, document); 35097(function (window, document) { 35098 'use strict'; 35099 35100 /** 35101 * Global utility for handling button URL parameters 35102 * Appends preloadZipCode and preloadCounty to button URLs 35103 * Prevents duplicate parameter appending through deduplication checks 35104 */ 35105 window.ButtonParameterHandler = { 35106 // Flag to track if initialization has already occurred 35107 _initialized: false, 35108 35109 /** 35110 * Helper function to read cookies 35111 */ 35112 getCookie: function(name) { 35113 var re = new RegExp(name + '=([^;]+)'); 35114 var value = re.exec(document.cookie); 35115 return value !== null ? unescape(value[1]) : null; 35116 }, 35117 35118 /** 35119 * Helper function to append parameters to URL 35120 * Checks if parameters already exist to prevent duplication 35121 */ 35122 appendParametersToUrl: function(url, params) { 35123 if (!url || !params || Object.keys(params).length === 0) { 35124 return url; 35125 } 35126 35127 // Check if parameters already exist in the URL 35128 try { 35129 var urlObj = new URL(url, window.location.origin); 35130 var hasPreloadZipCode = urlObj.searchParams.has('preloadZipCode'); 35131 var hasPreloadCounty = urlObj.searchParams.has('preloadCounty'); 35132 35133 // If both parameters already exist, return the URL unchanged 35134 if (hasPreloadZipCode && hasPreloadCounty) { 35135 return url; 35136 } 35137 } catch (e) { 35138 // If URL parsing fails, continue with parameter appending 35139 // This handles relative URLs that can't be parsed by URL constructor 35140 } 35141 35142 var separator = url.indexOf('?') > -1 ? '&' : '?'; 35143 var paramString = Object.keys(params) 35144 .map(function(key) { 35145 return encodeURIComponent(key) + '=' + encodeURIComponent(params[key]); 35146 }) 35147 .join('&'); 35148 35149 return url + separator + paramString; 35150 }, 35151 35152 /** 35153 * Get preload parameters from cookies 35154 */ 35155 getPreloadParams: function() { 35156 var userZIP = this.getCookie('userZIP'); 35157 var userCounty = this.getCookie('userCounty'); 35158 35159 if (userZIP && userCounty) { 35160 return { 35161 preloadZipCode: userZIP, 35162 preloadCounty: userCounty 35163 }; 35164 } 35165 return null; 35166 }, 35167 35168 /** 35169 * Apply parameters to buttons with specific ID 35170 */ 35171 applyParametersToButton: function(buttonId) { 35172 var button = document.getElementById(buttonId); 35173 if (button) { 35174 var params = this.getPreloadParams(); 35175 if (params) { 35176 var originalUrl = button.getAttribute('href'); 35177 if (originalUrl) { 35178 var newUrl = this.appendParametersToUrl(originalUrl, params); 35179 button.setAttribute('href', newUrl); 35180 } 35181 } 35182 } 35183 }, 35184 35185 /** 35186 * Apply parameters to all buttons with specific ID 35187 */ 35188 applyParametersToAllButtons: function(buttonId) { 35189 var buttons = document.querySelectorAll('[id="' + buttonId + '"]'); 35190 var params = this.getPreloadParams(); 35191 35192 if (buttons && buttons.length > 0 && params) { 35193 buttons.forEach(function(button) { 35194 var originalUrl = button.getAttribute('href'); 35195 if (originalUrl) { 35196 var newUrl = ButtonParameterHandler.appendParametersToUrl(originalUrl, params); 35197 button.setAttribute('href', newUrl); 35198 } 35199 }); 35200 } 35201 }, 35202 35203 }; 35204 35205 // Auto-initialize for blue-edge-balance buttons on page load 35206 function initializeBlueEdgeButtons() { 35207 // Only initialize once to prevent duplicate parameter appending 35208 if (!window.ButtonParameterHandler._initialized) { 35209 window.ButtonParameterHandler._initialized = true; 35210 window.ButtonParameterHandler.applyParametersToAllButtons('blue-edge-balance'); 35211 35212 } 35213 } 35214 35215 if (document.readyState === 'loading') { 35216 document.addEventListener('DOMContentLoaded', initializeBlueEdgeButtons); 35217 } else { 35218 initializeBlueEdgeButtons(); 35219 } 35220 35221 document.addEventListener('foundation-contentloaded', initializeBlueEdgeButtons); 35222 35223})(window, document); 35224 35225(function () { 35226 var consentListenerBound = false;
35227 // Last state actually pushed to dtrum. null means nothing has been applied yet, so 35228 // the first real call always goes through. Kept because onOneTrustReady can run more 35229 // than once and OnConsentChanged fires on every save, even when C0002 did not change. 35230 var appliedState = null; 35231 35232 function updateDynatraceConsent() { 35233 var groups = window.OnetrustActiveGroups || ""; 35234 var performanceEnabled = groups.indexOf("C0002") !== -1; 35235 console.log("OnetrustActiveGroups:", groups, "| C0002:", performanceEnabled); 35236 if (!window.dtrum) { 35237 console.log("Dynatrace not available"); 35238 return; 35239 } 35240 35241 if (performanceEnabled === appliedState) { 35242 return; 35243 } 35244 35245 if (performanceEnabled) { 35246 window.dtrum.enable(); 35247 console.log("Dynatrace ENABLED"); 35248 } else { 35249 window.dtrum.disable(); 35250 console.log("Dynatrace DISABLED"); 35251 } 35252 appliedState = performanceEnabled; 35253 } 35254 35255 function onOneTrustReady() { 35256 // OnetrustActiveGroups is only populated once the OneTrust SDK has resolved consent. 35257 updateDynatraceConsent(); 35258 // User changes Cookie Settings and confirms. OptanonWrapper can fire more than 35259 // once, so only bind the listener the first time through. 35260 if (!consentListenerBound && 35261 window.OneTrust && 35262 typeof window.OneTrust.OnConsentChanged === "function") { 35263 consentListenerBound = true; 35264 window.OneTrust.OnConsentChanged(function () { 35265 updateDynatraceConsent(); 35266 }); 35267 } 35268 } 35269 35270 if (typeof window.OnetrustActiveGroups !== "undefined") { 35271 // OneTrust already finished before this clientlib ran. 35272 onOneTrustReady(); 35273 } else { 35274 // OneTrust calls OptanonWrapper once the SDK is loaded and consent is known. 35275 var previousWrapper = window.OptanonWrapper; 35276 window.OptanonWrapper = function () { 35277 if (typeof previousWrapper === "function") { 35278 previousWrapper.apply(this, arguments); 35279 } 35280 onOneTrustReady(); 35281 }; 35282 } 35283})(); 35284// Opens the OneTrust preference centre for any link authored with the 35285// id "one-trust-cookie-link". Delegated from document so it covers every 35286// footer variant (global footer, GM landing page footer) without each 35287// component shipping its own clientlib. 35288(function () { 35289 document.addEventListener( 35290 "click", 35291 function (event) { 35292 const link = event.target.closest("#one-trust-cookie-link"); 35293 if (!link) { 35294 return; 35295 } 35296 35297 event.preventDefault(); 35298 event.stopPropagation(); 35299 event.stopImmediatePropagation(); 35300 35301 if ( 35302 window.OneTrust && 35303 typeof window.OneTrust.ToggleInfoDisplay === "function" 35304 ) { 35305 window.OneTrust.ToggleInfoDisplay(); 35306 } else if ( 35307 window.Optanon && 35308 typeof window.Optanon.ToggleInfoDisplay === "function" 35309 ) { 35310 window.Optanon.ToggleInfoDisplay(); 35311 } 35312 }, 35313 true 35314 ); 35315})(); 35316
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.