var CheckRatesJs=function(){var n={},i=function(t){var i={countryInfoId:"#CountryInfo",checkRatesUrl:null,loadingDivId:"div_load",removeBtnsClass:".remove-btns",reqVerTok:$("input[name=__RequestVerificationToken]").val(),countryFromId:"#CountryFrom",countryToId:"#CountryTo",checkBundlesEnabled:!1,checkBundlesUrl:null,notSupportedBundlesId:"#notSupportedIso"};n=$.extend(!0,i,t);r()},r=function(){$(document).on("click",n.countryInfoId+" "+n.removeBtnsClass,e);$(n.countryFromId).change(function(){var t=$(this).val();t!==null&&t!==undefined&&t.forEach(function(t){var i=$(n.countryToId).val();i!==null&&i!==undefined&&i.forEach(function(n){CheckRatesJs.checkLocations(t,n)})});n.checkBundlesEnabled&&f(t)}).select2();$(n.countryToId).change(function(){var t=$(this).val();t!==null&&t!==undefined&&t.forEach(function(t){var i=$(n.countryFromId).val();i!==null&&i!==undefined&&i.forEach(function(n){CheckRatesJs.checkLocations(n,t)})})}).select2()},u=function(t,i){t!==""&&i!==""&&($(n.countryInfoId+" #"+t+i).length||($("#CountryInfo").prepend(s),$.post(n.checkRatesUrl,{countryFrom:t,countryTo:i,__RequestVerificationToken:n.reqVerTok,viewType:1},function(t){$("#"+n.loadingDivId).remove();t!=""&&($(n.countryInfoId).prepend(t),o())})))},f=function(i){i!==undefined&&$.post(n.checkBundlesUrl,{countries:i,__RequestVerificationToken:n.reqVerTok},function(i){i!==""&&(i.noBundlesString!=null&&i.noBundlesString!=""?($(n.notSupportedBundlesId).text(i.noBundlesString),$("#noBundleWarning").removeClass("hidden")):$("#noBundleWarning").addClass("hidden"),t("#gbDataPack",i.zoneNr==0),t("#gbDayPack",!i.dayPackExists),t("#gbWifiPack",!i.wifiExists),$(".recomended").addClass("hidden"),$(".notRecomended").removeClass("hidden"),$("#bundleRec_"+i.zoneNr).removeClass("hidden"),$("#bundleNotRec_"+i.zoneNr).addClass("hidden"))})},t=function(n,t){t?($(n).removeClass("bg-green"),$(n).addClass("bg-grey"),$(n+" .gb-recomended").addClass("hidden"),$(n+" .gb-not-recomended").removeClass("hidden")):($(n).removeClass("bg-grey"),$(n).addClass("bg-green"),$(n+" .gb-recomended").removeClass("hidden"),$(n+" .gb-not-recomended").addClass("hidden"))},e=function(){$($(this).data("remove-ids")).remove()},o=function(){$("#LocalNumberIncluded").is(":checked")?($(".callForwExcluded").addClass("hidden"),$(".callForwIncluded").removeClass("hidden")):($(".callForwExcluded").removeClass("hidden"),$(".callForwIncluded").addClass("hidden"))},s=function(){return'<tr id="'+n.loadingDivId+'" class="text-center"><td colspan="8"><div class=\'panel progress\' data-loading><div class=\'progress-bar progress-bar-striped active carousel-inner\'><\/div><\/div><\/td><\/tr>'};return{initialize:i,checkLocations:u}}()