(function(n){"use strict";function t(t){var r,i;this.config={};n.extend(this,f);t&&n.extend(this,t);r={};for(i in this.output_fields)this.output_fields[i]!==undefined&&(r[i]=n(this.output_fields[i]));this.$output_fields=r}function e(n){var t=/\D/g;return n.sort(function(n,i){return parseInt(n.replace(t,""),10)-parseInt(i.replace(t,""),10)}),n}var i=[],r,u="https://api.getAddress.io/v2/uk",f={api_key:"",output_fields:{line_1:"#line1",line_2:"#line2",line_3:"#line3",post_town:"#town",county:"#county",postcode:"#postcode"},api_endpoint:u,input:undefined,$input:undefined,input_label:"Enter your Postcode",input_muted_style:"color:#CBCBCB;",input_class:"",input_id:"opc_input",button:undefined,$button:undefined,button_id:"opc_button",button_label:"Find your Address",button_class:"",button_disabled_message:"Fetching Addresses...",$dropdown:undefined,dropdown_id:"opc_dropdown",dropdown_select_message:"Select your Address",dropdown_class:"",$error_message:undefined,error_message_id:"opc_error_message",error_message_postcode_invalid:"Please recheck your postcode, it seems to be incorrect",error_message_postcode_not_found:"Your postcode could not be found. Please type in your address",error_message_default:"We were not able to your address from your Postcode. Please input your address manually",error_message_class:"",lookup_interval:1e3,debug_mode:!1,onLookupSuccess:undefined,onLookupError:undefined,onAddressSelected:undefined,sort_numerically:!1};n.support&&n.support.cors===!1&&(n.support.cors=!0);Array.prototype.clean=function(n){for(var t=0;t",{type:"text",id:this.input_id,value:this.input_label}).appendTo(this.$context).addClass(this.input_class).val(this.input_label).attr("style",this.input_muted_style).attr("autocomplete","off").submit(function(){return!1}).keypress(function(n){n.which===13&&t.$button.trigger("click")}).focus(function(){t.$input.removeAttr("style").val("")}).blur(function(){t.$input.val()||(t.$input.val(t.input_label),t.$input.attr("style",t.input_muted_style))}),this.$input};t.prototype.setupLookupButton=function(){var t=this;return this.$button=n(this.button).length?n(this.button).first():n("