!function(t,e){"function"==typeof define&&define.amd?define(["tether"],e):"object"==typeof exports?module.exports=e(require("tether")):t.Shepherd=e(t.Tether)}(this,function(t){"use strict";function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function i(t){return"undefined"==typeof t}function r(t){return t&&t.constructor===Array}function o(t){return t&&t.constructor===Object}function s(t){return"object"==typeof t}function h(t){var e=document.createElement("div");return e.innerHTML=t,e.children[0]}function c(t,e){var n=void 0;return i(t.matches)?i(t.matchesSelector)?i(t.msMatchesSelector)?i(t.webkitMatchesSelector)?i(t.mozMatchesSelector)?i(t.oMatchesSelector)||(n=t.oMatchesSelector):n=t.mozMatchesSelector:n=t.webkitMatchesSelector:n=t.msMatchesSelector:n=t.matchesSelector:n=t.matches,n.call(t,e)}function l(t){if(s(t))return t.hasOwnProperty("element")&&t.hasOwnProperty("on")?t:null;var e=S.exec(t);if(!e)return null;var n=e[2];return"["===n[0]&&(n=n.substring(1,n.length-1)),{element:e[1],on:n}}function a(t,e){if(null===t||i(t))return t;if(s(t))return t;for(var n=t.split(" "),r={},o=e.length-1,h=n.length-1;h>=0;h--){if(0===o){r[e[o]]=n.slice(0,h+1).join(" ");break}r[e[o]]=n[h],o--}return r}var u=function(){function t(t,e){for(var n=0;n");var e=document.createElement("div");e.className="shepherd-content",this.el.appendChild(e);var n=document.createElement("header");if(e.appendChild(n),this.options.title&&(n.innerHTML+="

"+this.options.title+"

",this.el.className+=" shepherd-has-title"),this.options.showCancelLink){var r=h("");n.appendChild(r),this.el.className+=" shepherd-has-cancel-link",this.bindCancelLink(r)}i(this.options.text)||!function(){var n=h("
"),i=t.options.text;"function"==typeof i&&(i=i.call(t,n)),i instanceof HTMLElement?n.appendChild(i):("string"==typeof i&&(i=[i]),i.map(function(t){n.innerHTML+="

"+t+"

"})),e.appendChild(n)}(),this.options.buttons&&!function(){var n=document.createElement("footer"),i=h("");t.options.buttons.map(function(e){var n=h("
  • "+e.text+"");i.appendChild(n),t.bindButtonEvents(e,n.querySelector("a"))}),n.appendChild(i),e.appendChild(n)}(),document.body.appendChild(this.el),this.setupTether(),this.options.advanceOn&&this.bindAdvance()}},{key:"bindCancelLink",value:function(t){var e=this;t.addEventListener("click",function(t){t.preventDefault(),e.cancel()})}},{key:"bindButtonEvents",value:function(t,e){var n=this;t.events=t.events||{},i(t.action)||(t.events.click=t.action);for(var r in t.events)if({}.hasOwnProperty.call(t.events,r)){var o=t.events[r];"string"==typeof o&&!function(){var t=o;o=function(){return n.tour.show(t)}}(),e.addEventListener(r,o)}this.on("destroy",function(){for(var n in t.events)if({}.hasOwnProperty.call(t.events,n)){var i=t.events[n];e.removeEventListener(n,i)}})}}]),p}(f),T=function(t){function r(){var t=this,n=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];e(this,r),d(Object.getPrototypeOf(r.prototype),"constructor",this).call(this,n),this.bindMethods(),this.options=n,this.steps=this.options.steps||[];var i=["complete","cancel","hide","start","show","active","inactive"];return i.map(function(e){!function(e){t.on(e,function(n){n=n||{},n.tour=t,w.trigger(e,n)})}(e)}),this}return n(r,t),u(r,[{key:"bindMethods",value:function(){var t=this,e=["next","back","cancel","complete","hide"];e.map(function(e){t[e]=t[e].bind(t)})}},{key:"addStep",value:function(t,e){return i(e)&&(e=t),e instanceof O?e.tour=this:("string"!=typeof t&&"number"!=typeof t||(e.id=t.toString()),e=m({},this.options.defaults,e),e=new O(this,e)),this.steps.push(e),this}},{key:"removeStep",value:function(t){for(var e=this.getCurrentStep(),n=0;n