text: (function(n){var f=function(b){return document.querySelectorAll(b)[0]},b=function(b,f){return b?b[f]||"":""},v=function(b,f){if(b)for(var d=b.length,h=0;h<d;h++)f(h,b[h])},x=function(b,f,d){f=[f.toLowerCase(),"webkit".concat(f),"MS".concat(f),"o".concat(f)];v(f,function(h,f){b[f]=d})},C=function(b,f,d){d=[d.toLowerCase(),"webkit".concat(d),"MS".concat(d),"o".concat(d)];v(d,function(d,m){b.addEventListener(m,f,!1)})},M=function(b,f){C(b,f,"AnimationEnd")},R=function(b,f){b.transitionEndEvent||(b.transitionEndEvent=
  !0,C(b,f,"TransitionEnd"))},F=function(b,f){b.firstChild?b.insertBefore(f,b.firstChild):b.appendChild(f)},l=function(m,l){var d=this,h=function(a,e){var c=function(a){return"undefined"!==typeof a};return e?c(l[a])?c(l[a][e])?l[a][e]:E[a][e]:E[a][e]:c(l[a])?l[a]:E[a]},L=function(a,e){try{if(e){if(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)document.exitFullscreen?document.exitFullscreen()["catch"](function(){}):document.mozCancelFullScreen?
  document.mozCancelFullScreen()["catch"](function(){}):document.mozCancelFullScreen&&document.mozCancelFullScreen()["catch"](function(){})}else if(a.requestFullScreen)a.requestFullScreen();else if(a["ms".concat("RequestFullScreen")])a["ms".concat("RequestFullScreen")]();else if(a["moz".concat("RequestFullScreen")])a["moz".concat("RequestFullScreen")]();else if(a["webkit".concat("RequestFullScreen")])a["webkit".concat("RequestFullScreen")]()}catch(c){console.warn("[Zuck.js] Can't access fullscreen")}},
  w=function(a,e,c,d){var b=0<e?1:-1;b*=Math.abs(e)/f("#zuck-modal").offsetWidth*90;if(h("cubeEffect")){var g=0===b?"scale(0.95)":"scale(0.930,0.930)";x(f("#zuck-modal-content").style,"Transform",g);if(-90>b||90<b)return!1}e=h("cubeEffect")?"rotateY(".concat(b,"deg)"):"translate3d(".concat(e,"px, 0, 0)");a&&(x(a.style,"TransitionTimingFunction",d),x(a.style,"TransitionDuration","".concat(c,"ms")),x(a.style,"Transform",e))},y=function(a,e,c,d){var b=0,g=0;if(a){if(a.offsetParent){do if(b+=a.offsetLeft,
  g+=a.offsetTop,a===d)break;while(a=a.offsetParent)}e&&(g-=e);c&&(b-=c)}return[b,g]};"string"===typeof m&&(m=document.getElementById(m));m.id||m.setAttribute("id","stories-"+Math.random().toString(36).substr(2,9));var G=function(a){a=1E3*Number(a);a=new Date(a);var e=a.getTime();e=((new Date).getTime()-e)/1E3;var c=h("language","time");c=[[60," ".concat(c.seconds),1],[120,"1 ".concat(c.minute),""],[3600," ".concat(c.minutes),60],[7200,"1 ".concat(c.hour),""],[86400," ".concat(c.hours),3600],[172800,
  " ".concat(c.yesterday),""],[604800," ".concat(c.days),86400]];var d=1;0>e&&(e=Math.abs(e),d=2);for(var b=0,g;g=c[b++];)if(e<g[0])return"string"===typeof g[2]?g[d]:Math.floor(e/g[2])+g[1];e=a.getDate();c=a.getMonth();a=a.getFullYear();return"".concat(e,"/").concat(c+1,"/").concat(a)},k=m.id,E={skin:"snapgram",avatars:!0,stories:[],backButton:!0,backNative:!1,paginationArrows:!1,previousTap:!0,autoFullScreen:!1,openEffect:!0,cubeEffect:!1,list:!1,localStorage:!0,callbacks:{onOpen:function(a,d){d()},
  onView:function(a){},onEnd:function(a,d){d()},onClose:function(a,d){d()},onNextItem:function(a,d,c){c()},onNavigateItem:function(a,d,c){c()}},template:{timelineItem:function(a){return'\n<div class="story '.concat(!0===b(a,"seen")?"seen":"",'">\n<a class="item-link" href="').concat(b(a,"link"),'">\n<span class="item-preview">\n<img lazy="eager" src="').concat(h("avatars")||!b(a,"currentPreview")?b(a,"photo"):b(a,"currentPreview"),'" />\n</span>\n<span class="info" itemProp="author" itemScope itemType="http://schema.org/Person">\n<strong class="name" itemProp="name">').concat(b(a,
  "name"),'</strong>\n<span class="time">').concat(b(a,"lastUpdatedAgo"),'</span>\n</span>\n</a>\n\n<ul class="items"></ul>\n</div>')},timelineStoryItem:function(a){return'<a href="'.concat(b(a,"src"),'"\ndata-link="').concat(b(a,"link"),'"\ndata-linkText="').concat(b(a,"linkText"),'"\ndata-time="').concat(b(a,"time"),'"\ndata-type="').concat(b(a,"type"),'"\ndata-length="').concat(b(a,"length"),'">\n<img loading="auto" src="').concat(b(a,"preview"),'" />\n</a>')},viewerItem:function(a,d){return'<div class="story-viewer">\n<div class="head">\n<div class="left">\n'.concat(h("backButton")?
  '<a class="back">&lsaquo;</a>':"",'\n\n<span class="item-preview">\n<img lazy="eager" class="profilePhoto" src="').concat(b(a,"photo"),'" />\n</span>\n\n<div class="info">\n<strong class="name">').concat(b(a,"name"),'</strong>\n<span class="time">').concat(b(a,"timeAgo"),'</span>\n</div>\n</div>\n\n<div class="right">\n<span class="time">').concat(b(d,"timeAgo"),'</span>\n<span class="loading"></span>\n<a class="close" tabIndex="2">&times;</a>\n</div>\n</div>\n\n<div class="slides-pointers">\n<div class="wrap"></div>\n</div>\n\n').concat(h("paginationArrows")?
  '<div class="slides-pagination">\n<span class="previous">&lsaquo;</span>\n<span class="next">&rsaquo;</span>\n</div>':"","\n</div>")},viewerItemPointer:function(a,d,c){return'<span \nclass="'.concat(d===a?"active":""," ").concat(!0===b(c,"seen")?"seen":"",'"\ndata-index="').concat(a,'" data-item-id="').concat(b(c,"id"),'">\n<b style="animation-duration:').concat(""===b(c,"length")?"3":b(c,"length"),'s"></b>\n</span>')},viewerItemBody:function(a,d,c){return'<div \nclass="item '.concat(!0===b(c,"seen")?
  "seen":""," ").concat(d===a?"active":"",'"\ndata-time="').concat(b(c,"time"),'" data-type="').concat(b(c,"type"),'" data-index="').concat(a,'" data-item-id="').concat(b(c,"id"),'">\n').concat("video"===b(c,"type")?'<video class="media" muted webkit-playsinline playsinline preload="auto" src="'.concat(b(c,"src"),'" ').concat(b(c,"type"),'></video>\n<b class="tip muted">').concat(h("language","unmute"),"</b>"):'<img loading="auto" class="media" src="'.concat(b(c,"src"),'" ').concat(b(c,"type")," />\n"),
  "\n\n").concat(b(c,"link")?'<a class="tip link" href="'.concat(b(c,"link"),'" rel="noopener" target="_blank">\n').concat(b(c,"linkText")&&""!==b(c,"linkText")?b(c,"linkText"):h("language","visitLink"),"\n</a>"):"","\n</div>")}},language:{unmute:"Touch to unmute",keyboardTip:"Press space to see next",visitLink:"Visit link",time:{ago:"ago",hour:"hour ago",hours:"hours ago",minute:"minute ago",minutes:"minutes ago",fromnow:"from now",seconds:"seconds ago",yesterday:"yesterday",tomorrow:"tomorrow",days:"days ago"}}},
  z=function(){var a=f("#zuck-modal");a||d.hasModal||(d.hasModal=!0,a=document.createElement("div"),a.id="zuck-modal",h("cubeEffect")&&(a.className="with-cube"),a.innerHTML='<div id="zuck-modal-content"></div>',a.style.display="none",a.setAttribute("tabIndex","1"),a.onkeyup=function(a){a=a.keyCode;27===a?z.close():(13===a||32===a)&&z.next()},h("openEffect")&&a.classList.add("with-effects"),R(a,function(){a.classList.contains("closed")&&(e.innerHTML="",a.style.display="none",a.classList.remove("closed"),
  a.classList.remove("animated"))}),document.body.appendChild(a));var e=f("#zuck-modal-content"),c=function(a){var c=f("#zuck-modal"),b="",e="",g=0,p=f("#zuck-modal-slider-".concat(k)),r={previous:f("#zuck-modal .story-viewer.previous"),next:f("#zuck-modal .story-viewer.next"),viewing:f("#zuck-modal .story-viewer.viewing")};if(!r.previous&&!a||!r.next&&a)return!1;a?(b="next",e="previous"):(b="previous",e="next");h("cubeEffect")?"previous"===b?g=c.slideWidth:"next"===b&&(g=-1*c.slideWidth):g=-1*y(r[b])[0];
  w(p,g,600,null);setTimeout(function(){if(""!==b&&r[b]&&""!==e){var a=r[b].getAttribute("data-story-id");d.internalData.currentStory=a;var c=f("#zuck-modal .story-viewer.".concat(e));c&&c.parentNode.removeChild(c);r.viewing&&(r.viewing.classList.add("stopped"),r.viewing.classList.add(e),r.viewing.classList.remove("viewing"));r[b]&&(r[b].classList.remove("stopped"),r[b].classList.remove(b),r[b].classList.add("viewing"));(c=H(b))&&q(c,b);var g=d.internalData.currentStory;if(c=f('#zuck-modal [data-story-id="'.concat(g,
  '"]'))){c=c.querySelectorAll("[data-index].active");var A=c[0].firstElementChild;d.data[g].currentItem=parseInt(c[0].getAttribute("data-index"),10);c[0].innerHTML='<b style="'.concat(A.style.cssText,'"></b>');M(c[0].firstElementChild,function(){d.nextItem(!1)})}w(p,"0",0,null);c&&(a=f('#zuck-modal .story-viewer[data-story-id="'.concat(a,'"]')),D(a,[c[0],c[1]],!0));h("callbacks","onView")(d.internalData.currentStory)}},650)},q=function(a,c,e){var g=f("#zuck-modal-slider-".concat(k)),q=b(a,"items");
  a.timeAgo=q&&q[0]?G(b(q[0],"time")):"";var A="",p="",m=b(a,"id"),l=document.createElement("div"),n=b(a,"currentItem")||0;if(f('#zuck-modal .story-viewer[data-story-id="'.concat(m,'"]')))return!1;l.className="slides";v(q,function(c,d){d.timeAgo=G(b(d,"time"));n>c&&(a.items[c].timeAgo=d.timeAgo,a.items[c].seen=!0,d.seen=!0);p+=h("template","viewerItemPointer")(c,n,d);A+=h("template","viewerItemBody")(c,n,d)});l.innerHTML=A;var t=l.querySelector("video"),J=function(a){a.muted?u.classList.add("muted"):
  u.classList.remove("muted")};t&&(t.onwaiting=function(a){t.paused&&(u.classList.add("paused"),u.classList.add("loading"))},t.onplay=function(){J(t);u.classList.remove("stopped");u.classList.remove("paused");u.classList.remove("loading")},t.onload=t.onplaying=t.oncanplay=function(){J(t);u.classList.remove("loading")},t.onvolumechange=function(){J(t)});q=document.createElement("div");q.innerHTML=h("template","viewerItem")(a,n);var u=q.firstElementChild;u.className="story-viewer muted ".concat(c," ").concat(e?
  "":"stopped"," ").concat(h("backButton")?"with-back-button":"");u.setAttribute("data-story-id",m);u.querySelector(".slides-pointers .wrap").innerHTML=p;v(u.querySelectorAll(".close, .back"),function(a,c){c.onclick=function(a){a.preventDefault();z.close()}});u.appendChild(l);"viewing"===c&&D(u,u.querySelectorAll('[data-index="'.concat(n,'"].active')),!1);v(u.querySelectorAll(".slides-pointers [data-index] > b"),function(a,c){M(c,function(){d.nextItem(!1)})});"previous"===c?F(g,u):g.appendChild(u)},
  p=function(a){var b=f("#zuck-modal"),e,g=void 0,q=void 0,p=void 0,r=void 0,m=void 0,k=function(c){var d=f("#zuck-modal .viewing");if("A"===c.target.nodeName)return!0;c.preventDefault();c=c.touches?c.touches[0]:c;var h=y(f("#zuck-modal .story-viewer.viewing"));b.slideWidth=f("#zuck-modal .story-viewer").offsetWidth;e=h[0];g={x:c.pageX,y:c.pageY,time:Date.now()};q=void 0;p={};a.addEventListener("mousemove",l);a.addEventListener("mouseup",t);a.addEventListener("mouseleave",t);a.addEventListener("touchmove",
  l);a.addEventListener("touchend",t);d&&d.classList.add("paused");S();r=setTimeout(function(){d.classList.add("longPress")},600);m=setTimeout(function(){clearInterval(m);m=!1},250)},l=function(c){var d=c.touches?c.touches[0]:c,b=d.pageX;d=d.pageY;g&&(p={x:b-g.x,y:d-g.y},"undefined"===typeof q&&(q=!!(q||Math.abs(p.x)<Math.abs(p.y))),!q&&g&&(c.preventDefault(),w(a,e+p.x,0,null)))},t=function I(A){var k=f("#zuck-modal .viewing"),u=g;if(p){var B=g?Date.now()-g.time:void 0;B=300>Number(B)&&25<Math.abs(p.x)||
  Math.abs(p.x)>b.slideWidth/3;var t=0>p.x,v=t?f("#zuck-modal .story-viewer.next"):f("#zuck-modal .story-viewer.previous");q||(!B||t&&!v||!t&&!v?w(a,e,300):c(t));g=void 0;a.removeEventListener("mousemove",l);a.removeEventListener("mouseup",I);a.removeEventListener("mouseleave",I);a.removeEventListener("touchmove",l);a.removeEventListener("touchend",I)}B=d.internalData.currentVideoElement;r&&clearInterval(r);k&&(D(k,k.querySelectorAll(".active"),!1),k.classList.remove("longPress"),k.classList.remove("paused"));
  if(m)if(clearInterval(m),m=!1,k=function(){u.x>n.screen.width/3||!h("previousTap")?d.navigateItem("next",A):d.navigateItem("previous",A)},(t=f("#zuck-modal .viewing"))&&B)t.classList.contains("muted")?N(B,t):k();else return k(),!1};a.addEventListener("touchstart",k);a.addEventListener("mousedown",k)};return{show:function(a,c){var b=f("#zuck-modal");h("callbacks","onOpen")(a,function(){e.innerHTML='<div id="zuck-modal-slider-'.concat(k,'" class="slider"></div>');var c=d.data[a],g=c.currentItem||0,
  m=f("#zuck-modal-slider-".concat(k));p(m);d.internalData.currentStory=a;c.currentItem=g;h("backNative")&&(n.location.hash="#!".concat(k));(g=H("previous"))&&q(g,"previous");q(c,"viewing",!0);(c=H("next"))&&q(c,"next");h("autoFullScreen")&&b.classList.add("fullscreen");var l=function(){b.classList.contains("fullscreen")&&h("autoFullScreen")&&1024>=n.screen.width&&L(b);b.focus()};h("openEffect")?(c=f("#".concat(k,' [data-id="').concat(a,'"] .item-preview')),g=y(c),b.style.marginLeft="".concat(g[0]+
  c.offsetWidth/2,"px"),b.style.marginTop="".concat(g[1]+c.offsetHeight/2,"px"),b.style.display="block",b.slideWidth=f("#zuck-modal .story-viewer").offsetWidth,setTimeout(function(){b.classList.add("animated")},10),setTimeout(function(){l()},300)):(b.style.display="block",b.slideWidth=f("#zuck-modal .story-viewer").offsetWidth,l());h("callbacks","onView")(a)})},next:function(a){h("callbacks","onEnd")(d.internalData.currentStory,function(){var a=d.internalData.currentStory,b=f("#".concat(k,' [data-id="').concat(a,
  '"]'));b&&(b.classList.add("seen"),d.data[a].seen=!0,d.internalData.seenItems[a]=!0,O("seenItems",d.internalData.seenItems),K());f("#zuck-modal .story-viewer.next")?c(!0):z.close()})},close:function(){var a=f("#zuck-modal");h("callbacks","onClose")(d.internalData.currentStory,function(){h("backNative")&&(n.location.hash="");L(a,!0);h("openEffect")?a.classList.add("closed"):(e.innerHTML="",a.style.display="none")})}}}(),C=function(a,b){var c=a.getAttribute("data-id"),e=document.querySelectorAll("#".concat(k,
  ' [data-id="').concat(c,'"] .items > li')),f=[];if(!h("reactive")||b)v(e,function(a,c){var b=c.firstElementChild,d=b.firstElementChild;f.push({id:b.getAttribute("data-id"),src:b.getAttribute("href"),length:b.getAttribute("data-length"),type:b.getAttribute("data-type"),time:b.getAttribute("data-time"),link:b.getAttribute("data-link"),linkText:b.getAttribute("data-linkText"),preview:d.getAttribute("src")})}),d.data[c].items=f,(c=h("callbacks","onDataUpdate"))&&c(d.data,function(){})},P=function(a,b){var c=
  a.getAttribute("data-id"),e=!1;d.internalData.seenItems[c]&&(e=!0);try{d.data[c]||(d.data[c]={}),d.data[c].id=c,d.data[c].photo=a.getAttribute("data-photo"),d.data[c].name=a.querySelector(".name").innerText,d.data[c].link=a.querySelector(".item-link").getAttribute("href"),d.data[c].lastUpdated=a.getAttribute("data-last-updated"),d.data[c].seen=e,d.data[c].items||(d.data[c].items=[],d.data[c].noItems=!0)}catch(p){d.data[c]={items:[]}}a.onclick=function(a){a.preventDefault();z.show(c)};(e=h("callbacks",
  "onDataUpdate"))&&e(d.data,function(){})},H=function(a){var b=d.internalData.currentStory;a="".concat(a,"ElementSibling");return b&&(b=f("#".concat(k,' [data-id="').concat(b,'"]'))[a])?(b=b.getAttribute("data-id"),d.data[b]||!1):!1},K=function(){v(document.querySelectorAll("#".concat(k," .story.seen")),function(a,b){var c=d.data[b.getAttribute("data-id")],e=b.parentNode;h("reactive")||e.removeChild(b);d.update(c,!0)})},D=function(a,b,c){var e=b[1],f=b[0];if(!e||!f)return!1;(b=d.internalData.currentVideoElement)&&
  b.pause();if("video"===e.getAttribute("data-type")){var g=e.getElementsByTagName("video")[0];if(!g)return d.internalData.currentVideoElement=!1;e=function(){g.duration&&x(f.getElementsByTagName("b")[0].style,"AnimationDuration","".concat(g.duration,"s"))};e();g.addEventListener("loadedmetadata",e);d.internalData.currentVideoElement=g;g.play();c&&c.target&&N(g,a)}else d.internalData.currentVideoElement=!1},S=function(){var a=d.internalData.currentVideoElement;if(a)try{a.pause()}catch(e){}},N=function(a,
  b){a.muted=!1;a.volume=1;a.removeAttribute("muted");a.play();a.paused&&(a.muted=!0,a.play());b&&b.classList.remove("paused")},O=function(a,b){try{if(h("localStorage")){var c="zuck-".concat(k,"-").concat(a);n.localStorage[c]=JSON.stringify(b)}}catch(q){}},Q=function(a){return h("localStorage")?(a="zuck-".concat(k,"-").concat(a),n.localStorage[a]?JSON.parse(n.localStorage[a]):!1):!1};d.data=h("stories")||{};d.internalData={};d.internalData.seenItems=Q("seenItems")||{};d.add=d.update=function(a,e){var c=
  b(a,"id"),q=f("#".concat(k,' [data-id="').concat(c,'"]')),p=b(a,"items"),g=void 0;g=!1;p[0]&&(g=p[0].preview||"");!0===d.internalData.seenItems[c]&&(a.seen=!0);a.currentPreview=g;q?g=q:(g=document.createElement("div"),g.innerHTML=h("template","timelineItem")(a),g=g.firstElementChild);!1===a.seen&&(d.internalData.seenItems[c]=!1,O("seenItems",d.internalData.seenItems));g.setAttribute("data-id",c);g.setAttribute("data-photo",b(a,"photo"));g.setAttribute("data-last-updated",b(a,"lastUpdated"));P(g);
  q||h("reactive")||(e?m.appendChild(g):F(m,g));v(p,function(a,b){d.addItem(c,b,e)});e||K()};d.next=function(){z.next()};d.remove=function(a){a=f("#".concat(k,' > [data-id="').concat(a,'"]'));a.parentNode.removeChild(a)};d.addItem=function(a,d,c){a=f("#".concat(k,' > [data-id="').concat(a,'"]'));if(!h("reactive")){var e=document.createElement("li"),p=a.querySelectorAll(".items")[0];e.className=b(d,"seen")?"seen":"";e.setAttribute("data-id",b(d,"id"));e.innerHTML=h("template","timelineStoryItem")(d);
  c?p.appendChild(e):F(p,e)}C(a)};d.removeItem=function(a,b){var c=f("#".concat(k,' > [data-id="').concat(a,'"] [data-id="').concat(b,'"]'));h("reactive")||m.parentNode.removeChild(c)};d.navigateItem=d.nextItem=function(a,b){var c=d.internalData.currentStory,e=d.data[c].currentItem,k=f('#zuck-modal .story-viewer[data-story-id="'.concat(c,'"]')),g="previous"===a?-1:1;if(!k||1===k.touchMove)return!1;var m=k.querySelectorAll('[data-index="'.concat(e,'"]')),l=m[0],n=m[1],w=k.querySelectorAll('[data-index="'.concat(e+
  g,'"]')),y=w[0],r=w[1];k&&y&&r?(e=(e=h("callbacks","onNavigateItem"))?h("callbacks","onNavigateItem"):h("callbacks","onNextItem"),e(c,r.getAttribute("data-story-id"),function(){"previous"===a?(l.classList.remove("seen"),n.classList.remove("seen")):(l.classList.add("seen"),n.classList.add("seen"));l.classList.remove("active");n.classList.remove("active");y.classList.remove("seen");y.classList.add("active");r.classList.remove("seen");r.classList.add("active");v(k.querySelectorAll(".time"),function(a,
  b){b.innerText=G(r.getAttribute("data-time"))});d.data[c].currentItem+=g;D(k,w,b)})):k&&"previous"!==a&&z.next(b)};return function(){m&&m.querySelector(".story")&&v(m.querySelectorAll(".story"),function(a,b){P(b)});h("backNative")&&(n.location.hash==="#!".concat(k)&&(n.location.hash=""),n.addEventListener("popstate",function(a){n.location.hash!=="#!".concat(k)&&(n.location.hash="")},!1));if(!h("reactive")){var a=Q("seenItems");for(b in a)a.hasOwnProperty(b)&&d.data[b]&&(d.data[b].seen=a[b])}v(h("stories"),
  function(a,b){d.add(b,!0)});K();a=h("avatars")?"user-icon":"story-preview";var b=h("list")?"list":"carousel";m.className+=" stories ".concat(a," ").concat(b," ").concat("".concat(h("skin")).toLowerCase());return d}()};l.buildTimelineItem=function(b,f,d,h,n,w){var m={id:b,photo:f,name:d,link:h,lastUpdated:n,items:[]};v(w,function(b,d){m.items.push(l.buildStoryItem.apply(l,d))});return m};l.buildStoryItem=function(b,f,d,h,l,n,v,x,k){return{id:b,type:f,length:d,src:h,preview:l,link:n,linkText:v,seen:x,
  time:k}};l.buildItem=l.buildStoryItem;"undefined"!==typeof exports?("undefined"!==typeof module&&module.exports&&(exports=module.exports=l),exports.ZuckJS=l):n.ZuckitaDaGalera=n.Zuck=l;return l})(window);  