1$(function () { 2 console.log('%c B2B%cee %c www.B2Bee.net ð', 'color:#000;font-size:50px;font-family:Segoe UI;font-weight:bold', 'color:#f6e000;font-size:50px;font-family:Segoe UI;font-weight:bold', 'color:#666;'); 3 4 $(document).on('click', '[data-vs-empty-session-storage]', function() { 5 sessionStorage.clear(); 6 }); 7 8}); 9 10 11/* 12|-------------------------------------------------------------------------- 13| Main methods, cookie, session 14|-------------------------------------------------------------------------- 15| 16*/ 17function SaveDataToLocalStorage(Key, Value) { 18 19 var data = new Object(); 20 21 data = { 22 d: new Date(), 23 c: getCookie("CurrentClient"), 24 v: Value 25 } 26 27 sessionStorage.setItem(Key, JSON.stringify(data)); 28 29} 30 31function GetDataFromLocalStorage(Key) { 32 var DataOnKey = sessionStorage.getItem(Key); 33 34 if (DataOnKey != null) { 35 var Data = JSON.parse(DataOnKey); 36 if (Data.c == getCookie("CurrentClient")) { 37 if ((new Date - new Date(Data.d)) < 21600000) { 38 return Data.v; 39 } else { 40 sessionStorage.removeItem(Key) 41 } 42 } else { 43 sessionStorage.removeItem(Key) 44 } 45 } 46 47 return null; 48 49} 50 51function getCookie(cname) { 52 var name = cname + "="; 53 var ca = document.cookie.split(';'); 54 for (var i = 0; i < ca.length; i++) { 55 var c = ca[i]; 56 while (c.charAt(0) == ' ') { 57 c = c.substring(1); 58 } 59 if (c.indexOf(name) == 0) { 60 return c.substring(name.length, c.length); 61 } 62 } 63 return ""; 64} 65 66 67/* 68|-------------------------------------------------------------------------- 69| Custom PNotify & alert fallback 70|-------------------------------------------------------------------------- 71| 72*/ 73 74/** 75 * Displays a custom notification using PNotify or falls back to a browser alert if PNotify is unavailable. 76 * 77 * @param {Object} options - The options for the notification. 78 * @param {string} options.message - **Required.** The message to display in the notification. 79 * @param {string} [options.type='notice'] - The type of notification. Can be one of the following: 80 * 'notice', 'info', 'success', 'error'. Defaults to 'notice'. 81 * @param {number} [options.delay=3000] - The duration (in milliseconds) for which the notification is displayed. 82 * Defaults to 3000ms. 83 * @param {boolean} [options.hide=true] - Determines whether the notification should automatically hide after the delay. 84 * Defaults to `true`. 85 */ 86function customNotify(options) { 87 const { 88 message, 89 type = 'notice', 90 delay = 3000, 91 hide = true, 92 } = options; 93 94 if (!message) { 95 console.error('customNotify: "message" is required.'); 96 return; 97 } 98 99 try { 100 new PNotify({ 101 title: "ObaveÅ¡tenje", 102 text: message, 103 type, 104 delay, 105 hide, 106 styling: "bootstrap3", 107 }); 108 } catch (error) { 109 console.log('PNotify error: ', error); 110 alert(message); 111 } 112} 113 114/* 115|-------------------------------------------------------------------------- 116| WebPartLogin 117|-------------------------------------------------------------------------- 118| 119*/ 120var LoginBehaivorObj = null; 121 122LoginBehaivor = function (UserNameId, PriceId, PriceOnlyHomeId, pnlLoginId, pnlLogoutId, IsHome, PrivatePageLink, HideLogout, 123 ServiceUrl, FBAppId, redirectUrl) { 124 125 this.IsLoggedIn = false; 126 this.UserNameControl = null; 127 this.PriceIdControl = null; 128 this.PriceOnlyHomeControl = null; 129 this.pnlLoginCtrl = null; 130 this.pnlLogoutCtrl = null; 131 132 this.UserNameId = UserNameId; 133 this.PriceId = PriceId; 134 this.PriceOnlyHomeId = PriceOnlyHomeId; 135 this.IsHome = IsHome; 136 this.pnlLoginId = pnlLoginId; 137 this.pnlLogoutId = pnlLogoutId; 138 this.HideLogout = HideLogout; 139 140 this.PrivatePageLink = PrivatePageLink; 141 142 this.Proxy = new serviceProxy(ServiceUrl); 143 144 this.FBAppId = FBAppId; 145 146 this.RedirectUrl = redirectUrl; 147 148 // Initialisation Facebook Login 149 if (this.FBAppId != "") { 150 btnLogin = $("#FBlogin"); 151 btnLogin.css("display", ""); 152 153 btnLogin.unbind("click").click(function () { 154 LoginBehaivorObj.FBLogin(); 155 }); 156 157 158 if (window.fbAsyncInit === null) { 159 window.fbAsyncInit = function () { 160 FB.init({ 161 appId: FBAppId,//'418301024905516', // App ID 162 status: true, // check login status 163 cookie: true, // enable cookies to allow the server to access the session 164 xfbml: true // parse XFBML 165 }); 166 167 // Additional initialization code here 168 169 170 }; 171 } 172 173 // Load the SDK Asynchronously 174 (function (d) { 175 var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0]; 176 if (d.getElementById(id)) { return; } 177 js = d.createElement('script'); js.id = id; js.async = true; 178 js.src = "//connect.facebook.net/en_US/all.js"; 179 ref.parentNode.insertBefore(js, ref); 180 }(document)); 181 182 (function (d) { 183 var js, id = 'jqueryui', ref = d.getElementsByTagName('script')[0]; 184 if (d.getElementById(id)) { return; } 185 js = d.createElement('script'); js.id = id; js.async = true; 186 js.src = "//code.jquery.com/ui/1.9.2/jquery-ui.js"; 187 ref.parentNode.insertBefore(js, ref); 188 }(document)); 189 190 } 191 192} 193LoginBehaivor.prototype = { 194 SetLoginData: function () { 195 this.UserNameControl = $(this.UserNameId); 196 this.PriceIdControl = $(this.PriceId); 197 this.PriceOnlyHomeControl = $(this.PriceOnlyHomeId);
198 this.pnlLoginCtrl = $(this.pnlLoginId); 199 this.pnlLogoutCtrl = $(this.pnlLogoutId); 200 201 var LoginData = GetDataFromLocalStorage("LoginInfo"); 202 var AjaxLogin = new Object(); 203 204 if (LoginData != null) { 205 AjaxLogin.IsLoggedIn = LoginData.IsLoggedIn; 206 AjaxLogin.UserName = LoginData.UserName; 207 LoginBehaivorObj.UpdateLoginInfo(AjaxLogin); 208 } else { 209 this.Proxy.invoke("GetLoginInfo", null, 210 function (AjaxLogin1) { 211 SaveDataToLocalStorage("LoginInfo", AjaxLogin1) 212 LoginBehaivorObj.UpdateLoginInfo(AjaxLogin1); 213 }, 214 function (result) { 215 //alert(result.get_message()); 216 } 217 ); 218 } 219 220 221 //this.SetPrice(PriceString); 222 }, 223 224 UpdateLoginInfo: function (AjaxLogin) { 225 this.IsLoggedIn = AjaxLogin.IsLoggedIn; 226 227 if (AjaxLogin.IsLoggedIn === true) { 228 $('[data-vs-loggedin-panel]').show(); 229 230 this.pnlLoginCtrl.html(''); 231 232 if (this.HideLogout === false) { 233 this.pnlLogoutCtrl.css('display', ''); 234 if (this.UserNameControl !== null) { 235 LoginBehaivorObj.UserNameControl.html(AjaxLogin.UserName); 236 LoginBehaivorObj.UserNameControl.href = this.PrivatePageLink; 237 } 238 } 239 else { 240 this.pnlLogoutCtrl.html(''); 241 } 242 } else { 243 $('[data-vs-loggedout-panel]').show(); 244 245 this.pnlLogoutCtrl.html(''); 246 this.pnlLoginCtrl.css('display', ''); 247 } 248 249 if (this.PriceIdControl !== null || this.PriceOnlyHomeControl !== null) { 250 //this.SetPrice(AjaxLogin.PriceString); 251 } 252 253 }, 254 255 GetCookieLogin: function () { 256 var name = ".Role" + "="; 257 var decodedCookie = decodeURIComponent(document.cookie); 258 var ca = decodedCookie.split(';'); 259 for (var i = 0; i < ca.length; i++) { 260 var c = ca[i]; 261 while (c.charAt(0) == ' ') { 262 c = c.substring(1); 263 } 264 if (c.indexOf(name) == 0) { 265 266 var cookieString = c.substring(name.length, c.length); 267 268 var CookieObject = new Object(); 269 cookieString.split("&").forEach(function (item) { 270 CookieObject[item.split('=')[0]] = item.split('=')[1]; 271 }) 272 273 274 return CookieObject; 275 276 277 278 } 279 } 280 return ""; 281 }, 282 283 SetPrice: function (PriceString) { 284 if (this.PriceIdControl !== null) { 285 this.PriceIdControl.html(PriceString); 286 } 287 288 if (this.IsHome && this.PriceOnlyHomeControl !== null) { 289 this.PriceOnlyHomeControl.html(PriceString); 290 } 291 }, 292 293 FBLogin: function () { 294 redirectUrl = this.RedirectUrl; 295 proxy = this.Proxy; 296 FB.login(function (response) { 297 if (response.status === 'connected') { 298 // the user is logged in and has authenticated your 299 // app, and response.authResponse supplies 300 // the user's ID, a valid access token, a signed 301 // request, and the time the access token 302 // and signed request each expire 303 var uid = response.authResponse.userID; 304 var accessToken = response.authResponse.accessToken; 305 306 307 // TODO: Handle the access token 308 // Do a post to the server to finish the logon 309 // This is a form post since we don't want to use AJAX 310 proxy.invoke("FacebookLogin", { isLogin: true, accessToken: accessToken }, 311 function (FacebookLogin) { 312 if (FacebookLogin.IsLoggedIn) { 313 location.href = redirectUrl; 314 } 315 else { 316 317 txbEmail = $("#BSEmailFBlogin"); 318 txbPassword = $("#BSPasswordFBlogin"); 319 txbPassword.val(""); 320 txbEmail.val(FacebookLogin.Email); 321 if (FacebookLogin.Email !== "" && FacebookLogin.Email !== null) 322 txbEmail.attr("disabled", true); 323 else 324 txbEmail.removeAttr("disabled"); 325 326 form = $("#BSCredentialsFormFBlogin"); 327 form.css("display", ""); 328 329 // Popup login 330 form.dialog({ 331 autoOpen: true, 332 height: 300, 333 width: 350, 334 modal: true, 335 buttons: { 336 "Submit": function () { 337 338 // Call ws 339 proxy.invoke("FacebookLoginAuthorization", { 340 accessToken: accessToken, 341 BSusername: txbEmail.val(), 342 BSpassword: txbPassword.val() 343 }, 344 function (FacebookLogin) { 345 if (FacebookLogin.IsLoggedIn) { 346 location.href = redirectUrl; 347 } 348 else { 349 alert(FacebookLogin.Message); 350 } 351 }, 352 function (result) { 353 alert("KO"); 354 } 355 ); 356 357 358 $(this).dialog("close"); 359 360 }, 361 Cancel: function () { 362 $(this).dialog("close"); 363 } 364 }, 365 close: function () { 366 } 367 }); 368 369 } 370 }, 371 function (result) { 372 alert("KO"); 373 } 374 ); 375 376 377 } else if (response.status === 'not_authorized') { 378 // the user is logged in to Facebook, 379 // but has not authenticated your app 380 alert("You didn't give the permissions to the application"); 381 } else { 382 // the user isn't logged in to Facebook. 383 alert("You are not registered in the system"); 384 } 385 }, { scope: 'email, user_birthday' }); 386 387 388 } 389} 390 391/* 392|-------------------------------------------------------------------------- 393| WebPartBasket 394|-------------------------------------------------------------------------- 395| 396*/ 397var BasketBehaivorObj = null; 398
399BasketBehaivor = function (BasketPanelId, PriceLinkId, ShortPriceLinkId, 400 TableId, DeleteMessage, pnlUserBasketId, lnkUsernameId, lnkEmailId, PrivatePageLink, RemotePriceID, 401 ServiceUrl, showIfEmpty, lnkEmptyBasketId, EmptyActionMessage, RedirectBasketUrl, IsB2B, UseCssForButton) { 402 403 this.EmptyBasketMessageId = '#EmptyBasketMessage'; 404 this.BasketCountId = '[data-vs-basket-count]'; 405 this.BasketTotalData = '[data-vs-basket-price]'; 406 this.BasketPanelControlId = BasketPanelId; 407 this.PriceLinkControlId = PriceLinkId; 408 this.ShortPriceLinkId = ShortPriceLinkId; 409 this.TableControlId = TableId; 410 411 this.IsB2B = IsB2B; 412 413 this.UseCssForButton = UseCssForButton; 414 415 this.pnlUserBasketId = pnlUserBasketId; 416 this.lnkUsernameId = lnkUsernameId; 417 this.lnkEmailId = lnkEmailId; 418 419 this.PrivatePageLink = PrivatePageLink; 420 421 this.RemotePriceID = RemotePriceID; 422 423 this.Spots = new Array(); 424 425 this.BasketUI = new Object(); 426 427 this.DeleteMessage = DeleteMessage; 428 429 this.Proxy = new serviceProxy(ServiceUrl); 430 431 this.ShowIfEmpty = showIfEmpty; 432 433 this.lnkEmptyBasketId = lnkEmptyBasketId; 434 435 this.EmptyMessage = EmptyActionMessage; 436 437 this.RedirectBasketUrl = RedirectBasketUrl; 438 439 $(this.lnkEmptyBasketId).click(function () { 440 BasketBehaivorObj.EmptyBasket(this); 441 }); 442} 443BasketBehaivor.prototype = { 444 UpdateLinkImage: function (link, imageName) { 445 if (link != null && imageName != null && imageName != '') { 446 if (this.UseCssForButton == false) { 447 448 var img = link.getElementsByTagName('img')[0]; 449 450 var imgPath = ''; 451 452 if (img != null) { 453 imgPath = img.src.substring(0, img.src.lastIndexOf('/') + 1); 454 455 img.src = imgPath + imageName; 456 } 457 458 } else { 459 460 link.className = imageName; 461 462 } 463 464 } 465 }, 466 467 AddToBasket: function (Sender, SalesItemId, Qty, 468 AddImageName, AnimatedImageName, InBasketImageName) { 469 470 toggleDisabled(Sender, true); 471 this.UpdateLinkImage(Sender, AnimatedImageName); 472 473 if (Qty == null || Qty == '' || Qty == undefined || Qty == '0' || Qty == 0) { 474 Qty = 1; 475 } 476 477 var ddlVariation = $('#ddlAttribute1_' + SalesItemId); 478 479 if (ddlVariation != null && ddlVariation.length > 0) { 480 SalesItemId = ddlVariation.val(); 481 } else { 482 if ($("#selectSize") != null && $("#selectSize").length > 0) { 483 if ($("#selectSize")[0].length > 1) { 484 SalesItemId = $("#selectSize").find(":selected").val(); 485 if (SalesItemId != "0") { 486 console.log(SalesItemId); 487 } 488 } 489 } 490 } 491 492 this.Proxy.invoke("AddToBasket", { SalesItemUid: SalesItemId, Qty: Qty, SendDetails: true }, 493 function (result) { 494 toggleDisabled(Sender, false); 495 if (result.BasketItems.length > 0) { 496 result.BasketItems.forEach(function (Item) { 497 $("[name=" + Item.uid + "]").removeClass("adding-to-basket"); 498 $("[data-add-to-basket]").removeClass("adding-to-basket"); 499 $(".btn-disable").removeClass("btn-disable"); 500 501 }); 502 } else { 503 $(".adding-to-basket").removeClass("adding-to-basket"); 504 $(".btn-disable").removeClass("btn-disable"); 505 } 506 507 var evt = new CustomEvent('AddToBasket', { detail: result }); 508 509 window.dispatchEvent(evt); 510 511 if (result.OperationResult != 0) { 512 localStorage.clear(); 513 setTimeout(function () { 514 BasketBehaivorObj.GetAndRefreshBasket(this); 515 }, 1000); 516 BasketBehaivorObj.UpdateLinkImage(Sender, AddImageName); 517 } else { 518 if (BasketBehaivorObj != undefined && BasketBehaivorObj != null) { 519 if (BasketBehaivorObj.RedirectBasketUrl != undefined && BasketBehaivorObj.RedirectBasketUrl != null && BasketBehaivorObj.RedirectBasketUrl != '') { 520 window.location.href = BasketBehaivorObj.RedirectBasketUrl; 521 } 522 else {
523 BasketBehaivorObj.RefreshBasket(Sender, result); 524 BasketBehaivorObj.UpdateLinkImage(Sender, InBasketImageName); 525 526 var element = new Object(); 527 528 element.Key = SalesItemId; 529 element.Value = Sender.id; 530 531 BasketBehaivorObj.Spots.push(element); 532 } 533 } 534 } 535 return result; 536 }, 537 function (result) { 538 toggleDisabled(Sender, false); 539 //alert(result.get_message()); 540 } 541 ); 542 }, 543 544 AddToBasketByIdentifier: function (Sender, SalesItemIdentifier, Qty, 545 AddImageName, AnimatedImageName, InBasketImageName) { 546 547 toggleDisabled(Sender, true); 548 549 this.UpdateLinkImage(Sender, AnimatedImageName); 550 551 if (Qty == null || Qty == '' || Qty == undefined) { 552 Qty = 1; 553 } 554 555 var ddlVariation = $('#ddlAttribute1_' + SalesItemIdentifier); 556 557 if (ddlVariation != null && ddlVariation.length > 0) { 558 SalesItemId = ddlVariation.val(); 559 } else { 560 if ($("#selectSize") != null && $("#selectSize").length > 0) { 561 if ($("#selectSize")[0].length > 1) { 562 SalesItemId = $("#selectSize").find(":selected").val(); 563 if (SalesItemId != "0") { 564 console.log(SalesItemId); 565 } 566 } 567 } 568 } 569 570 this.Proxy.invoke("AddToBasketByIdentifier", { Identifier: SalesItemIdentifier, Qty: Qty }, 571 function (result) { 572 toggleDisabled(Sender, false); 573 574 if (result.OperationResult != 0) { 575 try { 576 new PNotify({ 577 title: 'Obaveštenje', 578 text: result.ErrorMessage, 579 hide: false, 580 styling: 'bootstrap3' 581 }); 582 } catch (e) { 583 alert(result.ErrorMessage); 584 } 585 BasketBehaivorObj.UpdateLinkImage(Sender, AddImageName); 586 587 } 588 else { 589 590 try { 591 new PNotify({ 592 title: 'Obaveštenje', 593 text: result.ErrorMessage, 594 delay: 2000, 595 type: "success", 596 styling: "bootstrap3" 597 }); 598 } catch (e) { 599 alert(result.ErrorMessage); 600 } 601 602 } 603 return result; 604 }, 605 function (result) { 606 toggleDisabled(Sender, false); 607 //alert(result.get_message()); 608 } 609 ); 610 }, 611 612 EmptyBasket: function (Sender) { 613 if (true) { //confirm(this.EmptyMessage) 614 615 toggleDisabled(Sender, true); 616 617 this.Proxy.invoke("EmptyBasket", null, 618 function (result) { 619 toggleDisabled(Sender, false); 620 621 sessionStorage.removeItem("BasketUI"); 622 623 if (result.OperationResult != 0) { 624 //alert(result.OperationResult); 625 } 626 else { 627 if (BasketBehaivorObj != undefined && BasketBehaivorObj != null) { 628 BasketBehaivorObj.RefreshBasket(Sender, result); 629 630 if (BasketBehaivorObj.Spots != null) { 631 for (var a = 0; a < BasketBehaivorObj.Spots.length; a++) { 632 var LinkId = BasketBehaivorObj.Spots[a].Value; 633 634 var Link = $('#' + LinkId); 635 636 if (Link.attr('OriginalImgName') != null) { 637 if (BasketBehaivorObj.UseCssForButton == false) { 638 BasketBehaivorObj.UpdateLinkImage(Link.get(0), Link.attr('OriginalImgName')); 639 640 } else { 641 Link.className = Link.attr('OriginalImgName'); 642 } 643 } 644 } 645 646 BasketBehaivorObj.Spots.length = 0; 647 } 648 } 649 650 location.reload(); 651 652 } 653 }, 654 function (result) { 655 toggleDisabled(Sender, false); 656 //alert(result.get_message()); 657 } 658 ); 659 } 660 }, 661 662 RemoveFromBasket: function (Sender, SalesItemId) { 663 if (confirm(this.DeleteMessage)) { 664 665 toggleDisabled(Sender, true); 666 667 this.Proxy.invoke("RemoveFromBasket", { SalesItemUid: SalesItemId }, 668 function (result) { 669 toggleDisabled(Sender, false); 670 671 if (result.OperationResult != 0) { 672 //alert(result.OperationResult); 673 } 674 else { 675 if (BasketBehaivorObj != undefined && BasketBehaivorObj != null) {
676 BasketBehaivorObj.RefreshBasket(Sender, result); 677 678 if (BasketBehaivorObj.Spots != null) { 679 for (var a = 0; a < BasketBehaivorObj.Spots.length; a++) { 680 if (BasketBehaivorObj.Spots[a].Key == SalesItemId) { 681 var LinkId = BasketBehaivorObj.Spots[a].Value; 682 683 BasketBehaivorObj.Spots.splice(a, 1); 684 685 var Link = $('#' + LinkId); 686 687 if (Link.attr('OriginalImgName') != null) { 688 if (BasketBehaivorObj.UseCssForButton == false) { 689 BasketBehaivorObj.UpdateLinkImage(Link.get(0), Link.attr('OriginalImgName')); 690 691 } else { 692 Link.className = Link.attr('OriginalImgName'); 693 } 694 } 695 } 696 } 697 } 698 } 699 } 700 }, 701 function (result) { 702 toggleDisabled(Sender, false); 703 //alert(result.get_message()); 704 } 705 ); 706 } 707 }, 708 709 RefreshBasket: function (sender, BasketUI, refreshSpots) { 710 var BasketPanelControl = $(this.BasketPanelControlId); 711 var PriceLinkControl = $(this.PriceLinkControlId); 712 var ShortPriceLinkControl = $(this.ShortPriceLinkId); 713 var TableControl = $(this.TableControlId); 714 var pnlUserBasketCtrl = $(this.pnlUserBasketId); 715 var lnkUsernameCtrl = $(this.lnkUsernameId); 716 var lnkEmailCtrl = $(this.lnkEmailId); 717 718 SaveDataToLocalStorage("BasketUI", BasketUI); 719 720 BasketBehaivorObj.BasketUI = BasketUI; 721 722 if (BasketUI.IsLoggedIn) { 723 $('#NotRegisteredInfo').hide(); 724 } 725 else { 726 $('#NotRegisteredInfo').show(); 727 } 728 729 if ($("#orderNo").length) { 730 $("#orderNo").text(BasketUI.OrderId); 731 } 732 733 if (pnlUserBasketCtrl != null) { 734 if (BasketUI.IsLoggedIn) { 735 if (lnkUsernameCtrl.length != 0) { 736 lnkUsernameCtrl.html(BasketUI.UserName); 737 738 lnkUsernameCtrl.href = this.PrivatePageLink; 739 } 740 741 742 if (lnkEmailCtrl.length != 0) { 743 lnkEmailCtrl.href = this.PrivatePageLink; 744 lnkEmailCtrl.html(BasketUI.UserName); 745 } 746 747 pnlUserBasketCtrl.css('display', ''); 748 } 749 else { 750 pnlUserBasketCtrl.html(''); 751 } 752 } 753 754 if (PriceLinkControl.length != 0) { 755 756 if (location.href.indexOf("ctc.b2bee.rs") != -1) { 757 function formatNumber(num) { 758 return num.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g, '$1,') 759 } 760 761 console.log(BasketUI.BasketTotal); 762 console.log(BasketUI.BasketTotalString.split(' ')[1]); 763 764 765 var n = formatNumber((BasketUI.BasketTotal / 1.2).toFixed(2)) + " " + BasketUI.BasketTotalString.split(' ')[1] 766 767 console.log(n); 768 PriceLinkControl.html(n); 769 770 } else { 771 PriceLinkControl.html(BasketUI.BasketTotalString); 772 } 773 774 775 } 776 777 if (ShortPriceLinkControl.length != 0) { 778 ShortPriceLinkControl.html(BasketUI.BasketTotalString); 779 } 780 781 if (this.BasketTotalData != null) { 782 var BasketCountControl = $(this.BasketTotalData); 783 784 BasketCountControl.html(BasketUI.BasketTotalString); 785 } 786 787 if (this.RemotePriceID != undefined && this.RemotePriceID != null) { 788 var RemotePriceControl = $(this.RemotePriceID); 789 790 if (RemotePriceControl.length != 0) { 791 RemotePriceControl.html(BasketUI.BasketTotalString); 792 } 793 } 794 795 var SalesItemsCount = BasketUI.SalesItemsCount; //BasketUI.SalesItemsCount; 796 797 if (TableControl.length) { 798 TableControl.find('tbody').empty(); 799 800 for (n = 0; n < BasketUI.BasketItems.length; n++) { 801 var item = BasketUI.BasketItems[n]; 802 803 var row = $('<tr>'); 804 805 TableControl.find('tbody').append(row); 806 807 var cell1 = $('<td>'); 808 809 row.append(cell1); 810 811 if (item.SalesType != 3) { 812 cell1.html('<a href="' + item.ItemLink + '" class="link">' + item.Name + '</a>'); 813 } 814 else { 815 cell1.html(item.Name); 816 } 817 818 var cell2 = $('<td>'); 819 820 row.append(cell2); 821 822 if (item.SalesType != 3) { 823 cell2.html(item.Qty); 824 } 825 else { 826 cell2.html(''); 827 } 828 cell2.attr("align", "right"); 829 830 var cell3 = $('<td>'); 831 row.append(cell3); 832 cell3.html(item.ItemPriceString); 833 cell3.attr("align", "right"); 834 835 var cell4 = $('<td>'); 836 row.append(cell4); 837 if (item.SalesType != 3) { 838 cell4.html('<span onclick="BasketBehaivorObj.RemoveFromBasket(this, \'' + item.uid + '\');" class="remove"></span>'); 839 // SalesItemsCount += item.Qty; 840 } 841 else { 842 cell4.html(''); 843 } 844 cell4.attr("align", "right"); 845 846 if (refreshSpots === true && BasketBehaivorObj.Spots != null) { 847 var spotItem = null; 848 for (var a = 0; a < BasketBehaivorObj.Spots.length; a++) { 849 if (BasketBehaivorObj.Spots[a].Key == item.uid) { 850 spotItem = BasketBehaivorObj.Spots[a]; 851 } 852 } 853 if (spotItem != null && spotItem.Value) { 854 var LinkId = spotItem.Value; 855 var Link = $('#' + LinkId); 856 if (Link.attr('BoughtImageName') != null) { 857 if (BasketBehaivorObj.UseCssForButton == false) { 858 BasketBehaivorObj.UpdateLinkImage(Link.get(0), Link.attr('BoughtImageName')); 859 BasketBehaivorObj.UpdateLinkImage(Link.get(1), Link.attr('BoughtImageName')); 860 } else { 861 Link.className = Link.attr('BoughtImageName'); 862 } 863 864 } 865 } 866 } 867 } 868 869 BasketPanelControl.css('display', (BasketUI.BasketItems.length > 0 ? '' : 'none')); 870 } 871 872 $(this.lnkEmptyBasketId).css('display', (BasketUI.BasketItems.length > 0 ? '' : 'none')); 873 if (this.ShowIfEmpty) { 874 BasketPanelControl.css('display', ''); 875 } 876 877 if (this.EmptyBasketMessageId != null) { 878 var EmptyBasketMessageControl = $(this.EmptyBasketMessageId); 879 880 EmptyBasketMessageControl.css('display', (BasketUI.BasketItems.length > 0 ? 'none' : '')); 881 } 882 883 if (this.BasketCountId != null) { 884 var BasketCountControl = $(this.BasketCountId); 885 886 BasketCountControl.html(SalesItemsCount); 887 } 888 889 890 }, 891
892 GetAndRefreshBasket: function (sender) { 893 toggleDisabled(sender, true); 894 895 var url = "GetBasket"; 896 897 if (this.IsB2B) url = "GetB2BBasket"; 898 899 var BasketData = GetDataFromLocalStorage("BasketUI"); 900 901 if (BasketData != null) { 902 BasketBehaivorObj.RefreshBasket(sender, BasketData, true); 903 } else { 904 this.Proxy.invoke(url, null, 905 function (result) { 906 toggleDisabled(sender, false); 907 if (result.OperationResult != 0) { 908 alert(result.OperationResult); 909 } 910 else { 911 if (BasketBehaivorObj != undefined && BasketBehaivorObj != null) { 912 BasketBehaivorObj.RefreshBasket(sender, result, true); 913 } 914 } 915 }, 916 function (result) { 917 toggleDisabled(sender, false); 918 //alert(result.get_message()); 919 }); 920 } 921 922 923 }, 924 925 GetBasketItems: function (sender) { 926 toggleDisabled(sender, true); 927 928 var url = "GetBasket"; 929 930 if (this.IsB2B) url = "GetB2BBasket" 931 932 this.Proxy.invoke(url, null, 933 function (result) { 934 toggleDisabled(sender, false); 935 if (result.OperationResult != 0) { 936 alert(result.OperationResult); 937 } 938 else { 939 return result.BasketItems; 940 } 941 }, 942 function (result) { 943 toggleDisabled(sender, false); 944 //alert(result.get_message()); 945 }); 946 }, 947 948 RegisterAddSpots: function (SpotsJson) { 949 950 this.Spots = jQuery.parseJSON(SpotsJson); 951 }, 952 953 SetLogin: function (LoginName, PrivateUrl) { 954 var lnkUsernameCtrl = $(this.lnkUsernameId); 955 var lnkEmailCtrl = $(this.lnkEmailId); 956 957 if (lnkUsernameCtrl != null) { 958 lnkUsernameCtrl.html(LoginName); 959 lnkUsernameCtrl.href = PrivateUrl; 960 } 961 962 if (lnkEmailCtrl != null) { 963 lnkEmailCtrl.html(LoginName); 964 lnkEmailCtrl.href = PrivateUrl; 965 } 966 }, 967 968 GetValidQty: function (ID) { 969 var obj = $(ID); 970 971 if (obj == null) { 972 obj = $('ctl00_ctl00_' + ID); 973 } 974 975 if (obj != null) { 976 return obj.val(); 977 } 978 979 return 1; 980 } 981} 982 983/* 984|-------------------------------------------------------------------------- 985| Methods 986|-------------------------------------------------------------------------- 987| 988*/ 989 990 991 992function serviceProxy(n) { 993 var t = this; 994 this.serviceUrl = n; 995 this.invoke = function (n, i, r, u, f) { 996 var e = JSON.stringify(i), 997 o = t.serviceUrl + n; 998 $.ajax({ 999 url: o, 1000 data: e, 1001 type: "POST", 1002 processData: !1, 1003 contentType: "application/json", 1004 timeout: 0, 1005 dataType: "text", 1006 success: function (n) { 1007 var t, i; 1008 if (r) { 1009 if (t = JSON.parse(n), f) { 1010 r(t); 1011 return 1012 } 1013 for (i in t) { 1014 r(t[i]); 1015 break 1016 } 1017 } 1018 }, 1019 error: function (n) { 1020 if (u) { 1021 if (n.responseText) { 1022 var t = JSON.parse(n.responseText); 1023 t ? u(t) : u({ 1024 Message: "Unknown server error." 1025 }) 1026 } 1027 return 1028 } 1029 } 1030 }) 1031 } 1032} 1033 1034function toggleDisabled(n, t) { 1035 var u, i; 1036 if (n != null) { 1037 try { 1038 n.disabled = t != null ? t : n.disabled ? !1 : !0 1039 } catch (r) { 1040 u = r 1041 } 1042 if (n.childNodes && n.childNodes.length > 0) 1043 for (i = 0; i < n.childNodes.length; i++) n.childNodes[i] != null && n.childNodes[i].nodeType == 1 && toggleDisabled(n.childNodes[i], t) 1044 } 1045} 1046 1047function UnobstructiveVS() { 1048 var n, t, e; 1049 translateService.init();
1050 movecalendar(); 1051 activateScrollToTop(); 1052 var o = $("[vs-hover-target]"), 1053 s = $("[vs-toggle-target]"), 1054 h = $("[vs-attachhover-target]"), 1055 c = $("[vs-watermark]"), 1056 l = $("[vs-collapsable-target]"), 1057 i = $("[vs-slider]"), 1058 r = $("[vs-date-input]"), 1059 u = $("[vs-rating-input]"), 1060 f = $("[vs-questionarie]"); 1061 f != null && $.each(f, function (n, t) { 1062 var r = $(t), 1063 i = r.attr("data-vs-questionarie-uid"), 1064 f = r.attr("data-vs-questionarie-type"), 1065 e = param(), 1066 o = e.questdone, 1067 u; 1068 o == "1" ? (u = $("#panelThankYou_" + i), u.show()) : $.ajax({ 1069 url: "LoginService.svc/GetQuestionaireState", 1070 dataType: "json", 1071 data: { 1072 ActiveQuestionaireUid: JSON.stringify(i), 1073 type: f 1074 }, 1075 success: function (n) { 1076 var t; 1077 n.d == 0 && (t = $("#panelQuestions_" + i), t.show()); 1078 n.d == 1 && (t = $("#panelAnswered_" + i), t.show()); 1079 n.d == 2 && (t = $("#panelToLogin_" + i), t.show()) 1080 }, 1081 error: function () { } 1082 }) 1083 }); 1084 $(".ZoomImage").one("click", ZoomImage).css("cursor", "pointer"); 1085 u != null && $.each(u, function (n, t) { 1086 var r = $(t), 1087 i = r.attr("data-vs-rating-length"), 1088 u = r.attr("data-vs-rating-decimalLength"); 1089 i == null && (i = 5); 1090 u == null && (u = 0); 1091 r.jRating({ 1092 length: i, 1093 rateMax: i, 1094 type: "medium", 1095 step: !0, 1096 decimalLength: u, 1097 bigStarsPath: "/Content/icons/stars.png", 1098 smallStarsPath: "/Content/icons/small.png", 1099 mediumStarsPath: "/Content/icons/medium.png", 1100 phpPath: "/EcommerceService.svc/SaveRate", 1101 onSuccess: function (n, t, i) { 1102 alert(i.d.message) 1103 }, 1104 onError: function (n) { 1105 alert(n.message) 1106 } 1107 }) 1108 }); 1109 r != null && $.each(r, function (n, t) { 1110 var i = $(t); 1111 i.kendoDateTimePicker() 1112 }); 1113 i.length != 0 && $.each(i, function (n, t) { 1114 var i = $(t), 1115 r = 5e3, 1116 u = i.attr("data-vs-slider-delay"); 1117 u != null && (r = u); 1118 i.anythingSlider({ 1119 delay: r, 1120 expand: !0, 1121 hashTags: !1, 1122 resumeDelay: 15e3, 1123 autoPlayLocked: !0, 1124 navigationFormatter: function (n) { 1125 return ["", "", "", ""][n - 1] 1126 }, 1127 onInitialized: function (n, t) { 1128 var e = 1e3, 1129 o = 50, 1130 i = 0, 1131 r = 0, 1132 f = "ontouchend" in document, 1133 u = 0, 1134 s = f ? "touchstart" : "mousedown", 1135 h = f ? "touchmove" : "mousemove", 1136 c = f ? "touchend" : "mouseup"; 1137 t.$window.bind(s, function (n) { 1138 r = (new Date).getTime(); 1139 i = n.originalEvent.touches ? n.originalEvent.touches[0].pageX : n.pageX; 1140 u = n.originalEvent.touches ? n.originalEvent.touches[0].pageY : n.pageY 1141 }).bind(c, function () { 1142 r = 0; 1143 i = 0; 1144 u = 0 1145 }).bind(h, function (n) { 1146 var f = n.originalEvent.touches ? n.originalEvent.touches[0].pageX : n.pageX, 1147 h = n.originalEvent.touches ? n.originalEvent.touches[0].pageY : n.pageY, 1148 s = i === 0 ? 0 : Math.abs(f - i), 1149 c = u === 0 ? 0 : Math.abs(h - u), 1150 l = (new Date).getTime(); 1151 c < s && n.preventDefault(); 1152 r !== 0 && l - r < e && s > o && (f < i && t.goForward(), f > i && t.goBack(), r = 0, i = 0) 1153 }) 1154 } 1155 }) 1156 }); 1157 n = $("[data-vs-comments-more-button]"); 1158 n.length != 0 && $.each(n, function (n, t) { 1159 var i = $(t), 1160 f = i.attr("data-vs-comments-number"), 1161 e = i.attr("data-vs-comments-tablename"), 1162 o = i.attr("data-vs-comments-itemUid"), 1163 c = i.attr("data-vs-comments-orderAscending"), 1164 s = i.attr("data-vs-comments-separatorHeight"), 1165 h = i.attr("data-path"), 1166 r = $("~ [data-vs-comments-template]", i), 1167 u = 1; 1168 i.click(function () { 1169 if (r.length == 0) { 1170 alert("Template is missing"); 1171 return 1172 } 1173 var n = parseInt(i.attr("data-vs-comments-page")); 1174 $.ajax({ 1175 url: h + "EcommerceService.svc/GetNextComments", 1176 dataType: "json", 1177 data: { 1178 salesItemUid: JSON.stringify(o), 1179 page: n, 1180 numberComments: f, 1181 orderAscending: !1 1182 }, 1183 success: function (t) { 1184 var f, o; 1185 u = t.d.NbPages; 1186 n < u ? i.attr("data-vs-comments-page", n + 1) : (i.unbind("click"), i.css("display", "none")); 1187 for (f in t.d.Comments) o = GetTemplateData(r, $.makeArray(t.d.Comments[f])), lasttr = $("#" + e + " tr:last"), lasttr.html('<td style="height:' + s + ';"> <\/td>'), lasttr.after('<tr><td valign="top">' + o + "<\/td><\/tr><tr><td> <\/td><\/tr>"), lasttr.next().css("display", "none").show(1e3) 1188 }, 1189 error: function () { } 1190 }) 1191 }) 1192 }); 1193 t = $("[data-vs-autocomplete-search]"); 1194 t.length != 0 && ($.fn.outerHTML = function () { 1195 if ($t = $(this), "outerHTML" in $t[0]) return $t[0].outerHTML; 1196 var n = $t.wrap("<div><\/div>").parent().html(); 1197 return $t.unwrap(), n 1198 }, $.each(t, function (n, t) { 1199 var i = $(t), 1200 f = $("~ [data-vs-autocomplete-search-template]", i), 1201 r = $("~ [data-vs-autocomplete-search-pager-template]", i), 1202 e = i.attr("data-path"), 1203 u; 1204 f.css("display", "none"); 1205 r.css("display", "none"); 1206 i.after("<input type='hidden' id='ACSearchPage' value='1'/>"); 1207 $("#ACSearchPage").val("1"); 1208 u = 1; 1209 i.autocomplete({ 1210 minLength: 3, 1211 select: function () { }, 1212 source: function (n, t) { 1213 var i = $("#ACSearchPage").val(); 1214 $.ajax({ 1215 url: e + "EcommerceService.svc/GetSearchResults", 1216 dataType: "json", 1217 data: { 1218 query: JSON.stringify(n.term), 1219 page: i, 1220 take: 4 1221 }, 1222 success: function (n) { 1223 u = n.d.NbPages; 1224 t(n.d.Products) 1225 }, 1226 error: function () { } 1227 }) 1228 } 1229 }).data("uiAutocomplete")._renderItem = function (n, t) { 1230 return html = GetTemplateData(f, $.makeArray(t)), $("<li>").data("item.autocomplete", t).append(html).appendTo(n) 1231 }; 1232 i.data("uiAutocomplete")._renderMenu = function (n, t) { 1233 var c = this, 1234 o, s, e, f, h; 1235 if ($.each(t, function (t, i) { 1236 c._renderItemData(n, i) 1237 }), r.length && (o = !0, s = r.attr("data-vs-autocomplete-search-pager-maxPages"), s == undefined && (s = u), r.attr("data-vs-autocomplete-search-pager-alwaysShow").toLowerCase() == "false" && (o = !1), o || !o && u > 1)) { 1238 for (html = "", e = 1; e <= Math.min(u, s); e++) f = r.clone(), $("#ACSearchPage").val() != e ? (f.children().attr("onclick", "DoACSearch(this,'" + i.attr("id") + "')"), f.children().attr("data-page", e), f.children().addClass("autoCompleteSearchPage")) : f.children().addClass("autoCompleteSearchActivePage"), f.children().html(f.children().html().replace("#=Page", e)), html += f.html(); 1239 h = r.attr("data-vs-autocomplete-search-pager-bottom"); 1240 html = '<li class="autoCompleteSearchPager">' + html + "<\/li>"; 1241 h != undefined && h.toLowerCase() == "true" ? n.append(html) : n.prepend(html); 1242 $("#ACSearchPage").val("1") 1243 } 1244 }; 1245 i.focus(function () { 1246 if (i.val().length >= i.autocomplete("option", "minLength")) { 1247 var n = i.autocomplete("widget"); 1248 n.children().length == 0 ? i.autocomplete("search", i.val()) : n.css("display", "") 1249 } 1250 }) 1251 })); 1252 e = $("[data-vs-product-preview-container]"); 1253 $.each(e, function (n, t) { 1254 var i = $(t), 1255 u = $("[data-vs-slider-remote]", i); 1256 if (u.length != 0) { 1257 var f = i.attr("data-vs-product-preview-list-uid"), 1258 e = i.attr("data-vs-product-preview-group-uid"), 1259 r = i.attr("data-vs-product-preview-list-item-count"), 1260 o = i.attr("data-vs-product-preview-list-skip-count"), 1261 s = i.attr("data-vs-product-preview-item-uid"), 1262 h = i.attr("data-path"); 1263 $.each(u, function (n, t) { 1264 var u = $(t), 1265 b, y, p, d, g; 1266 $.fn.outerHTML = function () { 1267 if ($t = $(this), "outerHTML" in $t[0]) return $t[0].outerHTML; 1268 var n = $t.wrap("<div><\/div>").parent().html(); 1269 return $t.unwrap(), n 1270 }; 1271 b = $("[data-vs-slider-remote-template]", u); 1272 b.css("display", "none"); 1273 var rt = u.attr("data-vs-slider-remote-vertical") == "true" ? "vertical" : "horizontal", 1274 ut = u.attr("data-vs-slider-remote-speed") != undefined ? parseInt(u.attr("data-vs-slider-remote-speed")) : 1e3, 1275 ft = u.attr("data-vs-slider-remote-navbar"), 1276 a = u.attr("data-vs-slider-remote-image-width"), 1277 v = u.attr("data-vs-slider-remote-image-height"); 1278 a == null && (a = 65); 1279 v == null && (v = 107); 1280 var et = u.attr("data-vs-slider-remote-pager"), 1281 nt = u.attr("data-vs-slider-remote-prevButton"), 1282 tt = u.attr("data-vs-slider-remote-nextButton"), 1283 ot = u.attr("data-vs-slider-remote-disabledClass") == "" ? "ui-state-disabled" : u.attr("data-vs-slider-remote-disabledClass"), 1284 vt = u.attr("data-vs-slider-remote-autoHeight") == "true", 1285 it = u.attr("data-vs-slider-remote-linkPath"); 1286 rt != "vertical" && i.hide(); 1287 y = $(nt, i); 1288 p = $(tt, i); 1289 y.hide(); 1290 p.hide(); 1291 var st = 1e3, 1292 ht = 50, 1293 c = 0, 1294 l = 0, 1295 k = "ontouchend" in document, 1296 w = 0, 1297 ct = k ? "touchstart" : "mousedown", 1298 lt = k ? "touchmove" : "mousemove", 1299 at = k ? "touchend" : "mouseup"; 1300 i.bind(ct, function (n) { 1301 l = (new Date).getTime(); 1302 c = n.originalEvent.touches ? n.originalEvent.touches[0].pageX : n.pageX; 1303 w = n.originalEvent.touches ? n.originalEvent.touches[0].pageY : n.pageY 1304 }).bind(at, function () { 1305 l = 0; 1306 c = 0; 1307 w = 0 1308 }).bind(lt, function (n) { 1309 var t = n.originalEvent.touches ? n.originalEvent.touches[0].pageX : n.pageX, 1310 r = n.originalEvent.touches ? n.originalEvent.touches[0].pageY : n.pageY, 1311 i = c === 0 ? 0 : Math.abs(t - c), 1312 u = w === 0 ? 0 : Math.abs(r - w), 1313 f = (new Date).getTime(); 1314 u < i && n.preventDefault(); 1315 l !== 0 && f - l < st && i > ht && (t < c && p.click(), t > c && y.click(), l = 0, c = 0) 1316 });
1317 d = "EcommerceService.svc/GetProductPreviewList"; 1318 g = { 1319 ListUid: JSON.stringify(f), 1320 GroupUid: JSON.stringify(e), 1321 ItemUid: JSON.stringify(s), 1322 ListBookCount: r, 1323 SkipCount: o, 1324 nImageWidth: a, 1325 nImageHeight: v, 1326 takeWidthHeightAsMaxValues: !0, 1327 linkPath: it 1328 }; 1329 f == null && e == null && (d = "EcommerceService.svc/GetProductPreviewExactList", g = { 1330 ListItemsUids: $.cookie("VisitedCookie"), 1331 ListBookCount: r, 1332 SkipCount: o, 1333 nImageWidth: a, 1334 nImageHeight: v, 1335 takeWidthHeightAsMaxValues: !0, 1336 linkPath: it 1337 }); 1338 u.sliding({ 1339 items: r, 1340 url: h + d, 1341 urlFormat: "{url}?page={page}", 1342 params: g, 1343 speed: ut, 1344 target: ft, 1345 pager: et, 1346 prev: nt, 1347 next: tt, 1348 disabledClass: ot, 1349 onAppend: function (n) { 1350 n = n.d; 1351 u.sliding("setTotalPages", n.NbPages); 1352 n.Products != null && n.Products.length > 0 && i.show(); 1353 n.NbPages > 1 && (y.show(), p.show()); 1354 var t = GetTemplateData(b, n.Products); 1355 return t == "" && (t = "<li><\/li>"), t 1356 } 1357 }); 1358 u.sliding("restart") 1359 }) 1360 } 1361 }); 1362 $.each(s, function (n, t) { 1363 var i = $(t), 1364 r = i.attr("vs-toggle-target"), 1365 u = $(r); 1366 i.click(function () { 1367 u.slideToggle("slow") 1368 }) 1369 }); 1370 $.each(o, function (n, t) { 1371 var i = $(t), 1372 r = i.attr("vs-hover-target"), 1373 u = $(r); 1374 i.hoverIntent(function () { 1375 onHoverInHandle(i) 1376 }, function () { 1377 onHoverOutHandle(i) 1378 }); 1379 u.hover(function () { 1380 onHoverInHandle(i) 1381 }, function () { 1382 onHoverOutHandle(i) 1383 }) 1384 }); 1385 $.each(h, function (n, t) { 1386 var r = $(t), 1387 u = r.attr("vs-attachhover-target"), 1388 i = $(u); 1389 i.attr("vs-hover-target", "#" + r.attr("id")); 1390 i.attr("vs-hover-position", r.attr("vs-attachhover-position")); 1391 i.attr("vs-hover-offsetX", r.attr("vs-attachhover-offsetX")); 1392 i.attr("vs-hover-offsetY", r.attr("vs-attachhover-offsetY")); 1393 i.attr("vs-hover-use-offset", r.attr("vs-attachhover-use-offset")); 1394 i.hoverIntent(function () { 1395 onHoverInHandle(i) 1396 }, function () { 1397 onHoverOutHandle(i) 1398 }); 1399 r.hover(function () { 1400 onHoverInHandle(i) 1401 }, function () { 1402 onHoverOutHandle(i) 1403 }) 1404 }); 1405 $.each(l, function (n, t) { 1406 var i = $(t), 1407 u = i.attr("vs-collapsable-target"), 1408 r = $(u), 1409 f = i.attr("vs-collapsable-collapsed"), 1410 e = i.attr("vs-collapsable-disable-input"); 1411 isTrue(f) && (r.hide(), e && DisableEnableInputs(r, !1)); 1412 i.click(function () { 1413 var t = i.attr("vs-collapsable-collapsed"), 1414 n = i.attr("vs-collapsable-disable-input"); 1415 isTrue(t) ? (r.show(300, "linear"), i.attr("vs-collapsable-collapsed", !1), n && DisableEnableInputs(r, !0)) : (r.hide(300, "linear"), i.attr("vs-collapsable-collapsed", !0), n && DisableEnableInputs(r, !1)) 1416 }) 1417 }); 1418 // $(window).bind("orientationchange", resizeWrapper); 1419 // $(window).bind("resize", resizeWrapper) 1420} 1421 1422function movecalendar() { 1423 var n = $("#news-container"), 1424 t, i; 1425 n.length > 0 && (t = n.scrollTop() + 215, i = "doscrollcalendar(" + t + ");", window.setTimeout(i, 30)) 1426} 1427 1428function doscrollcalendar(n) { 1429 var t = $("#news-container"), 1430 i = t.scrollTop(), 1431 r; 1432 i < n ? (t.scrollTop(i + 6), r = "doscrollcalendar(" + n + ");", window.setTimeout(r, 30)) : t[0].scrollHeight - (t.scrollTop() + 215) < 10 ? (t.scrollTop(0), window.setTimeout("movecalendar(
1432);", 1)) : window.setTimeout("movecalendar();", 5e3) 1433} 1434 1435function activateScrollToTop() { 1436 var n = $(".scrollup"); 1437 n != null && ($(window).scroll(function () { 1438 $(this).scrollTop() > 100 ? n.fadeIn() : n.fadeOut() 1439 }), n.click(function () { 1440 return $("html, body").animate({ 1441 scrollTop: 0 1442 }, 600), !1 1443 })) 1444} 1445 1446function ZoomImage() { 1447 var n = $(this), 1448 t = n.children("img"), 1449 o, i, r; 1450 if (n.attr("data-zoom-loaded") != "true") { 1451 var u = t.width(), 1452 f = t.height(), 1453 e = t.position(), 1454 s = e.top, 1455 h = e.left; 1456 n.attr("data-zoom-image-width", u); 1457 n.attr("data-zoom-image-height", f); 1458 n.attr("data-zoom-image-top", s); 1459 n.attr("data-zoom-image-left", h); 1460 var c = n.attr("data-zoom-uid"), 1461 l = n.attr("data-zoom-name"), 1462 a = n.attr("data-zoom-timestpamp"), 1463 zxa = n.attr("data-zoom-type"), 1464 v = new serviceProxy("/EcommerceService.svc/"), 1465 y = v.invoke("GetImageUrl", { 1466 Uid: c, 1467 Name: l, 1468 TimeStampObject: a, 1469 ImageType: zxa, 1470 width: null, 1471 height: null, 1472 type: null, 1473 skipoverlay: !1 1474 }, function (i) { 1475 n.attr("data-zoom-loaded", !0); 1476 var r = $('<img style="display:none;" />'); 1477 n.append(r); 1478 r.attr("src", i).imagesLoaded(function () { 1479 var i = r.width(), 1480 e = r.height(); 1481 n.attr("data-zoom-image-new-width", i); 1482 n.attr("data-zoom-image-new-height", e); 1483 r.width(u); 1484 r.height(f); 1485 r.css("display", ""); 1486 t.css("display", "none"); 1487 t.remove(); 1488 n.width(u); 1489 n.height(f); 1490 n.css("position", ""); 1491 n.css("display", "block"); 1492 r.css("position", "absolute"); 1493 r.css("z-index", "10001"); 1494 r.animate({ 1495 width: i, 1496 height: e 1497 }, 600, function () { 1498 r.css("box-shadow", "0 0 35px #3f3f3f") 1499 }); 1500 n.attr("data-zoom-visible", !0); 1501 $(".ZoomImage").one("click", ZoomImage) 1502 }) 1503 }) 1504 } else o = n.attr("data-zoom-visible"), o == "true" ? (n.attr("data-zoom-visible", !1), i = n.attr("data-zoom-image-width"), r = n.attr("data-zoom-image-height"), t.css("box-shadow", ""), t.animate({ 1505 width: i, 1506 height: r 1507 }, 600, function () { 1508 $(".ZoomImage").one("click", ZoomImage) 1509 })) : (i = n.attr("data-zoom-image-new-width"), r = n.attr("data-zoom-image-new-height"), t.animate({ 1510 width: i, 1511 height: r 1512 }, 600, function () { 1513 t.css("box-shadow", "0 0 35px #3f3f3f"); 1514 $(".ZoomImage").one("click", ZoomImage) 1515 }), n.attr("data-zoom-visible", !0)) 1516} 1517 1518function onHoverInHandle(n) { 1519 var t = n.attr("_hoverCount"), 1520 i = n.attr("_hoverFired"), 1521 e, r; 1522 if (i == null && (i = !1), t == null && (t = 0), t++, n.attr("_hoverCount", t), t && !isTrue(i)) { 1523 e = n.attr("vs-hover-use-offset"); 1524 r = n.position(); 1525 e && (r = n.offset()); 1526 var c = n.outerWidth(), 1527 l = n.outerHeight(), 1528 a = n.attr("vs-hover-target"), 1529 o = n.attr("vs-hover-position"), 1530 s = n.attr("vs-hover-offsetX"), 1531 h = n.attr("vs-hover-offsetY"), 1532 v = $(a), 1533 u = 0, 1534 f = 0; 1535 u = r.top; 1536 f = r.left; 1537 o == "right" && (f += c); 1538 o == "bottom" && (u += l); 1539 h != null && (u += parseInt(h)); 1540 s != null && (f += parseInt(s)); 1541 v.css({ 1542 position: "absolute", 1543 top: u + "px", 1544 left: f + "px" 1545 }).fadeIn(); 1546 i = !0; 1547 n.attr("_hoverFired", i) 1548 } 1549} 1550 1551function onHoverOutHandle(n) { 1552 var t = n.attr("_hoverCount"), 1553 i = n.attr("_hoverFired"),
1554 r, u; 1555 t--; 1556 n.attr("_hoverCount", t); 1557 t <= 0 && isTrue(i) && !t && (i = !1, n.attr("_hoverFired", i), r = n.attr("vs-hover-target"), u = $(r), u.fadeOut()) 1558} 1559 1560function isTrue(n) { 1561 return typeof n == "string" ? n.toLowerCase() == "true" : !!n 1562} 1563 1564// function resizeWrapper() { 1565// window.clearTimeout(resizeTimeout); 1566// resizeTimeout = window.setTimeout(function () { 1567// var n = $("[vs-slider]"); 1568// $.each(n, function (n, t) { 1569// var i = $(t); 1570// console.log("resizeWrapper"); 1571// i.anythingSlider() 1572// }) 1573// }, 300) 1574// } 1575 1576function ShowAddComment(n) { 1577 return LoginBehaivorObj != null && LoginBehaivorObj.IsLoggedIn ? ($(n).show(), location.hash = "#addcomment") : alert("Morate biti logovani."), !1 1578} 1579 1580function AddComment(n, t, i, r, u, f) { 1581 var o = $(i), 1582 e = $(r), 1583 s; 1584 toggleDisabled(e, !0); 1585 s = new serviceProxy("/EcommerceService.svc/"); 1586 s.invoke("AddComment", { 1587 SalesItemUid: t, 1588 Comment: o.val() 1589 }, function() { 1590 e.hide(); 1591 o.val(""); 1592 toggleDisabled(e, !1); 1593 alert(u) 1594 }, function() { 1595 toggleDisabled(e, !1); 1596 alert(f) 1597 }) 1598} 1599 1600function CancelCommentAdd(n, t) { 1601 $(t).hide() 1602} 1603 1604function AddBackOrderRequest(n, t, i, r, u) { 1605 var f = $(i), 1606 e = f.val(), 1607 o; 1608 e == "" || validateEmail(e) == !1 ? alert("Proverite da li ste uneli ispravnu e-mail adresu.") : (o = new serviceProxy("/EcommerceService.svc/"), o.invoke("AddBackOrderRequest", { 1609 SalesItemUid: t, 1610 eMail: e 1611 }, function() { 1612 f.val(""); 1613 f.parent().hide(); 1614 alert(r) 1615 }, function() { 1616 alert(u) 1617 })) 1618} 1619function validateEmail(n) { 1620 return 1; 1621} 1622 1623function GetTemplateData(n, t) { 1624 var g = "data-", 1625 a = "#=Item.", 1626 v = "(", 1627 nt = ")", 1628 tt = "", 1629 y, e, p, o, it, s, r, u, rt, ut, f, i; 1630 if (t != null && t.length > 0) { 1631 for (y = "", e = 0; e < n[0].attributes.length; e++) 1632 if (n[0].attributes[e].name.indexOf("template") != -1) { 1633 y = n[0].attributes[e].name; 1634 break 1635 } 1636 for (p = $("*", n), iProd = 0; iProd < t.length; iProd++) { 1637 for (o = n.clone(), o.removeAttr(y), o.css("display", ""), it = $("*", o), s = 0; s < p.length; s++) { 1638 for (childTemplate = $(p[s]), childInstance = $(it[s]), r = childTemplate[0].attributes, u = 0; u < $(r).length; u++) 1639 if (rt = r[u].name.indexOf(g), ut = r[u].value.indexOf(a), rt !== -1 && ut !== -1) { 1640 var h = r[u].name.substring(g.length), 1641 i = r[u].value.substring(a.length), 1642 w = ""; 1643 if ($.inArray(h, r) && childInstance.attr(h) != "" && (w = childInstance.attr(h)), i.indexOf(v) != -1) { 1644 var c = i.indexOf(v), 1645 b = i.indexOf(nt), 1646 k = i.substring(c + 1, b); 1647 i = i.substring(0, c); 1648 var l = t[iProd][i].substring(0, k), 1649 d = l.lastIndexOf(" "), 1650 f = l.substring(0, d + 1) + "..."; 1651 childInstance.attr(h, f ? f : w) 1652 } else f = t[iProd][i], childInstance.attr(h, f ? f : w); 1653 childInstance.removeAttr(r[u].name) 1654 } 1655 if (content = childTemplate.html(), content != "" && content.indexOf(a) !== -1) 1656 if (i = content.substring(a.length), i.indexOf(v) != -1) { 1657 var c = i.indexOf(v), 1658 b = i.indexOf(nt), 1659 k = i.substring(c + 1, b); 1660 i = i.substring(0, c); 1661 var l = t[iProd][i].substring(0, k), 1662 d = l.lastIndexOf(" "), 1663 f = l.substring(0, d + 1) + "..."; 1664 childInstance.html(f) 1665 } else childInstance.html(t[iProd][i]) 1666 } 1667 tt += o.outerHTML() 1668 } 1669 } 1670 return tt 1671} 1672 1673function DoACSearch(n, t) { 1674 element = $("#" + t); 1675 $("#ACSearchPage").val($(n).attr("data-page")); 1676 element.autocomplete("search", element.val()) 1677} 1678 1679/* WISHLIST BEHAIVOR */ 1680 1681WishListBehaivorObj = null; 1682WishBehaivor = function(n, t, i, r, u) { 1683 this.WishPanelControlId = n; 1684 this.WishTablePaneControlId = t; 1685 this.ProductColumnTitle = i; 1686 this.Spots = []; 1687 this.DeleteMessage = r; 1688 this.Proxy = new serviceProxy(u) 1689}; 1690WishBehaivor.prototype = { 1691 UpdateLinkImage: function(n, t) { 1692 if (n != null && t != null) { 1693 var i = n.getElementsByTagName("img")[0], 1694 r = ""; 1695 i != null && (r = i.src.substring(0, i.src.lastIndexOf("/") + 1), i.src = r + t) 1696 } 1697 }, 1698 AddToWishList: function(n, t, i, r, u) { 1699 toggleDisabled(n, !0); 1700 this.UpdateLinkImage(n, r); 1701 this.Proxy.invoke("AddToWishList", { 1702 SalesItemUid: t 1703 }, function(i) { 1704 if (toggleDisabled(n, !1), i.OperationResult != 0) i.OperationResult == 2 ? alert(i.ResultMessage) : alert(i.OperationResult); 1705 else if (WishListBehaivorObj != undefined && WishListBehaivorObj != null) { 1706 WishListBehaivorObj.RefreshWishList(n, i); 1707 WishListBehaivorObj.UpdateLinkImage(n, u); 1708 var r = {}; 1709 r.Key = t; 1710 r.Value = n.id; 1711 WishListBehaivorObj.Spots.push(r); 1712 alert('Proizvod dodat u listu želja.'); 1713 } 1714 }, function() { 1715 toggleDisabled(n, !1) 1716 }) 1717 }, 1718 RemoveFromWishList: function(n, t) { 1719 confirm(this.DeleteMessage) && (toggleDisabled(n, !0), this.Proxy.invoke("RemoveFromWishList", { 1720 SalesItemUid: t 1721 }, function(i) { 1722 var r, f, u; 1723 if (toggleDisabled(n, !1), i.OperationResult != 0) i.OperationResult == 2 ? alert(i.ResultMessage) : alert(i.OperationResult); 1724 else if (WishListBehaivorObj != undefined && WishListBehaivorObj != null && (WishListBehaivorObj.RefreshWishList(n, i), WishListBehaivorObj.Spots != null)) 1725 for (r = 0; r < WishListBehaivorObj.Spots.length; r++) WishListBehaivorObj.Spots[r].Key == t && (f = WishListBehaivorObj.Spots[r].Value, WishListBehaivorObj.Spots.splice(r, 1), u = $("#" + f), u.attr("OriginalImgName") != null && WishListBehaivorObj.UpdateLinkImage(u, u.attr("OriginalImgName"))) 1726 }, function() { 1727 toggleDisabled(n, !1) 1728 })) 1729 }, 1730 RefreshWishList: function(t, i) { 1731 var y = $(this.WishPanelControlId), 1732 p = $(this.WishTablePaneControlId), 1733 a = this.WishTablePaneControlId + "_table", 1734 r = $(a), 1735 s, e, h, v, c, u, o, l, f; 1736 for (r.length == 0 && (r = $("<TABLE />"), r.attr("id", a.replace("#", "")), s = $("<THEAD />"), r.append(s), e = $("<TR/>"), s.append(e), h = $("<TH />"), h.html(this.ProductColumnTitle), e.append(h), v = $("<TH/>"), e.append(v), r.append("<tbody/>"), p.append(r)), c = r.find("tbody"), c.empty(), n = 0; n < i.WishItems.length; n++) u = i.WishItems[n], o = $("<tr/>"), c.append(o), l = $("<td/>"), o.append(l), l.html('<a href="' + u.ItemLink + '">' + u.Name + "<\/a>"), f = $("<td/>"), o.append(f), u.SalesType != 3 ? f.html("<a onclick=\"WishListBehaivorObj.RemoveFromWishList(this, '" + u.uid + '\');" class="remove"/>') : f.html(""), f.attr("align", "right"); 1737 y.css("display", i.WishItems.length > 0 ? "" : "none") 1738 }, 1739 GetAndRefreshWishList: function(n) { 1740 var t = $(this.WishTablePaneControlId); 1741 t.length > 0 && (toggleDisabled(n, !0), this.Proxy.invoke("GetWishList", null, function(t) { 1742 toggleDisabled(n, !1); 1743 t.OperationResult != 0 ? t.OperationResult == 1 && alert(t.OperationResult) : WishListBehaivorObj != undefined && WishListBehaivorObj != null && WishListBehaivorObj.RefreshWishList(n, t) 1744 }, function() { 1745 toggleDisabled(n, !1) 1746 })) 1747 }, 1748 RegisterAddSpots: function(n) { 1749 this.Spots = jQuery.parseJSON(n) 1750 } 1751}; 1752WishListBehaivorObj = new WishBehaivor("#pnlWishList", "#pnlWishListTable", "Proizvod", "Želite da obrišete?", "/EcommerceService.svc/"); 1753$(function() { 1754 WishListBehaivorObj.GetAndRefreshWishList(); 1755}) 1756 1757 1758 1759/* 1760|-------------------------------------------------------------------------- 1761| Coockie concent 1762|-------------------------------------------------------------------------- 1763| 1764*/ 1765 1766!function (e) { if (!e.hasInitialised) { var t = { escapeRegExp: function (e) { return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&") }, hasClass: function (e, t) { var i = " "; return 1 === e.nodeType && (i + e.className + i).replace(/[\n\t]/g, i).indexOf(i + t + i) >= 0 }, addClass: function (e, t) { e.className += " " + t }, removeClass: function (e, t) { var i = new RegExp("\\b" + this.escapeRegExp(t) + "\\b"); e.className = e.className.replace(i, "") }, interpolateString: function (e, t) { var i = /{{([a-z][a-z0-9\-_]*)}}/gi; return e.replace(i, function (e) { return t(arguments[1]) || "" }) }, getCookie: function (e) { var t = "; " + document.cookie, i = t.split("; " + e + "="); return i.length < 2 ? void 0 : i.pop().split(";").shift() }, setCookie: function (e, t, i, n, o, s) { var r = new Date; r.setDate(r.getDate() + (i || 365));
1766 var a = [e + "=" + t, "expires=" + r.toUTCString(), "path=" + (o || "/")]; n && a.push("domain=" + n), s && a.push("secure"), document.cookie = a.join(";") }, deepExtend: function (e, t) { for (var i in t) t.hasOwnProperty(i) && (i in e && this.isPlainObject(e[i]) && this.isPlainObject(t[i]) ? this.deepExtend(e[i], t[i]) : e[i] = t[i]); return e }, throttle: function (e, t) { var i = !1; return function () { i || (e.apply(this, arguments), i = !0, setTimeout(function () { i = !1 }, t)) } }, hash: function (e) { var t, i, n, o = 0; if (0 === e.length) return o; for (t = 0, n = e.length; t < n; ++t)i = e.charCodeAt(t), o = (o << 5) - o + i, o |= 0; return o }, normaliseHex: function (e) { return "#" == e[0] && (e = e.substr(1)), 3 == e.length && (e = e[0] + e[0] + e[1] + e[1] + e[2] + e[2]), e }, getContrast: function (e) { e = this.normaliseHex(e); var t = parseInt(e.substr(0, 2), 16), i = parseInt(e.substr(2, 2), 16), n = parseInt(e.substr(4, 2), 16), o = (299 * t + 587 * i + 114 * n) / 1e3; return o >= 128 ? "#000" : "#fff" }, getLuminance: function (e) { var t = parseInt(this.normaliseHex(e), 16), i = 38, n = (t >> 16) + i, o = (t >> 8 & 255) + i, s = (255 & t) + i, r = (16777216 + 65536 * (n < 255 ? n < 1 ? 0 : n : 255) + 256 * (o < 255 ? o < 1 ? 0 : o : 255) + (s < 255 ? s < 1 ? 0 : s : 255)).toString(16).slice(1); return "#" + r }, isMobile: function () { return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) }, isPlainObject: function (e) { return "object" == typeof e && null !== e && e.constructor == Object }, traverseDOMPath: function (e, i) { return e && e.parentNode ? t.hasClass(e, i) ? e : this.traverseDOMPath(e.parentNode, i) : null } }; e.status = { deny: "deny", allow: "allow", dismiss: "dismiss" }, e.transitionEnd = function () { var e = document.createElement("div"), t = { t: "transitionend", OT: "oTransitionEnd", msT: "MSTransitionEnd", MozT: "transitionend", WebkitT: "webkitTransitionEnd" }; for (var i in t) if (t.hasOwnProperty(i) && "undefined" != typeof e.style[i + "ransition"]) return t[i]; return "" }(), e.hasTransition = !!e.transitionEnd; var i = Object.keys(e.status).map(t.escapeRegExp); e.customStyles = {}, e.Popup = function () { function n() { this.initialise.apply(this, arguments) } function o(e) { this.openingTimeout = null, t.removeClass(e, "cc-invisible") } function s(t) { t.style.display = "none", t.removeEventListener(e.transitionEnd, this.afterTransition), this.afterTransition = null } function r() { var t = this.options.onInitialise.bind(this); if (!window.navigator.cookieEnabled) return t(e.status.deny), !0; if (window.CookiesOK || window.navigator.CookiesOK) return t(e.status.allow), !0; var i = Object.keys(e.status), n = this.getStatus(), o = i.indexOf(n) >= 0; return o && t(n), o } function a() { var e = this.options.position.split("-"), t = []; return e.forEach(function (e) { t.push("cc-" + e) }), t } function c() { var e = this.options, i = "top" == e.position || "bottom" == e.position ? "banner" : "floating"; t.isMobile() && (i = "floating"); var n = ["cc-" + i, "cc-type-" + e.type, "cc-theme-" + e.theme]; e["static"] && n.push("cc-static"), n.push.apply(n, a.call(this)); p.call(this, this.options.palette); return this.customStyleSelector && n.push(this.customStyleSelector), n } function l() { var e = {}, i = this.options; i.showLink || (i.elements.link = "", i.elements.messagelink = i.elements.message), Object.keys(i.elements).forEach(function (n) { e[n] = t.interpolateString(i.elements[n], function (e) { var t = i.content[e]; return e && "string" == typeof t && t.length ? t : "" }) }); var n = i.compliance[i.type]; n || (n = i.compliance.info), e.compliance = t.interpolateString(n, function (t) { return e[t] }); var o = i.layouts[i.layout]; return o || (o = i.layouts.basic), t.interpolateString(o, function (t) { return e[t] }) } function u(i) { var n = this.options, o = document.createElement("div"), s = n.container && 1 === n.container.nodeType ? n.container : document.body; o.innerHTML = i; var r = o.children[0]; return r.style.display = "none", t.hasClass(r, "cc-window") && e.hasTransition && t.addClass(r, "cc-invisible"), this.onButtonClick = h.bind(this), r.addEventListener("click", this.onButtonClick), n.autoAttach && (s.firstChild ? s.insertBefore(r, s.firstChild) : s.appendChild(r)), r } function h(n) { var o = t.traverseDOMPath(n.target, "cc-btn") || n.target; if (t.hasClass(o, "cc-btn")) { var s = o.className.match(new RegExp("\\bcc-(" + i.join("|") + ")\\b")), r = s && s[1] || !1; r && (this.setStatus(r), this.close(!0)) } t.hasClass(o, "cc-close") && (this.setStatus(e.status.dismiss), this.close(!0)), t.hasClass(o, "cc-revoke") && this.revokeChoice() } function p(e) { var i = t.hash(JSON.stringify(e)), n = "cc-color-override-" + i, o = t.isPlainObject(e); return this.customStyleSelector = o ? n : null, o && d(i, e, "." + n), o } function d(i, n, o) { if (e.customStyles[i]) return void ++e.customStyles[i].references; var s = {}, r = n.popup, a = n.button, c = n.highlight; r && (r.text = r.text ? r.text : t.getContrast(r.background), r.link = r.link ? r.link : r.text, s[o + ".cc-window"] = ["color: " + r.text, "background-color: " + r.background], s[o + ".cc-revoke"] = ["color: " + r.text, "background-color: " + r.background], s[o + " .cc-link," + o + " .cc-link:active," + o + " .cc-link:visited"] = ["color: " + r.link], a && (a.text = a.text ? a.text : t.getContrast(a.background), a.border = a.border ? a.border : "transparent", s[o + " .cc-btn"] = ["color: " + a.text, "border-color: " + a.border, "background-color: " + a.background], a.padding && s[o + " .cc-btn"].push("padding: " + a.padding), "transparent" != a.background && (s[o + " .cc-btn:hover, " + o + " .cc-btn:focus"] = ["background-color: " + (a.hover || v(a.background))]), c ? (c.text = c.text ? c.text : t.getContrast(c.background), c.border = c.border ? c.border : "transparent", s[o + " .cc-highlight .cc-btn:first-child"] = ["color: " + c.text, "border-color: " + c.border, "background-color: " + c.background]) : s[o + " .cc-highlight .cc-btn:first-child"] = ["color: " + r.text])); var l = document.createElement("style"); document.head.appendChild(l), e.customStyles[i] = { references: 1, element: l.sheet }; var u = -1; for (var h in s) s.hasOwnProperty(h) && l.sheet.insertRule(h + "{" + s[h].join(";") + "}", ++u) } function v(e) { return e = t.normaliseHex(e), "000000" == e ? "#222" : t.getLuminance(e) } function f(i) { if (t.isPlainObject(i)) { var n = t.hash(JSON.stringify(i)), o = e.customStyles[n]; if (o && !--o.references) { var s = o.element.ownerNode; s && s.parentNode && s.parentNode.removeChild(s), e.customStyles[n] = null } } } function m(e, t) { for (var i = 0, n = e.length; i < n; ++i) { var o = e[i]; if (o instanceof RegExp && o.test(t) || "string" == typeof o && o.length && o === t) return !0 } return !1 } function b() { var i = this.setStatus.bind(this), n = this.close.bind(this), o = this.options.dismissOnTimeout; "number" == typeof o && o >
vendor: 10,324 bytes, line 1766
1766= 0 && (this.dismissTimeout = window.setTimeout(function () { i(e.status.dismiss), n(!0) }, Math.floor(o))); var s = this.options.dismissOnScroll; if ("number" == typeof s && s >= 0) { var r = function (t) { window.pageYOffset > Math.floor(s) && (i(e.status.dismiss), n(!0), window.removeEventListener("scroll", r), this.onWindowScroll = null) }; this.options.enabled && (this.onWindowScroll = r, window.addEventListener("scroll", r)) } var a = this.options.dismissOnWindowClick, c = this.options.ignoreClicksFrom; if (a) { var l = function (o) { for (var s = !1, r = o.path.length, a = c.length, u = 0; u < r; u++)if (!s) for (var h = 0; h < a; h++)s || (s = t.hasClass(o.path[u], c[h])); s || (i(e.status.dismiss), n(!0), window.removeEventListener("click", l), this.onWindowClick = null) }.bind(this); this.options.enabled && (this.onWindowClick = l, window.addEventListener("click", l)) } } function g() { if ("info" != this.options.type && (this.options.revokable = !0), t.isMobile() && (this.options.animateRevokable = !1), this.options.revokable) { var e = a.call(this); this.options.animateRevokable && e.push("cc-animate"), this.customStyleSelector && e.push(this.customStyleSelector); var i = this.options.revokeBtn.replace("{{classes}}", e.join(" ")).replace("{{policy}}", this.options.content.policy); this.revokeBtn = u.call(this, i); var n = this.revokeBtn; if (this.options.animateRevokable) { var o = t.throttle(function (e) { var i = !1, o = 20, s = window.innerHeight - 20; t.hasClass(n, "cc-top") && e.clientY < o && (i = !0), t.hasClass(n, "cc-bottom") && e.clientY > s && (i = !0), i ? t.hasClass(n, "cc-active") || t.addClass(n, "cc-active") : t.hasClass(n, "cc-active") && t.removeClass(n, "cc-active") }, 200); this.onMouseMove = o, window.addEventListener("mousemove", o) } } } var y = { enabled: !0, container: null, cookie: { name: "cookieconsent_status", path: "/", domain: "", expiryDays: 365, secure: !1 }, onPopupOpen: function () { }, onPopupClose: function () { }, onInitialise: function (e) { }, onStatusChange: function (e, t) { }, onRevokeChoice: function () { }, onNoCookieLaw: function (e, t) { }, content: { header: "Cookies used on the website!", message: "This website uses cookies to ensure you get the best experience on our website.", dismiss: "Got it!", allow: "Allow cookies", deny: "Decline", link: "Learn more", href: "https://cookiesandyou.com", close: "❌", target: "_blank", policy: "Cookie Policy" }, elements: { header: '<span class="cc-header">{{header}}</span> ', message: '<span id="cookieconsent:desc" class="cc-message">{{message}}</span>', messagelink: '<span id="cookieconsent:desc" class="cc-message">{{message}} <a aria-label="learn more about cookies" role=button tabindex="0" class="cc-link" href="{{href}}" rel="noopener noreferrer nofollow" target="{{target}}">{{link}}</a></span>', dismiss: '<a aria-label="dismiss cookie message" role=button tabindex="0" class="cc-btn cc-dismiss">{{dismiss}}</a>', allow: '<a aria-label="allow cookies" role=button tabindex="0" class="cc-btn cc-allow">{{allow}}</a>', deny: '<a aria-label="deny cookies" role=button tabindex="0" class="cc-btn cc-deny">{{deny}}</a>', link: '<a aria-label="learn more about cookies" role=button tabindex="0" class="cc-link" href="{{href}}" rel="noopener noreferrer nofollow" target="{{target}}">{{link}}</a>', close: '<span aria-label="dismiss cookie message" role=button tabindex="0" class="cc-close">{{close}}</span>' }, window: '<div role="dialog" aria-live="polite" data-nosnippet="data-nosnippet" aria-label="cookieconsent" aria-describedby="cookieconsent:desc" class="cc-window {{classes}}"><!--googleoff: all-->{{children}}<!--googleon: all--></div>', revokeBtn: '<div class="cc-revoke {{classes}}">{{policy}}</div>', compliance: { info: '<div class="cc-compliance">{{dismiss}}</div>', "opt-in": '<div class="cc-compliance cc-highlight">{{deny}}{{allow}}</div>', "opt-out": '<div class="cc-compliance cc-highlight">{{deny}}{{allow}}</div>' }, type: "info", layouts: { basic: "{{messagelink}}{{compliance}}", "basic-close": "{{messagelink}}{{compliance}}{{close}}", "basic-header": "{{header}}{{message}}{{link}}{{compliance}}" }, layout: "basic", position: "bottom", theme: "block", "static": !1, palette: null, revokable: !1, animateRevokable: !0, showLink: !0, dismissOnScroll: !1, dismissOnTimeout: !1, dismissOnWindowClick: !1, ignoreClicksFrom: ["cc-revoke", "cc-btn"], autoOpen: !0, autoAttach: !0, whitelistPage: [], blacklistPage: [], overrideHTML: null }; return n.prototype.initialise = function (e) { this.options && this.destroy(), t.deepExtend(this.options = {}, y), t.isPlainObject(e) && t.deepExtend(this.options, e), r.call(this) && (this.options.enabled = !1), m(this.options.blacklistPage, location.pathname) && (this.options.enabled = !1), m(this.options.whitelistPage, location.pathname) && (this.options.enabled = !0); var i = this.options.window.replace("{{classes}}", c.call(this).join(" ")).replace("{{children}}", l.call(this)), n = this.options.overrideHTML; if ("string" == typeof n && n.length && (i = n), this.options["static"]) { var o = u.call(this, '<div class="cc-grower">' + i + "</div>"); o.style.display = "", this.element = o.firstChild, this.element.style.display = "none", t.addClass(this.element, "cc-invisible") } else this.element = u.call(this, i); b.call(this), g.call(this), this.options.autoOpen && this.autoOpen() }, n.prototype.destroy = function () { this.onButtonClick && this.element && (this.element.removeEventListener("click", this.onButtonClick), this.onButtonClick = null), this.dismissTimeout && (clearTimeout(this.dismissTimeout), this.dismissTimeout = null), this.onWindowScroll && (window.removeEventListener("scroll", this.onWindowScroll), this.onWindowScroll = null), this.onWindowClick && (window.removeEventListener("click", this.onWindowClick), this.onWindowClick = null), this.onMouseMove && (window.removeEventListener("mousemove", this.onMouseMove), this.onMouseMove = null), this.element && this.element.parentNode && this.element.parentNode.removeChild(this.element), this.element = null, this.revokeBtn && this.revokeBtn.parentNode && this.revokeBtn.parentNode.removeChild(this.revokeBtn), this.revokeBtn = null, f(this.options.palette), this.options = null }, n.prototype.open = function (t) { if (this.element) return this.isOpen() || (e.hasTransition ? this.fadeIn() : this.element.style.display = "", this.options.revokable && this.toggleRevokeButton(), this.options.onPopupOpen.call(this)), this }, n.prototype.close = function (t) { if (this.element) return this.isOpen() && (e.hasTransition ? this.fadeOut() : this.element.style.display = "none", t && this.options.revokable && this.toggleRevokeButton(!0), this.options.onPopupClose.call(this)), this }, n.prototype.fadeIn = function () { var i = this.element; if (e.hasTransition && i && (this.afterTransition && s.call(this, i), t.hasClass(i, "cc-invisible"))) { if (i.style.display = "", this.options["static"]) { var n = this.element.clientHeight; this.element.parentNode.style.maxHeight = n + "px" } var r = 20; this.openingTimeout = setTimeout(o.bind(this, i), r) } }, n.prototype.fadeOut = function () { var i = this.element; e.hasTransition && i && (this.openingTimeout && (clearTimeout(this.openingTimeout), o.bind(this, i)), t.hasClass(i, "cc-invisible") || (this.options["static"] && (this.element.parentNode.style.maxHeight = ""), this.afterTransition = s.bind(this, i), i.addEventListener(e.transitionEnd, this.afterTransition), t.addClass(i, "cc-invisible"))) }, n.prototype.isOpen = function () { return this.element && "" == this.element.style.display && (!e.hasTransition || !t.hasClass(this.element, "cc-invisible")) }, n.prototype.toggleRevokeButton = function (e) { this.revokeBtn && (this.revokeBtn.style.display = e ? "" : "none") }, n.prototype.revokeChoice = function (e) { this.options.enabled = !0, this.clearStatus(), this.options.onRevokeChoice.call(this), e || this.autoOpen() }, n.prototype.hasAnswered = function (t) { return Object.keys(e.status).indexOf(this.getStatus()) >= 0 }, n.prototype.hasConsented = function (t) { var i = this.getStatus(); return i == e.status.allow || i == e.status.dismiss }, n.prototype.autoOpen = function (e) { !this.hasAnswered() && this.options.enabled ? this.open() : this.hasAnswered() && this.options.revokable && this.toggleRevokeButton(!0) }, n.prototype.setStatus = function (i) { var n = this.options.cookie, o = t.getCookie(n.name), s = Object.keys(e.status).indexOf(o) >= 0; Object.keys(e.status).indexOf(i) >= 0 ? (t.setCookie(n.name, i, n.expiryDays, n.domain, n.path, n.secure), this.options.onStatusChange.call(this, i, s)) : this.clearStatus() }, n.prototype.getStatus = function () { return t.getCookie(this.options.cookie.name) }, n.prototype.clearStatus = function () { var e = this.options.cookie; t.setCookie(e.name, "", -1, e.domain, e.path) }, n }(), e.Location = function () { function e(e) { t.deepExtend(this.options = {}, s), t.isPlainObject(e) && t.deepExtend(this.options, e), this.currentServiceIndex = -1 } function i(e, t, i) { var n, o = document.createElement("script"); o.type = "text/" + (e.type || "javascript"), o.src = e.src || e, o.async = !1, o.onreadystatechange = o.onload = function () { var e = o.readyState; clearTimeout(n), t.done || e && !/loaded|complete/.test(e) || (t.done = !0, t(), o.onreadystatechange = o.onload = null) }, document.body.appendChild(o), n = setTimeout(function () { t.done = !0, t(), o.onreadystatechange = o.onload = null }, i) } function n(e, t, i, n, o) { var s = new (window.XMLHttpRequest || window.ActiveXObject)("MSXML2.XMLHTTP.3.0"); if (s.open(n ? "POST" : "GET", e, 1), s.setRequestHeader("Content-type", "application/x-www-form-urlencoded"), Array.isArray(o)) for (var r = 0, a = o.length; r < a; ++r) { var c = o[r].split(":", 2); s.setRequestHeader(c[0].replace(/^\s+|\s+$/g, ""), c[1].replace(/^\s+|\s+$/g, "")) } "function" == typeof t && (s.onreadystatechange = function () { s.readyState > 3 && t(s) }), s.send(n) } function o(e) { return new Error("Error [" + (e.code || "UNKNOWN") + "]: " + e.error) } var s = { timeout: 5e3, services: ["ipinfo"], serviceDefinitions: { ipinfo: function () { return { url: "//ipinfo.io", headers: ["Accept: application/json"], callback: function (e, t) { tr
1766y { var i = JSON.parse(t); return i.error ? o(i) : { code: i.country } } catch (n) { return o({ error: "Invalid response (" + n + ")" }) } } } }, ipinfodb: function (e) { return { url: "//api.ipinfodb.com/v3/ip-country/?key={api_key}&format=json&callback={callback}", isScript: !0, callback: function (e, t) { try { var i = JSON.parse(t); return "ERROR" == i.statusCode ? o({ error: i.statusMessage }) : { code: i.countryCode } } catch (n) { return o({ error: "Invalid response (" + n + ")" }) } } } }, maxmind: function () { return { url: "//js.maxmind.com/js/apis/geoip2/v2.1/geoip2.js", isScript: !0, callback: function (e) { return window.geoip2 ? void geoip2.country(function (t) { try { e({ code: t.country.iso_code }) } catch (i) { e(o(i)) } }, function (t) { e(o(t)) }) : void e(new Error("Unexpected response format. The downloaded script should have exported `geoip2` to the global scope")) } } } } }; return e.prototype.getNextService = function () { var e; do e = this.getServiceByIdx(++this.currentServiceIndex); while (this.currentServiceIndex < this.options.services.length && !e); return e }, e.prototype.getServiceByIdx = function (e) { var i = this.options.services[e]; if ("function" == typeof i) { var n = i(); return n.name && t.deepExtend(n, this.options.serviceDefinitions[n.name](n)), n } return "string" == typeof i ? this.options.serviceDefinitions[i]() : t.isPlainObject(i) ? this.options.serviceDefinitions[i.name](i) : null }, e.prototype.locate = function (e, t) { var i = this.getNextService(); return i ? (this.callbackComplete = e, this.callbackError = t, void this.runService(i, this.runNextServiceOnError.bind(this))) : void t(new Error("No services to run")) }, e.prototype.setupUrl = function (e) { var t = this.getCurrentServiceOpts(); return e.url.replace(/\{(.*?)\}/g, function (i, n) { if ("callback" === n) { var o = "callback" + Date.now(); return window[o] = function (t) { e.__JSONP_DATA = JSON.stringify(t) }, o } if (n in t.interpolateUrl) return t.interpolateUrl[n] }) }, e.prototype.runService = function (e, t) { var o = this; if (e && e.url && e.callback) { var s = e.isScript ? i : n, r = this.setupUrl(e); s(r, function (i) { var n = i ? i.responseText : ""; e.__JSONP_DATA && (n = e.__JSONP_DATA, delete e.__JSONP_DATA), o.runServiceCallback.call(o, t, e, n) }, this.options.timeout, e.data, e.headers) } }, e.prototype.runServiceCallback = function (e, t, i) { var n = this, o = function (t) { s || n.onServiceResult.call(n, e, t) }, s = t.callback(o, i); s && this.onServiceResult.call(this, e, s) }, e.prototype.onServiceResult = function (e, t) { t instanceof Error || t && t.error ? e.call(this, t, null) : e.call(this, null, t) }, e.prototype.runNextServiceOnError = function (e, t) { if (e) { this.logError(e); var i = this.getNextService(); i ? this.runService(i, this.runNextServiceOnError.bind(this)) : this.completeService.call(this, this.callbackError, new Error("All services failed")) } else this.completeService.call(this, this.callbackComplete, t) }, e.prototype.getCurrentServiceOpts = function () { var e = this.options.services[this.currentServiceIndex]; return "string" == typeof e ? { name: e } : "function" == typeof e ? e() : t.isPlainObject(e) ? e : {} }, e.prototype.completeService = function (e, t) { this.currentServiceIndex = -1, e && e(t) }, e.prototype.logError = function (e) { var t = this.currentServiceIndex, i = this.getServiceByIdx(t); console.warn("The service[" + t + "] (" + i.url + ") responded with the following error", e) }, e }(), e.Law = function () { function e(e) { this.initialise.apply(this, arguments) } var i = { regionalLaw: !0, hasLaw: ["AT", "BE", "BG", "HR", "CZ", "CY", "DK", "EE", "FI", "FR", "DE", "EL", "HU", "IE", "IT", "LV", "LT", "LU", "MT", "NL", "PL", "PT", "SK", "ES", "SE", "GB", "UK", "GR", "EU"], revokable: ["HR", "CY", "DK", "EE", "FR", "DE", "LV", "LT", "NL", "PT", "ES"], explicitAction: ["HR", "IT", "ES"] }; return e.prototype.initialise = function (e) { t.deepExtend(this.options = {}, i), t.isPlainObject(e) && t.deepExtend(this.options, e) }, e.prototype.get = function (e) { var t = this.options; return { hasLaw: t.hasLaw.indexOf(e) >= 0, revokable: t.revokable.indexOf(e) >= 0, explicitAction: t.explicitAction.indexOf(e) >= 0 } }, e.prototype.applyLaw = function (e, t) { var i = this.get(t); return i.hasLaw || (e.enabled = !1, "function" == typeof e.onNoCookieLaw && e.onNoCookieLaw(t, i)), this.options.regionalLaw && (i.revokable && (e.revokable = !0), i.explicitAction && (e.dismissOnScroll = !1, e.dismissOnTimeout = !1)), e }, e }(), e.initialise = function (i, n, o) { var s = new e.Law(i.law); n || (n = function () { }), o || (o = function () { }); var r = Object.keys(e.status), a = t.getCookie("cookieconsent_status"), c = r.indexOf(a) >= 0; return c ? void n(new e.Popup(i)) : void e.getCountryCode(i, function (t) { delete i.law, delete i.location, t.code && (i = s.applyLaw(i, t.code)), n(new e.Popup(i)) }, function (t) { delete i.law, delete i.location, o(t, new e.Popup(i)) }) }, e.getCountryCode = function (t, i, n) { if (t.law && t.law.countryCode) return void i({ code: t.law.countryCode }); if (t.location) { var o = new e.Location(t.location); return void o.locate(function (e) { i(e || {}) }, n) } i({}) }
1766, e.utils = t, e.hasInitialised = !0, window.cookieconsent = e } }(window.cookieconsent || {}); 1767 1768/* 1769|-------------------------------------------------------------------------- 1770| Jquery hover 1771|-------------------------------------------------------------------------- 1772| 1773*/ 1774!function (factory) { "use strict"; "function" == typeof define && define.amd ? define(["jquery"], factory) : "object" == typeof module && module.exports ? module.exports = factory(require("jquery")) : jQuery && !jQuery.fn.hoverIntent && factory(jQuery) }(function ($) { "use strict"; function track(ev) { cX = ev.pageX, cY = ev.pageY } var cX, cY, _cfg = { interval: 100, sensitivity: 6, timeout: 0 }, INSTANCE_COUNT = 0, compare = function (ev, $el, s, cfg) { if (Math.sqrt((s.pX - cX) * (s.pX - cX) + (s.pY - cY) * (s.pY - cY)) < cfg.sensitivity) return $el.off(s.event, track), delete s.timeoutId, s.isActive = !0, ev.pageX = cX, ev.pageY = cY, delete s.pX, delete s.pY, cfg.over.apply($el[0], [ev]); s.pX = cX, s.pY = cY, s.timeoutId = setTimeout(function () { compare(ev, $el, s, cfg) }, cfg.interval) }; $.fn.hoverIntent = function (handlerIn, handlerOut, selector) { var instanceId = INSTANCE_COUNT++, cfg = $.extend({}, _cfg); $.isPlainObject(handlerIn) ? (cfg = $.extend(cfg, handlerIn), $.isFunction(cfg.out) || (cfg.out = cfg.over)) : cfg = $.isFunction(handlerOut) ? $.extend(cfg, { over: handlerIn, out: handlerOut, selector: selector }) : $.extend(cfg, { over: handlerIn, out: handlerIn, selector: handlerOut }); function handleHover(e) { var ev = $.extend({}, e), $el = $(this), hoverIntentData = $el.data("hoverIntent"); hoverIntentData || $el.data("hoverIntent", hoverIntentData = {}); var state = hoverIntentData[instanceId]; state || (hoverIntentData[instanceId] = state = { id: instanceId }), state.timeoutId && (state.timeoutId = clearTimeout(state.timeoutId)); var mousemove = state.event = "mousemove.hoverIntent.hoverIntent" + instanceId; if ("mouseenter" === e.type) { if (state.isActive) return; state.pX = ev.pageX, state.pY = ev.pageY, $el.off(mousemove, track).on(mousemove, track), state.timeoutId = setTimeout(function () { compare(ev, $el, state, cfg) }, cfg.interval) } else { if (!state.isActive) return; $el.off(mousemove, track), state.timeoutId = setTimeout(function () { !function (ev, $el, s, out) { var data = $el.data("hoverIntent"); data && delete data[s.id], out.apply($el[0], [ev]) }(ev, $el, state, cfg.out) }, cfg.timeout) } } return this.on({ "mouseenter.hoverIntent": handleHover, "mouseleave.hoverIntent": handleHover }, cfg.selector) } }); 1775 1776 1777/* 1778|-------------------------------------------------------------------------- 1779| Jquery UI (init, widget, menu, autocomplete) 1780|-------------------------------------------------------------------------- 1781| 1782*/ 1783 1784!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(x){x.ui=x.ui||{};x.ui.version="1.12.1";var n,i=0,a=Array.prototype.slice;x.cleanData=(n=x.cleanData,function(t){for(var e,i,s=0;null!=(i=t[s]);s++)try{(e=x._data(i,"events"))&&e.remove&&x(i).triggerHandler("remove")}catch(t){}n(t)}),x.widget=function(t,i,e){var s,n,o,l={},a=t.split(".")[0],r=a+"-"+(t=t.split(".")[1]);return e||(e=i,i=x.Widget),x.isArray(e)&&(e=x.extend.apply(null,[{}].concat(e))),x.expr[":"][r.toLowerCase()]=function(t){return!!x.data(t,r)},x[a]=x[a]||{},s=x[a][t],n=x[a][t]=function(t,e){if(!this._createWidget)return new n(t,e);arguments.length&&this._createWidget(t,e)},x.extend(n,s,{version:e.version,_proto:x.extend({},e),_childConstructors:[]}),(o=new i).options=x.widget.extend({},o.options),x.each(e,function(e,s){function n(){return i.prototype[e].apply(this,arguments)}function o(t){return i.prototype[e].apply(this,t)}x.isFunction(s)?l[e]=function(){var t,e=this._super,i=this._superApply;return this._super=n,this._superApply=o,t=s.apply(this,arguments),this._super=e,this._superApply=i,t}:l[e]=s}),n.prototype=x.widget.extend(o,{widgetEventPrefix:s&&o.widgetEventPrefix||t},l,{constructor:n,namespace:a,widgetName:t,widgetFullName:r}),s?(x.each(s._childConstructors,function(t,e){var i=e.prototype;x.widget(i.namespace+"."+i.widgetName,n,e._proto)}),delete s._childConstructors):i._childConstructors.push(n),x.widget.bridge(t,n),n}
vendor: 19,681 bytes, line 1784
1784,x.widget.extend=function(t){for(var e,i,s=a.call(arguments,1),n=0,o=s.length;n<o;n++)for(e in s[n])i=s[n][e],s[n].hasOwnProperty(e)&&void 0!==i&&(x.isPlainObject(i)?t[e]=x.isPlainObject(t[e])?x.widget.extend({},t[e],i):x.widget.extend({},i):t[e]=i);return t},x.widget.bridge=function(o,e){var l=e.prototype.widgetFullName||o;x.fn[o]=function(i){var t="string"==typeof i,s=a.call(arguments,1),n=this;return t?this.length||"instance"!==i?this.each(function(){var t,e=x.data(this,l);return"instance"===i?(n=e,!1):e?x.isFunction(e[i])&&"_"!==i.charAt(0)?(t=e[i].apply(e,s))!==e&&void 0!==t?(n=t&&t.jquery?n.pushStack(t.get()):t,!1):void 0:x.error("no such method '"+i+"' for "+o+" widget instance"):x.error("cannot call methods on "+o+" prior to initialization; attempted to call method '"+i+"'")}):n=void 0:(s.length&&(i=x.widget.extend.apply(null,[i].concat(s))),this.each(function(){var t=x.data(this,l);t?(t.option(i||{}),t._init&&t._init()):x.data(this,l,new e(i,this))})),n}},x.Widget=function(){},x.Widget._childConstructors=[],x.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,e){e=x(e||this.defaultElement||this)[0],this.element=x(e),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=x(),this.hoverable=x(),this.focusable=x(),this.classesElementLookup={},e!==this&&(x.data(e,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===e&&this.destroy()}}),this.document=x(e.style?e.ownerDocument:e.document||e),this.window=x(this.document[0].defaultView||this.document[0].parentWindow)),this.options=x.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:x.noop,_create:x.noop,_init:x.noop,destroy:function(){var i=this;this._destroy(),x.each(this.classesElementLookup,function(t,e){i._removeClass(e,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:x.noop,widget:function(){return this.element},option:function(t,e){var i,s,n,o=t;if(0===arguments.length)return x.widget.extend({},this.options);if("string"==typeof t)if(o={},t=(i=t.split(".")).shift(),i.length){for(s=o[t]=x.widget.extend({},this.options[t]),n=0;n<i.length-1;n++)s[i[n]]=s[i[n]]||{},s=s[i[n]];if(t=i.pop(),1===arguments.length)return void 0===s[t]?null:s[t];s[t]=e}else{if(1===arguments.length)return void 0===this.options[t]?null:this.options[t];o[t]=e}return this._setOptions(o),this},_setOptions:function(t){for(var e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(t){var e,i,s;for(e in t)s=this.classesElementLookup[e],t[e]!==this.options.classes[e]&&s&&s.length&&(i=x(s.get()),this._removeClass(s,e),i.addClass(this._classes({element:i,keys:e,classes:t,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(n){var o=[],l=this;function t(t,e){for(var i,s=0;s<t.length;s++)i=l.classesElementLookup[t[s]]||x(),i=n.add?x(x.unique(i.get().concat(n.element.get()))):x(i.not(n.element).get()),l.classesElementLookup[t[s]]=i,o.push(t[s]),e&&n.classes[t[s]]&&o.push(n.classes[t[s]])}return n=x.extend({element:this.element,classes:this.options.classes||{}},n),this._on(n.element,{remove:"_untrackClassesElement"}),n.keys&&t(n.keys.match(/\S+/g)||[],!0),n.extra&&t(n.extra.match(/\S+/g)||[]),o.join(" ")},_untrackClassesElement:function(i){var s=this;x.each(s.classesElementLookup,function(t,e){-1!==x.inArray(i.target,e)&&(s.classesElementLookup[t]=x(e.not(i.target).get()))})},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,s){s="boolean"==typeof s?s:i;var n="string"==typeof t||null===t,t={extra:n?e:i,keys:n?t:e,element:n?this.element:t,add:s};return t.element.toggleClass(this._classes(t),s),this},_on:function(n,o,t){var l,a=this;"boolean"!=typeof n&&(t=o,o=n,n=!1),t?(o=l=x(o),this.bindings=this.bindings.add(o)):(t=o,o=this.element,l=this.widget()),x.each(t,function(t,e){function i(){if(n||!0!==a.options.disabled&&!x(this).hasClass("ui-state-disabled"))return("string"==typeof e?a[e]:e).apply(a,arguments)}"string"!=typeof e&&(i.guid=e.guid=e.guid||i.guid||x.guid++);var s=t.match(/^([\w:-]*)\s*(.*)$/),t=s[1]+a.eventNamespace,s=s[2];s?l.on(t,s,i):o.on(t,i)})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.off(e).off(e),this.bindings=x(this.bindings.not(t).get()),this.focusable=x(this.focusable.not(t).get()),this.hoverable=x(this.hoverable.not(t).get())},_delay:function(t,e){var i=this;return setTimeout(function(){return("string"==typeof t?i[t]:t).apply(i,arguments)},e||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){this._addClass(x(t.currentTarget),null,"ui-state-hover")},mouseleave:function(t){this._removeClass(x(t.currentTarget),null,"ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){this._addClass(x(t.currentTarget),null,"ui-state-focus")},focusout:function(t){this._removeClass(x(t.currentTarget),null,"ui-state-focus")}})},_trigger:function(t,e,i){var s,n,o=this.options[t];if(i=i||{},(e=x.Event(e)).type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),e.target=this.element[0],n=e.originalEvent)for(s in n)s in e||(e[s]=n[s]);return this.element.trigger(e,i),!(x.isFunction(o)&&!1===o.apply(this.element[0],[e].concat(i))||e.isDefaultPrevented())}},x.each({show:"fadeIn",hide:"fadeOut"},function(o,l){x.Widget.prototype["_"+o]=function(e,t,i){var s;"string"==typeof t&&(t={effect:t});var n=t?!0!==t&&"number"!=typeof t&&t.effect||l:o;"number"==typeof(t=t||{})&&(t={duration:t}),s=!x.isEmptyObject(t),t.complete=i,t.delay&&e.delay(t.delay),s&&x.effects&&x.effects.effect[n]?e[o](t):n!==o&&e[n]?e[n](t.duration,t.easing,i):e.queue(function(t){x(this)[o](),i&&i.call(e[0]),t()})}});var s,C,E,o,l,r,u,h,k;x.widget;function T(t,e,i){return[parseFloat(t[0])*(h.test(t[0])?e/100:1),parseFloat(t[1])*(h.test(t[1])?i/100:1)]}function W(t,e){return parseInt(x.css(t,e),10)||0}C=Math.max,E=Math.abs,o=/left|center|right/,l=/top|center|bottom/,r=/[\+\-]\d+(\.[\d]+)?%?/,u=/^\w+/,h=/%$/,k=x.fn.position,x.position={scrollbarWidth:function(){if(void 0!==s)return s;var t,e=x("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),i=e.children()[0];return x("body").append(e),t=i.offsetWidth,e.css("overflow","scroll"),t===(i=i.offsetWidth)&&(i=e[0].clientWidth),e.remove(),s=t-i},getScrollInfo:function(t){var e=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),i=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),e="scroll"===e||"auto"===e&&t.width<t.element[0].scrollWidth;return{width:"scroll"===i||"auto"===i&&t.height<t.element[0].scrollHeight?x.position.scrollbarWidth():0,height:e?x.position.scrollbarWidth():0}},getWithinInfo:function(t){var e=x(t||window),i=x.isWindow(e[0]),s=!!e[0]&&9===e[0].nodeType;return{element:e,isWindow:i,isDocument:s,offset:!i&&!s?x(t).offset():{left:0,top:0},scrollLeft:e.scrollLeft(),scrollTop:e.scrollTop(),width:e.outerWidth(),height:e.outerHeight()}}},x.fn.position=function(c){if(!c||!c.of)return k.apply(this,arguments);c=x.extend({},c);var d,f,m,p,v,t,g=x(c.of),_=x.position.getWithinInfo(c.within),y=x.position.getScrollInfo(_),b=(c.collision||"flip").split(" "),w={},e=9===(t=(e=g)[0]).nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:x.isWindow(t)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:t.preventDefault?{width:0,height:0,offset:{top:t.pageY,left:t.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()};return g[0].preventDefault&&(c.at="left top"),f=e.width,m=e.height,p=e.offset,v=x.extend({},p),x.each(["my","at"],function(){var t,e,i=(c[this]||"").split(" ");1===i.length&&(i=o.test(i[0])?i.concat(["center"]):l.test(i[0])?["center"].concat(i):["center","center"]),i[0]=o.test(i[0])?i[0]:"center",i[1]=l.test(i[1])?i[1]:"center",t=r.exec(i[0]),e=r.exec(i[1]),w[this]=[t?t[0]:0,e?e[0]:0],c[this]=[u.exec(i[0])[0],u.exec(i[1])[0]]}),1===b.length&&(b[1]=b[0]),"right"===c.at[0]?v.left+=f:"center"===c.at[0]&&(v.left+=f/2),"bottom"===c.at[1]?v.top+=m:"center"===c.at[1]&&(v.top+=m/2),d=T(w.at,f,m),v.left+=d[0],v.top+=d[1],this.each(function(){var i,t,l=x(this),a=l.outerWidth(),r=l.outerHeight(),e=W(this,"marginLeft"),s=W(this,"marginTop"),n=a+e+W(this,"marginRight")+y.width,o=r+s+W(this,"marginBottom")+y.height,u=x.extend({},v),h=T(w.my,l.outerWidth(),l.outerHeight());"right"===c.my[0]?u.left-=a:"center"===c.my[0]&&(u.left-=a/2),"bottom"===c.my[1]?u.top-=r:"center"===c.my[1]&&(u.top-=r/2),u.left+=h[0],u.top+=h[1],i={marginLeft:e,marginTop:s},x.each(["left","top"],function(t,e){x.ui.position[b[t]]&&x.ui.position[b[t]][e](u,{targetWidth:f,targetHeight:m,elemWidth:a,elemHeight:r,collisionPosition:i,collisionWidth:n,collisionHeight:o,offset:[d[0]+h[0],d[1]+h[1]],my:c.my,at:c.at,within:_,elem:l})}),c.using&&(t=function(t){var e=p.left-u.left,i=e+f-a,s=p.top-u.top,n=s+m-r,o={target:{element:g,left:p.left,top:p.top,width:f,height:m},element:{element:l,left:u.left,top:u.top,width:a,height:r},horizontal:i<0?"left":0<e?"right":"center",vertical:n<0?"top":0<s?"bottom":"middle"};f<a&&E(e+i)<f&&(o.horizontal="center"),m<r&&E(s+n)<m&&(o.vertical="middle"),C(E(e),E(i))>C(E(s),E(n))?o.important="horizontal":o.important="vertical",c.using.call(this,t,o)}),l.offset(x.extend(u,{using:t}))})},x.ui.position={fit:{left:function(t,e){var i=e.within,s=i.isWindow?i.scrollLeft:i.offset.left,n=i.width,o=t.left-e.collisionPosition.marginLeft,l=s-o,a=o+e.collisionWidth-n-s;e.collisionWidth>n?0<l&&a<=0?(i=t.left+l+e.collisionWidth-n-s,t.left+=l-i):t.left=!(0<a&&l<=0)&&a<l?s+n-e.collisionWidth:s:0<l?t.left+=l:0<a?t.left-=a:t.left=C(t.left-o,t.left)},top:function(t,e){var i=e.within,s=i.isWindow?i.scrollTop:i.offset.top,n=e.within.height,o=t.top-e.collisionPosition.marginTop,l=s-o,a=o+e.collisionHeight-n-s;e.collisionHeight>n?0<l&&a<=0?(i=t.top+l+e.collisionHeight-n-s,t.top+=l-i):t.top=!(0<a&&l<=0)&&a<l?s+n-e.collisionHeight:s:0<l?t.top+=l:0<a?t.top-=a:t.top=C(t.top-o,t.top)}},flip:{left:function(t,e){var i=e.within,s=i.offset.left+i.scrollLeft,n=i.width,o=i.isWindow?i.scrollLeft:i.offset.left,l=t.left-e.collisionPosition.marginLeft,a=l-o,r=l+e.collisionWidth-n-o,u="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,i="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,l=-2*e.offset[0];a<0?((s=t.left+u+i+l+e.collisionWidth-n-s)<0||s<E(a))&&(t.left+=u+i+l):0<r&&(0<(o=t.left-e.collisionPosition.marginLeft+u+i+l-o)||E(o)<r)&&(t.left+=u+i+l)},top:function(t,e){var i=e.within,s=i.offset.top+i.scrollTop,n=i.height,o=i.isWindow?i.scrollTop:i.offset.top,l=t.top-e.collisionPosition.marginTop,a=l-o,r=l+e.collisionHeight-n-o,u="top"===e.my[1]?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,i="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,l=-2*e.offset[1];a<0?((s=t.top+u+i+l+e.collisionHeight-n-s)<0||s<E(a))&&(t.top+=u+i+l):0<r&&(0<(o=t.top-e.collisionPosition.marginTop+u+i+l-o)||E(o)<r)&&(t.top+=u+i+l)}},flipfit:{left:function(){x.ui.position.flip.left.apply(this,arguments),x.ui.position.fit.left.apply(this,arguments)},top:function(){x.ui.position.flip.top.apply(this,arguments),x.ui.position.fit.top.apply(this,arguments)}}};var t;x.ui.position,x.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},x.fn.extend({uniqueId:(t=0,function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++t)})}),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&x(this).removeAttr("id")})}}),x.ui.safeActiveElement=function(e){var i;try{i=e.activeElement}catch(t){i=e.body}return(i=i||e.body).nodeName||(i=e.body),i},x.widget("ui.menu",{version:"1.12.1",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-caret-1-e"},items:"> *",menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().attr({role:this.options.role,tabIndex:0}),this._addClass("ui-menu","ui-widget ui-widget-content"),this._on({"mousedown .ui-menu-item":function(t){t.preventDefault()},"click .ui-menu-item":function(t){var e=x(t.target),i=x(x.ui.safeActiveElement(this.document[0]));!this.mouseHandled&&e.not(".ui-state-disabled").length&&(this.select(t),t.isPropagationStopped()||(this.mouseHandled=!0),e.has(".ui-menu").length?this.expand(t):!this.element.is(":focus")&&i.closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(t){var e,i;this.previousFilter||(e=x(t.target).closest(".ui-menu-item"),i=x(t.currentTarget),e[0]===i[0]&&(this._removeClass(i.siblings().children(".ui-state-active"),null,"ui-state-active"),this.focus(t,i)))},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var i=this.active||this.element.find(this.options.items).eq(0);e||this.focus(t,i)},blur:function(t){this._delay(function(){x.contains(this.element[0],x.ui.safeActiveElement(this.document[0]))||this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(t){this._closeOnDocumentClick(t)&&this.collapseAll(t),this.mouseHandled=!1}})},_destroy:function(){var t=this.element.find(".ui-menu-item").removeAttr("role aria-disabled").children(".ui-menu-item-wrapper").removeUniqueId().removeAttr("tabIndex role aria-haspopup");this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeAttr("role aria-labelledby aria-expanded aria-hidden aria-disabled tabIndex").removeUniqueId().show(),t.children().each(function(){var t=x(this);t.data("ui-menu-submenu-caret")&&t.remove()})},_keydown:function(t){var e,i,s,n=!0;switch(t.keyCode){case x.ui.keyCode.PAGE_UP:this.previousPage(t);break;case x.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case x.ui.keyCode.HOME:this._move("first","first",t);break;case x.ui.keyCode.END:this._move("last","last",t);break;case x.ui.keyCode.UP:this.previous(t);break;case x.ui.keyCode.DOWN:this.next(t);break;case x.ui.keyCode.LEFT:this.collapse(t);break;case x.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case x.ui.keyCode.ENTER:case x.ui.keyCode.SPACE:this._activate(t);break;case x.ui.keyCode.ESCAPE:this.collapse(t);break;default:n=!1,e=this.previousFilter||"",s=!1,i=96<=t.keyCode&&t.keyCode<=105?(t.keyCode-96).toString():String.fromCharCode(t.keyCode),clearTimeout(this.filterTimer),i===e?s=!0:i=e+i,e=this._filterMenuItems(i),(e=s&&-1!==e.index(this.active.next())?this.active.nextAll(".ui-menu-item"):e).length||(i=String.fromCharCode(t.keyCode),e=this._filterMenuItems(i)),e.length?(this.focus(t,e),this.previousFilter=i,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}n&&t.preventDefault()},_activate:function(t){this.active&&!this.active.is(".ui-state-disabled")&&(this.active.children("[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var t,e,s=this,n=this.options.icons.submenu,i=this.element.find(this.options.menus);this._toggleClass("ui-menu-icons",null,!!this.element.find(".ui-icon").length),e=i.filter(":not(.ui-menu)").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=x(this),e=t.prev(),i=x("<span>").data("ui-menu-submenu-caret",!0);s._addClass(i,"ui-menu-icon","ui-icon "+n),e.attr("aria-haspopup","true").prepend(i),t.attr("aria-labelledby",e.attr("id"))}),this._addClass(e,"ui-menu","ui-widget ui-widget-content ui-front"),(t=i.add(this.element).find(this.options.items)).not(".ui-menu-item").each(function(){var t=x(this);s._isDivider(t)&&s._addClass(t,"ui-menu-divider","ui-widget-content")}),i=(e=t.not(".ui-menu-item, .ui-menu-divider")).children().not(".ui-menu").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),this._addClass(e,"ui-menu-item")._addClass(i,"ui-menu-item-wrapper"),t.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!x.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){var i;"icons"===t&&(i=this.element.find(".ui-menu-icon"),this._removeClass(i,null,this.options.icons.submenu)._addClass(i,null,e.submenu)),this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",String(t)),this._toggleClass(null,"ui-state-disabled",!!t)},focus:function(t,e){var i;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),i=this.active.children(".ui-menu-item-wrapper"),this._addClass(i,null,"ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",i.attr("id")),i=this.active.parent().closest(".ui-menu-item").children(".ui-menu-item-wrapper"),this._addClass(i,null,"ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),(i=e.children(".ui-menu")).length&&t&&/^mouse/.test(t.type)&&this._startOpening(i),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(t){var e,i,s;this._hasScroll()&&(i=parseFloat(x.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(x.css(this.activeMenu[0],"paddingTop"))||0,e=t.offset().top-this.activeMenu.offset().top-i-s,i=this.activeMenu.scrollTop(),s=this.activeMenu.height(),t=t.outerHeight(),e<0?this.activeMenu.scrollTop(i+e):s<e+t&&this.activeMenu.scrollTop(i+e-s+t))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this._removeClass(this.active.children(".ui-menu-item-wrapper"),null,"ui-state-active"),this._trigger("blur",t,{item:this.active}),this.active=null)},_startOpening:function(t){clearTimeout(this.timer),"true"===t.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(t)},this.delay))},_open:function(t){var e=x.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(t.parents(".ui-menu")).hide().attr("aria-hidden","true"),t.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(e)},collapseAll:function(e,i){clearTimeout(this.timer),this.timer=this._delay(function(){var t=i?this.element:x(e&&e.target).closest(this.element.find(".ui-menu"));t.length||(t=this.element),this._close(t),this.blur(e),this._removeClass(t.find(".ui-state-active"),null,"ui-state-active"),this.activeMenu=t},this.delay)},_close:function(t){(t=t||(this.active?this.active.parent():this.element)).find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","fal
1784se")},_closeOnDocumentClick:function(t){return!x(t.target).closest(".ui-menu").length},_isDivider:function(t){return!/[^\-\u2014\u2013\s]/.test(t.text())},collapse:function(t){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element);e&&e.length&&(this._close(),this.focus(t,e))},expand:function(t){var e=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();e&&e.length&&(this._open(e.parent()),this._delay(function(){this.focus(t,e)}))},next:function(t){this._move("next","first",t)},previous:function(t){this._move("prev","last",t)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(t,e,i){var s;this.active&&(s="first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[t+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.find(this.options.items)[e]()),this.focus(i,s)},nextPage:function(t){var e,i,s;this.active?this.isLastItem()||(this._hasScroll()?(i=this.active.offset().top,s=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return(e=x(this)).offset().top-i-s<0}),this.focus(t,e)):this.focus(t,this.activeMenu.find(this.options.items)[this.active?"last":"first"]())):this.next(t)},previousPage:function(t){var e,i,s;this.active?this.isFirstItem()||(this._hasScroll()?(i=this.active.offset().top,s=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return 0<(e=x(this)).offset().top-i+s}),this.focus(t,e)):this.focus(t,this.activeMenu.find(this.options.items).first())):this.next(t)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(t){this.active=this.active||x(t.target).closest(".ui-menu-item");var e={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(t,!0),this._trigger("select",t,e)},_filterMenuItems:function(t){var t=t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),e=new RegExp("^"+t,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return e.test(x.trim(x(this).children(".ui-menu-item-wrapper").text()))})}});x.widget("ui.autocomplete",{version:"1.12.1",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var i,s,n,t=this.element[0].nodeName.toLowerCase(),e="textarea"===t,t="input"===t;this.isMultiLine=e||!t&&this._isContentEditable(this.element),this.valueMethod=this.element[e||t?"val":"text"],this.isNewMenu=!0,this._addClass("ui-autocomplete-input"),this.element.attr("autocomplete","off"),this._on(this.element,{keydown:function(t){if(this.element.prop("readOnly"))s=n=i=!0;else{s=n=i=!1;var e=x.ui.keyCode;switch(t.keyCode){case e.PAGE_UP:i=!0,this._move("previousPage",t);break;case e.PAGE_DOWN:i=!0,this._move("nextPage",t);break;case e.UP:i=!0,this._keyEvent("previous",t);break;case e.DOWN:i=!0,this._keyEvent("next",t);break;case e.ENTER:this.menu.active&&(i=!0,t.preventDefault(),this.menu.select(t));break;case e.TAB:this.menu.active&&this.menu.select(t);break;case e.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(t),t.preventDefault());break;default:s=!0,this._searchTimeout(t)}}},keypress:function(t){if(i)return i=!1,void(this.isMultiLine&&!this.menu.element.is(":visible")||t.preventDefault());if(!s){var e=x.ui.keyCode;switch(t.keyCode){case e.PAGE_UP:this._move("previousPage",t);break;case e.PAGE_DOWN:this._move("nextPage",t);break;case e.UP:this._keyEvent("previous",t);break;case e.DOWN:this._keyEvent("next",t)}}},input:function(t){if(n)return n=!1,void t.preventDefault();this._searchTimeout(t)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(t){this.cancelBlur?delete this.cancelBlur:(clearTimeout(this.searching),this.close(t),this._change(t))}}),this._initSource(),this.menu=x("<ul>").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance"),this._addClass(this.menu.element,"ui-autocomplete","ui-front"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,this.element[0]!==x.ui.safeActiveElement(this.document[0])&&this.element.trigger("focus")})},menufocus:function(t,e){var i;if(this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type)))return this.menu.blur(),void this.document.one("mousemove",function(){x(t.target).trigger(t.originalEvent)});i=e.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",t,{item:i}
1784)&&t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(i.value),(i=e.item.attr("aria-label")||i.value)&&x.trim(i).length&&(this.liveRegion.children().hide(),x("<div>").text(i).appendTo(this.liveRegion))},menuselect:function(t,e){var i=e.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==x.ui.safeActiveElement(this.document[0])&&(this.element.trigger("focus"),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",t,{item:i})&&this._value(i.value),this.term=this._value(),this.close(t),this.selectedItem=i}}),this.liveRegion=x("<div>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(t,e){this._super(t,e),"source"===t&&this._initSource(),"appendTo"===t&&this.menu.element.appendTo(this._appendTo()),"disabled"===t&&e&&this.xhr&&this.xhr.abort()},_isEventTargetInWidget:function(t){var e=this.menu.element[0];return t.target===this.element[0]||t.target===e||x.contains(e,t.target)},_closeOnClickOutside:function(t){this._isEventTargetInWidget(t)||this.close()},_appendTo:function(){var t=this.options.appendTo;return(t=t&&(t.jquery||t.nodeType?x(t):this.document.find(t).eq(0)))&&t[0]||(t=this.element.closest(".ui-front, dialog")),t.length||(t=this.document[0].body),t},_initSource:function(){var i,s,n=this;x.isArray(this.options.source)?(i=this.options.source,this.source=function(t,e){e(x.ui.autocomplete.filter(i,t.term))}):"string"==typeof this.options.source?(s=this.options.source,this.source=function(t,e){n.xhr&&n.xhr.abort(),n.xhr=x.ajax({url:s,data:t,dataType:"json",success:function(t){e(t)},error:function(){e([])}})}):this.source=this.options.source},_searchTimeout:function(s){clearTimeout(this.searching),this.searching=this._delay(function(){var t=this.term===this._value(),e=this.menu.element.is(":visible"),i=s.altKey||s.ctrlKey||s.metaKey||s.shiftKey;t&&(!t||e||i)||(this.selectedItem=null,this.search(null,s))},this.options.delay)},search:function(t,e){return t=null!=t?t:this._value(),this.term=this._value(),t.length<this.options.minLength?this.close(e):!1!==this._trigger("search",e)?this._search(t):void 0},_search:function(t){this.pending++,this._addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:t},this._response())},_response:function(){var e=++this.requestIndex;return x.proxy(function(t){e===this.requestIndex&&this.__response(t),this.pending--,this.pending||this._removeClass("ui-autocomplete-loading")},this)},__response:function(t){t=t&&this._normalize(t),this._trigger("response",null,{content:t}),!this.options.disabled&&t&&t.length&&!this.cancelSearch?(this._suggest(t),this._trigger("open")):this._close()},close:function(t){this.cancelSearch=!0,this._close(t)},_close:function(t){this._off(this.document,"mousedown"),this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",t))},_change:function(t){this.previous!==this._value()&&this._trigger("change",t,{item:this.selectedItem})},_normalize:function(t){return t.length&&t[0].label&&t[0].value?t:x.map(t,function(t){return"string"==typeof t?{label:t,value:t}:x.extend({},t,{label:t.label||t.value,value:t.value||t.label})})},_suggest:function(t){var e=this.menu.element.empty();this._renderMenu(e,t),this.isNewMenu=!0,this.menu.refresh(),e.show(),this._resizeMenu(),e.position(x.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next(),this._on(this.document,{mousedown:"_closeOnClickOutside"})},_resizeMenu:function(){var t=this.menu.element;t.outerWidth(Math.max(t.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(i,t){var s=this;x.each(t,function(t,e){s._renderItemData(i,e)})},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-autocomplete-item",e)},_renderItem:function(t,e){return x("<li>").append(x("<div>").text(e.label)).appendTo(t)},_move:function(t,e){if(this.menu.element.is(":visible"))return this.menu.isFirstItem()&&/^previous/.test(t)||this.menu.isLastItem()&&/^next/.test(t)?(this.isMultiLine||this._value(this.term),void this.menu.blur()):void this.menu[t](e);this.search(null,e)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(t,e){this.isMultiLine&&!this.menu.element.is(":visible")||(this._move(t,e),e.preventDefault())},_isContentEditable:function(t){if(!t.length)return!1;var e=t.prop("contentEditable");return"inherit"===e?this._isContentEditable(t.parent()):"true"===e}}),x.extend(x.ui.autocomplete,{escapeRegex:function(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,e){var i=new RegExp(x.ui.autocomplete.escapeRegex(e),"i");return x.grep(t,function(t){return i.test(t.label||t.value||t)})}}),x.widget("ui.autocomplete",x.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(t){return t+(1<t?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(t){var e;this._superApply(arguments),this.options.disabled||this.cancelSearch||(e=t&&t.length?this.options.messages.results(t.length):this.options.messages.noResults,this.liveRegion.children().hide(),x("<div>").text(e).appendTo(this.liveRegion))}});x.ui.autocomplete}); 1785 1786/* 1787|-------------------------------------------------------------------------- 1788| Translate service, B2Bee module 1789|-------------------------------------------------------------------------- 1790| 1791*/ 1792getTranslateString = (tag, defaultM) => { 1793 if (translateService != null) { 1794 return translateService.selectedJSON[tag] != undefined ? translateService.selectedJSON[tag] : defaultM; 1795 } 1796 return defaultM; 1797} 1798var translateService = { 1799 1800 hideContainer: false, 1801 defaultLanguage: 'sr', 1802 1803 selectedLanguage: '', 1804 selectedJSON: {}, 1805 availableLanguages: {}, 1806 1807 init: function () { 1808 var _self = this; 1809 var availableLang = $(".lan__select"); 1810 1811 $.each(availableLang, function () { 1812 _self.availableLanguages[$(this).attr("data-language")] = $(this).attr("data-translate"); 1813 }); 1814 1815 var fromCookie = getCookie("language"); 1816 if (fromCookie != "") { 1817 // console.log(fromCookie); 1818 if (_self.availableLanguages[fromCookie] != undefined) { 1819 _self.changeLanguage(fromCookie) 1820 } 1821 } else { 1822 _self.changeLanguage(_self.defaultLanguage == '' ? Object.keys(_self.availableLanguages)[0] : _self.defaultLanguage); 1823 } 1824 1825 if (_self.hideContainer) { 1826 $("#ctl00_ctl00_CMSWebPartManager_LanguageSelectorLogin_LanguageSelectionlogin_ctl00_pnlLanguages").hide(); 1827 } 1828 1829 $('#selectLang').val(_self.selectedLanguage); 1830 1831 }, 1832 1833 changeLanguage: function (l) { 1834 1835 if (l != undefined) { 1836 if (this.availableLanguages != {} && this.selectedLanguage != undefined) { 1837 this.selectedLanguage = l; 1838 // console.log(l) 1839 // console.log(this.availableLanguages) 1840 // console.log(this.selectedLanguage) 1841 if (this.availableLanguages[this.selectedLanguage] != undefined) { 1842 if (this.availableLanguages[this.selectedLanguage]) 1843 { 1844 this.selectedJSON = JSON.parse(this.availableLanguages[this.selectedLanguage]); 1845 } 1846 this.renderLanguage(); 1847 this.saveLanguage(); 1848 } 1849 } 1850 1851 } 1852 }, 1853 1854 renderLanguage: function () { 1855 var _self = this; 1856 1857 var x = _self.selectedJSON; 1858 var Keys = Object.keys(x); 1859 1860 Keys.forEach(function (K) { 1861 var Key = ""; 1862 var Attribute = ""; 1863 1864 if (K.indexOf("_") != -1) { 1865 Key = K.split('_')[0]; 1866 Attribute = K.split('_')[1]; 1867 } else { 1868 Key = K; 1869 } 1870 if (Attribute == "") { 1871 $("[language-data-translate-key='" + Key + "']").text(x[K]); 1872 } else { 1873 switch (Attribute) { 1874 case "title": 1875 $("[language-data-translate-key='" + Key + "']").attr({ title: x[K] }); 1876 $('[data-toggle="tooltip"]').tooltip({ 1877 container: 'body' 1878 }); 1879 break; 1880 case "placeholder": 1881 $("[language-data-translate-key='" + Key + "']").attr({ placeholder: x[K] }); 1882 break; 1883 default: 1884 // code block 1885 } 1886 } 1887 1888 }) 1889 }, 1890 1891 saveLanguage: function () { 1892 // setCookie("language", this.selectedLanguage, 9999); 1893 } 1894 1895}
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.