(function(n,t,i){"use strict";function rt(){function st(t){var i=t.data.addr,e=t.data.streetField,r=n.trim(t.data.streetField.val()),f=t.data.containerUi,o=n(".smarty-autocomplete",f);if(r||(i.lastStreetInput=r,o.empty(),f.hide()),t.keyCode==13)return n(".smarty-active-suggestion:visible").length>0&&it(i,c.suggestions[n(".smarty-active-suggestion:visible").first().data("suggIndex")],f),f.hide(),e.blur(),l(t);if(t.keyCode==40){tt(e[0]);return}if(t.keyCode==38){tt(e[0]);return}r&&r!=i.lastStreetInput&&i.isDomestic()&&(i.lastStreetInput=r,u("AutocompleteInvoked",{containerUi:f,suggContainer:o,streetField:e,input:r,addr:i}))}function it(t,i,r){var u=t.getDomFields();r.hide();t.isFreeform()?n(u.street).val(i.text).change():(u.street&&n(u.street).val(i.street_line).change(),u.city&&n(u.city).val(i.city).change(),u.state&&n(u.state).val(i.state).change(),u.lastline&&n(u.lastline).val(i.city+" "+i.state).change())}function ft(n){return{top:n.top+n.height/2-10,left:n.right-6}}function g(t,i,r){for(var e,f,s=h(t.name),o=h(t.id),c=o.replace(/[\[|\]|\(|\)|\:|\'|\"|\=|\||\#|\.|\!|\||\@|\^|\&|\*]/g,"\\\\$&"),l=h(t.placeholder),a=h(t.title),u=0;u<i.length;u++)if(s.indexOf(i[u])>-1||o.indexOf(i[u])>-1)return!0;for(("labels"in t)||(e=n('label[for="'+c+'"]')[0]||n(t).parents("label")[0],t.labels=e?[e]:[]),u=0;u<t.labels.length;u++)for(f=0;f<r.length;f++)if(n(t.labels[u]).text().toLowerCase().indexOf(r[f])>-1)return!0;for(u=0;u<r.length;u++)if(l.indexOf(r[u])>-1||a.indexOf(r[u])>-1)return!0;return!1}function w(t,r){n(i).unbind("keyup");n(t).slideUp(o.speed,function(){n(this).parent(".smarty-ui").remove()});u("Completed",r.data)}function b(t){for(var i in t)n("body").undelegate(t[i],"click")}function tt(n){if(typeof n.selectionStart=="number")n.selectionStart=n.selectionEnd=n.value.length;else if(typeof n.createTextRange!="undefined"){n.focus();var t=n.createTextRange();t.collapse(!1);t.select()}}var k,f={formDataProperty:"smarty-form",identifiers:{streets:{names:["street","address","address1","address2","addr1","addr2","address-1","address-2","address_1","address_2","line","primary"],labels:["street","address","line "," line"]},secondary:{names:["suite","apartment","primary","pmb","secondary"],labels:["suite","apartment","apt:","apt.","ste:","ste.","unit:","unit.","unit ","box","pmb"]},city:{names:["city","town","village","cityname","city-name","city_name","cities"],labels:["city","town","city name"]},state:{names:["state","province","region","section","territory"],labels:["state","province","region","section","territory"]},zipcode:{names:["zip","zipcode","zip-code","zip_code","postal_code","postal-code","postalcode","postcode","post-code","post_code","postal","zcode"],labels:["zip","zip code","postal code","postcode","locality"]},lastline:{names:["lastline","last-line","citystatezip","city-state-zip","city_state_zip"],labels:["last line","city/state/zip","city / state / zip","city - state - zip","city-state-zip","city, state, zip"]},country:{names:["country","nation","sovereignty"],labels:["country","nation","sovereignty"]}},street1exacts:{names:["address","street","address1","streetaddress","street-address","street_address","streetaddr","street-addr","street_addr","str","str1","street1","addr"]},street2:{names:["address2","address_2","address-2","street2","addr2","addr_2","line2","str2","second","two"],labels:[" 2","second ","two"]},exclude:{names:["email","e-mail","e_mail","firstname","first-name","first_name","lastname","last-name","last_name","fname","lname","name","eml","type","township","zip4","plus4","method","location","store","save","keep","phn","phone","cardholder","security","comp","firm","org","addressee","addresses","group","gate","fax","cvc","cvv","file","search","list"],labels:["email","e-mail","e mail"," type","save ","keep","name","method","phone","organization","company","addressee","township","firm","group","gate","cardholder","cvc","cvv","search","file"," list","fax","book"]}},c,et=0,d=[],rt=24,ut=8,ot="<style>.smarty-dots { display: none; position: absolute; z-index: 999; width: "+rt+"px; height: "+ut+"px; background-image: url('data:image/gif;base64,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'); }.smarty-ui { position: absolute; z-index: 99999; text-shadow: none; text-align: left; text-decoration: none; }.smarty-popup { border: 3px solid #4C4C4C; padding: 0; background: #F6F6F6; box-shadow: 0px 10px 35px rgba(0, 0, 0, .8); }.smarty-popup-header { background: #DDD; height: 12px; text-transform: uppercase; font: bold 12px/1em 'Arial Black', sans-serif; padding: 12px; }.smarty-popup-ambiguous-header { color: #333; }.smarty-popup-invalid-header { color: #CC0000; }.smarty-popup-close { color: #CC0000 !important; text-decoration: none !important; position: absolute; right: 15px; top: 10px; display: block; padding: 4px 6px; text-transform: uppercase; }.smarty-popup-close:hover { color: #FFF !important; background: #CC0000; }.smarty-choice-list .smarty-choice { background: #FFF; padding: 10px 15px; color: #1A1A1A; }.smarty-choice { display: block; font: 300 14px/1.5em sans-serif; text-decoration: none !important; border-top: 1px solid #CCC; }.smarty-choice-list .smarty-choice:hover { color: #EEE !important; background: #333; text-decoration: none !important; }.smarty-choice-alt { border-top: 1px solid #4C4C4C; background: #F6F6F6 !important; box-shadow: inset 0 4px 15px -5px rgba(0, 0, 0, .45); }.smarty-choice-alt .smarty-choice-abort, .smarty-choice-override { padding: 6px 15px; color: #B3B3B3 !important; font-size: 12px; text-decoration: none !important; }.smarty-choice-alt .smarty-choice:first-child { border-top: 0; }.smarty-choice-abort:hover { color: #333 !important; }.smarty-choice-override:hover { color: #CC0000 !important; }.smarty-tag { position: absolute; display: block; overflow: hidden; font: 15px/1.2em sans-serif; text-decoration: none !important; width: 20px; height: 18px; border-radius: 25px; transition: all .25s; -moz-transition: all .25s; -webkit-transition: all .25s; -o-transition: all .25s; }.smarty-tag:hover { width: 70px; text-decoration: none !important; color: #999; }.smarty-tag:hover .smarty-tag-text { color: #000 !important; }.smarty-tag-grayed { border: 1px solid #B4B4B4 !important; color: #999 !important; background: #DDD !important; box-shadow: inset 0 9px 15px #FFF; }.smarty-tag-green { border: 1px solid #407513 !important; color: #407513 !important; background: #A6D187 !important; box-shadow: inset 0 9px 15px #E3F6D5; }.smarty-tag-grayed:hover { border-color: #333 !important; }.smarty-tag-check { padding-left: 4px; text-decoration: none !important; }.smarty-tag-text { font-size: 12px !important; position: absolute; top: 0; left: 16px; width: 50px !important; text-align: center !important; }.smarty-autocomplete { border: 1px solid #777; background: white; overflow: hidden; white-space: nowrap; box-shadow: 1px 1px 3px #555; }.smarty-suggestion { display: block; color: #444; text-decoration: none !important; font-size: 12px; padding: 1px 5px; }.smarty-active-suggestion { background: #EEE; color: #000; border: none; outline: none; }.smarty-no-suggestions { padding: 1px 5px; font-size: 12px; color: #AAA; font-style: italic; }<\/style>";this.postMappingOperations=function(){var h,p,w,d,b,v,g,f,a,nt,ut;if(r.ui){for(n("head").prepend(ot),h=s.getMappedAddresses(),f=0;f<h.length;f++)p=h[f].id(),n("body").append('<div class="smarty-ui"><div title="Loading..." class="smarty-dots smarty-addr-'+p+'"><\/div><\/div>'),w=ft(h[f].corners(!0)),w.left=w.left+20,n("body").append('<div class="smarty-ui" style="top: '+w.top+"px; left: "+w.left+'px;"><a href="javascript:" class="smarty-tag smarty-tag-grayed smarty-addr-'+p+'" title="Address not verified. Click to verify." data-addressid="'+p+'"><span class="smarty-tag-check">&#10003;<\/span><span class="smarty-tag-text">Verify<\/span><\/a><\/div>'),n(t).resize({addr:h[f]},function(t){var i=t.data.addr,e=ft(i.corners(!0)),f,o,u;n(".smarty-tag.smarty-addr-"+i.id()).parent(".smarty-ui").css("top",e.top+"px").css("left",e.left+"px");f=i.corners();n(".smarty-popup.smarty-addr-"+i.id()).parent(".smarty-ui").css("top",f.top+"px").css("left",f.left+"px");r.autocomplete&&(o=n(".smarty-autocomplete.smarty-addr-"+i.id()).closest(".smarty-ui"),u=i.getDomFields(),u.street&&o.css({left:n(u.street).offset().left+"px",top:n(u.street).offset().top+n(u.street).outerHeight()+"px"}))}),h[f].isDomestic()||(d=n(".smarty-ui .smarty-tag.smarty-addr-"+p),d.is(":visible")&&d.hide(),h[f].accept({address:h[f]},!1));if(n("body").delegate(".smarty-tag-grayed","click",function(){var t=n(this).data("addressid");s.verify(t)}),n("body").delegate(".smarty-undo","click",function(){var t=n(this).parent().data("addressid"),i=s.getMappedAddressByID(t);i.undo(!0)}),r.autocomplete&&r.key){for(f=0;f<e.length;f++){for(a=e[f],b=0;b<a.addresses.length;b++)if(v=a.addresses[b],g=v.getDomFields(),g.street){var y=n(g.street),o=n('<div class="smarty-ui"><\/div>'),rt=n('<div class="smarty-autocomplete"><\/div>');rt.addClass("smarty-addr-"+v.id());o.data("addrID",v.id());o.append(rt);o.css({position:"absolute",left:y.offset().left+"px",top:y.offset().top+y.outerHeight()+"px"});o.hide().appendTo("body");o.delegate(".smarty-suggestion","click",{addr:v,containerUi:o},function(t){var i=c.suggestions[n(this).data("suggIndex")];it(t.data.addr,i,t.data.containerUi)});o.delegate(".smarty-suggestion","mouseover",function(){n(".smarty-active-suggestion").removeClass("smarty-active-suggestion");n(this).addClass("smarty-active-suggestion")});o.delegate(".smarty-active-suggestion","mouseleave",function(){n(this).removeClass("smarty-active-suggestion")});y.attr("autocomplete","off");y.blur({containerUi:o},function(n){setTimeout(function(n){return function(){n.data&&n.data.containerUi.hide()}}(n),300)});y.keydown({containerUi:o,addr:v},function(t){var f=n(".smarty-autocomplete",t.data.containerUi),i=n(".smarty-active-suggestion:visible",f).first(),r=!1,u;if(t.keyCode==9){if(i.length>0)return u=t.data.addr.getDomFields(),u.zipcode?n(u.zipcode).focus():n(u.street).blur(),it(t.data.addr,c.suggestions[i.data("suggIndex")],t.data.containerUi),v.isFreeform()?!0:l(t);t.data.containerUi.hide();return}if(t.keyCode==40){i.hasClass("smarty-suggestion")||(i=n(".smarty-suggestion",f).first().mouseover(),r=!0);r||(i.next(".smarty-addr-"+t.data.addr.id()+" .smarty-suggestion").length>0?i.next(".smarty-suggestion").mouseover():i.removeClass("smarty-active-suggestion"));tt(this);return}if(t.keyCode==38){i.hasClass("smarty-suggestion")||(i=n(".smarty-suggestion",f).last().mouseover(),r=!0);r||(i.prev(".smarty-addr-"+t.data.addr.id()+" .smarty-suggestion").length>0?i.prev(".smarty-suggestion").mouseover():i.removeClass("smarty-active-suggestion"));tt(this);return}});y.keyup({form:a,addr:v,streetField:y,containerUi:o},st)}n(i).keyup(function(t){t.keyCode==27&&n(".smarty-autocomplete").closest(".smarty-ui").hide()})}setTimeout(function(){n(t).resize()},500);setTimeout(function(){n(t).resize()},1500)}}if(r.submitVerify)for(f=0;f<e.length;f++)a=e[f],k=function(t){if(t.data.form&&t.data.form.processing||n(".smarty-active-suggestion:visible").length>0)return l(t);if(!t.data.form.allActiveAddressesAccepted()){var i=t.data.form.activeAddressesNotAccepted();return i.length>0&&u("VerificationInvoked",{address:i[0],invoke:t.data.invoke,invokeFn:t.data.invokeFn}),l(t)}},nt=function(t,i){var r,u,e,f;if(t&&i)for(r=[],u=n._data(t,"events"),u&&u[i]&&u[i].length>0&&(r=n.extend(!0,[],u[i])),n(t).unbind(i),n(t)[i]({form:a,invoke:t,invokeFn:i},k),typeof t["on"+i]=="function"&&(e=t["on"+i],t["on"+i]=null,n(t)[i](e)),f=0;f<r.length;f++)n(t)[i](r[f].data,r[f].handler)},ut=n(r.submitSelector,a.dom),ut.each(function(){nt(this,"click")}),nt(a.dom,"submit");u("MapInitialized")};this.requestAutocomplete=function(t,i){i.input&&i.addr.isDomestic()&&c&&i.containerUi.show();var f={callback:function(t,r){var u,f;if(c=r,i.suggContainer.empty(),!r.suggestions||r.suggestions.length==0){i.suggContainer.html('<div class="smarty-no-suggestions">No suggestions<\/div>');return}for(u=0;u<r.suggestions.length;u++)f=n('<a href="javascript:" class="smarty-suggestion">'+r.suggestions[u].text.replace(/<|>/g,"")+"<\/a>"),f.data("suggIndex",u),i.suggContainer.append(f);i.suggContainer.css({width:Math.max(i.streetField.outerWidth(),250)+"px"});i.containerUi.show();d.splice(0,t)},number:et++};d[f.number]=f;n.getJSON("https://autocomplete-api.smartystreets.com/suggest?callback=?",{"auth-id":r.key,prefix:i.input,city_filter:r.cityFilter,state_filter:r.stateFilter,prefer:r.cityStatePreference,suggestions:r.autocomplete,geolocate:r.geolocate},function(t){u("AutocompleteReceived",n.extend(i,{json:t,autocplrequest:f}))})};this.showAutocomplete=function(n,t){d[t.autocplrequest.number]&&d[t.autocplrequest.number].callback(t.autocplrequest.number,t.json)};this.clean=function(){var u,s,o,h;if(e.length!=0){for(r.debug&&console.log("Cleaning up old form map data and bindings..."),u=0;u<e.length;u++){for(n(e[u].dom).data(f.formDataProperty,""),s=0;s<e[u].addresses.length;s++){o=e[u].addresses[s].getDomFields();for(h in o)r.debug&&n(o[h]).css("background","none").attr("placeholder",""),n(o[h]).unbind("change");o.street&&n(o.street).unbind("keyup").unbind("keydown").unbind("blur")}n.each(e,function(){n(this.dom).unbind("submit",k)});n(r.submitSelector,e[u].dom).each(function(){n(this).unbind("click",k)})}n(".smarty-ui").undelegate(".smarty-suggestion","click").undelegate(".smarty-suggestion","mouseover").undelegate(".smarty-suggestion","mouseleave").remove();n("body").undelegate(".smarty-undo","click");n("body").undelegate(".smarty-tag-grayed","click");n(t).unbind("resize");n(i).unbind("keyup");e=[];y=0;r.debug&&console.log("Done cleaning up; ready for new mapping.")}};this.automap=function(t){r.debug&&console.log("Automapping fields...");this.clean();n("form").each(function(i){var v=new nt(this),u={},l,k,d,p,s,o,w,c,b,tt;for(l in f.identifiers)k=f.identifiers[l].names,d=f.identifiers[l].labels,u[l]=n(r.fieldSelector,this).filter(function(){return n(t).has(this).length>0}).filter(":visible").filter(function(){var r=h(this.name),u=h(this.id),i,t,n;if(l=="streets")for(n=0;n<f.street1exacts.names.length;n++)if(r==f.street1exacts.names[n]||u==f.street1exacts.names[n])return!0;if(i=g(this,k,d),l=="streets")for(t=["secondary","city","state","zipcode","country","lastline"],n=0;n<t.length;n++)if(g(this,f.identifiers[t[n]].names,f.identifiers[t[n]].labels))return!1;return i}).not(function(){var n=h(this.name),t=h(this.id);return n=="name"||t=="name"?!0:g(this,f.exclude.names,f.exclude.labels)}).toArray();if(u.street=[],u.street2=[],u.streets.length<=u.city.length*1.5||u.streets.length<=u.zipcode.length*1.5)u.street=u.streets;else for(s=0;s<u.streets.length;s++)c=u.streets[s],g(c,f.street2.names,f.street2.labels)||s>0&&c.name==u.streets[s-1].name?u.street2.push(c):u.street.push(c);for(delete u.streets,r.debug&&console.log("For form "+i+", the initial scan found these fields:",u),p=Math.max(u.street.length,u.street2.length),r.debug&&p==0&&console.log("No addresses were found in form "+i+"."),s=0;s<p;s++){o={};for(w in u)c=u[w][s],c&&(o[w]=c);if(b=o.zipcode||o.state&&o.city,tt=o.city||o.state||o.zipcode,!o.street&&b||o.street&&!b&&tt){r.debug&&console.log("Form "+i+" contains some address input elements that could not be resolved to a complete address.");continue}v.addresses.push(new a(o,v,"auto"+ ++y))}e.push(v);r.debug&&console.log("Form "+i+" is finished:",v)});r.debug&&console.log("Automapping complete.");u("FieldsMapped")};this.mapFields=function(t,i){var c,k,o,s,b,l,h,w;r.debug&&console.log("Manually mapping fields given this data:",t);this.clean();c=[];t=t instanceof Array?t:[t];for(k in t)if(o=t[k],o.street){for(s in o)if(s!="id"){if(!v(p,s)){r.debug&&console.log("NOTICE: Field named "+s+" is not allowed. Skipping...");delete o[s];continue}if(b=n(o[s],i),b.length==0){r.debug&&console.log("NOTICE: No matches found for selector "+o[s]+". Skipping...");delete o[s];continue}else if(b.parents("form").length==0){r.debug&&console.log('NOTICE: Element with selector "'+o[s]+'" is not inside a <form> tag. Skipping...');delete o[s];continue}else o[s]=b[0]}if(!(o.street&&(o.city&&o.state||o.zipcode||o.lastline||!o.street2&&!o.city&&!o.state&&!o.zipcode&&!o.lastline))){r.debug&&console.log("NOTICE: Address map (index "+k+") was not mapped to a complete street address. Skipping...");continue}if(l=n(o.street).parents("form")[0],h=new nt(l),n(l).data(f.formDataProperty)){for(w=0;w<c.length;w++)if(c[w].dom==l){h=c[w];break}}else n(l).data(f.formDataProperty,1),c.push(h);y++;h.addresses.push(new a(o,h,o.id));r.debug&&console.log("Finished mapping address with ID: "+h.addresses[h.addresses.length-1].id())}e=c;u("FieldsMapped")};this.disableFields=function(t){var i,u,f;if(r.ui){i=t.getDomFields();for(u in i)n(i[u]).prop?n(i[u]).prop("disabled",!0):n(i[u]).attr("disabled","disabled");t.form&&t.form.dom&&(f=n(r.submitSelector,t.form.dom),f.prop?f.prop("disabled",!0):f.attr("disabled","disabled"))}};this.enableFields=function(t){var i,u,f;if(r.ui){i=t.getDomFields();for(u in i)n(i[u]).prop?n(i[u]).prop("disabled",!1):n(i[u]).removeAttr("disabled");t.form&&t.form.dom&&(f=n(r.submitSelector,t.form.dom),f.prop?f.prop("disabled",!1):f.removeAttr("disabled"))}};this.showLoader=function(t){if(r.ui&&t.hasDomFields()){var i=t.corners(!0),u=n(".smarty-dots.smarty-addr-"+t.id()).parent();u.css("top",i.top+i.height/2-ut/2+"px").css("left",i.right-rt-10+"px");n(".smarty-dots",u).show()}};this.hideLoader=function(t){r.ui&&n(".smarty-dots.smarty-addr-"+t.id()).hide()};this.markAsValid=function(t){if(r.ui&&t){var i=n(".smarty-tag.smarty-tag-grayed.smarty-addr-"+t.id());i.removeClass("smarty-tag-grayed").addClass("smarty-tag-green").attr("title","Address verified! Click to undo.");n(".smarty-tag-text",i).text("Verified").hover(function(){n(this).text("Undo")},function(){n(this).text("Verified")}).addClass("smarty-undo")}};this.unmarkAsValid=function(t){var u=".smarty-tag.smarty-addr-"+t.id(),i;r.ui&&t&&n(u).length!=0&&(i=n(".smarty-tag.smarty-tag-green.smarty-addr-"+t.id()),i.removeClass("smarty-tag-green").addClass("smarty-tag-grayed").attr("title","Address not verified. Click to verify."),n(".smarty-tag-text",i).text("Verify").unbind("mouseenter mouseleave").removeClass("smarty-undo"))};this.showAmbiguous=function(f){var a,s;if(r.ui&&f.address.hasDomFields()){var h=f.address,c=f.response,e=h.corners();for(e.width=Math.max(e.width,300),e.height=Math.max(e.height,c.length*63+119),a='<div class="smarty-ui" style="top: '+e.top+"px; left: "+e.left+"px; width: "+e.width+"px; height: "+e.height+'px;"><div class="smarty-popup smarty-addr-'+h.id()+'" style="width: '+(e.width-6)+"px; height: "+(e.height-3)+'px;"><div class="smarty-popup-header smarty-popup-ambiguous-header">'+r.ambiguousMessage+'<a href="javascript:" class="smarty-popup-close smarty-abort" title="Cancel">x<\/a><\/div><div class="smarty-choice-list">',s=0;s<c.raw.length;s++){var v=c.raw[s].delivery_line_1,y=c.raw[s].components.city_name,p=c.raw[s].components.state_abbreviation,k=c.raw[s].components.zipcode+"-"+c.raw[s].components.plus4_code;a+='<a href="javascript:" class="smarty-choice" data-index="'+s+'">'+v+"<br>"+y+", "+p+" "+k+"<\/a>"}a+='<\/div><div class="smarty-choice-alt">';a+='<a href="javascript:" class="smarty-choice smarty-choice-abort smarty-abort">Click here to change your address<\/a>';a+='<a href="javascript:" class="smarty-choice smarty-choice-override">Click here to certify the address is correct<br>('+h.toString()+")<\/a>";a+="<\/div><\/div><\/div>";n(a).hide().appendTo("body").show(o.speed);(n(i).scrollTop()>e.top-100||n(i).scrollTop()<e.top-n(t).height()+100)&&n("html, body").stop().animate({scrollTop:n(".smarty-popup.smarty-addr-"+h.id()).offset().top-100},500);f.selectors={goodAddr:".smarty-popup.smarty-addr-"+h.id()+" .smarty-choice-list .smarty-choice",useOriginal:".smarty-popup.smarty-addr-"+h.id()+" .smarty-choice-override",abort:".smarty-popup.smarty-addr-"+h.id()+" .smarty-abort"};n("body").delegate(f.selectors.goodAddr,"click",f,function(t){n(".smarty-popup.smarty-addr-"+h.id()).slideUp(o.speed,function(){n(this).parent(".smarty-ui").remove();n(this).remove()});b(t.data.selectors);delete t.data.selectors;u("UsedSuggestedAddress",{address:t.data.address,response:t.data.response,invoke:t.data.invoke,invokeFn:t.data.invokeFn,chosenCandidate:c.raw[n(this).data("index")]})});n("body").delegate(f.selectors.useOriginal,"click",f,function(t){n(this).parents(".smarty-popup").slideUp(o.speed,function(){n(this).parent(".smarty-ui").remove();n(this).remove()});b(t.data.selectors);delete t.data.selectors;u("OriginalInputSelected",t.data)});n(i).keyup(f,function(t){t.keyCode==27&&(b(t.data.selectors),delete t.data.selectors,w(n(".smarty-popup.smarty-addr-"+t.data.address.id()),t),l(t))});n("body").delegate(f.selectors.abort,"click",f,function(t){b(t.data.selectors);delete t.data.selectors;w(n(this).parents(".smarty-popup"),t)})}};this.showInvalid=function(f){var h;if(r.ui&&f.address.hasDomFields()){var s=f.address,c=f.response,e=s.corners();e.width=Math.max(e.width,300);e.height=Math.max(e.height,180);h='<div class="smarty-ui" style="top: '+e.top+"px; left: "+e.left+"px; width: "+e.width+"px; height: "+e.height+'px;"><div class="smarty-popup smarty-addr-'+s.id()+'" style="width: '+(e.width-6)+"px; height: "+(e.height-3)+'px;"><div class="smarty-popup-header smarty-popup-invalid-header">'+r.invalidMessage+'<a href="javascript:" class="smarty-popup-close smarty-abort" title="Cancel">x<\/a><\/div><div class="smarty-choice-list"><a href="javascript:" class="smarty-choice smarty-choice-abort smarty-abort">Click here to change your address<\/a><\/div><div class="smarty-choice-alt"><a href="javascript:" class="smarty-choice smarty-choice-override">Click here to certify the address is correct<br>('+s.toString()+")<\/a><\/div><\/div><\/div>";n(h).hide().appendTo("body").show(o.speed);f.selectors={useOriginal:".smarty-popup.smarty-addr-"+s.id()+" .smarty-choice-override ",abort:".smarty-popup.smarty-addr-"+s.id()+" .smarty-abort"};(n(i).scrollTop()>e.top-100||n(i).scrollTop()<e.top-n(t).height()+100)&&n("html, body").stop().animate({scrollTop:n(".smarty-popup.smarty-addr-"+s.id()).offset().top-100},500);n("body").delegate(f.selectors.abort,"click",f,function(n){w(".smarty-popup.smarty-addr-"+n.data.address.id(),n);delete n.data.selectors;u("InvalidAddressRejected",n.data)});n("body").delegate(f.selectors.useOriginal,"click",f,function(n){w(".smarty-popup.smarty-addr-"+n.data.address.id(),n);delete n.data.selectors;u("OriginalInputSelected",n.data)});n(i).keyup(f,function(t){t.keyCode==27&&(n(f.selectors.abort).click(),b(t.data.selectors),w(".smarty-popup.smarty-addr-"+t.data.address.id(),t))})}};this.isDropdown=function(n){return n&&(n.tagName||n.nodeName||"").toUpperCase()=="SELECT"}}function ut(n){var t=this;this.standard=function(){var u,o,s,r,i,t,f,e;for(r in d)if((u=d[r],o=n.text.toUpperCase(),o.indexOf(u)>-1)||(s=n.value.toUpperCase(),s.indexOf(u)>-1))return k[u];for(r in g){i=g[r];t=n.text.split(/[ ,]+/);for(f in t)if(e=t[f].toUpperCase(),i===e)return i;t=n.value.split(/[ ,]+/);for(f in t)if(e=t[f].toUpperCase(),i===e)return i}return""};this.value=function(){return n.value?n.value:n.text}}function a(t,i,e){var h=this,o,c,y={},b=0,a="accepted",k=function(t,i,e,s,l,a){var k,d,w;return v(p,t)?(o[t]||(o[t]={}),i=i.replace(/<|>/g,""),k=o[t].value!=i,o[t].undo=o[t].value||"",o[t].value=i,e&&o[t].dom&&(t==="state"&&b>0&&i in y&&(i=y[i].value()),n(o[t].dom).val(i)),d={sourceEvent:l,field:t,address:h,value:i,suppressAutoVerification:a||!1},k&&!s&&(f.unmarkAsValid(h),w=r.ui?n(".smarty-ui .smarty-tag.smarty-addr-"+c):undefined,h.isDomestic()?(w&&!w.is(":visible")&&w.show(),h.unaccept(),u("AddressChanged",d)):(w&&w.is(":visible")&&w.hide(),h.accept({address:h},!1))),!0):!1};this.form=i;this.verifyCount=0;this.lastField;this.active=!0;this.lastStreetInput="";this.load=function(t,i){var l,u,e,s,w,h,k;if(o={},c=i?i.replace(/[^a-z0-9_\-]/ig,""):et(1,99999),typeof t=="object"){this.lastField=t.lastline||t.zipcode||t.state||t.city||t.street;l=!0;for(u in t)if(v(p,u)){try{e=n(t[u]);w=e.toArray();h=w?w.length==0:!1}catch(d){h=!0}s=h?t[u]||"":e.val()||"";u==="state"&&w[0].length!=undefined&&n("option",e).each(function(){var n=new ut(this),t=n.standard();y[t]=n;b++});o[u]={};o[u].value=s;o[u].undo=s;l=l?s.length==0||f.isDropdown(t[u]):!1;h||(r.debug&&(e.css("background","#FFFFCC"),e.attr("placeholder",u+":"+c)),o[u].dom=t[u]);k={address:this,field:u,value:s};h||n(t[u]).change(k,function(n){n.data.address.set(n.data.field,n.target.value,!1,!1,n,!1)})}l||(a="changed")}};this.load(t,e);this.set=function(n,t,i,r,u,f){var e,o;if(typeof n=="string"&&arguments.length>=2)return k(n,t,i,r,u,f);if(typeof n=="object"){e=!0;for(o in n)e=k(o,n[o],i,r,u,f)?e:!1;return e}};this.replaceWith=function(n,t,i){if(typeof n=="array"&&n.length>0&&(n=n[0]),h.isFreeform()){var r=(n.addressee?n.addressee+" ":"")+(n.delivery_line_1?n.delivery_line_1+" ":"")+(n.delivery_line_2?n.delivery_line_2+" ":"")+(n.components.urbanization?n.components.urbanization+" ":"")+(n.last_line?n.last_line:"");h.set("street",r,t,!0,i,!1)}else n.addressee&&h.set("addressee",n.addressee,t,!0,i,!1),n.delivery_line_1&&h.set("street",n.delivery_line_1,t,!0,i,!1),n.last_line&&o.lastline&&h.set("lastline",n.last_line,t,!0,i,!1),h.set("street2",n.delivery_line_2||"",t,!0,i,!1),h.set("secondary","",t,!0,i,!1),n.components.urbanization&&h.set("urbanization",n.components.urbanization,t,!0,i,!1),n.components.city_name&&h.set("city",n.components.city_name,t,!0,i,!1),n.components.state_abbreviation&&h.set("state",n.components.state_abbreviation,t,!0,i,!1),n.components.zipcode&&n.components.plus4_code&&h.set("zipcode",n.components.zipcode+"-"+n.components.plus4_code,t,!0,i,!1)};this.corners=function(t){var i={},u,f,r,e;if(t)e=n(h.lastField),i=e.offset(),i.right=i.left+e.outerWidth(),i.bottom=i.top+e.outerHeight();else for(u in o)o[u].dom&&n(o[u].dom).is(":visible")&&(f=o[u].dom,r=n(f).offset(),r.right=r.left+n(f).outerWidth(),r.bottom=r.top+n(f).outerHeight(),i.top=i.top?Math.min(i.top,r.top):r.top,i.left=i.left?Math.min(i.left,r.left):r.left,i.right=i.right?Math.max(i.right,r.right):r.right,i.bottom=i.bottom?Math.max(i.bottom,r.bottom):r.bottom);return i.width=i.right-i.left,i.height=i.bottom-i.top,i};this.verify=function(t,i){if(!t&&!h.enoughInput())return r.debug&&console.log("NOTICE: The address does not have enough input to verify. Since no callback is specified, there is nothing to do."),u("Completed",{address:h,invoke:t,invokeFn:i,response:new w([])});if(!h.enoughInput())return u("AddressWasInvalid",{address:h,response:new w([]),invoke:t,invokeFn:i});f.disableFields(h);h.verifyCount++;var e=h.toRequest(),o=r.token?"auth-id="+encodeURIComponent(r.key)+"&auth-token="+encodeURIComponent(r.token):"auth-token="+encodeURIComponent(r.key);n.ajax({url:r.requestUrl+"?"+o+"&plugin="+encodeURIComponent(s.version)+(r.debug?"_debug":"")+"&callback=?",dataType:"jsonp",data:e,timeout:r.timeout}).done(function(n){u("ResponseReceived",{address:h,response:new w(n),invoke:t,invokeFn:i})}).fail(function(n,r){u("RequestTimedOut",{address:h,status:r,invoke:t,invokeFn:i});h.verifyCount--});u("RequestSubmitted",{address:h})};this.enoughInput=function(){return o.street&&o.street.value&&(o.city&&o.city.value&&o.state&&o.state.value&&o.state.value.length>1||o.zipcode&&o.zipcode.value||o.lastline&&o.lastline.value||!o.street2&&!o.city&&!o.state&&!o.zipcode&&!o.lastline)};this.toRequest=function(){var u={},t,i;for(t in o)i={},i[t]=o[t].value.replace(/\r|\n/g," "),n.extend(u,i);return n.extend(u,{candidates:r.candidates})};this.toString=function(){return(o.street?o.street.value+" ":"")+(o.street2?o.street2.value+" ":"")+(o.secondary?o.secondary.value+" ":"")+(o.city?o.city.value+" ":"")+(o.state?o.state.value+" ":"")+(o.zipcode?o.zipcode.value:"")};this.abort=function(n,t){return t=typeof t=="undefined"?!1:t,t||h.unaccept(),delete h.form.processing,l(n)};this.isFreeform=function(){return o.street&&!o.street2&&!o.secondary&&!o.addressee&&!o.city&&!o.state&&!o.zipcode&&!o.urbanization&&!o.lastline};this.get=function(n){return o[n]?o[n].value:null};this.undo=function(n){n=typeof n=="undefined"?!0:n;for(var t in o)this.set(t,o[t].undo,n,!1,undefined,!0)};this.accept=function(n,t){t=typeof t=="undefined"?!0:t;a="accepted";f.enableFields(h);t&&f.markAsValid(h);u("AddressAccepted",n)};this.unaccept=function(){return a="changed",f.unmarkAsValid(h),h};this.getUndoValue=function(n){return o[n].undo};this.status=function(){return a};this.getDomFields=function(){var r={},t,i;for(t in o)i={},i[t]=o[t].dom,n.extend(r,i);return r};this.hasDomFields=function(){for(var n in o)if(o[n].dom)return!0};this.isDomestic=function(){if(!o.country)return!0;var n=o.country.value.toUpperCase().replace(/\.|\s|\(|\)|\\|\/|-/g,"");return v(["","0","1","COUNTRY","NONE","US","USA","USOFA","USOFAMERICA","AMERICAN","UNITEDSTATES","UNITEDSTATESAMERICA","UNITEDSTATESOFAMERICA","AMERICA","840","223","AMERICAUNITEDSTATES","AMERICAUS","AMERICAUSA"],n)||o.country.value=="-1"};this.autocompleteVisible=function(){return r.ui&&r.autocomplete&&n(".smarty-autocomplete.smarty-addr-"+h.id()).is(":visible")};this.id=function(){return c}}function nt(n){this.addresses=[];this.dom=n;this.activeAddressesNotAccepted=function(){for(var n,i=[],t=0;t<this.addresses.length;t++)n=this.addresses[t],n.status()!="accepted"&&n.active&&i.push(n);return i};this.allActiveAddressesAccepted=function(){return this.activeAddressesNotAccepted().length==0}}function w(n){var t=function(t){if(t>=n.length||t<0)if(n.length==0)throw new Error("Candidate index is out of bounds (no candidates returned; requested "+t+")");else throw new Error("Candidate index is out of bounds ("+n.length+" candidates; indicies 0 through "+(n.length-1)+" available; requested "+t+")");},i=function(n){return typeof n=="undefined"?0:n};this.raw=n;this.length=n.length;this.isValid=function(){return this.length==1};this.isInvalid=function(){return this.length==0};this.isAmbiguous=function(){return this.length>1};this.isMissingSecondary=function(n){return n=i(n),t(n),this.raw[n].analysis.dpv_footnotes.indexOf("N1")>-1||this.raw[n].analysis.dpv_footnotes.indexOf("R1")>-1||this.raw[n].analysis.footnotes&&this.raw[n].analysis.footnotes.indexOf("H#")>-1};this.isBadSecondary=function(n){return n=i(n),t(n),this.raw[n].analysis.footnotes&&this.raw[n].analysis.footnotes.indexOf("S#")>-1};this.componentChanged=function(n){return n=i(n),t(n),this.raw[n].analysis.footnotes&&this.raw[n].analysis.footnotes.indexOf("L#")>-1};this.betterAddressExists=function(n){return n=i(n),t(n),this.raw[n].analysis.footnotes&&this.raw[n].analysis.footnotes.indexOf("P#")>-1};this.isExactMatch=function(n){return n=i(n),t(n),this.raw[n].analysis.footnotes&&this.raw[n].analysis.dpv_footnotes=="AABB"};this.isUniqueZipCode=function(n){return n=i(n),t(n),this.raw[n].analysis.dpv_footnotes.indexOf("U1")>-1||this.raw[n].analysis.footnotes&&this.raw[n].analysis.footnotes.indexOf("Q#")>-1};this.fixedAbbreviations=function(n){return n=i(n),t(n),this.raw[n].analysis.footnotes&&this.raw[n].analysis.footnotes.indexOf("N#")>-1};this.fixedZipCode=function(n){return n=i(n),t(n),this.raw[n].analysis.footnotes&&this.raw[n].analysis.footnotes.indexOf("A#")>-1};this.fixedSpelling=function(n){return n=i(n),t(n),this.raw[n].analysis.footnotes.indexOf("B#")>-1||this.raw[n].analysis.footnotes&&this.raw[n].analysis.footnotes.indexOf("M#")>-1};this.isBuildingDefault=function(n){return n=i(n),t(n),this.raw[n].metadata.building_default_indicator};this.isMilitary=function(n){return n=i(n),t(n),this.raw[n].analysis.dpv_footnotes.indexOf("F1")>-1};this.hasExtraSecondary=function(n){return n=i(n),t(n),this.raw[n].analysis.dpv_footnotes.indexOf("CC")>-1};this.isLacsLink=function(n){return n=i(n),t(n),this.raw[n].analysis.lacslink_code=="A"};this.isCommercial=function(n){return n=i(n),t(n),this.raw[n].metadata.rdi=="Commercial"};this.isResidential=function(n){return n=i(n),t(n),this.raw[n].metadata.rdi=="Residential"}}function ft(n,t){var i=c[n.type];i&&i(n,t)}function v(n,t){for(var i in n)if(n[i]===t)return!0;return!1}function et(n,t){return Math.floor(Math.random()*(t-n+1))+n}function h(n){return n?n.toLowerCase().replace("[]",""):""}function u(t,r){n(i).triggerHandler(t,r)}function ot(t){n(i).bind(t,ft)}function l(n){return n?(n.preventDefault&&n.preventDefault(),n.stopPropagation&&n.stopPropagation(),n.stopImmediatePropagation&&n.stopImmediatePropagation(),n.cancelBubble=!0,!1):!1}var s,f=new rt,b="2.4.11",o={candidates:3,autocomplete:10,requestUrl:"https://api.smartystreets.com/street-address",timeout:5e3,speed:"medium",ambiguousMessage:"Choose the correct address",invalidMessage:"Address not verified",fieldSelector:"input[type=text], input:not([type]), textarea, select",submitSelector:"[type=submit], [type=image], [type=button]:last, button:last"},r={},e=[],it="body",y=0,p=["street","street2","secondary","city","state","zipcode","lastline","addressee","urbanization","country"],tt,c;n.LiveAddress=function(t){return n(it).LiveAddress(t)};n.fn.LiveAddress=function(h){var y;if(s)return s;var l=this,p=l.prevObject?!!l.prevObject.prevObject:!1,v=n.fn.jquery.split(".");if(v.length>=2){if(v[0]<1||v[0]==1&&v[1]<5)return console.log("jQuery version "+n.fn.jquery+" found, but LiveAddress requires jQuery version 1.5 or higher. Aborting."),!1}else return!1;h.debug&&console.log("LiveAddress API jQuery Plugin version "+b+" (Debug mode)");i.readyState==="complete"?t.loaded=!0:n(t).load(function(){t.loaded=!0});typeof h=="string"?r={key:h,candidates:o.candidates}:typeof h=="object"&&(r=n.extend(r,h));r.candidates=r.candidates||o.candidates;r.ui=typeof r.ui=="undefined"?!0:r.ui;r.autoMap=typeof r.autoMap=="undefined"?!0:r.autoMap;r.autoVerify=typeof r.autoVerify=="undefined"?!0:r.autoVerify;r.submitVerify=typeof r.submitVerify=="undefined"?!0:r.submitVerify;r.timeout=r.timeout||o.timeout;r.ambiguousMessage=r.ambiguousMessage||o.ambiguousMessage;r.invalidMessage=r.invalidMessage||o.invalidMessage;r.fieldSelector=r.fieldSelector||o.fieldSelector;r.submitSelector=r.submitSelector||o.submitSelector;r.requestUrl=r.requestUrl||o.requestUrl;r.autocomplete=typeof r.autocomplete=="undefined"?o.autocomplete:r.autocomplete;r.cityFilter=typeof r.cityFilter=="undefined"?"":r.cityFilter;r.stateFilter=typeof r.stateFilter=="undefined"?"":r.stateFilter;r.cityStatePreference=typeof r.cityStatePreference=="undefined"?"":r.cityStatePreference;r.geolocate=typeof r.geolocate=="undefined"?!0:r.geolocate;r.candidates=r.candidates<1?0:r.candidates>10?10:r.candidates;typeof r.autocomplete=="number"&&(r.autocomplete=r.autocomplete<1?!1:r.autocomplete>10?10:r.autocomplete);s={events:c,on:function(n,t){if(!c[n]||typeof t!="function")return!1;var i=c[n];c[n]=function(n,r){t(n,r,i)}},mapFields:function(t){var i=function(n){return n==="auto"?f.automap(l):typeof n=="object"?f.mapFields(n,l):n||typeof r.addresses!="object"?r.autoMap?f.automap(l):!1:f.mapFields(r.addresses,l)};n.isReady?i(t):n(function(){p||(l=n(l.selector));i(t)})},makeAddress:function(n){return typeof n!="object"?s.getMappedAddressByID(n)||new a({street:n}):new a(n)},verify:function(n,t){var i=s.makeAddress(n);u("VerificationInvoked",{address:i,verifyAccepted:!0,invoke:t})},getMappedAddresses:function(){for(var t,i=[],n=0;n<e.length;n++)for(t=0;t<e[n].addresses.length;t++)i.push(e[n].addresses[t]);return i},getMappedAddressByID:function(n){for(var i,t=0;t<e.length;t++)for(i=0;i<e[t].addresses.length;i++)if(e[t].addresses[i].id()==n)return e[t].addresses[i]},setKey:function(n){r.key=n},setCityFilter:function(n){r.cityFilter=n},setStateFilter:function(n){r.stateFilter=n},setCityStatePreference:function(n){r.cityStatePreference=n},activate:function(n){var t=s.getMappedAddressByID(n);t&&(t.active=!0)},deactivate:function(n){if(!n)return f.clean();var t=s.getMappedAddressByID(n);t&&(t.active=!1)},autoVerify:function(n){if(typeof n=="undefined")return r.autoVerify;r.autoVerify=n!=="disable"&&n!=="off"&&n?!0:!1},version:b};for(y in c)ot(y);return s.mapFields(),s};var k={ALABAMA:"AL",ALASKA:"AK","AMERICAN SAMOA":"AS",ARIZONA:"AZ",ARKANSAS:"AR",CALIFORNIA:"CA",COLORADO:"CO",CONNECTICUT:"CT",DELAWARE:"DE","DISTRICT OF COLUMBIA":"DC","FEDERATED STATES OF MICRONESIA":"FM",FLORIDA:"FL",GEORGIA:"GA",GUAM:"GU",HAWAII:"HI",IDAHO:"ID",ILLINOIS:"IL",INDIANA:"IN",IOWA:"IA",KANSAS:"KS",KENTUCKY:"KY",LOUISIANA:"LA",MAINE:"ME","MARSHALL ISLANDS":"MH",MARYLAND:"MD",MASSACHUSETTS:"MA",MICHIGAN:"MI",MINNESOTA:"MN",MISSISSIPPI:"MS",MISSOURI:"MO",MONTANA:"MT",NEBRASKA:"NE",NEVADA:"NV","NEW HAMPSHIRE":"NH","NEW JERSEY":"NJ","NEW MEXICO":"NM","NEW YORK":"NY","NORTH CAROLINA":"NC","NORTH DAKOTA":"ND","NORTHERN MARIANA ISLANDS":"MP",OHIO:"OH",OKLAHOMA:"OK",OREGON:"OR",PALAU:"PW",PENNSYLVANIA:"PA","PUERTO RICO":"PR","RHODE ISLAND":"RI","SOUTH CAROLINA":"SC","SOUTH DAKOTA":"SD",TENNESSEE:"TN",TEXAS:"TX",UTAH:"UT",VERMONT:"VT","VIRGIN ISLANDS":"VI",VIRGINIA:"VA",WASHINGTON:"WA","WEST VIRGINIA":"WV",WISCONSIN:"WI",WYOMING:"WY","ARMED FORCES EUROPE, THE MIDDLE EAST, AND CANADA":"AE","ARMED FORCES CANADA":"AE","ARMED FORCES THE MIDDLE EAST":"AE","ARMED FORCES EUROPE":"AE","ARMED FORCES PACIFIC":"AP","ARMED FORCES AMERICAS (EXCEPT CANADA)":"AA","ARMED FORCES AMERICAS":"AA"},d=["ALABAMA","ALASKA","AMERICAN SAMOA","ARIZONA","ARKANSAS","CALIFORNIA","COLORADO","CONNECTICUT","DELAWARE","DISTRICT OF COLUMBIA","FEDERATED STATES OF MICRONESIA","FLORIDA","GEORGIA","GUAM","HAWAII","IDAHO","ILLINOIS","INDIANA","IOWA","KANSAS","KENTUCKY","LOUISIANA","MAINE","MARSHALL ISLANDS","MARYLAND","MASSACHUSETTS","MICHIGAN","MINNESOTA","MISSISSIPPI","MISSOURI","MONTANA","NEBRASKA","NEVADA","NEW HAMPSHIRE","NEW JERSEY","NEW MEXICO","NEW YORK","NORTH CAROLINA","NORTH DAKOTA","NORTHERN MARIANA ISLANDS","OHIO","OKLAHOMA","OREGON","PALAU","PENNSYLVANIA","PUERTO RICO","RHODE ISLAND","SOUTH CAROLINA","SOUTH DAKOTA","TENNESSEE","TEXAS","UTAH","VERMONT","WEST VIRGINIA","VIRGINIA","VIRGIN ISLANDS","WASHINGTON","WISCONSIN","WYOMING","ARMED FORCES EUROPE, THE MIDDLE EAST, AND CANADA","ARMED FORCES CANADA","ARMED FORCES THE MIDDLE EAST","ARMED FORCES EUROPE","ARMED FORCES PACIFIC","ARMED FORCES AMERICAS (EXCEPT CANADA)","ARMED FORCES AMERICAS"],g=["AL","AK","AS","AZ","AR","CA","CO","CT","DE","DC","FM","FL","GA","GU","HI","ID","IL","IN","IA","KS","KY","LA","ME","MH","MD","MA","MI","MN","MS","MO","MT","NE","NV","NH","NJ","NM","NY","NC","ND","MP","OH","OK","OR","PW","PA","PR","RI","SC","SD","TN","TX","UT","VT","VI","VA","WA","WV","WI","WY","AE","AP","AA"];tt=function(t,i){t&&typeof t!="function"&&i&&(i=="click"?n(t).trigger("click"):i=="submit"&&n(t).submit())};c={FieldsMapped:function(i,u){r.debug&&console.log("EVENT:","FieldsMapped","(Fields mapped to their respective addresses)",i,u);t.loaded?f.postMappingOperations():n(t).load(f.postMappingOperations)},MapInitialized:function(n,t){r.debug&&console.log("EVENT:","MapInitialized","(Mapped fields have been wired up to the window"+(r.ui?", document, and UI":" and document")+")",n,t)},AutocompleteInvoked:function(n,t){r.debug&&console.log("EVENT:","AutocompleteInvoked","(A request is about to be sent to the autocomplete service)",n,t);f.requestAutocomplete(n,t)},AutocompleteReceived:function(n,t){r.debug&&console.log("EVENT:","AutocompleteReceived","(A response has just been received from the autocomplete service)",n,t);f.showAutocomplete(n,t)},AddressChanged:function(n,t){r.debug&&console.log("EVENT:","AddressChanged","(Address changed)",n,t);r.autoVerify&&t.address.enoughInput()&&(t.address.verifyCount==0||t.address.isFreeform())&&!t.suppressAutoVerification&&t.address.hasDomFields()&&t.address.active&&!t.address.autocompleteVisible()&&t.address.form&&!t.address.form.processing&&u("VerificationInvoked",{address:t.address})},VerificationInvoked:function(n,t){if(r.debug&&console.log("EVENT:","VerificationInvoked","(Address verification invoked)",n,t),!t.address||t.address&&t.address.form&&t.address.form.processing){r.debug&&console.log("NOTICE: VerificationInvoked event handling aborted. Address is missing or an address in the same form is already processing.");return}if(t.address.status()!="accepted"||t.verifyAccepted)t.address.form&&(t.address.form.processing=!0);else return r.debug&&console.log("NOTICE: VerificationInvoked raised on an accepted or un-changed address. Nothing to do."),u("Completed",t);t.address.verify(t.invoke,t.invokeFn)},RequestSubmitted:function(n,t){r.debug&&console.log("EVENT:","RequestSubmitted","(Request submitted to server)",n,t);f.showLoader(t.address)},ResponseReceived:function(n,t){r.debug&&console.log("EVENT:","ResponseReceived","(Response received from server, but has not been inspected)",n,t);f.hideLoader(t.address);typeof t.invoke=="function"?t.invoke(t.response):t.response.isInvalid()?u("AddressWasInvalid",t):t.response.isValid()?u("AddressWasValid",t):u("AddressWasAmbiguous",t)},RequestTimedOut:function(n,t){r.debug&&console.log("EVENT:","RequestTimedOut","(Request timed out)",n,t);t.address.form&&delete t.address.form.processing;t.invoke&&t.address.accept(t,!1);f.enableFields(t.address);f.hideLoader(t.address)},AddressWasValid:function(n,t){r.debug&&console.log("EVENT:","AddressWasValid","(Response indicates input address was valid)",n,t);var i=t.address,u=t.response;t.response.chosen=u.raw[0];i.replaceWith(u.raw[0],!0,n);i.accept(t)},AddressWasAmbiguous:function(n,t){r.debug&&console.log("EVENT:","AddressWasAmbiguous","(Response indiciates input address was ambiguous)",n,t);f.showAmbiguous(t)},AddressWasInvalid:function(n,t){r.debug&&console.log("EVENT:","AddressWasInvalid","(Response indicates input address was invalid)",n,t);f.showInvalid(t)},OriginalInputSelected:function(n,t){r.debug&&console.log("EVENT:","OriginalInputSelected","(User chose to use original input)",n,t);t.address.accept(t,!1)},UsedSuggestedAddress:function(n,t){r.debug&&console.log("EVENT:","UsedSuggestedAddress","(User chose to a suggested address)",n,t);t.response.chosen=t.chosenCandidate;t.address.replaceWith(t.chosenCandidate,!0,n);t.address.accept(t)},InvalidAddressRejected:function(n,t){r.debug&&console.log("EVENT:","InvalidAddressRejected","(User chose to correct an invalid address)",n,t);t.address.form&&delete t.address.form.processing;u("Completed",t)},AddressAccepted:function(n,t){r.debug&&console.log("EVENT:","AddressAccepted","(Address marked accepted)",n,t);t||(t={});t.address&&t.address.form&&delete t.address.form.processing;t.invoke&&t.invokeFn&&tt(t.invoke,t.invokeFn);u("Completed",t)},Completed:function(n,t){r.debug&&console.log("EVENT:","Completed","(All done)",n,t);t.address&&(f.enableFields(t.address),t.address.form&&delete t.address.form.processing)}}})(jQuery,window,document)