text: !function(a){"use strict";FormKeeper.Extension.Url=Class.extend({errorMessage:{"default":"The url you entered must be in a valid Format.",suggestion:' Did you mean <a data-form-keeper-suggestion="{{suggestion}}">{{suggestion}}</a>?'},defaults:{protocols:["http://","https://"],subDomains:["www"],suggestionDomain:"com",allowHash:!0,allowGet:!0},init:function(){return this.utils=FormKeeper.Utils,this.options={},this},validateSelector:function(a){var b=this,c=a.data("form-keeper").url,d=b.utils.isTagName(a,"input"),e=b.utils.isTagName(a,"textarea");return d||e?b.validate(a.val(),c):(b.utils.console("warn","FormKeeper.Extension.Url.validateSelector: the selector must be an input or textarea tag"),!0)},validate:function(b,c){var d,e=this,f={valid:!0},g=function(a){return e.utils.isUndefined(a)?{valid:!1}:{valid:!1,suggestion:a}};return e.utils.isMandatoryCase(b)?f:e.utils.isString(b)?(e.options=a.extend({},e.defaults,c),d=e.getValidateReturn(b),d.valid?f:g(d.suggestion)):g()},getValidateReturn:function(b){var c,d=this,e=d.getUrlParts(b),f=d.options,g=""===f.protocols[0],h=""===f.subDomains[0],i=[],j=0;return c=d.getRegExp().exec(e.base),d.utils.isNull(c)?{valid:!1}:(f.allowHash||""===e.hash||(j+=1,e.hash=""),f.allowGet||""===e.get||(j+=1,e.get=""),c[0]!==c.input&&(j+=1),g?i.push(""):-1===a.inArray(c[1],f.protocols)?(i.push(f.protocols[0]),j+=1):i.push(c[1]),h?i.push(""):-1===a.inArray(c[2],f.subDomains)?(i.push(f.subDomains[0]),j+=1):i.push(c[2]),i.push(c[3]),d.utils.isUndefined(c[4])||""===c[4]?(i.push(f.suggestionDomain),j+=1):i.push(c[4]),0===j?{valid:!0}:{valid:!1,suggestion:i.join("")+e.get+e.hash})},getUrlParts:function(a){var b,c=this;return-1!==a.search("/\\?")?(b=a.split("/?"),c.getUrlPartsHash(b[0],"/?"+b[1])):-1!==a.search("\\?")?(b=a.split("?"),c.getUrlPartsHash(b[0],"?"+b[1])):c.getUrlPartsHash(a,void 0)},getUrlPartsHash:function(a,b){var c,d=this,e="";return d.utils.isUndefined(b)?(b="",-1!==a.search("/#")?(c=a.split("/#"),a=c[0],e="/#"+c[1]):-1!==a.search("#")&&(c=a.split("#"),a=c[0],e="#"+c[1]),{base:a,get:b,hash:e}):(-1!==b.search("/#")?(c=b.split("/#"),b=c[0],e="/#"+c[1]):-1!==b.search("#")&&(c=b.split("#"),b=c[0],e="#"+c[1]),{base:a,get:b,hash:e})},getRegExp:function(){var a=this.options,b="("+a.protocols.join("|")+"){0,1}("+a.subDomains.join("|")+"){0,1}([.]{1}[a-z.-_0-9]*[.]{1})([a-z.]*)";return new RegExp(b,"i")}})}(FormKeeper.$);