1(function($){"use strict";if(typeof $=="undefined"){"console"in window&&window.console.info("Too much lightness, Featherlight needs jQuery.");return}function Featherlight($content,config){if(this instanceof Featherlight)this.id=Featherlight.id++,this.setup($content,config),this.chainCallbacks(Featherlight._callbackChain);else{var fl=new Featherlight($content,config);return fl.open(),fl}}var opened=[],pruneOpened=function(remove){return opened=$.grep(opened,function(fl){return fl!==remove&&fl.$instance.closest("body").length>0}),opened},structure=function(obj,prefix){var result={},regex=new RegExp("^"+prefix+"([A-Z])(.*)");for(var key in obj){var match=key.match(regex);if(match){var dasherized=(match[1]+match[2].replace(/([A-Z])/g,"-$1")).toLowerCase();result[dasherized]=obj[key]}}return result},eventMap={keyup:"onKeyUp",resize:"onResize"},globalEventHandler=function(event){$.each(Featherlight.opened().reverse(),function(){if(!event.isDefaultPrevented()&&this[eventMap[event.type]](event)===!1)return event.preventDefault(),event.stopPropagation(),!1})},toggleGlobalEvents=function(set){if(set!==Featherlight._globalHandlerInstalled){Featherlight._globalHandlerInstalled=set;var events=$.map(eventMap,function(_,name){return name+"."+Featherlight.prototype.namespace}).join(" ");$(window)[set?"on":"off"](events,globalEventHandler)}};Featherlight.prototype={constructor:Featherlight,namespace:"featherlight",targetAttr:"data-featherlight",variant:null,resetCss:!1,background:null,openTrigger:"click",closeTrigger:"click",filter:null,root:"body",openSpeed:250,closeSpeed:250,closeOnClick:"background",closeOnEsc:!0,closeIcon:"✕",loading:"",persist:!1,otherClose:null,beforeOpen:$.noop,beforeContent:$.noop,beforeClose:$.noop,afterOpen:$.noop,afterContent:$.noop,afterClose:$.noop,onKeyUp:$.noop,onResize:$.noop,type:null,contentFilters:["jquery","image","html","ajax","iframe","text"],setup:function(target,config){typeof target=="object"&&!(target instanceof $)&&!config&&(config=target,target=void 0);var self=$.extend(this,config,{target:target}),css=self.resetCss?self.namespace+"-reset":self.namespace,$background=$(self.background||['<div class="'+css+"-loading "+css+'">','<div class="'+css+'-content">','<span class="'+css+"-close-icon "+self.namespace+'-close">',self.closeIcon,"</span>",'<div class="'+self.namespace+'-inner">'+self.loading+"</div>","</div>","</div>"].join("")),closeButtonSelector="."+self.namespace+"-close"+(self.otherClose?","+self.otherClose:"");return self.$instance=$background.clone().addClass(self.variant),self.$instance.on(self.closeTrigger+"."+self.namespace,function(event){var $target=$(event.target);(self.closeOnClick==="background"&&$target.is("."+self.namespace)||self.closeOnClick==="anywhere"||$target.closest(closeButtonSelector).length)&&(self.close(event),event.preventDefault())}),this},getContent:function(){if(this.persist!==!1&&this.$content)return this.$content;var self=this,filters=this.constructor.contentFilters,readTargetAttr=function(name){return self.$currentTarget&&self.$currentTarget.attr(name)},targetValue=readTargetAttr(self.targetAttr),data=self.target||targetValue||"",filter=filters[self.type];if(!filter&&data in filters&&(filter=filters[data],data=self.target&&targetValue),data=data||readTargetAttr("href")||"",!filter)for(var filterName in filters)self[filterName]&&(filter=filters[filterName],data=self[filterName]);if(!filter){var target=data;if(data=null,$.each(self.contentFilters,function(){return filter=filters[this],filter.test&&(data=filter.test(target)),!data&&filter.regex&&target.match&&target.match(filter.regex)&&(data=target),!data}),!data)return"console"in window&&window.console.error("Featherlight: no content filter found "+(target?' for "'+target+'"':" (no target specified)")),!1}return filter.process.call(self,data)},setContent:function($content){var self=this;return($content.is("iframe")||$("iframe",$content).length>0)&&self.$instance.addClass(self.namespace+"-iframe"),self.$instance.removeClass(self.namespace+"-loading"),self.$instance.find("."+self.namespace+"-inner").not($content).slice(1).remove().end().replaceWith($.contains(self.$instance[0],$content[0])?"":$content),self.$content=$content.addClass(self.namespace+"-inner"),self},open:function(event){var self=this;if(self.$instance.hide().appendTo(self.root),(!event||!event.isDefaultPrevented())&&self.beforeOpen(event)!==!1){event&&event.preventDefault();var $content=self.getContent();if($content)return opened.push(self),toggleGlobalEvents(!0),self.$instance.fadeIn(self.openSpeed),self.beforeContent(event),$.when($content).always(function($content2){self.setContent($content2),self.afterContent(event)}).then(self.$instance.promise()).done(function(){self.afterOpen(event)})}return self.$instance.detach(),$.Deferred().reject().promise()},close:function(event){var self=this,deferred=$.Deferred();return self.beforeClose(event)===!1?deferred.reject():(pruneOpened(self).length===0&&toggleGlobalEvents(!1),self.$instance.fadeOut(self.closeSpeed,function(){self.$instance.detach(),self.afterClose(event),deferred.resolve()})),deferred.promise()},resize:function(w,h){if(w&&h){this.$content.css("width","").css("height","");var ratio=Math.max(w/(parseInt(this.$content.parent().css("width"),10)-1),h/(parseInt(this.$content.parent().css("height"),10)-1));ratio>1&&(ratio=h/Math.floor(h/ratio),this.$content.css("width",""+w/ratio+"px").css("height",""+h/ratio+"px"))}}
1,chainCallbacks:function(chain){for(var name in chain)this[name]=$.proxy(chain[name],this,$.proxy(this[name],this))}},$.extend(Featherlight,{id:0,autoBind:"[data-featherlight]",defaults:Featherlight.prototype,contentFilters:{jquery:{regex:/^[#.]\w/,test:function(elem){return elem instanceof $&&elem},process:function(elem){return this.persist!==!1?$(elem):$(elem).clone(!0)}},image:{regex:/\.(png|jpg|jpeg|gif|tiff|bmp|svg)(\?\S*)?$/i,process:function(url){var self=this,deferred=$.Deferred(),img=new Image,$img=$('<img src="'+url+'" alt="" class="'+self.namespace+'-image" />');return img.onload=function(){$img.naturalWidth=img.width,$img.naturalHeight=img.height,deferred.resolve($img)},img.onerror=function(){deferred.reject($img)},img.src=url,deferred.promise()}},html:{regex:/^\s*<[\w!][^<]*>/,process:function(html){return $(html)}},ajax:{regex:/./,process:function(url){var self=this,deferred=$.Deferred(),$container=$("<div></div>").load(url,function(response,status){status!=="error"&&deferred.resolve($container.contents()),deferred.fail()});return deferred.promise()}},iframe:{process:function(url){var deferred=new $.Deferred,$content=$("<iframe/>").hide().attr("src",url).css(structure(this,"iframe")).on("load",function(){deferred.resolve($content.show())}).appendTo(this.$instance.find("."+this.namespace+"-content"));return deferred.promise()}},text:{process:function(text){return $("<div>",{text:text})}}},functionAttributes:["beforeOpen","afterOpen","beforeContent","afterContent","beforeClose","afterClose"],readElementConfig:function(element,namespace){var Klass=this,regexp=new RegExp("^data-"+namespace+"-(.*)"),config={};return element&&element.attributes&&$.each(element.attributes,function(){var match=this.name.match(regexp);if(match){var val=this.value,name=$.camelCase(match[1]);if($.inArray(name,Klass.functionAttributes)>=0)val=new Function(val);else try{val=JSON.parse(val)}catch(e){}config[name]=val}}),config},extend:function(child,defaults){var Ctor=function(){this.constructor=child};return Ctor.prototype=this.prototype,child.prototype=new Ctor,child.__super__=this.prototype,$.extend(child,this,defaults),child.defaults=child.prototype,child},attach:function($source,$content,config){var Klass=this;typeof $content=="object"&&!($content instanceof $)&&!config&&(config=$content,$content=void 0),config=$.extend({},config);var namespace=config.namespace||Klass.defaults.namespace,tempConfig=$.extend({},Klass.defaults,Klass.readElementConfig($source[0],namespace),config),sharedPersist;return $source.on(tempConfig.openTrigger+"."+tempConfig.namespace,tempConfig.filter,function(event){var elemConfig=$.extend({$source:$source,$currentTarget:$(this)},Klass.readElementConfig($source[0],tempConfig.namespace),Klass.readElementConfig(this,tempConfig.namespace),config),fl=sharedPersist||$(this).data("featherlight-persisted")||new Klass($content,elemConfig);fl.persist==="shared"?sharedPersist=fl:fl.persist!==!1&&$(this).data("featherlight-persisted",fl),elemConfig.$currentTarget.blur(),fl.open(event)}),$source},current:function(){var all=this.opened();return all[all.length-1]||null},opened:function(){var klass=this;return pruneOpened(),$.grep(opened,function(fl){return fl instanceof klass})},close:function(event){var cur=this.current();if(cur)return cur.close(event)},_onReady:function(){var Klass=this;Klass.autoBind&&($(Klass.autoBind).each(function(){Klass.attach($(this))}),$(document).on("click",Klass.autoBind,function(evt){evt.isDefaultPrevented()||evt.namespace==="featherlight"||(evt.preventDefault(),Klass.attach($(evt.currentTarget)),$(evt.target).trigger("click.featherlight"))}))},_callbackChain:{onKeyUp:function(_super,event){return event.keyCode===27?(this.closeOnEsc&&$.featherlight.close(event),!1):_super(event)},onResize:function(_super,event){return this.resize(this.$content.naturalWidth,this.$content.naturalHeight),_super(event)},afterContent:function(_super,event){var r=_super(event);return this.onResize(event),r}}}),$.featherlight=Featherlight,$.fn.featherlight=function($content,config){return Featherlight.attach(this,$content,config)},$(document).ready(function(){Featherlight._onReady()})})(jQuery); 2//# sourceMappingURL=/cdn/shop/t/3/assets/featherlight.js.map?v=99075308828580375161476486593
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.