1 2window._dictionary={"menu":{"polska":"\u00dcbernachtung","mapa":"Kartensuche","promocje":"Rabatte","promocjaTeaser":"Tagesangebot","regiony":"Land"},"glowna":{"rekomendowane":"Empfohlen","popularneMiasta":"Beliebte St\u00e4dte"},"inne":{"slogan":"Die beste Unterkunft in Polen","wiecej":"alle","dodajDoUlubinych":"Zu Favoriten hinzuf\u00fcgen","dodajObiekt":"Objekt hinzuf\u00fcgen","prawaAutorskie":"Copyrights","kontakt":"Kontakt","zobaczWszystkie":"alle zeigen","zamknij":"schlie\u00dfen","hotele":"Hotels","hoteleLink":"hotels","popularne":"popul\u00e4r","polecane":"popul\u00e4r","miasta":"Stadt","krainy":"Regionen","jeziora":"Seen","noclegiWPopMiastach":"Unterkunft in popul\u00e4ren St\u00e4dten","noclegiWPopKrainach":"Unterkunft in popul\u00e4ren Regionen","noclegiNadJeziorem":"unterkunft am See","rezerwujOnline":"Online-Reservierung","firstBreadcrumb":"\u00dcbernachtung im Polen","ostatniaAktualizacja":"Zuletzt aktualisiert","iloscObiektowWBazie":"Anzahl der Inserate","tekstStopka":"\u00dcbernachtungsbasis Meteor \u2013 hier finden Sie Pensionen, Landtouristik, G\u00e4stezimmer, Hotels, Hostels, Bungalows, Ferienwohnungen, Ferienh\u00e4user, Motels, SPA-Zentren, Appartements u. \u00e4. in Polen. Die \u00dcbernachtungen befinden sich in Stadtzentren und im Umkreis, am Meer, in den Bergen und am See. Die Suchmaschine, in der Kategorie \u201eLand und See\u201c, erm\u00f6glicht Sie eine schnelle Suche nach den richtigen \u00dcbernachtungen. Die Beschreibungen der einzelnen Ferienunterk\u00fcnfte sind mit Preise, Landkarten, Fotos ausf\u00fchrlichen Beschreibungen ausgestattet.","odlegloscDoCentrum":"Zentrum","odlegloscDoCentrumPonad":"mehr als","polozonyWCentrum":"befindet sich im Zentrum von","jestesZPolski":"Bist Du aus Polen?<br\/>Sprichst du polnisch?<br\/>Sieht hier an:","dzielnice":"Bezirke","zaNocleg":"pro Nacht","noclegiIHotele":"\u00dcbernachtung und hotels","ulica":"Stra\u00dfe","ulice":"Stra\u00dfen","opinie":"Bewertungen","opinieLink":"bewertungen","liczbaOpinii":"Anzahl der Bewertungen","wPolsce":"in Polen","miejscowosci":"St\u00e4dte","regulamin":"Verordnungen","obiektyWolneMiejsca":"\u00dcbernachtung f\u00fcr die n\u00e4chsten Tage","ostatnioDodane":"Vor kurzem hinzugef\u00fcgt","proszeCzekac":"please wait","ofertaDniaNewsletter":"Sie wollen das Angebot des Tages erhalten? Ihre E-Mail","panelLogowania":"Der Login-Bildschirm"},"formularzWyszukiwania":{"aktywneKryteriaWyszukiwania":"Aktive Suchkriterien","czasPrzyjazdu":"Anreise","czasWyjazdu":"Abreise","miasjesceNoclegu":"Wohin reisen Sie?","termin":"Zeitraum","rowniezOkolica":"das Gebiet","wojewodztwo":"Provinz","wojewodztwoDowolne":"beliebig","typObiektu":"Kategorie","typObiektuDowolny":"beliebig","miasto":"Stadt","ceny":"Preis","cenyDowolna":"beliebig","kraina":"Region","nazwaJeziora":"der Name des Sees","nazwaJezioraPodpowiedz":"Geben Sie den Namen des Sees, z. B. \u015aniardwy","liczbaMiejsc":"Anzahl der Pl\u00e4tze","liczbaMiejscDowolna":"beliebig","szukaj":"Suche","mapaInstrukcja1":"Klicken Sie auf die Karte","mapaInstrukcja2":"W\u00e4hlen Sie Suchgebiet","mapaInstrukcja3":"Klicken Sie auf \"Suchen\"","dodatkoweKryteria":"Erweiterte Kriterien","pokazDalszeMiesiace":"mehr","kalendarzManual":"Geben Lage, Pick bevorzugte Zeitspanne und klicken Sie auf Suchen","terminWyjazdu":"Aufenthalt","terminWyjazduDowolny":"beliebig","atrybuty":"attributes","kliknijAbyWybrac":"click to select","wybrano":"selected","filtry":"filter","locationPlaceholderShort":"enter location","locationPlaceholderLong":"enter location (city, street, landmark, etc. )","zamknij":"close","wiecej":"more","wrocDoMapy":"return to map view"},"obiekt":{"nastepny":"n\u00e4chste","nastepne":"n\u00e4chste","poprzedni":"vorherige","poprzednie":"vorherige","daneTeleadresowe":"Kontakt","telefon":"Telefon","telefony":"Telefon","telefonKom":"Handy","telefonFax":"Fax","telefonRez":"Vorbestellung","www":"www","prywatneWWW":"private www","adres":"Adresse","wojewodztwo":"Woiwodschaft","opisPokoi":"Zimmerbeschreibung","iloscMiejsc":"Anzahl der Betten","cennik":"Preisliste","cennikRodzaj":"Zimmerart","cennikIlosc":"Anzahl","cennikCeny":"Preis","opisObiektu":"Objektbeschreibung","uslugiGastronomiczne":"Gastronomie","opisPolozenie":"Lage des Objekts","sprawdzWolneMie
2jsca":"Frei Zimmer","wyslijMail":"kontakt per E-mail","pogodaWOkolicy":"WETTER","opinieIKomentarze":"KOMMENTAR","zaNoclegOd":"pro Nacht ab","pokoje":"rooms","nazwaGastronimia":"Typ","podobnePropozycje":"\u00e4hnliche Vorschl\u00e4ge","zdjecia":"Fotos","pokazGPS":"zeigen GPS-Koordinaten","GPSInfo":"Koordinaten sind unbest\u00e4tigte","tagList":"Tagliste","pobierzPrzewodnik":"Download Fremdenf\u00fchrer","gastronomiaNazwa":"name","gastronomiaRodzaj":"Art","wiecejZdjec":"mehr Bilder","galeria":"Galerie","pokazNaMapie":"Auf der Karte anzeigen","wyslijWiadomosc":"Eine Nachricht schicken","obiektCzynnyWTerminie":"Einrichtung p\u00fcnktlich ge\u00f6ffnet","obiektCzynnyPrzezCalyRok":"Die Anlage ist ganzj\u00e4hrig ge\u00f6ffnet","sprawdzDostepnosc":"Verf\u00fcgbarkeit pr\u00fcfen","rezerwujOnline":"on-line reservation","najblizszeWiekszeMiasto":"nearest city","wizytowka":"card"},"obiektKontakt":{"infoGwiazdki":"Felder sind notwendig","imieINazwisko":"Vor- und Zuname","email":"E-mail","telefon":"Telefon","dataWyjazdu":"Abfart","dataPrzyjazdu":"Ankunft","pytanie":"Fragen\/Platzreservierung","iloscOsob":"Die Zahl der Personen","wyslij":"Schicke Frage\/Platzreservierung","newsletter":"subscribe to newsletter","dziekujemy":"\u017cyczymy udanego pobytu.<br>Zapraszamy ponownie do skorzystania z bazy noclegowej.","obiektOtrzyma":"otrzyma wiadomo\u015b\u0107 o nast\u0119pujacej tre\u015bci"},"wynikiSzukania":{"pierwsza":"erste","ostatnia":"letzte","nastepnya":"n\u00e4chste","poprzednia":"vorherige","pogoda":"Wetter","rezerwacjeOnLine":"Online-Reservierung","wolneMiejsca":"freie Zimmer","szukamNoclegu":"Ich suche Unterkunft","mapa":"Landkarte","keyword":"\u00dcbernachtung","keywordLink":"ubernachtung","keywordShort":"Schlafen","okolice":"Gel\u00e4nde","kolo":"Gel\u00e4nde","wOkolicy":"in der Nachbarschaft","wPoblizu":"in der N\u00e4he","topMiejscowosci":"top St\u00e4dte","tanieNoclegi":"preiswert \u00dcbernachtung","tanie":"preiswert","noclegOd":"pro Nacht ab","ofertyNoclegowe":"Inserate","znalezionoOfertNoclegowych":"Inserate gefunden","pokazTylkoWolneMiejsca":"zeigen nur den freien Zimmer","cena":"Preis","od":"ab","do":"zum","miejsc":"Pl\u00e4tze","polozenieNaMapie":"Lage auf der Karte","wspolrzedne":"Koordinaten","ofertaDnia":"Tagesangebot","ostatnioDodane":"Vor kurzem hinzugef\u00fcgt","nastepna":"next"},"ciekawostki":{"miejscamin":"Minimalna liczba miejsc noclegowych [rodzaj.nazwa_poj_dop] [lokacja.nazwa_poj_mie] wynosi [stats.miejscamin].","miejscamax":"Maksymalna liczba miejsc noclegowych [rodzaj.nazwa_poj_dop] [lokacja.nazwa_poj_mie] wynosi [stats.miejscamax].","miejscaavg":"\u015arednia liczba miejsc noclegowych [rodzaj.nazwa_poj_dop] [lokacja.nazwa_poj_mie] to [stats.miejscaavg].","cenamin":"Minimalna cena za nocleg [rodzaj.nazwa_mn_dop] [lokacja.nazwa_poj_mie] wynosi [stats.cenamin] PLN.","cenamax":"Maksymalna cena za nocleg [rodzaj.nazwa_mn_dop] [lokacja.nazwa_poj_mie] wynosi [stats.cenamax] PLN.","cenaminAVG":"\u015arednia cena za nocleg [rodzaj.nazwa_mn_dop] [lokacja.nazwa_poj_mie] wynosi [stats.cenaminAVG] PLN.","cenaprzedzial":"Ceny za nocleg [rodzaj.nazwa_mn_dop] [lokacja.nazwa_poj_mie] kszta\u0142tuj\u0105 si\u0119 na poziomie [stats.cena_przedzial] PLN.","miejscaprzedzial":"Obiekty noclegowe [rodzaj.nazwa_mn_mia] [lokacja.nazwa_poj_mie] dysponuj\u0105 ok [stats.miejsca_przedzial] miejscami noclegowymi.","liczba":"Liczba ofert noclegowych [rodzaj.nazwa_mn_dop] [lokacja.nazwa_poj_mie] wynosi [stats.liczba]."}};window._translate=function(key,section){return window._dictionary[section][key];};if(typeof(Meteor)=='undefined'){window.Meteor={};} 3Meteor.Core=Meteor.Core||{};Meteor.Core.Lang=Meteor.Core.Lang||{};Meteor.Core.Env=Meteor.Core.Env||{};Meteor.Core.Env.Privileged=typeof(Meteor.Core.Env.Privileged)!=='undefined'?Meteor.Core.Env.Privileged:false;Meteor.Data=Meteor.Data||{};Meteor.Util=Meteor.Util||{};Meteor.Widget=Meteor.Widget||{};Meteor.App=Meteor.App||{};Meteor.UI=Meteor.UI||{};Meteor.Core.Object={};Meteor.Core.Object.merge=function(o1,o2){if(typeof(o1)!=='object'){o1={};} 4if(typeof(o2)!=='object'){o2={};} 5var result={};for(var i in o1){result[i]=o1[i];} 6for(var i in o2){result[i]=o2[i];} 7return result;};Meteor.Core.Object.define=function(variable,defaultValue){if(typeof(variable)=='undefined'){return defaultValue;}else{return variable;}} 8Meteor.Core.Object.flatten=function(data,name){if(typeof(name)=='undefined'){name='formData';} 9var output={};for(var i in data){var key=name+'['+i+']';if(typeof(data[i])=='object'){var tmp=Meteor.Core.Object.flatten(data[i],
9key);for(var x in tmp){output[x]=tmp[x];}}else{output[key]=data[i];}} 10return output;};Meteor.Core.Lang.augmentObject=function(r,s){if(!s||!r){throw new Meteor.Core.Exception("Absorb failed, verify dependencies.");} 11var a=arguments,i,p,overrideList=a[2];if(overrideList&&overrideList!==true){for(i=2;i<a.length;i=i+1){r[a[i]]=s[a[i]];}}else{for(p in s){if(overrideList||!(p in r)){r[p]=s[p];}}}};Meteor.Core.Lang.augmentProto=function(r,s){if(!s||!r){throw new Meteor.Core.Exception("Augment failed, verify dependencies.");} 12var a=[r.prototype,s.prototype],i;for(i=2;i<arguments.length;i=i+1){a.push(arguments[i]);} 13L.augmentObject.apply(this,a);};Meteor.Core.Event=function(type,cancelable,data){this.timeStamp=(new Date()).getTime();this.type=type;this.cancelable=typeof(cancelable)!='undefined'?cancelable:true;this.target=null;this.returnValue=true;this.data=typeof(data)!='undefined'?data:{};};Meteor.Core.Event.prototype.preventDefault=function(){if(this.cancelable){this.returnValue=false;}};Meteor.Core.Event.prototype.toString=function(){return this.type;};Meteor.Core.EventTarget=function(){this._eventhandlers=[];} 14Meteor.Core.EventTarget.prototype.addEventListener=function(type,callback){if(typeof this._eventhandlers[type]=="undefined"){this._eventhandlers[type]=[];} 15this._eventhandlers[type].push(callback);return this;};Meteor.Core.EventTarget.prototype.dispatchEvent=function(oEvent){oEvent.target=this;if(typeof(this._eventhandlers[oEvent.type])!="undefined"){for(var i=0;i<this._eventhandlers[oEvent.type].length;i++){this._eventhandlers[oEvent.type][i](oEvent);}} 16return oEvent.returnValue;};Meteor.Core.Exception=function(message,data){this.__exceptionMessage=message||{};this.__exceptionData=data||{};};Meteor.Core.Exception.prototype.getMessage=function(){return this.__exceptionMessage;};Meteor.Core.Exception.prototype.getData=function(){return this.__exceptionData;};Meteor.Core.Exception.prototype.toString=function(){return this.getMessage();};Meteor.Core.ThrowsException=function(prefix){this.__ThrowsExceptionPrefix=prefix||'';};Meteor.Core.ThrowsException.prototype.throwException=function(message,data){throw new Meteor.Core.Exception(this.__ThrowsExceptionPrefix+'Exception: '+message,data);};Meteor.Core.Widget=function(widgetName){Meteor.Core.Lang.augmentObject(this,new Meteor.Core.EventTarget());this.__widgetName=widgetName;this.__instanceID=widgetName+"_"+parseInt(Math.random()*100000000);this._options={};};Meteor.Core.Widget.prototype.setOption=function(key,value){if(typeof(key)==='undefined'){return this;}else if(typeof(key)=='object'){Meteor.Core.Lang.augmentObject(this._options,key,true);}else{this._options[key]=value;} 17return this;};Meteor.Core.Widget.prototype.getName=function(){return this.__widgetName;};Meteor.Core.Widget.prototype.getID=function(){return this.__instanceID;};Meteor.Core.Widget.prototype.render=function(){if(typeof(this._render)=='undefined'){this.throwException('brak implementacji metody _render');} 18this._render();return this;};Meteor.Core.Widget.prototype.throwException=function(msg,data){throw new Meteor.Core.Exception("Widget."+this.getName()+": "+msg,data);};if(typeof(Meteor)==='undefined'){Meteor={};} 19if(typeof(Meteor.Util)==='undefined'){Meteor.Util={};} 20Meteor.Util.FileUploader={frame:function(c){var n='f'+Math.floor(Math.random()*99999);var d=document.createElement('DIV');d.innerHTML='<iframe style="display:none" src="about:blank" id="'+n+'" name="'+n+'" onload="Meteor.Util.FileUploader.loaded(\''+n+'\')"></iframe>';document.body.appendChild(d);var i=document.getElementById(n);if(c&&typeof(c.onComplete)=='function'){i.onComplete=c.onComplete;} 21return n;},form:function(f,name){f.setAttribute('target',name);},submit:function(f,c){Meteor.Util.FileUploader.form(f,Meteor.Util.FileUploader.frame(c));if(c&&typeof(c.onStart)=='function'){return c.onStart();}else{return true;}},loaded:function(id){var i=document.getElementById(id);if(i.contentDocument){var d=i.contentDocument;}else if(i.contentWindow){var d=i.contentWindow.document;}else{var d=window.frames[id].document;} 22if(d.location.href=="about:blank"){return;} 23if(typeof(i.onComplete)=='function'){i.onComplete(d.body.innerHTML);}}};Meteor.Util.Logger=function(){this._enabled=true;};Meteor.Util.Logger._instance=null;Meteor.Util.Logger.getInstance=function(){if(Meteor.Util.Logger._instance==null){Meteor.Util.Logger._instance=new Meteor.Util.Logger();} 24return Meteor.Util.Logger._instance;};Meteor.Util.Logger.prototype.write=function(msg,type){if(this._enabled==false){return this;} 25if(typeof(type)==='undefined'){type='log';} 26try{console[type](msg);}catch(e){} 27return this;};Meteor.Util.Logger.prototype.enable=function(){this._enabled=true;return this;} 28Meteor.Util.Logger.prototype.disable=function(){this._enabled=false;return this;} 29Meteor.Util.Logger.LoggerEnabled=function(prefix){Meteor.Core.Lang.augmentObject(this,new Meteor.Core.ThrowsException("Meteor.Util.Logger.LoggerEnabled"));if(typeof(prefix)=='undefined'){this.throwException('brak prefixu');} 30this.__LoggerLoggerEnabledPrefix=prefix||'anonim';};Meteor.Util.Logger.LoggerEnabled.prototype.log=function(msg,type){Meteor.Util.Logger.getInstance().write(this.__LoggerLoggerEnabledPrefix+": "+msg,type);};Meteor.Util.URI={};Meteor.Util.URI.parseQueryString=function(s){var r,a,p;r={};a=s.split('&');for(var i=0;i<a.length;i++){p=a[i].split('=');if(p.length===2&&p[0].length>0){r[p[0]]=decodeURIComponent(p[1]);}} 31return r;};Meteor.Util.URI.buildQueryString=function(parameters){var qsElements=[];for(var key in parameters){qsElements.push(encodeURIComponent(key)+"="+encodeURIComponent(parameters[key]));} 32return qsElements.join('&');};Meteor.Util.Template=function(){this._varCounter=0;this._data={};this._template="brak szablonu";this._strict=true;this.reset();};Meteor.Util.Template._instance=null;Meteor.Util.Template.getInstance=function(){if(Meteor.Util.Template._instance==null){Meteor.Util.Template._instance=new Meteor.Util.Template();} 33return Meteor.Util.Template._instance;};Meteor.Util.Template.prototype.parse=function(template,data){template=Meteor.Core.Object.define(template,this._template);data=Meteor.Core.Object.define(data,this._data);for(var k in data){template=template.replace(new RegExp("\\{\\$"+k+"\\}","g"),data[k]);} 34if(this._strict){template=template.replace(new RegExp("\\{\\$[a-zA-Z0-9]*\\}","g"),'');} 35return template;};Meteor.Util.Template.prototype.setData=function(data,key){if(typeof(key
35)=='undefined'){if(typeof(data)=='object'){this._data=data;}else{this._data[this._varCounter++]=data;}}else{this._data[key]=data;} 36return this;};Meteor.Util.Template.prototype.setTemplate=function(template){this._template=template;return this;};Meteor.Util.Template.prototype.reset=function(){this._template="brak szablonu";this._data={};this._varCounter=0;return this;};Meteor.Util.Template.prototype.setStrict=function(b){this._strict=b?true:false;return this;};Meteor.Util.Validate={};Meteor.Util.Validate.nrb=function(nrb){if(nrb.length!=26){return 0;} 37var W=[1,10,3,30,9,90,27,76,81,34,49,5,50,15,53,45,62,38,89,17,73,51,25,56,75,71,31,19,93,57];nrb+="2521";nrb=nrb.substr(2)+nrb.substr(0,2);var Z=0;for(var i=0;i<30;i++){Z+=nrb[29-i]*W[i];} 38return Z%97==1;};Meteor.Util.Validate.floatNumber=function(val){return val.match(/^\d+(\.\d+)?$/);};Meteor.Util.Validate.intNumber=function(val){return val.match(/^\d+$/);};Meteor.Util.Validate.email=function(val){var pattern=/^[A-Za-z0-9._%+-]+@[^.][A-Za-z0-9.-]+\.[a-zA-Z]{2,4}$/;return pattern.test(val);};Meteor.Util.Validate.www=function(val){var pattern=/^http(s)?:\/\/[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(\/.*)?$/i;return pattern.test(val);};Meteor.Util.Form={};Meteor.Util.Form.getData=function(form){var f=$(form);var data={};f.find("input[type=text], input[type=hidden], input[type=checkbox]:checked, textarea, input[type=radio]:checked, select").each(function(){var el=$(this);var elName=el.attr('name');if(elName){data[elName]=el.val();}});return data;};Meteor.Util.Form.cleanUpFloat=function(l,positive){positive=typeof(positive)!=='undefined';var result=parseFloat(String(l).replace(',','.').replace(/[^1234567890\.\-)]/g,''));result=isNaN(result)?'':result;return!positive||(positive&&result>0)?result:'';};Meteor.Util.Form.cleanUpInt=function(l,positive){positive=typeof(positive)!=='undefined';var pattern=positive?/[^1234567890]/g:/[^1234567890\-)]/g;var result=String(l).replace(pattern,'');result=isNaN(result)?'':result;return!positive||(positive&&result>0)?result:'';};Meteor.Util.String={};Meteor.Core.Lang.augmentObject(Meteor.Util.String,new Meteor.Core.ThrowsException("Meteor.Util.String"));Meteor.Util.String.UPPERCASE=1;Meteor.Util.String.NORMAL=0;Meteor.Util.String.LOWERCASE=-1;Meteor.Util.String.trim=function(str,chars){return Meteor.Util.String.ltrim(Meteor.Util.String.rtrim(str,chars),chars);};Meteor.Util.String.ltrim=function(str,chars){chars=chars||"\\s";return str.replace(new RegExp("^["+chars+"]+","g"),"");};Meteor.Util.String.rtrim=function(str,chars){chars=chars||"\\s";return str.replace(new RegExp("["+chars+"]+$","g"),"");};Meteor.Util.String.escapeHTML=function(string){return string.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>');};Meteor.Util.String.truncate=function(string,length,truncation){length=length||30;truncation=typeof(truncation)==='undefined'?'...':truncation;return string.length>length?string.slice(0,length-truncation.length)+truncation:String(string);};Meteor.Util.String.stripTags=function(string){return string.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi,'');};Meteor.Util.String.insertTextAtCursor=function(el,text){var val=el.value,endIndex,range;if(typeof el.selectionStart!="undefined"&&typeof el.selectionEnd!="undefined"){endIndex=el.selectionEnd;el.value=val.slice(0,endIndex)+text+val.slice(endIndex);el.selectionStart=el.selectionEnd=endIndex+text.length;}else if(typeof document.selection!="undefined"&&typeof document.selection.createRange!="undefined"){el.focus();range=document.selection.createRange();range.collapse(false);range.text=text;range.select();}} 39Meteor.Util.String.stripAccents=function(s,c){var acc,str,o,r,i 40if('undefined'===typeof(c)){c=Meteor.Util.String.LOWERCASE;} 41acc='à à à š Ã Ã Æ Å Âµ à à ž à Ÿ à à à à Š£ à à Š¥ à Ž § à à à à à à à à à à ';str='E E E s I I f o m I I z D Y N O O O S L O O O Y O Z S A U A U A U A U A Y ';acc+='à à à à à à á â û Ä Ä Å Å Å¸ ã ü Ä Ä® ŠŠŹ ä ý Ä Ä¯ Å Å¡ ź Ã¥ þ Ä Ä° ŠŢ Å» æ ÿ ';str+='A A S C a E a a u E i n s Y a u e I N S Z a y E i n s z a p e I n T Z a y ';acc+='Ä Ä± Šţ ż ç Ä Ä Ä² ŠŤ Ž è Ä Ä Ä³ Šť ž é Ä Ä Ä´ ŠŦ Å¿ ê Ä Ä Äµ Šŧ ë Ä Ä Ä¶ Å ';str+='E l n t z c A e I n T Z e a E i O t z e A e J o T i e a G j O t e A g K o ';acc+='Ũ ì Ä Ä Ä· Å Å© Ã Ä Ä Ä¸ ŠŪ î Ä Ä Ä¹ Å Å« ï Ä Ä¡ ĺ ŠŬ ð Ä Ä¢ Ä» ŠŠñ Ä Ä£ ļ Å Å® ';str+='U i a G k O u i C g k o U i c G L O u i C g l o U o c G L R u n C g l r U ';acc+='ò Ä Ä¤ Ľ Šů ó Ä Ä¥ ľ ŠŰ ô Ä Ä¦ Ä¿ Šű õ Ä Ä§ ŠŠŲ ö Ä Ä¨ ŠŠų Ä Ä© Å Å Å´ ø Ä ';str+='o c H L R u o C h l r U o c H L R u o D h l r U o d I L S c D i l s W o d ';acc+='Ī ŠŠŵ ù Ä Ä« ŠŠŶ Æ Ãº Ä Ä¬ Å Å Å· : ; . ,';str+='I N S w u E i n s Y e u e I N S y _ _ _ _ _';o='';var ta=acc.split("\t");var ts=str.split("\t");for(i=0;i<ta.length;i++){r=new RegExp('['+ta[i]+']','g');s=s.replace(r,ts[i]);} 42s=s.replace(/[^a-zA-Z0-9_-]/gi,o);s=s.replace(/[_]+/,'_');s=s.replace(/^_*(.*?)_*$/gi,'$1') 43if(c===Meteor.Util.String.LOWERCASE){return s.toLowerCase();}else if(c===Meteor.Util.String.UPPERCASE){return s.toUpperCase();}else{return s;}} 44Meteor.Util.AjaxEnabled=function(options){this.__AjaxEnabledOptions=Meteor.Core.Object.merge({'urlPatternEnabled':false,'urlPattern':''},options);};Meteor.Util.AjaxEnabled.prototype.ajax=function(ajaxOptions,options){var _options=Meteor.Core.Object.merge(this.__AjaxEnabledOptions,options);var _ajaxOptions=Meteor.Core.Object.merge({type:'GET',url:''},ajaxOptions);if(_options.urlPatternEnabled&&typeof(ajaxOptions.url)!=='undefined'){Meteor.Util.Template.getInstance().reset();_ajaxOptions.url=Meteor.Util.Template.getInstance().setData(ajaxOptions.url).parse(_options.urlPattern);} 45return $.ajax(_ajaxOptions);};Meteor.Util.AjaxEnabled.prototype.ajaxPost=function(url,p1,p2){var _ajaxOptions={url:url,data:typeof(p1)=='function'?{}:p1,success:typeof(p1)=='function'?p1:(typeof(p2)=='function'?p2:function(){}),type:'POST'};return this.ajax(_ajaxOptions);};Meteor.Util.AjaxEnabled.prototype.ajaxGet=function(url,p1,p2){var _ajaxOptions={url:url,data:typeof(p1)=='function'?{}:p1,success:typeof(p1)=='function'?p1:(typeof(p2)=='function'?p2:function(){}),type:'GET'};return this.ajax(_ajaxOptions);};Meteor.Util.AjaxEnabled.prototype.ajaxSetOption=function(key,value){this.__AjaxEnabledOptions[key]=value;return this;};if(typeof(Meteor.Util.JSONP)==='undefined'){Meteor.Util.JSONP=function(){var requestsCount=0;var options={interval:100,storeResults:false,startCallback:function(){},endCallback:function(){}};var requestsInProgress=0;var encodeParam=function(param){if(typeof(param)==="string"){return param;}else if(typeof(param)==="object"){var wynik='';for(att in param){wynik+="&"+encodeURIComponent(att)+'='+encodeURIComponent(param[att]);} 46return wynik;}else{return'';}};return{requests:[],setup:function(param){if(typeof(param)==='object'){for(p in param){options[p]=param[p];}}},get:function(url,param,callback){if(requestsInProgress===0){options.startCallback();} 47requestsInProgress++;if(typeof(param)==="function"&&typeof(callback)==="undefined"){callback=param;} 48var name=+(requestsCount++);var script=document.createElement('script');script.type="text/javascript";param=typeof(param)==="undefined"?'':param;script.src=url+(url.indexOf('?')!=-1?"&":"?")+"reqName="+name+encodeParam(param);document.getElementsByTagName('head')[0].appendChild(script);Meteor.Util.JSONP.requests[name]={script:script,callback:callback,loaded:function(data){Meteor.Util.JSONP.requests[name].data=data;if(typeof(callback)==='function'){callback(Meteor.Util.JSONP.requests[name].data,name);} 49Meteor.Util.JSONP._cleanUpRequest(name);}};return Meteor.Util.JSONP.requests[name];},_cleanUpRequest:function(name){Meteor.Util.JSONP.requests[name].script.parentNode.removeChild(Meteor.Util.JSONP.requests[name].script);if(!options.storeResults){delete Meteor.Util.JSONP.requests[name];}else{delete Meteor.Util.JSONP.requests[name].script;delete Meteor.Util.JSONP.requests[name].callback;delete Meteor.Util.JSONP.requests[name].listener;} 50requestsInProgress--;
50if(requestsInProgress===0){options.endCallback();}}}}();} 51if('undefined'===typeof(Meteor.Util.Cookie)){Meteor.Util.Cookie={};Meteor.Util.Cookie.create=function(name,value,lifetimeSeconds){name=name;if(lifetimeSeconds){var date=new Date();date.setTime(date.getTime()+(lifetimeSeconds*1000));var expires="; expires="+date.toGMTString();} 52else var expires="";document.cookie=name+"="+value+expires+"; path=/";};Meteor.Util.Cookie.get=function(name){name=name;var nameEQ=name+"=";var ca=document.cookie.split(';');for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' ')c=c.substring(1,c.length);if(c.indexOf(nameEQ)==0)return c.substring(nameEQ.length,c.length);} 53return null;};Meteor.Util.Cookie.erase=function(name){Meteor.Util.Cookie.create(name,"",-1);};} 54Meteor.Data.DataStorage=function(ID){this._ID=ID;this._db={};Meteor.Core.Lang.augmentObject(this,new Meteor.Core.EventTarget());Meteor.Core.Lang.augmentObject(this,new Meteor.Core.ThrowsException("Meteor.Data.DataStorage"),true);if(typeof(this._ID)==='undefined'){this.throwException('brak ID magazynu');}};Meteor.Data.DataStorage.prototype.set=function(key,value){this._db[key]=value;return this;};Meteor.Data.DataStorage.prototype.get=function(key){if(typeof(this._db[key])!=='undefined'){return this._db[key];}else{return null;}};Meteor.Data.DataStorage.prototype.isset=function(key){return typeof(this._db[key])!=='undefined';};Meteor.Data.DataStorage.prototype.erase=function(){this._db={};return this;};Meteor.Data.Config=function(ID){Meteor.Core.Lang.augmentObject(this,new Meteor.Data.DataStorage(ID));Meteor.Core.Lang.augmentObject(this,new Meteor.Core.ThrowsException("Meteor.Data.Config -> "+ID),true);};Meteor.App.AppController=function(ID){this._ID=ID;this._config=new Meteor.Data.Config(this.getID()+'_config');Meteor.Core.Lang.augmentObject(this,new Meteor.Util.Logger.LoggerEnabled("Meteor.App.AppController"));Meteor.Core.Lang.augmentObject(this,new Meteor.Core.EventTarget());Meteor.Core.Lang.augmentObject(this,new Meteor.Core.ThrowsException("Meteor.App.AppController"),true);if(typeof(this._ID)==='undefined'){this.throwException('brak ID aplikacji');}};Meteor.App.AppController.prototype.initialize=function(){this.log('initializing application: '+this.getID(),'info');if(typeof(this.doInitialize)==='undefined'){this.throwException("brak implementacji doInitialize() ");} 55this.doInitialize();};Meteor.App.AppController.prototype.getID=function(){return this._ID;};Meteor.App.AppController.prototype.getConfig=function(key){return typeof(key)==='undefined'?this._config:this._confgi.get('key');};Meteor.App.Core=(function(){var _moduleData=[];var o={registerModule:function(oModule){_moduleData[oModule.getID()]={instance:oModule};return this;},unregisterModule:function(moduleID){delete(_moduleData[moduleID]);return this;},startModule:function(moduleID){this.log("starting module: "+moduleID,'info');_moduleData[moduleID].instance.initialize(new Meteor.App.Sandbox(this));return this;},startModuleAll:function(){this.log("starting all modules",'info');for(var moduleID in _moduleData){if(typeof(_moduleData[moduleID].instance)==='object'&&_moduleData[moduleID].instance.constructor===Meteor.App.Module){this.startModule(moduleID);}} 56return this;},stopModule:function(moduleID){this.log("stoping module: "+moduleID,'info');_moduleData[moduleID].instance.stop();return this;},stopModuleAll:function(){this.log("stoping all modules",'info');for(var moduleID in _moduleData){if(typeof(_moduleData[moduleID].instance)==='object'&&_moduleData[moduleID].instance.constructor===Meteor.App.Module){this.stopModule(moduleID);}} 57return this;},addEventListeners:function(type,callback){for(var moduleID in _moduleData){if(typeof(_moduleData[moduleID].instance)==='object'&&_moduleData[moduleID].instance.constructor===Meteor.App.Module){_moduleData[moduleID].instance.addEventListener(type,callback);}} 58return this;},getModules:function(){return _moduleData;}};Meteor.Core.Lang.augmentObject(o,new Meteor.Util.Logger.LoggerEnabled("Meteor.App.Core"));Meteor.Core.Lang.augmentObject(o,new Meteor.Core.ThrowsException("Meteor.App.Core"),true);return o;})();Meteor.App.Module=function(moduleID){this._initialized=false;this._ID=moduleID;Meteor.Core.Lang.augmentObject(this,new Meteor.Util.Logger.LoggerEnabled("Module."+this.getID()));Meteor.Core.Lang.augmentObject(this,new Meteor.Core.EventTarget());Meteor.Core.Lang.augmentObject(this,new Meteor.Core.ThrowsException("Module."+this.getID()),true);};Meteor.App.Module.prototype.initialize=function(oSandbox){if(this._initialized){return this;} 59this._initialized=true;this.sandbox=oSandbox;if(typeof(this.doInitialize)!=='undefined'){this.doInitialize();} 60return this;};Meteor.App.Module.prototype.stop=function(){if(typeof(this.doStop)!=='undefined'){this.doStop();} 61return this;};Meteor.App.Module.prototype.getID=function(){return this._ID;};Meteor.App.Module.prototype.dispatchModuleEvent=function(type,cancelable,data){this.dispatchEvent(new Meteor.Core.Event(this.getID()+"_"+type,cancelable,data));return this;};Meteor.App.Sandbox=function(oCore){this._core=oCore;};Meteor.App.Sandbox.prototype.addEventListeners=function(type,callback){this._core.addEventListeners(type,callback);return this;};Meteor.App.AppConfig=function(){if(Meteor.App.AppConfig._instance!==null){return Meteor.App.AppConfig.getInstance();} 62Meteor.Core.Lang.augmentObject(this,new Meteor.Data.Config("Meteor.App.AppConfig"));};Meteor.App.AppConfig._instance=null;Meteor.App.AppConfig.getInstance=function(){if(Meteor.App.AppConfig._instance==null){Meteor.App.AppConfig._instance=new Meteor.App.AppConfig();} 63return Meteor.App.AppConfig._instance;};window.Meteor=window.Meteor||{};Meteor.Widget=Meteor.Widget||{};Meteor.Widget.MapSearch=Meteor.Widget.MapSearch||{};Meteor.Widget.MapSearch.V3=function(opt){if(typeof(google)==='undefined'){this.throwException("lack of: google");} 64if(typeof(google.maps)==='undefined'){this.throwException("lack of: google.maps");} 65if(typeof(google.maps.geometry)==='undefined'){this.throwException("lack of library: google.maps.geometry");} 66this._options={mapContainer:null,initialLng:18.8,initialLat:52.17393169256846,initialZoom:6,marker1IconUrl:'http://maps.google.com/mapfiles/ms/micons/red.png',marker2IconUrl:'http://maps.google.com/mapfiles/ms/micons/green.png',change:function(widget){}};if(typeof(opt)=='object'){for(var i in opt){this._options[i]=opt[i];}} 67if(!this._options.mapContainer){this.throwException("brak kontenera dla mapy");} 68this._map=null;this._circle=null;this._marker1=null;this._marker2=null;};Meteor.Widget.MapSearch.V3.prototype.render=function(){Meteor.Widget.MapSearch.V3.Label=function(opt_options){this.setValues(opt_options);
68var span=this.span_=document.createElement('span');span.style.cssText='position: relative; right: -20px; top: -30px; '+'white-space: nowrap; border: none; '+'padding: 2px; background-color: transparent; font-weight: bold;';var div=this.div_=document.createElement('div');div.appendChild(span);div.style.cssText='position: absolute; display: none';};Meteor.Widget.MapSearch.V3.Label.prototype=new google.maps.OverlayView;Meteor.Widget.MapSearch.V3.Label.prototype.onAdd=function(){var pane=this.getPanes().overlayLayer;pane.appendChild(this.div_);var me=this;this.listeners_=[google.maps.event.addListener(this,'position_changed',function(){me.draw();}),google.maps.event.addListener(this,'text_changed',function(){me.draw();})];};Meteor.Widget.MapSearch.V3.Label.prototype.onRemove=function(){this.div_.parentNode.removeChild(this.div_);for(var i=0,I=this.listeners_.length;i<I;++i){google.maps.event.removeListener(this.listeners_[i]);}};Meteor.Widget.MapSearch.V3.Label.prototype.draw=function(){var projection=this.getProjection();var position=projection.fromLatLngToDivPixel(this.get('position'));var div=this.div_;div.style.left=position.x+'px';div.style.top=position.y+'px';div.style.display='block';this.span_.innerHTML=this.get('text').toString();};var that=this;var latlng=new google.maps.LatLng(this._options.initialLat,this._options.initialLng);var myOptions={zoom:this._options.initialZoom,center:latlng,mapTypeId:google.maps.MapTypeId.ROADMAP} 69this._map=new google.maps.Map(this._options.mapContainer,myOptions);this._marker1=new google.maps.Marker({map:this._map,position:latlng,draggable:true,title:'',icon:new google.maps.MarkerImage(this._options.marker1IconUrl,null,null,new google.maps.Point(15,32))});var autoOffset=9/Math.pow(1.7,this._map.getZoom());var latlng2=new google.maps.LatLng(latlng.lat()+autoOffset,latlng.lng()+autoOffset);this._marker2=new google.maps.Marker({map:this._map,position:latlng2,draggable:true,title:'',icon:new google.maps.MarkerImage(this._options.marker2IconUrl,null,null,new google.maps.Point(15,32))});var distance=google.maps.geometry.spherical.computeDistanceBetween(latlng,latlng2);that._drawCircle(latlng,distance);google.maps.event.addListener(this._marker1,'drag',function(){that._drawCircle(that._marker1.getPosition(),that.getRadius());});google.maps.event.addListener(this._marker2,'drag',function(){that._drawCircle(that._marker1.getPosition(),that.getRadius());});google.maps.event.addListener(this._map,'click',function(e){that.setCenter(e.latLng.lat(),e.latLng.lng());});var label=new Meteor.Widget.MapSearch.V3.Label({map:this._map});label.bindTo('position',this._marker2,'position');label.bindTo('text',this._marker1,'title');return this;};Meteor.Widget.MapSearch.V3.prototype.setCenter=function(lat,lng){var latLng=new google.maps.LatLng(lat,lng);this._marker1.setPosition(latLng);var autoOffset=9/Math.pow(1.7,this._map.getZoom());this._marker2.setPosition(new google.maps.LatLng(latLng.lat()+autoOffset,latLng.lng()+autoOffset));this._drawCircle(this._marker1.getPosition(),this.getRadius());};Meteor.Widget.MapSearch.V3.prototype.getRadius=function(){return google.maps.geometry.spherical.computeDistanceBetween(this._marker1.getPosition(),this._marker2.getPosition());};Meteor.Widget.MapSearch.V3.prototype.getLng=function(){return this._marker1.getPosition().lng();};Meteor.Widget.MapSearch.V3.prototype.getLat=function(){return this._marker1.getPosition().lat();};Meteor.Widget.MapSearch.V3.prototype._drawCircle=function(latlng,radius){this._options.change(this);this._marker1.setTitle((Math.ceil(radius/100)/10).toString()+' KM');var that=this;if(null===that._circle){var circleOptions={strokeColor:"#823f",strokeOpacity:0.5,strokeWeight:2,fillColor:"#2387",fillOpacity:0.1,map:this._map,center:latlng,radius:radius};that._circle=new google.maps.Circle(circleOptions);}else{that._circle.setRadius(radius);that._circle.setCenter(latlng);}};Meteor.Widget.MapSearch.V3.prototype.throwException=function(msg){throw"Meteor.Widget.MapSearch.V3: "+msg;};!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if
vendor: 4,262 bytes, line 69
69(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.2",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},m.extend=m.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||m.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(m.isPlainObject(c)||(b=m.isArray(c)))?(b?(b=!1,f=a&&m.isArray(a)?a:[]):f=a&&m.isPlainObject(a)?a:{},g[d]=m.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},m.extend({expando:"jQuery"+(l+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===m.type(a)},isArray:Array.isArray||function(a){return"array"===m.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!m.isArray(a)&&a-parseFloat(a)+1>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==m.type(a)||a.nodeType||m.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(k.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&m.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(o,"ms-").replace(p,q)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=r(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(n,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(r(Object(a))?m.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=r(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),m.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||m.guid++,e):void 0},now:function(){return+new Date},support:k}),m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function r(a){var b=a.length,c=m.type(a);return"function"===c||m.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var s
vendor: 3,141 bytes, line 69
69=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=hb(),z=hb(),A=hb(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N=M.replace("w","w#"),O="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+L+"*\\]",P=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",Q=new RegExp(L+"+","g"),R=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),S=new RegExp("^"+L+"*,"+L+"*"),T=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),U=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),V=new RegExp(P),W=new RegExp("^"+N+"$"),X={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+P),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},eb=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(fb){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function gb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],k=b.nodeType,"string"!=typeof a||!a||1!==k&&9!==k&&11!==k)return d;if(!e&&p){if(11!==k&&(f=_.exec(a)))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return H.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName)return H.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=1!==k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+rb(o[l]);w=ab.test(a)&&pb(b.parentNode)||b,x=o.join(",")}if(x)try{return H.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function hb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ib(a){return a[u]=!0,a}
vendor: 9,785 bytes, line 69
69function jb(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function kb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function lb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function nb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function ob(a){return ib(function(b){return b=+b,ib(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function pb(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=gb.support={},f=gb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=gb.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=g.documentElement,e=g.defaultView,e&&e!==e.top&&(e.addEventListener?e.addEventListener("unload",eb,!1):e.attachEvent&&e.attachEvent("onunload",eb)),p=!f(g),c.attributes=jb(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=jb(function(a){return a.appendChild(g.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(g.getElementsByClassName),c.getById=jb(function(a){return o.appendChild(a).id=u,!g.getElementsByName||!g.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(g.querySelectorAll))&&(jb(function(a){o.appendChild(a).innerHTML="<a id='"+u+"'></a><select id='"+u+"-\f]' msallowcapture=''><option selected=''></option></select>",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),jb(function(a){var b=g.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&jb(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",P)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===g||a.ownerDocument===v&&t(v,a)?-1:b===g||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,h=[a],i=[b];if(!e||!f)return a===g?-1:b===g?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return lb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?lb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},g):n},gb.matches=function(a,b){return gb(a,null,null,b)},gb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return gb(b,n,null,[a]).length>0},gb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},gb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},gb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},gb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=gb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=gb.selectors={cacheLength:50,createPseudo:ib,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||gb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&gb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=gb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(Q," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||gb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ib(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ib(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?ib(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ib(function(a){return function(b){return gb(a,b).length>0}}),contains:ib(function(a){return a=a.replace(cb,db),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ib(function(a){return W.test(a||"")||gb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)}
vendor: 7,673 bytes, line 69
69,input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:ob(function(){return[0]}),last:ob(function(a,b){return[b-1]}),eq:ob(function(a,b,c){return[0>c?c+b:c]}),even:ob(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:ob(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:ob(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:ob(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=mb(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=nb(b);function qb(){}qb.prototype=d.filters=d.pseudos,d.setFilters=new qb,g=gb.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=S.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=T.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(R," ")}),h=h.slice(c.length));for(g in d.filter)!(e=X[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?gb.error(a):z(a,i).slice(0)};function rb(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function sb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function tb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ub(a,b,c){for(var d=0,e=b.length;e>d;d++)gb(a,b[d],c);return c}function vb(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function wb(a,b,c,d,e,f){return d&&!d[u]&&(d=wb(d)),e&&!e[u]&&(e=wb(e,f)),ib(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ub(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:vb(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=vb(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=vb(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function xb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=sb(function(a){return a===b},h,!0),l=sb(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[sb(tb(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return wb(i>1&&tb(m),i>1&&rb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&xb(a.slice(i,e)),f>e&&xb(a=a.slice(e)),f>e&&rb(a))}m.push(c)}return tb(m)}function yb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=F.call(i));s=vb(s)}H.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&gb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?ib(f):f}return h=gb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=xb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,yb(e,d)),f.selector=a}return f},i=gb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&pb(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&rb(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&pb(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=jb(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),jb(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||kb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&jb(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||kb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),jb(function(a){return null==a.getAttribute("disabled")})||kb(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),gb}(a);m.find=s,m.expr=s.selectors,m.expr[":"]=m.expr.pseudos,m.unique=s.uniqueSort,m.text=s.getText,m.isXMLDoc=s.isXML,m.contains=s.contains;var t=m.expr.match.needsContext,u=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,v=/^.[^:#\[\.,]*$/;function w(a,b,c){if(m.isFunction(b))return m.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return m.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(v.test(b))return m.filter(b,a,c);b=m.filter(b,a)}return m.grep(a,function(a){return m.inArray(a,b)>=0!==c})}m.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?m.find.matchesSelector(d,a)?[d]:[]:m.find.matches(a,m.grep(b,function(a){return 1===a.nodeType}))},m.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(m(a).filter(function(){for(b=0;e>b;b++)if(m.contains(d[b],this))return!0}));for(b=0;e>b;b++)m.find(a,d[b],c);return c=this.pushStack(e>1?m.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(w(this,a||[],!1))},not:function(a){return this.pushStack(w(this,a||[],!0))},is:function(a){return!!w(this,"string"==typeof a&&t.test(a)?m(a):a||[],!1).length}});var x,y=a.document,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=m.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||x).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof m?b[0]:b,m.merge(this,m.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:y,!0)),u.test(c[1])&&m.isPlainObject(b))for(c in b)m.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=y.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return x.find(a);this.length=1,this[0]=d}return this.context=y,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):m.isFunction(a)?"undefined"!=typeof x.ready?x.ready(a):a(m):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),m.makeArray(a,this))};A.prototype=m.fn,x=m(y);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};m.extend({dir:function(a,b,c){var d=[],e=a[b];
vendor: 27,695 bytes, line 69
69while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!m(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),m.fn.extend({has:function(a){var b,c=m(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(m.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=t.test(a)||"string"!=typeof a?m(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&m.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?m.unique(f):f)},index:function(a){return a?"string"==typeof a?m.inArray(this[0],m(a)):m.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(m.unique(m.merge(this.get(),m(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}m.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return m.dir(a,"parentNode")},parentsUntil:function(a,b,c){return m.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return m.dir(a,"nextSibling")},prevAll:function(a){return m.dir(a,"previousSibling")},nextUntil:function(a,b,c){return m.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return m.dir(a,"previousSibling",c)},siblings:function(a){return m.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return m.sibling(a.firstChild)},contents:function(a){return m.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:m.merge([],a.childNodes)}},function(a,b){m.fn[a]=function(c,d){var e=m.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=m.filter(d,e)),this.length>1&&(C[a]||(e=m.unique(e)),B.test(a)&&(e=e.reverse())),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return m.each(a.match(E)||[],function(a,c){b[c]=!0}),b}m.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):m.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){m.each(b,function(b,c){var d=m.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&m.each(arguments,function(a,c){var d;while((d=m.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?m.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},m.extend({Deferred:function(a){var b=[["resolve","done",m.Callbacks("once memory"),"resolved"],["reject","fail",m.Callbacks("once memory"),"rejected"],["notify","progress",m.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return m.Deferred(function(c){m.each(b,function(b,f){var g=m.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&m.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?m.extend(a,d):d}},e={};return d.pipe=d.then,m.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&m.isFunction(a.promise)?e:0,g=1===f?a:m.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&m.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;m.fn.ready=function(a){return m.ready.promise().done(a),this},m.extend({isReady:!1,readyWait:1,holdReady:function(a){a?m.readyWait++:m.ready(!0)},ready:function(a){if(a===!0?!--m.readyWait:!m.isReady){if(!y.body)return setTimeout(m.ready);m.isReady=!0,a!==!0&&--m.readyWait>0||(H.resolveWith(y,[m]),m.fn.triggerHandler&&(m(y).triggerHandler("ready"),m(y).off("ready")))}}});function I(){y.addEventListener?(y.removeEventListener("DOMContentLoaded",J,!1),a.removeEventListener("load",J,!1)):(y.detachEvent("onreadystatechange",J),a.detachEvent("onload",J))}function J(){(y.addEventListener||"load"===event.type||"complete"===y.readyState)&&(I(),m.ready())}m.ready.promise=function(b){if(!H)if(H=m.Deferred(),"complete"===y.readyState)setTimeout(m.ready);else if(y.addEventListener)y.addEventListener("DOMContentLoaded",J,!1),a.addEventListener("load",J,!1);else{y.attachEvent("onreadystatechange",J),a.attachEvent("onload",J);var c=!1;try{c=null==a.frameElement&&y.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!m.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}I(),m.ready()}}()}return H.promise(b)};var K="undefined",L;for(L in m(k))break;k.ownLast="0"!==L,k.inlineBlockNeedsLayout=!1,m(function(){var a,b,c,d;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",k.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(d))}),function(){var a=y.createElement("div");if(null==k.deleteExpando){k.deleteExpando=!0;try{delete a.test}catch(b){k.deleteExpando=!1}}a=null}(),m.acceptData=function(a){var b=m.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var M=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,N=/([A-Z])/g;function O(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(N,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:M.test(c)?m.parseJSON(c):c}catch(e){}m.data(a,b,c)}else c=void 0}return c}function P(a){var b;for(b in a)if(("data"!==b||!m.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}function R(a,b,c){if(m.acceptData(a)){var d,e,f=a.nodeType,g=f?m.cache:a,h=f?a[m.expando]:m.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){m.isArray(b)?b=b.concat(m.map(b,m.camelCase)):b in d?b=[b]:(b=m.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!P(d):!m.isEmptyObject(d))return}(c||(delete g[h].data,P(g[h])))&&(f?m.cleanData([a],!0):k.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}m.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?m.cache[a[m.expando]]:a[m.expando],!!a&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),m.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=m.data(f),1===f.nodeType&&!m._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=m.camelCase(d.slice(5)),O(f,d,e[d])));m._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){m.data(this,a)}):arguments.length>1?this.each(function(){m.data(this,a,b)}):f?O(f,a,m.data(f,a)):void 0},removeData:function(a){return this.each(function(){m.removeData(this,a)})}}),m.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=m._data(a,b),c&&(!d||m.isArray(c)?d=m._data(a,b,m.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=m.queue(a,b),d=c.length,e=c.shift(),f=m._queueHooks(a,b),g=function(){m.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return m._data(a,c)||m._data(a,c,{empty:m.Callbacks("once memory").add(function(){m._removeData(a,b+"queue"),m._removeData(a,c)})})}}),m.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?m.queue(this[0],a):void 0===b?this:this.each(function(){var c=m.queue(this,a,b);m._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&m.dequeue(this,a)})},dequeue:function(a){return this.each(function(){m.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=m.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=m._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var S=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=["Top","Right","Bottom","Left"],U=function(a,b){return a=b||a,"none"===m.css(a,"display")||!m.contains(a.ownerDocument,a)},V=m.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===m.type(c)){e=!0;for(h in c)m.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,m.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(m(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},W=/^(?:checkbox|radio)$/i;!function(){var a=y.createElement("input"),b=y.createElement("div"),c=y.createDocumentFragment();if(b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",k.leadingWhitespace=3===b.firstChild.nodeType,k.tbody=!b.getElementsByTagName("tbody").length,k.htmlSerialize=!!b.getElementsByTagName("link").length,k.html5Clone="<:nav></:nav>"!==y.createElement("nav").cloneNode(!0).outerHTML,a.type="checkbox",a.checked=!0,c.appendChild(a),k.appendChecked=a.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,c.appendChild(b),b.innerHTML="<input type='radio' checked='checked' name='t'/>",k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,k.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){k.noCloneEvent=!1}),b.cloneNode(!0).click()),null==k.deleteExpando){k.deleteExpando=!0;try{delete b.test}catch(d){k.deleteExpando=!1}}}(),function(){var b,c,d=y.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(k[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),k[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var X=/^(?:input|select|textarea)$/i,Y=/^key/,Z=/^(?:mouse|pointer|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=/^([^.]*)(?:\.(.+)|)$/;function ab(){return!0}function bb(){return!1}function cb(){try{return y.activeElement}catch(a){}}m.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=m.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof m===K||a&&m.event.triggered===a.type?void 0:m.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(E)||[""],h=b.length;while(h--)f=_.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=m.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=m.event.special[o]||{},l=m.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&m.expr.match.needsContext.test(e),namespace:p.join(".")},i),(n=g[o])||(n=g[o]=[],n.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?n.splice(n.delegateCount++,0,l):n.push(l),m.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m.hasData(a)&&m._data(a);if(r&&(k=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=_.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=m.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,n=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=n.length;while(f--)g=n[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(n.splice(f,1),g.selector&&n.delegateCount--,l.remove&&l.remove.call(a,g));i&&!n.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||m.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)m.event.remove(a,o+b[j],c,d,!0);m.isEmptyObject(k)&&(delete r.handle,m._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,n,o=[d||y],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||y,3!==d.nodeType&&8!==d.nodeType&&!$.test(p+m.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[m.expando]?b:new m.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:m.makeArray(c,[b]),k=m.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!m.isWindow(d)){for(i=k.delegateType||p,$.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||y)&&o.push(l.defaultView||l.parentWindow||a)}n=0;while((h=o[n++])&&!b.isPropagationStopped())b.type=n>1?i:k.bindType||p,f=(m._data(h,"events")||{})[b.type]&&m._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&m.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&m.acceptData(d)&&g&&d[p]&&!m.isWindow(d)){l=d[g],l&&(d[g]=null),m.event.triggered=p;try{d[p]()}catch(r){}m.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=m.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(m._data(this,"events")||{})[a.type]||[],k=m.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=m.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((m.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?m(c,this).index(i)>=0:m.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[m.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=Z.test(e)?this.mouseHooks:Y.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new m.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=f.srcElement||y),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,g.filter?g.filter(a,f):a},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button,g=b.fromElement;return null==a.pageX&&null!=b.clientX&&(d=a.target.ownerDocument||y,e=d.documentElement,c=d.body,a.pageX=b.clientX+(e&&e.scrollLeft||c&&c.scrollLeft||0)-(e&&e.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||c&&c.scrollTop||0)-(e&&e.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&g&&(a.relatedTarget=g===a.target?b.toElement:g),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==cb()&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:"focusin"},blur:{trigger:function(){return this===cb()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return m.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return m.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=m.extend(new m.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?m.event.trigger(e,null,b):m.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},m.removeEvent=y.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]===K&&(a[d]=null),a.detachEvent(d,c))},m.Event=function(a,b){return this instanceof m.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?ab:bb):this.type=a,b&&m.extend(this,b),this.timeStamp=a&&a.timeStamp||m.now(),void(this[m.expando]=!0)):new m.Event(a,b)},m.Event.prototype={isDefaultPrevented:bb,isPropagationStopped:bb,isImmediatePropagationStopped:bb,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=ab,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=ab,a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=ab,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},m.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){m.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!m.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),k.submitBubbles||(m.event.special.submit={setup:function(){return m.nodeName(this,"form")?!1:void m.event.add(this,"click._submit keypress._submit",function(a){var b=a.target,c=m.nodeName(b,"input")||m.nodeName(b,"button")?b.form:void 0;c&&!m._data(c,"submitBubbles")&&(m.event.add(c,"submit._submit",function(a){a._submit_bubble=!0}),m._data(c,"submitBubbles",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&m.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){return m.nodeName(this,"form")?!1:void m.event.remove(this,"._submit")}}),k.changeBubbles||(m.event.special.change={setup:function(){return X.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(m.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._just_changed=!0)}),m.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),m.event.simulate("change",this,a,!0)})),!1):void m.event.add(this,"beforeactivate._change",function(a){var b=a.target;X.test(b.nodeName)&&!m._data(b,"changeBubbles")&&(m.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||m.event.simulate("change",this.parentNode,a,!0)}),m._data(b,"changeBubbles",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return m.event.remove(this,"._change"),!X.test(this.nodeName)}}),k.focusinBubbles||m.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){m.event.simulate(b,a.target,m.event.fix(a),!0)};m.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=m._data(d,b);e||d.addEventListener(a,c,!0),m._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=m._data(d,b)-1;e?m._data(d,b,e):(d.removeEventListener(a,c,!0),m._removeData(d,b))}}}),m.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(f in a)this.on(f,b,c,a[f],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=bb;else if(!d)return this;return 1===e&&(g=d,d=function(a){return m().off(a),g.apply(this,arguments)},d.guid=g.guid||(g.guid=m.guid++)),this.each(function(){m.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,m(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=bb),this.each(function(){m.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){m.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?m.event.trigger(a,b,c,!0):void 0}});function db(a){var b=eb.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}var eb="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",fb=/ jQuery\d+="(?:null|\d+)"/g,gb=new RegExp("<(?:"+eb+")[\\s/>]","i"),hb=/^\s+/,ib=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,jb=/<([\w:]+)/,kb=/<tbody/i,lb=/<|&#?\w+;/,mb=/<(?:script|style|link)/i,nb=/checked\s*(?:[^=]|=\s*.checked.)/i,ob=/^$|\/(?:java|ecma)script/i,pb=/^true\/(.*)/,qb=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,rb={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:k.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},sb=db(y),tb=sb.appendChild(y.createElement("div"));rb.optgroup=rb.option,rb.tbody=rb.tfoot=rb.colgroup=rb.caption=rb.thead,rb.th=rb.td;function ub(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==K?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==K?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||m.nodeName(d,b)?f.push(d):m.merge(f,ub(d,b));return void 0===b||b&&m.nodeName(a,b)?m.merge([a],f):f}function vb(a){W.test(a.type)&&(a.defaultChecked=a.checked)}function wb(a,b){return m.nodeName(a,"table")&&m.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function xb(a){return a.type=(null!==m.find.attr(a,"type"))+"/"+a.type,a}function yb(a){var b=pb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function zb(a,b){for(var c,d=0;null!=(c=a[d]);d++)m._data(c,"globalEval",!b||m._data(b[d],"globalEval"))}function Ab(a,b){if(1===b.nodeType&&m.hasData(a)){var c,d,e,f=m._data(a),g=m._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)m.event.add(b,c,h[c][d])}g.data&&(g.data=m.extend({},g.data))}}function Bb(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!k.noCloneEvent&&b[m.expando]){e=m._data(b);for(d in e.events)m.removeEvent(b,d,e.handle);b.removeAttribute(m.expando)}"script"===c&&b.text!==a.text?(xb(b).text=a.text,yb(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),k.html5Clone&&a.innerHTML&&!m.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&W.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}m.extend({clone:function(a,b,c){var d,e,f,g,h,i=m.contains(a.ownerDocument,a);if(k.html5Clone||m.isXMLDoc(a)||!gb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(tb.innerHTML=a.outerHTML,tb.removeChild(f=tb.firstChild)),!(k.noCloneEvent&&k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||m.isXMLDoc(a)))for(d=ub(f),h=ub(a),g=0;null!=(e=h[g]);++g)d[g]&&Bb(e,d[g]);if(b)if(c)for(h=h||ub(a),d=d||ub(f),g=0;null!=(e=h[g]);g++)Ab(e,d[g]);else Ab(a,f);return d=ub(f,"script"),d.length>0&&zb(d,!i&&ub(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,l,n=a.length,o=db(b),p=[],q=0;n>q;q++)if(f=a[q],f||0===f)if("object"===m.type(f))m.merge(p,f.nodeType?[f]:f);else if(lb.test(f)){h=h||o.appendChild(b.createElement("div")),i=(jb.exec(f)||["",""])[1].toLowerCase(),l=rb[i]||rb._default,h.innerHTML=l[1]+f.replace(ib,"<$1></$2>")+l[2],e=l[0];while(e--)h=h.lastChild;if(!k.leadingWhitespace&&hb.test(f)&&p.push(b.createTextNode(hb.exec(f)[0])),!k.tbody){f="table"!==i||kb.test(f)?"<table>"!==l[1]||kb.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)m.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}m.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),k.appendChecked||m.grep(ub(p,"input"),vb),q=0;while(f=p[q++])if((!d||-1===m.inArray(f,d))&&(g=m.contains(f.ownerDocument,f),h=ub(o.appendChild(f),"script"),g&&zb(h),c)){e=0;while(f=h[e++])ob.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=m.expando,j=m.cache,l=k.deleteExpando,n=m.event.special;null!=(d=a[h]);h++)if((b||m.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)n[e]?m.event.remove(d,e):m.removeEvent(d,e,g.handle);j[f]&&(delete j[f],l?delete d[i]:typeof d.removeAttribute!==K?d.removeAttribute(i):d[i]=null,c.push(f))}}}),m.fn.extend({text:function(a){return V(this,function(a){return void 0===a?m.text(this):this.empty().append((this[0]&&this[0].ownerDocument||y).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if
vendor: 11,395 bytes, line 69
69(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?m.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||m.cleanData(ub(c)),c.parentNode&&(b&&m.contains(c.ownerDocument,c)&&zb(ub(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&m.cleanData(ub(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&m.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return m.clone(this,a,b)})},html:function(a){return V(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(fb,""):void 0;if(!("string"!=typeof a||mb.test(a)||!k.htmlSerialize&&gb.test(a)||!k.leadingWhitespace&&hb.test(a)||rb[(jb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(ib,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(m.cleanData(ub(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,m.cleanData(ub(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,n=this,o=l-1,p=a[0],q=m.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&nb.test(p))return this.each(function(c){var d=n.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(i=m.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=m.map(ub(i,"script"),xb),f=g.length;l>j;j++)d=i,j!==o&&(d=m.clone(d,!0,!0),f&&m.merge(g,ub(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,m.map(g,yb),j=0;f>j;j++)d=g[j],ob.test(d.type||"")&&!m._data(d,"globalEval")&&m.contains(h,d)&&(d.src?m._evalUrl&&m._evalUrl(d.src):m.globalEval((d.text||d.textContent||d.innerHTML||"").replace(qb,"")));i=c=null}return this}}),m.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){m.fn[a]=function(a){for(var c,d=0,e=[],g=m(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),m(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Cb,Db={};function Eb(b,c){var d,e=m(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:m.css(e[0],"display");return e.detach(),f}function Fb(a){var b=y,c=Db[a];return c||(c=Eb(a,b),"none"!==c&&c||(Cb=(Cb||m("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=(Cb[0].contentWindow||Cb[0].contentDocument).document,b.write(),b.close(),c=Eb(a,b),Cb.detach()),Db[a]=c),c}!function(){var a;k.shrinkWrapBlocks=function(){if(null!=a)return a;a=!1;var b,c,d;return c=y.getElementsByTagName("body")[0],c&&c.style?(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",b.appendChild(y.createElement("div")).style.width="5px",a=3!==b.offsetWidth),c.removeChild(d),a):void 0}}();var Gb=/^margin/,Hb=new RegExp("^("+S+")(?!px)[a-z%]+$","i"),Ib,Jb,Kb=/^(top|right|bottom|left)$/;a.getComputedStyle?(Ib=function(b){return b.ownerDocument.defaultView.opener?b.ownerDocument.defaultView.getComputedStyle(b,null):a.getComputedStyle(b,null)},Jb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ib(a),g=c?c.getPropertyValue(b)||c[b]:void 0,c&&(""!==g||m.contains(a.ownerDocument,a)||(g=m.style(a,b)),Hb.test(g)&&Gb.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0===g?g:g+""}):y.documentElement.currentStyle&&(Ib=function(a){return a.currentStyle},Jb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ib(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Hb.test(g)&&!Kb.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function Lb(a,b){return{get:function(){var c=a();if(null!=c)return c?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d,e,f,g,h;if(b=y.createElement("div"),b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=d&&d.style){c.cssText="float:left;opacity:.5",k.opacity="0.5"===c.opacity,k.cssFloat=!!c.cssFloat,b.style.backgroundClip="content-box",b.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===b.style.backgroundClip,k.boxSizing=""===c.boxSizing||""===c.MozBoxSizing||""===c.WebkitBoxSizing,m.extend(k,{reliableHiddenOffsets:function(){return null==g&&i(),g},boxSizingReliable:function(){return null==f&&i(),f},pixelPosition:function(){return null==e&&i(),e},reliableMarginRight:function(){return null==h&&i(),h}});function i(){var b,c,d,i;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),b.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",e=f=!1,h=!0,a.getComputedStyle&&(e="1%"!==(a.getComputedStyle(b,null)||{}).top,f="4px"===(a.getComputedStyle(b,null)||{width:"4px"}).width,i=b.appendChild(y.createElement("div")),i.style.cssText=b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",i.style.marginRight=i.style.width="0",b.style.width="1px",h=!parseFloat((a.getComputedStyle(i,null)||{}).marginRight),b.removeChild(i)),b.innerHTML="<table><tr><td></td><td>t</td></tr></table>",i=b.getElementsByTagName("td"),i[0].style.cssText="margin:0;border:0;padding:0;display:none",g=0===i[0].offsetHeight,g&&(i[0].style.display="",i[1].style.display="none",g=0===i[0].offsetHeight),c.removeChild(d))}}}(),m.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var Mb=/alpha\([^)]*\)/i,Nb=/opacity\s*=\s*([^)]*)/,Ob=/^(none|table(?!-c[ea]).+)/,Pb=new RegExp("^("+S+")(.*)$","i"),Qb=new RegExp("^([+-])=("+S+")","i"),Rb={position:"absolute",visibility:"hidden",display:"block"},Sb={letterSpacing:"0",fontWeight:"400"},Tb=["Webkit","O","Moz","ms"];function Ub(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=Tb.length;while(e--)if(b=Tb[e]+c,b in a)return b;return d}function Vb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=m._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&U(d)&&(f[g]=m._data(d,"olddisplay",Fb(d.nodeName)))):(e=U(d),(c&&"none"!==c||!e)&&m._data(d,"olddisplay",e?c:m.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function Wb(a,b,c){var d=Pb.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Xb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=m.css(a,c+T[f],!0,e)),d?("content"===c&&(g-=m.css(a,"padding"+T[f],!0,e)),"margin"!==c&&(g-=m.css(a,"border"+T[f]+"Width",!0,e))):(g+=m.css(a,"padding"+T[f],!0,e),"padding"!==c&&(g+=m.css(a,"border"+T[f]+"Width",!0,e)));return g}function Yb(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Ib(a),g=k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Jb(a,b,f),(0>e||null==e)&&(e=a.style[b]),Hb.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Xb(a,b,c||(g?"border":"content"),d,f)+"px"}m.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Jb(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":k.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=m.camelCase(b),i=a.style;if(b=m.cssProps[h]||(m.cssProps[h]=Ub(i,h)),g=m.cssHooks[b]||m.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=Qb.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(m.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||m.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=m.camelCase(b);return b=m.cssProps[h]||(m.cssProps[h]=Ub(a.style,h)),g=m.cssHooks[b]||m.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Jb(a,b,d)),"normal"===f&&b in Sb&&(f=Sb[b]),""===c||c?(e=parseFloat(f),c===!0||m.isNumeric(e)?e||0:f):f}}),m.each(["height","width"],function(a,b){m.cssHooks[b]={get:function(a,c,d){return c?Ob.test(m.css(a,"display"))&&0===a.offsetWidth?m.swap(a,Rb,function(){return Yb(a,b,d)}):Yb(a,b,d):void 0},set:function(a,c,d){var e=d&&Ib(a);return Wb(a,c,d?Xb(a,b,d,k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,e),e):0)}}}),k.opacity||(m.cssHooks.opacity={get:function(a,b){return Nb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=m.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===m.trim(f.replace(Mb,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Mb.test(f)?f.replace(Mb,e):f+" "+e)}}),m.cssHooks.marginRight=Lb(k.reliableMarginRight,function(a,b){return b?m.swap(a,{display:"inline-block"},Jb,[a,"marginRight"]):void 0}),m.each({margin:"",padding:"",border:"Width"},function(a,b){m.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+T[d]+b]=f[d]||f[d-2]||f[0];return e}},Gb.test(a)||(m.cssHooks[a+b].set=Wb)}),m.fn.extend({css:function(a,b){return V(this,function(a,b,c){var d,e,f={},g=0;if(m.isArray(b)){for(d=Ib(a),e=b.length;e>g;g++)f[b[g]]=m.css(a,b[g],!1,d);return f}return void 0!==c?m.style(a,b,c):m.css(a,b)},a,b,arguments.length>1)},show:function(){return Vb(this,!0)},hide:function(){return Vb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){U(this)?m(this).show():m(this).hide()})}});function Zb(a,b,c,d,e){return new Zb.prototype.init(a,b,c,d,e)
69}m.Tween=Zb,Zb.prototype={constructor:Zb,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(m.cssNumber[c]?"":"px")
vendor: 18,765 bytes, line 69
69},cur:function(){var a=Zb.propHooks[this.prop];return a&&a.get?a.get(this):Zb.propHooks._default.get(this)},run:function(a){var b,c=Zb.propHooks[this.prop];return this.pos=b=this.options.duration?m.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Zb.propHooks._default.set(this),this}},Zb.prototype.init.prototype=Zb.prototype,Zb.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=m.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){m.fx.step[a.prop]?m.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[m.cssProps[a.prop]]||m.cssHooks[a.prop])?m.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Zb.propHooks.scrollTop=Zb.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},m.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},m.fx=Zb.prototype.init,m.fx.step={};var $b,_b,ac=/^(?:toggle|show|hide)$/,bc=new RegExp("^(?:([+-])=|)("+S+")([a-z%]*)$","i"),cc=/queueHooks$/,dc=[ic],ec={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=bc.exec(b),f=e&&e[3]||(m.cssNumber[a]?"":"px"),g=(m.cssNumber[a]||"px"!==f&&+d)&&bc.exec(m.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,m.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function fc(){return setTimeout(function(){$b=void 0}),$b=m.now()}function gc(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=T[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function hc(a,b,c){for(var d,e=(ec[b]||[]).concat(ec["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function ic(a,b,c){var d,e,f,g,h,i,j,l,n=this,o={},p=a.style,q=a.nodeType&&U(a),r=m._data(a,"fxshow");c.queue||(h=m._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,n.always(function(){n.always(function(){h.unqueued--,m.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=m.css(a,"display"),l="none"===j?m._data(a,"olddisplay")||Fb(a.nodeName):j,"inline"===l&&"none"===m.css(a,"float")&&(k.inlineBlockNeedsLayout&&"inline"!==Fb(a.nodeName)?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",k.shrinkWrapBlocks()||n.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],ac.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||m.style(a,d)}else j=void 0;if(m.isEmptyObject(o))"inline"===("none"===j?Fb(a.nodeName):j)&&(p.display=j);else{r?"hidden"in r&&(q=r.hidden):r=m._data(a,"fxshow",{}),f&&(r.hidden=!q),q?m(a).show():n.done(function(){m(a).hide()}),n.done(function(){var b;m._removeData(a,"fxshow");for(b in o)m.style(a,b,o[b])});for(d in o)g=hc(q?r[d]:0,d,n),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function jc(a,b){var c,d,e,f,g;for(c in a)if(d=m.camelCase(c),e=b[d],f=a[c],m.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=m.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function kc(a,b,c){var d,e,f=0,g=dc.length,h=m.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=$b||fc(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:m.extend({},b),opts:m.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:$b||fc(),duration:c.duration,tweens:[],createTween:function(b,c){var d=m.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(jc(k,j.opts.specialEasing);g>f;f++)if(d=dc[f].call(j,a,k,j.opts))return d;return m.map(k,hc,j),m.isFunction(j.opts.start)&&j.opts.start.call(a,j),m.fx.timer(m.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}m.Animation=m.extend(kc,{tweener:function(a,b){m.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],ec[c]=ec[c]||[],ec[c].unshift(b)},prefilter:function(a,b){b?dc.unshift(a):dc.push(a)}}),m.speed=function(a,b,c){var d=a&&"object"==typeof a?m.extend({},a):{complete:c||!c&&b||m.isFunction(a)&&a,duration:a,easing:c&&b||b&&!m.isFunction(b)&&b};return d.duration=m.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in m.fx.speeds?m.fx.speeds[d.duration]:m.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){m.isFunction(d.old)&&d.old.call(this),d.queue&&m.dequeue(this,d.queue)},d},m.fn.extend({fadeTo:function(a,b,c,d){return this.filter(U).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=m.isEmptyObject(a),f=m.speed(b,c,d),g=function(){var b=kc(this,m.extend({},a),f);(e||m._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=m.timers,g=m._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&cc.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&m.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=m._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=m.timers,g=d?d.length:0;for(c.finish=!0,m.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),m.each(["toggle","show","hide"],function(a,b){var c=m.fn[b];m.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(gc(b,!0),a,d,e)}}),m.each({slideDown:gc("show"),slideUp:gc("hide"),slideToggle:gc("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){m.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),m.timers=[],m.fx.tick=function(){var a,b=m.timers,c=0;for($b=m.now();c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||m.fx.stop(),$b=void 0},m.fx.timer=function(a){m.timers.push(a),a()?m.fx.start():m.timers.pop()},m.fx.interval=13,m.fx.start=function(){_b||(_b=setInterval(m.fx.tick,m.fx.interval))},m.fx.stop=function(){clearInterval(_b),_b=null},m.fx.speeds={slow:600,fast:200,_default:400},m.fn.delay=function(a,b){return a=m.fx?m.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a,b,c,d,e;b=y.createElement("div"),b.setAttribute("className","t"),b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=y.createElement("select"),e=c.appendChild(y.createElement("option")),a=b.getElementsByTagName("input")[0],d.style.cssText="top:1px",k.getSetAttribute="t"!==b.className,k.style=/top/.test(d.getAttribute("style")),k.hrefNormalized="/a"===d.getAttribute("href"),k.checkOn=!!a.value,k.optSelected=e.selected,k.enctype=!!y.createElement("form").enctype,c.disabled=!0,k.optDisabled=!e.disabled,a=y.createElement("input"),a.setAttribute("value",""),k.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),k.radioValue="t"===a.value}();var lc=/\r/g;m.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=m.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,m(this).val()):a,null==e?e="":"number"==typeof e?e+="":m.isArray(e)&&(e=m.map(e,function(a){return null==a?"":a+""})),b=m.valHooks[this.type]||m.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=m.valHooks[e.type]||m.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(lc,""):null==c?"":c)}}}),m.extend({valHooks:{option:{get:function(a){var b=m.find.attr(a,"value");return null!=b?b:m.trim(m.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&m.nodeName(c.parentNode,"optgroup"))){if(b=m(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=m.makeArray(b),g=e.length;while(g--)if(d=e[g],m.inArray(m.valHooks.option.get(d),f)>=0)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),m.each(["radio","checkbox"],function(){m.valHooks[this]={set:function(a,b){return m.isArray(b)?a.checked=m.inArray(m(a).val(),b)>=0:void 0}},k.checkOn||(m.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var mc,nc,oc=m.expr.attrHandle,pc=/^(?:checked|selected)$/i,qc=k.getSetAttribute,rc=k.input;m.fn.extend({attr:function(a,b){return V(this,m.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){m.removeAttr(this,a)})}}),m.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===K?m.prop(a,b,c):(1===f&&m.isXMLDoc(a)||(b=b.toLowerCase(),d=m.attrHooks[b]||(m.expr.match.bool.test(b)?nc:mc)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=m.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void m.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=m.propFix[c]||c,m.expr.match.bool.test(c)?rc&&qc||!pc.test(c)?a[d]=!1:a[m.camelCase("default-"+c)]=a[d]=!1:m.attr(a,c,""),a.removeAttribute(qc?c:d)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&m.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),nc={set:function(a,b,c){return b===!1?m.removeAttr(a,c):rc&&qc||!pc.test(c)?a.setAttribute(!qc&&m.propFix[c]||c,c):a[m.camelCase("default-"+c)]=a[c]=!0,c}},m.each(m.expr.match.bool.source.match(/\w+/g),function(a,b){var c=oc[b]||m.find.attr;oc[b]=rc&&qc||!pc.test(b)?function(a,b,d){var e,f;return d||(f=oc[b],oc[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,oc[b]=f),e}:function(a,b,c){return c?void 0:a[m.camelCase("default-"+b)]?b.toLowerCase():null}}),rc&&qc||(m.attrHooks.value={set:function(a,b,c){return m.nodeName(a,"input")?void(a.defaultValue=b):mc&&mc.set(a,b,c)}}),qc||(mc={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},oc.id=oc.name=oc.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},m.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:mc.set},m.attrHooks.contenteditable={set:function(a,b,c){mc.set(a,""===b?!1:b,c)}},m.each(["width","height"],function(a,b){m.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),k.style||(m.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var sc=/^(?:input|select|textarea|button|object)$/i,tc=/^(?:a|area)$/i;m.fn.extend({prop:function(a,b){return V(this,m.prop,a,b,arguments.length>1)},removeProp:function(a){return a=m.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),m.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!m.isXMLDoc(a),f&&(b=m.propFix[b]||b,e=m.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=m.find.attr(a,"tabindex");return b?parseInt(b,10):sc.test(a.nodeName)||tc.test(a.nodeName)&&a.href?0:-1}}}}),k.hrefNormalized||m.each(["href","src"],function(a,b){m.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),k.optSelected||(m.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}}),m.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){m.propFix[this.toLowerCase()]=this}),k.enctype||(m.propFix.enctype="encoding");var uc=/[\t\r\n\f]/g;m.fn.extend({addClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j="string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).addClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(uc," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=m.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j=0===arguments.length||"string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).removeClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(uc," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?m.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(m.isFunction(a)?function(c){m(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=m(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===K||"boolean"===c)&&(this.className&&m._data(this,"__className__",this.className),this.className=this.className||a===!1?"":m._data(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(uc," ").indexOf(b)>=0)return!0;return!1}}),m.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){m.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),m.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var vc=m.now(),wc=/\?/,xc=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;m.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=m.trim(b+"");return e&&!m.trim(e.replace(xc,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():m.error("Invalid JSON: "+b)},m.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||m.error("Invalid XML: "+b),c};var yc,zc,Ac=/#.*$/,Bc=/([?&])_=[^&]*/,Cc=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Dc=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Ec=/^(?:GET|HEAD)$/,Fc=/^\/\//,Gc=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Hc={},Ic={},Jc="*/".concat("*");try{zc=location.href}catch(Kc){zc=y.createElement("a"),zc.href="",zc=zc.href}yc=Gc.exec(zc.toLowerCase())||[];function Lc(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(m.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Mc(a,b,c,d){var e={},f=a===Ic;function g(h){var i;return e[h]=!0,m.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Nc(a,b){var c,d,e=m.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&m.extend(!0,a,c),a}function Oc(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Pc(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}m.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:zc,type:"GET",isLocal:Dc.test(yc[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Jc,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":m.parseJSON,"text xml":m.parseXML}
vendor: 12,799 bytes, line 69
69,flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Nc(Nc(a,m.ajaxSettings),b):Nc(m.ajaxSettings,a)},ajaxPrefilter:Lc(Hc),ajaxTransport:Lc(Ic),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=m.ajaxSetup({},b),l=k.context||k,n=k.context&&(l.nodeType||l.jquery)?m(l):m.event,o=m.Deferred(),p=m.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!j){j={};while(b=Cc.exec(f))j[b[1].toLowerCase()]=b[2]}b=j[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?f:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return i&&i.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||zc)+"").replace(Ac,"").replace(Fc,yc[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=m.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(c=Gc.exec(k.url.toLowerCase()),k.crossDomain=!(!c||c[1]===yc[1]&&c[2]===yc[2]&&(c[3]||("http:"===c[1]?"80":"443"))===(yc[3]||("http:"===yc[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=m.param(k.data,k.traditional)),Mc(Hc,k,b,v),2===t)return v;h=m.event&&k.global,h&&0===m.active++&&m.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!Ec.test(k.type),e=k.url,k.hasContent||(k.data&&(e=k.url+=(wc.test(e)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=Bc.test(e)?e.replace(Bc,"$1_="+vc++):e+(wc.test(e)?"&":"?")+"_="+vc++)),k.ifModified&&(m.lastModified[e]&&v.setRequestHeader("If-Modified-Since",m.lastModified[e]),m.etag[e]&&v.setRequestHeader("If-None-Match",m.etag[e])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+Jc+"; q=0.01":""):k.accepts["*"]);for(d in k.headers)v.setRequestHeader(d,k.headers[d]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(d in{success:1,error:1,complete:1})v[d](k[d]);if(i=Mc(Ic,k,b,v)){v.readyState=1,h&&n.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,i.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,c,d){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),i=void 0,f=d||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,c&&(u=Oc(k,v,c)),u=Pc(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(m.lastModified[e]=w),w=v.getResponseHeader("etag"),w&&(m.etag[e]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,h&&n.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),h&&(n.trigger("ajaxComplete",[v,k]),--m.active||m.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return m.get(a,b,c,"json")},getScript:function(a,b){return m.get(a,void 0,b,"script")}}),m.each(["get","post"],function(a,b){m[b]=function(a,c,d,e){return m.isFunction(c)&&(e=e||d,d=c,c=void 0),m.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),m._evalUrl=function(a){return m.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},m.fn.extend({wrapAll:function(a){if(m.isFunction(a))return this.each(function(b){m(this).wrapAll(a.call(this,b))});if(this[0]){var b=m(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return this.each(m.isFunction(a)?function(b){m(this).wrapInner(a.call(this,b))}:function(){var b=m(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=m.isFunction(a);return this.each(function(c){m(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){m.nodeName(this,"body")||m(this).replaceWith(this.childNodes)}).end()}}),m.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0||!k.reliableHiddenOffsets()&&"none"===(a.style&&a.style.display||m.css(a,"display"))},m.expr.filters.visible=function(a){return!m.expr.filters.hidden(a)};var Qc=/%20/g,Rc=/\[\]$/,Sc=/\r?\n/g,Tc=/^(?:submit|button|image|reset|file)$/i,Uc=/^(?:input|select|textarea|keygen)/i;function Vc(a,b,c,d){var e;if(m.isArray(b))m.each(b,function(b,e){c||Rc.test(a)?d(a,e):Vc(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==m.type(b))d(a,b);else for(e in b)Vc(a+"["+e+"]",b[e],c,d)}m.param=function(a,b){var c,d=[],e=function(a,b){b=m.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=m.ajaxSettings&&m.ajaxSettings.traditional),m.isArray(a)||a.jquery&&!m.isPlainObject(a))m.each(a,function(){e(this.name,this.value)});else for(c in a)Vc(c,a[c],b,e);return d.join("&").replace(Qc,"+")},m.fn.extend({serialize:function(){return m.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=m.prop(this,"elements");return a?m.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!m(this).is(":disabled")&&Uc.test(this.nodeName)&&!Tc.test(a)&&(this.checked||!W.test(a))}).map(function(a,b){var c=m(this).val();return null==c?null:m.isArray(c)?m.map(c,function(a){return{name:b.name,value:a.replace(Sc,"\r\n")}}):{name:b.name,value:c.replace(Sc,"\r\n")}}).get()}}),m.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&Zc()||$c()}:Zc;var Wc=0,Xc={},Yc=m.ajaxSettings.xhr();a.attachEvent&&a.attachEvent("onunload",function(){for(var a in Xc)Xc[a](void 0,!0)}),k.cors=!!Yc&&"withCredentials"in Yc,Yc=k.ajax=!!Yc,Yc&&m.ajaxTransport(function(a){if(!a.crossDomain||k.cors){var b;return{send:function(c,d){var e,f=a.xhr(),g=++Wc;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)void 0!==c[e]&&f.setRequestHeader(e,c[e]+"");f.send(a.hasContent&&a.data||null),b=function(c,e){var h,i,j;if(b&&(e||4===f.readyState))if(delete Xc[g],b=void 0,f.onreadystatechange=m.noop,e)4!==f.readyState&&f.abort();else{j={},h=f.status,"string"==typeof f.responseText&&(j.text=f.responseText);try{i=f.statusText}catch(k){i=""}h||!a.isLocal||a.crossDomain?1223===h&&(h=204):h=j.text?200:404}j&&d(h,i,j,f.getAllResponseHeaders())},a.async?4===f.readyState?setTimeout(b):f.onreadystatechange=Xc[g]=b:b()},abort:function(){b&&b(void 0,!0)}}}});function Zc(){try{return new a.XMLHttpRequest}catch(b){}}function $c(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}m.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return m.globalEval(a),a}}}),m.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),m.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=y.head||m("head")[0]||y.documentElement;return{send:function(d,e){b=y.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||e(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var _c=[],ad=/(=)\?(?=&|$)|\?\?/;m.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=_c.pop()||m.expando+"_"+vc++;return this[a]=!0,a}}),m.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(ad.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&ad.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=m.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(ad,"$1"+e):b.jsonp!==!1&&(b.url+=(wc.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||m.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,_c.push(e)),g&&m.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),m.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||y;var d=u.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=m.buildFragment([a],b,e),e&&e.length&&m(e).remove(),m.merge([],d.childNodes))};var bd=m.fn.load;m.fn.load=function(a,b,c){if("string"!=typeof a&&bd)return bd.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=m.trim(a.slice(h,a.length)),a=a.slice(0,h)),m.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(f="POST"),g.length>0&&m.ajax({url:a,type:f,dataType:"html",data:b}).done(function(a){e=arguments,g.html(d?m("<div>").append(m.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,e||[a.responseText,b,a])}),this},m.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){m.fn[b]=function(a){return this.on(b,a)}}),m.expr.filters.animated=function(a){return m.grep(m.timers,function(b){return a===b.elem}).length};var cd=a.document.documentElement;function dd(a){return m.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}m.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=m.css(a,"position"),l=m(a),n={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=m.css(a,"top"),i=m.css(a,"left"),j=("absolute"===k||"fixed"===k)&&m.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),m.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(n.top=b.top-h.top+g),null!=b.left&&(n.left=b.left-h.left+e),"using"in b?b.using.call(a,n):l.css(n)}},m.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){m.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,m.contains(b,e)?(typeof e.getBoundingClientRect!==K&&(d=e.getBoundingClientRect()),c=dd(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===m.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),m.nodeName(a[0],"html")||(c=a.offset()),c.top+=m.css(a[0],"borderTopWidth",!0),c.left+=m.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-m.css(d,"marginTop",!0),left:b.left-c.left-m.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||cd;while(a&&!m.nodeName(a,"html")&&"static"===m.css(a,"position"))a=a.offsetParent;return a||cd})}}),m.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);m.fn[a]=function(d){return V(this,function(a,d,e){var f=dd(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?m(f).scrollLeft():e,c?e:m(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),m.each(["top","left"],function(a,b){m.cssHooks[b]=Lb(k.pixelPosition,function(a,c){return c?(c=Jb(a,b),Hb.test(c)?m(a).position()[b]+"px":c):void 0})}),m.each({Height:"height",Width:"width"},function(a,b){m.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){m.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return V(this,function(b,c,d){var e;return m.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?m.css(b,c,g):m.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),m.fn.size=function(){return this.length},m.fn.andSelf=m.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return m});var ed=a.jQuery,fd=a.$;return m.noConflict=function(b){return a.$===m&&(a.$=fd),b&&a.jQuery===m&&(a.jQuery=ed),m},typeof b===K&&(a.jQuery=a.$=m),m});
vendor: 7,307 bytes, lines 69-91
69(function(factory){if(typeof define==="function"&&define.amd){define(["jquery"],factory);}else{factory(jQuery);}}(function($){$.ui=$.ui||{};$.extend($.ui,{version:"1.11.3",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}});$.fn.extend({scrollParent:function(includeHidden){var position=this.css("position"),excludeStaticParent=position==="absolute",overflowRegex=includeHidden?/(auto|scroll|hidden)/:/(auto|scroll)/,scrollParent=this.parents().filter(function(){var parent=$(this);if(excludeStaticParent&&parent.css("position")==="static"){return false;} 70return overflowRegex.test(parent.css("overflow")+parent.css("overflow-y")+parent.css("overflow-x"));}).eq(0);return position==="fixed"||!scrollParent.length?$(this[0].ownerDocument||document):scrollParent;},uniqueId:(function(){var uuid=0;return function(){return this.each(function(){if(!this.id){this.id="ui-id-"+(++uuid);}});};})(),removeUniqueId:function(){return this.each(function(){if(/^ui-id-\d+$/.test(this.id)){$(this).removeAttr("id");}});}});function focusable(element,isTabIndexNotNaN){var map,mapName,img,nodeName=element.nodeName.toLowerCase();if("area"===nodeName){map=element.parentNode;mapName=map.name;if(!element.href||!mapName||map.nodeName.toLowerCase()!=="map"){return false;} 71img=$("img[usemap='#"+mapName+"']")[0];return!!img&&visible(img);} 72return(/^(input|select|textarea|button|object)$/.test(nodeName)?!element.disabled:"a"===nodeName?element.href||isTabIndexNotNaN:isTabIndexNotNaN)&&visible(element);} 73function visible(element){return $.expr.filters.visible(element)&&!$(element).parents().addBack().filter(function(){return $.css(this,"visibility")==="hidden";}).length;} 74$.extend($.expr[":"],{data:$.expr.createPseudo?$.expr.createPseudo(function(dataName){return function(elem){return!!$.data(elem,dataName);};}):function(elem,i,match){return!!$.data(elem,match[3]);},focusable:function(element){return focusable(element,!isNaN($.attr(element,"tabindex")));},tabbable:function(element){var tabIndex=$.attr(element,"tabindex"),isTabIndexNaN=isNaN(tabIndex);return(isTabIndexNaN||tabIndex>=0)&&focusable(element,!isTabIndexNaN);}});if(!$("<a>").outerWidth(1).jquery){$.each(["Width","Height"],function(i,name){var side=name==="Width"?["Left","Right"]:["Top","Bottom"],type=name.toLowerCase(),orig={innerWidth:$.fn.innerWidth,innerHeight:$.fn.innerHeight,outerWidth:$.fn.outerWidth,outerHeight:$.fn.outerHeight};function reduce(elem,size,border,margin){$.each(side,function(){size-=parseFloat($.css(elem,"padding"+this))||0;if(border){size-=parseFloat($.css(elem,"border"+this+"Width"))||0;} 75if(margin){size-=parseFloat($.css(elem,"margin"+this))||0;}});return size;} 76$.fn["inner"+name]=function(size){if(size===undefined){return orig["inner"+name].call(this);} 77return this.each(function(){$(this).css(type,reduce(this,size)+"px");});};$.fn["outer"+name]=function(size,margin){if(typeof size!=="number"){return orig["outer"+name].call(this,size);} 78return this.each(function(){$(this).css(type,reduce(this,size,true,margin)+"px");});};});} 79if(!$.fn.addBack){$.fn.addBack=function(selector){return this.add(selector==null?this.prevObject:this.prevObject.filter(selector));};} 80if($("<a>").data("a-b","a").removeData("a-b").data("a-b")){$.fn.removeData=(function(removeData){return function(key){if(arguments.length){return removeData.call(this,$.camelCase(key));}else{return removeData.call(this);}};})($.fn.removeData);} 81$.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());$.fn.extend({focus:(function(orig){return function(delay,fn){return typeof delay==="number"?this.each(function(){var elem=this;setTimeout(function(){$(elem).focus();if(fn){fn.call(elem);}},delay);}):orig.apply(this,arguments);};})($.fn.focus),disableSelection:(function(){var eventType="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.bind(eventType+".ui-disableSelection",function(event){event.preventDefault();});};})(),enableSelection:function(){return this.unbind(".ui-disableSelection");},zIndex:function(zIndex){if(zIndex!==undefined){return this.css("zIndex",zIndex);} 82if(this.length){var elem=$(this[0]),position,value;while(elem.length&&elem[0]!==document){position=elem.css("position");if(position==="absolute"||position==="relative"||position==="fixed"){value=parseInt(elem.css("zIndex"),10);if(!isNaN(value)&&value!==0){return value;}} 83elem=elem.parent();}} 84return 0;}});$.ui.plugin={add:function(module,option,set){var i,proto=$.ui[module].prototype;for(i in set){proto.plugins[i]=proto.plugins[i]||[];proto.plugins[i].push([option,set[i]]);}},call:function(instance,name,args,allowDisconnected){var i,set=instance.plugins[name];if(!set){return;} 85if(!allowDisconnected&&(!instance.element[0].parentNode||instance.element[0].parentNode.nodeType===11)){return;} 86for(i=0;i<set.length;i++){if(instance.options[set[i][0]]){set[i][1].apply(instance.element,args);}}}};var widget_uuid=0,widget_slice=Array.prototype.slice;$.cleanData=(function(orig){return function(elems){var events,elem,i;for(i=0;(elem=elems[i])!=null;i++){try{events=$._data(elem,"events");if(events&&events.remove){$(elem).triggerHandler("remove");}}catch(e){}} 87orig(elems);};})($.cleanData);$.widget=function(name,base,prototype){var fullName,existingConstructor,constructor,basePrototype,proxiedPrototype={},namespace=name.split(".")[0];name=name.split(".")[1];fullName=namespace+"-"+name;if(!prototype){prototype=base;base=$.Widget;} 88$.expr[":"][fullName.toLowerCase()]=function(elem){return!!$.data(elem,fullName);};$[namespace]=$[namespace]||{};existingConstructor=$[namespace][name];constructor=$[namespace][name]=function(options,element){if(!this._createWidget){return new constructor(options,element);} 89if(arguments.length){this._createWidget(options,element);}};$.extend(constructor,existingConstructor,{version:prototype.version,_proto:$.extend({},prototype),_childConstructors:[]});basePrototype=new base();basePrototype.options=$.widget.extend({},basePrototype.options);$.each(prototype,function(prop,value){if(!$.isFunction(value)){proxiedPrototype[prop]=value;return;} 90proxiedPrototype[prop]=(function(){var _super=function(){return base.prototype[prop].apply(this,arguments);},_superApply=function(args){return base.prototype[prop].apply(this,args);};return function(){var __super=this._super,__superApply=this._superApply,returnValue;this._super=_super;this._superApply=_superApply;returnValue=value.apply(this,arguments);this._super=__super;this._superApply=__superApply;return returnValue;};})();});constructor.prototype=$.widget.extend(basePrototype,{widgetEventPrefix:existingConstructor?(basePrototype.widgetEventPrefix||name):name},proxiedPrototype,{constructor:constructor,namespace:namespace,widgetName:name,widgetFullName:fullName});if(existingConstructor){$.each(existingConstructor._childConstructors,function(i,child){var childPrototype=child.prototype;$.widget(childPrototype.namespace+"."+childPrototype.widgetName,constructor,child._proto);});delete existingConstructor._childConstructors;}else{base._childConstructors.push(constructor);} 91$.widget.bridge(name,constructor);return constructor;};$.widget.extend=function(target){var input=widget_slice.call(arguments,1
vendor: 10,749 bytes, lines 91-128
91),inputIndex=0,inputLength=input.length,key,value;for(;inputIndex<inputLength;inputIndex++){for(key in input[inputIndex]){value=input[inputIndex][key];if(input[inputIndex].hasOwnProperty(key)&&value!==undefined){if($.isPlainObject(value)){target[key]=$.isPlainObject(target[key])?$.widget.extend({},target[key],value):$.widget.extend({},value);}else{target[key]=value;}}}} 92return target;};$.widget.bridge=function(name,object){var fullName=object.prototype.widgetFullName||name;$.fn[name]=function(options){var isMethodCall=typeof options==="string",args=widget_slice.call(arguments,1),returnValue=this;if(isMethodCall){this.each(function(){var methodValue,instance=$.data(this,fullName);if(options==="instance"){returnValue=instance;return false;} 93if(!instance){return $.error("cannot call methods on "+name+" prior to initialization; "+"attempted to call method '"+options+"'");} 94if(!$.isFunction(instance[options])||options.charAt(0)==="_"){return $.error("no such method '"+options+"' for "+name+" widget instance");} 95methodValue=instance[options].apply(instance,args);if(methodValue!==instance&&methodValue!==undefined){returnValue=methodValue&&methodValue.jquery?returnValue.pushStack(methodValue.get()):methodValue;return false;}});}else{if(args.length){options=$.widget.extend.apply(null,[options].concat(args));} 96this.each(function(){var instance=$.data(this,fullName);if(instance){instance.option(options||{});if(instance._init){instance._init();}}else{$.data(this,fullName,new object(options,this));}});} 97return returnValue;};};$.Widget=function(){};$.Widget._childConstructors=[];$.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:false,create:null},_createWidget:function(options,element){element=$(element||this.defaultElement||this)[0];this.element=$(element);this.uuid=widget_uuid++;this.eventNamespace="."+this.widgetName+this.uuid;this.bindings=$();this.hoverable=$();this.focusable=$();if(element!==this){$.data(element,this.widgetFullName,this);this._on(true,this.element,{remove:function(event){if(event.target===element){this.destroy();}}});this.document=$(element.style?element.ownerDocument:element.document||element);this.window=$(this.document[0].defaultView||this.document[0].parentWindow);} 98this.options=$.widget.extend({},this.options,this._getCreateOptions(),options);this._create();this._trigger("create",null,this._getCreateEventData());this._init();},_getCreateOptions:$.noop,_getCreateEventData:$.noop,_create:$.noop,_init:$.noop,destroy:function(){this._destroy();this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData($.camelCase(this.widgetFullName));this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled");this.bindings.unbind(this.eventNamespace);this.hoverable.removeClass("ui-state-hover");this.focusable.removeClass("ui-state-focus");},_destroy:$.noop,widget:function(){return this.element;},option:function(key,value){var options=key,parts,curOption,i;if(arguments.length===0){return $.widget.extend({},this.options);} 99if(typeof key==="string"){options={};parts=key.split(".");key=parts.shift();if(parts.length){curOption=options[key]=$.widget.extend({},this.options[key]);for(i=0;i<parts.length-1;i++){curOption[parts[i]]=curOption[parts[i]]||{};curOption=curOption[parts[i]];} 100key=parts.pop();if(arguments.length===1){return curOption[key]===undefined?null:curOption[key];} 101curOption[key]=value;}else{if(arguments.length===1){return this.options[key]===undefined?null:this.options[key];} 102options[key]=value;}} 103this._setOptions(options);return this;},_setOptions:function(options){var key;for(key in options){this._setOption(key,options[key]);} 104return this;},_setOption:function(key,value){this.options[key]=value;if(key==="disabled"){this.widget().toggleClass(this.widgetFullName+"-disabled",!!value);if(value){this.hoverable.removeClass("ui-state-hover");this.focusable.removeClass("ui-state-focus");}} 105return this;},enable:function(){return this._setOptions({disabled:false});},disable:function(){return this._setOptions({disabled:true});},_on:function(suppressDisabledCheck,element,handlers){var delegateElement,instance=this;if(typeof suppressDisabledCheck!=="boolean"){handlers=element;element=suppressDisabledCheck;suppressDisabledCheck=false;} 106if(!handlers){handlers=element;element=this.element;delegateElement=this.widget();}else{element=delegateElement=$(element);this.bindings=this.bindings.add(element);} 107$.each(handlers,function(event,handler){function handlerProxy(){if(!suppressDisabledCheck&&(instance.options.disabled===true||$(this).hasClass("ui-state-disabled"))){return;} 108return(typeof handler==="string"?instance[handler]:handler).apply(instance,arguments);} 109if(typeof handler!=="string"){handlerProxy.guid=handler.guid=handler.guid||handlerProxy.guid||$.guid++;} 110var match=event.match(/^([\w:-]*)\s*(.*)$/),eventName=match[1]+instance.eventNamespace,selector=match[2];if(selector){delegateElement.delegate(selector,eventName,handlerProxy);}else{element.bind(eventName,handlerProxy);}});},_off:function(element,eventName){eventName=(eventName||"").split(" ").join(this.eventNamespace+" ")+ 111this.eventNamespace;element.unbind(eventName).undelegate(eventName);this.bindings=$(this.bindings.not(element).get());this.focusable=$(this.focusable.not(element).get());this.hoverable=$(this.hoverable.not(element).get());},_delay:function(handler,delay){function handlerProxy(){return(typeof handler==="string"?instance[handler]:handler).apply(instance,arguments);} 112var instance=this;return setTimeout(handlerProxy,delay||0);},_hoverable:function(element){this.hoverable=this.hoverable.add(element);this._on(element,{mouseenter:function(event){$(event.currentTarget).addClass("ui-state-hover");},mouseleave:function(event){$(event.currentTarget).removeClass("ui-state-hover");}});},_focusable:function(element){this.focusable=this.focusable.add(element);this._on(element,{focusin:function(event){$(event.currentTarget).addClass("ui-state-focus");},focusout:function(event){$(event.currentTarget).removeClass("ui-state-focus");}});},_trigger:function(type,event,data){var prop,orig,callback=this.options[type];data=data||{};event=$.Event(event);event.type=(type===this.widgetEventPrefix?type:this.widgetEventPrefix+type).toLowerCase();event.target=this.element[0];orig=event.originalEvent;if(orig){for(prop in orig){if(!(prop in event)){event[prop]=orig[prop];}}} 113this.element.trigger(event,data);return!($.isFunction(callback)&&callback.apply(this.element[0],[event].concat(data))===false||event.isDefaultPrevented());}};$.each({show:"fadeIn",hide:"fadeOut"},function(method,defaultEffect){$.Widget.prototype["_"+method]=function(element,options,callback){if(typeof options==="string"){options={effect:options};} 114var hasOptions,effectName=!options?method:options===true||typeof options==="number"?defaultEffect:options.effect||defaultEffect;options=options||{};if(typeof options==="number"){options={duration:options};} 115hasOptions=!$.isEmptyObject(options);options.complete=callback;if(options.delay){element.delay(options.delay);} 116if(hasOptions&&$.effects&&$.effects.effect[effectName]){element[method](options);}else if(effectName!==method&&element[effectName]){element[effectName](options.duration,options.easing,callback);}else{element.queue(function(next){$(this)[method]();if(callback){callback.call(element[0]);} 117next();});}};});var widget=$.widget;var mouseHandled=false;$(document).mouseup(function(){mouseHandled=false;});var mouse=$.widget("ui.mouse",{version:"1.11.3",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var that=this;this.element.bind("mousedown."+this.widgetName,function(event){return that._mouseDown(event);}).bind("click."+this.widgetName,function(event){if(true===$.data(event.target,that.widgetName+".preventClickEvent")){$.removeData(event.target,that.widgetName+".preventClickEvent");event.stopImmediatePropagation();return false;}});this.started=false;},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);if(this._mouseMoveDelegate){this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);}},_mouseDown:function(event){if(mouseHandled){return;} 118this._mouseMoved=false;(this._mouseStarted&&this._mouseUp(event));this._mouseDownEvent=event;var that=this,btnIsLeft=(event.which===1),elIsCancel=(typeof this.options.cancel==="string"&&event.target.nodeName?$(event.target).closest(this.options.cancel).length:false);if(!btnIsLeft||elIsCancel||!this._mouseCapture(event)){return true;} 119this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){that.mouseDelayMet=true;},this.options.delay);} 120if(this._mouseDistanceMet(event)&&this._mouseDelayMet(event)){this._mouseStarted=(this._mouseStart(event)!==false);if(!this._mouseStarted){event.preventDefault();return true;}} 121if(true===$.data(event.target,this.widgetName+".preventClickEvent")){$.removeData(event.target,this.widgetName+".preventClickEvent");} 122this._mouseMoveDelegate=function(event){return that._mouseMove(event);};this._mouseUpDelegate=function(event){return that._mouseUp(event);};this.document.bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);event.preventDefault();mouseHandled=true;return true;},_mouseMove:function(event){if(this._mouseMoved){if($.ui.ie&&(!document.documentMode||document.documentMode<9)&&!event.button){return this._mouseUp(event);}else if(!event.which){return this._mouseUp(event);}} 123if(event.which||event.button){this._mouseMoved=true;} 124if(this._mouseStarted){this._mouseDrag(event);return event.preventDefault();} 125if(this._mouseDistanceMet(event)&&this._mouseDelayMet(event)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,event)!==false);(this._mouseStarted?this._mouseDrag(event):this._mouseUp(event));} 126return!this._mouseStarted;},_mouseUp:function(event){this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;if(event.target===this._mouseDownEvent.target){$.data(event.target,this.widgetName+".preventClickEvent",true);} 127this._mouseStop(event);} 128mouseHandled=false;return false;},_mouseDistanceMet:function(event){return(Math.max(Math.abs(this._mouseDownEvent.pageX-event.pageX),Math.abs(this._mouseDownEvent.pageY-event.pageY))>=this.options.distance);},_mouseDelayMet:function(){return this.mouseDelayMet;},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true;}}
vendor: 10,432 bytes, lines 128-149
128);(function(){$.ui=$.ui||{};var cachedScrollbarWidth,supportsOffsetFractions,max=Math.max,abs=Math.abs,round=Math.round,rhorizontal=/left|center|right/,rvertical=/top|center|bottom/,roffset=/[\+\-]\d+(\.[\d]+)?%?/,rposition=/^\w+/,rpercent=/%$/,_position=$.fn.position;function getOffsets(offsets,width,height){return[parseFloat(offsets[0])*(rpercent.test(offsets[0])?width/100:1),parseFloat(offsets[1])*(rpercent.test(offsets[1])?height/100:1)];} 129function parseCss(element,property){return parseInt($.css(element,property),10)||0;} 130function getDimensions(elem){var raw=elem[0];if(raw.nodeType===9){return{width:elem.width(),height:elem.height(),offset:{top:0,left:0}};} 131if($.isWindow(raw)){return{width:elem.width(),height:elem.height(),offset:{top:elem.scrollTop(),left:elem.scrollLeft()}};} 132if(raw.preventDefault){return{width:0,height:0,offset:{top:raw.pageY,left:raw.pageX}};} 133return{width:elem.outerWidth(),height:elem.outerHeight(),offset:elem.offset()};} 134$.position={scrollbarWidth:function(){if(cachedScrollbarWidth!==undefined){return cachedScrollbarWidth;} 135var w1,w2,div=$("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),innerDiv=div.children()[0];$("body").append(div);w1=innerDiv.offsetWidth;div.css("overflow","scroll");w2=innerDiv.offsetWidth;if(w1===w2){w2=div[0].clientWidth;} 136div.remove();return(cachedScrollbarWidth=w1-w2);},getScrollInfo:function(within){var overflowX=within.isWindow||within.isDocument?"":within.element.css("overflow-x"),overflowY=within.isWindow||within.isDocument?"":within.element.css("overflow-y"),hasOverflowX=overflowX==="scroll"||(overflowX==="auto"&&within.width<within.element[0].scrollWidth),hasOverflowY=overflowY==="scroll"||(overflowY==="auto"&&within.height<within.element[0].scrollHeight);return{width:hasOverflowY?$.position.scrollbarWidth():0,height:hasOverflowX?$.position.scrollbarWidth():0};},getWithinInfo:function(element){var withinElement=$(element||window),isWindow=$.isWindow(withinElement[0]),isDocument=!!withinElement[0]&&withinElement[0].nodeType===9;return{element:withinElement,isWindow:isWindow,isDocument:isDocument,offset:withinElement.offset()||{left:0,top:0},scrollLeft:withinElement.scrollLeft(),scrollTop:withinElement.scrollTop(),width:isWindow||isDocument?withinElement.width():withinElement.outerWidth(),height:isWindow||isDocument?withinElement.height():withinElement.outerHeight()};}};$.fn.position=function(options){if(!options||!options.of){return _position.apply(this,arguments);} 137options=$.extend({},options);var atOffset,targetWidth,targetHeight,targetOffset,basePosition,dimensions,target=$(options.of),within=$.position.getWithinInfo(options.within),scrollInfo=$.position.getScrollInfo(within),collision=(options.collision||"flip").split(" "),offsets={};dimensions=getDimensions(target);if(target[0].preventDefault){options.at="left top";} 138targetWidth=dimensions.width;targetHeight=dimensions.height;targetOffset=dimensions.offset;basePosition=$.extend({},targetOffset);$.each(["my","at"],function(){var pos=(options[this]||"").split(" "),horizontalOffset,verticalOffset;if(pos.length===1){pos=rhorizontal.test(pos[0])?pos.concat(["center"]):rvertical.test(pos[0])?["center"].concat(pos):["center","center"];} 139pos[0]=rhorizontal.test(pos[0])?pos[0]:"center";pos[1]=rvertical.test(pos[1])?pos[1]:"center";horizontalOffset=roffset.exec(pos[0]);verticalOffset=roffset.exec(pos[1]);offsets[this]=[horizontalOffset?horizontalOffset[0]:0,verticalOffset?verticalOffset[0]:0];options[this]=[rposition.exec(pos[0])[0],rposition.exec(pos[1])[0]];});if(collision.length===1){collision[1]=collision[0];} 140if(options.at[0]==="right"){basePosition.left+=targetWidth;}else if(options.at[0]==="center"){basePosition.left+=targetWidth/2;} 141if(options.at[1]==="bottom"){basePosition.top+=targetHeight;}else if(options.at[1]==="center"){basePosition.top+=targetHeight/2;} 142atOffset=getOffsets(offsets.at,targetWidth,targetHeight);basePosition.left+=atOffset[0];basePosition.top+=atOffset[1];return this.each(function(){var collisionPosition,using,elem=$(this),elemWidth=elem.outerWidth(),elemHeight=elem.outerHeight(),marginLeft=parseCss(this,"marginLeft"),marginTop=parseCss(this,"marginTop"),collisionWidth=elemWidth+marginLeft+parseCss(this,"marginRight")+scrollInfo.width,collisionHeight=elemHeight+marginTop+parseCss(this,"marginBottom")+scrollInfo.height,position=$.extend({},basePosition),myOffset=getOffsets(offsets.my,elem.outerWidth(),elem.outerHeight());if(options.my[0]==="right"){position.left-=elemWidth;}else if(options.my[0]==="center"){position.left-=elemWidth/2;} 143if(options.my[1]==="bottom"){position.top-=elemHeight;}else if(options.my[1]==="center"){position.top-=elemHeight/2;} 144position.left+=myOffset[0];position.top+=myOffset[1];if(!supportsOffsetFractions){position.left=round(position.left);position.top=round(position.top);} 145collisionPosition={marginLeft:marginLeft,marginTop:marginTop};$.each(["left","top"],function(i,dir){if($.ui.position[collision[i]]){$.ui.position[collision[i]][dir](position,{targetWidth:targetWidth,targetHeight:targetHeight,elemWidth:elemWidth,elemHeight:elemHeight,collisionPosition:collisionPosition,collisionWidth:collisionWidth,collisionHeight:collisionHeight,offset:[atOffset[0]+myOffset[0],atOffset[1]+myOffset[1]],my:options.my,at:options.at,within:within,elem:elem});}});if(options.using){using=function(props){var left=targetOffset.left-position.left,right=left+targetWidth-elemWidth,top=targetOffset.top-position.top,bottom=top+targetHeight-elemHeight,feedback={target:{element:target,left:targetOffset.left,top:targetOffset.top,width:targetWidth,height:targetHeight},element:{element:elem,left:position.left,top:position.top,width:elemWidth,height:elemHeight},horizontal:right<0?"left":left>0?"right":"center",vertical:bottom<0?"top":top>0?"bottom":"middle"};if(targetWidth<elemWidth&&abs(left+right)<targetWidth){feedback.horizontal="center";} 146if(targetHeight<elemHeight&&abs(top+bottom)<targetHeight){feedback.vertical="middle";} 147if(max(abs(left),abs(right))>max(abs(top),abs(bottom))){feedback.important="horizontal";}else{feedback.important="vertical";} 148options.using.call(this,props,feedback);};} 149elem.offset($.extend(position,{using:using}));});};$.ui.position={fit:{left:function(position,data){var within=data.within,withinOffset=within.isWindow?within.scrollLeft:within.offset.left,outerWidth=within.width,collisionPosLeft=position.left-data.collisionPosition.marginLeft,overLeft=withinOffset-collisionPosLeft,overRight=collisionPosLeft+data.collisionWidth-outerWidth-withinOffset,newOverRight;if(data.collisionWidth>outerWidth){if(overLeft>0&&overRight<=0){newOverRight=position.left+overLeft+data.collisionWidth-outerWidth-withinOffset;position.left+=overLeft-newOverRight;}else if(overRight>0&&overLeft<=0){position.left=withinOffset;}else{if(overLeft>overRight){position.left=withinOffset+outerWidth-data.collisionWidth;}else{position.left=withinOffset;}}}else if(overLeft>0){position.left+=overLeft;}else if(overRight>0){position.left-=overRight;}else{position.left=max(position.left-collisionPosLeft,position.left);}},top:function(position,data){var within=data.within,withinOffset=within.isWindow?within.scrollTop:within.offset.top,outerHeight=data.within.height,collisionPosTop=position.top-data.collisionPosition.marginTop,overTop=withinOffset-collisionPosTop,overBottom=collisionPosTop+data.collisionHeight-outerHeight-withinOffset,newOverBottom;if(data.collisionHeight>outerHeight){if(overTop>0&&overBottom<=0){newOverBottom=position.top+overTop+data.collisionHeight-outerHeight-withinOffset;position.top+=overTop-newOverBottom;}else if(overBottom>0&&overTop<=0){position.top=withinOffset;}else{if(overTop>overBottom){position.top=withinOffset+outerHeight-data.collisionHeight;}else{position.top=withinOffset;}}}else if(overTop>0){position.top+=overTop;}else if(overBottom>0){position.top-=overBottom;}else{position.top=max(position.top-collisionPosTop,position.top);}}},flip:{left:function(position,data){var within=data.within,withinOffset=within.offset.left+within.scrollLeft,outerWidth=within.width,offsetLeft=within.isWindow?within.scrollLeft:within.offset.left,collisionPosLeft=position.left-data.collisionPosition.marginLeft,overLeft=collisionPosLeft-offsetLeft,overRight=collisionPosLeft+data.collisionWidth-outerWidth-offsetLeft,myOffset=data.my[0]==="left"?-data.elemWidth:data.my[0]==="right"?data.elemWidth:0,atOffset=data.at[0]==="left"?data.targetWidth:data.at[0]==="right"?-data.targetWidth:0,offset=-2*data.offset[0],newOverRight,newOverLeft;if(overLeft<0){newOverRight=position.left+myOffset+atOffset+offset+data.collisionWidth-outerWidth-withinOffset;if(newOverRight<0||newOverRight<abs(overLeft)){position.left+=myOffset+atOffset+offset;}}else if(overRight>0){newOverLeft=position.left-data.collisionPosition.marginLeft+myOffset+atOffset+offset-offsetLeft;if(newOverLeft>0||abs(newOverLeft)<overRight){position.left+=myOffset+atOffset+offset;}}},top:function(position,data){var within=data.within,withinOffset=within.offset.top+within.scrollTop,outerHeight=within.height,offsetTop=within.isWindow?within.scrollTop:within.offset.top,collisionPosTop=position.top-data.collisionPosition.marginTop,overTop=collisionPosTop-offsetTop,overBottom=collisionPosTop+data.collisionHeight-outerHeight-offsetTop,top=data.my[1]==="top",myOffset=top?-data.elemHeight:data.my[1]==="bottom"?data.elemHeight:0,atOffset=data.at[1]==="top"?data.targetHeight:data.at[1]==="bottom"?-data.targetHeight:0,offset=-2*data.offset[1],newOverTop,newOverBottom;if(overTop<0){newOverBottom=position.top+myOffset+atOffset+offset+data.collisionHeight-outerHeight-withinOffset;if(newOverBottom<0||newOverBottom<abs(overTop)){position.top+=myOffset+atOffset+offset;}}else if(overBottom>0){newOverTop=position.top-data.collisionPosition.marginTop+myOffset+atOffset+offset-offsetTop;if(newOverTop>0||abs(newOverTop)<overBottom){position.top+=myOffset+atOffset+offset;}}}},flipfit:{left:function(){$.ui.position.flip.left.apply(this,arguments);$.ui.position.fit.left.apply(this,arguments);},top:function(){$.ui.position.flip.top.apply(this,arguments);$.ui.position.fit.top.apply(this,arguments);}}};(function(){var testElement,testElementParent,testElementStyle,offsetLeft,i,body=document.getElementsByTagName("body")[0],div=document.createElement("div");testElement=document.createElement(body?"div":"body");
vendor: 6,739 bytes, lines 149-175
149testElementStyle={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"};if(body){$.extend(testElementStyle,{position:"absolute",left:"-1000px",top:"-1000px"});} 150for(i in testElementStyle){testElement.style[i]=testElementStyle[i];} 151testElement.appendChild(div);testElementParent=body||document.documentElement;testElementParent.insertBefore(testElement,testElementParent.firstChild);div.style.cssText="position: absolute; left: 10.7432222px;";offsetLeft=$(div).offset().left;supportsOffsetFractions=offsetLeft>10&&offsetLeft<11;testElement.innerHTML="";testElementParent.removeChild(testElement);})();})();var position=$.ui.position;$.widget("ui.draggable",$.ui.mouse,{version:"1.11.3",widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false,drag:null,start:null,stop:null},_create:function(){if(this.options.helper==="original"){this._setPositionRelative();} 152if(this.options.addClasses){this.element.addClass("ui-draggable");} 153if(this.options.disabled){this.element.addClass("ui-draggable-disabled");} 154this._setHandleClassName();this._mouseInit();},_setOption:function(key,value){this._super(key,value);if(key==="handle"){this._removeHandleClassName();this._setHandleClassName();}},_destroy:function(){if((this.helper||this.element).is(".ui-draggable-dragging")){this.destroyOnClear=true;return;} 155this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._removeHandleClassName();this._mouseDestroy();},_mouseCapture:function(event){var o=this.options;this._blurActiveElement(event);if(this.helper||o.disabled||$(event.target).closest(".ui-resizable-handle").length>0){return false;} 156this.handle=this._getHandle(event);if(!this.handle){return false;} 157this._blockFrames(o.iframeFix===true?"iframe":o.iframeFix);return true;},_blockFrames:function(selector){this.iframeBlocks=this.document.find(selector).map(function(){var iframe=$(this);return $("<div>").css("position","absolute").appendTo(iframe.parent()).outerWidth(iframe.outerWidth()).outerHeight(iframe.outerHeight()).offset(iframe.offset())[0];});},_unblockFrames:function(){if(this.iframeBlocks){this.iframeBlocks.remove();delete this.iframeBlocks;}},_blurActiveElement:function(event){var document=this.document[0];if(!this.handleElement.is(event.target)){return;} 158try{if(document.activeElement&&document.activeElement.nodeName.toLowerCase()!=="body"){$(document.activeElement).blur();}}catch(error){}},_mouseStart:function(event){var o=this.options;this.helper=this._createHelper(event);this.helper.addClass("ui-draggable-dragging");this._cacheHelperProportions();if($.ui.ddmanager){$.ui.ddmanager.current=this;} 159this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent(true);this.offsetParent=this.helper.offsetParent();this.hasFixedAncestor=this.helper.parents().filter(function(){return $(this).css("position")==="fixed";}).length>0;this.positionAbs=this.element.offset();this._refreshOffsets(event);this.originalPosition=this.position=this._generatePosition(event,false);this.originalPageX=event.pageX;this.originalPageY=event.pageY;(o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt));this._setContainment();if(this._trigger("start",event)===false){this._clear();return false;} 160this._cacheHelperProportions();if($.ui.ddmanager&&!o.dropBehaviour){$.ui.ddmanager.prepareOffsets(this,event);} 161this._normalizeRightBottom();this._mouseDrag(event,true);if($.ui.ddmanager){$.ui.ddmanager.dragStart(this,event);} 162return true;},_refreshOffsets:function(event){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:false,parent:this._getParentOffset(),relative:this._getRelativeOffset()};this.offset.click={left:event.pageX-this.offset.left,top:event.pageY-this.offset.top};},_mouseDrag:function(event,noPropagation){if(this.hasFixedAncestor){this.offset.parent=this._getParentOffset();} 163this.position=this._generatePosition(event,true);this.positionAbs=this._convertPositionTo("absolute");if(!noPropagation){var ui=this._uiHash();if(this._trigger("drag",event,ui)===false){this._mouseUp({});return false;} 164this.position=ui.position;} 165this.helper[0].style.left=this.position.left+"px";this.helper[0].style.top=this.position.top+"px";if($.ui.ddmanager){$.ui.ddmanager.drag(this,event);} 166return false;},_mouseStop:function(event){var that=this,dropped=false;if($.ui.ddmanager&&!this.options.dropBehaviour){dropped=$.ui.ddmanager.drop(this,event);} 167if(this.dropped){dropped=this.dropped;this.dropped=false;} 168if((this.options.revert==="invalid"&&!dropped)||(this.options.revert==="valid"&&dropped)||this.options.revert===true||($.isFunction(this.options.revert)&&this.options.revert.call(this.element,dropped))){$(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){if(that._trigger("stop",event)!==false){that._clear();}});}else{if(this._trigger("stop",event)!==false){this._clear();}} 169return false;},_mouseUp:function(event){this._unblockFrames();if($.ui.ddmanager){$.ui.ddmanager.dragStop(this,event);} 170if(this.handleElement.is(event.target)){this.element.focus();} 171return $.ui.mouse.prototype._mouseUp.call(this,event);},cancel:function(){if(this.helper.is(".ui-draggable-dragging")){this._mouseUp({});}else{this._clear();} 172return this;},_getHandle:function(event){return this.options.handle?!!$(event.target).closest(this.element.find(this.options.handle)).length:true;},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element;this.handleElement.addClass("ui-draggable-handle");},_removeHandleClassName:function(){this.handleElement.removeClass("ui-draggable-handle");},_createHelper:function(event){var o=this.options,helperIsFunction=$.isFunction(o.helper),helper=helperIsFunction?$(o.helper.apply(this.element[0],[event])):(o.helper==="clone"?this.element.clone().removeAttr("id"):this.element);if(!helper.parents("body").length){helper.appendTo((o.appendTo==="parent"?this.element[0].parentNode:o.appendTo));} 173if(helperIsFunction&&helper[0]===this.element[0]){this._setPositionRelative();} 174if(helper[0]!==this.element[0]&&!(/(fixed|absolute)/).test(helper.css("position"))){helper.css("position","absolute");} 175return helper;},_setPositionRelative:function(){if(!(/^(?:r|a|f)/).test(this.element.css("position"))){this.element[0].style.position="relative";}}
vendor: 4,255 bytes, lines 175-206
175,_adjustOffsetFromHelper:function(obj){if(typeof obj==="string"){obj=obj.split(" ");} 176if($.isArray(obj)){obj={left:+obj[0],top:+obj[1]||0};} 177if("left"in obj){this.offset.click.left=obj.left+this.margins.left;} 178if("right"in obj){this.offset.click.left=this.helperProportions.width-obj.right+this.margins.left;} 179if("top"in obj){this.offset.click.top=obj.top+this.margins.top;} 180if("bottom"in obj){this.offset.click.top=this.helperProportions.height-obj.bottom+this.margins.top;}},_isRootNode:function(element){return(/(html|body)/i).test(element.tagName)||element===this.document[0];},_getParentOffset:function(){var po=this.offsetParent.offset(),document=this.document[0];if(this.cssPosition==="absolute"&&this.scrollParent[0]!==document&&$.contains(this.scrollParent[0],this.offsetParent[0])){po.left+=this.scrollParent.scrollLeft();po.top+=this.scrollParent.scrollTop();} 181if(this._isRootNode(this.offsetParent[0])){po={top:0,left:0};} 182return{top:po.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:po.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)};},_getRelativeOffset:function(){if(this.cssPosition!=="relative"){return{top:0,left:0};} 183var p=this.element.position(),scrollIsRootNode=this._isRootNode(this.scrollParent[0]);return{top:p.top-(parseInt(this.helper.css("top"),10)||0)+(!scrollIsRootNode?this.scrollParent.scrollTop():0),left:p.left-(parseInt(this.helper.css("left"),10)||0)+(!scrollIsRootNode?this.scrollParent.scrollLeft():0)};},_cacheMargins:function(){this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0),right:(parseInt(this.element.css("marginRight"),10)||0),bottom:(parseInt(this.element.css("marginBottom"),10)||0)};},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};},_setContainment:function(){var isUserScrollable,c,ce,o=this.options,document=this.document[0];this.relativeContainer=null;if(!o.containment){this.containment=null;return;} 184if(o.containment==="window"){this.containment=[$(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,$(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,$(window).scrollLeft()+$(window).width()-this.helperProportions.width-this.margins.left,$(window).scrollTop()+($(window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];return;} 185if(o.containment==="document"){this.containment=[0,0,$(document).width()-this.helperProportions.width-this.margins.left,($(document).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];return;} 186if(o.containment.constructor===Array){this.containment=o.containment;return;} 187if(o.containment==="parent"){o.containment=this.helper[0].parentNode;} 188c=$(o.containment);ce=c[0];if(!ce){return;} 189isUserScrollable=/(scroll|auto)/.test(c.css("overflow"));this.containment=[(parseInt(c.css("borderLeftWidth"),10)||0)+(parseInt(c.css("paddingLeft"),10)||0),(parseInt(c.css("borderTopWidth"),10)||0)+(parseInt(c.css("paddingTop"),10)||0),(isUserScrollable?Math.max(ce.scrollWidth,ce.offsetWidth):ce.offsetWidth)- 190(parseInt(c.css("borderRightWidth"),10)||0)- 191(parseInt(c.css("paddingRight"),10)||0)- 192this.helperProportions.width- 193this.margins.left- 194this.margins.right,(isUserScrollable?Math.max(ce.scrollHeight,ce.offsetHeight):ce.offsetHeight)- 195(parseInt(c.css("borderBottomWidth"),10)||0)- 196(parseInt(c.css("paddingBottom"),10)||0)- 197this.helperProportions.height- 198this.margins.top- 199this.margins.bottom];this.relativeContainer=c;},_convertPositionTo:function(d,pos){if(!pos){pos=this.position;} 200var mod=d==="absolute"?1:-1,scrollIsRootNode=this._isRootNode(this.scrollParent[0]);return{top:(pos.top+ 201this.offset.relative.top*mod+ 202this.offset.parent.top*mod- 203((this.cssPosition==="fixed"?-this.offset.scroll.top:(scrollIsRootNode?0:this.offset.scroll.top))*mod)),left:(pos.left+ 204this.offset.relative.left*mod+ 205this.offset.parent.left*mod- 206((this.cssPosition==="fixed"?-this.offset.scroll.left:(scrollIsRootNode?0:this.offset.scroll.left))*mod))};},_generatePosition:function(event,constrainPosition){var containment,co,top,left,o=this.options,scrollIsRootNode=this._isRo
vendor: 2,615 bytes, lines 206-225
206otNode(this.scrollParent[0]),pageX=event.pageX,pageY=event.pageY;if(!scrollIsRootNode||!this.offset.scroll){this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()};} 207if(constrainPosition){if(this.containment){if(this.relativeContainer){co=this.relativeContainer.offset();containment=[this.containment[0]+co.left,this.containment[1]+co.top,this.containment[2]+co.left,this.containment[3]+co.top];}else{containment=this.containment;} 208if(event.pageX-this.offset.click.left<containment[0]){pageX=containment[0]+this.offset.click.left;} 209if(event.pageY-this.offset.click.top<containment[1]){pageY=containment[1]+this.offset.click.top;} 210if(event.pageX-this.offset.click.left>containment[2]){pageX=containment[2]+this.offset.click.left;} 211if(event.pageY-this.offset.click.top>containment[3]){pageY=containment[3]+this.offset.click.top;}} 212if(o.grid){top=o.grid[1]?this.originalPageY+Math.round((pageY-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY;pageY=containment?((top-this.offset.click.top>=containment[1]||top-this.offset.click.top>containment[3])?top:((top-this.offset.click.top>=containment[1])?top-o.grid[1]:top+o.grid[1])):top;left=o.grid[0]?this.originalPageX+Math.round((pageX-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX;pageX=containment?((left-this.offset.click.left>=containment[0]||left-this.offset.click.left>containment[2])?left:((left-this.offset.click.left>=containment[0])?left-o.grid[0]:left+o.grid[0])):left;} 213if(o.axis==="y"){pageX=this.originalPageX;} 214if(o.axis==="x"){pageY=this.originalPageY;}} 215return{top:(pageY- 216this.offset.click.top- 217this.offset.relative.top- 218this.offset.parent.top+ 219(this.cssPosition==="fixed"?-this.offset.scroll.top:(scrollIsRootNode?0:this.offset.scroll.top))),left:(pageX- 220this.offset.click.left- 221this.offset.relative.left- 222this.offset.parent.left+ 223(this.cssPosition==="fixed"?-this.offset.scroll.left:(scrollIsRootNode?0:this.offset.scroll.left)))};},_clear:function(){this.helper.removeClass("ui-draggable-dragging");if(this.helper[0]!==this.element[0]&&!this.cancelHelperRemoval){this.helper.remove();} 224this.helper=null;this.cancelHelperRemoval=false;if(this.destroyOnClear){this.destroy();}},_normalizeRightBottom:function(){if(this.options.axis!=="y"&&this.helper.css("right")!=="auto"){this.helper.width(this.helper.width());this.helper.css("right","auto");} 225if(this.options.axis!=="x"&&this.helper.css("bottom")!=="auto"){this.helper.height(this.helper.height());this.helper.css("bottom","auto");}},_trigger:function(type,event,ui){ui=ui||this._uiHash();$.ui.plugin.call(this,type,[event,ui,this],true);
vendor: 4,493 bytes, lines 225-235
225if(/^(drag|start|stop)/.test(type)){this.positionAbs=this._convertPositionTo("absolute");ui.offset=this.positionAbs;} 226return $.Widget.prototype._trigger.call(this,type,event,ui);},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs};}});$.ui.plugin.add("draggable","connectToSortable",{start:function(event,ui,draggable){var uiSortable=$.extend({},ui,{item:draggable.element});draggable.sortables=[];$(draggable.options.connectToSortable).each(function(){var sortable=$(this).sortable("instance");if(sortable&&!sortable.options.disabled){draggable.sortables.push(sortable);sortable.refreshPositions();sortable._trigger("activate",event,uiSortable);}});},stop:function(event,ui,draggable){var uiSortable=$.extend({},ui,{item:draggable.element});draggable.cancelHelperRemoval=false;$.each(draggable.sortables,function(){var sortable=this;if(sortable.isOver){sortable.isOver=0;draggable.cancelHelperRemoval=true;sortable.cancelHelperRemoval=false;sortable._storedCSS={position:sortable.placeholder.css("position"),top:sortable.placeholder.css("top"),left:sortable.placeholder.css("left")};sortable._mouseStop(event);sortable.options.helper=sortable.options._helper;}else{sortable.cancelHelperRemoval=true;sortable._trigger("deactivate",event,uiSortable);}});},drag:function(event,ui,draggable){$.each(draggable.sortables,function(){var innermostIntersecting=false,sortable=this;sortable.positionAbs=draggable.positionAbs;sortable.helperProportions=draggable.helperProportions;sortable.offset.click=draggable.offset.click;if(sortable._intersectsWith(sortable.containerCache)){innermostIntersecting=true;$.each(draggable.sortables,function(){this.positionAbs=draggable.positionAbs;this.helperProportions=draggable.helperProportions;this.offset.click=draggable.offset.click;if(this!==sortable&&this._intersectsWith(this.containerCache)&&$.contains(sortable.element[0],this.element[0])){innermostIntersecting=false;} 227return innermostIntersecting;});} 228if(innermostIntersecting){if(!sortable.isOver){sortable.isOver=1;sortable.currentItem=ui.helper.appendTo(sortable.element).data("ui-sortable-item",true);sortable.options._helper=sortable.options.helper;sortable.options.helper=function(){return ui.helper[0];};event.target=sortable.currentItem[0];sortable._mouseCapture(event,true);sortable._mouseStart(event,true,true);sortable.offset.click.top=draggable.offset.click.top;sortable.offset.click.left=draggable.offset.click.left;sortable.offset.parent.left-=draggable.offset.parent.left- 229sortable.offset.parent.left;sortable.offset.parent.top-=draggable.offset.parent.top- 230sortable.offset.parent.top;draggable._trigger("toSortable",event);draggable.dropped=sortable.element;$.each(draggable.sortables,function(){this.refreshPositions();});draggable.currentItem=draggable.element;sortable.fromOutside=draggable;} 231if(sortable.currentItem){sortable._mouseDrag(event);ui.position=sortable.position;}}else{if(sortable.isOver){sortable.isOver=0;sortable.cancelHelperRemoval=true;sortable.options._revert=sortable.options.revert;sortable.options.revert=false;sortable._trigger("out",event,sortable._uiHash(sortable));sortable._mouseStop(event,true);sortable.options.revert=sortable.options._revert;sortable.options.helper=sortable.options._helper;if(sortable.placeholder){sortable.placeholder.remove();} 232draggable._refreshOffsets(event);ui.position=draggable._generatePosition(event,true);draggable._trigger("fromSortable",event);draggable.dropped=false;$.each(draggable.sortables,function(){this.refreshPositions();});}}});}});$.ui.plugin.add("draggable","cursor",{start:function(event,ui,instance){var t=$("body"),o=instance.options;if(t.css("cursor")){o._cursor=t.css("cursor");} 233t.css("cursor",o.cursor);},stop:function(event,ui,instance){var o=instance.options;if(o._cursor){$("body").css("cursor",o._cursor);}}});$.ui.plugin.add("draggable","opacity",{start:function(event,ui,instance){var t=$(ui.helper),o=instance.options;if(t.css("opacity")){o._opacity=t.css("opacity");} 234t.css("opacity",o.opacity);},stop:function(event,ui,instance){var o=instance.options;if(o._opacity){$(ui.helper).css("opacity",o._opacity);}}});$.ui.plugin.add("draggable","scroll",{start:function(event,ui,i){if(!i.scrollParentNotHidden){i.scrollParentNotHidden=i.helper.scrollParent(false);} 235if(i.scrollParentNotHidden[0]!==i.document[0]&&i.scrollParentNotHidden[0].tagName!=="HTML"){i.overflowOffset=i.scrollParentNotHidden.offset();}}
vendor: 10,207 bytes, lines 235-269
235,drag:function(event,ui,i){var o=i.options,scrolled=false,scrollParent=i.scrollParentNotHidden[0],document=i.document[0];if(scrollParent!==document&&scrollParent.tagName!=="HTML"){if(!o.axis||o.axis!=="x"){if((i.overflowOffset.top+scrollParent.offsetHeight)-event.pageY<o.scrollSensitivity){scrollParent.scrollTop=scrolled=scrollParent.scrollTop+o.scrollSpeed;}else if(event.pageY-i.overflowOffset.top<o.scrollSensitivity){scrollParent.scrollTop=scrolled=scrollParent.scrollTop-o.scrollSpeed;}} 236if(!o.axis||o.axis!=="y"){if((i.overflowOffset.left+scrollParent.offsetWidth)-event.pageX<o.scrollSensitivity){scrollParent.scrollLeft=scrolled=scrollParent.scrollLeft+o.scrollSpeed;}else if(event.pageX-i.overflowOffset.left<o.scrollSensitivity){scrollParent.scrollLeft=scrolled=scrollParent.scrollLeft-o.scrollSpeed;}}}else{if(!o.axis||o.axis!=="x"){if(event.pageY-$(document).scrollTop()<o.scrollSensitivity){scrolled=$(document).scrollTop($(document).scrollTop()-o.scrollSpeed);}else if($(window).height()-(event.pageY-$(document).scrollTop())<o.scrollSensitivity){scrolled=$(document).scrollTop($(document).scrollTop()+o.scrollSpeed);}} 237if(!o.axis||o.axis!=="y"){if(event.pageX-$(document).scrollLeft()<o.scrollSensitivity){scrolled=$(document).scrollLeft($(document).scrollLeft()-o.scrollSpeed);}else if($(window).width()-(event.pageX-$(document).scrollLeft())<o.scrollSensitivity){scrolled=$(document).scrollLeft($(document).scrollLeft()+o.scrollSpeed);}}} 238if(scrolled!==false&&$.ui.ddmanager&&!o.dropBehaviour){$.ui.ddmanager.prepareOffsets(i,event);}}});$.ui.plugin.add("draggable","snap",{start:function(event,ui,i){var o=i.options;i.snapElements=[];$(o.snap.constructor!==String?(o.snap.items||":data(ui-draggable)"):o.snap).each(function(){var $t=$(this),$o=$t.offset();if(this!==i.element[0]){i.snapElements.push({item:this,width:$t.outerWidth(),height:$t.outerHeight(),top:$o.top,left:$o.left});}});},drag:function(event,ui,inst){var ts,bs,ls,rs,l,r,t,b,i,first,o=inst.options,d=o.snapTolerance,x1=ui.offset.left,x2=x1+inst.helperProportions.width,y1=ui.offset.top,y2=y1+inst.helperProportions.height;for(i=inst.snapElements.length-1;i>=0;i--){l=inst.snapElements[i].left-inst.margins.left;r=l+inst.snapElements[i].width;t=inst.snapElements[i].top-inst.margins.top;b=t+inst.snapElements[i].height;if(x2<l-d||x1>r+d||y2<t-d||y1>b+d||!$.contains(inst.snapElements[i].item.ownerDocument,inst.snapElements[i].item)){if(inst.snapElements[i].snapping){(inst.options.snap.release&&inst.options.snap.release.call(inst.element,event,$.extend(inst._uiHash(),{snapItem:inst.snapElements[i].item})));} 239inst.snapElements[i].snapping=false;continue;} 240if(o.snapMode!=="inner"){ts=Math.abs(t-y2)<=d;bs=Math.abs(b-y1)<=d;ls=Math.abs(l-x2)<=d;rs=Math.abs(r-x1)<=d;if(ts){ui.position.top=inst._convertPositionTo("relative",{top:t-inst.helperProportions.height,left:0}).top;} 241if(bs){ui.position.top=inst._convertPositionTo("relative",{top:b,left:0}).top;} 242if(ls){ui.position.left=inst._convertPositionTo("relative",{top:0,left:l-inst.helperProportions.width}).left;} 243if(rs){ui.position.left=inst._convertPositionTo("relative",{top:0,left:r}).left;}} 244first=(ts||bs||ls||rs);if(o.snapMode!=="outer"){ts=Math.abs(t-y1)<=d;bs=Math.abs(b-y2)<=d;ls=Math.abs(l-x1)<=d;rs=Math.abs(r-x2)<=d;if(ts){ui.position.top=inst._convertPositionTo("relative",{top:t,left:0}).top;} 245if(bs){ui.position.top=inst._convertPositionTo("relative",{top:b-inst.helperProportions.height,left:0}).top;} 246if(ls){ui.position.left=inst._convertPositionTo("relative",{top:0,left:l}).left;} 247if(rs){ui.position.left=inst._convertPositionTo("relative",{top:0,left:r-inst.helperProportions.width}).left;}} 248if(!inst.snapElements[i].snapping&&(ts||bs||ls||rs||first)){(inst.options.snap.snap&&inst.options.snap.snap.call(inst.element,event,$.extend(inst._uiHash(),{snapItem:inst.snapElements[i].item})));} 249inst.snapElements[i].snapping=(ts||bs||ls||rs||first);}}});$.ui.plugin.add("draggable","stack",{start:function(event,ui,instance){var min,o=instance.options,group=$.makeArray($(o.stack)).sort(function(a,b){return(parseInt($(a).css("zIndex"),10)||0)-(parseInt($(b).css("zIndex"),10)||0);});if(!group.length){return;} 250min=parseInt($(group[0]).css("zIndex"),10)||0;$(group).each(function(i){$(this).css("zIndex",min+i);});this.css("zIndex",(min+group.length));}});$.ui.plugin.add("draggable","zIndex",{start:function(event,ui,instance){var t=$(ui.helper),o=instance.options;if(t.css("zIndex")){o._zIndex=t.css("zIndex");} 251t.css("zIndex",o.zIndex);},stop:function(event,ui,instance){var o=instance.options;if(o._zIndex){$(ui.helper).css("zIndex",o._zIndex);}}});var draggable=$.ui.draggable;$.widget("ui.droppable",{version:"1.11.3",widgetEventPrefix:"drop",options:{accept:"*",activeClass:false,addClasses:true,greedy:false,hoverClass:false,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var proportions,o=this.options,accept=o.accept;this.isover=false;this.isout=true;this.accept=$.isFunction(accept)?accept:function(d){return d.is(accept);};this.proportions=function(){if(arguments.length){proportions=arguments[0];}else{return proportions?proportions:proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};}};this._addToManager(o.scope);o.addClasses&&this.element.addClass("ui-droppable");},_addToManager:function(scope){$.ui.ddmanager.droppables[scope]=$.ui.ddmanager.droppables[scope]||[];$.ui.ddmanager.droppables[scope].push(this);},_splice:function(drop){var i=0;for(;i<drop.length;i++){if(drop[i]===this){drop.splice(i,1);}}},_destroy:function(){var drop=$.ui.ddmanager.droppables[this.options.scope];this._splice(drop);this.element.removeClass("ui-droppable ui-droppable-disabled");},_setOption:function(key,value){if(key==="accept"){this.accept=$.isFunction(value)?value:function(d){return d.is(value);};}else if(key==="scope"){var drop=$.ui.ddmanager.droppables[this.options.scope];this._splice(drop);this._addToManager(value);} 252this._super(key,value);},_activate:function(event){var draggable=$.ui.ddmanager.current;if(this.options.activeClass){this.element.addClass(this.options.activeClass);} 253if(draggable){this._trigger("activate",event,this.ui(draggable));}},_deactivate:function(event){var draggable=$.ui.ddmanager.current;if(this.options.activeClass){this.element.removeClass(this.options.activeClass);} 254if(draggable){this._trigger("deactivate",event,this.ui(draggable));}},_over:function(event){var draggable=$.ui.ddmanager.current;if(!draggable||(draggable.currentItem||draggable.element)[0]===this.element[0]){return;} 255if(this.accept.call(this.element[0],(draggable.currentItem||draggable.element))){if(this.options.hoverClass){this.element.addClass(this.options.hoverClass);} 256this._trigger("over",event,this.ui(draggable));}},_out:function(event){var draggable=$.ui.ddmanager.current;if(!draggable||(draggable.currentItem||draggable.element)[0]===this.element[0]){return;} 257if(this.accept.call(this.element[0],(draggable.currentItem||draggable.element))){if(this.options.hoverClass){this.element.removeClass(this.options.hoverClass);} 258this._trigger("out",event,this.ui(draggable));}},_drop:function(event,custom){var draggable=custom||$.ui.ddmanager.current,childrenIntersection=false;if(!draggable||(draggable.currentItem||draggable.element)[0]===this.element[0]){return false;} 259this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var inst=$(this).droppable("instance");if(inst.options.greedy&&!inst.options.disabled&&inst.options.scope===draggable.options.scope&&inst.accept.call(inst.element[0],(draggable.currentItem||draggable.element))&&$.ui.intersect(draggable,$.extend(inst,{offset:inst.element.offset()}),inst.options.tolerance,event)){childrenIntersection=true;return false;}});if(childrenIntersection){return false;} 260if(this.accept.call(this.element[0],(draggable.currentItem||draggable.element))){if(this.options.activeClass){this.element.removeClass(this.options.activeClass);} 261if(this.options.hoverClass){this.element.removeClass(this.options.hoverClass);} 262this._trigger("drop",event,this.ui(draggable));return this.element;} 263return false;},ui:function(c){return{draggable:(c.currentItem||c.element),helper:c.helper,position:c.position,offset:c.positionAbs};}});$.ui.intersect=(function(){function isOverAxis(x,reference,size){return(x>=reference)&&(x<(reference+size));} 264return function(draggable,droppable,toleranceMode,event){if(!droppable.offset){return false;} 265var x1=(draggable.positionAbs||draggable.position.absolute).left+draggable.margins.left,y1=(draggable.positionAbs||draggable.position.absolute).top+draggable.margins.top,x2=x1+draggable.helperProportions.width,y2=y1+draggable.helperProportions.height,l=droppable.offset.left,t=droppable.offset.top,r=l+droppable.proportions().width,b=t+droppable.proportions().height;switch(toleranceMode){case"fit":return(l<=x1&&x2<=r&&t<=y1&&y2<=b);case"intersect":return(l<x1+(draggable.helperProportions.width/2)&&x2-(draggable.helperProportions.width/2)<r&&t<y1+(draggable.helperProportions.height/2)&&y2-(draggable.helperProportions.height/2)<b);case"pointer":return isOverAxis(event.pageY,t,droppable.proportions().height)&&isOverAxis(event.pageX,l,droppable.proportions().width);case"touch":return((y1>=t&&y1<=b)||(y2>=t&&y2<=b)||(y1<t&&y2>b))&&((x1>=l&&x1<=r)||(x2>=l&&x2<=r)||(x1<l&&x2>r));default:return false;}};})();$.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,event){var i,j,m=$.ui.ddmanager.droppables[t.options.scope]||[],type=event?event.type:null,list=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();droppablesLoop:for(i=0;i<m.length;i++){if(m[i].options.disabled||(t&&!m[i].accept.call(m[i].element[0],(t.currentItem||t.element)))){continue;} 266for(j=0;j<list.length;j++){if(list[j]===m[i].element[0]){m[i].proportions().height=0;continue droppablesLoop;}} 267m[i].visible=m[i].element.css("display")!=="none";if(!m[i].visible){continue;} 268if(type==="mousedown"){m[i]._activate.call(m[i],event);} 269m[i].offset=m[i].element.offset();m[i].proportions({width:m[i].element[0].offsetWidth,height:m[i].element[0].offsetHeight});}},drop:function(draggable,event){var dropped=false;
vendor: 32,657 bytes, lines 269-371
269$.each(($.ui.ddmanager.droppables[draggable.options.scope]||[]).slice(),function(){if(!this.options){return;} 270if(!this.options.disabled&&this.visible&&$.ui.intersect(draggable,this,this.options.tolerance,event)){dropped=this._drop.call(this,event)||dropped;} 271if(!this.options.disabled&&this.visible&&this.accept.call(this.element[0],(draggable.currentItem||draggable.element))){this.isout=true;this.isover=false;this._deactivate.call(this,event);}});return dropped;},dragStart:function(draggable,event){draggable.element.parentsUntil("body").bind("scroll.droppable",function(){if(!draggable.options.refreshPositions){$.ui.ddmanager.prepareOffsets(draggable,event);}});},drag:function(draggable,event){if(draggable.options.refreshPositions){$.ui.ddmanager.prepareOffsets(draggable,event);} 272$.each($.ui.ddmanager.droppables[draggable.options.scope]||[],function(){if(this.options.disabled||this.greedyChild||!this.visible){return;} 273var parentInstance,scope,parent,intersects=$.ui.intersect(draggable,this,this.options.tolerance,event),c=!intersects&&this.isover?"isout":(intersects&&!this.isover?"isover":null);if(!c){return;} 274if(this.options.greedy){scope=this.options.scope;parent=this.element.parents(":data(ui-droppable)").filter(function(){return $(this).droppable("instance").options.scope===scope;});if(parent.length){parentInstance=$(parent[0]).droppable("instance");parentInstance.greedyChild=(c==="isover");}} 275if(parentInstance&&c==="isover"){parentInstance.isover=false;parentInstance.isout=true;parentInstance._out.call(parentInstance,event);} 276this[c]=true;this[c==="isout"?"isover":"isout"]=false;this[c==="isover"?"_over":"_out"].call(this,event);if(parentInstance&&c==="isout"){parentInstance.isout=false;parentInstance.isover=true;parentInstance._over.call(parentInstance,event);}});},dragStop:function(draggable,event){draggable.element.parentsUntil("body").unbind("scroll.droppable");if(!draggable.options.refreshPositions){$.ui.ddmanager.prepareOffsets(draggable,event);}}};var droppable=$.ui.droppable;$.widget("ui.resizable",$.ui.mouse,{version:"1.11.3",widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(value){return parseInt(value,10)||0;},_isNumber:function(value){return!isNaN(parseInt(value,10));},_hasScroll:function(el,a){if($(el).css("overflow")==="hidden"){return false;} 277var scroll=(a&&a==="left")?"scrollLeft":"scrollTop",has=false;if(el[scroll]>0){return true;} 278el[scroll]=1;has=(el[scroll]>0);el[scroll]=0;return has;},_create:function(){var n,i,handle,axis,hname,that=this,o=this.options;this.element.addClass("ui-resizable");$.extend(this,{_aspectRatio:!!(o.aspectRatio),aspectRatio:o.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:o.helper||o.ghost||o.animate?o.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)){this.element.wrap($("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize();} 279this.handles=o.handles||(!$(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});if(this.handles.constructor===String){if(this.handles==="all"){this.handles="n,e,s,w,se,sw,ne,nw";} 280n=this.handles.split(",");this.handles={};for(i=0;i<n.length;i++){handle=$.trim(n[i]);hname="ui-resizable-"+handle;axis=$("<div class='ui-resizable-handle "+hname+"'></div>");axis.css({zIndex:o.zIndex});if("se"===handle){axis.addClass("ui-icon ui-icon-gripsmall-diagonal-se");} 281this.handles[handle]=".ui-resizable-"+handle;this.element.append(axis);}} 282this._renderAxis=function(target){var i,axis,padPos,padWrapper;target=target||this.element;for(i in this.handles){if(this.handles[i].constructor===String){this.handles[i]=this.element.children(this.handles[i]).first().show();} 283if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)){axis=$(this.handles[i],this.element);padWrapper=/sw|ne|nw|se|n|s/.test(i)?axis.outerHeight():axis.outerWidth();padPos=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join("");target.css(padPos,padWrapper);this._proportionallyResize();} 284if(!$(this.handles[i]).length){continue;}}};this._renderAxis(this.element);this._handles=$(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!that.resizing){if(this.className){axis=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);} 285that.axis=axis&&axis[1]?axis[1]:"se";}});if(o.autoHide){this._handles.hide();$(this.element).addClass("ui-resizable-autohide").mouseenter(function(){if(o.disabled){return;} 286$(this).removeClass("ui-resizable-autohide");that._handles.show();}).mouseleave(function(){if(o.disabled){return;} 287if(!that.resizing){$(this).addClass("ui-resizable-autohide");that._handles.hide();}});} 288this._mouseInit();},_destroy:function(){this._mouseDestroy();var wrapper,_destroy=function(exp){$(exp).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove();};if(this.elementIsWrapper){_destroy(this.element);wrapper=this.element;this.originalElement.css({position:wrapper.css("position"),width:wrapper.outerWidth(),height:wrapper.outerHeight(),top:wrapper.css("top"),left:wrapper.css("left")}).insertAfter(wrapper);wrapper.remove();} 289this.originalElement.css("resize",this.originalResizeStyle);_destroy(this.originalElement);return this;},_mouseCapture:function(event){var i,handle,capture=false;for(i in this.handles){handle=$(this.handles[i])[0];if(handle===event.target||$.contains(handle,event.target)){capture=true;}} 290return!this.options.disabled&&capture;},_mouseStart:function(event){var curleft,curtop,cursor,o=this.options,el=this.element;this.resizing=true;this._renderProxy();curleft=this._num(this.helper.css("left"));curtop=this._num(this.helper.css("top"));if(o.containment){curleft+=$(o.containment).scrollLeft()||0;curtop+=$(o.containment).scrollTop()||0;} 291this.offset=this.helper.offset();this.position={left:curleft,top:curtop};this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:el.width(),height:el.height()};this.originalSize=this._helper?{width:el.outerWidth(),height:el.outerHeight()}:{width:el.width(),height:el.height()};this.sizeDiff={width:el.outerWidth()-el.width(),height:el.outerHeight()-el.height()};this.originalPosition={left:curleft,top:curtop};this.originalMousePosition={left:event.pageX,top:event.pageY};this.aspectRatio=(typeof o.aspectRatio==="number")?o.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);cursor=$(".ui-resizable-"+this.axis).css("cursor");$("body").css("cursor",cursor==="auto"?this.axis+"-resize":cursor);el.addClass("ui-resizable-resizing");this._propagate("start",event);return true;},_mouseDrag:function(event){var data,props,smp=this.originalMousePosition,a=this.axis,dx=(event.pageX-smp.left)||0,dy=(event.pageY-smp.top)||0,trigger=this._change[a];this._updatePrevProperties();if(!trigger){return false;} 292data=trigger.apply(this,[event,dx,dy]);this._updateVirtualBoundaries(event.shiftKey);if(this._aspectRatio||event.shiftKey){data=this._updateRatio(data,event);} 293data=this._respectSize(data,event);this._updateCache(data);this._propagate("resize",event);props=this._applyChanges();if(!this._helper&&this._proportionallyResizeElements.length){this._proportionallyResize();} 294if(!$.isEmptyObject(props)){this._updatePrevProperties();this._trigger("resize",event,this.ui());this._applyChanges();} 295return false;},_mouseStop:function(event){this.resizing=false;var pr,ista,soffseth,soffsetw,s,left,top,o=this.options,that=this;if(this._helper){pr=this._proportionallyResizeElements;ista=pr.length&&(/textarea/i).test(pr[0].nodeName);soffseth=ista&&this._hasScroll(pr[0],"left")?0:that.sizeDiff.height;soffsetw=ista?0:that.sizeDiff.width;s={width:(that.helper.width()-soffsetw),height:(that.helper.height()-soffseth)};left=(parseInt(that.element.css("left"),10)+ 296(that.position.left-that.originalPosition.left))||null;top=(parseInt(that.element.css("top"),10)+ 297(that.position.top-that.originalPosition.top))||null;if(!o.animate){this.element.css($.extend(s,{top:top,left:left}));} 298that.helper.height(that.size.height);that.helper.width(that.size.width);if(this._helper&&!o.animate){this._proportionallyResize();}} 299$("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",event);if(this._helper){this.helper.remove();} 300return false;},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left};this.prevSize={width:this.size.width,height:this.size.height};},_applyChanges:function(){var props={};if(this.position.top!==this.prevPosition.top){props.top=this.position.top+"px";} 301if(this.position.left!==this.prevPosition.left){props.left=this.position.left+"px";} 302if(this.size.width!==this.prevSize.width){props.width=this.size.width+"px";} 303if(this.size.height!==this.prevSize.height){props.height=this.size.height+"px";} 304this.helper.css(props);return props;},_updateVirtualBoundaries:function(forceAspectRatio){var pMinWidth,pMaxWidth,pMinHeight,pMaxHeight,b,o=this.options;b={minWidth:this._isNumber(o.minWidth)?o.minWidth:0,maxWidth:this._isNumber(o.maxWidth)?o.maxWidth:Infinity,minHeight:this._isNumber(o.minHeight)?o.minHeight:0,maxHeight:this._isNumber(o.maxHeight)?o.maxHeight:Infinity};if(this._aspectRatio||forceAspectRatio){pMinWidth=b.minHeight*this.aspectRatio;pMinHeight=b.minWidth/this.aspectRatio;pMaxWidth=b.maxHeight*this.aspectRatio;pMaxHeight=b.maxWidth/this.aspectRatio;if(pMinWidth>b.minWidth){b.minWidth=pMinWidth;} 305if(pMinHeight>b.minHeight){b.minHeight=pMinHeight;} 306if(pMaxWidth<b.maxWidth){b.maxWidth=pMaxWidth;} 307if(pMaxHeight<b.maxHeight){b.maxHeight=pMaxHeight;}} 308this._vBoundaries=b;},_updateCache:function(data){this.offset=this.helper.offset();if(this._isNumber(data.left)){this.position.left=data.left;} 309if(this._isNumber(data.top)){this.position.top=data.top;} 310if(this._isNumber(data.height)){this.size.height=data.height;} 311if(this._isNumber(data.width)){this.size.width=data.width;}},_updateRatio:function(data){var cpos=this.position,csize=this.size,a=this.axis;if(this._isNumber(data.height)){data.width=(data.height*this.aspectRatio);}else if(this._isNumber(data.width)){data.height=(data.width/this.aspectRatio);} 312if(a==="sw"){data.left=cpos.left+(csize.width-data.width);data.top=null;} 313if(a==="nw"){data.top=cpos.top+(csize.height-data.height);data.left=cpos.left+(csize.width-data.width);} 314return data;},_respectSize:function(data){var o=this._vBoundaries,a=this.axis,ismaxw=this._isNumber(data.width)&&o.maxWidth&&(o.maxWidth<data.width),ismaxh=this._isNumber(data.height)&&o.maxHeight&&(o.maxHeight<data.height),isminw=this._isNumber(data.width)&&o.minWidth&&(o.minWidth>data.width),isminh=this._isNumber(data.height)&&o.minHeight&&(o.minHeight>data.height),dw=this.originalPosition.left+this.originalSize.width,dh=this.position.top+this.size.height,cw=/sw|nw|w/.test(a),ch=/nw|ne|n/.test(a);if(isminw){data.width=o.minWidth;} 315if(isminh){data.height=o.minHeight;} 316if(ismaxw){data.width=o.maxWidth;} 317if(ismaxh){data.height=o.maxHeight;} 318if(isminw&&cw){data.left=dw-o.minWidth;} 319if(ismaxw&&cw){data.left=dw-o.maxWidth;} 320if(isminh&&ch){data.top=dh-o.minHeight;} 321if(ismaxh&&ch){data.top=dh-o.maxHeight;} 322if(!data.width&&!data.height&&!data.left&&data.top){data.top=null;}else if(!data.width&&!data.height&&!data.top&&data.left){data.left=null;} 323return data;},_getPaddingPlusBorderDimensions:function(element){var i=0,widths=[],borders=[element.css("borderTopWidth"),element.css("borderRightWidth"),element.css("borderBottomWidth"),element.css("borderLeftWidth")],paddings=[element.css("paddingTop"),element.css("paddingRight"),element.css("paddingBottom"),element.css("paddingLeft")];for(;i<4;i++){widths[i]=(parseInt(borders[i],10)||0);widths[i]+=(parseInt(paddings[i],10)||0);} 324return{height:widths[0]+widths[2],width:widths[1]+widths[3]};},_proportionallyResize:function(){if(!this._proportionallyResizeElements.length){return;} 325var prel,i=0,element=this.helper||this.element;for(;i<this._proportionallyResizeElements.length;i++){prel=this._proportionallyResizeElements[i];if(!this.outerDimensions){this.outerDimensions=this._getPaddingPlusBorderDimensions(prel);} 326prel.css({height:(element.height()-this.outerDimensions.height)||0,width:(element.width()-this.outerDimensions.width)||0});}},_renderProxy:function(){var el=this.element,o=this.options;this.elementOffset=el.offset();if(this._helper){this.helper=this.helper||$("<div style='overflow:hidden;'></div>");this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++o.zIndex});this.helper.appendTo("body").disableSelection();}else{this.helper=this.element;}},_change:{e:function(event,dx){return{width:this.originalSize.width+dx};},w:function(event,dx){var cs=this.originalSize,sp=this.originalPosition;return{left:sp.left+dx,width:cs.width-dx};},n:function(event,dx,dy){var cs=this.originalSize,sp=this.originalPosition;return{top:sp.top+dy,height:cs.height-dy};},s:function(event,dx,dy){return{height:this.originalSize.height+dy};},se:function(event,dx,dy){return $.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[event,dx,dy]));},sw:function(event,dx,dy){return $.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[event,dx,dy]));},ne:function(event,dx,dy){return $.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[event,dx,dy]));},nw:function(event,dx,dy){return $.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[event,dx,dy]));}},_propagate:function(n,event){$.ui.plugin.call(this,n,[event,this.ui()]);(n!=="resize"&&this._trigger(n,event,this.ui()));},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition};}});$.ui.plugin.add("resizable","animate",{stop:function(event){var that=$(this).resizable("instance"),o=that.options,pr=that._proportionallyResizeElements,ista=pr.length&&(/textarea/i).test(pr[0].nodeName),soffseth=ista&&that._hasScroll(pr[0],"left")?0:that.sizeDiff.height,soffsetw=ista?0:that.sizeDiff.width,style={width:(that.size.width-soffsetw),height:(that.size.height-soffseth)},left=(parseInt(that.element.css("left"),10)+ 327(that.position.left-that.originalPosition.left))||null,top=(parseInt(that.element.css("top"),10)+ 328(that.position.top-that.originalPosition.top))||null;that.element.animate($.extend(style,top&&left?{top:top,left:left}:{}),{duration:o.animateDuration,easing:o.animateEasing,step:function(){var data={width:parseInt(that.element.css("width"),10),height:parseInt(that.element.css("height"),10),top:parseInt(that.element.css("top"),10),left:parseInt(that.element.css("left"),10)};if(pr&&pr.length){$(pr[0]).css({width:data.width,height:data.height});} 329that._updateCache(data);that._propagate("resize",event);}});}});$.ui.plugin.add("resizable","containment",{start:function(){var element,p,co,ch,cw,width,height,that=$(this).resizable("instance"),o=that.options,el=that.element,oc=o.containment,ce=(oc instanceof $)?oc.get(0):(/parent/.test(oc))?el.parent().get(0):oc;if(!ce){return;} 330that.containerElement=$(ce);if(/document/.test(oc)||oc===document){that.containerOffset={left:0,top:0};that.containerPosition={left:0,top:0};that.parentData={element:$(document),left:0,top:0,width:$(document).width(),height:$(document).height()||document.body.parentNode.scrollHeight};}else{element=$(ce);p=[];$(["Top","Right","Left","Bottom"]).each(function(i,name){p[i]=that._num(element.css("padding"+name));});that.containerOffset=element.offset();that.containerPosition=element.position();that.containerSize={height:(element.innerHeight()-p[3]),width:(element.innerWidth()-p[1])};co=that.containerOffset;ch=that.containerSize.height;cw=that.containerSize.width;width=(that._hasScroll(ce,"left")?ce.scrollWidth:cw);height=(that._hasScroll(ce)?ce.scrollHeight:ch);that.parentData={element:ce,left:co.left,top:co.top,width:width,height:height};}},resize:function(event){var woset,hoset,isParent,isOffsetRelative,that=$(this).resizable("instance"),o=that.options,co=that.containerOffset,cp=that.position,pRatio=that._aspectRatio||event.shiftKey,cop={top:0,left:0},ce=that.containerElement,continueResize=true;if(ce[0]!==document&&(/static/).test(ce.css("position"))){cop=co;} 331if(cp.left<(that._helper?co.left:0)){that.size.width=that.size.width+ 332(that._helper?(that.position.left-co.left):(that.position.left-cop.left));if(pRatio){that.size.height=that.size.width/that.aspectRatio;continueResize=false;} 333that.position.left=o.helper?co.left:0;} 334if(cp.top<(that._helper?co.top:0)){that.size.height=that.size.height+ 335(that._helper?(that.position.top-co.top):that.position.top);if(pRatio){that.size.width=that.size.height*that.aspectRatio;continueResize=false;} 336that.position.top=that._helper?co.top:0;} 337isParent=that.containerElement.get(0)===that.element.parent().get(0);isOffsetRelative=/relative|absolute/.test(that.containerElement.css("position"));if(isParent&&isOffsetRelative){that.offset.left=that.parentData.left+that.position.left;that.offset.top=that.parentData.top+that.position.top;}else{that.offset.left=that.element.offset().left;that.offset.top=that.element.offset().top;} 338woset=Math.abs(that.sizeDiff.width+ 339(that._helper?that.offset.left-cop.left:(that.offset.left-co.left)));hoset=Math.abs(that.sizeDiff.height+ 340(that._helper?that.offset.top-cop.top:(that.offset.top-co.top)));if(woset+that.size.width>=that.parentData.width){that.size.width=that.parentData.width-woset;if(pRatio){that.size.height=that.size.width/that.aspectRatio;continueResize=false;}} 341if(hoset+that.size.height>=that.parentData.height){that.size.height=that.parentData.height-hoset;if(pRatio){that.size.width=that.size.height*that.aspectRatio;continueResize=false;}} 342if(!continueResize){that.position.left=that.prevPosition.left;that.position.top=that.prevPosition.top;that.size.width=that.prevSize.width;that.size.height=that.prevSize.height;}},stop:function(){var that=$(this).resizable("instance"),o=that.options,co=that.containerOffset,cop=that.containerPosition,ce=that.containerElement,helper=$(that.helper),ho=helper.offset(),w=helper.outerWidth()-that.sizeDiff.width,h=helper.outerHeight()-that.sizeDiff.height;if(that._helper&&!o.animate&&(/relative/).test(ce.css("position"))){$(this).css({left:ho.left-cop.left-co.left,width:w,height:h});} 343if(that._helper&&!o.animate&&(/static/).test(ce.css("position"))){$(this).css({left:ho.left-cop.left-co.left,width:w,height:h});}}});$.ui.plugin.add("resizable","alsoResize",{start:function(){var that=$(this).resizable("instance"),o=that.options,_store=function(exp){$(exp).each(function(){var el=$(this);el.data("ui-resizable-alsoresize",{width:parseInt(el.width(),10),height:parseInt(el.height(),10),left:parseInt(el.css("left"),10),top:parseInt(el.css("top"),10)});});};if(typeof(o.alsoResize)==="object"&&!o.alsoResize.parentNode){if(o.alsoResize.length){o.alsoResize=o.alsoResize[0];_store(o.alsoResize);}else{$.each(o.alsoResize,function(exp){_store(exp);});}}else{_store(o.alsoResize);}},resize:function(event,ui){var that=$(this).resizable("instance"),o=that.options,os=that.originalSize,op=that.originalPosition,delta={height:(that.size.height-os.height)||0,width:(that.size.width-os.width)||0,top:(that.position.top-op.top)||0,left:(that.position.left-op.left)||0},_alsoResize=function(exp,c){$(exp).each(function(){var el=$(this),start=$(this).data("ui-resizable-alsoresize"),style={},css=c&&c.length?c:el.parents(ui.originalElement[0]).length?["width","height"]:["width","height","top","left"];$.each(css,function(i,prop){var sum=(start[prop]||0)+(delta[prop]||0);if(sum&&sum>=0){style[prop]=sum||null;}});el.css(style);});};if(typeof(o.alsoResize)==="object"&&!o.alsoResize.nodeType){$.each(o.alsoResize,function(exp,c){_alsoResize(exp,c);});}else{_alsoResize(o.alsoResize);}},stop:function(){$(this).removeData("resizable-alsoresize");}});$.ui.plugin.add("resizable","ghost",{start:function(){var that=$(this).resizable("instance"),o=that.options,cs=that.size;that.ghost=that.originalElement.clone();that.ghost.css({opacity:0.25,display:"block",position:"relative",height:cs.height,width:cs.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof o.ghost==="string"?o.ghost:"");that.ghost.appendTo(that.helper);},resize:function(){var that=$(this).resizable("instance");if(that.ghost){that.ghost.css({position:"relative",height:that.size.height,width:that.size.width});}},stop:function(){var that=$(this).resizable("instance");if(that.ghost&&that.helper){that.helper.get(0).removeChild(that.ghost.get(0));}}});$.ui.plugin.add("resizable","grid",{resize:function(){var outerDimensions,that=$(this).resizable("instance"),o=that.options,cs=that.size,os=that.originalSize,op=that.originalPosition,a=that.axis,grid=typeof o.grid==="number"?[o.grid,o.grid]:o.grid,gridX=(grid[0]||1),gridY=(grid[1]||1),ox=Math.round((cs.width-os.width)/gridX)*gridX,oy=Math.round((cs.height-os.height)/gridY)*gridY,newWidth=os.width+ox,newHeight=os.height+oy,isMaxWidth=o.maxWidth&&(o.maxWidth<newWidth),isMaxHeight=o.maxHeight&&(o.maxHeight<newHeight),isMinWidth=o.minWidth&&(o.minWidth>newWidth),isMinHeight=o.minHeight&&(o.minHeight>newHeight);o.grid=grid;if(isMinWidth){newWidth+=gridX;} 344if(isMinHeight){newHeight+=gridY;} 345if(isMaxWidth){newWidth-=gridX;} 346if(isMaxHeight){newHeight-=gridY;} 347if(/^(se|s|e)$/.test(a)){that.size.width=newWidth;that.size.height=newHeight;}else if(/^(ne)$/.test(a)){that.size.width=newWidth;that.size.height=newHeight;that.position.top=op.top-oy;}else if(/^(sw)$/.test(a)){that.size.width=newWidth;that.size.height=newHeight;that.position.left=op.left-ox;}else{if(newHeight-gridY<=0||newWidth-gridX<=0){outerDimensions=that._getPaddingPlusBorderDimensions(this);} 348if(newHeight-gridY>0){that.size.height=newHeight;that.position.top=op.top-oy;}else{newHeight=gridY-outerDimensions.height;that.size.height=newHeight;that.position.top=op.top+os.height-newHeight;} 349if(newWidth-gridX>0){that.size.width=newWidth;that.position.left=op.left-ox;}else{newWidth=gridX-outerDimensions.width;that.size.width=newWidth;that.position.left=op.left+os.width-newWidth;}}}});var resizable=$.ui.resizable;var selectable=$.widget("ui.selectable",$.ui.mouse,{version:"1.11.3",options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var selectees,that=this;this.element.addClass("ui-selectable");this.dragged=false;this.refresh=function(){selectees=$(that.options.filter,that.element[0]);selectees.addClass("ui-selectee");selectees.each(function(){var $this=$(this),pos=$this.offset();$.data(this,"selectable-item",{element:this,$element:$this,left:pos.left,top:pos.top,right:pos.left+$this.outerWidth(),bottom:pos.top+$this.outerHeight(),startselected:false,selected:$this.hasClass("ui-selected"),selecting:$this.hasClass("ui-selecting"),unselecting:$this.hasClass("ui-unselecting")});});};this.refresh();this.selectees=selectees.addClass("ui-selectee");this._mouseInit();this.helper=$("<div class='ui-selectable-helper'></div>");},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item");this.element.removeClass("ui-selectable ui-selectable-disabled");this._mouseDestroy();},_mouseStart:function(event){var that=this,options=this.options;this.opos=[event.pageX,event.pageY];if(this.options.disabled){return;} 350this.selectees=$(options.filter,this.element[0]);this._trigger("start",event);$(options.appendTo).append(this.helper);this.helper.css({"left":event.pageX,"top":event.pageY,"width":0,"height":0});if(options.autoRefresh){this.refresh();} 351this.selectees.filter(".ui-selected").each(function(){var selectee=$.data(this,"selectable-item");selectee.startselected=true;if(!event.metaKey&&!event.ctrlKey){selectee.$element.removeClass("ui-selected");selectee.selected=false;selectee.$element.addClass("ui-unselecting");selectee.unselecting=true;that._trigger("unselecting",event,{unselecting:selectee.element});}});$(event.target).parents().addBack().each(function(){var doSelect,selectee=$.data(this,"selectable-item");if(selectee){doSelect=(!event.metaKey&&!event.ctrlKey)||!selectee.$element.hasClass("ui-selected");selectee.$element.removeClass(doSelect?"ui-unselecting":"ui-selected").addClass(doSelect?"ui-selecting":"ui-unselecting");selectee.unselecting=!doSelect;selectee.selecting=doSelect;selectee.selected=doSelect;if(doSelect){that._trigger("selecting",event,{selecting:selectee.element});}else{that._trigger("unselecting",event,{unselecting:selectee.element});} 352return false;}});},_mouseDrag:function(event){this.dragged=true;if(this.options.disabled){return;} 353var tmp,that=this,options=this.options,x1=this.opos[0],y1=this.opos[1],x2=event.pageX,y2=event.pageY;if(x1>x2){tmp=x2;x2=x1;x1=tmp;} 354if(y1>y2){tmp=y2;y2=y1;y1=tmp;} 355this.helper.css({left:x1,top:y1,width:x2-x1,height:y2-y1});this.selectees.each(function(){var selectee=$.data(this,"selectable-item"),hit=false;if(!selectee||selectee.element===that.element[0]){return;} 356if(options.tolerance==="touch"){hit=(!(selectee.left>x2||selectee.right<x1||selectee.top>y2||selectee.bottom<y1));}else if(options.tolerance==="fit"){hit=(selectee.left>x1&&selectee.right<x2&&selectee.top>y1&&selectee.bottom<y2);} 357if(hit){if(selectee.selected){selectee.$element.removeClass("ui-selected");selectee.selected=false;} 358if(selectee.unselecting){selectee.$element.removeClass("ui-unselecting");selectee.unselecting=false;} 359if(!selectee.selecting){selectee.$element.addClass("ui-selecting");selectee.selecting=true;that._trigger("selecting",event,{selecting:selectee.element});}}else{if(selectee.selecting){if((event.metaKey||event.ctrlKey)&&selectee.startselected){selectee.$element.removeClass("ui-selecting");selectee.selecting=false;selectee.$element.addClass("ui-selected");selectee.selected=true;}else{selectee.$element.removeClass("ui-selecting");selectee.selecting=false;if(selectee.startselected){selectee.$element.addClass("ui-unselecting");selectee.unselecting=true;} 360that._trigger("unselecting",event,{unselecting:selectee.element});}} 361if(selectee.selected){if(!event.metaKey&&!event.ctrlKey&&!selectee.startselected){selectee.$element.removeClass("ui-selected");selectee.selected=false;selectee.$element.addClass("ui-unselecting");selectee.unselecting=true;that._trigger("unselecting",event,{unselecting:selectee.element});}}}});return false;},_mouseStop:function(event){var that=this;this.dragged=false;$(".ui-unselecting",this.element[0]).each(function(){var selectee=$.data(this,"selectable-item");selectee.$element.removeClass("ui-unselecting");selectee.unselecting=false;selectee.startselected=false;that._trigger("unselected",event,{unselected:selectee.element});});$(".ui-selecting",this.element[0]).each(function(){var selectee=$.data(this,"selectable-item");selectee.$element.removeClass("ui-selecting").addClass("ui-selected");selectee.selecting=false;selectee.selected=true;selectee.startselected=true;that._trigger("selected",event,{selected:selectee.element});});this._trigger("stop",event);this.helper.remove();return false;}});var sortable=$.widget("ui.sortable",$.ui.mouse,{version:"1.11.3",widgetEventPrefix:"sort",ready:false,options:{appendTo:"parent",axis:false,connectWith:false,containment:false,cursor:"auto",cursorAt:false,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1000,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(x,reference,size){return(x>=reference)&&(x<(reference+size));},_isFloating:function(item){return(/left|right/).test(item.css("float"))||(/inline|table-cell/).test(item.css("display"));},_create:function(){var o=this.options;this.containerCache={};this.element.addClass("ui-sortable");this.refresh();this.floating=this.items.length?o.axis==="x"||this._isFloating(this.items[0].item):false;this.offset=this.element.offset();this._mouseInit();this._setHandleClassName();this.ready=true;},_setOption:function(key,value){this._super(key,value);if(key==="handle"){this._setHandleClassName();}},_setHandleClassName:function(){this.element.find(".ui-sortable-handle").removeClass("ui-sortable-handle");$.each(this.items,function(){(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item).addClass("ui-sortable-handle");});},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").find(".ui-sortable-handle").removeClass("ui-sortable-handle");this._mouseDestroy();for(var i=this.items.length-1;i>=0;i--){this.items[i].item.removeData(this.widgetName+"-item");} 362return this;},_mouseCapture:function(event,overrideHandle){var currentItem=null,validHandle=false,that=this;if(this.reverting){return false;} 363if(this.options.disabled||this.options.type==="static"){return false;} 364this._refreshItems(event);$(event.target).parents().each(function(){if($.data(this,that.widgetName+"-item")===that){currentItem=$(this);return false;}});if($.data(event.target,that.widgetName+"-item")===that){currentItem=$(event.target);} 365if(!currentItem){return false;} 366if(this.options.handle&&!overrideHandle){$(this.options.handle,currentItem).find("*").addBack().each(function(){if(this===event.target){validHandle=true;}});if(!validHandle){return false;}} 367this.currentItem=currentItem;this._removeCurrentsFromItems();return true;},_mouseStart:function(event,overrideHandle,noActivation){var i,body,o=this.options;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(event);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};$.extend(this.offset,{click:{left:event.pageX-this.offset.left,top:event.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");this.originalPosition=this._generatePosition(event);this.originalPageX=event.pageX;this.originalPageY=event.pageY;(o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt));this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};if(this.helper[0]!==this.currentItem[0]){this.currentItem.hide();} 368this._createPlaceholder();if(o.containment){this._setContainment();} 369if(o.cursor&&o.cursor!=="auto"){body=this.document.find("body");this.storedCursor=body.css("cursor");body.css("cursor",o.cursor);this.storedStylesheet=$("<style>*{ cursor: "+o.cursor+" !important; }</style>").appendTo(body);} 370if(o.opacity){if(this.helper.css("opacity")){this._storedOpacity=this.helper.css("opacity");} 371this.helper.css("opacity",o.opacity);}
vendor: 11,142 bytes, lines 372-411
372if(o.zIndex){if(this.helper.css("zIndex")){this._storedZIndex=this.helper.css("zIndex");} 373this.helper.css("zIndex",o.zIndex);} 374if(this.scrollParent[0]!==this.document[0]&&this.scrollParent[0].tagName!=="HTML"){this.overflowOffset=this.scrollParent.offset();} 375this._trigger("start",event,this._uiHash());if(!this._preserveHelperProportions){this._cacheHelperProportions();} 376if(!noActivation){for(i=this.containers.length-1;i>=0;i--){this.containers[i]._trigger("activate",event,this._uiHash(this));}} 377if($.ui.ddmanager){$.ui.ddmanager.current=this;} 378if($.ui.ddmanager&&!o.dropBehaviour){$.ui.ddmanager.prepareOffsets(this,event);} 379this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(event);return true;},_mouseDrag:function(event){var i,item,itemElement,intersection,o=this.options,scrolled=false;this.position=this._generatePosition(event);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs){this.lastPositionAbs=this.positionAbs;} 380if(this.options.scroll){if(this.scrollParent[0]!==this.document[0]&&this.scrollParent[0].tagName!=="HTML"){if((this.overflowOffset.top+this.scrollParent[0].offsetHeight)-event.pageY<o.scrollSensitivity){this.scrollParent[0].scrollTop=scrolled=this.scrollParent[0].scrollTop+o.scrollSpeed;}else if(event.pageY-this.overflowOffset.top<o.scrollSensitivity){this.scrollParent[0].scrollTop=scrolled=this.scrollParent[0].scrollTop-o.scrollSpeed;} 381if((this.overflowOffset.left+this.scrollParent[0].offsetWidth)-event.pageX<o.scrollSensitivity){this.scrollParent[0].scrollLeft=scrolled=this.scrollParent[0].scrollLeft+o.scrollSpeed;}else if(event.pageX-this.overflowOffset.left<o.scrollSensitivity){this.scrollParent[0].scrollLeft=scrolled=this.scrollParent[0].scrollLeft-o.scrollSpeed;}}else{if(event.pageY-this.document.scrollTop()<o.scrollSensitivity){scrolled=this.document.scrollTop(this.document.scrollTop()-o.scrollSpeed);}else if(this.window.height()-(event.pageY-this.document.scrollTop())<o.scrollSensitivity){scrolled=this.document.scrollTop(this.document.scrollTop()+o.scrollSpeed);} 382if(event.pageX-this.document.scrollLeft()<o.scrollSensitivity){scrolled=this.document.scrollLeft(this.document.scrollLeft()-o.scrollSpeed);}else if(this.window.width()-(event.pageX-this.document.scrollLeft())<o.scrollSensitivity){scrolled=this.document.scrollLeft(this.document.scrollLeft()+o.scrollSpeed);}} 383if(scrolled!==false&&$.ui.ddmanager&&!o.dropBehaviour){$.ui.ddmanager.prepareOffsets(this,event);}} 384this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!=="y"){this.helper[0].style.left=this.position.left+"px";} 385if(!this.options.axis||this.options.axis!=="x"){this.helper[0].style.top=this.position.top+"px";} 386for(i=this.items.length-1;i>=0;i--){item=this.items[i];itemElement=item.item[0];intersection=this._intersectsWithPointer(item);if(!intersection){continue;} 387if(item.instance!==this.currentContainer){continue;} 388if(itemElement!==this.currentItem[0]&&this.placeholder[intersection===1?"next":"prev"]()[0]!==itemElement&&!$.contains(this.placeholder[0],itemElement)&&(this.options.type==="semi-dynamic"?!$.contains(this.element[0],itemElement):true)){this.direction=intersection===1?"down":"up";if(this.options.tolerance==="pointer"||this._intersectsWithSides(item)){this._rearrange(event,item);}else{break;} 389this._trigger("change",event,this._uiHash());break;}} 390this._contactContainers(event);if($.ui.ddmanager){$.ui.ddmanager.drag(this,event);} 391this._trigger("sort",event,this._uiHash());this.lastPositionAbs=this.positionAbs;return false;},_mouseStop:function(event,noPropagation){if(!event){return;} 392if($.ui.ddmanager&&!this.options.dropBehaviour){$.ui.ddmanager.drop(this,event);} 393if(this.options.revert){var that=this,cur=this.placeholder.offset(),axis=this.options.axis,animation={};if(!axis||axis==="x"){animation.left=cur.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft);} 394if(!axis||axis==="y"){animation.top=cur.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop);} 395this.reverting=true;$(this.helper).animate(animation,parseInt(this.options.revert,10)||500,function(){that._clear(event);});}else{this._clear(event,noPropagation);} 396return false;},cancel:function(){if(this.dragging){this._mouseUp({target:null});if(this.options.helper==="original"){this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");}else{this.currentItem.show();} 397for(var i=this.containers.length-1;i>=0;i--){this.containers[i]._trigger("deactivate",null,this._uiHash(this));if(this.containers[i].containerCache.over){this.containers[i]._trigger("out",null,this._uiHash(this));this.containers[i].containerCache.over=0;}}} 398if(this.placeholder){if(this.placeholder[0].parentNode){this.placeholder[0].parentNode.removeChild(this.placeholder[0]);} 399if(this.options.helper!=="original"&&this.helper&&this.helper[0].parentNode){this.helper.remove();} 400$.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});if(this.domPosition.prev){$(this.domPosition.prev).after(this.currentItem);}else{$(this.domPosition.parent).prepend(this.currentItem);}} 401return this;},serialize:function(o){var items=this._getItemsAsjQuery(o&&o.connected),str=[];o=o||{};$(items).each(function(){var res=($(o.item||this).attr(o.attribute||"id")||"").match(o.expression||(/(.+)[\-=_](.+)/));if(res){str.push((o.key||res[1]+"[]")+"="+(o.key&&o.expression?res[1]:res[2]));}});if(!str.length&&o.key){str.push(o.key+"=");} 402return str.join("&");},toArray:function(o){var items=this._getItemsAsjQuery(o&&o.connected),ret=[];o=o||{};items.each(function(){ret.push($(o.item||this).attr(o.attribute||"id")||"");});return ret;},_intersectsWith:function(item){var x1=this.positionAbs.left,x2=x1+this.helperProportions.width,y1=this.positionAbs.top,y2=y1+this.helperProportions.height,l=item.left,r=l+item.width,t=item.top,b=t+item.height,dyClick=this.offset.click.top,dxClick=this.offset.click.left,isOverElementHeight=(this.options.axis==="x")||((y1+dyClick)>t&&(y1+dyClick)<b),isOverElementWidth=(this.options.axis==="y")||((x1+dxClick)>l&&(x1+dxClick)<r),isOverElement=isOverElementHeight&&isOverElementWidth;if(this.options.tolerance==="pointer"||this.options.forcePointerForContainers||(this.options.tolerance!=="pointer"&&this.helperProportions[this.floating?"width":"height"]>item[this.floating?"width":"height"])){return isOverElement;}else{return(l<x1+(this.helperProportions.width/2)&&x2-(this.helperProportions.width/2)<r&&t<y1+(this.helperProportions.height/2)&&y2-(this.helperProportions.height/2)<b);}},_intersectsWithPointer:function(item){var isOverElementHeight=(this.options.axis==="x")||this._isOverAxis(this.positionAbs.top+this.offset.click.top,item.top,item.height),isOverElementWidth=(this.options.axis==="y")||this._isOverAxis(this.positionAbs.left+this.offset.click.left,item.left,item.width),isOverElement=isOverElementHeight&&isOverElementWidth,verticalDirection=this._getDragVerticalDirection(),horizontalDirection=this._getDragHorizontalDirection();if(!isOverElement){return false;} 403return this.floating?(((horizontalDirection&&horizontalDirection==="right")||verticalDirection==="down")?2:1):(verticalDirection&&(verticalDirection==="down"?2:1));},_intersectsWithSides:function(item){var isOverBottomHalf=this._isOverAxis(this.positionAbs.top+this.offset.click.top,item.top+(item.height/2),item.height),isOverRightHalf=this._isOverAxis(this.positionAbs.left+this.offset.click.left,item.left+(item.width/2),item.width),verticalDirection=this._getDragVerticalDirection(),horizontalDirection=this._getDragHorizontalDirection();if(this.floating&&horizontalDirection){return((horizontalDirection==="right"&&isOverRightHalf)||(horizontalDirection==="left"&&!isOverRightHalf));}else{return verticalDirection&&((verticalDirection==="down"&&isOverBottomHalf)||(verticalDirection==="up"&&!isOverBottomHalf));}},_getDragVerticalDirection:function(){var delta=this.positionAbs.top-this.lastPositionAbs.top;return delta!==0&&(delta>0?"down":"up");},_getDragHorizontalDirection:function(){var delta=this.positionAbs.left-this.lastPositionAbs.left;return delta!==0&&(delta>0?"right":"left");},refresh:function(event){this._refreshItems(event);this._setHandleClassName();this.refreshPositions();return this;},_connectWith:function(){var options=this.options;return options.connectWith.constructor===String?[options.connectWith]:options.connectWith;},_getItemsAsjQuery:function(connected){var i,j,cur,inst,items=[],queries=[],connectWith=this._connectWith();if(connectWith&&connected){for(i=connectWith.length-1;i>=0;i--){cur=$(connectWith[i],this.document[0]);for(j=cur.length-1;j>=0;j--){inst=$.data(cur[j],this.widgetFullName);if(inst&&inst!==this&&!inst.options.disabled){queries.push([$.isFunction(inst.options.items)?inst.options.items.call(inst.element):$(inst.options.items,inst.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),inst]);}}}} 404queries.push([$.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):$(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);function addItems(){items.push(this);} 405for(i=queries.length-1;i>=0;i--){queries[i][0].each(addItems);} 406return $(items);},_removeCurrentsFromItems:function(){var list=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=$.grep(this.items,function(item){for(var j=0;j<list.length;j++){if(list[j]===item.item[0]){return false;}} 407return true;});},_refreshItems:function(event){this.items=[];this.containers=[this];var i,j,cur,inst,targetData,_queries,item,queriesLength,items=this.items,queries=[[$.isFunction(this.options.items)?this.options.items.call(this.element[0],event,{item:this.currentItem}):$(this.options.items,this.element),this]],connectWith=this._connectWith();if(connectWith&&this.ready){for(i=connectWith.length-1;i>=0;i--){cur=$(connectWith[i],this.document[0]);for(j=cur.length-1;j>=0;j--){inst=$.data(cur[j],this.widgetFullName);if(inst&&inst!==this&&!inst.options.disabled){queries.push([$.isFunction(inst.options.items)?inst.options.items.call(inst.element[0],event,{item:this.currentItem}):$(inst.options.items,inst.element),inst]);this.containers.push(inst);}}}} 408for(i=queries.length-1;i>=0;i--){targetData=queries[i][1];_queries=queries[i][0];for(j=0,queriesLength=_queries.length;j<queriesLength;j++){item=$(_queries[j]);item.data(this.widgetName+"-item",targetData);items.push({item:item,instance:targetData,width:0,height:0,left:0,top:0});}}},refreshPositions:function(fast){if(this.offsetParent&&this.helper){this.offset.parent=this._getParentOffset();} 409var i,item,t,p;for(i=this.items.length-1;i>=0;i--){item=this.items[i];if(item.instance!==this.currentContainer&&this.currentContainer&&item.item[0]!==this.currentItem[0]){continue;} 410t=this.options.toleranceElement?$(this.options.toleranceElement,item.item):item.item;if(!fast){item.width=t.outerWidth();item.height=t.outerHeight();} 411p=t.offset();item.left=p.left;item.top=p.top;}
vendor: 1,261 bytes, lines 412-415
412if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this);}else{for(i=this.containers.length-1;i>=0;i--){p=this.containers[i].element.offset();this.containers[i].containerCache.left=p.left;this.containers[i].containerCache.top=p.top;this.containers[i].containerCache.width=this.containers[i].element.outerWidth();this.containers[i].containerCache.height=this.containers[i].element.outerHeight();}} 413return this;},_createPlaceholder:function(that){that=that||this;var className,o=that.options;if(!o.placeholder||o.placeholder.constructor===String){className=o.placeholder;o.placeholder={element:function(){var nodeName=that.currentItem[0].nodeName.toLowerCase(),element=$("<"+nodeName+">",that.document[0]).addClass(className||that.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");if(nodeName==="tr"){that.currentItem.children().each(function(){$("<td> </td>",that.document[0]).attr("colspan",$(this).attr("colspan")||1).appendTo(element);});}else if(nodeName==="img"){element.attr("src",that.currentItem.attr("src"));} 414if(!className){element.css("visibility","hidden");} 415return element;},update:function(container,p){if(className&&!o.forcePlaceholderSize){return;}
vendor: 4,705 bytes, lines 416-440
416if(!p.height()){p.height(that.currentItem.innerHeight()-parseInt(that.currentItem.css("paddingTop")||0,10)-parseInt(that.currentItem.css("paddingBottom")||0,10));} 417if(!p.width()){p.width(that.currentItem.innerWidth()-parseInt(that.currentItem.css("paddingLeft")||0,10)-parseInt(that.currentItem.css("paddingRight")||0,10));}}};} 418that.placeholder=$(o.placeholder.element.call(that.element,that.currentItem));that.currentItem.after(that.placeholder);o.placeholder.update(that,that.placeholder);},_contactContainers:function(event){var i,j,dist,itemWithLeastDistance,posProperty,sizeProperty,cur,nearBottom,floating,axis,innermostContainer=null,innermostIndex=null;for(i=this.containers.length-1;i>=0;i--){if($.contains(this.currentItem[0],this.containers[i].element[0])){continue;} 419if(this._intersectsWith(this.containers[i].containerCache)){if(innermostContainer&&$.contains(this.containers[i].element[0],innermostContainer.element[0])){continue;} 420innermostContainer=this.containers[i];innermostIndex=i;}else{if(this.containers[i].containerCache.over){this.containers[i]._trigger("out",event,this._uiHash(this));this.containers[i].containerCache.over=0;}}} 421if(!innermostContainer){return;} 422if(this.containers.length===1){if(!this.containers[innermostIndex].containerCache.over){this.containers[innermostIndex]._trigger("over",event,this._uiHash(this));this.containers[innermostIndex].containerCache.over=1;}}else{dist=10000;itemWithLeastDistance=null;floating=innermostContainer.floating||this._isFloating(this.currentItem);posProperty=floating?"left":"top";sizeProperty=floating?"width":"height";axis=floating?"clientX":"clientY";for(j=this.items.length-1;j>=0;j--){if(!$.contains(this.containers[innermostIndex].element[0],this.items[j].item[0])){continue;} 423if(this.items[j].item[0]===this.currentItem[0]){continue;} 424cur=this.items[j].item.offset()[posProperty];nearBottom=false;if(event[axis]-cur>this.items[j][sizeProperty]/2){nearBottom=true;} 425if(Math.abs(event[axis]-cur)<dist){dist=Math.abs(event[axis]-cur);itemWithLeastDistance=this.items[j];this.direction=nearBottom?"up":"down";}} 426if(!itemWithLeastDistance&&!this.options.dropOnEmpty){return;} 427if(this.currentContainer===this.containers[innermostIndex]){if(!this.currentContainer.containerCache.over){this.containers[innermostIndex]._trigger("over",event,this._uiHash());this.currentContainer.containerCache.over=1;} 428return;} 429itemWithLeastDistance?this._rearrange(event,itemWithLeastDistance,null,true):this._rearrange(event,null,this.containers[innermostIndex].element,true);this._trigger("change",event,this._uiHash());this.containers[innermostIndex]._trigger("change",event,this._uiHash(this));this.currentContainer=this.containers[innermostIndex];this.options.placeholder.update(this.currentContainer,this.placeholder);this.containers[innermostIndex]._trigger("over",event,this._uiHash(this));this.containers[innermostIndex].containerCache.over=1;}},_createHelper:function(event){var o=this.options,helper=$.isFunction(o.helper)?$(o.helper.apply(this.element[0],[event,this.currentItem])):(o.helper==="clone"?this.currentItem.clone():this.currentItem);if(!helper.parents("body").length){$(o.appendTo!=="parent"?o.appendTo:this.currentItem[0].parentNode)[0].appendChild(helper[0]);} 430if(helper[0]===this.currentItem[0]){this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")};} 431if(!helper[0].style.width||o.forceHelperSize){helper.width(this.currentItem.width());} 432if(!helper[0].style.height||o.forceHelperSize){helper.height(this.currentItem.height());} 433return helper;},_adjustOffsetFromHelper:function(obj){if(typeof obj==="string"){obj=obj.split(" ");} 434if($.isArray(obj)){obj={left:+obj[0],top:+obj[1]||0};} 435if("left"in obj){this.offset.click.left=obj.left+this.margins.left;} 436if("right"in obj){this.offset.click.left=this.helperProportions.width-obj.right+this.margins.left;} 437if("top"in obj){this.offset.click.top=obj.top+this.margins.top;} 438if("bottom"in obj){this.offset.click.top=this.helperProportions.height-obj.bottom+this.margins.top;}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var po=this.offsetParent.offset();if(this.cssPosition==="absolute"&&this.scrollParent[0]!==this.document[0]&&$.contains(this.scrollParent[0],this.offsetParent[0])){po.left+=this.scrollParent.scrollLeft();po.top+=this.scrollParent.scrollTop();} 439if(this.offsetParent[0]===this.document[0].body||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()==="html"&&$.ui.ie)){po={top:0,left:0};} 440return{top:po.top+(parseInt(this.offsetParent.css("borderTopWidth"),
vendor: 13,132 bytes, lines 440-488
44010)||0),left:po.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)};},_getRelativeOffset:function(){if(this.cssPosition==="relative"){var p=this.currentItem.position();return{top:p.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:p.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()};}else{return{top:0,left:0};}},_cacheMargins:function(){this.margins={left:(parseInt(this.currentItem.css("marginLeft"),10)||0),top:(parseInt(this.currentItem.css("marginTop"),10)||0)};},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()};},_setContainment:function(){var ce,co,over,o=this.options;if(o.containment==="parent"){o.containment=this.helper[0].parentNode;} 441if(o.containment==="document"||o.containment==="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,o.containment==="document"?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,(o.containment==="document"?this.document.width():this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];} 442if(!(/^(document|window|parent)$/).test(o.containment)){ce=$(o.containment)[0];co=$(o.containment).offset();over=($(ce).css("overflow")!=="hidden");this.containment=[co.left+(parseInt($(ce).css("borderLeftWidth"),10)||0)+(parseInt($(ce).css("paddingLeft"),10)||0)-this.margins.left,co.top+(parseInt($(ce).css("borderTopWidth"),10)||0)+(parseInt($(ce).css("paddingTop"),10)||0)-this.margins.top,co.left+(over?Math.max(ce.scrollWidth,ce.offsetWidth):ce.offsetWidth)-(parseInt($(ce).css("borderLeftWidth"),10)||0)-(parseInt($(ce).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,co.top+(over?Math.max(ce.scrollHeight,ce.offsetHeight):ce.offsetHeight)-(parseInt($(ce).css("borderTopWidth"),10)||0)-(parseInt($(ce).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top];}},_convertPositionTo:function(d,pos){if(!pos){pos=this.position;} 443var mod=d==="absolute"?1:-1,scroll=this.cssPosition==="absolute"&&!(this.scrollParent[0]!==this.document[0]&&$.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,scrollIsRootNode=(/(html|body)/i).test(scroll[0].tagName);return{top:(pos.top+ 444this.offset.relative.top*mod+ 445this.offset.parent.top*mod- 446((this.cssPosition==="fixed"?-this.scrollParent.scrollTop():(scrollIsRootNode?0:scroll.scrollTop()))*mod)),left:(pos.left+ 447this.offset.relative.left*mod+ 448this.offset.parent.left*mod- 449((this.cssPosition==="fixed"?-this.scrollParent.scrollLeft():scrollIsRootNode?0:scroll.scrollLeft())*mod))};},_generatePosition:function(event){var top,left,o=this.options,pageX=event.pageX,pageY=event.pageY,scroll=this.cssPosition==="absolute"&&!(this.scrollParent[0]!==this.document[0]&&$.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,scrollIsRootNode=(/(html|body)/i).test(scroll[0].tagName);if(this.cssPosition==="relative"&&!(this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0])){this.offset.relative=this._getRelativeOffset();} 450if(this.originalPosition){if(this.containment){if(event.pageX-this.offset.click.left<this.containment[0]){pageX=this.containment[0]+this.offset.click.left;} 451if(event.pageY-this.offset.click.top<this.containment[1]){pageY=this.containment[1]+this.offset.click.top;} 452if(event.pageX-this.offset.click.left>this.containment[2]){pageX=this.containment[2]+this.offset.click.left;} 453if(event.pageY-this.offset.click.top>this.containment[3]){pageY=this.containment[3]+this.offset.click.top;}} 454if(o.grid){top=this.originalPageY+Math.round((pageY-this.originalPageY)/o.grid[1])*o.grid[1];pageY=this.containment?((top-this.offset.click.top>=this.containment[1]&&top-this.offset.click.top<=this.containment[3])?top:((top-this.offset.click.top>=this.containment[1])?top-o.grid[1]:top+o.grid[1])):top;left=this.originalPageX+Math.round((pageX-this.originalPageX)/o.grid[0])*o.grid[0];pageX=this.containment?((left-this.offset.click.left>=this.containment[0]&&left-this.offset.click.left<=this.containment[2])?left:((left-this.offset.click.left>=this.containment[0])?left-o.grid[0]:left+o.grid[0])):left;}} 455return{top:(pageY- 456this.offset.click.top- 457this.offset.relative.top- 458this.offset.parent.top+ 459((this.cssPosition==="fixed"?-this.scrollParent.scrollTop():(scrollIsRootNode?0:scroll.scrollTop())))),left:(pageX- 460this.offset.click.left- 461this.offset.relative.left- 462this.offset.parent.left+ 463((this.cssPosition==="fixed"?-this.scrollParent.scrollLeft():scrollIsRootNode?0:scroll.scrollLeft())))};},_rearrange:function(event,i,a,hardRefresh){a?a[0].appendChild(this.placeholder[0]):i.item[0].parentNode.insertBefore(this.placeholder[0],(this.direction==="down"?i.item[0]:i.item[0].nextSibling));this.counter=this.counter?++this.counter:1;var counter=this.counter;this._delay(function(){if(counter===this.counter){this.refreshPositions(!hardRefresh);}});},_clear:function(event,noPropagation){this.reverting=false;var i,delayedTriggers=[];if(!this._noFinalSort&&this.currentItem.parent().length){this.placeholder.before(this.currentItem);} 464this._noFinalSort=null;if(this.helper[0]===this.currentItem[0]){for(i in this._storedCSS){if(this._storedCSS[i]==="auto"||this._storedCSS[i]==="static"){this._storedCSS[i]="";}} 465this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");}else{this.currentItem.show();} 466if(this.fromOutside&&!noPropagation){delayedTriggers.push(function(event){this._trigger("receive",event,this._uiHash(this.fromOutside));});} 467if((this.fromOutside||this.domPosition.prev!==this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!==this.currentItem.parent()[0])&&!noPropagation){delayedTriggers.push(function(event){this._trigger("update",event,this._uiHash());});} 468if(this!==this.currentContainer){if(!noPropagation){delayedTriggers.push(function(event){this._trigger("remove",event,this._uiHash());});delayedTriggers.push((function(c){return function(event){c._trigger("receive",event,this._uiHash(this));};}).call(this,this.currentContainer));delayedTriggers.push((function(c){return function(event){c._trigger("update",event,this._uiHash(this));};}).call(this,this.currentContainer));}} 469function delayEvent(type,instance,container){return function(event){container._trigger(type,event,instance._uiHash(instance));};} 470for(i=this.containers.length-1;i>=0;i--){if(!noPropagation){delayedTriggers.push(delayEvent("deactivate",this,this.containers[i]));} 471if(this.containers[i].containerCache.over){delayedTriggers.push(delayEvent("out",this,this.containers[i]));this.containers[i].containerCache.over=0;}} 472if(this.storedCursor){this.document.find("body").css("cursor",this.storedCursor);this.storedStylesheet.remove();} 473if(this._storedOpacity){this.helper.css("opacity",this._storedOpacity);} 474if(this._storedZIndex){this.helper.css("zIndex",this._storedZIndex==="auto"?"":this._storedZIndex);} 475this.dragging=false;if(!noPropagation){this._trigger("beforeStop",event,this._uiHash());} 476this.placeholder[0].parentNode.removeChild(this.placeholder[0]);if(!this.cancelHelperRemoval){if(this.helper[0]!==this.currentItem[0]){this.helper.remove();} 477this.helper=null;} 478if(!noPropagation){for(i=0;i<delayedTriggers.length;i++){delayedTriggers[i].call(this,event);} 479this._trigger("stop",event,this._uiHash());} 480this.fromOutside=false;return!this.cancelHelperRemoval;},_trigger:function(){if($.Widget.prototype._trigger.apply(this,arguments)===false){this.cancel();}},_uiHash:function(_inst){var inst=_inst||this;return{helper:inst.helper,placeholder:inst.placeholder||$([]),position:inst.position,originalPosition:inst.originalPosition,offset:inst.positionAbs,item:inst.currentItem,sender:_inst?_inst.element:null};}});var menu=$.widget("ui.menu",{version:"1.11.3",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},items:"> *",menus:"ul",position:{my:"left-1 top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element;this.mouseHandled=false;this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0});if(this.options.disabled){this.element.addClass("ui-state-disabled").attr("aria-disabled","true");} 481this._on({"mousedown .ui-menu-item":function(event){event.preventDefault();},"click .ui-menu-item":function(event){var target=$(event.target);if(!this.mouseHandled&&target.not(".ui-state-disabled").length){this.select(event);if(!event.isPropagationStopped()){this.mouseHandled=true;} 482if(target.has(".ui-menu").length){this.expand(event);}else if(!this.element.is(":focus")&&$(this.document[0].activeElement).closest(".ui-menu").length){this.element.trigger("focus",[true]);if(this.active&&this.active.parents(".ui-menu").length===1){clearTimeout(this.timer);}}}},"mouseenter .ui-menu-item":function(event){if(this.previousFilter){return;} 483var target=$(event.currentTarget);target.siblings(".ui-state-active").removeClass("ui-state-active");this.focus(event,target);},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(event,keepActiveItem){var item=this.active||this.element.find(this.options.items).eq(0);if(!keepActiveItem){this.focus(event,item);}},blur:function(event){this._delay(function(){if(!$.contains(this.element[0],this.document[0].activeElement)){this.collapseAll(event);}});},keydown:"_keydown"});this.refresh();this._on(this.document,{click:function(event){if(this._closeOnDocumentClick(event)){this.collapseAll(event);} 484this.mouseHandled=false;}});},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-menu-icons ui-front").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show();this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").removeUniqueId().removeClass("ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var elem=$(this);if(elem.data("ui-menu-submenu-carat")){elem.remove();}});this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content");},_keydown:function(event){var match,prev,character,skip,preventDefault=true;switch(event.keyCode){case $.ui.keyCode.PAGE_UP:this.previousPage(event);break;case $.ui.keyCode.PAGE_DOWN:this.nextPage(event);break;case $.ui.keyCode.HOME:this._move("first","first",event);break;case $.ui.keyCode.END:this._move("last","last",event);break;case $.ui.keyCode.UP:this.previous(event);break;case $.ui.keyCode.DOWN:this.next(event);break;case $.ui.keyCode.LEFT:this.collapse(event);break;case $.ui.keyCode.RIGHT:if(this.active&&!this.active.is(".ui-state-disabled")){this.expand(event);} 485break;case $.ui.keyCode.ENTER:case $.ui.keyCode.SPACE:this._activate(event);break;case $.ui.keyCode.ESCAPE:this.collapse(event);break;default:preventDefault=false;prev=this.previousFilter||"";character=String.fromCharCode(event.keyCode);skip=false;clearTimeout(this.filterTimer);if(character===prev){skip=true;}else{character=prev+character;} 486match=this._filterMenuItems(character);match=skip&&match.index(this.active.next())!==-1?this.active.nextAll(".ui-menu-item"):match;if(!match.length){character=String.fromCharCode(event.keyCode);match=this._filterMenuItems(character);} 487if(match.length){this.focus(event,match);this.previousFilter=character;this.filterTimer=this._delay(function(){delete this.previousFilter;},1000);}else{delete this.previousFilter;}} 488if(preventDefault){event.preventDefault();}},_activate:function(event){if(!this.active.is(".ui-state-disabled")){if(this.active.is("[aria-haspopup='true']")){this.expand(event);}else{this.select(event);}}},refresh:function(){var menus,items,that=this,icon=this.options.icons.submenu,submenus=this.element.find(this.options.menus);this.element.toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length);submenus.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-front").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var menu=$(this),item=menu.parent(),submenuCarat=$("<span>").addClass("ui-menu-icon ui-icon "+icon).data("ui-menu-submenu-carat",true);item.attr("aria-haspopup","true").prepend(submenuCarat);menu.attr("aria-labelledby",item.attr("id"));});menus=submenus.add(this.element);items=menus.find(this.options.items);items.not(".ui-menu-item").each(function(){var item=$(this);if(that._isDivider(item)){item.addClass("ui-widget-content ui-menu-divider");}});items.not(".ui-menu-item, .ui-menu-divider").addClass("ui-menu-item").uniqueId().attr({tabIndex:-1,role:this._itemRole()});items.filter(".ui-state-disabled").attr("aria-disabled","true");
vendor: 5,422 bytes, lines 488-508
488if(this.active&&!$.contains(this.element[0],this.active[0])){this.blur();}},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role];},_setOption:function(key,value){if(key==="icons"){this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(value.submenu);} 489if(key==="disabled"){this.element.toggleClass("ui-state-disabled",!!value).attr("aria-disabled",value);} 490this._super(key,value);},focus:function(event,item){var nested,focused;this.blur(event,event&&event.type==="focus");this._scrollIntoView(item);this.active=item.first();focused=this.active.addClass("ui-state-focus").removeClass("ui-state-active");if(this.options.role){this.element.attr("aria-activedescendant",focused.attr("id"));} 491this.active.parent().closest(".ui-menu-item").addClass("ui-state-active");if(event&&event.type==="keydown"){this._close();}else{this.timer=this._delay(function(){this._close();},this.delay);} 492nested=item.children(".ui-menu");if(nested.length&&event&&(/^mouse/.test(event.type))){this._startOpening(nested);} 493this.activeMenu=item.parent();this._trigger("focus",event,{item:item});},_scrollIntoView:function(item){var borderTop,paddingTop,offset,scroll,elementHeight,itemHeight;if(this._hasScroll()){borderTop=parseFloat($.css(this.activeMenu[0],"borderTopWidth"))||0;paddingTop=parseFloat($.css(this.activeMenu[0],"paddingTop"))||0;offset=item.offset().top-this.activeMenu.offset().top-borderTop-paddingTop;scroll=this.activeMenu.scrollTop();elementHeight=this.activeMenu.height();itemHeight=item.outerHeight();if(offset<0){this.activeMenu.scrollTop(scroll+offset);}else if(offset+itemHeight>elementHeight){this.activeMenu.scrollTop(scroll+offset-elementHeight+itemHeight);}}},blur:function(event,fromFocus){if(!fromFocus){clearTimeout(this.timer);} 494if(!this.active){return;} 495this.active.removeClass("ui-state-focus");this.active=null;this._trigger("blur",event,{item:this.active});},_startOpening:function(submenu){clearTimeout(this.timer);if(submenu.attr("aria-hidden")!=="true"){return;} 496this.timer=this._delay(function(){this._close();this._open(submenu);},this.delay);},_open:function(submenu){var position=$.extend({of:this.active},this.options.position);clearTimeout(this.timer);this.element.find(".ui-menu").not(submenu.parents(".ui-menu")).hide().attr("aria-hidden","true");submenu.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(position);},collapseAll:function(event,all){clearTimeout(this.timer);this.timer=this._delay(function(){var currentMenu=all?this.element:$(event&&event.target).closest(this.element.find(".ui-menu"));if(!currentMenu.length){currentMenu=this.element;} 497this._close(currentMenu);this.blur(event);this.activeMenu=currentMenu;},this.delay);},_close:function(startMenu){if(!startMenu){startMenu=this.active?this.active.parent():this.element;} 498startMenu.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find(".ui-state-active").not(".ui-state-focus").removeClass("ui-state-active");},_closeOnDocumentClick:function(event){return!$(event.target).closest(".ui-menu").length;},_isDivider:function(item){return!/[^\-\u2014\u2013\s]/.test(item.text());},collapse:function(event){var newItem=this.active&&this.active.parent().closest(".ui-menu-item",this.element);if(newItem&&newItem.length){this._close();this.focus(event,newItem);}},expand:function(event){var newItem=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();if(newItem&&newItem.length){this._open(newItem.parent());this._delay(function(){this.focus(event,newItem);});}},next:function(event){this._move("next","first",event);},previous:function(event){this._move("prev","last",event);},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length;},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length;},_move:function(direction,filter,event){var next;if(this.active){if(direction==="first"||direction==="last"){next=this.active 499[direction==="first"?"prevAll":"nextAll"](".ui-menu-item").eq(-1);}else{next=this.active 500[direction+"All"](".ui-menu-item").eq(0);}} 501if(!next||!next.length||!this.active){next=this.activeMenu.find(this.options.items)[filter]();} 502this.focus(event,next);},nextPage:function(event){var item,base,height;if(!this.active){this.next(event);return;} 503if(this.isLastItem()){return;} 504if(this._hasScroll()){base=this.active.offset().top;height=this.element.height();this.active.nextAll(".ui-menu-item").each(function(){item=$(this);return item.offset().top-base-height<0;});this.focus(event,item);}else{this.focus(event,this.activeMenu.find(this.options.items) 505[!this.active?"first":"last"]());}},previousPage:function(event){var item,base,height;if(!this.active){this.next(event);return;} 506if(this.isFirstItem()){return;} 507if(this._hasScroll()){base=this.active.offset().top;height=this.element.height();this.active.prevAll(".ui-menu-item").each(function(){item=$(this);return item.offset().top-base+height>0;});this.focus(event,item);}else{this.focus(event,this.activeMenu.find(this.options.items).first());}},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight");},select:function(event){this.active=this.active||$(event.target).closest(".ui-menu-item");var ui={item:this.active};if(!this.active.has(".ui-menu").length){this.collapseAll(event,true);} 508this._trigger("select",event,ui);}
vendor: 4,399 bytes, lines 508-521
508,_filterMenuItems:function(character){var escapedCharacter=character.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),regex=new RegExp("^"+escapedCharacter,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return regex.test($.trim($(this).text()));});}});$.widget("ui.autocomplete",{version:"1.11.3",defaultElement:"<input>",options:{appendTo:null,autoFocus:false,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var suppressKeyPress,suppressKeyPressRepeat,suppressInput,nodeName=this.element[0].nodeName.toLowerCase(),isTextarea=nodeName==="textarea",isInput=nodeName==="input";this.isMultiLine=isTextarea?true:isInput?false:this.element.prop("isContentEditable");this.valueMethod=this.element[isTextarea||isInput?"val":"text"];this.isNewMenu=true;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off");this._on(this.element,{keydown:function(event){if(this.element.prop("readOnly")){suppressKeyPress=true;suppressInput=true;suppressKeyPressRepeat=true;return;} 509suppressKeyPress=false;suppressInput=false;suppressKeyPressRepeat=false;var keyCode=$.ui.keyCode;switch(event.keyCode){case keyCode.PAGE_UP:suppressKeyPress=true;this._move("previousPage",event);break;case keyCode.PAGE_DOWN:suppressKeyPress=true;this._move("nextPage",event);break;case keyCode.UP:suppressKeyPress=true;this._keyEvent("previous",event);break;case keyCode.DOWN:suppressKeyPress=true;this._keyEvent("next",event);break;case keyCode.ENTER:if(this.menu.active){suppressKeyPress=true;event.preventDefault();this.menu.select(event);} 510break;case keyCode.TAB:if(this.menu.active){this.menu.select(event);} 511break;case keyCode.ESCAPE:if(this.menu.element.is(":visible")){if(!this.isMultiLine){this._value(this.term);} 512this.close(event);event.preventDefault();} 513break;default:suppressKeyPressRepeat=true;this._searchTimeout(event);break;}},keypress:function(event){if(suppressKeyPress){suppressKeyPress=false;if(!this.isMultiLine||this.menu.element.is(":visible")){event.preventDefault();} 514return;} 515if(suppressKeyPressRepeat){return;} 516var keyCode=$.ui.keyCode;switch(event.keyCode){case keyCode.PAGE_UP:this._move("previousPage",event);break;case keyCode.PAGE_DOWN:this._move("nextPage",event);break;case keyCode.UP:this._keyEvent("previous",event);break;case keyCode.DOWN:this._keyEvent("next",event);break;}},input:function(event){if(suppressInput){suppressInput=false;event.preventDefault();return;} 517this._searchTimeout(event);},focus:function(){this.selectedItem=null;this.previous=this._value();},blur:function(event){if(this.cancelBlur){delete this.cancelBlur;return;} 518clearTimeout(this.searching);this.close(event);this._change(event);}});this._initSource();this.menu=$("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance");this._on(this.menu.element,{mousedown:function(event){event.preventDefault();this.cancelBlur=true;this._delay(function(){delete this.cancelBlur;});var menuElement=this.menu.element[0];if(!$(event.target).closest(".ui-menu-item").length){this._delay(function(){var that=this;this.document.one("mousedown",function(event){if(event.target!==that.element[0]&&event.target!==menuElement&&!$.contains(menuElement,event.target)){that.close();}});});}},menufocus:function(event,ui){var label,item;if(this.isNewMenu){this.isNewMenu=false;if(event.originalEvent&&/^mouse/.test(event.originalEvent.type)){this.menu.blur();this.document.one("mousemove",function(){$(event.target).trigger(event.originalEvent);});return;}} 519item=ui.item.data("ui-autocomplete-item");if(false!==this._trigger("focus",event,{item:item})){if(event.originalEvent&&/^key/.test(event.originalEvent.type)){this._value(item.value);}} 520label=ui.item.attr("aria-label")||item.value;if(label&&$.trim(label).length){this.liveRegion.children().hide();$("<div>").text(label).appendTo(this.liveRegion);}},menuselect:function(event,ui){var item=ui.item.data("ui-autocomplete-item"),previous=this.previous;if(this.element[0]!==this.document[0].activeElement){this.element.focus();this.previous=previous;this._delay(function(){this.previous=previous;this.selectedItem=item;});} 521if(false!==this._trigger("select",event,{item:item})){this._value(item.value);}
vendor: 11,882 bytes, lines 522-559
522this.term=this._value();this.close(event);this.selectedItem=item;}});this.liveRegion=$("<span>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body);this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete");}});},_destroy:function(){clearTimeout(this.searching);this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete");this.menu.element.remove();this.liveRegion.remove();},_setOption:function(key,value){this._super(key,value);if(key==="source"){this._initSource();} 523if(key==="appendTo"){this.menu.element.appendTo(this._appendTo());} 524if(key==="disabled"&&value&&this.xhr){this.xhr.abort();}},_appendTo:function(){var element=this.options.appendTo;if(element){element=element.jquery||element.nodeType?$(element):this.document.find(element).eq(0);} 525if(!element||!element[0]){element=this.element.closest(".ui-front");} 526if(!element.length){element=this.document[0].body;} 527return element;},_initSource:function(){var array,url,that=this;if($.isArray(this.options.source)){array=this.options.source;this.source=function(request,response){response($.ui.autocomplete.filter(array,request.term));};}else if(typeof this.options.source==="string"){url=this.options.source;this.source=function(request,response){if(that.xhr){that.xhr.abort();} 528that.xhr=$.ajax({url:url,data:request,dataType:"json",success:function(data){response(data);},error:function(){response([]);}});};}else{this.source=this.options.source;}},_searchTimeout:function(event){clearTimeout(this.searching);this.searching=this._delay(function(){var equalValues=this.term===this._value(),menuVisible=this.menu.element.is(":visible"),modifierKey=event.altKey||event.ctrlKey||event.metaKey||event.shiftKey;if(!equalValues||(equalValues&&!menuVisible&&!modifierKey)){this.selectedItem=null;this.search(null,event);}},this.options.delay);},search:function(value,event){value=value!=null?value:this._value();this.term=this._value();if(value.length<this.options.minLength){return this.close(event);} 529if(this._trigger("search",event)===false){return;} 530return this._search(value);},_search:function(value){this.pending++;this.element.addClass("ui-autocomplete-loading");this.cancelSearch=false;this.source({term:value},this._response());},_response:function(){var index=++this.requestIndex;return $.proxy(function(content){if(index===this.requestIndex){this.__response(content);} 531this.pending--;if(!this.pending){this.element.removeClass("ui-autocomplete-loading");}},this);},__response:function(content){if(content){content=this._normalize(content);} 532this._trigger("response",null,{content:content});if(!this.options.disabled&&content&&content.length&&!this.cancelSearch){this._suggest(content);this._trigger("open");}else{this._close();}},close:function(event){this.cancelSearch=true;this._close(event);},_close:function(event){if(this.menu.element.is(":visible")){this.menu.element.hide();this.menu.blur();this.isNewMenu=true;this._trigger("close",event);}},_change:function(event){if(this.previous!==this._value()){this._trigger("change",event,{item:this.selectedItem});}},_normalize:function(items){if(items.length&&items[0].label&&items[0].value){return items;} 533return $.map(items,function(item){if(typeof item==="string"){return{label:item,value:item};} 534return $.extend({},item,{label:item.label||item.value,value:item.value||item.label});});},_suggest:function(items){var ul=this.menu.element.empty();this._renderMenu(ul,items);this.isNewMenu=true;this.menu.refresh();ul.show();this._resizeMenu();ul.position($.extend({of:this.element},this.options.position));if(this.options.autoFocus){this.menu.next();}},_resizeMenu:function(){var ul=this.menu.element;ul.outerWidth(Math.max(ul.width("").outerWidth()+1,this.element.outerWidth()));},_renderMenu:function(ul,items){var that=this;$.each(items,function(index,item){that._renderItemData(ul,item);});},_renderItemData:function(ul,item){return this._renderItem(ul,item).data("ui-autocomplete-item",item);},_renderItem:function(ul,item){return $("<li>").text(item.label).appendTo(ul);},_move:function(direction,event){if(!this.menu.element.is(":visible")){this.search(null,event);return;} 535if(this.menu.isFirstItem()&&/^previous/.test(direction)||this.menu.isLastItem()&&/^next/.test(direction)){if(!this.isMultiLine){this._value(this.term);} 536this.menu.blur();return;} 537this.menu[direction](event);},widget:function(){return this.menu.element;},_value:function(){return this.valueMethod.apply(this.element,arguments);},_keyEvent:function(keyEvent,event){if(!this.isMultiLine||this.menu.element.is(":visible")){this._move(keyEvent,event);event.preventDefault();}}});$.extend($.ui.autocomplete,{escapeRegex:function(value){return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&");},filter:function(array,term){var matcher=new RegExp($.ui.autocomplete.escapeRegex(term),"i");return $.grep(array,function(value){return matcher.test(value.label||value.value||value);});}});$.widget("ui.autocomplete",$.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(amount){return amount+(amount>1?" results are":" result is")+" available, use up and down arrow keys to navigate.";}}},__response:function(content){var message;this._superApply(arguments);if(this.options.disabled||this.cancelSearch){return;} 538if(content&&content.length){message=this.options.messages.results(content.length);}else{message=this.options.messages.noResults;} 539this.liveRegion.children().hide();$("<div>").text(message).appendTo(this.liveRegion);}});var autocomplete=$.ui.autocomplete;var slider=$.widget("ui.slider",$.ui.mouse,{version:"1.11.3",widgetEventPrefix:"slide",options:{animate:false,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=false;this._mouseSliding=false;this._animateOff=true;this._handleIndex=null;this._detectOrientation();this._mouseInit();this._calculateNewMax();this.element.addClass("ui-slider"+" ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all");this._refresh();this._setOption("disabled",this.options.disabled);this._animateOff=false;},_refresh:function(){this._createRange();this._createHandles();this._setupEvents();this._refreshValue();},_createHandles:function(){var i,handleCount,options=this.options,existingHandles=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),handle="<span class='ui-slider-handle ui-state-default ui-corner-all' tabindex='0'></span>",handles=[];handleCount=(options.values&&options.values.length)||1;if(existingHandles.length>handleCount){existingHandles.slice(handleCount).remove();existingHandles=existingHandles.slice(0,handleCount);} 540for(i=existingHandles.length;i<handleCount;i++){handles.push(handle);} 541this.handles=existingHandles.add($(handles.join("")).appendTo(this.element));this.handle=this.handles.eq(0);this.handles.each(function(i){$(this).data("ui-slider-handle-index",i);});},_createRange:function(){var options=this.options,classes="";if(options.range){if(options.range===true){if(!options.values){options.values=[this._valueMin(),this._valueMin()];}else if(options.values.length&&options.values.length!==2){options.values=[options.values[0],options.values[0]];}else if($.isArray(options.values)){options.values=options.values.slice(0);}} 542if(!this.range||!this.range.length){this.range=$("<div></div>").appendTo(this.element);classes="ui-slider-range"+" ui-widget-header ui-corner-all";}else{this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({"left":"","bottom":""});} 543this.range.addClass(classes+ 544((options.range==="min"||options.range==="max")?" ui-slider-range-"+options.range:""));}else{if(this.range){this.range.remove();} 545this.range=null;}},_setupEvents:function(){this._off(this.handles);this._on(this.handles,this._handleEvents);this._hoverable(this.handles);this._focusable(this.handles);},_destroy:function(){this.handles.remove();if(this.range){this.range.remove();} 546this.element.removeClass("ui-slider"+" ui-slider-horizontal"+" ui-slider-vertical"+" ui-widget"+" ui-widget-content"+" ui-corner-all");this._mouseDestroy();},_mouseCapture:function(event){var position,normValue,distance,closestHandle,index,allowed,offset,mouseOverHandle,that=this,o=this.options;if(o.disabled){return false;} 547this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();position={x:event.pageX,y:event.pageY};normValue=this._normValueFromMouse(position);distance=this._valueMax()-this._valueMin()+1;this.handles.each(function(i){var thisDistance=Math.abs(normValue-that.values(i));if((distance>thisDistance)||(distance===thisDistance&&(i===that._lastChangedValue||that.values(i)===o.min))){distance=thisDistance;closestHandle=$(this);index=i;}});allowed=this._start(event,index);if(allowed===false){return false;} 548this._mouseSliding=true;this._handleIndex=index;closestHandle.addClass("ui-state-active").focus();offset=closestHandle.offset();mouseOverHandle=!$(event.target).parents().addBack().is(".ui-slider-handle");this._clickOffset=mouseOverHandle?{left:0,top:0}:{left:event.pageX-offset.left-(closestHandle.width()/2),top:event.pageY-offset.top- 549(closestHandle.height()/2)- 550(parseInt(closestHandle.css("borderTopWidth"),10)||0)- 551(parseInt(closestHandle.css("borderBottomWidth"),10)||0)+ 552(parseInt(closestHandle.css("marginTop"),10)||0)};if(!this.handles.hasClass("ui-state-hover")){this._slide(event,index,normValue);} 553this._animateOff=true;return true;},_mouseStart:function(){return true;},_mouseDrag:function(event){var position={x:event.pageX,y:event.pageY},normValue=this._normValueFromMouse(position);this._slide(event,this._handleIndex,normValue);return false;},_mouseStop:function(event){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(event,this._handleIndex);this._change(event,this._handleIndex);this._handleIndex=null;this._clickOffset=null;this._animateOff=false;return false;},_detectOrientation:function(){this.orientation=(this.options.orientation==="vertical")?"vertical":"horizontal";},_normValueFromMouse:function(position){var pixelTotal,pixelMouse,percentMouse,valueTotal,valueMouse;if(this.orientation==="horizontal"){pixelTotal=this.elementSize.width;pixelMouse=position.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0);}else{pixelTotal=this.elementSize.height;pixelMouse=position.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0);} 554percentMouse=(pixelMouse/pixelTotal);if(percentMouse>1){percentMouse=1;} 555if(percentMouse<0){percentMouse=0;} 556if(this.orientation==="vertical"){percentMouse=1-percentMouse;} 557valueTotal=this._valueMax()-this._valueMin();valueMouse=this._valueMin()+percentMouse*valueTotal;return this._trimAlignValue(valueMouse);},_start:function(event,index){var uiHash={handle:this.handles[index],value:this.value()};if(this.options.values&&this.options.values.length){uiHash.value=this.values(index);uiHash.values=this.values();} 558return this._trigger("start",event,uiHash);},_slide:function(event,index,newVal){var otherVal,newValues,allowed;if(this.options.values&&this.options.values.length){otherVal=this.values(index?0:1);if((this.options.values.length===2&&this.options.range===true)&&((index===0&&newVal>otherVal)||(index===1&&newVal<otherVal))){newVal=otherVal;} 559if(newVal!==this.values(index)){newValues=this.values();newValues[index]=newVal;allowed=this._trigger("slide",event,{handle:this.handles[index],value:newVal,values:newValues});otherVal=this.values(index?0:1);if(allowed!==false){this.values(index,newVal);}}}else{if(newVal!==this.value()){allowed=this._trigger("slide",event,{handle:this.handles[index],value:newVal});if(allowed!==false){this.value(newVal);}}}}
vendor: 18,921 bytes, lines 559-626
559,_stop:function(event,index){var uiHash={handle:this.handles[index],value:this.value()};if(this.options.values&&this.options.values.length){uiHash.value=this.values(index);uiHash.values=this.values();} 560this._trigger("stop",event,uiHash);},_change:function(event,index){if(!this._keySliding&&!this._mouseSliding){var uiHash={handle:this.handles[index],value:this.value()};if(this.options.values&&this.options.values.length){uiHash.value=this.values(index);uiHash.values=this.values();} 561this._lastChangedValue=index;this._trigger("change",event,uiHash);}},value:function(newValue){if(arguments.length){this.options.value=this._trimAlignValue(newValue);this._refreshValue();this._change(null,0);return;} 562return this._value();},values:function(index,newValue){var vals,newValues,i;if(arguments.length>1){this.options.values[index]=this._trimAlignValue(newValue);this._refreshValue();this._change(null,index);return;} 563if(arguments.length){if($.isArray(arguments[0])){vals=this.options.values;newValues=arguments[0];for(i=0;i<vals.length;i+=1){vals[i]=this._trimAlignValue(newValues[i]);this._change(null,i);} 564this._refreshValue();}else{if(this.options.values&&this.options.values.length){return this._values(index);}else{return this.value();}}}else{return this._values();}},_setOption:function(key,value){var i,valsLength=0;if(key==="range"&&this.options.range===true){if(value==="min"){this.options.value=this._values(0);this.options.values=null;}else if(value==="max"){this.options.value=this._values(this.options.values.length-1);this.options.values=null;}} 565if($.isArray(this.options.values)){valsLength=this.options.values.length;} 566if(key==="disabled"){this.element.toggleClass("ui-state-disabled",!!value);} 567this._super(key,value);switch(key){case"orientation":this._detectOrientation();this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue();this.handles.css(value==="horizontal"?"bottom":"left","");break;case"value":this._animateOff=true;this._refreshValue();this._change(null,0);this._animateOff=false;break;case"values":this._animateOff=true;this._refreshValue();for(i=0;i<valsLength;i+=1){this._change(null,i);} 568this._animateOff=false;break;case"step":case"min":case"max":this._animateOff=true;this._calculateNewMax();this._refreshValue();this._animateOff=false;break;case"range":this._animateOff=true;this._refresh();this._animateOff=false;break;}},_value:function(){var val=this.options.value;val=this._trimAlignValue(val);return val;},_values:function(index){var val,vals,i;if(arguments.length){val=this.options.values[index];val=this._trimAlignValue(val);return val;}else if(this.options.values&&this.options.values.length){vals=this.options.values.slice();for(i=0;i<vals.length;i+=1){vals[i]=this._trimAlignValue(vals[i]);} 569return vals;}else{return[];}},_trimAlignValue:function(val){if(val<=this._valueMin()){return this._valueMin();} 570if(val>=this._valueMax()){return this._valueMax();} 571var step=(this.options.step>0)?this.options.step:1,valModStep=(val-this._valueMin())%step,alignValue=val-valModStep;if(Math.abs(valModStep)*2>=step){alignValue+=(valModStep>0)?step:(-step);} 572return parseFloat(alignValue.toFixed(5));},_calculateNewMax:function(){var max=this.options.max,min=this._valueMin(),step=this.options.step,aboveMin=Math.floor((max-min)/step)*step;max=aboveMin+min;this.max=parseFloat(max.toFixed(this._precision()));},_precision:function(){var precision=this._precisionOf(this.options.step);if(this.options.min!==null){precision=Math.max(precision,this._precisionOf(this.options.min));} 573return precision;},_precisionOf:function(num){var str=num.toString(),decimal=str.indexOf(".");return decimal===-1?0:str.length-decimal-1;},_valueMin:function(){return this.options.min;},_valueMax:function(){return this.max;},_refreshValue:function(){var lastValPercent,valPercent,value,valueMin,valueMax,oRange=this.options.range,o=this.options,that=this,animate=(!this._animateOff)?o.animate:false,_set={};if(this.options.values&&this.options.values.length){this.handles.each(function(i){valPercent=(that.values(i)-that._valueMin())/(that._valueMax()-that._valueMin())*100;_set[that.orientation==="horizontal"?"left":"bottom"]=valPercent+"%";$(this).stop(1,1)[animate?"animate":"css"](_set,o.animate);if(that.options.range===true){if(that.orientation==="horizontal"){if(i===0){that.range.stop(1,1)[animate?"animate":"css"]({left:valPercent+"%"},o.animate);} 574if(i===1){that.range[animate?"animate":"css"]({width:(valPercent-lastValPercent)+"%"},{queue:false,duration:o.animate});}}else{if(i===0){that.range.stop(1,1)[animate?"animate":"css"]({bottom:(valPercent)+"%"},o.animate);} 575if(i===1){that.range[animate?"animate":"css"]({height:(valPercent-lastValPercent)+"%"},{queue:false,duration:o.animate});}}} 576lastValPercent=valPercent;});}else{value=this.value();valueMin=this._valueMin();valueMax=this._valueMax();valPercent=(valueMax!==valueMin)?(value-valueMin)/(valueMax-valueMin)*100:0;_set[this.orientation==="horizontal"?"left":"bottom"]=valPercent+"%";this.handle.stop(1,1)[animate?"animate":"css"](_set,o.animate);if(oRange==="min"&&this.orientation==="horizontal"){this.range.stop(1,1)[animate?"animate":"css"]({width:valPercent+"%"},o.animate);} 577if(oRange==="max"&&this.orientation==="horizontal"){this.range[animate?"animate":"css"]({width:(100-valPercent)+"%"},{queue:false,duration:o.animate});} 578if(oRange==="min"&&this.orientation==="vertical"){this.range.stop(1,1)[animate?"animate":"css"]({height:valPercent+"%"},o.animate);} 579if(oRange==="max"&&this.orientation==="vertical"){this.range[animate?"animate":"css"]({height:(100-valPercent)+"%"},{queue:false,duration:o.animate});}}},_handleEvents:{keydown:function(event){var allowed,curVal,newVal,step,index=$(event.target).data("ui-slider-handle-index");switch(event.keyCode){case $.ui.keyCode.HOME:case $.ui.keyCode.END:case $.ui.keyCode.PAGE_UP:case $.ui.keyCode.PAGE_DOWN:case $.ui.keyCode.UP:case $.ui.keyCode.RIGHT:case $.ui.keyCode.DOWN:case $.ui.keyCode.LEFT:event.preventDefault();if(!this._keySliding){this._keySliding=true;$(event.target).addClass("ui-state-active");allowed=this._start(event,index);if(allowed===false){return;}} 580break;} 581step=this.options.step;if(this.options.values&&this.options.values.length){curVal=newVal=this.values(index);}else{curVal=newVal=this.value();} 582switch(event.keyCode){case $.ui.keyCode.HOME:newVal=this._valueMin();break;case $.ui.keyCode.END:newVal=this._valueMax();break;case $.ui.keyCode.PAGE_UP:newVal=this._trimAlignValue(curVal+((this._valueMax()-this._valueMin())/this.numPages));break;case $.ui.keyCode.PAGE_DOWN:newVal=this._trimAlignValue(curVal-((this._valueMax()-this._valueMin())/this.numPages));break;case $.ui.keyCode.UP:case $.ui.keyCode.RIGHT:if(curVal===this._valueMax()){return;} 583newVal=this._trimAlignValue(curVal+step);break;case $.ui.keyCode.DOWN:case $.ui.keyCode.LEFT:if(curVal===this._valueMin()){return;} 584newVal=this._trimAlignValue(curVal-step);break;} 585this._slide(event,index,newVal);},keyup:function(event){var index=$(event.target).data("ui-slider-handle-index");if(this._keySliding){this._keySliding=false;this._stop(event,index);this._change(event,index);$(event.target).removeClass("ui-state-active");}}}});var tabs=$.widget("ui.tabs",{version:"1.11.3",delay:300,options:{active:null,collapsible:false,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:(function(){var rhash=/#.*$/;return function(anchor){var anchorUrl,locationUrl;anchor=anchor.cloneNode(false);anchorUrl=anchor.href.replace(rhash,"");locationUrl=location.href.replace(rhash,"");try{anchorUrl=decodeURIComponent(anchorUrl);}catch(error){} 586try{locationUrl=decodeURIComponent(locationUrl);}catch(error){} 587return anchor.hash.length>1&&anchorUrl===locationUrl;};})(),_create:function(){var that=this,options=this.options;this.running=false;this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",options.collapsible);this._processTabs();options.active=this._initialActive();if($.isArray(options.disabled)){options.disabled=$.unique(options.disabled.concat($.map(this.tabs.filter(".ui-state-disabled"),function(li){return that.tabs.index(li);}))).sort();} 588if(this.options.active!==false&&this.anchors.length){this.active=this._findActive(options.active);}else{this.active=$();} 589this._refresh();if(this.active.length){this.load(options.active);}},_initialActive:function(){var active=this.options.active,collapsible=this.options.collapsible,locationHash=location.hash.substring(1);if(active===null){if(locationHash){this.tabs.each(function(i,tab){if($(tab).attr("aria-controls")===locationHash){active=i;return false;}});} 590if(active===null){active=this.tabs.index(this.tabs.filter(".ui-tabs-active"));} 591if(active===null||active===-1){active=this.tabs.length?0:false;}} 592if(active!==false){active=this.tabs.index(this.tabs.eq(active));if(active===-1){active=collapsible?false:0;}} 593if(!collapsible&&active===false&&this.anchors.length){active=0;} 594return active;},_getCreateEventData:function(){return{tab:this.active,panel:!this.active.length?$():this._getPanelForTab(this.active)};},_tabKeydown:function(event){var focusedTab=$(this.document[0].activeElement).closest("li"),selectedIndex=this.tabs.index(focusedTab),goingForward=true;if(this._handlePageNav(event)){return;} 595switch(event.keyCode){case $.ui.keyCode.RIGHT:case $.ui.keyCode.DOWN:selectedIndex++;break;case $.ui.keyCode.UP:case $.ui.keyCode.LEFT:goingForward=false;selectedIndex--;break;case $.ui.keyCode.END:selectedIndex=this.anchors.length-1;break;case $.ui.keyCode.HOME:selectedIndex=0;break;case $.ui.keyCode.SPACE:event.preventDefault();clearTimeout(this.activating);this._activate(selectedIndex);return;case $.ui.keyCode.ENTER:event.preventDefault();clearTimeout(this.activating);this._activate(selectedIndex===this.options.active?false:selectedIndex);return;default:return;} 596event.preventDefault();clearTimeout(this.activating);selectedIndex=this._focusNextTab(selectedIndex,goingForward);if(!event.ctrlKey&&!event.metaKey){focusedTab.attr("aria-selected","false");this.tabs.eq(selectedIndex).attr("aria-selected","true");this.activating=this._delay(function(){this.option("active",selectedIndex);},this.delay);}},_panelKeydown:function(event){if(this._handlePageNav(event)){return;} 597if(event.ctrlKey&&event.keyCode===$.ui.keyCode.UP){event.preventDefault();this.active.focus();}},_handlePageNav:function(event){if(event.altKey&&event.keyCode===$.ui.keyCode.PAGE_UP){this._activate(this._focusNextTab(this.options.active-1,false));return true;} 598if(event.altKey&&event.keyCode===$.ui.keyCode.PAGE_DOWN){this._activate(this._focusNextTab(this.options.active+1,true));return true;}},_findNextTab:function(index,goingForward){var lastTabIndex=this.tabs.length-1;function constrain(){if(index>lastTabIndex){index=0;} 599if(index<0){index=lastTabIndex;} 600return index;} 601while($.inArray(constrain(),this.options.disabled)!==-1){index=goingForward?index+1:index-1;} 602return index;},_focusNextTab:function(index,goingForward){index=this._findNextTab(index,goingForward);this.tabs.eq(index).focus();return index;},_setOption:function(key,value){if(key==="active"){this._activate(value);return;} 603if(key==="disabled"){this._setupDisabled(value);return;} 604this._super(key,value);if(key==="collapsible"){this.element.toggleClass("ui-tabs-collapsible",value);if(!value&&this.options.active===false){this._activate(0);}} 605if(key==="event"){this._setupEvents(value);} 606if(key==="heightStyle"){this._setupHeightStyle(value);}},_sanitizeSelector:function(hash){return hash?hash.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):"";},refresh:function(){var options=this.options,lis=this.tablist.children(":has(a[href])");options.disabled=$.map(lis.filter(".ui-state-disabled"),function(tab){return lis.index(tab);});this._processTabs();if(options.active===false||!this.anchors.length){options.active=false;this.active=$();}else if(this.active.length&&!$.contains(this.tablist[0],this.active[0])){if(this.tabs.length===options.disabled.length){options.active=false;this.active=$();}else{this._activate(this._findNextTab(Math.max(0,options.active-1),false));}}else{options.active=this.tabs.index(this.active);} 607this._refresh();},_refresh:function(){this._setupDisabled(this.options.disabled);this._setupEvents(this.options.event);this._setupHeightStyle(this.options.heightStyle);this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1});this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"});if(!this.active.length){this.tabs.eq(0).attr("tabIndex",0);}else{this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0});this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"});}},_processTabs:function(){var that=this,prevTabs=this.tabs,prevAnchors=this.anchors,prevPanels=this.panels;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist").delegate("> li","mousedown"+this.eventNamespace,function(event){if($(this).is(".ui-state-disabled")){event.preventDefault();}}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){if($(this).closest("li").is(".ui-state-disabled")){this.blur();}});this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1});this.anchors=this.tabs.map(function(){return $("a",this)[0];}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1});this.panels=$();this.anchors.each(function(i,anchor){var selector,panel,panelId,anchorId=$(anchor).uniqueId().attr("id"),tab=$(anchor).closest("li"),originalAriaControls=tab.attr("aria-controls");if(that._isLocal(anchor)){selector=anchor.hash;panelId=selector.substring(1);panel=that.element.find(that._sanitizeSelector(selector));}else{panelId=tab.attr("aria-controls")||$({}).uniqueId()[0].id;selector="#"+panelId;panel=that.element.find(selector);if(!panel.length){panel=that._createPanel(panelId);panel.insertAfter(that.panels[i-1]||that.tablist);} 608panel.attr("aria-live","polite");} 609if(panel.length){that.panels=that.panels.add(panel);} 610if(originalAriaControls){tab.data("ui-tabs-aria-controls",originalAriaControls);} 611tab.attr({"aria-controls":panelId,"aria-labelledby":anchorId});panel.attr("aria-labelledby",anchorId);});this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel");if(prevTabs){this._off(prevTabs.not(this.tabs));this._off(prevAnchors.not(this.anchors));this._off(prevPanels.not(this.panels));}},_getList:function(){return this.tablist||this.element.find("ol,ul").eq(0);},_createPanel:function(id){return $("<div>").attr("id",id).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",true);},_setupDisabled:function(disabled){if($.isArray(disabled)){if(!disabled.length){disabled=false;}else if(disabled.length===this.anchors.length){disabled=true;}} 612for(var i=0,li;(li=this.tabs[i]);i++){if(disabled===true||$.inArray(i,disabled)!==-1){$(li).addClass("ui-state-disabled").attr("aria-disabled","true");}else{$(li).removeClass("ui-state-disabled").removeAttr("aria-disabled");}} 613this.options.disabled=disabled;},_setupEvents:function(event){var events={};if(event){$.each(event.split(" "),function(index,eventName){events[eventName]="_eventHandler";});} 614this._off(this.anchors.add(this.tabs).add(this.panels));this._on(true,this.anchors,{click:function(event){event.preventDefault();}});this._on(this.anchors,events);this._on(this.tabs,{keydown:"_tabKeydown"});this._on(this.panels,{keydown:"_panelKeydown"});this._focusable(this.tabs);this._hoverable(this.tabs);},_setupHeightStyle:function(heightStyle){var maxHeight,parent=this.element.parent();if(heightStyle==="fill"){maxHeight=parent.height();maxHeight-=this.element.outerHeight()-this.element.height();this.element.siblings(":visible").each(function(){var elem=$(this),position=elem.css("position");if(position==="absolute"||position==="fixed"){return;} 615maxHeight-=elem.outerHeight(true);});this.element.children().not(this.panels).each(function(){maxHeight-=$(this).outerHeight(true);});this.panels.each(function(){$(this).height(Math.max(0,maxHeight- 616$(this).innerHeight()+$(this).height()));}).css("overflow","auto");}else if(heightStyle==="auto"){maxHeight=0;this.panels.each(function(){maxHeight=Math.max(maxHeight,$(this).height("").height());}).height(maxHeight);}},_eventHandler:function(event){var options=this.options,active=this.active,anchor=$(event.currentTarget),tab=anchor.closest("li"),clickedIsActive=tab[0]===active[0],collapsing=clickedIsActive&&options.collapsible,toShow=collapsing?$():this._getPanelForTab(tab),toHide=!active.length?$():this._getPanelForTab(active),eventData={oldTab:active,oldPanel:toHide,newTab:collapsing?$():tab,newPanel:toShow};event.preventDefault();if(tab.hasClass("ui-state-disabled")||tab.hasClass("ui-tabs-loading")||this.running||(clickedIsActive&&!options.collapsible)||(this._trigger("beforeActivate",event,eventData)===false)){return;} 617options.active=collapsing?false:this.tabs.index(tab);this.active=clickedIsActive?$():tab;if(this.xhr){this.xhr.abort();} 618if(!toHide.length&&!toShow.length){$.error("jQuery UI Tabs: Mismatching fragment identifier.");} 619if(toShow.length){this.load(this.tabs.index(tab),event);} 620this._toggle(event,eventData);},_toggle:function(event,eventData){var that=this,toShow=eventData.newPanel,toHide=eventData.oldPanel;this.running=true;function complete(){that.running=false;that._trigger("activate",event,eventData);} 621function show(){eventData.newTab.closest("li").addClass("ui-tabs-active ui-state-active");if(toShow.length&&that.options.show){that._show(toShow,that.options.show,complete);}else{toShow.show();complete();}} 622if(toHide.length&&this.options.hide){this._hide(toHide,this.options.hide,function(){eventData.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active");show();});}else{eventData.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active");toHide.hide();show();} 623toHide.attr("aria-hidden","true");eventData.oldTab.attr({"aria-selected":"false","aria-expanded":"false"});if(toShow.length&&toHide.length){eventData.oldTab.attr("tabIndex",-1);}else if(toShow.length){this.tabs.filter(function(){return $(this).attr("tabIndex")===0;}).attr("tabIndex",-1);} 624toShow.attr("aria-hidden","false");eventData.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0});},_activate:function(index){var anchor,active=this._findActive(index);if(active[0]===this.active[0]){return;} 625if(!active.length){active=this.active;} 626anchor=active.find(".ui-tabs-anchor")[0];this._eventHandler({target:anchor,currentTarget:anchor,preventDefault:$.noop});},_findActive:function(index){return index===false?$():this.tabs.eq(index);}
vendor: 8,820 bytes, lines 626-660
626,_getIndex:function(index){if(typeof index==="string"){index=this.anchors.index(this.anchors.filter("[href$='"+index+"']"));} 627return index;},_destroy:function(){if(this.xhr){this.xhr.abort();} 628this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible");this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role");this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeUniqueId();this.tablist.unbind(this.eventNamespace);this.tabs.add(this.panels).each(function(){if($.data(this,"ui-tabs-destroy")){$(this).remove();}else{$(this).removeClass("ui-state-default ui-state-active ui-state-disabled "+"ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role");}});this.tabs.each(function(){var li=$(this),prev=li.data("ui-tabs-aria-controls");if(prev){li.attr("aria-controls",prev).removeData("ui-tabs-aria-controls");}else{li.removeAttr("aria-controls");}});this.panels.show();if(this.options.heightStyle!=="content"){this.panels.css("height","");}},enable:function(index){var disabled=this.options.disabled;if(disabled===false){return;} 629if(index===undefined){disabled=false;}else{index=this._getIndex(index);if($.isArray(disabled)){disabled=$.map(disabled,function(num){return num!==index?num:null;});}else{disabled=$.map(this.tabs,function(li,num){return num!==index?num:null;});}} 630this._setupDisabled(disabled);},disable:function(index){var disabled=this.options.disabled;if(disabled===true){return;} 631if(index===undefined){disabled=true;}else{index=this._getIndex(index);if($.inArray(index,disabled)!==-1){return;} 632if($.isArray(disabled)){disabled=$.merge([index],disabled).sort();}else{disabled=[index];}} 633this._setupDisabled(disabled);},load:function(index,event){index=this._getIndex(index);var that=this,tab=this.tabs.eq(index),anchor=tab.find(".ui-tabs-anchor"),panel=this._getPanelForTab(tab),eventData={tab:tab,panel:panel};if(this._isLocal(anchor[0])){return;} 634this.xhr=$.ajax(this._ajaxSettings(anchor,event,eventData));if(this.xhr&&this.xhr.statusText!=="canceled"){tab.addClass("ui-tabs-loading");panel.attr("aria-busy","true");this.xhr.success(function(response){setTimeout(function(){panel.html(response);that._trigger("load",event,eventData);},1);}).complete(function(jqXHR,status){setTimeout(function(){if(status==="abort"){that.panels.stop(false,true);} 635tab.removeClass("ui-tabs-loading");panel.removeAttr("aria-busy");if(jqXHR===that.xhr){delete that.xhr;}},1);});}},_ajaxSettings:function(anchor,event,eventData){var that=this;return{url:anchor.attr("href"),beforeSend:function(jqXHR,settings){return that._trigger("beforeLoad",event,$.extend({jqXHR:jqXHR,ajaxSettings:settings},eventData));}};},_getPanelForTab:function(tab){var id=$(tab).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+id));}});var tooltip=$.widget("ui.tooltip",{version:"1.11.3",options:{content:function(){var title=$(this).attr("title")||"";return $("<a>").text(title).html();},hide:true,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:true,tooltipClass:null,track:false,close:null,open:null},_addDescribedBy:function(elem,id){var describedby=(elem.attr("aria-describedby")||"").split(/\s+/);describedby.push(id);elem.data("ui-tooltip-id",id).attr("aria-describedby",$.trim(describedby.join(" ")));},_removeDescribedBy:function(elem){var id=elem.data("ui-tooltip-id"),describedby=(elem.attr("aria-describedby")||"").split(/\s+/),index=$.inArray(id,describedby);if(index!==-1){describedby.splice(index,1);} 636elem.removeData("ui-tooltip-id");describedby=$.trim(describedby.join(" "));if(describedby){elem.attr("aria-describedby",describedby);}else{elem.removeAttr("aria-describedby");}},_create:function(){this._on({mouseover:"open",focusin:"open"});this.tooltips={};this.parents={};if(this.options.disabled){this._disable();} 637this.liveRegion=$("<div>").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body);},_setOption:function(key,value){var that=this;if(key==="disabled"){this[value?"_disable":"_enable"]();this.options[key]=value;return;} 638this._super(key,value);if(key==="content"){$.each(this.tooltips,function(id,tooltipData){that._updateContent(tooltipData.element);});}},_disable:function(){var that=this;$.each(this.tooltips,function(id,tooltipData){var event=$.Event("blur");event.target=event.currentTarget=tooltipData.element[0];that.close(event,true);});this.element.find(this.options.items).addBack().each(function(){var element=$(this);if(element.is("[title]")){element.data("ui-tooltip-title",element.attr("title")).removeAttr("title");}});},_enable:function(){this.element.find(this.options.items).addBack().each(function(){var element=$(this);if(element.data("ui-tooltip-title")){element.attr("title",element.data("ui-tooltip-title"));}});},open:function(event){var that=this,target=$(event?event.target:this.element).closest(this.options.items);if(!target.length||target.data("ui-tooltip-id")){return;} 639if(target.attr("title")){target.data("ui-tooltip-title",target.attr("title"));} 640target.data("ui-tooltip-open",true);if(event&&event.type==="mouseover"){target.parents().each(function(){var parent=$(this),blurEvent;if(parent.data("ui-tooltip-open")){blurEvent=$.Event("blur");blurEvent.target=blurEvent.currentTarget=this;that.close(blurEvent,true);} 641if(parent.attr("title")){parent.uniqueId();that.parents[this.id]={element:this,title:parent.attr("title")};parent.attr("title","");}});} 642this._updateContent(target,event);},_updateContent:function(target,event){var content,contentOption=this.options.content,that=this,eventType=event?event.type:null;if(typeof contentOption==="string"){return this._open(event,target,contentOption);} 643content=contentOption.call(target[0],function(response){if(!target.data("ui-tooltip-open")){return;} 644that._delay(function(){if(event){event.type=eventType;} 645this._open(event,target,response);});});if(content){this._open(event,target,content);}},_open:function(event,target,content){var tooltipData,tooltip,events,delayedShow,a11yContent,positionOption=$.extend({},this.options.position);if(!content){return;} 646tooltipData=this._find(target);if(tooltipData){tooltipData.tooltip.find(".ui-tooltip-content").html(content);return;} 647if(target.is("[title]")){if(event&&event.type==="mouseover"){target.attr("title","");}else{target.removeAttr("title");}} 648tooltipData=this._tooltip(target);tooltip=tooltipData.tooltip;this._addDescribedBy(target,tooltip.attr("id"));tooltip.find(".ui-tooltip-content").html(content);this.liveRegion.children().hide();if(content.clone){a11yContent=content.clone();a11yContent.removeAttr("id").find("[id]").removeAttr("id");}else{a11yContent=content;} 649$("<div>").html(a11yContent).appendTo(this.liveRegion);function position(event){positionOption.of=event;if(tooltip.is(":hidden")){return;} 650tooltip.position(positionOption);} 651if(this.options.track&&event&&/^mouse/.test(event.type)){this._on(this.document,{mousemove:position});position(event);}else{tooltip.position($.extend({of:target},this.options.position));} 652tooltip.hide();this._show(tooltip,this.options.show);if(this.options.show&&this.options.show.delay){delayedShow=this.delayedShow=setInterval(function(){if(tooltip.is(":visible")){position(positionOption.of);clearInterval(delayedShow);}},$.fx.interval);} 653this._trigger("open",event,{tooltip:tooltip});events={keyup:function(event){if(event.keyCode===$.ui.keyCode.ESCAPE){var fakeEvent=$.Event(event);fakeEvent.currentTarget=target[0];this.close(fakeEvent,true);}}};if(target[0]!==this.element[0]){events.remove=function(){this._removeTooltip(tooltip);};} 654if(!event||event.type==="mouseover"){events.mouseleave="close";} 655if(!event||event.type==="focusin"){events.focusout="close";} 656this._on(true,target,events);},close:function(event){var tooltip,that=this,target=$(event?event.currentTarget:this.element),tooltipData=this._find(target);if(!tooltipData){return;} 657tooltip=tooltipData.tooltip;if(tooltipData.closing){return;} 658clearInterval(this.delayedShow);if(target.data("ui-tooltip-title")&&!target.attr("title")){target.attr("title",target.data("ui-tooltip-title"));} 659this._removeDescribedBy(target);tooltipData.hiding=true;tooltip.stop(true);this._hide(tooltip,this.options.hide,function(){that._removeTooltip($(this));});target.removeData("ui-tooltip-open");this._off(target,"mouseleave focusout keyup");if(target[0]!==this.element[0]){this._off(target,"remove");} 660this._off(this.document,"mousemove");
660if(event&&event.type==="mouseleave"){$.each(this.parents,function(id,parent){$(parent.element).attr("title",parent.title);delete that.parents[id];});} 661tooltipData.closing=true;this._trigger("close",event,{tooltip:tooltip});if(!tooltipData.hiding){tooltipData.closing=false;}},_tooltip:function(element){var tooltip=$("<div>").attr("role","tooltip").addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+ 662(this.options.tooltipClass||"")),id=tooltip.uniqueId().attr("id");$("<div>").addClass("ui-tooltip-content").appendTo(tooltip);tooltip.appendTo(this.document[0].body);return this.tooltips[id]={element:element,tooltip:tooltip};},_find:function(target){var id=target.data("ui-tooltip-id");return id?this.tooltips[id]:null;},_removeTooltip:function(tooltip){tooltip.remove();delete this.tooltips[tooltip.attr("id")];},_destroy:function(){var that=this;$.each(this.tooltips,function(id,tooltipData){var event=$.Event("blur"),element=tooltipData.element;event.target=event.currentTarget=element[0];that.close(event,true);$("#"+id).remove();if(element.data("ui-tooltip-title")){if(!element.attr("title")){element.attr("title",element.data("ui-tooltip-title"));} 663element.removeData("ui-tooltip-title");}});this.liveRegion.remove();}});}));(function($,undef) 664{if($.fn.dotdotdot) 665{return;} 666$.fn.dotdotdot=function(o) 667{if(this.length==0) 668{$.fn.dotdotdot.debug('No element found for "'+this.selector+'".');return this;} 669if(this.length>1) 670{return this.each(function() 671{$(this).dotdotdot(o);});} 672var $dot=this;if($dot.data('dotdotdot')) 673{$dot.trigger('destroy.dot');} 674$dot.data('dotdotdot-style',$dot.attr('style')||'');$dot.css('word-wrap','break-word');if($dot.css('white-space')==='nowrap') 675{$dot.css('white-space','normal');} 676$dot.bind_events=function() 677{$dot.bind('update.dot',function(e,c) 678{e.preventDefault();e.stopPropagation();opts.maxHeight=(typeof opts.height=='number')?opts.height:getTrueInnerHeight($dot);opts.maxHeight+=opts.tolerance;if(typeof c!='undefined') 679{if(typeof c=='string'||('nodeType'in c&&c.nodeType===1)) 680{c=$('<div />').append(c).contents();} 681if(c instanceof $) 682{orgContent=c;}} 683$inr=$dot.wrapInner('<div class="dotdotdot" />').children();$inr.contents().detach().end().append(orgContent.clone(true)).find('br').replaceWith(' <br /> ').end().css({'height':'auto','width':'auto','border':'none','padding':0,'margin':0});var after=false,trunc=false;if(conf.afterElement) 684{after=conf.afterElement.clone(true);after.show();conf.afterElement.detach();} 685if(test($inr,opts)) 686{if(opts.wrap=='children') 687{trunc=children($inr,opts,after);} 688else 689{trunc=ellipsis($inr,$dot,$inr,opts,after);}} 690$inr.replaceWith($inr.contents());$inr=null;if($.isFunction(opts.callback)) 691{opts.callback.call($dot[0],trunc,orgContent);} 692conf.isTruncated=trunc;return trunc;}).bind('isTruncated.dot',function(e,fn) 693{e.preventDefault();e.stopPropagation();if(typeof fn=='function') 694{fn.call($dot[0],conf.isTruncated);} 695return conf.isTruncated;}).bind('originalContent.dot',function(e,fn) 696{e.preventDefault();e.stopPropagation();if(typeof fn=='function') 697{fn.call($dot[0],orgContent);} 698return orgContent;}).bind('destroy.dot',function(e) 699{e.preventDefault();e.stopPropagation();$dot.unwatch().unbind_events().contents().detach().end().append(orgContent).attr('style',$dot.data('dotdotdot-style')||'').data('dotdotdot',false);});return $dot;};$dot.unbind_events=function() 700{$dot.unbind('.dot');return $dot;};$dot.watch=function() 701{$dot.unwatch();if(opts.watch=='window') 702{var $window=$(window),_wWidth=$window.width(),_wHeight=$window.height();$window.bind('resize.dot'+conf.dotId,function() 703{if(_wWidth!=$window.width()||_wHeight!=$window.height()||!opts.windowResizeFix) 704{_wWidth=$window.width();_wHeight=$window.height();if(watchInt) 705{clearInterval(watchInt);} 706watchInt=setTimeout(function() 707{$dot.trigger('update.dot');},100);}});} 708else 709{watchOrg=getSizes($dot);watchInt=setInterval(function() 710{if($dot.is(':visible')) 711{var watchNew=getSizes($dot);if(watchOrg.width!=watchNew.width||watchOrg.height!=watchNew.height) 712{$dot.trigger('update.dot');watchOrg=watchNew;}}},500);} 713return $dot;};$dot.unwatch=function() 714{$(window).unbind('resize.dot'+conf.dotId);if(watchInt) 715{clearInterval(watchInt);} 716return $dot;};var orgContent=$dot.contents(),opts=$.extend(true,{},$.fn.dotdotdot.defaults,o),conf={},watchOrg={},watchInt=null,$inr=null;if(!(opts.lastCharacter.remove instanceof Array)) 717{opts.lastCharacter.remove=$.fn.dotdotdot.defaultArrays.lastCharacter.remove;}
718if(!(opts.lastCharacter.noEllipsis instanceof Array)) 719{opts.lastCharacter.noEllipsis=$.fn.dotdotdot.defaultArrays.lastCharacter.noEllipsis;} 720conf.afterElement=getElement(opts.after,$dot);conf.isTruncated=false;conf.dotId=dotId++;$dot.data('dotdotdot',true).bind_events().trigger('update.dot');if(opts.watch) 721{$dot.watch();} 722return $dot;};$.fn.dotdotdot.defaults={'ellipsis':'... ','wrap':'word','fallbackToLetter':true,'lastCharacter':{},'tolerance':0,'callback':null,'after':null,'height':null,'watch':false,'windowResizeFix':true};$.fn.dotdotdot.defaultArrays={'lastCharacter':{'remove':[' ','\u3000',',',';','.','!','?'],'noEllipsis':[]}};$.fn.dotdotdot.debug=function(msg){};var dotId=1;function children($elem,o,after) 723{var $elements=$elem.children(),isTruncated=false;$elem.empty();for(var a=0,l=$elements.length;a<l;a++) 724{var $e=$elements.eq(a);$elem.append($e);if(after) 725{$elem.append(after);} 726if(test($elem,o)) 727{$e.remove();isTruncated=true;break;} 728else 729{if(after) 730{after.detach();}}} 731return isTruncated;} 732function ellipsis($elem,$d,$i,o,after) 733{var isTruncated=false;var notx='a table, thead, tbody, tfoot, tr, col, colgroup, object, embed, param, ol, ul, dl, blockquote, select, optgroup, option, textarea, script, style';var noty='script, .dotdotdot-keep';$elem.contents().detach().each(function() 734{var e=this,$e=$(e);if(typeof e=='undefined'||(e.nodeType==3&&$.trim(e.data).length==0)) 735{return true;} 736else if($e.is(noty)) 737{$elem.append($e);} 738else if(isTruncated) 739{return true;} 740else 741{$elem.append($e);if(after&&!$e.is(o.after)&&!$e.find(o.after).length) 742{$elem[$elem.is(notx)?'after':'append'](after);} 743if(test($i,o)) 744{if(e.nodeType==3) 745{isTruncated=ellipsisElement($e,$d,$i,o,after);} 746else 747{isTruncated=ellipsis($e,$d,$i,o,after);} 748if(!isTruncated) 749{$e.detach();isTruncated=true;}} 750if(!isTruncated) 751{if(after) 752{after.detach();}}}});return isTruncated;} 753function ellipsisElement($e,$d,$i,o,after) 754{var e=$e[0];if(!e) 755{return false;} 756var txt=getTextContent(e),space=(txt.indexOf(' ')!==-1)?' ':'\u3000',separator=(o.wrap=='letter')?'':space,textArr=txt.split(separator),position=-1,midPos=-1,startPos=0,endPos=textArr.length-1;if(o.fallbackToLetter&&startPos==0&&endPos==0) 757{separator='';textArr=txt.split(separator);endPos=textArr.length-1;} 758while(startPos<=endPos&&!(startPos==0&&endPos==0)) 759{var m=Math.floor((startPos+endPos)/2);if(m==midPos) 760{break;} 761midPos=m;setTextContent(e,textArr.slice(0,midPos+1).join(separator)+o.ellipsis);if(!test($i,o)) 762{position=midPos;startPos=midPos;} 763else 764{endPos=midPos;if(o.fallbackToLetter&&startPos==0&&endPos==0) 765{separator='';textArr=textArr[0].split(separator);position=-1;midPos=-1;startPos=0;endPos=textArr.length-1;}}} 766if(position!=-1&&!(textArr.length==1&&textArr[0].length==0)) 767{txt=addEllipsis(textArr.slice(0,position+1).join(separator),o);setTextContent(e,txt);} 768else 769{var $w=$e.parent();$e.detach();var afterLength=(after&&after.closest($w).length)?after.length:0;if($w.contents().length>afterLength) 770{e=findLastTextNode($w.contents().eq(-1-afterLength),$d);} 771else 772{e=findLastTextNode($w,$d,true);if(!afterLength) 773{$w.detach();}} 774if(e) 775{txt=addEllipsis(getTextContent(e),o);setTextContent(e,txt);if(afterLength&&after) 776{$(e).parent().append(after);}}} 777return true;} 778function test($i,o) 779{return $i.innerHeight()>o.maxHeight;} 780function addEllipsis(txt,o) 781{while($.inArray(txt.slice(-1),o.lastCharacter.remove)>-1) 782{txt=txt.slice(0,-1);} 783if($.inArray(txt.slice(-1),o.lastCharacter.noEllipsis)<0) 784{txt+=o.ellipsis;} 785return txt;} 786function getSizes($d) 787{return{'width':$d.innerWidth(),'height':$d.innerHeight()};} 788function setTextContent(e,content) 789{if(e.innerText) 790{e.innerText=content;} 791else if(e.nodeValue) 792{e.nodeValue=content;} 793else if(e.textContent) 794{e.textContent=content;}} 795function getTextContent(e) 796{if(e.innerText) 797{return e.innerText;} 798else if(e.nodeValue) 799{return e.nodeValue;} 800else if(e.textContent) 801{return e.textContent;} 802else 803{return"";}} 804function getPrevNode(n) 805{do 806{n=n.previousSibling;} 807while(n&&n.nodeType!==1&&n.nodeType!==3);return n;} 808function findLastTextNode($el,$top,excludeCurrent) 809{var e=$el&&$el[0],p;if(e) 810{if(!excludeCurrent) 811{if(e.nodeType===3) 812{return e;} 813if($.trim($el.text()))
814{return findLastTextNode($el.contents().last(),$top);}} 815p=getPrevNode(e);while(!p) 816{$el=$el.parent();if($el.is($top)||!$el.length) 817{return false;} 818p=getPrevNode($el[0]);} 819if(p) 820{return findLastTextNode($(p),$top);}} 821return false;} 822function getElement(e,$i) 823{if(!e) 824{return false;} 825if(typeof e==='string') 826{e=$(e,$i);return(e.length)?e:false;} 827return!e.jquery?false:e;} 828function getTrueInnerHeight($el) 829{var h=$el.innerHeight(),a=['paddingTop','paddingBottom'];for(var z=0,l=a.length;z<l;z++) 830{var m=parseInt($el.css(a[z]),10);if(isNaN(m)) 831{m=0;} 832h-=m;} 833return h;} 834var _orgHtml=$.fn.html;$.fn.html=function(str) 835{if(str!=undef&&!$.isFunction(str)&&this.data('dotdotdot')) 836{return this.trigger('update',[str]);} 837return _orgHtml.apply(this,arguments);};var _orgText=$.fn.text;$.fn.text=function(str) 838{if(str!=undef&&!$.isFunction(str)&&this.data('dotdotdot')) 839{str=$('<div />').text(str).html();return this.trigger('update',[str]);} 840return _orgText.apply(this,arguments);};})(jQuery);(function($){$.fn.hoverIntent=function(handlerIn,handlerOut,selector){var cfg={interval:100,sensitivity:7,timeout:0};if(typeof handlerIn==="object"){cfg=$.extend(cfg,handlerIn);}else if($.isFunction(handlerOut)){cfg=$.extend(cfg,{over:handlerIn,out:handlerOut,selector:selector});}else{cfg=$.extend(cfg,{over:handlerIn,out:handlerIn,selector:handlerOut});} 841var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).off("mousemove.hoverIntent",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev]);}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev]);};var handleHover=function(e){var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);} 842if(e.type=="mouseenter"){pX=ev.pageX;pY=ev.pageY;$(ob).on("mousemove.hoverIntent",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}}else{$(ob).off("mousemove.hoverIntent",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob);},cfg.timeout);}}};return this.on({'mouseenter.hoverIntent':handleHover,'mouseleave.hoverIntent':handleHover},cfg.selector);};})(jQuery);(function(){"use strict";var $,EkkoLightbox;$=jQuery;EkkoLightbox=function(element,options){var content,footer,header,_this=this;this.options=$.extend({title:null,footer:null,remote:null},$.fn.ekkoLightbox.defaults,options||{});this.$element=$(element);content='';this.modal_id=this.options.modal_id?this.options.modal_id:'ekkoLightbox-'+Math.floor((Math.random()*1000)+1);header='<div class="modal-header"'+(this.options.title||this.options.always_show_close?'':' style="display:none"')+'><button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button><h4 class="modal-title">'+(this.options.title||" ")+'</h4></div>';footer='<div class="modal-footer"'+(this.options.footer?'':' style="display:none"')+'>'+this.options.footer+'</div>';$(document.body).append('<div id="'+this.modal_id+'" class="ekko-lightbox modal fade" tabindex="-1"><div class="modal-dialog"><div class="modal-content">'+header+'<div class="modal-body"><div class="ekko-lightbox-container"><div></div></div></div>'+footer+'</div></div></div>');this.modal=$('#'+this.modal_id);this.modal_dialog=this.modal.find('.modal-dialog').first();this.modal_content=this.modal.find('.modal-content').first();this.modal_body=this.modal.find('.modal-body').first();this.lightbox_container=this.modal_body.find('.ekko-lightbox-container').first();this.lightbox_body=this.lightbox_container.find('> div:first-child').first();this.showLoading();this.modal_arrows=null;this.border={top:parseFloat(this.modal_dialog.css('border-top-width'))+parseFloat(this.modal_content.css('border-top-width'))+parseFloat(this.modal_body.css('border-top-width')),right:parseFloat(this.modal_dialog.css('border-right-width'))+parseFloat(this.modal_content.css('border-right-width'))+parseFloat(this.modal_body.css('border-right-width')),bottom:parseFloat(this.modal_dialog.css('border-bottom-width'))+parseFloat(this.modal_content.css('border-bottom-width'))+parseFloat(this.modal_body.css('border-bottom-width')),left:parseFloat(this.modal_dialog.css('border-left-width'))+parseFloat(this.modal_content.css('border-left-width'))+parseFloat(this.modal_body.css('border-left-width'))};this.padding={top:parseFloat(this.modal_dialog.css('padding-top'))+parseFloat(this.modal_content.css('padding-top'))+parseFloat(this.modal_body.css('padding-top')),right:parseFloat(this.modal_dialog.css('padding-right'))+parseFloat(this.modal_content.css('padding-right'))+parseFloat(this.modal_body.css('padding-right')),bottom:parseFloat(this.modal_dialog.css('padding-bottom'))+parseFloat(this.modal_content.css('padding-bottom'))+parseFloat(this.modal_body.css('padding-bottom')),left:parseFloat(this.modal_dialog.css('padding-left'))+parseFloat(this.modal_content.css('padding-left'))+parseFloat(this.modal_body.css('padding-left'))};this.modal.on('show.bs.modal',this.options.onShow.bind(this)).on('shown.bs.modal',function(){_this.modal_shown();return _this.options.onShown.call(_this);}).on('hide.bs.modal',this.options.onHide.bind(this)).on('hidden.bs.modal',function(){if(_this.gallery){$(document).off('keydown.ekkoLightbox');} 843_this.modal.remove();return _this.options.onHidden.call(_this);}).modal('show',options);return this.modal;};EkkoLightbox.prototype={modal_shown:function(){var video_id,_this=this;if(!this.options.remote){return this.error('No remote target given');}else{this.gallery=this.$element.data('gallery');if(this.gallery){if(this.options.gallery_parent_selector==='document.body'||this.options.gallery_parent_selector===''){this.gallery_items=$(document.body).find('*[data-toggle="lightbox"][data-gallery="'+this.gallery+'"]');}else{this.gallery_items=this.$element.parents(this.options.gallery_parent_selector).first().find('*[data-toggle="lightbox"][data-gallery="'+this.gallery+'"]');} 844this.gallery_index=this.gallery_items.index(this.$element);$(document).on('keydown.ekkoLightbox',this.navigate.bind(this));if(this.options.directional_arrows&&this.gallery_items.length>1){this.lightbox_container.prepend('<div class="ekko-lightbox-nav-overlay"><a href="#" class="'+this.strip_stops(this.options.left_arrow_class)+'"></a><a href="#" class="'+this.strip_stops(this.options.right_arrow_class)+'"></a></div>');this.modal_arrows=this.lightbox_container.find('div.ekko-lightbox-nav-overlay').first();this.lightbox_container.find('a'+this.strip_spaces(this.options.left_arrow_class)).on('click',function(event){event.preventDefault();return _this.navigate_left();});this.lightbox_container.find('a'+this.strip_spaces(this.options.right_arrow_class)).on('click',function(event){event.preventDefault();return _this.navigate_right();});}} 845if(this.options.type){if(this.options.type==='image'){return this.preloadImage(this.options.remote,true);}else if(this.options.type==='youtube'&&(video_id=this.getYoutubeId(this.options.remote))){return this.showYoutubeVideo(video_id);}else if(this.options.type==='vimeo'){return this.showVimeoVideo(this.options.remote);}else if(this.options.type==='instagram'){return this.showInstagramVideo(this.options.remote);}else if(this.options.type==='url'){return this.showInstagramVideo(this.options.remote);}else{return this.error("Could not detect remote target type. Force the type using data-type=\"image|youtube|vimeo|url\"");}}else{return this.detectRemoteType(this.options.remote);}}},strip_stops:function(str){return str.replace(/\./g,'');},strip_spaces:function(str){return str.replace(/\s/g,'');},isImage:function(str){return str.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i);},isSwf:function(str){return str.match(/\.(swf)((\?|#).*)?$/i);},getYoutubeId:function(str){var match;match=str.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/);if(match&&match[2].length===11){return match[2];}else{return false;}},getVimeoId:function(str){if(str.indexOf('vimeo')>0){return str;}else{return false;}},getInstagramId:function(str){if(str.indexOf('instagram')>0){return str;}else{return false;}},navigate:function(event){event=event||window.event;if(event.keyCode===39||event.keyCode===37){if(event.keyCode===39){return this.navigate_right();}else if(event.keyCode===37){return this.navigate_left();}}},navigateTo:function(index){var next,src;if(index<0||index>this.gallery_items.length-1){return this;} 846this.showLoading();this.gallery_index=index;this.options.onNavigate.call(this,this.gallery_index);this.$element=$(this.gallery_items.get(this.gallery_index));this.updateTitleAndFooter();src=this.$element.attr('data-remote')||this.$element.attr('href');this.detectRemoteType(src,this.$element.attr('data-type')||false);
846if(this.gallery_index+1<this.gallery_items.length){next=$(this.gallery_items.get(this.gallery_index+1),false);src=next.attr('data-remote')||next.attr('href');if(next.attr('data-type')==='image'||this.isImage(src)){return this.preloadImage(src,false);}}},navigate_left:function(){if(this.gallery_items.length===1){return;} 847if(this.gallery_index===0){this.gallery_index=this.gallery_items.length-1;}else{this.gallery_index--;} 848this.options.onNavigate.call(this,'left',this.gallery_index);return this.navigateTo(this.gallery_index);},navigate_right:function(){if(this.gallery_items.length===1){return;} 849if(this.gallery_index===this.gallery_items.length-1){this.gallery_index=0;}else{this.gallery_index++;} 850this.options.onNavigate.call(this,'right',this.gallery_index);return this.navigateTo(this.gallery_index);},detectRemoteType:function(src,type){var video_id;if(type==='image'||this.isImage(src)){this.options.type='image';return this.preloadImage(src,true);}else if(type==='youtube'||(video_id=this.getYoutubeId(src))){this.options.type='youtube';return this.showYoutubeVideo(video_id);}else if(type==='vimeo'||(video_id=this.getVimeoId(src))){this.options.type='vimeo';return this.showVimeoVideo(video_id);}else if(type==='instagram'||(video_id=this.getInstagramId(src))){this.options.type='instagram';return this.showInstagramVideo(video_id);}else if(type==='url'||(video_id=this.getInstagramId(src))){this.options.type='instagram';return this.showInstagramVideo(video_id);}else{this.options.type='url';return this.loadRemoteContent(src);}},updateTitleAndFooter:function(){var caption,footer,header,title;header=this.modal_content.find('.modal-header');footer=this.modal_content.find('.modal-footer');title=this.$element.data('title')||"";caption=this.$element.data('footer')||"";if(title||this.options.always_show_close){header.css('display','').find('.modal-title').html(title||" ");}else{header.css('display','none');} 851if(caption){footer.css('display','').html(caption);}else{footer.css('display','none');} 852return this;},showLoading:function(){this.lightbox_body.html('<div class="modal-loading">Loading..</div>');return this;},showYoutubeVideo:function(id){var aspectRatio,height,width;aspectRatio=560/315;width=this.$element.data('width')||560;width=this.checkDimensions(width);height=width/aspectRatio;this.resize(width);this.lightbox_body.html('<iframe width="'+width+'" height="'+height+'" src="//www.youtube.com/embed/'+id+'?badge=0&autoplay=1&html5=1" frameborder="0" allowfullscreen></iframe>');this.options.onContentLoaded.call(this);if(this.modal_arrows){return this.modal_arrows.css('display','none');}},showVimeoVideo:function(id){var aspectRatio,height,width;aspectRatio=500/281;width=this.$element.data('width')||560;width=this.checkDimensions(width);height=width/aspectRatio;this.resize(width);this.lightbox_body.html('<iframe width="'+width+'" height="'+height+'" src="'+id+'?autoplay=1" frameborder="0" allowfullscreen></iframe>');this.options.onContentLoaded.call(this);if(this.modal_arrows){return this.modal_arrows.css('display','none');}},showInstagramVideo:function(id){var width;width=this.$element.data('width')||612;width=this.checkDimensions(width);this.resize(width);this.lightbox_body.html('<iframe width="'+width+'" height="'+width+'" src="'+this.addTrailingSlash(id)+'embed/" frameborder="0" allowfullscreen></iframe>');this.options.onContentLoaded.call(this);if(this.modal_arrows){return this.modal_arrows.css('display','none');}},loadRemoteContent:function(url){var disableExternalCheck,width,_this=this;width=this.$element.data('width')||560;this.resize(width);disableExternalCheck=this.$element.data('disableExternalCheck')||false;if(!disableExternalCheck&&!this.isExternal(url)){this.lightbox_body.load(url,$.proxy(function(){return _this.$element.trigger('loaded.bs.modal');}));}else{this.lightbox_body.html('<iframe width="'+width+'" height="'+width+'" src="'+url+'" frameborder="0" allowfullscreen></iframe>');this.options.onContentLoaded.call(this);} 853if(this.modal_arrows){return this.modal_arrows.css('display','block');}},isExternal:function(url){var match;match=url.match(/^([^:\/?#]+:)?(?:\/\/([^\/?#]*))?([^?#]+)?(\?[^#]*)?(#.*)?/);
853if(typeof match[1]==="string"&&match[1].length>0&&match[1].toLowerCase()!==location.protocol){return true;} 854if(typeof match[2]==="string"&&match[2].length>0&&match[2].replace(new RegExp(":("+{"http:":80,"https:":443}[location.protocol]+")?$"),"")!==location.host){return true;} 855return false;},error:function(message){this.lightbox_body.html(message);return this;},preloadImage:function(src,onLoadShowImage){var img,_this=this;img=new Image();if((onLoadShowImage==null)||onLoadShowImage===true){img.onload=function(){var image;image=$('<img />');image.attr('src',img.src);image.addClass('img-responsive');_this.lightbox_body.html(image);if(_this.modal_arrows){_this.modal_arrows.css('display','block');} 856_this.resize(img.width);return _this.options.onContentLoaded.call(_this);};img.onerror=function(){return _this.error('Failed to load image: '+src);};} 857img.src=src;return img;},resize:function(width){var width_total;width_total=width+this.border.left+this.padding.left+this.padding.right+this.border.right;this.modal_dialog.css('width','auto').css('max-width',width_total);this.lightbox_container.find('a').css('line-height',function(){return $(this).parent().height()+'px';});return this;},checkDimensions:function(width){var body_width,width_total;width_total=width+this.border.left+this.padding.left+this.padding.right+this.border.right;body_width=document.body.clientWidth;if(width_total>body_width){width=this.modal_body.width();} 858return width;},close:function(){return this.modal.modal('hide');},addTrailingSlash:function(url){if(url.substr(-1)!=='/'){url+='/';} 859return url;}};$.fn.ekkoLightbox=function(options){return this.each(function(){var $this;$this=$(this);options=$.extend({remote:$this.attr('data-remote')||$this.attr('href'),gallery_parent_selector:$this.attr('data-parent'),type:$this.attr('data-type')},options,$this.data());new EkkoLightbox(this,options);return this;});};$.fn.ekkoLightbox.defaults={gallery_parent_selector:'*:not(.row)',left_arrow_class:'.glyphicon .glyphicon-chevron-left',right_arrow_class:'.glyphicon .glyphicon-chevron-right',directional_arrows:true,type:null,always_show_close:true,onShow:function(){},onShown:function(){},onHide:function(){},onHidden:function(){},onNavigate:function(){},onContentLoaded:function(){}};}).call(this);(function($){function getViewportHeight(){var height=window.innerHeight;var mode=document.compatMode;if((mode||!$.support.boxModel)){height=(mode=='CSS1Compat')?document.documentElement.clientHeight:document.body.clientHeight;} 860return height;} 861$(window).scroll(function(){var vpH=getViewportHeight(),scrolltop=(document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop),elems=[];$.each($.cache,function(){if(this.events&&this.events.inview){elems.push(this.handle.elem);}});if(elems.length){$(elems).each(function(){var $el=$(this),treshold=$el.data('inview-treshold')?$el.data('inview-treshold'):0,top=$el.offset().top-treshold,height=$el.height()+treshold,inview=$el.data('inview')||false;if(scrolltop>(top+height)||scrolltop+vpH<top){if(inview){$el.data('inview',false);$el.trigger('inview',[false]);}}else if(scrolltop<(top+height)){if(!inview){$el.data('inview',true);$el.trigger('inview',[true]);}}});}});$(function(){$(window).scroll();});})(jQuery);;(function(define){'use strict';define(['jquery'],function($){var $scrollTo=$.scrollTo=function(target,duration,settings){return $(window).scrollTo(target,duration,settings);};$scrollTo.defaults={axis:'xy',duration:0,limit:true};function isWin(elem){return!elem.nodeName||$.inArray(elem.nodeName.toLowerCase(),['iframe','#document','html','body'])!==-1;} 862$.fn.scrollTo=function(target,duration,settings){if(typeof duration==='object'){settings=duration;duration=0;} 863if(typeof settings==='function'){settings={onAfter:settings};} 864if(target==='max'){target=9e9;} 865settings=$.extend({},$scrollTo.defaults,settings);duration=duration||settings.duration;var queue=settings.queue&&settings.axis.length>1;if(queue){duration/=2;} 866settings.offset=both(settings.offset);settings.over=both(settings.over);return this.each(function(){if(target===null)return;var win=isWin(this),elem=win?this.contentWindow||window:this,$elem=$(elem),targ=target,attr={},toff;switch(typeof targ){case'number':case'string':if(/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(targ)){targ=both(targ);break;} 867targ=win?$(targ):$(targ,elem);if(!targ.length)return;case'object':if(targ.is||targ.style){toff=(targ=$(targ)).offset();}}
867 868var offset=$.isFunction(settings.offset)&&settings.offset(elem,targ)||settings.offset;$.each(settings.axis.split(''),function(i,axis){var Pos=axis==='x'?'Left':'Top',pos=Pos.toLowerCase(),key='scroll'+Pos,prev=$elem[key](),max=$scrollTo.max(elem,axis);if(toff){attr[key]=toff[pos]+(win?0:prev-$elem.offset()[pos]);if(settings.margin){attr[key]-=parseInt(targ.css('margin'+Pos),10)||0;attr[key]-=parseInt(targ.css('border'+Pos+'Width'),10)||0;} 869attr[key]+=offset[pos]||0;if(settings.over[pos]){attr[key]+=targ[axis==='x'?'width':'height']()*settings.over[pos];}}else{var val=targ[pos];attr[key]=val.slice&&val.slice(-1)==='%'?parseFloat(val)/100*max:val;} 870if(settings.limit&&/^\d+$/.test(attr[key])){attr[key]=attr[key]<=0?0:Math.min(attr[key],max);} 871if(!i&&settings.axis.length>1){if(prev===attr[key]){attr={};}else if(queue){animate(settings.onAfterFirst);attr={};}}});animate(settings.onAfter);function animate(callback){var opts=$.extend({},settings,{queue:true,duration:duration,complete:callback&&function(){callback.call(elem,targ,settings);}});$elem.animate(attr,opts);}});};$scrollTo.max=function(elem,axis){var Dim=axis==='x'?'Width':'Height',scroll='scroll'+Dim;if(!isWin(elem)) 872return elem[scroll]-$(elem)[Dim.toLowerCase()]();var size='client'+Dim,doc=elem.ownerDocument||elem.document,html=doc.documentElement,body=doc.body;return Math.max(html[scroll],body[scroll])-Math.min(html[size],body[size]);};function both(val){return $.isFunction(val)||$.isPlainObject(val)?val:{top:val,left:val};} 873$.Tween.propHooks.scrollLeft=$.Tween.propHooks.scrollTop={get:function(t){return $(t.elem)[t.prop]();},set:function(t){var curr=this.get(t);if(t.options.interrupt&&t._last&&t._last!==curr){return $(t.elem).stop();} 874var next=Math.round(t.now);if(curr!==next){$(t.elem)[t.prop](next);t._last=this.get(t);}}};return $scrollTo;});}(typeof define==='function'&&define.amd?define:function(deps,factory){'use strict';if(typeof module!=='undefined'&&module.exports){module.exports=factory(require('jquery'));}else{factory(jQuery);}}));(function(){'use strict';var Sugar={};var object=Object;var globalContext=typeof global!=='undefined'?global:window;var hasExports=typeof module!=='undefined'&&module.exports;var noConflict=hasExports&&typeof process!=='undefined'?process.env['SUGAR_NO_CONFLICT']:false;var internalHasOwnProperty=object.prototype.hasOwnProperty;var propertyDescriptorSupport=!!(object.defineProperty&&object.defineProperties);var natives='Boolean,Number,String,Array,Date,RegExp,Function'.split(',');var proxies={};function initializeGlobal(){Sugar={'extend':extend,'restore':restore,'revert':revert,'noConflict':noConflict};if(hasExports){module.exports=Sugar;}else{globalContext['Sugar']=Sugar;}} 875function initializeNatives(){iterateOverObject(natives.concat('Object'),function(i,name){proxies[globalContext[name]]=name;Sugar[name]={};});} 876function extend(klass,methods,instance,polyfill,override){var extendee;instance=instance!==false;extendee=instance?klass.prototype:klass;iterateOverObject(methods,function(name,prop){var existing=checkGlobal('method',klass,name,extendee),original=checkGlobal('original',klass,name,extendee),existed=name in extendee;
876if(typeof polyfill==='function'&&existing){prop=wrapExisting(existing,prop,polyfill);} 877defineOnGlobal(klass,name,instance,original,prop,existed);if(canDefineOnNative(klass,polyfill,existing,override)){setProperty(extendee,name,prop);}});} 878function alias(klass,target,source){var method=getProxy(klass)[source];var obj={};obj[target]=method['method'];extend(klass,obj,method['instance']);} 879function restore(klass,methods){if(noConflict)return;return batchMethodExecute(klass,methods,function(target,name,m){setProperty(target,name,m.method);});} 880function revert(klass,methods){return batchMethodExecute(klass,methods,function(target,name,m){if(m['existed']){setProperty(target,name,m['original']);}else{delete target[name];}});} 881function batchMethodExecute(klass,methods,fn){var all=!methods,changed=false;if(typeof methods==='string')methods=[methods];iterateOverObject(getProxy(klass),function(name,m){if(all||methods.indexOf(name)!==-1){changed=true;fn(m['instance']?klass.prototype:klass,name,m);}});return changed;} 882function checkGlobal(type,klass,name,extendee){var proxy=getProxy(klass),methodExists;methodExists=proxy&&hasOwnProperty(proxy,name);if(methodExists){return proxy[name][type];}else{return extendee[name];}} 883function canDefineOnNative(klass,polyfill,existing,override){if(override){return true;}else if(polyfill===true){return!existing;} 884return!noConflict||!proxies[klass];} 885function wrapExisting(originalFn,extendedFn,condition){return function(a){return condition.apply(this,arguments)?extendedFn.apply(this,arguments):originalFn.apply(this,arguments);}} 886function wrapInstanceAsClass(fn){return function(obj){var args=arguments,newArgs=[],i;for(i=1;i<args.length;i++){newArgs.push(args[i]);} 887return fn.apply(obj,newArgs);};} 888function defineOnGlobal(klass,name,instance,original,prop,existed){var proxy=getProxy(klass),result;if(!proxy)return;result=instance?wrapInstanceAsClass(prop):prop;setProperty(proxy,name,result,true);if(typeof prop==='function'){setProperty(result,'original',original);setProperty(result,'method',prop);setProperty(result,'existed',existed);setProperty(result,'instance',instance);}} 889function getProxy(klass){return Sugar[proxies[klass]];} 890function setProperty(target,name,property,enumerable){if(propertyDescriptorSupport){object.defineProperty(target,name,{'value':property,'enumerable':!!enumerable,'configurable':true,'
890writable':true});}else{target[name]=property;}} 891function iterateOverObject(obj,fn){var key;for(key in obj){if(!hasOwnProperty(obj,key))continue;if(fn.call(obj,key,obj[key],obj)===false)break;}} 892function hasOwnProperty(obj,prop){return!!obj&&internalHasOwnProperty.call(obj,prop);} 893initializeGlobal();initializeNatives();var object=Object,array=Array,regexp=RegExp,date=Date,string=String,number=Number,func=Function,math=Math,Undefined;var sugarObject=Sugar.Object,sugarArray=Sugar.Array,sugarDate=Sugar.Date,sugarString=Sugar.String,sugarNumber=Sugar.Number;var internalToString=object.prototype.toString;var regexIsFunction=typeof regexp()==='function';var noKeysInStringObjects=!('0'in new string('a'));var typeChecks={};var matchedByValueReg=/^\[object Date|Array|String|Number|RegExp|Boolean|Arguments\]$/;var isBoolean=buildPrimitiveClassCheck('boolean',natives[0]);var isNumber=buildPrimitiveClassCheck('number',natives[1]);var isString=buildPrimitiveClassCheck('string',natives[2]);var isArray=buildClassCheck(natives[3]);var isDate=buildClassCheck(natives[4]);var isRegExp=buildClassCheck(natives[5]);var isFunction=buildClassCheck(natives[6]);function isClass(obj,klass,cached){var k=cached||className(obj);return k==='[object '+klass+']';} 894function buildClassCheck(klass){var fn=(klass==='Array'&&array.isArray)||function(obj,cached){return isClass(obj,klass,cached);};typeChecks[klass]=fn;return fn;} 895function buildPrimitiveClassCheck(type,klass){var fn=function(obj){if(isObjectType(obj)){return isClass(obj,klass);} 896return typeof obj===type;} 897typeChecks[klass]=fn;return fn;} 898function className(obj){return internalToString.call(obj);} 899function extendSimilar(klass,set,fn,instance,polyfill,override){var methods={};set=isString(set)?set.split(','):set;set.forEach(function(name,i){fn(methods,name,i);});extend(klass,methods,instance,polyfill,override);} 900function isArgumentsObject(obj){return hasProperty(obj,'length')&&(className(obj)==='[object Arguments]'||!!obj.callee);} 901function multiArgs(args,fn,from){var result=[],i=from||0,len;for(len=args.length;i<len;i++){result.push(args[i]);if(fn)fn.call(args,args[i],i);} 902return result;} 903function flattenedArgs(args,fn,from){var arg=args[from||0];if(isArray(arg)){args=arg;from=0;} 904return multiArgs(args,fn,from);} 905function checkCallback(fn){if(!fn||!fn.call){throw new TypeError('Callback is not callable');}} 906function isDefined(o){return o!==Undefined;} 907function isUndefined(o){return o===Undefined;} 908function hasProperty(obj,prop){return!isPrimitiveType(obj)&&prop in obj;} 909function isObjectType(obj){return!!obj&&(typeof obj==='object'||(regexIsFunction&&isRegExp(obj)));} 910function isPrimitiveType(obj){var type=typeof obj;return obj==null||type==='string'||type==='number'||type==='boolean';} 911function isPlainObject(obj,klass){klass=klass||className(obj);try{if(obj&&obj.constructor&&!hasOwnProperty(obj,'constructor')&&!hasOwnProperty(obj.constructor.prototype,'isPrototypeOf')){return false;}}catch(e){return false;} 912return!!obj&&klass==='[object Object]'&&'hasOwnProperty'in obj;} 913function simpleRepeat(n,fn){for(var i=0;i<n;i++){fn(i);}} 914function simpleMerge(target,source){iterateOverObject(source,function(key){target[key]=source[key];});return target;} 915function coercePrimitiveToObject(obj){if(isPrimitiveType(obj)){obj=object(obj);} 916if(noKeysInStringObjects&&isString(obj)){forceStringCoercion(obj);} 917return obj;} 918function forceStringCoercion(obj){var i=0,chr;while(chr=obj.charAt(i)){obj[i++]=chr;}} 919function Hash(obj){simpleMerge(this,coercePrimitiveToObject(obj));};Hash.prototype.constructor=object;var abs=math.abs;var pow=math.pow;var ceil=math.ceil;var floor=math.floor;var round=math.round;var min=math.min;var max=math.max;function withPrecision(val,precision,fn){var multiplier=pow(10,abs(precision||0));fn=fn||round;if(precision<0)multiplier=1/multiplier;return fn(val*multiplier)/multiplier;} 920var HalfWidthZeroCode=0x30;var HalfWidthNineCode=0x39;var FullWidthZeroCode=0xff10;var FullWidthNineCode=0xff19;var HalfWidthPeriod='.';var FullWidthPeriod='ï¼';var HalfWidthComma=',';var FullWidthDigits='';var NumberNormalizeMap={};var NumberNormalizeReg;function codeIsNumeral(code){return(code>=HalfWidthZeroCode&&code<=HalfWidthNineCode)||(code>=FullWidthZeroCode&&code<=FullWidthNineCode);} 921function buildNumberHelpers(){var digit,i;for(i=0;i<=9;i++){digit=chr(i+FullWidthZeroCode);FullWidthDigits+=digit;NumberNormalizeMap[digit]=chr(i+HalfWidthZeroCode);} 922NumberNormalizeMap[HalfWidthComma]='';NumberNormalizeMap[FullWidthPeriod]=HalfWidthPeriod;NumberNormalizeMap[HalfWidthPeriod]=HalfWidthPeriod;NumberNormalizeReg=regexp('['+FullWidthDigits+FullWidthPeriod+HalfWidthComma+HalfWidthPeriod+']','g');} 923function chr(num){return string.fromCharCode(num);} 924function getTrimmableCharacters(){return'\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u2028\u2029\u3000\uFEFF';} 925function repeatString(str,num){var result='';str=str.toString();while(num>0){if(num&1){result+=str;} 926if(num>>=1){str+=str;}} 927return result;} 928function stringToNumber(str,base){var sanitized,isDecimal;sanitized=str.replace(NumberNormalizeReg,function(chr){var replacement=NumberNormalizeMap[chr];if(replacement===HalfWidthPeriod){isDecimal=true;} 929return replacement;});return isDecimal?parseFloat(sanitized):parseInt(sanitized,base||10);} 930function padNumber(num,place,sign,base){var str=abs(num).toString(base||10);str=repeatString('0',place-str.replace(/\.\d+/,'').length)+str;if(sign||num<0){str=(num<0?'-':'+')+str;} 931return str;} 932function getOrdinalizedSuffix(num){if(num>=11&&num<=13){return'th';}else{switch(num%10){case 1:return'st';case 2:return'nd';case 3:return'rd';default:return'th';}}} 933function getRegExpFlags(reg,add){var flags='';add=add||'';function checkFlag(prop,flag){if(prop||add.indexOf(flag)>-1){flags+=flag;}} 934checkFlag(reg.multiline,'m');checkFlag(reg.ignoreCase,'i');checkFlag(reg.global,'g');checkFlag(reg.sticky,'y');return flags;} 935function escapeRegExp(str){if(!isString(str))str=string(str);return str.replace(/([\\\/\'*+?|()\[\]{}.^$-])/g,'\\$1');} 936function callDateGet(d,method){return d['get'+(d._utc?'UTC':'')+method]();} 937function callDateSet(d,method,value){return d['set'+(d._utc?'UTC':'')+method](value);} 938function stringify(thing,stack){var type=typeof thing,thingIsObject,thingIsArray,klass,value,arr,key,i,len;if(type==='string')return thing;klass=internalToString.call(thing);thingIsObject=isPlainObject(thing,klass);thingIsArray=isArray(thing,klass);if(thing!=null&&thingIsObject||thingIsArray){if(!stack)stack=[];if(stack.length>1){i=stack.length;while(i--){if(stack[i]===thing){return'CYC';}}} 939stack.push(thing);value=thing.valueOf()+string(thing.constructor);arr=thingIsArray?thing:object.keys(thing).sort();for(i=0,len=arr.length;i<len;i++){key=thingIsArray?i:arr[i];value+=key+stringify(thing[key],stack);} 940stack.pop();}else if(1/thing===-Infinity){value='-0';}else{value=string(thing&&thing.valueOf?thing.valueOf():thing);} 941return type+klass+value;}
942function isEqual(a,b){if(a===b){return a!==0||1/a===1/b;}else if(objectIsMatchedByValue(a)&&objectIsMatchedByValue(b)){return stringify(a)===stringify(b);} 943return false;} 944function objectIsMatchedByValue(obj){var klass=className(obj);return matchedByValueReg.test(klass)||isPlainObject(obj,klass);} 945function getEntriesForIndexes(obj,args,isString){var result,length=obj.length,argsLen=args.length,overshoot=args[argsLen-1]!==false,multiple=argsLen>(overshoot?1:2);if(!multiple){return entryAtIndex(obj,length,args[0],overshoot,isString);} 946result=[];multiArgs(args,function(index){if(isBoolean(index))return false;result.push(entryAtIndex(obj,length,index,overshoot,isString));});return result;} 947function entryAtIndex(obj,length,index,overshoot,isString){if(overshoot){index=index%length;if(index<0)index=length+index;} 948return isString?obj.charAt(index):obj[index];} 949function transformArgument(el,map,context,mapArgs){if(!map){return el;}else if(map.apply){return map.apply(context,mapArgs||[]);}else if(isFunction(el[map])){return el[map].call(el);}else{return el[map];}} 950function keysWithObjectCoercion(obj){return object.keys(coercePrimitiveToObject(obj));} 951function buildObjectInstanceMethods(set,target){set.forEach(function(name){var classFn=sugarObject[name==='equals'?'equal':name];var fn=function(){var args=arguments,newArgs=[this],i;for(i=0;i<args.length;i++){newArgs.push(args[i]);} 952return classFn.apply(null,newArgs);} 953setProperty(target.prototype,name,fn);});} 954buildNumberHelpers();extend(object,{'keys':function(obj){var keys=[];if(!isObjectType(obj)&&!isRegExp(obj)&&!isFunction(obj)){throw new TypeError('Object required');} 955iterateOverObject(obj,function(key,value){keys.push(key);});return keys;}},false,true);function arrayIndexOf(arr,search,fromIndex,increment){var length=arr.length,fromRight=increment==-1,start=fromRight?length-1:0,index=toIntegerWithDefault(fromIndex,start);if(index<0){index=length+index;} 956if((!fromRight&&index<0)||(fromRight&&index>=length)){index=start;} 957while((fromRight&&index>=0)||(!fromRight&&index<length)){if(arr[index]===search){return index;} 958index+=increment;} 959return-1;} 960function arrayReduce(arr,fn,initialValue,fromRight){var length=arr.length,count=0,defined=isDefined(initialValue),result,index;checkCallback(fn);if(length==0&&!defined){throw new TypeError('Reduce called on empty array with no initial value');}else if(defined){result=initialValue;}else{result=arr[fromRight?length-1:count];count++;} 961while(count<length){index=fromRight?length-count-1:count;if(index in arr){result=fn(result,arr[index],index,arr);} 962count++;} 963return result;} 964function toIntegerWithDefault(i,d){if(isNaN(i)){return d;}else{return parseInt(i>>0);}} 965function checkFirstArgumentExists(args){if(args.length===0){throw new TypeError('First argument must be defined');}} 966extend(array,{'isArray':function(obj){return isArray(obj);}},false,true);extend(array,{'every':function(fn,scope){var length=this.length,index=0;checkFirstArgumentExists(arguments);while(index<length){if(index in this&&!fn.call(scope,this[index],index,this)){return false;} 967index++;} 968return true;},'some':function(fn,scope){var length=this.length,index=0;checkFirstArgumentExists(arguments);while(index<length){if(index in this&&fn.call(scope,this[index],index,this)){return true;} 969index++;} 970return false;},'map':function(fn,scope){var scope=arguments[1],length=this.length,index=0,result=new Array(length);checkFirstArgumentExists(arguments);while(index<length){if(index in this){result[index]=fn.call(scope,this[index],index,this);} 971index++;} 972return result;},'filter':function(fn){var scope=arguments[1];var length=this.length,index=0,result=[];checkFirstArgumentExists(arguments);while(index<length){if(index in this&&fn.call(scope,this[index],index,this)){result.push(this[index]);} 973index++;} 974return result;},'indexOf':function(search){var fromIndex=arguments[1];if(isString(this))return this.indexOf(search,fromIndex);return arrayIndexOf(this,search,fromIndex,1);},'lastIndexOf':function(search){var fromIndex=arguments[1];if(isString(this))return this.lastIndexOf(search,fromIndex);return arrayIndexOf(this,search,fromIndex,-1);},'forEach':function(fn){var length=this.length,index=0,scope=arguments[1];checkCallback(fn);while(index<length){if(index in this){fn.call(scope,this[index],index,this);} 975index++;}},'reduce':function(fn){return arrayReduce(this,fn,arguments[1]);},'reduceRight':function(fn){return arrayReduce(this,fn,arguments[1],true);}},true,true);var TrimRegExp=regexp('^['+getTrimmableCharacters()+']+|['+getTrimmableCharacters()+']+$','g') 976extend(string,{'trim':function(){return this.toString().replace(TrimRegExp,'');}},true,true);extend(func,{'bind':function(scope){var fn=this,args=multiArgs(arguments,null,1),bound;if(!isFunction(this)){throw new TypeError('Function.prototype.bind called on a non-function');} 977bound=function(){return fn.apply(fn.prototype&&this instanceof fn?this:scope,args.concat(multiArgs(arguments)));} 978bound.prototype=this.prototype;return bound;}},true,true);function hasISOStringSupport(){var d=new date(date.UTC(2000,0)),expected='2000-01-01T00:00:00.000Z';return!!d.toISOString&&d.toISOString()===expected;} 979extend(date,{'now':function(){return new date().getTime();}},false,true);extendSimilar(date,'toISOString,toJSON',function(methods,name){methods[name]=function(){return padNumber(this.getUTCFullYear(),4)+'-'+ 980padNumber(this.getUTCMonth()+1,2)+'-'+ 981padNumber(this.getUTCDate(),2)+'T'+ 982padNumber(this.getUTCHours(),2)+':'+ 983padNumber(this.getUTCMinutes(),2)+':'+ 984padNumber(this.getUTCSeconds(),2)+'.'+ 985padNumber(this.getUTCMilliseconds(),3)+'Z';}},true,true,!hasISOStringSupport());function regexMatcher(reg){reg=regexp(reg);return function(el){return reg.test(el);}} 986function dateMatcher(d){var ms=d.getTime();return function(el){return!!(el&&el.getTime)&&el.getTime()===ms;}} 987function functionMatcher(fn){return function(el,i,arr){return el===fn||fn.call(this,el,i,arr);}} 988function invertedArgsFunctionMatcher(fn){return function(value,key,obj){return value===fn||fn.call(obj,key,value,obj);}} 989function fuzzyMatcher(obj,isObject){var matchers={};return function(el,i,arr){var key;if(!isObjectType(el)){return false;} 990for(key in obj){matchers[key]=matchers[key]||getMatcher(obj[key],isObject);if(matchers[key].call(arr,el[key],i,arr)===false){return false;}} 991return true;}} 992function defaultMatcher(f){return function(el){return el===f||isEqual(el,f);}} 993function getMatcher(f,isObject){if(isPrimitiveType(f)){}else if(isRegExp(f)){return regexMatcher(f);}else if(isDate(f)){return dateMatcher(f);}else if(isFunction(f)){if(isObject){return invertedArgsFunctionMatcher(f);}else{return functionMatcher(f);}}else if(isPlainObject(f)){return fuzzyMatcher(f,isObject);} 994return defaultMatcher(f);} 995function transformArgument(el,map,context,mapArgs){if(!map){return el;}else if(map.apply){return map.apply(context,mapArgs||[]);}else if(isArray(map)){return map.map(function(m){return transformArgument(el,m,context,mapArgs);});}else if(isFunction(el[map])){return el[map].call(el);}else{return el[map];}} 996function compareValue(aVal,bVal){var cmp,i;if(isString(aVal)&&isString(bVal)){return collateStrings(aVal,bVal);}else if(isArray(aVal)&&isArray(bVal)){if(aVal.length<bVal.length){return-1;}else if(aVal.length>bVal.length){return 1;}else{for(i=0;i<aVal.length;i++){cmp=compareValue(aVal[i],bVal[i]);if(cmp!==0){return cmp;}} 997return 0;}}else if(aVal<bVal){return-1;}else if(aVal>bVal){return 1;}else{return 0;}} 998function arrayEach(arr,fn,startIndex,loop){var index,i,length=+arr.length;if(startIndex<0)startIndex=arr.length+startIndex;i=isNaN(startIndex)?0:startIndex;if(loop===true){length+=i;} 999while(i<length){index=i%arr.length;if(!(index in arr)){return iterateOverSparseArray(arr,fn,i,loop);}else if(fn.call(arr,arr[index],index,arr)===false){break;} 1000i++;}} 1001function iterateOverSparseArray(arr,fn,fromIndex,loop){var indexes=[],i;for(i in arr){if(isArrayIndex(arr,i)&&i>
1001=fromIndex){indexes.push(parseInt(i));}} 1002arrayEach(indexes.sort(),function(index){return fn.call(arr,arr[index],index,arr);});return arr;} 1003function isArrayIndex(arr,i){return i in arr&&toUInt32(i)==i&&i!=0xffffffff;} 1004function toUInt32(i){return i>>>0;} 1005function arrayFind(arr,f,startIndex,loop,returnIndex,context){var result,index,matcher;if(arr.length>0){matcher=getMatcher(f);arrayEach(arr,function(el,i){if(matcher.call(context,el,i,arr)){result=el;index=i;return false;}},startIndex,loop);} 1006return returnIndex?index:result;} 1007function arrayFindAll(arr,f,index,loop){var result=[],matcher;if(arr.length>0){matcher=getMatcher(f);arrayEach(arr,function(el,i,arr){if(matcher(el,i,arr)){result.push(el);}},index,loop);} 1008return result;} 1009function arrayAdd(arr,el,index){if(!isNumber(number(index))||isNaN(index))index=arr.length;array.prototype.splice.apply(arr,[index,0].concat(el));return arr;} 1010function arrayRemove(arr,args){multiArgs(args,function(f){var i=0,matcher=getMatcher(f);while(i<arr.length){if(matcher(arr[i],i,arr)){arr.splice(i,1);}else{i++;}}});return arr;}
1011function arrayUnique(arr,map){var result=[],o={},transformed;arrayEach(arr,function(el,i){transformed=map?transformArgument(el,map,arr,[el,i,arr]):el;if(!checkForElementInHashAndSet(o,transformed)){result.push(el);}}) 1012return result;} 1013function arrayIntersect(arr1,arr2,subtract){var result=[],o={};arrayEach(arr2,function(el){checkForElementInHashAndSet(o,el);});arrayEach(arr1,function(el){var stringified=stringify(el),isReference=!objectIsMatchedByValue(el);if(elementExistsInHash(o,stringified,el,isReference)!==subtract){discardElementFromHash(o,stringified,el,isReference);result.push(el);}});return result;} 1014function arrayFlatten(arr,level,current){level=level||Infinity;current=current||0;var result=[];arrayEach(arr,function(el){if(isArray(el)&¤t<level){result=result.concat(arrayFlatten(el,level,current+1));}else{result.push(el);}});return result;} 1015function arrayGroupBy(arr,map,fn){var result={},key;arrayEach(arr,function(el,index){key=transformArgument(el,map,arr,[el,index,arr]);if(!result[key])result[key]=[];result[key].push(el);});if(fn){iterateOverObject(result,fn);} 1016return result;} 1017function arraySum(arr,map){if(map){arr=sugarArray.map(arr,map);} 1018return arr.length>0?arr.reduce(function(a,b){return a+b;}):0;} 1019function arrayCompact(arr,all){var result=[];arrayEach(arr,function(el,i){if(isArray(el)){result.push(arrayCompact(el));}else if(all&&el){result.push(el);}else if(!all&&el!=null&&el.valueOf()===el.valueOf()){result.push(el);}});return result;} 1020function arrayRandomize(arr){arr=arrayClone(arr);var i=arr.length,j,x;while(i){j=(math.random()*i)|0;x=arr[--i];arr[i]=arr[j];arr[j]=x;} 1021return arr;} 1022function arrayClone(arr){return simpleMerge([],arr);} 1023function isArrayLike(obj){return hasProperty(obj,'length')&&!isString(obj)&&!isPlainObject(obj);} 1024function flatArguments(args){var result=[];multiArgs(args,function(arg){result=result.concat(arg);});return result;} 1025function elementExistsInHash(hash,key,element,isReference){var exists=hasOwnProperty(hash,key);if(isReference){if(!hash[key]){hash[key]=[];} 1026exists=hash[key].indexOf(element)!==-1;} 1027return exists;} 1028function checkForElementInHashAndSet(hash,element){var stringified=stringify(element),isReference=!objectIsMatchedByValue(element),exists=elementExistsInHash(hash,stringified,element,isReference);if(isReference){hash[stringified].push(element);}else{hash[stringified]=element;} 1029return exists;} 1030function discardElementFromHash(hash,key,element,isReference){var arr,i=0;if(isReference){arr=hash[key];while(i<arr.length){if(arr[i]===element){arr.splice(i,1);}else{i+=1;}}}else{delete hash[key];}} 1031function getMinOrMax(obj,map,which,all){var el,key,edge,test,result=[],max=which==='max',min=which==='min',isArray=array.isArray(obj);for(key in obj){if(!obj.hasOwnProperty(key))continue;el=obj[key];test=transformArgument(el,map,obj,isArray?[el,parseInt(key),obj]:[]);if(isUndefined(test)){throw new TypeError('Cannot compare with undefined');} 1032if(test===edge){result.push(el);}else if(isUndefined(edge)||(max&&test>edge)||(min&&test<edge)){result=[el];edge=test;}} 1033if(!isArray)result=arrayFlatten(result,1);return all?result:result[0];} 1034function collateStrings(a,b){var aValue,bValue,aChar,bChar,aEquiv,bEquiv,index=0,tiebreaker=0;var sortIgnore=sugarArray[AlphanumericSortIgnore];var sortIgnoreCase=sugarArray[AlphanumericSortIgnoreCase];var sortEquivalents=sugarArray[AlphanumericSortEquivalents];var sortOrder=sugarArray[AlphanumericSortOrder];var naturalSort=sugarArray[AlphanumericSortNatural];a=getCollationReadyString(a,sortIgnore,sortIgnoreCase);b=getCollationReadyString(b,sortIgnore,sortIgnoreCase);do{aChar=getCollationCharacter(a,index,sortEquivalents);bChar=getCollationCharacter(b,index,sortEquivalents);aValue=getSortOrderIndex(aChar,sortOrder);bValue=getSortOrderIndex(bChar,sortOrder);if(aValue===-1||bValue===-1){aValue=a.charCodeAt(index)||null;bValue=b.charCodeAt(index)||null;if(naturalSort&&codeIsNumeral(aValue)&&codeIsNumeral(bValue)){aValue=stringToNumber(a.slice(index));bValue=stringToNumber(b.slice(index));}}else{aEquiv=aChar!==a.charAt(index);bEquiv=bChar!==b.charAt(index);if(aEquiv!==bEquiv&&tiebreaker===0){tiebreaker=aEquiv-bEquiv;}} 1035index+=1;}while(aValue!=null&&bValue!=null&&aValue===bValue);if(aValue===bValue)return tiebreaker;return aValue-bValue;} 1036function getCollationReadyString(str,sortIgnore,sortIgnoreCase){if(!isString(str))str=string(str);if(sortIgnoreCase){str=str.toLowerCase();} 1037if(sortIgnore){str=str.replace(sortIgnore,'');} 1038return str;} 1039function getCollationCharacter(str,index,sortEquivalents){var chr=str.charAt(index);return sortEquivalents[chr]||chr;} 1040function getSortOrderIndex(chr,sortOrder){if(!chr){return null;}else{return sortOrder.indexOf(chr);}} 1041var AlphanumericSort='AlphanumericSort';var AlphanumericSortOrder='AlphanumericSortOrder';var AlphanumericSortIgnore='AlphanumericSortIgnore';var AlphanumericSortIgnoreCase='AlphanumericSortIgnoreCase';var AlphanumericSortEquivalents='AlphanumericSortEquivalents';var AlphanumericSortNatural='AlphanumericSortNatural';function buildEnhancements(){var nativeMap=array.prototype.map;var callbackCheck=function(){var args=arguments;return args.length>0&&!isFunction(args[0]);};extendSimilar(array,'every,some,filter,find,findIndex',function(methods,name){var nativeFn=array.prototype[name] 1042methods[name]=function(f){var matcher=getMatcher(f);return nativeFn.call(this,function(el,index,arr){return matcher(el,index,arr);});}},true,callbackCheck);extend(array,{'map':function(map,context){var arr=this;if(arguments.length<2){context=arr;} 1043return nativeMap.call(arr,function(el,index){return transformArgument(el,map,context,[el,index,arr]);});}},true,callbackCheck);} 1044function buildAlphanumericSort(){var order='AÃÃÃÃÄBCÄÄÃDÄÃEÃÃÄÃÃÄFGÄHıIÃÃİÃÃJKLÅMNÅÅÃOÃÃÃPQRÅSÅÅ ÅTŤUÃÃÅ®ÃÃVWXYÃZŹŻŽÃÃÅÃÃà ÃÃ';var equiv='AÃÃÃÃÃ,CÃ,EÃÃÃÃ,IÃÃİÃÃ,OÃÃÃÃÃ,SÃ,UÃÃÃÃ';sugarArray[AlphanumericSortOrder]=order.split('').map(function(str){return str+str.toLowerCase();}).join('');var equivalents={};arrayEach(equiv.split(','),function(set){var equivalent=set.charAt(0);arrayEach(set.slice(1).split(''),function(chr){equivalents[chr]=equivalent;equivalents[chr.toLowerCase()]=equivalent.toLowerCase();});});sugarArray[AlphanumericSortNatural]=true;sugarArray[AlphanumericSortIgnoreCase]=true;sugarArray[AlphanumericSortEquivalents]=equivalents;} 1045extend(array,{'create':function(){var result=[];
1045multiArgs(arguments,function(a){if(isArgumentsObject(a)||isArrayLike(a)){a=multiArgs(a);} 1046result=result.concat(a);});return result;}},false);extend(array,{'find':function(f){var context=arguments[1];checkCallback(f);return arrayFind(this,f,0,false,false,context);},'findIndex':function(f){var index,context=arguments[1];checkCallback(f);index=arrayFind(this,f,0,false,true,context);return isUndefined(index)?-1:index;}},true,true);extend(array,{'findFrom':function(f,index,loop){return arrayFind(this,f,index,loop);},'findIndexFrom':function(f,index,loop){var index=arrayFind(this,f,index,loop,true);return isUndefined(index)?-1:index;},'findAll':function(f,index,loop){return arrayFindAll(this,f,index,loop);},'count':function(f){if(isUndefined(f))return this.length;return arrayFindAll(this,f).length;},'removeAt':function(start,end){if(isUndefined(start))return this;if(isUndefined(end))end=start;this.splice(start,end-start+1);return this;},'include':function(el,index){return arrayAdd(arrayClone(this),el,index);},'exclude':function(){return arrayRemove(arrayClone(this),arguments);},'clone':function(){return arrayClone(this);},'unique':function(map){return arrayUnique(this,map);},'flatten':function(limit){return arrayFlatten(this,limit);},'union':function(){return arrayUnique(this.concat(flatArguments(arguments)));},'intersect':function(){return arrayIntersect(this,flatArguments(arguments),false);},'subtract':function(a){return arrayIntersect(this,flatArguments(arguments),true);},'at':function(){return getEntriesForIndexes(this,arguments);},'first':function(num){if(isUndefined(num))return this[0];if(num<0)num=0;return this.slice(0,num);},'last':function(num){if(isUndefined(num))return this[this.length-1];var start=this.length-num<0?0:this.length-num;return this.slice(start);},'from':function(num){return this.slice(num);},'to':function(num){if(isUndefined(num))num=this.length;return this.slice(0,num);},'min':function(map,all){return getMinOrMax(this,map,'min',all);},'max':function(map,all){return getMinOrMax(this,map,'max',all);},'least':function(map,all){return getMinOrMax(arrayGroupBy(this,map),'length','min',all);},'most':function(map,all){return getMinOrMax(arrayGroupBy(this,map),'length','max',all);},'sum':function(map){return arraySum(this,map);},'average':function(map){return this.length>0?arraySum(this,map)/this.length:0;},'inGroups':function(num,padding){var pad=arguments.length>1;var arr=this;var result=[];var divisor=ceil(this.length/num);simpleRepeat(num,function(i){var index=i*divisor;var group=arr.slice(index,index+divisor);if(pad&&group.length<divisor){simpleRepeat(divisor-group.length,function(){group.push(padding);});} 1047result.push(group);});return result;},'inGroupsOf':function(num,padding){var result=[],len=this.length,arr=this,group;if(len===0||num===0)return arr;if(isUndefined(num))num=1;if(isUndefined(padding))padding=null;simpleRepeat(ceil(len/num),function(i){group=arr.slice(num*i,num*i+num);while(group.length<num){group.push(padding);} 1048result.push(group);});return result;},'isEmpty':function(){return arrayCompact(this).length==0;},'sortBy':function(map,desc){var arr=arrayClone(this);arr.sort(function(a,b){var aProperty=transformArgument(a,map,arr,[a]);var bProperty=transformArgument(b,map,arr,[b]);return compareValue(aProperty,bProperty)*(desc?-1:1);});return arr;},'randomize':function(){return arrayRandomize(this);},'zip':function(){var args=multiArgs(arguments);return this.map(function(el,i){return[el].concat(args.map(function(k){return(i in k)?k[i]:null;}));});},'sample':function(num){var arr=arrayRandomize(this);return arguments.length>0?arr.slice(0,num):arr[0];},'each':function(fn,index,loop){arrayEach(this,fn,index,loop);return this;},'add':function(el,index){return arrayAdd(this,el,index);},'remove':function(){return arrayRemove(this,arguments);},'compact':function(all){return arrayCompact(this,all);},'groupBy':function(map,fn){return arrayGroupBy(this,map,fn);},'none':function(f){var args=multiArgs(arguments);return!sugarArray.some.apply(this,[this].concat(args));}});function buildAliases(){alias(array,'all','every');alias(array,'any','some');alias(array,'insert','add');} 1049function buildEnumerableMethods(names,mapping){extendSimilar(object,names,function(methods,name){var unwrapped=sugarArray[name]['method'];methods[name]=function(obj,arg1,arg2){var result,coerced=keysWithObjectCoercion(obj),matcher;if(!mapping){matcher=getMatcher(arg1,true);} 1050result=unwrapped.call(coerced,function(key){var value=obj[key];if(mapping){return transformArgument(value,arg1,obj,[key,value,obj]);}else{return matcher(value,key,obj);}},arg2);if(isArray(result)){result=result.reduce(function(o,key,i){o[key]=obj[key];return o;},{});} 1051return result;};},false);buildObjectInstanceMethods(names,Hash);} 1052function exportSortAlgorithm(){sugarArray[AlphanumericSort]=collateStrings;} 1053var EnumerableFindingMethods='any,all,none,count,find,findAll,isEmpty'.split(',');var EnumerableMappingMethods='sum,average,min,max,least,most'.split(',');buildEnhancements();buildAliases();buildAlphanumericSort();buildEnumerableMethods(EnumerableFindingMethods);buildEnumerableMethods(EnumerableMappingMethods,true);exportSortAlgorithm();var English;var CurrentLocalization;var TimeFormat=['ampm','hour','minute','second','ampm','utc','offset_sign','offset_hours','offset_minutes','ampm'];var DecimalReg='(?:[,.]\\d+)?';var HoursReg='\\d{1,2}'+DecimalReg;var SixtyReg='[0-5]\\d'+DecimalReg;
1053var RequiredTime='({t})?\\s*('+HoursReg+')(?:{h}('+SixtyReg+')?{m}(?::?('+SixtyReg+'){s})?\\s*(?:({t})|(Z)|(?:([+-])(\\d{2,2})(?::?(\\d{2,2}))?)?)?|\\s*({t}))';var KanjiDigits='ãä¸äºä¸åäºå ä¸å «ä¹åç¾åä¸';var AsianDigitMap={};var AsianDigitReg;var DateArgumentUnits;var DateUnitsReversed;var CoreDateFormats=[];var CompiledOutputFormats={};var DateFormatTokens={'yyyy':function(d){return callDateGet(d,'FullYear');},'yy':function(d){return callDateGet(d,'FullYear')%100;},'ord':function(d){var date=callDateGet(d,'Date');return date+getOrdinalizedSuffix(date);},'tz':function(d){return getUTCOffset(d);},'isotz':function(d){return getUTCOffset(d,true);},'Z':function(d){return getUTCOffset(d);},'ZZ':function(d){return getUTCOffset(d).replace(/(\d{2})$/,':$1');}};var DateUnits=[{name:'year',method:'FullYear',ambiguous:true,multiplier:function(d){var adjust=d?(isLeapYear(d)?1:0):0.25;return(365+adjust)*24*60*60*1000;}},{name:'month',error:0.919,method:'Month',ambiguous:true,multiplier:function(d,ms){var days=30.4375,inMonth;if(d){inMonth=getDaysInMonth(d);if(ms<=inMonth*24*60*60*1000){days=inMonth;}} 1054return days*24*60*60*1000;}},{name:'week',method:'ISOWeek',multiplier:function(){return 7*24*60*60*1000;}},{name:'day',error:0.958,method:'Date',ambiguous:true,multiplier:function(){return 24*60*60*1000;}},{name:'hour',method:'Hours',multiplier:function(){return 60*60*1000;}},{name:'minute',method:'Minutes',multiplier:function(){return 60*1000;}},{name:'second',method:'Seconds',multiplier:function(){return 1000;}},{name:'millisecond',method:'Milliseconds',multiplier:function(){return 1;}}];var Localizations={};function Localization(l){simpleMerge(this,l);this.compiledFormats=CoreDateFormats.concat();} 1055Localization.prototype={get:function(prop){return this[prop]||'';},getMonth:function(n){if(isNumber(n)){return n-1;}else{return this['months'].indexOf(n)%12;}},getWeekday:function(n){return this['weekdays'].indexOf(n)%7;},getNumber:function(n,digit){var mapped=this.ordinalNumberMap[n];if(mapped){if(digit){mapped=mapped%10;} 1056return mapped;} 1057return isNumber(n)?n:1;},getNumericDate:function(n){var self=this;return n.replace(regexp(this['num'],'g'),function(d){var num=self.getNumber(d,true);return num||'';});},getUnitIndex:function(n){return this['units'].indexOf(n)%8;},getRelativeFormat:function(adu){return this.convertAdjustedToFormat(adu,adu[2]>0?'future':'past');},getDuration:function(ms){return this.convertAdjustedToFormat(getAdjustedUnit(ms),'duration');},hasVariant:function(code){code=code||this.code;return code==='en'||code==='en-US'?true:this['variant'];},matchAM:function(str){return str===this.get('ampm')[0];},matchPM:function(str){return str&&str===this.get('ampm')[1];},convertAdjustedToFormat:function(adu,mode){var sign,unit,mult,num=adu[0],u=adu[1],ms=adu[2],format=this[mode]||this['relative'];if(isFunction(format)){return format.call(this,num,u,ms,mode);} 1058mult=this['plural']&&num>1?1:0;unit=this['units'][mult*8+u]||this['units'][u];if(this['capitalizeUnit'])unit=simpleCapitalize(unit);sign=this['modifiers'].filter(function(m){return m.name=='sign'&&m.value==(ms>0?1:-1);})[0];return format.replace(/\{(.*?)\}/g,function(full,match){switch(match){case'num':return num;case'unit':return unit;case'sign':return sign.src;}});},getFormats:function(){return this.cachedFormat?[this.cachedFormat].concat(this.compiledFormats):this.compiledFormats;},addFormat:function(src,allowsTime,match,variant,iso){var to=match||[],loc=this,time,timeMarkers,lastIsNumeral;src=src.replace(/\s+/g,'[,. ]*');src=src.replace(/\{([^,]+?)\}/g,function(all,k){var value,arr,result,opt=k.match(/\?$/),nc=k.match(/^(\d+)\??$/),slice=k.match(/(\d)(?:-(\d))?/),key=k.replace(/[^a-z]+$/,'');if(nc){value=loc.get('tokens')[nc[1]];}else if(loc[key]){value=loc[key];}else if(loc[key+'s']){value=loc[key+'s'];if(slice){arr=[];value.forEach(function(m,i){var mod=i%(loc['units']?8:value.length);if(mod>=slice[1]&&mod<=(slice[2]||slice[1])){arr.push(m);}});value=arr;} 1059value=arrayToAlternates(value);} 1060if(!value){return'';} 1061if(nc){result='(?:'+value+')';}else{if(!match){to.push(key);} 1062result='('+value+')';} 1063if(opt){result+='?';} 1064return result;});if(allowsTime){time=prepareTime(RequiredTime,loc,iso);timeMarkers=['t','[\\s\\u3000]'].concat(loc.get('timeMarker'));
1064lastIsNumeral=src.match(/\\d\{\d,\d\}\)+\??$/);addDateInputFormat(loc,'(?:'+time+')[,\\s\\u3000]+?'+src,TimeFormat.concat(to),variant);addDateInputFormat(loc,src+'(?:[,\\s]*(?:'+timeMarkers.join('|')+(lastIsNumeral?'+':'*')+')'+time+')?',to.concat(TimeFormat),variant);}else{addDateInputFormat(loc,src,to,variant);}}};function getLocalization(localeCode,fallback){var loc;if(!isString(localeCode))localeCode='';loc=Localizations[localeCode]||Localizations[localeCode.slice(0,2)];if(fallback===false&&!loc){throw new TypeError('Invalid locale.');} 1065return loc||CurrentLocalization;} 1066function setLocalization(localeCode,set){var loc,canAbbreviate;function initializeField(name){var val=loc[name];if(isString(val)){loc[name]=val.split(',');}else if(!val){loc[name]=[];}} 1067function eachAlternate(str,fn){str=str.split('+').map(function(split){return split.replace(/(.+):(.+)$/,function(full,base,suffixes){return suffixes.split('|').map(function(suffix){return base+suffix;}).join('|');});}).join('|');return str.split('|').forEach(fn);} 1068function setArray(name,abbreviate,multiple){var arr=[];loc[name].forEach(function(full,i){if(abbreviate){full+='+'+full.slice(0,3);} 1069eachAlternate(full,function(alt,j){arr[j*multiple+i]=alt.toLowerCase();});});loc[name]=arr;} 1070function getDigit(start,stop,allowNumbers){var str='\\d{'+start+','+stop+'}';if(allowNumbers)str+='|(?:'+arrayToAlternates(loc.get('numbers'))+')+';return str;} 1071function getNum(){var numbers=loc.get('numbers');var arr=['-?\\d+'].concat(loc.get('articles'));if(numbers){arr=arr.concat(numbers);} 1072return arrayToAlternates(arr);} 1073function setDefault(name,value){loc[name]=loc[name]||value;} 1074function buildNumbers(){var map=loc.ordinalNumberMap={},all=[];loc['numbers'].forEach(function(full,i){eachAlternate(full,function(alt){all.push(alt);map[alt]=i+1;});});loc['numbers']=all;} 1075function buildModifiers(){var arr=[];loc.modifiersByName={};loc['modifiers'].push({'name':'day','src':'yesterday','value':-1});loc['modifiers'].push({'name':'day','src':'today','value':0});loc['modifiers'].push({'name':'day','src':'tomorrow','value':1});loc['modifiers'].forEach(function(modifier){var name=modifier.name;eachAlternate(modifier.src,function(t){var locEntry=loc[name];loc.modifiersByName[t]=modifier;arr.push({name:name,src:t,value:modifier.value});loc[name]=locEntry?locEntry+'|'+t:t;});});loc['day']+='|'+arrayToAlternates(loc['weekdays']);loc['modifiers']=arr;} 1076loc=new Localization(set);initializeField('modifiers');'months,weekdays,units,numbers,articles,tokens,timeMarker,ampm,timeSuffixes,dateParse,timeParse'.split(',').forEach(initializeField);canAbbreviate=!loc['monthSuffix'];buildNumbers();setArray('months',canAbbreviate,12);setArray('weekdays',canAbbreviate,7);setArray('units',false,8);setDefault('code',localeCode);setDefault('date',getDigit(1,2,loc['digitDate']));setDefault('year',"'\\d{2}|"+getDigit(4,4));setDefault('num',getNum());buildModifiers();if(loc['monthSuffix']){loc['month']=getDigit(1,2);loc['months']='1,2,3,4,5,6,7,8,9,10,11,12'.split(',').map(function(n){return n+loc['monthSuffix'];});} 1077loc['full_month']=getDigit(1,2)+'|'+arrayToAlternates(loc['months']);if(loc['timeSuffixes'].length>0){loc.addFormat(prepareTime(RequiredTime,loc),false,TimeFormat);} 1078loc.addFormat('{day}',true);loc.addFormat('{month}'+(loc['monthSuffix']||''));loc.addFormat('{year}'+(loc['yearSuffix']||''));loc['timeParse'].forEach(function(src){loc.addFormat(src,true);});loc['dateParse'].forEach(function(src){loc.addFormat(src);});return Localizations[localeCode]=loc;} 1079function addDateInputFormat(locale,format,match,variant){locale.compiledFormats.unshift({variant:!!variant,locale:locale,reg:regexp('^'+format+'$','i'),to:match});} 1080function simpleCapitalize(str){return str.slice(0,1).toUpperCase()+str.slice(1);} 1081function arrayToAlternates(arr){return arr.filter(function(el){return!!el;}).join('|');} 1082function getNewDate(){var fn=sugarDate['newDateInternal'];return fn?fn():new date;} 1083function cloneDate(d){var cloned=new date(d.getTime());setUTC(cloned,!!d._utc);return cloned;} 1084function callDateSetWithWeek(d,method,value){if(method==='ISOWeek'){return setWeekNumber(d,value);}else{return callDateSet(d,method,value);}} 1085function isValid(d){return!isNaN(d.getTime());} 1086function isLeapYear(d){var year=callDateGet(d,'FullYear');return(year%4===0&&year%100!==0)||(year%400===0);} 1087function setUTC(d,force){setProperty(d,'_utc',!!force);return d;} 1088function isUTC(d){return!!d._utc||d.getTimezoneOffset()===0;} 1089function getUTCOffset(d,iso){var offset=d._utc?0:d.getTimezoneOffset();var colon=iso===true?':':'';if(!offset&&iso)return'Z';return padNumber(floor(-offset/60),2,true)+colon+padNumber(abs(offset%60),2);} 1090function collectDateArguments(args,allowDuration){var obj;if(isObjectType(args[0])){return args;}else if(isNumber(args[0])&&!isNumber(args[1])){return[args[0]];}else if(isString(args[0])&&allowDuration){return[getDateParamsFromString(args[0]),args[1]];} 1091obj={};
1091DateArgumentUnits.forEach(function(u,i){obj[u.name]=args[i];});return[obj];} 1092function getDateParamsFromString(str,num){var match,num,params={};match=str.match(/^(-?\d+)?\s?(\w+?)s?$/i);if(match){if(isUndefined(num)){num=parseInt(match[1]);if(isNaN(num)){num=1;}} 1093params[match[2].toLowerCase()]=num;} 1094return params;} 1095function iterateOverDateUnits(fn,from,to){var i,unit;if(isUndefined(to))to=DateUnitsReversed.length;for(i=from||0;i<to;i++){unit=DateUnitsReversed[i];if(fn(unit.name,unit,i)===false){break;}}} 1096function advanceDate(d,args){var args=collectDateArguments(args,true);return updateDate(d,args[0],args[1],1);} 1097function setDate(d,args){var args=collectDateArguments(args);return updateDate(d,args[0],args[1])} 1098function resetDate(d,unit){var params={},recognized;unit=unit||'hours';if(unit==='date')unit='days';recognized=DateUnits.some(function(u){return unit===u.name||unit===u.name+'s';});params[unit]=unit.match(/^days?/)?1:0;return recognized?setDate(d,[params,true]):d;} 1099function setWeekday(d,dow){if(isUndefined(dow))return;return callDateSet(d,'Date',callDateGet(d,'Date')+dow-callDateGet(d,'Day'));} 1100function moveToBeginningOfUnit(d,unit){var set={};switch(unit){case'year':set['year']=callDateGet(d,'FullYear');break;case'month':set['month']=callDateGet(d,'Month');break;case'day':set['day']=callDateGet(d,'Date');break;case'week':set['weekday']=0;break;} 1101return setDate(d,[set,true]);} 1102function moveToEndOfUnit(d,unit){var set={'hours':23,'minutes':59,'seconds':59,'milliseconds':999};switch(unit){case'year':set['month']=11;set['day']=31;break;case'month':set['day']=getDaysInMonth(d);break;case'week':set['weekday']=6;break;} 1103return setDate(d,[set,true]);} 1104function getFormatMatch(match,arr){var obj={},value,num;arr.forEach(function(key,i){value=match[i+1];if(isUndefined(value)||value==='')return;if(key==='year'){obj.yearAsString=value.replace(/'/,'');} 1105num=parseFloat(value.replace(/'/,'').replace(/,/,'.'));obj[key]=!isNaN(num)?num:value.toLowerCase();});return obj;} 1106function cleanDateInput(str){str=str.trim().replace(/^just (?=now)|\.+$/i,'');return convertAsianDigits(str);} 1107function convertAsianDigits(str){return str.replace(AsianDigitReg,function(full,disallowed,match){var sum=0,place=1,lastWasHolder,lastHolder;if(disallowed)return full;match.split('').reverse().forEach(function(letter){var value=AsianDigitMap[letter],holder=value>9;if(holder){if(lastWasHolder)sum+=place;place*=value/(lastHolder||1);lastHolder=value;}else{if(lastWasHolder===false){place*=10;} 1108sum+=place*value;} 1109lastWasHolder=holder;});if(lastWasHolder)sum+=place;return sum;});} 1110function getExtendedDate(f,localeCode,prefer,forceUTC){var d,relative,baseLocalization,afterCallbacks,loc,set,unit,unitIndex,weekday,num,tmp;d=getNewDate();afterCallbacks=[];function afterDateSet(fn){afterCallbacks.push(fn);} 1111function fireCallbacks(){afterCallbacks.forEach(function(fn){fn.call();});} 1112function setWeekdayOfMonth(){var w=d.getDay();setWeekday(d,(7*(set['num']-1))+(w>weekday?weekday+7:weekday));} 1113function setUnitEdge(){var modifier=loc.modifiersByName[set['edge']];iterateOverDateUnits(function(name){if(isDefined(set[name])){unit=name;return false;}},4);if(unit==='year'){set.specificity='month';}else if(unit==='month'||unit==='week'){set.specificity='day';} 1114if(modifier.value<0){moveToEndOfUnit(d,unit);}else{moveToBeginningOfUnit(d,unit);} 1115if(modifier.value===-2)resetDate(d);} 1116function separateAbsoluteUnits(){var params;iterateOverDateUnits(function(name,u,i){if(name==='day')name='date';if(isDefined(set[name])){if(i>=unitIndex){invalidateDate(d);return false;} 1117params=params||{};params[name]=set[name];delete set[name];}});if(params){afterDateSet(function(){setDate(d,[params,true]);});}} 1118setUTC(d,forceUTC);if(isDate(f)){setUTC(d,isUTC(f)).setTime(f.getTime());}else if(isNumber(f)||f===null){d.setTime(f);}else if(isObjectType(f)){setDate(d,[f,true]);set=f;}else if(isString(f)){baseLocalization=getLocalization(localeCode);f=cleanDateInput(f);if(baseLocalization){iterateOverObject(baseLocalization.getFormats(),function(i,dif){var match=f.match(dif.reg);if(match){loc=dif.locale;set=getFormatMatch(match,dif.to,loc);loc.cachedFormat=dif;if(set['utc']){setUTC(d,true);} 1119if(set.timestamp){set=set.timestamp;return false;} 1120if(dif.variant&&!isString(set['month'])&&(isString(set['date'])||baseLocalization.hasVariant(localeCode))){tmp=set['month'];set['month']=set['date'];set['date']=tmp;} 1121if(hasAbbreviatedYear(set)){set['year']=getYearFromAbbreviation(set['year']);} 1122if(set['month']){set['month']=loc.getMonth(set['month']);if(set['shift']&&!set['unit'])set['unit']=loc['units'][7];} 1123if(set['weekday']&&set['date']){delete set['weekday'];}else if(set['weekday']){set['weekday']=loc.getWeekday(set['weekday']);if(set['shift']&&!set['unit'])set['unit']=loc['units'][5];}
1124if(set['day']&&(tmp=loc.modifiersByName[set['day']])){set['day']=tmp.value;resetDate(d);relative=true;}else if(set['day']&&(weekday=loc.getWeekday(set['day']))>-1){delete set['day'];if(set['num']&&set['month']){afterDateSet(setWeekdayOfMonth);set['day']=1;}else{set['weekday']=weekday;}} 1125if(set['date']&&!isNumber(set['date'])){set['date']=loc.getNumericDate(set['date']);} 1126if(loc.matchPM(set['ampm'])&&set['hour']<12){set['hour']+=12;}else if(loc.matchAM(set['ampm'])&&set['hour']===12){set['hour']=0;} 1127if('offset_hours'in set||'offset_minutes'in set){setUTC(d,true);set['offset_minutes']=set['offset_minutes']||0;set['offset_minutes']+=set['offset_hours']*60;if(set['offset_sign']==='-'){set['offset_minutes']*=-1;} 1128set['minute']-=set['offset_minutes'];} 1129if(set['unit']){relative=true;num=loc.getNumber(set['num']);unitIndex=loc.getUnitIndex(set['unit']);unit=English['units'][unitIndex];separateAbsoluteUnits();if(set['shift']){num*=(tmp=loc.modifiersByName[set['shift']])?tmp.value:0;} 1130if(set['sign']&&(tmp=loc.modifiersByName[set['sign']])){num*=tmp.value;} 1131if(isDefined(set['weekday'])){setDate(d,[{'weekday':set['weekday']},true]);delete set['weekday'];} 1132set[unit]=(set[unit]||0)+num;} 1133if(set['edge']){afterDateSet(setUnitEdge);} 1134if(set['year_sign']==='-'){set['year']*=-1;} 1135iterateOverDateUnits(function(name,unit,i){var value=set[name],fraction=value%1;if(fraction){set[DateUnitsReversed[i-1].name]=round(fraction*(name==='second'?1000:60));set[name]=floor(value);}},1,4);return false;}});} 1136if(!set){if(f!=='now'){d=new date(f);} 1137if(forceUTC){d.addMinutes(-d.getTimezoneOffset());}}else if(relative){advanceDate(d,[set]);}else{if(d._utc){resetDate(d);} 1138updateDate(d,set,true,false,prefer);} 1139fireCallbacks();setUTC(d,false);} 1140return{date:d,set:set}} 1141function hasAbbreviatedYear(obj){return obj.yearAsString&&obj.yearAsString.length===2;} 1142function getYearFromAbbreviation(year){return round(callDateGet(getNewDate(),'FullYear')/100)*100-round(year/100)*100+year;} 1143function getShortHour(d){var hours=callDateGet(d,'Hours');return hours===0?12:hours-(floor(hours/13)*12);} 1144function getWeekNumber(date){date=cloneDate(date);var dow=callDateGet(date,'Day')||7;resetDate(advanceDate(date,[(4-dow)+' days']));return 1+floor(sugarDate.daysSince(date,moveToBeginningOfUnit(cloneDate(date),'year'))/7);} 1145function setWeekNumber(date,num){var weekday=callDateGet(date,'Day')||7;if(isUndefined(num))return;setDate(date,[{'month':0,'date':4}]);setDate(date,[{'weekday':1}]);if(num>1){advanceDate(date,[{'weeks':num-1}]);} 1146if(weekday!==1){advanceDate(date,[{'days':weekday-1}]);} 1147return date.getTime();} 1148function getDaysInMonth(d){return 32-callDateGet(new date(callDateGet(d,'FullYear'),callDateGet(d,'Month'),32),'Date');} 1149function getAdjustedUnit(ms){var next,ams=abs(ms),value=ams,unitIndex=0;iterateOverDateUnits(function(name,unit,i){next=floor(withPrecision(ams/unit.multiplier(),1));if(next>=1){value=next;unitIndex=i;}},1);return[value,unitIndex,ms];} 1150function getRelativeWithMonthFallback(date){var adu=getAdjustedUnit(sugarDate.millisecondsFromNow(date));if(allowMonthFallback(date,adu)){adu[0]=abs(sugarDate.monthsFromNow(date));adu[1]=6;} 1151return adu;} 1152function allowMonthFallback(date,adu){return adu[1]===6||(adu[1]===5&&adu[0]===4&&sugarDate.daysFromNow(date)>=getDaysInMonth(getNewDate()));} 1153function createMeridianTokens(slice,caps){var fn=function(d,localeCode){var hours=callDateGet(d,'Hours');return getLocalization(localeCode).get('ampm')[floor(hours/12)]||'';} 1154createFormatToken('t',fn,1);createFormatToken('tt',fn);createFormatToken('T',fn,1,1);createFormatToken('TT',fn,null,2);} 1155function createWeekdayTokens(slice,caps){var fn=function(d,localeCode){var dow=callDateGet(d,'Day');return getLocalization(localeCode)['weekdays'][dow];} 1156createFormatToken('dow',fn,3);createFormatToken('Dow',fn,3,1);createFormatToken('weekday',fn);createFormatToken('Weekday',fn,null,1);} 1157function createMonthTokens(slice,caps){createMonthToken('mon',0,3);createMonthToken('month',0);createMonthToken('month2',1);createMonthToken('month3',2);} 1158function createMonthToken(token,multiplier,slice){var fn=function(d,localeCode){var month=callDateGet(d,'Month');return getLocalization(localeCode)['months'][month+(multiplier*12)];};createFormatToken(token,fn,slice);createFormatToken(simpleCapitalize(token),fn,slice,1);} 1159function createFormatToken(t,fn,slice,caps){DateFormatTokens[t]=function(d,localeCode){var str=fn(d,localeCode);
1159if(slice)str=str.slice(0,slice);if(caps)str=str.slice(0,caps).toUpperCase()+str.slice(caps);return str;}} 1160function createPaddedToken(t,fn,ms){DateFormatTokens[t]=fn;DateFormatTokens[t+t]=function(d,localeCode){return padNumber(fn(d,localeCode),2);};if(ms){DateFormatTokens[t+t+t]=function(d,localeCode){return padNumber(fn(d,localeCode),3);};DateFormatTokens[t+t+t+t]=function(d,localeCode){return padNumber(fn(d,localeCode),4);};}} 1161function buildCompiledOutputFormat(format){var match=format.match(/(\{\w+\})|[^{}]+/g);CompiledOutputFormats[format]=match.map(function(p){p.replace(/\{(\w+)\}/,function(full,token){p=DateFormatTokens[token]||token;return token;});return p;});} 1162function executeCompiledOutputFormat(date,format,localeCode){var compiledFormat,length,i,t,result='';compiledFormat=CompiledOutputFormats[format];for(i=0,length=compiledFormat.length;i<length;i++){t=compiledFormat[i];result+=isFunction(t)?t(date,localeCode):t;} 1163return result;} 1164function formatDate(date,format,relative,localeCode){var adu;if(!isValid(date)){return'Invalid Date';}else if(isString(sugarDate[format])){format=sugarDate[format];}else if(isFunction(format)){adu=getRelativeWithMonthFallback(date);format=format.apply(date,adu.concat(getLocalization(localeCode)));} 1165if(!format&&relative){adu=adu||getRelativeWithMonthFallback(date);if(adu[1]===0){adu[1]=1;adu[0]=1;} 1166return getLocalization(localeCode).getRelativeFormat(adu);} 1167format=format||'long';if(format==='short'||format==='long'||format==='full'){format=getLocalization(localeCode)[format];} 1168if(!CompiledOutputFormats[format]){buildCompiledOutputFormat(format);} 1169return executeCompiledOutputFormat(date,format,localeCode);} 1170function fullCompareDate(d,f,margin,utc){var tmp,comp;if(!isValid(d))return;if(isString(f)){f=f.trim().toLowerCase();comp=setUTC(cloneDate(d),utc);switch(true){case f==='future':return d.getTime()>getNewDate().getTime();case f==='past':return d.getTime()<getNewDate().getTime();case f==='weekday':return callDateGet(comp,'Day')>0&&callDateGet(comp,'Day')<6;case f==='weekend':return callDateGet(comp,'Day')===0||callDateGet(comp,'Day')===6;case(tmp=English['weekdays'].indexOf(f)%7)>-1:return callDateGet(comp,'Day')===tmp;case(tmp=English['months'].indexOf(f)%12)>-1:return callDateGet(comp,'Month')===tmp;}} 1171return compareDate(d,f,null,margin,utc);} 1172function compareDate(d,find,localeCode,buffer,forceUTC){var p,t,min,max,override,accuracy=0,loBuffer=0,hiBuffer=0;p=getExtendedDate(find,localeCode,null,forceUTC);if(buffer>0){loBuffer=hiBuffer=buffer;override=true;} 1173if(!isValid(p.date))return false;if(p.set&&p.set.specificity){if(p.set['edge']||p.set['shift']){moveToBeginningOfUnit(p.date,p.set.specificity);} 1174if(p.set.specificity==='month'){max=moveToEndOfUnit(cloneDate(p.date),p.set.specificity).getTime();}else{max=advanceDate(cloneDate(p.date),['1 '+p.set.specificity]).getTime()-1;} 1175if(!override&&p.set['sign']&&p.set.specificity!=='millisecond'){loBuffer=50;hiBuffer=-50;}} 1176t=d.getTime();min=p.date.getTime();max=max||(min+accuracy);max=compensateForTimezoneTraversal(d,min,max);return t>=(min-loBuffer)&&t<=(max+hiBuffer);} 1177function compensateForTimezoneTraversal(d,min,max){var dMin,dMax,minOffset,maxOffset;dMin=new date(min);dMax=setUTC(new date(max),isUTC(d));if(callDateGet(dMax,'Hours')!==23){minOffset=dMin.getTimezoneOffset();maxOffset=dMax.getTimezoneOffset();if(minOffset!==maxOffset){max+=(maxOffset-minOffset).minutes();}} 1178return max;} 1179function updateDate(d,params,reset,advance,prefer){var weekday,specificityIndex;function getParam(key){return isDefined(params[key])?params[key]:params[key+'s'];} 1180function paramExists(key){return isDefined(getParam(key));} 1181function uniqueParamExists(key,isDay){return paramExists(key)||(isDay&¶mExists('weekday'));} 1182function canDisambiguate(){switch(prefer){case-1:return d>getNewDate();case 1:return d<getNewDate();}} 1183if(isNumber(params)&&advance){params={'milliseconds':params};}else if(isNumber(params)){d.setTime(params);return d;} 1184if(isDefined(params['date'])){params['day']=params['date'];} 1185iterateOverDateUnits(function(name,unit,i){var isDay=name==='day';if(uniqueParamExists(name,isDay)){params.specificity=name;specificityIndex=+i;return false;}else if(reset&&name!=='week'&&(!isDay||!paramExists('week'))){callDateSet(d,unit.method,(isDay?1:0));}});
1185DateUnits.forEach(function(u,i){var name=u.name,method=u.method,higherUnit=DateUnits[i-1],value;value=getParam(name) 1186if(isUndefined(value))return;if(advance){if(name==='week'){value=(params['day']||0)+(value*7);method='Date';} 1187value=(value*advance)+callDateGet(d,method);}else if(name==='month'&¶mExists('day')){callDateSet(d,'Date',15);} 1188callDateSetWithWeek(d,method,value);if(advance&&name==='month'){checkMonthTraversal(d,value);}});if(!advance&&!paramExists('day')&¶mExists('weekday')){var weekday=getParam('weekday'),isAhead,futurePreferred;setWeekday(d,weekday);} 1189if(canDisambiguate()){iterateOverDateUnits(function(name,u){var ambiguous=u.ambiguous||(name==='week'&¶mExists('weekday'));if(ambiguous&&!uniqueParamExists(name,name==='day')){sugarDate[u.addMethod](d,prefer);return false;}else if(name==='year'&&hasAbbreviatedYear(params)){advanceDate(d,[{'years':100*prefer}]);}},specificityIndex+1);} 1190return d;} 1191function prepareTime(format,loc,iso){var timeSuffixMapping={'h':0,'m':1,'s':2},add;loc=loc||English;return format.replace(/{([a-z])}/g,function(full,token){var separators=[],isHours=token==='h',tokenIsRequired=isHours&&!iso;if(token==='t'){return loc.get('ampm').join('|');}else{if(isHours){separators.push(':');} 1192if(add=loc['timeSuffixes'][timeSuffixMapping[token]]){separators.push(add+'\\s*');} 1193return separators.length===0?'':'(?:'+separators.join('|')+')'+(tokenIsRequired?'':'?');}});} 1194function checkMonthTraversal(date,targetMonth){if(targetMonth<0){targetMonth=targetMonth%12+12;} 1195if(targetMonth%12!==callDateGet(date,'Month')){callDateSet(date,'Date',0);}} 1196function createDate(args,prefer,forceUTC){var f,localeCode;if(isNumber(args[1])){f=collectDateArguments(args)[0];}else{f=args[0];localeCode=args[1];} 1197return getExtendedDate(f,localeCode,prefer,forceUTC).date;}
1198function invalidateDate(d){d.setTime(NaN);} 1199function buildDateUnits(){DateUnitsReversed=DateUnits.concat().reverse();DateArgumentUnits=DateUnits.concat();DateArgumentUnits.splice(2,1);} 1200function buildDateMethods(){extendSimilar(date,DateUnits,function(methods,u,i){var name=u.name,caps=simpleCapitalize(name),multiplier=u.multiplier(),since,until;u.addMethod='add'+caps+'s';function applyErrorMargin(ms){var num=ms/multiplier,fraction=num%1,error=u.error||0.999;if(fraction&&abs(fraction%1)>error){num=round(num);} 1201return num<0?ceil(num):floor(num);} 1202since=function(f,localeCode){return applyErrorMargin(this.getTime()-createDate([f,localeCode]).getTime());};until=function(f,localeCode){return applyErrorMargin(createDate([f,localeCode]).getTime()-this.getTime());};methods[name+'sAgo']=until;methods[name+'sUntil']=until;methods[name+'sSince']=since;methods[name+'sFromNow']=since;methods[u.addMethod]=function(num,reset){var set={};set[name]=num;return advanceDate(this,[set,reset]);};buildNumberToDateAlias(u,multiplier);if(i<3){['Last','This','Next'].forEach(function(shift){methods['is'+shift+caps]=function(){return compareDate(this,shift+' '+name,'en');};});} 1203if(i<4){methods['beginningOf'+caps]=function(){return moveToBeginningOfUnit(this,name);};methods['endOf'+caps]=function(){return moveToEndOfUnit(this,name);};}});} 1204function buildCoreInputFormats(){English.addFormat('([+-])?(\\d{4,4})[-.\\/]?{full_month}[-.]?(\\d{1,2})?',true,['year_sign','year','month','date'],false,true);English.addFormat('(\\d{1,2})[-.\\/]{full_month}(?:[-.\\/](\\d{2,4}))?',true,['date','month','year'],true);English.addFormat('{full_month}[-.](\\d{4,4})',false,['month','year']);English.addFormat('\\/Date\\((\\d+(?:[+-]\\d{4,4})?)\\)\\/',false,['timestamp']) 1205English.addFormat(prepareTime(RequiredTime,English),false,TimeFormat) 1206CoreDateFormats=English.compiledFormats.slice(0,7).reverse();English.compiledFormats=English.compiledFormats.slice(7).concat(CoreDateFormats);} 1207function buildFormatTokens(){createPaddedToken('f',function(d){return callDateGet(d,'Milliseconds');},true);createPaddedToken('s',function(d){return callDateGet(d,'Seconds');});createPaddedToken('m',function(d){return callDateGet(d,'Minutes');});createPaddedToken('h',function(d){return callDateGet(d,'Hours')%12||12;});createPaddedToken('H',function(d){return callDateGet(d,'Hours');});createPaddedToken('d',function(d){return callDateGet(d,'Date');});createPaddedToken('M',function(d){return callDateGet(d,'Month')+1;});createMeridianTokens();createWeekdayTokens();createMonthTokens();DateFormatTokens['ms']=DateFormatTokens['f'];DateFormatTokens['milliseconds']=DateFormatTokens['f'];DateFormatTokens['seconds']=DateFormatTokens['s'];DateFormatTokens['minutes']=DateFormatTokens['m'];DateFormatTokens['hours']=DateFormatTokens['h'];DateFormatTokens['24hr']=DateFormatTokens['H'];DateFormatTokens['12hr']=DateFormatTokens['h'];DateFormatTokens['date']=DateFormatTokens['d'];DateFormatTokens['day']=DateFormatTokens['d'];DateFormatTokens['year']=DateFormatTokens['yyyy'];} 1208function buildFormatShortcuts(){extendSimilar(date,'short,long,full',function(methods,name){methods[name]=function(localeCode){return formatDate(this,name,false,localeCode);}});} 1209function buildAsianDigits(){KanjiDigits.split('').forEach(function(digit,value){var holder;if(value>9){value=pow(10,value-9);} 1210AsianDigitMap[digit]=value;});simpleMerge(AsianDigitMap,NumberNormalizeMap);AsianDigitReg=regexp('([æé±å¨])?(['+KanjiDigits+FullWidthDigits+']+)(?!æ¨)','g');} 1211function buildRelativeAliases(){var special='today,yesterday,tomorrow,weekday,weekend,future,past'.split(',');var weekdays=English['weekdays'].slice(0,7);var months=English['months'].slice(0,12);extendSimilar(date,special.concat(weekdays).concat(months),function(methods,name){methods['is'+simpleCapitalize(name)]=function(utc){return fullCompareDate(this,name,0,utc);};});} 1212function buildUTCAliases(){extend(date,{'utc':{'create':function(){return createDate(arguments,0,true);},'past':function(){return createDate(arguments,-1,true);},'future':function(){return createDate(arguments,1,true);}}},false);} 1213function setDateProperties(){extend(date,{'RFC1123':'{Dow}, {dd} {Mon} {yyyy} {HH}:{mm}:{ss} {tz}','RFC1036':'{Weekday}, {dd}-{Mon}-{yy} {HH}:{mm}:{ss} {tz}','ISO8601_DATE':'{yyyy}-{MM}-{dd}','ISO8601_DATETIME':'{yyyy}-{MM}-{dd}T{HH}:{mm}:{ss}.{fff}{isotz}'},false);} 1214extend(date,{'create':function(){return createDate(arguments);},'past':function(){return createDate(arguments,-1);}
1214,'future':function(){return createDate(arguments,1);},'addLocale':function(localeCode,set){return setLocalization(localeCode,set);},'setLocale':function(localeCode,set){var loc=getLocalization(localeCode,false);CurrentLocalization=loc;if(localeCode&&localeCode!==loc['code']){loc['code']=localeCode;} 1215return loc;},'getLocale':function(localeCode){return!localeCode?CurrentLocalization:getLocalization(localeCode,false);},'addFormat':function(format,match,localeCode){addDateInputFormat(getLocalization(localeCode),format,match);}},false);extend(date,{'set':function(){return setDate(this,arguments);},'setWeekday':function(dow){return setWeekday(this,dow);},'setISOWeek':function(num){return setWeekNumber(this,num);},'getISOWeek':function(){return getWeekNumber(this);},'beginningOfISOWeek':function(){var day=this.getDay();if(day===0){day=-6;}else if(day!==1){day=1;} 1216setWeekday(this,day);return resetDate(this);},'endOfISOWeek':function(){if(this.getDay()!==0){setWeekday(this,7);} 1217return moveToEndOfUnit(this,'day');},'getUTCOffset':function(iso){return getUTCOffset(this,iso);},'setUTC':function(set){return setUTC(this,set);},'isUTC':function(){return isUTC(this);},'advance':function(){return advanceDate(this,arguments);},'rewind':function(){var args=collectDateArguments(arguments,true);return updateDate(this,args[0],args[1],-1);},'isValid':function(){return isValid(this);},'isAfter':function(d,margin,utc){return this.getTime()>createDate([d]).getTime()-(margin||0);},'isBefore':function(d,margin){return this.getTime()<createDate([d]).getTime()+(margin||0);},'isBetween':function(d1,d2,margin){var t=this.getTime();var t1=createDate([d1]).getTime();var t2=createDate([d2]).getTime();var lo=min(t1,t2);var hi=max(t1,t2);margin=margin||0;return(lo-margin<t)&&(hi+margin>t);},'isLeapYear':function(){return isLeapYear(this);},'daysInMonth':function(){return getDaysInMonth(this);},'format':function(f,localeCode){return formatDate(this,f,false,localeCode);},'relative':function(fn,localeCode){if(isString(fn)){localeCode=fn;fn=null;} 1218return formatDate(this,fn,true,localeCode);},'is':function(f,margin,utc){return fullCompareDate(this,f,margin,utc);},'reset':function(unit){return resetDate(this,unit);},'clone':function(){return cloneDate(this);},'iso':function(){return this.toISOString();},'getWeekday':function(){return this.getDay();},'getUTCWeekday':function(){return this.getUTCDay();}});function buildNumberToDateAlias(u,multiplier){var name=u.name,methods={};function base(){return round(this*multiplier);} 1219function after(){return sugarDate[u.addMethod](createDate(arguments),this);} 1220function before(){return sugarDate[u.addMethod](createDate(arguments),-this);} 1221methods[name]=base;methods[name+'s']=base;methods[name+'Before']=before;methods[name+'sBefore']=before;methods[name+'Ago']=before;methods[name+'sAgo']=before;methods[name+'After']=after;methods[name+'sAfter']=after;methods[name+'FromNow']=after;methods[name+'sFromNow']=after;extend(number,methods);} 1222extend(number,{'duration':function(localeCode){return getLocalization(localeCode).getDuration(this);}});English=CurrentLocalization=sugarDate.addLocale('en',{'plural':true,'timeMarker':'at','ampm':'am,pm','months':'January,February,March,April,May,June,July,August,September,October,November,December','weekdays':'Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday','units':'millisecond:|s,second:|s,minute:|s,hour:|s,day:|s,week:|s,month:|s,year:|s','numbers':'one,two,three,four,five,six,seven,eight,nine,ten','articles':'a,an,the','tokens':'the,st|nd|rd|th,of','short':'{Month} {d}, {yyyy}','long':'{Month} {d}, {yyyy} {h}:{mm}{tt}','full':'{Weekday} {Month} {d}, {yyyy} {h}:{mm}:{ss}{tt}','past':'{num} {unit} {sign}','future':'{num} {unit} {sign}','duration':'{num} {unit}','modifiers':[{'name':'sign','src':'ago|before','value':-1},{'name':'sign','src':'from now|after|from|in|later','value':1},{'name':'edge','src':'last day','value':-2},{'name':'edge','src':'end','value':-1},{'name':'edge','src':'first day|beginning','value':1},{'name':'shift','src':'last','value':-1},{'name':'shift','src':'the|this','value':0},{'name':'shift','src':'next','value':1}],'dateParse':['{month} {year}','{shift} {unit=5-7}','{0?} {date}{1}','{0?} {edge} of {shift?} {unit=4-7?} {month?} {year?}'],'timeParse':['{num} {unit} {sign}','{sign} {num} {unit}','{0} {num}{1} {day} of {month} {year?}','{weekday?} {month} {date}{1?} {year?}','{date} {month} {year}','{date} {month}','{shift} {weekday}','{shift} week {weekday}','{weekday} {2?} {shift} week','{num} {unit=4-5} {sign} {day}','{0?} {date}{1} of {month}','{0?}{month?} {date?}{1?} of {shift} {unit=6-7}','{edge} of {day}']});buildDateUnits();buildDateMethods();buildCoreInputFormats();buildFormatTokens();buildFormatShortcuts();buildAsianDigits();buildRelativeAliases();buildUTCAliases();setDateProperties();var DATE_UNITS='year|month|week|day|hour|minute|(?:milli)?second';var FULL_CAPTURED_DURATION='((?:\\d+)?\\s*(?:'+DATE_UNITS+'))s?';
1222var RANGE_REG=/(?:from)?\s*(.+)\s+(?:to|until)\s+(.+)$/i;var DURATION_REG=regexp('(\\d+)?\\s*('+DATE_UNITS+')s?','i');var RANGE_REG_FRONT_DURATION=regexp('(?:for)?\\s*'+FULL_CAPTURED_DURATION+'\\s*(?:starting)?\\s*at\\s*(.+)','i');var RANGE_REG_REAR_DURATION=regexp('(.+)\\s*for\\s*'+FULL_CAPTURED_DURATION,'i');function Range(start,end){this.start=cloneRangeMember(start);this.end=cloneRangeMember(end);};function getRangeMemberNumericValue(m){return isString(m)?m.charCodeAt(0):m;} 1223function getRangeMemberPrimitiveValue(m){if(m==null)return m;return isDate(m)?m.getTime():m.valueOf();} 1224function getPrecision(n){var split=n.toString().split('.');return split[1]?split[1].length:0;} 1225function getGreaterPrecision(n1,n2){return max(getPrecision(n1),getPrecision(n2));} 1226function getSimpleDate(str){return str==null?new date():new date(str);} 1227function getSugarExtendedDate(d){return sugarDate.create(d);} 1228function dateConstructorIsExtended(){return!!sugarDate.create;} 1229function createDateRangeFromString(str){var match,datetime,duration,dio,start,end;if(match=str.match(RANGE_REG)){return DateRangeConstructor(match[1],match[2]);} 1230if(match=str.match(RANGE_REG_FRONT_DURATION)){duration=match[1];datetime=match[2];} 1231if(match=str.match(RANGE_REG_REAR_DURATION)){datetime=match[1];duration=match[2];} 1232if(datetime&&duration){start=getSugarExtendedDate(datetime);dio=getDateIncrementObject(duration);end=incrementDate(start,dio[0],dio[1]);} 1233return DateRangeConstructor(start,end);} 1234function cloneRangeMember(m){if(isDate(m)){return new date(m.getTime());}else{return getRangeMemberPrimitiveValue(m);}} 1235function isValidRangeMember(m){var val=getRangeMemberPrimitiveValue(m);return(!!val||val===0)&&valueIsNotInfinite(m);} 1236function valueIsNotInfinite(m){return m!==-Infinity&&m!==Infinity;} 1237function getDateIncrementObject(amt){var match,val,unit;if(isNumber(amt)){return[amt,'Milliseconds'];} 1238match=amt.match(DURATION_REG);val=parseInt(match[1])||1;unit=match[2].slice(0,1).toUpperCase()+match[2].slice(1).toLowerCase();if(unit.match(/hour|minute|second/i)){unit+='s';}else if(unit==='Year'){unit='FullYear';}else if(unit==='Day'){unit='Date';} 1239return[val,unit];} 1240function incrementDate(current,amount,unit){var val=callDateGet(current,unit);var d=new date(current.getTime());callDateSet(d,unit,val+amount);return d;} 1241function incrementString(current,amount){return string.fromCharCode(current.charCodeAt(0)+amount);} 1242function incrementNumber(current,amount,precision){return withPrecision(current+amount,precision);} 1243Range.prototype.toString=function(){return this.isValid()?this.start+".."+this.end:'Invalid Range';};extend(Range,{'isValid':function(){return isValidRangeMember(this.start)&&isValidRangeMember(this.end)&&typeof this.start===typeof this.end;},'span':function(){return this.isValid()?abs(getRangeMemberNumericValue(this.end)-getRangeMemberNumericValue(this.start))+1:NaN;},'contains':function(obj){var self=this,arr;if(obj==null)return false;if(obj.start&&obj.end){return obj.start>=this.start&&obj.start<=this.end&&obj.end>=this.start&&obj.end<=this.end;}else{return obj>=this.start&&obj<=this.end;}},'every':function(amount,fn){var increment,precision,dio,unit,start=this.start,end=this.end,inverse=end<start,current=start,index=0,result=[];if(!this.isValid()){return[];} 1244if(isFunction(amount)){fn=amount;amount=null;} 1245amount=amount||1;if(isNumber(start)){precision=getGreaterPrecision(start,amount);increment=function(){return incrementNumber(current,amount,precision);};}else if(isString(start)){increment=function(){return incrementString(current,amount);};}else if(isDate(start)){dio=getDateIncrementObject(amount);amount=dio[0];unit=dio[1];increment=function(){return incrementDate(current,amount,unit);};} 1246if(inverse&&amount>0){amount*=-1;} 1247while(inverse?current>=end:current<=end){result.push(current);if(fn){fn(current,index);} 1248current=increment();index++;} 1249return result;},'union':function(range){return new Range(this.start<range.start?this.start:range.start,this.end>range.end?this.end:range.end);},'intersect':function(range){if(range.start>this.end||range.end<this.start){return new Range(NaN,NaN);} 1250return new Range(this.start>range.start?this.start:range.start,this.end<range.end?this.end:range.end);},'clone':function(range){return new Range(this.start,this.end);},'clamp':function(obj){var clamped,start=this.start,end=this.end,min=end<start?end:start,max=start>end?start:end;if(obj<min){clamped=min;}else if(obj>max){clamped=max;}else{clamped=obj;} 1251return cloneRangeMember(clamped);}});function extendRangeConstructor(klass,constructor){extend(klass,{'range':constructor},false);} 1252var PrimitiveRangeConstructor=function(start,end){return new Range(start,end);};var DateRangeConstructor=function(start,end){if(dateConstructorIsExtended()){if(arguments.length===1&&isString(start)){return createDateRangeFromString(start);} 1253start=getSugarExtendedDate(start);end=getSugarExtendedDate(end);}else{start=getSimpleDate(start);end=getSimpleDate(end);} 1254return new Range(start,end);};extendRangeConstructor(number,PrimitiveRangeConstructor);extendRangeConstructor(string,PrimitiveRangeConstructor);extendRangeConstructor(date,DateRangeConstructor);extend(number,{'upto':function(num,fn,step){return new Range(this,num).every(step,fn);},'clamp':function(start,end){return new Range(start,end).clamp(this);},'cap':function(max){return new Range(Undefined,max).clamp(this);}});alias(number,'downto','upto');extend(array,{'create':function(range){return range.every();}},false,function(a){return a instanceof Range;});function setDelay(fn,ms,after,scope,args){if(ms===Infinity)return;if(!fn.timers)fn.timers=[];if(!isNumber(ms))ms=1;fn._canceled=false;fn.timers.push(setTimeout(function(){if(!fn._canceled){after.apply(scope,args||[]);}},ms));} 1255function cancelFunction(fn){var timers=fn.timers,timer;if(isArray(timers)){while(timer=timers.shift()){clearTimeout(timer);}} 1256fn._canceled=true;return fn;} 1257function createLazyFunction(fn,ms,immediate,limit){var queue=[],locked=false,execute,rounded,perExecution,result;ms=ms||1;limit=limit||Infinity;rounded=ceil(ms);perExecution=round(rounded/ms)||1;execute=function(){var queueLength=queue.length,maxPerRound;if(queueLength==0)return;maxPerRound=max(queueLength-perExecution,0);while(queueLength>maxPerRound){result=func.prototype.apply.apply(fn,queue.shift());queueLength--;} 1258setDelay(lazy,rounded,function(){locked=false;execute();});} 1259function lazy(){if(queue.length<limit-(locked&&immediate?1:0)){queue.push([this,arguments]);} 1260if(!locked){locked=true;if(immediate){execute();}else{setDelay(lazy,rounded,execute);}} 1261return result;} 1262return lazy;} 1263extend(func,{'lazy':function(ms,immediate,limit){return createLazyFunction(this,ms,immediate,limit);},'throttle':function(ms){return createLazyFunction(this,ms,true,1);},'debounce':function(ms){var fn=this;function debounced(){cancelFunction(debounced);setDelay(debounced,ms,fn,this,arguments);};return debounced;},'delay':function(ms){var fn=this;var args=multiArgs(arguments,null,1);setDelay(fn,ms,fn,fn,args);return fn;},'every':function(ms){var fn=this,args=arguments;args=args.length>1?multiArgs(args,null,1):[];function execute(){fn.apply(fn,args);setDelay(fn,ms,execute);} 1264setDelay(fn,ms,execute);return fn;},'cancel':function(){return cancelFunction(this);},'after':function(num){var fn=this,counter=0,storedArguments=[];if(!isNumber(num)){num=1;}else if(num===0){fn.call();return fn;} 1265return function(){var ret;storedArguments.push(multiArgs(arguments));counter++;if(counter==num){ret=fn.call(this,storedArguments);counter=0;storedArguments=[];return ret;}}},'once':function(){return createLazyFunction(this,Infinity,true,1);},'fill':function(){var fn=this,curried=multiArgs(arguments);return function(){var args=multiArgs(arguments);curried.forEach(function(arg,index){if(arg!=null||index>=args.length)args.splice(index,0,arg);});return fn.apply(this,args);}}});function getThousands(){var str=sugarNumber.thousands;return isString(str)?str:',';} 1266function getDecimal(){var str=sugarNumber.decimal;return isString(str)?str:'.';} 1267function abbreviateNumber(num,roundTo,str,mid,limit,bytes){var fixed=num.toFixed(20),decimalPlace=fixed.search(/\./),numeralPlace=fixed.search(/[1-9]/),significant=decimalPlace-numeralPlace,unit,i,divisor;if(significant>0){significant-=1;} 1268i=max(min(floor(significant/3),limit===false?str.length:limit),-mid);unit=str.charAt(i+mid-1);if(significant<-9){i=-3;roundTo=abs(significant)-9;unit=str.slice(0,1);} 1269divisor=bytes?pow(2,10*i):pow(10,i*3);return formatNumber(withPrecision(num/divisor,roundTo||0))+unit.trim();} 1270function formatNumber(num,place){var i,str,split,integer,fraction,result='';var thousands=getThousands();var decimal=getDecimal();str=(isNumber(place)?withPrecision(num,place||0).toFixed(max(place,0)):num.toString()).replace(/^-/,'');
1270split=str.split('.');integer=split[0];fraction=split[1];for(i=integer.length;i>0;i-=3){if(i<integer.length){result=thousands+result;} 1271result=integer.slice(max(0,i-3),i)+result;} 1272if(fraction){result+=decimal+repeatString('0',(place||0)-fraction.length)+fraction;} 1273return(num<0?'-':'')+result;} 1274function isInteger(n){return n%1===0;} 1275function isMultiple(n1,n2){return n1%n2===0;} 1276extend(number,{'random':function(n1,n2){var minNum,maxNum;if(arguments.length==1)n2=n1,n1=0;minNum=min(n1||0,isUndefined(n2)?1:n2);maxNum=max(n1||0,isUndefined(n2)?1:n2)+1;return floor((math.random()*(maxNum-minNum))+minNum);}},false);extend(number,{'isNaN':function(value){return value!==value;}},false,true);extend(number,{'log':function(base){return math.log(this)/(base?math.log(base):1);},'abbr':function(precision){return abbreviateNumber(this,precision,'kmbt',0,4);},'metric':function(precision,limit){return abbreviateNumber(this,precision,'nμm kMGTPE',4,isUndefined(limit)?1:limit);},'bytes':function(precision,limit,si){return abbreviateNumber(this,precision,'kMGTPE',0,isUndefined(limit)?4:limit,si!==true)+'B';},'isInteger':function(){return isInteger(this);},'isOdd':function(){return isInteger(this)&&!isMultiple(this,2);},'isEven':function(){return isMultiple(this,2);},'isMultipleOf':function(num){return isMultiple(this,num);},'format':function(place){return formatNumber(this,place);},'hex':function(pad){return padNumber(this,pad||1,false,16);},'times':function(fn){if(fn){for(var i=0;i<this;i++){fn.call(this,i);}} 1277return+this;},'chr':function(){return string.fromCharCode(this);},'pad':function(place,sign,base){return padNumber(this,place,sign,base);},'ordinalize':function(){var suffix,num=abs(this),last=parseInt(num.toString().slice(-2));return this+getOrdinalizedSuffix(last);},'toNumber':function(){return parseFloat(this,10);}});function buildNumber(){function createRoundingFunction(fn){return function(precision){return precision?withPrecision(this,precision,fn):fn(this);}} 1278extend(number,{'ceil':createRoundingFunction(ceil),'round':createRoundingFunction(round),'floor':createRoundingFunction(floor)});extendSimilar(number,'abs,pow,sin,asin,cos,acos,tan,atan,exp,pow,sqrt',function(methods,name){methods[name]=function(a,b){return math[name](this.valueOf(),a,b);}});} 1279buildNumber();var ObjectTypeMethods='isObject,isNaN'.split(',');var ObjectHashMethods='equals,keys,values,select,reject,each,map,size,merge,clone,watch,tap,has,toQueryString'.split(',');function setParamsObject(obj,param,value,castBoolean){var reg=/^(.+?)(\[.*\])$/,paramIsArray,match,allKeys,key;if(match=param.match(reg)){key=match[1];allKeys=match[2].replace(/^\[|\]$/g,'').split('][');allKeys.forEach(function(k){paramIsArray=!k||k.match(/^\d+$/);if(!key&&isArray(obj))key=obj.length;if(!hasOwnProperty(obj,key)){obj[key]=paramIsArray?[]:{};} 1280obj=obj[key];key=k;});if(!key&¶mIsArray)key=obj.length.toString();setParamsObject(obj,key,value,castBoolean);}else if(castBoolean&&value==='true'){obj[param]=true;}else if(castBoolean&&value==='false'){obj[param]=false;}else{obj[param]=value;}} 1281function objectToQueryString(base,obj){var tmp;if(isArray(obj)||(isObjectType(obj)&&obj.toString===internalToString)){tmp=[];iterateOverObject(obj,function(key,value){if(base){key=base+'['+key+']';} 1282tmp.push(objectToQueryString(key,value));});return tmp.join('&');}else{if(!base)return'';return sanitizeURIComponent(base)+'='+(isDate(obj)?obj.getTime():sanitizeURIComponent(obj));}} 1283function sanitizeURIComponent(obj){return!obj&&obj!==false&&obj!==0?'':encodeURIComponent(obj).replace(/%20/g,'+');} 1284function matchInObject(match,key,value){if(isRegExp(match)){return match.test(key);}else if(isObjectType(match)){return match[key]===value;}else{return key===string(match);}} 1285function selectFromObject(obj,args,select){var match,result=obj instanceof Hash?new Hash:{};iterateOverObject(obj,function(key,value){match=false;flattenedArgs(args,function(arg){if(matchInObject(arg,key,value)){match=true;}},1);if(match===select){result[key]=value;}});return result;} 1286var getOwnPropertyNames=object.getOwnPropertyNames;var defineProperty=propertyDescriptorSupport?object.defineProperty:definePropertyShim;var getOwnPropertyDescriptor=propertyDescriptorSupport?object.getOwnPropertyDescriptor:getOwnPropertyDescriptorShim;var iterateOverProperties=propertyDescriptorSupport?iterateOverPropertyNames:iterateOverObject;function iterateOverPropertyNames(obj,fn){getOwnPropertyNames(obj).forEac
1286h(fn);} 1287function getOwnPropertyDescriptorShim(obj,prop){return obj.hasOwnProperty(prop)?{'value':obj[prop]}:Undefined;} 1288function definePropertyShim(obj,prop,descriptor){obj[prop]=descriptor['value'];} 1289function mergeObject(target,source,deep,resolve){if(!isObjectType(source))return target;iterateOverProperties(source,function(prop){var resolved;var sourceDescriptor=getOwnPropertyDescriptor(source,prop);var targetDescriptor=getOwnPropertyDescriptor(target,prop);var sourceVal=sourceDescriptor&&sourceDescriptor.value;var targetVal=targetDescriptor&&targetDescriptor.value;var sourceIsObject=isObjectType(sourceVal);var goingDeep=deep&&sourceIsObject;var conflict=isDefined(targetDescriptor)&&targetDescriptor.value!=null;if(conflict){if(!goingDeep&&resolve===false){return;}else if(isFunction(resolve)){resolved=resolve.call(source,prop,targetVal,sourceVal);if(isDefined(resolved)){sourceDescriptor.value=resolved;goingDeep=false;}}} 1290if(goingDeep){sourceDescriptor.value=handleDeepMerge(targetVal,sourceVal,deep,resolve);} 1291defineProperty(target,prop,sourceDescriptor);});return target;} 1292function handleDeepMerge(targetVal,sourceVal,deep,resolve){if(isDate(sourceVal)){return new date(sourceVal.getTime());}else if(isRegExp(sourceVal)){return new regexp(sourceVal.source,getRegExpFlags(sourceVal));}else{if(!isObjectType(targetVal))targetVal=isArray(sourceVal)?[]:{};return mergeObject(targetVal,sourceVal,deep,resolve);}} 1293function mapAllObject(){buildObjectInstanceMethods(getObjectInstanceMethods(),object);} 1294function unmapAllObject(){var objProto=object.prototype,methods=getObjectInstanceMethods();methods.forEach(function(name){if(objProto[name]){delete objProto[name];}});} 1295function getObjectInstanceMethods(){return ObjectTypeMethods.concat(ObjectHashMethods);} 1296function buildTypeMethods(){extendSimilar(object,natives,function(methods,name){var method='is'+name;ObjectTypeMethods.push(method);methods[method]=typeChecks[name];},false);} 1297extend(object,{'watch':function(obj,prop,fn){var value,descriptor;if(!propertyDescriptorSupport)return false;descriptor=getOwnPropertyDescriptor(obj,prop);if(descriptor&&(!descriptor.configurable||descriptor.get||descriptor.set)){return false;} 1298value=obj[prop];defineProperty(obj,prop,{'configurable':true,'enumerable':!descriptor||descriptor.enumerable,'get':function(){return value;},'set':function(to){value=fn.call(obj,prop,value,to);}});return true;},'unwatch':function(obj,prop){var descriptor;if(!propertyDescriptorSupport)return false;descriptor=getOwnPropertyDescriptor(obj,prop);if(!descriptor.configurable){return;} 1299defineProperty(obj,prop,{'configurable':true,'value':3});}},false,true,true);extend(object,{'keys':function(obj,fn){var keys=object.keys(obj);keys.forEach(function(key){fn.call(obj,key,obj[key]);});return keys;}},false,function(){return arguments.length>1;});extend(object,{'isArguments':function(obj){return isArgumentsObject(obj);},'isObject':function(obj){return isPlainObject(obj);},'isNaN':function(obj){return isNumber(obj)&&obj.valueOf()!==obj.valueOf();},'equal':function(a,b){return isEqual(a,b);},'extended':function(obj){return new Hash(obj);},'merge':function(target,source,deep,resolve){return mergeObject(target,source,deep,resolve);},'values':function(obj,fn){var values=[];iterateOverObject(obj,function(k,v){values.push(v);if(fn)fn.call(obj,v);});return values;},'clone':function(obj,deep){var target,klass;if(!isObjectType(obj)){return obj;} 1300klass=className(obj);if(isDate(obj,klass)&&sugarDate.clone){return sugarDate.clone(obj);}else if(isDate(obj,klass)||isRegExp(obj,klass)){return new obj.constructor(obj);}else if(obj instanceof Hash){target=new Hash;}else if(isArray(obj,klass)){target=[];}else if(isPlainObject(obj,klass)){target={};}else{throw new TypeError('Clone must be a basic data type.');} 1301return mergeObject(target,obj,deep);},'fromQueryString':function(str,castBoolean){var result=new Hash,split;str=str&&str.toString?str.toString():'';str.replace(/^.*?\?/,'').split('&').forEach(function(p){var split=p.split('=');if(split.length!==2)return;setParamsObject(result,split[0],decodeURIComponent(split[1]),castBoolean);});return result;},'toQueryString':function(obj,namespace){return objectToQueryString(namespace,obj);},'tap':function(obj,arg){var fn=arg;if(!isFunction(arg)){fn=function(){if(arg)obj[arg]();}} 1302fn.call(obj,obj);return obj;},'has':function(obj,key){return hasOwnProperty(obj,key);},'select':function(obj){return selectFromObject(obj,arguments,true);},'reject':function(obj){return selectFromObject(obj,arguments,false);},'map':function(obj,map){var result={},key,value;for(key in obj){if(!hasOwnProperty(obj,key))continue;value=obj[key];result[key]=transformArgument(value,map,obj,[key,value,obj]);} 1303return result;},'each':function(obj,fn){checkCallback(fn);iterateOverObject(obj,fn);return obj;},'size':function(obj){return keysWithObjectCoercion(obj).length;}},false);extend(Sugar,{'extendObject':function(on){if(on!==false){mapAllObject();}else{unmapAllObject();} 1304return true;}},false);buildTypeMethods();buildObjectInstanceMethods(ObjectHashMethods,Hash);extend(regexp,{'escape':function(str){return escapeRegExp(str);}},false);extend(regexp,{'getFlags':function(){return getRegExpFlags(this);},'setFlags':function(flags){return regexp(this.source,flags);},'addFlag':function(flag){return regexp(this.source,getRegExpFlags(this,flag));},'removeFlag':function(flag){return regexp(this.source,getRegExpFlags(this).replace(flag,''));}});var HTML_CODE_MATCH=/&#(x)?([\w\d]{0,5});/i;var HTML_VOID_ELEMENTS=['area','base','br','col','command','embed','hr','img','input','keygen','link','meta','param','source','track','wbr'];function getInflector(){return sugarString.Inflector;} 1305function getAcronym(word){var inflector=getInflector();var word=inflector&&inflector.acronyms[word];if(isString(word)){return word;}} 1306function checkRepeatRange(num){num=+num;if(num<0||num===Infinity){throw new RangeError('Invalid number');} 1307return num;} 1308function padString(num,padding){return repeatString(isDefined(padding)?padding:' ',num);} 1309function truncateString(str,length,from,ellipsis,split){var str1,str2,len1,len2;if(str.length<=length){return str.toString();} 1310ellipsis=isUndefined(ellipsis)?'...':ellipsis;switch(from){case'left':str2=split?truncateOnWord(str,length,true):str.slice(str.length-length);return ellipsis+str2;case'middle':len1=ceil(length/2);len2=floor(length/2);str1=split?truncateOnWord(str,len1):str.slice(0,len1);str2=split?truncateOnWord(str,len2,true):str.slice(str.length-len2);return str1+ellipsis+str2;default:str1=split?truncateOnWord(str,length):str.slice(0,length);return str1+ellipsis;}} 1311function stringEach(str,search,fn){var i,len,result,chunks;if(isFunction(search)){fn=search;search=/[\s\S]/g;}else if(!search){search=/[\s\S]/g}else if(isString(search)){search=regexp(escapeRegExp(search),'gi');}else if(isRegExp(search)){search=regexp(search.source,getRegExpFlags(search,'g'));} 1312chunks=str.match(search)||[];if(fn){for(i=0,len=chunks.length;i<len;i++){result=fn.call(str,chunks[i],i,chunks);if(result===false){chunks.length=i+1;break;}else if(isDefined(result)){chunks[i]=result;}}} 1313return chunks;} 1314function eachWord(str,fn){return stringEach(str.trim(),/\S+/g,fn);} 1315function stringCodes(str,fn){var codes=[],i,len;for(i=0,len=str.length;i<len;i++){var code=str.charCodeAt(i);codes.push(code);if(fn)fn.call(str,code,i);} 1316return codes;} 1317function shiftChar(str,n){var result='';n=n||0;stringCodes(str,function(c){result+=chr(c+n);});return result;} 1318function underscore(str){var inflector=getInflector();return str.replace(/[-\s]+/g,'_').replace(inflector&&inflector.acronymRegExp,function(acronym,index){return(index>0?'_':'')+acronym.toLowerCase();}).replace(/([A-Z\d]+)([A-Z][a-z])/g,'$1_$2').replace(/([a-z\d])([A-Z])/g,'$1_$2').toLowerCase();} 1319function spacify(str){return underscore(str).replace(/_/g,' ');} 1320function capitalize(str,all){var lastResponded;return str.toLowerCase().replace(all?/[^']/g:/^\S/,function(lower){var upper=lower.toUpperCase(),result;result=lastResponded?lower:upper;lastResponded=upper!==lower;return result;});} 1321function reverseString(str){return str.split('').reverse().join('');} 1322function stringFirst(str,num){if(isUndefined(num))num=1;return str.substr(0,num);} 1323function stringLast(str,num){if(isUndefined(num))num=1;
1323var start=str.length-num<0?0:str.length-num;return str.substr(start);} 1324function stringFrom(str,from){return str.slice(numberOrIndex(str,from,true));} 1325function stringTo(str,to){if(isUndefined(to))to=str.length;return str.slice(0,numberOrIndex(str,to));} 1326function stringAssign(str,args){var obj={};flattenedArgs(args,function(a,i){if(isObjectType(a)){simpleMerge(obj,a);}else{obj[i+1]=a;}});return str.replace(/\{([^{]+?)\}/g,function(m,key){return hasOwnProperty(obj,key)?obj[key]:m;});} 1327function isBlank(str){return str.trim().length===0;} 1328function truncateOnWord(str,limit,fromLeft){if(fromLeft){return reverseString(truncateOnWord(reverseString(str),limit));} 1329var reg=regexp('(?=['+getTrimmableCharacters()+'])');var words=str.split(reg);var count=0;return words.filter(function(word){count+=word.length;return count<=limit;}).join('');} 1330function convertHTMLCodes(str){return str.replace(HTML_CODE_MATCH,function(full,hex,code){return string.fromCharCode(parseInt(code,hex?16:10));});} 1331function tagIsVoid(tag){return HTML_VOID_ELEMENTS.indexOf(tag.toLowerCase())!==-1;} 1332function replaceTags(str,args,strip){var lastIndex=args.length-1,lastArg=args[lastIndex],replacementFn,tags,reg;if(isFunction(lastArg)){replacementFn=lastArg;args.length=lastIndex;} 1333tags=flattenedArgs(args).map(function(tag){return escapeRegExp(tag);}).join('|');reg=regexp('<(\\/)?('+(tags||'[^\\s>]+')+')\\s*([^<>]*?)\\s*(\\/)?\\s*>','gi');return runTagReplacements(str,reg,strip,replacementFn);} 1334function runTagReplacements(str,reg,strip,replacementFn,fullString){var match;var result='';var currentIndex=0;var currentlyOpenTagName;var currentlyOpenTagAttributes;var currentlyOpenTagCount=0;function processTag(index,tagName,attributes,tagLength){var content=str.slice(currentIndex,index),replacement;if(replacementFn){replacement=replacementFn.call(fullString,tagName,content,attributes,fullString);if(isDefined(replacement)){content=replacement;}else if(!strip){content='';}}else if(!strip){content='';} 1335result+=runTagReplacements(content,reg,strip,replacementFn,fullString);currentIndex=index+(tagLength||0);} 1336fullString=fullString||str;reg=regexp(reg.source,'gi');while(match=reg.exec(str)){var tagName=match[2];var attributes=match[3];var isClosingTag=!!match[1];var isSelfClosing=!!match[4];var tagLength=match[0].length;var isOpeningTag=!isClosingTag&&!isSelfClosing&&!tagIsVoid(tagName);var isSameAsCurrent=tagName===currentlyOpenTagName;if(!currentlyOpenTagName){result+=str.slice(currentIndex,match.index);currentIndex=match.index;} 1337if(isOpeningTag){if(!currentlyOpenTagName){currentlyOpenTagName=tagName;currentlyOpenTagAttributes=attributes;currentlyOpenTagCount++;currentIndex+=tagLength;}else if(isSameAsCurrent){currentlyOpenTagCount++;}}else if(isClosingTag&&isSameAsCurrent){currentlyOpenTagCount--;if(currentlyOpenTagCount===0){processTag(match.index,currentlyOpenTagName,currentlyOpenTagAttributes,tagLength);currentlyOpenTagName=null;currentlyOpenTagAttributes=null;}}else if(!currentlyOpenTagName){processTag(match.index,tagName,attributes,tagLength);}} 1338if(currentlyOpenTagName){processTag(str.length,currentlyOpenTagName,currentlyOpenTagAttributes);} 1339result+=str.slice(currentIndex);return result;} 1340function numberOrIndex(str,n,from){if(isString(n)){n=str.indexOf(n);if(n===-1){n=from?str.length:0;}} 1341return n;} 1342var encodeBase64,decodeBase64;function buildBase64(key){var encodeAscii,decodeAscii;function catchEncodingError(fn){return function(str){try{return fn(str);}catch(e){return'';}}} 1343if(typeof Buffer!=='undefined'){encodeBase64=function(str){return new Buffer(str).toString('base64');} 1344decodeBase64=function(str){return new Buffer(str,'base64').toString('utf8');} 1345return;} 1346if(typeof btoa!=='undefined'){encodeAscii=catchEncodingError(btoa);decodeAscii=catchEncodingError(atob);}else{var base64reg=/[^A-Za-z0-9\+\/\=]/g;encodeAscii=function(str){var output='';var chr1,chr2,chr3;var enc1,enc2,enc3,enc4;var i=0;do{chr1=str.charCodeAt(i++);chr2=str.charCodeAt(i++);chr3=str.charCodeAt(i++);enc1=chr1>>2;enc2=((chr1&3)<<4)|(chr2>>4);enc3=((chr2&15)<<2)|(chr3>>6);enc4=chr3&63;if(isNaN(chr2)){enc3=enc4=64;}else if(isNaN(chr3)){enc4=64;} 1347output=output+key.charAt(enc1)+key.charAt(enc2)+key.charAt(enc3)+key.charAt(enc4);chr1=chr2=chr3='';enc1=enc2=enc3=enc4='';}while(i<str.length);return output;} 1348decodeAscii=function(input){var output='';var chr1,chr2,chr3;var enc1,enc2,enc3,enc4;var i=0;if(input.match(base64reg)){return'';} 1349input=input.replace(/[^A-Za-z0-9\+\/\=]/g,'');do{enc1=key.indexOf(input.charAt(i++));enc2=key.indexOf(input.charAt(i++));enc3=key.indexOf(input.charAt(i++));enc4=key.indexOf(input.charAt(i++));chr1=(enc1<<2)|(enc2>>4);chr2=((enc2&15)<<4)|(enc3>>2);chr3=((enc3&3)<<6)|enc4;output=output+chr(chr1);if(enc3!=64){output=output+chr(chr2);} 1350if(enc4!=64){output=output+chr(chr3);} 1351chr1=chr2=chr3='';enc1=enc2=enc3=enc4='';}while(i<input.length);return output;}} 1352encodeBase64=function(str){return encodeAscii(unescape(encodeURIComponent(str)));} 1353decodeBase64=function(str){return decodeURIComponent(escape(decodeAscii(str)));}} 1354function getCoercedStringSubject(obj){if(obj==null){throw new TypeError();} 1355return string(obj);} 1356function getCoercedSearchString(obj,errorOnRegex){if(errorOnRegex&&isRegExp(obj)){throw new TypeError();} 1357return string(obj);} 1358function buildStartEndsWith(){var override=true;try{''.startsWith(/./);}catch(e){override=false;} 1359extend(string,{'startsWith':function(searchString){var str,start,pos,len,searchLength,position=arguments[1];str=getCoercedStringSubject(this);searchString=getCoercedSearchString(searchString,true);pos=number(position)||0;len=str.length;start=min(max(pos,0),len);searchLength=searchString.length;if(searchLength+start>len){return false;} 1360if(str.substr(start,searchLength)===searchString){return true;} 1361return false;},'endsWith':function(searchString){var str,start,end,pos,len,searchLength,endPosition=arguments[1];str=getCoercedStringSubject(this);searchString=getCoercedSearchString(searchString,true);len=str.length;pos=len;if(isDefined(endPosition)){pos=number(endPosition)||0;} 1362end=min(max(pos,0),len);searchLength=searchString.length;start=end-searchLength;if(start<0){return false;} 1363if(str.substr(start,searchLength)===searchString){return true;} 1364return false;}},true,true,override);} 1365extend(string,{'contains':function(searchString){var str=getCoercedStringSubject(this),position=arguments[1];return str.indexOf(searchString,position)>-1;},'repeat':function(num){num=checkRepeatRange(num);return repeatString(this,num);}},true,true);extend(string,{'escapeURL':function(param){return param?encodeURIComponent(this):encodeURI(this);},'unescapeURL':function(param){return param?decodeURI(this):decodeURIComponent(this);},'escapeHTML':function(){return this.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/"/g,'"').replace(/'/g,''').replace(/\//g,'/');},'unescapeHTML':function(){return convertHTMLCodes(this).replace(/</g,'<').replace(/>/g,'>').replace(/ /g,' ').replace(/"/g,'"').replace(/'/g,"'").replace(/&/g,'&');},'encodeBase64':function(){return encodeBase64(this);},'decodeBase64':function(){return decodeBase64(this);},'each':function(search,fn){return stringEach(this,search,fn);},'map':function(map,scope){var str=this.toString();if(isFunction(map)){var fn=map;
1365map=function(letter,i,arr){return fn.call(scope,letter,i,str);}} 1366return str.split('').map(map,scope).join('');},'shift':function(n){return shiftChar(this,n);},'codes':function(fn){return stringCodes(this,fn);},'chars':function(fn){return stringEach(this,fn);},'words':function(fn){return eachWord(this,fn);},'lines':function(fn){return stringEach(this.trim(),/^.*$/gm,fn);},'paragraphs':function(fn){var paragraphs=this.trim().split(/[\r\n]{2,}/);paragraphs=paragraphs.map(function(p){if(fn)var s=fn.call(p);return s?s:p;});return paragraphs;},'isBlank':function(){return isBlank(this);},'add':function(str,index){index=isUndefined(index)?this.length:index;return this.slice(0,index)+str+this.slice(index);},'remove':function(f){return this.replace(f,'');},'reverse':function(){return reverseString(this);},'compact':function(){return this.trim().replace(/([\r\n\sã])+/g,function(match,whitespace){return whitespace==='ã'?whitespace:' ';});},'at':function(){return getEntriesForIndexes(this,arguments,true);},'from':function(from){return stringFrom(this,from);},'to':function(to){return stringTo(this,to);},'dasherize':function(){return underscore(this).replace(/_/g,'-');},'underscore':function(){return underscore(this);},'camelize':function(first){return underscore(this).replace(/(^|_)([^_]+)/g,function(match,pre,word,index){var acronym=getAcronym(word),cap=first!==false||index>0;if(acronym)return cap?acronym:acronym.toLowerCase();return cap?capitalize(word):word;});},'spacify':function(){return spacify(this);},'stripTags':function(){return replaceTags(this,arguments,true);},'removeTags':function(){return replaceTags(this,arguments,false);},'truncate':function(length,from,ellipsis){return truncateString(this,length,from,ellipsis);},'truncateOnWord':function(length,from,ellipsis){return truncateString(this,length,from,ellipsis,true);},'pad':function(num,padding){var half,front,back;num=checkRepeatRange(num);half=max(0,num-this.length)/2;front=floor(half);back=ceil(half);return padString(front,padding)+this+padString(back,padding);},'padLeft':function(num,padding){num=checkRepeatRange(num);return padString(max(0,num-this.length),padding)+this;},'padRight':function(num,padding){num=checkRepeatRange(num);return this+padString(max(0,num-this.length),padding);},'first':function(num){return stringFirst(this,num);},'last':function(num){return stringLast(this,num);},'toNumber':function(base){return stringToNumber(this,base);},'capitalize':function(all){return capitalize(this,all);},'assign':function(){return stringAssign(this,arguments);},'trimLeft':function(){return this.replace(regexp('^['+getTrimmableCharacters()+']+'),'');},'trimRight':function(){return this.replace(regexp('['+getTrimmableCharacters()+']+$'),'');}});alias(string,'insert','add');buildStartEndsWith();buildBase64('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=');})();var JSON;if(!JSON){JSON={};} 1367(function(){"use strict";function f(n){return n<10?'0'+n:n;} 1368if(typeof Date.prototype.toJSON!=='function'){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+'-'+ 1369f(this.getUTCMonth()+1)+'-'+ 1370f(this.getUTCDate())+'T'+ 1371f(this.getUTCHours())+':'+ 1372f(this.getUTCMinutes())+':'+ 1373f(this.getUTCSeconds())+'Z':null;};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf();};} 1374var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==='string'?c:'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4);})+'"':'"'+string+'"';} 1375function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==='object'&&typeof value.toJSON==='function'){value=value.toJSON(key);}
vendor: 11,484 bytes, lines 1376-1448
1376if(typeof rep==='function'){value=rep.call(holder,key,value);} 1377switch(typeof value){case'string':return quote(value);case'number':return isFinite(value)?String(value):'null';case'boolean':case'null':return String(value);case'object':if(!value){return'null';} 1378gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==='[object Array]'){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||'null';} 1379v=partial.length===0?'[]':gap?'[\n'+gap+partial.join(',\n'+gap)+'\n'+mind+']':'['+partial.join(',')+']';gap=mind;return v;} 1380if(rep&&typeof rep==='object'){length=rep.length;for(i=0;i<length;i+=1){if(typeof rep[i]==='string'){k=rep[i];v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}else{for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}} 1381v=partial.length===0?'{}':gap?'{\n'+gap+partial.join(',\n'+gap)+'\n'+mind+'}':'{'+partial.join(',')+'}';gap=mind;return v;}} 1382if(typeof JSON.stringify!=='function'){JSON.stringify=function(value,replacer,space){var i;gap='';indent='';if(typeof space==='number'){for(i=0;i<space;i+=1){indent+=' ';}}else if(typeof space==='string'){indent=space;} 1383rep=replacer;if(replacer&&typeof replacer!=='function'&&(typeof replacer!=='object'||typeof replacer.length!=='number')){throw new Error('JSON.stringify');} 1384return str('',{'':value});};} 1385if(typeof JSON.parse!=='function'){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==='object'){for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v;}else{delete value[k];}}}} 1386return reviver.call(holder,key,value);} 1387text=String(text);cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return'\\u'+ 1388('0000'+a.charCodeAt(0).toString(16)).slice(-4);});} 1389if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){j=eval('('+text+')');return typeof reviver==='function'?walk({'':j},''):j;} 1390throw new SyntaxError('JSON.parse');};}}());(function(){'use strict';var 1391JSTORAGE_VERSION='0.4.12',$=window.jQuery||window.$||(window.$={}),JSON={parse:window.JSON&&(window.JSON.parse||window.JSON.decode)||String.prototype.evalJSON&&function(str){return String(str).evalJSON();}||$.parseJSON||$.evalJSON,stringify:Object.toJSON||window.JSON&&(window.JSON.stringify||window.JSON.encode)||$.toJSON};if(typeof JSON.parse!=='function'||typeof JSON.stringify!=='function'){throw new Error('No JSON support found, include //cdnjs.cloudflare.com/ajax/libs/json2/20110223/json2.js to page');} 1392var 1393_storage={__jstorage_meta:{CRC32:{}}},_storage_service={jStorage:'{}'},_storage_elm=null,_storage_size=0,_backend=false,_observers={},_observer_timeout=false,_observer_update=0,_pubsub_observers={},_pubsub_last=+new Date(),_ttl_timeout,_XMLService={isXML:function(elm){var documentElement=(elm?elm.ownerDocument||elm:0).documentElement;return documentElement?documentElement.nodeName!=='HTML':false;},encode:function(xmlNode){if(!this.isXML(xmlNode)){return false;} 1394try{return new XMLSerializer().serializeToString(xmlNode);}catch(E1){try{return xmlNode.xml;}catch(E2){}} 1395return false;},decode:function(xmlString){var dom_parser=('DOMParser'in window&&(new DOMParser()).parseFromString)||(window.ActiveXObject&&function(_xmlString){var xml_doc=new ActiveXObject('Microsoft.XMLDOM');xml_doc.async='false';xml_doc.loadXML(_xmlString);return xml_doc;}),resultXML;if(!dom_parser){return false;} 1396resultXML=dom_parser.call('DOMParser'in window&&(new DOMParser())||window,xmlString,'text/xml');return this.isXML(resultXML)?resultXML:false;}};function _init(){var localStorageReallyWorks=false;if('localStorage'in window){try{window.localStorage.setItem('_tmptest','tmpval');localStorageReallyWorks=true;window.localStorage.removeItem('_tmptest');}catch(BogusQuotaExceededErrorOnIos5){}} 1397if(localStorageReallyWorks){try{if(window.localStorage){_storage_service=window.localStorage;_backend='localStorage';_observer_update=_storage_service.jStorage_update;}}catch(E3){}} 1398else if('globalStorage'in window){try{if(window.globalStorage){if(window.location.hostname=='localhost'){_storage_service=window.globalStorage['localhost.localdomain'];}else{_storage_service=window.globalStorage[window.location.hostname];} 1399_backend='globalStorage';_observer_update=_storage_service.jStorage_update;}}catch(E4){}} 1400else{_storage_elm=document.createElement('link');if(_storage_elm.addBehavior){_storage_elm.style.behavior='url(#default#userData)';document.getElementsByTagName('head')[0].appendChild(_storage_elm);try{_storage_elm.load('jStorage');}catch(E){_storage_elm.setAttribute('jStorage','{}');_storage_elm.save('jStorage');_storage_elm.load('jStorage');} 1401var data='{}';try{data=_storage_elm.getAttribute('jStorage');}catch(E5){} 1402try{_observer_update=_storage_elm.getAttribute('jStorage_update');}catch(E6){} 1403_storage_service.jStorage=data;_backend='userDataBehavior';}else{_storage_elm=null;return;}} 1404_load_storage();_handleTTL();_setupObserver();_handlePubSub();if('addEventListener'in window){window.addEventListener('pageshow',function(event){if(event.persisted){_storageObserver();}},false);}} 1405function _reloadData(){var data='{}';if(_backend=='userDataBehavior'){_storage_elm.load('jStorage');try{data=_storage_elm.getAttribute('jStorage');}catch(E5){} 1406try{_observer_update=_storage_elm.getAttribute('jStorage_update');}catch(E6){} 1407_storage_service.jStorage=data;} 1408_load_storage();_handleTTL();_handlePubSub();} 1409function _setupObserver(){if(_backend=='localStorage'||_backend=='globalStorage'){if('addEventListener'in window){window.addEventListener('storage',_storageObserver,false);}else{document.attachEvent('onstorage',_storageObserver);}}else if(_backend=='userDataBehavior'){setInterval(_storageObserver,1000);}} 1410function _storageObserver(){var updateTime;clearTimeout(_observer_timeout);_observer_timeout=setTimeout(function(){if(_backend=='localStorage'||_backend=='globalStorage'){updateTime=_storage_service.jStorage_update;}else if(_backend=='userDataBehavior'){_storage_elm.load('jStorage');try{updateTime=_storage_elm.getAttribute('jStorage_update');}catch(E5){}} 1411if(updateTime&&updateTime!=_observer_update){_observer_update=updateTime;_checkUpdatedKeys();}},25);} 1412function _checkUpdatedKeys(){var oldCrc32List=JSON.parse(JSON.stringify(_storage.__jstorage_meta.CRC32)),newCrc32List;_reloadData();newCrc32List=JSON.parse(JSON.stringify(_storage.__jstorage_meta.CRC32));var key,updated=[],removed=[];for(key in oldCrc32List){if(oldCrc32List.hasOwnProperty(key)){if(!newCrc32List[key]){removed.push(key);continue;} 1413if(oldCrc32List[key]!=newCrc32List[key]&&String(oldCrc32List[key]).substr(0,2)=='2.'){updated.push(key);}}} 1414for(key in newCrc32List){if(newCrc32List.hasOwnProperty(key)){if(!oldCrc32List[key]){updated.push(key);}}} 1415_fireObservers(updated,'updated');_fireObservers(removed,'deleted');} 1416function _fireObservers(keys,action){keys=[].concat(keys||[]);var i,j,len,jlen;if(action=='flushed'){keys=[];for(var key in _observers){if(_observers.hasOwnProperty(key)){keys.push(key);}} 1417action='deleted';} 1418for(i=0,len=keys.length;i<len;i++){if(_observers[keys[i]]){for(j=0,jlen=_observers[keys[i]].length;j<jlen;j++){_observers[keys[i]][j](keys[i],action);}} 1419if(_observers['*']){for(j=0,jlen=_observers['*'].length;j<jlen;j++){_observers['*'][j](keys[i],action);}}}} 1420function _publishChange(){var updateTime=(+new Date()).toString();if(_backend=='localStorage'||_backend=='globalStorage'){try{_storage_service.jStorage_update=updateTime;}catch(E8){_backend=false;}}else if(_backend=='userDataBehavior'){_storage_elm.setAttribute('jStorage_update',updateTime);_storage_elm.save('jStorage');} 1421_storageObserver();} 1422function _load_storage(){if(_storage_service.jStorage){try{_storage=JSON.parse(String(_storage_service.jStorage));}catch(E6){_storage_service.jStorage='{}';}}else{_storage_service.jStorage='{}';} 1423_storage_size=_storage_service.jStorage?String(_storage_service.jStorage).length:0;if(!_storage.__jstorage_meta){_storage.__jstorage_meta={};} 1424if(!_storage.__jstorage_meta.CRC32){_storage.__jstorage_meta.CRC32={};}} 1425function _save(){_dropOldEvents();try{_storage_service.jStorage=JSON.stringify(_storage);if(_storage_elm){_storage_elm.setAttribute('jStorage',_storage_service.jStorage);_storage_elm.save('jStorage');} 1426_storage_size=_storage_service.jStorage?String(_storage_service.jStorage).length:0;}catch(E7){}} 1427function _checkKey(key){if(typeof key!='string'&&typeof key!='number'){throw new TypeError('Key name must be string or numeric');} 1428if(key=='__jstorage_meta'){throw new TypeError('Reserved key name');} 1429return true;} 1430function _handleTTL(){var curtime,i,TTL,CRC32,nextExpire=Infinity,changed=false,deleted=[];clearTimeout(_ttl_timeout);if(!_storage.__jstorage_meta||typeof _storage.__jstorage_meta.TTL!='object'){return;} 1431curtime=+new Date();TTL=_storage.__jstorage_meta.TTL;CRC32=_storage.__jstorage_meta.CRC32;for(i in TTL){if(TTL.hasOwnProperty(i)){if(TTL[i]<=curtime){delete TTL[i];delete CRC32[i];delete _storage[i];changed=true;deleted.push(i);}else if(TTL[i]<nextExpire){nextExpire=TTL[i];}}} 1432if(nextExpire!=Infinity){_ttl_timeout=setTimeout(_handleTTL,Math.min(nextExpire-curtime,0x7FFFFFFF));} 1433if(changed){_save();_publishChange();_fireObservers(deleted,'deleted');}} 1434function _handlePubSub(){var i,len;if(!_storage.__jstorage_meta.PubSub){return;} 1435var pubelm,_pubsubCurrent=_pubsub_last,needFired=[];for(i=len=_storage.__jstorage_meta.PubSub.length-1;i>=0;i--){pubelm=_storage.__jstorage_meta.PubSub[i];if(pubelm[0]>_pubsub_last){_pubsubCurrent=pubelm[0];needFired.unshift(pubelm);}} 1436for(i=needFired.length-1;i>=0;i--){_fireSubscribers(needFired[i][1],needFired[i][2]);} 1437_pubsub_last=_pubsubCurrent;} 1438function _fireSubscribers(channel,payload){if(_pubsub_observers[channel]){for(var i=0,len=_pubsub_observers[channel].length;i<len;i++){try{_pubsub_observers[channel][i](channel,JSON.parse(JSON.stringify(payload)));}catch(E){}}}} 1439function _dropOldEvents(){if(!_storage.__jstorage_meta.PubSub){return;} 1440var retire=+new Date()-2000;for(var i=0,len=_storage.__jstorage_meta.PubSub.length;i<len;i++){if(_storage.__jstorage_meta.PubSub[i][0]<=retire){_storage.__jstorage_meta.PubSub.splice(i,_storage.__jstorage_meta.PubSub.length-i);break;}} 1441if(!_storage.__jstorage_meta.PubSub.length){delete _storage.__jstorage_meta.PubSub;}} 1442function _publish(channel,payload){if(!_storage.__jstorage_meta){_storage.__jstorage_meta={};} 1443if(!_storage.__jstorage_meta.PubSub){_storage.__jstorage_meta.PubSub=[];} 1444_storage.__jstorage_meta.PubSub.unshift([+new Date(),channel,payload]);_save();_publishChange();} 1445function murmurhash2_32_gc(str,seed){var 1446l=str.length,h=seed^l,i=0,k;while(l>=4){k=((str.charCodeAt(i)&0xff))|((str.charCodeAt(++i)&0xff)<<8)|((str.charCodeAt(++i)&0xff)<<16)|((str.charCodeAt(++i)&0xff)<<24);k=(((k&0xffff)*0x5bd1e995)+((((k>>>16)*0x5bd1e995)&0xffff)<<16));k^=k>>>24;k=(((k&0xffff)*0x5bd1e995)+((((k>>>16)*0x5bd1e995)&0xffff)<<16));h=(((h&0xffff)*0x5bd1e995)+((((h>>>16)*0x5bd1e995)&0xffff)<<16))^k;l-=4;++i;} 1447switch(l){case 3:h^=(str.charCodeAt(i+2)&0xff)<<16;case 2:h^=(str.charCodeAt(i+1)&0xff)<<8;case 1:h^=(str.charCodeAt(i)&0xff);h=(((h&0xffff)*0x5bd1e995)+((((h>>>16)*0x5bd1e995)&0xffff)<<16));} 1448h^=h>>>13;h=(((h&0xffff)*0x5bd1e995)+((((h>>>16)*0x5bd1e995)&0xffff)<<16));h^=h>>>15;return h>>>0;}
1449$.jStorage={version:JSTORAGE_VERSION,set:function(key,value,options){_checkKey(key);options=options||{};if(typeof value=='undefined'){this.deleteKey(key);return value;} 1450if(_XMLService.isXML(value)){value={_is_xml:true,xml:_XMLService.encode(value)};}else if(typeof value=='function'){return undefined;}else if(value&&typeof value=='object'){value=JSON.parse(JSON.stringify(value));} 1451_storage[key]=value;_storage.__jstorage_meta.CRC32[key]='2.'+murmurhash2_32_gc(JSON.stringify(value),0x9747b28c);this.setTTL(key,options.TTL||0);_fireObservers(key,'updated');return value;},get:function(key,def){_checkKey(key);if(key in _storage){if(_storage[key]&&typeof _storage[key]=='object'&&_storage[key]._is_xml){return _XMLService.decode(_storage[key].xml);}else{return _storage[key];}} 1452return typeof(def)=='undefined'?null:def;},deleteKey:function(key){_checkKey(key);if(key in _storage){delete _storage[key];if(typeof _storage.__jstorage_meta.TTL=='object'&&key in _storage.__jstorage_meta.TTL){delete _storage.__jstorage_meta.TTL[key];} 1453delete _storage.__jstorage_meta.CRC32[key];_save();_publishChange();_fireObservers(key,'deleted');return true;} 1454return false;},setTTL:function(key,ttl){var curtime=+new Date();_checkKey(key);ttl=Number(ttl)||0;if(key in _storage){if(!_storage.__jstorage_meta.TTL){_storage.__jstorage_meta.TTL={};} 1455if(ttl>0){_storage.__jstorage_meta.TTL[key]=curtime+ttl;}else{delete _storage.__jstorage_meta.TTL[key];} 1456_save();_handleTTL();_publishChange();return true;} 1457return false;},getTTL:function(key){var curtime=+new Date(),ttl;_checkKey(key);if(key in _storage&&_storage.__jstorage_meta.TTL&&_storage.__jstorage_meta.TTL[key]){ttl=_storage.__jstorage_meta.TTL[key]-curtime;return ttl||0;} 1458return 0;},flush:function(){_storage={__jstorage_meta:{CRC32:{}}};_save();_publishChange();_fireObservers(null,'flushed');return true;},storageObj:function(){function F(){} 1459F.prototype=_storage;return new F();},index:function(){var index=[],i;for(i in _storage){if(_storage.hasOwnProperty(i)&&i!='__jstorage_meta'){index.push(i);}} 1460return index;},storageSize:function(){return _storage_size;},currentBackend:function(){return _backend;},storageAvailable:function(){return!!_backend;},listenKeyChange:function(key,callback){_checkKey(key);if(!_observers[key]){_observers[key]=[];} 1461_observers[key].push(callback);},stopListening:function(key,callback){_checkKey(key);if(!_observers[key]){return;} 1462if(!callback){delete _observers[key];return;} 1463for(var i=_observers[key].length-1;i>=0;i--){if(_observers[key][i]==callback){_observers[key].splice(i,1);}}},subscribe:function(channel,callback){channel=(channel||'').toString();if(!channel){throw new TypeError('Channel not defined');} 1464if(!_pubsub_observers[channel]){_pubsub_observers[channel]=[];} 1465_pubsub_observers[channel].push(callback);},publish:function(channel,payload){channel=(channel||'').toString();if(!channel){throw new TypeError('Channel not defined');} 1466_publish(channel,payload);},reInit:function(){_reloadData();},noConflict:function(saveInGlobal){delete window.$.jStorage;if(saveInGlobal){window.jStorage=this;} 1467return this;}};_init();})();(function(jQuery,window,undefined){jQuery.uaMatch=function(ua){ua=ua.toLowerCase();var match=/(chrome)[ \/]([\w.]+)/.exec(ua)||/(webkit)[ \/]([\w.]+)/.exec(ua)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua)||/(msie) ([\w.]+)/.exec(ua)||ua.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua)||[];return{browser:match[1]||"",version:match[2]||"0"};};matched=jQuery.uaMatch(navigator.userAgent);browser={};if(matched.browser){browser[matched.browser]=true;browser.version=matched.version;} 1468if(browser.chrome){browser.webkit=true;}else if(browser.webkit){browser.safari=true;} 1469jQuery.browser=browser;})(jQuery,window);(function($,window){'$:nomunge';var undefined,aps=Array.prototype.slice,decode=decodeURIComponent,jq_param=$.param,jq_param_sorted,jq_param_fragment,jq_deparam,jq_deparam_fragment,jq_bbq=$.bbq=$.bbq||{},jq_bbq_pushState,jq_bbq_getState,jq_elemUrlAttr,special=$.event.special,str_hashchange='hashchange',str_querystring='querystring',str_fragment='fragment',str_elemUrlAttr='elemUrlAttr',str_href='href',str_src='src',re_params_querystring=/^.*\?|#.*$/g,re_params_fragment,re_fragment,re_no_escape,ajax_crawlable,fragment_prefix,elemUrlAttr_cache={};function is_string(arg){return typeof arg==='string';};
1469function curry(func){var args=aps.call(arguments,1);return function(){return func.apply(this,args.concat(aps.call(arguments)));};};function get_fragment(url){return url.replace(re_fragment,'$2');};function get_querystring(url){return url.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,'$1');};function jq_param_sub(is_fragment,get_func,url,params,merge_mode){var result,qs,matches,url_params,hash;if(params!==undefined){matches=url.match(is_fragment?re_fragment:/^([^#?]*)\??([^#]*)(#?.*)/);hash=matches[3]||'';if(merge_mode===2&&is_string(params)){qs=params.replace(is_fragment?re_params_fragment:re_params_querystring,'');}else{url_params=jq_deparam(matches[2]);params=is_string(params)?jq_deparam[is_fragment?str_fragment:str_querystring](params):params;qs=merge_mode===2?params:merge_mode===1?$.extend({},params,url_params):$.extend({},url_params,params);qs=jq_param_sorted(qs);if(is_fragment){qs=qs.replace(re_no_escape,decode);}} 1470result=matches[1]+(is_fragment?fragment_prefix:qs||!matches[1]?'?':'')+qs+hash;}else{result=get_func(url!==undefined?url:location.href);} 1471return result;};jq_param[str_querystring]=curry(jq_param_sub,0,get_querystring);jq_param[str_fragment]=jq_param_fragment=curry(jq_param_sub,1,get_fragment);jq_param.sorted=jq_param_sorted=function(a,traditional){var arr=[],obj={};$.each(jq_param(a,traditional).split('&'),function(i,v){var key=v.replace(/(?:%5B|=).*$/,''),key_obj=obj[key];if(!key_obj){key_obj=obj[key]=[];arr.push(key);} 1472key_obj.push(v);});return $.map(arr.sort(),function(v){return obj[v];}).join('&');};jq_param_fragment.noEscape=function(chars){chars=chars||'';var arr=$.map(chars.split(''),encodeURIComponent);re_no_escape=new RegExp(arr.join('|'),'g');};jq_param_fragment.noEscape(',/');jq_param_fragment.ajaxCrawlable=function(state){if(state!==undefined){if(state){re_params_fragment=/^.*(?:#!|#)/;re_fragment=/^([^#]*)(?:#!|#)?(.*)$/;fragment_prefix='#!';}else{re_params_fragment=/^.*#/;re_fragment=/^([^#]*)#?(.*)$/;fragment_prefix='#';} 1473ajax_crawlable=!!state;} 1474return ajax_crawlable;};jq_param_fragment.ajaxCrawlable(0);$.deparam=jq_deparam=function(params,coerce){var obj={},coerce_types={'true':!0,'false':!1,'null':null};$.each(params.replace(/\+/g,' ').split('&'),function(j,v){var param=v.split('='),key=decode(param[0]),val,cur=obj,i=0,keys=key.split(']['),keys_last=keys.length-1;if(/\[/.test(keys[0])&&/\]$/.test(keys[keys_last])){keys[keys_last]=keys[keys_last].replace(/\]$/,'');keys=keys.shift().split('[').concat(keys);keys_last=keys.length-1;}else{keys_last=0;} 1475if(param.length===2){val=decode(param[1]);if(coerce){val=val&&!isNaN(val)?+val:val==='undefined'?undefined:coerce_types[val]!==undefined?coerce_types[val]:val;} 1476if(keys_last){for(;i<=keys_last;i++){key=keys[i]===''?cur.length:keys[i];cur=cur[key]=i<keys_last?cur[key]||(keys[i+1]&&isNaN(keys[i+1])?{}:[]):val;}}else{if($.isArray(obj[key])){obj[key].push(val);}else if(obj[key]!==undefined){obj[key]=[obj[key],val];}else{obj[key]=val;}}}else if(key){obj[key]=coerce?undefined:'';}});return obj;};function jq_deparam_sub(is_fragment,url_or_params,coerce){if(url_or_params===undefined||typeof url_or_params==='boolean'){coerce=url_or_params;url_or_params=jq_param[is_fragment?str_fragment:str_querystring]();}else{url_or_params=is_string(url_or_params)?url_or_params.replace(is_fragment?re_params_fragment:re_params_querystring,''):url_or_params;} 1477return jq_deparam(url_or_params,coerce);};jq_deparam[str_querystring]=curry(jq_deparam_sub,0);jq_deparam[str_fragment]=jq_deparam_fragment=curry(jq_deparam_sub,1);$[str_elemUrlAttr]||($[str_elemUrlAttr]=function(obj){return $.extend(elemUrlAttr_cache,obj);}
1477)({a:str_href,base:str_href,iframe:str_src,img:str_src,input:str_src,form:'action',link:str_href,script:str_src});jq_elemUrlAttr=$[str_elemUrlAttr];function jq_fn_sub(mode,force_attr,params,merge_mode){if(!is_string(params)&&typeof params!=='object'){merge_mode=params;params=force_attr;force_attr=undefined;} 1478return this.each(function(){var that=$(this),attr=force_attr||jq_elemUrlAttr()[(this.nodeName||'').toLowerCase()]||'',url=attr&&that.attr(attr)||'';that.attr(attr,jq_param[mode](url,params,merge_mode));});};$.fn[str_querystring]=curry(jq_fn_sub,str_querystring);$.fn[str_fragment]=curry(jq_fn_sub,str_fragment);jq_bbq.pushState=jq_bbq_pushState=function(params,merge_mode){if(is_string(params)&&/^#/.test(params)&&merge_mode===undefined){merge_mode=2;} 1479var has_args=params!==undefined,url=jq_param_fragment(location.href,has_args?params:{},has_args?merge_mode:2);location.href=url;};jq_bbq.getState=jq_bbq_getState=function(key,coerce){return key===undefined||typeof key==='boolean'?jq_deparam_fragment(key):jq_deparam_fragment(coerce)[key];};jq_bbq.removeState=function(arr){var state={};if(arr!==undefined){state=jq_bbq_getState();$.each($.isArray(arr)?arr:arguments,function(i,v){delete state[v];});} 1480jq_bbq_pushState(state,2);};special[str_hashchange]=$.extend(special[str_hashchange],{add:function(handleObj){var old_handler;function new_handler(e){var hash=e[str_fragment]=jq_param_fragment();e.getState=function(key,coerce){return key===undefined||typeof key==='boolean'?jq_deparam(hash,key):jq_deparam(hash,coerce)[key];};old_handler.apply(this,arguments);};if($.isFunction(handleObj)){old_handler=handleObj;return new_handler;}else{old_handler=handleObj.handler;handleObj.handler=new_handler;}}});})(jQuery,this);(function($,window,undefined){'$:nomunge';var str_hashchange='hashchange',doc=document,fake_onhashchange,special=$.event.special,doc_mode=doc.documentMode,supports_onhashchange='on'+str_hashchange in window&&(doc_mode===undefined||doc_mode>7);function get_fragment(url){url=url||location.href;return'#'+url.replace(/^[^#]*#?(.*)$/,'$1');};$.fn[str_hashchange]=function(fn){return fn?this.bind(str_hashchange,fn):this.trigger(str_hashchange);};$.fn[str_hashchange].delay=50;special[str_hashchange]=$.extend(special[str_hashchange],{setup:function(){if(supports_onhashchange){return false;} 1481$(fake_onhashchange.start);},teardown:function(){if(supports_onhashchange){return false;} 1482$(fake_onhashchange.stop);}});fake_onhashchange=(function(){var self={},timeout_id,last_hash=get_fragment(),fn_retval=function(val){return val;},history_set=fn_retval,history_get=fn_retval;self.start=function(){timeout_id||poll();};self.stop=function(){timeout_id&&clearTimeout(timeout_id);timeout_id=undefined;};function poll(){var hash=get_fragment(),history_hash=history_get(last_hash);if(hash!==last_hash){history_set(last_hash=hash,history_hash);$(window).trigger(str_hashchange);}else if(history_hash!==last_hash){location.href=location.href.replace(/#.*/,'')+history_hash;} 1483timeout_id=setTimeout(poll,$.fn[str_hashchange].delay);};$.browser.msie&&!supports_onhashchange&&(function(){var iframe,iframe_src;self.start=function(){if(!iframe){iframe_src=$.fn[str_hashchange].src;iframe_src=iframe_src&&iframe_src+get_fragment();iframe=$('<iframe tabindex="-1" title="empty"/>').hide().one('load',function(){iframe_src||history_set(get_fragment());poll();}).attr('src',iframe_src||'javascript:0').insertAfter('body')[0].contentWindow;doc.onpropertychange=function(){try{if(event.propertyName==='title'){iframe.document.title=doc.title;}}catch(e){}};}};self.stop=fn_retval;history_get=function(){return get_fragment(iframe.location.href);};history_set=function(hash,history_hash){var iframe_doc=iframe.document,domain=$.fn[str_hashchange].domain;if(hash!==history_hash){iframe_doc.title=doc.title;iframe_doc.open();domain&&iframe_doc.write('<script>document.domain="'+domain+'"</script>');iframe_doc.close();iframe.location.hash=hash;}};})();return self;})();})(jQuery,this);(function(factory){if(typeof define=='function'&&define.amd) 1484define('picker',['jquery'],factory) 1485else if(typeof exports=='object') 1486module.exports=factory(require('jquery')) 1487else this.Picker=factory(jQuery)}(function($){var $window=$(window) 1488var $document=$(document) 1489var $html=$(document.documentElement) 1490var supportsTransitions=document.documentElement.style.transition!=null 1491function PickerConstructor(ELEMENT,NAME,COMPONENT,OPTIONS){if(!ELEMENT)return PickerConstructor 1492var 1493IS_DEFAULT_THEME=false,STATE={id:ELEMENT.id||'P'+Math.abs(~~(Math.random()*new Date()))},SETTINGS=COMPONENT?$.extend(true,{},COMPONENT.defaults,OPTIONS):OPTIONS||{},CLASSES=$.extend({},PickerConstructor.klasses(),SETTINGS.klass),$ELEMENT=$(ELEMENT),PickerInstance=function(){return this.start()},P=PickerInstance.prototype={constructor:PickerInstance,$node:$ELEMENT,start:function(){if(STATE&&STATE.start)return P 1494STATE.methods={} 1495STATE.start=true 1496STATE.open=false 1497STATE.type=ELEMENT.type 1498ELEMENT.autofocus=ELEMENT==getActiveElement() 1499ELEMENT.readOnly=!SETTINGS.editable 1500ELEMENT.id=ELEMENT.id||STATE.id 1501if(ELEMENT.type!='text'){ELEMENT.type='text'} 1502P.component=new COMPONENT(P,SETTINGS) 1503P.$root=$('<div class="'+CLASSES.picker+'" id="'+ELEMENT.id+'_root" />') 1504prepareElementRoot() 1505P.$holder=$(createWrappedComponent()).appendTo(P.$root) 1506prepareElementHolder() 1507if(SETTINGS.formatSubmit){prepareElementHidden()} 1508prepareElement() 1509if(SETTINGS.containerHidden)$(SETTINGS.containerHidden).append(P._hidden) 1510else $ELEMENT.after(P._hidden) 1511if(SETTINGS.container)$(SETTINGS.container).append(P.$root) 1512else $ELEMENT.after(P.$root) 1513P.on({start:P.component.onStart,render:P.component.onRender,stop:P.component.onStop,open:P.component.onOpen,close:P.component.onClose,set:P.component.onSet}).on({start:SETTINGS.onStart,render:SETTINGS.onRender,stop:SETTINGS.onStop,open:SETTINGS.onOpen,close:SETTINGS.onClose,set:SETTINGS.onSet}) 1514IS_DEFAULT_THEME=isUsingDefaultTheme(P.$holder[0]) 1515if(ELEMENT.autofocus){P.open()} 1516return P.trigger('start').trigger('render')},render:function(entireComponent){if(entireComponent){P.$holder=$(createWrappedComponent()) 1517prepareElementHolder() 1518P.$root.html(P.$holder)} 1519else P.$root.find('.'+CLASSES.box).html(P.component.nodes(STATE.open)) 1520return P.trigger('render')},stop:function(){if(!STATE.start)return P 1521P.close() 1522if(P._hidden){P._hidden.parentNode.removeChild(P._hidden)} 1523P.$root.remove() 1524$ELEMENT.removeClass(CLASSES.input).removeData(NAME) 1525setTimeout(function(){$ELEMENT.off('.'+STATE.id)},0) 1526ELEMENT.type=STATE.type 1527ELEMENT.readOnly=false 1528P.trigger('stop') 1529STATE.methods={} 1530STATE.start=false 1531return P},open:function(dontGiveFocus){if(STATE.open)return P 1532$ELEMENT.addClass(CLASSES.active) 1533aria(ELEMENT,'expanded',true) 1534setTimeout(function(){P.$root.addClass(CLASSES.opened) 1535aria(P.$root[0],'hidden',false)},0) 1536if(dontGiveFocus!==false){STATE.open=true 1537if(IS_DEFAULT_THEME){$html.css('overflow','hidden').css('padding-right','+='+getScrollbarWidth())} 1538focusPickerOnceOpened() 1539$document.on('click.'+STATE.id+' focusin.'+STATE.id,function(event){var target=event.target 1540if(target!=ELEMENT&&target!=document&&event.which!=3){P.close(target===P.$holder[0])}}).on('keydown.'+STATE.id,function(event){var 1541keycode=event.keyCode,keycodeToMove=P.component.key[keycode],target=event.target 1542if(keycode==27){P.close(true)} 1543else if(target==P.$holder[0]&&(keycodeToMove||keycode==13)){event.preventDefault() 1544if(keycodeToMove){PickerConstructor._.trigger(P.component.key.go,P,[PickerConstructor._.trigger(keycodeToMove)])} 1545else if(!P.$root.find('.'+CLASSES.highlighted).hasClass(CLASSES.disabled)){P.set('select',P.component.item.highlight) 1546if(SETTINGS.closeOnSelect){P.close(true)}}} 1547else if($.contains(P.$root[0],target)&&keycode==13){event.preventDefault() 1548target.click()}})} 1549return P.trigger('open')},close:function(giveFocus){if(giveFocus){if(SETTINGS.editable){ELEMENT.focus()} 1550else{P.$holder.off('focus.toOpen').focus() 1551setTimeout(function(){P.$holder.on('focus.toOpen',handleFocusToOpenEvent)},0)}} 1552$ELEMENT.removeClass(CLASSES.active) 1553aria(ELEMENT,'expanded',false) 1554setTimeout(function(){P.$root.removeClass(CLASSES.opened+' '+CLASSES.focused) 1555aria(P.$root[0],'hidden',true)},0) 1556if(!STATE.open)return P 1557STATE.open=false 1558if(IS_DEFAULT_THEME){$html.css('overflow','').css('padding-right','-='+getScrollbarWidth())} 1559$document.off('.'+STATE.id) 1560return P.trigger('close')},clear:function(options){return P.set('clear',null,options)},set:function(thing,value,options){var thingItem,thingValue,thingIsObject=$.isPlainObject(thing),thingObject=thingIsObject?thing:{} 1561options=thingIsObject&&$.isPlainObject(value)?value:options||{} 1562if(thing){if(!thingIsObject){thingObject[thing]=value} 1563for(thingItem in thingObject){thingValue=thingObject[thingItem] 1564if(thingItem in P.component.item){if(thingValue===undefined)thingValue=null 1565P.component.set(thingItem,thingValue,options)} 1566if(thingItem=='select'||thingItem=='clear'){$ELEMENT.val(thingItem=='clear'?'':P.get(thingItem,SETTINGS.format)).trigger('change')}} 1567P.render()} 1568return options.muted?P:P.trigger('set',thingObject)},get:function(thing,format){thing=thing||'value' 1569if(STATE[thing]!=null){return STATE[thing]} 1570if(thing=='valueSubmit'){if(P._hidden){return P._hidden.value} 1571thing='value'} 1572if(thing=='value'){return ELEMENT.value} 1573if(thing in P.component.item){if(typeof format=='string'){var thingValue=P.component.get(thing) 1574return thingValue?PickerConstructor._.trigger(P.component.formats.toString,P.component,[format,thingValue]):''} 1575return P.component.get(thing)}},on:function(thing,method,internal){var thingName,thingMethod,thingIsObject=$.isPlainObject(thing),thingObject=thingIsObject?thing:{} 1576if(thing){if(!thingIsObject){thingObject[thing]=method} 1577for(thingName in thingObject){thingMethod=thingObject[thingName] 1578if(internal){thingName='_'+thingName} 1579STATE.methods[thingName]=STATE.methods[thingName]||[] 1580STATE.methods[thingName].push(thingMethod)}} 1581return P},off:function(){var i,thingName,names=arguments;for(i=0,namesCount=names.length;i<namesCount;i+=1){thingName=names[i] 1582if(thingName in STATE.methods){delete STATE.methods[thingName]}} 1583return P},trigger:function(name,data){var _trigger=function(name){var methodList=STATE.methods[name] 1584if(methodList){methodList.map(function(method){PickerConstructor._.trigger(method,P,[data])})}} 1585_trigger('_'+name) 1586_trigger(name) 1587return P}} 1588function createWrappedComponent(){return PickerConstructor._.node('div',PickerConstructor._.node('div',PickerConstructor._.node('div',PickerConstructor._.node('div',P.component.nodes(STATE.open),CLASSES.box),CLASSES.wrap),CLASSES.frame),CLASSES.holder,'tabindex="-1"')}
1589function prepareElement(){$ELEMENT.data(NAME,P).addClass(CLASSES.input).val($ELEMENT.data('value')?P.get('select',SETTINGS.format):ELEMENT.value) 1590if(!SETTINGS.editable){$ELEMENT.on('focus.'+STATE.id+' click.'+STATE.id,function(event){event.preventDefault() 1591P.open()}).on('keydown.'+STATE.id,handleKeydownEvent)} 1592aria(ELEMENT,{haspopup:true,expanded:false,readonly:false,owns:ELEMENT.id+'_root'})} 1593function prepareElementRoot(){aria(P.$root[0],'hidden',true)} 1594function prepareElementHolder(){P.$holder.on({keydown:handleKeydownEvent,'focus.toOpen':handleFocusToOpenEvent,blur:function(){$ELEMENT.removeClass(CLASSES.target)},focusin:function(event){P.$root.removeClass(CLASSES.focused) 1595event.stopPropagation()},'mousedown click':function(event){var target=event.target 1596if(target!=P.$holder[0]){event.stopPropagation() 1597if(event.type=='mousedown'&&!$(target).is('input, select, textarea, button, option')){event.preventDefault() 1598P.$holder[0].focus()}}}}).on('click','[data-pick], [data-nav], [data-clear], [data-close]',function(){var $target=$(this),targetData=$target.data(),targetDisabled=$target.hasClass(CLASSES.navDisabled)||$target.hasClass(CLASSES.disabled),activeElement=getActiveElement() 1599activeElement=activeElement&&(activeElement.type||activeElement.href) 1600if(targetDisabled||activeElement&&!$.contains(P.$root[0],activeElement)){P.$holder[0].focus()} 1601if(!targetDisabled&&targetData.nav){P.set('highlight',P.component.item.highlight,{nav:targetData.nav})} 1602else if(!targetDisabled&&'pick'in targetData){P.set('select',targetData.pick) 1603if(SETTINGS.closeOnSelect){P.close(true)}} 1604else if(targetData.clear){P.clear() 1605if(SETTINGS.closeOnClear){P.close(true)}} 1606else if(targetData.close){P.close(true)}})} 1607function prepareElementHidden(){var name 1608if(SETTINGS.hiddenName===true){name=ELEMENT.name 1609ELEMENT.name=''} 1610else{name=[typeof SETTINGS.hiddenPrefix=='string'?SETTINGS.hiddenPrefix:'',typeof SETTINGS.hiddenSuffix=='string'?SETTINGS.hiddenSuffix:'_submit'] 1611name=name[0]+ELEMENT.name+name[1]} 1612P._hidden=$('<input '+'type=hidden '+'name="'+name+'"'+ 1613($ELEMENT.data('value')||ELEMENT.value?' value="'+P.get('select',SETTINGS.formatSubmit)+'"':'')+'>')[0] 1614$ELEMENT.on('change.'+STATE.id,function(){P._hidden.value=ELEMENT.value?P.get('select',SETTINGS.formatSubmit):''})} 1615function focusPickerOnceOpened(){if(IS_DEFAULT_THEME&&supportsTransitions){P.$holder.find('.'+CLASSES.frame).one('transitionend',function(){P.$holder[0].focus()})} 1616else{P.$holder[0].focus()}} 1617function handleFocusToOpenEvent(event){event.stopPropagation() 1618$ELEMENT.addClass(CLASSES.target) 1619P.$root.addClass(CLASSES.focused) 1620P.open()} 1621function handleKeydownEvent(event){var keycode=event.keyCode,isKeycodeDelete=/^(8|46)$/.test(keycode) 1622if(keycode==27){P.close(true) 1623return false} 1624if(keycode==32||isKeycodeDelete||!STATE.open&&P.component.key[keycode]){event.preventDefault() 1625event.stopPropagation() 1626if(isKeycodeDelete){P.clear().close()} 1627else{P.open()}}} 1628return new PickerInstance()} 1629PickerConstructor.klasses=function(prefix){prefix=prefix||'picker' 1630return{picker:prefix,opened:prefix+'--opened',focused:prefix+'--focused',input:prefix+'__input',active:prefix+'__input--active',target:prefix+'__input--target',holder:prefix+'__holder',frame:prefix+'__frame',wrap:prefix+'__wrap',box:prefix+'__box'}} 1631function isUsingDefaultTheme(element){var theme,prop='position' 1632if(element.currentStyle){theme=element.currentStyle[prop]} 1633else if(window.getComputedStyle){theme=getComputedStyle(element)[prop]} 1634return theme=='fixed'} 1635function getScrollbarWidth(){if($html.height()<=$window.height()){return 0} 1636var $outer=$('<div style="visibility:hidden;width:100px" />').appendTo('body') 1637var widthWithoutScroll=$outer[0].offsetWidth 1638$outer.css('overflow','scroll') 1639var $inner=$('<div style="width:100%" />').appendTo($outer) 1640var widthWithScroll=$inner[0].offsetWidth 1641$outer.remove() 1642return widthWithoutScroll-widthWithScroll} 1643PickerConstructor._={group:function(groupObject){var 1644loopObjectScope,nodesList='',counter=PickerConstructor._.trigger(groupObject.min,groupObject) 1645for(;counter<=PickerConstructor._.trigger(groupObject.max,groupObject,[counter]);counter+=groupObject.i){loopObjectScope=PickerConstructor._.trigger(groupObject.item,groupObject,[counter]) 1646nodesList+=PickerConstructor._.node(groupObject.node,loopObjectScope[0],loopObjectScope[1],loopObjectScope[2])} 1647return nodesList},node:function(wrapper,item,klass,attribute){if(!item)return'' 1648item=$.isArray(item)?item.join(''):item 1649klass=klass?' class="'+klass+'"':'' 1650attribute=attribute?' '+attribute:'' 1651return'<'+wrapper+klass+attribute+'>'+item+'</'+wrapper+'>'},lead:function(number){return(number<10?'0':'')+number},trigger:function(callback,scope,args){return typeof callback=='function'?callback.apply(scope,args||[]):callback},digits:function(string){return(/\d/).test(string[1])?2:1},isDate:function(value){return{}.toString.call(value).indexOf('Date')>-1&&this.isInteger(value.getDate())},isInteger:function(value){return{}.toString.call(value).indexOf('Number')>-1&&value%1===0},ariaAttr:ariaAttr} 1652PickerConstructor.extend=function(name,Component){$.fn[name]=function(options,action){var componentData=this.data(name) 1653if(options=='picker'){return componentData} 1654if(componentData&&typeof options=='string'){return PickerConstructor._.trigger(componentData[options],componentData,[action])} 1655return this.each(function(){var $this=$(this) 1656if(!$this.data(name)){new PickerConstructor(this,name,Component,options)}})} 1657$.fn[name].defaults=Component.defaults} 1658function aria(element,attribute,value){if($.isPlainObject(attribute)){for(var key in attribute){ariaSet(element,key,attribute[key])}} 1659else{ariaSet(element,attribute,value)}} 1660function ariaSet(element,attribute,value){element.setAttribute((attribute=='role'?'':'aria-')+attribute,value)} 1661function ariaAttr(attribute,data){if(!$.isPlainObject(attribute)){attribute={attribute:data}} 1662data='' 1663for(var key in attribute){var attr=(key=='role'?'':'aria-')+key,attrVal=attribute[key] 1664data+=attrVal==null?'':attr+'="'+attribute[key]+'"'} 1665return data} 1666function getActiveElement(){try{return document.activeElement}catch(err){}} 1667return PickerConstructor}));(function(factory){if(typeof define=='function'&&define.amd) 1668define(['./picker','jquery'],factory) 1669else if(typeof exports=='object') 1670module.exports=factory(require('./picker.js'),require('jquery')) 1671else factory(Picker,jQuery)}(function(Picker,$){var DAYS_IN_WEEK=7,WEEKS_IN_CALENDAR=6,_=Picker._ 1672function DatePicker(picker,settings){var calendar=this,element=picker.$node[0],elementValue=element.value,elementDataValue=picker.$node.data('value'),valueString=elementDataValue||elementValue,formatString=elementDataValue?settings.formatSubmit:settings.format,isRTL=function(){return element.currentStyle?element.currentStyle.direction=='rtl':getComputedStyle(picker.$root[0]).direction=='rtl'} 1673calendar.settings=settings 1674calendar.$node=picker.$node 1675calendar.queue={min:'measure create',max:'measure create',now:'now create',select:'parse create validate',highlight:'parse navigate create validate',view:'parse create validate viewset',disable:'deactivate',enable:'activate'} 1676calendar.item={} 1677calendar.item.clear=null 1678calendar.item.disable=(settings.disable||[]).slice(0) 1679calendar.item.enable=-(function(collectionDisabled){return collectionDisabled[0]===true?collectionDisabled.shift():-1})(calendar.item.disable) 1680calendar.set('min',settings.min).set('max',settings.max).set('now') 1681if(valueString){calendar.set('select',valueString,{format:formatString,defaultValue:true})} 1682else{calendar.set('select',null).set('highlight',calendar.item.now)} 1683calendar.key={40:7,38:-7,39:function(){return isRTL()?-1:1},37:function(){return isRTL()?1:-1},go:function(timeChange){var highlightedObject=calendar.item.highlight,targetDate=new Date(highlightedObject.year,highlightedObject.month,highlightedObject.date+timeChange) 1684calendar.set('highlight',targetDate,{interval:timeChange}) 1685this.render()}} 1686picker.on('render',function(){picker.$root.find('.'+settings.klass.selectMonth).on('change',function(){var value=this.value 1687if(value){picker.set('highlight',[picker.get('view').year,value,picker.get('highlight').date]) 1688picker.$root.find('.'+settings.klass.selectMonth).trigger('focus')}}) 1689picker.$root.find('.'+settings.klass.selectYear).on('change',function(){var value=this.value 1690if(value){picker.set('highlight',[value,picker.get('view').month,picker.get('highlight').date]) 1691picker.$root.find('.'+settings.klass.selectYear).trigger('focus')}})},1).on('open',function(){var includeToday='' 1692if(calendar.disabled(calendar.get('now'))){includeToday=':not(.'+settings.klass.buttonToday+')'} 1693picker.$root.find('button'+includeToday+', select').attr('disabled',false)},1).on('close',function(){picker.$root.find('button, select').attr('disabled',true)},1)} 1694DatePicker.prototype.set=function(type,value,options){var calendar=this,calendarItem=calendar.item 1695if(value===null){if(type=='clear')type='select' 1696calendarItem[type]=value 1697return calendar} 1698calendarItem[(type=='enable'?'disable':type=='flip'?'enable':type)]=calendar.queue[type].split(' ').map(function(method){value=calendar[method](type,value,options) 1699return value}).pop() 1700if(type=='select'){calendar.set('highlight',calendarItem.select,options)} 1701else if(type=='highlight'){calendar.set('view',calendarItem.highlight,options)} 1702else if(type.match(/^(flip|min|max|disable|enable)$/)){if(calendarItem.select&&calendar.disabled(calendarItem.select)){calendar.set('select',calendarItem.select,options)} 1703if(calendarItem.highlight&&calendar.disabled(calendarItem.highlight)){calendar.set('highlight',calendarItem.highlight,options)}} 1704return calendar} 1705DatePicker.prototype.get=function(type){return this.item[type]} 1706DatePicker.prototype.create=function(type,value,options){var isInfiniteValue,calendar=this 1707value=value===undefined?type:value 1708if(value==-Infinity||value==Infinity){isInfiniteValue=value} 1709else if($.isPlainObject(value)&&_.isInteger(value.pick)){value=value.obj} 1710else if($.isArray(value)){value=new Date(value[0],value[1],value[2]) 1711value=_.isDate(value)?value:calendar.create().obj} 1712else if(_.isInteger(value)||_.isDate(value)){value=calendar.normalize(new Date(value),options)} 1713else{value=calendar.now(type,value,options)} 1714return{year:isInfiniteValue||value.getFullYear(),month:isInfiniteValue||value.getMonth(),date:isInfiniteValue||value.getDate(),day:isInfiniteValue||value.getDay(),obj:isInfiniteValue||value,pick:isInfiniteValue||value.getTime()}} 1715DatePicker.prototype.createRange=function(from,to){var calendar=this,createDate=function(date){if(date===true||$.isArray(date)||_.isDate(date)){return calendar.create(date)} 1716return date} 1717if(!_.isInteger(from)){from=createDate(from)} 1718if(!_.isInteger(to)){to=createDate(to)} 1719if(_.isInteger(from)&&$.isPlainObject(to)){from=[to.year,to.month,to.date+from];} 1720else if(_.isInteger(to)&&$.isPlainObject(from)){to=[from.year,from.month,from.date+to];} 1721return{from:createDate(from),to:createDate(to)}} 1722DatePicker.prototype.withinRange=function(range,dateUnit){range=this.createRange(range.from,range.to) 1723return dateUnit.pick>=range.from.pick&&dateUnit.pick<=range.to.pick} 1724DatePicker.prototype.overlapRanges=function(one,two){var calendar=this 1725one=calendar.createRange(one.from,one.to) 1726two=calendar.createRange(two.from,two.to) 1727return calendar.withinRange(one,two.from)||calendar.withinRange(one,two.to)||calendar.withinRange(two,one.from)||calendar.withinRange(two,one.to)} 1728DatePicker.prototype.now=function(type,value,options){value=new Date() 1729if(options&&options.rel){value.setDate(value.getDate()+options.rel)} 1730return this.normalize(value,options)} 1731DatePicker.prototype.navigate=function(type,value,options){var targetDateObject,targetYear,targetMonth,targetDate,isTargetArray=$.isArray(value),isTargetObject=$.isPlainObject(value),viewsetObject=this.item.view 1732if(isTargetArray||isTargetObject){if(isTargetObject){targetYear=value.year 1733targetMonth=value.month 1734targetDate=value.date} 1735else{targetYear=+value[0] 1736targetMonth=+value[1] 1737targetDate=+value[2]} 1738if(options&&options.nav&&viewsetObject&&viewsetObject.month!==targetMonth){targetYear=viewsetObject.year 1739targetMonth=viewsetObject.month}
1740targetDateObject=new Date(targetYear,targetMonth+(options&&options.nav?options.nav:0),1) 1741targetYear=targetDateObject.getFullYear() 1742targetMonth=targetDateObject.getMonth() 1743while(new Date(targetYear,targetMonth,targetDate).getMonth()!==targetMonth){targetDate-=1} 1744value=[targetYear,targetMonth,targetDate]} 1745return value} 1746DatePicker.prototype.normalize=function(value){value.setHours(0,0,0,0) 1747return value} 1748DatePicker.prototype.measure=function(type,value){var calendar=this 1749if(!value){value=type=='min'?-Infinity:Infinity} 1750else if(typeof value=='string'){value=calendar.parse(type,value)} 1751else if(_.isInteger(value)){value=calendar.now(type,value,{rel:value})} 1752return value} 1753DatePicker.prototype.viewset=function(type,dateObject){return this.create([dateObject.year,dateObject.month,1])} 1754DatePicker.prototype.validate=function(type,dateObject,options){var calendar=this,originalDateObject=dateObject,interval=options&&options.interval?options.interval:1,isFlippedBase=calendar.item.enable===-1,hasEnabledBeforeTarget,hasEnabledAfterTarget,minLimitObject=calendar.item.min,maxLimitObject=calendar.item.max,reachedMin,reachedMax,hasEnabledWeekdays=isFlippedBase&&calendar.item.disable.filter(function(value){if($.isArray(value)){var dateTime=calendar.create(value).pick 1755if(dateTime<dateObject.pick)hasEnabledBeforeTarget=true 1756else if(dateTime>dateObject.pick)hasEnabledAfterTarget=true} 1757return _.isInteger(value)}).length 1758if(!options||(!options.nav&&!options.defaultValue))if((!isFlippedBase&&calendar.disabled(dateObject))||(isFlippedBase&&calendar.disabled(dateObject)&&(hasEnabledWeekdays||hasEnabledBeforeTarget||hasEnabledAfterTarget))||(!isFlippedBase&&(dateObject.pick<=minLimitObject.pick||dateObject.pick>=maxLimitObject.pick))){if(isFlippedBase&&!hasEnabledWeekdays&&((!hasEnabledAfterTarget&&interval>0)||(!hasEnabledBeforeTarget&&interval<0))){interval*=-1} 1759while(calendar.disabled(dateObject)){if(Math.abs(interval)>1&&(dateObject.month<originalDateObject.month||dateObject.month>originalDateObject.month)){dateObject=originalDateObject 1760interval=interval>0?1:-1} 1761if(dateObject.pick<=minLimitObject.pick){reachedMin=true 1762interval=1 1763dateObject=calendar.create([minLimitObject.year,minLimitObject.month,minLimitObject.date+(dateObject.pick===minLimitObject.pick?0:-1)])} 1764else if(dateObject.pick>=maxLimitObject.pick){reachedMax=true 1765interval=-1 1766dateObject=calendar.create([maxLimitObject.year,maxLimitObject.month,maxLimitObject.date+(dateObject.pick===maxLimitObject.pick?0:1)])} 1767if(reachedMin&&reachedMax){break} 1768dateObject=calendar.create([dateObject.year,dateObject.month,dateObject.date+interval])}} 1769return dateObject} 1770DatePicker.prototype.disabled=function(dateToVerify){var 1771calendar=this,isDisabledMatch=calendar.item.disable.filter(function(dateToDisable){if(_.isInteger(dateToDisable)){return dateToVerify.day===(calendar.settings.firstDay?dateToDisable:dateToDisable-1)%7} 1772if($.isArray(dateToDisable)||_.isDate(dateToDisable)){return dateToVerify.pick===calendar.create(dateToDisable).pick} 1773if($.isPlainObject(dateToDisable)){return calendar.withinRange(dateToDisable,dateToVerify)}}) 1774isDisabledMatch=isDisabledMatch.length&&!isDisabledMatch.filter(function(dateToDisable){return $.isArray(dateToDisable)&&dateToDisable[3]=='inverted'||$.isPlainObject(dateToDisable)&&dateToDisable.inverted}).length 1775return calendar.item.enable===-1?!isDisabledMatch:isDisabledMatch||dateToVerify.pick<calendar.item.min.pick||dateToVerify.pick>calendar.item.max.pick} 1776DatePicker.prototype.parse=function(type,value,options){var calendar=this,parsingObject={} 1777if(!value||typeof value!='string'){return value} 1778if(!(options&&options.format)){options=options||{} 1779options.format=calendar.settings.format} 1780calendar.formats.toArray(options.format).map(function(label){var 1781formattingLabel=calendar.formats[label],formatLength=formattingLabel?_.trigger(formattingLabel,calendar,[value,parsingObject]):label.replace(/^!/,'').length 1782if(formattingLabel){parsingObject[label]=value.substr(0,formatLength)} 1783value=value.substr(formatLength)}) 1784return[parsingObject.yyyy||parsingObject.yy,+(parsingObject.mm||parsingObject.m)-1,parsingObject.dd||parsingObject.d]} 1785DatePicker.prototype.formats=(function(){function getWordLengthFromCollection(string,collection,dateObject){var word=string.match(/[^\x00-\x7F]+|\w+/)[0] 1786if(!dateObject.mm&&!dateObject.m){dateObject.m=collection.indexOf(word)+1} 1787return word.length} 1788function getFirstWordLength(string){return string.match(/\w+/)[0].length} 1789return{d:function(string,dateObject){return string?_.digits(string):dateObject.date},dd:function(string,dateObject){return string?2:_.lead(dateObject.date)},ddd:function(string,dateObject){return string?getFirstWordLength(string):this.settings.weekdaysShort[dateObject.day]},dddd:function(string,dateObject){return string?getFirstWordLength(string):this.settings.weekdaysFull[dateObject.day]},m:function(string,dateObject){return string?_.digits(string):dateObject.month+1},mm:function(string,dateObject){return string?2:_.lead(dateObject.month+1)},mmm:function(string,dateObject){var collection=this.settings.monthsShort 1790return string?getWordLengthFromCollection(string,collection,dateObject):collection[dateObject.month]},mmmm:function(string,dateObject){var collection=this.settings.monthsFull 1791return string?getWordLengthFromCollection(string,collection,dateObject):collection[dateObject.month]},yy:function(string,dateObject){return string?2:(''+dateObject.year).slice(2)},yyyy:function(string,dateObject){return string?4:dateObject.year},toArray:function(formatString){return formatString.split(/(d{1,4}|m{1,4}|y{4}|yy|!.)/g)},toString:function(formatString,itemObject){var calendar=this 1792return calendar.formats.toArray(formatString).map(function(label){return _.trigger(calendar.formats[label],calendar,[0,itemObject])||label.replace(/^!/,'')}).join('')}}})() 1793DatePicker.prototype.isDateExact=function(one,two){var calendar=this 1794if((_.isInteger(one)&&_.isInteger(two))||(typeof one=='boolean'&&typeof two=='boolean')){return one===two} 1795if((_.isDate(one)||$.isArray(one))&&(_.isDate(two)||$.isArray(two))){return calendar.create(one).pick===calendar.create(two).pick} 1796if($.isPlainObject(one)&&$.isPlainObject(two)){return calendar.isDateExact(one.from,two.from)&&calendar.isDateExact(one.to,two.to)} 1797return false} 1798DatePicker.prototype.isDateOverlap=function(one,two){var calendar=this,firstDay=calendar.settings.firstDay?1:0 1799if(_.isInteger(one)&&(_.isDate(two)||$.isArray(two))){one=one%7+firstDay 1800return one===calendar.create(two).day+1} 1801if(_.isInteger(two)&&(_.isDate(one)||$.isArray(one))){two=two%7+firstDay 1802return two===calendar.create(one).day+1} 1803if($.isPlainObject(one)&&$.isPlainObject(two)){return calendar.overlapRanges(one,two)} 1804return false} 1805DatePicker.prototype.flipEnable=function(val){var itemObject=this.item 1806itemObject.enable=val||(itemObject.enable==-1?1:-1)} 1807DatePicker.prototype.deactivate=function(type,datesToDisable){var calendar=this,disabledItems=calendar.item.disable.slice(0) 1808if(datesToDisable=='flip'){calendar.flipEnable()} 1809else if(datesToDisable===false){calendar.flipEnable(1) 1810disabledItems=[]} 1811else if(datesToDisable===true){calendar.flipEnable(-1) 1812disabledItems=[]} 1813else{datesToDisable.map(function(unitToDisable){var matchFound 1814for(var index=0;
1814index<disabledItems.length;index+=1){if(calendar.isDateExact(unitToDisable,disabledItems[index])){matchFound=true 1815break}} 1816if(!matchFound){if(_.isInteger(unitToDisable)||_.isDate(unitToDisable)||$.isArray(unitToDisable)||($.isPlainObject(unitToDisable)&&unitToDisable.from&&unitToDisable.to)){disabledItems.push(unitToDisable)}}})} 1817return disabledItems} 1818DatePicker.prototype.activate=function(type,datesToEnable){var calendar=this,disabledItems=calendar.item.disable,disabledItemsCount=disabledItems.length 1819if(datesToEnable=='flip'){calendar.flipEnable()} 1820else if(datesToEnable===true){calendar.flipEnable(1) 1821disabledItems=[]} 1822else if(datesToEnable===false){calendar.flipEnable(-1) 1823disabledItems=[]} 1824else{datesToEnable.map(function(unitToEnable){var matchFound,disabledUnit,index,isExactRange 1825for(index=0;index<disabledItemsCount;index+=1){disabledUnit=disabledItems[index] 1826if(calendar.isDateExact(disabledUnit,unitToEnable)){matchFound=disabledItems[index]=null 1827isExactRange=true 1828break} 1829else if(calendar.isDateOverlap(disabledUnit,unitToEnable)){if($.isPlainObject(unitToEnable)){unitToEnable.inverted=true 1830matchFound=unitToEnable} 1831else if($.isArray(unitToEnable)){matchFound=unitToEnable 1832if(!matchFound[3])matchFound.push('inverted')} 1833else if(_.isDate(unitToEnable)){matchFound=[unitToEnable.getFullYear(),unitToEnable.getMonth(),unitToEnable.getDate(),'inverted']} 1834break}} 1835if(matchFound)for(index=0;index<disabledItemsCount;index+=1){if(calendar.isDateExact(disabledItems[index],unitToEnable)){disabledItems[index]=null 1836break}} 1837if(isExactRange)for(index=0;index<disabledItemsCount;index+=1){if(calendar.isDateOverlap(disabledItems[index],unitToEnable)){disabledItems[index]=null 1838break}} 1839if(matchFound){disabledItems.push(matchFound)}})} 1840return disabledItems.filter(function(val){return val!=null})} 1841DatePicker.prototype.nodes=function(isOpen){var 1842calendar=this,settings=calendar.settings,calendarItem=calendar.item,nowObject=calendarItem.now,selectedObject=calendarItem.select,highlightedObject=calendarItem.highlight,viewsetObject=calendarItem.view,disabledCollection=calendarItem.disable,minLimitObject=calendarItem.min,maxLimitObject=calendarItem.max,tableHead=(function(collection,fullCollection){if(settings.firstDay){collection.push(collection.shift()) 1843fullCollection.push(fullCollection.shift())} 1844return _.node('thead',_.node('tr',_.group({min:0,max:DAYS_IN_WEEK-1,i:1,node:'th',item:function(counter){return[collection[counter],settings.klass.weekdays,'scope=col title="'+fullCollection[counter]+'"']}})))})((settings.showWeekdaysFull?settings.weekdaysFull:settings.weekdaysShort).slice(0),settings.weekdaysFull.slice(0)),createMonthNav=function(next){return _.node('div',' ',settings.klass['nav'+(next?'Next':'Prev')]+((next&&viewsetObject.year>=maxLimitObject.year&&viewsetObject.month>=maxLimitObject.month)||(!next&&viewsetObject.year<=minLimitObject.year&&viewsetObject.month<=minLimitObject.month)?' '+settings.klass.navDisabled:''),'data-nav='+(next||-1)+' '+ 1845_.ariaAttr({role:'button',controls:calendar.$node[0].id+'_table'})+' '+'title="'+(next?settings.labelMonthNext:settings.labelMonthPrev)+'"')},createMonthLabel=function(){var monthsCollection=settings.showMonthsShort?settings.monthsShort:settings.monthsFull 1846if(settings.selectMonths){return _.node('select',_.group({min:0,max:11,i:1,node:'option',item:function(loopedMonth){return[monthsCollection[loopedMonth],0,'value='+loopedMonth+ 1847(viewsetObject.month==loopedMonth?' selected':'')+ 1848(((viewsetObject.year==minLimitObject.year&&loopedMonth<minLimitObject.month)||(viewsetObject.year==maxLimitObject.year&&loopedMonth>maxLimitObject.month))?' disabled':'')]}}),settings.klass.selectMonth,(isOpen?'':'disabled')+' '+ 1849_.ariaAttr({controls:calendar.$node[0].id+'_table'})+' '+'title="'+settings.labelMonthSelect+'"')} 1850return _.node('div',monthsCollection[viewsetObject.month],settings.klass.month)},createYearLabel=function(){var focusedYear=viewsetObject.year,numberYears=settings.selectYears===true?5:~~(settings.selectYears/2) 1851if(numberYears){var 1852minYear=minLimitObject.year,maxYear=maxLimitObject.year,lowestYear=focusedYear-numberYears,highe
1852stYear=focusedYear+numberYears 1853if(minYear>lowestYear){highestYear+=minYear-lowestYear 1854lowestYear=minYear} 1855if(maxYear<highestYear){var availableYears=lowestYear-minYear,neededYears=highestYear-maxYear 1856lowestYear-=availableYears>neededYears?neededYears:availableYears 1857highestYear=maxYear} 1858return _.node('select',_.group({min:lowestYear,max:highestYear,i:1,node:'option',item:function(loopedYear){return[loopedYear,0,'value='+loopedYear+(focusedYear==loopedYear?' selected':'')]}}),settings.klass.selectYear,(isOpen?'':'disabled')+' '+_.ariaAttr({controls:calendar.$node[0].id+'_table'})+' '+'title="'+settings.labelYearSelect+'"')} 1859return _.node('div',focusedYear,settings.klass.year)} 1860return _.node('div',(settings.selectYears?createYearLabel()+createMonthLabel():createMonthLabel()+createYearLabel())+ 1861createMonthNav()+createMonthNav(1),settings.klass.header)+_.node('table',tableHead+ 1862_.node('tbody',_.group({min:0,max:WEEKS_IN_CALENDAR-1,i:1,node:'tr',item:function(rowCounter){var shiftDateBy=settings.firstDay&&calendar.create([viewsetObject.year,viewsetObject.month,1]).day===0?-7:0 1863return[_.group({min:DAYS_IN_WEEK*rowCounter-viewsetObject.day+shiftDateBy+1,max:function(){return this.min+DAYS_IN_WEEK-1},i:1,node:'td',item:function(targetDate){targetDate=calendar.create([viewsetObject.year,viewsetObject.month,targetDate+(settings.firstDay?1:0)]) 1864var isSelected=selectedObject&&selectedObject.pick==targetDate.pick,isHighlighted=highlightedObject&&highlightedObject.pick==targetDate.pick,isDisabled=disabledCollection&&calendar.disabled(targetDate)||targetDate.pick<minLimitObject.pick||targetDate.pick>maxLimitObject.pick,formattedDate=_.trigger(calendar.formats.toString,calendar,[settings.format,targetDate]) 1865return[_.node('div',targetDate.date,(function(klasses){klasses.push(viewsetObject.month==targetDate.month?settings.klass.infocus:settings.klass.outfocus) 1866if(nowObject.pick==targetDate.pick){klasses.push(settings.klass.now)} 1867if(isSelected){klasses.push(settings.klass.selected)} 1868if(isHighlighted){klasses.push(settings.klass.highlighted)} 1869if(isDisabled){klasses.push(settings.klass.disabled)} 1870return klasses.join(' ')})([settings.klass.day]),'data-pick='+targetDate.pick+' '+_.ariaAttr({role:'gridcell',label:formattedDate,selected:isSelected&&calendar.$node.val()===formattedDate?true:null,activedescendant:isHighlighted?true:null,disabled:isDisabled?true:null})),'',_.ariaAttr({role:'presentation'})]}})]}})),settings.klass.table,'id="'+calendar.$node[0].id+'_table'+'" '+_.ariaAttr({role:'grid',controls:calendar.$node[0].id,readonly:true}))+ 1871_.node('div',_.node('button',settings.today,settings.klass.buttonToday,'type=button data-pick='+nowObject.pick+ 1872(isOpen&&!calendar.disabled(nowObject)?'':' disabled')+' '+ 1873_.ariaAttr({controls:calendar.$node[0].id}))+ 1874_.node('button',settings.clear,settings.klass.buttonClear,'type=button data-clear=1'+ 1875(isOpen?'':' disabled')+' '+ 1876_.ariaAttr({controls:calendar.$node[0].id}))+ 1877_.node('button',settings.close,settings.klass.buttonClose,'type=button data-close=true '+ 1878(isOpen?'':' disabled')+' '+ 1879_.ariaAttr({controls:calendar.$node[0].id})),settings.klass.footer)} 1880DatePicker.defaults=(function(prefix){return{labelMonthNext:'Next month',labelMonthPrev:'Previous month',labelMonthSelect:'Select a month',labelYearSelect:'Select a year',monthsFull:['January','February','March','April','May','June','July','August','September','October','November','December'],monthsShort:['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],weekdaysFull:['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'],weekdaysShort:['Sun','Mon','Tue','Wed','Thu','Fri','Sat'],today:'Today',clear:'Clear',close:'Close',closeOnSelect:true,closeOnClear:true,format:'d mmmm, yyyy',klass:{table:prefix+'table',header:prefix+'header',navPrev:prefix+'nav--prev',navNext:prefix+'nav--next',navDisabled:prefix+'nav--disabled',month:prefix+'month',year:prefix+'year',selectMonth:prefix+'select--month',selectYear:prefix+'select--year',weekdays:prefix+'weekday',day:prefix+'day',disabled:prefix+'day--disabled',selected:prefix+'day--selected',highlighted:prefix+'day--highlighted',now:prefix+'day--today',infocus:prefix+'day--infocus',outfocus:prefix+'day--outfocus',footer
vendor: 8,652 bytes, lines 1880-1911
1880:prefix+'footer',buttonClear:prefix+'button--clear',buttonToday:prefix+'button--today',buttonClose:prefix+'button--close'}}})(Picker.klasses().picker+'__') 1881Picker.extend('pickadate',DatePicker)}));jQuery.extend(jQuery.fn.pickadate.defaults,{monthsFull:['styczeÅ','luty','marzec','kwiecieÅ','maj','czerwiec','lipiec','sierpieÅ','wrzesieÅ','październik','listopad','grudzieÅ'],monthsShort:['sty','lut','mar','kwi','maj','cze','lip','sie','wrz','paź','lis','gru'],weekdaysFull:['niedziela','poniedziaÅek','wtorek','Åroda','czwartek','piÄ tek','sobota'],weekdaysShort:['niedz.','pn.','wt.','År.','cz.','pt.','sob.'],today:'Dzisiaj',clear:'UsuÅ',close:'Zamknij',firstDay:1,format:'yyyy-mm-dd',formatSubmit:'yyyy-mm-dd'});(function($){var _iCheck='iCheck',_iCheckHelper=_iCheck+'-helper',_checkbox='checkbox',_radio='radio',_checked='checked',_unchecked='un'+_checked,_disabled='disabled',_determinate='determinate',_indeterminate='in'+_determinate,_update='update',_type='type',_click='click',_touch='touchbegin.i touchend.i',_add='addClass',_remove='removeClass',_callback='trigger',_label='label',_cursor='cursor',_mobile=/ipad|iphone|ipod|android|blackberry|windows phone|opera mini|silk/i.test(navigator.userAgent);$.fn[_iCheck]=function(options,fire){var handle='input[type="'+_checkbox+'"], input[type="'+_radio+'"]',stack=$(),walker=function(object){object.each(function(){var self=$(this);if(self.is(handle)){stack=stack.add(self);}else{stack=stack.add(self.find(handle));}});};if(/^(check|uncheck|toggle|indeterminate|determinate|disable|enable|update|destroy)$/i.test(options)){options=options.toLowerCase();walker(this);return stack.each(function(){var self=$(this);if(options=='destroy'){tidy(self,'ifDestroyed');}else{operate(self,true,options);} 1882if($.isFunction(fire)){fire();}});}else if(typeof options=='object'||!options){var settings=$.extend({checkedClass:_checked,disabledClass:_disabled,indeterminateClass:_indeterminate,labelHover:true},options),selector=settings.handle,hoverClass=settings.hoverClass||'hover',focusClass=settings.focusClass||'focus',activeClass=settings.activeClass||'active',labelHover=!!settings.labelHover,labelHoverClass=settings.labelHoverClass||'hover',area=(''+settings.increaseArea).replace('%','')|0;if(selector==_checkbox||selector==_radio){handle='input[type="'+selector+'"]';} 1883if(area<-50){area=-50;} 1884walker(this);return stack.each(function(){var self=$(this);tidy(self);var node=this,id=node.id,offset=-area+'%',size=100+(area*2)+'%',layer={position:'absolute',top:offset,left:offset,display:'block',width:size,height:size,margin:0,padding:0,background:'#fff',border:0,opacity:0},hide=_mobile?{position:'absolute',visibility:'hidden'}:area?layer:{position:'absolute',opacity:0},className=node[_type]==_checkbox?settings.checkboxClass||'i'+_checkbox:settings.radioClass||'i'+_radio,label=$(_label+'[for="'+id+'"]').add(self.closest(_label)),aria=!!settings.aria,ariaID=_iCheck+'-'+Math.random().toString(36).substr(2,6),parent='<div class="'+className+'" '+(aria?'role="'+node[_type]+'" ':''),helper;if(aria){label.each(function(){parent+='aria-labelledby="';if(this.id){parent+=this.id;}else{this.id=ariaID;parent+=ariaID;} 1885parent+='"';});} 1886parent=self.wrap(parent+'/>')[_callback]('ifCreated').parent().append(settings.insert);helper=$('<ins class="'+_iCheckHelper+'"/>').css(layer).appendTo(parent);self.data(_iCheck,{o:settings,s:self.attr('style')}).css(hide);!!settings.inheritClass&&parent[_add](node.className||'');!!settings.inheritID&&id&&parent.attr('id',_iCheck+'-'+id);parent.css('position')=='static'&&parent.css('position','relative');operate(self,true,_update);if(label.length){label.on(_click+'.i mouseover.i mouseout.i '+_touch,function(event){var type=event[_type],item=$(this);if(!node[_disabled]){if(type==_click){if($(event.target).is('a')){return;} 1887operate(self,false,true);}else if(labelHover){if(/ut|nd/.test(type)){parent[_remove](hoverClass);item[_remove](labelHoverClass);}else{parent[_add](hoverClass);item[_add](labelHoverClass);}} 1888if(_mobile){event.stopPropagation();}else{return false;}}});} 1889self.on(_click+'.i focus.i blur.i keyup.i keydown.i keypress.i',function(event){var type=event[_type],key=event.keyCode;if(type==_click){return false;}else if(type=='keydown'&&key==32){if(!(node[_type]==_radio&&node[_checked])){if(node[_checked]){off(self,_checked);}else{on(self,_checked);}} 1890return false;}else if(type=='keyup'&&node[_type]==_radio){!node[_checked]&&on(self,_checked);}else if(/us|ur/.test(type)){parent[type=='blur'?_remove:_add](focusClass);}});helper.on(_click+' mousedown mouseup mouseover mouseout '+_touch,function(event){var type=event[_type],toggle=/wn|up/.test(type)?activeClass:hoverClass;if(!node[_disabled]){if(type==_click){operate(self,false,true);}else{if(/wn|er|in/.test(type)){parent[_add](toggle);}else{parent[_remove](toggle+' '+activeClass);} 1891if(label.length&&labelHover&&toggle==hoverClass){label[/ut|nd/.test(type)?_remove:_add](labelHoverClass);}} 1892if(_mobile){event.stopPropagation();}else{return false;}}});});}else{return this;}};function operate(input,direct,method){var node=input[0],state=/er/.test(method)?_indeterminate:/bl/.test(method)?_disabled:_checked,active=method==_update?{checked:node[_checked],disabled:node[_disabled],indeterminate:input.attr(_indeterminate)=='true'||input.attr(_determinate)=='false'}:node[state];if(/^(ch|di|in)/.test(method)&&!active){on(input,state);}else if(/^(un|en|de)/.test(method)&&active){off(input,state);}else if(method==_update){for(var each in active){if(active[each]){on(input,each,true);}else{off(input,each,true);}}}else if(!direct||method=='toggle'){if(!direct){input[_callback]('ifClicked');} 1893if(active){if(node[_type]!==_radio){off(input,state);}}else{on(input,state);}}} 1894function on(input,state,keep){var node=input[0],parent=input.parent(),checked=state==_checked,indeterminate=state==_indeterminate,disabled=state==_disabled,callback=indeterminate?_determinate:checked?_unchecked:'enabled',regular=option(input,callback+capitalize(node[_type])),specific=option(input,state+capitalize(node[_type]));if(node[state]!==true){if(!keep&&state==_checked&&node[_type]==_radio&&node.name){var form=input.closest('form'),inputs='input[name="'+node.name+'"]';inputs=form.length?form.find(inputs):$(inputs);inputs.each(function(){if(this!==node&&$(this).data(_iCheck)){off($(this),state);}});} 1895if(indeterminate){node[state]=true;if(node[_checked]){off(input,_checked,'force');}}else{if(!keep){node[state]=true;} 1896if(checked&&node[_indeterminate]){off(input,_indeterminate,false);}} 1897callbacks(input,checked,state,keep);} 1898if(node[_disabled]&&!!option(input,_cursor,true)){parent.find('.'+_iCheckHelper).css(_cursor,'default');} 1899parent[_add](specific||option(input,state)||'');if(!!parent.attr('role')&&!indeterminate){parent.attr('aria-'+(disabled?_disabled:_checked),'true');} 1900parent[_remove](regular||option(input,callback)||'');} 1901function off(input,state,keep){var node=input[0],parent=input.parent(),checked=state==_checked,indeterminate=state==_indeterminate,disabled=state==_disabled,callback=indeterminate?_determinate:checked?_unchecked:'enabled',regular=option(input,callback+capitalize(node[_type])),specific=option(input,state+capitalize(node[_type]));if(node[state]!==false){if(indeterminate||!keep||keep=='force'){node[state]=false;} 1902callbacks(input,checked,callback,keep);} 1903if(!node[_disabled]&&!!option(input,_cursor,true)){parent.find('.'+_iCheckHelper).css(_cursor,'pointer');} 1904parent[_remove](specific||option(input,state)||'');if(!!parent.attr('role')&&!indeterminate){parent.attr('aria-'+(disabled?_disabled:_checked),'false');} 1905parent[_add](regular||option(input,callback)||'');} 1906function tidy(input,callback){if(input.data(_iCheck)){input.parent().html(input.attr('style',input.data(_iCheck).s||''));if(callback){input[_callback](callback);} 1907input.off('.i').unwrap();$(_label+'[for="'+input[0].id+'"]').add(input.closest(_label)).off('.i');}} 1908function option(input,state,regular){if(input.data(_iCheck)){return input.data(_iCheck).o[state+(regular?'':'Class')];}} 1909function capitalize(string){return string.charAt(0).toUpperCase()+string.slice(1);} 1910function callbacks(input,checked,callback,keep){if(!keep){if(checked){input[_callback]('ifToggled');} 1911input[_callback]('ifChanged')[_callback]('if'+capitalize(callback));}}})(window.jQuery||window.Zepto);(function($){$.fn.rating=function(method,options){method=method||'create';var settings=$.extend({limit:5,value:null,glyph:"fa-star",coloroff:"#A5A5A5",coloron:"#FF7F00",size:"2.0em",cursor:"pointer",onClick:function(){},endofarray:"idontmatter"},options);var style="";style=style+"font-size:"+settings.size+"; ";
1911style=style+"color:"+settings.coloroff+"; ";style=style+"cursor:"+settings.cursor+"; ";if(method=='create') 1912{$(this).find("input, select").hide();this.each(function(){var attr=$(this).attr('data-rating');if((attr===undefined||attr===false)&&null!==settings.value){$(this).attr('data-rating',settings.value);}else{$(this).attr('data-rating',$(this).find("input, select").val())}}) 1913for(var i=0;i<settings.limit;i++) 1914{this.append('<span data-value="'+(i+1)+'" class="ratingicon fa '+settings.glyph+'" style="'+style+'" aria-hidden="true"></span>');} 1915this.each(function(){paint($(this));});} 1916if(method=='set') 1917{this.attr('data-rating',options);this.each(function(){paint($(this));});} 1918if(method=='get') 1919{return this.attr('data-rating');} 1920this.find("span.ratingicon").click(function(){var rating=$(this).attr('data-value') 1921$(this).parent().attr('data-rating',rating);paint($(this).parent());settings.onClick.call($(this).parent());}) 1922function paint(div) 1923{var rating=parseInt(div.attr('data-rating'));div.find("input, select").val(rating);div.find("span.ratingicon").each(function(){var rating=parseInt($(this).parent().attr('data-rating'));var value=parseInt($(this).attr('data-value'));if(value>rating){$(this).css('color',settings.coloroff);}else{$(this).css('color',settings.coloron);}})}};}(jQuery));!function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.moment=b()}(this,function(){"use strict";function a(){return fd.apply(null,arguments)}function b(a){fd=a}function c(a){return a instanceof Array||"[object Array]"===Object.prototype.toString.call(a)}function d(a){return a instanceof Date||"[object Date]"===Object.prototype.toString.call(a)}function e(a,b){var c,d=[];for(c=0;c<a.length;++c)d.push(b(a[c],c));return d}function f(a,b){return Object.prototype.hasOwnProperty.call(a,b)}function g(a,b){for(var c in b)f(b,c)&&(a[c]=b[c]);return f(b,"toString")&&(a.toString=b.toString),f(b,"valueOf")&&(a.valueOf=b.valueOf),a}function h(a,b,c,d){return Ja(a,b,c,d,!0).utc()}function i(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],meridiem:null}}function j(a){return null==a._pf&&(a._pf=i()),a._pf}function k(a){if(null==a._isValid){var b=j(a),c=gd.call(b.parsedDateParts,function(a){return null!=a});a._isValid=!isNaN(a._d.getTime())&&b.overflow<0&&!b.empty&&!b.invalidMonth&&!b.invalidWeekday&&!b.nullInput&&!b.invalidFormat&&!b.userInvalidated&&(!b.meridiem||b.meridiem&&c),a._strict&&(a._isValid=a._isValid&&0===b.charsLeftOver&&0===b.unusedTokens.length&&void 0===b.bigHour)}return a._isValid}function l(a){var b=h(NaN);return null!=a?g(j(b),a):j(b).userInvalidated=!0,b}function m(a){return void 0===a}function n(a,b){var c,d,e;if(m(b._isAMomentObject)||(a._isAMomentObject=b._isAMomentObject),m(b._i)||(a._i=b._i),m(b._f)||(a._f=b._f),m(b._l)||(a._l=b._l),m(b._strict)||(a._strict=b._strict),m(b._tzm)||(a._tzm=b._tzm),m(b._isUTC)||(a._isUTC=b._isUTC),m(b._offset)||(a._offset=b._offset),m(b._pf)||(a._pf=j(b)),m(b._locale)||(a._locale=b._locale),hd.length>0)for(c in hd)d=hd[c],e=b[d],m(e)||(a[d]=e);return a}function o(b){n(this,b),this._d=new Date(null!=b._d?b._d.getTime():NaN),id===!1&&(id=!0,a.updateOffset(this),id=!1)}function p(a){return a instanceof o||null!=a&&null!=a._isAMomentObject}function q(a){return 0>a?Math.ceil(a):Math.floor(a)}function r(a){var b=+a,c=0;return 0!==b&&isFinite(b)&&(c=q(b)),c}function s(a,b,c){var d,e=Math.min(a.length,b.length),f=Math.abs(a.length-b.length),g=0;for(d=0;e>d;d++)(c&&a[d]!==b[d]||!c&&r(a[d])!==r(b[d]))&&g++;return g+f}function t(b){a.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+b)}function u(b,c){var d=!0;return g(function(){return null!=a.deprecationHandler&&a.deprecationHandler(null,b),d&&(t(b+"\nArguments: "+Array.prototype.slice.call(arguments).join(", ")+"\n"+(new Error).stack),d=!1),c.apply(this,arguments)},c)}function v(b,c){null!=a.deprecationHandler&&a.deprecationHandler(b,c),jd[b]||(t(c),jd[b]=!0)}function w(a){return a instanceof Function||"[object Function]"===Object.prototype.toString.call(a)}function x(a){return"[object Object]"===Object.prototype.toString.call(a)}function y(a){var b,c;for(c in a)b=a[c],w(b)?this[c]=b:this["_"+c]=b;this._config=a,this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function z(a,b){var c,d=g({},a);for(c in b)f(b,c)&&(x(a[c])&&x(b[c])?(d[c]={},g(d[c],a[c]),g(d[c],b[c])):null!=b[c]?d[c]=b[c]:delete d[c]);return d}function A(a){null!=a&&this.set(a)}function B(a){return a?a.toLowerCase().replace("_","-"):a}function C(a){for(var b,c,d,e,f=0;f<a.length;){for(e=B(a[f]).split("-"),b=e.length,c=B(a[f+1]),c=c?c.split("-"):null;b>0;){if(d=D(e.slice(0,b).join("-")))return d;if(c&&c.length>=b&&s(e,c,!0)>=b-1)break;b--}f++}return null}function D(a){var b=null;if(!nd[a]&&"undefined"!=typeof module&&module&&module.exports)try{b=ld._abbr,require("./locale/"+a),E(b)}catch(c){}return nd[a]}function E(a,b){var c;
vendor: 36,250 bytes, line 1923
1923return a&&(c=m(b)?H(a):F(a,b),c&&(ld=c)),ld._abbr}function F(a,b){return null!==b?(b.abbr=a,null!=nd[a]?(v("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale"),b=z(nd[a]._config,b)):null!=b.parentLocale&&(null!=nd[b.parentLocale]?b=z(nd[b.parentLocale]._config,b):v("parentLocaleUndefined","specified parentLocale is not defined yet")),nd[a]=new A(b),E(a),nd[a]):(delete nd[a],null)}function G(a,b){if(null!=b){var c;null!=nd[a]&&(b=z(nd[a]._config,b)),c=new A(b),c.parentLocale=nd[a],nd[a]=c,E(a)}else null!=nd[a]&&(null!=nd[a].parentLocale?nd[a]=nd[a].parentLocale:null!=nd[a]&&delete nd[a]);return nd[a]}function H(a){var b;if(a&&a._locale&&a._locale._abbr&&(a=a._locale._abbr),!a)return ld;if(!c(a)){if(b=D(a))return b;a=[a]}return C(a)}function I(){return kd(nd)}function J(a,b){var c=a.toLowerCase();od[c]=od[c+"s"]=od[b]=a}function K(a){return"string"==typeof a?od[a]||od[a.toLowerCase()]:void 0}function L(a){var b,c,d={};for(c in a)f(a,c)&&(b=K(c),b&&(d[b]=a[c]));return d}function M(b,c){return function(d){return null!=d?(O(this,b,d),a.updateOffset(this,c),this):N(this,b)}}function N(a,b){return a.isValid()?a._d["get"+(a._isUTC?"UTC":"")+b]():NaN}function O(a,b,c){a.isValid()&&a._d["set"+(a._isUTC?"UTC":"")+b](c)}function P(a,b){var c;if("object"==typeof a)for(c in a)this.set(c,a[c]);else if(a=K(a),w(this[a]))return this[a](b);return this}function Q(a,b,c){var d=""+Math.abs(a),e=b-d.length,f=a>=0;return(f?c?"+":"":"-")+Math.pow(10,Math.max(0,e)).toString().substr(1)+d}function R(a,b,c,d){var e=d;"string"==typeof d&&(e=function(){return this[d]()}),a&&(sd[a]=e),b&&(sd[b[0]]=function(){return Q(e.apply(this,arguments),b[1],b[2])}),c&&(sd[c]=function(){return this.localeData().ordinal(e.apply(this,arguments),a)})}function S(a){return a.match(/\[[\s\S]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}function T(a){var b,c,d=a.match(pd);for(b=0,c=d.length;c>b;b++)sd[d[b]]?d[b]=sd[d[b]]:d[b]=S(d[b]);return function(b){var e,f="";for(e=0;c>e;e++)f+=d[e]instanceof Function?d[e].call(b,a):d[e];return f}}function U(a,b){return a.isValid()?(b=V(b,a.localeData()),rd[b]=rd[b]||T(b),rd[b](a)):a.localeData().invalidDate()}function V(a,b){function c(a){return b.longDateFormat(a)||a}var d=5;for(qd.lastIndex=0;d>=0&&qd.test(a);)a=a.replace(qd,c),qd.lastIndex=0,d-=1;return a}function W(a,b,c){Kd[a]=w(b)?b:function(a,d){return a&&c?c:b}}function X(a,b){return f(Kd,a)?Kd[a](b._strict,b._locale):new RegExp(Y(a))}function Y(a){return Z(a.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,b,c,d,e){return b||c||d||e}))}function Z(a){return a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function $(a,b){var c,d=b;for("string"==typeof a&&(a=[a]),"number"==typeof b&&(d=function(a,c){c[b]=r(a)}),c=0;c<a.length;c++)Ld[a[c]]=d}function _(a,b){$(a,function(a,c,d,e){d._w=d._w||{},b(a,d._w,d,e)})}function aa(a,b,c){null!=b&&f(Ld,a)&&Ld[a](b,c._a,c,a)}function ba(a,b){return new Date(Date.UTC(a,b+1,0)).getUTCDate()}function ca(a,b){return c(this._months)?this._months[a.month()]:this._months[Vd.test(b)?"format":"standalone"][a.month()]}function da(a,b){return c(this._monthsShort)?this._monthsShort[a.month()]:this._monthsShort[Vd.test(b)?"format":"standalone"][a.month()]}function ea(a,b,c){var d,e,f,g=a.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],d=0;12>d;++d)f=h([2e3,d]),this._shortMonthsParse[d]=this.monthsShort(f,"").toLocaleLowerCase(),this._longMonthsParse[d]=this.months(f,"").toLocaleLowerCase();return c?"MMM"===b?(e=md.call(this._shortMonthsParse,g),-1!==e?e:null):(e=md.call(this._longMonthsParse,g),-1!==e?e:null):"MMM"===b?(e=md.call(this._shortMonthsParse,g),-1!==e?e:(e=md.call(this._longMonthsParse,g),-1!==e?e:null)):(e=md.call(this._longMonthsParse,g),-1!==e?e:(e=md.call(this._shortMonthsParse,g),-1!==e?e:null))}function fa(a,b,c){var d,e,f;if(this._monthsParseExact)return ea.call(this,a,b,c);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),d=0;12>d;d++){if(e=h([2e3,d]),c&&!this._longMonthsParse[d]&&(this._longMonthsParse[d]=new RegExp("^"+this.months(e,"").replace(".","")+"$","i"),this._shortMonthsParse[d]=new RegExp("^"+this.monthsShort(e,"").replace(".","")+"$","i")),c||this._monthsParse[d]||(f="^"+this.months(e,"")+"|^"+this.monthsShort(e,""),this._monthsParse[d]=new RegExp(f.replace(".",""),"i")),c&&"MMMM"===b&&this._longMonthsParse[d].test(a))return d;if(c&&"MMM"===b&&this._shortMonthsParse[d].test(a))return d;if(!c&&this._monthsParse[d].test(a))return d}}function ga(a,b){var c;if(!a.isValid())return a;if("string"==typeof b)if(/^\d+$/.test(b))b=r(b);else if(b=a.localeData().monthsParse(b),"number"!=typeof b)return a;return c=Math.min(a.date(),ba(a.year(),b)),a._d["set"+(a._isUTC?"UTC":"")+"Month"](b,c),a}function ha(b){return null!=b?(ga(this,b),a.updateOffset(this,!0),this):N(this,"Month")}function ia(){return ba(this.year(),this.month())}function ja(a){return this._monthsParseExact?(f(this,"_monthsRegex")||la.call(this),a?this._monthsShortStrictRegex:this._monthsShortRegex):this._monthsShortStrictRegex&&a?this._monthsShortStrictRegex:this._monthsShortRegex}function ka(a){return this._monthsParseExact?(f(this,"_monthsRegex")||la.call(this),a?this._monthsStrictRegex:this._monthsRegex):this._monthsStrictRegex&&a?this._monthsStrictRegex:this._monthsRegex}function la(){function a(a,b){return b.length-a.length}var b,c,d=[],e=[],f=[];for(b=0;12>b;b++)c=h([2e3,b]),d.push(this.monthsShort(c,"")),e.push(this.months(c,"")),f.push(this.months(c,"")),f.push(this.monthsShort(c,""));for(d.sort(a),e.sort(a),f.sort(a),b=0;12>b;b++)d[b]=Z(d[b]),e[b]=Z(e[b]),f[b]=Z(f[b]);this._monthsRegex=new RegExp("^("+f.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+e.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+d.join("|")+")","i")}function ma(a){var b,c=a._a;return c&&-2===j(a).overflow&&(b=c[Nd]<0||c[Nd]>11?Nd:c[Od]<1||c[Od]>ba(c[Md],c[Nd])?Od:c[Pd]<0||c[Pd]>24||24===c[Pd]&&(0!==c[Qd]||0!==c[Rd]||0!==c[Sd])?Pd:c[Qd]<0||c[Qd]>59?Qd:c[Rd]<0||c[Rd]>59?Rd:c[Sd]<0||c[Sd]>999?Sd:-1,j(a)._overflowDayOfYear&&(Md>b||b>Od)&&(b=Od),j(a)._overflowWeeks&&-1===b&&(b=Td),j(a)._overflowWeekday&&-1===b&&(b=Ud),j(a).overflow=b),a}function na(a){var b,c,d,e,f,g,h=a._i,i=$d.exec(h)||_d.exec(h);if(i){for(j(a).iso=!0,b=0,c=be.length;c>b;b++)if(be[b][1].exec(i[1])){e=be[b][0],d=be[b][2]!==!1;break}if(null==e)return void(a._isValid=!1);if(i[3]){for(b=0,c=ce.length;c>b;b++)if(ce[b][1].exec(i[3])){f=(i[2]||" ")+ce[b][0];break}if(null==f)return void(a._isValid=!1)}if(!d&&null!=f)return void(a._isValid=!1);if(i[4]){if(!ae.exec(i[4]))return void(a._isValid=!1);g="Z"}a._f=e+(f||"")+(g||""),Ca(a)}else a._isValid=!1}function oa(b){var c=de.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(na(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}function pa(a,b,c,d,e,f,g){var h=new Date(a,b,c,d,e,f,g);return 100>a&&a>=0&&isFinite(h.getFullYear())&&h.setFullYear(a),h}function qa(a){var b=new Date(Date.UTC.apply(null,arguments));return 100>a&&a>=0&&isFinite(b.getUTCFullYear())&&b.setUTCFullYear(a),b}function ra(a){return sa(a)?366:365}function sa(a){return a%4===0&&a%100!==0||a%400===0}function ta(){return sa(this.year())}function ua(a,b,c){var d=7+b-c,e=(7+qa(a,0,d).getUTCDay()-b)%7;return-e+d-1}function va(a,b,c,d,e){var f,g,h=(7+c-d)%7,i=ua(a,d,e),j=1+7*(b-1)+h+i;return 0>=j?(f=a-1,g=ra(f)+j):j>ra(a)?(f=a+1,g=j-ra(a)):(f=a,g=j),{year:f,dayOfYear:g}}function wa(a,b,c){var d,e,f=ua(a.year(),b,c),g=Math.floor((a.dayOfYear()-f-1)/7)+1;return 1>g?(e=a.year()-1,d=g+xa(e,b,c)):g>xa(a.year(),b,c)?(d=g-xa(a.year(),b,c),e=a.year()+1):(e=a.year(),d=g),{week:d,year:e}}function xa(a,b,c){var d=ua(a,b,c),e=ua(a+1,b,c);return(ra(a)-d+e)/7}function ya(a,b,c){return null!=a?a:null!=b?b:c}function za(b){var c=new Date(a.now());return b._useUTC?[c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()]:[c.getFullYear(),c.getMonth(),c.getDate()]}function Aa(a){var b,c,d,e,f=[];if(!a._d){for(d=za(a),a._w&&null==a._a[Od]&&null==a._a[Nd]&&Ba(a),a._dayOfYear&&(e=ya(a._a[Md],d[Md]),a._dayOfYear>ra(e)&&(j(a)._overflowDayOfYear=!0),c=qa(e,0,a._dayOfYear),a._a[Nd]=c.getUTCMonth(),a._a[Od]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];for(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];24===a._a[Pd]&&0===a._a[Qd]&&0===a._a[Rd]&&0===a._a[Sd]&&(a._nextDay=!0,a._a[Pd]=0),a._d=(a._useUTC?qa:pa).apply(null,f),null!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[Pd]=24)}}function Ba(a){var b,c,d,e,f,g,h,i;b=a._w,null!=b.GG||null!=b.W||null!=b.E?(f=1,g=4,c=ya(b.GG,a._a[Md],wa(Ka(),1,4).year),d=ya(b.W,1),e=ya(b.E,1),(1>e||e>7)&&(i=!0)):(f=a._locale._week.dow,g=a._locale._week.doy,c=ya(b.gg,a._a[Md],wa(Ka(),f,g).year),d=ya(b.w,1),null!=b.d?(e=b.d,(0>e||e>6)&&(i=!0)):null!=b.e?(e=b.e+f,(b.e<0||b.e>6)&&(i=!0)):e=f),1>d||d>xa(c,f,g)?j(a)._overflowWeeks=!0:null!=i?j(a)._overflowWeekday=!0:(h=va(c,d,e,f,g),a._a[Md]=h.year,a._dayOfYear=h.dayOfYear)}function Ca(b){if(b._f===a.ISO_8601)return void na(b);b._a=[],j(b).empty=!0;var c,d,e,f,g,h=""+b._i,i=h.length,k=0;for(e=V(b._f,b._locale).match(pd)||[],c=0;c<e.length;c++)f=e[c],d=(h.match(X(f,b))||[])[0],d&&(g=h.substr(0,h.indexOf(d)),g.length>0&&j(b).unusedInput.push(g),h=h.slice(h.indexOf(d)+d.length),k+=d.length),sd[f]?(d?j(b).empty=!1:j(b).unusedTokens.push(f),aa(f,d,b)):b._strict&&!d&&j(b).unusedTokens.push(f);j(b).charsLeftOver=i-k,h.length>0&&j(b).unusedInput.push(h),j(b).bigHour===!0&&b._a[Pd]<=12&&b._a[Pd]>0&&(j(b).bigHour=void 0),j(b).parsedDateParts=b._a.slice(0),j(b).meridiem=b._meridiem,b._a[Pd]=Da(b._locale,b._a[Pd],b._meridiem),Aa(b),ma(b)}function Da(a,b,c){var d;return null==c?b:null!=a.meridiemHour?a.meridiemHour(b,c):null!=a.isPM?(d=a.isPM(c),d&&12>b&&(b+=12),d||12!==b||(b=0),b):b}function Ea(a){var b,c,d,e,f;if(0===a._f.length)return j(a).invalidFormat=!0,void(a._d=new Date(NaN));for(e=0;e<a._f.length;e++)f=0,b=n({},a),null!=a._useUTC&&(b._useUTC=a._useUTC),b._f=a._f[e],Ca(b),k(b)&&(f+=j(b).charsLeftOver,f+=10*j(b).unusedTokens.length,j(b).score=f,(null==d||d>f)&&(d=f,c=b));g(a,c||b)}function Fa(a){if(!a._d){var b=L(a._i);a._a=e([b.year,b.month,b.day||b.date,b.hour,b.minute,b.second,b.millisecond],function(a){return a&&parseInt(a,10)}),Aa(a)}}function Ga(a){var b=new o(ma(Ha(a)));return b._nextDay&&(b.add(1,"d"),b._nextDay=void 0),b}function Ha(a){var b=a._i,e=a._f;return a._locale=a._locale||H(a._l),null===b||void 0===e&&""===b?l({nullInput:!0}):("string"==typeof b&&(a._i=b=a._locale.preparse(b)),p(b)?new o(ma(b)):(c(e)?Ea(a):e?Ca(a):d(b)?a._d=b:Ia(a),k(a)||(a._d=null),a))}function Ia(b){var f=b._i;void 0===f?b._d=new Date(a.now()):d(f)?b._d=new Date(f.valueOf()):"string"==typeof f?oa(b):c(f)?(b._a=e(f.slice(0),function(a){return parseInt(a,10)}),Aa(b)):"object"==typeof f?Fa(b):"number"==typeof f?b._d=new Date(f):a.createFromInputFallback(b)}function Ja(a,b,c,d,e){var f={};return"boolean"==typeof c&&(d=c,c=void 0),f._isAMomentObject=!0,f._useUTC=f._isUTC=e,f._l=c,f._i=a,f._f=b,f._strict=d,Ga(f)}function Ka(a,b,c,d){return Ja(a,b,c,d,!1)}function La(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return Ka();for(d=b[0],e=1;e<b.length;++e)(!b[e].isValid()||b[e][a](d))&&(d=b[e]);return d}function Ma(){var a=[].slice.call(arguments,0);return La("isBefore",a)}function Na(){var a=[].slice.call(arguments,0);return La("isAfter",a)}function Oa(a){var b=L(a),c=b.year||0,d=b.quarter||0,e=b.month||0,f=b.week||0,g=b.day||0,h=b.hour||0,i=b.minute||0,j=b.second||0,k=b.millisecond||0;this._milliseconds=+k+1e3*j+6e4*i+1e3*h*60*60,this._days=+g+7*f,this._months=+e+3*d+12*c,this._data={},this._locale=H(),this._bubble()}function Pa(a){return a instanceof Oa}function Qa(a,b){R(a,0,0,function(){var a=this.utcOffset(),c="+";return 0>a&&(a=-a,c="-"),c+Q(~~(a/60),2)+b+Q(~~a%60,2)})}function Ra(a,b){var c=(b||"").match(a)||[],d=c[c.length-1]||[],e=(d+"").match(ie)||["-",0,0],f=+(60*e[1])+r(e[2]);return"+"===e[0]?f:-f}function Sa(b,c){var e,f;return c._isUTC?(e=c.clone(),f=(p(b)||d(b)?b.valueOf():Ka(b).valueOf())-e.valueOf(),e._d.setTime(e._d.valueOf()+f),a.updateOffset(e,!1),e):Ka(b).local()}function Ta(a){return 15*-Math.round(a._d.getTimezoneOffset()/15)}function Ua(b,c){var d,e=this._offset||0;return this.isValid()?null!=b?("string"==typeof b?b=Ra(Hd,b):Math.abs(b)<16&&(b=60*b),!this._isUTC&&c&&(d=Ta(this)),this._offset=b,this._isUTC=!0,null!=d&&this.add(d,"m"),e!==b&&(!c||this._changeInProgress?jb(this,db(b-e,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,a.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?e:Ta(this):null!=b?this:NaN}function Va(a,b){return null!=a?("string"!=typeof a&&(a=-a),this.utcOffset(a,b),this):-this.utcOffset()}function Wa(a){return this.utcOffset(0,a)}function Xa(a){return this._isUTC&&(this.utcOffset(0,a),this._isUTC=!1,a&&this.subtract(Ta(this),"m")),this}function Ya(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(Ra(Gd,this._i)),this}function Za(a){return this.isValid()?(a=a?Ka(a).utcOffset():0,(this.utcOffset()-a)%60===0):!1}function $a(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function _a(){if(!m(this._isDSTShifted))return this._isDSTShifted;var a={};if(n(a,this),a=Ha(a),a._a){var b=a._isUTC?h(a._a):Ka(a._a);this._isDSTShifted=this.isValid()&&s(a._a,b.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function ab(){return this.isValid()?!this._isUTC:!1}function bb(){return this.isValid()?this._isUTC:!1}function cb(){return this.isValid()?this._isUTC&&0===this._offset:!1}function db(a,b){var c,d,e,g=a,h=null;return Pa(a)?g={ms:a._milliseconds,d:a._days,M:a._months}:"number"==typeof a?(g={},b?g[b]=a:g.milliseconds=a):(h=je.exec(a))?(c="-"===h[1]?-1:1,g={y:0,d:r(h[Od])*c,h:r(h[Pd])*c,m:r(h[Qd])*c,s:r(h[Rd])*c,ms:r(h[Sd])*c}):(h=ke.exec(a))?(c="-"===h[1]?-1:1,g={y:eb(h[2],c),M:eb(h[3],c),w:eb(h[4],c),d:eb(h[5],c),h:eb(h[6],c),m:eb(h[7],c),s:eb(h[8],c)}):null==g?g={}:"object"==typeof g&&("from"in g||"to"in g)&&(e=gb(Ka(g.from),Ka(g.to)),g={},g.ms=e.milliseconds,g.M=e.months),d=new Oa(g),Pa(a)&&f(a,"_locale")&&(d._locale=a._locale),d}function eb(a,b){var c=a&&parseFloat(a.replace(",","."));return(isNaN(c)?0:c)*b}function fb(a,b){var c={milliseconds:0,months:0};return c.months=b.month()-a.month()+12*(b.year()-a.year()),a.clone().add(c.months,"M").isAfter(b)&&--c.months,c.milliseconds=+b-+a.clone().add(c.months,"M"),c}function gb(a,b){var c;return a.isValid()&&b.isValid()?(b=Sa(b,a),a.isBefore(b)?c=fb(a,b):(c=fb(b,a),c.milliseconds=-c.milliseconds,c.months=-c.months),c):{milliseconds:0,months:0}}function hb(a){return 0>a?-1*Math.round(-1*a):Math.round(a)}function ib(a,b){return function(c,d){var e,f;return null===d||isNaN(+d)||(v(b,"moment()."+b+"(period, number) is deprecated. Please use moment()."+b+"(number, period)."),f=c,c=d,d=f),c="string"==typeof c?+c:c,e=db(c,d),jb(this,e,a),this}}function jb(b,c,d,e){var f=c._milliseconds,g=hb(c._days),h=hb(c._months);b.isValid()&&(e=null==e?!0:e,f&&b._d.setTime(b._d.valueOf()+f*d),g&&O(b,"Date",N(b,"Date")+g*d),h&&ga(b,N(b,"Month")+h*d),e&&a.updateOffset(b,g||h))}function kb(a,b){var c=a||Ka(),d=Sa(c,this).startOf("day"),e=this.diff(d,"days",!0),f=-6>e?"sameElse":-1>e?"lastWeek":0>e?"lastDay":1>e?"sameDay":2>e?"nextDay":7>e?"nextWeek":"sameElse",g=b&&(w(b[f])?b[f]():b[f]);return this.format(g||this.localeData().calendar(f,this,Ka(c)))}function lb(){return new o(this)}function mb(a,b){var c=p(a)?a:Ka(a);return this.isValid()&&c.isValid()?(b=K(m(b)?"millisecond":b),"millisecond"===b?this.valueOf()>c.valueOf():c.valueOf()<this.clone().startOf(b).valueOf()):!1}function nb(a,b){var c=p(a)?a:Ka(a);return this.isValid()&&c.isValid()?(b=K(m(b)?"millisecond":b),"millisecond"===b?this.valueOf()<c.valueOf():this.clone().endOf(b).valueOf()<c.valueOf()):!1}function ob(a,b,c,d){return d=d||"()",("("===d[0]?this.isAfter(a,c):!this.isBefore(a,c))&&(")"===d[1]?this.isBefore(b,c):!this.isAfter(b,c))}function pb(a,b){var c,d=p(a)?a:Ka(a);return this.isValid()&&d.isValid()?(b=K(b||"millisecond"),"millisecond"===b?this.valueOf()===d.valueOf():(c=d.valueOf(),this.clone().startOf(b).valueOf()<=c&&c<=this.clone().endOf(b).valueOf())):!1}function qb(a,b){return this.isSame(a,b)||this.isAfter(a,b)}function rb(a,b){return this.isSame(a,b)||this.isBefore(a,b)}function sb(a,b,c){var d,e,f,g;return this.isValid()?(d=Sa(a,this),d.isValid()?(e=6e4*(d.utcOffset()-this.utcOffset()),b=K(b),"year"===b||"month"===b||"quarter"===b?(g=tb(this,d),"quarter"===b?g/=3:"year"===b&&(g/=12)):(f=this-d,g="second"===b?f/1e3:"minute"===b?f/6e4:"hour"===b?f/36e5:"day"===b?(f-e)/864e5:"week"===b?(f-e)/6048e5:f),c?g:q(g)):NaN):NaN}function tb(a,b){var c,d,e=12*(b.year()-a.year())+(b.month()-a.month()),f=a.clone().add(e,"months");return 0>b-f?(c=a.clone().add(e-1,"months"),d=(b-f)/(f-c)):(c=a.clone().add(e+1,"months"),d=(b-f)/(c-f)),-(e+d)||0}function ub(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function vb(){var a=this.clone().utc();return 0<a.year()&&a.year()<=9999?w(Date.prototype.toISOString)?this.toDate().toISOString():U(a,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):U(a,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")}function wb(b){b||(b=this.isUtc()?a.defaultFormatUtc:a.defaultFormat);var c=U(this,b);return this.localeData().postformat(c)}function xb(a,b){return this.isValid()&&(p(a)&&a.isValid()||Ka(a).isValid())?db({to:this,from:a}).locale(this.locale()).humanize(!b):this.localeData().invalidDate()}function yb(a){return this.from(Ka(),a)}function zb(a,b){return this.isValid()&&(p(a)&&a.isValid()||Ka(a).isValid())?db({from:this,to:a}).locale(this.locale()).humanize(!b):this.localeData().invalidDate()}function Ab(a){return this.to(Ka(),a)}function Bb(a){var b;return void 0===a?this._locale._abbr:(b=H(a),null!=b&&(this._locale=b),this)}function Cb(){return this._locale}function Db(a){switch(a=K(a)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":case"date":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===a&&this.weekday(0),"isoWeek"===a&&this.isoWeekday(1),"quarter"===a&&this.month(3*Math.floor(this.month()/3)),this}function Eb(a){return a=K(a),void 0===a||"millisecond"===a?this:("date"===a&&(a="day"),this.startOf(a).add(1,"isoWeek"===a?"week":a).subtract(1,"ms"))}function Fb(){return this._d.valueOf()-6e4*(this._offset||0)}function Gb(){return Math.floor(this.valueOf()/1e3)}function Hb(){return this._offset?new Date(this.valueOf()):this._d}function Ib(){var a=this;return[a.year(),a.month(),a.date(),a.hour(),a.minute(),a.second(),a.millisecond()]}function Jb(){var a=this;return{years:a.year(),months:a.month(),date:a.date(),hours:a.hours(),minutes:a.minutes(),seconds:a.seconds(),milliseconds:a.milliseconds()}}function Kb(){return this.isValid()?this.toISOString():null}function Lb(){return k(this)}function Mb(){return g({},j(this))}function Nb(){return j(this).overflow}function Ob(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function Pb(a,b){R(0,[a,a.length],0,b)}function Qb(a){return Ub.call(this,a,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function Rb(a){return Ub.call(this,a,this.isoWeek(),this.isoWeekday(),1,4)}function Sb(){return xa(this.year(),1,4)}function Tb(){var a=this.localeData()._week;return xa(this.year(),a.dow,a.doy)}function Ub(a,b,c,d,e){var f;return null==a?wa(this,d,e).year:(f=xa(a,d,e),b>f&&(b=f),Vb.call(this,a,b,c,d,e))}function Vb(a,b,c,d,e){var f=va(a,b,c,d,e),g=qa(f.year,0,f.dayOfYear);return this.year(g.getUTCFullYear()),this.month(g.getUTCMonth()),this.date(g.getUTCDate()),this}function Wb(a){return null==a?Math.ceil((this.month()+1)/3):this.month(3*(a-1)+this.month()%3)}function Xb(a){return wa(a,this._week.dow,this._week.doy).week}function Yb(){return this._week.dow}function Zb(){return this._week.doy}function $b(a){var b=this.localeData().week(this);return null==a?b:this.add(7*(a-b),"d")}function _b(a){var b=wa(this,1,4).week;return null==a?b:this.add(7*(a-b),"d")}function ac(a,b){return"string"!=typeof a?a:isNaN(a)?(a=b.weekdaysParse(a),"number"==typeof a?a:null):parseInt(a,10)}function bc(a,b){return c(this._weekdays)?this._weekdays[a.day()]:this._weekdays[this._weekdays.isFormat.test(b)?"format":"standalone"][a.day()]}function cc(a){return this._weekdaysShort[a.day()]}function dc(a){return this._weekdaysMin[a.day()]}function ec(a,b,c){var d,e,f,g=a.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],d=0;7>d;++d)f=h([2e3,1]).day(d),this._minWeekdaysParse[d]=this.weekdaysMin(f,"").toLocaleLowerCase(),this._shortWeekdaysParse[d]=this.weekdaysShort(f,"").toLocaleLowerCase(),this._weekdaysParse[d]=this.weekdays(f,"").toLocaleLowerCase();return c?"dddd"===b?(e=md.call(this._weekdaysParse,g),-1!==e?e:null):"ddd"===b?(e=md.call(this._shortWeekdaysParse,g),-1!==e?e:null):(e=md.call(this._minWeekdaysParse,g),-1!==e?e:null):"dddd"===b?(e=md.call(this._weekdaysParse,g),-1!==e?e:(e=md.call(this._shortWeekdaysParse,g),-1!==e?e:(e=md.call(this._minWeekdaysParse,g),-1!==e?e:null))):"ddd"===b?(e=md.call(this._shortWeekdaysParse,g),-1!==e?e:(e=md.call(this._weekdaysParse,g),-1!==e?e:(e=md.call(this._minWeekdaysParse,g),-1!==e?e:null))):(e=md.call(this._minWeekdaysParse,g),-1!==e?e:(e=md.call(this._weekdaysParse,g),-1!==e?e:(e=md.call(this._shortWeekdaysParse,g),-1!==e?e:null)))}function fc(a,b,c){var d,e,f;if(this._weekdaysParseExact)return ec.call(this,a,b,c);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),d=0;7>d;d++){if(e=h([2e3,1]).day(d),c&&!this._fullWeekdaysParse[d]&&(this._fullWeekdaysParse[d]=new RegExp("^"+this.weekdays(e,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[d]=new RegExp("^"+this.weekdaysShort(e,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[d]=new RegExp("^"+this.weekdaysMin(e,"").replace(".",".?")+"$","i")),this._weekdaysParse[d]||(f="^"+this.weekdays(e,"")+"|^"+this.weekdaysShort(e,"")+"|^"+this.weekdaysMin(e,""),this._weekdaysParse[d]=new RegExp(f.replace(".",""),"i")),c&&"dddd"===b&&this._fullWeekdaysParse[d].test(a))return d;if(c&&"ddd"===b&&this._shortWeekdaysParse[d].test(a))return d;if(c&&"dd"===b&&this._minWeekdaysParse[d].test(a))return d;if(!c&&this._weekdaysParse[d].test(a))return d}}function gc(a){if(!this.isValid())return null!=a?this:NaN;var b=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=a?(a=ac(a,this.localeData()),this.add(a-b,"d")):b}function hc(a){if(!this.isValid())return null!=a?this:NaN;var b=(this.day()+7-this.localeData()._week.dow)%7;return null==a?b:this.add(a-b,"d")}function ic(a){return this.isValid()?null==a?this.day()||7:this.day(this.day()%7?a:a-7):null!=a?this:NaN}function jc(a){return this._weekdaysParseExact?(f(this,"_weekdaysRegex")||mc.call(this),a?this._weekdaysStrictRegex:this._weekdaysRegex):this._weekdaysStrictRegex&&a?this._weekdaysStrictRegex:this._weekdaysRegex}function kc(a){return this._weekdaysParseExact?(f(this,"_weekdaysRegex")||mc.call(this),a?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):this._weekdaysShortStrictRegex&&a?this._weekdaysShortStrictRegex:this._weekdaysShortRegex}function lc(a){return this._weekdaysParseExact?(f(this,"_weekdaysRegex")||mc.call(this),a?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):this._weekdaysMinStrictRegex&&a?this._weekdaysMinStrictRegex:this._weekdaysMinRegex}function mc(){function a(a,b){return b.length-a.length}var b,c,d,e,f,g=[],i=[],j=[],k=[];for(b=0;7>b;b++)c=h([2e3,1]).day(b),d=this.weekdaysMin(c,""),e=this.weekdaysShort(c,""),f=this.weekdays(c,""),g.push(d),i.push(e),j.push(f),k.push(d),k.push(e),k.push(f);for(g.sort(a),i.sort(a),j.sort(a),k.sort(a),b=0;7>b;b++)i[b]=Z(i[b]),j[b]=Z(j[b]),k[b]=Z(k[b]);this._weekdaysRegex=new RegExp("^("+k.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+j.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+g.join("|")+")","i")}function nc(a){var b=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==a?b:this.add(a-b,"d")}function oc(){return this.hours()%12||12}function pc(){return this.hours()||24}function qc(a,b){R(a,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),b)})}function rc(a,b){return b._meridiemParse}function sc(a){return"p"===(a+"").toLowerCase().charAt(0)}function tc(a,b,c){return a>11?c?"pm":"PM":c?"am":"AM"}function uc(a,b){b[Sd]=r(1e3*("0."+a))}function vc(){return this._isUTC?"UTC":""}function wc(){return this._isUTC?"Coordinated Universal Time":""}function xc(a){return Ka(1e3*a)}function yc(){return Ka.apply(null,arguments).parseZone()}function zc(a,b,c){var d=this._calendar[a];return w(d)?d.call(b,c):d}function Ac(a){var b=this._longDateFormat[a],c=this._longDateFormat[a.toUpperCase()];return b||!c?b:(this._longDateFormat[a]=c.replace(/MMMM|MM|DD|dddd/g,function(a){return a.slice(1)}),this._longDateFormat[a])}function Bc(){return this._invalidDate}function Cc(a){return this._ordinal.replace("%d",a)}function Dc(a){return a}function Ec(a,b,c,d){var e=this._relativeTime[c];return w(e)?e(a,b,c,d):e.replace(/%d/i,a)}function Fc(a,b){var c=this._relativeTime[a>0?"future":"past"];return w(c)?c(b):c.replace(/%s/i,b)}function Gc(a,b,c,d){var e=H(),f=h().set(d,b);return e[c](f,a)}function Hc(a,b,c){if("number"==typeof a&&(b=a,a=void 0),a=a||"",null!=b)return Gc(a,b,c,"month");var d,e=[];for(d=0;12>d;d++)e[d]=Gc(a,d,c,"month");return e}function Ic(a,b,c,d){"boolean"==typeof a?("number"==typeof b&&(c=b,b=void 0),b=b||""):(b=a,c=b,a=!1,"number"==typeof b&&(c=b,b=void 0),b=b||"");var e=H(),f=a?e._week.dow:0;if(null!=c)return Gc(b,(c+f)%7,d,"day");var g,h=[];for(g=0;7>g;g++)h[g]=Gc(b,(g+f)%7,d,"day");return h}function Jc(a,b){return Hc(a,b,"months")}function Kc(a,b){return Hc(a,b,"monthsShort")}function Lc(a,b,c){return Ic(a,b,c,"weekdays")}function Mc(a,b,c){return Ic(a,b,c,"weekdaysShort")}function Nc(a,b,c){return Ic(a,b,c,"weekdaysMin")}function Oc(){var a=this._data;return this._milliseconds=Le(this._milliseconds),this._days=Le(this._days),this._months=Le(this._months),a.milliseconds=Le(a.milliseconds),a.seconds=Le(a.seconds),a.minutes=Le(a.minutes),a.hours=Le(a.hours),a.months=Le(a.months),a.years=Le(a.years),this}function Pc(a,b,c,d){var e=db(b,c);return a._milliseconds+=d*e._milliseconds,a._days+=d*e._days,a._months+=d*e._months,a._bubble()}function Qc(a,b){return Pc(this,a,b,1)}function Rc(a,b){return Pc(this,a,b,-1)}function Sc(a){return 0>a?Math.floor(a):Math.ceil(a)}function Tc(){var a,b,c,d,e,f=this._milliseconds,g=this._days,h=this._months,i=this._data;return f>=0&&g>=0&&h>=0||0>=f&&0>=g&&0>=h||(f+=864e5*Sc(Vc(h)+g),g=0,h=0),i.milliseconds=f%1e3,a=q(f/1e3),i.seconds=a%60,b=q(a/60),i.minutes=b%60,c=q(b/60),i.hours=c%24,g+=q(c/24),e=q(Uc(g)),h+=e,g-=Sc(Vc(e)),d=q(h/12),h%=12,i.days=g,i.months=h,i.years=d,this}function Uc(a){return 4800*a/146097}function Vc(a){return 146097*a/4800}function Wc(a){var b,c,d=this._milliseconds;if(a=K(a),"month"===a||"year"===a)return b=this._days+d/864e5,c=this._months+Uc(b),"month"===a?c:c/12;switch(b=this._days+Math.round(Vc(this._months)),a){case"week":return b/7+d/6048e5;case"day":return b+d/864e5;case"hour":return 24*b+d/36e5;case"minute":return 1440*b+d/6e4;case"second":return 86400*b+d/1e3;case"millisecond":return Math.floor(864e5*b)+d;default:throw new Error("Unknown unit "+a)}}function Xc(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*r(this._months/12)}function Yc(a){return function(){return this.as(a)}}function Zc(a){return a=K(a),this[a+"s"]()}function $c(a){return function(){return this._data[a]}}function _c(){return q(this.days()/7)}function ad(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}function bd(a,b,c){var d=db(a).abs(),e=_e(d.as("s")),f=_e(d.as("m")),g=_e(d.as("h")),h=_e(d.as("d")),i=_e(d.as("M")),j=_e(d.as("y")),k=e<af.s&&["s",e]||1>=f&&["m"]||f<af.m&&["mm",f]||1>=g&&["h"]||g<af.h&&["hh",g]||1>=h&&["d"]||h<af.d&&["dd",h]||1>=i&&["M"]||i<af.M&&["MM",i]||1>=j&&["y"]||["yy",j];return k[2]=b,k[3]=+a>0,k[4]=c,ad.apply(null,k)}function cd(a,b){return void 0===af[a]?!1:void 0===b?af[a]:(af[a]=b,!0)}function dd(a){var b=this.localeData(),c=bd(this,!a,b);return a&&(c=b.pastFuture(+this,c)),b.postformat(c)}function ed(){var a,b,c,d=bf(this._milliseconds)/1e3,e=bf(this._days),f=bf(this._months);a=q(d/60),b=q(a/60),d%=60,a%=60,c=q(f/12),f%=12;var g=c,h=f,i=e,j=b,k=a,l=d,m=this.asSeconds();return m?(0>m?"-":"")+"P"+(g?g+"Y":"")+(h?h+"M":"")+(i?i+"D":"")+(j||k||l?"T":"")+(j?j+"H":"")+(k?k+"M":"")+(l?l+"S":""):"P0D"}var fd,gd;gd=Array.prototype.some?Array.prototype.some:function(a){for(var b=Object(this),c=b.length>>>0,d=0;c>d;d++)if(d in b&&a.call(this,b[d],d,b))return!0;return!1};var hd=a.momentProperties=[],id=!1,jd={};a.suppressDeprecationWarnings=!1,a.deprecationHandler=null;var kd;kd=Object.keys?Object.keys:function(a){var b,c=[];for(b in a)f(a,b)&&c.push(b);return c};var ld,md,nd={},od={},pd=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,qd=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,rd={},sd={},td=/\d/,ud=/\d\d/,vd=/\d{3}/,wd=/\d{4}/,xd=/[+-]?\d{6}/,yd=/\d\d?/,zd=/\d\d\d\d?/,Ad=/\d\d\d\d\d\d?/,Bd=/\d{1,3}/,Cd=/\d{1,4}/,Dd=/[+-]?\d{1,6}/,Ed=/\d+/,Fd=/[+-]?\d+/,Gd=/Z|[+-]\d\d:?\d\d/gi,Hd=/Z|[+-]\d\d(?::?\d\d)?/gi,Id=/[+-]?\d+(\.\d{1,3})?/,Jd=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,Kd={},Ld={},Md=0,Nd=1,Od=2,Pd=3,Qd=4,Rd=5,Sd=6,Td=7,Ud=8;md=Array.prototype.indexOf?Array.prototype.indexOf:function(a){var b;for(b=0;b<this.length;++b)if(this[b]===a)return b;return-1},R("M",["MM",2],"Mo",function(){return this.month()+1}),R("MMM",0,0,function(a){return this.localeData().monthsShort(this,a)}),R("MMMM",0,0,function(a){return this.localeData().months(this,a)}),J("month","M"),W("M",yd),W("MM",yd,ud),W("MMM",function(a,b){return b.monthsShortRegex(a)}),W("MMMM",function(a,b){return b.monthsRegex(a)}),$(["M","MM"],function(a,b){b[Nd]=r(a)-1}),$(["MMM","MMMM"],function(a,b,c,d){var e=c._locale.monthsParse(a,d,c._strict);null!=e?b[Nd]=e:j(c).invalidMonth=a});var Vd=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/,Wd="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Xd="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Yd=Jd,Zd=Jd,$d=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,_d=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,ae=/Z|[+-]\d\d(?::?\d\d)?/,be=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],ce=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],de=/^\/?Date\((\-?\d+)/i;a.createFromInputFallback=u("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(a){a._d=new Date(a._i+(a._useUTC?" UTC":""))}),R("Y",0,0,function(){var a=this.year();return 9999>=a?""+a:"+"+a}),R(0,["YY",2],0,function(){return this.year()%100}),R(0,["YYYY",4],0,"year"),R(0,["YYYYY",5],0,"year"),R(0,["YYYYYY",6,!0],0,"year"),J("year","y"),W("Y",Fd),W("YY",yd,ud),W("YYYY",Cd,wd),W("YYYYY",Dd,xd),W("YYYYYY",Dd,xd),$(["YYYYY","YYYYYY"],Md),$("YYYY",function(b,c){c[Md]=2===b.length?a.parseTwoDigitYear(b):r(b)}),$("YY",function(b,c){c[Md]=a.parseTwoDigitYear(b)}),$("Y",function(a,b){b[Md]=parseInt(a,10)}),a.parseTwoDigitYear=function(a){return r(a)+(r(a)>68?1900:2e3)};var ee=M("FullYear",!0);a.ISO_8601=function(){};var fe=u("moment().min is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var a=Ka.apply(null,arguments);return this.isValid()&&a.isValid()?this>a?this:a:l()}),ge=u("moment().max is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var a=Ka.apply(null,arguments);return this.isValid()&&a.isValid()?a>this?this:a:l()}),he=function(){return Date.now?Date.now():+new Date};Qa("Z",":"),Qa("ZZ",""),W("Z",Hd),W("ZZ",Hd),$(["Z","ZZ"],function(a,b,c){c._useUTC=!0,c._tzm=Ra(Hd,a)});var ie=/([\+\-]|\d\d)/gi;a.updateOffset=function(){};var je=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?\d*)?$/,ke=/^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;db.fn=Oa.prototype;var le=ib(1,"add"),me=ib(-1,"subtract");a.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",a.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var ne=u("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(a){return void 0===a?this.localeData():this.locale(a)});R(0,["gg",2],0,function(){return this.weekYear()%100}),R(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Pb("gggg","weekYear"),Pb("ggggg","weekYear"),Pb("GGGG","isoWeekYear"),Pb("GGGGG","isoWeekYear"),J("weekYear","gg"),J("isoWeekYear","GG"),W("G",Fd),W("g",Fd),W("GG",yd,ud),W("gg",yd,ud),W("GGGG",Cd,wd),W("gggg",Cd,wd),W("GGGGG",Dd,xd),W("ggggg",Dd,xd),_(["gggg","ggggg","GGGG","GGGGG"],function(a,b,c,d){b[d.substr(0,2)]=r(a)}),_(["gg","GG"],function(b,c,d,e){c[e]=a.parseTwoDigitYear(b)}),R("Q",0,"Qo","quarter"),J("quarter","Q"),W("Q",td),$("Q",function(a,b){b[Nd]=3*(r(a)-1)}),R("w",["ww",2],"wo","week"),R("W",["WW",2],"Wo","isoWeek"),J("week","w"),J("isoWeek","W"),W("w",yd),W("ww",yd,ud),W("W",yd),W("WW",yd,ud),_(["w","ww","W","WW"],function(a,b,c,d){b[d.substr(0,1)]=r(a)});var oe={dow:0,doy:6};R("D",["DD",2],"Do","date"),J("date","D"),W("D",yd),W("DD",yd,ud),W("Do",function(a,b){return a?b._ordinalParse:b._ordinalParseLenient}),$(["D","DD"],Od),$("Do",function(a,b){b[Od]=r(a.match(yd)[0],10)});var pe=M("Date",!0);R("d",0,"do","day"),R("dd",0,0,function(a){return this.localeData().weekdaysMin(this,a)}),R("ddd",0,0,function(a){return this.localeData().weekdaysShort(this,a)}),R("dddd",0,0,function(a){return this.localeData().weekdays(this,a)}),R("e",0,0,"weekday"),R("E",0,0,"isoWeekday"),J("day","d"),J("weekday","e"),J("isoWeekday","E"),W("d",yd),W("e",yd),W("E",yd),W("dd",function(a,b){return b.weekdaysMinRegex(a)}),W("ddd",function(a,b){return b.weekdaysShortRegex(a)}),W("dddd",function(a,b){return b.weekdaysRegex(a)}),_(["dd","ddd","dddd"],function(a,b,c,d){var e=c._locale.weekdaysParse(a,d,c._strict);null!=e?b.d=e:j(c).invalidWeekday=a}),_(["d","e","E"],function(a,b,c,d){b[d]=r(a)});var qe="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),re="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),se="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),te=Jd,ue=Jd,ve=Jd;R("DDD",["DDDD",3],"DDDo","dayOfYear"),J("dayOfYear","DDD"),W("DDD",Bd),W("DDDD",vd),$(["DDD","DDDD"],function(a,b,c){c._dayOfYear=r(a)}),R("H",["HH",2],0,"hour"),R("h",["hh",2],0,oc),R("k",["kk",2],0,pc),R("hmm",0,0,function(){return""+oc.apply(this)+Q(this.minutes(),2)}
1923),R("hmmss",0,0,function(){return""+oc.apply(this)+Q(this.minutes(),2)+Q(this.seconds(),2)}),R("Hmm",0,0,function(){return""+this.hours()+Q(this.minutes(),2)}),R("Hmmss",0,0,function(){return""+this.hours()+Q(this.minutes(),2)+Q(this.seconds(),2)}),qc("a",!0),qc("A",!1),J("hour","h"),W("a",rc),W("A",rc),W("H",yd),W("h",yd),W("HH",yd,ud),W("hh",yd,ud),W("hmm",zd),W("hmmss",Ad),W("Hmm",zd),W("Hmmss",Ad),$(["H","HH"],Pd),$(["a","A"],function(a,b,c){c._isPm=c._locale.isPM(a),c._meridiem=a}),$(["h","hh"],function(a,b,c){b[Pd]=r(a),j(c).bigHour=!0}),$("hmm",function(a,b,c){var d=a.length-2;b[Pd]=r(a.substr(0,d)),b[Qd]=r(a.substr(d)),j(c).bigHour=!0}),$("hmmss",function(a,b,c){var d=a.length-4,e=a.length-2;b[Pd]=r(a.substr(0,d)),b[Qd]=r(a.substr(d,2)),b[Rd]=r(a.substr(e)),j(c).bigHour=!0}),$("Hmm",function(a,b,c){var d=a.length-2;b[Pd]=r(a.substr(0,d)),b[Qd]=r(a.substr(d))}),$("Hmmss",function(a,b,c){var d=a.length-4,e=a.length-2;b[Pd]=r(a.substr(0,d)),b[Qd]=r(a.substr(d,2)),b[Rd]=r(a.substr(e))});var we=/[ap]\.?m?\.?/i,xe=M("Hours",!0);R("m",["mm",2],0,"minute"),J("minute","m"),W("m",yd),W("mm",yd,ud),$(["m","mm"],Qd);var ye=M("Minutes",!1);R("s",["ss",2],0,"second"),J("second","s"),W("s",yd),W("ss",yd,ud),$(["s","ss"],Rd);var ze=M("Seconds",!1);R("S",0,0,function(){return~~(this.millisecond()/100)}),R(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),R(0,["SSS",3],0,"millisecond"),R(0,["SSSS",4],0,function(){return 10*this.millisecond()}),R(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),R(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),R(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),R(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),R(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),J("millisecond","ms"),W("S",Bd,td),W("SS",Bd,ud),W("SSS",Bd,vd);var Ae;for(Ae="SSSS";Ae.length<=9;Ae+="S")W(Ae,Ed);for(Ae="S";Ae.length<=9;Ae+="S")$(Ae,uc);var Be=M("Milliseconds",!1);R("z",0,0,"zoneAbbr"),R("zz",0,0,"zoneName");var Ce=o.prototype;Ce.add=le,Ce.calendar=kb,Ce.clone=lb,Ce.diff=sb,Ce.endOf=Eb,Ce.format=wb,Ce.from=xb,Ce.fromNow=yb,Ce.to=zb,Ce.toNow=Ab,Ce.get=P,Ce.invalidAt=Nb,Ce.isAfter=mb,Ce.isBefore=nb,Ce.isBetween=ob,Ce.isSame=pb,Ce.isSameOrAfter=qb,Ce.isSameOrBefore=rb,Ce.isValid=Lb,Ce.lang=ne,Ce.locale=Bb,Ce.localeData=Cb,Ce.max=ge,Ce.min=fe,Ce.parsingFlags=Mb,Ce.set=P,Ce.startOf=Db,Ce.subtract=me,Ce.toArray=Ib,Ce.toObject=Jb,Ce.toDate=Hb,Ce.toISOString=vb,Ce.toJSON=Kb,Ce.toString=ub,Ce.unix=Gb,Ce.valueOf=Fb,Ce.creationData=Ob,Ce.year=ee,Ce.isLeapYear=ta,Ce.weekYear=Qb,Ce.isoWeekYear=Rb,Ce.quarter=Ce.quarters=Wb,Ce.month=ha,Ce.daysInMonth=ia,Ce.week=Ce.weeks=$b,Ce.isoWeek=Ce.isoWeeks=_b,Ce.weeksInYear=Tb,Ce.isoWeeksInYear=Sb,Ce.date=pe,Ce.day=Ce.days=gc,Ce.weekday=hc,Ce.isoWeekday=ic,Ce.dayOfYear=nc,Ce.hour=Ce.hours=xe,Ce.minute=Ce.minutes=ye,Ce.second=Ce.seconds=ze,Ce.millisecond=Ce.milliseconds=Be,Ce.utcOffset=Ua,Ce.utc=Wa,Ce.local=Xa,Ce.parseZone=Ya,Ce.hasAlignedHourOffset=Za,Ce.isDST=$a,Ce.isDSTShifted=_a,Ce.isLocal=ab,Ce.isUtcOffset=bb,Ce.isUtc=cb,Ce.isUTC=cb,Ce.zoneAbbr=vc,Ce.zoneName=wc,Ce.dates=u("dates accessor is deprecated. Use date instead.",pe),Ce.months=u("months accessor is deprecated. Use month instead",ha),Ce.years=u("years accessor is deprecated. Use year instead",ee),Ce.zone=u("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",Va);var De=Ce,Ee={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},Fe={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},Ge="Invalid date",He="%d",Ie=/\d{1,2}/,Je={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},Ke=A.prototype;Ke._calendar=Ee,Ke.calendar=zc,Ke._longDateFormat=Fe,Ke.longDateFormat=Ac,Ke._invalidDate=Ge,Ke.invalidDate=Bc,Ke._ordinal=He,Ke.ordinal=Cc,Ke._ordinalParse=Ie,Ke.preparse=Dc,Ke.postformat=Dc,Ke._relativeTime=Je,Ke.relativeTime=Ec,Ke.pastFuture=Fc,Ke.set=y,Ke.months=ca,Ke._months=Wd,Ke.monthsShort=da,Ke._monthsShort=Xd,Ke.monthsParse=fa,Ke._monthsRegex=Zd,Ke.monthsRegex=ka,Ke._monthsShortRegex=Yd,Ke.monthsShortRegex=ja,Ke.week=Xb,Ke._week=oe,Ke.firstDayOfYear=Zb,Ke.firstDayOfWeek=Yb,Ke.weekdays=bc,Ke._weekdays=qe,Ke.weekdaysMin=dc,Ke._weekdaysMin=se,Ke.weekdaysShort=cc,Ke._weekdaysShort=re,Ke.weekdaysParse=fc,Ke._weekdaysRegex=te,Ke.weekdaysRegex=jc,Ke._weekdaysShortRegex=ue,Ke.weekdaysShortRegex=kc,Ke._weekdaysMinRegex=ve,Ke.weekdaysMinRegex=lc,Ke.isPM=sc,Ke._meridiemParse=we,Ke.meridiem=tc,E("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(a){var b=a%10,c=1===r(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c}}),a.lang=u("moment.lang is deprecated. Use moment.locale instead.",E),a.langData=u("moment.langData is deprecated. Use moment.localeData instead.",H);var Le=Math.abs,Me=Yc("ms"),Ne=Yc("s"),Oe=Yc("m"),Pe=Yc("h"),Qe=Yc("d"),Re=Yc("w"),Se=Yc("M"),Te=Yc("y"),Ue=$c("milliseconds"),Ve=$c("seconds"),We=$c("minutes"),Xe=$c("hours"),Ye=$c("days"),Ze=$c("months"),$e=$c("years"),_e=Math.round,af={s:45,m:45,h:22,d:26,M:11},bf=Math.abs,cf=Oa.prototype;cf.abs=Oc,cf.add=Qc,cf.subtract=Rc,cf.as=Wc,cf.asMilliseconds=Me,cf.asSeconds=Ne,cf.asMinutes=Oe,cf.asHours=Pe,cf.asDays=Qe,cf.asWeeks=Re,cf.asMonths=Se,cf.asYears=Te,cf.valueOf=Xc,cf._bubble=Tc,cf.get=Zc,cf.milliseconds=Ue,cf.seconds=Ve,cf.minutes=We,cf.hours=Xe,cf.days=Ye,cf.weeks=_c,cf.months=Ze,cf.years=$e,cf.humanize=dd,cf.toISOString=ed,cf.toString=ed,cf.toJSON=ed,cf.locale=Bb,cf.localeData=Cb,cf.toIsoString=u("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ed),cf.lang=ne,R("X",0,0,"unix"),R("x",0,0,"valueOf"),W("x",Fd),W("X",Id),$("X",function(a,b,c){c._d=new Date(1e3*parseFloat(a,10))}),$("x",function(a,b,c){c._d=new Date(r(a))}),a.version="2.13.0",b(Ka),a.fn=De,a.min=Ma,a.max=Na,a.now=he,a.utc=h,a.unix=xc,a.months=Jc,a.isDate=d,a.locale=E,a.invalid=l,a.duration=db,a.isMoment=p,a.weekdays=Lc,a.parseZone=yc,a.localeData=H,a.isDuration=Pa,a.monthsShort=Kc,a.weekdaysMin=Nc,a.defineLocale=F,a.updateLocale=G,a.locales=I,a.weekdaysShort=Mc,a.normalizeUnits=K,a.relativeTimeThreshold=cd,a.prototype=De;var df=a;return df});(function(root,factory){if(typeof define==='function'&&define.amd){define(['moment','jquery'],function(moment,jquery){if(!jquery.fn)jquery.fn={};return(root.daterangepicker=factory(moment,jquery));});}else if(typeof module==='object'&&module.exports){var jQuery=(typeof window!='undefined')?window.jQuery:undefined;if(!jQuery){jQuery=require('jquery');if(!jQuery.fn)jQuery.fn={};} 1924var moment=(typeof window!='undefined'&&typeof window.moment!='undefined')?window.moment:require('moment');module.exports=factory(moment,jQuery);}else{root.daterangepicker=factory(root.moment,root.jQuery);}}(this,function(moment,$){var DateRangePicker=function(element,options,cb){this.parentEl='body';this.element=$(element);this.startDate=moment().startOf('day');this.endDate=moment().endOf('day');this.minDate=false;this.maxDate=false;this.dateLimit=false;this.autoApply=false;this.singleDatePicker=false;this.showDropdowns=false;this.showWeekNumbers=false;this.showISOWeekNumbers=false;this.showCustomRangeLabel=true;this.timePicker=false;this.timePicker24Hour=false;this.timePickerIncrement=1;this.timePickerSeconds=false;this.linkedCalendars=true;this.autoUpdateInput=true;this.alwaysShowCalendars=false;this.ranges={};this.opens='right';if(this.element.hasClass('pull-right')) 1925this.opens='left';this.drops='down';if(this.element.hasClass('dropup')) 1926this.drops='up';
vendor: 4,420 bytes, lines 1926-1955
1926this.buttonClasses='btn btn-sm';this.applyClass='btn-success';this.cancelClass='btn-default';this.locale={direction:'ltr',format:moment.localeData().longDateFormat('L'),separator:' - ',applyLabel:'Apply',cancelLabel:'Cancel',weekLabel:'W',customRangeLabel:'Custom Range',daysOfWeek:moment.weekdaysMin(),monthNames:moment.monthsShort(),firstDay:moment.localeData().firstDayOfWeek()};this.callback=function(){};this.isShowing=false;this.leftCalendar={};this.rightCalendar={};if(typeof options!=='object'||options===null) 1927options={};options=$.extend(this.element.data(),options);if(typeof options.template!=='string'&&!(options.template instanceof $)) 1928options.template='<div class="daterangepicker dropdown-menu">'+'<div class="calendar left">'+'<div class="daterangepicker_input">'+'<input class="input-mini form-control" type="text" name="daterangepicker_start" value="" />'+'<i class="fa fa-calendar glyphicon glyphicon-calendar"></i>'+'<div class="calendar-time">'+'<div></div>'+'<i class="fa fa-clock-o glyphicon glyphicon-time"></i>'+'</div>'+'</div>'+'<div class="calendar-table"></div>'+'</div>'+'<div class="calendar right">'+'<div class="daterangepicker_input">'+'<input class="input-mini form-control" type="text" name="daterangepicker_end" value="" />'+'<i class="fa fa-calendar glyphicon glyphicon-calendar"></i>'+'<div class="calendar-time">'+'<div></div>'+'<i class="fa fa-clock-o glyphicon glyphicon-time"></i>'+'</div>'+'</div>'+'<div class="calendar-table"></div>'+'</div>'+'<div class="ranges">'+'<div class="range_inputs">'+'<button class="applyBtn" disabled="disabled" type="button"></button> '+'<button class="cancelBtn" type="button"></button>'+'</div>'+'</div>'+'</div>';this.parentEl=(options.parentEl&&$(options.parentEl).length)?$(options.parentEl):$(this.parentEl);this.container=$(options.template).appendTo(this.parentEl);if(typeof options.locale==='object'){if(typeof options.locale.direction==='string') 1929this.locale.direction=options.locale.direction;if(typeof options.locale.format==='string') 1930this.locale.format=options.locale.format;if(typeof options.locale.separator==='string') 1931this.locale.separator=options.locale.separator;if(typeof options.locale.daysOfWeek==='object') 1932this.locale.daysOfWeek=options.locale.daysOfWeek.slice();if(typeof options.locale.monthNames==='object') 1933this.locale.monthNames=options.locale.monthNames.slice();if(typeof options.locale.firstDay==='number') 1934this.locale.firstDay=options.locale.firstDay;if(typeof options.locale.applyLabel==='string') 1935this.locale.applyLabel=options.locale.applyLabel;if(typeof options.locale.cancelLabel==='string') 1936this.locale.cancelLabel=options.locale.cancelLabel;if(typeof options.locale.weekLabel==='string') 1937this.locale.weekLabel=options.locale.weekLabel;if(typeof options.locale.customRangeLabel==='string'){var elem=document.createElement('textarea');elem.innerHTML=options.locale.customRangeLabel;var rangeHtml=elem.value;this.locale.customRangeLabel=rangeHtml;}} 1938this.container.addClass(this.locale.direction);if(typeof options.startDate==='string') 1939this.startDate=moment(options.startDate,this.locale.format);if(typeof options.endDate==='string') 1940this.endDate=moment(options.endDate,this.locale.format);if(typeof options.minDate==='string') 1941this.minDate=moment(options.minDate,this.locale.format);if(typeof options.maxDate==='string') 1942this.maxDate=moment(options.maxDate,this.locale.format);if(typeof options.startDate==='object') 1943this.startDate=moment(options.startDate);if(typeof options.endDate==='object') 1944this.endDate=moment(options.endDate);if(typeof options.minDate==='object') 1945this.minDate=moment(options.minDate);if(typeof options.maxDate==='object') 1946this.maxDate=moment(options.maxDate);if(this.minDate&&this.startDate.isBefore(this.minDate)) 1947this.startDate=this.minDate.clone();if(this.maxDate&&this.endDate.isAfter(this.maxDate)) 1948this.endDate=this.maxDate.clone();if(typeof options.applyClass==='string') 1949this.applyClass=options.applyClass;if(typeof options.cancelClass==='string') 1950this.cancelClass=options.cancelClass;if(typeof options.dateLimit==='object') 1951this.dateLimit=options.dateLimit;if(typeof options.opens==='string') 1952this.opens=options.opens;if(typeof options.drops==='string') 1953this.drops=options.drops;if(typeof options.showWeekNumbers==='boolean') 1954this.showWeekNumbers=options.showWeekNumbers;if(typeof options.showISOWeekNumbers==='boolean') 1955this.showISOWeekNumbers=options.showISOWeekNumbers;
1955if(typeof options.buttonClasses==='string') 1956this.buttonClasses=options.buttonClasses;if(typeof options.buttonClasses==='object') 1957this.buttonClasses=options.buttonClasses.join(' ');if(typeof options.showDropdowns==='boolean') 1958this.showDropdowns=options.showDropdowns;if(typeof options.showCustomRangeLabel==='boolean') 1959this.showCustomRangeLabel=options.showCustomRangeLabel;if(typeof options.singleDatePicker==='boolean'){this.singleDatePicker=options.singleDatePicker;if(this.singleDatePicker) 1960this.endDate=this.startDate.clone();} 1961if(typeof options.timePicker==='boolean') 1962this.timePicker=options.timePicker;if(typeof options.timePickerSeconds==='boolean') 1963this.timePickerSeconds=options.timePickerSeconds;if(typeof options.timePickerIncrement==='number') 1964this.timePickerIncrement=options.timePickerIncrement;if(typeof options.timePicker24Hour==='boolean') 1965this.timePicker24Hour=options.timePicker24Hour;if(typeof options.autoApply==='boolean') 1966this.autoApply=options.autoApply;if(typeof options.autoUpdateInput==='boolean') 1967this.autoUpdateInput=options.autoUpdateInput;if(typeof options.linkedCalendars==='boolean') 1968this.linkedCalendars=options.linkedCalendars;if(typeof options.isInvalidDate==='function') 1969this.isInvalidDate=options.isInvalidDate;if(typeof options.isCustomDate==='function')
vendor: 21,513 bytes, lines 1970-2087
1970this.isCustomDate=options.isCustomDate;if(typeof options.alwaysShowCalendars==='boolean') 1971this.alwaysShowCalendars=options.alwaysShowCalendars;if(this.locale.firstDay!=0){var iterator=this.locale.firstDay;while(iterator>0){this.locale.daysOfWeek.push(this.locale.daysOfWeek.shift());iterator--;}} 1972var start,end,range;if(typeof options.startDate==='undefined'&&typeof options.endDate==='undefined'){if($(this.element).is('input[type=text]')){var val=$(this.element).val(),split=val.split(this.locale.separator);start=end=null;if(split.length==2){start=moment(split[0],this.locale.format);end=moment(split[1],this.locale.format);}else if(this.singleDatePicker&&val!==""){start=moment(val,this.locale.format);end=moment(val,this.locale.format);} 1973if(start!==null&&end!==null){this.setStartDate(start);this.setEndDate(end);}}} 1974if(typeof options.ranges==='object'){for(range in options.ranges){if(typeof options.ranges[range][0]==='string') 1975start=moment(options.ranges[range][0],this.locale.format);else 1976start=moment(options.ranges[range][0]);if(typeof options.ranges[range][1]==='string') 1977end=moment(options.ranges[range][1],this.locale.format);else 1978end=moment(options.ranges[range][1]);if(this.minDate&&start.isBefore(this.minDate)) 1979start=this.minDate.clone();var maxDate=this.maxDate;if(this.dateLimit&&maxDate&&start.clone().add(this.dateLimit).isAfter(maxDate)) 1980maxDate=start.clone().add(this.dateLimit);if(maxDate&&end.isAfter(maxDate)) 1981end=maxDate.clone();if((this.minDate&&end.isBefore(this.minDate,this.timepicker?'minute':'day'))||(maxDate&&start.isAfter(maxDate,this.timepicker?'minute':'day'))) 1982continue;var elem=document.createElement('textarea');elem.innerHTML=range;var rangeHtml=elem.value;this.ranges[rangeHtml]=[start,end];} 1983var list='<ul>';for(range in this.ranges){list+='<li data-range-key="'+range+'">'+range+'</li>';} 1984if(this.showCustomRangeLabel){list+='<li data-range-key="'+this.locale.customRangeLabel+'">'+this.locale.customRangeLabel+'</li>';} 1985list+='</ul>';this.container.find('.ranges').prepend(list);} 1986if(typeof cb==='function'){this.callback=cb;} 1987if(!this.timePicker){this.startDate=this.startDate.startOf('day');this.endDate=this.endDate.endOf('day');this.container.find('.calendar-time').hide();} 1988if(this.timePicker&&this.autoApply) 1989this.autoApply=false;if(this.autoApply&&typeof options.ranges!=='object'){this.container.find('.ranges').hide();}else if(this.autoApply){this.container.find('.applyBtn, .cancelBtn').addClass('hide');} 1990if(this.singleDatePicker){this.container.addClass('single');this.container.find('.calendar.left').addClass('single');this.container.find('.calendar.left').show();this.container.find('.calendar.right').hide();this.container.find('.daterangepicker_input input, .daterangepicker_input > i').hide();if(this.timePicker){this.container.find('.ranges ul').hide();}else{this.container.find('.ranges').hide();}} 1991if((typeof options.ranges==='undefined'&&!this.singleDatePicker)||this.alwaysShowCalendars){this.container.addClass('show-calendar');} 1992this.container.addClass('opens'+this.opens);if(typeof options.ranges!=='undefined'&&this.opens=='right'){this.container.find('.ranges').prependTo(this.container.find('.calendar.left').parent());} 1993this.container.find('.applyBtn, .cancelBtn').addClass(this.buttonClasses);if(this.applyClass.length) 1994this.container.find('.applyBtn').addClass(this.applyClass);if(this.cancelClass.length) 1995this.container.find('.cancelBtn').addClass(this.cancelClass);this.container.find('.applyBtn').html(this.locale.applyLabel);this.container.find('.cancelBtn').html(this.locale.cancelLabel);this.container.find('.calendar').on('click.daterangepicker','.prev',$.proxy(this.clickPrev,this)).on('click.daterangepicker','.next',$.proxy(this.clickNext,this)).on('mousedown.daterangepicker','td.available',$.proxy(this.clickDate,this)).on('mouseenter.daterangepicker','td.available',$.proxy(this.hoverDate,this)).on('mouseleave.daterangepicker','td.available',$.proxy(this.updateFormInputs,this)).on('change.daterangepicker','select.yearselect',$.proxy(this.monthOrYearChanged,this)).on('change.daterangepicker','select.monthselect',$.proxy(this.monthOrYearChanged,this)).on('change.daterangepicker','select.hourselect,select.minuteselect,select.secondselect,select.ampmselect',$.proxy(this.timeChanged,this)).on('click.daterangepicker','.daterangepicker_input input',$.proxy(this.showCalendars,this)).on('focus.daterangepicker','.daterangepicker_input input',$.proxy(this.formInputsFocused,this)).on('blur.daterangepicker','.daterangepicker_input input',$.proxy(this.formInputsBlurred,this)).on('change.daterangepicker','.daterangepicker_input input',$.proxy(this.formInputsChanged,this));this.container.find('.ranges').on('click.daterangepicker','button.applyBtn',$.proxy(this.clickApply,this)).on('click.daterangepicker','button.cancelBtn',$.proxy(this.clickCancel,this)).on('click.daterangepicker','li',$.proxy(this.clickRange,this)).on('mouseenter.daterangepicker','li',$.proxy(this.hoverRange,this)).on('mouseleave.daterangepicker','li',$.proxy(this.updateFormInputs,this));if(this.element.is('input')||this.element.is('button')){this.element.on({'click.daterangepicker':$.proxy(this.show,this),'focus.daterangepicker':$.proxy(this.show,this),'keyup.daterangepicker':$.proxy(this.elementChanged,this),'keydown.daterangepicker':$.proxy(this.keydown,this)});}else{this.element.on('click.daterangepicker',$.proxy(this.toggle,this));} 1996if(this.element.is('input')&&!this.singleDatePicker&&this.autoUpdateInput){this.element.val(this.startDate.format(this.locale.format)+this.locale.separator+this.endDate.format(this.locale.format));this.element.trigger('change');}else if(this.element.is('input')&&this.autoUpdateInput){this.element.val(this.startDate.format(this.locale.format));this.element.trigger('change');}};DateRangePicker.prototype={constructor:DateRangePicker,setStartDate:function(startDate){if(typeof startDate==='string') 1997this.startDate=moment(startDate,this.locale.format);if(typeof startDate==='object') 1998this.startDate=moment(startDate);if(!this.timePicker) 1999this.startDate=this.startDate.startOf('day');if(this.timePicker&&this.timePickerIncrement) 2000this.startDate.minute(Math.round(this.startDate.minute()/this.timePickerIncrement)*this.timePickerIncrement);if(this.minDate&&this.startDate.isBefore(this.minDate)){this.startDate=this.minDate.clone();if(this.timePicker&&this.timePickerIncrement) 2001this.startDate.minute(Math.round(this.startDate.minute()/this.timePickerIncrement)*this.timePickerIncrement);} 2002if(this.maxDate&&this.startDate.isAfter(this.maxDate)){this.startDate=this.maxDate.clone();if(this.timePicker&&this.timePickerIncrement) 2003this.startDate.minute(Math.floor(this.startDate.minute()/this.timePickerIncrement)*this.timePickerIncrement);} 2004if(!this.isShowing) 2005this.updateElement();this.updateMonthsInView();},setEndDate:function(endDate){if(typeof endDate==='string') 2006this.endDate=moment(endDate,this.locale.format);if(typeof endDate==='object') 2007this.endDate=moment(endDate);if(!this.timePicker) 2008this.endDate=this.endDate.endOf('day');if(this.timePicker&&this.timePickerIncrement) 2009this.endDate.minute(Math.round(this.endDate.minute()/this.timePickerIncrement)*this.timePickerIncrement);if(this.endDate.isBefore(this.startDate)) 2010this.endDate=this.startDate.clone();if(this.maxDate&&this.endDate.isAfter(this.maxDate)) 2011this.endDate=this.maxDate.clone();if(this.dateLimit&&this.startDate.clone().add(this.dateLimit).isBefore(this.endDate)) 2012this.endDate=this.startDate.clone().add(this.dateLimit);this.previousRightTime=this.endDate.clone();if(!this.isShowing) 2013this.updateElement();this.updateMonthsInView();},isInvalidDate:function(){return false;},isCustomDate:function(){return false;},updateView:function(){if(this.timePicker){this.renderTimePicker('left');this.renderTimePicker('right');if(!this.endDate){this.container.find('.right .calendar-time select').attr('disabled','disabled').addClass('disabled');}else{this.container.find('.right .calendar-time select').removeAttr('disabled').removeClass('disabled');}} 2014if(this.endDate){this.container.find('input[name="daterangepicker_end"]').removeClass('active');this.container.find('input[name="daterangepicker_start"]').addClass('active');}else{this.container.find('input[name="daterangepicker_end"]').addClass('active');this.container.find('input[name="daterangepicker_start"]').removeClass('active');} 2015this.updateMonthsInView();this.updateCalendars();this.updateFormInputs();},updateMonthsInView:function(){if(this.endDate){if(!this.singleDatePicker&&this.leftCalendar.month&&this.rightCalendar.month&&(this.startDate.format('YYYY-MM')==this.leftCalendar.month.format('YYYY-MM')||this.startDate.format('YYYY-MM')==this.rightCalendar.month.format('YYYY-MM'))&&(this.endDate.format('YYYY-MM')==this.leftCalendar.month.format('YYYY-MM')||this.endDate.format('YYYY-MM')==this.rightCalendar.month.format('YYYY-MM'))){return;} 2016this.leftCalendar.month=this.startDate.clone().date(2);if(!this.linkedCalendars&&(this.endDate.month()!=this.startDate.month()||this.endDate.year()!=this.startDate.year())){this.rightCalendar.month=this.endDate.clone().date(2);}else{this.rightCalendar.month=this.startDate.clone().date(2).add(1,'month');}}else{if(this.leftCalendar.month.format('YYYY-MM')!=this.startDate.format('YYYY-MM')&&this.rightCalendar.month.format('YYYY-MM')!=this.startDate.format('YYYY-MM')){this.leftCalendar.month=this.startDate.clone().date(2);this.rightCalendar.month=this.startDate.clone().date(2).add(1,'month');}} 2017if(this.maxDate&&this.linkedCalendars&&!this.singleDatePicker&&this.rightCalendar.month>this.maxDate){this.rightCalendar.month=this.maxDate.clone().date(2);this.leftCalendar.month=this.maxDate.clone().date(2).subtract(1,'month');}},updateCalendars:function(){if(this.timePicker){var hour,minute,second;if(this.endDate){hour=parseInt(this.container.find('.left .hourselect').val(),10);minute=parseInt(this.container.find('.left .minuteselect').val(),10);second=this.timePickerSeconds?parseInt(this.container.find('.left .secondselect').val(),10):0;if(!this.timePicker24Hour){var ampm=this.container.find('.left .ampmselect').val();if(ampm==='PM'&&hour<12) 2018hour+=12;if(ampm==='AM'&&hour===12) 2019hour=0;}}else{hour=parseInt(this.container.find('.right .hourselect').val(),10);minute=parseInt(this.container.find('.right .minuteselect').val(),10);second=this.timePickerSeconds?parseInt(this.container.find('.right .secondselect').val(),10):0;if(!this.timePicker24Hour){var ampm=this.container.find('.right .ampmselect').val();if(ampm==='PM'&&hour<12) 2020hour+=12;if(ampm==='AM'&&hour===12) 2021hour=0;}} 2022this.leftCalendar.month.hour(hour).minute(minute).second(second);this.rightCalendar.month.hour(hour).minute(minute).second(second);} 2023this.renderCalendar('left');this.renderCalendar('right');this.container.find('.ranges li').removeClass('active');if(this.endDate==null)return;this.calculateChosenLabel();},renderCalendar:function(side){var calendar=side=='left'?this.leftCalendar:this.rightCalendar;var month=calendar.month.month();var year=calendar.month.year();var hour=calendar.month.hour();var minute=calendar.month.minute();var second=calendar.month.second();var daysInMonth=moment([year,month]).daysInMonth();var firstDay=moment([year,month,1]);var lastDay=moment([year,month,daysInMonth]);var lastMonth=moment(firstDay).subtract(1,'month').month();var lastYear=moment(firstDay).subtract(1,'month').year();var daysInLastMonth=moment([lastYear,lastMonth]).daysInMonth();var dayOfWeek=firstDay.day();var calendar=[];calendar.firstDay=firstDay;calendar.lastDay=lastDay;for(var i=0;i<6;i++){calendar[i]=[];} 2024var startDay=daysInLastMonth-dayOfWeek+this.locale.firstDay+1;if(startDay>daysInLastMonth) 2025startDay-=7;if(dayOfWeek==this.locale.firstDay) 2026startDay=daysInLastMonth-6;var curDate=moment([lastYear,lastMonth,startDay,12,minute,second]);var col,row;for(var i=0,col=0,row=0;i<42;i++,col++,curDate=moment(curDate).add(24,'hour')){if(i>0&&col%7===0){col=0;row++;} 2027calendar[row][col]=curDate.clone().hour(hour).minute(minute).second(second);curDate.hour(12);if(this.minDate&&calendar[row][col].format('YYYY-MM-DD')==this.minDate.format('YYYY-MM-DD')&&calendar[row][col].isBefore(this.minDate)&&side=='left'){calendar[row][col]=this.minDate.clone();} 2028if(this.maxDate&&calendar[row][col].format('YYYY-MM-DD')==this.maxDate.format('YYYY-MM-DD')&&calendar[row][col].isAfter(this.maxDate)&&side=='right'){calendar[row][col]=this.maxDate.clone();}} 2029if(side=='left'){this.leftCalendar.calendar=calendar;}else{this.rightCalendar.calendar=calendar;} 2030var minDate=side=='left'?this.minDate:this.startDate;var maxDate=this.maxDate;var selected=side=='left'?this.startDate:this.endDate;var arrow=this.locale.direction=='ltr'?{left:'chevron-left',right:'chevron-right'}:{left:'chevron-right',right:'chevron-left'};var html='<table class="table-condensed">';html+='<thead>';html+='<tr>';if(this.showWeekNumbers||this.showISOWeekNumbers) 2031html+='<th></th>';if((!minDate||minDate.isBefore(calendar.firstDay))&&(!this.linkedCalendars||side=='left')){html+='<th class="prev available"><i class="fa fa-'+arrow.left+' glyphicon glyphicon-'+arrow.left+'"></i></th>';}else{html+='<th></th>';} 2032var dateHtml=this.locale.monthNames[calendar[1][1].month()]+calendar[1][1].format(" YYYY");if(this.showDropdowns){var currentMonth=calendar[1][1].month();var currentYear=calendar[1][1].year();var maxYear=(maxDate&&maxDate.year())||(currentYear+5);var minYear=(minDate&&minDate.year())||(currentYear-50);var inMinYear=currentYear==minYear;var inMaxYear=currentYear==maxYear;var monthHtml='<select class="monthselect">';for(var m=0;m<12;m++){if((!inMinYear||m>=minDate.month())&&(!inMaxYear||m<=maxDate.month())){monthHtml+="<option value='"+m+"'"+ 2033(m===currentMonth?" selected='selected'":"")+">"+this.locale.monthNames[m]+"</option>";}else{monthHtml+="<option value='"+m+"'"+ 2034(m===currentMonth?" selected='selected'":"")+" disabled='disabled'>"+this.locale.monthNames[m]+"</option>";}} 2035monthHtml+="</select>";var yearHtml='<select class="yearselect">';for(var y=minYear;y<=maxYear;y++){yearHtml+='<option value="'+y+'"'+ 2036(y===currentYear?' selected="selected"':'')+'>'+y+'</option>';} 2037yearHtml+='</select>';dateHtml=monthHtml+yearHtml;} 2038html+='<th colspan="5" class="month">'+dateHtml+'</th>';if((!maxDate||maxDate.isAfter(calendar.lastDay))&&(!this.linkedCalendars||side=='right'||this.singleDatePicker)){html+='<th class="next available"><i class="fa fa-'+arrow.right+' glyphicon glyphicon-'+arrow.right+'"></i></th>';}else{html+='<th></th>';} 2039html+='</tr>';html+='<tr>';if(this.showWeekNumbers||this.showISOWeekNumbers) 2040html+='<th class="week">'+this.locale.weekLabel+'</th>';$.each(this.locale.daysOfWeek,function(index,dayOfWeek){html+='<th>'+dayOfWeek+'</th>';});html+='</tr>';html+='</thead>';html+='<tbody>';if(this.endDate==null&&this.dateLimit){var maxLimit=this.startDate.clone().add(this.dateLimit).endOf('day');if(!maxDate||maxLimit.isBefore(maxDate)){maxDate=maxLimit;}} 2041for(var row=0;row<6;row++){html+='<tr>';if(this.showWeekNumbers) 2042html+='<td class="week">'+calendar[row][0].week()+'</td>';else if(this.showISOWeekNumbers) 2043html+='<td class="week">'+calendar[row][0].isoWeek()+'</td>';for(var col=0;col<7;col++){var classes=[];if(calendar[row][col].isSame(new Date(),"day")) 2044classes.push('today');if(calendar[row][col].isoWeekday()>5) 2045classes.push('weekend');if(calendar[row][col].month()!=calendar[1][1].month()) 2046classes.push('off');if(this.minDate&&calendar[row][col].isBefore(this.minDate,'day')) 2047classes.push('off','disabled');if(maxDate&&calendar[row][col].isAfter(maxDate,'day')) 2048classes.push('off','disabled');if(this.isInvalidDate(calendar[row][col])) 2049classes.push('off','disabled');if(calendar[row][col].format('YYYY-MM-DD')==this.startDate.format('YYYY-MM-DD')) 2050classes.push('active','start-date');if(this.endDate!=null&&calendar[row][col].format('YYYY-MM-DD')==this.endDate.format('YYYY-MM-DD')) 2051classes.push('active','end-date');if(this.endDate!=null&&calendar[row][col]>this.startDate&&calendar[row][col]<this.endDate) 2052classes.push('in-range');var isCustom=this.isCustomDate(calendar[row][col]);if(isCustom!==false){if(typeof isCustom==='string') 2053classes.push(isCustom);else 2054Array.prototype.push.apply(classes,isCustom);} 2055var cname='',disabled=false;for(var i=0;i<classes.length;i++){cname+=classes[i]+' ';if(classes[i]=='disabled') 2056disabled=true;} 2057if(!disabled) 2058cname+='available';html+='<td class="'+cname.replace(/^\s+|\s+$/g,'')+'" data-title="'+'r'+row+'c'+col+'">'+calendar[row][col].date()+'</td>';} 2059html+='</tr>';} 2060html+='</tbody>';html+='</table>';this.container.find('.calendar.'+side+' .calendar-table').html(html);},renderTimePicker:function(side){if(side=='right'&&!this.endDate)return;var html,selected,minDate,maxDate=this.maxDate;if(this.dateLimit&&(!this.maxDate||this.startDate.clone().add(this.dateLimit).isAfter(this.maxDate))) 2061maxDate=this.startDate.clone().add(this.dateLimit);if(side=='left'){selected=this.startDate.clone();minDate=this.minDate;}else if(side=='right'){selected=this.endDate.clone();minDate=this.startDate;var timeSelector=this.container.find('.calendar.right .calendar-time div');if(timeSelector.html()!=''){selected.hour(timeSelector.find('.hourselect option:selected').val()||selected.hour());selected.minute(timeSelector.find('.minuteselect option:selected').val()||selected.minute());selected.second(timeSelector.find('.secondselect option:selected').val()||selected.second());if(!this.timePicker24Hour){var ampm=timeSelector.find('.ampmselect option:selected').val();if(ampm==='PM'&&selected.hour()<12) 2062selected.hour(selected.hour()+12);if(ampm==='AM'&&selected.hour()===12) 2063selected.hour(0);}} 2064if(selected.isBefore(this.startDate)) 2065selected=this.startDate.clone();if(maxDate&&selected.isAfter(maxDate)) 2066selected=maxDate.clone();} 2067html='<select class="hourselect">';var start=this.timePicker24Hour?0:1;var end=this.timePicker24Hour?23:12;for(var i=start;i<=end;i++){var i_in_24=i;if(!this.timePicker24Hour) 2068i_in_24=selected.hour()>=12?(i==12?12:i+12):(i==12?0:i);var time=selected.clone().hour(i_in_24);var disabled=false;if(minDate&&time.minute(59).isBefore(minDate)) 2069disabled=true;if(maxDate&&time.minute(0).isAfter(maxDate)) 2070disabled=true;if(i_in_24==selected.hour()&&!disabled){html+='<option value="'+i+'" selected="selected">'+i+'</option>';}else if(disabled){html+='<option value="'+i+'" disabled="disabled" class="disabled">'+i+'</option>';}else{html+='<option value="'+i+'">'+i+'</option>';}} 2071html+='</select> ';html+=': <select class="minuteselect">';for(var i=0;i<60;i+=this.timePickerIncrement){var padded=i<10?'0'+i:i;var time=selected.clone().minute(i);var disabled=false;if(minDate&&time.second(59).isBefore(minDate)) 2072disabled=true;if(maxDate&&time.second(0).isAfter(maxDate)) 2073disabled=true;if(selected.minute()==i&&!disabled){html+='<option value="'+i+'" selected="selected">'+padded+'</option>';}else if(disabled){html+='<option value="'+i+'" disabled="disabled" class="disabled">'+padded+'</option>';}else{html+='<option value="'+i+'">'+padded+'</option>';}} 2074html+='</select> ';if(this.timePickerSeconds){html+=': <select class="secondselect">';for(var i=0;i<60;i++){var padded=i<10?'0'+i:i;var time=selected.clone().second(i);var disabled=false;if(minDate&&time.isBefore(minDate)) 2075disabled=true;if(maxDate&&time.isAfter(maxDate)) 2076disabled=true;if(selected.second()==i&&!disabled){html+='<option value="'+i+'" selected="selected">'+padded+'</option>';}else if(disabled){html+='<option value="'+i+'" disabled="disabled" class="disabled">'+padded+'</option>';}else{html+='<option value="'+i+'">'+padded+'</option>';}} 2077html+='</select> ';} 2078if(!this.timePicker24Hour){html+='<select class="ampmselect">';var am_html='';var pm_html='';if(minDate&&selected.clone().hour(12).minute(0).second(0).isBefore(minDate)) 2079am_html=' disabled="disabled" class="disabled"';if(maxDate&&selected.clone().hour(0).minute(0).second(0).isAfter(maxDate)) 2080pm_html=' disabled="disabled" class="disabled"';if(selected.hour()>=12){html+='<option value="AM"'+am_html+'>AM</option><option value="PM" selected="selected"'+pm_html+'>PM</option>';}else{html+='<option value="AM" selected="selected"'+am_html+'>AM</option><option value="PM"'+pm_html+'>PM</option>';} 2081html+='</select>';} 2082this.container.find('.calendar.'+side+' .calendar-time div').html(html);},updateFormInputs:function(){if(this.container.find('input[name=daterangepicker_start]').is(":focus")||this.container.find('input[name=daterangepicker_end]').is(":focus")) 2083return;this.container.find('input[name=daterangepicker_start]').val(this.startDate.format(this.locale.format));if(this.endDate) 2084this.container.find('input[name=daterangepicker_end]').val(this.endDate.format(this.locale.format));if(this.singleDatePicker||(this.endDate&&(this.startDate.isBefore(this.endDate)||this.startDate.isSame(this.endDate)))){this.container.find('button.applyBtn').removeAttr('disabled');}else{this.container.find('button.applyBtn').attr('disabled','disabled');}},move:function(){var parentOffset={top:0,left:0},containerTop;var parentRightEdge=$(window).width();if(!this.parentEl.is('body')){parentOffset={top:this.parentEl.offset().top-this.parentEl.scrollTop(),left:this.parentEl.offset().left-this.parentEl.scrollLeft()};parentRightEdge=this.parentEl[0].clientWidth+this.parentEl.offset().left;} 2085if(this.drops=='up') 2086containerTop=this.element.offset().top-this.container.outerHeight()-parentOffset.top;else 2087containerTop=this.element.offset().top+this.element.outerHeight()-parentOffset.top;this.container[this.drops=='up'?'addClass':'removeClass']('dropup');
2087if(this.opens=='left'){this.container.css({top:containerTop,right:parentRightEdge-this.element.offset().left-this.element.outerWidth(),left:'auto'});if(this.container.offset().left<0){this.container.css({right:'auto',left:9});}}else if(this.opens=='center'){this.container.css({top:containerTop,left:this.element.offset().left-parentOffset.left+this.element.outerWidth()/2 2088-this.container.outerWidth()/2,right:'auto'});if(this.container.offset().left<0){this.container.css({right:'auto',left:9});}}else{this.container.css({top:containerTop,left:this.element.offset().left-parentOffset.left,right:'auto'});if(this.container.offset().left+this.container.outerWidth()>$(window).width()){this.container.css({left:'auto',right:0});}}},show:function(e){if(this.isShowing)return;this._outsideClickProxy=$.proxy(function(e){this.outsideClick(e);},this);$(document).on('mousedown.daterangepicker',this._outsideClickProxy).on('touchend.daterangepicker',this._outsideClickProxy).on('click.daterangepicker','[data-toggle=dropdown]',this._outsideClickProxy).on('focusin.daterangepicker',this._outsideClickProxy);$(window).on('resize.daterangepicker',$.proxy(function(e){this.move(e);},this));this.oldStartDate=this.startDate.clone();this.oldEndDate=this.endDate.clone();this.previousRightTime=this.endDate.clone();this.updateView();this.container.show();this.move();this.element.trigger('show.daterangepicker',this);this.isShowing=true;},hide:function(e){if(!this.isShowing)return;if(!this.endDate){this.startDate=this.oldStartDate.clone();this.endDate=this.oldEndDate.clone();} 2089if(!this.startDate.isSame(this.oldStartDate)||!this.endDate.isSame(this.oldEndDate)) 2090this.callback(this.startDate,this.endDate,this.chosenLabel);this.updateElement();$(document).off('.daterangepicker');$(window).off('.daterangepicker');this.container.hide();this.element.trigger('hide.daterangepicker',this);this.isShowing=false;},toggle:function(e){if(this.isShowing){this.hide();}else{this.show();}},outsideClick:function(e){var target=$(e.target);if(e.type=="focusin"||target.closest(this.element).length||target.closest(this.container).length||target.closest('.calendar-table').length)return;this.hide();this.element.trigger('outsideClick.daterangepicker',this);},showCalendars:function(){this.container.addClass('show-calendar');this.move();this.element.trigger('showCalendar.daterangepicker',this);},hideCalendars:function(){this.container.removeClass('show-calendar');this.element.trigger('hideCalendar.daterangepicker',this);},hoverRange:function(e){if(this.container.find('input[name=daterangepicker_start]').is(":focus")||this.container.find('input[name=daterangepicker_end]').is(":focus")) 2091return;var label=e.target.getAttribute('data-range-key');if(label==this.locale.customRangeLabel){this.updateView();}else{var dates=this.ranges[label];this.container.find('input[name=daterangepicker_start]').val(dates[0].format(this.locale.format));this.container.find('input[name=daterangepicker_end]').val(dates[1].format(this.locale.format));}},clickRange:function(e){var label=e.target.getAttribute('data-range-key');this.chosenLabel=label;if(label==this.locale.customRangeLabel){this.showCalendars();}else{var dates=this.ranges[label];this.startDate=dates[0];this.endDate=dates[1];if(!this.timePicker){this.startDate.startOf('day');this.endDate.endOf('day');} 2092if(!this.alwaysShowCalendars) 2093this.hideCalendars();this.clickApply();}},clickPrev:function(e){var cal=$(e.target).parents('.calendar');if(cal.hasClass('left')){this.leftCalendar.month.subtract(1,'month');if(this.linkedCalendars) 2094this.rightCalendar.month.subtract(1,'month');}else{this.rightCalendar.month.subtract(1,'month');} 2095this.updateCalendars();},clickNext:function(e){var cal=$(e.target).parents('.calendar');if(cal.hasClass('left')){this.leftCalendar.month.add(1,'month');}else{this.rightCalendar.month.add(1,'month');if(this.linkedCalendars) 2096this.leftCalendar.month.add(1,'month');} 2097this.updateCalendars();},hoverDate:function(e){if(!$(e.target).hasClass('available'))return;var title=$(e.target).attr('data-title');var row=title.substr(1,1);var col=title.substr(3,1);var cal=$(e.target).parents('.calendar');var date=cal.hasClass('left')?this.leftCalendar.calendar[row][col]:this.rightCalendar.calendar[row][col];if(this.endDate&&!this.container.find('input[name=daterangepicker_start]').is(":focus")){this.container.find('input[name=daterangepicker_start]').val(date.format(this.locale.format));}else if(!this.endDate&&!this.container.find('input[name=daterangepicker_end]').is(":focus")){this.container.find('input[name=daterangepicker_end]').val(date.format(this.locale.format));} 2098var leftCalendar=this.leftCalendar;var rightCalendar=this.rightCalendar;var startDate=this.startDate;if(!this.endDate){this.container.find('.calendar tbody td').each(function(index,el){if($(el).hasClass('week'))return;
vendor: 4,452 bytes, lines 2098-2118
2098var title=$(el).attr('data-title');var row=title.substr(1,1);var col=title.substr(3,1);var cal=$(el).parents('.calendar');var dt=cal.hasClass('left')?leftCalendar.calendar[row][col]:rightCalendar.calendar[row][col];if((dt.isAfter(startDate)&&dt.isBefore(date))||dt.isSame(date,'day')){$(el).addClass('in-range');}else{$(el).removeClass('in-range');}});}},clickDate:function(e){if(!$(e.target).hasClass('available'))return;var title=$(e.target).attr('data-title');var row=title.substr(1,1);var col=title.substr(3,1);var cal=$(e.target).parents('.calendar');var date=cal.hasClass('left')?this.leftCalendar.calendar[row][col]:this.rightCalendar.calendar[row][col];if(this.endDate||date.isBefore(this.startDate,'day')){if(this.timePicker){var hour=parseInt(this.container.find('.left .hourselect').val(),10);if(!this.timePicker24Hour){var ampm=this.container.find('.left .ampmselect').val();if(ampm==='PM'&&hour<12) 2099hour+=12;if(ampm==='AM'&&hour===12) 2100hour=0;} 2101var minute=parseInt(this.container.find('.left .minuteselect').val(),10);var second=this.timePickerSeconds?parseInt(this.container.find('.left .secondselect').val(),10):0;date=date.clone().hour(hour).minute(minute).second(second);} 2102this.endDate=null;this.setStartDate(date.clone());}else if(!this.endDate&&date.isBefore(this.startDate)){this.setEndDate(this.startDate.clone());}else{if(this.timePicker){var hour=parseInt(this.container.find('.right .hourselect').val(),10);if(!this.timePicker24Hour){var ampm=this.container.find('.right .ampmselect').val();if(ampm==='PM'&&hour<12) 2103hour+=12;if(ampm==='AM'&&hour===12) 2104hour=0;} 2105var minute=parseInt(this.container.find('.right .minuteselect').val(),10);var second=this.timePickerSeconds?parseInt(this.container.find('.right .secondselect').val(),10):0;date=date.clone().hour(hour).minute(minute).second(second);} 2106this.setEndDate(date.clone());if(this.autoApply){this.calculateChosenLabel();this.clickApply();}} 2107if(this.singleDatePicker){this.setEndDate(this.startDate);if(!this.timePicker) 2108this.clickApply();} 2109this.updateView();e.stopPropagation();},calculateChosenLabel:function(){var customRange=true;var i=0;for(var range in this.ranges){if(this.timePicker){if(this.startDate.isSame(this.ranges[range][0])&&this.endDate.isSame(this.ranges[range][1])){customRange=false;this.chosenLabel=this.container.find('.ranges li:eq('+i+')').addClass('active').html();break;}}else{if(this.startDate.format('YYYY-MM-DD')==this.ranges[range][0].format('YYYY-MM-DD')&&this.endDate.format('YYYY-MM-DD')==this.ranges[range][1].format('YYYY-MM-DD')){customRange=false;this.chosenLabel=this.container.find('.ranges li:eq('+i+')').addClass('active').html();break;}} 2110i++;} 2111if(customRange){if(this.showCustomRangeLabel){this.chosenLabel=this.container.find('.ranges li:last').addClass('active').html();}else{this.chosenLabel=null;} 2112this.showCalendars();}},clickApply:function(e){this.hide();this.element.trigger('apply.daterangepicker',this);},clickCancel:function(e){this.startDate=this.oldStartDate;this.endDate=this.oldEndDate;this.hide();this.element.trigger('cancel.daterangepicker',this);},monthOrYearChanged:function(e){var isLeft=$(e.target).closest('.calendar').hasClass('left'),leftOrRight=isLeft?'left':'right',cal=this.container.find('.calendar.'+leftOrRight);var month=parseInt(cal.find('.monthselect').val(),10);var year=cal.find('.yearselect').val();if(!isLeft){if(year<this.startDate.year()||(year==this.startDate.year()&&month<this.startDate.month())){month=this.startDate.month();year=this.startDate.year();}} 2113if(this.minDate){if(year<this.minDate.year()||(year==this.minDate.year()&&month<this.minDate.month())){month=this.minDate.month();year=this.minDate.year();}} 2114if(this.maxDate){if(year>this.maxDate.year()||(year==this.maxDate.year()&&month>this.maxDate.month())){month=this.maxDate.month();year=this.maxDate.year();}} 2115if(isLeft){this.leftCalendar.month.month(month).year(year);if(this.linkedCalendars) 2116this.rightCalendar.month=this.leftCalendar.month.clone().add(1,'month');}else{this.rightCalendar.month.month(month).year(year);if(this.linkedCalendars) 2117this.leftCalendar.month=this.rightCalendar.month.clone().subtract(1,'month');} 2118this.updateCalendars();},timeChanged:function(e){var cal=$(e.target).closest('.calendar'),isLeft=cal.hasClass('left');var hour=parseInt(cal.find('.hourselect').val(),10);var minute=parseInt(cal.find('.minuteselect').val(),10);var second=this.timePickerSeconds?parseInt(cal.find('.secondselect').val(),10):0;
2118if(!this.timePicker24Hour){var ampm=cal.find('.ampmselect').val();if(ampm==='PM'&&hour<12) 2119hour+=12;if(ampm==='AM'&&hour===12) 2120hour=0;} 2121if(isLeft){var start=this.startDate.clone();start.hour(hour);start.minute(minute);start.second(second);this.setStartDate(start);if(this.singleDatePicker){this.endDate=this.startDate.clone();}else if(this.endDate&&this.endDate.format('YYYY-MM-DD')==start.format('YYYY-MM-DD')&&this.endDate.isBefore(start)){this.setEndDate(start.clone());}}else if(this.endDate){var end=this.endDate.clone();end.hour(hour);end.minute(minute);end.second(second);this.setEndDate(end);} 2122this.updateCalendars();this.updateFormInputs();this.renderTimePicker('left');this.renderTimePicker('right');},formInputsChanged:function(e){var isRight=$(e.target).closest('.calendar').hasClass('right');var start=moment(this.container.find('input[name="daterangepicker_start"]').val(),this.locale.format);var end=moment(this.container.find('input[name="daterangepicker_end"]').val(),this.locale.format);if(start.isValid()&&end.isValid()){if(isRight&&end.isBefore(start)) 2123start=end.clone();this.setStartDate(start);this.setEndDate(end);if(isRight){this.container.find('input[name="daterangepicker_start"]').val(this.startDate.format(this.locale.format));}else{this.container.find('input[name="daterangepicker_end"]').val(this.endDate.format(this.locale.format));}} 2124this.updateView();},formInputsFocused:function(e){this.container.find('input[name="daterangepicker_start"], input[name="daterangepicker_end"]').removeClass('active');$(e.target).addClass('active');var isRight=$(e.target).closest('.calendar').hasClass('right');if(isRight){this.endDate=null;this.setStartDate(this.startDate.clone());this.updateView();}},formInputsBlurred:function(e){if(!this.endDate){var val=this.container.find('input[name="daterangepicker_end"]').val();var end=moment(val,this.locale.format);if(end.isValid()){this.setEndDate(end);this.updateView();}}},elementChanged:function(){if(!this.element.is('input'))return;if(!this.element.val().length)return;if(this.element.val().length<this.locale.format.length)return;var dateString=this.element.val().split(this.locale.separator),start=null,end=null;if(dateString.length===2){start=moment(dateString[0],this.locale.format);end=moment(dateString[1],this.locale.format);} 2125if(this.singleDatePicker||start===null||end===null){start=moment(this.element.val(),this.locale.format);end=start;} 2126if(!start.isValid()||!end.isValid())return;this.setStartDate(start);this.setEndDate(end);this.updateView();},keydown:function(e){if((e.keyCode===9)||(e.keyCode===13)){this.hide();}},updateElement:function(){if(this.element.is('input')&&!this.singleDatePicker&&this.autoUpdateInput){this.element.val(this.startDate.format(this.locale.format)+this.locale.separator+this.endDate.format(this.locale.format));this.element.trigger('change');}else if(this.element.is('input')&&this.autoUpdateInput){this.element.val(this.startDate.format(this.locale.format));this.element.trigger('change');}},remove:function(){this.container.remove();this.element.off('.daterangepicker');this.element.removeData();}};$.fn.daterangepicker=function(options,callback){this.each(function(){var el=$(this);if(el.data('daterangepicker')) 2127el.data('daterangepicker').remove();el.data('daterangepicker',new DateRangePicker(el,options,callback));});return this;};return DateRangePicker;}));!function($){"use strict";if(typeof ko!=='undefined'&&ko.bindingHandlers&&!ko.bindingHandlers.multiselect){ko.bindingHandlers.multiselect={after:['options','value','selectedOptions'],init:function(element,valueAccessor,allBindings,viewModel,bindingContext){var $element=$(element);var config=ko.toJS(valueAccessor());$element.multiselect(config);if(allBindings.has('options')){var options=allBindings.get('options');if(ko.isObservable(options)){ko.computed({read:function(){options();setTimeout(function(){var ms=$element.data('multiselect');if(ms) 2128ms.updateOriginalOptions();$element.multiselect('rebuild');},1);},disposeWhenNodeIsRemoved:element});}} 2129if(allBindings.has('value')){var value=allBindings.get('value');if(ko.isObservable(value)){ko.computed({read:function(){value();setTimeout(function(){$element.multiselect('refresh');},1);},disposeWhenNodeIsRemoved:element}).extend({rateLimit:100,notifyWhenChangesStop:true});}} 2130if(allBindings.has('selectedOptions')){var selectedOptions=allBindings.get('selectedOptions');if(ko.isObservable(selectedOptions)){ko.computed({read:function(){selectedOptions();setTimeout(function(){$element.multiselect('refresh');},1);},disposeWhenNodeIsRemoved:element}).extend({rateLimit:100,notifyWhenChangesStop:true});}} 2131ko.utils.domNodeDisposal.addDisposeCallback(element,function(){$element.multiselect('destroy');});},update:function(element,valueAccessor,allBindings,viewModel,bindingContext){var $element=$(element);var config=ko.toJS(valueAccessor());$element.multiselect('setOptions',config);$element.multiselect('rebuild');}};} 2132function forEach(array,callback){for(var index=0;
2132index<array.length;++index){callback(array[index],index);}} 2133function Multiselect(select,options){this.$select=$(select);this.options=this.mergeOptions($.extend({},options,this.$select.data()));this.originalOptions=this.$select.clone()[0].options;this.query='';this.searchTimeout=null;this.lastToggledInput=null 2134this.options.multiple=this.$select.attr('multiple')==="multiple";this.options.onChange=$.proxy(this.options.onChange,this);this.options.onDropdownShow=$.proxy(this.options.onDropdownShow,this);this.options.onDropdownHide=$.proxy(this.options.onDropdownHide,this);this.options.onDropdownShown=$.proxy(this.options.onDropdownShown,this);this.options.onDropdownHidden=$.proxy(this.options.onDropdownHidden,this);this.buildContainer();this.buildButton();this.buildDropdown();this.buildSelectAll();this.buildDropdownOptions();this.buildFilter();this.updateButtonText();this.updateSelectAll();if(this.options.disableIfEmpty&&$('option',this.$select).length<=0){this.disable();} 2135this.$select.hide().after(this.$container);};Multiselect.prototype={defaults:{buttonText:function(options,select){if(options.length===0){return this.nonSelectedText;} 2136else if(this.allSelectedText&&options.length==$('option',$(select)).length){if(this.selectAllNumber){return this.allSelectedText+' ('+options.length+')';} 2137else{return this.allSelectedText;}} 2138else if(options.length>this.numberDisplayed){return options.length+' '+this.nSelectedText;} 2139else{var selected='';options.each(function(){var label=($(this).attr('label')!==undefined)?$(this).attr('label'):$(this).text();selected+=label+', ';});return selected.substr(0,selected.length-2);}},buttonTitle:function(options,select){if(options.length===0){return this.nonSelectedText;} 2140else{var selected='';options.each(function(){selected+=$(this).text()+', ';});return selected.substr(0,selected.length-2);}},optionLabel:function(element){return $(element).attr('label')||$(element).text();},onChange:function(option,checked){},onDropdownShow:function(event){},onDropdownHide:function(event){},onDropdownShown:function(event){},onDropdownHidden:function(event){},onSelectAll:function(){},buttonClass:'btn btn-default',inheritClass:false,buttonWidth:'auto',buttonContainer:'<div class="btn-group" />',dropRight:false,selectedClass:'active',maxHeight:false,checkboxName:false,includeSelectAllOption:false,includeSelectAllIfMoreThan:0,selectAllText:' Select all',selectAllValue:'multiselect-all',selectAllName:false,selectAllNumber:true,enableFiltering:false,enableCaseInsensitiveFiltering:false,enableClickableOptGroups:false,filterPlaceholder:'',filterBehavior:'text',includeFilterClearBtn:true,preventInputChangeEvent:false,nonSelectedText:'',nSelectedText:'selected',allSelectedText:'All selected',numberDisplayed:3,disableIfEmpty:false,templates:{button:'<button type="button" class="multiselect dropdown-toggle" data-toggle="dropdown"><span class="multiselect-selected-text"></span> <b class="caret"></b></button>',ul:'<ul class="multiselect-container dropdown-menu"></ul>',filter:'<li class="multiselect-item filter"><div class="input-group"><span class="input-group-addon"><i class="glyphicon glyphicon-search"></i></span><input class="form-control multiselect-search" type="text"></div></li>',filterClearBtn:'<span class="input-group-btn"><button class="btn btn-default multiselect-clear-filter" type="button"><i class="glyphicon glyphicon-remove-circle"></i></button></span>',li:'<li><a tabindex="0"><label></label></a></li>',divider:'<li class="multiselect-item divider"></li>',liGroup:'<li class="multiselect-item multiselect-group"><label></label></li>'}},constructor:Multiselect,buildContainer:function(){this.$container=$(this.options.buttonContainer);this.$container.on('show.bs.dropdown',this.options.onDropdownShow);this.$container.on('hide.bs.dropdown',this.options.onDropdownHide);this.$container.on('shown.bs.dropdown',this.options.onDropdownShown);this.$container.on('hidden.bs.dropdown',this.options.onDropdownHidden);},buildButton:function(){this.$button=$(this.options.templates.button).addClass(this.options.buttonClass);if(this.$select.attr('class')&&this.options.inheritClass){this.$button.addClass(this.$select.attr('class'));} 2141if(this.$select.prop('disabled')){this.disable();} 2142else{this.enable();} 2143if(this.options.buttonWidth&&this.options.buttonWidth!=='auto'){this.$button.css({'width':this.options.buttonWidth,'overflow':'hidden','text-overflow':'ellipsis'});this.$container.css({'width':this.options.buttonWidth});} 2144var tabindex=this.$select.attr('tabindex');if(tabindex){this.$button.attr('tabindex',tabindex);} 2145this.$container.prepend(this.$button);},buildDropdown:function(){this.$ul=$(this.options.templates.ul);
2145if(this.options.dropRight){this.$ul.addClass('pull-right');} 2146if(this.options.maxHeight){this.$ul.css({'max-height':this.options.maxHeight+'px','overflow-y':'auto','overflow-x':'hidden'});} 2147this.$container.append(this.$ul);},buildDropdownOptions:function(){this.$select.children().each($.proxy(function(index,element){var $element=$(element);var tag=$element.prop('tagName').toLowerCase();if($element.prop('value')===this.options.selectAllValue){return;} 2148if(tag==='optgroup'){this.createOptgroup(element);} 2149else if(tag==='option'){if($element.data('role')==='divider'){this.createDivider();} 2150else{this.createOptionValue(element);}}},this));$('li input',this.$ul).on('change',$.proxy(function(event){var $target=$(event.target);var checked=$target.prop('checked')||false;var isSelectAllOption=$target.val()===this.options.selectAllValue;if(this.options.selectedClass){if(checked){$target.closest('li').addClass(this.options.selectedClass);} 2151else{$target.closest('li').removeClass(this.options.selectedClass);}} 2152var value=$target.val();var $option=this.getOptionByValue(value);var $optionsNotThis=$('option',this.$select).not($option);var $checkboxesNotThis=$('input',this.$container).not($target);if(isSelectAllOption){if(checked){this.selectAll();} 2153else{this.deselectAll();}} 2154if(!isSelectAllOption){if(checked){$option.prop('selected',true);if(this.options.multiple){$option.prop('selected',true);} 2155else{if(this.options.selectedClass){$($checkboxesNotThis).closest('li').removeClass(this.options.selectedClass);} 2156$($checkboxesNotThis).prop('checked',false);$optionsNotThis.prop('selected',false);this.$button.click();} 2157if(this.options.selectedClass==="active"){$optionsNotThis.closest("a").css("outline","");}} 2158else{$option.prop('selected',false);}} 2159this.$select.change();this.updateButtonText();this.updateSelectAll();this.options.onChange($option,checked);if(this.options.preventInputChangeEvent){return false;}},this));$('li a',this.$ul).on('mousedown',function(e){if(e.shiftKey){return false;}});$('li a',this.$ul).on('touchstart click',$.proxy(function(event){event.stopPropagation();var $target=$(event.target);if(event.shiftKey&&this.options.multiple){if($target.is("label")){event.preventDefault();$target=$target.find("input");$target.prop("checked",!$target.prop("checked"));} 2160var checked=$target.prop('checked')||false;if(this.lastToggledInput!==null&&this.lastToggledInput!==$target){var from=$target.closest("li").index();var to=this.lastToggledInput.closest("li").index();if(from>to){var tmp=to;to=from;from=tmp;} 2161++to;var range=this.$ul.find("li").slice(from,to).find("input");range.prop('checked',checked);if(this.options.selectedClass){range.closest('li').toggleClass(this.options.selectedClass,checked);} 2162for(var i=0,j=range.length;i<j;i++){var $checkbox=$(range[i]);var $option=this.getOptionByValue($checkbox.val());$option.prop('selected',checked);}} 2163$target.trigger("change");} 2164if($target.is("input")&&!$target.closest("li").is(".multiselect-item")){this.lastToggledInput=$target;} 2165$target.blur();},this));this.$container.off('keydown.multiselect').on('keydown.multiselect',$.proxy(function(event){if($('input[type="text"]',this.$container).is(':focus')){return;} 2166if(event.keyCode===9&&this.$container.hasClass('open')){this.$button.click();} 2167else{var $items=$(this.$container).find("li:not(.divider):not(.disabled) a").filter(":visible");if(!$items.length){return;} 2168var index=$items.index($items.filter(':focus'));if(event.keyCode===38&&index>0){index--;} 2169else if(event.keyCode===40&&index<$items.length-1){index++;} 2170else if(!~index){index=0;} 2171var $current=$items.eq(index);$current.focus();if(event.keyCode===32||event.keyCode===13){var $checkbox=$current.find('input');$checkbox.prop("checked",!$checkbox.prop("checked"));$checkbox.change();} 2172event.stopPropagation();event.preventDefault();}},this));if(this.options.enableClickableOptGroups&&this.options.multiple){$('li.multiselect-group',this.$ul).on('click',$.proxy(function(event){event.stopPropagation();var group=$(event.target).parent();var $options=group.nextUntil('li.multiselect-group');var $visibleOptions=$options.filter(":visible");var allChecked=true;var optionInputs=$visibleOptions.find('input');optionInputs.each(function(){allChecked=allChecked&&$(this).prop('checked');});optionInputs.prop('checked',!allChecked).trigger('change');},this));}},createOptionValue:function(element){var $element=$(element);if($element.is(':selected')){$element.prop('selected',true);} 2173var label=this.options.optionLabel(element);var value=$element.val();var inputType=this.options.multiple?"checkbox":"radio";var $li=$(this.options.templates.li);var $label=$('label',$li);$label.addClass(inputType);var $checkbox=$('<input/>').attr('type',inputType);if(this.options.checkboxName){$checkbox.attr('name',this.options.checkboxName);} 2174$label.append($checkbox);var selected=$element.prop('selected')||false;$checkbox.val(value);if(value===this.options.selectAllValue){$li.addClass("multiselect-item multiselect-all");$checkbox.parent().parent().addClass('multiselect-all');} 2175$label.append(" "+label);$label.attr('title',$element.attr('title'));this.$ul.append($li);if($element.is(':disabled')){$checkbox.attr('disabled','disabled').prop('disabled',true).closest('a').attr("tabindex","-1").closest('li').addClass('disabled');} 2176$checkbox.prop('checked',selected);if(selected&&this.options.selectedClass){$checkbox.closest('li').addClass(this.options.selectedClass);}},createDivider:function(element){var $divider=$(this.options.templates.divider);this.$ul.append($divider);}
2176,createOptgroup:function(group){var groupName=$(group).prop('label');var $li=$(this.options.templates.liGroup);$('label',$li).text(groupName);if(this.options.enableClickableOptGroups){$li.addClass('multiselect-group-clickable');} 2177this.$ul.append($li);if($(group).is(':disabled')){$li.addClass('disabled');} 2178$('option',group).each($.proxy(function(index,element){this.createOptionValue(element);},this));},buildSelectAll:function(){if(typeof this.options.selectAllValue==='number'){this.options.selectAllValue=this.options.selectAllValue.toString();} 2179var alreadyHasSelectAll=this.hasSelectAll();if(!alreadyHasSelectAll&&this.options.includeSelectAllOption&&this.options.multiple&&$('option',this.$select).length>this.options.includeSelectAllIfMoreThan){if(this.options.includeSelectAllDivider){this.$ul.prepend($(this.options.templates.divider));} 2180var $li=$(this.options.templates.li);$('label',$li).addClass("checkbox");if(this.options.selectAllName){$('label',$li).append('<input type="checkbox" name="'+this.options.selectAllName+'" />');} 2181else{$('label',$li).append('<input type="checkbox" />');} 2182var $checkbox=$('input',$li);$checkbox.val(this.options.selectAllValue);$li.addClass("multiselect-item multiselect-all");$checkbox.parent().parent().addClass('multiselect-all');$('label',$li).append(" "+this.options.selectAllText);this.$ul.prepend($li);$checkbox.prop('checked',false);}},buildFilter:function(){if(this.options.enableFiltering||this.options.enableCaseInsensitiveFiltering){var enableFilterLength=Math.max(this.options.enableFiltering,this.options.enableCaseInsensitiveFiltering);if(this.$select.find('option').length>=enableFilterLength){this.$filter=$(this.options.templates.filter);$('input',this.$filter).attr('placeholder',this.options.filterPlaceholder);if(this.options.includeFilterClearBtn){var clearBtn=$(this.options.templates.filterClearBtn);clearBtn.on('click',$.proxy(function(event){clearTimeout(this.searchTimeout);this.$filter.find('.multiselect-search').val('');$('li',this.$ul).show().removeClass("filter-hidden");this.updateSelectAll();},this));this.$filter.find('.input-group').append(clearBtn);} 2183this.$ul.prepend(this.$filter);this.$filter.val(this.query).on('click',function(event){event.stopPropagation();}).on('input keydown',$.proxy(function(event){if(event.which===13){event.preventDefault();} 2184clearTimeout(this.searchTimeout);this.searchTimeout=this.asyncFunction($.proxy(function(){if(this.query!==event.target.value){this.query=event.target.value;var currentGroup,currentGroupVisible;$.each($('li',this.$ul),$.proxy(function(index,element){var value=$('input',element).length>0?$('input',element).val():"";var text=$('label',element).text();var filterCandidate='';if((this.options.filterBehavior==='text')){filterCandidate=text;} 2185else if((this.options.filterBehavior==='value')){filterCandidate=value;} 2186else if(this.options.filterBehavior==='both'){filterCandidate=text+'\n'+value;} 2187if(value!==this.options.selectAllValue&&text){var showElement=false;if(this.options.enableCaseInsensitiveFiltering&&filterCandidate.toLowerCase().indexOf(this.query.toLowerCase())>-1){showElement=true;} 2188else if(filterCandidate.indexOf(this.query)>-1){showElement=true;} 2189$(element).toggle(showElement).toggleClass('filter-hidden',!showElement);if($(element).hasClass('multiselect-group')){currentGroup=element;currentGroupVisible=showElement;} 2190else{if(showElement){$(currentGroup).show().removeClass('filter-hidden');} 2191if(!showElement&¤tGroupVisible){$(element).show().removeClass('filter-hidden');}}}},this));} 2192this.updateSelectAll();},this),300,this);},this));}}},destroy:function(){this.$container.remove();this.$select.show();this.$select.data('multiselect',null);},refresh:function(){$('option',this.$select).each($.proxy(function(index,element){var $input=$('li input',this.$ul).filter(function(){return $(this).val()===$(element).val();});if($(element).is(':selected')){$input.prop('checked',true);if(this.options.selectedClass){$input.closest('li').addClass(this.options.selectedClass);}} 2193else{$input.prop('checked',false);if(this.options.selectedClass){$input.closest('li').removeClass(this.options.selectedClass);}} 2194if($(element).is(":disabled")){$input.attr('disabled','disabled').prop('disabled',true).closest('li').addClass('disabled');} 2195else{$input.prop('disabled',false).closest('li').removeClass('disabled');}},this));this.updateButtonText();this.updateSelectAll();},select:function(selectValues,triggerOnChange){if(!$.isArray(selectValues)){selectValues=[selectValues];} 2196for(var i=0;i<selectValues.length;i++){var value=selectValues[i];if(value===null||value===undefined){continue;} 2197var $option=this.getOptionByValue(value);var $checkbox=this.getInputByValue(value);if($option===undefined||$checkbox===undefined){continue;} 2198if(!this.options.multiple){this.deselectAll(false);} 2199if(this.options.selectedClass){$checkbox.closest('li').addClass(this.options.selectedClass);} 2200$checkbox.prop('checked',true);$option.prop('selected',true);} 2201this.updateButtonText();this.updateSelectAll();if(triggerOnChange&&selectValues.length===1){this.options.onChange($option,true);}},clearSelection:function(){this.deselectAll(false);this.updateButtonText();this.updateSelectAll();},deselect:function(deselectValues,triggerOnChange){if(!$.isArray(deselectValues)){deselectValues=[deselectValues];} 2202for(var i=0;i<deselectValues.length;i++){var value=deselectValues[i];if(value===null||value===undefined){continue;} 2203var $option=this.getOptionByValue(value);var $checkbox=this.getInputByValue(value);if($option===undefined||$checkbox===undefined){continue;} 2204if(this.options.selectedClass){$checkbox.closest('li').removeClass(this.options.selectedClass);}
2205$checkbox.prop('checked',false);$option.prop('selected',false);} 2206this.updateButtonText();this.updateSelectAll();if(triggerOnChange&&deselectValues.length===1){this.options.onChange($option,false);}},selectAll:function(justVisible,triggerOnSelectAll){var justVisible=typeof justVisible==='undefined'?true:justVisible;var allCheckboxes=$("li input[type='checkbox']:enabled",this.$ul);var visibleCheckboxes=allCheckboxes.filter(":visible");var allCheckboxesCount=allCheckboxes.length;var visibleCheckboxesCount=visibleCheckboxes.length;if(justVisible){visibleCheckboxes.prop('checked',true);$("li:not(.divider):not(.disabled)",this.$ul).filter(":visible").addClass(this.options.selectedClass);} 2207else{allCheckboxes.prop('checked',true);$("li:not(.divider):not(.disabled)",this.$ul).addClass(this.options.selectedClass);} 2208if(allCheckboxesCount===visibleCheckboxesCount||justVisible===false){$("option:enabled",this.$select).prop('selected',true);} 2209else{var values=visibleCheckboxes.map(function(){return $(this).val();}).get();$("option:enabled",this.$select).filter(function(index){return $.inArray($(this).val(),values)!==-1;}).prop('selected',true);} 2210if(triggerOnSelectAll){this.options.onSelectAll();}},deselectAll:function(justVisible){var justVisible=typeof justVisible==='undefined'?true:justVisible;if(justVisible){var visibleCheckboxes=$("li input[type='checkbox']:not(:disabled)",this.$ul).filter(":visible");visibleCheckboxes.prop('checked',false);var values=visibleCheckboxes.map(function(){return $(this).val();}).get();$("option:enabled",this.$select).filter(function(index){return $.inArray($(this).val(),values)!==-1;}).prop('selected',false);if(this.options.selectedClass){$("li:not(.divider):not(.disabled)",this.$ul).filter(":visible").removeClass(this.options.selectedClass);}} 2211else{$("li input[type='checkbox']:enabled",this.$ul).prop('checked',false);$("option:enabled",this.$select).prop('selected',false);if(this.options.selectedClass){$("li:not(.divider):not(.disabled)",this.$ul).removeClass(this.options.selectedClass);}}},rebuild:function(){this.$ul.html('');this.options.multiple=this.$select.attr('multiple')==="multiple";this.buildSelectAll();this.buildDropdownOptions();this.buildFilter();this.updateButtonText();this.updateSelectAll();if(this.options.disableIfEmpty&&$('option',this.$select).length<=0){this.disable();} 2212else{this.enable();} 2213if(this.options.dropRight){this.$ul.addClass('pull-right');}},dataprovider:function(dataprovider){var groupCounter=0;var $select=this.$select.empty();$.each(dataprovider,function(index,option){var $tag;if($.isArray(option.children)){groupCounter++;$tag=$('<optgroup/>').attr({label:option.label||'Group '+groupCounter,disabled:!!option.disabled});forEach(option.children,function(subOption){$tag.append($('<option/>').attr({value:subOption.value,label:subOption.label||subOption.value,title:subOption.title,selected:!!subOption.selected,disabled:!!subOption.disabled}));});} 2214else{$tag=$('<option/>').attr({value:option.value,label:option.label||option.value,title:option.title,selected:!!option.selected,disabled:!!option.disabled});} 2215$select.append($tag);});this.rebuild();},enable:function(){this.$select.prop('disabled',false);this.$button.prop('disabled',false).removeClass('disabled');},disable:function(){this.$select.prop('disabled',true);this.$button.prop('disabled',true).addClass('disabled');},setOptions:function(options){this.options=this.mergeOptions(options);},mergeOptions:function(options){return $.extend(true,{},this.defaults,this.options,options);},hasSelectAll:function(){return $('li.'+this.options.selectAllValue,this.$ul).length>0;},updateSelectAll:function(){if(this.hasSelectAll()){var allBoxes=$("li:not(.multiselect-item):not(.filter-hidden) input:enabled",this.$ul);var allBoxesLength=allBoxes.length;var checkedBoxesLength=allBoxes.filter(":checked").length;var selectAllLi=$("li."+this.options.selectAllValue,this.$ul);var selectAllInput=selectAllLi.find("input");if(checkedBoxesLength>0&&checkedBoxesLength===allBoxesLength){selectAllInput.prop("checked",true);selectAllLi.addClass(this.options.selectedClass);this.options.onSelectAll();} 2216else{selectAllInput.prop("checked",false);selectAllLi.removeClass(this.options.selectedClass);}}},updateButtonText:function(){var options=this.getSelected();$('.multiselect .multiselect-selected-text',this.$container).text(this.options.buttonText(options,this.$select));$('.multiselect',this.$container).attr('title',this.options.buttonTitle(options,this.$select));},getSelected:function(){return $('option',this.$select).filter(":selected");},getOptionByValue:function(value){var options=$('option',this.$select);var valueToCompare=value.toString();for(var i=0;i<options.length;i=i+1){var option=options[i];if(option.value===valueToCompare){return $(option);}}},getInputByValue:function(value){var checkboxes=$('li input',this.$ul);var valueToCompare=value.toString();for(var i=0;i<checkboxes.length;i=i+1){var checkbox=checkboxes[i];if(checkbox.value===valueToCompare){return $(checkbox);}}
2216},updateOriginalOptions:function(){this.originalOptions=this.$select.clone()[0].options;},asyncFunction:function(callback,timeout,self){var args=Array.prototype.slice.call(arguments,3);return setTimeout(function(){callback.apply(self||window,args);},timeout);},setAllSelectedText:function(allSelectedText){this.options.allSelectedText=allSelectedText;this.updateButtonText();}};$.fn.multiselect=function(option,parameter,extraOptions){return this.each(function(){var data=$(this).data('multiselect');var options=typeof option==='object'&&option;if(!data){data=new Multiselect(this,options);$(this).data('multiselect',data);} 2217if(typeof option==='string'){data[option](parameter,extraOptions);if(option==='destroy'){$(this).data('multiselect',false);}}});};$.fn.multiselect.Constructor=Multiselect;$(function(){$("select[data-role=multiselect]").multiselect();});}(window.jQuery);if(typeof jQuery==='undefined'){throw new Error('Bootstrap\'s JavaScript requires jQuery')} 2218+function($){'use strict';var version=$.fn.jquery.split(' ')[0].split('.') 2219if((version[0]<2&&version[1]<9)||(version[0]==1&&version[1]==9&&version[2]<1)){throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher')}}(jQuery);+function($){'use strict';function transitionEnd(){var el=document.createElement('bootstrap') 2220var transEndEventNames={WebkitTransition:'webkitTransitionEnd',MozTransition:'transitionend',OTransition:'oTransitionEnd otransitionend',transition:'transitionend'} 2221for(var name in transEndEventNames){if(el.style[name]!==undefined){return{end:transEndEventNames[name]}}} 2222return false} 2223$.fn.emulateTransitionEnd=function(duration){var called=false 2224var $el=this 2225$(this).one('bsTransitionEnd',function(){called=true}) 2226var callback=function(){if(!called)$($el).trigger($.support.transition.end)} 2227setTimeout(callback,duration) 2228return this} 2229$(function(){$.support.transition=transitionEnd() 2230if(!$.support.transition)return 2231$.event.special.bsTransitionEnd={bindType:$.support.transition.end,delegateType:$.supp
vendor: 50,198 bytes, lines 2231-2975
2231ort.transition.end,handle:function(e){if($(e.target).is(this))return e.handleObj.handler.apply(this,arguments)}}})}(jQuery);+function($){'use strict';var dismiss='[data-dismiss="alert"]' 2232var Alert=function(el){$(el).on('click',dismiss,this.close)} 2233Alert.VERSION='3.3.2' 2234Alert.TRANSITION_DURATION=150 2235Alert.prototype.close=function(e){var $this=$(this) 2236var selector=$this.attr('data-target') 2237if(!selector){selector=$this.attr('href') 2238selector=selector&&selector.replace(/.*(?=#[^\s]*$)/,'')} 2239var $parent=$(selector) 2240if(e)e.preventDefault() 2241if(!$parent.length){$parent=$this.closest('.alert')} 2242$parent.trigger(e=$.Event('close.bs.alert')) 2243if(e.isDefaultPrevented())return 2244$parent.removeClass('in') 2245function removeElement(){$parent.detach().trigger('closed.bs.alert').remove()} 2246$.support.transition&&$parent.hasClass('fade')?$parent.one('bsTransitionEnd',removeElement).emulateTransitionEnd(Alert.TRANSITION_DURATION):removeElement()} 2247function Plugin(option){return this.each(function(){var $this=$(this) 2248var data=$this.data('bs.alert') 2249if(!data)$this.data('bs.alert',(data=new Alert(this))) 2250if(typeof option=='string')data[option].call($this)})} 2251var old=$.fn.alert 2252$.fn.alert=Plugin 2253$.fn.alert.Constructor=Alert 2254$.fn.alert.noConflict=function(){$.fn.alert=old 2255return this} 2256$(document).on('click.bs.alert.data-api',dismiss,Alert.prototype.close)}(jQuery);+function($){'use strict';var Button=function(element,options){this.$element=$(element) 2257this.options=$.extend({},Button.DEFAULTS,options) 2258this.isLoading=false} 2259Button.VERSION='3.3.2' 2260Button.DEFAULTS={loadingText:'loading...'} 2261Button.prototype.setState=function(state){var d='disabled' 2262var $el=this.$element 2263var val=$el.is('input')?'val':'html' 2264var data=$el.data() 2265state=state+'Text' 2266if(data.resetText==null)$el.data('resetText',$el[val]()) 2267setTimeout($.proxy(function(){$el[val](data[state]==null?this.options[state]:data[state]) 2268if(state=='loadingText'){this.isLoading=true 2269$el.addClass(d).attr(d,d)}else if(this.isLoading){this.isLoading=false 2270$el.removeClass(d).removeAttr(d)}},this),0)} 2271Button.prototype.toggle=function(){var changed=true 2272var $parent=this.$element.closest('[data-toggle="buttons"]') 2273if($parent.length){var $input=this.$element.find('input') 2274if($input.prop('type')=='radio'){if($input.prop('checked')&&this.$element.hasClass('active'))changed=false 2275else $parent.find('.active').removeClass('active')} 2276if(changed)$input.prop('checked',!this.$element.hasClass('active')).trigger('change')}else{this.$element.attr('aria-pressed',!this.$element.hasClass('active'))} 2277if(changed)this.$element.toggleClass('active')} 2278function Plugin(option){return this.each(function(){var $this=$(this) 2279var data=$this.data('bs.button') 2280var options=typeof option=='object'&&option 2281if(!data)$this.data('bs.button',(data=new Button(this,options))) 2282if(option=='toggle')data.toggle() 2283else if(option)data.setState(option)})} 2284var old=$.fn.button 2285$.fn.button=Plugin 2286$.fn.button.Constructor=Button 2287$.fn.button.noConflict=function(){$.fn.button=old 2288return this} 2289$(document).on('click.bs.button.data-api','[data-toggle^="button"]',function(e){var $btn=$(e.target) 2290if(!$btn.hasClass('btn'))$btn=$btn.closest('.btn') 2291Plugin.call($btn,'toggle') 2292e.preventDefault()}).on('focus.bs.button.data-api blur.bs.button.data-api','[data-toggle^="button"]',function(e){$(e.target).closest('.btn').toggleClass('focus',/^focus(in)?$/.test(e.type))})}(jQuery);+function($){'use strict';var Carousel=function(element,options){this.$element=$(element) 2293this.$indicators=this.$element.find('.carousel-indicators') 2294this.options=options 2295this.paused=this.sliding=this.interval=this.$active=this.$items=null 2296this.options.keyboard&&this.$element.on('keydown.bs.carousel',$.proxy(this.keydown,this)) 2297this.options.pause=='hover'&&!('ontouchstart'in document.documentElement)&&this.$element.on('mouseenter.bs.carousel',$.proxy(this.pause,this)).on('mouseleave.bs.carousel',$.proxy(this.cycle,this))} 2298Carousel.VERSION='3.3.2' 2299Carousel.TRANSITION_DURATION=600 2300Carousel.DEFAULTS={interval:5000,pause:'hover',wrap:true,keyboard:true} 2301Carousel.prototype.keydown=function(e){if(/input|textarea/i.test(e.target.tagName))return 2302switch(e.which){case 37:this.prev();break 2303case 39:this.next();break 2304default:return} 2305e.preventDefault()} 2306Carousel.prototype.cycle=function(e){e||(this.paused=false) 2307this.interval&&clearInterval(this.interval) 2308this.options.interval&&!this.paused&&(this.interval=setInterval($.proxy(this.next,this),this.options.interval)) 2309return this} 2310Carousel.prototype.getItemIndex=function(item){this.$items=item.parent().children('.item') 2311return this.$items.index(item||this.$active)} 2312Carousel.prototype.getItemForDirection=function(direction,active){var activeIndex=this.getItemIndex(active) 2313var willWrap=(direction=='prev'&&activeIndex===0)||(direction=='next'&&activeIndex==(this.$items.length-1)) 2314if(willWrap&&!this.options.wrap)return active 2315var delta=direction=='prev'?-1:1 2316var itemIndex=(activeIndex+delta)%this.$items.length 2317return this.$items.eq(itemIndex)} 2318Carousel.prototype.to=function(pos){var that=this 2319var activeIndex=this.getItemIndex(this.$active=this.$element.find('.item.active')) 2320if(pos>(this.$items.length-1)||pos<0)return 2321if(this.sliding)return this.$element.one('slid.bs.carousel',function(){that.to(pos)}) 2322if(activeIndex==pos)return this.pause().cycle() 2323return this.slide(pos>activeIndex?'next':'prev',this.$items.eq(pos))} 2324Carousel.prototype.pause=function(e){e||(this.paused=true) 2325if(this.$element.find('.next, .prev').length&&$.support.transition){this.$element.trigger($.support.transition.end) 2326this.cycle(true)} 2327this.interval=clearInterval(this.interval) 2328return this} 2329Carousel.prototype.next=function(){if(this.sliding)return 2330return this.slide('next')} 2331Carousel.prototype.prev=function(){if(this.sliding)return 2332return this.slide('prev')} 2333Carousel.prototype.slide=function(type,next){var $active=this.$element.find('.item.active') 2334var $next=next||this.getItemForDirection(type,$active) 2335var isCycling=this.interval 2336var direction=type=='next'?'left':'right' 2337var that=this 2338if($next.hasClass('active'))return(this.sliding=false) 2339var relatedTarget=$next[0] 2340var slideEvent=$.Event('slide.bs.carousel',{relatedTarget:relatedTarget,direction:direction}) 2341this.$element.trigger(slideEvent) 2342if(slideEvent.isDefaultPrevented())return 2343this.sliding=true 2344isCycling&&this.pause() 2345if(this.$indicators.length){this.$indicators.find('.active').removeClass('active') 2346var $nextIndicator=$(this.$indicators.children()[this.getItemIndex($next)]) 2347$nextIndicator&&$nextIndicator.addClass('active')} 2348var slidEvent=$.Event('slid.bs.carousel',{relatedTarget:relatedTarget,direction:direction}) 2349if($.support.transition&&this.$element.hasClass('slide')){$next.addClass(type) 2350$next[0].offsetWidth 2351$active.addClass(direction) 2352$next.addClass(direction) 2353$active.one('bsTransitionEnd',function(){$next.removeClass([type,direction].join(' ')).addClass('active') 2354$active.removeClass(['active',direction].join(' ')) 2355that.sliding=false 2356setTimeout(function(){that.$element.trigger(slidEvent)},0)}).emulateTransitionEnd(Carousel.TRANSITION_DURATION)}else{$active.removeClass('active') 2357$next.addClass('active') 2358this.sliding=false 2359this.$element.trigger(slidEvent)} 2360isCycling&&this.cycle() 2361return this} 2362function Plugin(option){return this.each(function(){var $this=$(this) 2363var data=$this.data('bs.carousel') 2364var options=$.extend({},Carousel.DEFAULTS,$this.data(),typeof option=='object'&&option) 2365var action=typeof option=='string'?option:options.slide 2366if(!data)$this.data('bs.carousel',(data=new Carousel(this,options))) 2367if(typeof option=='number')data.to(option) 2368else if(action)data[action]() 2369else if(options.interval)data.pause().cycle()})} 2370var old=$.fn.carousel 2371$.fn.carousel=Plugin 2372$.fn.carousel.Constructor=Carousel 2373$.fn.carousel.noConflict=function(){$.fn.carousel=old 2374return this} 2375var clickHandler=function(e){var href 2376var $this=$(this) 2377var $target=$($this.attr('data-target')||(href=$this.attr('href'))&&href.replace(/.*(?=#[^\s]+$)/,'')) 2378if(!$target.hasClass('carousel'))return 2379var options=$.extend({},$target.data(),$this.data()) 2380var slideIndex=$this.attr('data-slide-to') 2381if(slideIndex)options.interval=false 2382Plugin.call($target,options) 2383if(slideIndex){$target.data('bs.carousel').to(slideIndex)} 2384e.preventDefault()} 2385$(document).on('click.bs.carousel.data-api','[data-slide]',clickHandler).on('click.bs.carousel.data-api','[data-slide-to]',clickHandler) 2386$(window).on('load',function(){$('[data-ride="carousel"]').each(function(){var $carousel=$(this) 2387Plugin.call($carousel,$carousel.data())})})}(jQuery);+function($){'use strict';var Collapse=function(element,options){this.$element=$(element) 2388this.options=$.extend({},Collapse.DEFAULTS,options) 2389this.$trigger=$(this.options.trigger).filter('[href="#'+element.id+'"], [data-target="#'+element.id+'"]') 2390this.transitioning=null 2391if(this.options.parent){this.$parent=this.getParent()}else{this.addAriaAndCollapsedClass(this.$element,this.$trigger)} 2392if(this.options.toggle)this.toggle()} 2393Collapse.VERSION='3.3.2' 2394Collapse.TRANSITION_DURATION=350 2395Collapse.DEFAULTS={toggle:true,trigger:'[data-toggle="collapse"]'} 2396Collapse.prototype.dimension=function(){var hasWidth=this.$element.hasClass('width') 2397return hasWidth?'width':'height'} 2398Collapse.prototype.show=function(){if(this.transitioning||this.$element.hasClass('in'))return 2399var activesData 2400var actives=this.$parent&&this.$parent.children('.panel').children('.in, .collapsing') 2401if(actives&&actives.length){activesData=actives.data('bs.collapse') 2402if(activesData&&activesData.transitioning)return} 2403var startEvent=$.Event('show.bs.collapse') 2404this.$element.trigger(startEvent) 2405if(startEvent.isDefaultPrevented())return 2406if(actives&&actives.length){Plugin.call(actives,'hide') 2407activesData||actives.data('bs.collapse',null)} 2408var dimension=this.dimension() 2409this.$element.removeClass('collapse').addClass('collapsing')[dimension](0).attr('aria-expanded',true) 2410this.$trigger.removeClass('collapsed').attr('aria-expanded',true) 2411this.transitioning=1 2412var complete=function(){this.$element.removeClass('collapsing').addClass('collapse in')[dimension]('') 2413this.transitioning=0 2414this.$element.trigger('shown.bs.collapse')} 2415if(!$.support.transition)return complete.call(this) 2416var scrollSize=$.camelCase(['scroll',dimension].join('-')) 2417this.$element.one('bsTransitionEnd',$.proxy(complete,this)).emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize])} 2418Collapse.prototype.hide=function(){if(this.transitioning||!this.$element.hasClass('in'))return 2419var startEvent=$.Event('hide.bs.collapse') 2420this.$element.trigger(startEvent) 2421if(startEvent.isDefaultPrevented())return 2422var dimension=this.dimension() 2423this.$element[dimension](this.$element[dimension]())[0].offsetHeight 2424this.$element.addClass('collapsing').removeClass('collapse in').attr('aria-expanded',false) 2425this.$trigger.addClass('collapsed').attr('aria-expanded',false) 2426this.transitioning=1 2427var complete=function(){this.transitioning=0 2428this.$element.removeClass('collapsing').addClass('collapse').trigger('hidden.bs.collapse')} 2429if(!$.support.transition)return complete.call(this) 2430this.$element 2431[dimension](0).one('bsTransitionEnd',$.proxy(complete,this)).emulateTransitionEnd(Collapse.TRANSITION_DURATION)} 2432Collapse.prototype.toggle=function(){this[this.$element.hasClass('in')?'hide':'show']()} 2433Collapse.prototype.getParent=function(){return $(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each($.proxy(function(i,element){var $element=$(element) 2434this.addAriaAndCollapsedClass(getTargetFromTrigger($element),$element)},this)).end()} 2435Collapse.prototype.addAriaAndCollapsedClass=function($element,$trigger){var isOpen=$element.hasClass('in') 2436$element.attr('aria-expanded',isOpen) 2437$trigger.toggleClass('collapsed',!isOpen).attr('aria-expanded',isOpen)} 2438function getTargetFromTrigger($trigger){var href 2439var target=$trigger.attr('data-target')||(href=$trigger.attr('href'))&&href.replace(/.*(?=#[^\s]+$)/,'') 2440return $(target)} 2441function Plugin(option){return this.each(function(){var $this=$(this) 2442var data=$this.data('bs.collapse') 2443var options=$.extend({},Collapse.DEFAULTS,$this.data(),typeof option=='object'&&option) 2444if(!data&&options.toggle&&option=='show')options.toggle=false 2445if(!data)$this.data('bs.collapse',(data=new Collapse(this,options))) 2446if(typeof option=='string')data[option]()})} 2447var old=$.fn.collapse 2448$.fn.collapse=Plugin 2449$.fn.collapse.Constructor=Collapse 2450$.fn.collapse.noConflict=function(){$.fn.collapse=old 2451return this} 2452$(document).on('click.bs.collapse.data-api','[data-toggle="collapse"]',function(e){var $this=$(this) 2453if(!$this.attr('data-target'))e.preventDefault() 2454var $target=getTargetFromTrigger($this) 2455var data=$target.data('bs.collapse') 2456var option=data?'toggle':$.extend({},$this.data(),{trigger:this}) 2457Plugin.call($target,option)})}(jQuery);+function($){'use strict';var backdrop='.dropdown-backdrop' 2458var toggle='[data-toggle="dropdown"]' 2459var Dropdown=function(element){$(element).on('click.bs.dropdown',this.toggle)} 2460Dropdown.VERSION='3.3.2' 2461Dropdown.prototype.toggle=function(e){var $this=$(this) 2462if($this.is('.disabled, :disabled'))return 2463var $parent=getParent($this) 2464var isActive=$parent.hasClass('open') 2465clearMenus() 2466if(!isActive){if('ontouchstart'in document.documentElement&&!$parent.closest('.navbar-nav').length){$('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click',clearMenus)} 2467var relatedTarget={relatedTarget:this} 2468$parent.trigger(e=$.Event('show.bs.dropdown',relatedTarget)) 2469if(e.isDefaultPrevented())return 2470$this.trigger('focus').attr('aria-expanded','true') 2471$parent.toggleClass('open').trigger('shown.bs.dropdown',relatedTarget)} 2472return false} 2473Dropdown.prototype.keydown=function(e){if(!/(38|40|27|32)/.test(e.which)||/input|textarea/i.test(e.target.tagName))return 2474var $this=$(this) 2475e.preventDefault() 2476e.stopPropagation() 2477if($this.is('.disabled, :disabled'))return 2478var $parent=getParent($this) 2479var isActive=$parent.hasClass('open') 2480if((!isActive&&e.which!=27)||(isActive&&e.which==27)){if(e.which==27)$parent.find(toggle).trigger('focus') 2481return $this.trigger('click')} 2482var desc=' li:not(.divider):visible a' 2483var $items=$parent.find('[role="menu"]'+desc+', [role="listbox"]'+desc) 2484if(!$items.length)return 2485var index=$items.index(e.target) 2486if(e.which==38&&index>0)index-- 2487if(e.which==40&&index<$items.length-1)index++ 2488if(!~index)index=0 2489$items.eq(index).trigger('focus')} 2490function clearMenus(e){if(e&&e.which===3)return 2491$(backdrop).remove() 2492$(toggle).each(function(){var $this=$(this) 2493var $parent=getParent($this) 2494var relatedTarget={relatedTarget:this} 2495if(!$parent.hasClass('open'))return 2496$parent.trigger(e=$.Event('hide.bs.dropdown',relatedTarget)) 2497if(e.isDefaultPrevented())return 2498$this.attr('aria-expanded','false') 2499$parent.removeClass('open').trigger('hidden.bs.dropdown',relatedTarget)})} 2500function getParent($this){var selector=$this.attr('data-target') 2501if(!selector){selector=$this.attr('href') 2502selector=selector&&/#[A-Za-z]/.test(selector)&&selector.replace(/.*(?=#[^\s]*$)/,'')} 2503var $parent=selector&&$(selector) 2504return $parent&&$parent.length?$parent:$this.parent()} 2505function Plugin(option){return this.each(function(){var $this=$(this) 2506var data=$this.data('bs.dropdown') 2507if(!data)$this.data('bs.dropdown',(data=new Dropdown(this))) 2508if(typeof option=='string')data[option].call($this)})} 2509var old=$.fn.dropdown 2510$.fn.dropdown=Plugin 2511$.fn.dropdown.Constructor=Dropdown 2512$.fn.dropdown.noConflict=function(){$.fn.dropdown=old 2513return this} 2514$(document).on('click.bs.dropdown.data-api',clearMenus).on('click.bs.dropdown.data-api','.dropdown form',function(e){e.stopPropagation()}).on('click.bs.dropdown.data-api',toggle,Dropdown.prototype.toggle).on('keydown.bs.dropdown.data-api',toggle,Dropdown.prototype.keydown).on('keydown.bs.dropdown.data-api','[role="menu"]',Dropdown.prototype.keydown).on('keydown.bs.dropdown.data-api','[role="listbox"]',Dropdown.prototype.keydown)}(jQuery);+function($){'use strict';var Modal=function(element,options){this.options=options 2515this.$body=$(document.body) 2516this.$element=$(element) 2517this.$backdrop=this.isShown=null 2518this.scrollbarWidth=0 2519if(this.options.remote){this.$element.find('.modal-content').load(this.options.remote,$.proxy(function(){this.$element.trigger('loaded.bs.modal')},this))}} 2520Modal.VERSION='3.3.2' 2521Modal.TRANSITION_DURATION=300 2522Modal.BACKDROP_TRANSITION_DURATION=150 2523Modal.DEFAULTS={backdrop:true,keyboard:true,show:true} 2524Modal.prototype.toggle=function(_relatedTarget){return this.isShown?this.hide():this.show(_relatedTarget)} 2525Modal.prototype.show=function(_relatedTarget){var that=this 2526var e=$.Event('show.bs.modal',{relatedTarget:_relatedTarget}) 2527this.$element.trigger(e) 2528if(this.isShown||e.isDefaultPrevented())return 2529this.isShown=true 2530this.checkScrollbar() 2531this.setScrollbar() 2532this.$body.addClass('modal-open') 2533this.escape() 2534this.resize() 2535this.$element.on('click.dismiss.bs.modal','[data-dismiss="modal"]',$.proxy(this.hide,this)) 2536this.backdrop(function(){var transition=$.support.transition&&that.$element.hasClass('fade') 2537if(!that.$element.parent().length){that.$element.appendTo(that.$body)} 2538that.$element.show().scrollTop(0) 2539if(that.options.backdrop)that.adjustBackdrop() 2540that.adjustDialog() 2541if(transition){that.$element[0].offsetWidth} 2542that.$element.addClass('in').attr('aria-hidden',false) 2543that.enforceFocus() 2544var e=$.Event('shown.bs.modal',{relatedTarget:_relatedTarget}) 2545transition?that.$element.find('.modal-dialog').one('bsTransitionEnd',function(){that.$element.trigger('focus').trigger(e)}).emulateTransitionEnd(Modal.TRANSITION_DURATION):that.$element.trigger('focus').trigger(e)})} 2546Modal.prototype.hide=function(e){if(e)e.preventDefault() 2547e=$.Event('hide.bs.modal') 2548this.$element.trigger(e) 2549if(!this.isShown||e.isDefaultPrevented())return 2550this.isShown=false 2551this.escape() 2552this.resize() 2553$(document).off('focusin.bs.modal') 2554this.$element.removeClass('in').attr('aria-hidden',true).off('click.dismiss.bs.modal') 2555$.support.transition&&this.$element.hasClass('fade')?this.$element.one('bsTransitionEnd',$.proxy(this.hideModal,this)).emulateTransitionEnd(Modal.TRANSITION_DURATION):this.hideModal()} 2556Modal.prototype.enforceFocus=function(){$(document).off('focusin.bs.modal').on('focusin.bs.modal',$.proxy(function(e){if(this.$element[0]!==e.target&&!this.$element.has(e.target).length){this.$element.trigger('focus')}},this))} 2557Modal.prototype.escape=function(){if(this.isShown&&this.options.keyboard){this.$element.on('keydown.dismiss.bs.modal',$.proxy(function(e){e.which==27&&this.hide()},this))}else if(!this.isShown){this.$element.off('keydown.dismiss.bs.modal')}} 2558Modal.prototype.resize=function(){if(this.isShown){$(window).on('resize.bs.modal',$.proxy(this.handleUpdate,this))}else{$(window).off('resize.bs.modal')}} 2559Modal.prototype.hideModal=function(){var that=this 2560this.$element.hide() 2561this.backdrop(function(){that.$body.removeClass('modal-open') 2562that.resetAdjustments() 2563that.resetScrollbar() 2564that.$element.trigger('hidden.bs.modal')})} 2565Modal.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove() 2566this.$backdrop=null} 2567Modal.prototype.backdrop=function(callback){var that=this 2568var animate=this.$element.hasClass('fade')?'fade':'' 2569if(this.isShown&&this.options.backdrop){var doAnimate=$.support.transition&&animate 2570this.$backdrop=$('<div class="modal-backdrop '+animate+'" />').prependTo(this.$element).on('click.dismiss.bs.modal',$.proxy(function(e){if(e.target!==e.currentTarget)return 2571this.options.backdrop=='static'?this.$element[0].focus.call(this.$element[0]):this.hide.call(this)},this)) 2572if(doAnimate)this.$backdrop[0].offsetWidth 2573this.$backdrop.addClass('in') 2574if(!callback)return 2575doAnimate?this.$backdrop.one('bsTransitionEnd',callback).emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION):callback()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass('in') 2576var callbackRemove=function(){that.removeBackdrop() 2577callback&&callback()} 2578$.support.transition&&this.$element.hasClass('fade')?this.$backdrop.one('bsTransitionEnd',callbackRemove).emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION):callbackRemove()}else if(callback){callback()}} 2579Modal.prototype.handleUpdate=function(){if(this.options.backdrop)this.adjustBackdrop() 2580this.adjustDialog()} 2581Modal.prototype.adjustBackdrop=function(){this.$backdrop.css('height',0).css('height',this.$element[0].scrollHeight)} 2582Modal.prototype.adjustDialog=function(){var modalIsOverflowing=this.$element[0].scrollHeight>document.documentElement.clientHeight 2583this.$element.css({paddingLeft:!this.bodyIsOverflowing&&modalIsOverflowing?this.scrollbarWidth:'',paddingRight:this.bodyIsOverflowing&&!modalIsOverflowing?this.scrollbarWidth:''})} 2584Modal.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:'',paddingRight:''})} 2585Modal.prototype.checkScrollbar=function(){this.bodyIsOverflowing=document.body.scrollHeight>document.documentElement.clientHeight 2586this.scrollbarWidth=this.measureScrollbar()} 2587Modal.prototype.setScrollbar=function(){var bodyPad=parseInt((this.$body.css('padding-right')||0),10) 2588if(this.bodyIsOverflowing)this.$body.css('padding-right',bodyPad+this.scrollbarWidth)} 2589Modal.prototype.resetScrollbar=function(){this.$body.css('padding-right','')} 2590Modal.prototype.measureScrollbar=function(){var scrollDiv=document.createElement('div') 2591scrollDiv.className='modal-scrollbar-measure' 2592this.$body.append(scrollDiv) 2593var scrollbarWidth=scrollDiv.offsetWidth-scrollDiv.clientWidth 2594this.$body[0].removeChild(scrollDiv) 2595return scrollbarWidth} 2596function Plugin(option,_relatedTarget){return this.each(function(){var $this=$(this) 2597var data=$this.data('bs.modal') 2598var options=$.extend({},Modal.DEFAULTS,$this.data(),typeof option=='object'&&option) 2599if(!data)$this.data('bs.modal',(data=new Modal(this,options))) 2600if(typeof option=='string')data[option](_relatedTarget) 2601else if(options.show)data.show(_relatedTarget)})} 2602var old=$.fn.modal 2603$.fn.modal=Plugin 2604$.fn.modal.Constructor=Modal 2605$.fn.modal.noConflict=function(){$.fn.modal=old 2606return this} 2607$(document).on('click.bs.modal.data-api','[data-toggle="modal"]',function(e){var $this=$(this) 2608var href=$this.attr('href') 2609var $target=$($this.attr('data-target')||(href&&href.replace(/.*(?=#[^\s]+$)/,''))) 2610var option=$target.data('bs.modal')?'toggle':$.extend({remote:!/#/.test(href)&&href},$target.data(),$this.data()) 2611if($this.is('a'))e.preventDefault() 2612$target.one('show.bs.modal',function(showEvent){if(showEvent.isDefaultPrevented())return 2613$target.one('hidden.bs.modal',function(){$this.is(':visible')&&$this.trigger('focus')})}) 2614Plugin.call($target,option,this)})}(jQuery);+function($){'use strict';var Tooltip=function(element,options){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null 2615this.init('tooltip',element,options)} 2616Tooltip.VERSION='3.3.2' 2617Tooltip.TRANSITION_DURATION=150 2618Tooltip.DEFAULTS={animation:true,placement:'top',selector:false,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:'hover focus',title:'',delay:0,html:false,container:false,viewport:{selector:'body',padding:0}} 2619Tooltip.prototype.init=function(type,element,options){this.enabled=true 2620this.type=type 2621this.$element=$(element) 2622this.options=this.getOptions(options) 2623this.$viewport=this.options.viewport&&$(this.options.viewport.selector||this.options.viewport) 2624var triggers=this.options.trigger.split(' ') 2625for(var i=triggers.length;i--;){var trigger=triggers[i] 2626if(trigger=='click'){this.$element.on('click.'+this.type,this.options.selector,$.proxy(this.toggle,this))}else if(trigger!='manual'){var eventIn=trigger=='hover'?'mouseenter':'focusin' 2627var eventOut=trigger=='hover'?'mouseleave':'focusout' 2628this.$element.on(eventIn+'.'+this.type,this.options.selector,$.proxy(this.enter,this)) 2629this.$element.on(eventOut+'.'+this.type,this.options.selector,$.proxy(this.leave,this))}} 2630this.options.selector?(this._options=$.extend({},this.options,{trigger:'manual',selector:''})):this.fixTitle()} 2631Tooltip.prototype.getDefaults=function(){return Tooltip.DEFAULTS} 2632Tooltip.prototype.getOptions=function(options){options=$.extend({},this.getDefaults(),this.$element.data(),options) 2633if(options.delay&&typeof options.delay=='number'){options.delay={show:options.delay,hide:options.delay}} 2634return options} 2635Tooltip.prototype.getDelegateOptions=function(){var options={} 2636var defaults=this.getDefaults() 2637this._options&&$.each(this._options,function(key,value){if(defaults[key]!=value)options[key]=value}) 2638return options} 2639Tooltip.prototype.enter=function(obj){var self=obj instanceof this.constructor?obj:$(obj.currentTarget).data('bs.'+this.type) 2640if(self&&self.$tip&&self.$tip.is(':visible')){self.hoverState='in' 2641return} 2642if(!self){self=new this.constructor(obj.currentTarget,this.getDelegateOptions()) 2643$(obj.currentTarget).data('bs.'+this.type,self)} 2644clearTimeout(self.timeout) 2645self.hoverState='in' 2646if(!self.options.delay||!self.options.delay.show)return self.show() 2647self.timeout=setTimeout(function(){if(self.hoverState=='in')self.show()},self.options.delay.show)} 2648Tooltip.prototype.leave=function(obj){var self=obj instanceof this.constructor?obj:$(obj.currentTarget).data('bs.'+this.type) 2649if(!self){self=new this.constructor(obj.currentTarget,this.getDelegateOptions()) 2650$(obj.currentTarget).data('bs.'+this.type,self)} 2651clearTimeout(self.timeout) 2652self.hoverState='out' 2653if(!self.options.delay||!self.options.delay.hide)return self.hide() 2654self.timeout=setTimeout(function(){if(self.hoverState=='out')self.hide()},self.options.delay.hide)} 2655Tooltip.prototype.show=function(){var e=$.Event('show.bs.'+this.type) 2656if(this.hasContent()&&this.enabled){this.$element.trigger(e) 2657var inDom=$.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]) 2658if(e.isDefaultPrevented()||!inDom)return 2659var that=this 2660var $tip=this.tip() 2661var tipId=this.getUID(this.type) 2662this.setContent() 2663$tip.attr('id',tipId) 2664this.$element.attr('aria-describedby',tipId) 2665if(this.options.animation)$tip.addClass('fade') 2666var placement=typeof this.options.placement=='function'?this.options.placement.call(this,$tip[0],this.$element[0]):this.options.placement 2667var autoToken=/\s?auto?\s?/i 2668var autoPlace=autoToken.test(placement) 2669if(autoPlace)placement=placement.replace(autoToken,'')||'top' 2670$tip.detach().css({top:0,left:0,display:'block'}).addClass(placement).data('bs.'+this.type,this) 2671this.options.container?$tip.appendTo(this.options.container):$tip.insertAfter(this.$element) 2672var pos=this.getPosition() 2673var actualWidth=$tip[0].offsetWidth 2674var actualHeight=$tip[0].offsetHeight 2675if(autoPlace){var orgPlacement=placement 2676var $container=this.options.container?$(this.options.container):this.$element.parent() 2677var containerDim=this.getPosition($container) 2678placement=placement=='bottom'&&pos.bottom+actualHeight>containerDim.bottom?'top':placement=='top'&&pos.top-actualHeight<containerDim.top?'bottom':placement=='right'&&pos.right+actualWidth>containerDim.width?'left':placement=='left'&&pos.left-actualWidth<containerDim.left?'right':placement 2679$tip.removeClass(orgPlacement).addClass(placement)} 2680var calculatedOffset=this.getCalculatedOffset(placement,pos,actualWidth,actualHeight) 2681this.applyPlacement(calculatedOffset,placement) 2682var complete=function(){var prevHoverState=that.hoverState 2683that.$element.trigger('shown.bs.'+that.type) 2684that.hoverState=null 2685if(prevHoverState=='out')that.leave(that)} 2686$.support.transition&&this.$tip.hasClass('fade')?$tip.one('bsTransitionEnd',complete).emulateTransitionEnd(Tooltip.TRANSITION_DURATION):complete()}} 2687Tooltip.prototype.applyPlacement=function(offset,placement){var $tip=this.tip() 2688var width=$tip[0].offsetWidth 2689var height=$tip[0].offsetHeight 2690var marginTop=parseInt($tip.css('margin-top'),10) 2691var marginLeft=parseInt($tip.css('margin-left'),10) 2692if(isNaN(marginTop))marginTop=0 2693if(isNaN(marginLeft))marginLeft=0 2694offset.top=offset.top+marginTop 2695offset.left=offset.left+marginLeft 2696$.offset.setOffset($tip[0],$.extend({using:function(props){$tip.css({top:Math.round(props.top),left:Math.round(props.left)})}},offset),0) 2697$tip.addClass('in') 2698var actualWidth=$tip[0].offsetWidth 2699var actualHeight=$tip[0].offsetHeight 2700if(placement=='top'&&actualHeight!=height){offset.top=offset.top+height-actualHeight} 2701var delta=this.getViewportAdjustedDelta(placement,offset,actualWidth,actualHeight) 2702if(delta.left)offset.left+=delta.left 2703else offset.top+=delta.top 2704var isVertical=/top|bottom/.test(placement) 2705var arrowDelta=isVertical?delta.left*2-width+actualWidth:delta.top*2-height+actualHeight 2706var arrowOffsetPosition=isVertical?'offsetWidth':'offsetHeight' 2707$tip.offset(offset) 2708this.replaceArrow(arrowDelta,$tip[0][arrowOffsetPosition],isVertical)} 2709Tooltip.prototype.replaceArrow=function(delta,dimension,isHorizontal){this.arrow().css(isHorizontal?'left':'top',50*(1-delta/dimension)+'%').css(isHorizontal?'top':'left','')} 2710Tooltip.prototype.setContent=function(){var $tip=this.tip() 2711var title=this.getTitle() 2712$tip.find('.tooltip-inner')[this.options.html?'html':'text'](title) 2713$tip.removeClass('fade in top bottom left right')} 2714Tooltip.prototype.hide=function(callback){var that=this 2715var $tip=this.tip() 2716var e=$.Event('hide.bs.'+this.type) 2717function complete(){if(that.hoverState!='in')$tip.detach() 2718that.$element.removeAttr('aria-describedby').trigger('hidden.bs.'+that.type) 2719callback&&callback()} 2720this.$element.trigger(e) 2721if(e.isDefaultPrevented())return 2722$tip.removeClass('in') 2723$.support.transition&&this.$tip.hasClass('fade')?$tip.one('bsTransitionEnd',complete).emulateTransitionEnd(Tooltip.TRANSITION_DURATION):complete() 2724this.hoverState=null 2725return this} 2726Tooltip.prototype.fixTitle=function(){var $e=this.$element 2727if($e.attr('title')||typeof($e.attr('data-original-title'))!='string'){$e.attr('data-original-title',$e.attr('title')||'').attr('title','')}} 2728Tooltip.prototype.hasContent=function(){return this.getTitle()} 2729Tooltip.prototype.getPosition=function($element){$element=$element||this.$element 2730var el=$element[0] 2731var isBody=el.tagName=='BODY' 2732var elRect=el.getBoundingClientRect() 2733if(elRect.width==null){elRect=$.extend({},elRect,{width:elRect.right-elRect.left,height:elRect.bottom-elRect.top})} 2734var elOffset=isBody?{top:0,left:0}:$element.offset() 2735var scroll={scroll:isBody?document.documentElement.scrollTop||document.body.scrollTop:$element.scrollTop()} 2736var outerDims=isBody?{width:$(window).width(),height:$(window).height()}:null 2737return $.extend({},elRect,scroll,outerDims,elOffset)} 2738Tooltip.prototype.getCalculatedOffset=function(placement,pos,actualWidth,actualHeight){return placement=='bottom'?{top:pos.top+pos.height,left:pos.left+pos.width/2-actualWidth/2}:placement=='top'?{top:pos.top-actualHeight,left:pos.left+pos.width/2-actualWidth/2}:placement=='left'?{top:pos.top+pos.height/2-actualHeight/2,left:pos.left-actualWidth}:{top:pos.top+pos.height/2-actualHeight/2,left:pos.left+pos.width}} 2739Tooltip.prototype.getViewportAdjustedDelta=function(placement,pos,actualWidth,actualHeight){var delta={top:0,left:0} 2740if(!this.$viewport)return delta 2741var viewportPadding=this.options.viewport&&this.options.viewport.padding||0 2742var viewportDimensions=this.getPosition(this.$viewport) 2743if(/right|left/.test(placement)){var topEdgeOffset=pos.top-viewportPadding-viewportDimensions.scroll 2744var bottomEdgeOffset=pos.top+viewportPadding-viewportDimensions.scroll+actualHeight 2745if(topEdgeOffset<viewportDimensions.top){delta.top=viewportDimensions.top-topEdgeOffset}else if(bottomEdgeOffset>viewportDimensions.top+viewportDimensions.height){delta.top=viewportDimensions.top+viewportDimensions.height-bottomEdgeOffset}}else{var leftEdgeOffset=pos.left-viewportPadding 2746var rightEdgeOffset=pos.left+viewportPadding+actualWidth 2747if(leftEdgeOffset<viewportDimensions.left){delta.left=viewportDimensions.left-leftEdgeOffset}else if(rightEdgeOffset>viewportDimensions.width){delta.left=viewportDimensions.left+viewportDimensions.width-rightEdgeOffset}} 2748return delta} 2749Tooltip.prototype.getTitle=function(){var title 2750var $e=this.$element 2751var o=this.options 2752title=$e.attr('data-original-title')||(typeof o.title=='function'?o.title.call($e[0]):o.title) 2753return title} 2754Tooltip.prototype.getUID=function(prefix){do prefix+=~~(Math.random()*1000000) 2755while(document.getElementById(prefix)) 2756return prefix} 2757Tooltip.prototype.tip=function(){return(this.$tip=this.$tip||$(this.options.template))} 2758Tooltip.prototype.arrow=function(){return(this.$arrow=this.$arrow||this.tip().find('.tooltip-arrow'))} 2759Tooltip.prototype.enable=function(){this.enabled=true} 2760Tooltip.prototype.disable=function(){this.enabled=false} 2761Tooltip.prototype.toggleEnabled=function(){this.enabled=!this.enabled} 2762Tooltip.prototype.toggle=function(e){var self=this 2763if(e){self=$(e.currentTarget).data('bs.'+this.type) 2764if(!self){self=new this.constructor(e.currentTarget,this.getDelegateOptions()) 2765$(e.currentTarget).data('bs.'+this.type,self)}} 2766self.tip().hasClass('in')?self.leave(self):self.enter(self)} 2767Tooltip.prototype.destroy=function(){var that=this 2768clearTimeout(this.timeout) 2769this.hide(function(){that.$element.off('.'+that.type).removeData('bs.'+that.type)})} 2770function Plugin(option){return this.each(function(){var $this=$(this) 2771var data=$this.data('bs.tooltip') 2772var options=typeof option=='object'&&option 2773if(!data&&option=='destroy')return 2774if(!data)$this.data('bs.tooltip',(data=new Tooltip(this,options))) 2775if(typeof option=='string')data[option]()})} 2776var old=$.fn.tooltip 2777$.fn.tooltip=Plugin 2778$.fn.tooltip.Constructor=Tooltip 2779$.fn.tooltip.noConflict=function(){$.fn.tooltip=old 2780return this}}(jQuery);+function($){'use strict';var Popover=function(element,options){this.init('popover',element,options)} 2781if(!$.fn.tooltip)throw new Error('Popover requires tooltip.js') 2782Popover.VERSION='3.3.2' 2783Popover.DEFAULTS=$.extend({},$.fn.tooltip.Constructor.DEFAULTS,{placement:'right',trigger:'click',content:'',template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}) 2784Popover.prototype=$.extend({},$.fn.tooltip.Constructor.prototype) 2785Popover.prototype.constructor=Popover 2786Popover.prototype.getDefaults=function(){return Popover.DEFAULTS} 2787Popover.prototype.setContent=function(){var $tip=this.tip() 2788var title=this.getTitle() 2789var content=this.getContent() 2790$tip.find('.popover-title')[this.options.html?'html':'text'](title) 2791$tip.find('.popover-content').children().detach().end()[this.options.html?(typeof content=='string'?'html':'append'):'text'](content) 2792$tip.removeClass('fade top bottom left right in') 2793if(!$tip.find('.popover-title').html())$tip.find('.popover-title').hide()} 2794Popover.prototype.hasContent=function(){return this.getTitle()||this.getContent()} 2795Popover.prototype.getContent=function(){var $e=this.$element 2796var o=this.options 2797return $e.attr('data-content')||(typeof o.content=='function'?o.content.call($e[0]):o.content)} 2798Popover.prototype.arrow=function(){return(this.$arrow=this.$arrow||this.tip().find('.arrow'))} 2799Popover.prototype.tip=function(){if(!this.$tip)this.$tip=$(this.options.template) 2800return this.$tip} 2801function Plugin(option){return this.each(function(){var $this=$(this) 2802var data=$this.data('bs.popover') 2803var options=typeof option=='object'&&option 2804if(!data&&option=='destroy')return 2805if(!data)$this.data('bs.popover',(data=new Popover(this,options))) 2806if(typeof option=='string')data[option]()})} 2807var old=$.fn.popover 2808$.fn.popover=Plugin 2809$.fn.popover.Constructor=Popover 2810$.fn.popover.noConflict=function(){$.fn.popover=old 2811return this}}(jQuery);+function($){'use strict';function ScrollSpy(element,options){var process=$.proxy(this.process,this) 2812this.$body=$('body') 2813this.$scrollElement=$(element).is('body')?$(window):$(element) 2814this.options=$.extend({},ScrollSpy.DEFAULTS,options) 2815this.selector=(this.options.target||'')+' .nav li > a' 2816this.offsets=[] 2817this.targets=[] 2818this.activeTarget=null 2819this.scrollHeight=0 2820this.$scrollElement.on('scroll.bs.scrollspy',process) 2821this.refresh() 2822this.process()} 2823ScrollSpy.VERSION='3.3.2' 2824ScrollSpy.DEFAULTS={offset:10} 2825ScrollSpy.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)} 2826ScrollSpy.prototype.refresh=function(){var offsetMethod='offset' 2827var offsetBase=0 2828if(!$.isWindow(this.$scrollElement[0])){offsetMethod='position' 2829offsetBase=this.$scrollElement.scrollTop()} 2830this.offsets=[] 2831this.targets=[] 2832this.scrollHeight=this.getScrollHeight() 2833var self=this 2834this.$body.find(this.selector).map(function(){var $el=$(this) 2835var href=$el.data('target')||$el.attr('href') 2836var $href=/^#./.test(href)&&$(href) 2837return($href&&$href.length&&$href.is(':visible')&&[[$href[offsetMethod]().top+offsetBase,href]])||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){self.offsets.push(this[0]) 2838self.targets.push(this[1])})} 2839ScrollSpy.prototype.process=function(){var scrollTop=this.$scrollElement.scrollTop()+this.options.offset 2840var scrollHeight=this.getScrollHeight() 2841var maxScroll=this.options.offset+scrollHeight-this.$scrollElement.height() 2842var offsets=this.offsets 2843var targets=this.targets 2844var activeTarget=this.activeTarget 2845var i 2846if(this.scrollHeight!=scrollHeight){this.refresh()} 2847if(scrollTop>=maxScroll){return activeTarget!=(i=targets[targets.length-1])&&this.activate(i)} 2848if(activeTarget&&scrollTop<offsets[0]){this.activeTarget=null 2849return this.clear()} 2850for(i=offsets.length;i--;){activeTarget!=targets[i]&&scrollTop>=offsets[i]&&(!offsets[i+1]||scrollTop<=offsets[i+1])&&this.activate(targets[i])}} 2851ScrollSpy.prototype.activate=function(target){this.activeTarget=target 2852this.clear() 2853var selector=this.selector+'[data-target="'+target+'"],'+ 2854this.selector+'[href="'+target+'"]' 2855var active=$(selector).parents('li').addClass('active') 2856if(active.parent('.dropdown-menu').length){active=active.closest('li.dropdown').addClass('active')} 2857active.trigger('activate.bs.scrollspy')} 2858ScrollSpy.prototype.clear=function(){$(this.selector).parentsUntil(this.options.target,'.active').removeClass('active')} 2859function Plugin(option){return this.each(function(){var $this=$(this) 2860var data=$this.data('bs.scrollspy') 2861var options=typeof option=='object'&&option 2862if(!data)$this.data('bs.scrollspy',(data=new ScrollSpy(this,options))) 2863if(typeof option=='string')data[option]()})} 2864var old=$.fn.scrollspy 2865$.fn.scrollspy=Plugin 2866$.fn.scrollspy.Constructor=ScrollSpy 2867$.fn.scrollspy.noConflict=function(){$.fn.scrollspy=old 2868return this} 2869$(window).on('load.bs.scrollspy.data-api',function(){$('[data-spy="scroll"]').each(function(){var $spy=$(this) 2870Plugin.call($spy,$spy.data())})})}(jQuery);+function($){'use strict';var Tab=function(element){this.element=$(element)} 2871Tab.VERSION='3.3.2' 2872Tab.TRANSITION_DURATION=150 2873Tab.prototype.show=function(){var $this=this.element 2874var $ul=$this.closest('ul:not(.dropdown-menu)') 2875var selector=$this.data('target') 2876if(!selector){selector=$this.attr('href') 2877selector=selector&&selector.replace(/.*(?=#[^\s]*$)/,'')} 2878if($this.parent('li').hasClass('active'))return 2879var $previous=$ul.find('.active:last a') 2880var hideEvent=$.Event('hide.bs.tab',{relatedTarget:$this[0]}) 2881var showEvent=$.Event('show.bs.tab',{relatedTarget:$previous[0]}) 2882$previous.trigger(hideEvent) 2883$this.trigger(showEvent) 2884if(showEvent.isDefaultPrevented()||hideEvent.isDefaultPrevented())return 2885var $target=$(selector) 2886this.activate($this.closest('li'),$ul) 2887this.activate($target,$target.parent(),function(){$previous.trigger({type:'hidden.bs.tab',relatedTarget:$this[0]}) 2888$this.trigger({type:'shown.bs.tab',relatedTarget:$previous[0]})})} 2889Tab.prototype.activate=function(element,container,callback){var $active=container.find('> .active') 2890var transition=callback&&$.support.transition&&(($active.length&&$active.hasClass('fade'))||!!container.find('> .fade').length) 2891function next(){$active.removeClass('active').find('> .dropdown-menu > .active').removeClass('active').end().find('[data-toggle="tab"]').attr('aria-expanded',false) 2892element.addClass('active').find('[data-toggle="tab"]').attr('aria-expanded',true) 2893if(transition){element[0].offsetWidth 2894element.addClass('in')}else{element.removeClass('fade')} 2895if(element.parent('.dropdown-menu')){element.closest('li.dropdown').addClass('active').end().find('[data-toggle="tab"]').attr('aria-expanded',true)} 2896callback&&callback()} 2897$active.length&&transition?$active.one('bsTransitionEnd',next).emulateTransitionEnd(Tab.TRANSITION_DURATION):next() 2898$active.removeClass('in')} 2899function Plugin(option){return this.each(function(){var $this=$(this) 2900var data=$this.data('bs.tab') 2901if(!data)$this.data('bs.tab',(data=new Tab(this))) 2902if(typeof option=='string')data[option]()})} 2903var old=$.fn.tab 2904$.fn.tab=Plugin 2905$.fn.tab.Constructor=Tab 2906$.fn.tab.noConflict=function(){$.fn.tab=old 2907return this} 2908var clickHandler=function(e){e.preventDefault() 2909Plugin.call($(this),'show')} 2910$(document).on('click.bs.tab.data-api','[data-toggle="tab"]',clickHandler).on('click.bs.tab.data-api','[data-toggle="pill"]',clickHandler)}(jQuery);+function($){'use strict';var Affix=function(element,options){this.options=$.extend({},Affix.DEFAULTS,options) 2911this.$target=$(this.options.target).on('scroll.bs.affix.data-api',$.proxy(this.checkPosition,this)).on('click.bs.affix.data-api',$.proxy(this.checkPositionWithEventLoop,this)) 2912this.$element=$(element) 2913this.affixed=this.unpin=this.pinnedOffset=null 2914this.checkPosition()} 2915Affix.VERSION='3.3.2' 2916Affix.RESET='affix affix-top affix-bottom' 2917Affix.DEFAULTS={offset:0,target:window} 2918Affix.prototype.getState=function(scrollHeight,height,offsetTop,offsetBottom){var scrollTop=this.$target.scrollTop() 2919var position=this.$element.offset() 2920var targetHeight=this.$target.height() 2921if(offsetTop!=null&&this.affixed=='top')return scrollTop<offsetTop?'top':false 2922if(this.affixed=='bottom'){if(offsetTop!=null)return(scrollTop+this.unpin<=position.top)?false:'bottom' 2923return(scrollTop+targetHeight<=scrollHeight-offsetBottom)?false:'bottom'} 2924var initializing=this.affixed==null 2925var colliderTop=initializing?scrollTop:position.top 2926var colliderHeight=initializing?targetHeight:height 2927if(offsetTop!=null&&scrollTop<=offsetTop)return'top' 2928if(offsetBottom!=null&&(colliderTop+colliderHeight>=scrollHeight-offsetBottom))return'bottom' 2929return false} 2930Affix.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset 2931this.$element.removeClass(Affix.RESET).addClass('affix') 2932var scrollTop=this.$target.scrollTop() 2933var position=this.$element.offset() 2934return(this.pinnedOffset=position.top-scrollTop)} 2935Affix.prototype.checkPositionWithEventLoop=function(){setTimeout($.proxy(this.checkPosition,this),1)} 2936Affix.prototype.checkPosition=function(){if(!this.$element.is(':visible'))return 2937var height=this.$element.height() 2938var offset=this.options.offset 2939var offsetTop=offset.top 2940var offsetBottom=offset.bottom 2941var scrollHeight=$('body').height() 2942if(typeof offset!='object')offsetBottom=offsetTop=offset 2943if(typeof offsetTop=='function')offsetTop=offset.top(this.$element) 2944if(typeof offsetBottom=='function')offsetBottom=offset.bottom(this.$element) 2945var affix=this.getState(scrollHeight,height,offsetTop,offsetBottom) 2946if(this.affixed!=affix){if(this.unpin!=null)this.$element.css('top','') 2947var affixType='affix'+(affix?'-'+affix:'') 2948var e=$.Event(affixType+'.bs.affix') 2949this.$element.trigger(e) 2950if(e.isDefaultPrevented())return 2951this.affixed=affix 2952this.unpin=affix=='bottom'?this.getPinnedOffset():null 2953this.$element.removeClass(Affix.RESET).addClass(affixType).trigger(affixType.replace('affix','affixed')+'.bs.affix')} 2954if(affix=='bottom'){this.$element.offset({top:scrollHeight-height-offsetBottom})}} 2955function Plugin(option){return this.each(function(){var $this=$(this) 2956var data=$this.data('bs.affix') 2957var options=typeof option=='object'&&option 2958if(!data)$this.data('bs.affix',(data=new Affix(this,options))) 2959if(typeof option=='string')data[option]()})} 2960var old=$.fn.affix 2961$.fn.affix=Plugin 2962$.fn.affix.Constructor=Affix 2963$.fn.affix.noConflict=function(){$.fn.affix=old 2964return this} 2965$(window).on('load',function(){$('[data-spy="affix"]').each(function(){var $spy=$(this) 2966var data=$spy.data() 2967data.offset=data.offset||{} 2968if(data.offsetBottom!=null)data.offset.bottom=data.offsetBottom 2969if(data.offsetTop!=null)data.offset.top=data.offsetTop 2970Plugin.call($spy,data)})})}(jQuery);(function($){"use strict";var BootstrapDialog=function(options){this.defaultOptions=$.extend(true,{id:BootstrapDialog.newGuid(),buttons:[],data:{},onshow:null,onshown:null,onhide:null,onhidden:null},BootstrapDialog.defaultOptions);this.indexedButtons={};this.registeredButtonHotkeys={};this.draggableData={isMouseDown:false,mouseOffset:{}};this.realized=false;this.opened=false;this.initOptions(options);this.holdThisInstance();};BootstrapDialog.NAMESPACE='bootstrap-dialog';BootstrapDialog.TYPE_DEFAULT='type-default';BootstrapDialog.TYPE_INFO='type-info';BootstrapDialog.TYPE_PRIMARY='type-primary';BootstrapDialog.TYPE_SUCCESS='type-success';BootstrapDialog.TYPE_WARNING='type-warning';BootstrapDialog.TYPE_DANGER='type-danger';BootstrapDialog.DEFAULT_TEXTS={};BootstrapDialog.DEFAULT_TEXTS[BootstrapDialog.TYPE_DEFAULT]=' ';BootstrapDialog.DEFAULT_TEXTS[BootstrapDialog.TYPE_INFO]=' ';BootstrapDialog.DEFAULT_TEXTS[BootstrapDialog.TYPE_PRIMARY]=' ';BootstrapDialog.DEFAULT_TEXTS[BootstrapDialog.TYPE_SUCCESS]='Sukces';BootstrapDialog.DEFAULT_TEXTS[BootstrapDialog.TYPE_WARNING]='Uwaga';BootstrapDialog.DEFAULT_TEXTS[BootstrapDialog.TYPE_DANGER]='Uwaga';BootstrapDialog.SIZE_NORMAL='size-normal';BootstrapDialog.SIZE_LARGE='size-large';BootstrapDialog.BUTTON_SIZES={};BootstrapDialog.BUTTON_SIZES[BootstrapDialog.SIZE_NORMAL]='';BootstrapDialog.BUTTON_SIZES[BootstrapDialog.SIZE_LARGE]='btn-lg';BootstrapDialog.ICON_SPINNER='glyphicon glyphicon-asterisk';BootstrapDialog.defaultOptions={type:BootstrapDialog.TYPE_PRIMARY,size:BootstrapDialog.SIZE_NORMAL,cssClass:'',title:null,message:null,nl2br:true,closable:true,spinicon:BootstrapDialog.ICON_SPINNER,autodestroy:true,draggable:false};BootstrapDialog.configDefaultOptions=function(options){BootstrapDialog.defaultOptions=$.extend(true,BootstrapDialog.defaultOptions,options);};BootstrapDialog.dialogs={};BootstrapDialog.openAll=function(){$.each(BootstrapDialog.dialogs,function(id,dialogInstance){dialogInstance.open();});};BootstrapDialog.closeAll=function(){$.each(BootstrapDialog.dialogs,function(id,dialogInstance){dialogInstance.close();});};BootstrapDialog.prototype={constructor:BootstrapDialog,initOptions:function(options){this.options=$.extend(true,this.defaultOptions,options);return this;},holdThisInstance:function(){BootstrapDialog.dialogs[this.getId()]=this;return this;},initModalStuff:function(){this.setModal(this.createModal()).setModalDialog(this.createModalDialog()).setModalContent(this.createModalContent()).setModalHeader(this.createModalHeader()).setModalBody(this.createModalBody()).setModalFooter(this.createModalFooter());this.getModal().append(this.getModalDialog());this.getModalDialog().append(this.getModalContent());this.getModalContent().append(this.getModalHeader()).append(this.getModalBody()).append(this.getModalFooter());return this;},createModal:function(){var $modal=$('<div class="modal fade" tabindex="-1"></div>');$modal.prop('id',this.getId());return $modal;},getModal:function(){return this.$modal;},setModal:function($modal){this.$modal=$modal;return this;},createModalDialog:function(){return $('<div class="modal-dialog"></div>');},getModalDialog:function(){return this.$modalDialog;},setModalDialog:function($modalDialog){this.$modalDialog=$modalDialog;return this;},createModalContent:function(){return $('<div class="modal-content"></div>');},getModalContent:function(){return this.$modalContent;},setModalContent:function($modalContent){this.$modalContent=$modalContent;return this;},createModalHeader:function(){return $('<div class="modal-header"></div>');},getModalHeader:function(){return this.$modalHeader;},setModalHeader:function($modalHeader){this.$modalHeader=$modalHeader;return this;},createModalBody:function(){return $('<div class="modal-body"></div>');},getModalBody:function(){return this.$modalBody;},setModalBody:function($modalBody){this.$modalBody=$modalBody;return this;},createModalFooter:function(){return $('<div class="modal-footer"></div>');},getModalFooter:function(){return this.$modalFooter;},setModalFooter:function($modalFooter){this.$modalFooter=$modalFooter;return this;},createDynamicContent:function(rawContent){var content=null;if(typeof rawContent==='function'){content=rawContent.call(rawContent,this);}else{content=rawContent;} 2971if(typeof content==='string'){content=this.formatStringContent(content);} 2972return content;},formatStringContent:function(content){if(this.options.nl2br){return content.replace(/\r\n/g,'<br />').replace(/[\r\n]/g,'<br />');} 2973return content;},setData:function(key,value){this.options.data[key]=value;return this;},getData:function(key){return this.options.data[key];},setId:function(id){this.options.id=id;return this;},getId:function(){return this.options.id;},getType:function(){return this.options.type;},setType:function(type){this.options.type=type;return this;},getSize:function(){return this.options.size;},setSize:function(size){this.options.size=size;return this;},getCssClass:function(){return this.options.cssClass;},setCssClass:function(cssClass){this.options.cssClass=cssClass;return this;},getTitle:function(){return this.options.title;},setTitle:function(title){this.options.title=title;this.updateTitle();return this;},updateTitle:function(){if(this.isRealized()){var title=this.getTitle()!==null?this.createDynamicContent(this.getTitle()):this.getDefaultText();this.getModalHeader().find('.'+this.getNamespace('title')).html('').append(title);} 2974return this;},getMessage:function(){return this.options.message;},setMessage:function(message){this.options.message=message;this.updateMessage();return this;},updateMessage:function(){if(this.isRealized()){var message=this.createDynamicContent(this.getMessage());this.getModalBody().find('.'+this.getNamespace('message')).html('').append(message);} 2975return this;},isClosable:function(){return this.options.closable;},setClosable:function(closable){this.options.closable=closable;this.updateClosable();return this;},getSpinicon:function(){return this.options.spinicon;},setSpinicon:function(spinicon){this.options.spinicon=spinicon;return this;},addButton:function(button){this.options.buttons.push(button);return
vendor: 3,337 bytes, lines 2975-2983
2975this;},addButtons:function(buttons){var that=this;$.each(buttons,function(index,button){that.addButton(button);});return this;},getButtons:function(){return this.options.buttons;},setButtons:function(buttons){this.options.buttons=buttons;this.updateButtons();return this;},getButton:function(id){if(typeof this.indexedButtons[id]!=='undefined'){return this.indexedButtons[id];} 2976return null;},getButtonSize:function(){if(typeof BootstrapDialog.BUTTON_SIZES[this.getSize()]!=='undefined'){return BootstrapDialog.BUTTON_SIZES[this.getSize()];} 2977return'';},updateButtons:function(){if(this.isRealized()){if(this.getButtons().length===0){this.getModalFooter().hide();}else{this.getModalFooter().find('.'+this.getNamespace('footer')).html('').append(this.createFooterButtons());}} 2978return this;},isAutodestroy:function(){return this.options.autodestroy;},setAutodestroy:function(autodestroy){this.options.autodestroy=autodestroy;},getDefaultText:function(){return BootstrapDialog.DEFAULT_TEXTS[this.getType()];},getNamespace:function(name){return BootstrapDialog.NAMESPACE+'-'+name;},createHeaderContent:function(){var $container=$('<div></div>');$container.addClass(this.getNamespace('header'));$container.append(this.createTitleContent());$container.append(this.createCloseButton());return $container;},createTitleContent:function(){var $title=$('<div></div>');$title.addClass(this.getNamespace('title'));return $title;},createCloseButton:function(){var $container=$('<div></div>');$container.addClass(this.getNamespace('close-button'));var $icon=$('<button class="close">×</button>');$container.append($icon);$container.on('click',{dialog:this},function(event){event.data.dialog.close();});return $container;},createBodyContent:function(){var $container=$('<div></div>');$container.addClass(this.getNamespace('body'));$container.append(this.createMessageContent());return $container;},createMessageContent:function(){var $message=$('<div></div>');$message.addClass(this.getNamespace('message'));return $message;},createFooterContent:function(){var $container=$('<div></div>');$container.addClass(this.getNamespace('footer'));return $container;},createFooterButtons:function(){var that=this;var $container=$('<div></div>');$container.addClass(this.getNamespace('footer-buttons'));this.indexedButtons={};$.each(this.options.buttons,function(index,button){if(!button.id){button.id=BootstrapDialog.newGuid();} 2979var $button=that.createButton(button);that.indexedButtons[button.id]=$button;$container.append($button);});return $container;},createButton:function(button){var $button=$('<button class="btn"></button>');$button.addClass(this.getButtonSize());$button.prop('id',button.id);if(typeof button.icon!==undefined&&$.trim(button.icon)!==''){$button.append(this.createButtonIcon(button.icon));} 2980if(typeof button.label!==undefined){$button.append(button.label);} 2981if(typeof button.cssClass!==undefined&&$.trim(button.cssClass)!==''){$button.addClass(button.cssClass);}else{$button.addClass('btn-default');} 2982if(typeof button.hotkey!==undefined){this.registeredButtonHotkeys[button.hotkey]=$button;} 2983$button.on('click',{dialog:this,$button:$button,button:button},function(event){var dialog=event.data.dialog;var $button=event.data.$button;var button=event.data.button;if(typeof button.action==='function'){button.action.call($button,dialog);}
2984if(button.autospin){$button.toggleSpin(true);}});this.enhanceButton($button);return $button;},enhanceButton:function($button){$button.dialog=this;$button.toggleEnable=function(enable){var $this=this;$this.prop("disabled",!enable).toggleClass('disabled',!enable);return $this;};$button.enable=function(){var $this=this;$this.toggleEnable(true);return $this;};$button.disable=function(){var $this=this;$this.toggleEnable(false);return $this;};$button.toggleSpin=function(spin){var $this=this;var dialog=$this.dialog;var $icon=$this.find('.'+dialog.getNamespace('button-icon'));if(spin){$icon.hide();$button.prepend(dialog.createButtonIcon(dialog.getSpinicon()).addClass('icon-spin'));}else{$icon.show();$button.find('.icon-spin').remove();} 2985return $this;};$button.spin=function(){var $this=this;$this.toggleSpin(true);return $this;};$button.stopSpin=function(){var $this=this;$this.toggleSpin(false);return $this;};return this;},createButtonIcon:function(icon){var $icon=$('<span></span>');$icon.addClass(this.getNamespace('button-icon')).addClass(icon);return $icon;},enableButtons:function(enable){$.each(this.indexedButtons,function(id,$button){$button.toggleEnable(enable);});return this;},updateClosable:function(){if(this.isRealized()){this.getModalHeader().find('.'+this.getNamespace('close-button')).toggle(this.isClosable());} 2986return this;},onShow:function(onshow){this.options.onshow=onshow;return this;},onShown:function(onshown){this.options.onshown=onshown;return this;},onHide:function(onhide){this.options.onhide=onhide;return this;},onHidden:function(onhidden){this.options.onhidden=onhidden;return this;},isRealized:function(){return this.realized;},setRealized:function(realized){this.realized=realized;return this;},isOpened:function(){return this.opened;},setOpened:function(opened){this.opened=opened;return this;},handleModalEvents:function(){this.getModal().on('show.bs.modal',{dialog:this},function(event){var dialog=event.data.dialog;typeof dialog.options.onshow==='function'&&dialog.options.onshow(dialog);dialog.showPageScrollBar(true);});this.getModal().on('shown.bs.modal',{dialog:this},function(event){var dialog=event.data.dialog;typeof dialog.options.onshown==='function'&&dialog.options.onshown(dialog);dialog.showPageScrollBar(true);});this.getModal().on('hide.bs.modal',{dialog:this},function(event){var dialog=event.data.dialog;typeof dialog.options.onhide==='function'&&dialog.options.onhide(dialog);});this.getModal().on('hidden.bs.modal',{dialog:this},function(event){var dialog=event.data.dialog;typeof dialog.options.onhidden==='function'&&dialog.options.onhidden(dialog);dialog.isAutodestroy()&&$(this).remove();dialog.showPageScrollBar(false);});this.getModal().on('click',{dialog:this},function(event){event.target===this&&event.data.dialog.isClosable()&&event.data.dialog.close();});this.getModal().on('keyup',{dialog:this},function(event){event.which===27&&event.data.dialog.isClosable()&&event.data.dialog.close();});this.getModal().on('keyup',{dialog:this},function(event){var dialog=event.data.dialog;if(typeof dialog.registeredButtonHotkeys[event.which]!=='undefined'){var $button=$(dialog.registeredButtonHotkeys[event.which]);!$button.prop('disabled')&&$button.focus().trigger('click');}});return this;},makeModalDraggable:function(){if(this.options.draggable){this.getModalHeader().addClass(this.getNamespace('draggable')).on('mousedown',{dialog:this},function(event){var dialog=event.data.dialog;dialog.draggableData.isMouseDown=true;var dialogOffset=dialog.getModalContent().offset();dialog.draggableData.mouseOffset={top:event.clientY-dialogOffset.top,left:event.clientX-dialogOffset.left};});this.getModal().on('mouseup mouseleave',{dialog:this},function(event){event.data.dialog.draggableData.isMouseDown=false;});$('body').on('mousemove',{dialog:this},function(event){var dialog=event.data.dialog;if(!dialog.draggableData.isMouseDown){return;} 2987dialog.getModalContent().offset({top:event.clientY-dialog.draggableData.mouseOffset.top,left:event.clientX-dialog.draggableData.mouseOffset.left});});} 2988return this;},showPageScrollBar:function(show){$(document.body).toggleClass('modal-open',show);},realize:function(){this.initModalStuff();this.getModal().addClass(BootstrapDialog.NAMESPACE).addClass(this.getType()).addClass(this.getSize()).addClass(this.getCssClass());this.getModalFooter().append(this.createFooterContent());this.getModalHeader().append(this.createHeaderContent());this.getModalBody().append(this.createBodyContent());this.getModal().modal({backdrop:'static',keyboard:false,show:false});this.makeModalDraggable();this.handleModalEvents();this.setRealized(true);this.updateButtons();this.updateTitle();this.updateMessage();this.updateClosable();return this;},open:function(){!this.isRealized()&&this.realize();this.getModal().modal('show');this.setOpened(true);return this;},close:function(){this.getModal().modal('hide');if(this.isAutodestroy()){delete BootstrapDialog.dialogs[this.getId()];} 2989this.setOpened(false);return this;}};BootstrapDialog.newGuid=function(){return'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g,function(c){var r=Math.random()*16|0,v=c==='x'?r:(r&0x3|0x8);return v.toString(16);});};BootstrapDialog.show=function(options){return new BootstrapDialog(options).open();};BootstrapDialog.alert=function(){var options={};var defaultOptions={type:BootstrapDialog.TYPE_PRIMARY,title:null,message:null,closable:true,buttonLabel:'OK',callback:null};if(typeof arguments[0]==='object'&&arguments[0].constructor==={}.constructor){options=$.extend(true,defaultOptions,arguments[0]);}else{options=$.extend(true,defaultOptions,{message:arguments[0],closable:false,buttonLabel:'OK',callback:typeof arguments[1]!=='undefined'?arguments[1]:null});} 2990return new BootstrapDialog({type:options.type,title:options.title,message:options.message,closable:options.closable,cssClass:'bootstrap-dialog-alert',data:{callback:options.callback},onhide:function(dialog){!dialog.getData('btnClicked')&&dialog.isClosable()&&typeof dialog.getData('callback')==='function'&&dialog.getData('callback')(false);},buttons:[{label:options.buttonLabel,action:function(dialog){dialog.setData('btnClicked',true);typeof dialog.getData('callback')==='function'&&dialog.getData('callback')(true);dialog.close();}}]}).open();};BootstrapDialog.confirm=function(message,callback){return new BootstrapDialog({title:' ',message:message,closable:false,cssClass:'bootstrap-dialog-confirm',data:{'callback':callback},buttons:[{label:'nie',action:function(dialog){typeof dialog.getData('callback')==='function'&&dialog.getData('callback')(false);dialog.close();}},{label:'tak',cssClass:'btn-primary',action:function(dialog){typeof dialog.getData('callback')==='function'&&dialog.getData('callback')(true);dialog.close();}}]}).open();};BootstrapDialog.init=function(){var hasModule=(typeof module!=='undefined'&&module.exports);if(hasModule) 2991module.exports=BootstrapDialog;else if(typeof define==="function"&&define.amd) 2992define("bootstrap-dialog",function(){return BootstrapDialog;});else 2993window.BootstrapDialog=BootstrapDialog;};
2993BootstrapDialog.init();})(window.jQuery);BootstrapDialog.prompt=function(options){var defaultOptions={type:BootstrapDialog.TYPE_PRIMARY,lines:1,title:'',message:null,instruction:'',initialValue:'',closable:true,callback:function(){},okLabel:'ok',cancelLabel:'anuluj'};options=$.extend(true,defaultOptions,options);if(1===options.lines){var message=['<div>',options.instruction,'</div>','<input type="text" class="prompt-input form-control" value=""/>'].join('');}else{var message=['<div>',options.instruction,'</div>','<textarea rows="',options.lines,'" class="prompt-input form-control"></textarea>'].join('');} 2994return new BootstrapDialog({title:options.title,onshow:function(dialog){$(dialog.$modalContent).find('.prompt-input').val(options.initialValue);},message:message,closable:false,data:{'callback':options.callback},buttons:[{label:options.cancelLabel,action:function(dialog){dialog.close();}},{label:options.okLabel,cssClass:'btn-primary',action:function(dialog){var newValue=$(dialog.$modalContent).find('.prompt-input').val();options.callback(newValue,options.initialValue);dialog.close();}}]}).open();};BootstrapDialog.loader=function(options){if(null!==BootstrapDialog.loader.instance){return BootstrapDialog.loader.instance;} 2995var defaultOptions={type:BootstrapDialog.TYPE_PRIMARY,title:'',message:null,closable:true,callback:function(){}};options=$.extend(true,defaultOptions,options);var message=['<div style="text-align: center; font-size: 50px;"><span class="fa fa-gear fa-spin"></span></div>'].join('');BootstrapDialog.loader.instance=new BootstrapDialog({title:options.title,message:message,cssClass:'bootstrap-dialog-loader',closable:false});return BootstrapDialog.loader.instance;};BootstrapDialog.loader.instance=null;(function(root,factory){if(typeof define==='function'&&define.amd){define(factory);}else if(typeof exports==='object'){module.exports=factory();}else{root.PhotoSwipe=factory();}})(this,function(){'use strict';var PhotoSwipe=function(template,UiClass,items,options){var framework={features:null,bind:function(target,type,listener,unbind){var methodName=(unbind?'remove':'add')+'EventListener';type=type.split(' ');for(var i=0;i<type.length;i++){if(type[i]){target[methodName](type[i],listener,false);}}},isArray:function(obj){return(obj instanceof Array);},createEl:function(classes,tag){var el=document.createElement(tag||'div');if(classes){el.className=classes;} 2996return el;},getScrollY:function(){var yOffset=window.pageYOffset;return yOffset!==undefined?yOffset:document.documentElement.scrollTop;},unbind:function(target,type,listener){framework.bind(target,type,listener,true);},removeClass:function(el,className){var reg=new RegExp('(\\s|^)'+className+'(\\s|$)');el.className=el.className.replace(reg,' ').replace(/^\s\s*/,'').replace(/\s\s*$/,'');},addClass:function(el,className){if(!framework.hasClass(el,className)){el.className+=(el.className?' ':'')+className;}},hasClass:function(el,className){return el.className&&new RegExp('(^|\\s)'+className+'(\\s|$)').test(el.className);},getChildByClass:function(parentEl,childClassName){var node=parentEl.firstChild;while(node){if(framework.hasClass(node,childClassName)){return node;} 2997node=node.nextSibling;}},arraySearch:function(array,value,key){var i=array.length;while(i--){if(array[i][key]===value){return i;}} 2998return-1;},extend:function(o1,o2,preventOverwrite){for(var prop in o2){if(o2.hasOwnProperty(prop)){if(preventOverwrite&&o1.hasOwnProperty(prop)){continue;} 2999o1[prop]=o2[prop];}}},easing:{sine:{out:function(k){return Math.sin(k*(Math.PI/2));},inOut:function(k){return-(Math.cos(Math.PI*k)-1)/2;}},cubic:{out:function(k){return--k*k*k+1;}}},detectFeatures:function(){if(framework.features){return framework.features;} 3000var helperEl=framework.createEl(),helperStyle=helperEl.style,vendor='',features={};features.oldIE=document.all&&!document.addEventListener;features.touch='ontouchstart'in window;if(window.requestAnimationFrame){features.raf=window.requestAnimationFrame;features.caf=window.cancelAnimationFrame;} 3001features.pointerEvent=navigator.pointerEnabled||navigator.msPointerEnabled;if(!features.pointerEvent){var ua=navigator.userAgent;if(/iP(hone|od)/.test(navigator.platform)){var v=(navigator.appVersion).match(/OS (\d+)_(\d+)_?(\d+)?/);if(v&&v.length>0){v=parseInt(v[1],10);if(v>=1&&v<8){features.isOldIOSPhone=true;}}} 3002var match=ua.match(/Android\s([0-9\.]*)/);var androidversion=match?match[1]:0;androidversion=parseFloat(androidversion);if(androidversion>=1){if(androidversion<4.4){features.isOldAndroid=true;} 3003features.androidVersion=androidversion;}
3004features.isMobileOpera=/opera mini|opera mobi/i.test(ua);} 3005var styleChecks=['transform','perspective','animationName'],vendors=['','webkit','Moz','ms','O'],styleCheckItem,styleName;for(var i=0;i<4;i++){vendor=vendors[i];for(var a=0;a<3;a++){styleCheckItem=styleChecks[a];styleName=vendor+(vendor?styleCheckItem.charAt(0).toUpperCase()+styleCheckItem.slice(1):styleCheckItem);if(!features[styleCheckItem]&&styleName in helperStyle){features[styleCheckItem]=styleName;}} 3006if(vendor&&!features.raf){vendor=vendor.toLowerCase();features.raf=window[vendor+'RequestAnimationFrame'];if(features.raf){features.caf=window[vendor+'CancelAnimationFrame']||window[vendor+'CancelRequestAnimationFrame'];}}} 3007if(!features.raf){var lastTime=0;features.raf=function(fn){var currTime=new Date().getTime();var timeToCall=Math.max(0,16-(currTime-lastTime));var id=window.setTimeout(function(){fn(currTime+timeToCall);},timeToCall);lastTime=currTime+timeToCall;return id;};features.caf=function(id){clearTimeout(id);};} 3008features.svg=!!document.createElementNS&&!!document.createElementNS('http://www.w3.org/2000/svg','svg').createSVGRect;framework.features=features;return features;}};framework.detectFeatures();if(framework.features.oldIE){framework.bind=function(target,type,listener,unbind){type=type.split(' ');var methodName=(unbind?'detach':'attach')+'Event',evName,_handleEv=function(){listener.handleEvent.call(listener);};for(var i=0;i<type.length;i++){evName=type[i];if(evName){if(typeof listener==='object'&&listener.handleEvent){if(!unbind){listener['oldIE'+evName]=_handleEv;}else{if(!listener['oldIE'+evName]){return false;}} 3009target[methodName]('on'+evName,listener['oldIE'+evName]);}else{target[methodName]('on'+evName,listener);}}}};} 3010var self=this;var DOUBLE_TAP_RADIUS=25,NUM_HOLDERS=3;var _options={allowPanToNext:true,spacing:0.12,bgOpacity:1,mouseUsed:false,loop:true,pinchToClose:true,closeOnScroll:true,closeOnVerticalDrag:true,hideAnimationDuration:333,showAnimationDuration:333,showHideOpacity:false,focus:true,escKey:true,arrowKeys:true,mainScrollEndFriction:0.35,panEndFriction:0.35,isClickableElement:function(el){return el.tagName==='A';},getDoubleTapZoom:function(isMouseClick,item){if(isMouseClick){return 1;}else{return item.initialZoomLevel<0.7?1:1.5;}},maxSpreadZoom:2,scaleMode:'fit',modal:true,alwaysFadeIn:false};framework.extend(_options,options);var _getEmptyPoint=function(){return{x:0,y:0};};var _isOpen,_isDestroying,_closedByScroll,_currentItemIndex,_containerStyle,_containerShiftIndex,_currPanDist=_getEmptyPoint(),_startPanOffset=_getEmptyPoint(),_panOffset=_getEmptyPoint(),_upMoveEvents,_downEvents,_globalEventHandlers,_viewportSize={},_currZoomLevel,_startZoomLevel,_translatePrefix,_translateSufix,_updateSizeInterval,_itemsNeedUpdate,_currPositionIndex=0,_offset,_slideSize=_getEmptyPoint(),_itemHolders,_prevItemIndex,_indexDiff=0,_dragStartEvent,_dragMoveEvent,_dragEndEvent,_dragCancelEvent,_transformKey,_pointerEventEnabled,_isFixedPosition=true,_likelyTouchDevice,_modules=[],_requestAF,_cancelAF,_initalClassName,_initalWindowScrollY,_oldIE,_currentWindowScrollY,_features,_windowVisibleSize={},_registerModule=function(name,module){framework.extend(self,module.publicMethods);_modules.push(name);},_getLoopedId=function(index){var numSlides=_getNumItems();if(index>numSlides-1){return index-numSlides;}else if(index<0){return numSlides+index;} 3011return index;},_listeners={},_listen=function(name,fn){if(!_listeners[name]){_listeners[name]=[];} 3012return _listeners[name].push(fn);},_shout=function(name){var listeners=_listeners[name];if(listeners){var args=Array.prototype.slice.call(arguments);args.shift();for(var i=0;i<listeners.length;i++){listeners[i].apply(self,args);}}},_getCurrentTime=function(){return new Date().getTime();},_applyBgOpacity=function(opacity){_bgOpacity=opacity;self.bg.style.opacity=opacity*_options.bgOpacity;},_applyZoomTransform=function(styleObj,x,y,zoom){styleObj[_transformKey]=_translatePrefix+x+'px, '+y+'px'+_translateSufix+' scale('+zoom+')';},_applyCurrentZoomPan=function(){if(_currZoomElementStyle){_applyZoomTransform(_currZoomElementStyle,_panOffset.x,_panOffset.
3012y,_currZoomLevel);}},_applyZoomPanToItem=function(item){if(item.container){_applyZoomTransform(item.container.style,item.initialPosition.x,item.initialPosition.y,item.initialZoomLevel);}},_setTranslateX=function(x,elStyle){elStyle[_transformKey]=_translatePrefix+x+'px, 0px'+_translateSufix;},_moveMainScroll=function(x,dragging){if(!_options.loop&&dragging){var newSlideIndexOffset=_currentItemIndex+(_slideSize.x*_currPositionIndex-x)/_slideSize.x;var delta=Math.round(x-_mainScrollPos.x);if((newSlideIndexOffset<0&&delta>0)||(newSlideIndexOffset>=_getNumItems()-1&&delta<0)){x=_mainScrollPos.x+delta*_options.mainScrollEndFriction;}} 3013_mainScrollPos.x=x;_setTranslateX(x,_containerStyle);},_calculatePanOffset=function(axis,zoomLevel){var m=_midZoomPoint[axis]-_offset[axis];return _startPanOffset[axis]+_currPanDist[axis]+m-m*(zoomLevel/_startZoomLevel);},_equalizePoints=function(p1,p2){p1.x=p2.x;p1.y=p2.y;if(p2.id){p1.id=p2.id;}},_roundPoint=function(p){p.x=Math.round(p.x);p.y=Math.round(p.y);},_mouseMoveTimeout=null,_onFirstMouseMove=function(){if(_mouseMoveTimeout){framework.unbind(document,'mousemove',_onFirstMouseMove);framework.addClass(template,'pswp--has_mouse');_options.mouseUsed=true;_shout('mouseUsed');} 3014_mouseMoveTimeout=setTimeout(function(){_mouseMoveTimeout=null;},100);},_bindEvents=function(){framework.bind(document,'keydown',self);if(_features.transform){framework.bind(self.scrollWrap,'click',self);} 3015if(!_options.mouseUsed){framework.bind(document,'mousemove',_onFirstMouseMove);} 3016framework.bind(window,'resize scroll',self);_shout('bindEvents');},_unbindEvents=function(){framework.unbind(window,'resize',self);framework.unbind(window,'scroll',_globalEventHandlers.scroll);framework.unbind(document,'keydown',self);framework.unbind(document,'mousemove',_onFirstMouseMove);if(_features.transform){framework.unbind(self.scrollWrap,'click',self);} 3017if(_isDragging){framework.unbind(window,_upMoveEvents,self);} 3018_shout('unbindEvents');},_calculatePanBounds=function(zoomLevel,update){var bounds=_calculateItemSize(self.currItem,_viewportSize,zoomLevel);if(update){_currPanBounds=bounds;} 3019return bounds;},_getMinZoomLevel=function(item){if(!item){item=self.currItem;} 3020return item.initialZoomLevel;},_getMaxZoomLevel=function(item){if(!item){item=self.currItem;} 3021return item.w>0?_options.maxSpreadZoom:1;},_modifyDestPanOffset=function(axis,destPanBounds,destPanOffset,destZoomLevel){if(destZoomLevel===self.currItem.initialZoomLevel){destPanOffset[axis]=self.currItem.initialPosition[axis];return true;}else{destPanOffset[axis]=_calculatePanOffset(axis,destZoomLevel);if(destPanOffset[axis]>destPanBounds.min[axis]){destPanOffset[axis]=destPanBounds.min[axis];return true;}else if(destPanOffset[axis]<destPanBounds.max[axis]){destPanOffset[axis]=destPanBounds.max[axis];return true;}} 3022return false;},_setupTransforms=function(){if(_transformKey){var allow3dTransform=_features.perspective&&!_likelyTouchDevice;_translatePrefix='translate'+(allow3dTransform?'3d(':'(');_translateSufix=_features.perspective?', 0px)':')';return;} 3023_transformKey='left';framework.addClass(template,'pswp--ie');_setTranslateX=function(x,elStyle){elStyle.left=x+'px';};_applyZoomPanToItem=function(item){var zoomRatio=item.fitRatio>1?1:item.fitRatio,s=item.container.style,w=zoomRatio*item.w,h=zoomRatio*item.h;s.width=w+'px';s.height=h+'px';s.left=item.initialPosition.x+'px';s.top=item.initialPosition.y+'px';};_applyCurrentZoomPan=function(){if(_currZoomElementStyle){var s=_currZoomElementStyle,item=self.currItem,zoomRatio=item.fitRatio>1?1:item.fitRatio,w=zoomRatio*item.w,h=zoomRatio*item.h;s.width=w+'px';s.height=h+'px';s.left=_panOffset.x+'px';s.top=_panOffset.y+'px';}};},_onKeyDown=function(e){var keydownAction='';if(_options.escKey&&e.keyCode===27){keydownAction='close';}else if(_options.arrowKeys){if(e.keyCode===37){keydownAction='prev';}else if(e.keyCode===39){keydownAction='next';}} 3024if(keydownAction){if(!e.ctrlKey&&!e.altKey&&!e.shiftKey&&!e.metaKey){if(e.preventDefault){e.preventDefault();}else{e.returnValue=false;} 3025self[keydownAction]();}}},_onGlobalClick=function(e){if(!e){return;} 3026if(_moved||_zoomStarted||_mainScrollAnimating||_verticalDragInitiated){e.preventDefault();e.stopPropagation();}},_onPageScroll=function(){self.setScrollOffset(0,framework.getScrollY());};var _animations={},_numAnimations=0,_stopAnimation=function(name){if(_animations[name]){if(_animations[name].raf){_cancelAF(_animations[name].raf);} 3027_numAnimations--;delete _animations[name];}},_registerStartAnimation=function(name){if(_animations[name]){_stopAnimation(name);} 3028if(!_animations[name]){_numAnimations++;_animations[name]={};}},_stopAllAnimations=function(){for(var prop in _animations){if(_animations.hasOwnProperty(prop)){_stopAnimation(prop);}}},_animateProp=function(name,b,endProp,d,easingFn,onUpdate,onComplete){var startAnimTime=_getCurrentTime(),t;_registerStartAnimation(name);var animloop=function(){if(_animations[name]){t=_getCurrentTime()-startAnimTime;if(t>=d){_stopAnimation(name);onUpdate(endProp);if(onComplete){onComplete();} 3029return;} 3030onUpdate((endProp-b)*easingFn(t/d)+b);_animations[name].raf=_requestAF(animloop);}};animloop();};
3030var publicMethods={shout:_shout,listen:_listen,viewportSize:_viewportSize,options:_options,isMainScrollAnimating:function(){return _mainScrollAnimating;},getZoomLevel:function(){return _currZoomLevel;},getCurrentIndex:function(){return _currentItemIndex;},isDragging:function(){return _isDragging;},isZooming:function(){return _isZooming;},setScrollOffset:function(x,y){_offset.x=x;_currentWindowScrollY=_offset.y=y;},applyZoomPan:function(zoomLevel,panX,panY){_panOffset.x=panX;_panOffset.y=panY;_currZoomLevel=zoomLevel;_applyCurrentZoomPan();},init:function(){if(_isOpen||_isDestroying){return;} 3031var i;self.framework=framework;self.template=template;self.bg=framework.getChildByClass(template,'pswp__bg');_initalClassName=template.className;_isOpen=true;_features=framework.detectFeatures();_requestAF=_features.raf;_cancelAF=_features.caf;_transformKey=_features.transform;_oldIE=_features.oldIE;self.scrollWrap=framework.getChildByClass(template,'pswp__scroll-wrap');self.container=framework.getChildByClass(self.scrollWrap,'pswp__container');_containerStyle=self.container.style;self.itemHolders=_itemHolders=[{el:self.container.children[0],wrap:0,index:-1},{el:self.container.children[1],wrap:0,index:-1},{el:self.container.children[2],wrap:0,index:-1}];_itemHolders[0].el.style.display=_itemHolders[2].el.style.display='none';_setupTransforms();_globalEventHandlers={resize:self.updateSize,scroll:_onPageScroll,keydown:_onKeyDown,click:_onGlobalClick};var oldPhone=_features.isOldIOSPhone||_features.isOldAndroid||_features.isMobileOpera;
3031if(!_features.animationName||!_features.transform||oldPhone){_options.showAnimationDuration=_options.hideAnimationDuration=0;} 3032for(i=0;i<_modules.length;i++){self['init'+_modules[i]]();} 3033if(UiClass){var ui=self.ui=new UiClass(self,framework);ui.init();} 3034_shout('firstUpdate');_currentItemIndex=_currentItemIndex||_options.index||0;if(isNaN(_currentItemIndex)||_currentItemIndex<0||_currentItemIndex>=_getNumItems()){_currentItemIndex=0;} 3035self.currItem=_getItemAt(_currentItemIndex);if(_features.isOldIOSPhone||_features.isOldAndroid){_isFixedPosition=false;} 3036if(_options.modal){template.setAttribute('aria-hidden','false');if(!_isFixedPosition){template.style.position='absolute';template.style.top=framework.getScrollY()+'px';}else{template.style.position='fixed';}} 3037if(_currentWindowScrollY===undefined){_shout('initialLayout');_currentWindowScrollY=_initalWindowScrollY=framework.getScrollY();} 3038var rootClasses='pswp--open ';if(_options.mainClass){rootClasses+=_options.mainClass+' ';} 3039if(_options.showHideOpacity){rootClasses+='pswp--animate_opacity ';} 3040rootClasses+=_likelyTouchDevice?'pswp--touch':'pswp--notouch';rootClasses+=_features.animationName?' pswp--css_animation':'';rootClasses+=_features.svg?' pswp--svg':'';framework.addClass(template,rootClasses);self.updateSize();_containerShiftIndex=-1;_indexDiff=null;for(i=0;i<NUM_HOLDERS;i++){_setTranslateX((i+_containerShiftIndex)*_slideSize.x,_itemHolders[i].el.style);} 3041if(!_oldIE){framework.bind(self.scrollWrap,_downEvents,self);} 3042_listen('initialZoomInEnd',function(){self.setContent(_itemHolders[0],_currentItemIndex-1);self.setContent(_itemHolders[2],_currentItemIndex+1);_itemHolders[0].el.style.display=_itemHolders[2].el.style.display='block';if(_options.focus){template.focus();} 3043_bindEvents();});self.setContent(_itemHolders[1],_currentItemIndex);self.updateCurrItem();_shout('afterInit');if(!_isFixedPosition){_updateSizeInterval=setInterval(function(){if(!_numAnimations&&!_isDragging&&!_isZooming&&(_currZoomLevel===self.currItem.initialZoomLevel)){self.updateSize();}},1000);} 3044framework.addClass(template,'pswp--visible');},close:function(){if(!_isOpen){return;} 3045_isOpen=false;_isDestroying=true;_shout('close');_unbindEvents();_showOrHide(self.currItem,null,true,self.destroy);},destroy:function(){_shout('destroy');if(_showOrHideTimeout){clearTimeout(_showOrHideTimeout);} 3046if(_options.modal){template.setAttribute('aria-hidden','true');template.className=_initalClassName;} 3047if(_updateSizeInterval){clearInterval(_updateSizeInterval);} 3048framework.unbind(self.scrollWrap,_downEvents,self);framework.unbind(window,'scroll',self);_stopDragUpdateLoop();_stopAllAnimations();_listeners=null;},panTo:function(x,y,force){if(!force){if(x>_currPanBounds.min.x){x=_currPanBounds.min.x;}else if(x<_currPanBounds.max.x){x=_currPanBounds.max.x;} 3049if(y>_currPanBounds.min.y){y=_currPanBounds.min.y;}else if(y<_currPanBounds.max.y){y=_currPanBounds.max.y;}} 3050_panOffset.x=x;_panOffset.y=y;_applyCurrentZoomPan();},handleEvent:function(e){e=e||window.event;if(_globalEventHandlers[e.type]){_globalEventHandlers[e.type](e);}},goTo:function(index){index=_getLoopedId(index);var diff=index-_currentItemIndex;_indexDiff=diff;_currentItemIndex=index;self.currItem=_getItemAt(_currentItemIndex);_currPositionIndex-=diff;_moveMainScroll(_slideSize.x*_currPositionIndex);_stopAllAnimations();_mainScrollAnimating=false;self.updateCurrItem();},next:function(){self.goTo(_currentItemIndex+1);},prev:function(){self.goTo(_currentItemIndex-1);},updateCurrZoomItem:function(emulateSetContent){if(emulateSetContent){_shout('beforeChange',0);} 3051if(_itemHolders[1].el.children.length){var zoomElement=_itemHolders[1].el.children[0];if(framework.hasClass(zoomElement,'pswp__zoom-wrap')){_currZoomElementStyle=zoomElement.style;}else{_currZoomElementStyle=null;}}else{_currZoomElementStyle=null;} 3052_currPanBounds=self.currItem.bounds;_startZoomLevel=_currZoomLevel=self.currItem.initialZoomLevel;_panOffset.x=_currPanBounds.center.x;_panOffset.y=_currPanBounds.center.y;if(emulateSetContent){_shout('afterChange');}},invalidateCurrItems:function(){_itemsNeedUpdate=true;for(var i=0;i<NUM_HOLDERS;i++){if(_itemHolders[i].item){_itemHolders[i].item.needsUpdate=true;}}},updateCurrItem:function(beforeAnimation){if(_indexDiff===0){return;} 3053var diffAbs=Math.abs(_indexDiff),tempHolder;if(beforeAnimation&&diffAbs<2){return;} 3054self.currItem=_getItemAt(_currentItemIndex);_shout('beforeChange',_indexDiff);if(diffAbs>=NUM_HOLDERS){_containerShiftIndex+=_indexDiff+(_indexDiff>0?-NUM_HOLDERS:NUM_HOLDERS);diffAbs=NUM_HOLDERS;} 3055for(var i=0;i<diffAbs;i++){if(_indexDiff>0){tempHolder=_itemHolders.shift();_itemHolders[NUM_HOLDERS-1]=tempHolder;_containerShiftIndex++;_setTranslateX((_containerShiftIndex+2)*_slideSize.x,tempHolder.el.style);self.setContent(tempHolder,_currentItemIndex-diffAbs+i+1+1);}else{tempHolder=_itemHolders.pop();_itemHolders.unshift(tempHolder);_containerShiftIndex--;_setTranslateX(_containerShiftIndex*_slideSize.x,tempHolder.el.style);self.setContent(tempHolder,_currentItemIndex+diffAbs-i-1-1);}} 3056if(_currZoomElementStyle&&Math.abs(_indexDiff)===1){var prevItem=_getItemAt(_prevItemIndex);
3056if(prevItem.initialZoomLevel!==_currZoomLevel){_calculateItemSize(prevItem,_viewportSize);_applyZoomPanToItem(prevItem);}} 3057_indexDiff=0;self.updateCurrZoomItem();_prevItemIndex=_currentItemIndex;_shout('afterChange');},updateSize:function(force){if(!_isFixedPosition){var windowScrollY=framework.getScrollY();if(_currentWindowScrollY!==windowScrollY){template.style.top=windowScrollY+'px';_currentWindowScrollY=windowScrollY;} 3058if(!force&&_windowVisibleSize.x===window.innerWidth&&_windowVisibleSize.y===window.innerHeight){return;} 3059_windowVisibleSize.x=window.innerWidth;_windowVisibleSize.y=window.innerHeight;template.style.height=_windowVisibleSize.y+'px';} 3060_viewportSize.x=self.scrollWrap.clientWidth;_viewportSize.y=self.scrollWrap.clientHeight;_offset={x:0,y:_currentWindowScrollY};_slideSize.x=_viewportSize.x+Math.round(_viewportSize.x*_options.spacing);_slideSize.y=_viewportSize.y;_moveMainScroll(_slideSize.x*_currPositionIndex);_shout('beforeResize');if(_containerShiftIndex!==undefined){var holder,item,hIndex;for(var i=0;i<NUM_HOLDERS;i++){holder=_itemHolders[i];_setTranslateX((i+_containerShiftIndex)*_slideSize.x,holder.el.style);hIndex=_currentItemIndex+i-1;if(_options.loop&&_getNumItems()>2){hIndex=_getLoopedId(hIndex);} 3061item=_getItemAt(hIndex);if(item&&(_itemsNeedUpdate||item.needsUpdate||!item.bounds)){self.cleanSlide(item);self.setContent(holder,hIndex);if(i===1){self.currItem=item;self.updateCurrZoomItem(true);} 3062item.needsUpdate=false;}else if(holder.index===-1&&hIndex>=0){self.setContent(holder,hIndex);} 3063if(item&&item.container){_calculateItemSize(item,_viewportSize);_applyZoomPanToItem(item);}} 3064_itemsNeedUpdate=false;} 3065_startZoomLevel=_currZoomLevel=self.currItem.initialZoomLevel;_currPanBounds=self.currItem.bounds;if(_currPanBounds){_panOffset.x=_currPanBounds.center.x;_panOffset.y=_currPanBounds.center.y;_applyCurrentZoomPan();} 3066_shout('resize');},zoomTo:function(destZoomLevel,centerPoint,speed,easingFn,updateFn){if(centerPoint){_startZoomLevel=_currZoomLevel;_midZoomPoint.x=Math.abs(centerPoint.x)-_panOffset.x;_midZoomPoint.y=Math.abs(centerPoint.y)-_panOffset.y;_equalizePoints(_startPanOffset,_panOffset);} 3067var destPanBounds=_calculatePanBounds(destZoomLevel,false),destPanOffset={};_modifyDestPanOffset('x',destPanBounds,destPanOffset,destZoomLevel);_modifyDestPanOffset('y',destPanBounds,destPanOffset,destZoomLevel);var initialZoomLevel=_currZoomLevel;var initialPanOffset={x:_panOffset.x,y:_panOffset.y};_roundPoint(destPanOffset);var onUpdate=function(now){if(now===1){_currZoomLevel=destZoomLevel;_panOffset.x=destPanOffset.x;_panOffset.y=destPanOffset.y;}else{_currZoomLevel=(destZoomLevel-initialZoomLevel)*now+initialZoomLevel;_panOffset.x=(destPanOffset.x-initialPanOffset.x)*now+initialPanOffset.x;
3067_panOffset.y=(destPanOffset.y-initialPanOffset.y)*now+initialPanOffset.y;} 3068if(updateFn){updateFn(now);} 3069_applyCurrentZoomPan();};if(speed){_animateProp('customZoomTo',0,1,speed,easingFn||framework.easing.sine.inOut,onUpdate);}else{onUpdate(1);}}};var MIN_SWIPE_DISTANCE=30,DIRECTION_CHECK_OFFSET=10;var _gestureStartTime,_gestureCheckSpeedTime,p={},p2={},delta={},_currPoint={},_startPoint={},_currPointers=[],_startMainScrollPos={},_releaseAnimData,_posPoints=[],_tempPoint={},_isZoomingIn,_verticalDragInitiated,_oldAndroidTouchEndTimeout,_currZoomedItemIndex=0,_centerPoint=_getEmptyPoint(),_lastReleaseTime=0,_isDragging,_isMultitouch,_zoomStarted,_moved,_dragAnimFrame,_mainScrollShifted,_currentPoints,_isZooming,_currPointsDistance,_startPointsDistance,_currPanBounds,_mainScrollPos=_getEmptyPoint(),_currZoomElementStyle,_mainScrollAnimating,_midZoomPoint=_getEmptyPoint(),_currCenterPoint=_getEmptyPoint(),_direction,_isFirstMove,_opacityChanged,_bgOpacity,_wasOverInitialZoom,_isEqualPoints=function(p1,p2){return p1.x===p2.x&&p1.y===p2.y;},_isNearbyPoints=function(touch0,touch1){return Math.abs(touch0.x-touch1.x)<DOUBLE_TAP_RADIUS&&Math.abs(touch0.y-touch1.y)<DOUBLE_TAP_RADIUS;},_calculatePointsDistance=function(p1,p2){_tempPoint.x=Math.abs(p1.x-p2.x);_tempPoint.y=Math.abs(p1.y-p2.y);return Math.sqrt(_tempPoint.x*_tempPoint.x+_tempPoint.y*_tempPoint.y);},_stopDragUpdateLoop=function(){if(_dragAnimFrame){_cancelAF(_dragAnimFrame);_dragAnimFrame=null;}},_dragUpdateLoop=function(){if(_isDragging){_dragAnimFrame=_requestAF(_dragUpdateLoop);_renderMovement();}},_canPan=function(){return!(_options.scaleMode==='fit'&&_currZoomLevel===self.currItem.initialZoomLevel);},_closestElement=function(el,fn){if(!el){return false;} 3070if(el.className&&el.className.indexOf('pswp__scroll-wrap')>-1){return false;} 3071if(fn(el)){return el;} 3072return _closestElement(el.parentNode,fn);},_preventObj={},_preventDefaultEventBehaviour=function(e,isDown){_preventObj.prevent=!_closestElement(e.target,_options.isClickableElement);_shout('preventDragEvent',e,isDown,_preventObj);return _preventObj.prevent;},_convertTouchToPoint=function(touch,p){p.x=touch.pageX;p.y=touch.pageY;p.id=touch.identifier;return p;},_findCenterOfPoints=function(p1,p2,pCenter){pCenter.x=(p1.x+p2.x)*0.5;pCenter.y=(p1.y+p2.y)*0.5;},_pushPosPoint=function(time,x,y){if(time-_gestureCheckSpeedTime>50){var o=_posPoints.length>2?_posPoints.shift():{};o.x=x;o.y=y;_posPoints.push(o);_gestureCheckSpeedTime=time;}},_calculateVerticalDragOpacityRatio=function(){var yOffset=_panOffset.y-self.currItem.initialPosition.y;return 1-Math.abs(yOffset/(_viewportSize.y/2));},_ePoint1={},_ePoint2={},_tempPointsArr=[],_tempCounter,_getTouchPoints=function(e){while(_tempPointsArr.length>0){_tempPointsArr.pop();} 3073if(!_pointerEventEnabled){if(e.type.indexOf('touch')>-1){if(e.touches&&e.touches.length>0){_tempPointsArr[0]=_convertTouchToPoint(e.touches[0],_ePoint1);if(e.touches.length>1){_tempPointsArr[1]=_convertTouchToPoint(e.touches[1],_ePoint2);}}}else{_ePoint1.x=e.pageX;_ePoint1.y=e.pageY;_ePoint1.id='';_tempPointsArr[0]=_ePoint1;}}else{_tempCounter=0;_currPointers.forEach(function(p){if(_tempCounter===0){_tempPointsArr[0]=p;}else if(_tempCounter===1){_tempPointsArr[1]=p;} 3074_tempCounter++;});} 3075return _tempPointsArr;},_panOrMoveMainScroll=function(axis,delta){var panFriction,overDiff=0,newOffset=_panOffset[axis]+delta[axis],startOverDiff,dir=delta[axis]>0,newMainScrollPosition=_mainScrollPos.x+delta.x,mainScrollDiff=_mainScrollPos.x-_startMainScrollPos.x,newPanPos,newMainScrollPos;if(newOffset>_currPanBounds.min[axis]||newOffset<_currPanBounds.max[axis]){panFriction=_options.panEndFriction;}else{panFriction=1;} 3076newOffset=_panOffset[axis]+delta[axis]*panFriction;if(_options.allowPanToNext||_currZoomLevel===self.currItem.initialZoomLevel){if(!_currZoomElementStyle){newMainScrollPos=newMainScrollPosition;}else if(_direction==='h'&&axis==='x'&&!_zoomStarted){if(dir){if(newOffset>_currPanBounds.min[axis]){panFriction=_options.panEndFriction;overDiff=_currPanBounds.min[axis]-newOffset;startOverDiff=_currPanBounds.min[axis]-_startPanOffset[axis];} 3077if((startOverDiff<=0||mainScrollDiff<0)&&_getNumItems()>1){newMainScrollPos=newMainScrollPosition;if(mainScrollDiff<0&&newMainScrollPosition>_startMainScrollPos.x){newMainScrollPos=_startMainScrollPos.x;}}else{if(_currPanBounds.min.x!==_currPanBounds.max.x){newPanPos=newOffset;}}}else{if(newOffset<_currPanBounds.max[axis]){panFriction=_options.panEndFriction;overDiff=newOffset-_currPanBounds.max[axis];startOverDiff=_startPanOffset[axis]-_currPanBounds.max[axis];} 3078if((startOverDiff<=0||mainScrollDiff>0)&&_getNumItems()>1){newMainScrollPos=newMainScrollPosition;if(mainScrollDiff>0&&newMainScrollPosition<_startMainScrollPos.x){newMainScrollPos=_startMainScrollPos.x;}}else{if(_currPanBounds.min.x!==_currPanBounds.max.x){newPanPos=newOffset;}}}} 3079if(axis==='x'){if(newMainScrollPos!==undefined){_moveMainScroll(newMainScrollPos,true);if(newMainScrollPos===_startMainScrollPos.x){_mainScrollShifted=false;}else{_mainScrollShifted=true;}} 3080if(_currPanBounds.min.x!==_currPanBounds.max.x){if(newPanPos!==undefined){_panOffset.x=newPanPos;}else if(!_mainScrollShifted){_panOffset.x+=delta.x*panFriction;}} 3081return newMainScrollPos!==undefined;}} 3082if(!_mainScrollAnimating){if(!_mainScrollShifted){if(_currZoomLevel>self.currItem.fitRatio){_panOffset[axis]+=delta[axis]*panFriction;}}}},_onDragStart=function(e){if(e.type==='mousedown'&&e.button>0){return;} 3083if(_initialZoomRunning){e.preventDefault();return;} 3084if(_oldAndroidTouchEndTimeout&&e.type==='mousedown'){return;} 3085if(_preventDefaultEventBehaviour(e,true)){e.preventDefault();} 3086_shout('pointerDown');if(_pointerEventEnabled){var pointerIndex=framework.arraySearch(_currPointers,e.pointerId,'id');if(pointerIndex<0){pointerIndex=_currPointers.length;} 3087_currPointers[pointerIndex]={x:e.pageX,y:e.pageY,id:e.pointerId};} 3088var startPointsList=_getTouchPoints(e),numPoints=startPointsList.length;_currentPoints=null;_stopAllAnimations();if(!_isDragging||numPoints===1){_isDragging=_isFirstMove=true;framework.bind(window,_upMoveEvents,self);_isZoomingIn=_wasOverInitialZoom=_opacityChanged=_verticalDragInitiated=_mainScrollShifted=_moved=_isMultitouch=_zoomStarted=false;_direction=null;_shout('firstTouchStart',startPointsList);_equalizePoints(_startPanOffset,_panOffset);_currPanDist.x=_currPanDist.y=0;
3088_equalizePoints(_currPoint,startPointsList[0]);_equalizePoints(_startPoint,_currPoint);_startMainScrollPos.x=_slideSize.x*_currPositionIndex;_posPoints=[{x:_currPoint.x,y:_currPoint.y}];_gestureCheckSpeedTime=_gestureStartTime=_getCurrentTime();_calculatePanBounds(_currZoomLevel,true);_stopDragUpdateLoop();_dragUpdateLoop();} 3089if(!_isZooming&&numPoints>1&&!_mainScrollAnimating&&!_mainScrollShifted){_startZoomLevel=_currZoomLevel;_zoomStarted=false;_isZooming=_isMultitouch=true;_currPanDist.y=_currPanDist.x=0;_equalizePoints(_startPanOffset,_panOffset);_equalizePoints(p,startPointsList[0]);_equalizePoints(p2,startPointsList[1]);_findCenterOfPoints(p,p2,_currCenterPoint);_midZoomPoint.x=Math.abs(_currCenterPoint.x)-_panOffset.x;_midZoomPoint.y=Math.abs(_currCenterPoint.y)-_panOffset.y;_currPointsDistance=_startPointsDistance=_calculatePointsDistance(p,p2);}},_onDragMove=function(e){e.preventDefault();if(_pointerEventEnabled){var pointerIndex=framework.arraySearch(_currPointers,e.pointerId,'id');if(pointerIndex>-1){var p=_currPointers[pointerIndex];p.x=e.pageX;p.y=e.pageY;}} 3090if(_isDragging){var touchesList=_getTouchPoints(e);if(!_direction&&!_moved&&!_isZooming){var diff=Math.abs(touchesList[0].x-_currPoint.x)-Math.abs(touchesList[0].y-_currPoint.y);if(Math.abs(diff)>=DIRECTION_CHECK_OFFSET){_direction=diff>0?'h':'v';_currentPoints=touchesList;}}else{_currentPoints=touchesList;}}},_renderMovement=function(){if(!_currentPoints){return;} 3091var numPoints=_currentPoints.length;if(numPoints===0){return;} 3092_equalizePoints(p,_currentPoints[0]);delta.x=p.x-_currPoint.x;delta.y=p.y-_currPoint.y;if(_isZooming&&numPoints>1){_currPoint.x=p.x;_currPoint.y=p.y;if(!delta.x&&!delta.y&&_isEqualPoints(_currentPoints[1],p2)){return;} 3093_equalizePoints(p2,_currentPoints[1]);if(!_zoomStarted){_zoomStarted=true;_shout('zoomGestureStarted');} 3094var pointsDistance=_calculatePointsDistance(p,p2);var zoomLevel=_calculateZoomLevel(pointsDistance);if(zoomLevel>self.currItem.initialZoomLevel+self.currItem.initialZoomLevel/15){_wasOverInitialZoom=true;} 3095var zoomFriction=1,minZoomLevel=_getMinZoomLevel(),maxZoomLevel=_getMaxZoomLevel();if(zoomLevel<minZoomLevel){if(_options.pinchToClose&&!_wasOverInitialZoom&&_startZoomLevel<=self.currItem.initialZoomLevel){var minusDiff=minZoomLevel-zoomLevel;var percent=1-minusDiff/(minZoomLevel/1.2);_applyBgOpacity(percent);_shout('onPinchClose',percent);_opacityChanged=true;}else{zoomFriction=(minZoomLevel-zoomLevel)/minZoomLevel;if(zoomFriction>1){zoomFriction=1;} 3096zoomLevel=minZoomLevel-zoomFriction*(minZoomLevel/3);}}else if(zoomLevel>maxZoomLevel){zoomFriction=(zoomLevel-maxZoomLevel)/(minZoomLevel*6);if(zoomFriction>1){zoomFriction=1;} 3097zoomLevel=maxZoomLevel+zoomFriction*minZoomLevel;} 3098if(zoomFriction<0){zoomFriction=0;} 3099_currPointsDistance=pointsDistance;_findCenterOfPoints(p,p2,_centerPoint);_currPanDist.x+=_centerPoint.x-_currCenterPoint.x;_currPanDist.y+=_centerPoint.y-_currCenterPoint.y;_equalizePoints(_currCenterPoint,_centerPoint);_panOffset.x=_calculatePanOffset('x',zoomLevel);_panOffset.y=_calculatePanOffset('y',zoomLevel);_isZoomingIn=zoomLevel>_currZoomLevel;_currZoomLevel=zoomLevel;_applyCurrentZoomPan();}else{if(!_direction){return;} 3100if(_isFirstMove){_isFirstMove=false;if(Math.abs(delta.x)>=DIRECTION_CHECK_OFFSET){delta.x-=_currentPoints[0].x-_startPoint.x;} 3101if(Math.abs(delta.y)>=DIRECTION_CHECK_OFFSET){delta.y-=_currentPoints[0].y-_startPoint.y;}} 3102_currPoint.x=p.x;_currPoint.y=p.y;if(delta.x===0&&delta.y===0){return;} 3103if(_direction==='v'&&_options.closeOnVerticalDrag){if(!_canPan()){_currPanDist.y+=delta.y;_panOffset.y+=delta.y;var opacityRatio=_calculateVerticalDragOpacityRatio();_verticalDragInitiated=true;_shout('onVerticalDrag',opacityRatio);_applyBgOpacity(opacityRatio);_applyCurrentZoomPan();return;}} 3104_pushPosPoint(_getCurrentTime(),p.x,p.y);_moved=true;_currPanBounds=self.currItem.bounds;var mainScrollChanged=_panOrMoveMainScroll('x',delta);if(!mainScrollChanged){_panOrMoveMainScroll('y',delta);_roundPoint(_panOffset);_applyCurrentZoomPan();}}},_onDragRelease=function(e){if(_features.isOldAndroid){if(_oldAndroidTouchEndTimeout&&e.type==='mouseup'){return;} 3105if(e.type.indexOf('touch')>-1){clearTimeout(_oldAndroidTouchEndTimeout);_oldAndroidTouchEndTimeout=setTimeout(function(){_oldAndroidTouchEndTimeout=0;},600);}} 3106_shout('pointerUp');if(_preventDefaultEventBehaviour(e,false)){e.preventDefault();} 3107var releasePoint;if(_pointerEventEnabled){var pointerIndex=framework.arraySearch(_currPointers,e.pointerId,'id');if(pointerIndex>-1){releasePoint=_currPointers.splice(pointerIndex,1)[0];if(navigator.pointerEnabled){releasePoint.type=e.pointerType||'mouse';}else{var MSPOINTER_TYPES={4:'mouse',2:'touch',3:'pen'};releasePoint.type=MSPOINTER_TYPES[e.pointerType];if(!releasePoint.type){releasePoint.type=e.pointerType||'mouse';}}}} 3108var touchList=_getTouchPoints(e),gestureType,numPoints=touchList.length;if(e.type==='mouseup'){numPoints=0;} 3109if(numPoints===2){_currentPoints=null;return true;} 3110if(numPoints===1){_equalizePoints(_startPoint,touchList[0]);} 3111if(numPoints===0&&!_direction&&!_mainScrollAnimating){if(!releasePoint){if(e.type==='mouseup'){releasePoint={x:e.pageX,y:e.pageY,type:'mou
3111se'};}else if(e.changedTouches&&e.changedTouches[0]){releasePoint={x:e.changedTouches[0].pageX,y:e.changedTouches[0].pageY,type:'touch'};}} 3112_shout('touchRelease',e,releasePoint);} 3113var releaseTimeDiff=-1;if(numPoints===0){_isDragging=false;framework.unbind(window,_upMoveEvents,self);_stopDragUpdateLoop();if(_isZooming){releaseTimeDiff=0;}else if(_lastReleaseTime!==-1){releaseTimeDiff=_getCurrentTime()-_lastReleaseTime;}} 3114_lastReleaseTime=numPoints===1?_getCurrentTime():-1;if(releaseTimeDiff!==-1&&releaseTimeDiff<150){gestureType='zoom';}else{gestureType='swipe';} 3115if(_isZooming&&numPoints<2){_isZooming=false;if(numPoints===1){gestureType='zoomPointerUp';} 3116_shout('zoomGestureEnded');} 3117_currentPoints=null;if(!_moved&&!_zoomStarted&&!_mainScrollAnimating&&!_verticalDragInitiated){return;} 3118_stopAllAnimations();if(!_releaseAnimData){_releaseAnimData=_initDragReleaseAnimationData();} 3119_releaseAnimData.calculateSwipeSpeed('x');if(_verticalDragInitiated){var opacityRatio=_calculateVerticalDragOpacityRatio();if(opacityRatio<0.6){self.close();}else{var initalPanY=_panOffset.y,initialBgOpacity=_bgOpacity;_animateProp('verticalDrag',0,1,300,framework.easing.cubic.out,function(now){_panOffset.y=(self.currItem.initialPosition.y-initalPanY)*now+initalPanY;_applyBgOpacity((1-initialBgOpacity)*now+initialBgOpacity);_applyCurrentZoomPan();});_shout('onVerticalDrag',1);} 3120return;} 3121if((_mainScrollShifted||_mainScrollAnimating)&&numPoints===0){var itemChanged=_finishSwipeMainScrollGesture(gestureType,_releaseAnimData);if(itemChanged){return;} 3122gestureType='zoomPointerUp';} 3123if(_mainScrollAnimating){return;} 3124if(gestureType!=='swipe'){_completeZoomGesture();return;} 3125if(!_mainScrollShifted&&_currZoomLevel>self.currItem.fitRatio){_completePanGesture(_releaseAnimData);}},_initDragReleaseAnimationData=function(){var lastFlickDuration,tempReleasePos;var s={lastFlickOffset:{},lastFlickDist:{},lastFlickSpeed:{},slowDownRatio:{},slowDownRatioReverse:{},speedDecelerationRatio:{},speedDecelerationRatioAbs:{},distanceOffset:{},backAnimDestination:{},backAnimStarted:{},calculateSwipeSpeed:function(axis){if(_posPoints.length>1){lastFlickDuration=_getCurrentTime()-_gestureCheckSpeedTime+50;tempReleasePos=_posPoints[_posPoints.length-2][axis];}else{lastFlickDuration=_getCurrentTime()-_gestureStartTime;tempReleasePos=_startPoint[axis];} 3126s.lastFlickOffset[axis]=_currPoint[axis]-tempReleasePos;s.lastFlickDist[axis]=Math.abs(s.lastFlickOffset[axis]);if(s.lastFlickDist[axis]>20){s.lastFlickSpeed[axis]=s.lastFlickOffset[axis]/lastFlickDuration;}else{s.lastFlickSpeed[axis]=0;} 3127if(Math.abs(s.lastFlickSpeed[axis])<0.1){s.lastFlickSpeed[axis]=0;} 3128s.slowDownRatio[axis]=0.95;s.slowDownRatioReverse[axis]=1-s.slowDownRatio[axis];s.speedDecelerationRatio[axis]=1;},calculateOverBoundsAnimOffset:function(axis,speed){if(!s.backAnimStarted[axis]){if(_panOffset[axis]>_currPanBounds.min[axis]){s.backAnimDestination[axis]=_currPanBounds.min[axis];}else if(_panOffset[axis]<_currPanBounds.max[axis]){s.backAnimDestination[axis]=_currPanBounds.max[axis];} 3129if(s.backAnimDestination[axis]!==undefined){s.slowDownRatio[axis]=0.7;s.slowDownRatioReverse[axis]=1-s.slowDownRatio[axis];if(s.speedDecelerationRatioAbs[axis]<0.05){s.lastFlickSpeed[axis]=0;s.backAnimStarted[axis]=true;_animateProp('bounceZoomPan'+axis,_panOffset[axis],s.backAnimDestination[axis],speed||300,framework.easing.sine.out,function(pos){_panOffset[axis]=pos;_applyCurrentZoomPan();});}}}},calculateAnimOffset:function(axis){if(!s.backAnimStarted[axis]){s.speedDecelerationRatio[axis]=s.speedDecelerationRatio[axis]*(s.slowDownRatio[axis]+ 3130s.slowDownRatioReverse[axis]- 3131s.slowDownRatioReverse[axis]*s.timeDiff/10);s.speedDecelerationRatioAbs[axis]=Math.abs(s.lastFlickSpeed[axis]*s.speedDecelerationRatio[axis]);s.distanceOffset[axis]=s.lastFlickSpeed[axis]*s.speedDecelerationRatio[axis]*s.timeDiff;_panOffset[axis]+=s.distanceOffset[axis];}},panAnimLoop:function(){if(_animations.zoomPan){_animations.zoomPan.raf=_requestAF(s.panAnimLoop);s.now=_getCurrentTime();s.timeDiff=s.now-s.lastNow;s.lastNow=s.now;s.calculateAnimOffset('x');s.calculateAnimOffset('y');_applyCurrentZoomPan();s.calculateOverBoundsAnimOffset('x');s.calculateOverBoundsAnimOffset('y');if(s.speedDecelerationRatioAbs.x<0.05&&s.speedDecelerationRatioAbs.y<0.05){_panOffset.x=Math.round(_panOffset.x);
3131_panOffset.y=Math.round(_panOffset.y);_applyCurrentZoomPan();_stopAnimation('zoomPan');return;}}}};return s;},_completePanGesture=function(animData){animData.calculateSwipeSpeed('y');_currPanBounds=self.currItem.bounds;animData.backAnimDestination={};animData.backAnimStarted={};if(Math.abs(animData.lastFlickSpeed.x)<=0.05&&Math.abs(animData.lastFlickSpeed.y)<=0.05){animData.speedDecelerationRatioAbs.x=animData.speedDecelerationRatioAbs.y=0;animData.calculateOverBoundsAnimOffset('x');animData.calculateOverBoundsAnimOffset('y');return true;} 3132_registerStartAnimation('zoomPan');animData.lastNow=_getCurrentTime();animData.panAnimLoop();},_finishSwipeMainScrollGesture=function(gestureType,_releaseAnimData){var itemChanged;if(!_mainScrollAnimating){_currZoomedItemIndex=_currentItemIndex;} 3133var itemsDiff;if(gestureType==='swipe'){var totalShiftDist=_currPoint.x-_startPoint.x,isFastLastFlick=_releaseAnimData.lastFlickDist.x<10;if(totalShiftDist>MIN_SWIPE_DISTANCE&&(isFastLastFlick||_releaseAnimData.lastFlickOffset.x>20)){itemsDiff=-1;}else if(totalShiftDist<-MIN_SWIPE_DISTANCE&&(isFastLastFlick||_releaseAnimData.lastFlickOffset.x<-20)){itemsDiff=1;}} 3134var nextCircle;if(itemsDiff){_currentItemIndex+=itemsDiff;if(_currentItemIndex<0){_currentItemIndex=_options.loop?_getNumItems()-1:0;nextCircle=true;}else if(_currentItemIndex>=_getNumItems()){_currentItemIndex=_options.loop?0:_getNumItems()-1;nextCircle=true;} 3135if(!nextCircle||_options.loop){_indexDiff+=itemsDiff;_currPositionIndex-=itemsDiff;itemChanged=true;}} 3136var animateToX=_slideSize.x*_currPositionIndex;var animateToDist=Math.abs(animateToX-_mainScrollPos.x);var finishAnimDuration;if(!itemChanged&&animateToX>_mainScrollPos.x!==_releaseAnimData.lastFlickSpeed.x>0){finishAnimDuration=333;}else{finishAnimDuration=Math.abs(_releaseAnimData.lastFlickSpeed.x)>0?animateToDist/Math.abs(_releaseAnimData.lastFlickSpeed.x):333;finishAnimDuration=Math.min(finishAnimDuration,400);finishAnimDuration=Math.max(finishAnimDuration,250);} 3137if(_currZoomedItemIndex===_currentItemIndex){itemChanged=false;} 3138_mainScrollAnimating=true;_shout('mainScrollAnimStart');_animateProp('mainScroll',_mainScrollPos.x,animateToX,finishAnimDuration,framework.easing.cubic.out,_moveMainScroll,function(){_stopAllAnimations();_mainScrollAnimating=false;_currZoomedItemIndex=-1;if(itemChanged||_currZoomedItemIndex!==_currentItemIndex){self.updateCurrItem();} 3139_shout('mainScrollAnimComplete');});if(itemChanged){self.updateCurrItem(true);} 3140return itemChanged;},_calculateZoomLevel=function(touchesDistance){return 1/_startPointsDistance*touchesDistance*_startZoomLevel;},_completeZoomGesture=function(){var destZoomLevel=_currZoomLevel,minZoomLevel=_getMinZoomLevel(),maxZoomLevel=_getMaxZoomLevel();if(_currZoomLevel<minZoomLevel){destZoomLevel=minZoomLevel;}else if(_currZoomLevel>maxZoomLevel){destZoomLevel=maxZoomLevel;} 3141var destOpacity=1,onUpdate,initialOpacity=_bgOpacity;if(_opacityChanged&&!_isZoomingIn&&!_wasOverInitialZoom&&_currZoomLevel<minZoomLevel){self.close();return true;} 3142if(_opacityChanged){onUpdate=function(now){_applyBgOpacity((destOpacity-initialOpacity)*now+initialOpacity);};} 3143self.zoomTo(destZoomLevel,0,300,framework.easing.cubic.out,onUpdate);return true;};_registerModule('Gestures',{publicMethods:{initGestures:function(){var addEventNames=function(pref,down,move,up,cancel){_dragStartEvent=pref+down;_dragMoveEvent=pref+move;_dragEndEvent=pref+up;if(cancel){_dragCancelEvent=pref+cancel;}else{_dragCancelEvent='';}};_pointerEventEnabled=_features.pointerEvent;if(_pointerEventEnabled&&_features.touch){_features.touch=false;} 3144if(_pointerEventEnabled){if(navigator.pointerEnabled){addEventNames('pointer','down','move','up','cancel');}else{addEventNames('MSPointer','Down','Move','Up','Cancel');}}else if(_features.touch){addEventNames('touch','start','move','end','cancel');_likelyTouchDevice=true;}else{addEventNames('mouse','down','move','up');} 3145_upMoveEvents=_dragMoveEvent+' '+_dragEndEvent+' '+_dragCancelEvent;_downEvents=_dragStartEvent;if(_pointerEventEnabled&&!_likelyTouchDevice){_likelyTouchDevice=(navigator.maxTouchPoints>1)||(navigator.msMaxTouchPoints>1);} 3146self.likelyTouchDevice=_likelyTouchDevice;_globalEventHandlers[_dragStartEvent]=_onDragStart;_globalEventHandlers[_dragMoveEvent]=_onDragMove;_globalEventHandlers[_dragEndEvent]=_onDragRelease;if(_dragCancelEvent){_globalEventHandlers[_dragCancelEvent]=_globalEventHandlers[_dragEndEvent];} 3147if(_features.touch){_downEvents+=' mousedown';_upMoveEvents+=' mousemove mouseup';_globalEventHandlers.mousedown=_globalEventHandlers[_dragStartEvent];_globalEventHandlers.mousemove=_globalEventHandlers[_dragMoveEvent];_globalEventHandlers.mouseup=_globalEventHandlers[_dragEndEvent];} 3148if(!_likelyTouchDevice){_options.allowPanToNext=false;}}}});var _showOrHideTimeout,_showOrHide=function(item,img,out,completeFn){if(_showOrHideTimeout){clearTimeout(_showOrHideTimeout);} 3149_initialZoomRunning=true;_initialContentSet=true;var thumbBounds;if(item.initialLayout){thumbBounds=item.initialLayout;item.initialLayout=null;}else{thumbBounds=_options.getThumbBoundsFn&&_options.getThumbBoundsFn(_currentItemIndex);} 3150var duration=out?_options.hideAnimationDuration:_options.showAnimationDuration;var onComplete=function(){_stopAnimation('initialZoom');if(!out){_applyBgOpacity(1);if(img){img.style.display='block';} 3151framework.addClass(template,'pswp--animated-in');_shout('initialZoom'+(out?'OutEnd':'InEnd'));}else{self.template.removeAttribute('style');self.bg.removeAttribute('style');} 3152if(completeFn){completeFn();} 3153_initialZoomRunning=false;};if(!duration||!thumbBounds||thumbBounds.x===undefined){var finishWithoutAnimation=function(){_shout('initialZoom'+(out?'Out':'In'));_currZoomLevel=item.initialZoomLevel;_equalizePoints(_panOffset,item.initialPosition);_applyCurrentZoomPan();template.style.opacity=out?0:1;_applyBgOpacity(1);onComplete();};finishWithoutAnimation();return;} 3154var startAnimation=function(){var closeWithRaf=_closedByScroll,fadeEverything=!self.currItem.src||self.currItem.loadError||_options.showHideOpacity;if(item.miniImg){item.miniImg.style.webkitBackfaceVisibility='hidden';} 3155if(!out){_currZoomLevel=thumbBounds.w/item.w;_panOffset.x=thumbBounds.x;
3155_panOffset.y=thumbBounds.y-_initalWindowScrollY;self[fadeEverything?'template':'bg'].style.opacity=0.001;_applyCurrentZoomPan();} 3156_registerStartAnimation('initialZoom');if(out&&!closeWithRaf){framework.removeClass(template,'pswp--animated-in');} 3157if(fadeEverything){if(out){framework[(closeWithRaf?'remove':'add')+'Class'](template,'pswp--animate_opacity');}else{setTimeout(function(){framework.addClass(template,'pswp--animate_opacity');},30);}} 3158_showOrHideTimeout=setTimeout(function(){_shout('initialZoom'+(out?'Out':'In'));if(!out){_currZoomLevel=item.initialZoomLevel;_equalizePoints(_panOffset,item.initialPosition);_applyCurrentZoomPan();_applyBgOpacity(1);if(fadeEverything){template.style.opacity=1;}else{_applyBgOpacity(1);} 3159_showOrHideTimeout=setTimeout(onComplete,duration+20);}else{var destZoomLevel=thumbBounds.w/item.w,initialPanOffset={x:_panOffset.x,y:_panOffset.y},initialZoomLevel=_currZoomLevel,initalBgOpacity=_bgOpacity,onUpdate=function(now){if(now===1){_currZoomLevel=destZoomLevel;_panOffset.x=thumbBounds.x;_panOffset.y=thumbBounds.y-_currentWindowScrollY;}else{_currZoomLevel=(destZoomLevel-initialZoomLevel)*now+initialZoomLevel;_panOffset.x=(thumbBounds.x-initialPanOffset.x)*now+initialPanOffset.x;_panOffset.y=(thumbBounds.y-_currentWindowScrollY-initialPanOffset.
3159y)*now+initialPanOffset.y;} 3160_applyCurrentZoomPan();if(fadeEverything){template.style.opacity=1-now;}else{_applyBgOpacity(initalBgOpacity-now*initalBgOpacity);}};if(closeWithRaf){_animateProp('initialZoom',0,1,duration,framework.easing.cubic.out,onUpdate,onComplete);}else{onUpdate(1);_showOrHideTimeout=setTimeout(onComplete,duration+20);}}},out?25:90);};startAnimation();};var _items,_tempPanAreaSize={},_imagesToAppendPool=[],_initialContentSet,_initialZoomRunning,_controllerDefaultOptions={index:0,errorMsg:'<div class="pswp__error-msg"><a href="%url%" target="_blank">The image</a> could not be loaded.</div>',forceProgressiveLoading:false,preload:[1,1],getNumItemsFn:function(){return _items.length;}};var _getItemAt,_getNumItems,_initialIsLoop,_getZeroBounds=function(){return{center:{x:0,y:0},max:{x:0,y:0},min:{x:0,y:0}};},_calculateSingleItemPanBounds=function(item,realPanElementW,realPanElementH){var bounds=item.bounds;bounds.center.x=Math.round((_tempPanAreaSize.x-realPanElementW)/2);bounds.center.y=Math.round((_tempPanAreaSize.y-realPanElementH)/2)+item.vGap.top;bounds.max.x=(realPanElementW>_tempPanAreaSize.x)?Math.round(_tempPanAreaSize.x-realPanElementW):bounds.center.x;bounds.max.y=(realPanElementH>_tempPanAreaSize.y)?Math.round(_tempPanAreaSize.y-realPanElementH)+item.vGap.top:bounds.center.y;bounds.min.x=(realPanElementW>_tempPanAreaSize.x)?0:bounds.center.x;bounds.min.y=(realPanElementH>_tempPanAreaSize.y)?item.vGap.top:bounds.center.y;},_calculateItemSize=function(item,viewportSize,zoomLevel){if(item.src&&!item.loadError){var isInitial=!zoomLevel;if(isInitial){if(!item.vGap){item.vGap={top:0,bottom:0};} 3161_shout('parseVerticalMargin',item);} 3162_tempPanAreaSize.x=viewportSize.x;_tempPanAreaSize.y=viewportSize.y-item.vGap.top-item.vGap.bottom;if(isInitial){var hRatio=_tempPanAreaSize.x/item.w;var vRatio=_tempPanAreaSize.y/item.h;item.fitRatio=hRatio<vRatio?hRatio:vRatio;var scaleMode=_options.scaleMode;if(scaleMode==='orig'){zoomLevel=1;}else if(scaleMode==='fit'){zoomLevel=item.fitRatio;} 3163if(zoomLevel>1){zoomLevel=1;} 3164item.initialZoomLevel=zoomLevel;if(!item.bounds){item.bounds=_getZeroBounds();}} 3165if(!zoomLevel){return;} 3166_calculateSingleItemPanBounds(item,item.w*zoomLevel,item.h*zoomLevel);if(isInitial&&zoomLevel===item.initialZoomLevel){item.initialPosition=item.bounds.center;} 3167return item.bounds;}else{item.w=item.h=0;item.initialZoomLevel=item.fitRatio=1;item.bounds=_getZeroBounds();item.initialPosition=item.bounds.center;return item.bounds;} 3168return false;},_appendImage=function(index,item,baseDiv,img,preventAnimation,keepPlaceholder){if(item.loadError){return;} 3169var animate,isSwiping=self.isDragging()&&!self.isZooming(),slideMightBeVisible=index===_currentItemIndex||self.isMainScrollAnimating()||isSwiping;if(!preventAnimation&&(_likelyTouchDevice||_options.alwaysFadeIn)&&slideMightBeVisible){animate=true;} 3170if(img){if(animate){img.style.opacity=0;} 3171item.imageAppended=true;_setImageSize(img,item.w,item.h);baseDiv.appendChild(img);if(animate){setTimeout(function(){img.style.opacity=1;if(keepPlaceholder){setTimeout(function(){if(item&&item.loaded&&item.placeholder){item.placeholder.style.display='none';item.placeholder=null;}},500);}},50);}}},_preloadImage=function(item){item.loading=true;item.loaded=false;var img=item.img=framework.createEl('pswp__img','img');var onComplete=function(){item.loading=false;item.loaded=true;if(item.loadComplete){item.loadComplete(item);}else{item.img=null;} 3172img.onload=img.onerror=null;img=null;};img.onload=onComplete;img.onerror=function(){item.loadError=true;onComplete();};img.src=item.src;return img;},_checkForError=function(item,cleanUp){if(item.src&&item.loadError&&item.container){if(cleanUp){item.container.innerHTML='';} 3173item.container.innerHTML=_options.errorMsg.replace('%url%',item.src);return true;}},_setImageSize=function(img,w,h){img.style.width=w+'px';img.style.height=h+'px';},_appendImagesPool=function(){if(_imagesToAppendPool.length){var poolItem;for(var i=0;i<_imagesToAppendPool.length;i++){poolItem=_imagesToAppendPool[i];if(poolItem.holder.index===poolItem.index){_appendImage(poolItem.index,poolItem.item,poolItem.baseDiv,poolItem.img);}} 3174_imagesToAppendPool=[];}};_registerModule('Controller',{publicMethods:{lazyLoadItem:function(index){
3174index=_getLoopedId(index);var item=_getItemAt(index);if(!item||item.loaded||item.loading){return;} 3175_shout('gettingData',index,item);if(!item.src){return;} 3176_preloadImage(item);},initController:function(){framework.extend(_options,_controllerDefaultOptions,true);self.items=_items=items;_getItemAt=self.getItemAt;_getNumItems=_options.getNumItemsFn;_initialIsLoop=_options.loop;if(_getNumItems()<3){_options.loop=false;} 3177_listen('beforeChange',function(diff){var p=_options.preload,isNext=diff===null?true:(diff>0),preloadBefore=Math.min(p[0],_getNumItems()),preloadAfter=Math.min(p[1],_getNumItems()),i;for(i=1;i<=(isNext?preloadAfter:preloadBefore);i++){self.lazyLoadItem(_currentItemIndex+i);} 3178for(i=1;i<=(isNext?preloadBefore:preloadAfter);i++){self.lazyLoadItem(_currentItemIndex-i);}});_listen('initialLayout',function(){self.currItem.initialLayout=_options.getThumbBoundsFn&&_options.getThumbBoundsFn(_currentItemIndex);});_listen('mainScrollAnimComplete',_appendImagesPool);_listen('initialZoomInEnd',_appendImagesPool);_listen('destroy',function(){var item;for(var i=0;i<_items.length;i++){item=_items[i];if(item.container){item.container=null;} 3179if(item.placeholder){item.placeholder=null;} 3180if(item.img){item.img=null;} 3181if(item.preloader){item.preloader=null;} 3182if(item.loadError){item.loaded=item.loadError=false;}} 3183_imagesToAppendPool=null;});},getItemAt:function(index){if(index>=0){return _items[index]!==undefined?_items[index]:false;} 3184return false;},allowProgressiveImg:function(){return _options.forceProgressiveLoading||!_likelyTouchDevice||_options.mouseUsed||screen.width>1200;},setContent:function(holder,index){if(_options.loop){index=_getLoopedId(index);} 3185var prevItem=self.getItemAt(holder.index);if(prevItem){prevItem.container=null;} 3186var item=self.getItemAt(index),img;if(!item){holder.el.innerHTML='';return;} 3187_shout('gettingData',index,item);holder.index=index;holder.item=item;var baseDiv=item.container=framework.createEl('pswp__zoom-wrap');if(!item.src&&item.html){if(item.html.tagName){baseDiv.appendChild(item.html);}else{baseDiv.innerHTML=item.html;}} 3188_checkForError(item);if(item.src&&!item.loadError&&!item.loaded){item.loadComplete=function(item){if(!_isOpen){return;} 3189if(item.img){item.img.style.webkitBackfaceVisibility='hidden';} 3190if(holder&&holder.index===index){if(_checkForError(item,true)){item.loadComplete=item.img=null;_calculateItemSize(item,_viewportSize);_applyZoomPanToItem(item);if(holder.index===_currentItemIndex){self.updateCurrZoomItem();} 3191return;} 3192if(!item.imageAppended){if(_features.transform&&(_mainScrollAnimating||_initialZoomRunning)){_imagesToAppendPool.push({item:item,baseDiv:baseDiv,img:item.img,index:index,holder:holder});}else{_appendImage(index,item,baseDiv,item.img,_mainScrollAnimating||_initialZoomRunning);}}else{if(!_initialZoomRunning&&item.placeholder){item.placeholder.style.display='none';item.placeholder=null;}}} 3193item.loadComplete=null;item.img=null;_shout('imageLoadComplete',index,item);};if(framework.features.transform){var placeholderClassName='pswp__img pswp__img--placeholder';placeholderClassName+=(item.msrc?'':' pswp__img--placeholder--blank');var placeholder=framework.createEl(placeholderClassName,item.msrc?'img':'');if(item.msrc){placeholder.src=item.msrc;} 3194_setImageSize(placeholder,item.w,item.h);baseDiv.appendChild(placeholder);item.placeholder=placeholder;} 3195if(!item.loading){_preloadImage(item);} 3196if(self.allowProgressiveImg()){if(!_initialContentSet&&_features.transform){_imagesToAppendPool.push({item:item,baseDiv:baseDiv,img:item.img,index:index,holder:holder});}else{_appendImage(index,item,baseDiv,item.img,true,true);}}}else if(item.src&&!item.loadError){img=framework.createEl('pswp__img','img');img.style.webkitBackfaceVisibility='hidden';img.style.opacity=1;img.src=item.src;_setImageSize(img,item.w,item.h);_appendImage(index,item,baseDiv,img,true);} 3197_calculateItemSize(item,_viewportSize);if(!_initialContentSet&&index===_currentItemIndex){_currZoomElementStyle=baseDiv.style;_showOrHide(item,(img||item.img));}else{_applyZoomPanToItem(item);} 3198holder.el.innerHTML='';holder.el.appendChild(baseDiv);},cleanSlide:function(item){if(item.img){item.img.onload=item.img.onerror=null;} 3199item.loaded=item.loading=item.img=item.imageAppended=false;}}});var tapTimer,tapReleasePoint={},_dispatchTapEvent=function(origEvent,releasePoint,pointerType){var e=document.createEvent('CustomEvent'),eDetail={origEvent:origEvent,target:origEvent.target,releasePoint:releasePoint,pointerType:pointerType||'touch'};e.initCustomEvent('pswpTap',true,true,eDetail);origEvent.target.dispatchEvent(e);};_registerModule('Tap',{publicMethods:{initTap:function(){_listen('firstTouchStart',self.onTa
3199pStart);_listen('touchRelease',self.onTapRelease);_listen('destroy',function(){tapReleasePoint={};tapTimer=null;});},onTapStart:function(touchList){if(touchList.length>1){clearTimeout(tapTimer);tapTimer=null;}},onTapRelease:function(e,releasePoint){if(!releasePoint){return;} 3200if(!_moved&&!_isMultitouch&&!_numAnimations){var p0=releasePoint;if(tapTimer){clearTimeout(tapTimer);tapTimer=null;if(_isNearbyPoints(p0,tapReleasePoint)){_shout('doubleTap',p0);return;}} 3201if(releasePoint.type==='mouse'){_dispatchTapEvent(e,releasePoint,'mouse');return;} 3202var clickedTagName=e.target.tagName.toUpperCase();if(clickedTagName==='BUTTON'||framework.hasClass(e.target,'pswp__single-tap')){_dispatchTapEvent(e,releasePoint);return;} 3203_equalizePoints(tapReleasePoint,p0);tapTimer=setTimeout(function(){_dispatchTapEvent(e,releasePoint);tapTimer=null;},300);}}}});var _wheelDelta;_registerModule('DesktopZoom',{publicMethods:{initDesktopZoom:function(){if(_oldIE){return;} 3204if(_likelyTouchDevice){_listen('mouseUsed',function(){self.setupDesktopZoom();});}else{self.setupDesktopZoom(true);}},setupDesktopZoom:function(onInit){_wheelDelta={};var events='wheel mousewheel DOMMouseScroll';_listen('bindEvents',function(){framework.bind(template,events,self.handleMouseWheel);});_listen('unbindEvents',function(){if(_wheelDelta){framework.unbind(template,events,self.handleMouseWheel);}});self.mouseZoomedIn=false;var hasDraggingClass,updateZoomable=function(){if(self.mouseZoomedIn){framework.removeClass(template,'pswp--zoomed-in');self.mouseZoomedIn=false;} 3205if(_currZoomLevel<1){framework.addClass(template,'pswp--zoom-allowed');}else{framework.removeClass(template,'pswp--zoom-allowed');} 3206removeDraggingClass();},removeDraggingClass=function(){if(hasDraggingClass){framework.removeClass(template,'pswp--dragging');hasDraggingClass=false;}};_listen('resize',updateZoomable);_listen('afterChange',updateZoomable);_listen('pointerDown',function(){if(self.mouseZoomedIn){hasDraggingClass=true;framework.addClass(template,'pswp--dragging');}});_listen('pointerUp',removeDraggingClass);if(!onInit){updateZoomable();}},handleMouseWheel:function(e){if(_currZoomLevel<=self.currItem.fitRatio){if(!_options.closeOnScroll){e.preventDefault();}else{if(_transformKey&&Math.abs(e.deltaY)>2){_closedByScroll=true;self.close();}} 3207return true;} 3208e.preventDefault();e.stopPropagation();_wheelDelta.x=0;if('deltaX'in e){if(e.deltaMode===1){_wheelDelta.x=e.deltaX*18;_wheelDelta.y=e.deltaY*18;}else{_wheelDelta.x=e.deltaX;_wheelDelta.y=e.deltaY;}}else if('wheelDelta'in e){if(e.wheelDeltaX){_wheelDelta.x=-0.16*e.wheelDeltaX;} 3209if(e.wheelDeltaY){_wheelDelta.y=-0.16*e.wheelDeltaY;}else{_wheelDelta.y=-0.16*e.wheelDelta;}}else if('detail'in e){_wheelDelta.y=e.detail;}else{return;} 3210_calculatePanBounds(_currZoomLevel,true);self.panTo(_panOffset.x-_wheelDelta.x,_panOffset.y-_wheelDelta.y);},toggleDesktopZoom:function(centerPoint){centerPoint=centerPoint||{x:_viewportSize.x/2,y:_viewportSize.y/2+_currentWindowScrollY};var doubleTapZoomLevel=_options.getDoubleTapZoom(true,self.currItem);var zoomOut=_currZoomLevel===doubleTapZoomLevel;self.mouseZoomedIn=!zoomOut;self.zoomTo(zoomOut?self.currItem.initialZoomLevel:doubleTapZoomLevel,centerPoint,333);framework[(!zoomOut?'add':'remove')+'Class'](template,'pswp--zoomed-in');}}});var _historyDefaultOptions={history:true,galleryUID:1};var _historyUpdateTimeout,_hashChangeTimeout,_hashAnimCheckTimeout,_hashChangedByScript,_hashChangedByHistory,_hashReseted,_initialHash,_historyChanged,_closedFromURL,_urlChangedOnce,_windowLoc,_supportsPushState,_getHash=function(){return _windowLoc.hash.substring(1);},_cleanHistoryTimeouts=function(){if(_historyUpdateTimeout){clearTimeout(_historyUpdateTimeout);} 3211if(_hashAnimCheckTimeout){clearTimeout(_hashAnimCheckTimeout);}},_parseItemIndexFromURL=function(){var hash=_getHash(),params={};if(hash.length<5){return params;} 3212var vars=hash.split('&');for(var i=0;i<vars.length;i++){if(!vars[i]){continue;} 3213var pair=vars[i].split('=');if(pair.length<2){continue;} 3214params[pair[0]]=pair[1];} 3215params.pid=parseInt(params.pid,10)-1;if(params.pid<0){params.pid=0;} 3216return params;},_updateHash=function(){if(_hashAnimCheckTimeout){clearTimeout(_hashAnimCheckTimeout);} 3217if(_numAnimations||_isDragging){_hashAnimCheckTimeout=setTimeout(_updateHash,500);return;} 3218if(_hashChangedByScript){clearTimeout(_hashChangeTimeout);}else{_hashChangedByScript=true;} 3219var newHash=_initialHash+'&'+'gid='+_options.galleryUID+'&'+'pid='+(_currentItemIndex+1);if(!_historyChanged){if(_windowLoc.hash.indexOf(newHash)===-1){_urlChangedOnce=true;}} 3220var newURL=_windowLoc.href.split('#')[0]+'#'+newHash;if(_supportsPushState){if('#'+newHash!==window.location.hash){history[_historyChanged?'replaceState':'pushState']('',document.title,newURL);}}else{if(_historyChanged){_windowLoc.replace(newURL);}else{_windowLoc.hash=newHash;}} 3221_historyChanged=true;_hashChangeTimeout=setTimeout(function(){_hashChangedByScript=false;},60);};_registerModule('History',{publicMethods:{initHistory:function(){framework.extend(_options,_historyDefaultOptions,true);if(!_options.history){return;} 3222_windowLoc=window.location;_urlChangedOnce=false;_closedFromURL=false;_historyChanged=false;_initialHash=_getHash();_supportsPushState=('pushState'in history);if(_initialHash.indexOf('gid=')>-1){_initialHash=_initialHash.split('&gid=')[0];_initialHash=_initialHash.split('?gid=')[0];} 3223_listen('afterChange',self.updateURL);_listen('unbindEvents',function(){framework.unbind(window,'hashchange',self.onHashChange);});var returnToOriginal=function(){_hashReseted=true;if(!_closedFromURL){if(_urlChangedOnce){history.back();}else{if(_initialHash){_windowLoc.hash=_initialHash;}else{if(_supportsPushState){history.pushState('',document.title,_windowLoc.pathname+_windowLoc.search);}else{_windowLoc.hash='';}}}} 3224_cleanHistoryTimeouts();};_listen('unbindEvents',function(){if(_closedByScroll){returnToOriginal();}});_listen('destroy',function(){if(!_hashReseted){returnToOriginal();}});_listen('firstUpdate',function(){_currentItemIndex=_parseItemIndexFromURL().pid;});var index=_initialHash.indexOf('pid=');
3224if(index>-1){_initialHash=_initialHash.substring(0,index);if(_initialHash.slice(-1)==='&'){_initialHash=_initialHash.slice(0,-1);}} 3225setTimeout(function(){if(_isOpen){framework.bind(window,'hashchange',self.onHashChange);}},40);},onHashChange:function(){if(_getHash()===_initialHash){_closedFromURL=true;self.close();return;} 3226if(!_hashChangedByScript){_hashChangedByHistory=true;self.goTo(_parseItemIndexFromURL().pid);_hashChangedByHistory=false;}},updateURL:function(){_cleanHistoryTimeouts();if(_hashChangedByHistory){return;} 3227if(!_historyChanged){_updateHash();}else{_historyUpdateTimeout=setTimeout(_updateHash,800);}}}});framework.extend(self,publicMethods);};return PhotoSwipe;});(function(root,factory){if(typeof define==='function'&&define.amd){define(factory);}else if(typeof exports==='object'){module.exports=factory();}else{root.PhotoSwipeUI_Default=factory();}})(this,function(){'use strict';var PhotoSwipeUI_Default=function(pswp,framework){var ui=this;var _overlayUIUpdated=false,_controlsVisible=true,_fullscrenAPI,_controls,_captionContainer,_fakeCaptionContainer,_indexIndicator,_shareButton,_shareModal,_shareModalHidden=true,_initalCloseOnScrollValue,_isIdle,_listen,_loadingIndicator,_loadingIndicatorHidden,_loadingIndicatorTimeout,_galleryHasOneSlide,_options,_defaultUIOptions={barsSize:{top:44,bottom:'auto'},closeElClasses:['item','caption','zoom-wrap','ui','top-bar'],timeToIdle:4000,timeToIdleOutside:1000,loadingIndicatorDelay:1000,addCaptionHTMLFn:function(item,captionEl){if(!item.title){captionEl.children[0].innerHTML='';return false;} 3228captionEl.children[0].innerHTML=item.title;return true;},closeEl:true,captionEl:true,fullscreenEl:true,zoomEl:true,shareEl:true,counterEl:true,arrowEl:true,preloaderEl:true,tapToClose:false,tapToToggleControls:true,clickToCloseNonZoomable:true,shareButtons:[{id:'facebook',label:'Share on Facebook',url:'https://www.facebook.com/sharer/sharer.php?u={{url}}'},{id:'twitter',label:'Tweet',url:'https://twitter.com/intent/tweet?text={{text}}&url={{url}}'},{id:'pinterest',label:'Pin it',url:'http://www.pinterest.com/pin/create/button/'+'?url={{url}}&media={{image_url}}&description={{text}}'},{id:'download',label:'Download image',url:'{{raw_image_url}}',download:true}],getImageURLForShare:function(){return pswp.currItem.src||'';},getPageURLForShare:function(){return window.location.href;},getTextForShare:function(){return pswp.currItem.title||'';},indexIndicatorSep:' / '},_blockControlsTap,_blockControlsTapTimeout;var _onControlsTap=function(e){if(_blockControlsTap){return true;} 3229e=e||window.event;if(_options.timeToIdle&&_options.mouseUsed&&!_isIdle){_onIdleMouseMove();} 3230var target=e.target||e.srcElement,uiElement,clickedClass=target.className,found;for(var i=0;i<_uiElements.length;i++){uiElement=_uiElements[i];if(uiElement.onTap&&clickedClass.indexOf('pswp__'+uiElement.name)>-1){uiElement.onTap();found=true;}} 3231if(found){if(e.stopPropagation){e.stopPropagation();} 3232_blockControlsTap=true;var tapDelay=framework.features.isOldAndroid?600:30;_blockControlsTapTimeout=setTimeout(function(){_blockControlsTap=false;},tapDelay);}},_fitControlsInViewport=function(){return!pswp.likelyTouchDevice||_options.mouseUsed||screen.width>1200;},_togglePswpClass=function(el,cName,add){framework[(add?'add':'remove')+'Class'](el,'pswp__'+cName);},_countNumItems=function(){var hasOneSlide=(_options.getNumItemsFn()===1);if(hasOneSlide!==_galleryHasOneSlide){_togglePswpClass(_controls,'ui--one-slide',hasOneSlide);_galleryHasOneSlide=hasOneSlide;}},_toggleShareModalClass=function(){_togglePswpClass(_shareModal,'share-modal--hidden',_shareModalHidden);},_toggleShareModal=function(){_shareModalHidden=!_shareModalHidden;if(!_shareModalHidden){_toggleShareModalClass();setTimeout(function(){if(!_shareModalHidden){framework.addClass(_shareModal,'pswp__share-modal--fade-in');}},30);}else{framework.removeClass(_shareModal,'pswp__share-modal--fade-in');setTimeout(function(){if(_shareModalHidden){_toggleShareModalClass();}},300);} 3233if(!_shareModalHidden){_updateShareURLs();} 3234return false;},_openWindowPopup=function(e){e=e||window.event;var target=e.target||e.srcElement;pswp.shout('shareLinkClick',e,target);if(!target.href){return false;} 3235if(target.hasAttribute('download')){return true;} 3236window.open(target.href,'pswp_share','scrollbars=yes,resizable=yes,toolbar=no,'+'location=yes,width=550,height=420,top=100,left='+ 3237(window.screen?Math.round(screen.width/2-275):100));
3237if(!_shareModalHidden){_toggleShareModal();} 3238return false;},_updateShareURLs=function(){var shareButtonOut='',shareButtonData,shareURL,image_url,page_url,share_text;for(var i=0;i<_options.shareButtons.length;i++){shareButtonData=_options.shareButtons[i];image_url=_options.getImageURLForShare(shareButtonData);page_url=_options.getPageURLForShare(shareButtonData);share_text=_options.getTextForShare(shareButtonData);shareURL=shareButtonData.url.replace('{{url}}',encodeURIComponent(page_url)).replace('{{image_url}}',encodeURIComponent(image_url)).replace('{{raw_image_url}}',image_url).replace('{{text}}',encodeURIComponent(share_text));shareButtonOut+='<a href="'+shareURL+'" target="_blank" '+'class="pswp__share--'+shareButtonData.id+'"'+ 3239(shareButtonData.download?'download':'')+'>'+ 3240shareButtonData.label+'</a>';if(_options.parseShareButtonOut){shareButtonOut=_options.parseShareButtonOut(shareButtonData,shareButtonOut);}} 3241_shareModal.children[0].innerHTML=shareButtonOut;_shareModal.children[0].onclick=_openWindowPopup;},_hasCloseClass=function(target){for(var i=0;i<_options.closeElClasses.length;i++){if(framework.hasClass(target,'pswp__'+_options.closeElClasses[i])){return true;}}},_idleInterval,_idleTimer,_idleIncrement=0,_onIdleMouseMove=function(){clearTimeout(_idleTimer);_idleIncrement=0;if(_isIdle){ui.setIdle(false);}},_onMouseLeaveWindow=function(e){e=e?e:window.event;var from=e.relatedTarget||e.toElement;if(!from||from.nodeName==='HTML'){clearTimeout(_idleTimer);_idleTimer=setTimeout(function(){ui.setIdle(true);},_options.timeToIdleOutside);}},_setupFullscreenAPI=function(){if(_options.fullscreenEl){if(!_fullscrenAPI){_fullscrenAPI=ui.getFullscreenAPI();} 3242if(_fullscrenAPI){framework.bind(document,_fullscrenAPI.eventK,ui.updateFullscreen);ui.updateFullscreen();framework.addClass(pswp.template,'pswp--supports-fs');}else{framework.removeClass(pswp.template,'pswp--supports-fs');}}},_setupLoadingIndicator=function(){if(_options.preloaderEl){_toggleLoadingIndicator(true);_listen('beforeChange',function(){clearTimeout(_loadingIndicatorTimeout);_loadingIndicatorTimeout=setTimeout(function(){if(pswp.currItem&&pswp.currItem.loading){if(!pswp.allowProgressiveImg()||(pswp.currItem.img&&!pswp.currItem.img.naturalWidth)){_toggleLoadingIndicator(false);}}else{_toggleLoadingIndicator(true);}},_options.loadingIndicatorDelay);});_listen('imageLoadComplete',function(index,item){if(pswp.currItem===item){_toggleLoadingIndicator(true);}});}},_toggleLoadingIndicator=function(hide){if(_loadingIndicatorHidden!==hide){_togglePswpClass(_loadingIndicator,'preloader--active',!hide);_loadingIndicatorHidden=hide;}},_applyNavBarGaps=function(item){var gap=item.vGap;if(_fitControlsInViewport()){var bars=_options.barsSize;if(_options.captionEl&&bars.bottom==='auto'){if(!_fakeCaptionContainer){_fakeCaptionContainer=framework.createEl('pswp__caption pswp__caption--fake');_fakeCaptionContainer.appendChild(framework.createEl('pswp__caption__center'));_controls.insertBefore(_fakeCaptionContainer,_captionContainer);framework.addClass(_controls,'pswp__ui--fit');} 3243if(_options.addCaptionHTMLFn(item,_fakeCaptionContainer,true)){var captionSize=_fakeCaptionContainer.clientHeight;gap.bottom=parseInt(captionSize,10)||44;}else{gap.bottom=bars.top;}}else{gap.bottom=bars.bottom==='auto'?0:bars.bottom;} 3244gap.top=bars.top;}else{gap.top=gap.bottom=0;}},_setupIdle=function(){if(_options.timeToIdle){_listen('mouseUsed',function(){framework.bind(document,'mousemove',_onIdleMouseMove);framework.bind(document,'mouseout',_onMouseLeaveWindow);_idleInterval=setInterval(function(){_idleIncrement++;if(_idleIncrement===2){ui.setIdle(true);}},_options.timeToIdle/2);});}},_setupHidingControlsDuringGestures=function(){_listen('onVerticalDrag',function(now){if(_controlsVisible&&now<0.95){ui.hideControls();}else if(!_controlsVisible&&now>=0.95){ui.showControls();}});var pinchControlsHidden;_listen('onPinchClose',function(now){if(_controlsVisible&&now<0.9){ui.hideControls();pinchControlsHidden=true;}else if(pinchControlsHidden&&!_controlsVisible&&now>0.9){ui.showControls();}});
3244_listen('zoomGestureEnded',function(){pinchControlsHidden=false;if(pinchControlsHidden&&!_controlsVisible){ui.showControls();}});};var _uiElements=[{name:'caption',option:'captionEl',onInit:function(el){_captionContainer=el;}},{name:'share-modal',option:'shareEl',onInit:function(el){_shareModal=el;},onTap:function(){_toggleShareModal();}},{name:'button--share',option:'shareEl',onInit:function(el){_shareButton=el;},onTap:function(){_toggleShareModal();}},{name:'button--zoom',option:'zoomEl',onTap:pswp.toggleDesktopZoom},{name:'counter',option:'counterEl',onInit:function(el){_indexIndicator=el;}},{name:'button--close',option:'closeEl',onTap:pswp.close},{name:'button--arrow--left',option:'arrowEl',onTap:pswp.prev},{name:'button--arrow--right',option:'arrowEl',onTap:pswp.next},{name:'button--fs',option:'fullscreenEl',onTap:function(){if(_fullscrenAPI.isFullscreen()){_fullscrenAPI.exit();}else{_fullscrenAPI.enter();}}},{name:'preloader',option:'preloaderEl',onInit:function(el){_loadingIndicator=el;}}];var _setupUIElements=function(){var item,classAttr,uiElement;var loopThroughChildElements=function(sChildren){if(!sChildren){return;} 3245var l=sChildren.length;for(var i=0;i<l;i++){item=sChildren[i];classAttr=item.className;for(var a=0;a<_uiElements.length;a++){uiElement=_uiElements[a];if(classAttr.indexOf('pswp__'+uiElement.name)>-1){if(_options[uiElement.option]){framework.removeClass(item,'pswp__element--disabled');if(uiElement.onInit){uiElement.onInit(item);}}else{framework.addClass(item,'pswp__element--disabled');}}}}};loopThroughChildElements(_controls.children);var topBar=framework.getChildByClass(_controls,'pswp__top-bar');if(topBar){loopThroughChildElements(topBar.children);}};ui.init=function(){framework.extend(pswp.options,_defaultUIOptions,true);_options=pswp.options;_controls=framework.getChildByClass(pswp.scrollWrap,'pswp__ui');_listen=pswp.listen;_setupHidingControlsDuringGestures();_listen('beforeChange',ui.update);_listen('doubleTap',function(point){var initialZoomLevel=pswp.currItem.initialZoomLevel;if(pswp.getZoomLevel()!==initialZoomLevel){pswp.zoomTo(initialZoomLevel,point,333);}else{pswp.zoomTo(_options.getDoubleTapZoom(false,pswp.currItem),point,333);}});_listen('preventDragEvent',function(e,isDown,preventObj){var t=e.target||e.srcElement;if(t&&t.className&&e.type.indexOf('mouse')>-1&&(t.className.indexOf('__caption')>0||(/(SMALL|STRONG|EM)/i).test(t.tagName))){preventObj.prevent=false;}});_listen('bindEvents',function(){framework.bind(_controls,'pswpTap click',_onControlsTap);framework.bind(pswp.scrollWrap,'pswpTap',ui.onGlobalTap);if(!pswp.likelyTouchDevice){framework.bind(pswp.scrollWrap,'mouseover',ui.onMouseOver);}});_listen('unbindEvents',function(){if(!_shareModalHidden){_toggleShareModal();} 3246if(_idleInterval){clearInterval(_idleInterval);} 3247framework.unbind(document,'mouseout',_onMouseLeaveWindow);framework.unbind(document,'mousemove',_onIdleMouseMove);framework.unbind(_controls,'pswpTap click',_onControlsTap);framework.unbind(pswp.scrollWrap,'pswpTap',ui.onGlobalTap);framework.unbind(pswp.scrollWrap,'mouseover',ui.onMouseOver);if(_fullscrenAPI){framework.unbind(document,_fullscrenAPI.eventK,ui.updateFullscreen);if(_fullscrenAPI.isFullscreen()){_options.hideAnimationDuration=0;_fullscrenAPI.exit();} 3248_fullscrenAPI=null;}});_listen('destroy',function(){if(_options.captionEl){if(_fakeCaptionContainer){_controls.removeChild(_fakeCaptionContainer);} 3249framework.removeClass(_captionContainer,'pswp__caption--empty');} 3250if(_shareModal){_shareModal.children[0].onclick=null;} 3251framework.removeClass(_controls,'pswp__ui--over-close');framework.addClass(_controls,'pswp__ui--hidden');ui.setIdle(false);});if(!_options.showAnimationDuration){framework.removeClass(_controls,'pswp__ui--hidden');} 3252_listen('initialZoomIn',function(){if(_options.showAnimationDuration){framework.removeClass(_controls,'pswp__ui--hidden');}});_listen('initialZoomOut',function(){framework.addClass(_controls,'pswp__ui--hidden');});_listen('parseVerticalMargin',_applyNavBarGaps);_setupUIElements();if(_options.shareEl&&_shareButton&&_shareModal){_shareModalHidden=true;} 3253_countNumItems();_setupIdle();_setupFullscreenAPI();_setupLoadingIndicator();};ui.setIdle=function(isIdle){_isIdle=isIdle;_togglePswpClass(_controls,'ui--idle',isIdle);};ui.update=function(){if(_controlsVisible&&pswp.currItem){ui.updateIndexIndicator();if(_options.captionEl){_options.addCaptionHTMLFn(pswp.currItem,_captionContainer);_togglePswpClass(_captionContainer,'caption--empty',!pswp.currItem.title);} 3254_overlayUIUpdated=true;}else{_overlayUIUpdated=false;} 3255if(!_shareModalHidden){_toggleShareModal();} 3256_countNumItems();};ui.updateFullscreen=function(e){if(e){setTimeout(function(){pswp.setScrollOffset(0,framework.getScrollY());},50);} 3257framework[(_fullscrenAPI.isFullscreen()?'add':'remove')+'Class'](pswp.template,'pswp--fs');};ui.updateIndexIndicator=function(){if(_options.counterEl){_indexIndicator.innerHTML=(pswp.getCurrentIndex()+1)+ 3258_options.indexIndicatorSep+ 3259_options.getNumItemsFn();}};ui.onGlobalTap=function(e){e=e||window.event;var target=e.target||e.srcElement;if(_blockControlsTap){return;} 3260if(e.detail&&e.detail.pointerType==='mouse'){if(_hasCloseClass(target)){pswp.close();return;}
3261if(framework.hasClass(target,'pswp__img')){if(pswp.getZoomLevel()===1&&pswp.getZoomLevel()<=pswp.currItem.fitRatio){if(_options.clickToCloseNonZoomable){pswp.close();}}else{pswp.toggleDesktopZoom(e.detail.releasePoint);}}}else{if(_options.tapToToggleControls){if(_controlsVisible){ui.hideControls();}else{ui.showControls();}} 3262if(_options.tapToClose&&(framework.hasClass(target,'pswp__img')||_hasCloseClass(target))){pswp.close();return;}}};ui.onMouseOver=function(e){e=e||window.event;var target=e.target||e.srcElement;_togglePswpClass(_controls,'ui--over-close',_hasCloseClass(target));};ui.hideControls=function(){framework.addClass(_controls,'pswp__ui--hidden');_controlsVisible=false;};ui.showControls=function(){_controlsVisible=true;if(!_overlayUIUpdated){ui.update();} 3263framework.removeClass(_controls,'pswp__ui--hidden');};ui.supportsFullscreen=function(){var d=document;return!!(d.exitFullscreen||d.mozCancelFullScreen||d.webkitExitFullscreen||d.msExitFullscreen);};ui.getFullscreenAPI=function(){var dE=document.documentElement,api,tF='fullscreenchange';if(dE.requestFullscreen){api={enterK:'requestFullscreen',exitK:'exitFullscreen',elementK:'fullscreenElement',eventK:tF};}else if(dE.mozRequestFullScreen){api={enterK:'mozRequestFullScreen',exitK:'mozCancelFullScreen',elementK:'mozFullScreenElement',eventK:'moz'+tF};}else if(dE.webkitRequestFullscreen){api={enterK:'webkitRequestFullscreen',exitK:'webkitExitFullscreen',elementK:'webkitFullscreenElement',eventK:'webkit'+tF};}else if(dE.msRequestFullscreen){api={enterK:'msRequestFullscreen',exitK:'msExitFullscreen',elementK:'msFullscreenElement',eventK:'MSFullscreenChange'};} 3264if(api){api.enter=function(){_initalCloseOnScrollValue=_options.closeOnScroll;_options.closeOnScroll=false;if(this.enterK==='webkitRequestFullscreen'){pswp.template[this.enterK](Element.ALLOW_KEYBOARD_INPUT);}else{return pswp.template[this.enterK]();}};api.exit=function(){_options.closeOnScroll=_initalCloseOnScrollValue;return document[this.exitK]();};api.isFullscreen=function(){return document[this.elementK];};} 3265return api;};};return PhotoSwipeUI_Default;});!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).easepick=t.easepick||{})}(this,(function(t){"use strict";class e extends Date{static parseDateTime(t,i="YYYY-MM-DD",n="en-US"){if(!t)return new Date((new Date).setHours(0,0,0,0));if(t instanceof e)return t.toJSDate();if(t instanceof Date)return t;if(/^-?\d{10,}$/.test(String(t)))return new Date(Number(t));if("string"==typeof t){const s=[];let o=null;for(;null!=(o=e.regex.exec(i));)"\\"!==o[1]&&s.push(o);if(s.length){const i={year:null,month:null,shortMonth:null,longMonth:null,day:null,hour:0,minute:0,second:0,ampm:null,value:""};s[0].index>0&&(i.value+=".*?");for(const[t,o]of Object.entries(s)){const s=Number(t),{group:a,pattern:r}=e.formatPatterns(o[0],n);i[a]=s+1,i.value+=r,i.value+=".*?"}const o=new RegExp(`^${i.value}$`);if(o.test(t)){const s=o.exec(t),a=Number(s[i.year]);let r=null;i.month?r=Number(s[i.month])-1:i.shortMonth?r=e.shortMonths(n).indexOf(s[i.shortMonth]):i.longMonth&&(r=e.longMonths(n).indexOf(s[i.longMonth]));const c=Number(s[i.day])||1,l=Number(s[i.hour]);let h=Number.isNaN(l)?0:l;const d=Number(s[i.minute]),p=Number.isNaN(d)?0:d,u=Number(s[i.second]),g=Number.isNaN(u)?0:u,m=s[i.ampm];return m&&"PM"===m&&(h+=12,24===h&&(h=0)),new Date(a,r,c,h,p,g,0)}}}return new Date((new Date).setHours(0,0,0,0))}static regex=/(\\)?(Y{2,4}|M{1,4}|D{1,2}|H{1,2}|h{1,2}|m{1,2}|s{1,2}|A|a)/g;static MONTH_JS=[0,1,2,3,4,5,6,7,8,9,10,11];static shortMonths(t){return e.MONTH_JS.map((e=>new Date(2019,e).toLocaleString(t,{month:"short"})))}static longMonths(t){return e.MONTH_JS.map((e=>new Date(2019,e).toLocaleString(t,{month:"long"})))}static formatPatterns(t,i){switch(t){case"YY":case"YYYY":return{group:"year",pattern:`(\\d{${t.length}})`};case"M":return{group:"month",pattern:"(\\d{1,2})"};case"MM":return{group:"month",pattern:"(\\d{2})"};case"MMM":return{group:"shortMonth",pattern:`(${e.shortMonths(i).join("|")})`};case"MMMM":return{group:"longMonth",pattern:`(${e.longMonths(i).join("|")})`};case"D":return{group:"day",pattern:"(\\d{1,2})"};case"DD":return{group:"day",pattern:"(\\d{2})"};case"h":case"H":return{group:"hour",pattern:"(\\d{1,2})"};case"hh":case"HH":return{group:"hour",pattern:"(\\d{2})"};case"m":return{group:"minute",pattern:"(\\d{1,2})"};case"mm":return{group:"minute",pattern:"(\\d{2})"};case"s":return{group:"second",pattern:"(\\d{1,2})"};case"ss":return{group:"second",pattern:"(\\d{2})"};case"a":case"A":return{group:"ampm",pattern:"(AM|PM|am|pm)"}}}lang;constructor(t=null,i="YYYY-MM-DD",n="en-US"){super(e.parseDateTime(t,i,n)),this.lang=n}getWeek(t){const e=new Date(this.midnight_ts(this)),i=(this.getDay()+(7-t))%7;e.setDate(e.getDate()-i);const n=e.getTime();return e.setMonth(0,1),e.getDay()!==t&&e.setMonth(0,1+(4-e.getDay()+7)%7),1+Math.ceil((n-e.getTime())/6048e5)}clone(){return new e(this)}toJSDate(){return new Date(this)}inArray(t,e="[]"){return t.some((t=>t instanceof Array?this.isBetween(t[0],t[1],e):this.isSame(t,"day")))}isBetween(t,e,i="()"){switch(i){default:case"()":return this.midnight_ts(this)>this.midnight_ts(t)&&this.midnight_ts(this)<this.midnight_ts(e);case"[)":return this.midnight_ts(this)>=this.midnight_ts(t)&&this.midnight_ts(this)<this.midnight_ts(e);case"(]":return this.midnight_ts(this)>this.midnight_ts(t)&&this.midnight_ts(this)<=this.midnight_ts(e);case"[]":return this.midnight_ts()>=this.midnight_ts(t)&&this.midnight_ts()<=this.midnight_ts(e)}}isBefore(t,e="days"){switch(e){case"day":case"days":return new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()>
vendor: 9,691 bytes, line 3265
3265new Date(this.getFullYear(),this.getMonth(),this.getDate()).getTime();case"month":case"months":return new Date(t.getFullYear(),t.getMonth(),1).getTime()>new Date(this.getFullYear(),this.getMonth(),1).getTime();case"year":case"years":return t.getFullYear()>this.getFullYear()}throw new Error("isBefore: Invalid unit!")}isSameOrBefore(t,e="days"){switch(e){case"day":case"days":return new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime()>=new Date(this.getFullYear(),this.getMonth(),this.getDate()).getTime();case"month":case"months":return new Date(t.getFullYear(),t.getMonth(),1).getTime()>=new Date(this.getFullYear(),this.getMonth(),1).getTime()}throw new Error("isSameOrBefore: Invalid unit!")}isAfter(t,e="days"){switch(e){case"day":case"days":return new Date(this.getFullYear(),this.getMonth(),this.getDate()).getTime()>new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime();case"month":case"months":return new Date(this.getFullYear(),this.getMonth(),1).getTime()>new Date(t.getFullYear(),t.getMonth(),1).getTime();case"year":case"years":return this.getFullYear()>t.getFullYear()}throw new Error("isAfter: Invalid unit!")}isSameOrAfter(t,e="days"){switch(e){case"day":case"days":return new Date(this.getFullYear(),this.getMonth(),this.getDate()).getTime()>=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime();case"month":case"months":return new Date(this.getFullYear(),this.getMonth(),1).getTime()>=new Date(t.getFullYear(),t.getMonth(),1).getTime()}throw new Error("isSameOrAfter: Invalid unit!")}isSame(t,e="days"){switch(e){case"day":case"days":return new Date(this.getFullYear(),this.getMonth(),this.getDate()).getTime()===new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime();case"month":case"months":return new Date(this.getFullYear(),this.getMonth(),1).getTime()===new Date(t.getFullYear(),t.getMonth(),1).getTime()}throw new Error("isSame: Invalid unit!")}add(t,e="days"){switch(e){case"day":case"days":this.setDate(this.getDate()+t);break;case"month":case"months":this.setMonth(this.getMonth()+t)}return this}subtract(t,e="days"){switch(e){case"day":case"days":this.setDate(this.getDate()-t);break;case"month":case"months":this.setMonth(this.getMonth()-t)}return this}diff(t,e="days"){switch(e){default:case"day":case"days":return Math.round((this.midnight_ts()-this.midnight_ts(t))/864e5);case"month":case"months":let e=12*(t.getFullYear()-this.getFullYear());return e-=t.getMonth(),e+=this.getMonth(),e}}format(t,i="en-US"){let n="";const s=[];let o=null;for(;null!=(o=e.regex.exec(t));)"\\"!==o[1]&&s.push(o);if(s.length){s[0].index>0&&(n+=t.substring(0,s[0].index));for(const[e,o]of Object.entries(s)){const a=Number(e);n+=this.formatTokens(o[0],i),s[a+1]&&(n+=t.substring(o.index+o[0].length,s[a+1].index)),a===s.length-1&&(n+=t.substring(o.index+o[0].length))}}return n.replace(/\\/g,"")}midnight_ts(t){return t?new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0,0).getTime():new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0,0).getTime()}formatTokens(t,i){switch(t){case"YY":return String(this.getFullYear()).slice(-2);case"YYYY":return String(this.getFullYear());case"M":return String(this.getMonth()+1);case"MM":return`0${this.getMonth()+1}`.slice(-2);case"MMM":return e.shortMonths(i)[this.getMonth()];case"MMMM":return e.longMonths(i)[this.getMonth()];case"D":return String(this.getDate());case"DD":return`0${this.getDate()}`.slice(-2);case"H":return String(this.getHours());case"HH":return`0${this.getHours()}`.slice(-2);case"h":return String(this.getHours()%12||12);case"hh":return`0${this.getHours()%12||12}`.slice(-2);case"m":return String(this.getMinutes());case"mm":return`0${this.getMinutes()}`.slice(-2);case"s":return String(this.getSeconds());case"ss":return`0${this.getSeconds()}`.slice(-2);case"a":return this.getHours()<12||24===this.getHours()?"am":"pm";case"A":return this.getHours()<12||24===this.getHours()?"AM":"PM";default:return""}}}class i{picker;constructor(t){this.picker=t}render(t,i){t||(t=new e),t.setDate(1),t.setHours(0,0,0,0),"function"==typeof this[`get${i}View`]&&this[`get${i}View`](t)}getContainerView(t){this.picker.ui.container.innerHTML="",this.picker.options.header&&this.picker.trigger("render",{date:t.clone(),view:"Header"}),this.picker.trigger("render",{date:t.clone(),view:"Main"}),this.picker.options.autoApply||this.picker.trigger("render",{date:t.clone(),view:"Footer"})}getHeaderView(t){const e=document.createElement("header");this.picker.options.header instanceof HTMLElement&&e.appendChild(this.picker.options.header),"string"==typeof this.picker.options.header&&(e.innerHTML=this.picker.options.header),this.picker.ui.container.appendChild(e),this.picker.trigger("view",{target:e,date:t.clone(),view:"Header"})}getMainView(t){const e=document.createElement("main");this.picker.ui.container.appendChild(e);const i=document.createElement("div");i.className=`calendars grid-${this.picker.options.grid}`;for(let e=0;e<this.picker.options.calendars;e++){const n=document.createElement("div");n.className="calendar",i.appendChild(n);const s=this.getCalendarHeaderView(t.clone());n.appendChild(s),this.picker.trigger("view",{date:t.clone(),view:"CalendarHeader",index:e,target:s});const o=this.getCalendarDayNamesView();n.appendChild(o),this.picker.trigger("view",{date:t.clone(),view:"CalendarDayNames",index:e,target:o});const a=this.getCalendarDaysView(t.clone());n.appendChild(a),this.picker.trigger("view",{date:t.clone(),view:"CalendarDays",index:e,target:a});const r=this.getCalendarFooterView(this.picker.options.lang,t.clone());n.appendChild(r),this.picker.trigger("view",{date:t.clone(),view:"CalendarFooter",index:e,target:r}),this.picker.trigger("view",{date:t.clone(),view:"CalendarItem",index:e,target:n}),t.add(1,"month")}e.appendChild(i),this.picker.trigger("view",{date:t.clone(),view:"Calendars",target:i}),this.picker.trigger("view",{date:t.clone(),view:"Main",target:e})}getFooterView(t){const e=document.createElement("footer"),i=document.createElement("div");i.className="footer-buttons";const n=document.createElement("button");n.className="cancel-button unit",n.innerHTML=this.picker.options.locale.cancel,i.appendChild(n);const s=document.createElement("button");s.className="apply-button unit",s.innerHTML=this.picker.options.locale.apply,s.disabled=!0,i.appendChild(s),e.appendChild(i),this.picker.ui.container.appendChild(e),this.picker.trigger("view",{date:t,target:e,view:"Footer"})}getCalendarHeaderView(t){const e=document.createElement("div");e.className="header";const i=document.createElement("div");i.className="month-name",i.innerHTML=`<span>${t.toLocaleString(this.picker.options.lang,{month:"long"})}</span>${t.format("YYYY")}`,e.appendChild(i);const n=document.createElement("button");n.className="previous-button unit",n.innerHTML=this.picker.options.locale.previousMonth,e.appendChild(n);const s=document.createElement("button");return s.className="next-button unit",s.innerHTML=this.picker.options.locale.nextMonth,e.appendChild(s),e}getCalendarDayNamesView(){const t=document.createElement("div");t.className="daynames-row";for(let e=1;e<=7;e++){const i=3+this.picker.options.firstDay+e,n=document.createElement("div");n.className="dayname",n.innerHTML=new Date(1970,0,i,12,0,0,0).toLocaleString(this.picker.options.lang,{weekday:"short"}),n.title=new Date(1970,0,i,12,0,0,0).toLocaleString(this.picker.options.lang,{weekday:"long"}),t.appendChild(n),this.picker.trigger("view",{dayIdx:i,view:"CalendarDayName",target:n})}return t}getCalendarDaysView(t){const e=document.createElement("div");e.className="days-grid";const i=this.calcOffsetDays(t,this.picker.options.firstDay),n=32-new Date(t.getFullYear(),t.getMonth(),32).getDate();for(let t=0;t<i;t++){const t=document.createElement("div");t.className="offset",e.appendChild(t)}for(let i=1;i<=n;i++){t.setDate(i);const n=this.getCalendarDayView(t);e.appendChild(n),this.picker.trigger("view",{date:t,view:"CalendarDay",target:n})}return e}getCalendarDayView(t){const i=this.picker.options.date?new e(this.picker.options.date):null,n=new e,s=document.createElement("div");return s.className="day unit",s.innerHTML=t.format("D"),s.dataset.time=String(t.getTime()),t.isSame(n,"day")&&s.classList.add("today"),[0,6].includes(t.getDay())&&s.classList.add("weekend"),this.picker.datePicked.length?this.picker.datePicked[0].isSame(t,"day")&&s.classList.add("selected"):i&&t.isSame(i,"day")&&s.classList.add("selected"),this.picker.trigger("view",{date:t,view:"CalendarDay",target:s}),s}getCalendarFooterView(t,e){const i=document.createElement("div");return i.className="footer",i}calcOffsetDays(t,e){let i=t.getDay()-e;return i<0&&(i+=7),i}}class n{picker;instances={};constructor(t){this.picker=t}initialize(){const t=[];this.picker.options.plugins.forEach((e=>{"function"==typeof e?t.push(new e):"string"==typeof e&&"undefined"!=typeof easepick&&Object.prototype.hasOwnProperty.call(easepick,e)?t.push(new easepick[e]):console.warn(`easepick:${e}not found.`)})),t.sort(((t,e)=>t.priority>e.priority?-1:t.priority<e.priority||t.dependencies.length>e.dependencies.length?1:t.dependencies.length<e.dependencies.length?-1:0)),t.forEach((t=>{t.attach(this.picker),this.instances[t.getName()]=t}))}getInstance(t){return this.instances[t]}addInstance(t){if(Object.prototype.hasOwnProperty.call(this.instances,t))console.warn(`easepick:${t}already added.`);else{if("undefined"!=typeof easepick&&Object.prototype.hasOwnProperty.call(easepick,t)){const e=new easepick[t];return e.attach(this.picker),this.instances[e.getName()]=e,e}if("undefined"!==this.getPluginFn(t)){const e=new(this.getPluginFn(t));return e.attach(this.picker),this.instances[e.getName()]=e,e}console.warn(`easepick:${t}
vendor: 8,202 bytes, line 3265
3265not found.`)}return null}removeInstance(t){return t in this.instances&&this.instances[t].detach(),delete this.instances[t]}reloadInstance(t){return this.removeInstance(t),this.addInstance(t)}getPluginFn(t){return[...this.picker.options.plugins].filter((e=>"function"==typeof e&&(new e).getName()===t)).shift()}}class s{Calendar=new i(this);PluginManager=new n(this);calendars=[];datePicked=[];cssLoaded=0;binds={hidePicker:this.hidePicker.bind(this),show:this.show.bind(this)};options={doc:document,css:[],element:null,firstDay:1,grid:1,calendars:1,lang:"en-US",date:null,format:"YYYY-MM-DD",readonly:!0,autoApply:!0,header:!1,inline:!1,scrollToDate:!0,locale:{nextMonth:'<svg width="11" height="16" xmlns="http://www.w3.org/2000/svg"><path d="M2.748 16L0 13.333 5.333 8 0 2.667 2.748 0l7.919 8z" fill-rule="nonzero"/></svg>',previousMonth:'<svg width="11" height="16" xmlns="http://www.w3.org/2000/svg"><path d="M7.919 0l2.748 2.667L5.333 8l5.334 5.333L7.919 16 0 8z" fill-rule="nonzero"/></svg>',cancel:"Cancel",apply:"Apply"},documentClick:this.binds.hidePicker,plugins:[]};ui={container:null,shadowRoot:null,wrapper:null};version="1.2.1";constructor(t){const e={...this.options.locale,...t.locale};this.options={...this.options,...t},this.options.locale=e,this.handleOptions(),this.ui.wrapper=document.createElement("span"),this.ui.wrapper.style.display="none",this.ui.wrapper.style.position="absolute",this.ui.wrapper.style.pointerEvents="none",this.ui.wrapper.className="easepick-wrapper",this.ui.wrapper.attachShadow({mode:"open"}),this.ui.shadowRoot=this.ui.wrapper.shadowRoot,this.ui.container=document.createElement("div"),this.ui.container.className="container",this.options.zIndex&&(this.ui.container.style.zIndex=String(this.options.zIndex)),this.options.inline&&(this.ui.wrapper.style.position="relative",this.ui.container.classList.add("inline")),this.ui.shadowRoot.appendChild(this.ui.container),this.options.element.after(this.ui.wrapper),this.handleCSS(),this.options.element.addEventListener("click",this.binds.show),this.on("view",this.onView.bind(this)),this.on("render",this.onRender.bind(this)),this.PluginManager.initialize(),this.parseValues(),"function"==typeof this.options.setup&&this.options.setup(this),this.on("click",this.onClick.bind(this));const i=this.options.scrollToDate?this.getDate():null;this.renderAll(i)}on(t,e,i={}){this.ui.container.addEventListener(t,e,i)}off(t,e,i={}){this.ui.container.removeEventListener(t,e,i)}trigger(t,e={}){return this.ui.container.dispatchEvent(new CustomEvent(t,{detail:e}))}destroy(){this.options.element.removeEventListener("click",this.binds.show),"function"==typeof this.options.documentClick&&document.removeEventListener("click",this.options.documentClick,!0),Object.keys(this.PluginManager.instances).forEach((t=>{this.PluginManager.removeInstance(t)})),this.ui.wrapper.remove()}onRender(t){const{view:e,date:i}=t.detail;this.Calendar.render(i,e)}onView(t){const{view:e,target:i}=t.detail;"Footer"===e&&this.datePicked.length&&(i.querySelector(".apply-button").disabled=!1)}onClickHeaderButton(t){this.isCalendarHeaderButton(t)&&(t.classList.contains("next-button")?this.calendars[0].add(1,"month"):this.calendars[0].subtract(1,"month"),this.renderAll(this.calendars[0]))}onClickCalendarDay(t){if(this.isCalendarDay(t)){const i=new e(t.dataset.time);this.options.autoApply?(this.setDate(i),this.trigger("select",{date:this.getDate()}),this.hide()):(this.datePicked[0]=i,this.trigger("preselect",{date:this.getDate()}),this.renderAll())}}onClickApplyButton(t){if(this.isApplyButton(t)){if(this.datePicked[0]instanceof Date){const t=this.datePicked[0].clone();this.setDate(t)}this.hide(),this.trigger("select",{date:this.getDate()})}}onClickCancelButton(t){this.isCancelButton(t)&&this.hide()}onClick(t){const e=t.target;if(e instanceof HTMLElement){const t=e.closest(".unit");if(!(t instanceof HTMLElement))return;this.onClickHeaderButton(t),this.onClickCalendarDay(t),this.onClickApplyButton(t),this.onClickCancelButton(t)}}isShown(){return this.ui.container.classList.contains("inline")||this.ui.container.classList.contains("show")}show(t){if(this.isShown())return;const e=t&&"target"in t?t.target:this.options.element,{top:i,left:n}=this.adjustPosition(e);this.ui.container.style.top=`${i}px`,this.ui.container.style.left=`${n}px`,this.ui.container.classList.add("show"),this.trigger("show",{target:e})}hide(){this.ui.container.classList.remove("show"),this.datePicked.length=0,this.renderAll(),this.trigger("hide")}setDate(t){const i=new e(t,this.options.format);this.options.date=i.clone(),this.updateValues(),this.calendars.length&&this.renderAll()}getDate(){return this.options.date instanceof e?this.options.date.clone():null}parseValues(){this.options.date?this.setDate(this.options.date):this.options.element instanceof HTMLInputElement&&this.options.element.value.length&&this.setDate(this.options.element.value),this.options.date instanceof Date||(this.options.date=null)}updateValues(){const t=this.getDate(),e=t instanceof Date?t.format(this.options.format,this.options.lang):"",i=this.options.element;i instanceof HTMLInputElement?i.value=e:i instanceof HTMLElement&&(i.innerText=e)}hidePicker(t){let e=t.target,i=null;e.shadowRoot&&(e=t.composedPath()[0],i=e.getRootNode().host),this.isShown()&&i!==this.ui.wrapper&&e!==this.options.element&&this.hide()}renderAll(t){this.trigger("render",{view:"Container",date:(t||this.calendars[0]).clone()})}isCalendarHeaderButton(t){return["previous-button","next-button"].some((e=>t.classList.contains(e)))}isCalendarDay(t){return t.classList.contains("day")}isApplyButton(t){return t.classList.contains("apply-button")}isCancelButton(t){return t.classList.contains("cancel-button")}gotoDate(t){const i=new e(t,this.options.format);i.setDate(1),this.calendars[0]=i.clone(),this.renderAll()}clear(){this.options.date=null,this.datePicked.length=0,this.updateValues(),this.renderAll(),this.trigger("clear")}handleOptions(){this.options.element instanceof HTMLElement||(this.options.element=this.options.doc.querySelector(this.options.element)),"function"==typeof this.options.documentClick&&document.addEventListener("click",this.options.documentClick,!0),this.options.element instanceof HTMLInputElement&&(this.options.element.readOnly=this.options.readonly),this.options.date?this.calendars[0]=new e(this.options.date,this.options.format):this.calendars[0]=new e}handleCSS(){if(Array.isArray(this.options.css))this.options.css.forEach((t=>{const e=document.createElement("link");e.href=t,e.rel="stylesheet";const i=()=>{this.cssLoaded++,this.cssLoaded===this.options.css.length&&(this.ui.wrapper.style.display="")};e.addEventListener("load",i),e.addEventListener("error",i),this.ui.shadowRoot.append(e)}));else if("string"==typeof this.options.css){const t=document.createElement("style"),e=document.createTextNode(this.options.css);t.appendChild(e),this.ui.shadowRoot.append(t),this.ui.wrapper.style.display=""}else"function"==typeof this.options.css&&(this.options.css.call(this,this),this.ui.wrapper.style.display="")}adjustPosition(t){const e=t.getBoundingClientRect(),i=this.ui.wrapper.getBoundingClientRect();this.ui.container.classList.add("calc");const n=this.ui.container.getBoundingClientRect();this.ui.container.classList.remove("calc");let s=e.bottom-i.bottom,o=e.left-i.left;return"undefined"!=typeof window&&(window.innerHeight<s+n.height&&s-n.height>=0&&(s=e.top-i.top-n.height),window.innerWidth<o+n.width&&e.right-n.width>=0&&(o=e.right-i.right-n.width)),{left:o,top:s}}}var o=Object.freeze({__proto__:null,Core:s,create:s});class a{picker;options;priority=0;dependencies=[];attach(t){const e=this.getName(),i={...this.options};this.options={...this.options,...t.options[e]||{}};for(const n of Object.keys(i))if(null!==i[n]&&"object"==typeof i[n]&&Object.keys(i[n]).length&&e in t.options&&n in t.options[e]){const s={...t.options[e][n]};null!==s&&"object"==typeof s&&Object.keys(s).length&&Object.keys(s).every((t=>Object.keys(i[n]).includes(t)))&&(this.options[n]={...i[n],...s})}if(this.picker=t,this.dependenciesNotFound()){const t=this.dependencies.filter((t=>!this.pluginsAsStringArray().includes(t)));return void console.warn(`${this.getName()}:
3265required dependencies(${t.join(", ")}).`)}const n=this.camelCaseToKebab(this.getName());this.picker.ui.container.classList.add(n),this.onAttach()}detach(){const t=this.camelCaseToKebab(this.getName());this.picker.ui.container.classList.remove(t),"function"==typeof this.onDetach&&this.onDetach()}dependenciesNotFound(){return this.dependencies.length&&!this.dependencies.every((t=>this.pluginsAsStringArray().includes(t)))}pluginsAsStringArray(){return this.picker.options.plugins.map((t=>"function"==typeof t?(new t).getName():t))}camelCaseToKebab(t){return t.replace(/([a-zA-Z])(?=[A-Z])/g,"$1-").toLowerCase()}}t.AmpPlugin=class extends a{rangePlugin;lockPlugin;priority=10;binds={onView:this.onView.bind(this),onColorScheme:this.onColorScheme.bind(this)};options={dropdown:{months:!1,years:!1,minYear:1950,maxYear:null},darkMode:!0,locale:{resetButton:'<svg xmlns="http://www.w3.org/2000/svg" height="24" width="24"><path d="M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"/></svg>'}};matchMedia;getName(){return"AmpPlugin"}onAttach(){this.options.darkMode&&window&&"matchMedia"in window&&(this.matchMedia=window.matchMedia("(prefers-color-scheme: dark)"),this.matchMedia.matches&&(this.picker.ui.container.dataset.theme="dark"),this.matchMedia.addEventListener("change",this.binds.onColorScheme)),this.options.weekNumbers&&this.picker.ui.container.classList.add("week-numbers"),this.picker.on("view",this.binds.onView)}onDetach(){this.options.darkMode&&window&&"matchMedia"in window&&this.matchMedia.removeEventListener("change",this.binds.onColorScheme),this.picker.ui.container.removeAttribute("data-theme"),this.picker.ui.container.classList.remove("week-numbers"),this.picker.off("view",this.binds.onView)}onView(t){this.lockPlugin=this.picker.PluginManager.getInstance("LockPlugin"),this.rangePlugin=this.picker.PluginManager.getInstance("RangePlugin"),this.handleDropdown(t),this.handleResetButton(t),this.handleWeekNumbers(t)}
vendor: 4,576 bytes, line 3265
3265onColorScheme(t){const e=t.matches?"dark":"light";this.picker.ui.container.dataset.theme=e}handleDropdown(t){const{view:i,target:n,date:s,index:o}=t.detail;if("CalendarHeader"===i){const t=n.querySelector(".month-name");if(this.options.dropdown.months){t.childNodes[0].remove();const i=document.createElement("select");i.className="month-name--select month-name--dropdown";for(let t=0;t<12;t+=1){const n=document.createElement("option"),o=new e(new Date(s.getFullYear(),t,2,0,0,0)),a=new e(new Date(s.getFullYear(),t,1,0,0,0));n.value=String(t),n.text=o.toLocaleString(this.picker.options.lang,{month:"long"}),this.lockPlugin&&(n.disabled=this.lockPlugin.options.minDate&&a.isBefore(new e(this.lockPlugin.options.minDate),"month")||this.lockPlugin.options.maxDate&&a.isAfter(new e(this.lockPlugin.options.maxDate),"month")),n.selected=a.getMonth()===s.getMonth(),i.appendChild(n)}i.addEventListener("change",(t=>{const e=t.target;this.picker.calendars[0].setDate(1),this.picker.calendars[0].setMonth(Number(e.value)),this.picker.renderAll()})),t.prepend(i)}if(this.options.dropdown.years){t.childNodes[1].remove();const i=document.createElement("select");i.className="month-name--select";const n=this.options.dropdown.minYear,o=this.options.dropdown.maxYear?this.options.dropdown.maxYear:(new Date).getFullYear();if(s.getFullYear()>o){const t=document.createElement("option");t.value=String(s.getFullYear()),t.text=String(s.getFullYear()),t.selected=!0,t.disabled=!0,i.appendChild(t)}for(let t=o;t>=n;t-=1){const n=document.createElement("option"),o=new e(new Date(t,0,1,0,0,0));n.value=String(t),n.text=String(t),this.lockPlugin&&(n.disabled=this.lockPlugin.options.minDate&&o.isBefore(new e(this.lockPlugin.options.minDate),"year")||this.lockPlugin.options.maxDate&&o.isAfter(new e(this.lockPlugin.options.maxDate),"year")),n.selected=s.getFullYear()===t,i.appendChild(n)}if(s.getFullYear()<n){const t=document.createElement("option");t.value=String(s.getFullYear()),t.text=String(s.getFullYear()),t.selected=!0,t.disabled=!0,i.appendChild(t)}if("asc"===this.options.dropdown.years){const t=Array.prototype.slice.call(i.childNodes).reverse();i.innerHTML="",t.forEach((t=>{t.innerHTML=t.value,i.appendChild(t)}))}i.addEventListener("change",(t=>{const e=t.target;this.picker.calendars[0].setFullYear(Number(e.value)),this.picker.renderAll()})),t.appendChild(i)}}}handleResetButton(t){const{view:e,target:i}=t.detail;if("CalendarHeader"===e&&this.options.resetButton){const t=document.createElement("button");t.className="reset-button unit",t.innerHTML=this.options.locale.resetButton,t.addEventListener("click",(t=>{t.preventDefault();let e=!0;"function"==typeof this.options.resetButton&&(e=this.options.resetButton.call(this)),e&&this.picker.clear()})),i.appendChild(t)}}handleWeekNumbers(t){if(this.options.weekNumbers){const{view:i,target:n}=t.detail;if("CalendarDayNames"===i){const t=document.createElement("div");t.className="wnum-header",t.innerHTML="Wk",n.prepend(t)}"CalendarDays"===i&&[...n.children].forEach(((t,i)=>{if(0===i||i%7==0){let i;if(t.classList.contains("day"))i=new e(t.dataset.time);else{const t=n.querySelector(".day");i=new e(t.dataset.time)}let s=i.getWeek(this.picker.options.firstDay);53===s&&0===i.getMonth()&&(s="53/1");const o=document.createElement("div");o.className="wnum-item",o.innerHTML=String(s),n.insertBefore(o,t)}}))}}},t.DateTime=e,t.KbdPlugin=class extends a{docElement=null;rangePlugin;binds={onView:this.onView.bind(this),onKeydown:this.onKeydown.bind(this)};options={unitIndex:1,dayIndex:2};getName(){return"KbdPlugin"}onAttach(){const t=this.picker.options.element,e=t.getBoundingClientRect();if(this.docElement=document.createElement("span"),this.docElement.style.position="absolute",this.docElement.style.top=`${t.offsetTop}px`,this.docElement.style.left=t.offsetLeft+e.width-25+"px",this.docElement.attachShadow({mode:"open"}),this.options.html)this.docElement.shadowRoot.innerHTML=this.options.html;else{const t=`\n<style>\n button{\n border:none;\n background:transparent;\n font-size:${window.getComputedStyle(this.picker.options.element).fontSize};\n}\n</style>\n\n<button>📅</button>\n`;this.docElement.shadowRoot.innerHTML=t}const i=this.docElement.shadowRoot.querySelector("button");i&&(i.addEventListener("click",(t=>{t.preventDefault(),this.picker.show({target:this.picker.options.element})}),{capture:!0}),i.addEventListener("keydown",(t=>{"Escape"===t.code&&this.picker.hide()}),{capture:!0})),this.picker.options.element.after(this.docElement),this.picker.on("view",this.binds.onView),this.picker.on("key
3265down",this.binds.onKeydown)}onDetach(){this.docElement&&this.docElement.isConnected&&this.docElement.remove(),this.picker.off("view",this.binds.onView),this.picker.off("keydown",this.binds.onKeydown)}onView(t){const{view:e,target:i}=t.detail;i&&"querySelector"in i&&("CalendarDay"!==e||["locked","not-available"].some((t=>i.classList.contains(t)))?[...i.querySelectorAll(".unit:not(.day)")].forEach((t=>t.tabIndex=this.options.unitIndex)):i.tabIndex=this.options.dayIndex)}onKeydown(t){switch(this.onMouseEnter(t),t.code){case"ArrowUp":case"ArrowDown":this.verticalMove(t);break;case"ArrowLeft":case"ArrowRight":this.horizontalMove(t);break;case"Enter":case"Space":this.handleEnter(t);break;case"Escape":this.picker.hide()}}findAllowableDaySibling(t,e,i){const n=Array.from(t.querySelectorAll(`.day[tabindex="${this.options.dayIndex}"]`)),s=n.indexOf(e);return n.filter(((t,e)=>i(e,s)&&t.tabIndex===this.options.dayIndex))[0]}changeMonth(t){const e={ArrowLeft:"previous",ArrowRight:"next"},i=this.picker.ui.container.querySelector(`.${e[t.code]}-button[tabindex="${this.options.unitIndex}"]`);i&&!i.parentElement.classList.contains(`no-${e[t.code]}-month`)&&(i.dispatchEvent(new Event("click",{bubbles:!0})),setTimeout((()=>{let e=null;switch(t.code){case"ArrowLeft":const t=this.picker.ui.container.querySelectorAll(`.day[tabindex="${this.options.dayIndex}"]`);e=t[t.length-1];break;case"ArrowRight":e=this.picker.ui.container.querySelector(`.day[tabindex="${this.options.dayIndex}"]`)}e&&e.focus()})))}verticalMove(t){const e=t.target;if(e.classList.contains("day")){t.preventDefault();const i=this.findAllowableDaySibling(this.picker.ui.container,e,((e,i)=>e===("ArrowUp"===t.code?i-7:i+7)));i&&i.focus()}}horizontalMove(t){const e=t.target;if(e.classList.contains("day")){t.preventDefault();const i=this.findAllowableDaySibling(this.picker.ui.container,e,((e,i)=>e===("ArrowLeft"===t.code?i-1:i+1)));i?i.focus():this.changeMonth(t)}}handleEnter(t){const e=t.target;e.classList.contains("day")&&(t.preventDefault(),e.dispatchEvent(new Event("click",{bubbles:!0})),setTimeout((()=>{if(this.rangePlugin=this.picker.PluginManager.getInstance("RangePlugin"),this.rangePlugin||!this.picker.options.autoApply){const t=this.picker.ui.container.querySelector(".day.selected");t&&setTimeout((()=>{t.focus()}))}})))}onMouseEnter(t){t.target.classList.contains("day")&&setTimeout((()=>{const t=this.picker.ui.shadowRoot.activeElement;t&&t.dispatchEvent(new Event("mouseenter",{bubbles:!0}))}))}},t.LockPlugin=class extends a{priority=1;binds={onView:this.onView.bind(this)};options={minDate:null,maxDate:null,minDays:null,maxDays:null,selectForward:null,selectBackward:null,presets:!0,inseparable:!1,filter:null};getName(){return"LockPlugin"}onAttach(){if(this.options.minDate&&(this.options.minDate=new e(this.options.minDate,this.picker.options.format,this.picker.options.lang)),this.options.maxDate&&(this.options.maxDate=new e(this.options.maxDate,this.picker.options.format,this.picker.options.lang),this.options.maxDate instanceof e&&this.picker.options.calendars>1&&this.picker.calendars[0].isSame(this.options.maxDate,"month"))){const t=this.picker.calendars[0].clone().subtract(1,"month");this.picker.gotoDate(t)}if((this.options.minDays||this.options.maxDays||this.options.selectForward||this.options.selectBackward)&&!this.picker.options.plugins.includes("RangePlugin")){const t=["minDays","maxDays","selectForward","selectBackward"];console.warn(`${this.getName()}:options ${t.join(", ")}
vendor: 6,300 bytes, line 3265
3265required RangePlugin.`)}this.picker.on("view",this.binds.onView)}onDetach(){this.picker.off("view",this.binds.onView)}onView(t){const{view:i,target:n,date:s}=t.detail;if("CalendarHeader"===i&&(this.options.minDate instanceof e&&s.isSameOrBefore(this.options.minDate,"month")&&n.classList.add("no-previous-month"),this.options.maxDate instanceof e&&s.isSameOrAfter(this.options.maxDate,"month")&&n.classList.add("no-next-month")),"CalendarDay"===i){const t=this.picker.datePicked.length?this.picker.datePicked[0]:null;if(this.testFilter(s))return void n.classList.add("locked");if(this.options.inseparable){if(this.options.minDays){const t=s.clone().subtract(this.options.minDays-1,"day"),e=s.clone().add(this.options.minDays-1,"day");let i=!1,o=!1;for(;t.isBefore(s,"day");){if(this.testFilter(t)){i=!0;break}t.add(1,"day")}for(;e.isAfter(s,"day");){if(this.testFilter(e)){o=!0;break}e.subtract(1,"day")}i&&o&&n.classList.add("not-available")}this.rangeIsNotAvailable(s,t)&&n.classList.add("not-available")}this.dateIsNotAvailable(s,t)&&n.classList.add("not-available")}if(this.options.presets&&"PresetPluginButton"===i){const t=new e(Number(n.dataset.start)),i=new e(Number(n.dataset.end)),s=i.diff(t,"day"),o=this.options.minDays&&s<this.options.minDays,a=this.options.maxDays&&s>this.options.maxDays;(o||a||this.lockMinDate(t)||this.lockMaxDate(t)||this.lockMinDate(i)||this.lockMaxDate(i)||this.rangeIsNotAvailable(t,i))&&n.setAttribute("disabled","disabled")}}dateIsNotAvailable(t,e){return this.lockMinDate(t)||this.lockMaxDate(t)||this.lockMinDays(t,e)||this.lockMaxDays(t,e)||this.lockSelectForward(t)||this.lockSelectBackward(t)}rangeIsNotAvailable(t,e){if(!t||!e)return!1;const i=(t.isSameOrBefore(e,"day")?t:e).clone(),n=(e.isSameOrAfter(t,"day")?e:t).clone();for(;i.isSameOrBefore(n,"day");){if(this.testFilter(i))return!0;i.add(1,"day")}return!1}lockMinDate(t){return this.options.minDate instanceof e&&t.isBefore(this.options.minDate,"day")}lockMaxDate(t){return this.options.maxDate instanceof e&&t.isAfter(this.options.maxDate,"day")}lockMinDays(t,e){if(this.options.minDays&&e){const i=e.clone().subtract(this.options.minDays-1,"day"),n=e.clone().add(this.options.minDays-1,"day");return t.isBetween(i,n)}return!1}lockMaxDays(t,e){if(this.options.maxDays&&e){const i=e.clone().subtract(this.options.maxDays,"day"),n=e.clone().add(this.options.maxDays,"day");return!t.isBetween(i,n)}return!1}lockSelectForward(t){if(1===this.picker.datePicked.length&&this.options.selectForward){const e=this.picker.datePicked[0].clone();return t.isBefore(e,"day")}return!1}lockSelectBackward(t){if(1===this.picker.datePicked.length&&this.options.selectBackward){const e=this.picker.datePicked[0].clone();return t.isAfter(e,"day")}return!1}testFilter(t){return"function"==typeof this.options.filter&&this.options.filter(t,this.picker.datePicked)}},t.PresetPlugin=class extends a{dependencies=["RangePlugin"];binds={onView:this.onView.bind(this),onClick:this.onClick.bind(this)};options={customLabels:["Today","Yesterday","Last 7 Days","Last 30 Days","This Month","Last Month"],customPreset:{},position:"left"};getName(){return"PresetPlugin"}onAttach(){if(!Object.keys(this.options.customPreset).length){const t=new e,i=()=>{const i=t.clone();i.setDate(1);const n=new Date(t.getFullYear(),t.getMonth()+1,0);return[new e(i),new e(n)]},n=()=>{const i=t.clone();i.setMonth(i.getMonth()-1),i.setDate(1);const n=new Date(t.getFullYear(),t.getMonth(),0);return[new e(i),new e(n)]},s=[[t.clone(),t.clone()],[t.clone().subtract(1,"day"),t.clone().subtract(1,"day")],[t.clone().subtract(6,"day"),t.clone()],[t.clone().subtract(29,"day"),t.clone()],i(),n()];Object.values(this.options.customLabels).forEach(((t,e)=>{this.options.customPreset[t]=s[e]}))}this.picker.on("view",this.binds.onView),this.picker.on("click",this.binds.onClick)}onDetach(){this.picker.off("view",this.binds.onView),this.picker.off("click",this.binds.onClick)}onView(t){const{view:e,target:i}=t.detail;if("Main"===e){const t=document.createElement("div");t.className="preset-plugin-container",Object.keys(this.options.customPreset).forEach((e=>{if(Object.prototype.hasOwnProperty.call(this.options.customPreset,e)){const i=this.options.customPreset[e],n=document.createElement("button");n.className="preset-button unit",n.innerHTML=e,n.dataset.start=i[0].getTime(),n.dataset.end=i[1].getTime(),t.appendChild(n),this.picker.trigger("view",{view:"PresetPluginButton",target:n})}})),i.appendChild(t),i.classList.add(`preset-${this.options.position}`),this.picker.trigger("view",{view:"PresetPluginContainer",target:t})}}onClick(t){const i=t.target;if(i instanceof HTMLElement){const t=i.closest(".unit");if(!(t instanceof HTMLElement))return;if(this.isPresetButton(t)){const i=new e(Number(t.dataset.start)),n=new e(Number(t.dataset.end));this.picker.options.autoApply?(this.picker.setDateRange(i,n),this.picker.trigger("select",{start:this.picker.getStartDate(),end:this.picker.getEndDate()}),this.picker.hide()):(this.picker.datePicked=[i,n],this.picker.renderAll())}}}isPresetButton(t){return t.classList.contains("preset-button")}},t.RangePlugin=class extends a{tooltipElement;triggerElement;binds={setStartDate:this.setStartDate.bind(this),setEndDate:this.setEndDate.bind(this),setDateRange:this.setDateRange.bind(this),getStartDate:this.getStartDate.bind(this),getEndDate:this.getEndDate.bind(this),onView:this.onView.bind(this),onShow:this.onShow.bind(this),onMouseEnter:this.onMouseEnter.bind(this),onMouseLeave:this.onMouseLeave.bind(this),onClickCalendarDay:this.onClickCalendarDay.bind(this),onClickApplyButton:this.onClickApplyButton.bind(this),parseValues:this.parseValues.bind(this),updateValues:this.updateValues.bind(this),clear:this.clear.bind(this)};options={elementEnd:null,startDate:null,endDate:null,repick:!1,strict:!0,delimiter:" - ",tooltip:!0,tooltipNumber:t=>t,locale:{zero:"",one:"day",two:"",few:"",many:"",other:"days"},documentClick:this.hidePicker.bind(this)};getName(){return"RangePlugin"}onAttach(){this.binds._setStartDate=this.picker.setStartDate,this.binds._setEndDate=this.picker.setEndDate,this.binds._setDateRange=this.picker.setDateRange,this.binds._getStartDate=this.picker.getStartDate,this.binds._getEndDate=this.picker.getEndDate,this.binds._parseValues=this.picker.parseValues,this.binds._updateV
vendor: 4,909 bytes, line 3265
3265alues=this.picker.updateValues,this.binds._clear=this.picker.clear,this.binds._onClickCalendarDay=this.picker.onClickCalendarDay,this.binds._onClickApplyButton=this.picker.onClickApplyButton,Object.defineProperties(this.picker,{setStartDate:{configurable:!0,value:this.binds.setStartDate},setEndDate:{configurable:!0,value:this.binds.setEndDate},setDateRange:{configurable:!0,value:this.binds.setDateRange},getStartDate:{configurable:!0,value:this.binds.getStartDate},getEndDate:{configurable:!0,value:this.binds.getEndDate},parseValues:{configurable:!0,value:this.binds.parseValues},updateValues:{configurable:!0,value:this.binds.updateValues},clear:{configurable:!0,value:this.binds.clear},onClickCalendarDay:{configurable:!0,value:this.binds.onClickCalendarDay},onClickApplyButton:{configurable:!0,value:this.binds.onClickApplyButton}}),this.options.elementEnd&&(this.options.elementEnd instanceof HTMLElement||(this.options.elementEnd=this.picker.options.doc.querySelector(this.options.elementEnd)),this.options.elementEnd instanceof HTMLInputElement&&(this.options.elementEnd.readOnly=this.picker.options.readonly),"function"==typeof this.picker.options.documentClick&&(document.removeEventListener("click",this.picker.options.documentClick,!0),"function"==typeof this.options.documentClick&&document.addEventListener("click",this.options.documentClick,!0)),this.options.elementEnd.addEventListener("click",this.picker.show.bind(this.picker))),this.options.repick=this.options.repick&&this.options.elementEnd instanceof HTMLElement,this.picker.options.date=null,this.picker.on("view",this.binds.onView),this.picker.on("show",this.binds.onShow),this.picker.on("mouseenter",this.binds.onMouseEnter,!0),this.picker.on("mouseleave",this.binds.onMouseLeave,!0),this.checkIntlPluralLocales()}onDetach(){Object.defineProperties(this.picker,{setStartDate:{configurable:!0,value:this.binds._setStartDate},setEndDate:{configurable:!0,value:this.binds._setEndDate},setDateRange:{configurable:!0,value:this.binds._setDateRange},getStartDate:{configurable:!0,value:this.binds._getStartDate},getEndDate:{configurable:!0,value:this.binds._getEndDate},parseValues:{configurable:!0,value:this.binds._parseValues},updateValues:{configurable:!0,value:this.binds._updateValues},clear:{configurable:!0,value:this.binds._clear},onClickCalendarDay:{configurable:!0,value:this.binds._onClickCalendarDay},onClickApplyButton:{configurable:!0,value:this.binds._onClickApplyButton}}),this.picker.off("view",this.binds.onView),this.picker.off("show",this.binds.onShow),this.picker.off("mouseenter",this.binds.onMouseEnter,!0),this.picker.off("mouseleave",this.binds.onMouseLeave,!0)}parseValues(){if(this.options.startDate||this.options.endDate)this.options.strict?this.options.startDate&&this.options.endDate?this.setDateRange(this.options.startDate,this.options.endDate):(this.options.startDate=null,this.options.endDate=null):(this.options.startDate&&this.setStartDate(this.options.startDate),this.options.endDate&&this.setEndDate(this.options.endDate));else if(this.options.elementEnd)this.options.strict?this.picker.options.element instanceof HTMLInputElement&&this.picker.options.element.value.length&&this.options.elementEnd instanceof HTMLInputElement&&this.options.elementEnd.value.length&&this.setDateRange(this.picker.options.element.value,this.options.elementEnd.value):(this.picker.options.element instanceof HTMLInputElement&&this.picker.options.element.value.length&&this.setStartDate(this.picker.options.element.value),this.options.elementEnd instanceof HTMLInputElement&&this.options.elementEnd.value.length&&this.setEndDate(this.options.elementEnd.value));else if(this.picker.options.element instanceof HTMLInputElement&&this.picker.options.element.value.length){const[t,e]=this.picker.options.element.value.split(this.options.delimiter);this.options.strict?t&&e&&this.setDateRange(t,e):(t&&this.setStartDate(t),e&&this.setEndDate(e))}}updateValues(){const t=this.picker.options.element,e=this.options.elementEnd,i=this.picker.getStartDate(),n=this.picker.getEndDate(),s=i instanceof Date?i.format(this.picker.options.format,this.picker.options.lang):"",o=n instanceof Date?n.format(this.picker.options.format,this.picker.options.lang):"";if(e)t instanceof HTMLInputElement?t.value=s:t instanceof HTMLElement&&(t.innerText=s),e instanceof HTMLInputElement?e.value=o:e instanceof HTMLElement&&(e.innerText=o);else{const e=`${s}${s||o?this.options.delimiter:""}${o}`;t instanceof HTMLInputElement?t.value=e:t instanceof HTMLElement&&(t.innerText=e)}}clear(){this.options.startDate=null,this.options.endDate=null,this.picker.datePicked.length=0,this.updateValues(),this.picker.renderAll(),this.picker.trigger("clear")}onShow(t){const{target:e}=t.detail;this.triggerElement=e,this.picker.options.scrollToDate&&this.getStartDate()instanceof Date&&this.picker.gotoDate(this.getStartDate()),this.initializeRepick()}onView(
vendor: 5,719 bytes, line 3265
3265t){const{view:i,target:n}=t.detail;if("Main"===i&&(this.tooltipElement=document.createElement("span"),this.tooltipElement.className="range-plugin-tooltip",n.appendChild(this.tooltipElement)),"CalendarDay"===i){const t=new e(n.dataset.time),i=this.picker.datePicked,s=i.length?this.picker.datePicked[0]:this.getStartDate(),o=i.length?this.picker.datePicked[1]:this.getEndDate();s&&s.isSame(t,"day")&&n.classList.add("start"),s&&o&&(o.isSame(t,"day")&&n.classList.add("end"),t.isBetween(s,o)&&n.classList.add("in-range"))}if("Footer"===i){const t=1===this.picker.datePicked.length&&!this.options.strict||2===this.picker.datePicked.length;n.querySelector(".apply-button").disabled=!t}}hidePicker(t){let e=t.target,i=null;e.shadowRoot&&(e=t.composedPath()[0],i=e.getRootNode().host),this.picker.isShown()&&i!==this.picker.ui.wrapper&&e!==this.picker.options.element&&e!==this.options.elementEnd&&this.picker.hide()}setStartDate(t){const i=new e(t,this.picker.options.format);this.options.startDate=i?i.clone():null,this.updateValues(),this.picker.renderAll()}setEndDate(t){const i=new e(t,this.picker.options.format);this.options.endDate=i?i.clone():null,this.updateValues(),this.picker.renderAll()}setDateRange(t,i){const n=new e(t,this.picker.options.format),s=new e(i,this.picker.options.format);this.options.startDate=n?n.clone():null,this.options.endDate=s?s.clone():null,this.updateValues(),this.picker.renderAll()}getStartDate(){return this.options.startDate instanceof Date?this.options.startDate.clone():null}getEndDate(){return this.options.endDate instanceof Date?this.options.endDate.clone():null}onMouseEnter(t){const i=t.target;if(i instanceof HTMLElement){this.isContainer(i)&&this.initializeRepick();const t=i.closest(".unit");if(!(t instanceof HTMLElement))return;if(this.picker.isCalendarDay(t)){if(1!==this.picker.datePicked.length)return;let i=this.picker.datePicked[0].clone(),n=new e(t.dataset.time),s=!1;if(i.isAfter(n,"day")){const t=i.clone();i=n.clone(),n=t.clone(),s=!0}if([...this.picker.ui.container.querySelectorAll(".day")].forEach((o=>{const a=new e(o.dataset.time),r=this.picker.Calendar.getCalendarDayView(a);a.isBetween(i,n)&&r.classList.add("in-range"),a.isSame(this.picker.datePicked[0],"day")&&(r.classList.add("start"),r.classList.toggle("flipped",s)),o===t&&(r.classList.add("end"),r.classList.toggle("flipped",s)),o.className=r.className})),this.options.tooltip){const e=this.options.tooltipNumber(n.diff(i,"day")+1);if(e>0){const i=new Intl.PluralRules(this.picker.options.lang).select(e),n=`${e}${this.options.locale[i]}`;this.showTooltip(t,n)}else this.hideTooltip()}}}}onMouseLeave(t){if(this.isContainer(t.target)&&this.options.repick){const t=this.getStartDate(),e=this.getEndDate();t&&e&&(this.picker.datePicked.length=0,this.picker.renderAll())}}onClickCalendarDay(t){if(this.picker.isCalendarDay(t)){2===this.picker.datePicked.length&&(this.picker.datePicked.length=0);const i=new e(t.dataset.time);if(this.picker.datePicked[this.picker.datePicked.length]=i,2===this.picker.datePicked.length&&this.picker.datePicked[0].isAfter(this.picker.datePicked[1])){const t=this.picker.datePicked[1].clone();this.picker.datePicked[1]=this.picker.datePicked[0].clone(),this.picker.datePicked[0]=t.clone()}1!==this.picker.datePicked.length&&this.picker.options.autoApply||this.picker.trigger("preselect",{start:this.picker.datePicked[0]instanceof Date?this.picker.datePicked[0].clone():null,end:this.picker.datePicked[1]instanceof Date?this.picker.datePicked[1].clone():null}),1===this.picker.datePicked.length&&(!this.options.strict&&this.picker.options.autoApply&&(this.picker.options.element===this.triggerElement&&this.setStartDate(this.picker.datePicked[0]),this.options.elementEnd===this.triggerElement&&this.setEndDate(this.picker.datePicked[0]),this.picker.trigger("select",{start:this.picker.getStartDate(),end:this.picker.getEndDate()})),this.picker.renderAll()),2===this.picker.datePicked.length&&(this.picker.options.autoApply?(this.setDateRange(this.picker.datePicked[0],this.picker.datePicked[1]),this.picker.trigger("select",{start:this.picker.getStartDate(),end:this.picker.getEndDate()}),this.picker.hide()):(this.hideTooltip(),this.picker.renderAll()))}}onClickApplyButton(t){this.picker.isApplyButton(t)&&(1!==this.picker.datePicked.length||this.options.strict||(this.picker.options.element===this.triggerElement&&(this.options.endDate=null,this.setStartDate(this.picker.datePicked[0])),this.options.elementEnd===this.triggerElement&&(this.options.startDate=null,this.setEndDate(this.picker.datePicked[0]))),2===this.picker.datePicked.length&&this.setDateRange(this.picker.datePicked[0],this.picker.datePicked[1]),this.picker.trigger("select",{start:this.picker.getStartDate(),end:this.picker.getEndDate()}),this.picker.hide())}showTooltip(t,e){this.tooltipElement.style.visibility="visible",this.tooltipElement.innerHTML=e;const i=this.picker.ui.container.getBoundingClientRect(),n=this.tooltipElement.getBoundingClientRect(),s=t.getBoundingClientRect();let o=s.top,a=s.left;o-=i.top,a-=i.left,o-=n.height,a-=n.width/2,a+=s.width/2,this.tooltipElement.style.top=`${o}px`,this.tooltipElement.style.left=`${a}px`}hideTooltip(){this.tooltipElement.style.visibility="hidden"}checkIntlPluralLocales(){if(!this.options.tooltip)return;const t=[...new Set([new Intl.PluralRules(this.picker.options.lang).select(0),new Intl.PluralRules(this.picker.options.lang).select(1),new Intl.PluralRules(this.picker.options.lang).select(2),new Intl.PluralRules(this.picker.options.lang).select(6),new Intl.PluralRules(this.picker.options.lang).select(18)])],e=Object.keys(this.options.locale);t.every((t=>e.includes(t)))||console.warn(`${this.getName()}:provide locales(${t.join(", ")})
vendor: 11,741 bytes, line 3265
3265for correct tooltip text.`)}initializeRepick(){if(!this.options.repick)return;const t=this.getStartDate(),e=this.getEndDate();e&&this.triggerElement===this.picker.options.element&&(this.picker.datePicked[0]=e),t&&this.triggerElement===this.options.elementEnd&&(this.picker.datePicked[0]=t)}isContainer(t){return t===this.picker.ui.container}},t.TimePlugin=class extends a{options={native:!1,seconds:!1,stepHours:1,stepMinutes:5,stepSeconds:5,format12:!1};rangePlugin;timePicked={input:null,start:null,end:null};timePrePicked={input:null,start:null,end:null};binds={getDate:this.getDate.bind(this),getStartDate:this.getStartDate.bind(this),getEndDate:this.getEndDate.bind(this),onView:this.onView.bind(this),onInput:this.onInput.bind(this),onChange:this.onChange.bind(this),onClick:this.onClick.bind(this),setTime:this.setTime.bind(this),setStartTime:this.setStartTime.bind(this),setEndTime:this.setEndTime.bind(this)};getName(){return"TimePlugin"}onAttach(){this.binds._getDate=this.picker.getDate,this.binds._getStartDate=this.picker.getStartDate,this.binds._getEndDate=this.picker.getEndDate,Object.defineProperties(this.picker,{getDate:{configurable:!0,value:this.binds.getDate},getStartDate:{configurable:!0,value:this.binds.getStartDate},getEndDate:{configurable:!0,value:this.binds.getEndDate},setTime:{configurable:!0,value:this.binds.setTime},setStartTime:{configurable:!0,value:this.binds.setStartTime},setEndTime:{configurable:!0,value:this.binds.setEndTime}}),this.rangePlugin=this.picker.PluginManager.getInstance("RangePlugin"),this.parseValues(),this.picker.on("view",this.binds.onView),this.picker.on("input",this.binds.onInput),this.picker.on("change",this.binds.onChange),this.picker.on("click",this.binds.onClick)}onDetach(){delete this.picker.setTime,delete this.picker.setStartTime,delete this.picker.setEndTime,Object.defineProperties(this.picker,{getDate:{configurable:!0,value:this.binds._getDate},getStartDate:{configurable:!0,value:this.binds._getStartDate},getEndDate:{configurable:!0,value:this.binds._getEndDate}}),this.picker.off("view",this.binds.onView),this.picker.off("input",this.binds.onInput),this.picker.off("change",this.binds.onChange),this.picker.off("click",this.binds.onClick)}onView(t){const{view:e,target:i}=t.detail;if("Main"===e){this.rangePlugin=this.picker.PluginManager.getInstance("RangePlugin");const t=document.createElement("div");if(t.className="time-plugin-container",this.rangePlugin){const e=this.getStartInput();t.appendChild(e),this.picker.trigger("view",{view:"TimePluginInput",target:e});const i=this.getEndInput();t.appendChild(i),this.picker.trigger("view",{view:"TimePluginInput",target:i})}else{const e=this.getSingleInput();t.appendChild(e),this.picker.trigger("view",{view:"TimePluginInput",target:e})}i.appendChild(t),this.picker.trigger("view",{view:"TimePluginContainer",target:t})}}onInput(t){const i=t.target;if(i instanceof HTMLInputElement&&i.classList.contains("time-plugin-input")){const t=this.timePicked[i.name]||new e,[n,s]=i.value.split(":");t.setHours(Number(n)||0,Number(s)||0,0,0),this.picker.options.autoApply?(this.timePicked[i.name]=t,this.picker.updateValues()):this.timePrePicked[i.name]=t}}onChange(t){const i=t.target;if(i instanceof HTMLSelectElement&&i.classList.contains("time-plugin-custom-input")){const t=/(\w+)\[(\w+)\]/,[,n,s]=i.name.match(t),o=Number(i.value);let a=new e;switch(!this.picker.options.autoApply&&this.timePrePicked[n]instanceof Date?a=this.timePrePicked[n].clone():this.timePicked[n]instanceof Date&&(a=this.timePicked[n].clone()),s){case"HH":if(this.options.format12){const t=i.closest(".time-plugin-custom-block").querySelector(`select[name="${n}[period]"]`).value,e=this.handleFormat12(t,a,o);a.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),0)}else a.setHours(o,a.getMinutes(),a.getSeconds(),0);break;case"mm":a.setHours(a.getHours(),o,a.getSeconds(),0);break;case"ss":a.setHours(a.getHours(),a.getMinutes(),o,0);break;case"period":if(this.options.format12){const t=i.closest(".time-plugin-custom-block").querySelector(`select[name="${n}[HH]"]`).value,e=this.handleFormat12(i.value,a,Number(t));a.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),0)}}if(this.picker.options.autoApply)this.timePicked[n]=a,this.picker.updateValues();else{this.timePrePicked[n]=a;const t=this.picker.ui.container.querySelector(".apply-button");if(this.rangePlugin){const e=this.rangePlugin.options,i=this.picker.datePicked,n=e.strict&&2===i.length||!e.strict&&i.length>0||!i.length&&e.strict&&e.startDate instanceof Date&&e.endDate instanceof Date||!i.length&&!e.strict&&(e.startDate instanceof Date||e.endDate instanceof Date);t.disabled=!n}else this.picker.datePicked.length&&(t.disabled=!1)}}}onClick(t){const e=t.target;if(e instanceof HTMLElement){const t=e.closest(".unit");if(!(t instanceof HTMLElement))return;this.picker.isApplyButton(t)&&(Object.keys(this.timePicked).forEach((t=>{this.timePrePicked[t]instanceof Date&&(this.timePicked[t]=this.timePrePicked[t].clone())})),this.picker.updateValues(),this.timePrePicked={input:null,start:null,end:null}),this.picker.isCancelButton(t)&&(this.timePrePicked={input:null,start:null,end:null},this.picker.renderAll())}}setTime(t){const e=this.handleTimeString(t);this.timePicked.input=e.clone(),this.picker.renderAll(),this.picker.updateValues()}setStartTime(t){const e=this.handleTimeString(t);this.timePicked.start=e.clone(),this.picker.renderAll(),this.picker.updateValues()}setEndTime(t){const e=this.handleTimeString(t);this.timePicked.end=e.clone(),this.picker.renderAll(),this.picker.updateValues()}handleTimeString(t){const i=new e,[n,s,o]=t.split(":").map((t=>Number(t))),a=n&&!Number.isNaN(n)?n:0,r=s&&!Number.isNaN(s)?s:0,c=o&&!Number.isNaN(o)?o:0;return i.setHours(a,r,c,0),i}getDate(){if(this.picker.options.date instanceof Date){const t=new e(this.picker.options.date,this.picker.options.format);if(this.timePicked.input instanceof Date){const e=this.timePicked.input;t.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),0)}return t}return null}getStartDate(){if(this.rangePlugin.options.startDate instanceof Date){const t=new e(this.rangePlugin.options.startDate,this.picker.options.format);if(this.timePicked.start instanceof Date){const e=this.timePicked.start;t.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),0)}return t}return null}getEndDate(){if(this.rangePlugin.options.endDate instanceof Date){const t=new e(this.rangePlugin.options.endDate,this.picker.options.format);if(this.timePicked.end instanceof Date){const e=this.timePicked.end;t.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),0)}return t}return null}getSingleInput(){return this.options.native?this.getNativeInput("input"):this.getCustomInput("input")}getStartInput(){return this.options.native?this.getNativeInput("start"):this.getCustomInput("start")}getEndInput(){return this.options.native?this.getNativeInput("end"):this.getCustomInput("end")}getNativeInput(t){const e=document.createElement("input");e.type="time",e.name=t,e.className="time-plugin-input unit";const i=this.timePicked[t];if(i){const t=`0${i.getHours()}`.slice(-2),n=`0${i.getMinutes()}`.slice(-2);e.value=`${t}:${n}`}return e}getCustomInput(t){const e=document.createElement("div");e.className="time-plugin-custom-block";const i=document.createElement("select");i.className="time-plugin-custom-input unit",i.name=`${t}[HH]`;const n=this.options.format12?1:0,s=this.options.format12?13:24;let o=null;!this.picker.options.autoApply&&this.timePrePicked[t]instanceof Date?o=this.timePrePicked[t].clone():this.timePicked[t]instanceof Date&&(o=this.timePicked[t].clone());for(let t=n;t<s;t+=this.options.stepHours){const e=document.createElement("option");e.value=String(t),e.text=String(t),o&&(this.options.format12?(o.getHours()%12?o.getHours()%12:12)===t&&(e.selected=!0):o.getHours()===t&&(e.selected=!0)),i.appendChild(e)}e.appendChild(i);const a=document.createElement("select");a.className="time-plugin-custom-input unit",a.name=`${t}[mm]`;for(let t=0;t<60;t+=this.options.stepMinutes){const e=document.createElement("option");e.value=`0${String(t)}`.slice(-2),e.text=`0${String(t)}`.slice(-2),o&&o.getMinutes()===t&&(e.selected=!0),a.appendChild(e)}if(e.appendChild(a),this.options.seconds){const i=document.createElement("select");i.className="time-plugin-custom-input unit",i.name=`${t}[ss]`;const n=60;for(let t=0;t<n;t+=this.options.stepSeconds){const e=document.createElement("option");e.value=`0${String(t)}`.slice(-2),e.text=`0${String(t)}`.slice(-2),o&&o.getSeconds()===t&&(e.selected=!0),i.appendChild(e)}e.appendChild(i)}if(this.options.format12){const i=document.createElement("select");i.className="time-plugin-custom-input unit",i.name=`${t}[period]`,["AM","PM"].forEach((t=>{const e=document.createElement("option");e.value=t,e.text=t,o&&"PM"===t&&o.getHours()>=12&&(e.selected=!0),i.appendChild(e)})),e.appendChild(i)}return e}handleFormat12(t,e,i){const n=e.clone();switch(t){case"AM":12===i?n.setHours(0,n.getMinutes(),n.getSeconds(),0):n.setHours(i,n.getMinutes(),n.getSeconds(),0);break;case"PM":12!==i?n.setHours(i+12,n.getMinutes(),n.getSeconds(),0):n.setHours(i,n.getMinutes(),n.getSeconds(),0)}return n}parseValues(){if(this.rangePlugin){if(this.rangePlugin.options.strict){if(this.rangePlugin.options.startDate&&this.rangePlugin.options.endDate){const t=new e(this.rangePlugin.options.startDate,this.picker.options.format),i=new e(this.rangePlugin.options.endDate,this.picker.options.format);this.timePicked.start=t.clone(),this.timePicked.end=i.clone()}}else{if(this.rangePlugin.options.startDate){const t=new e(this.rangePlugin.options.startDate,this.picker.options.format);this.timePicked.start=t.clone()}if(this.rangePlugin.options.endDate){const t=new e(this.rangePlugin.options.endDate,this.picker.options.format);this.timePicked.end=t.clone()}}if(this.rangePlugin.options.elementEnd)if(this.rangePlugin.options.strict){if(this.picker.options.element instanceof HTMLInputElement&&this.picker.options.element.value.length&&this.rangePlugin.options.elementEnd instanceof HTMLInputElement&&this.rangePlugin.options.elementEnd.value.length){const t=new e(this.picker.options.element.value,this.picker.options.format),i=new e(this.rangePlugin.options.elementEnd.value,this.picker.options.format);this.timePicked.start=t.clone(),this.timePicked.end=i.clone()}}else{if(this.picker.options.element instanceof HTMLInputElement&&this.picker.options.element.value.length){const t=new e(this.picker.options.element.value,this.picker.options.format);this.timePicked.start=t.clone()}if(this.rangePlugin.options.elementEnd instanceof HTMLInputElement&&this.rangePlugin.options.elementEnd.value.length){const t=new e(this.rangePlugin.options.elementEnd.value,this.picker.options.format);this.timePicked.start=t.clone()}}else if(this.picker.options.element instanceof HTMLInputElement&&this.picker.options.element.value.length){const[t,i]=this.picker.options.element.value.split(this.rangePlugin.options.delimiter);if(this.rangePlugin.options.strict){if(t&&i){const n=new e(t,this.picker.options.format),s=new e(i,this.picker.options.format);this.timePicked.start=n.clone(),this.timePicked.end=s.clone()}}else{if(t){const i=new e(t,this.picker.options.format);this.timePicked.start=i.clone()}if(i){const t=new e(i,this.picker.options.format);this.timePicked.start=t.clone()}}}}else{if(this.picker.options.date){const t=new e(this.picker.options.date,this.picker.options.format);this.timePicked.input=t.clone()}if(this.picker.options.element instanceof HTMLInputElement&&this.picker.options.element.value.length){const t=new e(this.picker.options.element.value,this.picker.options.format);this.timePicked.input=t.clone()}}}},t.create=s,t.easepick=o,Object.defineProperty(t,"__esModule",{value:!0})}));
3265Application={};Application.Module={};Application.Widget={};Application.Tool={};Application.AppController=function(){};Application.AppController.prototype=new Meteor.App.AppController('meteor-turystyka.pl');Application.AppController.prototype.doInitialize=function(){window.MeteorSerwis=1;Meteor.App.Core.startModuleAll();};$(function(){var App=new Application.AppController();try{App.initialize();}catch(e){console.error(e);}});Application.Tool.OpenLayersHelper={};Application.Tool.OpenLayersHelper.createMarker=function(lng,lat,meta,vectorSource){var marker=new ol.Feature({geometry:new ol.geom.Point(ol.proj.fromLonLat([lng,lat])),});if(meta){marker.meta=meta;} 3266return marker;};Application.Tool.OpenLayersHelper.pointerOverFeature=function(map){map.on('pointermove',function(e){var pixel=map.getEventPixel(e.originalEvent);var hit=map.hasFeatureAtPixel(pixel);$("#"+map.getTarget()).css("cursor",hit?'pointer':'');});};Application.Tool.OpenLayersHelper.getFeatureStyleCircle=function(feature,resolution,sel) 3267{if(Application.Tool.Env.isMobile()){return new ol.style.Style({image:new ol.style.Circle({radius:10,snapToPixel:false,stroke:new ol.style.Stroke({color:"black",lineCap:"round",lineJoin:"bevel",width:1}),fill:new ol.style.Fill({color:'#2D85C5'})}),});}else{return new ol.style.Style({image:new ol.style.Icon({anchor:[0.5,0.5],anchorXUnits:"fraction",anchorYUnits:"fraction",src:"/vendor/ol-5.3/addons/gfx/blue-dot.svg"}),});}};Application.Tool.OpenLayersHelper.getFeatureStylePhoto=function(feature,resolution,sel) 3268{var k=feature.meta.record.photoMedium.match(/[^\\/]+$/)[0]+(sel?"_1":"");var style=new ol.style.Style 3269({image:new ol.style.Photo({src:feature.meta.record.photoMedium,radius:50,crop:false,kind:"anchored",shadow:5,onload:function(){},stroke:new ol.style.Stroke({width:Number(4)+(sel?3:0),color:sel?'red':'#fff'})})});return[style];};Application.Tool.OpenLayersHelper.getFeatureStyleMarker=function(feature,resolution,sel) 3270{return new ol.style.Style({image:new ol.style.Icon({anchor:[0.5,1],anchorXUnits:'fraction',anchorYUnits:'fraction',src:'https://maps.gstatic.com/mapfiles/api-3/images/spotlight-poi.png'}),});};Application.Tool.OpenLayersHelper.initPopup=function(map,contentBuilder){var $element=$("<div/>");var element=$element.get(0);var popup=new ol.Overlay({element:element,positioning:'bottom-center',stopEvent:false});map.addOverlay(popup);map.on('click',function(evt){var feature=map.forEachFeatureAtPixel(evt.pixel,function(feature,layer){return feature;});if(feature){popup.setPosition(evt.coordinate);$(element).popover('destroy');var content=contentBuilder(feature);if(null!==content){$(element).popover({placement:'top',html:true,trigger:"manual",animation:false,content:content});$(element).popover('show');}}else{$(element).popover('destroy');}});};Application.Tool.OpenLayersHelper.createMap=function(target,setup){var satelita=new ol.layer.Tile({title:"Satelita",baseLayer:true,visible:false,source:new ol.source.TileWMS({url:'https://mapy.geoportal.gov.pl/wss/service/img/guest/ORTO/MapServer/WMSServer',params:{'LAYERS':'Raster','FORMAT':'image/png','TILED':true},})});var osm=new ol.layer.Tile({title:"OSM",baseLayer:true,source:new ol.source.OSM(),visible:false});var topo=new ol.layer.Tile({title:"topo",baseLayer:true,source:new ol.source.XYZ({attributions:'Tiles © <a href="https://services.arcgisonline.com/ArcGIS/'+'rest/services/World_Topo_Map/MapServer">ArcGIS</a>',url:'https://server.arcgisonline.com/ArcGIS/rest/services/'+'World_Topo_Map/MapServer/tile/{z}/{y}/{x}'}),visible:true});var openMapSurfer=new ol.layer.Tile({title:"OMS",baseLayer:true,source:new ol.source.XYZ({attributions:'OpenMapSurfer',url:'https://korona.geog.uni-heidelberg.de/tiles/roads/x={x}&y={y}&z={z}'}),visible:false});var hike=new ol.layer.Tile({title:"szlaki",baseLayer:true,source:new ol.source.XYZ({attributions:'hikebikemap.org',url:'https://toolserver.org/tiles/hikebike/{z}/{x}/{y}.png'}),visible:false});var wikimedia=new ol.layer.Tile({title:"wikimedia",baseLayer:true,source:new ol.source.XYZ({attributions:'wikimedia',url:'https://maps.wikimedia.org/osm-intl/{z}/{x}/{y}.png'}),visible:false});var teren=new ol.layer.Tile({title:"teren",source:new ol.source.XYZ({attributions:'hikebikemap.org',url:'https://c.tiles.wmflabs.org/hillshading/{z}/{x}/{y}.png'}),visible:false});var map=new ol.Map({target:target,layers:[topo,osm,wikimedia],loadTilesWhileInteracting:true,view:new ol.View({center:ol.proj.fromLonLat(setup.center),zoom:setup.zoom})});if(!Application.Tool.Env.deviceXs()){map.addControl(new ol.control.LayerSwitcherImage());map.addControl(new ol.control.CanvasScaleLine());} 3271Application.Tool.OpenLayersHelper.pointerOverFeature(map);return map;};Application.Tool.Form={};Application.Tool.Form.deserializeUrl=function(url,form){if(!form){return;} 3272form.find('[type=checkbox][name]').each(function(){var chkBox=$(this);if(chkBox.attr('checked')){return;}
3273chkBox.prop('checked',false);chkBox.attr('checked',chkBox.prop('checked'));});if(typeof(url)==="string"&&url){var b=decodeURIComponent(url).split('&');$.each(b,function(x,y){var temp=y.split('=');temp[1]=temp[1].replace(/\+/g,' ');if(!temp[0].match(/formData/)){return;} 3274var checkboxSelector='[name="'+temp[0]+'"][value="'+temp[1]+'"]';var selector='[name="'+temp[0]+'"]';if(form.find(checkboxSelector).length&&form.find(checkboxSelector).get(0).type=="checkbox"){form.find(checkboxSelector).attr("checked",true);form.find(checkboxSelector).prop("checked",true);}else{var el=form.find(selector);if(el.attr('multiple')){el.find('option[value="'+temp[1]+'"]').attr('selected',true);el.find('option[value="'+temp[1]+'"]').prop('selected',true);}else{el.val(temp[1]);}}});}};Application.Tool.Form.deparam=function(url){var result={};var b=decodeURIComponent(url).split('&');$.each(b,function(x,y){var temp=y.split('=');temp[1]=temp[1].replace(/\+/g,' ');result[temp[0]]=temp[1];});return result;};Application.Tool.Env={};Application.Tool.Env.isMobile=function(){return $('body').data('is-mobile')===1?true:false;};Application.Tool.Env.screenWidth=function(){return $(window).width();};Application.Tool.Env.screenHeight=function(){return $(window).height();};Application.Tool.Env.os=function(){var ua=navigator.userAgent.toLowerCase();if(ua.indexOf("Windows Phone")>-1||ua.indexOf("windows phone")>-1){return'wp';}else if(ua.indexOf("android")>-1||ua.indexOf("Android")>-1){return'android';}else if(ua.indexOf("iphone")>-1||ua.indexOf("ipad")>-1){return'ios';} 3275return null;};Application.Tool.Env.maxOverlayListHeight=function(){var result=Application.Tool.Env.screenHeight()-200;if(result<250){result=250;} 3276return result;};Application.Tool.Env.deviceXs=function(){return $('body').hasClass('device-xs');};Application.Tool.Env.loadJs=function(src){var dfd=$.Deferred();$("<script></script>").appendTo($("body")).load(function(){dfd.resolve();}).attr("src",src);return dfd;};Application.Tool.Env.loadCss=function(src){$('<link rel="stylesheet" type="text/css" />').appendTo($("body")).attr("href",src);};Application.Tool.StatsClient=function(facilityId,facilityPriority){this.facilityId=facilityId;this.facilityPriority=facilityPriority;this.serverUrl='https://stats-server.meteor24.pl/api/hit/register';};Application.Tool.StatsClient.prototype.hit=function(eventName){var params={e:eventName,fid:this.facilityId,fpr:this.facilityPriority,src:1,dummy:new Date().getTime()};var url=this.serverUrl+'?'+$.param(params);var img=$('<img/>');img.css('display','none');img.attr('src',url);$('body').append(img);};Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(e){var t="";var n,r,i,s,o,u,a;var f=0;e=Base64._utf8_encode(e);while(f<e.length){n=e.charCodeAt(f++);r=e.charCodeAt(f++);i=e.charCodeAt(f++);s=n>>2;o=(n&3)<<4|r>>4;u=(r&15)<<2|i>>6;a=i&63;if(isNaN(r)){u=a=64}else if(isNaN(i)){a=64}t=t+this._keyStr.charAt(s)+this._keyStr.charAt(o)+this._keyStr.charAt(u)+this._keyStr.charAt(a)}return t},decode:function(e){var t="";var n,r,i;var s,o,u,a;var f=0;e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(f<e.length){s=this._keyStr.indexOf(e.charAt(f++));o=this._keyStr.indexOf(e.charAt(f++));u=this._keyStr.indexOf(e.charAt(f++));a=this._keyStr.indexOf(e.charAt(f++));n=s<<2|o>>4;r=(o&15)<<4|u>>2;i=(u&3)<<6|a;t=t+String.fromCharCode(n);if(u!=64){t=t+String.fromCharCode(r)}if(a!=64){t=t+String.fromCharCode(i)}}t=Base64._utf8_decode(t);return t},_utf8_encode:function(e){e=e.replace(/\r\n/g,"\n");var t="";for(var n=0;n<e.length;n++){var r=e.charCodeAt(n);if(r<128){t+=String.fromCharCode(r)}else if(r>127&&r<2048){t+=String.fromCharCode(r>>6|192);t+=String.fromCharCode(r&63|128)}else{t+=String.fromCharCode(r>>12|224);t+=String.fromCharCode(r>>6&63|128);t+=String.fromCharCode(r&63|128)}}return t},_utf8_decode:function(e){var t="";var n=0;var r=c1=c2=0;while(n<e.length){r=e.charCodeAt(n);if(r<128){t+=String.fromCharCode(r);n++}else if(r>191&&r<224){c2=e.charCodeAt(n+1);t+=String.fromCharCode((r&31)<<6|c2&63);n+=2}else{c2=e.charCodeAt(n+1);c3=e.charCodeAt(n+2);t+=String.fromCharCode((r&15)<<12|(c2&63)<<6|c3&63);n+=3}}return t}} 3277Application.Tool.Base64=Base64;Application.Tool.WebPush={serverKey:"BClGNqwzDEb8gUFKp8SADrNjQnAParywQoAkE1t5dyGGFKIhAWAUdTyBMozb+IQmSebNcvI2drpbfSZEz7Xoakw="};function urlBase64ToUint8Array(base64String){var padding='='.repeat((4-base64String.length%4)%4);var base64=(base64String+padding).replace(/\-/g,'+').replace(/_/g,'/');var rawData=window.atob(base64);var outputArray=new Uint8Array(rawData.length);for(var i=0;i<rawData.length;++i){outputArray[i]=rawData.charCodeAt(i);} 3278return outputArray;} 3279Application.Tool.WebPush.unsubscribe=function(){navigator.serviceWorker.ready.then(function(serviceWorkerRegistration){return serviceWorkerRegistration.pushManager.getSubscription()}).then(function(subscription){console.log("subscription:",subscription);if(!subscription){return;} 3280return subscription;}).then(function(subscription){return subscription.unsubscribe();}).catch(function(e){console.error('Error when unsubscribing the user',e);});};Application.Tool.WebPush.saveSubscription=function(subscription,method){var key=subscription.getKey('p256dh');var token=subscription.getKey('auth');return fetch('/?c=PushNotification&a=subscribe',{method:method,body:JSON.stringify({location:window.location.toString(),endpoint:subscription.endpoint,key:key?btoa(String.fromCharCode.apply(null,new Uint8Array(key))):null,token:token?btoa(String.fromCharCode.apply(null,new Uint8Array(token))):null}),}).then(function(){return subscription;});};Application.Tool.WebPush.subscribe=function(){navigator.serviceWorker.ready.then(function(serviceWorkerRegistration){return serviceWorkerRegistration.pushManager.subscribe({userVisibleOnly:true,applicationServerKey:Application.Tool.WebPush.urlBase64ToUint8Array(Application.Tool.WebPush.serverKey),})}).then(function(subscription){$.post("/?c=Log&a=event",{log:'pushnotification',event:'permission-granted'});console.log("saving subscription to server",subscription);Application.Tool.WebPush.saveSubscription(subscription,'POST')}).catch(function(e){if(Notification.permission==='denied'){$.post("/?c=Log&a=event",{log:'pushnotification',event:'permission-denied'});console.warn('Notifications are denied by the user.');}else{console.error('Impossible to subscribe to push notifications',e);}});};Application.Tool.WebPush.unregisterServiceWorker=function(serviceWorkerPath){navigator.serviceWorker.register(serviceWorkerPath).then(function(registration){return registration.unregister().then(function(boolean){console.log("unregistered",boolean)});});};Application.Tool.WebPush.registerServiceWorker=function(serviceWorkerPath,callback){navigator.serviceWorker.register(serviceWorkerPath).then(function(registration){console.log('Service worker has been registered',registration);navigator.serviceWorker.ready.then(function(serviceWorkerRegistration){return serviceWorkerRegistration.pushManager.getSubscription()}).then(function(subscription){console.log('subscription:',subscription);callback(subscription);if(!subscription){return;}}).catch(function(e){console.error('Error when updating the subscription',e);});},function(e){console.error('Service worker registration failed',e);});};Application.Tool.WebPush.urlBase64ToUint8Array=function(base64String){var padding='='.repeat((4-base64String.length%4)%4);var base64=(base64String+padding).replace(/\-/g,'+').replace(/_/g,'/');var rawData=window.atob(base64);var outputArray=new Uint8Array(rawData.length);for(var i=0;i<rawData.length;++i){outputArray[i]=rawData.charCodeAt(i);} 3281return outputArray;};Application.Tool.WebPush.isBrowserCompatible=function(){if(!('serviceWorker'in navigator)){console.warn("Service workers are not supported by this browser");return false;} 3282if(!('PushManager'in window)){console.warn('Push notifications are not supported by this browser');return false;} 3283if(!('showNotification'in ServiceWorkerRegistration.prototype)){console.warn('Notifications are not supported by this browser');return false;} 3284if(Notification.permission==='denied'){console.warn('Notifications are denied by the user');return false;} 3285return true;};Application.Tool.BrowserHistory={_pages:null,_scrollTimeout:null};Application.Tool.BrowserHistory.initialize=function(){this._load();this._bindEvents();};Application.Tool.BrowserHistory.add=function(page){this._pages[page.getId()]=page;this._save();return this;};Application.Tool.BrowserHistory.getCurrentPage=function(){var page=null;for(var id in this._pages){if(null===page||this._pages[id].getCeatedAt()>page.getCeatedAt()){page=this._pages[id];}} 3286return page;};Application.Tool.BrowserHistory.getPages=function(){return this._pages;};Application.Tool.BrowserHistory.getPageById=function(id){return'undefined'!==typeof(this._pages[id])?this._pages[id]:null;};Application.Tool.BrowserHistory._bindEvents=function(){var that=this;$(window).scroll(function(event){clearTimeout(that._scrollTimeout);that._scrollTimeout=setTimeout(function(){that.refreshData();},1500);});};Application.Tool.BrowserHistory.refreshData=function(){var that=this;var currentPage=that.getCurrentPage();currentPage.setScrollOffset($(window).scrollTop());this._save();};Application.Tool.BrowserHistory._save=function(){$.jStorage.set('Application.Tool.BrowserHistory',this._pages,{TTL:5*3600*1000});};Application.Tool.BrowserHistory._load=function(){if(null!==this._pages){return;} 3287this._pages={};if($.jStorage.get('Application.Tool.BrowserHistory')){var pagesData=$.jStorage.get('Application.Tool.BrowserHistory');for(var id in pagesData){var page=new Application.Tool.BrowserHistory.Page(id);for(var prop in pagesData[id]){page[prop]=pagesData[id][prop]} 3288this._pages[page.getId()]=page;}}};Application.Tool.BrowserHistory.Page=function(id){if(typeof(id)==='undefined'){id=window.location.href;} 3289this._id=id;this._scrollOffset=$(window).scrollTop();this._createdAt=(new Date()).getTime();};Application.Tool.BrowserHistory.Page.prototype.getId=function(){return this._id;};Application.Tool.BrowserHistory.Page.prototype.getCeatedAt=function(){return this._createdAt;};Application.Tool.BrowserHistory.Page.prototype.getScrollOffset=function(){return this._scrollOffset;};Application.Tool.BrowserHistory.Page.prototype.setScrollOffset=function(offset){this._scrollOffset=offset;return this;};Application.Tool.BrowserHistory.Page.prototype.equals=function(page){return page.getId()===this.getId();};Application.Widget.DateRangePicker=function(opt){this._options={fromInput:null,toInput:null,onChange:function(arrival,departure){},minRange:1};this.setOption(opt);};Application.Widget.DateRangePicker.prototype=new Meteor.Core.Widget('DateRangePicker');Application.Widget.DateRangePicker.prototype._render=function(){this._renderDesktop();};Application.Widget.DateRangePicker.prototype._renderDesktop=function(){var that=this;var arrival=this._options.fromInput;var departure=this._options.toInput;
3289arrival.pickadate({clear:'czyÅÄ',onSet:function(changes){if(typeof(changes['select'])!=='undefined'){that._options.onChange(arrival,departure);if(departure.val()===""||Date.create(arrival.val()).addDays(1).isAfter(departure.val())){var newDepartureDate=Date.create(changes['select']).addDays(1*that._options.minRange);departure.pickadate("set",{select:newDepartureDate});}}}});departure.pickadate({clear:'czyÅÄ',onSet:function(changes){if(typeof(changes['select'])!=='undefined'){that._options.onChange(arrival,departure);} 3290if(arrival.val()===""||Date.create(arrival.val()).addDays(1).isAfter(departure.val())){var newDate=Date.create(changes['select']).addDays(-1*that._options.minRange);arrival.pickadate("set",{select:newDate});}}});if(arrival.val()!==''){} 3291if(departure.val()!==''){}};Application.Widget.DateRangePicker.prototype._renderMobile=function(){var that=this;var arrival=this._options.fromInput;var departure=this._options.toInput;$('body').datepicker({forceParse:false,startDate:Date.create('today'),autoclose:true,todayHighlight:true,inputs:[arrival,departure]});arrival.on('changeDate',function(){if(departure.val()===""||departure.val()===arrival.val()){departure.datepicker('update',arrival.datepicker('getDate').addDays(1));}});};Application.Widget.DateRangePickerMulti=function(opt){this._options={fromInput:null,toInput:null,onChange:function(arrival,departure){}};this.setOption(opt);};Application.Widget.DateRangePickerMulti.prototype=new Meteor.Core.Widget('DateRangePickerMulti');Application.Widget.DateRangePickerMulti.prototype._render=function(){var that=this;var arrival=this._options.fromInput;var departure=this._options.toInput;var options={autoUpdateInput:false,autoApply:false,linkedCalendars:true,locale:{format:"YYYY-MM-DD",separator:" - ",applyLabel:"ok",cancelLabel:"wyczyÅÄ",fromLabel:"od",toLabel:"do",customRangeLabel:"Custom",weekLabel:"T",daysOfWeek:["Nd","Pn","Wt","År","Cz","Pt","So"],monthNames:["StyczeÅ","Luty","Marzec","KwiecieÅ","Maj","Czerwiec","Lipiec","SierpieÅ","WrzesieÅ","Październik","Listopad","GrudzieÅ"],firstDay:1}};arrival.daterangepicker(options).on('apply.daterangepicker',function(ev,picker){arrival.val(picker.startDate.format('YYYY-MM-DD')) 3292departure.val(picker.endDate.format('YYYY-MM-DD')) 3293departure.data('daterangepicker').setStartDate(picker.startDate);departure.data('daterangepicker').setEndDate(picker.endDate);that._options.onChange(arrival,departure);}).on('cancel.daterangepicker',function(ev,picker){arrival.val('');departure.val('');}).on('show.daterangepicker',function(ev,picker){picker.container.find('.daterangepicker_input').hide();});departure.daterangepicker(options).on('apply.daterangepicker',function(ev,picker){arrival.val(picker.startDate.format('YYYY-MM-DD')) 3294departure.val(picker.endDate.format('YYYY-MM-DD')) 3295arrival.data('daterangepicker').setStartDate(picker.startDate);arrival.data('daterangepicker').setEndDate(picker.endDate);that._options.onChange(arrival,departure);}).on('cancel.daterangepicker',function(ev,picker){arrival.val('');departure.val('');}).on('show.daterangepicker',function(ev,picker){picker.container.find('.daterangepicker_input').hide();});;};Application.Widget.NumberOfGuestsPicker=function(opt){this._options={element:null,input:null,value:2,};this.setOption(opt);};Application.Widget.NumberOfGuestsPicker.prototype=new Meteor.Core.Widget('NumberOfGuestsPicker');Application.Widget.NumberOfGuestsPicker.prototype._guestLabel=function(n){if(n===1)return'osoba';if(n>=2&&n<=4)return'osoby';var lastTwo=n%100;var lastOne=n%10;if(lastTwo>=12&&lastTwo<=14)return'osób';if(lastOne>=2&&lastOne<=4)return'osoby';return'osób';};Application.Widget.NumberOfGuestsPicker.prototype.render=function(){var that=this;var label=this._guestLabel(this._options.value);var markup=$(['<div class="nog-preview">','<span class="nog-preview-value">'+this._options.value+'</span> ','<span class="nog-preview-label">'+label+'</span>','</div>','<div class="nog-menu">','<div class="nog-menu-arrow"></div>','<div class="nog-menu-label">Liczba goÅci</div>','<div class="nog-controls">','<button type="button" class="nog-btn down" aria-label="mniej goÅci">','<i class="fa fa-minus"></i>','</button>','<span class="nog-value">'+this._options.value+'</span>','<button type="button" class="nog-btn up" aria-label="wiÄcej goÅci">','<i class="fa fa-plus"></i>','</button>','</div>','</div>',].join(''));this._options.element.css('position','relative').html(markup);this._options.input.val(this._options.value);this._injectStyles();this._bindEvents();this._updateDownBtn();};Application.Widget.NumberOfGuestsPicker.prototype._injectStyles=function(){if($('#nog-styles').length)return;$('<style id="nog-styles">').text(['.nog-preview {',' cursor: pointer;',' font-size: 16px;',' color: #333;',' user-select: none;',' display: flex;',' align-items: center;',' gap: 4px;',' height: 100%;','}','.nog-preview-value {',' font-weight: 600;','}','.nog-preview-label {',' font-weight: 400;','}','.nog-menu {',' display: none;',' position: absolute;',' top: calc(100% + 12px);',' left: 50%;',' transform: translateX(-50%);',' background: #fff;',' border-radius: 16px;',' box-shadow: 0 8px 32px rgba(0,0,0,.12), 0 2px 8px rgba(0,0,0,.06);',' border: 1px solid #eee;',' padding: 20px 24px;',' z-index: 1000;',' min-width: 200px;',' text-align: center;','}','.nog-menu-arrow {',' position: absolute;',' top: -7px;',' left: 50%;',' transform: translateX(-50%) rotate(45deg);',' width: 12px;',' height: 12px;',' background: #fff;',' border-top: 1px solid #eee;',' border-left: 1px solid #eee;','}','.nog-menu-label {',' font-size: 12px;',' font-weight: 600;',' color: #999;',' text-transform: uppercase;',' letter-spacing: 0.5px;',' margin-bottom: 14px;','}
3295','.nog-controls {',' display: flex;',' align-items: center;',' justify-content: center;',' gap: 20px;','}','.nog-btn {',' width: 36px;',' height: 36px;',' border-radius: 50%;',' border: 1.5px solid #ccc;',' background: #fff;',' color: #555;',' font-size: 13px;',' cursor: pointer;',' display: flex;',' align-items: center;',' justify-content: center;',' transition: all 0.15s ease;',' padding: 0;',' outline: none;','}','.nog-btn:hover:not(.is-disabled) {',' border-color: #333;',' color: #333;',' background: #fafafa;','}','.nog-btn:active:not(.is-disabled) {',' transform: scale(0.92);','}','.nog-btn.is-disabled {',' border-color: #e8e8e8;',' color: #ddd;',' cursor: not-allowed;','}','.nog-value {',' font-size: 22px;',' font-weight: 700;',' color: #1a1a2e;',' min-width: 40px;',' line-height: 1;','}','.nog-menu.is-open {',' display: block;',' animation: nogFadeIn 0.18s ease;','}','@keyframes nogFadeIn {',' from { opacity: 0; transform: translateX(-50%) translateY(6px); }',' to { opacity: 1; transform: translateX(-50%) translateY(0); }','}',].join('\n')).appendTo('head');};Application.Widget.NumberOfGuestsPicker.prototype._bindEvents=function(){var that=this;var $menu=this._options.element.find('.nog-menu');this._options.element.find('.nog-preview').on('click',function(e){e.stopPropagation();$menu.toggleClass('is-open');});$menu.on('click',function(e){e.stopPropagation();});$(window).on('click',function(){$menu.removeClass('is-open');});this._options.element.find('.nog-btn.up').on('click',function(){that.changeValue(that._options.value+1);});this._options.element.find('.nog-btn.down').on('click',function(){if(that._options.value>1){that.changeValue(that._options.value-1);}});};Application.Widget.NumberOfGuestsPicker.prototype.changeValue=function(value){this._options.value=value;var label=this._guestLabel(value);this._options.element.find('.nog-value').text(value);this._options.element.find('.nog-preview-value').text(value);this._options.element.find('.nog-preview-label').text(label);this._options.input.val(value);this._updateDownBtn();};Application.Widget.NumberOfGuestsPicker.prototype._updateDownBtn=function(){this._options.element.find('.nog-btn.down').toggleClass('is-disabled',this._options.value<=1);};Meteor.Widget.TimespanPicker=function(opt){this._options={container:null,pickCallback:function(data){},canBeHidden:false};if(typeof(opt)=='object'){for(var i in opt){this._options[i]=opt[i];}} 3296this._mainWrapper=$(this._options.container);};Meteor.Widget.TimespanPicker.prototype.render=function(){this._bindEvents();this.refresh();};Meteor.Widget.TimespanPicker.prototype.show=function(){var that=this;this._mainWrapper.show();that._options.canBeHidden=false;setTimeout(function(){that._options.canBeHidden=true;},1);};Meteor.Widget.TimespanPicker.prototype.hide=function(){this._mainWrapper.hide();};Meteor.Widget.TimespanPicker.prototype.collapse=function(){this._mainWrapper.find('.timespanTableRowHidden').hide();this._mainWrapper.find('.expandB').show();};Meteor.Widget.TimespanPicker.prototype.expand=function(){this._mainWrapper.find('.timespanTableRowHidden').show();this._mainWrapper.find('.expandB').hide();};Meteor.Widget.TimespanPicker.prototype.refresh=function(){this._mainWrapper.find('.timespan').each(function(){var timespan=$(this);var parentRow=timespan.parents('.timespanTableRow');if(timespan.prop('checked')){parentRow.addClass('timespanTableRowSelected');}else{parentRow.removeClass('timespanTableRowSelected');}});};Meteor.Widget.TimespanPicker.prototype._bindEvents=function(){var that=this;$("html").click(function(evt){if(!that._options.canBeHidden){return;} 3297var target=evt.target;if($(target).parents(".timespanPicker").length==0){that.hide();that.collapse();}});this._mainWrapper.find('.timespan').change(function(){var timespan=$(this);var parentRow=timespan.parents('.timespanTableRow');that.refresh();var data={timespan:timespan.val(),timespanDMY:timespan.attr('data-timespanDMY')};that._options.pickCallback.apply(data);});this._mainWrapper.mouseover(function(){});this._mainWrapper.mouseout(function(){});};Meteor.Widget.TimespanPicker.prototype.throwException=function(msg){throw"Meteor.Widget.TimespanPicker: "+msg;};Application.Widget.FlashMessenger=function(opt){this._options={latency:3000,container:$('body')};this.setOption(opt);this._mainWrapper=this._options.container;this._container=null;this._messageTimeout=null;};Application.Widget.FlashMessenger.prototype=new Meteor.Core.Widget('Flas
3297hMessenger');Application.Widget.FlashMessenger.prototype._render=function(){var that=this;this._container=$(['<div class="widget-flash-messanger"><span class="message"></span></div>'].join(''));this._container.hide();this._mainWrapper.append(this._container);this._bindEvents();};Application.Widget.FlashMessenger.prototype._bindEvents=function(){var that=this;};Application.Widget.FlashMessenger.prototype.write=function(text,options){var that=this;var options=Meteor.Core.Object.merge(this._options,options);clearTimeout(this._messageTimeout);this._setText(text);this._show();this._messageTimeout=setTimeout(function(){that._hide();},options.latency);return this;};Application.Widget.FlashMessenger.prototype.info=function(text){this.write(text);return this;};Application.Widget.FlashMessenger.prototype._setText=function(text){this._container.find('.message').html(text);return this;};Application.Widget.FlashMessenger.prototype._show=function(text){this._container.show();return this;};Application.Widget.FlashMessenger.prototype._hide=function(text){this._container.fadeOut();return this;};Application.Module.Default=function(){this._mainWrapper=$('body');this._baseUrl=$('body').data('base-url');this._flashMessanger=null;};Application.Module.Default.prototype=new Meteor.App.Module('Default');Application.Module.Default.prototype.doInitialize=function(){var that=this;$('[data-toggle="tooltip"]').tooltip();this._bindEvents();this.handleLocationContext();this.setBodyClass();$('.header-text').dotdotdot({height:20});$('.on-load-remove').remove();$('.on-load-visible').css({visibility:'visible'});this._flashMessanger=new Application.Widget.FlashMessenger();this._flashMessanger.render();setTimeout(function(){that.initalizeLazyCss();},200);this.initalizeLazyIframe();if($('.obiekty-top-splide').length){const slideTop=new Splide('.obiekty-top-splide',{type:'loop',perPage:4,breakpoints:{640:{perPage:2,},}}).mount();$('.obiekty-top-splide-close').click(function(){$(this).remove();slideTop.destroy();});} 3298if($('.last-minute-splide').length){const slideLastMinute=new Splide('.last-minute-splide',{type:'loop',perPage:3,breakpoints:{640:{perPage:1,},}}).mount();$('.last-minute-splide-close').click(function(){$(this).remove();slideLastMinute.destroy();});} 3299$('.dropdown-menu a.dropdown-toggle').on("click",function(e){var row=$(this).parent().siblings().find(".dropdown-menu").hide();$(this).next('ul').toggle();e.stopPropagation();e.preventDefault();});this.handleJsLink();};Application.Module.Default.prototype.handleJsLink=function(){var that=this;$("body").on("click",".js-link",function(e){if($(e.target).is("a")){return;} 3300var jsLink=$(this);var url=jsLink.data("url");var target=jsLink.data("target")||"_self";if(Application.Tool.Env.deviceXs()){target="_self";} 3301target="_self";window.open(url,target);});if(Application.Tool.Env.deviceXs()){$("a[target=_blank]").attr("target","_self");}};Application.Module.Default.prototype._bindEvents=function(){var that=this;$('.show-more-anchors-button').click(function(){var button=$(this);button.hide();button.parents('.anchor-section').find('.anchor-section-list-element-hidden').removeClass('anchor-section-list-element-hidden');return false;});this.sandbox.addEventListeners('SearchForm.search.results.loaded',function(e){$('.remove-on-search-result-loaded').remove();});this.sandbox.addEventListeners('flash-messanger-requested',function(e){that._flashMessanger.info(e.data.text);});$('.js-anchor').css('cursor','pointer').click(function(){var href=Application.Tool.Base64.decode($(this).data('b64url'));window.open(href);});};Application.Module.Default.prototype._setupFeedbackForm=function(){var that=this;};Application.Module.Default.prototype.initalizeLazyCss=function(){$('.lazy-css').each(function(){$(this).attr('href',$(this).data('href'))});};Application.Module.Default.prototype.handleLocationContext=function(){var locationContext=$('body').data("location-context");if(locationContext){var href='/noclegi-mapa.html#MapSearchFormModule=map-zoom%3D11%26map-center-lat%3D'+locationContext.lat+'%26map-center-lng%3D'+locationContext.lng;$("#page-navigation .page-map a").attr("href",href)}};Application.Module.Default.prototype.initalizeLazyIframe=function(){$('.lazy-iframe').each(function(){var iframe=$(this);var delay=4000;if(iframe.data('delay')){delay=iframe.data('delay');} 3302setTimeout(function(){iframe.get(0).contentWindow.location.replace(iframe.data('src'));},delay);});};Application.Module.Default.prototype.setBodyClass=function(){if($(window).width()<768){$('body').addClass('device-xs');$('.remove-if-screen-xs').remove();}else if($(window).width()>=768&&$(window).width()<=992){$('body').addClass('device-sm');}else if($(window).width()>992&&$(window).width()<=1200){$('body').addClass('device-md');}else{$('body').addClass('device-lg');}};Meteor.App.Core.registerModule(new Application.Module.Default());Application.Module.GdprNotice=function(){this._mainWrapper=$('body');this._domain='meteor-turystyka.pl';};Application.Module.GdprNotice.prototype=new Meteor.App.Module('GdprNotice');Application.Module.GdprNotice.prototype.doInitialize=function(){this.showAlert();};Application.Module.GdprNotice.prototype._bindEvents=function(){};Application.Module.GdprNotice.prototype.showAlert=function(){var text="Strona korzysta z <a rel='nofollow' href='/polityka-prywatnosci.html' target='blank'>plików cookies</a> w celu poprawy funkcjonowania serwisu. Jeżeli nie zmienisz ustawieÅ, bÄdÄ one zapisywane w pamiÄci Twojego urzÄ dzenia.";if(Application.Tool.Env.deviceXs()){var text="Polityka <a rel='nofollow' href='/polityka-prywatnosci.html' target='blank'>plików cookies</a>";} 3303if(null===Meteor.Util.Cookie.get('gdpr-accepted')){var closeButton=$('
3303<div><i class="fa fa-window-close"><i/></div>');closeButton.css({cursor:"pointer",float:"right",fontSize:"20px"});var mainContainer=$('<div/>');var messageContainer=$('<div/>');messageContainer.html(text);mainContainer.css({position:"fixed",width:"100%",textAlign:"center",background:"orange",color:"white",fontWeight:"bold",padding:"5px",lineHeight:"20px",zIndex:3});if(Application.Tool.Env.deviceXs()&&$(".floating-buttons").is(":visible")){mainContainer.css({bottom:45});}else{mainContainer.css({bottom:0});} 3304closeButton.click(function(){mainContainer.remove();Meteor.Util.Cookie.create('gdpr-accepted',1);});mainContainer.append(closeButton);mainContainer.append(messageContainer);$("body").append(mainContainer);}};Meteor.App.Core.registerModule(new Application.Module.GdprNotice());Application.Module.ShareButtons=function(){this._mainWrapper=$('body');this._baseUrl=$('body').data('base-url');this._pageType=$('body').data('page-type');this.shareOptions=[{icon:'fa-facebook-official',label:"Facebook",mobileOnly:false,url:'https://www.facebook.com/sharer/sharer.php?u='+window.location},{icon:'fa-facebook-official',label:"Messanger",mobileOnly:true,url:'fb-messenger://share/?link='+window.location},{icon:'fa-twitter',label:"Twitter",mobileOnly:false,url:'https://twitter.com/intent/tweet?text='+window.location},{icon:'fa-whatsapp',label:"WhatsApp",mobileOnly:true,url:'whatsapp://send?text='+window.location},{icon:'fa-envelope',label:"E-mail",mobileOnly:false,url:'mailto:?body='+window.location},];};Application.Module.ShareButtons.prototype=new Meteor.App.Module('ShareButtons');Application.Module.ShareButtons.prototype.doInitialize=function(){this._bindEvents();};Application.Module.ShareButtons.prototype._bindEvents=function(){var that=this;$('.share-button').css('cursor','pointer').click(function(){new BootstrapDialog({title:'UdostÄpnij przez...',message:that.getContent(),closable:false,onshow:function(dialog){},onshown:function(dialog){dialog.getModalContent().find('.share-button').click(function(){var button=$(this);ga('send',{hitType:'event',eventCategory:'page',eventAction:'share',eventLabel:that._pageType});ga('send',{hitType:'event',eventCategory:'page',eventAction:'share-channel',eventLabel:button.data('label')});});},buttons:[{label:'zamknij',action:function(dialog){dialog.close();}}]}).open();ga('send',{hitType:'event',eventCategory:'page',eventAction:'share-menu-open',eventLabel:that._pageType});});};Application.Module.ShareButtons.prototype.getContent=function(){var htmlArr=[];htmlArr.push('<div class="row">');for(var i in this.shareOptions){var item=this.shareOptions[i];htmlArr.push(['<div class="col-xs-6 col-md-4 '+(item.mobileOnly?"visible-xs visible-sm":"")+'">','<a rel="nofollow" target="_blank" class="btn btn-primary btn-block share-button" data-label="'+item.label+'" href="'+item.url+'" style="margin-bottom: 5px;">','<i class="fa '+item.icon+'"></i> ','<b>'+item.label+'</b>','</a>','</div>'].join(""));} 3305htmlArr.push('</div>');return htmlArr.join("");};Meteor.App.Core.registerModule(new Application.Module.ShareButtons());Application.Module.BrowserHistory=function(){this._mainWrapper=$('body');this._baseUrl=$('body').data('base-url');this._flashMessanger=null;};Application.Module.BrowserHistory.prototype=new Meteor.App.Module('BrowserHistory');Application.Module.BrowserHistory.prototype.doInitialize=function(){var that=this;Application.Tool.BrowserHistory.initialize();var page=Application.Tool.BrowserHistory.getPageById(window.location.href);if(null!==page){setTimeout(function(){that.dispatchEvent(new Meteor.Core.Event('browser-history-page-revisited',true,{page:page}));},1);} 3306Application.Tool.BrowserHistory.add(new Application.Tool.BrowserHistory.Page(window.location.href));this._bindEvents();};Application.Module.BrowserHistory.prototype._bindEvents=function(){var that=this;};Meteor.App.Core.registerModule(new Application.Module.BrowserHistory());Application.Module.LanguageSwitcher=function(){this._mainWrapper=$('.lang-switcher');this._baseUrl=$('body').data('base-url');};Application.Module.LanguageSwitcher.prototype=new Meteor.App.Module('LanguageSwitcher');Application.Module.LanguageSwitcher.prototype.doInitialize=function(){var that=this;this._bindEvents();};Application.Module.LanguageSwitcher.prototype._bindEvents=function(){var that=this;this._mainWrapper.find('.current').click(function(){new BootstrapDialog({title:' ',type:BootstrapDialog.TYPE_PRIMARY,message:that._mainWrapper.find('.alternatives').html(),closable:true,nl2br:false,cssClass:'lang-switcher-modal',buttons:{}}).open();});};Meteor.App.Core.registerModule(new Application.Module.LanguageSwitcher());Application.Module.LazyImageLoader=function(){this._mainWrapper=$('body');this._baseUrl=$('body').data('base-url');};Application.Module.LazyImageLoader.prototype=new Meteor.App.Module('LazyImageLoader');Application.Module.LazyImageLoader.prototype.doInitialize=function(){this._bindEvents();};Application.Module.LazyImageLoader.prototype._bindEvents=function(){var that=this;this.sandbox.addEventListeners('lazy-image-loader-content-loaded',function(e){that._bindImageLoad();});that._bindImageLoad();};Application.Module.LazyImageLoader.prototype._bindImageLoad=function(){$('img.lazy-image-loader').data('inview-treshold',600);this._mainWrapper.find('.lazy-image-loader').removeClass('lazy-image-loader').one('inview',function(event,visible){var img=$(this);var newSrc=img.attr('data-src-small')&&Application.Tool.Env.screenWidth()<=767?img.attr('data-src-small'):img.attr('data-src');if(img.attr('src')===newSrc){return;} 3307var tempImg=$('<img/>').attr('src',newSrc) 3308tempImg.one('load',function(){img.css({opacity:0}
3308);img.attr('src',newSrc);if(Application.Tool.Env.screenWidth()<767){img.css({opacity:1});}else{img.animate({opacity:1},200);}});});$(window).scroll();};Meteor.App.Core.registerModule(new Application.Module.LazyImageLoader());Application.Module.SearchForm=function(){this._mainWrapper=$('body');this._baseUrl=this._mainWrapper.data('base-url');this._searchForm=this._mainWrapper.find('.search-form-main-v2');this._searchRequest=null;this._cacheRevision=25;this._order="default";this._revisitedPage=null;};Application.Module.SearchForm.prototype=new Meteor.App.Module('SearchForm');Application.Module.SearchForm.prototype.doInitialize=function(){var that=this;if(window.location.href.toString().match(/\.pl\.dev/)){$.jStorage.flush();} 3309if(window.location.href.toString().match(/m\.meteor/)){$.jStorage.flush();} 3310if(this._mainWrapper.find('.search-form-main-v2:visible').length===0){return;} 3311if($('body').attr("id")!=="link-search"){$(".toggle-filters-button").remove();} 3312this.bindEvents();if(Application.Tool.Env.deviceXs()){this._mainWrapper.find('.rodzaj-list').remove();$(".attributes-sidebar .attribute-categories").hide();$(".attributes-sidebar .attribute-categories-toggler").show();}else{this._mainWrapper.find('select[name="formDataBonus\[rodzaj_maska_arr\]\[\]"]').parents(".form-row ").remove();} 3313var initUi=function(){that.initializeAutocomplete();that.initMultiselect();that.initICheckbox();that.initTimespanPicker();that.initRestrictionsRemover();that.initLocationPicker();that.initializeDateRangePicker();if(that.initializeSort){that.initializeSort();} 3314if(that.initializeShowOnMapButton){that.initializeShowOnMapButton();} 3315that._searchForm.css('visibility','visible');that._searchForm.css('opacity',1);};var initialRestrictionsUrl=this._mainWrapper.find('.search-form').attr('data-initial-restrictions-url');if(initialRestrictionsUrl){var deparammerFormData=Application.Tool.Form.deparam(initialRestrictionsUrl);if(deparammerFormData['formData[tag_id_all_in][]']){var tagId=deparammerFormData['formData[tag_id_all_in][]'];if(0===$('.tag-select option[value='+tagId+']').length){var option=$('<option/>').html(deparammerFormData['formDataBonus[tag_text]']).attr('value',tagId) 3316$('.tag-select').append(option);}}} 3317if(null===window.location.hash.toString().match(/SearchFormModule/)){this._initializeFormFields();this._syncDatePickerFromHidden();initUi();if(that._mainWrapper.find('.search-form-filter-home-2').length>0){that._mainWrapper.find('.search-form-filter').appendTo(that._mainWrapper.find('.search-form-filter-home-2'));$('.search-button-row-2').remove();}}else{setTimeout(function(){$(window).trigger('hashchange');initUi();$('.search-form-filter-home-2').remove();},1);}};Application.Module.SearchForm.prototype.bindEvents=function(){var that=this;this._datePicker=new easepick.create({element:document.getElementById('arrival-departure'),css:['/vendor/easepick-1.2.1/css/easepick-1.1.2.css','/vendor/easepick-1.2.1/css/easepick-custom.css',],lang:'pl-PL',format:'DD MMM',calendars:2,grid:2,plugins:['RangePlugin','LockPlugin'],autoApply:true,LockPlugin:{minDate:new Date(),},RangePlugin:{tooltipNumber(num){return num-1;},locale:{one:'noc',other:'noce'},},});this._mainWrapper.find(".date-range-selector-icon").click(function(){that._datePicker.show();});var $arrivalDeparture=$('#arrival-departure');$arrivalDeparture.removeAttr('name');$arrivalDeparture.after('<input type="hidden" name="formDataBonus[date_range]" class="date-range-hidden" />');that._datePicker.on('select',(e)=>{var start=that._datePicker.getStartDate();var end=that._datePicker.getEndDate();if(start&&end){var fmt=function(d){return d.format('YYYY-MM-DD');};$('.date-range-hidden').val(fmt(start)+' - '+fmt(end));}});(new Application.Widget.NumberOfGuestsPicker({element:this._mainWrapper.find(".number-of-guest-selector"),input:this._mainWrapper.find(".number-of-guest-input"),value:this._mainWrapper.find(".number-of-guest-input").val()>0?this._mainWrapper.find(".number-of-guest-input").val():2})).render();this._mainWrapper.find(".sf-field-guests").on('click',function(e){if(!$(e.target).closest('.nog-preview, .nog-menu').length){e.stopPropagation();$(this).find('.nog-menu').toggleClass('is-open');}});this._searchForm.submit(function(){that.triggerSearch();ga('send',{hitType:'event',eventCategory:'search-form',eventAction:'use',eventLabel:"search"});return false;});this._mainWrapper.find('.search-form-filter').submit(function(){return false;});this._mainWrapper.find('.toggle-filters-button').click(function(){that._mainWrapper.find('.search-form-filter .form-row').toggle();});$('.search-button').click(function(){var button=$(this);button.css({opacity:0.5});setTimeout(function(){button.css({opacity:1});},300);that._searchForm.submit();});$(window).bind('hashchange',function(e){if(''===e.fragment){window.location.reload();return false;} 3318var url=e.getState('SearchFormModule');var hashData=$.deparam.fragment(url);if(window.location.hash.toString().match(/SearchFormModule/)){Application.Tool.Form.deserializeUrl(url,that._mainWrapper.find('.search-form'));Application.Tool.Form.deserializeUrl(url,that._mainWrapper.find('.search-form-filter'));that._syncDatePickerFromHidden();that.performSearch(that._getRestrictions(),hashData.page?hashData.page:1);if(!hashData.page||hashData.page==1){that.dispatchEvent(new Meteor.Core.Event('SearchForm.restrictions.deserialized'));}}});this.sandbox.addEventListeners('browser-history-page-revisited',function(e){that._revisitedPage=e.data.page;});$(".toggle-advanced-filters-button").click(function(){$('.attributes-sidebar .attribute-categories').toggle();$(this).find('span').toggle();return false;});};Application.Module.SearchForm.prototype.triggerSearch=function(page){var restrictions=this._getRestrictions();page=page||1;
3318$.bbq.pushState({SearchFormModule:jQuery.param(restrictions)+'&page='+page+'&order='+this._order});try{var newpathname=location.pathname+window.location.hash.toString();document.title=document.title+" - wyniki szukania - "+Date.create('now').format('{yyyy}-{MM}-{dd} {hh}:{mm}');ga('set','page',newpathname);ga('send','pageview');}catch(e){console.error(e);} 3319if(Application.Tool.Env.deviceXs()){if($('.attributes-sidebar .attribute-categories').is(":visible")){$(".toggle-advanced-filters-button").click();}}};Application.Module.SearchForm.prototype.resetLocation=function(page){$('.search-form-main-v2 #miasto_nazwa_textfield').val('');$('.search-form-main-v2 #miasto_nr').val('');$('.search-form-main-v2 #location-name').val('');$('.search-form-main-v2 #location-id').val('');$('.search-form-main-v2 .radius').val('');$('.search-form-main-v2 .lat').val('');$('.search-form-main-v2 .lng').val('');$('.search-form-main-v2 .show-map-button').removeClass('btn-success').addClass('btn-primary');setTimeout(function(){$('.kraina-select').val('').multiselect('refresh');$('.wojewodztwo-select').val('').multiselect('refresh');},1000)};Application.Module.SearchForm.prototype._syncDatePickerFromHidden=function(){var dateRange=$('.date-range-hidden').val();if(dateRange){var dates=dateRange.split(' - ');if(dates.length===2&&this._datePicker){var start=new Date(dates[0]+'T00:00:00');var end=new Date(dates[1]+'T00:00:00');if(!isNaN(start)&&!isNaN(end)){this._datePicker.setDateRange(start,end);}}}};Application.Module.SearchForm.prototype.autoTriggerSearch=function(){if(!Application.Tool.Env.deviceXs()){this.triggerSearch();}};Application.Module.SearchForm.prototype._getRestrictions=function(){var that=this;var r1=Meteor.Util.Form.getData(this._searchForm);var r2=this._mainWrapper.find('.search-form-filter').length>0?Meteor.Util.Form.getData(this._mainWrapper.find('.search-form-filter')):{};var data=Meteor.Core.Object.merge(r1,r2);return data;};Application.Module.SearchForm.prototype._getNotEmptyRestrictions=function(){var restrictions=this._getRestrictions();var notEmptyRestrictions={};for(var k in restrictions){if(restrictions[k]){notEmptyRestrictions[k]=restrictions[k];}} 3320return notEmptyRestrictions;};Application.Module.SearchForm.prototype.performSearch=function(data,page){var that=this;if(data["formData[location_id_string]"].length===0){BootstrapDialog.alert("Prosze podaÄ wpisac gdzie szukasz noclegu");return;} 3321data.order=this._order;that.dispatchEvent(new Meteor.Core.Event('SearchForm.search.start',false,{restrictions:data}));this.setOkolicaCheckbox();this.sortRodzajOptions();that.searchIndicator(true);if(this._searchRequest){this._searchRequest.abort();} 3322var scrollTop=null;var currentPage=new Application.Tool.BrowserHistory.Page(window.location.href);if(null!==that._revisitedPage&¤tPage.equals(that._revisitedPage)){scrollTop=that._revisitedPage.getScrollOffset();that._revisitedPage=null;}else if($(window).scrollTop()>250&&!Application.Tool.Env.deviceXs()){scrollTop={top:'0px',left:'0px'};}else if(Application.Tool.Env.deviceXs()){scrollTop='.search-form-filter';} 3323Application.Tool.BrowserHistory.add(currentPage);var handleResponseHtml=function(responseHTML){if(that._mainWrapper.find('.search-form-filter-home-2 .search-form-filter').length>0){that._mainWrapper.find('.search-form-filter-home-2 .search-form-filter').appendTo(that._mainWrapper.find('.search-form-filter-home'));$('.search-form-filter-home-2').remove();} 3324that._searchRequest=null;that._mainWrapper.find('.search-form-results-wrapper').show();that._mainWrapper.find('.search-form-results').html(responseHTML);that._mainWrapper.find('.search-result-pagination .page').click(function(){var pageNumber=$(this).data('page-number');if(pageNumber){that.triggerSearch(pageNumber);}});that.setupSortButtons();that._mainWrapper.find('.search-form-results .result-row').click(function(){Application.Tool.BrowserHistory.refreshData();var row=$(this);row.addClass('clicked');setTimeout(function(){row.removeClass('clicked');},200);});that.dispatchEvent(new Meteor.Core.Event('SearchForm.search.results.loaded'));that._mainWrapper.find('#section-with-subsections-zPrawejBelki-panel-body').appendTo(that._mainWrapper.find('.search-form-filter-home'));setTimeout(function(){that.dispatchEvent(new Meteor.Core.Event('lazy-image-loader-content-loaded'));},10);if(null!==scrollTop){$('body').scrollTo(scrollTop,50);}};delete data['formDataBonus[date_arrival]_submit'];delete data['formDataBonus[date_departure]_submit'];var searchUrl=$.param(data)+'&page='+page;var storageKey=searchUrl+'_r'+this._cacheRevision;if(false&&null!==$.jStorage.get(storageKey)){setTimeout(function(){that.searchIndicator(false);},20);handleResponseHtml($.jStorage.get(storageKey));}else{var url=that._baseUrl+'/index.php?c=Search&a=performSearch&lang='+$('body').data('lang')+'&t='+Math.random() 3325this._searchRequest=$.post(url,searchUrl,function(responseHTML){that.searchIndicator(false);handleResponseHtml(responseHTML);});}};Application.Module.SearchForm.prototype.validateForm=function(){var that=this;if(1){return true;}else{return false;}};Application.Module.SearchForm.prototype.searchIndicator=function(b){var that=this;if(b){$('.ui-autocomplete').hide();$('.search-button .fa').removeClass('fa-search').addClass('fa-spin fa-gears');
3325$('.search-button').attr('disabled',true);that._mainWrapper.find('.search-form-results').css('opacity',0.5);}else{$('.search-button .fa').removeClass('fa-spin fa-gears').addClass('fa-search');$('.search-button').attr('disabled',false);that._mainWrapper.find('.search-form-results').css('opacity',1);}};Meteor.App.Core.registerModule(new Application.Module.SearchForm());Application.Module.SearchForm.prototype.initICheckbox=function(){var that=this;$('input.rowniez-okolica').iCheck({checkboxClass:'icheckbox_square-blue',radioClass:'iradio_square-blue',increaseArea:'20%'}).on('ifToggled',function(){that.autoTriggerSearch();ga('send',{hitType:'event',eventCategory:'search-form',eventAction:'use',eventLabel:"również okolica"});}).on('ifChecked',function(){$('input.rowniez-okolica').iCheck('check');}).on('ifUnchecked',function(){$('input.rowniez-okolica').iCheck('uncheck');});$('input.bon-turystyczny').iCheck({checkboxClass:'icheckbox_square-blue',radioClass:'iradio_square-blue',increaseArea:'20%'}).on('ifChecked',function(){$(".attribute-368 input").iCheck('check');}).on('ifUnchecked',function(){$(".attribute-368 input").iCheck('uncheck');});$('input.bon-turystyczny').iCheck('uncheck');$(".attribute-368 input").on('ifChecked',function(){$('input.bon-turystyczny').iCheck('check');ga('send',{hitType:'event',eventCategory:'search-form',eventAction:'use',eventLabel:"bon turystyczny"});}).on('ifUnchecked',function(){$('input.bon-turystyczny').iCheck('uncheck');});$('.rodzaj-list input').iCheck({checkboxClass:'icheckbox_square-blue',radioClass:'iradio_square-blue',increaseArea:'20%'}).on('ifToggled',function(){that.autoTriggerSearch();});$(".attributes-sidebar .attribute-category input").iCheck({checkboxClass:'icheckbox_square-blue',radioClass:'iradio_square-blue',increaseArea:'20%'}).on('ifToggled',function(){that.autoTriggerSearch();ga('send',{hitType:'event',eventCategory:'search-form',eventAction:'use',eventLabel:"attributes"});});$('input.online-reservations').iCheck({checkboxClass:'icheckbox_square-blue',radioClass:'iradio_square-blue',increaseArea:'20%'}).on('ifToggled',function(){that.autoTriggerSearch();});};Application.Module.SearchForm.prototype.setOkolicaCheckbox=function(){if($('#location-id').val().match(/^0_/)){$('.rowniez-okolica-container').show();}else{$('.rowniez-okolica-container').hide();}};Application.Module.SearchForm.prototype.initLocationPicker=function(){var that=this;var setInfo=function(){var lat=$('.search-form-main-v2 .lat').val();var button=$('.show-map-button');var locationSet=lat?true:false;if(locationSet){button.addClass('btn-success').removeClass('btn-primary');}else{button.removeClass('btn-success').addClass('btn-primary');}};setInfo();$('.show-map-button').click(function(){ga('send',{hitType:'event',eventCategory:'search-form',eventAction:'use',eventLabel:"pokaż mapÄ"});new BootstrapDialog({title:'Zaznacz obszar szukania',type:BootstrapDialog.TYPE_PRIMARY,onshown:function(dialog){var lat=$('.search-form-main-v2 .lat').val();var lng=$('.search-form-main-v2 .lng').val();(new Meteor.Widget.MapSearch.V3({initialLng:lng?lng:18.8,initialLat:lat?lat:52.17393169256846,initialZoom:lat?12:6,mapContainer:dialog.getModalBody().get(0),change:function(map){$('.search-form-main-v2 .radius').val(map.getRadius()/1000);$('.search-form-main-v2 .lat').val(map.getLat());$('.search-form-main-v2 .lng').val(map.getLng());setInfo();}})).render();},message:'',closable:false,nl2br:false,cssClass:'modal-location-picker',buttons:[{label:'ok',cssClass:'btn-primary',action:function(dialog){setInfo();that.autoTriggerSearch();dialog.close();ga('send',{hitType:'event',eventCategory:'search-form',eventAction:'use',eventLabel:"mapa"});}},{label:'reset',cssClass:'btn-danger',action:function(dialog){$('.search-form-main-v2 .radius').val('');$('.search-form-main-v2 .lat').val('');$('.search-form-main-v2 .lng').val('');setInfo();dialog.close();}},{label:'anuluj',cssClass:'btn-default',action:function(dialog){dialog.close();}}]}).open();return false;});};Application.Module.SearchForm.prototype.initTimespanPicker=function(){var that=this;
3325if($('.timespanPicker').length===0){$('.show-calendar-button').remove();return;} 3326var setInfo=function(){var checkedNumber=$('.timespanPicker .timespan:checked').length;$('.show-calendar-button .info').html(checkedNumber>0?[' (',checkedNumber,')'].join(''):'');};var oWidget=new Meteor.Widget.TimespanPicker({container:$('.timespanPicker')});oWidget.render();setInfo();$('.timespanPicker').css({height:Application.Tool.Env.maxOverlayListHeight()-50});$('.show-calendar-button').click(function(){new BootstrapDialog({title:'czas pobytu',type:BootstrapDialog.TYPE_PRIMARY,onshown:function(dialog){$('.timespanPicker').appendTo(dialog.getModalBody())},message:'',closable:false,nl2br:false,cssClass:'modal-timespan-picker',buttons:[{label:'ok',cssClass:'btn-primary',action:function(dialog){$('.timespanPicker').appendTo('.timespan-picker-markup');setInfo();that.autoTriggerSearch();dialog.close();ga('send',{hitType:'event',eventCategory:'search-form',eventAction:'use',eventLabel:"kalendarz"});}},{label:'anuluj',cssClass:'btn-default',action:function(dialog){$('.timespanPicker').appendTo('.timespan-picker-markup');dialog.close();}}]}).open();return false;});};Application.Module.SearchForm.prototype.initMultiselect=function(){var that=this;var w=Application.Tool.Env.screenWidth();var calculatedButtonWidth='160px';if(w<356){calculatedButtonWidth='130px';} 3327if(w<768&&w>480){calculatedButtonWidth='200px';} 3328if(w<768&&w>580){calculatedButtonWidth='240px';} 3329var multipleSelectButtonText=function(options,select){if(options.length===0){return _translate('kliknijAbyWybrac','formularzWyszukiwania');}else if(options.length>2){return _translate('wybrano','formularzWyszukiwania')+" "+options.length;}else{var labels=[];options.each(function(){if($(this).attr('label')!==undefined){labels.push($(this).attr('label'));}else{labels.push($(this).html());}});return labels.join(', ')+'';}};$('.rodzaj-select').multiselect({maxHeight:Application.Tool.Env.maxOverlayListHeight(),onChange:function(){that.autoTriggerSearch();ga('send',{hitType:'event',eventCategory:'search-form',eventAction:'use',eventLabel:"rodzaj"});},nonSelectedText:'wybierz rodzaj oferty noclegowej',buttonWidth:calculatedButtonWidth,buttonText:multipleSelectButtonText});$('.cecha-select').multiselect({maxHeight:Application.Tool.Env.maxOverlayListHeight(),onChange:function(){that.autoTriggerSearch();ga('send',{hitType:'event',eventCategory:'search-form',eventAction:'use',eventLabel:"cecha"});},buttonWidth:calculatedButtonWidth,buttonText:multipleSelectButtonText,nonSelectedText:'wybierz dodatkowe atrybuty obiektu noclegowego'});$('.attribute-select').multiselect({maxHeight:Application.Tool.Env.maxOverlayListHeight(),onChange:function(){that.autoTriggerSearch();},buttonWidth:calculatedButtonWidth,buttonText:multipleSelectButtonText,nonSelectedText:'wybierz dodatkowe atrybuty obiektu noclegowego'});$('.kraina-select').multiselect({maxHeight:Application.Tool.Env.maxOverlayListHeight(),buttonWidth:calculatedButtonWidth,enableFiltering:true,dropRight:true,onChange:function(){that.autoTriggerSearch();ga('send',{hitType:'event',eventCategory:'search-form',eventAction:'use',eventLabel:"kraina"});},enableCaseInsensitiveFiltering:true,buttonText:multipleSelectButtonText,nonSelectedText:'wybierz krainÄ w której poszukujesz noclegu'});$('.wojewodztwo-select').multiselect({maxHeight:Application.Tool.Env.maxOverlayListHeight(),dropRight:true,onChange:function(){that.autoTriggerSearch();ga('send',{hitType:'event',eventCategory:'search-form',eventAction:'use',eventLabel:"wojewodztwo"});},buttonWidth:calculatedButtonWidth,buttonText:multipleSelectButtonText,nonSelectedText:'wybierz województwa w którym poszukujesz noclegu'});$('.price-select').multiselect({maxHeight:Application.Tool.Env.maxOverlayListHeight(),onChange:function(){that.autoTriggerSearch();ga('send',{hitType:'event',eventCategory:'search-form',eventAction:'use',eventLabel:"price"});},buttonWidth:calculatedButtonWidth,nonSelectedText:'wybierz zakres cen noclegu'});$('.promocja-select').multiselect({maxHeight:Application.Tool.Env.maxOverlayListHeight(),onChange:function(){that.autoTriggerSearch();ga('send',{hitType:'event',eventCategory:'search-form',eventAction:'use',eventLabel:"promocja-select"});},buttonWidth:calculatedButtonWidth,nonSelectedText:'wybierz promocjÄ'});$(".quick-special-offer-button").click(function(){var input=$('select[name="formData[promocja_grupa_id_eq]"]');input.val($(this).data("promocja-grupa-id"));input.multiselect('refresh');that.autoTriggerSearch();});$('.miejsca-select').multiselect({maxHeight:Application.Tool.Env.maxOverlayListHeight(),onChange:function(){that.autoTriggerSearch();ga('send',{hitType:'event',eventCategory:'search-form',eventAction:'use',eventLabel:"liczba miejsc"});},buttonWidth:calculatedButtonWidth,nonSelectedText:'wybierz liczbÄ miejsc jakÄ dysponuje obiekt noclegowy'});};Application.Module.SearchForm.prototype.initializeAutocomplete=function(){var that=this;this._searchForm.find('#miasto_nazwa_textfield').focus(function(){$('.mobile-app-banner-container-fixed-bottom').remove();that.resetLocation();});var rowTemplate=['<a>{$label}<br><span class="description">{$description}</span></a>'].join('');$.widget("custom.cityautocomplete",$.ui.autocomplete,{_renderItemData:function(ul,item){return $("<li></li>").data("ui-autocomplete-item",item).append(Meteor.Util.Template.getInstance().setTemplate(rowTemplate).setData(item).parse()).appendTo(ul);}});this._searchForm.find('#miasto_nazwa_textfield').cityautocomplete({source:'index.php?c=Search&a=cityAutocomplete',minLength:3,delay:100,autoFocus:false,appendTo:'#miasto_nazwa_textfield_wrapper',open:function(event,ui){$('#miasto_nazwa_textfield_wrapper .ui-autocomplete').css('left',0);},select:function(event,ui){that._searchForm.find('#miasto_nr').val(ui.item.id);
3329$('.wojewodztwo-select').val(ui.item.data.wojewodztwo_nr).multiselect('refresh');setTimeout(function(){that.autoTriggerSearch();},1);that._searchForm.find('#miasto_nazwa_textfield').blur();ga('send',{hitType:'event',eventCategory:'search-form',eventAction:'use',eventLabel:"miasto.autocomplete"});},close:function(event,ui){}});this._searchForm.find('#location-name').focus(function(){$('.mobile-app-banner-container-fixed-bottom').remove();that.resetLocation();});var rowTemplate=['<a>{$label}<br><span class="description">{$description}</span></a>'].join('');$.widget("custom.locationautocomplete",$.ui.autocomplete,{_renderItemData:function(ul,item){return $("<li></li>").data("ui-autocomplete-item",item).append(Meteor.Util.Template.getInstance().setTemplate(rowTemplate).setData(item).parse()).appendTo(ul);}});this._searchForm.find('#location-name').locationautocomplete({source:'index.php?c=Search&a=locationAutocomplete',minLength:3,delay:100,autoFocus:false,open:function(event,ui){},select:function(event,ui){that._searchForm.find('#location-id').val([ui.item.type_id+'_'+ui.item.id].join(''));that._searchForm.find('#location-name').val(ui.item.nazwa);var restrictions=that._getNotEmptyRestrictions();delete restrictions["formDataBonus[miasto_strict]"];if(Object.keys(restrictions).length===2&&that.redirectToStaticPage(ui.item)){return;} 3330setTimeout(function(){that.autoTriggerSearch();},1);that._searchForm.find('#location-name').blur();that.setOkolicaCheckbox();ga('send',{hitType:'event',eventCategory:'search-form',eventAction:'use',eventLabel:"places.autocomplete"});},close:function(event,ui){}});};Application.Module.SearchForm.prototype.redirectToStaticPage=function(acItem){if(0===parseInt(acItem.type_id
3330)){window.location="/noclegi,"+acItem.data.slug+",0.html";return true;} 3331if(1===parseInt(acItem.type_id)){window.location="/noclegi,"+acItem.data.slug+",58.html";return true;} 3332return false;} 3333Application.Module.SearchForm.prototype._initializeFormFields=function(){var that=this;var initialRestrictionsUrl=this._mainWrapper.find('.search-form').attr('data-initial-restrictions-url');if(initialRestrictionsUrl){Application.Tool.Form.deserializeUrl(initialRestrictionsUrl,that._mainWrapper.find('.search-form'));Application.Tool.Form.deserializeUrl(initialRestrictionsUrl,that._mainWrapper.find('.search-form-filter'));that.setOkolicaCheckbox();that.sortRodzajOptions();}};Application.Module.SearchForm.prototype.initializeDateRangePicker=function(){var that=this;var form=this._mainWrapper.find('.search-form') 3334var arrivalInput=form.find('input[name="formDataBonus[date_arrival]"]');var departureInput=form.find('input[name="formDataBonus[date_departure]"]');if(Application.Tool.Env.deviceXs()){var dateRangePicker=new Application.Widget.DateRangePicker({fromInput:arrivalInput,toInput:departureInput,onChange:function(input){setTimeout(function(){that.autoTriggerSearch();},1);if(arrivalInput.val()!==""&&departureInput.val()!==""){ga('send',{hitType:'event',eventCategory:'search-form',eventAction:'use',eventLabel:"czas przyjazdu-wyjazdu"});}}});dateRangePicker.render();}else{var dateRangePicker=new Application.Widget.DateRangePicker({fromInput:arrivalInput,toInput:departureInput,onChange:function(input){setTimeout(function(){that.autoTriggerSearch();},1);if(arrivalInput.val()!==""&&departureInput.val()!==""){ga('send',{hitType:'event',eventCategory:'search-form',eventAction:'use',eventLabel:"czas przyjazdu-wyjazdu"});}}});dateRangePicker.render();}};Application.Module.SearchForm.prototype.initializeSort=function(){var that=this;this.setupSortButtons();$('body').on('click','.sort-button',function(){var btn=$(this);if(btn.data('name')!=='price'){switch(btn.data('state')){case"":that._order=btn.data('name')+'_desc' 3335break;case"desc":that._order=btn.data('name')+'_asc' 3336break;case"asc":that._order="default";break;}}else{switch(btn.data('state')){case"":that._order=btn.data('name')+'_asc' 3337break;case"asc":that._order=btn.data('name')+'_desc' 3338break;case"desc":that._order="default";break;}} 3339that.setupSortButtons();that.triggerSearch(1);ga('send',{hitType:'event',eventCategory:'search-form',eventAction:'sort',eventLabel:that._order});return false;});};Application.Module.SearchForm.prototype.setupSortButtons=function(){var that=this;$('.sort-button .arrow').remove();$('.sort-button').append(' <i class="arrow"> </i>');if('default'===that._order){return;} 3340var data=that._order.split("_");var activeButton=$('.sort-button[data-name='+data[0]+']');activeButton.find('.arrow').remove();activeButton.append(' <i class="arrow fa fa-sort-'+data[1]+'"></i>');activeButton.data('state',data[1]);};Application.Module.SearchForm.prototype.initializeShowOnMapButton=function(){var that=this;if($('body').data('lang')!=='pl'){return;} 3341var btnHome=$('.shown-on-map-button-home');if(btnHome.length>0){this.insertShowOnMapButton({lng:btnHome.data('lng'),lat:btnHome.data('lat')},btnHome);} 3342this.sandbox.addEventListeners('SearchForm.search.results.loaded',function(e){var locationDataContainer=$('.location-data-container');if(locationDataContainer.length>0&&locationDataContainer.data('location')){that.insertShowOnMapButton(locationDataContainer.data('location'),$('.search-form-filter-home'));}});};Application.Module.SearchForm.prototype.insertShowOnMapButton=function(coordinates,targetContainer){var btnContainer=$('.shown-on-map-button-container');if(btnContainer.length===0){var markup=['<div class="shown-on-map-button-container" style="padding:5px; padding-right: 15px; margin-top: 20px;">','<a class="text-center btn btn-block btn-primary hidden-xs map-button" target="_blank" href="/noclegi-mapa.html" title="pokaż noclegi na mapie" >','<div><i class="fa fa-3x fa-map-marker"></i></div>','Pokaż na mapie','</a></div>'].join("");btnContainer=$(markup);btnContainer.find('a').click(function(){ga('send',{hitType:'event',eventCategory:'link',eventAction:'click',eventLabel:'show-on-map'})});} 3343var href='/noclegi-mapa.html#MapSearchFormModule=map-zoom%3D11%26map-center-lat%3D'+coordinates.lat+'%26map-center-lng%3D'+coordinates.lng;btnContainer.find('a').attr('href',href);targetContainer.append(btnContainer);$("#page-navigation .page-map a").attr("href",href)};Application.Module.SearchForm.prototype.sortRodzajOptions=function(){var that=this;var handleData=function(rodzaje){var $wrapper=$('.rodzaj-list');$wrapper.find('.rodzaj-option').data('count',0).removeClass('checked').removeClass('less-important');var rodzajeSorted=rodzaje.sort(function(a,b){return parseInt(b.count)-parseInt(a.count);});var visibleCountLimit=rodzajeSorted.length>10?rodzajeSorted[10].count:1;for(var i in rodzaje){var r=rodzaje[i];var option=$wrapper.find('.rodzaj-option-'+r.maska);if(option.find('input[type=checkbox]').is(':checked')){option.addClass('checked');} 3344option.data('count',r.count);option.find('.count').html("("+r.count+")");if(visibleCountLimit>parseInt(r.count)){option.addClass('less-important');}} 3345$wrapper.find('.rodzaj-option').each(function(){var el=$(this);if(el.data('count')===0&&!el.find('input[type=checkbox]').is(':checked')){el.css({height:0,overflow:'hidden'});
3345el.find(".icheckbox_square-blue").hide();}else{el.css({height:"auto"});el.find(".icheckbox_square-blue").show();}});};function handleQuickSpecialOffers(specialOffers){var c=$(".quick-special-offers");c.hide();c.find(".quick-special-offer-button").hide();specialOffers.forEach(function(row){var b=c.find(".quick-special-offer-button[data-promocja-grupa-id="+row.obiekt_promocja_grupa_id+"]");if(b.length>0){b.show();b.find(".number").html(row.count);c.show();}});} 3346if(!this.rodzajStatsCache){this.rodzajStatsCache={};} 3347var searchUrl=$.param(that._getRestrictions());if(false&&this.rodzajStatsCache[searchUrl]){handleData(this.rodzajStatsCache[searchUrl].rodzaje);}else{$.post("/?c=Statistics&a=getRodzajeByRestrictions",searchUrl).then(function(response){that.rodzajStatsCache[searchUrl]=response.data;handleData(response.data.rodzaje);that.sortAttributes(response.data.attributes);handleQuickSpecialOffers(response.data.specialOffers);setTimeout(function(){$(".bon-turystyczny-container").toggle($(".attribute-368").is(":visible"))},10);});}};Application.Module.SearchForm.prototype.sortAttributes=function(attributes){var that=this;$(".attribute .count").html("(0)");$(".attribute").data("count",0);attributes.forEach(function(attribute){var $attrContainer=$(".attribute-"+attribute.attribute_id);$attrContainer.find(".count").html("("+attribute.count+")") 3348$attrContainer.data("count",attribute.count);});$(".attributes-sidebar .attribute-category").each(function(){var $attributesCategory=$(this);var $attributesWrapper=$attributesCategory.find(".attributes");$attributesWrapper.find('.attribute').sort(function(a,b){return $(b).data('count')-$(
3348a).data('count');}).appendTo($attributesWrapper);var hasVisibleAttribute=false;$attributesWrapper.find('.attribute').each(function(){var $attrContainer=$(this);if($attrContainer.data("count")===0&&!$attrContainer.find("input[type=checkbox]").is(":checked")){$attrContainer.hide();}else{hasVisibleAttribute=true;$attrContainer.show();if($attrContainer.find("input[type=checkbox]").is(":checked")){$attrContainer.find(".count").hide();}else{$attrContainer.find(".count").show();}}});if(!hasVisibleAttribute){$attributesCategory.hide();}else{$attributesCategory.show();}});};Application.Module.SearchForm.prototype.initRestrictionsRemover=function(){this.restrictionsRemoverContainer=$(".restrictions-remover");var that=this;if($("body").attr("id")==="link-search"){setTimeout(function(){that.restrictionsRemoverRefresh();},100);} 3349this.sandbox.addEventListeners('SearchForm.search.start',function(e){that.restrictionsRemoverRefresh();});this.sandbox.addEventListeners('SearchForm.search.results.loaded',function(e){var numberOfResults=$(".result-list .result-row").length;if(numberOfResults<15&&numberOfResults>0&&$(".restrictions-remover").find(".restrictions .pill").length>1){$(".restrictions-remover-bottom").show();}else{$(".restrictions-remover-bottom").hide();}});};Application.Module.SearchForm.prototype.restrictionsRemoverAdd=function(name,removeCallback){var that=this;var pill=$("<span class='badge pill'><span class='pill-name'></span> <i class='pill-close-button fa fa-remove'></i></span>");pill.css({marginLeft:10});pill.find(".pill-name").html(name);if(removeCallback){pill.find(".pill-close-button").css("cursor","pointer").click(function(){pill.remove();removeCallback();that.triggerSearch();});}else{pill.find(".pill-close-button").remove();} 3350this.restrictionsRemoverContainer.find(".restrictions").append(pill);};Application.Module.SearchForm.prototype.restrictionsRemoverRefresh=function(){this.restrictionsRemoverContainer.find(".restrictions").html("");var restrictions=this._getRestrictions();var that=this 3351for(var key in restrictions){if(key==="formDataBonus[location_name]"&&restrictions[key]){this.restrictionsRemoverAdd(restrictions[key],null);} 3352if(key.indexOf("formDataBonus[rodzaj_maska_arr]")>-1&&restrictions[key]){(function(key){var input=$('select[name="'+key+'"]');if(input.length>0){input.val().forEach(function(v){that.restrictionsRemoverAdd(input.find("option[value="+v+"]").html(),function(){input.find("option[value="+v+"]").attr("selected",fal
3352se);input.multiselect('refresh');});});}else{var input=$('input[name="'+key+'"]');that.restrictionsRemoverAdd(input.data("label"),function(){$('input[name="'+key+'"]').iCheck('uncheck');});}})(key);} 3353if(key.indexOf("formData[attribute_id_all_in_and_state_eq_1]")>-1&&restrictions[key]){(function(key){var input=$('input[name="'+key+'"]');that.restrictionsRemoverAdd(input.data("label"),function(){$('input[name="'+key+'"]').iCheck('uncheck');});})(key);} 3354if(key.indexOf("formDataBonus[cena]")>-1&&restrictions[key]){var input=$('select[name="'+key+'"]');this.restrictionsRemoverAdd("cena "+input.find("option[value="+restrictions[key]+"]").html(),function(){input.val("");input.multiselect('refresh');});} 3355if(key.indexOf("formDataBonus[miejsca]")>-1&&restrictions[key]){var input=$('select[name="'+key+'"]');this.restrictionsRemoverAdd("liczba miejsc "+input.find("option[value="+restrictions[key]+"]").html(),function(){input.val("");input.multiselect('refresh');});} 3356if(key.indexOf("formData[promocja_grupa_id_eq]")>-1&&restrictions[key]){var input=$('select[name="'+key+'"]');this.restrictionsRemoverAdd(input.find("option[value="+restrictions[key]+"]").html(),function(){input.val("");input.multiselect('refresh');});} 3357if(this.restrictionsRemoverContainer.find(".restrictions .pill").length>0){this.restrictionsRemoverContainer.show();}else{this.restrictionsRemoverContainer.hide();}}};Application.Module.MobileApplicationBanner=function(){this._mainWrapper=$('body');this._domain='meteor-turystyka.pl';};Application.Module.MobileApplicationBanner.prototype=new Meteor.App.Module('MobileApplicationBanner');Application.Module.MobileApplicationBanner.prototype.doInitialize=function(){var that=this;this._bindEvents();setTimeout(function(){},14000);this._showBanner();};Application.Module.MobileApplicationBanner.prototype._bindEvents=function(){var that=this;this.sandbox.addEventListeners('SearchForm.search.results.loaded',function(e){that._showBanner();});if(Application.Tool.Env.screenHeight()-$('.search-form-main').height()<130){$('.mobile-app-banner-container-fixed-bottom').remove();} 3358this._mainWrapper.find('#page-footer').one('inview',function(event,visible){$('.mobile-app-banner-container-fixed-bottom').remove();});};Application.Module.MobileApplicationBanner.prototype._showBanner=function(){var that=this;var html='';$('.mobile-app-banner-container').each(function(){var container=$(this);var location=container.data('location')?container.data('location'):'location-unknown';switch(Application.Tool.Env.os()){case'android':html=['<a class="android-app-banner app-banner-fixed-bottom app-banner " href="market://details?id=pl.meteor24.m&referrer=utm_source%3Dweb%26utm_medium%3Dbanner-mobile-',location,'%26utm_campaign%3D',that._domain,'">','<i class="fa fa-android app-icon "></i><span class="app-text">Pobierz bezpÅatnÄ aplikacjÄ <i class="fa fa-chevron-right "></i></span>','</a>'].join('');break;case'ios':html=['<a class="android-app-banner app-banner-fixed-bottom app-banner " href="https://itunes.apple.com/us/app/noclegi-hotele-w-polsce/id950200320">','<i class="fa fa-apple app-icon "></i><span class="app-text">Pobierz bezpÅatnÄ aplikacjÄ <i class="fa fa-chevron-right "></i></span>','</a>'].join('');break;case'wp':html=['<a class="android-app-banner app-banner-fixed-bottom app-banner " href="http://www.windowsphone.com/pl-pl/store/app/meteor-24/3e2fafdf-7aa7-424b-b91a-698bbd35f5ee">','<i style="font-size: 44px;" class="fa fa-windows app-icon "></i><span class="app-text">Pobierz bezpÅatnÄ aplikacjÄ <i class="fa fa-chevron-right "></i></span>','</a>'].join('');break;} 3359container.html(html);});};Application.Module.MobileApplicationBanner.prototype._showAlert=function(){var that=this;if(Math.random()<0.5){return;} 3360var isAndroid=Application.Tool.Env.os()==='android';if(isAndroid&&null===Meteor.Util.Cookie.get('androidcookie-alert-shown')){Meteor.Util.Cookie.create('androidcookie-alert-shown',1);BootstrapDialog.confirm("<p>Czy chcesz pobraÄ wygodnÄ wyszukiwarkÄ noclegów na telefon/smartfon/tablet?</p><br/><p>ZALETY TAKIEJ WYSZUKIWARKI :<br/>- możesz wyszukaÄ wedÅug Twojego poÅożenia<br/>- wygodnie sortowaÄ<br/>- Åatwo i szybko wybieraÄ numery telefonów<br/>- Åatwo wÅÄ czyÄ nawigowanie do obiektu<br/>- przechowywaÄ dane obiektu w telefonie<br/></p>",function(confirmResult){if(confirmResult===true){window.location="market://details?id=pl.meteor24.m&referrer=utm_source%3Dweb%26utm_medium%3Dalert-mobile%26utm_campaign%3D"+that._domain;}});} 3361var isAndroid=Application.Tool.Env.os()==='wp';if(isAndroid&&null===Meteor.Util.Cookie.get('androidcookie-alert-shown')){Meteor.Util.Cookie.create('androidcookie-alert-shown',1);BootstrapDialog.confirm("<p>Czy chcesz pobraÄ wygodnÄ wyszukiwarkÄ noclegów na telefon/smartfon?</p><br/><p>ZALETY TAKIEJ WYSZUKIWARKI :<br/>- możesz wyszukaÄ wedÅug Twojego poÅożenia<br/>- wygodnie sortowaÄ<br/>- Åatwo i szybko wybieraÄ numery telefonów</p>",function(confirmResult){if(confirmResult===true){window.location="http://www.windowsphone.com/pl-pl/store/app/meteor-24/3e2fafdf-7aa7-424b-b91a-698bbd35f5ee";}});}};Meteor.App.Core.registerModule(new Application.Module.MobileApplicationBanner());Application.Module.Feedback=function(){this._mainWrapper=$('body');this._baseUrl=$('body').data('base-url');this._button=null;};Application.Module.Feedback.prototype=new Meteor.App.Module('Feedback');Application.Module.Feedback.prototype.doInitialize=function(){this._bindEvents();if(!Application.Tool.Env.deviceXs()){}};Application.Module.Feedback.prototype._bindEvents=function(){var that=this;};Meteor.App.Core.registerModule(new Application.Module.Feedback());Application.Module.PushNotification=function(){this._mainWrapper=$('body');this._baseUrl=$('body').data('base-url');};Application.Module.PushNotification.prototype=new Meteor.App.Module('PushNotification');Application.Module.PushNotification.prototype.doInitialize=function(){var that=this;return;if(navigator.language&&navigator.language!='pl'){return;} 3362if($('body').attr('id')==='facility-details'){if(Application.Tool.WebPush.isBrowserCompatible()){console.log("Browser is push notification compatible");}else{return;} 3363Application.Tool.WebPush.registerServiceWorker('/pushServiceWorker.js',function(subscription){if(!subscription&&null===Meteor.Util.Cookie.get('push-notifications-alert-shown')){if(Math.random()<0.5){return;} 3364that.showConfirmDialog();}});}};Application.Module.PushNotification.prototype._bindEvents=function(){};Application.Module.PushNotification.prototype.showConfirmDialog=function(){Meteor.Util.Cookie.create('push-notifications-alert-shown',1);$.post("/?c=Log&a=event",{log:'pushnotification',event:'dialog-shown'});new BootstrapDialog({title:' ',message:'Czy chcesz otrzymywaÄ powiadomienia dotyczÄ ce promocyjnych noclegów?',closable:false,cssClass:'bootstrap-dialog-confirm',buttons:[{label:'nie',action:function(dialog){$.post("/?c=Log&a=event",{log:'pushnotification',event:'dialog-no'});dialog.close();}},{label:'TAK',cssClass:'btn-primary',action:function(dialog){$.post("/?c=Log&a=event",{log:'pushnotification',event:'dialog-yes'});Application.Tool.WebPush.subscribe();dialog.close();}}]}).open();};Meteor.App.Core.registerModule(new Application.Module.PushNotification());Application.Module.CopyLink=function(){};Application.Module.CopyLink.prototype=new Meteor.App.Module('CopyLink');Application.Module.CopyLink.prototype.doInitialize=function(){var that=this;function addLink(){var body_element=document.getElementsByTagName('body')[0];var selection;selection=window.getSelection();
3364var pagelink=" (<a href='"+document.location.href+"'>"+document.location.href+"</a>)";var copytext=selection+pagelink;if(Math.random()<0.5){copytext="<a href='"+document.location.href+"'>"+selection+"</a>";} 3365var orgText=selection.toString();var newdiv=document.createElement('div');body_element.appendChild(newdiv);newdiv.innerHTML=copytext;selection.selectAllChildren(newdiv);window.setTimeout(function(){body_element.removeChild(newdiv);},0);$.post("/?c=Log&a=event",{log:'copy',event:'copy',extra:orgText.substring(0,300)+" ["+document.location.href+"]"+"["+navigator.userAgent+"]"});} 3366document.oncopy=addLink;};Meteor.App.Core.registerModule(new Application.Module.CopyLink());function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}} 3367function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;} 3368(function(global,factory){typeof exports==='object'&&typeof module!=='undefined'?module.exports=factory():typeof define==='function'&&define.amd?define(factory):(global=typeof globalThis!=='undefined'?globalThis:global||self,global.Splide=factory());})(this,function(){'use strict';var MEDIA_PREFERS_REDUCED_MOTION="(prefers-reduced-motion: reduce)";var CREATED=1;var MOUNTED=2;var IDLE=3;var MOVING=4;var SCROLLING=5;var DRAGGING=6;var DESTROYED=7;var STATES={CREATED:CREATED,MOUNTED:MOUNTED,IDLE:IDLE,MOVING:MOVING,SCROLLING:SCROLLING,DRAGGING:DRAGGING,DESTROYED:DESTROYED};function empty(array){array.length=0;} 3369function slice(arrayLike,start,end){return Array.prototype.slice.call(arrayLike,start,end);} 3370function apply(func){return func.bind.apply(func,[null].concat(slice(arguments,1)));} 3371var nextTick=setTimeout;var noop=function noop(){};function raf(func){return requestAnimationFrame(func);} 3372function typeOf(type,subject){return typeof subject===type;} 3373function isObject(subject){return!isNull(subject)&&typeOf("object",subject);} 3374var isArray=Array.isArray;var isFunction=apply(typeOf,"function");var isString=apply(typeOf,"string");var isUndefined=apply(typeOf,"undefined");function isNull(subject){return subject===null;} 3375function isHTMLElement(subject){try{return subject instanceof(subject.ownerDocument.defaultView||window).HTMLElement;}catch(e){return false;}} 3376function toArray(value){return isArray(value)?value:[value];} 3377function forEach(values,iteratee){toArray(values).forEach(iteratee);} 3378function includes(array,value){return array.indexOf(value)>-1;} 3379function push(array,items){array.push.apply(array,toArray(items));return array;} 3380function toggleClass(elm,classes,add){if(elm){forEach(classes,function(name){if(name){elm.classList[add?"add":"remove"](name);}});}} 3381function addClass(elm,classes){toggleClass(elm,isString(classes)?classes.split(" "):classes,true);} 3382function append(parent,children){forEach(children,parent.appendChild.bind(parent));} 3383function before(nodes,ref){forEach(nodes,function(node){var parent=(ref||node).parentNode;if(parent){parent.insertBefore(node,ref);}});} 3384function matches(elm,selector){return isHTMLElement(elm)&&(elm["msMatchesSelector"]||elm.matches).call(elm,selector);} 3385function children(parent,selector){var children2=parent?slice(parent.children):[];return selector?children2.filter(function(child){return matches(child,selector);}):children2;} 3386function child(parent,selector){return selector?children(parent,selector)[0]:parent.firstElementChild;} 3387var ownKeys=Object.keys;function forOwn(object,iteratee,right){if(object){(right?ownKeys(object).reverse():ownKeys(object)).forEach(function(key){key!=="__proto__"&&iteratee(object[key],key);});} 3388return object;} 3389function assign(object){slice(arguments,1).forEach(function(source){forOwn(source,function(value,key){object[key]=source[key];});});return object;}
vendor: 4,238 bytes, lines 3390-3424
3390function merge(object){slice(arguments,1).forEach(function(source){forOwn(source,function(value,key){if(isArray(value)){object[key]=value.slice();}else if(isObject(value)){object[key]=merge({},isObject(object[key])?object[key]:{},value);}else{object[key]=value;}});});return object;} 3391function omit(object,keys){forEach(keys||ownKeys(object),function(key){delete object[key];});} 3392function removeAttribute(elms,attrs){forEach(elms,function(elm){forEach(attrs,function(attr){elm&&elm.removeAttribute(attr);});});} 3393function setAttribute(elms,attrs,value){if(isObject(attrs)){forOwn(attrs,function(value2,name){setAttribute(elms,name,value2);});}else{forEach(elms,function(elm){isNull(value)||value===""?removeAttribute(elm,attrs):elm.setAttribute(attrs,String(value));});}} 3394function create(tag,attrs,parent){var elm=document.createElement(tag);if(attrs){isString(attrs)?addClass(elm,attrs):setAttribute(elm,attrs);} 3395parent&&append(parent,elm);return elm;} 3396function style(elm,prop,value){if(isUndefined(value)){return getComputedStyle(elm)[prop];} 3397if(!isNull(value)){elm.style[prop]=""+value;}} 3398function display(elm,display2){style(elm,"display",display2);} 3399function focus(elm){elm["setActive"]&&elm["setActive"]()||elm.focus({preventScroll:true});} 3400function getAttribute(elm,attr){return elm.getAttribute(attr);} 3401function hasClass(elm,className){return elm&&elm.classList.contains(className);} 3402function rect(target){return target.getBoundingClientRect();} 3403function remove(nodes){forEach(nodes,function(node){if(node&&node.parentNode){node.parentNode.removeChild(node);}});} 3404function parseHtml(html){return child(new DOMParser().parseFromString(html,"text/html").body);} 3405function prevent(e,stopPropagation){e.preventDefault();if(stopPropagation){e.stopPropagation();e.stopImmediatePropagation();}} 3406function query(parent,selector){return parent&&parent.querySelector(selector);} 3407function queryAll(parent,selector){return selector?slice(parent.querySelectorAll(selector)):[];} 3408function removeClass(elm,classes){toggleClass(elm,classes,false);} 3409function timeOf(e){return e.timeStamp;} 3410function unit(value){return isString(value)?value:value?value+"px":"";} 3411var PROJECT_CODE="splide";var DATA_ATTRIBUTE="data-"+PROJECT_CODE;function assert(condition,message){if(!condition){throw new Error("["+PROJECT_CODE+"] "+(message||""));}} 3412var min=Math.min,max=Math.max,floor=Math.floor,ceil=Math.ceil,abs=Math.abs;function approximatelyEqual(x,y,epsilon){return abs(x-y)<epsilon;} 3413function between(number,x,y,exclusive){var minimum=min(x,y);var maximum=max(x,y);return exclusive?minimum<number&&number<maximum:minimum<=number&&number<=maximum;} 3414function clamp(number,x,y){var minimum=min(x,y);var maximum=max(x,y);return min(max(minimum,number),maximum);} 3415function sign(x){return+(x>0)-+(x<0);} 3416function format(string,replacements){forEach(replacements,function(replacement){string=string.replace("%s",""+replacement);});return string;} 3417function pad(number){return number<10?"0"+number:""+number;} 3418var ids={};function uniqueId(prefix){return""+prefix+pad(ids[prefix]=(ids[prefix]||0)+1);} 3419function EventBinder(){var listeners=[];function bind(targets,events,callback,options){forEachEvent(targets,events,function(target,event,namespace){var isEventTarget=("addEventListener"in target);var remover=isEventTarget?target.removeEventListener.bind(target,event,callback,options):target["removeListener"].bind(target,callback);isEventTarget?target.addEventListener(event,callback,options):target["addListener"](callback);listeners.push([target,event,namespace,callback,remover]);});} 3420function unbind(targets,events,callback){forEachEvent(targets,events,function(target,event,namespace){listeners=listeners.filter(function(listener){if(listener[0]===target&&listener[1]===event&&listener[2]===namespace&&(!callback||listener[3]===callback)){listener[4]();return false;} 3421return true;});});} 3422function dispatch(target,type,detail){var e;var bubbles=true;if(typeof CustomEvent==="function"){e=new CustomEvent(type,{bubbles:bubbles,detail:detail});}else{e=document.createEvent("CustomEvent");e.initCustomEvent(type,bubbles,false,detail);} 3423target.dispatchEvent(e);return e;} 3424function forEachEvent(targets,events,iteratee){forEach(targets,function(target){target&&forEac
vendor: 55,758 bytes, lines 3424-3710
3424h(events,function(events2){events2.split(" ").forEach(function(eventNS){var fragment=eventNS.split(".");iteratee(target,fragment[0],fragment[1]);});});});} 3425function destroy(){listeners.forEach(function(data){data[4]();});empty(listeners);} 3426return{bind:bind,unbind:unbind,dispatch:dispatch,destroy:destroy};} 3427var EVENT_MOUNTED="mounted";var EVENT_READY="ready";var EVENT_MOVE="move";var EVENT_MOVED="moved";var EVENT_CLICK="click";var EVENT_ACTIVE="active";var EVENT_INACTIVE="inactive";var EVENT_VISIBLE="visible";var EVENT_HIDDEN="hidden";var EVENT_REFRESH="refresh";var EVENT_UPDATED="updated";var EVENT_RESIZE="resize";var EVENT_RESIZED="resized";var EVENT_DRAG="drag";var EVENT_DRAGGING="dragging";var EVENT_DRAGGED="dragged";var EVENT_SCROLL="scroll";var EVENT_SCROLLED="scrolled";var EVENT_OVERFLOW="overflow";var EVENT_DESTROY="destroy";var EVENT_ARROWS_MOUNTED="arrows:mounted";var EVENT_ARROWS_UPDATED="arrows:updated";var EVENT_PAGINATION_MOUNTED="pagination:mounted";var EVENT_PAGINATION_UPDATED="pagination:updated";var EVENT_NAVIGATION_MOUNTED="navigation:mounted";var EVENT_AUTOPLAY_PLAY="autoplay:play";var EVENT_AUTOPLAY_PLAYING="autoplay:playing";var EVENT_AUTOPLAY_PAUSE="autoplay:pause";var EVENT_LAZYLOAD_LOADED="lazyload:loaded";var EVENT_SLIDE_KEYDOWN="sk";var EVENT_SHIFTED="sh";var EVENT_END_INDEX_CHANGED="ei";function EventInterface(Splide2){var bus=Splide2?Splide2.event.bus:document.createDocumentFragment();var binder=EventBinder();function on(events,callback){binder.bind(bus,toArray(events).join(" "),function(e){callback.apply(callback,isArray(e.detail)?e.detail:[]);});} 3428function emit(event){binder.dispatch(bus,event,slice(arguments,1));} 3429if(Splide2){Splide2.event.on(EVENT_DESTROY,binder.destroy);} 3430return assign(binder,{bus:bus,on:on,off:apply(binder.unbind,bus),emit:emit});} 3431function RequestInterval(interval,onInterval,onUpdate,limit){var now=Date.now;var startTime;var rate=0;var id;var paused=true;var count=0;function update(){if(!paused){rate=interval?min((now()-startTime)/interval,1):1;onUpdate&&onUpdate(rate);if(rate>=1){onInterval();startTime=now();if(limit&&++count>=limit){return pause();}} 3432id=raf(update);}} 3433function start(resume){resume||cancel();startTime=now()-(resume?rate*interval:0);paused=false;id=raf(update);} 3434function pause(){paused=true;} 3435function rewind(){startTime=now();rate=0;if(onUpdate){onUpdate(rate);}} 3436function cancel(){id&&cancelAnimationFrame(id);rate=0;id=0;paused=true;} 3437function set(time){interval=time;} 3438function isPaused(){return paused;} 3439return{start:start,rewind:rewind,pause:pause,cancel:cancel,set:set,isPaused:isPaused};} 3440function State(initialState){var state=initialState;function set(value){state=value;} 3441function is(states){return includes(toArray(states),state);} 3442return{set:set,is:is};} 3443function Throttle(func,duration){var interval=RequestInterval(duration||0,func,null,1);return function(){interval.isPaused()&&interval.start();};} 3444function Media(Splide2,Components2,options){var state=Splide2.state;var breakpoints=options.breakpoints||{};var reducedMotion=options.reducedMotion||{};var binder=EventBinder();var queries=[];function setup(){var isMin=options.mediaQuery==="min";ownKeys(breakpoints).sort(function(n,m){return isMin?+n-+m:+m-+n;}).forEach(function(key){register(breakpoints[key],"("+(isMin?"min":"max")+"-width:"+key+"px)");});register(reducedMotion,MEDIA_PREFERS_REDUCED_MOTION);update();} 3445function destroy(completely){if(completely){binder.destroy();}} 3446function register(options2,query){var queryList=matchMedia(query);binder.bind(queryList,"change",update);queries.push([options2,queryList]);} 3447function update(){var destroyed=state.is(DESTROYED);var direction=options.direction;var merged=queries.reduce(function(merged2,entry){return merge(merged2,entry[1].matches?entry[0]:{});},{});omit(options);set(merged);if(options.destroy){Splide2.destroy(options.destroy==="completely");}else if(destroyed){destroy(true);Splide2.mount();}else{direction!==options.direction&&Splide2.refresh();}} 3448function reduce(enable){if(matchMedia(MEDIA_PREFERS_REDUCED_MOTION).matches){enable?merge(options,reducedMotion):omit(options,ownKeys(reducedMotion));}} 3449function set(opts,base,notify){merge(options,opts);base&&merge(Object.getPrototypeOf(options),opts);if(notify||!state.is(CREATED)){Splide2.emit(EVENT_UPDATED,options);}} 3450return{setup:setup,destroy:destroy,reduce:reduce,set:set};} 3451var ARROW="Arrow";var ARROW_LEFT=ARROW+"Left";var ARROW_RIGHT=ARROW+"Right";var ARROW_UP=ARROW+"Up";var ARROW_DOWN=ARROW+"Down";var RTL="rtl";var TTB="ttb";var ORIENTATION_MAP={width:["height"],left:["top","right"],right:["bottom","left"],x:["y"],X:["Y"],Y:["X"],ArrowLeft:[ARROW_UP,ARROW_RIGHT],ArrowRight:[ARROW_DOWN,ARROW_LEFT]};function Direction(Splide2,Components2,options){function resolve(prop,axisOnly,direction){direction=direction||options.direction;var index=direction===RTL&&!axisOnly?1:direction===TTB?0:-1;return ORIENTATION_MAP[prop]&&ORIENTATION_MAP[prop][index]||prop.replace(/width|left|right/i,function(match,offset){var replacement=ORIENTATION_MAP[match.toLowerCase()][index]||match;return offset>0?replacement.charAt(0).toUpperCase()+replacement.slice(1):replacement;});} 3452function orient(value){return value*(options.direction===RTL?1:-1);} 3453return{resolve:resolve,orient:orient};} 3454var ROLE="role";var TAB_INDEX="tabindex";var DISABLED="disabled";var ARIA_PREFIX="aria-";var ARIA_CONTROLS=ARIA_PREFIX+"controls";var ARIA_CURRENT=ARIA_PREFIX+"current";var ARIA_SELECTED=ARIA_PREFIX+"selected";var ARIA_LABEL=ARIA_PREFIX+"label";var ARIA_LABELLEDBY=ARIA_PREFIX+"labelledby";var ARIA_HIDDEN=ARIA_PREFIX+"hidden";var ARIA_ORIENTATION=ARIA_PREFIX+"orientation";var ARIA_ROLEDESCRIPTION=ARIA_PREFIX+"roledescription";var ARIA_LIVE=ARIA_PREFIX+"live";var ARIA_BUSY=ARIA_PREFIX+"busy";var ARIA_ATOMIC=ARIA_PREFIX+"atomic";var ALL_ATTRIBUTES=[ROLE,TAB_INDEX,DISABLED,ARIA_CONTROLS,ARIA_CURRENT,ARIA_LABEL,ARIA_LABELLEDBY,ARIA_HIDDEN,ARIA_ORIENTATION,ARIA_ROLEDESCRIPTION];var CLASS_PREFIX=PROJECT_CODE+"__";var STATUS_CLASS_PREFIX="is-";var CLASS_ROOT=PROJECT_CODE;var CLASS_TRACK=CLASS_PREFIX+"track";var CLASS_LIST=CLASS_PREFIX+"list";var CLASS_SLIDE=CLASS_PREFIX+"slide";var CLASS_CLONE=CLASS_SLIDE+"--clone";var CLASS_CONTAINER=CLASS_SLIDE+"__container";var CLASS_ARROWS=CLASS_PREFIX+"arrows";var CLASS_ARROW=CLASS_PREFIX+"arrow";var CLASS_ARROW_PREV=CLASS_ARROW+"--prev";var CLASS_ARROW_NEXT=CLASS_ARROW+"--next";var CLASS_PAGINATION=CLASS_PREFIX+"pagination";var CLASS_PAGINATION_PAGE=CLASS_PAGINATION+"__page";var CLASS_PROGRESS=CLASS_PREFIX+"progress";var CLASS_PROGRESS_BAR=CLASS_PROGRESS+"__bar";var CLASS_TOGGLE=CLASS_PREFIX+"toggle";var CLASS_SPINNER=CLASS_PREFIX+"spinner";var CLASS_SR=CLASS_PREFIX+"sr";var CLASS_INITIALIZED=STATUS_CLASS_PREFIX+"initialized";var CLASS_ACTIVE=STATUS_CLASS_PREFIX+"active";var CLASS_PREV=STATUS_CLASS_PREFIX+"prev";var CLASS_NEXT=STATUS_CLASS_PREFIX+"next";var CLASS_VISIBLE=STATUS_CLASS_PREFIX+"visible";var CLASS_LOADING=STATUS_CLASS_PREFIX+"loading";var CLASS_FOCUS_IN=STATUS_CLASS_PREFIX+"focus-in";var CLASS_OVERFLOW=STATUS_CLASS_PREFIX+"overflow";var STATUS_CLASSES=[CLASS_ACTIVE,CLASS_VISIBLE,CLASS_PREV,CLASS_NEXT,CLASS_LOADING,CLASS_FOCUS_IN,CLASS_OVERFLOW];var CLASSES={slide:CLASS_SLIDE,clone:CLASS_CLONE,arrows:CLASS_ARROWS,arrow:CLASS_ARROW,prev:CLASS_ARROW_PREV,next:CLASS_ARROW_NEXT,pagination:CLASS_PAGINATION,page:CLASS_PAGINATION_PAGE,spinner:CLASS_SPINNER};function closest(from,selector){if(isFunction(from.closest)){return from.closest(selector);} 3455var elm=from;while(elm&&elm.nodeType===1){if(matches(elm,selector)){break;} 3456elm=elm.parentElement;} 3457return elm;} 3458var FRICTION=5;var LOG_INTERVAL=200;var POINTER_DOWN_EVENTS="touchstart mousedown";var POINTER_MOVE_EVENTS="touchmove mousemove";var POINTER_UP_EVENTS="touchend touchcancel mouseup click";function Elements(Splide2,Components2,options){var _EventInterface=EventInterface(Splide2),on=_EventInterface.on,bind=_EventInterface.bind;var root=Splide2.root;var i18n=options.i18n;var elements={};var slides=[];var rootClasses=[];var trackClasses=[];var track;var list;var isUsingKey;function setup(){collect();init();update();} 3459function mount(){on(EVENT_REFRESH,destroy);on(EVENT_REFRESH,setup);on(EVENT_UPDATED,update);bind(document,POINTER_DOWN_EVENTS+" keydown",function(e){isUsingKey=e.type==="keydown";},{capture:true});bind(root,"focusin",function(){toggleClass(root,CLASS_FOCUS_IN,!!isUsingKey);});} 3460function destroy(completely){var attrs=ALL_ATTRIBUTES.concat("style");empty(slides);removeClass(root,rootClasses);removeClass(track,trackClasses);removeAttribute([track,list],attrs);removeAttribute(root,completely?attrs:["style",ARIA_ROLEDESCRIPTION]);} 3461function update(){removeClass(root,rootClasses);removeClass(track,trackClasses);rootClasses=getClasses(CLASS_ROOT);trackClasses=getClasses(CLASS_TRACK);addClass(root,rootClasses);addClass(track,trackClasses);setAttribute(root,ARIA_LABEL,options.label);setAttribute(root,ARIA_LABELLEDBY,options.labelledby);} 3462function collect(){track=find("."+CLASS_TRACK);list=child(track,"."+CLASS_LIST);assert(track&&list,"A track/list element is missing.");push(slides,children(list,"."+CLASS_SLIDE+":not(."+CLASS_CLONE+")"));forOwn({arrows:CLASS_ARROWS,pagination:CLASS_PAGINATION,prev:CLASS_ARROW_PREV,next:CLASS_ARROW_NEXT,bar:CLASS_PROGRESS_BAR,toggle:CLASS_TOGGLE},function(className,key){elements[key]=find("."+className);});assign(elements,{root:root,track:track,list:list,slides:slides});} 3463function init(){var id=root.id||uniqueId(PROJECT_CODE);var role=options.role;root.id=id;track.id=track.id||id+"-track";list.id=list.id||id+"-list";if(!getAttribute(root,ROLE)&&root.tagName!=="SECTION"&&role){setAttribute(root,ROLE,role);} 3464setAttribute(root,ARIA_ROLEDESCRIPTION,i18n.carousel);setAttribute(list,ROLE,"presentation");} 3465function find(selector){var elm=query(root,selector);return elm&&closest(elm,"."+CLASS_ROOT)===root?elm:void 0;} 3466function getClasses(base){return[base+"--"+options.type,base+"--"+options.direction,options.drag&&base+"--draggable",options.isNavigation&&base+"--nav",base===CLASS_ROOT&&CLASS_ACTIVE];} 3467return assign(elements,{setup:setup,mount:mount,destroy:destroy});} 3468var SLIDE="slide";var LOOP="loop";var FADE="fade";function Slide$1(Splide2,index,slideIndex,slide){var event=EventInterface(Splide2);var on=event.on,emit=event.emit,bind=event.bind;var Components=Splide2.Components,root=Splide2.root,options=Splide2.options;var isNavigation=options.isNavigation,updateOnMove=options.updateOnMove,i18n=options.i18n,pagination=options.pagination,slideFocus=options.slideFocus;var resolve=Components.Direction.resolve;var styles=getAttribute(slide,"style");var label=getAttribute(slide,ARIA_LABEL);var isClone=slideIndex>-1;var container=child(slide,"."+CLASS_CONTAINER);var destroyed;function mount(){if(!isClone){slide.id=root.id+"-slide"+pad(index+1);setAttribute(slide,ROLE,pagination?"tabpanel":"group");setAttribute(slide,ARIA_ROLEDESCRIPTION,i18n.slide);setAttribute(slide,ARIA_LABEL,label||format(i18n.slideLabel,[index+1,Splide2.length]));} 3469listen();} 3470function listen(){bind(slide,"click",apply(emit,EVENT_CLICK,self));bind(slide,"keydown",apply(emit,EVENT_SLIDE_KEYDOWN,self));on([EVENT_MOVED,EVENT_SHIFTED,EVENT_SCROLLED],update);on(EVENT_NAVIGATION_MOUNTED,initNavigation);if(updateOnMove){on(EVENT_MOVE,onMove);}} 3471function destroy(){destroyed=true;event.destroy();removeClass(slide,STATUS_CLASSES);removeAttribute(slide,ALL_ATTRIBUTES);setAttribute(slide,"style",styles);setAttribute(slide,ARIA_LABEL,label||"");} 3472function initNavigation(){var controls=Splide2.splides.map(function(target){var Slide2=target.splide.Components.Slides.getAt(index);return Slide2?Slide2.slide.id:"";}).join(" ");setAttribute(slide,ARIA_LABEL,format(i18n.slideX,(isClone?slideIndex:index)+1));setAttribute(slide,ARIA_CONTROLS,controls);setAttribute(slide,ROLE,slideFocus?"button":"");slideFocus&&removeAttribute(slide,ARIA_ROLEDESCRIPTION);} 3473function onMove(){if(!destroyed){update();}} 3474function update(){if(!destroyed){var curr=Splide2.index;updateActivity();updateVisibility();toggleClass(slide,CLASS_PREV,index===curr-1);toggleClass(slide,CLASS_NEXT,index===curr+1);}} 3475function updateActivity(){var active=isActive();if(active!==hasClass(slide,CLASS_ACTIVE)){toggleClass(slide,CLASS_ACTIVE,active);setAttribute(slide,ARIA_CURRENT,isNavigation&&active||"");emit(active?EVENT_ACTIVE:EVENT_INACTIVE,self);}} 3476function updateVisibility(){var visible=isVisible();var hidden=!visible&&(!isActive()||isClone);if(!Splide2.state.is([MOVING,SCROLLING])){setAttribute(slide,ARIA_HIDDEN,hidden||"");} 3477setAttribute(queryAll(slide,options.focusableNodes||""),TAB_INDEX,hidden?-1:"");if(slideFocus){setAttribute(slide,TAB_INDEX,hidden?-1:0);} 3478if(visible!==hasClass(slide,CLASS_VISIBLE)){toggleClass(slide,CLASS_VISIBLE,visible);emit(visible?EVENT_VISIBLE:EVENT_HIDDEN,self);} 3479if(!visible&&document.activeElement===slide){var Slide2=Components.Slides.getAt(Splide2.index);Slide2&&focus(Slide2.slide);}} 3480function style$1(prop,value,useContainer){style(useContainer&&container||slide,prop,value);} 3481function isActive(){var curr=Splide2.index;return curr===index||options.cloneStatus&&curr===slideIndex;} 3482function isVisible(){if(Splide2.is(FADE)){return isActive();} 3483var trackRect=rect(Components.Elements.track);var slideRect=rect(slide);var left=resolve("left",true);var right=resolve("right",true);return floor(trackRect[left])<=ceil(slideRect[left])&&floor(slideRect[right])<=ceil(trackRect[right]);} 3484function isWithin(from,distance){var diff=abs(from-index);if(!isClone&&(options.rewind||Splide2.is(LOOP))){diff=min(diff,Splide2.length-diff);} 3485return diff<=distance;} 3486var self={index:index,slideIndex:slideIndex,slide:slide,container:container,isClone:isClone,mount:mount,destroy:destroy,update:update,style:style$1,isWithin:isWithin};return self;} 3487function Slides(Splide2,Components2,options){var _EventInterface2=EventInterface(Splide2),on=_EventInterface2.on,emit=_EventInterface2.emit,bind=_EventInterface2.bind;var _Components2$Elements=Components2.Elements,slides=_Components2$Elements.slides,list=_Components2$Elements.list;var Slides2=[];function mount(){init();on(EVENT_REFRESH,destroy);on(EVENT_REFRESH,init);} 3488function init(){slides.forEach(function(slide,index){register(slide,index,-1);});} 3489function destroy(){forEach$1(function(Slide2){Slide2.destroy();});empty(Slides2);} 3490function update(){forEach$1(function(Slide2){Slide2.update();});} 3491function register(slide,index,slideIndex){var object=Slide$1(Splide2,index,slideIndex,slide);object.mount();Slides2.push(object);Slides2.sort(function(Slide1,Slide2){return Slide1.index-Slide2.index;});} 3492function get(excludeClones){return excludeClones?filter(function(Slide2){return!Slide2.isClone;}):Slides2;} 3493function getIn(page){var Controller=Components2.Controller;var index=Controller.toIndex(page);var max=Controller.hasFocus()?1:options.perPage;return filter(function(Slide2){return between(Slide2.index,index,index+max-1);});} 3494function getAt(index){return filter(index)[0];} 3495function add(items,index){forEach(items,function(slide){if(isString(slide)){slide=parseHtml(slide);} 3496if(isHTMLElement(slide)){var ref=slides[index];ref?before(slide,ref):append(list,slide);addClass(slide,options.classes.slide);observeImages(slide,apply(emit,EVENT_RESIZE));}});emit(EVENT_REFRESH);} 3497function remove$1(matcher){remove(filter(matcher).map(function(Slide2){return Slide2.slide;}));emit(EVENT_REFRESH);} 3498function forEach$1(iteratee,excludeClones){get(excludeClones).forEach(iteratee);} 3499function filter(matcher){return Slides2.filter(isFunction(matcher)?matcher:function(Slide2){return isString(matcher)?matches(Slide2.slide,matcher):includes(toArray(matcher),Slide2.index);});} 3500function style(prop,value,useContainer){forEach$1(function(Slide2){Slide2.style(prop,value,useContainer);});} 3501function observeImages(elm,callback){var images=queryAll(elm,"img");var length=images.length;if(length){images.forEach(function(img){bind(img,"load error",function(){if(!--length){callback();}});});}else{callback();}} 3502function getLength(excludeClones){return excludeClones?slides.length:Slides2.length;} 3503function isEnough(){return Slides2.length>options.perPage;} 3504return{mount:mount,destroy:destroy,update:update,register:register,get:get,getIn:getIn,getAt:getAt,add:add,remove:remove$1,forEach:forEach$1,filter:filter,style:style,getLength:getLength,isEnough:isEnough};} 3505function Layout(Splide2,Components2,options){var _EventInterface3=EventInterface(Splide2),on=_EventInterface3.on,bind=_EventInterface3.bind,emit=_EventInterface3.emit;var Slides=Components2.Slides;var resolve=Components2.Direction.resolve;var _Components2$Elements2=Components2.Elements,root=_Components2$Elements2.root,track=_Components2$Elements2.track,list=_Components2$Elements2.list;var getAt=Slides.getAt,styleSlides=Slides.style;var vertical;var rootRect;var overflow;function mount(){init();bind(window,"resize load",Throttle(apply(emit,EVENT_RESIZE)));on([EVENT_UPDATED,EVENT_REFRESH],init);on(EVENT_RESIZE,resize);} 3506function init(){vertical=options.direction===TTB;style(root,"maxWidth",unit(options.width));style(track,resolve("paddingLeft"),cssPadding(false));style(track,resolve("paddingRight"),cssPadding(true));resize(true);} 3507function resize(force){var newRect=rect(root);if(force||rootRect.width!==newRect.width||rootRect.height!==newRect.height){style(track,"height",cssTrackHeight());styleSlides(resolve("marginRight"),unit(options.gap));styleSlides("width",cssSlideWidth());styleSlides("height",cssSlideHeight(),true);rootRect=newRect;emit(EVENT_RESIZED);if(overflow!==(overflow=isOverflow())){toggleClass(root,CLASS_OVERFLOW,overflow);emit(EVENT_OVERFLOW,overflow);}}} 3508function cssPadding(right){var padding=options.padding;var prop=resolve(right?"right":"left");return padding&&unit(padding[prop]||(isObject(padding)?0:padding))||"0px";} 3509function cssTrackHeight(){var height="";if(vertical){height=cssHeight();assert(height,"height or heightRatio is missing.");height="calc("+height+" - "+cssPadding(false)+" - "+cssPadding(true)+")";} 3510return height;} 3511function cssHeight(){return unit(options.height||rect(list).width*options.heightRatio);} 3512function cssSlideWidth(){return options.autoWidth?null:unit(options.fixedWidth)||(vertical?"":cssSlideSize());} 3513function cssSlideHeight(){return unit(options.fixedHeight)||(vertical?options.autoHeight?null:cssSlideSize():cssHeight());} 3514function cssSlideSize(){var gap=unit(options.gap);return"calc((100%"+(gap&&" + "+gap)+")/"+(options.perPage||1)+(gap&&" - "+gap)+")";} 3515function listSize(){return rect(list)[resolve("width")];} 3516function slideSize(index,withoutGap){var Slide=getAt(index||0);return Slide?rect(Slide.slide)[resolve("width")]+(withoutGap?0:getGap()):0;} 3517function totalSize(index,withoutGap){var Slide=getAt(index);if(Slide){var right=rect(Slide.slide)[resolve("right")];var left=rect(list)[resolve("left")];return abs(right-left)+(withoutGap?0:getGap());} 3518return 0;} 3519function sliderSize(withoutGap){return totalSize(Splide2.length-1)-totalSize(0)+slideSize(0,withoutGap);} 3520function getGap(){var Slide=getAt(0);return Slide&&parseFloat(style(Slide.slide,resolve("marginRight")))||0;} 3521function getPadding(right){return parseFloat(style(track,resolve("padding"+(right?"Right":"Left"))))||0;} 3522function isOverflow(){return Splide2.is(FADE)||sliderSize(true)>listSize();} 3523return{mount:mount,resize:resize,listSize:listSize,slideSize:slideSize,sliderSize:sliderSize,totalSize:totalSize,getPadding:getPadding,isOverflow:isOverflow};} 3524var MULTIPLIER=2;function Clones(Splide2,Components2,options){var event=EventInterface(Splide2);var on=event.on;var Elements=Components2.Elements,Slides=Components2.Slides;var resolve=Components2.Direction.resolve;var clones=[];var cloneCount;function mount(){on(EVENT_REFRESH,remount);on([EVENT_UPDATED,EVENT_RESIZE],observe);if(cloneCount=computeCloneCount()){generate(cloneCount);Components2.Layout.resize(true);}} 3525function remount(){destroy();mount();} 3526function destroy(){remove(clones);empty(clones);event.destroy();} 3527function observe(){var count=computeCloneCount();if(cloneCount!==count){if(cloneCount<count||!count){event.emit(EVENT_REFRESH);}}} 3528function generate(count){var slides=Slides.get().slice();var length=slides.length;if(length){while(slides.length<count){push(slides,slides);} 3529push(slides.slice(-count),slides.slice(0,count)).forEach(function(Slide,index){var isHead=index<count;var clone=cloneDeep(Slide.slide,index);isHead?before(clone,slides[0].slide):append(Elements.list,clone);push(clones,clone);Slides.register(clone,index-count+(isHead?0:length),Slide.index);});}} 3530function cloneDeep(elm,index){var clone=elm.cloneNode(true);addClass(clone,options.classes.clone);clone.id=Splide2.root.id+"-clone"+pad(index+1);return clone;} 3531function computeCloneCount(){var clones2=options.clones;if(!Splide2.is(LOOP)){clones2=0;}else if(isUndefined(clones2)){var fixedSize=options[resolve("fixedWidth")]&&Components2.Layout.slideSize(0);var fixedCount=fixedSize&&ceil(rect(Elements.track)[resolve("width")]/fixedSize);clones2=fixedCount||options[resolve("autoWidth")]&&Splide2.length||options.perPage*MULTIPLIER;} 3532return clones2;} 3533return{mount:mount,destroy:destroy};} 3534function Move(Splide2,Components2,options){var _EventInterface4=EventInterface(Splide2),on=_EventInterface4.on,emit=_EventInterface4.emit;var set=Splide2.state.set;var _Components2$Layout=Components2.Layout,slideSize=_Components2$Layout.slideSize,getPadding=_Components2$Layout.getPadding,totalSize=_Components2$Layout.totalSize,listSize=_Components2$Layout.listSize,sliderSize=_Components2$Layout.sliderSize;var _Components2$Directio=Components2.Direction,resolve=_Components2$Directio.resolve,orient=_Components2$Directio.orient;var _Components2$Elements3=Components2.Elements,list=_Components2$Elements3.list,track=_Components2$Elements3.track;var Transition;function mount(){Transition=Components2.Transition;on([EVENT_MOUNTED,EVENT_RESIZED,EVENT_UPDATED,EVENT_REFRESH],reposition);} 3535function reposition(){if(!Components2.Controller.isBusy()){Components2.Scroll.cancel();jump(Splide2.index);Components2.Slides.update();}} 3536function move(dest,index,prev,callback){if(dest!==index&&canShift(dest>prev)){cancel();translate(shift(getPosition(),dest>prev),true);} 3537set(MOVING);emit(EVENT_MOVE,index,prev,dest);Transition.start(index,function(){set(IDLE);emit(EVENT_MOVED,index,prev,dest);callback&&callback();});} 3538function jump(index){translate(toPosition(index,true));} 3539function translate(position,preventLoop){if(!Splide2.is(FADE)){var destination=preventLoop?position:loop(position);style(list,"transform","translate"+resolve("X")+"("+destination+"px)");position!==destination&&emit(EVENT_SHIFTED);}} 3540function loop(position){if(Splide2.is(LOOP)){var index=toIndex(position);var exceededMax=index>Components2.Controller.getEnd();var exceededMin=index<0;if(exceededMin||exceededMax){position=shift(position,exceededMax);}} 3541return position;} 3542function shift(position,backwards){var excess=position-getLimit(backwards);var size=sliderSize();position-=orient(size*(ceil(abs(excess)/size)||1))*(backwards?1:-1);return position;} 3543function cancel(){translate(getPosition(),true);Transition.cancel();} 3544function toIndex(position){var Slides=Components2.Slides.get();var index=0;var minDistance=Infinity;for(var i=0;i<Slides.length;i++){var slideIndex=Slides[i].index;var distance=abs(toPosition(slideIndex,true)-position);if(distance<=minDistance){minDistance=distance;index=slideIndex;}else{break;}} 3545return index;} 3546function toPosition(index,trimming){var position=orient(totalSize(index-1)-offset(index));return trimming?trim(position):position;} 3547function getPosition(){var left=resolve("left");return rect(list)[left]-rect(track)[left]+orient(getPadding(false));} 3548function trim(position){if(options.trimSpace&&Splide2.is(SLIDE)){position=clamp(position,0,orient(sliderSize(true)-listSize()));} 3549return position;} 3550function offset(index){var focus=options.focus;return focus==="center"?(listSize()-slideSize(index,true))/2:+focus*slideSize(index)||0;} 3551function getLimit(max){return toPosition(max?Components2.Controller.getEnd():0,!!options.trimSpace);} 3552function canShift(backwards){var shifted=orient(shift(getPosition(),backwards));return backwards?shifted>=0:shifted<=list[resolve("scrollWidth")]-rect(track)[resolve("width")];} 3553function exceededLimit(max,position){position=isUndefined(position)?getPosition():position;var exceededMin=max!==true&&orient(position)<orient(getLimit(false));var exceededMax=max!==false&&orient(position)>orient(getLimit(true));return exceededMin||exceededMax;} 3554return{mount:mount,move:move,jump:jump,translate:translate,shift:shift,cancel:cancel,toIndex:toIndex,toPosition:toPosition,getPosition:getPosition,getLimit:getLimit,exceededLimit:exceededLimit,reposition:reposition};} 3555function Controller(Splide2,Components2,options){var _EventInterface5=EventInterface(Splide2),on=_EventInterface5.on,emit=_EventInterface5.emit;var Move=Components2.Move;var getPosition=Move.getPosition,getLimit=Move.getLimit,toPosition=Move.toPosition;var _Components2$Slides=Components2.Slides,isEnough=_Components2$Slides.isEnough,getLength=_Components2$Slides.getLength;var omitEnd=options.omitEnd;var isLoop=Splide2.is(LOOP);var isSlide=Splide2.is(SLIDE);var getNext=apply(getAdjacent,false);var getPrev=apply(getAdjacent,true);var currIndex=options.start||0;var endIndex;var prevIndex=currIndex;var slideCount;var perMove;var perPage;function mount(){init();on([EVENT_UPDATED,EVENT_REFRESH,EVENT_END_INDEX_CHANGED],init);on(EVENT_RESIZED,onResized);} 3556function init(){slideCount=getLength(true);perMove=options.perMove;perPage=options.perPage;endIndex=getEnd();var index=clamp(currIndex,0,omitEnd?endIndex:slideCount-1);if(index!==currIndex){currIndex=index;Move.reposition();}} 3557function onResized(){if(endIndex!==getEnd()){emit(EVENT_END_INDEX_CHANGED);}} 3558function go(control,allowSameIndex,callback){if(!isBusy()){var dest=parse(control);var index=loop(dest);if(index>-1&&(allowSameIndex||index!==currIndex)){setIndex(index);Move.move(dest,index,prevIndex,callback);}}} 3559function scroll(destination,duration,snap,callback){Components2.Scroll.scroll(destination,duration,snap,function(){var index=loop(Move.toIndex(getPosition()));setIndex(omitEnd?min(index,endIndex):index);callback&&callback();});} 3560function parse(control){var index=currIndex;if(isString(control)){var _ref=control.match(/([+\-<>])(\d+)?/)||[],indicator=_ref[1],number=_ref[2];if(indicator==="+"||indicator==="-"){index=computeDestIndex(currIndex+(+(""+indicator+(+number||1))),currIndex);}else if(indicator===">"){index=number?toIndex(+number):getNext(true);}else if(indicator==="<"){index=getPrev(true);}}else{index=isLoop?control:clamp(control,0,endIndex);} 3561return index;} 3562function getAdjacent(prev,destination){var number=perMove||(hasFocus()?1:perPage);var dest=computeDestIndex(currIndex+number*(prev?-1:1),currIndex,!(perMove||hasFocus()));if(dest===-1&&isSlide){if(!approximatelyEqual(getPosition(),getLimit(!prev),1)){return prev?0:endIndex;}} 3563return destination?dest:loop(dest);} 3564function computeDestIndex(dest,from,snapPage){if(isEnough()||hasFocus()){var index=computeMovableDestIndex(dest);if(index!==dest){from=dest;dest=index;snapPage=false;} 3565if(dest<0||dest>endIndex){if(!perMove&&(between(0,dest,from,true)||between(endIndex,from,dest,true))){dest=toIndex(toPage(dest));}else{if(isLoop){dest=snapPage?dest<0?-(slideCount%perPage||perPage):slideCount:dest;}else if(options.rewind){dest=dest<0?endIndex:0;}else{dest=-1;}}}else{if(snapPage&&dest!==from){dest=toIndex(toPage(from)+(dest<from?-1:1));}}}else{dest=-1;} 3566return dest;} 3567function computeMovableDestIndex(dest){if(isSlide&&options.trimSpace==="move"&&dest!==currIndex){var position=getPosition();while(position===toPosition(dest,true)&&between(dest,0,Splide2.length-1,!options.rewind)){dest<currIndex?--dest:++dest;}} 3568return dest;} 3569function loop(index){return isLoop?(index+slideCount)%slideCount||0:index;} 3570function getEnd(){var end=slideCount-(hasFocus()||isLoop&&perMove?1:perPage);while(omitEnd&&end-->0){if(toPosition(slideCount-1,true)!==toPosition(end,true)){end++;break;}} 3571return clamp(end,0,slideCount-1);} 3572function toIndex(page){return clamp(hasFocus()?page:perPage*page,0,endIndex);} 3573function toPage(index){return hasFocus()?min(index,endIndex):floor((index>=endIndex?slideCount-1:index)/perPage);} 3574function toDest(destination){var closest=Move.toIndex(destination);return isSlide?clamp(closest,0,endIndex):closest;} 3575function setIndex(index){if(index!==currIndex){prevIndex=currIndex;currIndex=index;}} 3576function getIndex(prev){return prev?prevIndex:currIndex;} 3577function hasFocus(){return!isUndefined(options.focus)||options.isNavigation;} 3578function isBusy(){return Splide2.state.is([MOVING,SCROLLING])&&!!options.waitForTransition;} 3579return{mount:mount,go:go,scroll:scroll,getNext:getNext,getPrev:getPrev,getAdjacent:getAdjacent,getEnd:getEnd,setIndex:setIndex,getIndex:getIndex,toIndex:toIndex,toPage:toPage,toDest:toDest,hasFocus:hasFocus,isBusy:isBusy};} 3580var XML_NAME_SPACE="http://www.w3.org/2000/svg";var PATH="m15.5 0.932-4.3 4.38 14.5 14.6-14.5 14.5 4.3 4.4 14.6-14.6 4.4-4.3-4.4-4.4-14.6-14.6z";var SIZE=40;function Arrows(Splide2,Components2,options){var event=EventInterface(Splide2);var on=event.on,bind=event.bind,emit=event.emit;var classes=options.classes,i18n=options.i18n;var Elements=Components2.Elements,Controller=Components2.Controller;var placeholder=Elements.arrows,track=Elements.track;var wrapper=placeholder;var prev=Elements.prev;var next=Elements.next;var created;var wrapperClasses;var arrows={};function mount(){init();on(EVENT_UPDATED,remount);} 3581function remount(){destroy();mount();} 3582function init(){var enabled=options.arrows;if(enabled&&!(prev&&next)){createArrows();} 3583if(prev&&next){assign(arrows,{prev:prev,next:next});display(wrapper,enabled?"":"none");addClass(wrapper,wrapperClasses=CLASS_ARROWS+"--"+options.direction);if(enabled){listen();update();setAttribute([prev,next],ARIA_CONTROLS,track.id);emit(EVENT_ARROWS_MOUNTED,prev,next);}}} 3584function destroy(){event.destroy();removeClass(wrapper,wrapperClasses);if(created){remove(placeholder?[prev,next]:wrapper);prev=next=null;}else{removeAttribute([prev,next],ALL_ATTRIBUTES);}} 3585function listen(){on([EVENT_MOUNTED,EVENT_MOVED,EVENT_REFRESH,EVENT_SCROLLED,EVENT_END_INDEX_CHANGED],update);bind(next,"click",apply(go,">"));bind(prev,"click",apply(go,"<"));} 3586function go(control){Controller.go(control,true);} 3587function createArrows(){wrapper=placeholder||create("div",classes.arrows);prev=createArrow(true);next=createArrow(false);created=true;append(wrapper,[prev,next]);!placeholder&&before(wrapper,track);} 3588function createArrow(prev2){var arrow="<button class=\""+classes.arrow+" "+(prev2?classes.prev:classes.next)+"\" type=\"button\"><svg xmlns=\""+XML_NAME_SPACE+"\" viewBox=\"0 0 "+SIZE+" "+SIZE+"\" width=\""+SIZE+"\" height=\""+SIZE+"\" focusable=\"false\"><path d=\""+(options.arrowPath||PATH)+"\" />";return parseHtml(arrow);} 3589function update(){if(prev&&next){var index=Splide2.index;var prevIndex=Controller.getPrev();var nextIndex=Controller.getNext();var prevLabel=prevIndex>-1&&index<prevIndex?i18n.last:i18n.prev;var nextLabel=nextIndex>-1&&index>nextIndex?i18n.first:i18n.next;prev.disabled=prevIndex<0;next.disabled=nextIndex<0;setAttribute(prev,ARIA_LABEL,prevLabel);setAttribute(next,ARIA_LABEL,nextLabel);emit(EVENT_ARROWS_UPDATED,prev,next,prevIndex,nextIndex);}} 3590return{arrows:arrows,mount:mount,destroy:destroy,update:update};} 3591var INTERVAL_DATA_ATTRIBUTE=DATA_ATTRIBUTE+"-interval";function Autoplay(Splide2,Components2,options){var _EventInterface6=EventInterface(Splide2),on=_EventInterface6.on,bind=_EventInterface6.bind,emit=_EventInterface6.emit;var interval=RequestInterval(options.interval,Splide2.go.bind(Splide2,">"),onAnimationFrame);var isPaused=interval.isPaused;var Elements=Components2.Elements,_Components2$Elements4=Components2.Elements,root=_Components2$Elements4.root,toggle=_Components2$Elements4.toggle;var autoplay=options.autoplay;var hovered;var focused;var stopped=autoplay==="pause";function mount(){if(autoplay){listen();toggle&&setAttribute(toggle,ARIA_CONTROLS,Elements.track.id);stopped||play();update();}} 3592function listen(){if(options.pauseOnHover){bind(root,"mouseenter mouseleave",function(e){hovered=e.type==="mouseenter";autoToggle();});} 3593if(options.pauseOnFocus){bind(root,"focusin focusout",function(e){focused=e.type==="focusin";autoToggle();});} 3594if(toggle){bind(toggle,"click",function(){stopped?play():pause(true);});} 3595on([EVENT_MOVE,EVENT_SCROLL,EVENT_REFRESH],interval.rewind);on(EVENT_MOVE,onMove);} 3596function play(){if(isPaused()&&Components2.Slides.isEnough()){interval.start(!options.resetProgress);focused=hovered=stopped=false;update();emit(EVENT_AUTOPLAY_PLAY);}} 3597function pause(stop){if(stop===void 0){stop=true;} 3598stopped=!!stop;update();if(!isPaused()){interval.pause();emit(EVENT_AUTOPLAY_PAUSE);}} 3599function autoToggle(){if(!stopped){hovered||focused?pause(false):play();}} 3600function update(){if(toggle){toggleClass(toggle,CLASS_ACTIVE,!stopped);setAttribute(toggle,ARIA_LABEL,options.i18n[stopped?"play":"pause"]);}} 3601function onAnimationFrame(rate){var bar=Elements.bar;bar&&style(bar,"width",rate*100+"%");emit(EVENT_AUTOPLAY_PLAYING,rate);} 3602function onMove(index){var Slide=Components2.Slides.getAt(index);interval.set(Slide&&+getAttribute(Slide.slide,INTERVAL_DATA_ATTRIBUTE)||options.interval);} 3603return{mount:mount,destroy:interval.cancel,play:play,pause:pause,isPaused:isPaused};} 3604function Cover(Splide2,Components2,options){var _EventInterface7=EventInterface(Splide2),on=_EventInterface7.on;function mount(){if(options.cover){on(EVENT_LAZYLOAD_LOADED,apply(toggle,true));on([EVENT_MOUNTED,EVENT_UPDATED,EVENT_REFRESH],apply(cover,true));}} 3605function cover(cover2){Components2.Slides.forEach(function(Slide){var img=child(Slide.container||Slide.slide,"img");if(img&&img.src){toggle(cover2,img,Slide);}});} 3606function toggle(cover2,img,Slide){Slide.style("background",cover2?"center/cover no-repeat url(\""+img.src+"\")":"",true);display(img,cover2?"none":"");} 3607return{mount:mount,destroy:apply(cover,false)};} 3608var BOUNCE_DIFF_THRESHOLD=10;var BOUNCE_DURATION=600;var FRICTION_FACTOR=0.6;var BASE_VELOCITY=1.5;var MIN_DURATION=800;function Scroll(Splide2,Components2,options){var _EventInterface8=EventInterface(Splide2),on=_EventInterface8.on,emit=_EventInterface8.emit;var set=Splide2.state.set;var Move=Components2.Move;var getPosition=Move.getPosition,getLimit=Move.getLimit,exceededLimit=Move.exceededLimit,translate=Move.translate;var isSlide=Splide2.is(SLIDE);var interval;var callback;var friction=1;function mount(){on(EVENT_MOVE,clear);on([EVENT_UPDATED,EVENT_REFRESH],cancel);} 3609function scroll(destination,duration,snap,onScrolled,noConstrain){var from=getPosition();clear();if(snap&&(!isSlide||!exceededLimit())){var size=Components2.Layout.sliderSize();var offset=sign(destination)*size*floor(abs(destination)/size)||0;destination=Move.toPosition(Components2.Controller.toDest(destination%size))+offset;} 3610var noDistance=approximatelyEqual(from,destination,1);friction=1;duration=noDistance?0:duration||max(abs(destination-from)/BASE_VELOCITY,MIN_DURATION);callback=onScrolled;interval=RequestInterval(duration,onEnd,apply(update,from,destination,noConstrain),1);set(SCROLLING);emit(EVENT_SCROLL);interval.start();} 3611function onEnd(){set(IDLE);callback&&callback();emit(EVENT_SCROLLED);} 3612function update(from,to,noConstrain,rate){var position=getPosition();var target=from+(to-from)*easing(rate);var diff=(target-position)*friction;translate(position+diff);if(isSlide&&!noConstrain&&exceededLimit()){friction*=FRICTION_FACTOR;if(abs(diff)<BOUNCE_DIFF_THRESHOLD){scroll(getLimit(exceededLimit(true)),BOUNCE_DURATION,false,callback,true);}}} 3613function clear(){if(interval){interval.cancel();}} 3614function cancel(){if(interval&&!interval.isPaused()){clear();onEnd();}} 3615function easing(t){var easingFunc=options.easingFunc;return easingFunc?easingFunc(t):1-Math.pow(1-t,4);} 3616return{mount:mount,destroy:clear,scroll:scroll,cancel:cancel};} 3617var SCROLL_LISTENER_OPTIONS={passive:false,capture:true};function Drag(Splide2,Components2,options){var _EventInterface9=EventInterface(Splide2),on=_EventInterface9.on,emit=_EventInterface9.emit,bind=_EventInterface9.bind,unbind=_EventInterface9.unbind;var state=Splide2.state;var Move=Components2.Move,Scroll=Components2.Scroll,Controller=Components2.Controller,track=Components2.Elements.track,reduce=Components2.Media.reduce;var _Components2$Directio2=Components2.Direction,resolve=_Components2$Directio2.resolve,orient=_Components2$Directio2.orient;var getPosition=Move.getPosition,exceededLimit=Move.exceededLimit;var basePosition;var baseEvent;var prevBaseEvent;var isFree;var dragging;var exceeded=false;var clickPrevented;var disabled;var target;function mount(){bind(track,POINTER_MOVE_EVENTS,noop,SCROLL_LISTENER_OPTIONS);bind(track,POINTER_UP_EVENTS,noop,SCROLL_LISTENER_OPTIONS);bind(track,POINTER_DOWN_EVENTS,onPointerDown,SCROLL_LISTENER_OPTIONS);bind(track,"click",onClick,{capture:true});bind(track,"dragstart",prevent);on([EVENT_MOUNTED,EVENT_UPDATED],init);} 3618function init(){var drag=options.drag;disable(!drag);isFree=drag==="free";} 3619function onPointerDown(e){clickPrevented=false;if(!disabled){var isTouch=isTouchEvent(e);if(isDraggable(e.target)&&(isTouch||!e.button)){if(!Controller.isBusy()){target=isTouch?track:window;dragging=state.is([MOVING,SCROLLING]);prevBaseEvent=null;bind(target,POINTER_MOVE_EVENTS,onPointerMove,SCROLL_LISTENER_OPTIONS);bind(target,POINTER_UP_EVENTS,onPointerUp,SCROLL_LISTENER_OPTIONS);Move.cancel();Scroll.cancel();save(e);}else{prevent(e,true);}}}} 3620function onPointerMove(e){if(!state.is(DRAGGING)){state.set(DRAGGING);emit(EVENT_DRAG);} 3621if(e.cancelable){if(dragging){Move.translate(basePosition+constrain(diffCoord(e)));var expired=diffTime(e)>LOG_INTERVAL;var hasExceeded=exceeded!==(exceeded=exceededLimit());if(expired||hasExceeded){save(e);} 3622clickPrevented=true;emit(EVENT_DRAGGING);prevent(e);}else if(isSliderDirection(e)){dragging=shouldStart(e);prevent(e);}}} 3623function onPointerUp(e){if(state.is(DRAGGING)){state.set(IDLE);emit(EVENT_DRAGGED);} 3624if(dragging){move(e);prevent(e);} 3625unbind(target,POINTER_MOVE_EVENTS,onPointerMove);unbind(target,POINTER_UP_EVENTS,onPointerUp);dragging=false;} 3626function onClick(e){if(!disabled&&clickPrevented){prevent(e,true);}} 3627function save(e){prevBaseEvent=baseEvent;baseEvent=e;basePosition=getPosition();} 3628function move(e){var velocity=computeVelocity(e);var destination=computeDestination(velocity);var rewind=options.rewind&&options.rewindByDrag;reduce(false);if(isFree){Controller.scroll(destination,0,options.snap);}else if(Splide2.is(FADE)){Controller.go(orient(sign(velocity))<0?rewind?"<":"-":rewind?">":"+");}else if(Splide2.is(SLIDE)&&exceeded&&rewind){Controller.go(exceededLimit(true)?">":"<");}else{Controller.go(Controller.toDest(destination),true);} 3629reduce(true);} 3630function shouldStart(e){var thresholds=options.dragMinThreshold;var isObj=isObject(thresholds);var mouse=isObj&&thresholds.mouse||0;var touch=(isObj?thresholds.touch:+thresholds)||10;return abs(diffCoord(e))>(isTouchEvent(e)?touch:mouse);} 3631function isSliderDirection(e){return abs(diffCoord(e))>abs(diffCoord(e,true));} 3632function computeVelocity(e){if(Splide2.is(LOOP)||!exceeded){var time=diffTime(e);if(time&&time<LOG_INTERVAL){return diffCoord(e)/time;}} 3633return 0;} 3634function computeDestination(velocity){return getPosition()+sign(velocity)*min(abs(velocity)*(options.flickPower||600),isFree?Infinity:Components2.Layout.listSize()*(options.flickMaxPages||1));} 3635function diffCoord(e,orthogonal){return coordOf(e,orthogonal)-coordOf(getBaseEvent(e),orthogonal);} 3636function diffTime(e){return timeOf(e)-timeOf(getBaseEvent(e));} 3637function getBaseEvent(e){return baseEvent===e&&prevBaseEvent||baseEvent;} 3638function coordOf(e,orthogonal){return(isTouchEvent(e)?e.changedTouches[0]:e)["page"+resolve(orthogonal?"Y":"X")];} 3639function constrain(diff){return diff/(exceeded&&Splide2.is(SLIDE)?FRICTION:1);} 3640function isDraggable(target2){var noDrag=options.noDrag;return!matches(target2,"."+CLASS_PAGINATION_PAGE+", ."+CLASS_ARROW)&&(!noDrag||!matches(target2,noDrag));} 3641function isTouchEvent(e){return typeof TouchEvent!=="undefined"&&e instanceof TouchEvent;} 3642function isDragging(){return dragging;} 3643function disable(value){disabled=value;} 3644return{mount:mount,disable:disable,isDragging:isDragging};} 3645var NORMALIZATION_MAP={Spacebar:" ",Right:ARROW_RIGHT,Left:ARROW_LEFT,Up:ARROW_UP,Down:ARROW_DOWN};function normalizeKey(key){key=isString(key)?key:key.key;return NORMALIZATION_MAP[key]||key;} 3646var KEYBOARD_EVENT="keydown";function Keyboard(Splide2,Components2,options){var _EventInterface10=EventInterface(Splide2),on=_EventInterface10.on,bind=_EventInterface10.bind,unbind=_EventInterface10.unbind;var root=Splide2.root;var resolve=Components2.Direction.resolve;var target;var disabled;function mount(){init();on(EVENT_UPDATED,destroy);on(EVENT_UPDATED,init);on(EVENT_MOVE,onMove);} 3647function init(){var keyboard=options.keyboard;if(keyboard){target=keyboard==="global"?window:root;bind(target,KEYBOARD_EVENT,onKeydown);}} 3648function destroy(){unbind(target,KEYBOARD_EVENT);} 3649function disable(value){disabled=value;} 3650function onMove(){var _disabled=disabled;disabled=true;nextTick(function(){disabled=_disabled;});} 3651function onKeydown(e){if(!disabled){var key=normalizeKey(e);if(key===resolve(ARROW_LEFT)){Splide2.go("<");}else if(key===resolve(ARROW_RIGHT)){Splide2.go(">");}}} 3652return{mount:mount,destroy:destroy,disable:disable};} 3653var SRC_DATA_ATTRIBUTE=DATA_ATTRIBUTE+"-lazy";var SRCSET_DATA_ATTRIBUTE=SRC_DATA_ATTRIBUTE+"-srcset";var IMAGE_SELECTOR="["+SRC_DATA_ATTRIBUTE+"], ["+SRCSET_DATA_ATTRIBUTE+"]";function LazyLoad(Splide2,Components2,options){var _EventInterface11=EventInterface(Splide2),on=_EventInterface11.on,off=_EventInterface11.off,bind=_EventInterface11.bind,emit=_EventInterface11.emit;var isSequential=options.lazyLoad==="sequential";var events=[EVENT_MOVED,EVENT_SCROLLED];var entries=[];function mount(){if(options.lazyLoad){init();on(EVENT_REFRESH,init);}} 3654function init(){empty(entries);register();if(isSequential){loadNext();}else{off(events);on(events,check);check();}} 3655function register(){Components2.Slides.forEach(function(Slide){queryAll(Slide.slide,IMAGE_SELECTOR).forEach(function(img){var src=getAttribute(img,SRC_DATA_ATTRIBUTE);var srcset=getAttribute(img,SRCSET_DATA_ATTRIBUTE);if(src!==img.src||srcset!==img.srcset){var className=options.classes.spinner;var parent=img.parentElement;var spinner=child(parent,"."+className)||create("span",className,parent);entries.push([img,Slide,spinner]);img.src||display(img,"none");}});});} 3656function check(){entries=entries.filter(function(data){var distance=options.perPage*((options.preloadPages||1)+1)-1;return data[1].isWithin(Splide2.index,distance)?load(data):true;});entries.length||off(events);} 3657function load(data){var img=data[0];addClass(data[1].slide,CLASS_LOADING);bind(img,"load error",apply(onLoad,data));setAttribute(img,"src",getAttribute(img,SRC_DATA_ATTRIBUTE));setAttribute(img,"srcset",getAttribute(img,SRCSET_DATA_ATTRIBUTE));removeAttribute(img,SRC_DATA_ATTRIBUTE);removeAttribute(img,SRCSET_DATA_ATTRIBUTE);} 3658function onLoad(data,e){var img=data[0],Slide=data[1];removeClass(Slide.slide,CLASS_LOADING);if(e.type!=="error"){remove(data[2]);display(img,"");emit(EVENT_LAZYLOAD_LOADED,img,Slide);emit(EVENT_RESIZE);} 3659isSequential&&loadNext();} 3660function loadNext(){entries.length&&load(entries.shift());} 3661return{mount:mount,destroy:apply(empty,entries),check:check};} 3662function Pagination(Splide2,Components2,options){var event=EventInterface(Splide2);var on=event.on,emit=event.emit,bind=event.bind;var Slides=Components2.Slides,Elements=Components2.Elements,Controller=Components2.Controller;var hasFocus=Controller.hasFocus,getIndex=Controller.getIndex,go=Controller.go;var resolve=Components2.Direction.resolve;var placeholder=Elements.pagination;var items=[];var list;var paginationClasses;function mount(){destroy();on([EVENT_UPDATED,EVENT_REFRESH,EVENT_END_INDEX_CHANGED],mount);var enabled=options.pagination;placeholder&&display(placeholder,enabled?"":"none");if(enabled){on([EVENT_MOVE,EVENT_SCROLL,EVENT_SCROLLED],update);createPagination();update();emit(EVENT_PAGINATION_MOUNTED,{list:list,items:items},getAt(Splide2.index));}} 3663function destroy(){if(list){remove(placeholder?slice(list.children):list);removeClass(list,paginationClasses);empty(items);list=null;} 3664event.destroy();} 3665function createPagination(){var length=Splide2.length;var classes=options.classes,i18n=options.i18n,perPage=options.perPage;var max=hasFocus()?Controller.getEnd()+1:ceil(length/perPage);list=placeholder||create("ul",classes.pagination,Elements.track.parentElement);addClass(list,paginationClasses=CLASS_PAGINATION+"--"+getDirection());setAttribute(list,ROLE,"tablist");setAttribute(list,ARIA_LABEL,i18n.select);setAttribute(list,ARIA_ORIENTATION,getDirection()===TTB?"vertical":"");for(var i=0;i<max;i++){var li=create("li",null,list);var button=create("button",{class:classes.page,type:"button"},li);var controls=Slides.getIn(i).map(function(Slide){return Slide.slide.id;});var text=!hasFocus()&&perPage>1?i18n.pageX:i18n.slideX;bind(button,"click",apply(onClick,i));if(options.paginationKeyboard){bind(button,"keydown",apply(onKeydown,i));} 3666setAttribute(li,ROLE,"presentation");setAttribute(button,ROLE,"tab");setAttribute(button,ARIA_CONTROLS,controls.join(" "));setAttribute(button,ARIA_LABEL,format(text,i+1));setAttribute(button,TAB_INDEX,-1);items.push({li:li,button:button,page:i});}} 3667function onClick(page){go(">"+page,true);} 3668function onKeydown(page,e){var length=items.length;var key=normalizeKey(e);var dir=getDirection();var nextPage=-1;if(key===resolve(ARROW_RIGHT,false,dir)){nextPage=++page%length;}else if(key===resolve(ARROW_LEFT,false,dir)){nextPage=(--page+length)%length;}else if(key==="Home"){nextPage=0;}else if(key==="End"){nextPage=length-1;} 3669var item=items[nextPage];if(item){focus(item.button);go(">"+nextPage);prevent(e,true);}} 3670function getDirection(){return options.paginationDirection||options.direction;} 3671function getAt(index){return items[Controller.toPage(index)];} 3672function update(){var prev=getAt(getIndex(true));var curr=getAt(getIndex());if(prev){var button=prev.button;removeClass(button,CLASS_ACTIVE);removeAttribute(button,ARIA_SELECTED);setAttribute(button,TAB_INDEX,-1);} 3673if(curr){var _button=curr.button;addClass(_button,CLASS_ACTIVE);setAttribute(_button,ARIA_SELECTED,true);setAttribute(_button,TAB_INDEX,"");} 3674emit(EVENT_PAGINATION_UPDATED,{list:list,items:items},prev,curr);} 3675return{items:items,mount:mount,destroy:destroy,getAt:getAt,update:update};} 3676var TRIGGER_KEYS=[" ","Enter"];function Sync(Splide2,Components2,options){var isNavigation=options.isNavigation,slideFocus=options.slideFocus;var events=[];function mount(){Splide2.splides.forEach(function(target){if(!target.isParent){sync(Splide2,target.splide);sync(target.splide,Splide2);}});if(isNavigation){navigate();}} 3677function destroy(){events.forEach(function(event){event.destroy();});empty(events);} 3678function remount(){destroy();mount();} 3679function sync(splide,target){var event=EventInterface(splide);event.on(EVENT_MOVE,function(index,prev,dest){target.go(target.is(LOOP)?dest:index);});events.push(event);} 3680function navigate(){var event=EventInterface(Splide2);var on=event.on;on(EVENT_CLICK,onClick);on(EVENT_SLIDE_KEYDOWN,onKeydown);on([EVENT_MOUNTED,EVENT_UPDATED],update);events.push(event);event.emit(EVENT_NAVIGATION_MOUNTED,Splide2.splides);} 3681function update(){setAttribute(Components2.Elements.list,ARIA_ORIENTATION,options.direction===TTB?"vertical":"");} 3682function onClick(Slide){Splide2.go(Slide.index);} 3683function onKeydown(Slide,e){if(includes(TRIGGER_KEYS,normalizeKey(e))){onClick(Slide);prevent(e);}} 3684return{setup:apply(Components2.Media.set,{slideFocus:isUndefined(slideFocus)?isNavigation:slideFocus},true),mount:mount,destroy:destroy,remount:remount};} 3685function Wheel(Splide2,Components2,options){var _EventInterface12=EventInterface(Splide2),bind=_EventInterface12.bind;var lastTime=0;function mount(){if(options.wheel){bind(Components2.Elements.track,"wheel",onWheel,SCROLL_LISTENER_OPTIONS);}} 3686function onWheel(e){if(e.cancelable){var deltaY=e.deltaY;var backwards=deltaY<0;var timeStamp=timeOf(e);var _min=options.wheelMinThreshold||0;var sleep=options.wheelSleep||0;if(abs(deltaY)>_min&&timeStamp-lastTime>sleep){Splide2.go(backwards?"<":">");lastTime=timeStamp;} 3687shouldPrevent(backwards)&&prevent(e);}} 3688function shouldPrevent(backwards){return!options.releaseWheel||Splide2.state.is(MOVING)||Components2.Controller.getAdjacent(backwards)!==-1;} 3689return{mount:mount};} 3690var SR_REMOVAL_DELAY=90;function Live(Splide2,Components2,options){var _EventInterface13=EventInterface(Splide2),on=_EventInterface13.on;var track=Components2.Elements.track;var enabled=options.live&&!options.isNavigation;var sr=create("span",CLASS_SR);var interval=RequestInterval(SR_REMOVAL_DELAY,apply(toggle,false));function mount(){if(enabled){disable(!Components2.Autoplay.isPaused());setAttribute(track,ARIA_ATOMIC,true);sr.textContent="\u2026";on(EVENT_AUTOPLAY_PLAY,apply(disable,true));on(EVENT_AUTOPLAY_PAUSE,apply(disable,false));on([EVENT_MOVED,EVENT_SCROLLED],apply(toggle,true));}} 3691function toggle(active){setAttribute(track,ARIA_BUSY,active);if(active){append(track,sr);interval.start();}else{remove(sr);interval.cancel();}} 3692function destroy(){removeAttribute(track,[ARIA_LIVE,ARIA_ATOMIC,ARIA_BUSY]);remove(sr);} 3693function disable(disabled){if(enabled){setAttribute(track,ARIA_LIVE,disabled?"off":"polite");}} 3694return{mount:mount,disable:disable,destroy:destroy};} 3695var ComponentConstructors=Object.freeze({__proto__:null,Media:Media,Direction:Direction,Elements:Elements,Slides:Slides,Layout:Layout,Clones:Clones,Move:Move,Controller:Controller,Arrows:Arrows,Autoplay:Autoplay,Cover:Cover,Scroll:Scroll,Drag:Drag,Keyboard:Keyboard,LazyLoad:LazyLoad,Pagination:Pagination,Sync:Sync,Wheel:Wheel,Live:Live});var I18N={prev:"Previous slide",next:"Next slide",first:"Go to first slide",last:"Go to last slide",slideX:"Go to slide %s",pageX:"Go to page %s",play:"Start autoplay",pause:"Pause autoplay",carousel:"carousel",slide:"slide",select:"Select a slide to show",slideLabel:"%s of %s"};var DEFAULTS={type:"slide",role:"region",speed:400,perPage:1,cloneStatus:true,arrows:true,pagination:true,paginationKeyboard:true,interval:5e3,pauseOnHover:true,pauseOnFocus:true,resetProgress:true,easing:"cubic-bezier(0.25, 1, 0.5, 1)",drag:true,direction:"ltr",trimSpace:true,focusableNodes:"a, button, textarea, input, select, iframe",live:true,classes:CLASSES,i18n:I18N,reducedMotion:{speed:0,rewindSpeed:0,autoplay:"pause"}};function Fade(Splide2,Components2,options){var Slides=Components2.Slides;function mount(){EventInterface(Splide2).on([EVENT_MOUNTED,EVENT_REFRESH],init);} 3696function init(){Slides.forEach(function(Slide){Slide.style("transform","translateX(-"+100*Slide.index+"%)");});} 3697function start(index,done){Slides.style("transition","opacity "+options.speed+"ms "+options.easing);nextTick(done);} 3698return{mount:mount,start:start,cancel:noop};} 3699function Slide(Splide2,Components2,options){var Move=Components2.Move,Controller=Components2.Controller,Scroll=Components2.Scroll;var list=Components2.Elements.list;var transition=apply(style,list,"transition");var endCallback;function mount(){EventInterface(Splide2).bind(list,"transitionend",function(e){if(e.target===list&&endCallback){cancel();endCallback();}});} 3700function start(index,done){var destination=Move.toPosition(index,true);var position=Move.getPosition();var speed=getSpeed(index);if(abs(destination-position)>=1&&speed>=1){if(options.useScroll){Scroll.scroll(destination,speed,false,done);}else{transition("transform "+speed+"ms "+options.easing);Move.translate(destination,true);endCallback=done;}}else{Move.jump(index);done();}} 3701function cancel(){transition("");Scroll.cancel();} 3702function getSpeed(index){var rewindSpeed=options.rewindSpeed;if(Splide2.is(SLIDE)&&rewindSpeed){var prev=Controller.getIndex(true);var end=Controller.getEnd();if(prev===0&&index>=end||prev>=end&&index===0){return rewindSpeed;}} 3703return options.speed;} 3704return{mount:mount,start:start,cancel:cancel};} 3705var _Splide=function(){function _Splide(target,options){this.event=EventInterface();this.Components={};this.state=State(CREATED);this.splides=[];this._o={};this._E={};var root=isString(target)?query(document,target):target;assert(root,root+" is invalid.");this.root=root;options=merge({label:getAttribute(root,ARIA_LABEL)||"",labelledby:getAttribute(root,ARIA_LABELLEDBY)||""},DEFAULTS,_Splide.defaults,options||{});try{merge(options,JSON.parse(getAttribute(root,DATA_ATTRIBUTE)));}catch(e){assert(false,"Invalid JSON");} 3706this._o=Object.create(merge({},options));} 3707var _proto=_Splide.prototype;_proto.mount=function mount(Extensions,Transition){var _this=this;var state=this.state,Components2=this.Components;assert(state.is([CREATED,DESTROYED]),"Already mounted!");state.set(CREATED);this._C=Components2;this._T=Transition||this._T||(this.is(FADE)?Fade:Slide);this._E=Extensions||this._E;var Constructors=assign({},ComponentConstructors,this._E,{Transition:this._T});forOwn(Constructors,function(Component,key){var component=Component(_this,Components2,_this._o);Components2[key]=component;component.setup&&component.setup();});forOwn(Components2,function(component){component.mount&&component.mount();});this.emit(EVENT_MOUNTED);addClass(this.root,CLASS_INITIALIZED);state.set(IDLE);this.emit(EVENT_READY);return this;};_proto.sync=function sync(splide){this.splides.push({splide:splide});splide.splides.push({splide:this,isParent:true});if(this.state.is(IDLE)){this._C.Sync.remount();splide.Components.Sync.remount();} 3708return this;};_proto.go=function go(control){this._C.Controller.go(control);return this;};_proto.on=function on(events,callback){this.event.on(events,callback);return this;};_proto.off=function off(events){this.event.off(events);return this;};_proto.emit=function emit(event){var _this$event;(_this$event=this.event).emit.apply(_this$event,[event].concat(slice(arguments,1)));return this;};_proto.add=function add(slides,index){this._C.Slides.add(slides,index);return this;};_proto.remove=function remove(matcher){this._C.Slides.remove(matcher);return this;};_proto.is=function is(type){return this._o.type===type;};_proto.refresh=function refresh(){this.emit(EVENT_REFRESH);return this;};_proto.destroy=function destroy(completely){if(completely===void 0){completely=true;} 3709var event=this.event,state=this.state;if(state.is(CREATED)){EventInterface(this).on(EVENT_READY,this.destroy.bind(this,completely));}else{forOwn(this._C,function(component){component.destroy&&component.destroy(completely);},true);event.emit(EVENT_DESTROY);event.destroy();completely&&empty(this.splides);state.set(DESTROYED);} 3710return this;};_createClass(_Splide,[{key:"options",get:function get(){return this._o;},set:function set(options){this._C.Media.set(options,true,true);}},{key:"length",get:function get(){return this._C.Slides.getLength(true);}},{key:"index",get:function get(){return this._C.Controller.getIndex();}}]);return _Splide;}();var Splide=_Splide;Splide.defaults={};Splide.STATES=STATES;return Splide;});Application.Module.LandingPage=Application.Module.LandingPage||{};Application.Module.LandingPage.PageTop=function(){};Application.Module.LandingPage.PageTop.prototype=new Meteor.App.Module('LandingPage');Application.Module.LandingPage.PageTop.prototype.doInitialize=function(){this.sandbox.addEventListeners('SearchForm.search.start',function(e){$(".landing-page-top").remove();$("body").attr("id","default-search");});};Meteor.App.Core.registerModule(new Application.Module.LandingPage.PageTop());
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.