!function(e){var t={init:function(){e("#svod .tab_content").hide(),e("#svod ul.tabs li").on("click",function(){e(this).hasClass("active")?(e("#svod .tab_content").hide(),e("#"+t.init.activeTab).fadeOut(),e(this).removeClass("active"),e("#svod .tab_drawer_heading").addClass("d_active"),e("#svod .tab_drawer_heading[rel^='"+t.init.activeTab+"']").removeClass("d_active"),t.initSlider()):(e("#svod .tab_content").hide(),t.init.activeTab=e(this).attr("rel"),e("#"+t.init.activeTab).fadeIn(),e("#svod ul.tabs li").removeClass("active"),e(this).addClass("active"),t.initSlider())}),e("#svod .tab_drawer_heading").on("click",function(){e(this).hasClass("d_active")?(e("#svod .tab_content").hide(),t.init.activeTab=e(this).attr("rel"),e("#"+t.init.activeTab).fadeOut(),e("#svod .tab_drawer_heading").removeClass("d_active"),t.initSlider()):(e("#svod .tab_content").hide(),t.init.activeTab=e(this).attr("rel"),e("#"+t.init.activeTab).fadeIn(),e("#svod .tab_drawer_heading").removeClass("d_active"),e(this).addClass("d_active"),e("#svod ul.tabs li").removeClass("active"),e("#svod ul.tabs li[rel^='"+t.init.activeTab+"']").addClass("active"),t.initSlider())});ractiveHandsetCarousel.get("page");e("#svod .tab_drawer_heading").is(":visible")||e("#svod ul.tabs li[rel='mobile-tv']").click()},initSlider:function(){new Swiper(".music-streaming-slick .swiper-container",{grabCursor:!1,observer:!0,autoHeight:!0,nextButton:".music-streaming-slick .swiper-container .swiper-button-next",prevButton:".music-streaming-slick .swiper-container .swiper-button-prev",pagination:".music-streaming-slick .swiper-container .swiper-pagination",breakpoints:{6e3:{slidesPerView:3,spaceBetween:10},800:{slidesPerView:1}}}),new Swiper(".mobile-tv-slick .swiper-container",{grabCursor:!1,observer:!0,autoHeight:!0,nextButton:".mobile-tv-slick .swiper-container .swiper-button-next",prevButton:".mobile-tv-slick .swiper-container .swiper-button-prev",pagination:".mobile-tv-slick .swiper-container .swiper-pagination",breakpoints:{6e3:{slidesPerView:4,spaceBetween:10,slidesPerGroup:4},800:{slidesPerView:1,slidesPerGroup:1}}}),new Swiper(".optus-sport-slick .swiper-container",{grabCursor:!1,observer:!0,autoHeight:!0,centeredSlides:!0,nextButton:".optus-sport-slick .swiper-container .swiper-button-next",prevButton:".optus-sport-slick .swiper-container .swiper-button-prev",pagination:".optus-sport-slick .swiper-container .swiper-pagination",breakpoints:{6e3:{slidesPerView:4,spaceBetween:10},800:{slidesPerView:1,slidesPerGroup:1}}})}},a=!1;e.OptusHandsetCarousel=function(s){function r(e,t){if("byo"==s.carousel)var r="byo";else if("mbb"==s.carousel)var r="mbb";else if("postpaid-tablet"==s.carousel)var r="tablets";else var r="handsetplans";var o=ractiveHandsetCarousel.get("selectSku");if(s.pageConfig)if("slugs"in s.pageConfig.plans[r]){for(var n=s.pageConfig.plans[r].skus,i=0;i<n.length;i++)if(n[i].id==o.id){for(var l=0;l<n[i].plans.plus.length;l++)if(n[i].plans.plus[l].id==e)return n[i].plans.plus[l];for(var l=0;l<n[i].plans.flex.length;l++)if(n[i].plans.flex[l].id==e)return n[i].plans.flex[l];n[i].location?(n[i].location.flex?a=n[i].location.flex:n[i].location.plus&&(a=n[i].location.plus),a=parseInt(a)):a=!1}handsets=s.pageConfig.plans[r].slugs;for(var i=0;i<handsets.length;i++){var n=handsets[i];if(n.id==t.slug){for(var l=0;l<n.plans.plus.length;l++)if(n.plans.plus[l].id==e)return n.plans.plus[l];for(var l=0;l<n.plans.flex.length;l++)if(n.plans.flex[l].id==e)return n.plans.flex[l]}}}else for(var c=s.pageConfig.plans[r],i=0;i<c.length;i++)if(c[i].id==e)return c[i];return!1}function o(e,t,a){var o=r(e,a);return o&&t in o?o[t]:!!s.pageConfig.page[t]&&s.pageConfig.page[t]}function n(t,a){e.each(t,function(e,t){t.defaultValue&&(a.push(t),t.added=!0)})}function i(t,a){return t=e.grep(t,function(e,t){return e.id!=a.id&&e.groupChild!=a.compID||(e.added=!1),e.id!==a.id&&e.groupChild!==a.compID})}function l(){for(var t=[".plan-header",".feature.PO_Included_Data",".feature.PO_Business_Care",".feature.PO_Included_Calls_Text",".feature.PO_Included_int",".feature.PO_Included_roaming",".feature.PO_Included_Entertainment",".plan-footer",".feature.bundle",".feature.PO_save",".feature.PO_onemonth"],a=0;a<t.length;a++){var s=0;e(t[a]).each(function(){e(this).css("height","auto"),e(this).height()>s&&(s=e(this).height())}),e(t[a]).each(function(){e(this).height(s)})}}function c(e,t,a){if(""!=e&&""==t){e=parseInt(e.substring(0,e.toLowerCase().indexOf("gb")));var s=f(e,a);s.length>0&&(t=s[0].colour)}else if(""==e&&""!=t){var r=v(t,a);e=r[0]}else _.isString(e)&&(e=parseInt(e.substring(0,e.toLowerCase().indexOf("gb"))));for(var o=0;o<a.skus.length;o++)if(a.skus[o].storage===e&&a.skus[o].colour.toLowerCase().replace(" ","")===t.toLowerCase().replace(" ",""))return a.skus[o]}function d(e){for(var t=ractiveHandsetCarousel.get("handsets"),a=0;a<t.length;a++)if(t[a].name.toLowerCase()===e.name.toLowerCase())return a}function p(e,t){var a=[];if(t.length>0){for(var s=0;s<e.length;s++)for(var r=0;r<t.length;r++)if(t[r].toLowerCase()==e[s].name.toLowerCase()){a.push(e[s]);break}}else a=e;return a}function u(e){for(var t=[],a=0;a<e.skus.length;a++)-1==t.indexOf(e.skus[a].storage)&&t.push(e.skus[a].storage);return t}function v(e,t){for(var a=[],s=0;s<t.skus.length;s++)t.skus[s].colour.toLowerCase().replace(" ","")===e.toLowerCase().replace(" ","")&&a.push(t.skus[s].storage);return a}function f(e,t){for(var a=[],s=0;s<t.skus.length;s++)if(t.skus[s].storage===e){var r={};r.colour=t.skus[s].colour.toLowerCase(),r.imageColour=t.skus[s].imageColour,r.listImage=t.skus[s].listImage,r.proImage=t.skus[s].proImage,r.colorIndex=t.skus[s].colorIndex,a.push(r)}return a.sort(function(e,t){return e.colorIndex>t.colorIndex?1:-1}),a}function g(){var e=ractiveHandsetCarousel.get("selectPlan");if(""!=e.plan){var t=ractiveHandsetCarousel.get("summary"),a=ractiveHandsetCarousel.get("selectHandset"),r=ractiveHandsetCarousel.get("customerType"),n=ractiveHandsetCarousel.get("selectSku"),i=x(e.plan,a.name,r);t.monthlyCost=i.disPlanCost,t.originalMonthlyCost=i.planCost;var l=o(e.plan.id,"discount",ractiveHandsetCarousel.get("selectHandset"));ractiveHandsetCarousel.get("secondServiceAdded");l.percent?(s.offerDiscount=l.percent,t.monthlyCost=t.monthlyCost*((100-s.offerDiscount)/100),e.plan.percent_discount=l.percent,ractiveHandsetCarousel.set("selectPlan",e)):l.dollar&&(t.monthlyCost=t.monthlyCost,e.plan.dollar_discount=s.dollarDiscount,ractiveHandsetCarousel.set("selectPlan",e));var c=e.plan.position-1;"plus"===e.plan.planType?t.handsetCost=n.mro.postpaid[c]:"flex"===e.plan.planType?t.handsetCost=n.mro.leasing[c]:t.handsetCost=0;var d=0,p=0;_.each(e.selectedBoltons,function(t){"MONTHLY"===t.costType?"YES_STREAMING_MOB_5"==t.id?"byo"==e.plan.planType?d+=t.cost:d=d:d+=t.cost:p+=t.cost}),t.totalMonthlyExtraCost=d,t.totalUpfrontFeeCost=p,t.totalMonthlyCost=t.monthlyCost+t.totalMonthlyExtraCost+t.handsetCost,t.mtc=t.totalMonthlyCost*e.plan.contractLength+t.totalUpfrontFeeCost,1==ractiveHandsetCarousel.get("secondServiceAdded")&&(t.totalMonthlyCost+=15,t.mtc+=180),ractiveHandsetCarousel.set("summary",t)}}function w(e){for(var t="",a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",s=0;s<e;s++)t+=a.charAt(Math.floor(Math.random()*a.length));return t}function C(){var e="https://offer.optus.com.au/rebuild/offline/";s.development||(e="https://offer.optus.com.au/offlineform/");var t=ractiveHandsetCarousel.get("selectSku"),a=ractiveHandsetCarousel.get("selectPlan"),r=ractiveHandsetCarousel.get("customerType"),n=ractiveHandsetCarousel.get("student"),i=ractiveHandsetCarousel.get("selectHandset"),l=ractiveHandsetCarousel.get("page"),c=ractiveHandsetCarousel.get("isWatchAdded");if(e+="new"===r||"new1"===r?"shoppingcart?action=addToCart":"p2p"===r?"shoppingcart?action=pre2Post":"existing"===r?"upgrade?action=addToCart&":"shoppingcart?action=addToCart","mbb"===ractiveHandsetCarousel.get("carouselType")?e+="&resourceId=SIM-4G%20SIM%20OMB&device=OMB":"postpaid-tablet"===ractiveHandsetCarousel.get("carouselType")?e+="&resourceId="+t.id+"&device=OMB":"mbb-modems"===ractiveHandsetCarousel.get("carouselType")?e+="&resourceId="+t.id+"&device=OMB":e+="&resourceId="+t.id,e+="&externalPackageId="+a.plan.id,e+="&resourceCL="+a.plan.contractLength,"BYO-Handset"===t.id?e+="&colorId=BYO-Handset":e+="&colorId=",a.selectedBoltons.length>0||s.boltons.length>0||boltonHack||"epl"==l||("fbreg"==l||"fbmetro"==l)&&("10227"==a.plan.id||"10228"==a.plan.id)){boltons="&boltonIds=";for(var d=0;d<a.selectedBoltons.length;d++)boltons+=a.selectedBoltons[d].compID+",";for(var d=0;d<s.boltons.length;d++)boltons+=s.boltons[d]+",";"fbreg"!=l&&"fbmetro"!=l||"10227"!=a.plan.id||(boltons+="11424,");var p=o(a.plan.id,"discount",i);boltons+=p?p.bolton_id+",":s.pageConfig.page.discount.bolton_id+",",boltons=boltons.slice(0,-1),e+=boltons}e+="&productOfferingCL="+a.plan.contractLength;for(var d=0;d<s.urlparams.length;d++)e+="&"+s.urlparams[d].name+"="+s.urlparams[d].value;return e+="&ctype="+s.propType,!0===n&&(e+="&student=true"),c&&(e+="&visa=Samsung-GS9-tab-a-bundle"),e+="&tactical="+P(a.plan,i.name,r),1==ractiveHandsetCarousel.get("secondServiceAdded")&&(e+="&accessory=second-service"),e}function h(){var e="https://www.optus.com.au/";s.development||(e="https://www.optus.com.au/");var t=ractiveHandsetCarousel.get("selectSku"),a=ractiveHandsetCarousel.get("selectPlan"),r=ractiveHandsetCarousel.get("customerType"),o=ractiveHandsetCarousel.get("page"),n="shop/shoppingcart?action=addToCart&resourceId=";"new"===r?n="smb"===s.propType?"business/shoppingcart?action=onlineOfflineOrder&resourceId=":"shop/shoppingcart?action=addToCart&resourceId=":"p2p"===r?n="shop/shoppingcart?action=pre2Post&resourceId=":"existing"===r&&(n="smb"===s.propType?"business/upgrade?action=addToCart&resourceId=":"shop/upgrade?action=addToCart&resourceId="),e+=n+t.id,e+="&resourceCL="+a.plan.contractLength,"BYO-Handset"===t.id?e+="&colorId=BYO-Handset":e+="&colorId=",e+="&externalPackageId="+a.plan.id,e+="&productOfferingCL="+a.plan.contractLength;var i=(new Date).getTime();if(i=w(1)+Math.floor(1e3*Math.random()).toString()+i,e+="&atcid="+i,a.selectedBoltons.length>0||s.boltons.length>0||boltonHack||"spring"==o){boltons="&boltonIds=";for(var l=0;l<a.selectedBoltons.length;l++)boltons+=a.selectedBoltons[l].compID+",";for(var l=0;l<s.boltons.length;l++)boltons+=s.boltons[l]+",";"spring"==o&&(boltons+="30892,"),boltons=boltons.slice(0,-1),e+=boltons}for(var l=0;l<s.urlparams.length;l++)e+="&"+s.urlparams[l].name+"="+s.urlparams[l].value;return 1==ractiveHandsetCarousel.get("secondServiceAdded")&&(e+="&accessory=second-service"),e}function m(t){var a=e(".product-selector-sticky-header"),s=0;a.length>0&&(s=a.height()),e("html, body").animate({scrollTop:e(t).offset().top-s},350)}function b(e,t){if(t)for(var a=0;a<t.length;a++)for(var s=0;s<e.length;s++)if(e[s].name===t[a]){var r=e[s];e.splice(s,1),e.splice(a,0,r)}return e}function y(e,t){return e<t?-1:e>t?1:0}function H(e,t){for(var a=0,s=0;s<t.colours.length;s++)if(e.colour.toLowerCase()==t.colours[s].colour.toLowerCase()){a=s;break}return a}function x(t,a,s){var r=t.value,o=r,n=ractiveHandsetCarousel.get("page"),i=[],l=!1,c=[],d=!1,p={};if(ractiveHandsetCarousel.set({data1:t}),t.tacticalOffer){for(var u=[],v=[],f=0;f<t.tacticalOffer.length;f++)"discount(%)"===t.tacticalOffer[f].offerType?v.push(f):"discount($)"===t.tacticalOffer[f].offerType&&u.push(f);if(u.length>0)for(var g in u){var w=e.inArray(u[g],u);if(w>=0){i.length=0,l=!1,i=t.tacticalOffer[u[g]].offerPage.split("|");for(var C in i){var h=e.inArray(i[C],i);h>=0&&n.toLowerCase()===i[C].trim().toLowerCase()&&(l=!0)}if((""==t.tacticalOffer[u[g]].offerCustomerType||t.tacticalOffer[u[g]].offerCustomerType==s)&&l&&a){d=!1,c.length=0,c=t.tacticalOffer[u[g]].offerDeviceList.split("|");for(var m in c){var h=e.inArray(c[m],c);h>=0&&a.toLowerCase()===c[m].trim().toLowerCase()&&(d=!0)}o="all"===t.tacticalOffer[u[g]].offerDeviceRange?r-t.tacticalOffer[u[g]].offervalue:"excluded"!==t.tacticalOffer[u[g]].offerDeviceRange||d?"included"===t.tacticalOffer[u[g]].offerDeviceRange&&d?r-t.tacticalOffer[u[g]].offervalue:r:r-t.tacticalOffer[u[g]].offervalue}}}if(v.length>0)for(var g in v){var b=e.inArray(v[g],v);if(b>=0){i.length=0,l=!1,i=t.tacticalOffer[v[g]].offerPage.split("|");for(var C in i){var h=e.inArray(i[C],i);h>=0&&n.toLowerCase()===i[C].trim().toLowerCase()&&(l=!0)}if((""==t.tacticalOffer[v[g]].offerCustomerType||t.tacticalOffer[v[g]].offerCustomerType==s)&&l&&a){d=!1,c.length=0,c=t.tacticalOffer[v[g]].offerDeviceList.split("|");for(var m in c){var h=e.inArray(c[m],c);h>=0&&a.toLowerCase()===c[m].trim().toLowerCase()&&(d=!0)}o="all"===t.tacticalOffer[v[g]].offerDeviceRange?r*(100-t.tacticalOffer[v[g]].offervalue)/100:"excluded"!==t.tacticalOffer[v[g]].offerDeviceRange||d?"included"===t.tacticalOffer[v[g]].offerDeviceRange&&d?r*(100-t.tacticalOffer[v[g]].offervalue)/100:r:r*(100-t.tacticalOffer[v[g]].offervalue)/100}}}}return p.planCost=parseFloat(r),p.disPlanCost=parseFloat(o),p}function P(e,t,a){var s="",r=ractiveHandsetCarousel.get("page"),o=[],n=!1,i=[],l=!1;if(e.tacticalOffer){for(var c=0;c<e.tacticalOffer.length;c++){if(o.length=0,n=!1,e.tacticalOffer[c].offerPage.indexOf("|")>=0){o=e.tacticalOffer[c].offerPage.split("|");for(var d in o)r.toLowerCase()===o[d].trim().toLowerCase()&&(n=!0)}else r.toLowerCase()===e.tacticalOffer[c].offerPage.trim().toLowerCase()&&(n=!0);if((""==e.tacticalOffer[c].offerCustomerType||e.tacticalOffer[c].offerCustomerType==a)&&n){if(l=!1,i.length=0,i=e.tacticalOffer[c].offerDeviceList.split("|"),t)for(var p in i)t.toLowerCase()===i[p].trim().toLowerCase()&&(l=!0);"all"===e.tacticalOffer[c].offerDeviceRange?s+=e.tacticalOffer[c].id+",":"excluded"!==e.tacticalOffer[c].offerDeviceRange||l?"included"===e.tacticalOffer[c].offerDeviceRange&&l&&(s+=e.tacticalOffer[c].id+","):s+=e.tacticalOffer[c].id+","}}s=s.slice(0,-1)}return s}function k(e,t){var a=e[0],s=t.name,r=ractiveHandsetCarousel.get("customerType"),o=ractiveHandsetCarousel.get("page"),n=[],i=[],l=!1,c=[],d=!1;if(a.tacticalOffer.length>0)for(var p=0;p<a.tacticalOffer.length;p++)if("banner"===a.tacticalOffer[p].offerType){i.length=0,l=!1,i=a.tacticalOffer[p].offerPage.split("|");for(var u in i)o.toLowerCase()===i[u].trim().toLowerCase()&&(l=!0);if((""==a.tacticalOffer[p].offerCustomerType||a.tacticalOffer[p].offerCustomerType==r)&&l){d=!1,c.length=0,c=a.tacticalOffer[p].offerDeviceList.split("|");for(var v in c)s.toLowerCase()===c[v].trim().toLowerCase()&&(d=!0);"all"===a.tacticalOffer[p].offerDeviceRange?n.push(a.tacticalOffer[p]):"excluded"!==a.tacticalOffer[p].offerDeviceRange||d?"included"===a.tacticalOffer[p].offerDeviceRange&&d&&n.push(a.tacticalOffer[p]):n.push(a.tacticalOffer[p])}}return n}function T(t,a){var s=[];return t.length>0&&e.each(a,function(e,a){t.indexOf(a.id)>-1&&s.push(a)}),s}function S(t,a){var s={};return e.each(a,function(e,a){a.id===t&&(s=a)}),s}function B(e,t,a,s,r){ga("optus.send",{hitType:e,eventCategory:t,eventAction:a,eventLabel:s,eventValue:r})}Ractive.DEBUG=!1;var O=Ractive.defaults.data;O.isSuggestedPlan=function(e){ractiveHandsetCarousel.get("selectHandset").name;if(o(e,"hero",ractiveHandsetCarousel.get("selectHandset")))return!0},O.hasTactical=function(e,t){return e.tacticalOfferID.toLowerCase().indexOf(t.toLowerCase())>-1},O.isSuggestedPlanDescription=function(e){var t=(ractiveHandsetCarousel.get("selectHandset").name,o(e,"badge",ractiveHandsetCarousel.get("selectHandset")));if(t)return t},O.isShow=function(e,t,a,o){return s.pageConfig?!!r(e,ractiveHandsetCarousel.get("selectHandset")):"10140"!=e&&"10142"!=e||"Samsung Galaxy Note9"!=t||128==a},O.offerDiscountSet=function(e,t,a){var r=o(e,"discount",ractiveHandsetCarousel.get("selectHandset"));return r?r.percent:s.pageConfig.page.discount.percent};var L={development:!1,carousel:"postpaid-mobile",heroHandsets:[],campaignHandsets:[],heroPlans:null,urlparams:[],extraInclusions:"",propType:"consumer",excludedPlans:[],personalisedOffer:"",offerDiscount:0,dollarDiscount:0,customerToggle:!0,customerType:"new",contractToggle:!0,contractLength:12,selectedSku:{colour:"",storage:""},boltons:[],layout:"iphone",recommendPlan:"",initPaymentType:"",paymentType:"buy",planIdx:"0",templateSelector:"#contentTemplate",callback:function(){}},s=e.extend({},L,s);s.pageConfig&&(s.page=s.pageConfig.page.id,s.offerDiscount=s.pageConfig.page.discount.percent,s.dollarDiscount=s.pageConfig.page.discount.dollar),ractiveHandsetCarousel=new Ractive({el:"#contentContainer",template:s.templateSelector,data:{carouselType:s.carousel,offerDiscount:s.offerDiscount,dollarDiscount:s.dollarDiscount,propType:s.propType,initPaymentType:s.initPaymentType,page:s.page,paymentType:s.paymentType,customerType:s.customerType,contractToggle:s.contractToggle,customerToggle:s.customerToggle,contractLengthFilter:s.contractLength,recommendPlanID:s.recommendPlan,recommendPlan:{},handsets:[],rawPlans:{},plans:[],selectHandset:{},selectSku:{},selectPlan:{plan:"",boltons:"",boltonGroup:"",selectedBoltons:""},isWatchAdded:!1,student:!1,prePlanType:"ultimate",summary:{monthlyCost:0,handsetCost:0,totalMonthlyCost:0,totalMonthlyExtraCost:0,totalUpfrontFeeCost:0,mtc:0},bannerOffers:[],pageConfig:s.pageConfig,format:function(e){return e=parseFloat(e),e%1!=0?e.toFixed(2):e},getMonthlyPlanCost:function(e){var t=this.get("plans."+e),a=this.get("selectHandset").name,s=this.get("customerType"),r=x(t,a,s);return r},getHandsetCost:function(e){var t=this.get("plans."+e),a=this.get("selectSku"),s=0;return s="plus"===t.planType?a.mro.postpaid[t.position-1]:"flex"===t.planType?a.mro.leasing[t.position-1]:"mbb"===t.planType?a.mro.postpaid[t.position-1]:0,parseFloat(s)},getBonusData:function(e){var t=this.get("plans."+e),a=this.get("selectHandset").name,s=this.get("customerType"),r=this.get("page"),o=!1,n=[],i=!1,l=[],c=!1;if(t.tacticalOffer)for(var d=0;d<t.tacticalOffer.length;d++)if("bonus_data"===t.tacticalOffer[d].offerType){n.length=0,i=!1,n=t.tacticalOffer[d].offerPage.split("|");for(var p in n)r.toLowerCase()===n[p].trim().toLowerCase()&&(i=!0);if((""==t.tacticalOffer[d].offerCustomerType||t.tacticalOffer[d].offerCustomerType==s)&&i){c=!1,l.length=0,l=t.tacticalOffer[d].offerDeviceList.split("|");for(var u in l)a.toLowerCase()===l[u].trim().toLowerCase()&&(c=!0);"all"===t.tacticalOffer[d].offerDeviceRange?o=t.tacticalOffer[d]:"excluded"!==t.tacticalOffer[d].offerDeviceRange||c?"included"===t.tacticalOffer[d].offerDeviceRange&&c&&(o=t.tacticalOffer[d]):o=t.tacticalOffer[d]}}return o}}}),e("#spinner").show(),e("#hcpm").hide();var I="";if("byo"===s.carousel){ractiveHandsetCarousel.get("page");I="https://offer.optus.com.au/dev/api/byo-plan-new/","undefined"!=typeof secondservice&&(I="https://offer.optus.com.au/dev/api/byo-plan-secondservice"),s.development||(I="https://offer.optus.com.au/live/api/byo-plan-new/","undefined"!=typeof secondservice&&(I="https://offer.optus.com.au/live/api/byo-plan-secondservice"))}else"postpaid-mobile"===s.carousel?(I="https://offer.optus.com.au/dev/api/handset-plan-new/","undefined"!=typeof secondservice&&(I="https://offer.optus.com.au/dev/api/handset-plan-secondservice"),s.development||(I="https://offer.optus.com.au/live/api/handset-plan-new/","undefined"!=typeof secondservice&&(I="https://offer.optus.com.au/live/api/handset-plan-secondservice"))):"postpaid-single"===s.carousel?(I="https://offer.optus.com.au/dev/api/handset-plan-new/",s.development||(I="https://offer.optus.com.au/live/api/handset-plan-new/")):"mbb"==s.carousel?(I="https://offer.optus.com.au/services/dev/api/hpcm/mbb/",s.development||(I="https://offer.optus.com.au/live/api/mbb-plan-new")):"mbb-modems"==s.carousel?(I="https://offer.optus.com.au/dev/api/modem-plan-new",s.development||(I="https://offer.optus.com.au/live/api/modem-plan-new")):"postpaid-tablet"===s.carousel&&(I="https://offer.optus.com.au/dev/api/tablet-plan-new",s.development||(I="https://offer.optus.com.au/live/api/tablet-plan-new"));"smb"===s.propType?I+="?type=smb":I+="?type=consumer","prepaid-sim"==s.carousel?(I="https://offer.optus.com.au/dev/api/prepaid-data/?type=sim",s.development||(I="https://offer.optus.com.au/api/prepaid-data/?type=sim")):"prepaid-handset"==s.carousel&&(I="https://offer.optus.com.au/dev/api/prepaid-data/?type=handset",s.development||(I="https://offer.optus.com.au/api/prepaid-data/?type=handset")),s.excludedPlans&&(I=I+"&exclusions="+s.excludedPlans),"postpaid-single"===s.carousel&&(s.campaignHandsets.length>0&&(I=I+"&name="+s.campaignHandsets.toString()),""!=s.layout&&e(".single-handset-wrap").attr("id",s.layout));var D,V,A,G,M,N=[];if(s.dataInfo){e("#spinner").hide(),e("#hcpm").show();var R=s.dataInfo;if("prepaid-sim"==s.carousel){ractiveHandsetCarousel.set({plans:R});new Swiper(".plan-slider .swiper-container",{grabCursor:!0,observer:!0,nextButton:".plan-slider .swiper-container .swiper-button-next",prevButton:".plan-slider .swiper-container .swiper-button-prev",pagination:".plan-slider .swiper-container .swiper-pagination",breakpoints:{6e3:{slidesPerView:3,spaceBetween:10},986:{slidesPerView:3,spaceBetween:10},860:{slidesPerView:2,spaceBetween:10},500:{slidesPerView:1,spaceBetween:10}}})}else if("prepaid-handset"==s.carousel)ractiveHandsetCarousel.set({handsets:R});else{if("new"==s.customerType?(e(".filter.customer_type").addClass("hide"),e(".filter-option.new_or_existing_new").addClass("active")):"existing"==s.customerType?(e(".filter.customer_type").removeClass("hide"),e(".filter-option.new_or_existing_new").removeClass("active"),e(".filter-option.new_or_existing_existing").addClass("active"),e(".ux-radio-button input[type=radio][value=existing]").prop("checked","checked")):"p2p"==s.customerType&&(e(".filter.customer_type").removeClass("hide"),e(".filter-option.new_or_existing_new").removeClass("active"),e(".filter-option.new_or_existing_existing").addClass("active"),e(".ux-radio-button input[type=radio][value=p2p]").prop("checked","checked")),"mbb"!=s.carousel){var F=b(R.handsets,s.heroHandsets);"postpaid-mobile"!==s.carousel&&"postpaid-tablet"!==s.carousel&&"mbb-modems"!==s.carousel||(F=p(F,s.campaignHandsets)),F[0].skus=F[0].skus,F[0].storage=F[0].storage;var W=c(s.selectedSku.storage,s.selectedSku.colour,F[0])||F[0].skus[0];F[0].colours=f(W.storage,F[0]);var $=[];$="buy"==s.paymentType?T(F[0].buyPlanList,R.plans.postpaid):T(F[0].leasingPlanList,R.plans.leasing);var E={};E=""!=s.recommendPlan?S(s.recommendPlan,$):$[0],ractiveHandsetCarousel.set({handsets:F,selectHandset:F[0],selectSku:W,plans:$,rawPlans:R.plans,rawBoltons:R.boltons,recommendPlan:E})}"byo"===s.carousel?($=R.plans.byo,ractiveHandsetCarousel.set({plans:R.plans.byo,contractLengthFilter:s.contractLength})):"mbb"==s.carousel?($=R.plans.mbb,ractiveHandsetCarousel.set({plans:R.plans.mbb,rawPlans:R.plans,rawBoltons:R.boltons,contractLengthFilter:s.contractLength})):"mbb-modems"==s.carousel&&ractiveHandsetCarousel.set({contractLengthFilter:24}),"buy"==s.paymentType?e(".leasing_copy").addClass("hide"):e(".leasing_copy").removeClass("hide"),"mbb"!=s.carousel&&ractiveHandsetCarousel.set("bannerOffers",k($,F[0]));new Swiper(".banner-slider .swiper-container",{grabCursor:!1,observer:!0,autoHeight:!0,allowSwipeToPrev:!1,allowSwipeToNext:!1,nextButton:".banner-slider .swiper-container .swiper-button-next",prevButton:".banner-slider .swiper-container .swiper-button-prev",slidesPerView:1});if("postpaid-mobile"===s.carousel||"postpaid-tablet"===s.carousel||"mbb-modems"===s.carousel){new Swiper(".phone-slider .swiper-container",{grabCursor:!1,observer:!0,autoHeight:!0,nextButton:".phone-slider .swiper-container .swiper-button-next",prevButton:".phone-slider .swiper-container .swiper-button-prev",pagination:".phone-slider .swiper-container .swiper-pagination",breakpoints:{6e3:{slidesPerView:4,spaceBetween:10,slidesPerGroup:4},860:{slidesPerView:3,spaceBetween:10,slidesPerGroup:2},500:{slidesPerView:1,spaceBetween:10,slidesPerGroup:1}}})}else"postpaid-single"===s.carousel&&(D=new Swiper(".product-image-main-gallery  .swiper-container",{spaceBetween:10,grabCursor:!0,observer:!0,onSlideChangeStart:function(t){var a=ractiveHandsetCarousel.get("selectHandset"),s=ractiveHandsetCarousel.get("selectSku"),r=c(s.storage,a.colours[t.activeIndex].colour,a);a.storage=v(a.colours[t.activeIndex].colour,a),ractiveHandsetCarousel.set({selectHandset:a,selectSku:r}),g(),e(".summary").addClass("hide")}}),V=new Swiper(".product-image-nav-gallery .swiper-container",{centeredSlides:!0,grabCursor:!0,observer:!0,slideToClickedSlide:!0,breakpoints:{6e3:{slidesPerView:5,spaceBetween:12},860:{slidesPerView:4,spaceBetween:10},500:{slidesPerView:4,spaceBetween:10}}}),D.params.control=V,V.params.control=D,V.slideTo(W.colorIndex-1),e(window).scroll(function(){var t=e(".product-selector-sticky-header").height(),a=e(".sticky-holder").offset().top-100-t;e(window).scrollTop()>a?e(".product-selector-sticky-header").addClass("show"):e(".product-selector-sticky-header ").removeClass("show")}));A="epl"===s.page?new Swiper(".plan-slider .swiper-container",{grabCursor:!0,observer:!0,nextButton:".plan-slider .swiper-container .swiper-button-next",prevButton:".plan-slider .swiper-container .swiper-button-prev",pagination:".plan-slider .swiper-container .swiper-pagination",initialSlide:parseInt(s.planIdx),breakpoints:{6e3:{slidesPerView:2,spaceBetween:10},860:{slidesPerView:2,spaceBetween:10},500:{slidesPerView:1,spaceBetween:10}}}):"aoss"===s.page||"spring"===s.page?new Swiper(".plan-slider .swiper-container",{grabCursor:!0,observer:!0,nextButton:".plan-slider .swiper-container .swiper-button-next",prevButton:".plan-slider .swiper-container .swiper-button-prev",pagination:".plan-slider .swiper-container .swiper-pagination",slidesPerView:1,initialSlide:parseInt(s.planIdx),spaceBetween:0}):new Swiper(".plan-slider .swiper-container",{grabCursor:!0,observer:!0,nextButton:".plan-slider .swiper-container .swiper-button-next",prevButton:".plan-slider .swiper-container .swiper-button-prev",pagination:".plan-slider .swiper-container .swiper-pagination",initialSlide:parseInt(s.planIdx),breakpoints:{6e3:{slidesPerView:3.5,spaceBetween:10},1150:{slidesPerView:2.65,spaceBetween:10},860:{slidesPerView:2.25,spaceBetween:10},500:{slidesPerView:1,spaceBetween:10}}})}s.pageConfig&&(s.page=s.pageConfig.page.id,s.offerDiscount=s.pageConfig.page.discount.percent,s.dollarDiscount=s.pageConfig.page.discount.dollar),s.callback(),e("*[data-scrollto]").click(function(t){t.preventDefault();var a=e(this).data("scrollto");if($target=e('*[data-scrollto_target="'+a+'"]'),$target.length>0){e("html, body").animate({scrollTop:$target.offset().top-0},300)}}),e("#r-86").on("toggled",function(t,a){var s=a.parent();e("html, body").animate({scrollTop:s.offset().top-0},350)}),e(document).foundation(),e(document).foundation("tab","reflow"),t.init(),e(document).on("opened.fndtn.reveal","[data-reveal]",function(){M=new Swiper(".fetch-channel-lightbox .swiper-container",{grabCursor:!0,nextButton:".fetch-channel-lightbox .swiper-button-next",prevButton:".fetch-channel-lightbox .swiper-button-prev",slidesPerView:1})})}else e.ajax({url:I,dataType:"json",success:function(a){if(e("#spinner").hide(),e("#hcpm").show(),"prepaid-sim"==s.carousel){ractiveHandsetCarousel.set({plans:a});new Swiper(".plan-slider .swiper-container",{grabCursor:!0,observer:!0,centeredSlides:!0,nextButton:".plan-slider .swiper-container .swiper-button-next",prevButton:".plan-slider .swiper-container .swiper-button-prev",pagination:".plan-slider .swiper-container .swiper-pagination",breakpoints:{6e3:{slidesPerView:3,spaceBetween:10},986:{slidesPerView:3,spaceBetween:10},860:{slidesPerView:2,spaceBetween:10},500:{slidesPerView:1,spaceBetween:10}}})}else if("prepaid-handset"==s.carousel)ractiveHandsetCarousel.set({handsets:a});else{if("new"==s.customerType?(e(".filter.customer_type").addClass("hide"),e(".filter-option.new_or_existing_new").addClass("active")):"existing"==s.customerType?(e(".filter.customer_type").removeClass("hide"),e(".filter-option.new_or_existing_new").removeClass("active"),e(".filter-option.new_or_existing_existing").addClass("active"),e(".ux-radio-button input[type=radio][value=existing]").prop("checked","checked")):"p2p"==s.customerType&&(e(".filter.customer_type").removeClass("hide"),e(".filter-option.new_or_existing_new").removeClass("active"),e(".filter-option.new_or_existing_existing").addClass("active"),e(".ux-radio-button input[type=radio][value=p2p]").prop("checked","checked")),"mbb"!=s.carousel){var r=b(a.handsets,s.heroHandsets);"postpaid-mobile"!==s.carousel&&"postpaid-tablet"!==s.carousel&&"mbb-modems"!==s.carousel||(r=p(r,s.campaignHandsets)),r[0].skus=r[0].skus,r[0].storage=r[0].storage;var o=c(s.selectedSku.storage,s.selectedSku.colour,r[0])||r[0].skus[0];r[0].colours=f(o.storage,r[0]);var n=[];n="buy"==s.paymentType?T(r[0].buyPlanList,a.plans.postpaid):T(r[0].leasingPlanList,a.plans.leasing);var i={};i=""!=s.recommendPlan?S(s.recommendPlan,n):n[0],ractiveHandsetCarousel.set({handsets:r,selectHandset:r[0],selectSku:o,plans:n,rawPlans:a.plans,rawBoltons:a.boltons,recommendPlan:i})}"byo"===s.carousel?(n=a.plans.byo,ractiveHandsetCarousel.set({plans:a.plans.byo,contractLengthFilter:s.contractLength,flybuysMapping:a.flybuysMapping})):"mbb"==s.carousel?(n=a.plans.mbb,ractiveHandsetCarousel.set({plans:a.plans.mbb,rawPlans:a.plans,rawBoltons:a.boltons,contractLengthFilter:s.contractLength})):"mbb-modems"==s.carousel&&ractiveHandsetCarousel.set({contractLengthFilter:24}),"buy"==s.paymentType?e(".leasing_copy").addClass("hide"):e(".leasing_copy").removeClass("hide"),"mbb"!=s.carousel&&ractiveHandsetCarousel.set("bannerOffers",k(n,r[0]));new Swiper(".banner-slider .swiper-container",{grabCursor:!1,observer:!0,autoHeight:!0,allowSwipeToPrev:!1,allowSwipeToNext:!1,nextButton:".banner-slider .swiper-container .swiper-button-next",prevButton:".banner-slider .swiper-container .swiper-button-prev",slidesPerView:1});if("postpaid-mobile"===s.carousel||"postpaid-tablet"===s.carousel||"mbb-modems"===s.carousel){new Swiper(".phone-slider .swiper-container",{grabCursor:!1,observer:!0,autoHeight:!0,onSlideChangeEnd:function(){e(window).width()<=500&&e(".swiper-slide.swiper-slide-active .carousel-option").click()},nextButton:".phone-slider .swiper-container .swiper-button-next",prevButton:".phone-slider .swiper-container .swiper-button-prev",pagination:".phone-slider .swiper-container .swiper-pagination",breakpoints:{6e3:{slidesPerView:4,spaceBetween:10,slidesPerGroup:4},860:{slidesPerView:3,spaceBetween:10,slidesPerGroup:2},500:{slidesPerView:1,spaceBetween:10,slidesPerGroup:1}}})}else"postpaid-single"===s.carousel&&(D=new Swiper(".product-image-main-gallery  .swiper-container",{spaceBetween:10,grabCursor:!0,observer:!0,onSlideChangeStart:function(t){var a=ractiveHandsetCarousel.get("selectHandset"),s=ractiveHandsetCarousel.get("selectSku"),r=c(s.storage,a.colours[t.activeIndex].colour,a);a.storage=v(a.colours[t.activeIndex].colour,a),ractiveHandsetCarousel.set({selectHandset:a,selectSku:r}),g(),e(".summary").addClass("hide")}}),V=new Swiper(".product-image-nav-gallery .swiper-container",{centeredSlides:!0,grabCursor:!0,observer:!0,slideToClickedSlide:!0,breakpoints:{6e3:{slidesPerView:5,spaceBetween:12},860:{slidesPerView:4,spaceBetween:10},500:{slidesPerView:4,spaceBetween:10}}}),D.params.control=V,V.params.control=D,V.slideTo(o.colorIndex-1),e(window).scroll(function(){var t=e(".product-selector-sticky-header").height(),a=e(".sticky-holder").offset().top-100-t;e(window).scrollTop()>a?e(".product-selector-sticky-header").addClass("show"):e(".product-selector-sticky-header ").removeClass("show")}));if("epl"===s.page)A=new Swiper(".plan-slider .swiper-container",{grabCursor:!0,observer:!0,nextButton:".plan-slider .swiper-container .swiper-button-next",prevButton:".plan-slider .swiper-container .swiper-button-prev",pagination:".plan-slider .swiper-container .swiper-pagination",initialSlide:parseInt(s.planIdx),breakpoints:{6e3:{slidesPerView:2,spaceBetween:10},860:{
slidesPerView:2,spaceBetween:10},500:{slidesPerView:1,spaceBetween:10}}});else if("aoss"===s.page||"spring"===s.page)A=new Swiper(".plan-slider .swiper-container",{grabCursor:!0,observer:!0,nextButton:".plan-slider .swiper-container .swiper-button-next",prevButton:".plan-slider .swiper-container .swiper-button-prev",pagination:".plan-slider .swiper-container .swiper-pagination",slidesPerView:1,initialSlide:parseInt(s.planIdx),spaceBetween:0});else{var l=!1;"39reginal"!=s.page&&"phonefest"!=s.page&&"201902promo"!=s.page||(l=!0),A=new Swiper(".plan-slider .swiper-container",{grabCursor:!0,observer:!0,centeredSlides:l,nextButton:".plan-slider .swiper-container .swiper-button-next",prevButton:".plan-slider .swiper-container .swiper-button-prev",pagination:".plan-slider .swiper-container .swiper-pagination",initialSlide:parseInt(s.planIdx),breakpoints:{6e3:{slidesPerView:3.5,spaceBetween:10},1150:{slidesPerView:2.65,spaceBetween:10},860:{slidesPerView:2.25,spaceBetween:10},500:{slidesPerView:1,spaceBetween:10}}})}}s.callback(),e("*[data-scrollto]").click(function(t){t.preventDefault();var a=e(this).data("scrollto");if($target=e('*[data-scrollto_target="'+a+'"]'),$target.length>0){$target.is(".accordion-item-caption")&&$target.closest("li").is(":not(.active)")&&$target.trigger("click");var r=0;"postpaid-single"==s.carousel&&(r=e(".product-selector-sticky-header").height()),e("html, body").animate({scrollTop:$target.offset().top-r},300)}}),e("#r-86").on("toggled",function(t,a){var s=a.parent();e("html, body").animate({scrollTop:s.offset().top-0},350)}),e(document).foundation(),e(document).foundation("tab","reflow"),t.init(),e(document).on("opened.fndtn.reveal","[data-reveal]",function(){M=new Swiper(".fetch-channel-lightbox .swiper-container",{grabCursor:!0,nextButton:".fetch-channel-lightbox .swiper-button-next",prevButton:".fetch-channel-lightbox .swiper-button-prev",slidesPerView:1})})},error:function(){}});ractiveHandsetCarousel.on("change",function(){setTimeout(function(){l()},50)}),ractiveHandsetCarousel.on("selectHandset",function(a,r){e(".handset").removeClass("active"),e(a.node).addClass("active"),r.storage=u(r).sort(y),r.colours=f(r.skus[0].storage,r),r.leasing||ractiveHandsetCarousel.set("paymentType","buy"),"201902promo"==s.page&&("iphone-xs"==r.slug||"iphone-xs-max"==r.slug||"iphone-xr"==r.slug||"samsung-galaxy-note9"==r.slug?ractiveHandsetCarousel.set("paymentType","lease"):ractiveHandsetCarousel.set("paymentType","buy"));var o=ractiveHandsetCarousel.get("paymentType"),n=ractiveHandsetCarousel.get("rawPlans"),i=[];"buy"==o?(i=T(r.buyPlanList,n.postpaid),N=T(r.buyPlanList,n.postpaid)):i=T(r.leasingPlanList,n.leasing),ractiveHandsetCarousel.set({selectHandset:r,selectSku:r.skus[0],plans:i}),"buy"==o?e(".leasing_copy").addClass("hide"):e(".leasing_copy").removeClass("hide");var l=d(r),c="handsets["+l+"].imageUrl";ractiveHandsetCarousel.set(c,r.skus[0].listImage),ractiveHandsetCarousel.set("selectPlan.plan",""),ractiveHandsetCarousel.set("student",!1),e(".summary").addClass("hide"),e(".apple-watch").addClass("hide"),ractiveHandsetCarousel.set("isWatchAdded",!1),ractiveHandsetCarousel.set("bannerOffers",k(i,r));new Swiper(".banner-slider .swiper-container",{grabCursor:!1,observer:!0,autoHeight:!0,allowSwipeToPrev:!1,allowSwipeToNext:!1,nextButton:".banner-slider .swiper-container .swiper-button-next",prevButton:".banner-slider .swiper-container .swiper-button-prev",slidesPerView:1});t.init()}),ractiveHandsetCarousel.on("selectStorage",function(t,a){var r=ractiveHandsetCarousel.get("selectHandset"),o=ractiveHandsetCarousel.get("selectSku"),n=(function(e){e.splice(3,1)}(N),v(o.colour,r));if(r.colours=f(a,r),n.indexOf(a)>-1)var i=c(a,o.colour,r);else i=c(a,r.colours[0].colour,r);if(ractiveHandsetCarousel.set({"selectHandset.colours":r.colours,selectSku:i}),"postpaid-single"===s.carousel){D.update(),V.update();var l=H(i,r);V.slideTo(l)}ractiveHandsetCarousel.set("selectPlan.plan",""),ractiveHandsetCarousel.set("student",!1),e(".summary").addClass("hide"),e(".apple-watch").addClass("hide"),ractiveHandsetCarousel.set("isWatchAdded",!1)}),ractiveHandsetCarousel.on("selectColour",function(t,r,o){e("#gallery .colour, #skus .color").removeClass("active"),e(t.node).addClass("active"),e(".storage").css("display","inline-block");var n=ractiveHandsetCarousel.get("selectHandset"),i=ractiveHandsetCarousel.get("selectSku"),l=c(i.storage,r,n);n.storage=v(r,n);var p=d(n),u="handsets["+p+"].imageUrl";ractiveHandsetCarousel.set({"selectHandset.storage":n.storage,selectSku:l});var p=d(n),u="handsets["+p+"].imageUrl";if(ractiveHandsetCarousel.set(u,l.listImage),"byo"==s.carousel)var f="byo";else if("mbb"==s.carousel)var f="mbb";else if("postpaid-tablet"==s.carousel)var f="tablets";else var f="handsetplans";for(var g=s.pageConfig.plans[f].skus,w=0;w<g.length;w++)g[w].id==l.id&&(g[w].location?(g[w].location.flex?a=g[w].location.flex:g[w].location.plus&&(a=g[w].location.plus),a=parseInt(a),A.slideTo(a)):a=!1);ractiveHandsetCarousel.set("selectPlan.plan",""),ractiveHandsetCarousel.set("student",!1),e(".summary").addClass("hide"),e(".apple-watch").addClass("hide"),ractiveHandsetCarousel.set("isWatchAdded",!1)}),ractiveHandsetCarousel.on("toggleHandset",function(t,r){e(".toggle-btn").removeClass("active"),e(t.node).addClass("active"),r.storage=u(r).sort(y),r.colours=f(r.skus[0].storage,r),r.leasing||(ractiveHandsetCarousel.set("paymentType","buy"),e(".leasing_copy").addClass("hide"));var o=ractiveHandsetCarousel.get("paymentType"),n=ractiveHandsetCarousel.get("rawPlans"),i=[];if(i="buy"==o?T(r.buyPlanList,n.postpaid):T(r.leasingPlanList,n.leasing),ractiveHandsetCarousel.set({selectHandset:r,selectSku:r.skus[0],plans:i}),"postpaid-single"===s.carousel){D.update(),V.update();var l=H(r.skus[0],r);V.slideTo(l)}ractiveHandsetCarousel.set("selectPlan.plan",""),ractiveHandsetCarousel.set("student",!1),e(".summary").addClass("hide"),e(".apple-watch").addClass("hide"),ractiveHandsetCarousel.set("isWatchAdded",!1),ractiveHandsetCarousel.set("bannerOffers",k(i,r));new Swiper(".banner-slider .swiper-container",{grabCursor:!1,observer:!0,autoHeight:!0,allowSwipeToPrev:!1,allowSwipeToNext:!1,nextButton:".banner-slider .swiper-container .swiper-button-next",prevButton:".banner-slider .swiper-container .swiper-button-prev",slidesPerView:1});a&&A.slideTo(a)}),ractiveHandsetCarousel.on("changeColour",function(t,a,s){var r=ractiveHandsetCarousel.get("selectHandset"),o=ractiveHandsetCarousel.get("selectSku"),n=c(o.storage,a,r);r.storage=v(a,r),V.slideTo(s),ractiveHandsetCarousel.set({selectHandset:r,selectSku:n}),ractiveHandsetCarousel.set("selectPlan.plan",""),ractiveHandsetCarousel.set("student",!1),e(".summary").addClass("hide"),e(".apple-watch").addClass("hide"),ractiveHandsetCarousel.set("isWatchAdded",!1)}),ractiveHandsetCarousel.on("toggleStudent",function(t){e(t.node).closest("div").find(".student_code").toggleClass("hide");var a=ractiveHandsetCarousel.get("student");!1===a?a=!0:(a=!1,e(".email_error").hide()),ractiveHandsetCarousel.set("student",a)}),ractiveHandsetCarousel.on("studentAjax",function(t){var a=e("#emailAddr").val();e.ajax({type:"GET",url:"https://offer.optus.com.au/student/promocodesetup/",dataType:"jsonp",jsonpCallback:"emailCallback",data:{emailAddr:a},success:function(t){1==t.valid?(e(".student_code").hide(),e(".email_error").hide(),e(".email-address").html(a),e(".email_success").show(),e('#form label[for="students"]').click(function(e){e.preventDefault()})):2==t.valid?(e(".student_code").show(),e(".email_error").show(),e(".email_success").hide()):(e(".student_code").show(),e(".email_error").hide(),e(".email_success").hide())},error:function(e){}})}),ractiveHandsetCarousel.on("customer-type",function(t,a){t.original.preventDefault(),ractiveHandsetCarousel.set("customerType",a);var r=ractiveHandsetCarousel.get("page");if("existing"===a?(e(".filter.customer_type").removeClass("hide"),e(".filter-option.new_or_existing_new").removeClass("active"),e(".filter-option.new_or_existing_existing").addClass("active"),"phonefest"==r?(e(".ux-radio-button input[type=radio][value=new]").prop("checked","checked"),e(".ux-radio-button input[type=radio][value=new]").click()):(e(".ux-radio-button input[type=radio][value=existing]").prop("checked","checked"),e(".ux-radio-button input[type=radio][value=existing]").click()),"byo"==s.carousel&&(ractiveHandsetCarousel.set("contractLengthFilter",12),e(".summary").addClass("hide"))):(e(".filter.customer_type").addClass("hide"),e(".filter-option.new_or_existing_new").addClass("active"),e(".filter-option.new_or_existing_existing").removeClass("active"),e("#10237").removeClass("hide")),ractiveHandsetCarousel.set("selectPlan.plan",""),ractiveHandsetCarousel.set("student",!1),e(".summary").addClass("hide"),e(".apple-watch").addClass("hide"),ractiveHandsetCarousel.set("isWatchAdded",!1),"byo"==s.carousel)e(".cta .ux-button").addClass("yellow").removeClass("blue selected").text("Buy Now"),e(".cta .ux-button.disabled").removeClass("yellow").text("Not Available Online"),e(".summary").addClass("hide");else{var o=ractiveHandsetCarousel.get("selectSku"),n=ractiveHandsetCarousel.get("paymentType");"preorder"===o.stockStatus?e(".cta .ux-button").addClass("yellow").removeClass("blue selected").text("Pre-Order"):"backorder"===o.stockStatus?e(".cta .ux-button").addClass("yellow").removeClass("blue selected").text("Back order now"):"instock"===o.stockStatus&&("buy"==n?e(".cta .ux-button").addClass("yellow").removeClass("blue selected").text("Buy Now"):e(".cta .ux-button").addClass("yellow").removeClass("blue selected").text("Lease Now"))}var i=ractiveHandsetCarousel.get("plans"),l=ractiveHandsetCarousel.get("selectHandset");ractiveHandsetCarousel.set("bannerOffers",k(i,l));new Swiper(".banner-slider .swiper-container",{grabCursor:!1,observer:!0,autoHeight:!0,allowSwipeToPrev:!1,allowSwipeToNext:!1,nextButton:".banner-slider .swiper-container .swiper-button-next",prevButton:".banner-slider .swiper-container .swiper-button-prev",slidesPerView:1})}),ractiveHandsetCarousel.on("da-selected",function(t,a){if(ractiveHandsetCarousel.set("customerType",a),"existing"===a?"byo"==s.carousel?(ractiveHandsetCarousel.set("contractLengthFilter",12),e(".summary").addClass("hide")):e("#10237").addClass("hide"):"byo"!=s.carousel&&e("#10237").removeClass("hide"),setTimeout(function(){l()},120),ractiveHandsetCarousel.set("selectPlan.plan",""),ractiveHandsetCarousel.set("student",!1),e(".summary").addClass("hide"),e(".apple-watch").addClass("hide"),ractiveHandsetCarousel.set("isWatchAdded",!1),"byo"==s.carousel)e(".cta .ux-button").addClass("yellow").removeClass("blue selected").text("Buy Now"),e(".cta .ux-button.disabled").removeClass("yellow").text("Not Available Online"),e(".summary").addClass("hide");else{var r=ractiveHandsetCarousel.get("selectSku"),o=ractiveHandsetCarousel.get("paymentType");"preorder"===r.stockStatus?e(".cta .ux-button").addClass("yellow").removeClass("blue selected").text("Pre-Order"):"backorder"===r.stockStatus?e(".cta .ux-button").addClass("yellow").removeClass("blue selected").text("Back order now"):"instock"===r.stockStatus&&("buy"==o?e(".cta .ux-button").addClass("yellow").removeClass("blue selected").text("Buy Now"):e(".cta .ux-button").addClass("yellow").removeClass("blue selected").text("Lease Now"))}var n=ractiveHandsetCarousel.get("plans"),i=ractiveHandsetCarousel.get("selectHandset");ractiveHandsetCarousel.set("bannerOffers",k(n,i));new Swiper(".banner-slider .swiper-container",{grabCursor:!1,observer:!0,autoHeight:!0,allowSwipeToPrev:!1,allowSwipeToNext:!1,nextButton:".banner-slider .swiper-container .swiper-button-next",prevButton:".banner-slider .swiper-container .swiper-button-prev",slidesPerView:1})}),ractiveHandsetCarousel.on("payment-type",function(t,a){t.original.preventDefault();var s=ractiveHandsetCarousel.get("rawPlans"),r=ractiveHandsetCarousel.get("selectHandset"),o=[];o="buy"==a?T(r.buyPlanList,s.postpaid):T(r.leasingPlanList,s.leasing),ractiveHandsetCarousel.set("paymentType",a),ractiveHandsetCarousel.set("plans",o),"lease"===a?e(".leasing_copy").removeClass("hide"):e(".leasing_copy").addClass("hide"),ractiveHandsetCarousel.set("selectPlan.plan",""),ractiveHandsetCarousel.set("student",!1),e(".apple-watch").addClass("hide"),ractiveHandsetCarousel.set("isWatchAdded",!1);var n=ractiveHandsetCarousel.get("selectSku"),i=ractiveHandsetCarousel.get("paymentType");"preorder"===n.stockStatus?e(".cta .ux-button").addClass("yellow").removeClass("blue selected").text("Pre-Order"):"backorder"===n.stockStatus?e(".cta .ux-button").addClass("yellow").removeClass("blue selected").text("Back order now"):"instock"===n.stockStatus&&("buy"==i?e(".cta .ux-button").addClass("yellow").removeClass("blue selected").text("Buy Now"):e(".cta .ux-button").addClass("yellow").removeClass("blue selected").text("Lease Now")),e(".summary").addClass("hide");var o=ractiveHandsetCarousel.get("plans"),l=ractiveHandsetCarousel.get("selectHandset");ractiveHandsetCarousel.set("bannerOffers",k(o,l));new Swiper(".banner-slider .swiper-container",{grabCursor:!1,observer:!0,autoHeight:!0,allowSwipeToPrev:!1,allowSwipeToNext:!1,nextButton:".banner-slider .swiper-container .swiper-button-next",prevButton:".banner-slider .swiper-container .swiper-button-prev",slidesPerView:1})}),ractiveHandsetCarousel.on("plan-more",function(t,a){t.original.preventDefault();var s=e(t.node).parents(".feature")[0].className;s="."+s.split(" ").join("."),e(s).find(".more-info").toggleClass("hide");var r=e(t.node).text(),o="more"===r?"less":"more";e(s).find(".more-link a").text(o),l()}),ractiveHandsetCarousel.on("selectPlan",function(t,a){var s=ractiveHandsetCarousel.get("selectSku"),r=ractiveHandsetCarousel.get("paymentType"),o=ractiveHandsetCarousel.get("page");"preorder"===s.stockStatus?e(".cta .ux-button").addClass("yellow").removeClass("blue selected").text("Pre-Order"):"backorder"===s.stockStatus?e(".cta .ux-button").addClass("yellow").removeClass("blue selected").text("Back order now"):"buy"==r?"epl"==o?e(".cta .ux-button").addClass("yellow").removeClass("blue selected").text("Select"):e(".cta .ux-button").addClass("yellow").removeClass("blue selected").text("Buy Now"):e(".cta .ux-button").addClass("yellow").removeClass("blue selected").text("Lease Now"),e(".cta .ux-button.disabled").removeClass("yellow").text("Not Available Online"),e(t.node).removeClass("yellow").addClass("blue selected").text("Selected");var i=ractiveHandsetCarousel.get("rawBoltons"),l=[];if(a.boltonID.length>0){var c=a.boltonID.split("|");for(var d in c){var p=_.findWhere(i,{id:c[d]});if(void 0!=p){var u=e.extend(!0,{},p);if(u.added=!1,u.dependency.length>0){var v=_.findWhere(i,{compID:u.dependency});void 0!=v&&(u.cost=u.cost+v.cost,u.compID=u.compID+","+v.compID)}l.push(u)}}}var f={};_.each(l,function(e){var t=e.id;f[t]=e});var w=_.groupBy(l,"group"),C=[];n(f,C),ractiveHandsetCarousel.set({"selectPlan.plan":a,"selectPlan.boltons":f,"selectPlan.boltonGroup":w,"selectPlan.selectedBoltons":C});var h=ractiveHandsetCarousel.get("selectPlan.plan");"rglop"==o&&B("event","Sales Campaign Tracking","Regional Handset Tracking",h.name+" "+s.id.replace("%20"," "),0),g(),e(".summary").addClass("hide"),e(".apple-watch").addClass("hide"),ractiveHandsetCarousel.set("isWatchAdded",!1),m("#addons"),G=new Swiper(".fetch-swiper .swiper-container",{grabCursor:!0,nextButton:".fetch-swiper .swiper-button-next",prevButton:".fetch-swiper .swiper-button-prev",breakpoints:{6e3:{slidesPerView:4,spaceBetween:10},860:{slidesPerView:2,spaceBetween:10},500:{slidesPerView:1,spaceBetween:10}}})}),ractiveHandsetCarousel.on("learn-more",function(t,a){t.original.preventDefault();var s="Show less"===e(t.node).text()?"Show more":"Show less";e(t.node).text(s),e(t.node).prev(".more-desc").toggleClass("hide")}),ractiveHandsetCarousel.on("next-section",function(t,a){t.original.preventDefault(),m(e(t.node).closest(".sections .section").removeClass("active").find(".controls").removeClass("hide").closest(".sections .section").next().addClass("active"))}),ractiveHandsetCarousel.on("edit-section",function(t,a){t.original.preventDefault(),e(".summary").addClass("hide"),e(".sections .section").removeClass("active");e(t.node).closest(".sections .section").addClass("active").find(".controls").addClass("hide");m(".sections .section.active")}),ractiveHandsetCarousel.on("toggleContractLength",function(t,a){t.original.preventDefault(),ractiveHandsetCarousel.set({contractLengthFilter:a}),ractiveHandsetCarousel.set("selectPlan.plan",""),e(".apple-watch").addClass("hide"),ractiveHandsetCarousel.set("isWatchAdded",!1),e(".cta .ux-button").addClass("yellow").removeClass("blue selected").text("Buy Now"),e(".cta .ux-button.disabled").removeClass("yellow").text("Not Available Online"),e(".summary").addClass("hide")}),ractiveHandsetCarousel.on("goToSvod",function(t,a){t.original.preventDefault(),e("#svod .tab_drawer_heading").is(":visible"),e("#svod .tab_drawer_heading[rel='"+a+"']").click(),m("#svod")}),ractiveHandsetCarousel.on("addGroupBolton",function(e,t){e.original.preventDefault();var a=ractiveHandsetCarousel.get("selectPlan.selectedBoltons"),s=ractiveHandsetCarousel.get("selectPlan.boltonGroup"),r=ractiveHandsetCarousel.get("selectPlan.boltons");if(!t.added){if(""!==t.group){var o=t.group,n=s[o];_.each(n,function(e){a=i(a,e)})}t.added=!0,a.push(t),ractiveHandsetCarousel.set("selectPlan.selectedBoltons",a),ractiveHandsetCarousel.set("selectPlan.boltonGroup",s),ractiveHandsetCarousel.set("selectPlan.boltons",r),g()}}),ractiveHandsetCarousel.on("addSS",function(e,t){ractiveHandsetCarousel.set("secondServiceAdded",!0),g()}),ractiveHandsetCarousel.on("removeSS",function(e,t){ractiveHandsetCarousel.set("secondServiceAdded",!1),g()}),ractiveHandsetCarousel.on("addBolton",function(e,t){e.original.preventDefault();var a=ractiveHandsetCarousel.get("selectPlan.selectedBoltons"),s=ractiveHandsetCarousel.get("selectPlan.boltonGroup"),r=ractiveHandsetCarousel.get("selectPlan.boltons");t.added||(t.added=!0,a.push(t),ractiveHandsetCarousel.set("selectPlan.selectedBoltons",a),ractiveHandsetCarousel.set("selectPlan.boltonGroup",s),ractiveHandsetCarousel.set("selectPlan.boltons",r),g())}),ractiveHandsetCarousel.on("removeBolton",function(e,t){e.original.preventDefault();var a=ractiveHandsetCarousel.get("selectPlan.selectedBoltons"),s=ractiveHandsetCarousel.get("selectPlan.boltonGroup"),r=ractiveHandsetCarousel.get("selectPlan.boltons");a=i(a,t),ractiveHandsetCarousel.set("selectPlan.selectedBoltons",a),ractiveHandsetCarousel.set("selectPlan.boltonGroup",s),ractiveHandsetCarousel.set("selectPlan.boltons",r),g()}),ractiveHandsetCarousel.on("addSkinnyPacks",function(e,t){e.original.preventDefault();var a=ractiveHandsetCarousel.get("selectPlan.selectedBoltons"),s=ractiveHandsetCarousel.get("selectPlan.boltonGroup"),r=ractiveHandsetCarousel.get("selectPlan.boltons");if(!t.added){if(""!==t.group){var o=t.group,n=s[o];if("ULTIMATE_PACK"===t.id)_.each(n,function(e){a=i(a,e)}),t.added=!0,a.push(t);else{_.size(_.where(a,{group:o}))<3?(t.added=!0,a.push(t)):(_.each(n,function(e){a=i(a,e)}),_.each(r,function(e){"ULTIMATE_PACK"===e.id&&(e.added=!0,a.push(e))}))}}ractiveHandsetCarousel.set("selectPlan.selectedBoltons",a),ractiveHandsetCarousel.set("selectPlan.boltonGroup",s),ractiveHandsetCarousel.set("selectPlan.boltons",r),g()}}),ractiveHandsetCarousel.on("goToegal",function(t,a){if(t.original.preventDefault(),$target=e('*[data-scrollto_target="'+a+'"]'),$target.length>0){$target.is(".accordion-item-caption")&&$target.closest("li").is(":not(.active)")&&$target.trigger("click");var r=0;"postpaid-single"==s.carousel&&(r=e(".product-selector-sticky-header").height()),e("html, body").animate({scrollTop:$target.offset().top-r},300)}}),ractiveHandsetCarousel.on("checkout",function(t){t.original.preventDefault(),e(t.node).closest(".add-on-section").removeClass("active").find(".controls").removeClass("hide"),e(".summary").removeClass("hide"),e(".apple-watch").addClass("hide"),m(".summary")}),ractiveHandsetCarousel.on("add-watch",function(e,t){e.original.preventDefault(),ractiveHandsetCarousel.set("isWatchAdded",!0),m(".summary"),g()}),ractiveHandsetCarousel.on("show-monthly-extras",function(t){t.original.preventDefault(),e("#monthlyFees").toggle()}),ractiveHandsetCarousel.on("show-monthly-extras-tablet",function(t){t.original.preventDefault(),e("#inclEnt").toggle()}),ractiveHandsetCarousel.on("buy-now",function(e){e.original.preventDefault();var t=(ractiveHandsetCarousel.get("page"),ractiveHandsetCarousel.get("selectSku"),ractiveHandsetCarousel.get("selectPlan"),"#"),a=ractiveHandsetCarousel.get("customerType"),r=ractiveHandsetCarousel.get("student"),o=ractiveHandsetCarousel.get("isWatchAdded");(t="p2p,p2p_c,stu,mnt,ptr,rpc,clickfrenzy,sec-srvce,fbdd,aoss,rglop,fbmetro,fbreg,augdeal,ss10dollar,hsale,39reginal,phonefest,mate,201902promo".indexOf(s.page)>-1||"p2p"==a||r||o?C():h())&&(window.location=t)}),ractiveHandsetCarousel.on("plan-type",function(e,t){e.original.preventDefault(),ractiveHandsetCarousel.set("prePlanType",t)}),ractiveHandsetCarousel.on("prepaid-checkout",function(e,t){e.original.preventDefault();var a="https://offer.optus.com.au/dev/prepaid/build-cart/?ordertype=prepaid&offer=ptr&handset="+t.id;s.development||(a="https://offer.optus.com.au/prepaid/build-cart/?ordertype=prepaid&offer=ptr&handset="+t.id),a&&(window.location=a)});var U=null;e(window).resize(function(){null!==U&&window.clearTimeout(U),U=setTimeout(function(){l()},120)})}}(jQuery);