define(["exports","jquery","./Plugin","./Site"],function(e,t,n,l){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=a(t),o=a(l);function a(e){return e&&e.__esModule?e:{default:e}}var r=function(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),e};function s(e,t){for(var n=0;n<t.length;n++){var l=t[n];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(e,l.key,l)}}function c(e,t,n){null===e&&(e=Function.prototype);var l=Object.getOwnPropertyDescriptor(e,t);if(void 0===l){var i=Object.getPrototypeOf(e);return null===i?void 0:c(i,t,n)}if("value"in l)return l.value;var o=l.get;return void 0!==o?o.call(n):void 0}var u=(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(f,o.default),r(f,[{key:"initialize",value:function(){c(f.prototype.__proto__||Object.getPrototypeOf(f.prototype),"initialize",this).call(this),this.handlSlidePanelPlugin()}},{key:"process",value:function(){c(f.prototype.__proto__||Object.getPrototypeOf(f.prototype),"process",this).call(this),this.bindSlidePanelPlugin()}},{key:"handlSlidePanelPlugin",value:function(){var e=this;this.slidepanelOptions=i.default.extend({},(0,n.getDefaults)("slidePanel"),{template:function(e){return'<div class="'+e.classes.base+" "+e.classes.base+"-"+e.direction+'">\n                  <div class="'+e.classes.base+'-scrollable">\n                    <div><div class="'+e.classes.content+'"></div></div>\n                  </div>\n                  <div class="'+e.classes.base+'-handler"></div>\n                </div>'},afterLoad:function(){this.$panel.find("."+this.options.classes.base+"-scrollable").asScrollable({namespace:"scrollable",contentSelector:">",containerSelector:">"}),e.initializePlugins(this.$panel)},afterShow:function(){var t=this;(0,i.default)(document).on("click.slidePanelShow",function(e){0===(0,i.default)(e.target).closest(".slidePanel").length&&1===(0,i.default)(e.target).closest("html").length&&t.hide()})},afterHide:function(){(0,i.default)(document).off("click.slidePanelShow"),(0,i.default)(document).off("click.slidePanelDatepicker")}},this.getSlidePanelOptions())}},{key:"bindSlidePanelPlugin",value:function(){var t=this;(0,i.default)(document).on("click",'[data-toggle="slidePanel"]',function(e){t.openSlidePanel((0,i.default)(this).data("url")),e.stopPropagation()})}},{key:"getSlidePanelOptions",value:function(){return{}}},{key:"openSlidePanel",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"";i.default.slidePanel.show({url:e,settings:{cache:!1}},this.slidepanelOptions)}}]),f);function f(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,f),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}e.default=u});