!function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define("vAnchor",[],t):"object"===typeof exports?exports.vAnchor=t():e.vAnchor=t()}("undefined"!==typeof self?self:this,(function(){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s="aP0J")}({Nkoo:function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(o){"object"===typeof window&&(n=window)}e.exports=n},aP0J:function(e,t,n){"use strict";n.r(t);var o=n("g8md"),r={cssClasses:{outer:"v-anchor--html",inner:"v-anchor"},body:null,offset:0},c=function(e){var t=document.querySelector(e);t?r.body.scrollTop=t.offsetTop-r.offset:console.warn("[v-anchor]","Invalid anchor: ".concat(e))},i=function(e,t,n){var o=n.value,i=n.arg,u=n.modifiers;switch(i){case"href":t.dataset.href=o,t["".concat(e,"EventListener")]("click",(function(){c(o)}));break;case"id":t.setAttribute("id",o)}u.html&&t.classList[e](r.cssClasses.outer)},u=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document,n=t.querySelectorAll(".".concat(r.cssClasses.outer," .").concat(r.cssClasses.inner));n.length&&n.forEach((function(t){t["".concat(e,"EventListener")]("click",(function(){c(t.dataset.href)}))}))},f={name:"anchor",bind:function(e,t){i("add",e,t)},inserted:function(e,t){!function(e,t){var n=t.value,o=t.rawName,c=t.modifiers;(o===r.cssClasses.inner||o.includes("."))&&(r.body=c.bodyElement?e:document.documentElement||document.body,r.offset=c.offset?n:r.body.dataset.vanchorOffset||0)}(e,t),t.modifiers.html&&u("add")},update:function(e,t,n){t.modifiers.html&&n.context.$nextTick((function(){u("add",n.context.$el)}))},unbind:function(e,t){e===r.body&&(r.body=document.documentElement||document.body),i("remove",e,t),t.modifiers.html&&u("remove")}};Object(o.a)(f,"directive"),t.default=f},g8md:function(e,t,n){"use strict";(function(e){t.a=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default",o=null;"undefined"!==typeof window?o=window.Vue:"undefined"!==typeof e&&(o=e.Vue),o&&("directive"===n?o.directive(t.name,t):o.use(t))}}).call(this,n("Nkoo"))}}).default}));