1/** 2 * Side Navigation extension for Zendesk themes v2.9.1 3 * https://www.lotusthemes.com 4 * 5 * Released on 2021-02-04 6 * Copyright (c) 2014-2021 Lotus Themes 7 */ 8 9!(function a(o, c, l) { 10 function r(i, t) { 11 if (!c[i]) { 12 if (!o[i]) { 13 var e = "function" == typeof require && require; 14 if (!t && e) return e(i, !0); 15 if (d) return d(i, !0); 16 var n = new Error("Cannot find module '" + i + "'"); 17 throw ((n.code = "MODULE_NOT_FOUND"), n); 18 } 19 var s = (c[i] = { exports: {} }); 20 o[i][0].call( 21 s.exports, 22 function (t) { 23 return r(o[i][1][t] || t); 24 }, 25 s, 26 s.exports, 27 a, 28 o, 29 c, 30 l 31 ); 32 } 33 return c[i].exports; 34 } 35 for ( 36 var d = "function" == typeof require && require, t = 0; 37 t < l.length; 38 t++ 39 ) 40 r(l[t]); 41 return r; 42})( 43 { 44 1: [ 45 function (t, i, e) { 46 i.exports = { 47 name: "sidenav", 48 version: "2.9.1", 49 description: "Side Navigation extension for Zendesk themes", 50 repository: { 51 type: "git", 52 url: "git+https://gitlab.com/lotusthemes/sidenav.git", 53 }, 54 main: "src/index.js", 55 scripts: { 56 gulp: "gulp default", 57 zat: "cd demo && zat theme preview", 58 start: "run-p gulp zat", 59 build: "gulp build", 60 precommit: "lint-staged", 61 postinstall: "node postinstall.js", 62 version: 63 "conventional-changelog -p angular -i CHANGELOG.md -s && git add CHANGELOG.md", 64 }, 65 husky: { hooks: { "pre-commit": "lint-staged" } }, 66 "lint-staged": { 67 "*.scss": [ 68 "prettier --write", 69 "stylelint --fix --syntax=scss", 70 "git add", 71 ], 72 "*.css": ["prettier --write", "stylelint --fix", "git add"], 73 "src/*.js": ["prettier --write", "eslint --fix", "git add"], 74 }, 75 keywords: ["sidenav"], 76 author: "Lotus Themes", 77 license: "ISC", 78 bugs: { url: "https://gitlab.com/lotusthemes/sidenav/issues" }, 79 homepage: "https://gitlab.com/lotusthemes/sidenav#README", 80 devDependencies: { 81 "@babel/preset-env": "^7.5.5", 82 autoprefixer: "^9.8.4", 83 "babel-core": "^6.26.3", 84 babelify: "^10.0.0", 85 "browser-sync": "^2.26.7", 86 "css-mqpacker": "^7.0.0", 87 del: "^5.0.0", 88 eslint: "^6.1.0", 89 "eslint-config-recommended": "^4.0.0", 90 gulp: "^3.9.1", 91 "gulp-autoprefixer": "^6.1.0", 92 "gulp-bro": "^1.0.3", 93 "gulp-clean-css": "^4.2.0", 94 "gulp-header-comment": "^0.6.1", 95 "gulp-plumber": "^1.2.1", 96 "gulp-postcss": "^8.0.0", 97 "gulp-rename": "^1.4.0", 98 "gulp-sass": "^4.0.2", 99 "gulp-uglify": "^3.0.2", 100 "gulp-watch": "^5.0.1", 101 husky: "^3.0.3", 102 "lint-staged": "^9.2.1", 103 lodash: "^4.17.15", 104 moment: "^2.24.0", 105 "postcss-merge-rules": "^4.0.3", 106 "postcss-rtl": "^1.7.3", 107 prettier: "^1.18.2", 108 "run-sequence": "^2.2.0", 109 stylelint: "^10.1.0", 110 "stylelint-config-lotus": 111 "git+https://gitlab.com/lotusthemes/stylelint-config-lotus.git", 112 "stylelint-config-rational-order": "^0.1.2", 113 }, 114 dependencies: { 115 apidata: 116 "git+https://gitlab.com/lotusthemes/extensions/apidata.git", 117 "fs-extra": "^8.1.0", 118 }, 119 }; 120 }, 121 {}, 122 ], 123 2: [ 124 function (t, i, e) { 125 "use strict"; 126 Object.defineProperty(e, "__esModule", { value: !0 }), 127 (e.default = void 0); 128 var a = t("./constants"), 129 n = t("./utils"); 130 function o(t, i) { 131 for (var e = 0; e < i.length; e++) { 132 var n = i[e]; 133 (n.enumerable = n.enumerable || !1), 134 (n.configurable = !0), 135 "value" in n && (n.writable = !0), 136 Object.defineProperty(t, n.key, n); 137 } 138 } 139 var c = { 140 content: ["articles", "sections", "categories"], 141 animation: "accordion", 142 animationDuration: 300, 143 homeTitle: "Home", 144 backTitle: "", 145 disableClickHandlers: !1, 146 autoHeightAnimation: !1, 147 mobileBreakpoint: 767, 148 showMobile: !0, 149 buttonText: "Toggle navigation", 150 includeCategories: null, 151 includeSections: null, 152 includeArticles: null, 153 excludeCategories: null, 154 excludeSections: null, 155 excludeArticles: null, 156 }, 157 s = (function () { 158 function s(t, i, e, n) { 159 !(function (t, i) { 160 if (!(t instanceof i)) 161 throw new TypeError("Cannot call a class as a function"); 162 })(this, s), 163 (this.i = t), 164 (this.$element = i), 165 (this.options = $.extend({}, c, e)), 166 (this.data = n), 167 (this.ifRenderCategories = 168 -1 !== this.options.content.indexOf("categories")), 169 (this.ifRenderSections = 170 -1 !== this.options.content.indexOf("sections")), 171 (this.ifRenderArticles = 172 -1 !== this.options.content.indexOf("articles")), 173 (this.state = {}), 174 (this.height = 0), 175 (this.view = "desktop"), 176 this.init(); 177 } 178 var t, i, e; 179 return ( 180 (t = s), 181 (i = [ 182 { 183 key: "init", 184 value: function () { 185 (this.$wrapper = $( 186 '<div class="'.concat(a.CSS_PREFIX, '-container"></div>') 187 )), 188 (this.$box = $( 189 '<div class="' 190 .concat(a.CSS_PREFIX, " ") 191 .concat(a.CSS_PREFIX, "_") 192 .concat(this.i, " ") 193 .concat(a.CSS_PREFIX, '_init"></div>') 194 )), 195 this.initialStates(), 196 "slide" === this.options.animation 197 ? (this.$box.addClass(a.CSS_PREFIX + "_slide"), 198 this.initVisibleSlideBlocks()) 199 : this.$box.addClass(a.CSS_PREFIX + "_accordion"), 200 this.$element.html(this.$wrapper.html(this.$box[0])[0]), 201 this.options.showMobile && 202 ((this.$button = $( 203 '<a href="#" class="btn btn--primary ' 204 .concat( 205 a.CSS_PREFIX,
206 '-btn" style="display: none;">' 207 ) 208 .concat(this.options.buttonText, "</a>") 209 )), 210 (this.$overlay = $( 211 '<div class="'.concat( 212 a.CSS_PREFIX, 213 '-overlay" style="display: none;"></div>' 214 ) 215 )), 216 this.$element.append(this.$overlay[0]), 217 this.$element.append(this.$button[0])), 218 this.renderMenuItems(), 219 this.initVisibleAccordionBlocks(); 220 }, 221 }, 222 { 223 key: "renderMenuItems", 224 value: function () { 225 var t = this.ifRenderCategories 226 ? this.getCategoriesTemplate( 227 ApiData.toCategoriesTree( 228 ApiData.sortBy(this.data, "position") 229 ) 230 ) 231 : this.ifRenderSections
232 ? this.getSectionsTemplate( 233 ApiData.toSectionsTree( 234 ApiData.sortBy(this.data, "position") 235 ) 236 ) 237 : this.getArticlesTemplate(this.data.articles); 238 this.$box.append(t), 239 this.handleToggleMobileView(), 240 this.options.disableClickHandlers || 241 ("slide" === this.options.animation 242 ? (this.autoHeightAnimation(), 243 this.changeBoxHeight(), 244 this.$box 245 .find(".".concat(a.CSS_PREFIX, "__category-name")) 246 .on("click", this.handleCategoryClick.bind(this)), 247 this.$box 248 .find(".".concat(a.CSS_PREFIX, "__section-name")) 249 .on("click", this.handleSectionClick.bind(this)), 250 this.$box 251 .find( 252 "[data-".concat( 253 a.CSS_PREFIX, 254 "-back-to-categories]" 255 ) 256 ) 257 .on( 258 "click", 259 this.handleBackToCategoriesClick.bind(this) 260 ), 261 this.$box 262 .find( 263 "[data-".concat( 264 a.CSS_PREFIX, 265 "-back-to-sections]" 266 ) 267 ) 268 .on( 269 "click", 270 this.handleBackToSectionsClick.bind(this) 271 ), 272 this.$box 273 .find( 274 "[data-".concat( 275 a.CSS_PREFIX, 276 "-back-to-prev-sections]" 277 ) 278 ) 279 .on( 280 "click", 281 this.handleBackToPrevSections.bind(this) 282 )) 283 : (this.$box 284 .find(".".concat(a.CSS_PREFIX, "__category-name")) 285 .on( 286 "click", 287 this.handleCategorySlideToggleClick.bind(this) 288 ), 289 this.$box 290 .find(".".concat(a.CSS_PREFIX, "__section-name")) 291 .on( 292 "click", 293 this.handleSectionSlideToggleClick.bind(this) 294 ))), 295 this.options.showMobile && 296 (this.$button.on( 297 "click", 298 this.handleToggleMobileMenu.bind(this) 299 ), 300 this.$overlay.on( 301 "click", 302 this.handleHideMobileMenu.bind(this) 303 )), 304 $(window).on( 305 "resize", 306 this.handleToggleMobileView.bind(this) 307 ); 308 }, 309 }, 310 { 311 key: "initialStates", 312 value: function () { 313 if (-1 !== window.location.pathname.indexOf("/categories/")) 314 this.state = { 315 currentPage: "category", 316 activeCategoryId: parseInt( 317 window.location.pathname.replace( 318 a.REG_CATEGORY_ID, 319 "$1" 320 ) 321 ), 322 }; 323 else if ( 324 -1 !== window.location.pathname.indexOf("/sections/") 325 ) 326 (this.state = { 327 currentPage: "section", 328 activeSectionId: [ 329 parseInt( 330 window.location.pathname.replace( 331 a.REG_SECTION_ID, 332 "$1" 333 ) 334 ), 335 ], 336 }), 337 this.ifRenderCategories && 338 (this.state.activeCategoryId = 339 ApiData.filterBySectionId( 340 this.data, 341 this.state.activeSectionId[0] 342 ).categories[0].id); 343 else if ( 344 -1 !== window.location.pathname.indexOf("/articles/") 345 ) { 346 this.state = { 347 currentPage: "article", 348 activeArticleId: parseInt( 349 window.location.pathname.replace( 350 a.REG_ARTICLE_ID, 351 "$1" 352 ) 353 ), 354 }; 355 var t = ApiData.filterByArticleId( 356 this.data, 357 this.state.activeArticleId 358 ); 359 this.ifRenderCategories && 360 (this.state.activeCategoryId = t.categories[0].id), 361 this.ifRenderSections && 362 (this.state.activeSectionId = [t.sections[0].id]); 363 } 364 this.pushActiveSections(); 365 }, 366 }, 367 { 368 key: "pushActiveSections", 369 value: function (t) { 370 if ( 371 this.state.activeSectionId && 372 this.state.activeSectionId.length 373 ) { 374 var i = 375 t || 376 ApiData.filterBySectionId( 377 this.data, 378 this.state.activeSectionId[0] 379 ).sections[0]; 380 if (i && i.parent_section_id) { 381 var e = ApiData.filterBySectionId( 382 this.data, 383 i.parent_section_id 384 ).sections[0]; 385 e && 386 (this.state.activeSectionId.push(e.id), 387 this.pushActiveSections(e)); 388 } 389 } 390 }, 391 }, 392 { 393 key: "initVisibleSlideBlocks", 394 value: function () { 395 "category" === this.state.currentPage 396 ? this.isExist("category") && 397 this.$box.addClass(a.CSS_PREFIX + "_sections-is-active") 398 : "section" === this.state.currentPage 399 ? this.isExist("section") && this.isExist("category") 400 ? this.$box.addClass( 401 a.CSS_PREFIX + "_articles-is-active" 402 ) 403 : this.isExist("category") && 404 this.$box.addClass( 405 a.CSS_PREFIX + "_sections-is-active" 406 ) 407 : "article" === this.state.currentPage && 408 ((this.isExist("article") && 409 this.isExist("section") && 410 this.isExist("category")) || 411 (this.isExist("section") && this.isExist("category")) 412 ? this.$box.addClass( 413 a.CSS_PREFIX + "_articles-is-active" 414 ) 415 : this.isExist("category") && 416 this.$box.addClass( 417 a.CSS_PREFIX + "_sections-is-active" 418 )); 419 }, 420 }, 421 { 422 key: "initVisibleAccordionBlocks", 423 value: function () { 424 "accordion" === this.options.animation && 425 this.$box 426 .find( 427 ".sidenav__category.is-active > .sidenav__sections-list, .sidenav__section.is-active > .sidenav__articles-list" 428 ) 429 .css("display", "block"); 430 }, 431 }, 432 { 433 key: "isExist", 434 value: function (t) { 435 var i = 436 "category" === t 437 ? this.state.activeCategoryId 438 : "section" === t 439 ? this.state.activeSectionId 440 : this.state.activeArticleId; 441 if ("section" !== t) 442 return "article" === t 443 ? (0, n.isExist)( 444 this.options.includeArticles, 445 this.options.excludeArticles, 446 i 447 ) 448 : "category" === t && 449 (0, n.isExist)( 450 this.options.includeCategories, 451 this.options.excludeCategories, 452 i 453 ); 454 for (var e = 0; e < i.length; e++) 455 if ( 456 (0, n.isExist)( 457 this.options.includeSections, 458 this.options.excludeSections, 459 i[0] 460 ) 461 ) 462 return !0; 463 return !1; 464 }, 465 }, 466 { 467 key: "getCategoriesTemplate", 468 value: function (t) { 469 return '\n <ul class="' 470 .concat( 471 a.CSS_PREFIX, 472 '__categories-list" style="transition: transform ' 473 ) 474 .concat(this.options.animationDuration, 'ms">\n ') 475 .concat( 476 this.options.homeTitle 477 ? '\n <li class="' 478 .concat( 479 a.CSS_PREFIX, 480 '__home">\n <a href="/hc" class="' 481 ) 482 .concat(a.CSS_PREFIX, '__home-link">') 483 .concat( 484 this.options.homeTitle, 485 "</a>\n </li>\n " 486 ) 487 : "", 488 "\n " 489 ) 490 .concat( 491 t.map(this.getCategoryTemplate.bind(this)).join(""), 492 "\n </ul>\n " 493 ); 494 }, 495 }, 496 { 497 key: "getCategoryTemplate", 498 value: function (t) { 499 return (this.options.includeCategories && 500 -1 === this.options.includeCategories.indexOf(t.id)) || 501 (this.options.excludeCategories && 502 -1 !== this.options.excludeCategories.indexOf(t.id)) 503 ? "" 504 : '\n <li class="' 505 .concat(a.CSS_PREFIX, "__category ") 506 .concat( 507 this.state.activeCategoryId === t.id 508 ? a.ACTIVE_CLASS 509 : "", 510 '"\n data-' 511 ) 512 .concat(a.CSS_PREFIX, '-category-id="') 513 .concat(t.id, '">\n ') 514 .concat( 515 this.ifRenderSections 516 ? '<a class="' 517 .concat( 518 a.CSS_PREFIX, 519 '__category-name" href="' 520 ) 521 .concat(t.html_url, '">') 522 .concat(t.name, "</a>\n ") 523 .concat(
524 this.getSectionsTemplate(t.sections, t) 525 ) 526 : this.ifRenderArticles 527 ? '<a class="' 528 .concat( 529 a.CSS_PREFIX, 530 '__category-name" href="' 531 ) 532 .concat(t.html_url, '">') 533 .concat(t.name, "</a>\n ") 534 .concat( 535 this.getArticlesTemplate( 536 ApiData.filterByCategoryId( 537 this.data, 538 t.id 539 ).articles, 540 null, 541 t 542 ) 543 ) 544 : '<a href="' 545 .concat(t.html_url, '" class="') 546 .concat(a.CSS_PREFIX, '__category-name">') 547 .concat(t.name, "</a>"), 548 "\n </li>" 549 ); 550 }, 551 }, 552 { 553 key: "getSectionsTemplate", 554 value: function (t, i) { 555 return '\n <ul class="' 556 .concat( 557 a.CSS_PREFIX, 558 '__sections-list" style="transition: transform ' 559 ) 560 .concat(this.options.animationDuration, 'ms"\n ') 561 .concat( 562 i 563 ? "data-" 564 .concat(a.CSS_PREFIX, "-parent-") 565 .concat( 566 i.category_id ? "section" : "category", 567 '="' 568 ) 569 .concat(i.id, '"') 570 : "", 571 ">\n " 572 ) 573 .concat( 574 i 575 ? "\n ".concat( 576 "slide" !== this.options.animation 577 ? "" 578 : '\n <li class="' 579 .concat(a.CSS_PREFIX, "__section ") 580 .concat( 581 a.CSS_PREFIX, 582 '__back">\n <span data-' 583 ) 584 .concat(a.CSS_PREFIX, "-back-to-") 585 .concat( 586 i.category_id ? "sections" : "categories", 587 ">" 588 ) 589 .concat( 590 this.options.backTitle || i.name, 591 "</span>\n </li>\n " 592 ), 593 "\n " 594 ) 595 : this.getHomeLinkTemplate(), 596 "\n " 597 ) 598 .concat( 599 t.map(this.getSectionTemplate.bind(this)).join(""), 600 "\n </ul>\n " 601 ); 602 }, 603 }, 604 { 605 key: "getSectionTemplate", 606 value: function (t) { 607 return (this.options.includeSections && 608 -1 === this.options.includeSections.indexOf(t.id)) || 609 (this.options.excludeSections && 610 -1 !== this.options.excludeSections.indexOf(t.id)) 611 ? "" 612 : '\n <li class="' 613 .concat(a.CSS_PREFIX, "__section ") 614 .concat( 615 this.state.activeSectionId && 616 -1 !== this.state.activeSectionId.indexOf(t.id) 617 ? a.ACTIVE_CLASS 618 : "", 619 " " 620 ) 621 .concat( 622 t.sections.length 623 ? "".concat(a.CSS_PREFIX, "__section--sections") 624 : "", 625 " " 626 ) 627 .concat( 628 t.articles.length 629 ? "".concat(a.CSS_PREFIX, "__section--articles") 630 : "", 631 '"\n data-' 632 ) 633 .concat(a.CSS_PREFIX, '-section-id="') 634 .concat(t.id, '">\n <a class="') 635 .concat(a.CSS_PREFIX, '__section-name" href="') 636 .concat(t.html_url, '">') 637 .concat(t.name, "</a> ") 638 .concat( 639 '<span class="section__section-description">', 640 t.description != null ? t.description : "" 641 ) 642 .concat("</span>", "") 643 .concat( 644 this.getArticlesTemplate(t.articles, t), 645 "\n </li>\n " 646 ); 647 }, 648 }, 649 { 650 key: "getArticlesTemplate", 651 value: function (t, i, e) { 652 var n = ""; 653 return ( 654 i && 655 this.state.activeSectionId && 656 (n = 657 i.id === this.state.activeSectionId[0] 658 ? a.VISIBLE_CLASS + " " + a.ACTIVE_CLASS 659 : ""), 660 (this.ifRenderArticles && t.length) || i.sections.length 661 ? '\n <ul class="' 662 .concat(a.CSS_PREFIX, "__articles-list ") 663 .concat(n, '" style="transition: transform ') 664 .concat( 665 this.options.animationDuration, 666 'ms"\n ' 667 ) 668 .concat( 669 e 670 ? "data-" 671 .concat(a.CSS_PREFIX, '-parent-category="') 672 .concat(e.id, '"') 673 : "", 674 "\n " 675 ) 676 .concat( 677 i 678 ? "data-" 679 .concat(a.CSS_PREFIX, '-parent-section="') 680 .concat(i.id, '"') 681 : "", 682 ">\n " 683 ) 684 .concat( 685 e 686 ? "\n ".concat( 687 "slide" !== this.options.animation 688 ? "" 689 : '\n <li class="' 690 .concat(a.CSS_PREFIX, "__article ") 691 .concat( 692 a.CSS_PREFIX, 693 '__back">
693\n <span data-' 694 ) 695 .concat( 696 a.CSS_PREFIX, 697 "-back-to-categories>" 698 ) 699 .concat( 700 this.options.backTitle || e.name, 701 "</span>\n </li>\n " 702 ), 703 "\n " 704 ) 705 : i 706 ? "\n ".concat( 707 "slide" !== this.options.animation 708 ? "" 709 : '\n <li class="' 710 .concat(a.CSS_PREFIX, "__article ") 711 .concat( 712 a.CSS_PREFIX, 713 '__back">\n <span data-' 714 ) 715 .concat(a.CSS_PREFIX, "-back-to-") 716 .concat( 717 i.parent_section_id ? "prev-" : "", 718 "sections>" 719 ) 720 .concat( 721 this.options.backTitle || i.name, 722 "</span>\n </li>\n " 723 ), 724 "\n " 725 ) 726 : this.getHomeLinkTemplate(), 727 "\n " 728 ) 729 .concat( 730 this.ifRenderArticles && t.length 731 ? t 732 .map(this.getArticleTemplate.bind(this)) 733 .join("") 734 : "", 735 "\n " 736 ) 737 .concat( 738 i && i.sections && i.sections.length 739 ? i.sections 740 .map(this.getSectionTemplate.bind(this)) 741 .join("") 742 : "", 743 "\n </ul>\n " 744 ) 745 : "" 746 ); 747 }, 748 }, 749 { 750 key: "getArticleTemplate", 751 value: function (t) { 752 return (this.options.includeArticles && 753 -1 === this.options.includeArticles.indexOf(t.id)) || 754 (this.options.excludeArticles && 755 -1 !== this.options.excludeArticles.indexOf(t.id)) 756 ? "" 757 : '\n <li class="' 758 .concat(a.CSS_PREFIX, "__article ") 759 .concat( 760 this.state.activeArticleId === t.id 761 ? a.ACTIVE_CLASS 762 : "", 763 " " 764 ) 765 .concat( 766 t.promoted 767 ? "".concat(a.CSS_PREFIX, "__article--promoted") 768 : "", 769 '"\n data-' 770 ) 771 .concat(a.CSS_PREFIX, '-article-id="') 772 .concat(t.id, '">\n <a href="') 773 .concat(t.html_url, '" class="') 774 .concat(a.CSS_PREFIX, '__article-name">') 775 .concat(t.title, "</a>\n </li>\n "); 776 }, 777 }, 778 { 779 key: "getHomeLinkTemplate", 780 value: function () { 781 return this.options.homeTitle 782 ? '\n <li class="' 783 .concat(a.CSS_PREFIX, "__section ") 784 .concat( 785 a.CSS_PREFIX, 786 '__home">\n <a href="/hc" class="' 787 ) 788 .concat(a.CSS_PREFIX, '__section-name">') 789 .concat( 790 this.options.homeTitle, 791 "</a>\n </li>\n " 792 ) 793 : ""; 794 }, 795 }, 796 { 797 key: "categoriesIsActive",
798 value: function () { 799 this.addActiveClass(), 800 this.$box 801 .removeClass( 802 "sidenav_articles-is-active sidenav_sections-is-active" 803 ) 804 .addClass("sidenav_categories-is-active"); 805 }, 806 }, 807 { 808 key: "sectionsIsActive", 809 value: function (t) { 810 this.addActiveClass( 811 t 812 ? "[data-" 813 .concat(a.CSS_PREFIX, '-parent-category="') 814 .concat(t, '"]') 815 : null 816 ), 817 this.$box 818 .removeClass( 819 "sidenav_categories-is-active sidenav_articles-is-active" 820 ) 821 .addClass("sidenav_sections-is-active"); 822 }, 823 }, 824 { 825 key: "articlesIsActive", 826 value: function (t) { 827 this.addActiveClass( 828 "[data-" 829 .concat(a.CSS_PREFIX, '-parent-section="') 830 .concat(t, '"]') 831 ), 832 this.$box 833 .removeClass( 834 "sidenav_categories-is-active sidenav_sections-is-active" 835 ) 836 .addClass("sidenav_articles-is-active"); 837 }, 838 }, 839 { 840 key: "addActiveClass", 841 value: function (t) { 842 var i = this; 843 t && 844 this.$box 845 .find(t) 846 .addClass(a.ACTIVE_CLASS) 847 .addClass(a.VISIBLE_CLASS), 848 "slide" === this.options.animation 849 ? (this.changeBoxHeight(t), 850 this.removeActiveClass(t, !0), 851 setTimeout(function () { 852 return i.removeActiveClass(t); 853 }, this.options.animationDuration)) 854 : this.removeActiveClass(t); 855 }, 856 }, 857 { 858 key: "removeActiveClass", 859 value: function (t, i) { 860 var e = i ? a.VISIBLE_CLASS : a.ACTIVE_CLASS; 861 t 862 ? this.$box 863 .find("ul." + e) 864 .not(t) 865 .removeClass(e) 866 : this.$box.find("ul." + e).removeClass(e), 867 this.$box.hasClass("".concat(a.CSS_PREFIX, "_init")) && 868 this.$box.removeClass("".concat(a.CSS_PREFIX, "_init")); 869 }, 870 }, 871 { 872 key: "autoHeightAnimation", 873 value: function () { 874 this.options.autoHeightAnimation && 875 this.$box.css( 876 "transition-duration", 877 this.options.animationDuration + "ms" 878 ); 879 }, 880 }, 881 { 882 key: "changeBoxHeight", 883 value: function (t) { 884 var i = this, 885 e = t 886 ? this.$box.find(t).outerHeight() 887 : this.$box.find("." + a.ACTIVE_CLASS).length && 888 this.$box.hasClass(a.CSS_PREFIX + "_init") 889 ? this.$box 890 .find("." + a.ACTIVE_CLASS) 891 .last() 892 .children("ul") 893 .outerHeight() || 894 this.$box 895 .find("." + a.ACTIVE_CLASS) 896 .last() 897 .closest("ul") 898 .outerHeight() 899 : this.$box.children("ul").outerHeight(); 900 this.options.autoHeightAnimation || !this.height 901 ? this.$box.height(e) 902 : (this.autoHeightDelay && 903 clearTimeout(this.autoHeightDelay), 904 this.$box.height(e > this.height ? e : this.height), 905 (this.autoHeightDelay = setTimeout(function () { 906 i.$box.height(e); 907 }, this.options.animationDuration))), 908 (this.height = e); 909 }, 910 }, 911 { 912 key: "handleCategoryClick", 913 value: function (t) { 914 t.preventDefault(); 915 var i = $(t.currentTarget) 916 .closest("[data-".concat(a.CSS_PREFIX, "-category-id]")) 917 .attr("data-".concat(a.CSS_PREFIX, "-category-id")); 918 this.sectionsIsActive(i); 919 }, 920 }, 921 { 922 key: "handleSectionClick", 923 value: function (t) { 924 t.preventDefault(); 925 var i = $(t.currentTarget) 926 .closest("[data-".concat(a.CSS_PREFIX, "-section-id]")) 927 .attr("data-".concat(a.CSS_PREFIX, "-section-id")); 928 this.articlesIsActive(i); 929 }, 930 }, 931 { 932 key: "handleBackToCategoriesClick", 933 value: function (t) { 934 t.preventDefault(), this.categoriesIsActive(); 935 }, 936 }, 937 { 938 key: "handleBackToSectionsClick", 939 value: function (t) { 940 t.preventDefault(), 941 this.ifRenderCategories 942 ? this.handleCategoryClick(t) 943 : this.sectionsIsActive(); 944 }, 945 }, 946 { 947 key: "handleBackToPrevSections", 948 value: function (t) { 949 t.preventDefault(); 950 var i = $(t.currentTarget) 951 .parents("[data-".concat(a.CSS_PREFIX, "-section-id]")) 952 .eq(1) 953 .attr("data-".concat(a.CSS_PREFIX, "-section-id")); 954 this.articlesIsActive(i); 955 }, 956 }, 957 { 958 key: "slideToggle", 959 value: function (t) { 960 t.siblings("ul").slideToggle( 961 this.options.animationDuration 962 ); 963 }, 964 }, 965 { 966 key: "handleCategorySlideToggleClick", 967 value: function (t) { 968 t.preventDefault(); 969 var i = $(t.currentTarget); 970 this.slideToggle(i), 971 i 972 .closest(".".concat(a.CSS_PREFIX, "__category")) 973 .toggleClass(a.ACTIVE_CLASS); 974 }, 975 }, 976 { 977 key: "handleSectionSlideToggleClick", 978 value: function (t) { 979 var i = $(t.currentTarget), 980 e = i.siblings("ul"); 981 e && 982 e.length && 983 (t.preventDefault(), 984 this.slideToggle(i), 985 i 986 .closest(".".concat(a.CSS_PREFIX, "__section")) 987 .toggleClass(a.ACTIVE_CLASS)); 988 }, 989 }, 990 { 991 key: "handleToggleMobileView", 992 value: function () { 993 window.innerWidth <= this.options.mobileBreakpoint && 994 "desktop" === this.view && 995 ((this.view = "mobile"), 996 this.options.showMobile 997 ? (this.$button.show(0), 998 this.$overlay.show(0), 999 this.$wrapper.addClass( 1000 "".concat(a.CSS_PREFIX, "-mobile") 1001 )) 1002 : this.$wrapper.hide(0)), 1003 window.innerWidth > this.options.mobileBreakpoint && 1004 "mobile" === this.view && 1005 ((this.view = "desktop"), 1006 this.options.showMobile 1007 ? (this.$button.hide(0), 1008 this.$overlay.hide(0), 1009 this.$wrapper.removeClass( 1010 "".concat(a.CSS_PREFIX, "-mobile") 1011 )) 1012 : this.$wrapper.show(0)), 1013 "slide" === this.options.animation && 1014 this.changeBoxHeight(); 1015 }, 1016 }, 1017 { 1018 key: "handleToggleMobileMenu", 1019 value: function (t) { 1020 t.preventDefault(), 1021 this.$overlay.toggleClass("is-active"), 1022 this.$wrapper.toggleClass("is-active"); 1023 }, 1024 }, 1025 { 1026 key: "handleHideMobileMenu", 1027 value: function (t) { 1028 t.preventDefault(), 1029 this.$overlay.removeClass("is-active"), 1030 this.$wrapper.removeClass("is-active"); 1031 }, 1032 }, 1033 { 1034 key: "openCategory", 1035 value: function (t, i) { 1036 var e = this; 1037 if ("slide" === this.options.animation) 1038 this.sectionsIsActive("number" == typeof t ? t : t[0]); 1039 else { 1040 var n = i ? 0 : this.options.animationDuration; 1041 "number" == typeof t 1042 ? (this.$element 1043 .find( 1044 "[data-" 1045 .concat(a.CSS_PREFIX, '-parent-category="') 1046 .concat(t, '"]') 1047 ) 1048 .slideDown(n), 1049 this.$element 1050 .find( 1051 "[data-" 1052 .concat(a.CSS_PREFIX, '-category-id="') 1053 .concat(t, '"]') 1054 ) 1055 .addClass(a.ACTIVE_CLASS)) 1056 : t.forEach(function (t) { 1057 e.$element 1058 .find( 1059 "[data-" 1060 .concat(a.CSS_PREFIX, '-parent-category="') 1061 .concat(t, '"]') 1062 ) 1063 .slideDown(n), 1064 e.$element 1065 .find( 1066 "[data-" 1067 .concat(a.CSS_PREFIX, '-category-id="') 1068 .concat(t, '"]') 1069 ) 1070 .addClass(a.ACTIVE_CLASS); 1071 }); 1072 } 1073 }, 1074 }, 1075 { 1076 key: "openSection", 1077 value: function (t, i) { 1078 var e = this; 1079 if ("slide" === this.options.animation) 1080 this.articlesIsActive("number" == typeof t ? t : t[0]); 1081 else { 1082 var n = i ? 0 : this.options.animationDuration; 1083 "number" == typeof t 1084 ? (this.$element 1085 .find( 1086 "[data-" 1087 .concat(a.CSS_PREFIX, '-parent-section="') 1088 .concat(t, '"]') 1089 ) 1090 .slideDown(n), 1091 this.$element 1092 .find( 1093 "[data-" 1094 .concat(a.CSS_PREFIX, '-section-id="') 1095 .concat(t, '"]') 1096 ) 1097 .addClass(a.ACTIVE_CLASS)) 1098 : t.forEach(function (t) { 1099 e.$element 1100 .find( 1101 "[data-" 1102 .concat(a.CSS_PREFIX, '-parent-section="') 1103 .concat(t, '"]') 1104 ) 1105 .slideDown(n), 1106 e.$element 1107 .find( 1108 "[data-" 1109 .concat(a.CSS_PREFIX, '-section-id="') 1110 .concat(t, '"]') 1111 ) 1112 .addClass(a.ACTIVE_CLASS); 1113 }); 1114 } 1115 }, 1116 }, 1117 { 1118 key: "openAllCategories", 1119 value: function (t) { 1120 var i = 1121 "slide" === this.options.animation 1122 ? this.data.categories[0].id 1123 : this.data.categories.map(function (t) { 1124 return t.id; 1125 }); 1126 this.openCategory(i, t); 1127 }, 1128 }, 1129 { 1130 key: "openAllSections", 1131 value: function (t) { 1132 var i = 1133 "slide" === this.options.animation 1134 ? this.data.sections[0].id 1135 : this.data.sections.map(function (t) { 1136 return t.id; 1137 }); 1138 this.openSection(i, t); 1139 }, 1140 }, 1141 ]) && o(t.prototype, i), 1142 e && o(t, e), 1143 s 1144 ); 1145 })(); 1146 e.default = s; 1147 }, 1148 { "./constants": 3, "./utils": 5 }, 1149 ], 1150 3: [ 1151 function (t, i, e) { 1152 "use strict"; 1153 Object.defineProperty(e, "__esModule", { value: !0 }), 1154 (e.REG_ARTICLE_ID = 1155 e.REG_SECTION_ID = 1156 e.REG_CATEGORY_ID =
1157 e.VISIBLE_CLASS = 1158 e.ACTIVE_CLASS = 1159 e.CSS_PREFIX = 1160 void 0); 1161 e.CSS_PREFIX = "sidenav"; 1162 e.ACTIVE_CLASS = "is-active"; 1163 e.VISIBLE_CLASS = "is-visible"; 1164 e.REG_CATEGORY_ID = 1165 /\/hc(?:\/[A-Za-z0-9-]+)?\/categories\/([0-9]+)[\S]*$/i; 1166 e.REG_SECTION_ID = 1167 /\/hc(?:\/[A-Za-z0-9-]+)?\/sections\/([0-9]+)[\S]*$/i; 1168 e.REG_ARTICLE_ID = 1169 /\/hc(?:\/[A-Za-z0-9-]+)?\/articles\/([0-9]+)[\S]*$/i; 1170 }, 1171 {}, 1172 ], 1173 4: [ 1174 function (t, i, e) { 1175 "use strict"; 1176 var n, 1177 o = (n = t("./SideNav")) && n.__esModule ? n : { default: n }, 1178 s = t("../package"); 1179 $(window).on("apiDataFetched", function (t, a) { 1180 $(function () { 1181 $("[data-sidenav]").each(function (t, i) { 1182 var e = $(i), 1183 n = e.data("sidenav") || {}; 1184 t || $("html").addClass("sidenav-enabled"); 1185 var s = new o.default(t, e, n, a); 1186 $(window).trigger("sidenavRendered", s), 1187 $(window).trigger("resize"); 1188 }); 1189 }); 1190 }), 1191 (window.SideNav = { version: s.version }); 1192 }, 1193 { "../package": 1, "./SideNav": 2 }, 1194 ], 1195 5: [ 1196 function (t, i, e) { 1197 "use strict"; 1198 Object.defineProperty(e, "__esModule", { value: !0 }), 1199 (e.isExist = void 0); 1200 e.isExist = function (t, i, e) { 1201 return t ? -1 !== t.indexOf(e) : !i || -1 === i.indexOf(e); 1202 }; 1203 }, 1204 {}, 1205 ], 1206 }, 1207 {}, 1208 [4] 1209);
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.