function isMobile(){return navigator.userAgent.match(/(iPhone)|(iPod)|(iPad)|(android)|(Android)|(webOS)|(IEMobile)/i)}function maxLengthCheck(n){n.value.length>n.maxLength&&(n.value=n.value.slice(0,n.maxLength))}function formatSelectedValue(n,t){var i=formatDollar(n.fn.getSelectedValue(t));return i==="Unlimited"?"Unlimited <sup>~<\/sup>":i}function formatDollar(n,t){if(n===null||n===undefined)return"—";var i=n;if(typeof n=="object"&&n.Amount!==undefined&&typeof n.Amount=="function"){if(i=n.Amount(),parseFloat(i)==0)return"—";if(n.Text)return ko.utils.unwrapObservable(n.Text)}return(typeof i!="string"&&(i=i.toString()),t===!0&&i=="0")?"Nil":t===!0&&/^[9]{6,}$/.test(i)?"Unlimited":"$"+i.replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,").replace(".00","")}function sharedExtendViewModel(n){var l=null,a,f,e,v,o,y,s,r,h,w,c,p,i,t,u;if(n.MetaData.IsIE8=ko.computed(function(){return l==null&&(l=$("html.ie8").length>0),l},this).extend({throttle:$$.Client.Util.ThrottleTime}),n.buildSpecifiedItemsForm=function(){var t=$$.policy.fn.getBenefit("SPITM"),n;if(!t.fn.hasBenefitItems())for(n=0;n<5;n++)$$.policy.fn.addBenefitItem("SPITM");return!0},n.clearSpecifiedItemsForm=function(){for(var n=$$.policy.fn.getBenefit("SPITM");n.fn.hasBenefitItems();)n.BenefitItems.pop();return!0},n.MetaData.PromoAdjustments=ko.computed(function(){return ko.utils.arrayFilter(n.Adjustments(),function(n){return $.inArray(n.BriefCode(),promoCodeBriefCodes)>=0})},this).extend({throttle:$$.Client.Util.ThrottleTime}),n.MetaData.ActiveMemberAdjustment=ko.observable(""),n.MetaData.MemberAdjustments=ko.computed(function(){var t=ko.utils.arrayFilter(n.Adjustments(),function(t){return ko.utils.unwrapObservable(t.Question)&&/^MEM*/.test(t.Question.BriefCode())?(t.Value.rules&&$.each(t.Value.rules(),function(n,i){(i.rule==="minLength"||i.rule==="maxLength")&&(i.message=PrismApi.Validation.messages.adjustments.invalidMemberAdjustment.format(t.Question.Description()))}),ko.utils.unwrapObservable(t.Value)&&n.MetaData.ActiveMemberAdjustment(t.Question.BriefCode()),!0):!1});return t.length>0?t.sortBy(function(n){return n.BriefCode()}):t},this).extend({throttle:$$.Client.Util.ThrottleTime}),n.MetaData.ActiveMemberAdjustmentChanged=function(){return $.each(n.MetaData.MemberAdjustments(),function(n,t){t.Value(null)}),!0},n.MetaData.MemberAdjustmentOptions=ko.computed(function(){var t=[];return $.each(n.MetaData.MemberAdjustments(),function(n,i){t.push({value:i.Question.BriefCode(),text:i.Question.Description()})}),t},this).extend({throttle:$$.Client.Util.ThrottleTime}),ko.utils.arrayFirst($$.policy.MetaData.AllTravellers(),function(n){return ko.utils.unwrapObservable(n.HasPeCondition)})==null&&n.MetaData.EmailPolicy.extend({equal:{params:!0,message:PrismApi.Validation.messages.travellers.requiredEmailDocuments}}),n.MetaData.emailConfirm=ko.observable(n.Email.EmailAddress()),n.MetaData.emailConfirm.extend({equal:{params:$$.policy.Email.EmailAddress,message:PrismApi.Validation.messages.travellers.matchEmail},required:{params:!0,message:PrismApi.Validation.messages.travellers.requiredEmail}}),a=n.Phones(),n.Phones([]),f=ko.utils.arrayFirst(a,function(n){return n.PhoneType()=="MOB"}),n.Phones.push(f||(new $$.Data.Phone).PhoneType("MOB")),f=ko.utils.arrayFirst(a,function(n){return n.PhoneType()=="HOME"}),n.Phones.push(f||(new $$.Data.Phone).PhoneType("HOME")),n.Address.MetaData={FullAddress:ko.observable(""),FilterBy:ko.observable("")},n.Address.MetaData.FilterBy.extend({minLength:{params:4,message:PrismApi.Validation.messages.address.invalidPostCode},required:!0}),n.Address.MetaData.FullAddress.extend({requiredAll:{params:[n.Address.AddressLine1,n.Address.Suburb,n.Address.State,n.Address.Postcode],message:PrismApi.Validation.messages.travellers.invalidFullAddress},required:!0}),window.sessionStorage.FullAddress&&$$.policy.Address.MetaData.FullAddress(window.sessionStorage.FullAddress),_session.policy&&_session.policy.Plan&&_session.policy.Plan.Currency&&_session.policy.Plan.Currency.BriefCode){switch(_session.policy.Plan.Currency.BriefCode){case"AUD":e=/^[0-9]{8}$/,o=/^(0[2-5])|(0[7-8])$/,v=/^[0-9]{10}$/;break;case"NZD":e=/^[0-9]{7}$/,v=/^[0-9]{7}$/,o=/^((0[2-4])|(0[6-7])|(09))$/;break;default:e=/^[0-9]{8,12}$/,o=/^[0-9]{2}$/}y=ko.utils.arrayMap(n.Phones(),function(n){return n.PhoneNumber}).concat(ko.utils.arrayMap(ko.utils.arrayFilter(n.Phones(),function(n){return n.PhoneType()!="MOB"}),function(n){return n.AreaCode})),ko.utils.arrayForEach(n.Phones(),function(n){var t=n.PhoneType()=="HOME"?PrismApi.Validation.messages.travellers.labelPhoneHome:n.PhoneType()=="WORK"?PrismApi.Validation.messages.travellers.labelPhoneWork:PrismApi.Validation.messages.travellers.labelPhoneMobile;n.PhoneNumber.extend({pattern:{params:n.PhoneType()=="MOB"?v:e,message:PrismApi.Validation.messages.travellers.invalidPhone.format(t.toLowerCase()+(n.PhoneType()=="MOB"?"":PrismApi.Validation.messages.travellers.labelPhoneNumberTypeNumber),n.PhoneType()=="MOB"?10:8)},requiresOneOf:{params:y,message:PrismApi.Validation.messages.travellers.requiredPhoneOrMobile},allOrNone:{params:n.PhoneType()!="MOB"?[n.AreaCode,n.PhoneNumber]:[n.PhoneNumber],message:function(){return PrismApi.Validation.messages.travellers.requiredAllOrNonePhone.format(t.toLowerCase()+(n.PhoneType()=="MOB"?"":n.PhoneNumber()?PrismApi.Validation.messages.travellers.labelPhoneNumberTypeArea:PrismApi.Validation.messages.travellers.labelPhoneNumberTypeNumber))}}}),n.PhoneType()!="MOB"&&n.AreaCode.extend({pattern:{params:o,message:PrismApi.Validation.messages.travellers.invalidPhoneArea.format(t.toLowerCase())},requiresOneOf:{params:y,message:PrismApi.Validation.messages.travellers.requiredPhoneOrMobile},allOrNone:{params:[n.AreaCode,n.PhoneNumber],message:function(){return PrismApi.Validation.messages.travellers.requiredAllOrNonePhone.format(t.toLowerCase()+(n.PhoneNumber()?PrismApi.Validation.messages.travellers.labelPhoneNumberTypeArea:PrismApi.Validation.messages.travellers.labelPhoneNumberTypeNumber))}}})}),fixQuestionItems()}if(ko.bindingHandlers.slideVisible={init:function(n,t){var i=t();$(n).toggle(ko.utils.unwrapObservable(i))},update:function(n,t){var i=t();ko.utils.unwrapObservable(i)?$(n).slideDown():$(n).slideUp()}},ko.bindingHandlers.mouseOverPolicyBenefit={init:function(n,t){var i=$(ko.utils.unwrapObservable(t()));$(n).hover(function(){var r,u,t,f;if(!$(n).is(".highlighted")&&($("li.highlighted").removeClass("highlighted"),$(n).data("featureRow")||$(n).data("featureRow")==0)){if(r=$("li[data-feature-row="+$(n).data("featureRow")+"]"),u=r.first(),window.innerWidth<480)r=$("li[data-feature-row="+$(n).data("featureRow")+"]",$(n).parent()),t=$(n).parents(".column"),t.append(i),i.css("top",$(n).position().top+$(n).outerHeight()).show();else{for($("#benefits-columns").append(i),t=$(".pricing-table").last();t&&!t.position().top;)t=t.parent();f=t.position().top,i.css("top",$(n).position().top+f+$(n).outerHeight()).show()}i.addClass("wide"),r.addClass("highlighted"),i.find(".heading").html(u.first().data("feature")),i.find(".details").html(u.first().data("originalTitle")),i.show()}},function(){isMobile()||($("li[data-feature-row="+$(n).data("featureRow")+"]").removeClass("highlighted"),i.hide())})}},ko.bindingHandlers.mouseOverPopup={init:function(n,t){var i=$(ko.utils.unwrapObservable(t()));i.length>0&&$(n).hover(function(){if($(".benefit-div.highlighted").removeClass("highlighted"),!$(n).is(".highlighted")){$(this).parent().append(i),i.css("top",$(this).position().top+$(this).outerHeight()).show(),window.innerWidth>979?i.addClass("wide"):i.removeClass("wide"),$(this).addClass("highlighted");var t=$(this).find("label").first();t!=null&&(i.find(".heading").html(t.text()),i.find(".details").html(t.attr("detail"))),i.show()}},function(){isMobile()||($(this).removeClass("highlighted"),i.hide())})}},ko.bindingHandlers.select2={init:function(n,t,i){var u=t(),r=i(),f=r.lookupKey,e;$(n).select2(u),f&&(e=ko.utils.unwrapObservable(r.value),$(n).select2("data",ko.utils.arrayFirst(u.data.results,function(n){return n[f]===e}))),r.value.subscribe(function(){$(n).trigger("change")}),ko.utils.domNodeDisposal.addDisposeCallback(n,function(){$(n).select2("destroy")})},update:function(n){$(n).trigger("change")}},ko.bindingHandlers.mobilenumpad={init:function(n,t){var r=$(n),u;if(isMobile()){u=ko.utils.unwrapObservable(t())==="tel"?"tel":"number",r.attr("inputmode","numeric");r.on("focus",function(){this.type=u});r.on("blur",function(){this.type="text"});r.on("input",function(n){maxLengthCheck(n.target)})}else r.on("input",function(){this.value=this.value.replace(/\D/g,"")})}},ko.bindingHandlers.hidden={update:function(n,t){var i=ko.utils.unwrapObservable(t());ko.bindingHandlers.visible.update(n,function(){return!i})}},ko.bindingHandlers.mouseOverBootstrapPopover={init:function(n,t){var i=t(),r,u;i!==null&&i!==undefined&&i.length>0&&(r=popoverSettings,u=$(ko.utils.unwrapObservable(t())),r.container=u,$(n).popover(r))}},ko.bindingHandlers.bootstrapCollapseChange={init:function(n){var r=$(n),i;$(r).data("toggle")!="collapse"?(i=$(r),i.find('[data-parent="#'+i.attr("id")+'"]').bootstrapCollapseChange(null,i)):$(r).bootstrapCollapseChange()}},ko.bindingHandlers.placeholder={init:function(n,t){var r=t();ko.applyBindingsToNode(n,{attr:{placeholder:r}})}},ko.bindingHandlers.stopBinding={init:function(){return{controlsDescendantBindings:!0}}},ko.virtualElements.allowedBindings.stopBinding=!0,s=function(n){var t=$$.quickQuoteOptions().DefaultAdultAge;n.MetaData.Type()=="dependant"&&(t=$$.quickQuoteOptions().DefaultDependantAge),n.DateOfBirth.formattedDate("1/1/"+((new Date).getFullYear()-t))},$$.quickQuoteOptions()&&$$.quickQuoteOptions().DefaultAdultAge)while(n.PolicyHolders().length<$$.quickQuoteOptions().MinAdults)r=new PrismApi.Data.Customer(null,"adult"),s(r),n.PolicyHolders().push(r);if($$.quickQuoteOptions()&&$$.quickQuoteOptions().DefaultDependantAge)while(n.PolicyHolders().length<$$.quickQuoteOptions().MinDependants)r=new PrismApi.Data.Customer(null,"dependant"),s(r),n.PolicyHolders().push(r);for(ko.utils.arrayForEach(n.MetaData.AllTravellers(),function(n){n.DateOfBirth()||s(n)}),h=function(n){ko.utils.arrayForEach(n,function(n){(n.IsRequired==undefined||n.IsRequired())&&(n.Answer.extend({required:{params:!0,message:getQuestionValidationErrorMsg(n.BriefCode())}}),n.Answers()&&ko.utils.arrayForEach(n.Answers(),function(n){n.Questions&&n.Questions()&&h(n.Questions())}))})},h(n.Questions()),n.Questions.subscribe(function(){h(n.Questions())}),w=function(){ko.utils.arrayForEach(n.Adjustments(),function(t){var i=typeof t.Question=="function"?t.Question():t.Question,s=ko.utils.arrayMap(n.MetaData.PromoAdjustments(),function(n){return n.Value}),r,o,u,f,e;i&&(r=getQuestionValidationErrorMsg(i.BriefCode()),r.length==0&&(r=PrismApi.Validation.messages.travellers.requiredQuestion.format(i.Description())),i.Answer.extend({required:{params:!0,message:r}})),t.MetaData&&t.MetaData.ValueTitle&&(o=PrismApi.Validation.messages.adjustments.requiredAdjustment.format(ko.utils.unwrapObservable(t.MetaData.ValueTitle)),u=$.inArray(t.BriefCode(),promoCodeBriefCodes)>-1,u&&s.length==1&&(o=promoCodeErrorMessage),u||t.MetaData.MinLength&&(f=ko.utils.unwrapObservable(t.MetaData.MinLength),f&&t.Value.extend({minLength:{params:f,message:PrismApi.Validation.messages.adjustments.invalidAdjustment.format(ko.utils.unwrapObservable(t.MetaData.ValueTitle))}})),t.MetaData.MaxLength&&(e=ko.utils.unwrapObservable(t.MetaData.MaxLength),e&&t.Value.extend({maxLength:{params:e,message:PrismApi.Validation.messages.adjustments.invalidAdjustment.format(ko.utils.unwrapObservable(t.MetaData.ValueTitle))}})))})},n.Adjustments.subscribe(function(){w()}),ko.utils.arrayForEach(n.PremiumExtraInfo,function(n){(n.IsRequired==undefined||n.IsRequired())&&n.Answer.extend({required:{params:!0,message:getQuestionValidationErrorMsg(n.BriefCode())}})}),c=0;c<n.Questions().length;c++)p=n.Questions()[c],p.Answer.extend({required:{params:!0,message:getQuestionValidationErrorMsg(p.BriefCode())}});n.Region.extend({required:{params:!0,message:PrismApi.Validation.messages.requiredRegion}}),n.Region.subscribe(function(n){n&&n.Country&&n.Country.extend({required:{params:!0,message:PrismApi.Validation.messages.requiredRegionMostTime}})}),ko.utils.arrayForEach(n.Questions(),function(n){n.Answer.extend({required:{params:!0,message:getQuestionValidationErrorMsg(n.BriefCode())}})}),ko.validation.rules.ensureWorldwideRegionHasACountrySelected={validator:function(n){var i=JSON.parse("["+n.replace(/\|/g,",")+"]");return i.length==1?!(i[0].BriefCode=="WORLD"&&(i[0].Country==null||i[0].Country.BriefCode=="WWID")):!0},message:"End Date must be greater than Start Date"},ko.validation.registerExtenders(),n.MetaData.Countries=ko.observable(""),n.MetaData.CountriesCopy=ko.computed({read:function(){return n.MetaData.Countries()},write:function(t){n.MetaData.Countries(t)}}),n.MetaData.CountriesCopy.extend({required:{params:!0,message:PrismApi.Validation.messages.requiredCountry}}),n.MetaData.Partners=ko.observableArray(window.PartnerConfigurations||[]),n.MetaData.Partner=ko.observable(window.PartnerConfiguration),n.PartnerCode.subscribe(function(t){n.MetaData.Partners().length>0&&n.MetaData.Partner(ko.utils.arrayFirst(n.MetaData.Partners(),function(n){return n.PartnerCode==t}))}),window.PartnerConfiguration==null&&PartnerConfigurations.length===1&&(n.PartnerCode(PartnerConfigurations[0].PartnerCode),n.MetaData.Partner(PartnerConfigurations[0])),ko.utils.arrayForEach(n.Benefits(),function(t){var i=ko.utils.arrayFirst(n.MetaData.Partner().OptionConfigurations,function(n){return t.BriefCode()==n.BriefCode});t.MetaData.Editor=(i||{}).Editor}),i=ko.utils.arrayFirst(n.Benefits(),function(n){return n.BriefCode()==="ITEM"}),i&&(i.MetaData.hasBenefitItems=ko.observable(i.BenefitItems().length),i.BenefitItems.subscribe(function(){i.MetaData.hasBenefitItems(i.BenefitItems().length>0),i.BenefitItems().length===0&&i.MetaData.hasBenefitItems.isModified(!1)}),i.MetaData.hasBenefitItems.extend({min:{params:1,message:PrismApi.Validation.messages.benefits.requiredItemItem}}),i.MetaData.currentlySelectedTraveller=ko.observable(),i.MetaData.currentlySelectedItem=ko.observable(),i.MetaData.currentlySelectedValue=ko.observable(),i.MetaData.currentlySelectedIsValid=ko.observable(!0),u=function(){var t=!i.MetaData.hasBenefitItems()||i.MetaData.currentlySelectedTraveller()==null&&i.MetaData.currentlySelectedItem()==null&&i.MetaData.currentlySelectedValue()==null;i.MetaData.currentlySelectedIsValid(t),i.MetaData.currentlySelectedIsValid.isModified(!1)},i.MetaData.currentlySelectedTraveller.subscribe(u),i.MetaData.currentlySelectedItem.subscribe(u),i.MetaData.currentlySelectedValue.subscribe(u),i.MetaData.currentlySelectedIsValid.extend({equal:{params:!0,message:PrismApi.Validation.messages.benefits.requiredItemAdd}})),ko.utils.arrayForEach(n.MetaData.AllTravellers(),function(n){n.MetaData.PeOptions=ko.observableArray(),ko.unwrap(n.HealixAssessment)&&ko.unwrap(n.HealixAssessment().ScreeningResult)&&ko.unwrap(n.HealixAssessment().ScreeningResult.PostScreeningCondition)&&(n.HealixAssessment().ScreeningResult.MetaData=n.HealixAssessment().ScreeningResult.MetaData||{},n.HealixAssessment().ScreeningResult.MetaData.PostScreeningMentalCondition=ko.computed(function(){return ko.utils.arrayFilter(ko.unwrap(n.HealixAssessment().ScreeningResult.PostScreeningCondition),function(n){return n.IsMentalCondition()})}),n.HealixAssessment().ScreeningResult.MetaData.PostScreeningPhysicalCondition=ko.computed(function(){return ko.utils.arrayFilter(ko.unwrap(n.HealixAssessment().ScreeningResult.PostScreeningCondition),function(n){return!n.IsMentalCondition()})}))}),t=ko.utils.arrayFirst(n.Benefits(),function(n){return n.BriefCode()==="BUS"}),t&&(t.MetaData.hasBenefitItems=ko.observable(t.BenefitItems().length),t.MetaData.ShowTravellerSelection=ko.computed(function(){return(n.Plan().CoverType.BriefCode==="DUO"||n.Plan().CoverType.BriefCode==="SGL")&&n.PolicyHolders().length>1}).extend({throttle:$$.Client.Util.ThrottleTime}),t.MetaData.TravellerDataList=ko.observableArray(),t.MetaData.ResetTravellerDataList=function(){var n=ko.utils.arrayFilter(t.MetaData.TravellerOptions(),function(n){return foundCustomer=ko.utils.arrayFilter(t.BenefitItems(),function(t){return n.MetaData.TravellerIndex.toString()===t.CustomerIndex().toString()}),foundCustomer.length==0});t.MetaData.TravellerDataList(n)},t.MetaData.IsEnabled.subscribe(function(i){var r,i;if(t.MetaData.ResetTravellerDataList(),t.MetaData.IsEnabled()&&(t.MetaData.IsPerAdultOnly&&t.MetaData.IsPerPersonChoice&&t.MetaData.TravellerOptions().length==1||!(n.Plan().CoverType.BriefCode==="DUO"&&n.PolicyHolders().length>1))){for(r=1;r<=t.MetaData.TravellerOptions().length;r++)i=new PrismApi.Data.BenefitItem(t),i.CustomerIndex(r),i.BriefCode(t.BriefCode()),i.Description("Business Pack"),i.ValueText(t.MetaData.Values[0].Value),t.BenefitItems.push(i);RecalculateQuote()}}),t.BenefitItems.subscribe(function(){t.MetaData.hasBenefitItems(t.BenefitItems().length>0),t.BenefitItems().length===0&&t.MetaData.hasBenefitItems.isModified(!1),RecalculateQuote()}),t.MetaData.hasBenefitItems.extend({min:{params:1,message:PrismApi.Validation.messages.benefits.requiredBusinessPackTraveller}}),t.MetaData.currentlySelectedTraveller=ko.observable(),t.MetaData.currentlySelectedIsValid=ko.observable(!0),u=function(){var i=!t.MetaData.hasBenefitItems()||t.MetaData.currentlySelectedTraveller()==null;t.MetaData.currentlySelectedIsValid(i),t.MetaData.currentlySelectedIsValid.isModified(!1)},t.MetaData.currentlySelectedTraveller.subscribe(u),t.MetaData.currentlySelectedIsValid.extend({equal:{params:!0,message:PrismApi.Validation.messages.benefits.requiredItemAdd}})),n.fn.FixTravellers=function(){ko.utils.arrayForEach(n.MetaData.AllTravellers(),function(t){if(t.MetaData.PeOptionsEnforced===undefined&&(t.MetaData.PeOptionsEnforced=ko.observable(!1),t.MetaData.HasPeConditionChangedValidation=ko.observable(),window.sessionStorage&&t.DateOfBirth.hasEntered(window.sessionStorage["Travellers["+t.MetaData.TravellerIndex+"].HasEnteredDOB"]==="true"),!t.MetaData.HasSetNewAge)){var i=$$.policy.PeOptions&&$$.policy.PeOptions.PESystem()?$$.policy.PeOptions.MetaData.MandatoryAssessmentAge():undefined;t.MetaData.age=ko.computed({read:function(){var u,n,r;return t.DateOfBirth()?(u=new Date(Date.parse(t.DateOfBirth().toString())).age(),n=new Date(Date.parse(t.DateOfBirth())),isNaN(n))?undefined:(r=t.MetaData.HasPeConditionChangedValidation,t.MetaData.HasPeConditionChangedValidation=function(){},i!==undefined&&n.age()>=i?(t.MetaData.HasPeCondition("true"),t.MetaData.PeOptionsEnforced(!0)):t.MetaData.PeOptionsEnforced(!1),t.MetaData.HasPeConditionChangedValidation=r,n.age()):undefined},write:function(n){n===""||typeof n=="undefined"?t.DateOfBirth(undefined):n>=0&&n<=999?t.DateOfBirth.formattedDate("1/1/"+((new Date).getFullYear()-n)):t.DateOfBirth(null)},owner:self}),t.MetaData.HasSetNewAge=!0,n.MetaData.AllTravellers.notifySubscribers()}})},n.MetaData.AllTravellers.subscribe(function(){n.fn.FixTravellers()}),n.MetaData.forceHasOtherTravellers=ko.computed(function(){return ko.utils.arrayFirst(n.MetaData.AllTravellers(),function(n){return ko.unwrap(n.MetaData.PeOptionsEnforced)===!0})!=null},this),n.fn.DoHealixAssessment=function(t){var i=$.grep(n.MetaData.AllTravellers(),function(n){return n.HealixAssessment()&&n.HealixAssessment().ScreeningId()>0}),r=n.PolicyHolders().length+n.PolicyDependants().length;n.PeOptions.FirstHolderFlag(i.length!==0||r===1),$.each(n.MetaData.AllTravellers(),function(n,i){t==i?i.HealixAssessment().PeId(1):i.HealixAssessment().PeId(0)}),t.DateOfBirth()&&t.MetaData.age()>=n.PeOptions.MetaData.MandatoryAssessmentAge()?$$.Client.showHealixAssessment(t,undefined):$$.Client.showHealixAssessment(t,"false")},ko.utils.arrayForEach(n.MetaData.AllTravellers(),function(n){var t=n.HasPeCondition();(t==="true"||t===!0)&&n.HasPeCondition("true"),(t==="false"||t===!1)&&n.HasPeCondition("false")})}function afterQuickQuoteOptionsLoaded(n){var t;for(n.MaxDurationDays==365||n.MaxDurationDays==366?$$.policy.EndDate.formattedDate.extend({maxDuration:{params:[$$.policy.StartDate,1,"year"],message:PrismApi.Validation.messages.maxDurationTravelDates1Year}}):$$.policy.EndDate.formattedDate.extend({maxDuration:{params:[$$.policy.StartDate,n.MaxDurationDays,"day"],message:PrismApi.Validation.messages.maxDurationTravelDates.format(n.MaxDurationDays)}}),ko.utils.arrayForEach($$.policy.MetaData.AllTravellers(),function(n){_session.policy&&_session.policy.Plan&&_session.policy.Plan.CoverLevel&&(_session.policy.Plan.CoverLevel.BriefCode=="NONMD"?n.MetaData.PeOptions.push({Value:"false",Description:"No"}):n.DateOfBirth()&&(new Date).getFullYear()-new Date(Date.parse(n.DateOfBirth())).getFullYear()>=$$.quickQuoteOptions().DefaultPeMandatoryAge?n.MetaData.PeOptions.push({Value:"true",Description:"Yes"}):(n.MetaData.PeOptions.push({Value:"true",Description:"Yes"}),n.MetaData.PeOptions.push({Value:"false",Description:"No"})))}),t=0;t<$$.quickQuoteOptions().MinAdults;t++)$$.policy.MetaData.AdultAges()[t].MetaData.age.extend({required:{params:!0,message:function(){var n=ko.utils.arrayFilter($$.policy.MetaData.DependantAges(),function(n){return n.MetaData.age()!=""}).length>0;return n?PrismApi.Validation.messages.travellers.invalidMinAdults.format($$.quickQuoteOptions().MinAdults):PrismApi.Validation.messages.travellers.requiredAtLeastOneTraveller}}});for(t=0;t<$$.quickQuoteOptions().MinDependants;t++)$$.policy.MetaData.DependantAges()[t].MetaData.age.extend({required:{params:!0,message:PrismApi.Validation.messages.travellers.invalidMinDependants.format($$.quickQuoteOptions().MinDependants)}});$$.policy.MetaData.PromoAdjustments().length>0&&$$.policy.MetaData.havePromoCode(1),$$.quickQuoteOptions().MaxDependantAge=24,$$.policy.MetaData.MaxDependantAge($$.quickQuoteOptions().MaxDependantAge),$$.policy.MetaData.QuickQuoteOptionsReady(!0)}function fixDestinations(){var t=JSON.parse("["+$$.policy.MetaData.Countries().replace(/\|/g,",")+"]"),n;$$.policy.Destinations().length=0,ko.utils.arrayForEach(t,function(t){var r=ko.utils.arrayFirst($$.policy.Destinations(),function(n){return ko.utils.unwrapObservable(n.BriefCode)==t.BriefCode&&n.Country&&ko.utils.unwrapObservable(n.Country.BriefCode)==t.Country.BriefCode&&t.Country&&t.Country.Location&&ko.utils.unwrapObservable(n.Country.Location)&&ko.utils.unwrapObservable(n.Country.Location.BriefCode)==t.Country.Location.BriefCode?!0:!1}),i;t.Country&&t.Country.Location&&!ko.utils.unwrapObservable(t.Country.Location.BriefCode)&&(t.Country.Location=null),r||$$.policy.Destinations().push(t),i=ko.utils.arrayFirst($$.policy.MetaData.Regions(),function(n){return ko.utils.unwrapObservable(n.BriefCode)==ko.utils.unwrapObservable(t.BriefCode)}),i&&(n==null||n.SortOrder<i.SortOrder)&&(n=i)}),n&&$$.policy.Region(n)}function getQuestionValidationErrorMsg(n){return n=="RESID"?PrismApi.Validation.messages.travellers.requiredResidentsOfCountry:n=="TEMPR"?PrismApi.Validation.messages.travellers.requiredTempResidentsOfCountry:n=="MEMBR"?PrismApi.Validation.messages.travellers.requiredPartnerMember:n=="TRIP"?PrismApi.Validation.messages.travellers.requiredPurposeOfTrip:n=="REFER"?PrismApi.Validation.messages.travellers.requiredPartnerReferer:""}function getTextByBriefCode(n){return n=="RESID"?"A Resident of Australia is someone who currently resides in Australia and is eligible for an Australian Medicare Card.":n=="TEMPR"?"Cover is available if you are a temporary resident of Australia and you hold a return ticket to Australia, have a home address in Australia to which you intend to return, and you hold a current Australian visa which will remain valid beyond the period for your journey.":""}function isLocalStorageNameSupported(){try{var n="test",t=window.sessionStorage;return t.setItem(n,"1"),t.removeItem(n),!0}catch(i){return!1}}function isCookieSupported(){try{var n=navigator.cookieEnabled?!0:!1;return typeof navigator.cookieEnabled!="undefined"||n||(document.cookie="testcookie",n=document.cookie.indexOf("testcookie")!=-1?!0:!1),n}catch(t){return!1}}function ValidatePromoCode(){$(".input-promo").removeClass("validationElement");var n=ko.validation.utils.showAllMessages($$.policy.Adjustments());n.length!=0?$$.Client.displayError(new PrismApi.Data.ApiError(null,n,null)):$$.policy.MetaData.RecalculateTimer({doPageValidation:!1,displayError:function(){$(".input-promo").addClass("validationElement"),$("#myModalLabel span").html("Validation Error"),$("#myModalContent").html("Please enter a valid Promo code.")}})}function keepAlive(){PrismApi.Utils.ajaxCall("Session/KeepAlive").done(function(){console.log("keep-alive")})}var countrySearchRegex,showMap,PrismApi;document.documentElement.className+=window.SVGSVGElement?" yes-svg":" no-svg",$("document").ready(function(){isMobile()&&($("#PolicyBenefitPopupDiv").click(function(){$("li.highlighted").removeClass("highlighted"),$(this).hide()}),$("#BenefitPopupDiv").click(function(){$(".benefit-div.highlighted").removeClass("highlighted"),$(this).hide()}))}),this.initCountries=function(n,t){var i=[],r=JSON.parse("["+($$.policy.MetaData.Countries()||"").replace(/\|/g,",")+"]");ko.utils.arrayForEach(r,function(n){i.push(EncodeLocation(n,n.Country,n.Country&&n.Country.Location&&n.Country.Location.BriefCode?n.Country.Location:null))}),t(i)},this.EncodeRegion=function(n,t,i){var r={BriefCode:ko.utils.unwrapObservable(n.BriefCode),Description:ko.utils.unwrapObservable(n.Description)};return t&&ko.utils.unwrapObservable(t.BriefCode)&&(r.Country={BriefCode:ko.utils.unwrapObservable(t.BriefCode),Description:ko.utils.unwrapObservable(t.Description)}),t&&i&&ko.utils.unwrapObservable(i.BriefCode)&&(r.Country.Location={BriefCode:ko.utils.unwrapObservable(i.BriefCode),Description:ko.utils.unwrapObservable(i.Description)}),JSON.stringify(r).replace(/,/g,"|")},this.EncodeLocation=function(n,t,i){var r=EncodeRegion(n,t,i);return t?i&&i.BriefCode?{id:r,text:t.Description+" ("+i.Description+")"}:{id:r,text:t.Description}:{id:r,text:""}},countrySearchRegex=function(n){return new RegExp("^"+n.term,"i")},this.findCountries=function(n){var t=[],i,r,u;n.term.length==0?(i=[],ko.utils.arrayForEach($$.policy.MetaData.Regions(),function(n){var r=ko.utils.arrayFilter(ko.utils.unwrapObservable(n.Countries),function(n){return ko.utils.unwrapObservable(n.Popularity)>0}),t;r.length>0&&(t=jQuery.extend({},n),t.Countries=r,i.push(t))}),i=i.sort(function(n,t){return ko.utils.unwrapObservable(n.SortOrder)-ko.utils.unwrapObservable(t.SortOrder)}),t.push({text:"Select from most popular"}),ko.utils.arrayForEach(i,function(n){var i={text:ko.utils.unwrapObservable(n.Description),children:[]};t.push(i),ko.utils.arrayForEach(n.Countries,function(t){t.Popularity>0&&i.children.push(EncodeLocation(n,t)),t.Locations&&ko.utils.arrayForEach(t.Locations,function(r){r.Popularity>0&&i.children.push(EncodeLocation(n,t,r))})})})):(r=JSON.parse("["+$$.policy.MetaData.Countries().replace(/\|/g,",")+"]"),ko.utils.arrayForEach($$.policy.MetaData.Regions(),function(i){ko.utils.arrayForEach(i.Countries(),function(u){var f=ko.utils.arrayFirst(r,function(n){return n.country===u.BriefCode});f||(u.Description.search(countrySearchRegex(n))>=0&&t.push(EncodeLocation(i,u)),u.Locations&&ko.utils.arrayForEach(u.Locations,function(f){var e=ko.utils.arrayFirst(r,function(n){return n.location===f.BriefCode});f.Description.search(countrySearchRegex(n))>=0&&t.push(EncodeLocation(i,u,f))}))})}),t=t.sort(function(n,t){return n.text<t.text?-1:n.text>t.text?1:0})),u={results:t},n.callback(u)},showMap=function(){function vt(r){var ut,rt,ot,st,p,y,b,lt,ht,at;t=new ScaleRaphael("map",f,e),ut=function(){var n=$(this);t.changeSize($(".mapWrapper").width(),$(".mapWrapper").height(),!0,!1)},$(window).resize(ut);var vt={fill:"#d9d9d9",cursor:"pointer",stroke:it,"stroke-width":et,"stroke-linejoin":"round"},bt=[],ct=!1;ko.utils.arrayForEach($$.policy.Destinations(),function(n){n.Country&&n.Country.BriefCode()&&(bt.push(n.Country.BriefCode()),n.BriefCode()=="WORLD"&&(ct=!0))}),rt=[],$("html.ie8").length>0&&(l=!0,ot=$("<div class='primary-region'><\/div>").hide().appendTo("body"),rt.push(ot.css("background-color")),ot.remove(),st=$("<div class='secondary-region'><\/div>").hide().appendTo("body"),rt.push(st.css("background-color")),st.remove());for(y in paths){if(countryProperty=paths[y],p=t.path(paths[y].path),p.attr(vt),y=ko.utils.arrayFirst(r,function(n){return n.BriefCode==countryProperty.MidasCountry}),!y){console.log("Unable to find: "+y);continue}b="",y.BriefCode?(lt=ko.utils.arrayFirst($$.policy.MetaData.Regions(),function(n){if(ko.utils.unwrapObservable(n.Countries))return ko.utils.arrayFirst(ko.utils.unwrapObservable(n.Countries),function(n){return n.BriefCode==y.BriefCode})}),ht=ko.utils.arrayFirst($$.policy.PricingRegions(),function(n){return n.BriefCode()==ko.utils.unwrapObservable(lt.BriefCode)}),ht&&(b=ct||ht.MetaData.IsPrimaryRegion()?"primary-region":"secondary-region",y.isSelected=!0)):y.isSelected=!1,l||(at=p.node.getAttribute("class"),p.node.setAttribute("class",at+" "+b)),y.Mode=="OFF"?p.attr({fill:a,cursor:"default"}):(p.attr({fill:y.Colors,font:"arial"}),p.CountryName=y.Description+(y.isSelected===!0?" - Covered":" - Not Covered"),p.CountryCode=y.BriefCode,p.MidasCountry=y.BriefCode,p.Colors=y.Colors,p.OverColors=y.OverColors,p.ClickedColors=y.ClickedColors,p.mouseover(function(){var i,t;v?this.attr({cursor:"move"}):(nt=!0,this.attr({cursor:"pointer"}),this!=g&&this.animate({},500),i=this.getBBox(0),$("#map").next(".map-label").remove(),$("#map").after($("<div />").addClass("map-label")),t=l?{left:s-50,top:h-70}:{left:s-650,top:h-110},console.log(t),$(".map-label").html(this.CountryName).css(t).fadeIn())}),p.mouseout(function(){v||(nt=!1,this!=g&&this.animate({},500),$("#map").next(".map-label").remove())}),p.mouseup(function(){var t,i;v||(g=this,t=$("#country-selector").val().split(","),$("#country-selector").val()==""&&(t=[]),i=t.indexOf(this.MidasCountry),i>=0?t.splice(i,1):t.push(this.MidasCountry),$("#country-selector").val(t.join(",")).trigger("change"))})),l&&(b==="primary-region"?p.attr({fill:rt[0]}):b==="secondary-region"&&p.attr({fill:rt[1]}))}kt(t),ut(),l&&(f=f/1.9,e=e/1.9),d(t),$(".console").fadeIn(),ft=t.rect(n[0],n[1],n[2],n[3]).attr({fill:"#F00","fill-opacity":0,stroke:"none"}).data({disabled:!0,name:"_backpan"}).toBack(),ft.drag(pt,yt,wt),w.bind("mousewheel.map",function(r,s){if(c){if(c=!1,i+=s/2,i<=1&&(i=1),i==1&&d(t),i==1&&s<0)return;l||tt();var v=n[2],y=n[3];return n[2]=f/i,n[3]=e/i,n[0]+=(v-n[2])/2,n[1]+=(y-n[3])/2,t.animateViewBox(u,n[0],n[1],n[2],n[3],250,k),o=f/n[2],o=o.toFixed(1),!1}}),w.mousemove(function(){nt||i==1?$(this).css("cursor","default"):$(this).css("cursor","move")}),$("#zoomerIn").click(function(r){if(c){c=!1,i+=.5,tt();var s=n[2],h=n[3];n[2]=f/i,n[3]=e/i,n[0]+=(s-n[2])/2,n[1]+=(h-n[3])/2,t.animateViewBox(u,n[0],n[1],n[2],n[3],250,k),o=f/n[2],o=o.toFixed(1),r.stopPropagation(),r.preventDefault()}}),$("#zoomerOut").click(function(r){if(c){if(c=!1,i==1){d(t);return}i-=.5,tt();var s=n[2],h=n[3];n[2]=f/i,n[3]=e/i,n[0]+=(s-n[2])/2,n[1]+=(h-n[3])/2,t.animateViewBox(u,n[0],n[1],n[2],n[3],250,k),o=f/n[2],o=o.toFixed(1),r.stopPropagation(),r.preventDefault()}}),$("#zoomerReset").click(function(n){d(t),n.stopPropagation(),n.preventDefault()}),$("#zoomerUp").click(function(i){n[1]-=20,n[1]<=0&&(n[1]=0),t.setViewBox(n[0],n[1],n[2],n[3],!1),i.stopPropagation(),i.preventDefault()}),$("#zoomerDown").click(function(i){n[1]+=20;var r=e-n[3];n[1]>=r&&(n[1]=r),t.setViewBox(n[0],n[1],n[2],n[3],!1),i.stopPropagation(),i.preventDefault()}),$("#zoomerLeft").click(function(i){n[0]-=20,n[0]<=0&&(n[0]=0),t.setViewBox(n[0],n[1],n[2],n[3],!1),i.stopPropagation(),i.preventDefault()}),$("#zoomerRight").click(function(i){n[0]+=20;var r=f-n[2];n[0]>=r&&(n[0]=r),t.setViewBox(n[0],n[1],n[2],n[3],!1),i.stopPropagation(),i.preventDefault()})}function tt(){u.x=n[0],u.y=n[1],u.width=n[2],u.height=n[3]}function k(n,t,i,r){u.x=n,u.y=t,u.width=i,u.height=r,c=!0}function yt(){r.dx=n[0],r.dy=n[1],v=!0}function pt(i,u){r.dx=n[0]-i/o,r.dy=n[1]-u/o;var s=e-n[3],h=f-n[2];r.dx>=h&&(r.dx=h),r.dx<=0&&(r.dx=0),r.dy>=s&&(r.dy=s),r.dy<=0&&(r.dy=0),t.setViewBox(r.dx,r.dy,n[2],n[3],!1)}function wt(){v=!1,n[0]=r.dx,n[1]=r.dy}function d(t){i=1,n[0]=-60,n[1]=-10,n[2]=f,n[3]=e,u.x=0,u.y=0,u.width=f,u.height=e,t.animateViewBox(u,n[0],n[1],n[2],n[3],250,k),c=!0}function bt(n){var i=$(window).scrollTop(),t;n&&n.pageX?(s=n.pageX,h=n.pageY-i):(s=event.clientX+document.body.scrollLeft,h=event.clientY+document.body.scrollTop),s<0&&(s=0),h<0&&(h=0),t=l?{left:s-50,top:h-70}:{left:s-650,top:h-110},$("#map").next(".map-label").css(t)}function kt(n){n.changeSize(rt,p,!0,!1),ut=="true"?$(".mapWrapper").css({width:"100%",height:p+"px"}):$(".mapWrapper").css({width:"100%",height:p+"px"})}var a,y,it,rt,p,ut,ot,st,ht,s=0,h=0,g=null,i=1,f=960,e=480,ct=0,lt=0,n=[ct,lt,f,e],dt,gt,ni,ti=0,o=1,nt=!1,ii=!1,ri=$(window),ui=0,fi=0,ei=0,oi=0,at=0,w,ft,t,r={},u={},v=!1,et=0,c=!0,si="",hi="",l=!1,b;a="#CCCCCC",y="#006600",it="#24221f",rt="520",p="260",ut="false",ot="300",st="10",et=".5",ht="300",b=[],ko.utils.arrayForEach($$.policy.MetaData.Regions(),function(n){ko.utils.unwrapObservable(n.Countries)&&ko.utils.arrayForEach(ko.utils.unwrapObservable(n.Countries),function(n){b.push(n)})}),ko.utils.arrayForEach(b,function(n){n.RegionName=="Worldwide"?(n.Mode="ON",n.Colors=y,n.OverColors=y,n.ClickedColors=y):(n.Mode="ON",n.Colors=a,n.OverColors=a,n.ClickedColors=a)}),w=$("#map"),at=w.offset(),vt(b),document.captureEvents&&Event.MOUSEMOVE&&document.captureEvents(Event.MOUSEMOVE),document.body.onmousemove=bt},function(){"use strict";$$.Client=$$.Client||{},$$.Client.Util=$$.Client.Util||{},$$.Client.Util.MobileFunctions=$$.Client.Util.MobileFunctions||{},$$.Client.Util.MobileFunctions.MobileView=ko.observable(!1),$$.Client.Util.MobileFunctions.TabletView=ko.observable(!1),$$.Client.Util.MobileFunctions.DesktopView=ko.observable(!0),$$.Client.Util.MobileFunctions.Breakpoints=[{label:"phone",enter:0,exit:767},{label:"tablet",enter:768,exit:979},{label:"desktop",enter:980,exit:1199}],$$.Client.Util.MobileFunctions.jRespond=jRespond($$.Client.Util.MobileFunctions.Breakpoints),$$.Client.Util.MobileFunctions.jRespond.addFunc({breakpoint:["phone"],enter:function(){$$.Client.Util.MobileFunctions.MobileView(!0),$$.Client.Util.MobileFunctions.TabletView(!1),$$.Client.Util.MobileFunctions.DesktopView(!1)}}),$$.Client.Util.MobileFunctions.jRespond.addFunc({breakpoint:["tablet"],enter:function(){$$.Client.Util.MobileFunctions.MobileView(!1),$$.Client.Util.MobileFunctions.TabletView(!0),$$.Client.Util.MobileFunctions.DesktopView(!1)}}),$$.Client.Util.MobileFunctions.jRespond.addFunc({breakpoint:["desktop"],enter:function(){$$.Client.Util.MobileFunctions.MobileView(!1),$$.Client.Util.MobileFunctions.TabletView(!1),$$.Client.Util.MobileFunctions.DesktopView(!0)}})}(jQuery),PrismApi=PrismApi||{},PrismApi.Validation=PrismApi.Validation||{},PrismApi.Validation.messages=$.extend({},PrismApi.Validation.messages,{requiredRegion:"Please select your travel region.",requiredRegionMostTime:"Please select where most time will be spent in.",requiredCountry:"Please enter destination countries.",requiredCountryForWorldwide:"You must include at least one additional destination country when Worldwide has been selected. Select the country where you will be spending the longest time in.",labelStartDate:"Departure date",labelEndDate:"Return date",invalidStartDateFormat:"Please enter a valid departure date (dd/mm/yyyy).",invalidEndDateFormat:"Please enter a valid return date (dd/mm/yyyy).",invalidStartDate:"{1} must be within 12 months from today's date.",invalidEndDate:"Please enter a valid return date (dd/mm/yyyy).",requiredPartner:"Please select a partner",maxDurationTravelDates1Year:"Return date cannot be greater than 12 months from the departure date.",maxDurationTravelDates:"Return date cannot be greater than {0} days from the departure date"}),PrismApi.Validation.messages.travellers=$.extend({},PrismApi.Validation.messages.travellers,{requiredAtLeastOneTraveller:"Please enter the age of at least one adult traveller.",requiredEmailDocuments:"You must agree to receive the PDS and Certificate of Insurance by email before continuing. If you would like to update your email then please return to the Your Details screen.",requiredEmail:"Please confirm your email address.",matchEmail:"Please make sure the email confirmation field matches the email field.",requiredResidentsOfCountry:"Please select if all travellers are residents of Australia.",requiredTempResidentsOfCountry:"Please select if any travellers are temporary residents of Australia.",requiredPartnerMember:"Please select if you are a {1}.",requiredPurposeOfTrip:"Please select the purpose of your trip.",requiredPartnerReferer:"Please select who referred you to us.",requiredQuestion:"Please enter a value for {0}",invalidPhone:"Please enter a valid {0}. Field must be {1} numeric digits in length.",requiredPhoneOrMobile:"Please enter your phone or mobile number.",requiredAllOrNonePhone:"Please enter a {0}.",invalidPhoneArea:"Please enter a valid {0} (area code). Field must be 2 numeric digits in length.",labelPhoneNumberTypeNumber:" (number)",labelPhoneNumberTypeArea:" (area code)",labelPhoneWork:"phone",labelPhoneHome:"phone",labelPhoneMobile:"mobile",labelTravellerForOption:"Traveller for item {0}",labelTravellerTitleGroup:"Area for {0} {1}",labelTravellerTitle:"Title for {0} {1}",labelTravellerGivenName:"Given Name for {0} {1}",labelTravellerSurname:"Surname for {0} {1}",labelTravellerGender:"Gender for {0} {1}",labelTravellerDob:"Date of Birth for {0} {1}",labelTravellerPreExistingCond:"Pre-existing medical condition for {0} {1}",labelTravellerPreExistingAssess:"Pre-existing assessment for {0} {1}",labelTravellerAddress1:"Address Line 1",labelTravellerAddress2:"Address Line 2",labelFullAddress:"Street Address",requiredTitleGroup:"Please select an {1}.",requiredTitle:"Please select a {1}.",requiredFirstName:"Please enter a {1}.",requiredSurname:"Please enter a {1}.",requiredDob:"Please enter a {1}.",requiredGender:"Please select a {1}.",requiredPreExisting:"Please advise if you have a {1}.",invalidDobDate:"Please enter a valid {1} (dd/mm/yyyy).",invalidAge:"The age for {1} traveller must be a numeric value.",invalidFullAddress:"Please enter a valid {1}.",requiredPreExistingOffer:"Please select if you would like to accept this offer?",requiredPreExistingExcessPremium:"Please select the excess amount."}),PrismApi.Validation.messages.adjustments=$.extend({},PrismApi.Validation.messages.adjustments,{requiredAdjustment:"Please enter a value for {0}",invalidAdjustment:"Please enter a valid {0}.",invalidMemberAdjustment:"Please enter a valid membership number for {0}.",invalidPromoCode:"Please enter a valid Promo Code."}),PrismApi.Validation.messages.benefits=$.extend({},PrismApi.Validation.messages.benefits,{labelBenefitValue:"{0} {1}",labelBenefitValueDollarAmount:"with a value of ${0}",labelBenefitValueInput:"{0} for item {1}",requiredItemTraveller:"Please select the traveller.",requiredItemType:"Please select the item type you wish to have covered.",requiredItemValue:"Please select the item limit for the item type you wish to have covered.",requiredItemItem:"Please select the item type you wish to have covered.",requiredItemAdd:"You have selected an Increased Item Limit but have not added it to your policy. Please either add this item to the list of items by clicking on the Add button, or clear the items.",requiredBusinessPackTraveller:"Please add at least one adult traveller for the Business Pack."})