jQuery(function($){
if($('.comment-form-aios-antibot-keys').length&&$('#aios_antibot_keys_expiry').length){
if($('#aios_antibot_keys_expiry').val() < Math.floor(Date.now() / 1000)){
jQuery.ajax({
url: AIOS_FRONT.ajaxurl,
type: 'post',
dataType: 'json',
cache: false,
data: {
action: 'get_antibot_keys',
nonce: AIOS_FRONT.ajax_nonce
},
success: function(resp){
if(resp.hasOwnProperty('error_code')){
console.log("ERROR: " + resp.error_message);
}else if(resp.hasOwnProperty('data')){
for (var indx in resp.data){
var input=$("<input>").attr("type", "hidden");
input.attr("name", resp.data[indx][0]);
input.attr("value", resp.data[indx][1]);
$('.comment-form-aios-antibot-keys').append(input);
}}
},
error: function(xhr, text_status, error_thrown){
console.log("ERROR: " + text_status + ":" + error_thrown);
}});
}}
});
(function(){
var supportsPassive=false;
try {
var opts=Object.defineProperty({}, 'passive', {
get:function(){
supportsPassive=true;
}});
window.addEventListener('testPassive', null, opts);
window.removeEventListener('testPassive', null, opts);
} catch(e){}
function init(){
var input_begin='';
var keydowns={};
var lastKeyup=null;
var lastKeydown=null;
var keypresses=[];
var modifierKeys=[];
var correctionKeys=[];
var lastMouseup=null;
var lastMousedown=null;
var mouseclicks=[];
var mouseclickCoordinates=[];
var mousemoveTimer=null;
var lastMousemoveX=null;
var lastMousemoveY=null;
var mousemoveStart=null;
var mousemoves=[];
var touchmoveCountTimer=null;
var touchmoveCount=0;
var lastTouchEnd=null;
var lastTouchStart=null;
var touchEvents=[];
var scrollCountTimer=null;
var scrollCount=0;
var correctionKeyCodes=[ 'Backspace', 'Delete', 'ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'Home', 'End', 'PageUp', 'PageDown' ];
var modifierKeyCodes=[ 'Shift', 'CapsLock' ];
var forms=document.querySelectorAll('form[method=post]');
for(var i=0; i < forms.length; i++){
var form=forms[i];
var formAction=form.getAttribute('action');
if(formAction){
if(formAction.indexOf('http://')==0||formAction.indexOf('https://')==0){
if(formAction.indexOf('http://' + window.location.hostname + '/')!=0&&formAction.indexOf('https://' + window.location.hostname + '/')!=0){
continue;
}}
}
form.addEventListener('submit', function (){
var ak_bkp=prepare_array_for_request(keypresses);
var ak_bmc=prepare_array_for_request(mouseclicks);
var ak_bte=prepare_array_for_request(touchEvents);
var ak_bmm=prepare_array_for_request(mousemoves);
var ak_bcc=prepare_array_for_request(mouseclickCoordinates);
var input_fields={
'bib': input_begin,
'bfs': Date.now(),
'bkpc': keypresses.length,
'bkp': ak_bkp,
'bmc': ak_bmc,
'bmcc': mouseclicks.length,
'bmk': modifierKeys.join(';'),
'bck': correctionKeys.join(';'),
'bmmc': mousemoves.length,
'btmc': touchmoveCount,
'bsc': scrollCount,
'bte': ak_bte,
'btec':touchEvents.length,
'bmm':ak_bmm,
'bcc':ak_bcc
};
var akismet_field_prefix='ak_';
if(this.getElementsByClassName){
var possible_akismet_containers=this.getElementsByClassName('akismet-fields-container');
for(var containerIndex=0; containerIndex < possible_akismet_containers.length; containerIndex++){
var container=possible_akismet_containers.item(containerIndex);
if(container.getAttribute('data-prefix') ){
akismet_field_prefix=container.getAttribute('data-prefix');
break;
}}
}
for(var field_name in input_fields){
var field=document.createElement('input');
field.setAttribute('type', 'hidden');
field.setAttribute('name', akismet_field_prefix + field_name);
field.setAttribute('value', input_fields[ field_name ]);
this.appendChild(field);
}}, supportsPassive ? { passive: true }:false);
form.addEventListener('keydown', function(e){
if(e.key in keydowns){
return;
}
var keydownTime=(new Date()).getTime();
keydowns[ e.key ]=[ keydownTime ];
if(! input_begin){
input_begin=keydownTime;
}
var lastKeyEvent=Math.max(lastKeydown, lastKeyup);
if(lastKeyEvent){
keydowns[ e.key ].push(keydownTime - lastKeyEvent);
}
lastKeydown=keydownTime;
}, supportsPassive ? { passive: true }:false);
form.addEventListener('keyup', function(e){
if(!(e.key in keydowns) ){
return;
}
var keyupTime=(new Date()).getTime();
if('TEXTAREA'===e.target.nodeName||'INPUT'===e.target.nodeName){
if(-1!==modifierKeyCodes.indexOf(e.key) ){
modifierKeys.push(keypresses.length - 1);
}else if(-1!==correctionKeyCodes.indexOf(e.key) ){
correctionKeys.push(keypresses.length - 1);
}else{
var keydownTime=keydowns[ e.key ][0];
var keypress=[];
keypress.push(keyupTime - keydownTime);
if(keydowns[ e.key ].length > 1){
keypress.push(keydowns[ e.key ][1]);
}
keypresses.push(keypress);
}}
delete keydowns[ e.key ];
lastKeyup=keyupTime;
}, supportsPassive ? { passive: true }:false);
form.addEventListener("focusin", function(e){
lastKeydown=null;
lastKeyup=null;
keydowns={};}, supportsPassive ? { passive: true }:false);
form.addEventListener("focusout", function(e){
lastKeydown=null;
lastKeyup=null;
keydowns={};}, supportsPassive ? { passive: true }:false);
}
document.addEventListener('mousedown', function(e){
lastMousedown=(new Date()).getTime();
var mouseclickCoordinate=[];
var rect=e.target.getBoundingClientRect();
var relativeX=e.clientX - rect.left;
var relativeY=e.clientY - rect.top;
mouseclickCoordinate.push(Math.round(relativeX) );
mouseclickCoordinate.push(Math.round(relativeY) );
mouseclickCoordinate.push(rect.width > 0 ? Math.round(relativeX / rect.width * 100):0);
mouseclickCoordinate.push(rect.height > 0 ? Math.round(relativeY / rect.height * 100):0);
mouseclickCoordinates.push(mouseclickCoordinate);
}, supportsPassive ? { passive: true }:false);
document.addEventListener('mouseup', function(e){
if(! lastMousedown){
return;
}
var now=(new Date()).getTime();
var mouseclick=[];
mouseclick.push(now - lastMousedown);
if(lastMouseup){
mouseclick.push(lastMousedown - lastMouseup);
}
mouseclicks.push(mouseclick);
lastMouseup=now;
lastKeydown=null;
lastKeyup=null;
keydowns={};}, supportsPassive ? { passive: true }:false);
document.addEventListener('mousemove', function(e){
if(mousemoveTimer){
clearTimeout(mousemoveTimer);
mousemoveTimer=null;
}else{
mousemoveStart=(new Date()).getTime();
lastMousemoveX=e.offsetX;
lastMousemoveY=e.offsetY;
}
mousemoveTimer=setTimeout(function(theEvent, originalMousemoveStart){
var now=(new Date()).getTime() - 500;
var mousemove=[];
mousemove.push(now - originalMousemoveStart);
mousemove.push(Math.round(Math.sqrt(Math.pow(theEvent.offsetX - lastMousemoveX, 2) +
Math.pow(theEvent.offsetY - lastMousemoveY, 2)
)
)
);
if(mousemove[1] > 0){
mousemoves.push(mousemove);
}
mousemoveStart=null;
mousemoveTimer=null;
}, 500, e, mousemoveStart);
}, supportsPassive ? { passive: true }:false);
document.addEventListener('touchmove', function(e){
if(touchmoveCountTimer){
clearTimeout(touchmoveCountTimer);
}
touchmoveCountTimer=setTimeout(function (){
touchmoveCount++;
}, 500);
}, supportsPassive ? { passive: true }:false);
document.addEventListener('touchstart', function(e){
lastTouchStart=(new Date()).getTime();
}, supportsPassive ? { passive: true }:false);
document.addEventListener('touchend', function(e){
if(! lastTouchStart){
return;
}
var now=(new Date()).getTime();
var touchEvent=[];
touchEvent.push(now - lastTouchStart);
if(lastTouchEnd){
touchEvent.push(lastTouchStart - lastTouchEnd);
}
touchEvents.push(touchEvent);
lastTouchEnd=now;
lastKeydown=null;
lastKeyup=null;
keydowns={};}, supportsPassive ? { passive: true }:false);
document.addEventListener('scroll', function(e){
if(scrollCountTimer){
clearTimeout(scrollCountTimer);
}
scrollCountTimer=setTimeout(function (){
scrollCount++;
}, 500);
}, supportsPassive ? { passive: true }:false);
}
function prepare_array_for_request(a, limit){
if(! limit){
limit=100;
}
var rv='';
if(a.length > 0){
var random_starting_point=Math.max(0, Math.floor(Math.random() * a.length - limit) );
for(var i=0; i < limit&&i < a.length; i++){
var entry=a[ random_starting_point + i ];
rv +=entry.join(',') + ';';
}}
return rv;
}
if(document.readyState!=='loading'){
init();
}else{
document.addEventListener('DOMContentLoaded', init);
}})();
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(c,v,p){c!=Array.prototype&&c!=Object.prototype&&(c[v]=p.value)};$jscomp.getGlobal=function(c){return"undefined"!=typeof window&&window===c?c:"undefined"!=typeof global&&null!=global?global:c};$jscomp.global=$jscomp.getGlobal(this);
$jscomp.polyfill=function(c,v,p,z){if(v){p=$jscomp.global;c=c.split(".");for(z=0;z<c.length-1;z++){var m=c[z];m in p||(p[m]={});p=p[m]}c=c[c.length-1];z=p[c];v=v(z);v!=z&&null!=v&&$jscomp.defineProperty(p,c,{configurable:!0,writable:!0,value:v})}};
$jscomp.polyfill("Math.hypot",function(c){return c?c:function(c,p,z){c=Number(c);p=Number(p);var m,u=Math.max(Math.abs(c),Math.abs(p));for(m=2;m<arguments.length;m++)u=Math.max(u,Math.abs(arguments[m]));if(1E100<u||1E-100>u){if(!u)return u;c/=u;p/=u;var v=c*c+p*p;for(m=2;m<arguments.length;m++){var D=Number(arguments[m])/u;v+=D*D}return Math.sqrt(v)*u}v=c*c+p*p;for(m=2;m<arguments.length;m++)D=Number(arguments[m]),v+=D*D;return Math.sqrt(v)}},"es6","es3");
function codeasily_albumsGrid3_module(){function c(a){return window[a]&&window[a].settings?window[a].settings:null}function v(){this._listenerSet={}}function p(a,b,d){this.type=a;this.params=d;this.target=b}function z(){var a=!1;try{var b=Object.defineProperty({},"passive",{get:function(){a=!0}});window.addEventListener("testPassiveListener",null,b)}catch(d){}return a}function m(){return navigator.maxTouchPoints||"ontouchstart"in window}function u(a){if("audio/mpeg"==a)return"audio";if("image"==a.split("/")[0])return"image"}
function W(){if(R)return R;var a=document.createElement("div");a.style.visibility="hidden";a.style.width="100px";a.style.msOverflowStyle="scrollbar";document.body.appendChild(a);var b=a.offsetWidth;a.style.overflow="scroll";var d=document.createElement("div");d.style.width="100%";a.appendChild(d);d=d.offsetWidth;a.parentNode.removeChild(a);return R=b-d}function D(a){a=new Date(1E3*a);var b=new Date,d=new Date(Date.now()-864E5),e=a.getFullYear(),c="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" ")[a.getMonth()],
g=a.getDate(),h=a.getHours(),n=a.getMinutes();return a.setHours(0,0,0,0)==b.setHours(0,0,0,0)?"Today, "+h+":"+n:a.setHours(0,0,0,0)==d.setHours(0,0,0,0)?"Yesterday, "+h+":"+n:e==b.getFullYear()?g+" "+c+", "+e:g+" "+c+" "+e}function S(a){for(var b=0,d=0;d<a.childNodes.length;d++){var e=a.childNodes[d];if(1==e.nodeType&&"SCRIPT"!=e.nodeName)var c=document.defaultView.getComputedStyle(e,null).getPropertyValue("z-index");c>b&&"auto"!=c&&(b=parseInt(c));b=0==b?999999:b}return b}function J(a,b,d,e){this.x=
a;this.y=b;this.width=d;this.height=e}function r(a,b){this.width=a;this.height=b}function q(a,b){this.x=a;this.y=b}function K(a,b,d,e,c,g){this.scaleX=a;this.skewY=b;this.skewX=d;this.scaleY=e;this.translateX=c;this.translateY=g}function T(a,b,d){this.x=a;this.y=b;this.z=d}function H(a){var b=0,d=document.createElement("div");d.className="gmediaAlbumsGridPreloader";var e=document.createElement("div");e.style.position="absolute";e.style.width="8px";e.style.height="8px";e.style.margin="-4px";e.style.left=
"50%";e.style.top="50%";e.style.borderRadius="50%";e.style.backgroundColor=a;d.appendChild(e);e=document.createElement("div");e.className="c-spinner";e.style.position="absolute";e.style.width="36px";e.style.height="36px";e.style.margin="-18px";e.style.left="50%";e.style.top="50%";for(var c=0;8>c;c++){var g=document.createElement("div");g.style.position="absolute";g.style.top="50%";g.style.left="50%";g.style.marginTop="-4px";g.style.marginLeft="-4px";g.style.width="8px";g.style.height="8px";g.style.backgroundColor=
a;g.style.borderRadius="100%";g.style.transform="rotate("+b+"deg) translate(18px)";b+=45;e.appendChild(g)}d.appendChild(e);return d}function U(a){if(1==arguments.length)console.log(a);else{for(var b="",d=0;d<arguments.length;d++)b+=arguments[d]+", ";b=b.slice(0,-2);console.log(b)}}function X(){window.addEventListener&&(window.addEventListener("DOMMouseScroll",E,!1),window.addEventListener("touchmove",E,A));window.onwheel=E;window.onmousewheel=document.onmousewheel=E;document.onkeydown=pa}function Y(){window.removeEventListener&&
(window.removeEventListener("DOMMouseScroll",E,!1),window.removeEventListener("touchmove",E,A));window.onmousewheel=document.onmousewheel=null;window.onwheel=null;document.onkeydown=null}function pa(a){if({37:1,38:1,39:1,40:1}[a.keyCode])return E(a),!1}function E(a){a=a||window.event;a.preventDefault&&a.preventDefault();a.returnValue=!1}function l(a,b){a=a.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(a,b,c,g){return b+b+c+c+g+g});return(a=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(a))?
"rgba("+parseInt(a[1],16)+","+parseInt(a[2],16)+","+parseInt(a[3],16)+","+b+")":null}function L(a,b){for(var d in a)b[d]=a[d]}function Z(a,b,d,e){var c=a.width;a=a.height;var g=b.width;b=b.height;d?d=Math.max(g/c,b/a):(d=Math.min(g/c,b/a),d=1<d?1:d);var h=Math.round(c*d),n=Math.round(a*d),k=Math.round((g-h)/2),qa=Math.round((b-n)/2);return e?new K(d,0,0,d,(g-c)/2,(b-a)/2):new J(k,qa,h,n)}function aa(a,b,d,e,c,g,h){var f=1;h&&(f=h);b=b.width;d=Math.min(d,Math.floor((b+e)/(g+e)));g=(b-e*(d-1))/d;b=
Math.ceil((a+1)/d)-1;return{x:(a-b*d)*(g+e),y:b*(g*f+c),width:g,height:g*f}}function M(a,b,d){function e(){var f=(new Date).getTime()-g,n=f/d;1>n?(n=1-c(n),a.style.opacity=String(n),setTimeout(e,Math.min(25,d-f))):(a.style.opacity="0",b&&b())}d||(d=500);var c=Math.sqrt,g=(new Date).getTime();e()}function F(a,b,d,e){var f=new XMLHttpRequest;f.open("POST",c(b.appName).appApi,!0);f.onreadystatechange=function(){4==this.readyState&&(200!=this.status?d&&c(b.appName).appEventManager.dispatchGMEvent(new p(d,
b,{error:this.statusText,params:e})):d&&c(b.appName).appEventManager.dispatchGMEvent(new p(d,b,{data:this.responseText,params:e})))};f.onerror=function(c){1==confirm("Failed to load resource: The network connection was lost. Let's try again?")&&F(a,b,d,e)};try{f.send(a),c(b.appName).appEventManager.dispatchGMEvent(new p(t.REQUEST_START,b,null))}catch(g){U(g)}}function ra(a,b,d){this.appName=a;var e=0;a=document.createElement("div");a.className="gmediaAlbumsGridItemInfoBar";a.style.backgroundColor=
l(c(this.appName).modalInfoBoxBgColor,c(this.appName).modalInfoBoxBgAlpha);if(!m()||m()&&N)e=document.createElement("div"),e.className="gmInfoBarCloseButton",e.innerHTML='<svg version="1.1" viewBox="0 0 512 512" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M437.5,386.6L306.9,256l130.6-130.6c14.1-14.1,14.1-36.8,0-50.9c-14.1-14.1-36.8-14.1-50.9,0L256,205.1L125.4,74.5  c-14.1-14.1-36.8-14.1-50.9,0c-14.1,14.1-14.1,36.8,0,50.9L205.1,256L74.5,386.6c-14.1,14.1-14.1,36.8,0,50.9  c14.1,14.1,36.8,14.1,50.9,0L256,306.9l130.6,130.6c14.1,14.1,36.8,14.1,50.9,0C451.5,423.4,451.5,400.6,437.5,386.6z"/></svg>',
e.childNodes[0].style.fill=l(c(this.appName).modalInfoBoxTitleTextColor,1),e.addEventListener("click",function(){b.prepareToRemove()},!1),a.appendChild(e);var f='<span class="gmItemTitle" style="color: '+c(this.appName).modalInfoBoxTitleTextColor+'">'+d.title+"<br>";f=d.description&&""!=d.description?f+('<span class="gmItemDescription" style="color: '+c(this.appName).modalInfoBoxTextColor+'">'+d.description+"</span></span>"):f+"</span>";""!=f&&(e=document.createElement("div"),e.className="gmDescriptionWrap",
e.style.float="none",e.innerHTML=f,a.appendChild(e));if(c(this.appName).infoBarExifEnable){f="";d.meta.data&&d.meta.data.model&&(f+="<span class=gmItemMetaExifValue>"+d.meta.data.model+"</span></br>");var g=[];d.meta.data&&d.meta.data.focallength&&g.push("<span class=gmItemMetaExifValue>"+d.meta.data.focallength+"</span>");d.meta.data&&d.meta.data.aperture&&g.push("<span class=gmItemMetaExifValue>"+d.meta.data.aperture+"</span>");d.meta.data&&d.meta.data.exposure&&g.push("<span class=gmItemMetaExifValue>"+
d.meta.data.exposure+"</span>");d.meta.data&&d.meta.data.iso&&g.push("<span class=gmItemMetaExifValue>ISO "+d.meta.data.iso+"</span>");for(e=0;e<g.length;e++)f+=g[e],e<g.length-1&&(f+='<span class="gmItemMetaExifSeparator"> / </span>');""!=f&&(e=document.createElement("div"),e.className="gmDescriptionWrap",e.style.color=l(c(this.appName).modalInfoBoxTextColor,1),e.style.fontSize="100%",e.innerHTML=f,a.appendChild(e))}c(this.appName).infoBarCountersEnable&&(e=document.createElement("div"),e.className=
"gmDescriptionWrap",e.style.color=l(c(this.appName).modalInfoBoxTextColor,1),e.style.fontSize="100%",f=document.createElement("div"),f.className="likesViewCom",f.innerHTML='<svg enable-background="new 0 0 167 93" height="93px" id="Layer_1" version="1.1" viewBox="0 0 167 93" width="167px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g><path d="M83.25,29.25c-9.649,0-17.5,7.851-17.5,17.5s7.851,17.5,17.5,17.5s17.5-7.851,17.5-17.5   S92.899,29.25,83.25,29.25z"/><path d="M83.25,0.75c-45.84,0-83,46-83,46s37.16,46,83,46s83-46,83-46S129.09,0.75,83.25,0.75z M83.25,81.25   c-19.054,0-34.5-15.445-34.5-34.5c0-19.054,15.446-34.5,34.5-34.5s34.5,15.446,34.5,34.5C117.75,65.805,102.304,81.25,83.25,81.25z   "/></g></svg><div class="counterTxt">'+
(d.meta.views?d.meta.views:0)+"</div>",f.getElementsByTagName("svg")[0].style.fill=l(c(this.appName).modalInfoBoxTitleTextColor,1),e.appendChild(f),f=document.createElement("div"),f.className="likesViewCom",f.innerHTML='<svg enable-background="new 0 0 51 46" height="46px" id="Layer_1" version="1.1" viewBox="0 0 51 46" width="51px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M46.188,4.101c-5.529-5.53-14.495-5.53-20.023,0L25.39,4.875l-0.996-0.774c-5.529-5.53-14.715-5.53-20.245,0  C-1.38,9.63-1.27,18.595,4.26,24.125l18.753,18.643c0.671,0.671,1.4,1.258,2.376,1.766c0.76-0.508,1.483-1.095,2.155-1.766  l18.643-18.643C51.717,18.595,51.717,9.63,46.188,4.101z""/></svg><div class="counterTxt">'+
(d.meta.likes?d.meta.likes:0)+"</div>",f.getElementsByTagName("svg")[0].style.fill=l(c(this.appName).modalInfoBoxTitleTextColor,1),e.appendChild(f),f=document.createElement("div"),f.className="likesViewCom",f.innerHTML='<svg style="enable-background:new 0 0 24 24;" version="1.1" viewBox="0 0 24 24" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="info"/><g id="icons"><path d="M20,1H4C1.8,1,0,2.8,0,5v10c0,2.2,1.8,4,4,4v3c0,0.9,1.1,1.3,1.7,0.7L9.4,19H20c2.2,0,4-1.8,4-4V5   C24,2.8,22.2,1,20,1z M14,13H8c-0.6,0-1-0.4-1-1c0-0.6,0.4-1,1-1h6c0.6,0,1,0.4,1,1C15,12.6,14.6,13,14,13z M16,9H8   C7.4,9,7,8.6,7,8c0-0.6,0.4-1,1-1h8c0.6,0,1,0.4,1,1C17,8.6,16.6,9,16,9z" id="message"/></g></svg><div class="counterTxt">'+
(d.comment_count?d.comment_count:0)+"</div>",f.getElementsByTagName("svg")[0].style.fill=l(c(this.appName).modalInfoBoxTitleTextColor,1),e.appendChild(f),a.appendChild(e));c(this.appName).infoBarDateInfoEnable&&(e=document.createElement("div"),e.className="gmDescriptionWrap",e.style.color=l(c(this.appName).modalInfoBoxTextColor,1),e.style.fontSize="100%",f="",g='<span class="gmItemMetaKey">Upload: </span><span class="gmItemMetaValue">'+D(d.date)+"</span></br>",f+=g,d.meta.data&&d.meta.data.created_timestamp&&
(d='<span class="gmItemMetaKey">Taken: </span><span class="gmItemMetaValue">'+D(d.meta.data.created_timestamp)+"</span>",f+=d),e.innerHTML='<div class="gmItemsDate">'+f+"</div>",""!=f&&a.appendChild(e));return a}function sa(a,b,d,e){function f(a){if(!b.dragging){a=this.getAttribute("type");var c="menubar=no,toolbar=no,resizable=yes,scrollbars=yes, top=200, left="+(screen.width-600)/2+", height=450,width=600";switch(a){case "copy":n&&window.open(e,"_blank");a=document.getElementById("gmSH_title_copy");
c=this.getElementsByClassName("gmItemCopyLink")[0].getElementsByTagName("svg")[0];window.getSelection().selectAllChildren(a);try{document.execCommand ("copy"),window.getSelection().removeAllRanges(),c.style.fill="green",a.style.color="green",n=!0}catch(ta){window.open(e,"_blank")}break;case "google":window.open("https://plus.google.com/share?url="+e,"",c);break;case "facebook":window.open("https://www.facebook.com/share.php?u="+e,"",c);break;case "twitter":window.open("https://twitter.com/intent/tweet?text="+
encodeURI(d.title)+"&url="+e,"",c);break;case "pinterest":window.open("http://www.pinterest.com/pin/create/button/?url="+e+"&media="+d.url+"&description="+encodeURI(d.title),"",c)}}}this.appName=a;a=document.createElement("div");a.className="gmediaAlbumsGridItemShare";a.style.backgroundColor=l(c(this.appName).modalInfoBoxBgColor,c(this.appName).modalInfoBoxBgAlpha);if(!m()||m()&&N){var g=document.createElement("div");g.className="gmInfoBarCloseButton";g.innerHTML='<svg version="1.1" viewBox="0 0 512 512" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M437.5,386.6L306.9,256l130.6-130.6c14.1-14.1,14.1-36.8,0-50.9c-14.1-14.1-36.8-14.1-50.9,0L256,205.1L125.4,74.5  c-14.1-14.1-36.8-14.1-50.9,0c-14.1,14.1-14.1,36.8,0,50.9L205.1,256L74.5,386.6c-14.1,14.1-14.1,36.8,0,50.9  c14.1,14.1,36.8,14.1,50.9,0L256,306.9l130.6,130.6c14.1,14.1,36.8,14.1,50.9,0C451.5,423.4,451.5,400.6,437.5,386.6z"/></svg>';
g.childNodes[0].style.fill=l(c(this.appName).modalInfoBoxTitleTextColor,1);g.addEventListener("click",function(){b.prepareToRemove()},!1);a.appendChild(g)}var h='<span class="gmItemTitle" style="color: '+c(this.appName).modalInfoBoxTitleTextColor+'">Share<br>';d.title&&""!=d.title||d.name&&""!=d.name?(g=d.title||d.name,h+='<span class="gmItemDescription" style="color: '+c(this.appName).modalInfoBoxTextColor+'">'+g+"</span></span>"):h+="</span>";""!=h&&(g=document.createElement("div"),g.className=
"gmDescriptionWrap",g.style.float="none",g.innerHTML=h,a.appendChild(g));g=document.createElement("div");g.className="gmDescriptionWrap";g.style.float="none";g.style.padding="0px 20px";a.appendChild(g);var n=!1;h=document.createElement("div");h.setAttribute("type","facebook");h.className="gmItemShareButtonWrap";var k=document.createElement("div");k.className="gmItemShareButton";k.innerHTML='<svg version="1.1" viewBox="0 0 32 32" width="32" height="32" aria-hidden="false"><path d="M27.6 3h-23.2c-.8 0-1.4.6-1.4 1.4v23.1c0 .9.6 1.5 1.4 1.5h12.5v-10.1h-3.4v-3.9h3.4v-2.9c0-3.4 2.1-5.2 5-5.2 1.4 0 2.7.1 3 .2v3.5h-2.1c-1.6 0-1.9.8-1.9 1.9v2.5h3.9l-.5 3.9h-3.4v10.1h6.6c.8 0 1.4-.6 1.4-1.4v-23.2c.1-.8-.5-1.4-1.3-1.4z"></path></svg><div class="gmSH_title" style="color: #3b5998">Facebook</div>';
k.getElementsByTagName("svg")[0].style.fill="#3b5998";h.appendChild(k);h.addEventListener("mouseup",f,!1);m()&&h.addEventListener("touchend",f,!1);g.appendChild(h);h=document.createElement("div");h.setAttribute("type","twitter");h.className="gmItemShareButtonWrap";k=document.createElement("div");k.className="gmItemShareButton";k.innerHTML='<svg version="1.1" viewBox="0 0 32 32" width="32" height="32" aria-hidden="false"><path d="M30 7.3c-1 .5-2.1.8-3.3.9 1.2-.7 2.1-1.8 2.5-3.2-1.1.7-2.3 1.1-3.6 1.4-1-1.1-2.5-1.8-4.2-1.8-3.2 0-5.7 2.6-5.7 5.7 0 .5.1.9.1 1.3-4.8-.2-9-2.5-11.8-6-.5.9-.8 1.9-.8 3 0 2 1 3.8 2.6 4.8-.9 0-1.8-.3-2.6-.7v.1c0 2.8 2 5.1 4.6 5.6-.5.1-1 .2-1.5.2-.4 0-.7 0-1.1-.1.7 2.3 2.9 3.9 5.4 4-2 1.5-4.4 2.5-7.1 2.5-.5 0-.9 0-1.4-.1 2.5 1.6 5.6 2.6 8.8 2.6 10.6 0 16.3-8.8 16.3-16.3v-.7c1.1-1 2-2 2.8-3.2z"></path></svg><div class="gmSH_title" style="color: #00aced">Twitter</div>';
k.getElementsByTagName("svg")[0].style.fill="#00aced";h.appendChild(k);h.addEventListener("mouseup",f,!1);m()&&h.addEventListener("touchend",f,!1);g.appendChild(h);h=document.createElement("div");h.setAttribute("type","pinterest");h.className="gmItemShareButtonWrap";k=document.createElement("div");k.className="gmItemShareButton";k.innerHTML='<svg version="1.1" viewBox="0 0 32 32" width="32" height="32" aria-hidden="false"><path d="M16 3c-7.2 0-13 5.8-13 13 0 5.5 3.4 10.2 8.3 12.1-.1-1-.2-2.6 0-3.7.2-1 1.5-6.5 1.5-6.5s-.4-.8-.4-1.9c0-1.8 1-3.2 2.4-3.2 1.1 0 1.6.8 1.6 1.8 0 1.1-.7 2.8-1.1 4.3-.3 1.3.6 2.3 1.9 2.3 2.3 0 4.1-2.4 4.1-6 0-3.1-2.2-5.3-5.4-5.3-3.7 0-5.9 2.8-5.9 5.6 0 1.1.4 2.3 1 3 .1.1.1.2.1.4-.1.4-.3 1.3-.4 1.5-.1.2-.2.3-.4.2-1.6-.8-2.6-3.1-2.6-5 0-4.1 3-7.9 8.6-7.9 4.5 0 8 3.2 8 7.5 0 4.5-2.8 8.1-6.7 8.1-1.3 0-2.6-.7-3-1.5 0 0-.7 2.5-.8 3.1-.3 1.1-1.1 2.5-1.6 3.4 1.2.4 2.5.6 3.8.6 7.2 0 13-5.8 13-13 0-7.1-5.8-12.9-13-12.9z"></path></svg><div class="gmSH_title" style="color: #cc2127">Pinterest</div>';
k.getElementsByTagName("svg")[0].style.fill="#cc2127";h.appendChild(k);h.addEventListener("mouseup",f,!1);m()&&h.addEventListener("touchend",f,!1);g.appendChild(h);h=document.createElement("div");h.setAttribute("type","google");h.className="gmItemShareButtonWrap";k=document.createElement("div");k.className="gmItemShareButton";k.innerHTML='<svg enable-background="new 0 0 56.693 56.693" height="56.693px" id="Layer_1" version="1.1" viewBox="0 0 56.693 56.693" width="56.693px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g><path d="M52.218,25.852h-7.512v-7.51c0-0.573-0.465-1.039-1.037-1.039H41.53c-0.576,0-1.041,0.466-1.041,1.039v7.51h-7.512   c-0.572,0-1.039,0.467-1.039,1.041v2.139c0,0.574,0.467,1.039,1.039,1.039h7.512v7.514c0,0.574,0.465,1.039,1.041,1.039h2.139   c0.572,0,1.037-0.465,1.037-1.039V30.07h7.512c0.572,0,1.039-0.465,1.039-1.039v-2.139C53.257,26.318,52.79,25.852,52.218,25.852z"/><path d="M26.974,32.438c-1.58-1.119-3.016-2.76-3.041-3.264c0-0.918,0.082-1.357,2.141-2.961c2.662-2.084,4.128-4.824,4.128-7.719   c0-2.625-0.802-4.957-2.167-6.595h1.059c0.219,0,0.434-0.068,0.609-0.196l2.955-2.141c0.367-0.263,0.521-0.732,0.381-1.161   c-0.141-0.428-0.537-0.72-0.988-0.72H18.835c-1.446,0-2.915,0.255-4.357,0.751c-4.816,1.661-8.184,5.765-8.184,9.978   c0,5.969,4.624,10.493,10.805,10.635c-0.121,0.473-0.182,0.939-0.182,1.396c0,0.92,0.233,1.791,0.713,2.633c-0.056,0-0.11,0-0.17,0   c-5.892,0-11.21,2.891-13.229,7.193c-0.526,1.119-0.794,2.25-0.794,3.367c0,1.086,0.279,2.131,0.826,3.113   c1.269,2.27,3.994,4.031,7.677,4.961c1.901,0.48,3.944,0.725,6.065,0.725c1.906,0,3.723-0.246,5.403-0.732   c5.238-1.521,8.625-5.377,8.625-9.828C32.032,37.602,30.659,35.045,26.974,32.438z M10.283,42.215c0-3.107,3.947-5.832,8.446-5.832   h0.121c0.979,0.012,1.934,0.156,2.834,0.432c0.309,0.213,0.607,0.416,0.893,0.611c2.084,1.42,3.461,2.357,3.844,3.861   c0.09,0.379,0.135,0.758,0.135,1.125c0,3.869-2.885,5.83-8.578,5.83C13.663,48.242,10.283,45.596,10.283,42.215z M14.377,12.858   c0.703-0.803,1.624-1.227,2.658-1.227l0.117,0.002c2.921,0.086,5.716,3.341,6.23,7.256c0.289,2.192-0.199,4.253-1.301,5.509   c-0.705,0.805-1.613,1.229-2.689,1.229c0,0,0,0-0.002,0h-0.047c-2.861-0.088-5.716-3.467-6.227-7.377   C12.829,16.064,13.289,14.099,14.377,12.858z"/></g></svg><div class="gmSH_title" style="color: #d64a2d">Google+</div>';
k.getElementsByTagName("svg")[0].style.fill="#d64a2d";h.appendChild(k);h.addEventListener("mouseup",f,!1);m()&&h.addEventListener("touchend",f,!1);g.appendChild(h);h=document.createElement("div");h.setAttribute("type","copy");h.className="gmItemShareButtonWrap";h.style.width="100%";k=document.createElement("div");k.className="gmItemCopyLink";k.innerHTML='<svg height="1792" viewBox="0 0 1792 1792" width="1792" xmlns="http://www.w3.org/2000/svg"><path d="M1520 1216q0-40-28-68l-208-208q-28-28-68-28-42 0-72 32 3 3 19 18.5t21.5 21.5 15 19 13 25.5 3.5 27.5q0 40-28 68t-68 28q-15 0-27.5-3.5t-25.5-13-19-15-21.5-21.5-18.5-19q-33 31-33 73 0 40 28 68l206 207q27 27 68 27 40 0 68-26l147-146q28-28 28-67zm-703-705q0-40-28-68l-206-207q-28-28-68-28-39 0-68 27l-147 146q-28 28-28 67 0 40 28 68l208 208q27 27 68 27 42 0 72-31-3-3-19-18.5t-21.5-21.5-15-19-13-25.5-3.5-27.5q0-40 28-68t68-28q15 0 27.5 3.5t25.5 13 19 15 21.5 21.5 18.5 19q33-31 33-73zm895 705q0 120-85 203l-147 146q-83 83-203 83-121 0-204-85l-206-207q-83-83-83-203 0-123 88-209l-88-88q-86 88-208 88-120 0-204-84l-208-208q-84-84-84-204t85-203l147-146q83-83 203-83 121 0 204 85l206 207q83 83 83 203 0 123-88 209l88 88q86-88 208-88 120 0 204 84l208 208q84 84 84 204z"/></svg><div id="gmSH_title_copy" class="gmSH_title" style="color: #7d7d7d">'+
e+"</div>";k.getElementsByTagName("svg")[0].style.fill="#7d7d7d";h.appendChild(k);h.addEventListener("mouseup",f,!1);m()&&h.addEventListener("touchend",f,!1);g.appendChild(h);a.appendChild(g);return a}function V(a){var b=this;this.type=void 0;this.delegate=a;this.appName=a.appName;this.view=document.createElement("div");this.view.className="gmediaAlbumsGridModal";this.closeButton=document.createElement("div");this.closeButton.style.position="absolute";this.closeButton.style.zIndex=-100;this.closeButton.className=
"gmModalCloseButton";this.closeButton.style.width="100%";this.closeButton.style.height="100%";this.closeButton.style.backgroundColor=l(c(this.appName).modaBgColor,1);this.closeButton.style.willChange="opacity";this.closeButton.style.opacity=c(this.appName).modalBgAlpha;this.closeButton.addEventListener("click",function(a){b.prepareToRemove(a)},!1);this.view.appendChild(this.closeButton);a=document.createElement("div");a.className="gmflexe";this.view.appendChild(a);this.scrollView=void 0;this.dragging=
!1;this._scrollViewTranslateY=0;this.startDragHandler=void 0;this.viewCompleted=!1;this.addToStage()}function ba(a){function b(a){switch(a.type){case "mouseenter":d.selector.style.opacity="1";break;case "mouseleave":d._selected||(d.selector.style.opacity="0")}}var d=this;this.delegate=a;this.appName=a.appName;this.item=void 0;this.view=document.createElement("div");this.view.className="gmediaAlbumsGridScrollBarItem";y&&this.view.classList.add("miniScreen");this.bgImg=document.createElement("div");
this.bgImg.className="gmediaAlbumsGridScrollBarItemBg";this.view.appendChild(this.bgImg);this.imgSRC=void 0;this.selector=document.createElement("div");this.selector.className="gmediaAlbumsGridScrollBarItemHover";this.selector.style.borderColor=c(this.appName).sliderThumbBarHoverColor;this.view.appendChild(this.selector);this._selected=!1;this.view.addEventListener("mouseenter",b,!1);this.view.addEventListener("mouseleave",b,!1)}function ca(a){this.delegate=a;this.appName=a.appName;this.view=document.createElement("div");
this.view.className="gmediaAlbumsGridTermScrollBarWrap";y&&this.view.classList.add("miniScreen");this.scrollView=document.createElement("div");this.scrollView.className="gmediaAlbumsGridScrollView";this.scrollView.style.width="0px";this.view.appendChild(this.scrollView);this.thumbsList=[];this._scrollWidth=0;this.dragging=this.viewCompleted=!1;this.scrollViewTranslateX=0;this.activAudioIndex=this.activIndex=this.startDragHandler=void 0}function da(a){var b=this;this.item=void 0;this.delegate=a;this.appName=
a.appName;this.view=document.createElement("div");this.view.className="gmediaAlbumsGridItemPage";this.audioCover=void 0;this.maxScale=2;this.size=new r(0,0);this.imgSize=new r(0,0);this.maxYoffset=this.maxXoffset=this.height=this.width=0;this._fitMode=!0;this._scale=1;this.startDistForZoom=this.focusGlobalPoint=this.startGlobalPoint=this.startScale=this.newScaleMW=this.newScale=this.fitScale=void 0;this.newPosition=new q(0,0);this._imageTranslate=new q(0,0);this.startTranslate=new q(0,0);this.isBlockDragingMem=
this.isBlockDraging=this.draging=this.zooming=!1;this.animaSliderRender=void 0;this.newY=this.oldY=this.newX=this.oldX=this.speedY=this.speedX=0;this.itemImgComplete=!1;this.itemImg=new Image;this.itemImg.style.maxWidth="none";this.itemImg.style.setProperty("max-width","none","!important");this.itemImg.style.transformOrigin="0 0";this.itemImg.style.opacity=0;this.itemImg.onload=function(a){b.thumbLoad(a)};this.view.appendChild(this.itemImg)}function ea(a){this.delegate=a;this.appName=a.appName;this.pageNum=
void 0;this.view=document.createElement("div");this.view.className="gmediaAlbumsGridSliderPage";this.preloader=H(c(this.appName).sliderPreloaderColor)}function fa(a){this.delegate=a;this.appName=this.delegate.appName;this.id=this.appName+"sliderAView_";this.itemsList=void 0;this.visibleBounds=new J(0,0,0,0);this.needHideControlls=this.isControllsShow=!1;this.firsrTap=void 0;this.view=document.createElement("div");this.view.className="gmediaAlbumsGridColectionSlider";I.desktop||(this.view.style.height=
"100%");this.view.id=this.id+"main";this.resizeDelay=void 0;a=document.createElement("div");a.className="gmSliderBg";a.style.backgroundColor=l(c(this.appName).sliderBgColor,1);this.background=a;this.view.appendChild(a);this.sliderPages=[];this.zoomingDrag=this.dragging=!1;this._scrollViewTranslateY=this._scrollViewTranslateX=this.speedY=this.speedX=0;this.currentPageIndex=this.startDragHandler=void 0;this.startItemIndex=0;this.items=[];this.pageAmount=0;this.pages=[];this.zoomingPageNum=this.animaSliderRender=
this._pageNum=void 0;this.slider=document.createElement("div");this.slider.className="gmediaAlbumsGridSlidesWrap";this.view.appendChild(this.slider);this.footer=document.createElement("div");this.footer.className="gmediaAlbumsGridSliderFooter";this.footer.style.backgroundImage="linear-gradient(180deg,"+l(c(this.appName).sliderBgColor,0)+","+l(c(this.appName).sliderBgColor,1)+")";this.view.appendChild(this.footer);this.header=document.createElement("div");this.header.className="gmediaAlbumsGridSliderHeader";
this.header.style.backgroundImage="linear-gradient(0deg,"+l(c(this.appName).sliderBgColor,0)+","+l(c(this.appName).sliderBgColor,1)+")";y&&this.header.classList.add("gmediaAlbumsGridSliderHeaderMiniScreen");this.view.appendChild(this.header);this.createControlls();this.addToStage()}function O(a,b,d){function e(a){"like"==a.getAttribute("type")&&a.getAttribute("like")||("bookmark"==a.getAttribute("type")&&a.getAttribute("bookmark")?a.style.backgroundColor=h.backgroundColor:(a.style.backgroundColor=
h.backgroundColor,a.childNodes[0].style.fill=h.iconColor))}function f(a){"bookmark"==a.getAttribute("type")&&a.getAttribute("bookmark")?a.style.backgroundColor=h.backgroundColorOver:(a.style.backgroundColor=h.backgroundColorOver,a.childNodes[0].style.fill=h.iconColorOver)}function g(a){var b=this;if("click"==a.type){m()&&(f(b),setTimeout(function(){e(b)},200));var d=h.item;if(d)switch(a=void 0,this.getAttribute("type")){case "info":c(h.appName).appEventManager.dispatchGMEvent(new p(t.NEED_MODAL,h,
{type:"info",item:d}));break;case "link":d.link&&window.open(d.link,c(h.appName).linkTargetWindow);break;case "like":e(this);h.delegate.likeItem=h.item;this.setAttribute("like",h.item.ID);this.style.cursor="default";this.style.pointerEvents="none";this.getElementsByTagName("svg")[0].style.fill="red";break;case "share":c(h.appName).appEventManager.dispatchGMEvent(new p(t.NEED_MODAL,h,{type:"share",item:d}));break;case "download":a=d.url;d=document.createElement("A");d.href=a;d.download=a.substr(a.lastIndexOf("/")+
1);document.body.appendChild(d);d.click();document.body.removeChild(d);break;case "coments":a=d.sharelink+"/#comments",window.open(a,c(h.appName).linkTargetWindow)}}else"mouseenter"==a.type?f(this):"mouseleave"==a.type&&e(this)}var h=this;this.delegate=a;this.appName=a.appName;this.item=void 0;this.view=document.createElement("div");this.view.className="gmediaAlbumsGridItemInfoMenu";this.backgroundColor=b.backgroundColor;this.backgroundColorOver=b.backgroundColorOver;this.iconColor=b.iconColor;this.iconColorOver=
b.iconColorOver;a=void 0;a=document.createElement("div");a.className="itemsButtons";d&&a.classList.add("lightbox");a.setAttribute("type","link");a.innerHTML='<svg height="1792" viewBox="0 0 1792 1792" width="1792" xmlns="http://www.w3.org/2000/svg"><path d="M1520 1216q0-40-28-68l-208-208q-28-28-68-28-42 0-72 32 3 3 19 18.5t21.5 21.5 15 19 13 25.5 3.5 27.5q0 40-28 68t-68 28q-15 0-27.5-3.5t-25.5-13-19-15-21.5-21.5-18.5-19q-33 31-33 73 0 40 28 68l206 207q27 27 68 27 40 0 68-26l147-146q28-28 28-67zm-703-705q0-40-28-68l-206-207q-28-28-68-28-39 0-68 27l-147 146q-28 28-28 67 0 40 28 68l208 208q27 27 68 27 42 0 72-31-3-3-19-18.5t-21.5-21.5-15-19-13-25.5-3.5-27.5q0-40 28-68t68-28q15 0 27.5 3.5t25.5 13 19 15 21.5 21.5 18.5 19q33-31 33-73zm895 705q0 120-85 203l-147 146q-83 83-203 83-121 0-204-85l-206-207q-83-83-83-203 0-123 88-209l-88-88q-86 88-208 88-120 0-204-84l-208-208q-84-84-84-204t85-203l147-146q83-83 203-83 121 0 204 85l206 207q83 83 83 203 0 123-88 209l88 88q86-88 208-88 120 0 204 84l208 208q84 84 84 204z"/></svg>';
a.style.backgroundColor=this.backgroundColor;a.childNodes[0].style.fill=this.iconColor;this.linkButton=a;a.addEventListener("click",g,!1);a.addEventListener("mouseenter",g,!1);a.addEventListener("mouseleave",g,!1);this.view.appendChild(a);if(!d&&c(this.appName).collectionInfoEnable||d&&c(this.appName).sliderInfoEnable)a=document.createElement("div"),a.className="itemsButtons",d&&a.classList.add("lightbox"),a.setAttribute("type","info"),a.innerHTML='<svg height="100px" id="Capa_1" style="enable-background:new 0 0 46 100;" version="1.1" viewBox="0 0 46 100" width="46px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g><path d="M35.162,0c6.696,0,10.043,4.567,10.043,9.789c0,6.522-5.814,12.555-13.391,12.555c-6.344,0-10.045-3.752-9.869-9.947   C21.945,7.176,26.35,0,35.162,0z M14.543,100c-5.287,0-9.164-3.262-5.463-17.615l6.07-25.457c1.057-4.077,1.23-5.707,0-5.707   c-1.588,0-8.451,2.816-12.51,5.59L0,52.406C12.863,41.48,27.662,35.072,34.004,35.072c5.285,0,6.168,6.361,3.525,16.148   L30.58,77.98c-1.234,4.729-0.703,6.359,0.527,6.359c1.586,0,6.787-1.963,11.896-6.041L46,82.377C33.488,95.1,19.83,100,14.543,100z   "/></g><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/></svg>',
a.style.backgroundColor=this.backgroundColor,a.childNodes[0].style.fill=this.iconColor,this.infoButton=a,a.addEventListener("click",g,!1),a.addEventListener("mouseenter",g,!1),a.addEventListener("mouseleave",g,!1),this.view.appendChild(a);if(!d&&c(this.appName).collectionItemDiscuss||d&&c(this.appName).sliderItemDiscuss)a=document.createElement("div"),a.className="itemsButtons",d&&a.classList.add("lightbox"),a.setAttribute("type","coments"),a.innerHTML='<svg style="enable-background:new 0 0 24 24;" version="1.1" viewBox="0 0 24 24" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="info"/><g id="icons"><path d="M20,1H4C1.8,1,0,2.8,0,5v10c0,2.2,1.8,4,4,4v3c0,0.9,1.1,1.3,1.7,0.7L9.4,19H20c2.2,0,4-1.8,4-4V5   C24,2.8,22.2,1,20,1z M14,13H8c-0.6,0-1-0.4-1-1c0-0.6,0.4-1,1-1h6c0.6,0,1,0.4,1,1C15,12.6,14.6,13,14,13z M16,9H8   C7.4,9,7,8.6,7,8c0-0.6,0.4-1,1-1h8c0.6,0,1,0.4,1,1C17,8.6,16.6,9,16,9z" id="message"/></g></svg>',
a.style.backgroundColor=this.backgroundColor,a.childNodes[0].style.fill=this.iconColor,this.commentsButton=a,a.addEventListener("click",g,!1),a.addEventListener("mouseenter",g,!1),a.addEventListener("mouseleave",g,!1),this.view.appendChild(a);if(!d&&c(this.appName).collectionItemDownload||d&&c(this.appName).sliderItemDownload)a=document.createElement("div"),a.className="itemsButtons",d&&a.classList.add("lightbox"),a.setAttribute("type","download"),a.innerHTML='<svg version="1.1" viewBox="0 0 24 24" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="info"/><g id="icons"><g id="save"><path d="M11.2,16.6c0.4,0.5,1.2,0.5,1.6,0l6-6.3C19.3,9.8,18.8,9,18,9h-4c0,0,0.2-4.6,0-7c-0.1-1.1-0.9-2-2-2c-1.1,0-1.9,0.9-2,2    c-0.2,2.3,0,7,0,7H6c-0.8,0-1.3,0.8-0.8,1.4L11.2,16.6z"/><path d="M19,19H5c-1.1,0-2,0.9-2,2v0c0,0.6,0.4,1,1,1h16c0.6,0,1-0.4,1-1v0C21,19.9,20.1,19,19,19z"/></g></g></svg>',
a.style.backgroundColor=this.backgroundColor,a.childNodes[0].style.fill=this.iconColor,this.downloadButton=a,a.addEventListener("click",g,!1),a.addEventListener("mouseenter",g,!1),a.addEventListener("mouseleave",g,!1),this.view.appendChild(a);if(!d&&c(this.appName).collectionSocialShareEnabled||d&&c(this.appName).sliderSocialShareEnabled)a=document.createElement("div"),a.className="itemsButtons",d&&a.classList.add("lightbox"),a.setAttribute("type","share"),a.innerHTML='<svg height="1792" viewBox="0 0 1792 1792" width="1792" xmlns="http://www.w3.org/2000/svg"><path d="M1344 1024q133 0 226.5 93.5t93.5 226.5-93.5 226.5-226.5 93.5-226.5-93.5-93.5-226.5q0-12 2-34l-360-180q-92 86-218 86-133 0-226.5-93.5t-93.5-226.5 93.5-226.5 226.5-93.5q126 0 218 86l360-180q-2-22-2-34 0-133 93.5-226.5t226.5-93.5 226.5 93.5 93.5 226.5-93.5 226.5-226.5 93.5q-126 0-218-86l-360 180q2 22 2 34t-2 34l360 180q92-86 218-86z"/></svg>',
a.style.backgroundColor=this.backgroundColor,a.childNodes[0].style.fill=this.iconColor,this.shareButton=a,a.addEventListener("click",g,!1),a.addEventListener("mouseenter",g,!1),a.addEventListener("mouseleave",g,!1),this.view.appendChild(a);if(!d&&c(this.appName).collectionLikesEnabled||d&&c(this.appName).sliderLikesEnabled)a=document.createElement("div"),a.className="itemsButtons",d&&a.classList.add("lightbox"),a.setAttribute("type","like"),a.innerHTML='<svg enable-background="new 0 0 51 46" height="46px" id="Layer_1" version="1.1" viewBox="0 0 51 46" width="51px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M46.188,4.101c-5.529-5.53-14.495-5.53-20.023,0L25.39,4.875l-0.996-0.774c-5.529-5.53-14.715-5.53-20.245,0  C-1.38,9.63-1.27,18.595,4.26,24.125l18.753,18.643c0.671,0.671,1.4,1.258,2.376,1.766c0.76-0.508,1.483-1.095,2.155-1.766  l18.643-18.643C51.717,18.595,51.717,9.63,46.188,4.101z""/></svg>',
a.style.backgroundColor=this.backgroundColor,a.childNodes[0].style.fill=this.iconColor,this.likeButton=a,a.addEventListener("click",g,!1),a.addEventListener("mouseenter",g,!1),a.addEventListener("mouseleave",g,!1),this.view.appendChild(a)}function G(a,b,d){this.delegate=a;this.query=d;this.appName=a.appName;this.query.per_page=c(this.appName).pagination?c(this.appName).imagesPperPage:0;this.query.page=1;this.properties=void 0;this.itemsList=[];this.filteredList=[];this.terms=[];this.term=void 0;this.lastPageItems=
[];this.tagsCloud=c(this.appName).tagsFilter?{0:"All"}:void 0;this._filter=0;this.activate()}function ha(a,b){this.delegate=a;this.appName=a.appName;this.index=b;this.view=document.createElement("div");this.view.className="gmediaAlbumsGrid_JustifiedCollection_Item";this.space=c(this.appName).thumbSpacing/2+"px";this.view.style.padding=this.space;this.view.style.fontSize=c(this.appName).collectionThumbFontSize+"px";this.view.style.color=c(this.appName).collectionThumbTitleColor;this._heightForCollection=
this._widthForCollection=0;this.rect=new J(0,0,0,0)}function P(a,b,d){G.apply(this,arguments);this.view=document.createElement("div");this.view.className="gmediaAlbumsGrid_JustifiedCollection";this.header=document.createElement("div");this.content=document.createElement("div");this.footer=document.createElement("div");this.header.className="header";this.header.style.padding=c(b).thumbSpacing+"px";this.content.className="content";this.content.style.margin=c(b).thumbSpacing/2+"px 0";this.footer.className=
"footer";this.view.appendChild(this.header);this.view.appendChild(this.content);this.view.appendChild(this.footer);this.resizeTimeOut=void 0;var e={};e.backgroundColor=c(this.appName).collectionThumbSubMenuBackgroundColor;e.backgroundColorOver=c(this.appName).collectionThumbSubMenuBackgroundColorOver;e.iconColor=c(this.appName).collectionThumbSubMenuIconColor;e.iconColorOver=c(this.appName).collectionThumbSubMenuIconHoverColor;this.itemMenu=new O(this.delegate,e)}function ia(a,b){this.delegate=a;
this.appName=a.appName;this.index=b;this.view=document.createElement("div");this.view.className="gmediaAlbumsGridCollection_Item";this.space=c(this.appName).thumbSpacing+"px";this.view.style.padding=this.space;this.view.style.fontSize=c(this.appName).collectionThumbFontSize+"px";this.view.style.color=c(this.appName).collectionThumbTitleColor;this._heightForCollection=this._widthForCollection=0;this.rect=new J(0,0,0,0)}function ja(a,b){var d=this;this.delegate=a;this.term=b;this.appName=this.delegate.appName;
this.id=b.term_id+"_"+this.appName+"collectionView_";this.view=document.createElement("div");this.view.className="gmediaAlbumsGridColection";I.desktop&&(this.view.style.minHeight="100vh");this.view.id=this.id+"main";this.resizeTimeOut=void 0;this.view.style.backgroundColor="white";this.itemsList=[];this.tagsCloud=void 0;this.thumbsList=[];this.columnsArr=[];this.touchendHandler=this.scrollHandler=void 0;this.isShowFixedHeder=!1;this.fixedHeader=void 0;a=document.createElement("div");a.className="gmCollectionBg";
this.background=a;this.background.style.backgroundColor=c(this.appName).collectionBgColor;this.background.addEventListener("click",function(){d.prepareToRemove()},!1);this.view.appendChild(a);this.scrollViewHeight=0;this.scrollView=document.createElement("div");this.scrollView.className="gmCollectionScrollView";a={};a.backgroundColor=c(this.appName).collectionThumbSubMenuBackgroundColor;a.backgroundColorOver=c(this.appName).collectionThumbSubMenuBackgroundColorOver;a.iconColor=c(this.appName).collectionThumbSubMenuIconColor;
a.iconColorOver=c(this.appName).collectionThumbSubMenuIconHoverColor;this.itemMenu=new O(this.delegate,a);this.itemLeave=void 0;this.addToStage()}function ka(a){this.termData=a;this.thumb=void 0;this.appName=this.termData.appName;a=this.termData.taxonomy;"gmedia_album"==a&&(a="albums");"gmedia_category"==a&&(a="categories");"gmedia_tag"==a&&(a="tags");this.taxonomy=a}function la(a,b){this.delegate=b;this.termData=a;this.appName=this.termData.appName;a.meta&&a.meta._cover&&(this.data=a.meta._cover);
a=this.termData.taxonomy;"gmedia_album"==a&&(a="albums");"gmedia_category"==a&&(a="categories");"gmedia_tag"==a&&(a="tags");this.taxonomy=a;this.index=null;this.identifier=void 0;this.thumbMatrix=new K(1,0,0,1,0,0);this.thumbnailOpacity=1;this.thumbnailSize=new r(0,0);this.itemViewMatrix=new K(1,0,0,1,0,0);this.itemOpacity=1;this.itemSize=new r(0,0);this.thumbImgSize=new r(0,0);this.backTitle=this.backDescription=this.coverTitle=void 0}function ma(a){this.delegate=a;this.appName=a.appName;this.id=
a.appName+"_module_view";this.div=document.createElement("div");this.div.className="gmediaAlbumsGrid_Collection";this.div.id=this.id;this._maxZindex=this.viewWidth=0;this.selectedThumbView=this.overThumbView=void 0;this.collectionBoxs=[];this.gmediaTemplate=void 0;a=document.getElementsByTagName("body")[0];for(var b=0;b<a.classList.length;b++)"gmedia-template"==a.classList[b]&&(this.gmediaTemplate=!0,b=a.classList.length)}function Q(a,b){L(a,this);this.appName=b;this.idPrefix=void 0}function C(a,
b){L(a,this);this.appName=b;this.collectionName=this.key=this.listIndex=void 0;this.meta&&(this.meta=new na(this.meta,this.appName));"myCollection"==this.taxonomy&&this._query&&(this.sharelink=c(b).post_url+"/?"+c(b).galleryID+"[gmedia__in]="+this._query.gmedia__in);"gmedia__in"==this.taxonomy&&this._query&&(this.sharelink=c(b).post_url+"/?"+c(b).galleryID+"[gmedia__in]="+this._query.gmedia__in)}function na(a,b){L(a,this);this.appName=b;this._cover&&(this._cover=new Q(a._cover,this.appName))}function oa(a,
b,d){L(a,this);if(this.appApi&&(this.appName=b,a=this.settings,c(this.appName).appApi=this.appApi,c(this.appName).post_url=a.post_url,c(this.appName).galleryID="gm"+d.getAttribute("data-gmid"),c(this.appName).appEventManager=new v,this.appDiv=d,this.audioPlayer=void 0,c(this.appName).openCollectionInNewPage="1"==a.openCollectionInNewPage?!0:!1,c(this.appName).openGalleryAsItemsList="1"==a.openGalleryAsItemsList?!0:!1,c(this.appName).splashPreloaderColor="#"+a.splashPreloaderColor,c(this.appName).activColor=
"#"+a.activColor,c(this.appName).reverseColor="#"+a.reverseColor,c(this.appName).hoverColor="#"+a.hoverColor,this.appDiv.style.paddingTop=this.appDiv.style.paddingBottom=parseInt(a.gallertMargin)+"px",c(this.appName).linkTargetWindow=a.linkTargetWindow,c(this.appName).columns=parseInt(a.columns),c(this.appName).spaceX=c(this.appName).spaceY=parseInt(a.spaceX),c(this.appName).thumbRecomendedSize=parseInt(a.thumbRecomendedSize),c(this.appName).coverThumbRatio=parseFloat(a.coverThumbRatio),c(this.appName).coverTitleShow=
"1"==a.coverTitleShow?!0:!1,c(this.appName).coverCounerShow="1"==a.coverCounerShow?!0:!1,c(this.appName).flipEffect="1"==a.flipEffect?!0:!1,c(this.appName).coverTitleFontSizeRatio=parseInt(a.coverTitleFontSizeRatio)/100,c(this.appName).coverTitleBgColor="#"+a.coverTitleBgColor,c(this.appName).coverTitleBgAlpha=parseInt(a.coverTitleBgAlpha)/100,c(this.appName).coverTitleTextColor="#"+a.coverTitleTextColor,c(this.appName).descriptionBgColor="#"+a.descriptionBgColor,c(this.appName).descriptionImgAlpha=
parseInt(a.descriptionImgAlpha)/100,c(this.appName).coverDescriptionTextColor="#"+a.coverDescriptionTextColor,c(this.appName).tagsFilter=!1,c(this.appName).lightBoxEnable="1"==a.lightBoxEnable?!0:!1,c(this.appName).collectionPreloaderColor="#"+a.collectionPreloaderColor,c(this.appName).collectionBgColor="#"+a.collectionBgColor,c(this.appName).collectionHeaderBgColor="#"+a.collectionHeaderBgColor,c(this.appName).collectionTitleColor=c(this.appName).collectionHeaderTextColor="#"+a.collectionHeaderTextColor,
c(this.appName).collectionHeaderControllIconColor="#"+a.collectionHeaderControllIconColor,c(this.appName).collectionHeaderControllBgColor="#"+a.collectionHeaderControllBgColor,c(this.appName).collectionShareButtons="1"==a.collectionShareButtons?!0:!1,c(this.appName).collectionDescription="1"==a.collectionDescription?!0:!1,c(this.appName).collectionThumbRecomendedHeight=parseInt(a.collectionThumbRecomendedHeight),c(this.appName).thumbSpacing=parseInt(a.collectionThumbInPadding),c(this.appName).collectionThumbHoverColor=
l("#"+a.collectionthumbHoverBgColor,parseInt(a.collectionthumbHoverBgAlpha)/100),c(this.appName).collectionThumbTitleShow="1"==a.collectionThumbTitleShow?!0:!1,c(this.appName).collectionThumbTitleColor="#"+a.collectionThumbTitleColor,c(this.appName).collectionThumbFontSize=parseInt(a.collectionThumbFontSize),c(this.appName).collectionInfoEnable="1"==a.collectionInfoEnable?!0:!1,c(this.appName).collectionItemDownload="1"==a.collectionItemDownload?!0:!1,c(this.appName).collectionItemDiscuss="1"==a.collectionItemDiscuss?
!0:!1,c(this.appName).collectionSocialShareEnabled="1"==a.collectionSocialShareEnabled?!0:!1,c(this.appName).collectionLikesEnabled="1"==a.collectionLikesEnabled?!0:!1,c(this.appName).collectionThumbSubMenuBackgroundColor=l("#000000",0),c(this.appName).collectionThumbSubMenuBackgroundColorOver="#"+a.collectionThumbSubMenuBackgroundColorOver,c(this.appName).collectionThumbSubMenuIconColor="#"+a.collectionThumbSubMenuIconColor,c(this.appName).collectionThumbSubMenuIconHoverColor="#"+a.collectionThumbSubMenuIconHoverColor,
c(this.appName).modaBgColor="#"+a.modaBgColor,c(this.appName).modalBgAlpha=parseInt(a.modalBgAlpha)/100,c(this.appName).modalInfoBoxBgColor="#"+a.modalInfoBoxBgColor,c(this.appName).modalInfoBoxBgAlpha=1,c(this.appName).modalInfoBoxTextColor="#"+a.modalInfoBoxTextColor,c(this.appName).modalInfoBoxTitleTextColor="#"+a.modalInfoBoxTitleTextColor,c(this.appName).infoBarExifEnable="1"==a.infoBarExifEnable?!0:!1,c(this.appName).infoBarCountersEnable="1"==a.infoBarCountersEnable?!0:!1,c(this.appName).infoBarDateInfoEnable=
"1"==a.infoBarDateInfoEnable?!0:!1,c(this.appName).sliderPreloaderColor="#"+a.sliderPreloaderColor,c(this.appName).sliderBgColor="#"+a.sliderBgColor,c(this.appName).sliderNavigationColor="#"+a.sliderNavigationColor,c(this.appName).sliderNavigationColorOpacity=1,c(this.appName).sliderNavigationIconColor="#"+a.sliderNavigationIconColor,c(this.appName).sliderItemTitleFontSize=parseInt(a.sliderItemTitleFontSize),c(this.appName).sliderItemTitleTextColor="#"+a.sliderItemTitleTextColor,c(this.appName).sliderThumbBarEnable=
"1"==a.sliderThumbBarEnable?!0:!1,c(this.appName).sliderThumbBarHoverColor="#"+a.sliderThumbBarHoverColor,c(this.appName).sliderThumbSubMenuBackgroundColor="#"+a.sliderThumbSubMenuBackgroundColor,c(this.appName).sliderThumbSubMenuBackgroundColorOver="#"+a.sliderThumbSubMenuBackgroundColorOver,c(this.appName).sliderThumbSubMenuIconColor="#"+a.sliderThumbSubMenuIconColor,c(this.appName).sliderThumbSubMenuIconHoverColor="#"+a.sliderThumbSubMenuIconHoverColor,c(this.appName).sliderInfoEnable="1"==a.sliderInfoEnable?
!0:!1,c(this.appName).sliderItemDownload="1"==a.sliderItemDownload?!0:!1,c(this.appName).sliderItemDiscuss="1"==a.sliderItemDiscuss?!0:!1,c(this.appName).sliderSocialShareEnabled="1"==a.sliderSocialShareEnabled?!0:!1,c(this.appName).sliderLikesEnabled="1"==a.sliderLikesEnabled?!0:!1,c(this.appName).filterTag=!1,c(this.appName).pagination=!1,c(this.appName).pagination_button_text="Load more",c(this.appName).imagesPperPage=10,c(this.appName).customCSS=a.customCSS,c(b))){this.appDiv.style.position="relative";
this.appDivWidth=this.appDiv.clientWidth;var e=this;window.addEventListener("resize",function(){e.windowResizeHandler(e)});this.terms={};this.collections={};this.collectionIndex=0;this.slider=this.cureantCollection=void 0;this.currentLocation=[];this.viewsSet={};this.likesSet={};window.localStorage.getItem("gm_likesSet")&&(this.likesSet=JSON.parse(window.localStorage.getItem("gm_likesSet")));this.appQuery&&(c(this.appName).appEventManager.addGMEventListener(t.NEED_NEW_COLLECTION,this,"addCollectioByTerm"),
c(this.appName).appEventManager.addGMEventListener(t.NEED_MODAL,this,"createModal"),c(this.appName).lightBoxEnable&&c(this.appName).appEventManager.addGMEventListener(t.NEED_LIGHTBOX,this,"createLightbox"),this.createTermsList(this.appQuery),this.createAudioPlayer())}}var N=!1,y=!1,t={REQUEST_START:"REQUEST_START",TERMS_DATA_REDY:"TERMS_DATA_REDY",COLLECTION_DATA_REDY:"COLLECTION_DATA_REDY",COUNTERS_UPDATED:"COUNTERS_UPDATED",NEED_MODAL:"NEED_MODAL",NEED_LIGHTBOX:"NEED_LIGHTBOX",NEED_NEW_COLLECTION:"NEED_NEW_COLLECTION",
NEED_PREV_COLLECTION:"NEED_PREV_COLLECTION"};v.prototype={addGMEventListener:function(a,b,d){this._listenerSet[a]||(this._listenerSet[a]=[]);this._listenerSet[a].push({listener:b,handler:d})},removeGMEventListener:function(a,b,d){if(this._listenerSet[a])for(var e=0;e<this._listenerSet[a].length;e++)this._listenerSet[a][e].listener==b&&this._listenerSet[a][e].handler==d&&(this._listenerSet[a].splice(e,1),e=this._listenerSet[a].length)},dispatchGMEvent:function(a){if(this._listenerSet[a.type])for(var b=
this._listenerSet[a.type],d=0;d<b.length;d++){var e=b[d];if(e&&e.listener&&"function"==typeof e.listener[e.handler])e.listener[e.handler](a)}}};var A=z()?{passive:!1,capture:!1}:!1,B=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame,w=window.cancelAnimationFrame||window.mozCancelAnimationFrame,I=function(){var a=window,b=a.navigator.userAgent,d={ios:!1,android:!1,androidChrome:!1,desktop:!1,windows:!1,iphone:!1,ipod:!1,
ipad:!1,cordova:a.cordova||a.phonegap,phonegap:a.cordova||a.phonegap},e=b.match(/(Windows Phone);?[\s\/]+([\d.]+)?/),c=b.match(/(Android);?[\s\/]+([\d.]+)?/),g=b.match(/(iPad).*OS\s([\d_]+)/),h=b.match(/(iPod)(.*OS\s([\d_]+))?/),n=!g&&b.match(/(iPhone\sOS|iOS)\s([\d_]+)/);e&&(d.os="windows",d.osVersion=e[2],d.windows=!0);c&&!e&&(d.os="android",d.osVersion=c[2],d.android=!0,d.androidChrome=0<=b.toLowerCase().indexOf("chrome"));if(g||n||h)d.os="ios",d.ios=!0;n&&!h&&(d.osVersion=n[2].replace(/_/g,"."),
d.iphone=!0);g&&(d.osVersion=g[2].replace(/_/g,"."),d.ipad=!0);h&&(d.osVersion=h[3]?h[3].replace(/_/g,"."):null,d.iphone=!0);d.ios&&d.osVersion&&0<=b.indexOf("Version/")&&"10"===d.osVersion.split(".")[0]&&(d.osVersion=b.toLowerCase().split("version/")[1].split(" ")[0]);d.desktop=!(d.os||d.android||d.webView);d.webView=(n||g||h)&&b.match(/.*AppleWebKit(?!.*Safari)/i);d.os&&"ios"===d.os&&(b=d.osVersion.split("."),e=document.querySelector('meta[name="viewport"]'),d.minimalUi=!d.webView&&(h||n)&&(7===1*b[0]?1<=1*b[1]:7<1*b[0])&&e&&0<=e.getAttribute("content").indexOf("minimal-ui"));d.pixelRatio=a.devicePixelRatio||1;return d}(),R=0;K.prototype={toString:function(){return"matrix("+this.scaleX+","+this.skewY+","+this.skewX+","+this.scaleY+","+this.translateX+","+this.translateY+")"}};T.prototype={toString:function(){return"translate3d("+this.x+"px,"+this.y+"px,"+this.z+"px)"}};V.prototype={addToStage:function(){var a=this,b=document.getElementsByTagName("body")[0];document.getElementsByTagName("html");
this.view.style.zIndex=S(b)+1;X();b.appendChild(this.view);setTimeout(function(){a.view.style.opacity="1"},30);document.addEventListener("keydown",a.keydownHandler(),!1)},prepareToRemove:function(a){var b=this;document.removeEventListener("keydown",this.handlerKB,!1);b.view.style.opacity="0";this.delegate.slider||Y();setTimeout(function(){b.view&&b.view.parentNode&&b.view.parentNode.removeChild(b.view);delete b.view;b.delegate.deleteModal()},400)},keydownHandler:function(a){var b=this;b.handlerKB=
function(a){switch(a.keyCode){case 27:b.prepareToRemove()}};return b.handlerKB},pushPage:function(a){this.viewCompleted=!1;this.scrollView&&this.scrollView.parentNode&&this.scrollView.parentNode.removeChild(this.scrollView);this.view.appendChild(a);this.scrollView=a;this.updateControlls()},updateControlls:function(){if(this.scrollView&&!this.viewCompleted){this.startDragHandler=this.startDrag();if(m()){var a=z()?{passive:!1,capture:!1}:!1;this.scrollView.addEventListener("touchstart",this.startDragHandler,
a)}this.scrollView.addEventListener("mousedown",this.startDragHandler,!1);this.viewCompleted=!0}},get bottom(){return this.view.clientHeight-this.scrollView.clientHeight-20},set scrollViewTranslateY(a){this._scrollViewTranslateY=a;this.scrollView.style.transform="translateY("+a+"px)";a=Math.max(c(this.appName).modalBgAlpha-Math.abs(a/200),0);this.closeButton.style.opacity=a},get scrollViewTranslateY(){return this._scrollViewTranslateY},startDrag:function(){function a(){n=0<e.scrollViewTranslateY?
.2*n+.1*(0-e.scrollViewTranslateY):e.scrollViewTranslateY<e.bottom?.2*n+.1*(e.bottom-e.scrollViewTranslateY):.95*n;e.scrollViewTranslateY+=n;.04>Math.abs(n)?w(x):x=B(a)}function b(a){a.preventDefault();a=a.touches&&a.touches[0]?a.touches[0].pageY:a.pageY;e.dragging=!0;e.scrollViewTranslateY=h-(c-a);k=l;l=e.scrollViewTranslateY;n=l-k}function d(c){c.preventDefault();e.scrollView.style.transition="none";m()&&(document.removeEventListener("touchmove",b,g),document.removeEventListener("touchend",d,g),
document.removeEventListener("touchcancel",d,!1));document.removeEventListener("mousemove",b,!1);document.removeEventListener("mouseup",d,!1);document.removeEventListener("oncontextmenu",d,!1);if(0>=e.bottom){if(e.scrollViewTranslateY<e.bottom-50||50<e.scrollViewTranslateY){e.prepareToRemove();e.dragging=!1;return}}else if(-50>e.scrollViewTranslateY||50<e.scrollViewTranslateY){e.prepareToRemove();e.dragging=!1;return}(0!=n||0<e.scrollViewTranslateY||e.scrollViewTranslateY<e.bottom)&&e.dragging&&(x=
B(a));e.dragging=!1}var e=this,c=void 0,g=z()?{passive:!1,capture:!1}:!1,h=0,n=0,k=0,l=0,x=void 0;return function(a){a?(m()||a.preventDefault(),a.button&&0!==a.button||(n=0,l=e.scrollViewTranslateY,c=a.touches&&a.touches[0]?a.touches[0].pageY:a.pageY,h=e.scrollViewTranslateY,w(x),m()&&(document.addEventListener("touchmove",b,g),document.addEventListener("touchend",d,g),document.addEventListener("touchcancel",d,!1)),document.addEventListener("mousemove",b,!1),document.addEventListener("mouseup",d,
!1),document.addEventListener("oncontextmenu",d,!1))):(n=0,h=e.scrollViewTranslateY,w(x))}}};ba.prototype={initByItem:function(a){this.imgSRC==a.itemViewThumbSrc?this.delegate.itemsLoaderHandler(this.view.clientWidth):(this.item=a,this.imgSRC=a.itemViewThumbSrc,this.bgImg.style.backgroundImage="url("+this.imgSRC+")",this.delegate.itemsLoaderHandler(this.view.clientWidth),this.type=u(this.item.mime_type),"audio"==this.type&&(this.hover=document.createElement("div"),this.hover.className="gmediaAlbumsGridScrollBarItemLink",
this.hover.style.backgroundColor=l("#ffffff",.6),this.hover.innerHTML='<svg version="1.1" viewBox="0 0 58 94" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g><path d="M37.992,0h-8.021v65.358c-4.435-1.706-10.174-1.73-15.835,0.328C3.994,69.377-2.049,78.355,0.638,85.736   c2.688,7.383,13.088,10.374,23.229,6.683c8.614-3.134,14.249-10.082,14.111-16.626l0.014-53.451   c13.986,2.204,14.943,19.884,13.268,24.842c-0.636,1.879,0.484,3.286,2.598,0C68.938,23.726,37.992,13.376,37.992,0z"/></g><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/></svg>',
this.view.appendChild(this.hover)))},set musicIdentifireStatus(a){if("audio"==this.type)switch(a){case "play":this.hover.classList.add("rotate");break;case "durationchange":this.hover.classList.add("rotate");break;case "ended":this.hover.classList.remove("rotate");break;case "pause":this.hover.classList.remove("rotate")}},select:function(a){this.selector.style.opacity=a?"1":"0";this._selected=a}};ca.prototype={initItemsList:function(a){function b(a){"touchend"!=a.type&&"mouseup"!=a.type||d.dragging||
(d.delegate.gotoPageByNum(parseInt(this.getAttribute("gmIndex"))),d.startDragHandler&&d.startDragHandler())}var d=this;this.prepare();for(var e=0;e<a.length;e++){var c=new ba(this);this.thumbsList.push(c);m()&&c.view.addEventListener("touchend",b,!1);c.view.addEventListener("mouseup",b,!1);this.scrollView.appendChild(c.view);c.initByItem(a[e]);c.view.setAttribute("gmIndex",e)}},changeAudioStatusForIndex:function(a,b){!this.activAudioIndex&&0!==this.activAudioIndex||a==this.activAudioIndex||(this.thumbsList[this.activAudioIndex].musicIdentifireStatus=
"ended");this.thumbsList[a].musicIdentifireStatus=b.type;this.activAudioIndex=a},itemsLoaderHandler:function(a){this._scrollWidth+=a;this.scrollView.style.width=this._scrollWidth+5+"px";this.updateView()},prepare:function(){this._scrollWidth=0;this.scrollView.style.transform="translateX(0px)";this.scrollView.style.width="0px";this._scrollViewTranslateX=0},resize:function(){this.updateView()},selectThumbByIndex:function(a){var b;(this.activIndex||0===this.activIndex)&&(b=this.thumbsList[this.activIndex])&&
b.select(!1);if(b=this.thumbsList[a]){b.select(!0);var d=b.view.clientWidth*a,e=d+this.scrollViewTranslateX,c=e+b.view.clientWidth;this.scrollView.style.transition="none";if(0>e||0>c)this.scrollView.style.transition="transform .4s",this.scrollViewTranslateX=-d;if(e>this.view.clientWidth||c>this.view.clientWidth)this.scrollView.style.transition="transform .4s",this.scrollViewTranslateX=this.view.clientWidth-b.view.clientWidth-d;this._scrollWidth>this.view.clientWidth&&(this.scrollViewTranslateX=Math.max(this.scrollViewTranslateX,
-(this._scrollWidth-this.view.clientWidth)))}this.activIndex=a},updateView:function(){this.selectThumbByIndex(this.activIndex);1>this.view.clientWidth/this._scrollWidth?this.viewCompleted||(this.scrollView.classList.add("gm_grabbable"),this.startDragHandler=this.startDrag(),m()&&this.scrollView.addEventListener("touchstart",this.startDragHandler,A),this.scrollView.addEventListener("mousedown",this.startDragHandler,!1),this.viewCompleted=!0):(this.scrollView.classList.remove("gm_grabbable"),this.scrollViewTranslateX=
0,this.viewCompleted&&(m()&&this.scrollView.removeEventListener("touchstart",this.startDragHandler,A),this.scrollView.removeEventListener("mousedown",this.startDragHandler,!1),this.viewCompleted=!1))},set scrollViewTranslateX(a){this._scrollViewTranslateX=a;this.scrollView.style.transform="translateX("+a+"px)"},get scrollViewTranslateX(){return this._scrollViewTranslateX},startDrag:function(a){function b(){return-(g._scrollWidth-g.view.clientWidth+g.view.getBoundingClientRect().left)}function d(){k=
0<g.scrollViewTranslateX?.2*k+.1*(0-g.scrollViewTranslateX):g.scrollViewTranslateX<b()?.2*k+.1*(b()-g.scrollViewTranslateX):.95*k;g.scrollViewTranslateX+=k;.04>Math.abs(k)?w(p):p=B(d)}function e(a){a.preventDefault();if(a=h-(a.touches&&a.touches[0]?a.touches[0].pageX:a.pageX))g.dragging=!0;g.scrollViewTranslateX=n-a;l=x;x=g.scrollViewTranslateX;k=x-l}function c(a){a.preventDefault();g.scrollView.style.transition=null;m()&&(document.removeEventListener("touchmove",e,A),document.removeEventListener("touchend",
c,A),document.removeEventListener("touchcancel",c,!1));document.removeEventListener("mousemove",e,!1);document.removeEventListener("mouseup",c,!1);document.removeEventListener("oncontextmenu",c,!1);if(0!=k||0<g.scrollViewTranslateX||g.scrollViewTranslateX<b())p=B(d);g.dragging=!1}var g=this,h=void 0,n=void 0,k=0,l=0,x=0,p=void 0;return function(a){a?(m()||a.preventDefault(),a.button&&0!==a.button||(k=0,x=g.scrollViewTranslateX,h=a.touches&&a.touches[0]?a.touches[0].pageX:a.pageX,n=g.scrollViewTranslateX,
w(p),m()&&(document.addEventListener("touchmove",e,A),document.addEventListener("touchend",c,A),document.addEventListener("touchcancel",c,!1)),document.addEventListener("mousemove",e,!1),document.addEventListener("mouseup",c,!1),document.addEventListener("oncontextmenu",c,!1))):(k=0,n=g.scrollViewTranslateX,w(p))}}};da.prototype={initByItem:function(a){this.item=a;this.type=u(this.item.mime_type);this.audioRedy=!1;"audio"==this.type&&(this.playerControls=this.createAudioPlaterControls())},tryToShow:function(){if(this.itemImgComplete)this.resize();
else if("audio"==this.type){this.size=new r(this.view.clientWidth,this.view.clientHeight);var a=new r(300,300),b=new r(this.view.clientWidth,this.view.clientHeight);this.itemImg.style.transformOrigin="center center";this.itemImg.classList.add("gmpAudioCoverContainerAlbumsGrid");this.itemImg.setAttribute("src",this.item.itemViewThumbSrc);this.itemImg.style.top=(b.height-a.height)/2+"px";this.itemImg.style.left=(b.width-a.width)/2+"px";this.itemImg.style.width=a.width+"px";this.itemImg.style.height=
a.height+"px"}else this.item.itemViewSrc&&this.itemImg.setAttribute("src",this.item.itemViewSrc)},thumbLoad:function(a){this.view.parentNode&&(a=this.view.parentNode.getElementsByClassName("gmediaAlbumsGridPreloader")[0])&&this.view.parentNode.removeChild(a);this.imgSize=new r(this.itemImg.naturalWidth,this.itemImg.naturalHeight);this.resize();this.itemImg.style.opacity="1";this.itemImgComplete=!0;this.showAudioPlayerControls()},resize:function(){if(this.size.width!=this.view.clientWidth||this.size.height!=this.view.clientHeight)if("audio"!=this.type)this.fit();else{this.size=new r(this.view.clientWidth,this.view.clientHeight);var a=new r(300,300);this.itemImg.style.top=(this.size.height-a.height)/2+"px";this.itemImg.style.left=(this.size.width-a.width)/2+"px"}},set scale(a){"audio"!=this.type&&(this.width=this.imgSize.width*a,this.height=this.imgSize.height*a,this.maxXoffset=this.width>this.size.width?(this.width-this.size.width)/2:0,this.maxYoffset=this.height>this.size.height?(this.height-this.size.height)/
2:0,this._scale=a)},get scale(){return this._scale},fit:function(a){if("audio"!=this.type){var b=0;this.size=new r(this.view.clientWidth,this.view.clientHeight);700<this.view.clientHeight&&(b=100);var d=Z(this.imgSize,new r(this.size.width-4,this.size.height-2*b),!1,!1);this.fitScale=this.newScale=this.newScaleMW=d.height/this.imgSize.height;this.newPosition=new q(d.x+2,d.y+b);a?this.renderTransformTo(this.newPosition,this.newScale):(w(this.animaSliderRender),this.scale=this.newScale,this.imageTranslate=
this.newPosition);this._fitMode=!0;this.isBlockDraging=this.draging=!1}},zoomByScaleIter:function(a,b){"audio"!=this.type&&(w(this.animaSliderRender),this.zooming=!0,this.newScaleMW+=a,this.newScaleMW=Math.max(this.fitScale,this.newScaleMW),this.newScaleMW=Math.min(this.maxScale,this.newScaleMW),a=this.startGlobalPoint.x-(this.startGlobalPoint.x-this.origin.x)/this.startScale*this.newScaleMW,b=this.startGlobalPoint.y-(this.startGlobalPoint.y-this.origin.y)/this.startScale*this.newScaleMW,this.scale=
this.newScaleMW,this.imageTranslate=this.checkOffset(new q(a,b)),this._fitMode=!1,this.newScaleMW<=this.fitScale&&(this._fitMode=!0))},zoomByScaleDeltaToPoint:function(a,b,d){if("audio"!=this.type){w(this.animaSliderRender);this.zooming=!0;a=this.startDistForZoom/this.startScale*(a/this.startDistForZoom)/(this.startDistForZoom/this.startScale)*this.startScale;var e=0;a>this.maxScale&&(e=.8*-(a-this.maxScale));a+=e;e=this.startGlobalPoint.x-(this.startGlobalPoint.x-this.origin.x)/this.scale*a;var c=
this.startGlobalPoint.y-(this.startGlobalPoint.y-this.origin.y)/this.scale*a;this.origin=new q(e,c);this.focusGlobalPoint=d;this.scale=this.newScale=a;this.imageTranslate=new q(e-b.x,c-b.y);this._fitMode=!1}},zoomIn:function(a,b){if("audio"!=this.type)if(this.newScale==a&&this.newScaleMW==a)this.fit(!0);else{var d=b.x-(b.x-this.imageTranslate.x)/this.scale*a;b=b.y-(b.y-this.imageTranslate.y)/this.scale*a;this.newScale=this.newScaleMW=a;this.newPosition=this.checkOffset(new q(d,b),a);this.renderTransformTo(this.newPosition,
this.newScale);this._fitMode=!1}},is_zooming:function(){return!this._fitMode},is_pointInItem:function(a){return"audio"!=this.type&&this.itemImgComplete?a.x>this.itemImg.getBoundingClientRect().left&&a.x<this.itemImg.getBoundingClientRect().right&&a.y>this.itemImg.getBoundingClientRect().top&&a.y<this.itemImg.getBoundingClientRect().bottom?!0:!1:!1},checkOffset:function(a,b){if(b){var d=this.imgSize.width*b;b*=this.imgSize.height;var e=d>this.size.width?(d-this.size.width)/2:0;var c=b>this.size.height?
(b-this.size.height)/2:0}else d=this.width,b=this.height,e=this.maxXoffset,c=this.maxYoffset;var g=a.x+d/2-this.size.width/2;a=a.y+b/2-this.size.height/2;return new q(0==g?-(d-this.size.width)/2:-(d-this.size.width)/2+Math.min(Math.abs(g),e)*g/Math.abs(g),0==a?-(b-this.size.height)/2:-(b-this.size.height)/2+Math.min(Math.abs(a),c)*a/Math.abs(a))},set imageTranslate(a){this._imageTranslate=a;this.itemImg.style.transform="matrix("+this.scale+", 0, 0, "+this.scale+", "+a.x+", "+a.y+")"},get imageTranslate(){return this._imageTranslate},
get zoomBound(){return{lt:new q((this.size.width-this.width)/2-this.maxXoffset,(this.size.height-this.height)/2-this.maxYoffset),rb:new q((this.size.width-this.width)/2+this.maxXoffset,(this.size.height-this.height)/2+this.maxYoffset)}},renderTransformTo:function(a,b){function d(){c=.3*c+.15*(a.x-e.imageTranslate.x);g=.3*g+.15*(a.y-e.imageTranslate.y);b&&(h=.3*h+.15*(b-e.scale));var f=e.imageTranslate.x;f+=c;var k=e.imageTranslate.y;k+=g;b&&(e.scale+=h);e.imageTranslate=new q(f,k);.04>Math.abs(c)&&
.04>Math.abs(g)&&.04>Math.abs(h)?(w(e.animaSliderRender),e.itemImg.style.willChange="unset",b&&(e.scale=b),e.imageTranslate=new q(a.x,a.y)):e.animaSliderRender=B(d)}var e=this;w(e.animaSliderRender);var c=0,g=0,h=0;e.animaSliderRender=B(d)},renderGlidingTransform:function(){function a(){b.speedX*=d;b.speedY*=e;var g=b.imageTranslate.x;g+=b.speedX;var f=b.imageTranslate.y;f+=b.speedY;g<c.lt.x?(b.speedX*=-1,g=c.lt.x+b.speedX,d=.75):g>c.rb.x&&(b.speedX*=-1,g=c.rb.x+b.speedX,d=.75);f<c.lt.y?(b.speedY*=
-1,f=c.lt.y+b.speedY,e=.75):f>c.rb.y&&(b.speedY*=-1,f=c.rb.y+b.speedY,e=.75);b.imageTranslate=new q(g,f);.04>Math.abs(b.speedX)&&.04>Math.abs(b.speedY)?(w(b.animaSliderRender),b.speedX=0,b.speedY=0,b.itemImg.style.willChange="unset"):b.animaSliderRender=B(a)}var b=this;w(b.animaSliderRender);var d=.95,e=.95,c=this.zoomBound;b.animaSliderRender=B(a)},renderStretchstretchTransform:function(){function a(){c=.2*c+.15*(d.x-b.imageTranslate.x);f=.2*f+.15*(d.y-b.imageTranslate.y);b.imageTranslate=new q(b.imageTranslate.x+
c,b.imageTranslate.y+f);.04>Math.abs(c)&&.04>Math.abs(f)?(w(b.animaSliderRender),b.imageTranslate=d,b.itemImg.style.willChange="unset"):b.animaSliderRender=B(a)}var b=this;w(b.animaSliderRender);var d=this.checkOffset(new q(b.imageTranslate.x+b.speedX,b.imageTranslate.y+b.speedY)),c=0,f=0;b.animaSliderRender=B(a)},startDrag:function(a,b){"audio"!=this.type&&(this.itemImg.style.willChange="transform",this.isBlockDragingMem=this.isBlockDraging,this.startDistForZoom=b,this.startGlobalPoint=this.focusGlobalPoint=
a,this.startTranslate=this.origin=this.imageTranslate,this.speedY=this.speedX=0,this.newX=this.imageTranslate.x,this.newY=this.imageTranslate.y,this.startScale=this.scale)},stopDrag:function(){"audio"!=this.type&&(this.zooming&&(this.scale<this.fitScale?this.fit(!0):this.scale>this.maxScale?this.zoomIn(this.maxScale,this.focusGlobalPoint):this.renderStretchstretchTransform(),this.zooming=!1),this.draging&&(this.isBlockDraging?this.renderStretchstretchTransform():this.renderGlidingTransform(),this.draging=
!1))},dragin:function(a){if("audio"==this.type)return!1;var b=0<this.maxXoffset?this.startTranslate.x-a.x:this.startTranslate.x;a=0<this.maxYoffset?this.startTranslate.y-a.y:this.startTranslate.y;var d=a+this.height/2-this.size.height/2;this.isBlockDraging=Math.abs(b+this.width/2-this.size.width/2)>this.maxXoffset||Math.abs(d)>this.maxYoffset;d=this.checkOffset(new q(b,a));var c=a-d.y;b-=.7*(b-d.x);a-=.7*c;this.oldX=this.newX;this.newX=b;this.speedX=.7*(this.newX-this.oldX);this.oldY=this.newY;this.newY=
a;this.speedY=.7*(this.newY-this.oldY);this.imageTranslate=new q(b,a);return this.draging=!0},createAudioPlaterControls:function(){function a(a){a.preventDefault();a.stopPropagation();switch(a.type){case "mousedown":b.tryPlayOrPauseMp3();break;case "touchstart":b.tryPlayOrPauseMp3()}}if(!document.getElementById("gmAudioPlayer"))return null;var b=this,d=document.createElement("div");d.className="gmCircleAudioControllerAlbumsGridContainer";d.style.backgroundColor=l(c(this.appName).sliderNavigationColor,
c(this.appName).sliderNavigationColorOpacity);var e=document.createElement("div");e.className="gmBtHolderAlbumsGrid";e.style.position="absolute";e.style.transform="translate3d(0px,0px,0)";e.style.transition="transform 0.5s";d.appendChild(e);var f=document.createElement("span");f.className="gmCirclebButtonAudioPlayerAlbumsGrid";f.setAttribute("title","Play");f.innerHTML='<svg version="1.1" viewBox="0 0 50 60" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g><path d="M48.479,27.435L5.672,0.915C2.553-1.132,0,0.374,0,4.261v51.48c0,3.885,2.553,5.391,5.672,3.346l42.807-26.52   c0,0,1.521-1.07,1.521-2.566S48.479,27.435,48.479,27.435z"/></g><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/></svg>';
f.style.fill=l(c(this.appName).sliderNavigationIconColor,.8);e.appendChild(f);f=document.createElement("span");f.className="gmCirclebButtonAudioPlayerAlbumsGrid";f.setAttribute("title","Stop");f.innerHTML='<svg version="1.1" viewBox="0 0 53 70" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g><g><path d="M44,0c-4.972,0-9,1.529-9,6.5v57c0,4.971,4.028,6.5,9,6.5c4.971,0,9-1.529,9-6.5v-57C53,1.529,48.971,0,44,0z"/><path d="M9,0C4.028,0,0,1.529,0,6.5v57C0,68.471,4.028,70,9,70c4.971,0,9-1.529,9-6.5v-57C18,1.529,13.971,0,9,0z"/></g></g><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/></svg>';
f.style.fill=l(c(this.appName).sliderNavigationIconColor,.8);f.style.left="109px";e.appendChild(f);d.addEventListener("mousedown",a,!0);d.addEventListener("touchstart",a,!0);return d},showAudioPlayerControls:function(){if(this.playerControls&&this.playerControls){var a=document.getElementById("gmAudioPlayer");this.audioStatus=a.src==this.item.url?a.paused?"pause":"play":"pause";this.audioRedy||(this.view.appendChild(this.playerControls),this.audioRedy=!0)}},tryPlayOrPauseMp3:function(){if(document.getElementById("gmAudioPlayer")&&
"audio"==this.type){var a=document.getElementById("gmAudioPlayer");a.src==this.item.url?a.paused?a.play():a.pause():(a.src=this.item.url,a.play())}},audioHandler:function(a){switch(a.type){case "ended":this.audioStatus="pause";break;case "play":this.audioStatus="play";break;case "pause":this.audioStatus="pause"}},set audioStatus(a){var b=this.playerControls.getElementsByClassName("gmBtHolderAlbumsGrid")[0];switch(a){case "play":this.itemImg.classList.add("gmAlbusListRotate");b.style.transform=new T(-109,
0,0);break;case "pause":this.itemImg.classList.remove("gmAlbusListRotate"),b.style.transform=new T(0,0,0)}}};ea.prototype={initByPageNum:function(a){if(this.pageNum!=a){for(;this.view.hasChildNodes();)this.view.removeChild(this.view.lastChild);this.delegate.pages[a]?(this.delegate.pages[a].itemImgComplete||this.view.appendChild(this.preloader),this.view.appendChild(this.delegate.pages[a].view),this.delegate.pages[a].tryToShow(),this.pageNum=a,this.bj&&this.view.appendChild(this.bj)):this.pageNum=
void 0}},resize:function(){(this.pageNum||0===this.pageNum)&&this.delegate.pages[this.pageNum].resize()}};fa.prototype={addToStage:function(){var a=this,b=document.getElementsByTagName("body")[0];document.getElementsByTagName("html");this.view.style.zIndex=S(b)+1;X();b.appendChild(this.view);setTimeout(function(){a.view.classList.add("gmediaAlbumsGridColectionSliderActivate")},30)},initByList:function(a,b){if(a&&0<a.length){var d=this;this.currentPageIndex=b&&0!==b?0:void 0;this.startItemIndex=b?
b:0;this.itemsList=a;setTimeout(function(){d.createLayout()},400)}},deleteSlider:function(){this.view&&this.view.parentNode&&this.view.parentNode.removeChild(this.view);for(var a=0;a<this.pages.length;a++)delete this.pages[a];delete this.pages;delete this.view;this.delegate.removeLightbox()},prepareToRemove:function(){var a=this;window.removeEventListener("wheel",a.handlerMWheel,!1);document.removeEventListener("keydown",a.handlerKB,!0);Y();a.view.classList.remove("gmediaAlbumsGridColectionSliderActivate");
this.showPreloader(!1);this.delegate.itemsCountersUpdate();document.getElementById("gmAudioPlayer")&&document.getElementById("gmAudioPlayer").pause();y?this.deleteSlider():setTimeout(function(){a.deleteSlider()},400)},keydownHandler:function(a){var b=this;b.handlerKB=function(a){switch(a.keyCode){case 37:b.gotoPrev();break;case 39:b.gotoNext();break;case 27:if(b.delegate.modal){b.delegate.modal.prepareToRemove();break}b.prepareToRemove();break;case 32:if(b.delegate.modal)b.delegate.modal.prepareToRemove();
else return b.switchShowControlls(),b.needHideControlls=!b.isControllsShow,E(a),!1}};return b.handlerKB},showPreloader:function(a){var b=void 0;if(a)0<this.view.getElementsByClassName("gmediaAlbumsGridPreloader").length||(b=H(c(this.appName).sliderPreloaderColor),this.view.appendChild(b));else if(this.view.getElementsByClassName("gmediaAlbumsGridPreloader")[0]){var d=this;b=this.view.getElementsByClassName("gmediaAlbumsGridPreloader")[0];M(b,function(){d.view&&b.parentNode&&d.view.removeChild(b)},
500)}},createLayout:function(){var a=this,b=this.itemsList;if(b&&0<b.length)for(var d=0;d<b.length;d++){var c=new da(this);c.initByItem(b[d]);this.pages.push(c)}this.pageAmount=this.pages.length;y&&(this.slider.classList.add("miniScreen"),this.prevButton.classList.add("sliderNextPrevButtonsMiniScreen"),this.nextButton.classList.add("sliderNextPrevButtonsMiniScreen"));this.initSlider();this.thumbsBar&&(this.thumbsBar.initItemsList(b),this.thumbsBar.selectThumbByIndex(this.pageNum));700>a.view.clientHeight&&
this.slider.classList.add("miniScreen");m()||document.addEventListener("keydown",a.keydownHandler(),!0);window.addEventListener("wheel",a.mouseWheelHandler(),!1);setTimeout(function(){a.showControlls(!0)},500)},set pageNum(a){this._pageNum=a;this.updateControlls()},get pageNum(){return this._pageNum},initSlider:function(){var a;if(0==this.sliderPages.length)for(a=0;3>a;a++){var b=new ea(this);this.slider.appendChild(b.view);this.sliderPages.push(b)}var d=2<this.pageAmount?-100:0;for(a=0;3>a;a++)b=
this.sliderPages[a],b.view.style.left=d+"%",b.pageNum=void 0,d+=100;this.startDragHandler?this.gotoPageByNum(0):(this.startDragHandler=this.startDrag(),this.slider.addEventListener("touchstart",this.startDragHandler,A),this.slider.addEventListener("mousedown",this.startDragHandler,!1),this.gotoPageByNum(this.startItemIndex))},set scrollViewTranslateY(a){this._scrollViewTranslateY=a;this.slider.style.transform="translateY("+a+"px) translateX("+this.scrollViewTranslateX+"px)";0!=a&&this.sliderVerticalRender()},
get scrollViewTranslateY(){return this._scrollViewTranslateY},set scrollViewTranslateX(a){this._scrollViewTranslateX=a;this.slider.style.transform="translateY("+this.scrollViewTranslateY+"px) translateX("+a+"px)";this.pageRenderByIndex(-Math.round(a/this.view.clientWidth))},get scrollViewTranslateX(){return this._scrollViewTranslateX},sliderVerticalRender:function(){var a=1-Math.abs(this.scrollViewTranslateY)/(this.view.clientHeight/2);this.background.style.opacity=a;this.needHideControlls||(.8>a?
this.showControlls(!1):this.showControlls(!0))},gotoPageByNum:function(a){!this.pageNum&&0!==this.pageNum||!this.currentPageIndex?this.gotoPageByIndex(a,!0):this.gotoPageByIndex(this.currentPageIndex-(this.pageNum-a))},gotoNext:function(){this.gotoPageByIndex(this.currentPageIndex+1)},gotoPrev:function(){this.gotoPageByIndex(this.currentPageIndex-1)},renderTransformTo:function(a){function b(){c=.2*c+.15*(a.x-d.scrollViewTranslateX);f=.2*f+.15*(a.y-d.scrollViewTranslateY);d.scrollViewTranslateX+=c;
d.scrollViewTranslateY+=f;1>Math.abs(c)&&1>Math.abs(f)&&(d.dragging=!1);.1>Math.abs(c)&&.1>Math.abs(f)?(w(d.animaSliderRender),d.scrollViewTranslateX=a.x,d.scrollViewTranslateY=a.y,d.sliderTransitionComplete({target:d.slider})):d.animaSliderRender=B(b)}var d=this;w(d.animaSliderRender);var c=5*d.speedX,f=5*d.speedY;d.animaSliderRender=B(b)},gotoPageByIndex:function(a,b){3>this.pageAmount&&(a=Math.max(0,a),a=Math.min(this.pageAmount-1,a));2<Math.abs(this.currentPageIndex-a)&&(b=!0);a=-a*this.view.clientWidth;
b?(this.scrollViewTranslateX=a,this.sliderTransitionComplete({target:this.slider})):this.renderTransformTo(new q(a,this.scrollViewTranslateY))},pageRenderByIndex:function(a){if(this.currentPageIndex!==a){var b;if(3>this.pageAmount){for(b=0;b<this.pageAmount;b++)this.sliderPages[b].initByPageNum(b);this.pageNum=this.currentPageIndex=a}else{var d=(a+1)%3;0>d&&(d+=3);var c=0<=d-1?d-1:2,f=3>d+1?d+1:0,g=[c,d,f],h=[100*a-100,100*a,100*a+100];for(b=0;b<g.length;b++)this.sliderPages[g[b]].view.style.left=
h[b]+"%";this.currentPageIndex=a;this.pageNum=0>a?this.pageAmount+(0==a%this.pageAmount?-this.pageAmount:a%this.pageAmount):a%this.pageAmount;this.sliderPages[d].initByPageNum(this.pageNum);this.sliderPages[f].initByPageNum(this.pageNum+1<this.pageAmount?this.pageNum+1:0);this.sliderPages[c].initByPageNum(0>this.pageNum-1?this.pageAmount-1:this.pageNum-1)}}},sliderTransitionComplete:function(a){a.target!=this.slider||0!==this.zoomingPageNum&&!this.zoomingPageNum||this.zoomingPageNum==this.pageNum||
(this.pages[this.zoomingPageNum].fit(),this.zoomingPageNum=void 0)},mouseWheelHandler:function(a){var b=this,d=0,c=0,f=void 0;b.handlerMWheel=function(a){a.stopPropagation();var e=new q(0,0);if("deltaX"in a)1===a.deltaMode?(e.x=18*a.deltaX,e.y=18*a.deltaY):(e.x=a.deltaX,e.y=a.deltaY);else if("wheelDelta"in a)a.wheelDeltaX&&(e.x=-.16*a.wheelDeltaX),e.y=a.wheelDeltaY?-.16*a.wheelDeltaY:-.16*a.wheelDelta;else if("detail"in a)e.y=a.detail;else return;var g=b.view.getBoundingClientRect().top-document.body.getBoundingClientRect().top,
k=b.view.getBoundingClientRect().left-document.body.getBoundingClientRect().left,l=b.view.clientWidth/2,m=b.view.clientHeight/2;a.pageX&&(l=a.pageX,m=a.pageY);l-=k;m-=g;if(b.pages[b.pageNum].is_pointInItem(new q(l,m))||!b.dragging){f||(b.needHideControlls=b.isControllsShow);!b.zoomingPageNum&&0!==b.zoomingPageNum||b.zoomingPageNum!=b.pageNum?(f=b.pages[b.pageNum],b.zoomingPageNum=b.pageNum):f=b.pages[b.pageNum];if(l!=d||m!=c)f.startDrag(new q(l,m)),d=l,c=m;f.zoomByScaleIter(e.y/-500);f.is_zooming()?
b.showControlls(!1):(b.showControlls(b.needHideControlls),f=void 0)}};return b.handlerMWheel},doubleClickController:function(a){if(!I.ios||"mouseup"!=a.type){var b=void 0,d=void 0;a.changedTouches&&a.changedTouches[0]?(b=a.changedTouches[0].pageX,d=a.changedTouches[0].pageY):(b=a.pageX,d=a.pageY);a=this.view.getBoundingClientRect().top-document.body.getBoundingClientRect().top;var c=this.view.getBoundingClientRect().left-document.body.getBoundingClientRect().left;b-=c;d-=a;var f=this.pages[this.pageNum].is_pointInItem(new q(b,
d)),g=this;this.firsrTap?(clearTimeout(this.firsrTap),this.firsrTap=void 0,f&&(this.pages[this.pageNum].zoomIn(1,new q(b,d)),(this.zoomingPageNum=this.pages[this.pageNum].is_zooming()?this.pageNum:void 0)||0===this.zoomingPageNum?(g.needHideControlls=g.isControllsShow,g.showControlls(!1)):g.showControlls(g.needHideControlls))):this.firsrTap=setTimeout(function(){g.firsrTap=void 0;f||y?g.zoomingPageNum||0===g.zoomingPageNum?(g.pages[g.zoomingPageNum].fit(!0),g.showControlls(g.needHideControlls)):(g.switchShowControlls(),
g.needHideControlls=!g.isControllsShow):g.prepareToRemove()},300)}},startDrag:function(a){function b(a){a.originalEvent&&(a=a.originalEvent);a.preventDefault();if(a.touches)if(!c.dragging&&1<a.touches.length){x=!0;var b=a.touches[0].pageX;var d=a.touches[0].pageY;var e=a.touches[1].pageX;a=a.touches[1].pageY;var f=Math.hypot(b-e,d-a);b+=(e-b)/2;d+=(a-d)/2}else x=!1,b=a.touches[0].pageX,d=a.touches[0].pageY;else b=a.pageX,d=a.pageY;b-=v;d-=t;if(!(I.ios&&20>=g))if(void 0===p&&(d===h?p=!1:(e=180*Math.atan2(Math.abs(d-
h),Math.abs(b-g))/Math.PI,p=45<e)),c.dragging||!c.zoomingPageNum&&0!==c.zoomingPageNum)if(p){u=0;if(b=4<Math.abs(h-d)?h-d:0)c.dragging=!0;c.scrollViewTranslateY=l-b}else{c.transition=!0;if(b=4<Math.abs(g-b)?g-b:0)c.dragging=!0;c.scrollViewTranslateX=n-b;z=y;y=c.scrollViewTranslateX;u=y-z}else{e=c.pages[c.zoomingPageNum];a=4<Math.abs(g-b)?g-b:0;var k=4<Math.abs(h-d)?h-d:0;if(a||k)c.zoomingDrag=!0;x?e.zoomByScaleDeltaToPoint(f,new q(a,k),new q(b,d)):e.dragin(new q(a,k))}}function d(a){a.preventDefault();
p=void 0;m()&&(document.removeEventListener("touchmove",b,A),document.removeEventListener("touchend",d,A));document.removeEventListener("mousemove",b,!1);document.removeEventListener("mouseup",d,!1);document.removeEventListener("oncontextmenu",d,!1);if(c.dragging||x||c.zoomingDrag){if(c.zoomingPageNum||0===c.zoomingPageNum)c.pages[c.zoomingPageNum].stopDrag(),x=!1;else if(4>Math.abs(c.scrollViewTranslateY)){a=c.currentPageIndex;var e=m()?7:3;Math.abs(u)>e&&f==c.currentPageIndex&&(a=0<u?a-1:a+1);c.speedX=
u;c.scrollViewTranslateY=0;c.gotoPageByIndex(a)}else.2<Math.abs(c.scrollViewTranslateY/(c.view.clientHeight/2))?c.prepareToRemove():c.renderTransformTo(new q(c.scrollViewTranslateX,0));this.dragging=!1}else c.doubleClickController(a);c.zoomingDrag=!1}var c=this,f=void 0,g=void 0,h=void 0,n=void 0,l=void 0,p=void 0,x=void 0,r=void 0,t=0,v=0,u=0,z=0,y=0;return function(a){t=c.view.getBoundingClientRect().top-document.body.getBoundingClientRect().top;v=c.view.getBoundingClientRect().left-document.body.getBoundingClientRect().left;
c.zoomingPageNum=c.pages[c.pageNum].is_zooming()?c.pageNum:void 0;w(c.animaSliderRender);f=c.currentPageIndex;a.preventDefault();a.originalEvent&&(a=a.originalEvent);if(!a.button||0===a.button){if(a.touches)if(!c.dragging&&1<a.touches.length){x=!0;var e=a.touches[0].pageX;var k=a.touches[0].pageY;var p=a.touches[1].pageX;a=a.touches[1].pageY;r=Math.hypot(e-p,k-a);e+=(p-e)/2;k+=(a-k)/2;c.zoomingPageNum=c.pageNum;c.needHideControlls=c.isControllsShow;c.showControlls(!1)}else e=a.touches[0].pageX,k=
a.touches[0].pageY;else e=a.pageX,k=a.pageY;e-=v;k-=t;z=u=c.speedX=c.speedY=0;y=c.scrollViewTranslateX;g=e;h=k;n=c.scrollViewTranslateX;l=c.scrollViewTranslateY;(c.zoomingPageNum||0===c.zoomingPageNum)&&c.pages[c.zoomingPageNum].startDrag(new q(g,h),r);m()&&(document.addEventListener("touchmove",b,A),document.addEventListener("touchend",d,A));document.addEventListener("mousemove",b,!1);document.addEventListener("mouseup",d,!1);document.addEventListener("oncontextmenu",d,!1)}}},audioPlayerHandler:function(a){this.pages[this.pageNum]&&
this.pages[this.pageNum].audioHandler(a);this.thumbsBar&&this.thumbsBar.changeAudioStatusForIndex(this.pageNum,a)},createControlls:function(){var a=this;this.prevButton=document.createElement("div");this.prevButton.className="sliderNextPrevButtons";this.prevButton.style.left="0px";this.prevButton.style.transform="translateX(-120%)";this.prevButton.style.backgroundColor=l(c(this.appName).sliderNavigationColor,c(this.appName).sliderNavigationColorOpacity);this.prevButton.style.visibility="hidden";this.prevButton.innerHTML=
'<svg height="128px" id="Layer_1" style="enable-background:new 0 0 128 128;" version="1.1" viewBox="0 0 128 128" width="128px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g><g><line style="stroke-width:12;stroke-linecap:square;stroke-miterlimit:10;" x1="57.12" x2="17.787" y1="103.334" y2="64"/><line style="stroke-width:12;stroke-linecap:square;stroke-miterlimit:10;" x1="17.787" x2="57.12" y1="64" y2="24.666"/></g><line style="stroke-width:12;stroke-miterlimit:10;" x1="17.787" x2="118.213" y1="64" y2="64"/></g></svg>';
this.prevButton.childNodes[0].style.stroke=l(c(this.appName).sliderNavigationIconColor,1);this.prevButton.onmouseover=function(){this.style.backgroundColor=l(c(a.appName).sliderNavigationIconColor,1);this.childNodes[0].style.stroke=l(c(a.appName).sliderNavigationColor,1)};this.prevButton.onmouseout=function(){this.style.backgroundColor=l(c(a.appName).sliderNavigationColor,1);this.childNodes[0].style.stroke=l(c(a.appName).sliderNavigationIconColor,1)};this.prevButton.onclick=function(){a.gotoPrev()};
this.view.appendChild(this.prevButton);this.nextButton=document.createElement("div");this.nextButton.className="sliderNextPrevButtons";this.nextButton.style.backgroundColor=l(c(this.appName).sliderNavigationColor,c(this.appName).sliderNavigationColorOpacity);this.nextButton.style.right="0px";this.nextButton.style.transform="translateX(120%)";this.nextButton.style.visibility="hidden";this.nextButton.innerHTML='<svg height="128px" id="Layer_1" style="enable-background:new 0 0 128 128;" version="1.1" viewBox="0 0 128 128" width="128px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g><g><line style="stroke-width:12;stroke-linecap:square;stroke-miterlimit:10;" x1="70.88" x2="110.213" y1="24.666" y2="64"/><line style="stroke-width:12;stroke-linecap:square;stroke-miterlimit:10;" x1="110.213" x2="70.88" y1="64" y2="103.334"/></g><line style="stroke-width:12;stroke-miterlimit:10;" x1="110.213" x2="9.787" y1="64" y2="64"/></g></svg>';
this.nextButton.childNodes[0].style.stroke=l(c(this.appName).sliderNavigationIconColor,1);this.nextButton.onmouseover=function(){this.style.backgroundColor=l(c(a.appName).sliderNavigationIconColor,1);this.childNodes[0].style.stroke=l(c(a.appName).sliderNavigationColor,1)};this.nextButton.onmouseout=function(){this.style.backgroundColor=l(c(a.appName).sliderNavigationColor,1);this.childNodes[0].style.stroke=l(c(a.appName).sliderNavigationIconColor,1)};this.nextButton.onclick=function(){a.gotoNext()};
this.view.appendChild(this.nextButton);c(this.appName).sliderThumbBarEnable&&(this.thumbsBar=new ca(this),this.footer.appendChild(this.thumbsBar.view));this.view.appendChild(this.footer);this.view.appendChild(this.header);this.infoBox1=document.createElement("div");this.infoBox1.className="gmInfoBox1";this.header.appendChild(this.infoBox1);var b={};b.backgroundColor=c(this.appName).sliderThumbSubMenuBackgroundColor;b.backgroundColorOver=c(this.appName).sliderThumbSubMenuBackgroundColorOver;b.iconColor=
c(this.appName).sliderThumbSubMenuIconColor;b.iconColorOver=c(this.appName).sliderThumbSubMenuIconHoverColor;this.itemMenu=new O(this.delegate,b,!0);this.buttonsBox=document.createElement("div");this.buttonsBox.className="gmInfoBox1";this.buttonsBox.style.float="right";this.buttonsBox.appendChild(this.itemMenu.view);this.header.appendChild(this.buttonsBox);y?(this.infoBox2=document.createElement("div"),this.infoBox2.className="gmInfoBox1",this.infoBox2.style.width="100%",this.footer.appendChild(this.infoBox2),
this.header.appendChild(this.buttonsBox),this.buttonsBox.style.float="none",this.infoBox1.style.float="none"):(button=document.createElement("div"),button.setAttribute("type","close"),button.className="sliderItemsButtons",button.innerHTML='<svg version="1.1" viewBox="0 0 512 512" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M437.5,386.6L306.9,256l130.6-130.6c14.1-14.1,14.1-36.8,0-50.9c-14.1-14.1-36.8-14.1-50.9,0L256,205.1L125.4,74.5  c-14.1-14.1-36.8-14.1-50.9,0c-14.1,14.1-14.1,36.8,0,50.9L205.1,256L74.5,386.6c-14.1,14.1-14.1,36.8,0,50.9  c14.1,14.1,36.8,14.1,50.9,0L256,306.9l130.6,130.6c14.1,14.1,36.8,14.1,50.9,0C451.5,423.4,451.5,400.6,437.5,386.6z"/></svg>',
button.style.backgroundColor=c(this.appName).sliderNavigationColor,button.childNodes[0].style.fill=c(this.appName).sliderNavigationIconColor,this.buttonsBox.appendChild(button),button.onmouseover=function(){this.style.backgroundColor=c(a.appName).sliderNavigationIconColor;this.childNodes[0].style.fill=c(a.appName).sliderNavigationColor},button.onmouseout=function(){this.style.backgroundColor=c(a.appName).sliderNavigationColor;this.childNodes[0].style.fill=c(a.appName).sliderNavigationIconColor},button.onclick=
function(){a.prepareToRemove()});this.titleItem=document.createElement("div");this.titleItem.className="gmediaAlbumsGridColectionSliderItemTitle";this.titleItem.style.fontSize=c(this.appName).sliderItemTitleFontSize+"px";this.titleItem.style.color=c(this.appName).sliderItemTitleTextColor;y&&(this.titleItem.classList.add("gmediaAlbumsGridColectionSliderItemTitleMiniScreen"),this.titleItem.style.fontSize="20px",this.titleItem.style.borderBottom="solid 1px "+l(c(this.appName).sliderNavigationColor,.3));
this.infoBox1.appendChild(this.titleItem);this.titleTerm=document.createElement("div");this.titleTerm.className="gmediaAlbumsGridColectionSliderItemTitle";this.titleTerm.style.fontSize=c(this.appName).sliderItemTitleFontSize/2+"px";this.titleTerm.style.color=l(c(this.appName).sliderItemTitleTextColor,.7);this.titleTerm.classList.add("gmediaAlbumsGridColectionSliderTermTitle");y?(this.titleTerm.classList.add("gmediaAlbumsGridColectionSliderTermTitleMiniScreen"),this.titleTerm.style.fontSize="15px",
this.infoBox2.appendChild(this.titleTerm)):(this.titleTerm.style.fontSize=c(this.appName).sliderItemTitleFontSize/2+"px",this.infoBox1.appendChild(this.titleTerm))},switchShowControlls:function(){this.showControlls(!this.isControllsShow)},showControlls:function(a,b){this.isControllsShow!=a&&(b?(this.header.classList.add("gmNoneTransition"),this.footer.classList.add("gmNoneTransition"),this.prevButton.classList.add("gmNoneTransition"),this.nextButton.classList.add("gmNoneTransition")):(this.header.classList.remove("gmNoneTransition"),
this.footer.classList.remove("gmNoneTransition"),this.prevButton.classList.remove("gmNoneTransition"),this.nextButton.classList.remove("gmNoneTransition")),a?(this.header.classList.add("gmediaAlbumsGridSliderHeaderActivate"),this.footer.classList.add("gmediaAlbumsGridSliderFooterActivate"),this.prevButton.style.transform="translateX(0%)",this.nextButton.style.transform="translateX(0%)"):(this.header.classList.remove("gmediaAlbumsGridSliderHeaderActivate"),this.footer.classList.remove("gmediaAlbumsGridSliderFooterActivate"),
this.prevButton.style.transform="translateX(-120%)",this.nextButton.style.transform="translateX(120%)"),this.isControllsShow=a)},updateControlls:function(){3>this.pageAmount?(this.prevButton.style.visibility=0==this.pageNum?"hidden":"visible",this.nextButton.style.visibility=this.pageNum==this.pageAmount-1?"hidden":"visible",1==this.pageAmount&&(this.prevButton.style.visibility="hidden",this.nextButton.style.visibility="hidden")):(this.prevButton.style.visibility="visible",this.nextButton.style.visibility=
"visible");this.pages[this.pageNum]&&this.pages[this.pageNum].showAudioPlayerControls();var a=this.itemsList[this.pageNum];a&&(this.delegate.updateItemLink(a),this.titleItem.innerHTML=a.title?a.title:"",this.titleTerm.innerHTML=this.pageNum+1+" / "+this.pageAmount,this.itemMenu&&this.itemMenu.updateForItem(a),this.thumbsBar&&this.thumbsBar.selectThumbByIndex(this.pageNum),this.delegate.modal&&("info"==this.delegate.modal.type?c(this.appName).appEventManager.dispatchGMEvent(new p(t.NEED_MODAL,this,
{type:"info",item:a})):this.delegate.modal.prepareToRemove()),this.delegate.viewItem=a)},resizeHandler:function(){var a=this;this.resizeDelay&&clearTimeout(this.resizeDelay);410>a.view.clientHeight&&(a.showControlls(!1,!0),a.needHideControlls=!0);this.resizeDelay=setTimeout(function(){for(var b=0;b<a.pages.length;b++)a.pages[b].resize();if(a.zoomingPageNum||0===a.zoomingPageNum)a.zoomingPageNum=a.pages[a.zoomingPageNum].is_zooming()?a.zoomingPageNum:void 0;a.gotoPageByIndex(a.currentPageIndex,!0);
a.thumbsBar&&a.thumbsBar.updateView()},200)}};O.prototype={updateForItem:function(a){this.item=a;this.delegate.likesSet&&this.likeButton&&(this.delegate.likesSet[a.ID]?(this.likeButton.getElementsByTagName("svg")[0].style.fill="red",this.likeButton.style.cursor="default",this.likeButton.style.pointerEvents="none",this.likeButton.setAttribute("like",a.ID)):(this.likeButton.childNodes[0].style.fill=this.iconColor,this.likeButton.style.cursor="pointer",this.likeButton.style.pointerEvents="all",this.likeButton.removeAttribute("like")));
a.link?(this.linkButton.style.display="block",this.linkButton.style.opacity="1",this.linkButton.style.cursor="pointer",this.linkButton.style.pointerEvents="all"):(this.linkButton.style.opacity="0",this.linkButton.style.display="none",this.linkButton.style.cursor="default",this.linkButton.style.pointerEvents="none")}};G.prototype={init:function(){this.startRequest();F(JSON.stringify({library:this.query}),this,t.COLLECTION_DATA_REDY)},activate:function(){c(this.appName).appEventManager.addGMEventListener(t.COLLECTION_DATA_REDY,
this,"dataLoaded")},deactivate:function(){c(this.appName).appEventManager.removeGMEventListener(t.COLLECTION_DATA_REDY,this,"dataLoaded")},dataLoaded:function(a){if(a=a.params.data)try{var b=JSON.parse(a);b.key&&""!=b.key?c(this.appName).key=b.key:(c(this.appName).tv=document.createElement("div"),c(this.appName).tv.style.position="absolute",c(this.appName).tv.style.height="24px",c(this.appName).tv.innerHTML='<a href="http://bit.ly/2snVAca" style="background-color: rgba(0, 0, 0, 0.8) !important;position: relative !important;left: auto!important;right: auto!important;top: auto!important;bottom: auto!important;width:auto!important;height:auto!important;text-indent:0!important;overflow:visible!important;display:block!important;padding: 4px 10px!important;margin:0 0 -3em 0!important;font-size:14px!important;line-height:120%!important;color:#FFFFFF!important;font-weight:bold!important;visibility:visible!important;opacity:1!important;pointer-events:auto!important;transform:none!important;">Trial version - Gmedia WP Plugin</a>');
a=[];if(b.properties){b.properties.category__in&&a.push(b.properties.category__in);b.properties.album__in&&a.push(b.properties.album__in);b.properties.tag__in&&a.push(b.properties.tag__in);if(1==a.length)for(key in a[0])this.terms.push(new C(a[0][key],this.appName)),this.term=new C(a[0][key],this.appName);else 0==a.length&&b.properties.request&&"s"==b.properties.request.taxonomy&&b.properties.request.term_id&&(this.term=new C({name:b.properties.request.term_id,taxonomy:"s",count:b.properties.count},
this.appName));this.createTermsCollectionAndUpdateProperties(b.properties)}b.data&&this.addItemsToCollection(b.data)}catch(d){U(d)}finally{}},createTermsCollectionAndUpdateProperties:function(a){this.properties||(this.properties={});for(var b in a)if("album__in"==b||"categoy__in"==b||"tag__in"==b){var c=this.properties,e=b,f=void 0,g=a[b],h={};for(f in g){var n=new C(g[f],this.appName);h[n.term_id]=n}c[e]=h}else this.properties[b]=a[b]},addItemsToCollection:function(a){this.lastPageItems=[];for(var b=
0;b<a.length;b++){var c=new Q(a[b],this.appName);c.index=this.itemsList.length+b;if(c.tags&&0<c.tags.length)for(var e=0;e<c.tags.length;e++){var f=c.tags[e];this.tagsCloud&&(this.tagsCloud[f.term_id]=f.name)}this.lastPageItems.push(c)}this.itemsList=this.itemsList.concat(this.lastPageItems)},set filtredById(a){if(this.itemsList&&(this.filteredList=[],this._filter=a,0!==a))for(var b=0;b<this.itemsList.length;b++){var c=this.itemsList[b];c.hasTag(a)&&this.filteredList.push(c)}},get filtredById(){return this._filter},
get filteredCollection(){return 0<this.filteredList.length?this.filteredList:this.itemsList}};ha.prototype={init:function(){var a=this.delegate.itemsList[this.index];this.item=a;this.type=u(a.mime_type);this.itemViewSrc=!1;this.img=new Image;var b=this;this.img.onload=function(){this.setAttribute("alt",a.title);1.1<b.view.clientWidth/this.naturalWidth&&a.itemViewSrc&&(this.src=a.itemViewSrc,b.itemViewSrc=!0);b.view.style.opacity=1};this.view.appendChild(this.img);this.img.src=a.itemViewThumbSrc;this.hover=
document.createElement("div");this.hover.className="gmediaAlbumsGrid_JustifiedCollection_Item_Hover";this.hover.style.backgroundColor=c(this.appName).collectionThumbHoverColor;this.hover.style.top=this.hover.style.bottom=this.hover.style.left=this.hover.style.right=this.space;this.view.appendChild(this.hover);this.inner=document.createElement("div");this.inner.className="gmediaAlbumsGrid_JustifiedCollection_Item_Inner";this.inner.style.top=this.inner.style.bottom=this.inner.style.left=this.inner.style.right=
this.space;this.view.appendChild(this.inner);c(this.appName).lightBoxEnable&&(this.inner.style.cursor="zoom-in",this.inner.addEventListener("click",function(a){"gmediaAlbumsGrid_JustifiedCollection_Item_Inner"==a.target.className&&c(b.appName).appEventManager.dispatchGMEvent(new p(t.NEED_LIGHTBOX,b,{collection:b.delegate,index:b.index}))}));this.menuHolder=document.createElement("div");this.menuHolder.className="gmediaAlbumsGrid_JustifiedCollection_Item_MenuHolder";this.inner.appendChild(this.menuHolder);
if(c(this.appName).collectionThumbTitleShow&&a.title&&0<a.title.length){var d=document.createElement("div");d.className="item_title";d.innerHTML=a.title;this.inner.appendChild(d)}var e=this.delegate.itemMenu;this.view.addEventListener("mouseenter",function(c){switch(c.type){case "mouseenter":e.updateForItem(a),b.menuHolder.appendChild(e.view)}},!1)},get ratio(){if(this.item.meta.web){var a=this.item.meta.web.width;var b=this.item.meta.web.height}else this.item.meta.thumb&&(a=this.item.meta.thumb.width,
b=this.item.meta.thumb.height);return(b?b:1)/(a?a:1)},thumbWidthByHeight:function(a){this.rect.width=a/this.ratio;return this.rect.width},thumbHeightByWidth:function(a){this.rect.height=a*this.ratio;return this.rect.height},set widthForCollection(a){this.rect.width=a},get widthForCollection(){return this.rect.width},set heightForCollection(a){this.rect.height=a},get width(){return this.rect.width},get height(){return this.rect.height},set x(a){this.rect.x=a;this.view.style.left=this.rect.x+"px"},
set y(a){this.rect.y=a;this.view.style.top=this.rect.y+"px"},get x(){return this.rect.x},get y(){return this.rect.y},updateSize:function(){this.view.style.width=this.rect.width.toFixed(2)+"px";this.view.style.height=this.rect.height.toFixed(2)+"px";!this.itemViewSrc&&1.1<this.view.clientWidth/this.img.naturalWidth&&this.item.itemViewSrc&&(this.img.src=this.item.itemViewSrc,this.itemViewSrc=!0)},set display(a){this.view.style.display=a},set opacity(a){var b=this;setTimeout(function(){b.view.style.opacity=
a},40)}};P.prototype=Object.create(G.prototype,{startRequest:{value:function(){this.showPreloader(!0)}},showPreloader:{value:function(a){var b=void 0;if(a)0<this.view.getElementsByClassName("gmediaAlbumsGridPreloader").length||(b=H(l(c(this.appName).collectionPreloaderColor,.7)),this.view.appendChild(b));else if(this.view.getElementsByClassName("gmediaAlbumsGridPreloader")[0]){var d=this;b=this.view.getElementsByClassName("gmediaAlbumsGridPreloader")[0];M(b,function(){d.view&&d.view.removeChild(b)},
500)}}},dataLoaded:{value:function(a){G.prototype.dataLoaded.apply(this,arguments);this.showPreloader(!1);if(this.properties){var b=this,d=void 0;if(this.terms&&0<this.terms.length){for(var e="",f=0;f<this.terms.length;f++)d=this.terms[f],0<f&&(e+=" &#183 "),e+=d.name;d=document.createElement("div");d.className="termTitle";d.style.color=c(this.appName).collectionTitleColor;d.innerHTML=e;this.header.appendChild(d);this.header.style.backgroundColor=c(this.appName).collectionHeaderBgColor}this.terms&&
1==this.terms.length&&(d=this.terms[0],c(this.appName).collectionDescription&&d.description&&(e=document.createElement("div"),e.className="termDescription",e.style.color=c(this.appName).collectionTitleColor,e.innerHTML=d.description,this.header.appendChild(e)),d.sharelink&&c(this.appName).collectionShareButtons&&(d=function(a){var d=this.getElementsByTagName("svg")[0];switch(a.type){case "click":c(b.appName).appEventManager.dispatchGMEvent(new p(t.NEED_MODAL,b,{type:"share",term:b.term}));break;case "mouseover":d.style.fill=
c(b.appName).collectionHeaderControllBgColor;this.style.backgroundColor=c(b.appName).collectionHeaderControllIconColor;break;case "mouseout":d.style.fill=c(b.appName).collectionHeaderControllIconColor,this.style.backgroundColor=c(b.appName).collectionHeaderControllBgColor}},e=document.createElement("div"),e.style.display="inline-block",e.style.verticalAlign="top",f=document.createElement("div"),f.className="centreCircleButton",f.setAttribute("title","Share"),f.innerHTML='<svg height="1792" viewBox="0 0 1792 1792" width="1792" xmlns="http://www.w3.org/2000/svg"><path d="M1344 1024q133 0 226.5 93.5t93.5 226.5-93.5 226.5-226.5 93.5-226.5-93.5-93.5-226.5q0-12 2-34l-360-180q-92 86-218 86-133 0-226.5-93.5t-93.5-226.5 93.5-226.5 226.5-93.5q126 0 218 86l360-180q-2-22-2-34 0-133 93.5-226.5t226.5-93.5 226.5 93.5 93.5 226.5-93.5 226.5-226.5 93.5q-126 0-218-86l-360 180q2 22 2 34t-2 34l360 180q92-86 218-86z"/></svg>',
f.style.fill=c(b.appName).collectionHeaderControllIconColor,f.style.backgroundColor=c(b.appName).collectionHeaderControllBgColor,f.addEventListener("click",d),f.addEventListener("mouseover",d),f.addEventListener("mouseout",d),e.appendChild(f),this.shareMenu=e,this.header.appendChild(this.shareMenu)));this.updateViewByData()}}},deactivate:{value:function(){G.prototype.deactivate.apply(this,arguments);if(this.itemsList&&0<this.itemsList.length)for(var a=0;a<this.itemsList.length;a++)this.itemsList[a].view.display=
"none",this.itemsList[a].view.opacity=0}},activate:{value:function(){G.prototype.activate.apply(this,arguments);if(this.filteredCollection&&0<this.filteredCollection.length){this.arrangeItems();for(var a=0;a<this.filteredCollection.length;a++){var b=this.filteredCollection[a].view;b.index=a;(function(a,b){setTimeout(function(){a.display="block";a.opacity="1"},100*b)})(b,a+1)}}}},updateViewByData:{value:function(){if(this.lastPageItems&&0<this.lastPageItems.length)for(var a=0;a<this.lastPageItems.length;a++){var b=
new ha(this,this.lastPageItems[a].index);this.lastPageItems[a].view=b;b.init()}c(this.appName).tagsFilter&&this.updateTagsCloud();this.arrangeItems();this.lastPageItems&&0<this.lastPageItems.length&&this.addItemsViewToStage(this.lastPageItems)}},addItemsViewToStage:{value:function(a){for(var b=0;b<a.length;b++)this.content.appendChild(a[b].view.view)}},createGrid:{value:function(){this.corectedHeight=this.gridHeight=this.rowHeight=this.rowWidth=0;this.rowArray=[];var a=this.content.clientWidth,b=
c(this.appName).collectionThumbRecomendedHeight,d=this.filteredCollection;if(0!=d.length){for(var e=0;e<d.length;e++){var f=d[e].view;this.rowWidth+f.thumbWidthByHeight(b)<a?(f.heightForCollection=b,this.rowWidth+=f.thumbWidthByHeight(b),this.rowArray.push(f),this.rowHeight=b):(0<this.rowArray.length&&(this.corectHeight(this.rowArray),this.gridHeight+=this.rowHeight),this.rowArray=[],this.rowWidth=f.thumbWidthByHeight(b),f.heightForCollection=b,this.rowArray.push(f));f.y=this.gridHeight}0<this.rowArray.length&&
(this.corectHeight(this.rowArray,!0),this.rowArray=[],this.gridHeight+=this.rowHeight);a=d[d.length-1].view;this.content.style.height=a.y+a.height+"px"}}},corectHeight:{value:function(a,b){var d=0,e=this.content.clientWidth,f=e/this.rowWidth,g=c(this.appName).collectionThumbRecomendedHeight;0==this.corectedHeight&&(this.corectedHeight=g*f);this.rowHeight=this.corectedHeight=b?1>f?this.rowHeight*f:this.rowHeight:g*f;for(f=0;f<a.length;f++)g=a[f],d+=g.thumbWidthByHeight(this.corectedHeight),g.heightForCollection=
this.corectedHeight,g.x=0>f-1?0:a[f-1].x+a[f-1].width;b&&d>e&&(this.rowWidth=d,this.corectHeight(a,b));!b&&0<a.length&&d!=e&&(g=a[a.length-1],g.widthForCollection+=e-d)}},updateView:{value:function(){for(var a=this.filteredCollection,b=0;b<a.length;b++)a[b].view.updateSize()}},arrangeItems:{value:function(){this.createGrid();this.updateView()}},resizeHandler:{value:function(){var a=this;clearTimeout(this.resizeTimeOut);m()?this.resizeTimeOut=setTimeout(function(){a.resizeDelay()},150):this.resizeDelay()}},
resizeDelay:{value:function(){this.arrangeItems()}},filtred:{value:function(a){this.deactivate();this.filtredById=a;this.activate()}},updateTagsCloud:{value:function(){0!=this.filteredCollection.length&&(this.tagsCloudView||(this.tagsCloudView=new TagsCloud(this),this.header.appendChild(this.tagsCloudView.view)),this.tagsCloud&&this.tagsCloudView.updateView())}}});P.prototype.constructor=P;ia.prototype={init:function(){function a(a){switch(a.type){case "touchstart":d=!0;break;case "mouseenter":d||
(g.updateForItem(b),e.menuHolder.appendChild(g.view))}}var b=this.delegate.itemsList[this.index],d=!1;this.item=b;this.type=u(b.mime_type);this.itemViewSrc=!1;this.img=new Image;var e=this;this.img.onload=function(){this.setAttribute("alt",b.title);1.1<e.view.clientWidth/this.naturalWidth&&b.itemViewSrc&&(this.src=b.itemViewSrc,e.itemViewSrc=!0);e.view.style.opacity=1};this.view.appendChild(this.img);this.img.src=b.itemViewThumbSrc;this.hover=document.createElement("div");this.hover.className="gmediaAlbumsGridCollection_Item_Hover";
this.hover.style.backgroundColor=c(this.appName).collectionThumbHoverColor;this.hover.style.top=this.hover.style.bottom=this.hover.style.left=this.hover.style.right=this.space;this.view.appendChild(this.hover);this.inner=document.createElement("div");this.inner.className="gmediaAlbumsGridCollection_Item_Inner";this.inner.style.top=this.inner.style.bottom=this.inner.style.left=this.inner.style.right=this.space;this.view.appendChild(this.inner);c(this.appName).lightBoxEnable&&(this.inner.style.cursor=
"zoom-in",this.inner.addEventListener("click",function(a){"gmediaAlbumsGridCollection_Item_Inner"==a.target.className&&c(e.appName).appEventManager.dispatchGMEvent(new p(t.NEED_LIGHTBOX,e,{collection:e.delegate,index:e.index}));d&&(e.hover.style.opacity="0");d=!1}));this.menuHolder=document.createElement("div");this.menuHolder.className="gmediaAlbumsGridCollection_Item_MenuHolder";this.inner.appendChild(this.menuHolder);if(c(this.appName).collectionThumbTitleShow&&b.title&&0<b.title.length){var f=
document.createElement("div");f.className="item_title";f.innerHTML=b.title;this.inner.appendChild(f)}var g=this.delegate.itemMenu;this.view.addEventListener("mouseenter",a,!1);c(this.appName).lightBoxEnable&&this.view.addEventListener("touchstart",a,A)},get ratio(){if(this.item.meta.web){var a=this.item.meta.web.width;var b=this.item.meta.web.height}else this.item.meta.thumb&&(a=this.item.meta.thumb.width,b=this.item.meta.thumb.height);return(b?b:1)/(a?a:1)},thumbWidthByHeight:function(a){this.rect.width=
a/this.ratio;return this.rect.width},thumbHeightByWidth:function(a){this.rect.height=a*this.ratio;return this.rect.height},set widthForCollection(a){this.rect.width=a},get widthForCollection(){return this.rect.width},set heightForCollection(a){this.rect.height=a},get width(){return this.rect.width},get height(){return this.rect.height},set x(a){this.rect.x=a;this.view.style.left=this.rect.x+"px"},set y(a){this.rect.y=a;this.view.style.top=this.rect.y+"px"},get x(){return this.rect.x},get y(){return this.rect.y},
updateSize:function(){this.view.style.width=this.rect.width.toFixed(2)+"px";this.view.style.height=this.rect.height.toFixed(2)+"px";!this.itemViewSrc&&1.1<this.view.clientWidth/this.img.naturalWidth&&this.item.itemViewSrc&&(this.img.src=this.item.itemViewSrc,this.itemViewSrc=!0)},set display(a){this.view.style.display=a},set opacity(a){var b=this;setTimeout(function(){b.view.style.opacity=a},40)}};ja.prototype={initByTerm:function(a){this.showPreloader(!0);c(this.appName).appEventManager.addGMEventListener(t.COLLECTION_DATA_REDY,
this,"dataLoaded");var b={per_page:c(this.appName).pagination?c(this.appName).imagesPperPage:0,admin:!1,page:1};b[a.taxForRequest]=[a.term_id];a=JSON.stringify({library:b});F(a,this,t.COLLECTION_DATA_REDY,{term:this.term})},addToStage:function(){var a=this;this.windowScrollY=window.scrollY;var b=document.getElementsByTagName("body")[0];this.view.style.zIndex=S(b)+1;this.view.style.top=this.windowScrollY+"px";m()&&(this.view.style.minHeight=window.innerHeight+1+"px");b.appendChild(this.view);a.view.classList.add("gmediaAlbumsGridColectionActivate");
document.getElementsByTagName("html")[0].classList.add("gmediaAlbumsGridPopUpActive");setTimeout(function(){window.scrollTo(0,0);for(var c=a.view,e=[],f=0;f<b.childNodes.length;f++){var g=b.childNodes[f];1==g.nodeType&&"SCRIPT"!=g.nodeName&&g!==c&&(g.classList.add("gmediaAlbumsGridPopUpBodyChildeCollapse"),e.push(g))}a.bodyElements=e;a.view.style.top="0px";a.createHeader()},100);setTimeout(function(){a.header.classList.add("collectionHeaderActivate");a.view.appendChild(a.scrollView);a.scrollViewHeight=
a.view.clientHeight-a.header.clientHeight;a.scrollView.style.minHeight=a.scrollViewHeight+"px";a.term&&a.initByTerm(a.term)},350);document.addEventListener("keydown",a.keydownHandler(),!1)},keydownHandler:function(a){var b=this;b.handlerKB=function(a){switch(a.keyCode){case 27:b.delegate.slider||b.prepareToRemove()}};return b.handlerKB},prepareToRemove:function(){c(this.appName).appEventManager.removeGMEventListener(t.COLLECTION_DATA_REDY,this,"colectionCompleteHandler");document.removeEventListener("keydown",
this.handlerKB,!1);window.removeEventListener("scroll",this.scrollHandler);this.showPreloader(!1);this.delegate.itemsCountersUpdate();var a=this.bodyElements;if(0!=a.length)for(var b=0;b<a.length;b++)a[b].classList.remove("gmediaAlbumsGridPopUpBodyChildeCollapse");this.bodyElements.length=0;window.scrollTo(0,this.windowScrollY);this.view.classList.remove("gmediaAlbumsGridColectionActivate");document.getElementsByTagName("html")[0].classList.remove("gmediaAlbumsGridPopUpActive");document.getElementById("gmAudioPlayer")&&
document.getElementById("gmAudioPlayer").pause();this.view&&this.view.parentNode&&this.view.parentNode.removeChild(this.view);delete this.view;this.delegate.removeCollection()},showPreloader:function(a){var b=void 0;if(a)0<this.scrollView.getElementsByClassName("gmediaAlbumsGridPreloader").length||(b=H(l(c(this.appName).collectionPreloaderColor,.7)),this.scrollView.appendChild(b));else if(this.scrollView.getElementsByClassName("gmediaAlbumsGridPreloader")[0]){var d=this;b=this.scrollView.getElementsByClassName("gmediaAlbumsGridPreloader")[0];
M(b,function(){b.parentNode&&d.scrollView.removeChild(b)},200)}},dataLoaded:function(a){this.showPreloader(!1);if(a.params.data&&a.params.params.term&&a.params.params.term==this.term){a=a.params.data;try{var b=JSON.parse(a);c(this.appName).key=b.key;if(b.data){var d=b.data;for(b=0;b<d.length;b++){var e=new Q(d[b],this.appName);e.index=this.itemsList.length+b;if(e.tags&&0<e.tags.length)for(a=0;a<e.tags.length;a++){var f=e.tags[a];this.tagsCloud&&(this.tagsCloud[f.term_id]=f.name)}this.itemsList.push(e)}}this.initCollectionView()}catch(g){U(g)}finally{}}},
initCollectionView:function(){var a=this;this.createThumbCollection();var b=window.pageYOffset;this.scrollHandler=function(c){c=a.header.clientHeight;if(I.desktop)window.pageYOffset>c-20?a.showFixedHeader(!0):a.showFixedHeader(!1);else{var d=-(window.pageYOffset-b);b=window.pageYOffset;window.pageYOffset>c-20?a.showFixedHeader(!0,d):a.showFixedHeader(!1,d)}};window.addEventListener("scroll",this.scrollHandler)},createThumbCollection:function(){for(var a=0;a<this.itemsList.length;a++){var b=new ia(this,
a);this.itemsList[a].view=b;b.init()}this.arrangeItems();this.addItemsViewToStage(this.itemsList)},get filteredCollection(){return this.itemsList},addItemsViewToStage:function(a){for(var b=0;b<a.length;b++)this.scrollView.appendChild(a[b].view.view)},createGrid:function(){this.corectedHeight=this.gridHeight=this.rowHeight=this.rowWidth=0;this.rowArray=[];var a=this.scrollView.clientWidth,b=c(this.appName).collectionThumbRecomendedHeight,d=this.filteredCollection;if(0!=d.length){for(var e=0;e<d.length;e++){var f=
d[e].view;this.rowWidth+f.thumbWidthByHeight(b)<a?(f.heightForCollection=b,this.rowWidth+=f.thumbWidthByHeight(b),this.rowArray.push(f),this.rowHeight=b):(0<this.rowArray.length&&(this.corectHeight(this.rowArray),this.gridHeight+=this.rowHeight),this.rowArray=[],this.rowWidth=f.thumbWidthByHeight(b),f.heightForCollection=b,this.rowArray.push(f));f.y=this.gridHeight}0<this.rowArray.length&&(this.corectHeight(this.rowArray,!0),this.rowArray=[],this.gridHeight+=this.rowHeight);a=d[d.length-1].view;this.scrollView.style.height=
a.y+a.height+"px"}},corectHeight:function(a,b){var d=0,e=this.scrollView.clientWidth,f=e/this.rowWidth,g=c(this.appName).collectionThumbRecomendedHeight;0==this.corectedHeight&&(this.corectedHeight=g*f);this.rowHeight=this.corectedHeight=b?1>f?this.rowHeight*f:this.rowHeight:g*f;for(f=0;f<a.length;f++)g=a[f],d+=g.thumbWidthByHeight(this.corectedHeight),g.heightForCollection=this.corectedHeight,g.x=0>f-1?0:a[f-1].x+a[f-1].width;b&&d>e&&(this.rowWidth=d,this.corectHeight(a,b));!b&&0<a.length&&d!=e&&
(g=a[a.length-1],g.widthForCollection+=e-d)},updateView:function(){for(var a=this.filteredCollection,b=0;b<a.length;b++)a[b].view.updateSize()},arrangeItems:function(){this.createGrid();this.updateView()},resizeHandler:function(){var a=this;clearTimeout(this.resizeTimeOut);m()?this.resizeTimeOut=setTimeout(function(){a.windowWidth!=window.innerWidth&&(a.windowWidth=window.innerWidth);a.resizeDelay()},150):this.resizeDelay()},resizeDelay:function(){this.arrangeItems()},showFixedHeader:function(a,b){if(!this.fixedHeader){var d=
document.createElement("div");d.className="gmediaAlbumsGridFixedHeder";d.id=this.id+"fixedHeader";this.fixedHeader=d;this.fixedHeader.style.backgroundColor=c(this.appName).collectionHeaderBgColor;d=this.term;if(d.name){var e=document.createElement("div");e.className="title";e.innerHTML='<span style="color:'+c(this.appName).collectionHeaderTextColor+'">'+d.name+'<span style="color:'+c(this.appName).collectionHeaderControllIconColor+'"> \u00b7 '+d.count+"</span></span>";this.fixedHeader.appendChild(e)}this.fixedHeader.style.transform=
"translateY(-100%)";this.view.appendChild(this.fixedHeader);this.scrollDirection=-1}a?(b&&(this.scrollDirection!=b/Math.abs(b)&&(this.fixedHeader.style.transform="translateY("+(0<b/Math.abs(b)?0:-100)+"%)"),this.scrollDirection=b/Math.abs(b)),this.isShowFixedHeder||(this.closeButton&&this.fixedHeader.appendChild(this.closeButton),this.shareMenu&&this.fixedHeader.appendChild(this.shareMenu),b||(this.fixedHeader.style.transform="translateY(0%)"),this.fixedHeader.style.opacity="1",this.isShowFixedHeder=
!0)):this.isShowFixedHeder&&(this.closeButton&&this.header.appendChild(this.closeButton),this.shareMenu&&this.header.appendChild(this.shareMenu),this.fixedHeader.style.opacity="0",this.fixedHeader.style.transform="translateY(-100%)",this.isShowFixedHeder=!1)},createHeader:function(){var a=this,b=this.term,d=document.createElement("div");d.className="collectionHeader";d.style.backgroundColor=c(a.appName).collectionHeaderBgColor;this.view.appendChild(d);this.header=d;if(b.name){var e=document.createElement("div");
e.className="title";y&&e.classList.add("titleMiniScreen");e.style.color=c(a.appName).collectionHeaderTextColor;e.innerHTML=b.name;d.appendChild(e)}c(a.appName).collectionDescription&&b.description&&(e=document.createElement("div"),e.className="collectionDescription",e.style.color=c(a.appName).collectionHeaderTextColor,e.innerHTML=b.description,d.appendChild(e));if(b.sharelink&&c(a.appName).collectionShareButtons){b=function(b){var d=this.getElementsByTagName("svg")[0];switch(b.type){case "click":c(a.appName).appEventManager.dispatchGMEvent(new p(t.NEED_MODAL,
a,{type:"share",term:a.term}));break;case "mouseover":d.style.fill=c(a.appName).collectionHeaderControllBgColor;this.style.backgroundColor=c(a.appName).collectionHeaderControllIconColor;break;case "mouseout":d.style.fill=c(a.appName).collectionHeaderControllIconColor,this.style.backgroundColor=c(a.appName).collectionHeaderControllBgColor}};e=document.createElement("div");e.style.display="inline-block";e.style.verticalAlign="top";var f=document.createElement("div");f.className="centreCircleButton";
f.setAttribute("title","Share");f.innerHTML='<svg height="1792" viewBox="0 0 1792 1792" width="1792" xmlns="http://www.w3.org/2000/svg"><path d="M1344 1024q133 0 226.5 93.5t93.5 226.5-93.5 226.5-226.5 93.5-226.5-93.5-93.5-226.5q0-12 2-34l-360-180q-92 86-218 86-133 0-226.5-93.5t-93.5-226.5 93.5-226.5 226.5-93.5q126 0 218 86l360-180q-2-22-2-34 0-133 93.5-226.5t226.5-93.5 226.5 93.5 93.5 226.5-93.5 226.5-226.5 93.5q-126 0-218-86l-360 180q2 22 2 34t-2 34l360 180q92-86 218-86z"/></svg>';f.style.fill=c(a.appName).collectionHeaderControllIconColor;
f.style.backgroundColor=c(a.appName).collectionHeaderControllBgColor;f.addEventListener("click",b);f.addEventListener("mouseover",b);f.addEventListener("mouseout",b);e.appendChild(f);this.shareMenu=e;d.appendChild(this.shareMenu)}b=document.createElement("div");b.setAttribute("title","Close (Esc)");b.className="collectionButtons";b.style.backgroundColor=c(a.appName).collectionHeaderControllBgColor;y&&b.classList.add("collectionButtonsMiniScreen");b.innerHTML='<svg version="1.1" viewBox="0 0 512 512" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M437.5,386.6L306.9,256l130.6-130.6c14.1-14.1,14.1-36.8,0-50.9c-14.1-14.1-36.8-14.1-50.9,0L256,205.1L125.4,74.5  c-14.1-14.1-36.8-14.1-50.9,0c-14.1,14.1-14.1,36.8,0,50.9L205.1,256L74.5,386.6c-14.1,14.1-14.1,36.8,0,50.9  c14.1,14.1,36.8,14.1,50.9,0L256,306.9l130.6,130.6c14.1,14.1,36.8,14.1,50.9,0C451.5,423.4,451.5,400.6,437.5,386.6z"/></svg>';
var g=b.childNodes[0];g.style.fill=c(a.appName).collectionHeaderControllIconColor;b.addEventListener("mouseover",function(){g.style.fill=c(a.appName).collectionHeaderControllBgColor;this.style.backgroundColor=c(a.appName).collectionHeaderControllIconColor});b.addEventListener("mouseout",function(){g.style.fill=c(a.appName).collectionHeaderControllIconColor;this.style.backgroundColor=c(a.appName).collectionHeaderControllBgColor});b.addEventListener("click",function(){a.prepareToRemove()});this.closeButton=
b;d.appendChild(this.closeButton)}};ka.prototype={view:function(){function a(a){switch(a.type){case "click":f.style.backgroundColor=l(c(b.appName).activColor,1);g.classList.remove("hover");c(b.appName).appEventManager.dispatchGMEvent(new p(t.NEED_NEW_COLLECTION,this,{term:b.termData}));break;case "mouseenter":f.style.backgroundColor=l(c(b.appName).hoverColor,1);g.classList.add("hover");break;case "mouseleave":f.style.backgroundColor=l(c(b.appName).activColor,1),g.classList.remove("hover")}}var b=
this;if(!this.thumb){var d=document.createElement("div");d.setAttribute("gmIndex",this.index+"_"+this.taxonomy);d.className="gmediaAlbumsGridTagWrap";var e="";this.termData&&(e=this.termData.name);var f=document.createElement("div");f.className="gmediaAlbumsGridTagCover";f.style.backgroundColor=l(c(b.appName).activColor,1);f.style.color=l(c(b.appName).reverseColor,1);f.appendChild(document.createTextNode(e));d.appendChild(f);var g=document.createElement("div");g.className="gmediaAlbumsGridTagCoverNnotification";
g.appendChild(document.createTextNode(this.termData.count));g.style.backgroundColor=l(c(b.appName).activColor,1);g.style.color=l(c(b.appName).reverseColor,1);g.style.borderColor=l(c(b.appName).reverseColor,1);f.appendChild(g);f.addEventListener("mouseenter",a,!1);f.addEventListener("mouseleave",a,!1);f.addEventListener("click",a,!1);this.thumb=d}return this.thumb}};la.prototype={itemMouseHandler:function(a){var b=this.thumb;switch(a.type){case "click":c(this.appName).flipEffect?b.classList.remove("hover"):
b.classList.remove("scaleImg");c(this.appName).appEventManager.dispatchGMEvent(new p(t.NEED_NEW_COLLECTION,this,{term:this.termData}));break;case "mouseenter":c(this.appName).flipEffect?b.classList.add("hover"):b.classList.add("scaleImg");b.style.zIndex=this.delegate.zIndexForCovers;break;case "mouseleave":c(this.appName).flipEffect?b.classList.remove("hover"):b.classList.remove("scaleImg")}},view:function(a){if(!this.thumb){var b=this,d=document.createElement("div");d.className="gmediaAlbumsGridFlipContainer";
d.style.position="absolute";d.setAttribute("gmIndex",this.index+"_"+this.taxonomy);var e=document.createElement("div");e.className="front";var f="";this.termData&&(f=this.termData.name);var g=void 0;if(c(this.appName).coverTitleShow||c(this.appName).coverCounerShow)g=document.createElement("div"),g.className="gmTitleHolder",g.style.visibility="hidden";if(this.data&&this.data.meta){var h=document.createElement("img"),n=this.data.meta.thumb?this.data.meta.thumb.link:this.data.meta.web.link;this.thumbImgSize=
this.data.meta.thumb?new r(this.data.meta.thumb.width,this.data.meta.thumb.height):new r(this.data.meta.web.width,this.data.meta.web.height);h.setAttribute("src",n);h.style.maxWidth="none";h.style.border="none";h.style.setProperty("max-width","none","!important");this.thumbImgBack=h.cloneNode(!0);this.thumbImgBack.style.opacity=c(this.appName).descriptionImgAlpha;h.style.opacity="0";h.addEventListener("load",function(){h.setAttribute("alt",f);h.style.transition="opacity .6s cubic-bezier(0.25,0.1,0.25,1), transform .6s";
setTimeout(function(){h.style.opacity="1";g&&(g.style.visibility="visible")},30)}());this.thumbImg=h;e.appendChild(h)}else e.style.backgroundColor=c(this.appName).activColor,e.style.border="1px solid "+c(this.appName).activColor,g&&(g.style.visibility="visible");c(this.appName).coverTitleShow&&(n=document.createElement("div"),n.className="coverTitle",n.style.color=c(this.appName).coverTitleTextColor,n.style.backgroundColor=l(c(this.appName).coverTitleBgColor,c(this.appName).coverTitleBgAlpha),n.innerHTML=
f,this.coverTitle=n,g.appendChild(this.coverTitle));if(c(this.appName).coverCounerShow){n=document.createElement("div");n.style.width="100%";var k=document.createElement("div");k.className="coverCounter";k.style.backgroundColor=l(c(this.appName).coverTitleBgColor,c(this.appName).coverTitleBgAlpha);k.style.color=c(this.appName).coverTitleTextColor;k.innerHTML=this.termData.count;n.appendChild(k);g.appendChild(n)}g&&e.appendChild(g);this.frontPart=e;if(c(this.appName).flipEffect){var m=document.createElement("div");
m.className="back";m.style.backgroundColor=c(this.appName).descriptionBgColor;this.thumbImgBack&&m.appendChild(this.thumbImgBack);this.backPart=m;this.addBackDescription()}n=document.createElement("div");n.className="gmediaAlbumsGridFlipper";n.appendChild(e);m&&n.appendChild(m);d.appendChild(n);this.thumb=d;this.thumb.addEventListener("click",function(a){b.itemMouseHandler(a)},!1);this.thumb.addEventListener("mouseenter",function(a){b.itemMouseHandler(a)},!1);this.thumb.addEventListener("mouseleave",
function(a){b.itemMouseHandler(a)},!1)}a&&(this.thumbMatrix.translateX=a.x,this.thumbMatrix.translateY=a.y,this.updateThumbMatrix(),this.thumbSize=new r(a.width,a.height));return this.thumb},addBackDescription:function(){var a=document.createElement("div");a.className="gmTitleHolder";this.backPart.appendChild(a);if(this.termData){if(this.termData.user&&this.termData.user.displayname){var b=document.createElement("div");b.className="thumbButtonTermGM";b.innerHTML='<svg version="1.1" viewBox="0 0 24 24" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="info"/><g id="icons"><path d="M12,0C5.4,0,0,5.4,0,12c0,6.6,5.4,12,12,12s12-5.4,12-12C24,5.4,18.6,0,12,0z M12,4c2.2,0,4,2.2,4,5s-1.8,5-4,5   s-4-2.2-4-5S9.8,4,12,4z M18.6,19.5C16.9,21,14.5,22,12,22s-4.9-1-6.6-2.5c-0.4-0.4-0.5-1-0.1-1.4c1.1-1.3,2.6-2.2,4.2-2.7   c0.8,0.4,1.6,0.6,2.5,0.6s1.7-0.2,2.5-0.6c1.7,0.5,3.1,1.4,4.2,2.7C19.1,18.5,19.1,19.1,18.6,19.5z" id="user2"/></g></svg>';
b.getElementsByTagName("svg")[0].style.fill=c(this.appName).hoverColor;var d=document.createElement("div");d.className="userName";d.style.color=c(this.appName).hoverColor;d.style.marginLeft="5px";d.appendChild(document.createTextNode(this.termData.user.displayname));this.backTitle=d}else b=document.createElement("div"),b.className="thumbButtonTermGM",b.style.width="54px",b.style.height="54px",b.innerHTML='<svg enable-background="new 0 0 167 93" height="93px" id="Layer_1" version="1.1" viewBox="0 0 167 93" width="167px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g><path d="M83.25,29.25c-9.649,0-17.5,7.851-17.5,17.5s7.851,17.5,17.5,17.5s17.5-7.851,17.5-17.5   S92.899,29.25,83.25,29.25z"/><path d="M83.25,0.75c-45.84,0-83,46-83,46s37.16,46,83,46s83-46,83-46S129.09,0.75,83.25,0.75z M83.25,81.25   c-19.054,0-34.5-15.445-34.5-34.5c0-19.054,15.446-34.5,34.5-34.5s34.5,15.446,34.5,34.5C117.75,65.805,102.304,81.25,83.25,81.25z   "/></g></svg>',
b.getElementsByTagName("svg")[0].style.fill=c(this.appName).hoverColor;var e=document.createElement("div");e.style.display="inline-block";e.style.verticalAlign="top";e.appendChild(b);this.termData.user&&this.termData.user.displayname&&e.appendChild(d);a.appendChild(e)}this.termData&&this.termData.description&&(b=document.createElement("div"),b.className="descriptionTermGM",b.style.color=c(this.appName).coverDescriptionTextColor,b.innerHTML=this.termData.description,a.appendChild(b),this.backDescription=
b)},set frame(a){this.thumbMatrix.translateX=a.x;this.thumbMatrix.translateY=a.y;this.updateThumbMatrix();this.thumbSize=new r(a.width,a.height)},set thumbSize(a){if(this.thumb){this.thumb.style.width=a.width+"px";this.thumb.style.height=a.height+"px";if(this.thumbImg){var b=Z(this.thumbImgSize,a,!0);this.thumbImg.style.width=this.thumbImgBack.style.width=b.width+"px";this.thumbImg.style.height=this.thumbImgBack.style.height=b.height+"px";this.thumbImg.style.marginLeft=this.thumbImgBack.style.marginLeft=
b.x+"px";this.thumbImg.style.marginTop=this.thumbImgBack.style.marginTop=b.y+"px"}this.coverTitle&&(this.coverTitle.style.fontSize=200>a.width?parseInt(18*c(this.appName).coverTitleFontSizeRatio)+"px":parseInt(28*c(this.appName).coverTitleFontSizeRatio)+"px");this.frontPart.style.width=a.width+"px";this.frontPart.style.height=a.height+"px";if(this.backPart&&(this.backPart.style.width=a.width+"px",this.backPart.style.height=a.height+"px",this.backTitle&&(this.backTitle.style.fontSize=200>a.width?"13px":
"16px"),this.backDescription)){this.backDescription.style.fontSize=200>a.width?"12px":"14px";this.backDescription.style.maxHeight=a.height-65+"px";b=this.backDescription;for(var d;b.clientHeight<b.scrollHeight;){d=b.innerHTML.trim();if(1>=d.split(" ").length)break;b.innerHTML=d.replace(/\W*\s(\S)*$/,"...")}}this.thumbnailSize=a}},updateThumbMatrix:function(){this.thumb&&(this.thumb.style.left=this.thumbMatrix.translateX+"px",this.thumb.style.top=this.thumbMatrix.translateY+"px")},set thumbX(a){this.thumbMatrix.translateX=
a;this.updateThumbMatrix()},set thumbY(a){this.thumbMatrix.translateY=a;this.updateThumbMatrix()},set thumbScaleX(a){this.thumbMatrix.scaleX=a;this.updateThumbMatrix()},set thumbScaleY(a){this.thumbMatrix.scaleY=a;this.updateThumbMatrix()},set thumbSkewX(a){this.thumbMatrix.skewX=a;this.updateThumbMatrix()},set thumbSkewY(a){this.thumbMatrix.skewY=a;this.updateThumbMatrix()},set thumbOpacity(a){this.thumbnailOpacity=a;this.thumb.style.opacity=this.thumbnailOpacity}};ma.prototype={showPreloader:function(a){var b=
void 0;if(a)0<this.div.getElementsByClassName("gmediaAlbumsGridPreloader").length||(b=H(c(this.appName).splashPreloaderColor),this.div.appendChild(b));else if(this.div.getElementsByClassName("gmediaAlbumsGridPreloader")[0]){var d=this;b=this.div.getElementsByClassName("gmediaAlbumsGridPreloader")[0];M(b,function(){d.div&&d.div.removeChild(b)},500)}},createSplashView:function(){function a(a,c){var e=b[a].itemsList;if(e&&0<e.length){b[a].coversList=[];for(var f=0;f<e.length;f++){var g=new la(e[f],d);
g.index=f;b[a].coversList.push(g);g=g.view(null);c.appendChild(g)}}}var b=this.delegate.terms;if(b){var d=this,e;for(e in b)switch(e){case "albums":var f=document.createElement("div");f.className="gmediaAlbumsGrid_clearfix";f.style.position="relative";f.id="albums_"+this.id;this.div.appendChild(f);this.albumsBox=f;a("albums",this.albumsBox);this.collectionBoxs.push(this.albumsBox);break;case "categories":f=document.createElement("div");f.className="gmediaAlbumsGrid_clearfix";f.style.position="relative";
f.id="categories_"+this.id;this.div.appendChild(f);this.categoriesBox=f;a("categories",this.categoriesBox);this.collectionBoxs.push(this.categoriesBox);break;case "tags":f=document.createElement("div");f.className="gmediaAlbumsGrid_clearfix";f.style.position="relative";f.id="tags_"+this.id;f.style.textAlign="center";this.div.appendChild(f);this.tagsBox=f;this.tagsBox.style.marginTop="10px";if((f=b.tags.itemsList)&&0<f.length){b.tags.coversList=[];for(var g=0;g<f.length;g++){var h=new ka(f[g]);h.index=
g;b.tags.coversList.push(h);h=h.view();this.tagsBox.appendChild(h)}}this.collectionBoxs.push(this.tagsBox)}for(e=0;e<this.collectionBoxs.length-1;e++)this.collectionBoxs[e].style.borderBottom="1px solid "+c(this.appName).splashPreloaderColor;this.arangeTerms()}},get zIndexForCovers(){return this._maxZindex+=1},arangeTerms:function(){function a(a,e){if((a=b[a].coversList)&&0<a.length){var f={width:e.clientWidth,height:e.clientHeight},g=Math.min(c(d.appName).thumbRecomendedSize,e.clientWidth-2);d.gmediaTemplate&&
(f={width:window.innerWidth-2*W(),height:e.clientHeight},d.div.style.width=window.innerWidth-2*W()+"px");for(var k=0;k<a.length;k++)a[k].view(aa(a[k].index,f,c(d.appName).columns,c(d.appName).spaceX,c(d.appName).spaceY,g,c(d.appName).coverThumbRatio)).style.perspective=2.5*a[k].thumbnailSize.width+"px";a=aa(a.length-1,f,c(d.appName).columns,c(d.appName).spaceX,c(d.appName).spaceY,g,c(d.appName).coverThumbRatio);e.style.height=a.y+a.height+a.width/2*.22+"px";e.style.marginTop=a.width/2*.22+"px"}}var b=
this.delegate.terms;if(b){var d=this,e;for(e in b)switch(e){case "albums":a("albums",this.albumsBox);break;case "categories":a("categories",this.categoriesBox)}this.viewWidth=this.div.clientWidth}},resizeHandler:function(){this.viewWidth!=this.div.clientWidth&&this.arangeTerms()}};Q.prototype={hasTag:function(a){if("all"==a)return!0;if(!this.tags||0==this.tags.length)return!1;for(var b=0;b<this.tags.length;b++)if(this.tags[b].term_id==a)return!0},get itemViewSrc(){return this.meta?this.meta.web?this.meta.web.link:
this.meta.original?this.meta.original.link:null:null},get itemViewThumbSrc(){return this.meta?this.meta.thumb?this.meta.thumb.link:this.meta.web?this.meta.web.link:null:null},get itemViewSize(){return this.meta?this.meta.web?new r(this.meta.web.width,this.meta.web.height):this.meta.original?new r(this.meta.original.width,this.meta.original.height):new r(300,300):new r(300,300)},get itemViewThumbSize(){return this.meta?this.meta.thumb?new r(this.meta.thumb.width,this.meta.thumb.height):this.meta.web?
new r(this.meta.web.width,this.meta.web.height):new r(300,300):new r(300,300)}};C.prototype={set gmedia__in(a){this._query&&(this._query.gmedia__in=a.toString(),"myCollection"==this.taxonomy&&this._query&&(this.sharelink=c(this.appName).post_url+"/?"+c(this.appName).galleryID+"[gmedia__in]="+this._query.gmedia__in),"gmedia__in"==this.taxonomy&&this._query&&(this.sharelink=c(this.appName).post_url+"/?"+c(this.appName).galleryID+"[gmedia__in]="+this._query.gmedia__in))},get taxForRequest(){switch(this.taxonomy){case "gmedia_album":return"album__in";
case "gmedia_category":return"category__in";case "gmedia_tag":return"tag__in";default:return this.taxonomy}}};C.termDataByQueryNameId=function(a,b,c){var d=0,f="myCollection";c="myCollection_"+c;a.gmedia__in&&(d=a.gmedia__in.split(",").length,f="gmedia__in");a.s&&(f="s",c=a.s);a.author__in&&(f="author__in",c=a.author__in);var g=a.orderby,h=a.order;b={count:d,name:b,meta:{_order:h,_orderby:g,order:h,orderby:g},taxonomy:f,term_id:c,_query:a};a.mime_type&&(b.mime_type=a.mime_type);return b};na.prototype=
{get cover(){return this._cover?this._cover:null}};oa.prototype={createTermsList:function(a){var b=[],d=[];for(e in a)switch(e){case "album__in":b.push("gmedia_album");d=d.concat(a[e].split(","));break;case "category__in":b.push("gmedia_category");d=d.concat(a[e].split(","));break;case "tag__in":b.push("gmedia_tag"),d=d.concat(a[e].split(","))}var e=0>window.location.href.indexOf(c(this.appName).galleryID)?!1:!0;c(this.appName).openGalleryAsItemsList||c(this.appName).openCollectionInNewPage&&(0==b.length||1>=d.length)&&e?(b="collection"+this.collectionIndex,a=new P(this,this.appName,a),this.collectionIndex+=1,this.cureantCollection=a,this.collections[b]=a,this.appDiv.appendChild(a.view),a.init()):(this.view=new ma(this),this.appDiv.appendChild(this.view.div),this.view.showPreloader(!0),c(this.appName).appEventManager.addGMEventListener(t.TERMS_DATA_REDY,this,"termsLoaded"),F(JSON.stringify({library_terms:{taxonomy:b,include:d}}),this,t.TERMS_DATA_REDY))},termsLoaded:function(a){if(a=a.params.data)try{var b=
JSON.parse(a);a=0;var c=void 0,e;for(e in b){var f;switch(e){case "albums":this.terms.albums={};b.albums.properties&&(this.terms.albums.properties=b.albums.properties);if((f=b.albums.data)&&Array.isArray(f))for(this.terms.albums.itemsList=[],a=0;a<f.length;a++)c=new C(f[a],this.appName),this.terms.albums.itemsList.push(c);break;case "categories":this.terms.categories={};b.categories.properties&&(this.terms.categories.properties=b.categories.properties);if((f=b.categories.data)&&Array.isArray(f))for(this.terms.categories.itemsList=
[],a=0;a<f.length;a++)c=new C(f[a],this.appName),this.terms.categories.itemsList.push(c);break;case "tags":if(this.terms.tags={},b.tags.properties&&(this.terms.tags.properties=b.tags.properties),(f=b.tags.data)&&Array.isArray(f))for(this.terms.tags.itemsList=[],a=0;a<f.length;a++)c=new C(f[a],this.appName),this.terms.tags.itemsList.push(c)}}this.view.createSplashView()}catch(g){}finally{this.view.showPreloader(!1)}},addCollectioByTerm:function(a){if(a=a.params.term)if(c(this.appName).openCollectionInNewPage){var b=
a.term_id;a=a.taxForRequest;a=c(this.appName).post_url+"/?"+c(this.appName).galleryID+"["+a+"]="+b;window.open(a,"_self")}else b="collection"+this.collectionIndex,a=new ja(this,a),this.collectionIndex+=1,this.cureantCollection=a,this.collections[b]=a},removeCollection:function(){this.collection&&(this.collection=void 0)},itemsCountersUpdate:function(){if(this.viewsSet){var a=[];for(key in this.viewsSet)a.push(key);0<a.length&&(a=JSON.stringify({counter:{likes:[],views:a}}),F(a,this,t.COUNTERS_UPDATED),
this.viewsSet={})}},itemsCountersUpdateHandler:function(a){window.localStorage.setItem("gm_likesSet",JSON.stringify(this.likesSet))},set likeItem(a){a.meta.likes||(a.meta.likes=0);a.meta.likes=parseInt(a.meta.likes)+1;a=a.ID;this.likesSet[a]||(this.likesSet[a]="like",this.viewsSet[a]&&delete this.viewsSet[a],a=JSON.stringify({counter:{likes:[a],views:[a]}}),F(a,this,t.COUNTERS_UPDATED),window.localStorage.setItem("gm_likesSet",JSON.stringify(this.likesSet)))},set viewItem(a){this.viewsSet[a.ID]="view"},
createLightbox:function(a){if(a.params||a.params.collection){var b=a.params.collection;a=a.params.index;this.slider&&this.slider.prepareToRemove();window.localStorage.getItem("gm_likesSet")&&(this.likesSet=JSON.parse(window.localStorage.getItem("gm_likesSet")));this.slider=new fa(this);this.slider.initByList(b.filteredCollection,a);c(this.appName).openCollectionInNewPage&&(this.currentLocation.push(window.location.href),window.history.pushState(null,null,window.location.href),this.popstateHandlerF=
this.popstateHandler(),window.addEventListener("popstate",this.popstateHandlerF,!1))}},popstateHandler:function(){var a=this;return function(){a.slider&&a.slider.prepareToRemove()}},updateItemLink:function(a){window.history.replaceState({},a.title,a.sharelink)},removeLightbox:function(){this.slider&&(this.slider=void 0);c(this.appName).openCollectionInNewPage&&(window.removeEventListener("popstate",this.popstateHandlerF,!1),this.currentLocation[0]&&window.location.href!=this.currentLocation[0]&&window.history.back(),
this.currentLocation=[])},createModal:function(a){if(a.params.type)switch(a.params.type){case "share":this.modal||(this.modal=new V(this));this.modal.type=a.params.type;if(a=a.params.item||a.params.term)a=new sa(this.appName,this.modal,a,a.sharelink);else break;this.modal.pushPage(a);break;case "info":if(this.modal||(this.modal=new V(this)),this.modal.type=a.params.type,a=a.params.item)a=new ra(this.appName,this.modal,a),this.modal.pushPage(a)}},deleteModal:function(){this.modal&&delete this.modal},
windowResizeHandler:function(a){a&&a.view&&"function"==typeof a.view.resizeHandler&&a.view.resizeHandler();this.cureantCollection&&this.cureantCollection.resizeHandler();this.slider&&this.slider.resizeHandler()},createAudioPlayer:function(){var a=this;var b=document.getElementById("gmAudioPlayer")?document.getElementById("gmAudioPlayer"):new Audio;if(null!=b&&b.canPlayType&&b.canPlayType("audio/mpeg")){var c=function(b){a.slider&&a.slider.audioPlayerHandler(b)};b.id="gmAudioPlayer";b.setAttribute("type",
"audio/mpeg");b.setAttribute("codecs","mp3");this.audioPlayer=b;this.appDiv.appendChild(this.audioPlayer);b.addEventListener("ended",c,!1);b.addEventListener("pause",c,!1);b.addEventListener("play",c,!1);b.addEventListener("durationchange",c,!1)}}};(function(){var a=function(b){window.removeEventListener("mousedown",a,!1);window.removeEventListener("touchstart",a,!1);"touchstart"==b.type?(b.stopPropagation(),N=!1):N=!0};window.addEventListener("mousedown",a,!1);window.addEventListener("touchstart",
a,!1);y=500>window.screen.height||500>window.screen.width;for(var b=document.body.getElementsByClassName("module_GmediaAlbumsGrid3"),c=0;c<b.length;c++){var e=b[c].getAttribute("app-id"),f=this[e];f=new oa(f,e,b[c].parentElement);window[e]=f}})()}codeasily_albumsGrid3_module();