/*! ScrollMagic v2.0.7 | (c) 2019 Jan Paepke (@janpaepke) | license & info: http://scrollmagic.io */
!function(n,t){"function"==typeof define&&define.amd?define(["ScrollMagic"],t):"object"==typeof exports?t(require("scrollmagic")):t(n.ScrollMagic||n.jQuery&&n.jQuery.ScrollMagic)}(this,function(n){"use strict";var r="0.85em",u="9999",t=n._util,f=0,e,i;n.Scene.extend(function(){var i,n=this;n.addIndicators=function(r){if(!i)r=t.extend({},{name:"",indent:0,parent:void 0,colorStart:"green",colorEnd:"red",colorTrigger:"blue"},r),f++,i=new e(n,r),n.on("add.plugin_addIndicators",i.add),n.on("remove.plugin_addIndicators",i.remove),n.on("destroy.plugin_addIndicators",n.removeIndicators),n.controller()&&i.add();return n};n.removeIndicators=function(){return i&&(i.remove(),this.off("*.plugin_addIndicators"),i=void 0),n}});n.Controller.addOption("addIndicators",!1);n.Controller.extend(function(){var o=this,h=o.info(),i=h.container,s=h.isDocument,r=h.vertical,f={groups:[]},e,u;return this._indicators=f,e=function(){f.updateBoundsPositions()},u=function(){f.updateTriggerGroupPositions()},i.addEventListener("resize",u),s||(window.addEventListener("resize",u),window.addEventListener("scroll",u)),i.addEventListener("resize",e),i.addEventListener("scroll",e),this._indicators.updateBoundsPositions=function(n){for(var u,o,e,s=n?[t.extend({},n.triggerGroup,{members:[n]})]:f.groups,h=s.length,c={},l=r?"left":"top",a=r?"width":"height",v=r?t.get.scrollLeft(i)+t.get.width(i)-15:t.get.scrollTop(i)+t.get.height(i)-15;h--;)for(u=(e=s[h]).members.length,o=t.get[a](e.element.firstChild);u--;)c[l]=v-o,t.css(e.members[u].bounds,c)},this._indicators.updateTriggerGroupPositions=function(n){for(var u,e,h,c,l=n?[n]:f.groups,a=l.length,p=s?document.body:i,v=s?{top:0,left:0}:t.get.offset(p,!0),y=r?t.get.width(i)-15:t.get.height(i)-15,w=r?"width":"height",b=r?"Y":"X";a--;)e=(u=l[a]).element,h=u.triggerHook*o.info("size"),c=t.get[w](e.firstChild.firstChild)<h?"translate"+b+"(-100%)":"",t.css(e,{top:v.top+(r?h:y-u.members[0].options.indent),left:v.left+(r?y-u.members[0].options.indent:h)}),t.css(e.firstChild.firstChild,{"-ms-transform":c,"-webkit-transform":c,transform:c})},this._indicators.updateTriggerGroupLabel=function(n){var t="trigger"+(1<n.members.length?"":" "+n.members[0].options.name),i=n.element.firstChild.firstChild;i.textContent!==t&&(i.textContent=t,r&&f.updateBoundsPositions())},this.addScene=function(t){this._options.addIndicators&&t instanceof n.Scene&&t.controller()===o&&t.addIndicators();this.$super.addScene.apply(this,arguments)},this.destroy=function(){i.removeEventListener("resize",u);s||(window.removeEventListener("resize",u),window.removeEventListener("scroll",u));i.removeEventListener("resize",e);i.removeEventListener("scroll",e);this.$super.destroy.apply(this,arguments)},o});e=function(n,r){var s,e,u=this,o=i.bounds(),l=i.start(r.colorStart),c=i.end(r.colorEnd),h=r.parent&&t.get.elements(r.parent)[0];r.name=r.name||f;l.firstChild.textContent+=" "+r.name;c.textContent+=" "+r.name;o.appendChild(l);o.appendChild(c);u.options=r;u.bounds=o;u.triggerGroup=void 0;this.add=function(){e=n.controller();s=e.info("vertical");var i=e.info("isDocument");h||(h=i?document.body:e.info("container"));i||"static"!==t.css(h,"position")||t.css(h,{position:"relative"});n.on("change.plugin_addIndicators",v);n.on("shift.plugin_addIndicators",a);w();y();setTimeout(function(){e._indicators.updateBoundsPositions(u)},0)};this.remove=function(){if(u.triggerGroup){if(n.off("change.plugin_addIndicators",v),n.off("shift.plugin_addIndicators",a),1<u.triggerGroup.members.length){var t=u.triggerGroup;t.members.splice(t.members.indexOf(u),1);e._indicators.updateTriggerGroupLabel(t);e._indicators.updateTriggerGroupPositions(t);u.triggerGroup=void 0}else p();b()}};var a=function(){y()},v=function(n){"triggerHook"===n.what&&w()},b=function(){o.parentNode.removeChild(o)},y=function(){var i,u;o.parentNode!==h&&(i=e.info("vertical"),t.css(l.firstChild,{"border-bottom-width":i?1:0,"border-right-width":i?0:1,bottom:i?-1:r.indent,right:i?r.indent:-1,padding:i?"0 8px":"2px 4px"}),t.css(c,{"border-top-width":i?1:0,"border-left-width":i?0:1,top:i?"100%":"",right:i?r.indent:"",bottom:i?"":r.indent,left:i?"":"100%",padding:i?"0 8px":"2px 4px"}),h.appendChild(o));u={};u[s?"top":"left"]=n.triggerPosition();u[s?"height":"width"]=n.duration();t.css(o,u);t.css(c,{display:0<n.duration()?"":"none"})},p=function(){e._indicators.groups.splice(e._indicators.groups.indexOf(u.triggerGroup),1);u.triggerGroup.element.parentNode.removeChild(u.triggerGroup.element);u.triggerGroup=void 0},w=function(){var o=n.triggerHook(),f,h,c;if(!(u.triggerGroup&&Math.abs(u.triggerGroup.triggerHook-o)<.0001)){for(h=e._indicators.groups,c=h.length;c--;)if(f=h[c],Math.abs(f.triggerHook-o)<.0001)return u.triggerGroup&&(1===u.triggerGroup.members.length?p():(u.triggerGroup.members.splice(u.triggerGroup.members.indexOf(u),1),e._indicators.updateTriggerGroupLabel(u.triggerGroup),e._indicators.updateTriggerGroupPositions(u.triggerGroup))),f.members.push(u),u.triggerGroup=f,void e._indicators.updateTriggerGroupLabel(f);if(u.triggerGroup){if(1===u.triggerGroup.members.length)return u.triggerGroup.triggerHook=o,void e._indicators.updateTriggerGroupPositions(u.triggerGroup);u.triggerGroup.members.splice(u.triggerGroup.members.indexOf(u),1);e._indicators.updateTriggerGroupLabel(u.triggerGroup);e._indicators.updateTriggerGroupPositions(u.triggerGroup);u.triggerGroup=void 0}!function(){var o=i.trigger(r.colorTrigger),h={},f;h[s?"right":"bottom"]=0;h[s?"border-top-width":"border-left-width"]=1;t.css(o.firstChild,h);t.css(o.firstChild.firstChild,{padding:s?"0 8px 3px 8px":"3px 4px"});document.body.appendChild(o);f={triggerHook:n.triggerHook(),element:o,members:[u]};e._indicators.groups.push(f);u.triggerGroup=f;e._indicators.updateTriggerGroupLabel(f);e._indicators.updateTriggerGroupPositions(f)}()}}};i={start:function(n){var r=document.createElement("div"),i;return r.textContent="start",t.css(r,{position:"absolute",overflow:"visible","border-width":0,"border-style":"solid",color:n,"border-color":n}),i=document.createElement("div"),t.css(i,{position:"absolute",overflow:"visible",width:0,height:0}),i.appendChild(r),i},end:function(n){var i=document.createElement("div");return i.textContent="end",t.css(i,{position:"absolute",overflow:"visible","border-width":0,"border-style":"solid",color:n,"border-color":n}),i},bounds:function(){var n=document.createElement("div");return t.css(n,{position:"absolute",overflow:"visible","white-space":"nowrap","pointer-events":"none","font-size":r}),n.style.zIndex=u,n},trigger:function(n){var e=document.createElement("div"),f,i;return e.textContent="trigger",t.css(e,{position:"relative"}),f=document.createElement("div"),t.css(f,{position:"absolute",overflow:"visible","border-width":0,"border-style":"solid",color:n,"border-color":n}),f.appendChild(e),i=document.createElement("div"),t.css(i,{position:"fixed",overflow:"visible","white-space":"nowrap","pointer-events":"none","font-size":r}),i.style.zIndex=u,i.appendChild(f),i}}})