this.wp=this.wp||{},this.wp.a11y=function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s="jncB")}({Y8OO:function(t,e){t.exports=window.wp.domReady},jncB:function(t,e,n){"use strict";n.r(e),n.d(e,"setup",(function(){return u})),n.d(e,"speak",(function(){return d}));var i=n("Y8OO"),o=n.n(i),r=n("l3Sj");function a(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"polite";const e=document.createElement("div");e.id="a11y-speak-"+t,e.className="a11y-speak-region",e.setAttribute("style","position: absolute;margin: -1px;padding: 0;height: 1px;width: 1px;overflow: hidden;clip: rect(1px, 1px, 1px, 1px);-webkit-clip-path: inset(50%);clip-path: inset(50%);border: 0;word-wrap: normal !important;"),e.setAttribute("aria-live",t),e.setAttribute("aria-relevant","additions text"),e.setAttribute("aria-atomic","true");const{body:n}=document;return n&&n.appendChild(e),e}let p="";function u(){const t=document.getElementById("a11y-speak-intro-text"),e=document.getElementById("a11y-speak-assertive"),n=document.getElementById("a11y-speak-polite");null===t&&function(){const t=document.createElement("p");t.id="a11y-speak-intro-text",t.className="a11y-speak-intro-text",t.textContent=Object(r.__)("Notifications"),t.setAttribute("style","position: absolute;margin: -1px;padding: 0;height: 1px;width: 1px;overflow: hidden;clip: rect(1px, 1px, 1px, 1px);-webkit-clip-path: inset(50%);clip-path: inset(50%);border: 0;word-wrap: normal !important;"),t.setAttribute("hidden","hidden");const{body:e}=document;e&&e.appendChild(t)}(),null===e&&a("assertive"),null===n&&a("polite")}function d(t,e){!function(){const t=document.getElementsByClassName("a11y-speak-region"),e=document.getElementById("a11y-speak-intro-text");for(let e=0;e<t.length;e++)t[e].textContent="";e&&e.setAttribute("hidden","hidden")}(),t=function(t){return t=t.replace(/<[^<>]+>/g," "),p===t&&(t+=" "),p=t,t}(t);const n=document.getElementById("a11y-speak-intro-text"),i=document.getElementById("a11y-speak-assertive"),o=document.getElementById("a11y-speak-polite");i&&"assertive"===e?i.textContent=t:o&&(o.textContent=t),n&&n.removeAttribute("hidden")}o()(u)},l3Sj:function(t,e){t.exports=window.wp.i18n}});
!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","./menu","./core"],e):e(jQuery)}(function(o){"use strict";return o.widget("ui.autocomplete",{version:"1.13.0",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var i,s,n,e=this.element[0].nodeName.toLowerCase(),t="textarea"===e,e="input"===e;this.isMultiLine=t||!e&&this._isContentEditable(this.element),this.valueMethod=this.element[t||e?"val":"text"],this.isNewMenu=!0,this._addClass("ui-autocomplete-input"),this.element.attr("autocomplete","off"),this._on(this.element,{keydown:function(e){if(this.element.prop("readOnly"))s=n=i=!0;else{s=n=i=!1;var t=o.ui.keyCode;switch(e.keyCode){case t.PAGE_UP:i=!0,this._move("previousPage",e);break;case t.PAGE_DOWN:i=!0,this._move("nextPage",e);break;case t.UP:i=!0,this._keyEvent("previous",e);break;case t.DOWN:i=!0,this._keyEvent("next",e);break;case t.ENTER:this.menu.active&&(i=!0,e.preventDefault(),this.menu.select(e));break;case t.TAB:this.menu.active&&this.menu.select(e);break;case t.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(e),e.preventDefault());break;default:s=!0,this._searchTimeout(e)}}},keypress:function(e){if(i)return i=!1,void(this.isMultiLine&&!this.menu.element.is(":visible")||e.preventDefault());if(!s){var t=o.ui.keyCode;switch(e.keyCode){case t.PAGE_UP:this._move("previousPage",e);break;case t.PAGE_DOWN:this._move("nextPage",e);break;case t.UP:this._keyEvent("previous",e);break;case t.DOWN:this._keyEvent("next",e)}}},input:function(e){if(n)return n=!1,void e.preventDefault();this._searchTimeout(e)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(e){clearTimeout(this.searching),this.close(e),this._change(e)}}),this._initSource(),this.menu=o("<ul>").appendTo(this._appendTo()).menu({role:null}).hide().attr({unselectable:"on"}).menu("instance"),this._addClass(this.menu.element,"ui-autocomplete","ui-front"),this._on(this.menu.element,{mousedown:function(e){e.preventDefault()},menufocus:function(e,t){var i;if(this.isNewMenu&&(this.isNewMenu=!1,e.originalEvent&&/^mouse/.test(e.originalEvent.type)))return this.menu.blur(),void this.document.one("mousemove",function(){o(e.target).trigger(e.originalEvent)});i=t.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",e,{item:i})&&e.originalEvent&&/^key/.test(e.originalEvent.type)&&this._value(i.value),(i=t.item.attr("aria-label")||i.value)&&String.prototype.trim.call(i).length&&(this.liveRegion.children().hide(),o("<div>").text(i).appendTo(this.liveRegion))},menuselect:function(e,t){var i=t.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==o.ui.safeActiveElement(this.document[0])&&(this.element.trigger("focus"),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",e,{item:i})&&this._value(i.value),this.term=this._value(),this.close(e),this.selectedItem=i}}),this.liveRegion=o("<div>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(e,t){this._super(e,t),"source"===e&&this._initSource(),"appendTo"===e&&this.menu.element.appendTo(this._appendTo()),"disabled"===e&&t&&this.xhr&&this.xhr.abort()},_isEventTargetInWidget:function(e){var t=this.menu.element[0];return e.target===this.element[0]||e.target===t||o.contains(t,e.target)},_closeOnClickOutside:function(e){this._isEventTargetInWidget(e)||this.close()},_appendTo:function(){var e=this.options.appendTo;return e=!(e=!(e=e&&(e.jquery||e.nodeType?o(e):this.document.find(e).eq(0)))||!e[0]?this.element.closest(".ui-front, dialog"):e).length?this.document[0].body:e},_initSource:function(){var i,s,n=this;Array.isArray(this.options.source)?(i=this.options.source,this.source=function(e,t){t(o.ui.autocomplete.filter(i,e.term))}):"string"==typeof this.options.source?(s=this.options.source,this.source=function(e,t){n.xhr&&n.xhr.abort(),n.xhr=o.ajax({url:s,data:e,dataType:"json",success:function(e){t(e)},error:function(){t([])}})}):this.source=this.options.source},_searchTimeout:function(s){clearTimeout(this.searching),this.searching=this._delay(function(){var e=this.term===this._value(),t=this.menu.element.is(":visible"),i=s.altKey||s.ctrlKey||s.metaKey||s.shiftKey;e&&(t||i)||(this.selectedItem=null,this.search(null,s))},this.options.delay)},search:function(e,t){return e=null!=e?e:this._value(),this.term=this._value(),e.length<this.options.minLength?this.close(t):!1!==this._trigger("search",t)?this._search(e):void 0},_search:function(e){this.pending++,this._addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:e},this._response())},_response:function(){var t=++this.requestIndex;return function(e){t===this.requestIndex&&this.__response(e),this.pending--,this.pending||this._removeClass("ui-autocomplete-loading")}.bind(this)},__response:function(e){e=e&&this._normalize(e),this._trigger("response",null,{content:e}),!this.options.disabled&&e&&e.length&&!this.cancelSearch?(this._suggest(e),this._trigger("open")):this._close()},close:function(e){this.cancelSearch=!0,this._close(e)},_close:function(e){this._off(this.document,"mousedown"),this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",e))},_change:function(e){this.previous!==this._value()&&this._trigger("change",e,{item:this.selectedItem})},_normalize:function(e){return e.length&&e[0].label&&e[0].value?e:o.map(e,function(e){return"string"==typeof e?{label:e,value:e}:o.extend({},e,{label:e.label||e.value,value:e.value||e.label})})},_suggest:function(e){var t=this.menu.element.empty();this._renderMenu(t,e),this.isNewMenu=!0,this.menu.refresh(),t.show(),this._resizeMenu(),t.position(o.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next(),this._on(this.document,{mousedown:"_closeOnClickOutside"})},_resizeMenu:function(){var e=this.menu.element;e.outerWidth(Math.max(e.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(i,e){var s=this;o.each(e,function(e,t){s._renderItemData(i,t)})},_renderItemData:function(e,t){return this._renderItem(e,t).data("ui-autocomplete-item",t)},_renderItem:function(e,t){return o("<li>").append(o("<div>").text(t.label)).appendTo(e)},_move:function(e,t){if(this.menu.element.is(":visible"))return this.menu.isFirstItem()&&/^previous/.test(e)||this.menu.isLastItem()&&/^next/.test(e)?(this.isMultiLine||this._value(this.term),void this.menu.blur()):void this.menu[e](t);this.search(null,t)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(e,t){this.isMultiLine&&!this.menu.element.is(":visible")||(this._move(e,t),t.preventDefault())},_isContentEditable:function(e){if(!e.length)return!1;var t=e.prop("contentEditable");return"inherit"===t?this._isContentEditable(e.parent()):"true"===t}}),o.extend(o.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(e,t){var i=new RegExp(o.ui.autocomplete.escapeRegex(t),"i");return o.grep(e,function(e){return i.test(e.label||e.value||e)})}}),o.widget("ui.autocomplete",o.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(e){return e+(1<e?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(e){this._superApply(arguments),this.options.disabled||this.cancelSearch||(e=e&&e.length?this.options.messages.results(e.length):this.options.messages.noResults,this.liveRegion.children().hide(),o("<div>").text(e).appendTo(this.liveRegion))}}),o.ui.autocomplete});
!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","./core"],e):e(jQuery)}(function(o){"use strict";var n=!1;return o(document).on("mouseup",function(){n=!1}),o.widget("ui.mouse",{version:"1.13.0",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.on("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).on("click."+this.widgetName,function(e){if(!0===o.data(e.target,t.widgetName+".preventClickEvent"))return o.removeData(e.target,t.widgetName+".preventClickEvent"),e.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(e){if(!n){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(e),this._mouseDownEvent=e;var t=this,s=1===e.which,i=!("string"!=typeof this.options.cancel||!e.target.nodeName)&&o(e.target).closest(this.options.cancel).length;return s&&!i&&this._mouseCapture(e)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){t.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=!1!==this._mouseStart(e),!this._mouseStarted)?(e.preventDefault(),!0):(!0===o.data(e.target,this.widgetName+".preventClickEvent")&&o.removeData(e.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return t._mouseMove(e)},this._mouseUpDelegate=function(e){return t._mouseUp(e)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),e.preventDefault(),n=!0)):!0}},_mouseMove:function(e){if(this._mouseMoved){if(o.ui.ie&&(!document.documentMode||document.documentMode<9)&&!e.button)return this._mouseUp(e);if(!e.which)if(e.originalEvent.altKey||e.originalEvent.ctrlKey||e.originalEvent.metaKey||e.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(e)}return(e.which||e.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,e),this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(e){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&o.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,n=!1,e.preventDefault()},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})});
!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery","./mouse","./core"],t):t(jQuery)}(function(u){"use strict";return u.widget("ui.sortable",u.ui.mouse,{version:"1.13.0",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(t,e,i){return e<=t&&t<e+i},_isFloating:function(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))},_create:function(){this.containerCache={},this._addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(t,e){this._super(t,e),"handle"===t&&this._setHandleClassName()},_setHandleClassName:function(){var t=this;this._removeClass(this.element.find(".ui-sortable-handle"),"ui-sortable-handle"),u.each(this.items,function(){t._addClass(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item,"ui-sortable-handle")})},_destroy:function(){this._mouseDestroy();for(var t=this.items.length-1;0<=t;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(t,e){var i=null,s=!1,o=this;return!this.reverting&&(!this.options.disabled&&"static"!==this.options.type&&(this._refreshItems(t),u(t.target).parents().each(function(){if(u.data(this,o.widgetName+"-item")===o)return i=u(this),!1}),!!(i=u.data(t.target,o.widgetName+"-item")===o?u(t.target):i)&&(!(this.options.handle&&!e&&(u(this.options.handle,i).find("*").addBack().each(function(){this===t.target&&(s=!0)}),!s))&&(this.currentItem=i,this._removeCurrentsFromItems(),!0))))},_mouseStart:function(t,e,i){var s,o,r=this.options;if((this.currentContainer=this).refreshPositions(),this.appendTo=u("parent"!==r.appendTo?r.appendTo:this.currentItem.parent()),this.helper=this._createHelper(t),this._cacheHelperProportions(),this._cacheMargins(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},u.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),r.cursorAt&&this._adjustOffsetFromHelper(r.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),this.scrollParent=this.placeholder.scrollParent(),u.extend(this.offset,{parent:this._getParentOffset()}),r.containment&&this._setContainment(),r.cursor&&"auto"!==r.cursor&&(o=this.document.find("body"),this.storedCursor=o.css("cursor"),o.css("cursor",r.cursor),this.storedStylesheet=u("<style>*{ cursor: "+r.cursor+" !important; }</style>").appendTo(o)),r.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",r.zIndex)),r.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",r.opacity)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!i)for(s=this.containers.length-1;0<=s;s--)this.containers[s]._trigger("activate",t,this._uiHash(this));return u.ui.ddmanager&&(u.ui.ddmanager.current=this),u.ui.ddmanager&&!r.dropBehaviour&&u.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this._addClass(this.helper,"ui-sortable-helper"),this.helper.parent().is(this.appendTo)||(this.helper.detach().appendTo(this.appendTo),this.offset.parent=this._getParentOffset()),this.position=this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,this.lastPositionAbs=this.positionAbs=this._convertPositionTo("absolute"),this._mouseDrag(t),!0},_scroll:function(t){var e=this.options,i=!1;return this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<e.scrollSensitivity?this.scrollParent[0].scrollTop=i=this.scrollParent[0].scrollTop+e.scrollSpeed:t.pageY-this.overflowOffset.top<e.scrollSensitivity&&(this.scrollParent[0].scrollTop=i=this.scrollParent[0].scrollTop-e.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<e.scrollSensitivity?this.scrollParent[0].scrollLeft=i=this.scrollParent[0].scrollLeft+e.scrollSpeed:t.pageX-this.overflowOffset.left<e.scrollSensitivity&&(this.scrollParent[0].scrollLeft=i=this.scrollParent[0].scrollLeft-e.scrollSpeed)):(t.pageY-this.document.scrollTop()<e.scrollSensitivity?i=this.document.scrollTop(this.document.scrollTop()-e.scrollSpeed):this.window.height()-(t.pageY-this.document.scrollTop())<e.scrollSensitivity&&(i=this.document.scrollTop(this.document.scrollTop()+e.scrollSpeed)),t.pageX-this.document.scrollLeft()<e.scrollSensitivity?i=this.document.scrollLeft(this.document.scrollLeft()-e.scrollSpeed):this.window.width()-(t.pageX-this.document.scrollLeft())<e.scrollSensitivity&&(i=this.document.scrollLeft(this.document.scrollLeft()+e.scrollSpeed))),i},_mouseDrag:function(t){var e,i,s,o,r=this.options;if(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),this._contactContainers(t),null!==this.innermostContainer)for(r.scroll&&!1!==this._scroll(t)&&(this._refreshItemPositions(!0),u.ui.ddmanager&&!r.dropBehaviour&&u.ui.ddmanager.prepareOffsets(this,t)),this.dragDirection={vertical:this._getDragVerticalDirection(),horizontal:this._getDragHorizontalDirection()},e=this.items.length-1;0<=e;e--)if(s=(i=this.items[e]).item[0],(o=this._intersectsWithPointer(i))&&i.instance===this.currentContainer&&!(s===this.currentItem[0]||this.placeholder[1===o?"next":"prev"]()[0]===s||u.contains(this.placeholder[0],s)||"semi-dynamic"===this.options.type&&u.contains(this.element[0],s))){if(this.direction=1===o?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(i))break;this._rearrange(t,i),this._trigger("change",t,this._uiHash());break}return u.ui.ddmanager&&u.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t,e){var i,s,o,r;if(t)return u.ui.ddmanager&&!this.options.dropBehaviour&&u.ui.ddmanager.drop(this,t),this.options.revert?(s=(i=this).placeholder.offset(),r={},(o=this.options.axis)&&"x"!==o||(r.left=s.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),o&&"y"!==o||(r.top=s.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,u(this.helper).animate(r,parseInt(this.options.revert,10)||500,function(){i._clear(t)})):this._clear(t,e),!1},cancel:function(){if(this.dragging){this._mouseUp(new u.Event("mouseup",{target:null})),"original"===this.options.helper?(this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")):this.currentItem.show();for(var t=this.containers.length-1;0<=t;t--)this.containers[t]._trigger("deactivate",null,this._uiHash(this)),this.containers[t].containerCache.over&&(this.containers[t]._trigger("out",null,this._uiHash(this)),this.containers[t].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),u.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?u(this.domPosition.prev).after(this.currentItem):u(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var t=this._getItemsAsjQuery(e&&e.connected),i=[];return e=e||{},u(t).each(function(){var t=(u(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);t&&i.push((e.key||t[1]+"[]")+"="+(e.key&&e.expression?t[1]:t[2]))}),!i.length&&e.key&&i.push(e.key+"="),i.join("&")},toArray:function(t){var e=this._getItemsAsjQuery(t&&t.connected),i=[];return t=t||{},e.each(function(){i.push(u(t.item||this).attr(t.attribute||"id")||"")}),i},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,s=this.positionAbs.top,o=s+this.helperProportions.height,r=t.left,n=r+t.width,h=t.top,a=h+t.height,l=this.offset.click.top,c=this.offset.click.left,l="x"===this.options.axis||h<s+l&&s+l<a,c="y"===this.options.axis||r<e+c&&e+c<n;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?l&&c:r<e+this.helperProportions.width/2&&i-this.helperProportions.width/2<n&&h<s+this.helperProportions.height/2&&o-this.helperProportions.height/2<a},_intersectsWithPointer:function(t){var e="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top,t.height),t="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left,t.width);return!(!e||!t)&&(e=this.dragDirection.vertical,t=this.dragDirection.horizontal,this.floating?"right"===t||"down"===e?2:1:e&&("down"===e?2:1))},_intersectsWithSides:function(t){var e=this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),i=this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),s=this.dragDirection.vertical,t=this.dragDirection.horizontal;return this.floating&&t?"right"===t&&i||"left"===t&&!i:s&&("down"===s&&e||"up"===s&&!e)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!=t&&(0<t?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!=t&&(0<t?"right":"left")},refresh:function(t){return this._refreshItems(t),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(t){var e,i,s,o,r=[],n=[],h=this._connectWith();if(h&&t)for(e=h.length-1;0<=e;e--)for(i=(s=u(h[e],this.document[0])).length-1;0<=i;i--)(o=u.data(s[i],this.widgetFullName))&&o!==this&&!o.options.disabled&&n.push(["function"==typeof o.options.items?o.options.items.call(o.element):u(o.options.items,o.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),o]);function a(){r.push(this)}for(n.push(["function"==typeof this.options.items?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):u(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),e=n.length-1;0<=e;e--)n[e][0].each(a);return u(r)},_removeCurrentsFromItems:function(){var i=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=u.grep(this.items,function(t){for(var e=0;e<i.length;e++)if(i[e]===t.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[],this.containers=[this];var e,i,s,o,r,n,h,a,l=this.items,c=[["function"==typeof this.options.items?this.options.items.call(this.element[0],t,{item:this.currentItem}):u(this.options.items,this.element),this]],p=this._connectWith();if(p&&this.ready)for(e=p.length-1;0<=e;e--)for(i=(s=u(p[e],this.document[0])).length-1;0<=i;i--)(o=u.data(s[i],this.widgetFullName))&&o!==this&&!o.options.disabled&&(c.push(["function"==typeof o.options.items?o.options.items.call(o.element[0],t,{item:this.currentItem}):u(o.options.items,o.element),o]),this.containers.push(o));for(e=c.length-1;0<=e;e--)for(r=c[e][1],a=(n=c[e][i=0]).length;i<a;i++)(h=u(n[i])).data(this.widgetName+"-item",r),l.push({item:h,instance:r,width:0,height:0,left:0,top:0})},_refreshItemPositions:function(t){for(var e,i,s=this.items.length-1;0<=s;s--)e=this.items[s],this.currentContainer&&e.instance!==this.currentContainer&&e.item[0]!==this.currentItem[0]||(i=this.options.toleranceElement?u(this.options.toleranceElement,e.item):e.item,t||(e.width=i.outerWidth(),e.height=i.outerHeight()),i=i.offset(),e.left=i.left,e.top=i.top)},refreshPositions:function(t){var e,i;if(this.floating=!!this.items.length&&("x"===this.options.axis||this._isFloating(this.items[0].item)),null!==this.innermostContainer&&this._refreshItemPositions(t),this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(e=this.containers.length-1;0<=e;e--)i=this.containers[e].element.offset(),this.containers[e].containerCache.left=i.left,this.containers[e].containerCache.top=i.top,this.containers[e].containerCache.width=this.containers[e].element.outerWidth(),this.containers[e].containerCache.height=this.containers[e].element.outerHeight();return this},_createPlaceholder:function(i){var s,o,r=(i=i||this).options;r.placeholder&&r.placeholder.constructor!==String||(s=r.placeholder,o=i.currentItem[0].nodeName.toLowerCase(),r.placeholder={element:function(){var t=u("<"+o+">",i.document[0]);return i._addClass(t,"ui-sortable-placeholder",s||i.currentItem[0].className)._removeClass(t,"ui-sortable-helper"),"tbody"===o?i._createTrPlaceholder(i.currentItem.find("tr").eq(0),u("<tr>",i.document[0]).appendTo(t)):"tr"===o?i._createTrPlaceholder(i.currentItem,t):"img"===o&&t.attr("src",i.currentItem.attr("src")),s||t.css("visibility","hidden"),t},update:function(t,e){s&&!r.forcePlaceholderSize||(e.height()&&(!r.forcePlaceholderSize||"tbody"!==o&&"tr"!==o)||e.height(i.currentItem.innerHeight()-parseInt(i.currentItem.css("paddingTop")||0,10)-parseInt(i.currentItem.css("paddingBottom")||0,10)),e.width()||e.width(i.currentItem.innerWidth()-parseInt(i.currentItem.css("paddingLeft")||0,10)-parseInt(i.currentItem.css("paddingRight")||0,10)))}}),i.placeholder=u(r.placeholder.element.call(i.element,i.currentItem)),i.currentItem.after(i.placeholder),r.placeholder.update(i,i.placeholder)},_createTrPlaceholder:function(t,e){var i=this;t.children().each(function(){u("<td>&#160;</td>",i.document[0]).attr("colspan",u(this).attr("colspan")||1).appendTo(e)})},_contactContainers:function(t){for(var e,i,s,o,r,n,h,a,l,c=null,p=null,f=this.containers.length-1;0<=f;f--)u.contains(this.currentItem[0],this.containers[f].element[0])||(this._intersectsWith(this.containers[f].containerCache)?c&&u.contains(this.containers[f].element[0],c.element[0])||(c=this.containers[f],p=f):this.containers[f].containerCache.over&&(this.containers[f]._trigger("out",t,this._uiHash(this)),this.containers[f].containerCache.over=0));if(this.innermostContainer=c)if(1===this.containers.length)this.containers[p].containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1);else{for(i=1e4,s=null,o=(a=c.floating||this._isFloating(this.currentItem))?"left":"top",r=a?"width":"height",l=a?"pageX":"pageY",e=this.items.length-1;0<=e;e--)u.contains(this.containers[p].element[0],this.items[e].item[0])&&this.items[e].item[0]!==this.currentItem[0]&&(n=this.items[e].item.offset()[o],h=!1,t[l]-n>this.items[e][r]/2&&(h=!0),Math.abs(t[l]-n)<i&&(i=Math.abs(t[l]-n),s=this.items[e],this.direction=h?"up":"down"));(s||this.options.dropOnEmpty)&&(this.currentContainer!==this.containers[p]?(s?this._rearrange(t,s,null,!0):this._rearrange(t,null,this.containers[p].element,!0),this._trigger("change",t,this._uiHash()),this.containers[p]._trigger("change",t,this._uiHash(this)),this.currentContainer=this.containers[p],this.options.placeholder.update(this.currentContainer,this.placeholder),this.scrollParent=this.placeholder.scrollParent(),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1):this.currentContainer.containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash()),this.currentContainer.containerCache.over=1))}},_createHelper:function(t){var e=this.options,t="function"==typeof e.helper?u(e.helper.apply(this.element[0],[t,this.currentItem])):"clone"===e.helper?this.currentItem.clone():this.currentItem;return t.parents("body").length||this.appendTo[0].appendChild(t[0]),t[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),t[0].style.width&&!e.forceHelperSize||t.width(this.currentItem.width()),t[0].style.height&&!e.forceHelperSize||t.height(this.currentItem.height()),t},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),"left"in(t=Array.isArray(t)?{left:+t[0],top:+t[1]||0}:t)&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&u.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),{top:(t=this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&u.ui.ie?{top:0,left:0}:t).top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,e,i=this.options;"parent"===i.containment&&(i.containment=this.helper[0].parentNode),"document"!==i.containment&&"window"!==i.containment||(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===i.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===i.containment?this.document.height()||document.body.parentNode.scrollHeight:this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(i.containment)||(t=u(i.containment)[0],e=u(i.containment).offset(),i="hidden"!==u(t).css("overflow"),this.containment=[e.left+(parseInt(u(t).css("borderLeftWidth"),10)||0)+(parseInt(u(t).css("paddingLeft"),10)||0)-this.margins.left,e.top+(parseInt(u(t).css("borderTopWidth"),10)||0)+(parseInt(u(t).css("paddingTop"),10)||0)-this.margins.top,e.left+(i?Math.max(t.scrollWidth,t.offsetWidth):t.offsetWidth)-(parseInt(u(t).css("borderLeftWidth"),10)||0)-(parseInt(u(t).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,e.top+(i?Math.max(t.scrollHeight,t.offsetHeight):t.offsetHeight)-(parseInt(u(t).css("borderTopWidth"),10)||0)-(parseInt(u(t).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(t,e){e=e||this.position;var i="absolute"===t?1:-1,s="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&u.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,t=/(html|body)/i.test(s[0].tagName);return{top:e.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():t?0:s.scrollTop())*i,left:e.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():t?0:s.scrollLeft())*i}},_generatePosition:function(t){var e=this.options,i=t.pageX,s=t.pageY,o="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&u.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,r=/(html|body)/i.test(o[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(t.pageX-this.offset.click.left<this.containment[0]&&(i=this.containment[0]+this.offset.click.left),t.pageY-this.offset.click.top<this.containment[1]&&(s=this.containment[1]+this.offset.click.top),t.pageX-this.offset.click.left>this.containment[2]&&(i=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(s=this.containment[3]+this.offset.click.top)),e.grid&&(t=this.originalPageY+Math.round((s-this.originalPageY)/e.grid[1])*e.grid[1],s=!this.containment||t-this.offset.click.top>=this.containment[1]&&t-this.offset.click.top<=this.containment[3]?t:t-this.offset.click.top>=this.containment[1]?t-e.grid[1]:t+e.grid[1],t=this.originalPageX+Math.round((i-this.originalPageX)/e.grid[0])*e.grid[0],i=!this.containment||t-this.offset.click.left>=this.containment[0]&&t-this.offset.click.left<=this.containment[2]?t:t-this.offset.click.left>=this.containment[0]?t-e.grid[0]:t+e.grid[0])),{top:s-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():r?0:o.scrollTop()),left:i-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():r?0:o.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var o=this.counter;this._delay(function(){o===this.counter&&this.refreshPositions(!s)})},_clear:function(t,e){this.reverting=!1;var i,s=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(i in this._storedCSS)"auto"!==this._storedCSS[i]&&"static"!==this._storedCSS[i]||(this._storedCSS[i]="");this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")}else this.currentItem.show();function o(e,i,s){return function(t){s._trigger(e,t,i._uiHash(i))}}for(this.fromOutside&&!e&&s.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||s.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(e||(s.push(function(t){this._trigger("remove",t,this._uiHash())}),s.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),s.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer)))),i=this.containers.length-1;0<=i;i--)e||s.push(o("deactivate",this,this.containers[i])),this.containers[i].containerCache.over&&(s.push(o("out",this,this.containers[i])),this.containers[i].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!e){for(i=0;i<s.length;i++)s[i].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){!1===u.Widget.prototype._trigger.apply(this,arguments)&&this.cancel()},_uiHash:function(t){var e=t||this;return{helper:e.helper,placeholder:e.placeholder||u([]),position:e.position,originalPosition:e.originalPosition,offset:e.positionAbs,item:e.currentItem,sender:t?t.element:null}}})});
(function($){
"use strict";
if($("#media-uploader._gallery").length>0){
var gallery_limit=$("#media-uploader._gallery").data('maxfiles');
if(!gallery_limit){
gallery_limit=listeo_core.maxFiles;
}
console.log('gallery_limit'+gallery_limit)
Dropzone.autoDiscover=false;
var galleryDropzone=new Dropzone ("#media-uploader._gallery", {
url: listeo_core.upload,
timeout: 999999,
maxFiles:gallery_limit,
acceptedFiles: 'image/*',
maxFilesize:listeo_core.maxFilesize,
dictMaxFilesExceeded: listeo_core.dictMaxFilesExceeded,
dictDefaultMessage: listeo_core.dictDefaultMessage,
dictFallbackMessage: listeo_core.dictFallbackMessage,
dictFallbackText: listeo_core.dictFallbackText,
dictFileTooBig: listeo_core.dictFileTooBig,
dictInvalidFileType: listeo_core.dictInvalidFileType,
dictResponseError: listeo_core.dictResponseError,
dictCancelUpload: listeo_core.dictCancelUpload,
dictCancelUploadConfirmation: listeo_core.dictCancelUploadConfirmation,
dictRemoveFile: listeo_core.dictRemoveFile,
init: function(){
this.on("sending", function(file, xhr, formData){
var id=$('input[name=property_id]').val();
formData.append("data", id);
});
this.on("addedfile", function(file){
/* Set active thumb class to preview that is used as thumbnail*/
if(file['attachment_id']===parseInt($('#_thumbnail_id').val())){
file.previewElement.className +=' active-thumb _gallery'+file['attachment_id'];
}else{
file.previewElement.className +=' _gallery'+ parseInt(file['attachment_id']);
}
file.previewElement.addEventListener("click", function(){
$('.dz-preview').removeClass('active-thumb');
$(this).addClass('active-thumb');
var id=file['attachment_id'];
$('#_thumbnail_id').val(id);
});
})
,
this.on("complete", function(file){
file.previewElement.className +=' _gallery'+file.attachment_id;
});
this.on("queuecomplete", function (file){
$('.dz-image-preview:first').trigger('click');  //file.previewElement.click();
});
},
success: function (file, response){
file.previewElement.classList.add("dz-success");
file['attachment_id']=response;
$("#media-uploader-ids").append('<input id="_gallery' + file['attachment_id'] +'" type="hidden" name="_gallery[' +file['attachment_id']+ ']"  value="'+file['name']+'">');
},
error: function (file, response){
file.previewElement.classList.add("dz-error");
$(file.previewElement).find('.dz-error-message').text(response);
},
addRemoveLinks: true,
removedfile: function(file){
var attachment_id=file['attachment_id'];
$('input#_gallery'+attachment_id).remove();
if($('#_thumbnail_id').val()==attachment_id){
$('#_thumbnail_id').val('');
}
$.ajax({
type: 'POST',
url: listeo_core.delete,
data: {
media_id:attachment_id
},
success: function (result){
console.log(result);
},
error: function (){
console.log("delete error");
}});
var _ref;
return (_ref=file.previewElement)!=null ? _ref.parentNode.removeChild(file.previewElement):void 0;
}});
if(typeof images!==typeof undefined&&images!==false){
var uploaded_media=jQuery.parseJSON(images);
for (var i=0; i < uploaded_media.length; ++i){
var mockFile={ name: uploaded_media[i].name, size: uploaded_media[i].size, attachment_id: uploaded_media[i].attachment_id };
galleryDropzone.emit("addedfile", mockFile);
galleryDropzone.emit("thumbnail", mockFile, uploaded_media[i].thumb);
galleryDropzone.emit("complete", mockFile);
galleryDropzone.files.push(mockFile);
var existingFileCount=1;
galleryDropzone.options.maxFiles=galleryDropzone.options.maxFiles - existingFileCount;
}}
$(".dropzone").sortable({
items:'.dz-preview',
cursor: 'move',
opacity: 0.5,
containment: '.dropzone',
distance: 20,
tolerance: 'pointer',
update: sortinputs
}).disableSelection();
function sortinputs(){
$('.dropzone .dz-preview').each(function(i, el){
var p=$(el).attr('class').match(/\d+/g);
$('#media-uploader-ids input#_gallery' + p)
.remove()
.appendTo($('#media-uploader-ids'));
});
}}
if($("#media-uploader._floorplans").length>0){
Dropzone.autoDiscover=false;
var floorDropzone=new Dropzone ("#media-uploader._floorplans", {
url: listeo_core.upload,
maxFiles:listeo_core.maxFiles,
maxFilesize:listeo_core.maxFilesize,
acceptedFiles: 'image/*',
init: function(){
this.on("addedfile", function(file){
/* Set active thumb class to preview that is used as thumbnail*/
})
,
this.on("complete", function(file){
file.previewElement.className +=' _gallery'+file.attachment_id;
});
},
success: function (file, response){
file.previewElement.classList.add("dz-success");
file['attachment_id']=response;
$("#media-uploader-ids").append('<input id="_gallery' + file['attachment_id'] +'" type="hidden" name="_gallery[' +file['attachment_id']+ ']"  value="'+file['name']+'">');
},
error: function (file, response){
file.previewElement.classList.add("dz-error");
},
addRemoveLinks: true,
removedfile: function(file){
var attachment_id=file['attachment_id'];
$('input#_gallery'+attachment_id).remove();
if($('#_thumbnail_id').val()==attachment_id){
$('#_thumbnail_id').val('');
}
$.ajax({
type: 'POST',
url: listeo_core.delete,
data: {
media_id:attachment_id
},
success: function (result){
console.log(result);
},
error: function (){
console.log("delete error");
}});
var _ref;
return (_ref=file.previewElement)!=null ? _ref.parentNode.removeChild(file.previewElement):void 0;
}});
}
$(document).ready(function(){
$(document).on("click", ".listeo_core-submit-image-preview", function(){
$('.listeo_core-submit-image-preview').removeClass('active-thumb');
$(this).addClass('active-thumb');
var id=$(this).data('thumb');
$('#_thumbnail_id').val(id);
});
if($("#media-uploader._floorplans").length>0){
$(".dropzone").sortable({
items:'.dz-preview',
cursor: 'move',
opacity: 0.5,
containment: '.dropzone',
distance: 20,
tolerance: 'pointer',
update: sortinputs
}).disableSelection();
function sortinputs(){
$('.dropzone .dz-preview').each(function(i, el){
var p=$(el).attr('class').match(/\d+/g);
$('#media-uploader-ids input#_gallery' + p)
.remove()
.appendTo($('#media-uploader-ids'));
});
}}
});
})(this.jQuery);
(function($){
"use strict";
$(document).ready(function(){
if($('#listeo_core-search-form').hasClass('ajax-search')){
$('.fullwidth-filters ').addClass('ajax-search');
}
$('#listeo-listings-container').on('update_results', function(event, page, append, loading_previous){
var results=$('#listeo-listings-container');
var filter=$('#listeo_core-search-form');
var data=filter.serializeArray();
var style=results.data('style');
var grid_columns=results.data('grid_columns');
var tax_region=results.data('region');
var tax_category=results.data('category');
var tax_service_category=results.data('service-category');
var tax_rental_category=results.data('rental-category');
var tax_event_category=results.data('event-category');
var tax_feature=results.data('feature');
var per_page=results.data('per_page');
var custom_class=results.data('custom_class');
var order=results.data('orderby');
data.push({name: 'action', value: 'listeo_get_listings'});
data.push({name: 'page', value: page});
data.push({name: 'style', value: style});
data.push({name: 'grid_columns', value: grid_columns});
data.push({name: 'per_page', value: per_page});
data.push({name: 'custom_class', value: custom_class});
data.push({name: 'order', value: order});
var has_listing_category_search=false;
var has_service_category_search=false;
var has_rental_category_search=false;
var has_event_category_search=false;
var has_listing_feature_search=false;
var has_region_search=false;
$.each(data, function(i, v){
console.log();
if(v.name.substring(0, 15)=='tax-listing_cat'){
if(v.value){ has_listing_category_search=true; }}
if(v.name.substring(0, 15)=='tax-listing_cat'){
if(v.value){ has_listing_category_search=true; }}
if(v.name.substring(0, 15)=='tax-listing_fea'){
if(v.value){ has_listing_feature_search=true; }}
if(v.name.substring(0, 9)=='tax-regio'){
if(v.value){ has_region_search=true; }}
});
if(!has_region_search){	if(tax_region){ data.push({name: 'tax-region', value: tax_region});}};
if(!has_listing_category_search){ if(tax_category){ data.push({name: 'tax-listing_category', value: tax_category});}};
if(!has_listing_feature_search){ if(tax_feature){ data.push({name: 'tax-listing_feature', value: tax_feature});}};
if(!has_rental_category_search){ if(tax_rental_category){ data.push({name: 'tax-rental_category', value: tax_rental_category});}};
if(!has_event_category_search){ if(tax_event_category){ data.push({name: 'tax-event_category', value: tax_event_category});}};
if(!has_service_category_search){ if(tax_service_category){ data.push({name: 'tax-service_category', value: tax_service_category});}};
$.ajax({
type:"post",
dataType:"json",
url:listeo_core.ajax_url,
data:data,
beforeSend:function(xhr){
results.addClass('loading');
},
success:function(data){
results.removeClass('loading');
$(results).html(data.html);
$('div.pagination-container').html(data.pagination);
$('.numerical-rating').numericalRating();
$('.star-rating').starRating();
$('#listeo-listings-container').triggerHandler('update_results_success');
if(listeo_core.map_provider=='google'){
var map=document.getElementById('map');
if(typeof(map)!='undefined'&&map!=null){
}}
}});
});
$(document).on('change', '.sort-by-select .orderby, #listeo_core-search-form.ajax-search select, .ajax-search input:not(#location_search,#_price_range,.bootstrap-range-slider)', function(e){
console.log('change test');
var target=$('div#listeo-listings-container');
target.triggerHandler('update_results', [ 1, false ]);
}).on('keyup', function(e){
if(e.which===13){
e.preventDefault();
$(this).trigger('change');
}});
$('.bootstrap-range-slider').on('slideStop', function (){
var target=$('div#listeo-listings-container');
target.triggerHandler('update_results', [ 1, false ]);
});
if($('#listeo_core-search-form:not(.main-search-form)').length){
document.getElementById("listeo_core-search-form").onkeypress=function(e){
var key=e.charCode||e.keyCode||0;
if(key==13){
if($('#location_search:focus').length){ return false; }
var target=$('div#listeo-listings-container');
target.triggerHandler('update_results', [ 1, false ]);
e.preventDefault();
}}
}
$(document).on('click', 'span.panel-disable,.slider-disable', function(e){
var results=$('#listeo-listings-container');
results.triggerHandler('update_results', [ 1, false ]);
});
$('div.pagination-container.ajax-search').on('click', 'a', function(e){
e.preventDefault();
var results=$('#listeo-listings-container');
var filter=$('#listeo_core-search-form');
var page=$(this).parent().data('paged');
console.log(page);
if(page=='next'){
var page=$('.pagination li.current').data('paged') + 1
}
if(page=='prev'){
var page=$('.pagination li.current').data('paged') - 1
}
results.triggerHandler('update_results', [ page, false ]);
$('body, html').animate({
scrollTop: $('.fs-inner-container .search,#titlebar, .ajax-search,#map-container').offset().top
}, 600);
return false;
});
var init_layout=$('#listeo-listings-container').data('style');
if(init_layout=='list'){
$('.layout-switcher a').removeClass('active');
$('.layout-switcher a.list').addClass('active');
}else{
$('.layout-switcher a:not(.list)').addClass('active');
}
$('.tax-listing_category #tax-listing_category').on('change',function(e){
var label=$(this).find(":selected").html();
$('.page-title').html(label);
});
$('.layout-switcher').on('click', 'a', function(e){
e.preventDefault();
$('.layout-switcher a').removeClass('active');
$(this).addClass('active');
var layout=$(this).data('layout');
var results=$('#listeo-listings-container');
results.data('style',layout);
var page=1;
results.triggerHandler('update_results', [ page, false ]);
});
});
})(this.jQuery);
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.flatpickr=t()}(this,function(){"use strict";function e(e,t,n){return!1!==n?new Date(e.getTime()).setHours(0,0,0,0)-new Date(t.getTime()).setHours(0,0,0,0):e.getTime()-t.getTime()}function t(e,t,n){void 0===n&&(n=!1);var a;return function(){var i=this,o=arguments;null!==a&&clearTimeout(a),a=window.setTimeout(function(){a=null,n||e.apply(i,o)},t),n&&!a&&e.apply(i,o)}}function n(e,t,n){if(!0===n)return e.classList.add(t);e.classList.remove(t)}function a(e,t,n){var a=window.document.createElement(e);return t=t||"",n=n||"",a.className=t,void 0!==n&&(a.textContent=n),a}function i(e,t){return t(e)?e:e.parentNode?i(e.parentNode,t):void 0}function o(e){var t=a("div","numInputWrapper"),n=a("input","numInput "+e),i=a("span","arrowUp"),o=a("span","arrowDown");return n.type="text",n.pattern="\\d*",t.appendChild(n),t.appendChild(i),t.appendChild(o),t}function r(r,s){for(var u=Array.prototype.slice.call(r),p=[],w=0;w<u.length;w++){var M=u[w];try{if(null!==M.getAttribute("data-fp-omit"))continue;void 0!==M._flatpickr&&(M._flatpickr.destroy(),M._flatpickr=void 0),M._flatpickr=function(r,s){function u(e){return e.bind(X)}function p(e){if(X.config.noCalendar&&0===X.selectedDates.length){var t=X.config.minDate;X.setDate((new Date).setHours(t?t.getHours():X.config.defaultHour,t?t.getMinutes():X.config.defaultMinute,t&&X.config.enableSeconds?t.getSeconds():X.config.defaultSeconds),!1),w(),Q()}!function(e){e.preventDefault();var t="keydown"===e.type,n=e.target;void 0!==X.amPM&&e.target===X.amPM&&(X.amPM.textContent=X.l10n.amPM[m(X.amPM.textContent===X.l10n.amPM[0])]);var a=Number(n.min),i=Number(n.max),o=Number(n.step),r=parseInt(n.value,10),l=e.delta||(t?38===e.which?1:-1:Math.max(-1,Math.min(1,e.wheelDelta||-e.deltaY))||0),c=r+o*l;if(void 0!==n.value&&2===n.value.length){var d=n===X.hourElement,s=n===X.minuteElement;c<a?(c=i+c+m(!d)+(m(d)&&m(!X.amPM)),s&&S(void 0,-1,X.hourElement)):c>i&&(c=n===X.hourElement?c-i-m(!X.amPM):a,s&&S(void 0,1,X.hourElement)),X.amPM&&d&&(1===o?c+r===23:Math.abs(c-r)>o)&&(X.amPM.textContent=X.l10n.amPM[m(X.amPM.textContent===X.l10n.amPM[0])]),n.value=f(c)}}(e),0!==X.selectedDates.length&&(!X.minDateHasTime||"input"!==e.type||e.target.value.length>=2?(w(),Q()):setTimeout(function(){w(),Q()},1e3))}function w(){if(void 0!==X.hourElement&&void 0!==X.minuteElement){var t=(parseInt(X.hourElement.value.slice(-2),10)||0)%24,n=(parseInt(X.minuteElement.value,10)||0)%60,a=void 0!==X.secondElement?(parseInt(X.secondElement.value,10)||0)%60:0;void 0!==X.amPM&&(t=function(e,t){return e%12+12*m(t===X.l10n.amPM[1])}(t,X.amPM.textContent)),X.config.minDate&&X.minDateHasTime&&X.latestSelectedDateObj&&0===e(X.latestSelectedDateObj,X.config.minDate)&&(t=Math.max(t,X.config.minDate.getHours()))===X.config.minDate.getHours()&&(n=Math.max(n,X.config.minDate.getMinutes())),X.config.maxDate&&X.maxDateHasTime&&X.latestSelectedDateObj&&0===e(X.latestSelectedDateObj,X.config.maxDate)&&(t=Math.min(t,X.config.maxDate.getHours()))===X.config.maxDate.getHours()&&(n=Math.min(n,X.config.maxDate.getMinutes())),b(t,n,a)}}function M(e){var t=e||X.latestSelectedDateObj;t&&b(t.getHours(),t.getMinutes(),t.getSeconds())}function b(e,t,n){void 0!==X.latestSelectedDateObj&&X.latestSelectedDateObj.setHours(e%24,t,n||0,0),X.hourElement&&X.minuteElement&&!X.isMobile&&(X.hourElement.value=f(X.config.time_24hr?e:(12+e)%12+12*m(e%12==0)),X.minuteElement.value=f(t),void 0!==X.amPM&&(X.amPM.textContent=X.l10n.amPM[m(e>=12)]),void 0!==X.secondElement&&(X.secondElement.value=f(n)))}function y(e,t,n){return t instanceof Array?t.forEach(function(t){return y(e,t,n)}):e instanceof Array?e.forEach(function(e){return y(e,t,n)}):(e.addEventListener(t,n),void X._handlers.push({element:e,event:t,handler:n}))}function x(e){return function(t){1===t.which&&e(t)}}function E(){z("onChange")}function N(){X._animationLoop.forEach(function(e){return e()}),X._animationLoop=[]}function k(e){var t=void 0!==e?q(e):X.latestSelectedDateObj||(X.config.minDate&&X.config.minDate>X.now?X.config.minDate:X.config.maxDate&&X.config.maxDate<X.now?X.config.maxDate:X.now);try{void 0!==t&&(X.currentYear=t.getFullYear(),X.currentMonth=t.getMonth())}catch(e){e.message="Invalid date supplied: "+t,X.config.errorHandler(e)}X.redraw()}function S(e,t,n){var a=e&&e.target,i=n||a&&a.parentNode&&a.parentNode.firstChild,o=G("increment");o.delta=t,i&&i.dispatchEvent(o)}function T(t,i,o,r){var l=j(i,!0),c=a("span","flatpickr-day "+t,i.getDate().toString());return c.dateObj=i,c.$i=r,c.setAttribute("aria-label",X.formatDate(i,X.config.ariaDateFormat)),0===e(i,X.now)&&(X.todayDateElem=c,c.classList.add("today")),l?(c.tabIndex=-1,V(i)&&(c.classList.add("selected"),X.selectedDateElem=c,"range"===X.config.mode&&(n(c,"startRange",X.selectedDates[0]&&0===e(i,X.selectedDates[0])),n(c,"endRange",X.selectedDates[1]&&0===e(i,X.selectedDates[1]))))):(c.classList.add("disabled"),X.selectedDates[0]&&X.minRangeDate&&i>X.minRangeDate&&i<X.selectedDates[0]?X.minRangeDate=i:X.selectedDates[0]&&X.maxRangeDate&&i<X.maxRangeDate&&i>X.selectedDates[0]&&(X.maxRangeDate=i)),"range"===X.config.mode&&(function(t){return!("range"!==X.config.mode||X.selectedDates.length<2)&&e(t,X.selectedDates[0])>=0&&e(t,X.selectedDates[1])<=0}(i)&&!V(i)&&c.classList.add("inRange"),1===X.selectedDates.length&&void 0!==X.minRangeDate&&void 0!==X.maxRangeDate&&(i<X.minRangeDate||i>X.maxRangeDate)&&c.classList.add("notAllowed")),X.weekNumbers&&"prevMonthDay"!==t&&o%7==1&&X.weekNumbers.insertAdjacentHTML("beforeend","<span class='disabled flatpickr-day'>"+X.config.getWeek(i)+"</span>"),z("onDayCreate",c),c}function I(e,t){var n=e+t||0,a=void 0!==e?X.days.childNodes[n]:X.selectedDateElem||X.todayDateElem||X.days.childNodes[0],i=function(){(a=a||X.days.childNodes[n]).focus(),"range"===X.config.mode&&R(a)};if(void 0===a&&0!==t)return t>0?(X.changeMonth(1,!0,void 0,!0),n%=42):t<0&&(X.changeMonth(-1,!0,void 0,!0),n+=42),Y(i);i()}function Y(e){!0===X.config.animate?X._animationLoop.push(e):e()}function _(e){if(void 0!==X.daysContainer){var t=(new Date(X.currentYear,X.currentMonth,1).getDay()-X.l10n.firstDayOfWeek+7)%7,n="range"===X.config.mode,i=X.utils.getDaysInMonth((X.currentMonth-1+12)%12),o=X.utils.getDaysInMonth(),r=window.document.createDocumentFragment(),l=i+1-t,c=0;for(X.weekNumbers&&X.weekNumbers.firstChild&&(X.weekNumbers.textContent=""),n&&(X.minRangeDate=new Date(X.currentYear,X.currentMonth-1,l),X.maxRangeDate=new Date(X.currentYear,X.currentMonth+1,(42-t)%o));l<=i;l++,c++)r.appendChild(T("prevMonthDay",new Date(X.currentYear,X.currentMonth-1,l),l,c));for(l=1;l<=o;l++,c++)r.appendChild(T("",new Date(X.currentYear,X.currentMonth,l),l,c));for(var d=o+1;d<=42-t;d++,c++)r.appendChild(T("nextMonthDay",new Date(X.currentYear,X.currentMonth+1,d%o),d,c));n&&1===X.selectedDates.length&&r.childNodes[0]?(X._hidePrevMonthArrow=X._hidePrevMonthArrow||!!X.minRangeDate&&X.minRangeDate>r.childNodes[0].dateObj,X._hideNextMonthArrow=X._hideNextMonthArrow||!!X.maxRangeDate&&X.maxRangeDate<new Date(X.currentYear,X.currentMonth+1,1)):Z();var s=a("div","dayContainer");if(s.appendChild(r),X.config.animate&&void 0!==e)for(;X.daysContainer.childNodes.length>1;)X.daysContainer.removeChild(X.daysContainer.firstChild);else!function(e){for(;e.firstChild;)e.removeChild(e.firstChild)}(X.daysContainer);e&&e>=0?X.daysContainer.appendChild(s):X.daysContainer.insertBefore(s,X.daysContainer.firstChild),X.days=X.daysContainer.childNodes[0]}}function O(){X.weekdayContainer||(X.weekdayContainer=a("div","flatpickr-weekdays"));var e=X.l10n.firstDayOfWeek,t=X.l10n.weekdays.shorthand.slice();return e>0&&e<t.length&&(t=t.splice(e,t.length).concat(t.splice(0,e))),X.weekdayContainer.innerHTML="\n    <span class=flatpickr-weekday>\n      "+t.join("</span><span class=flatpickr-weekday>")+"\n    </span>\n    ",X.weekdayContainer}function P(e,t,n,a){void 0===t&&(t=!0),void 0===n&&(n=X.config.animate),void 0===a&&(a=!1);var i=t?e:e-X.currentMonth;if(!(i<0&&X._hidePrevMonthArrow||i>0&&X._hideNextMonthArrow)){if(X.currentMonth+=i,(X.currentMonth<0||X.currentMonth>11)&&(X.currentYear+=X.currentMonth>11?1:-1,X.currentMonth=(X.currentMonth+12)%12,z("onYearChange")),_(n?i:void 0),!n)return z("onMonthChange"),Z();var o=X.navigationCurrentMonth;if(i<0)for(;o.nextSibling&&/curr/.test(o.nextSibling.className);)X.monthNav.removeChild(o.nextSibling);else if(i>0)for(;o.previousSibling&&/curr/.test(o.previousSibling.className);)X.monthNav.removeChild(o.previousSibling);X.oldCurMonth=X.navigationCurrentMonth,X.navigationCurrentMonth=X.monthNav.insertBefore(X.oldCurMonth.cloneNode(!0),i>0?X.oldCurMonth.nextSibling:X.oldCurMonth);var r=X.daysContainer;if(r.firstChild&&r.lastChild&&(i>0?(r.firstChild.classList.add("slideLeft"),r.lastChild.classList.add("slideLeftNew"),X.oldCurMonth.classList.add("slideLeft"),X.navigationCurrentMonth.classList.add("slideLeftNew")):i<0&&(r.firstChild.classList.add("slideRightNew"),r.lastChild.classList.add("slideRight"),X.oldCurMonth.classList.add("slideRight"),X.navigationCurrentMonth.classList.add("slideRightNew"))),X.currentMonthElement=X.navigationCurrentMonth.firstChild,X.currentYearElement=X.navigationCurrentMonth.lastChild.childNodes[0],Z(),X.oldCurMonth.firstChild&&(X.oldCurMonth.firstChild.textContent=c(X.currentMonth-i,X.config.shorthandCurrentMonth,X.l10n)),Y(function(){return z("onMonthChange")}),a&&document.activeElement&&document.activeElement.$i){var l=document.activeElement.$i;Y(function(){I(l,0)})}}}function F(e){return!(!X.config.appendTo||!X.config.appendTo.contains(e))||X.calendarContainer.contains(e)}function L(e){if(X.isOpen&&!X.config.inline){var t=F(e.target),n=e.target===X.input||e.target===X.altInput||X.element.contains(e.target)||e.path&&e.path.indexOf&&(~e.path.indexOf(X.input)||~e.path.indexOf(X.altInput));("blur"===e.type?n&&e.relatedTarget&&!F(e.relatedTarget):!n&&!t)&&-1===X.config.ignoredFocusElements.indexOf(e.target)&&(X.close(),"range"===X.config.mode&&1===X.selectedDates.length&&(X.clear(!1),X.redraw()))}}function A(e){if(!(!e||X.currentYearElement.min&&e<parseInt(X.currentYearElement.min)||X.currentYearElement.max&&e>parseInt(X.currentYearElement.max))){var t=e,n=X.currentYear!==t;X.currentYear=t||X.currentYear,X.config.maxDate&&X.currentYear===X.config.maxDate.getFullYear()?X.currentMonth=Math.min(X.config.maxDate.getMonth(),X.currentMonth):X.config.minDate&&X.currentYear===X.config.minDate.getFullYear()&&(X.currentMonth=Math.max(X.config.minDate.getMonth(),X.currentMonth)),n&&(X.redraw(),z("onYearChange"))}}function j(t,n){void 0===n&&(n=!0);var a=X.parseDate(t,void 0,n);if(X.config.minDate&&a&&e(a,X.config.minDate,void 0!==n?n:!X.minDateHasTime)<0||X.config.maxDate&&a&&e(a,X.config.maxDate,void 0!==n?n:!X.maxDateHasTime)>0)return!1;if(!X.config.enable.length&&!X.config.disable.length)return!0;if(void 0===a)return!1;for(var i=X.config.enable.length>0,o=i?X.config.enable:X.config.disable,r=0,l=void 0;r<o.length;r++){if("function"==typeof(l=o[r])&&l(a))return i;if(l instanceof Date&&void 0!==a&&l.getTime()===a.getTime())return i;if("string"==typeof l&&void 0!==a){var c=X.parseDate(l,void 0,!0);return c&&c.getTime()===a.getTime()?i:!i}if("object"==typeof l&&void 0!==a&&l.from&&l.to&&a.getTime()>=l.from.getTime()&&a.getTime()<=l.to.getTime())return i}return!i}function H(e){var t=e.target===X._input,n=F(e.target),a=X.config.allowInput,i=X.isOpen&&(!a||!t),o=X.config.inline&&t&&!a;if("Enter"===e.key&&t){if(a)return X.setDate(X._input.value,!0,e.target===X.altInput?X.config.altFormat:X.config.dateFormat),e.target.blur();X.open()}else if(n||i||o){var r=!!X.timeContainer&&X.timeContainer.contains(e.target);switch(e.key){case"Enter":r?Q():K(e);break;case"Escape":e.preventDefault(),X.close();break;case"Backspace":case"Delete":t&&!X.config.allowInput&&X.clear();break;case"ArrowLeft":case"ArrowRight":if(r)X.hourElement&&X.hourElement.focus();else if(e.preventDefault(),X.daysContainer){var l="ArrowRight"===e.key?1:-1;e.ctrlKey?P(l,!0,void 0,!0):I(e.target.$i,l)}break;case"ArrowUp":case"ArrowDown":e.preventDefault();var c="ArrowDown"===e.key?1:-1;X.daysContainer&&void 0!==e.target.$i?e.ctrlKey?(A(X.currentYear-c),I(e.target.$i,0)):r||I(e.target.$i,7*c):X.config.enableTime&&(!r&&X.hourElement&&X.hourElement.focus(),p(e),X._debouncedChange());break;case"Tab":e.target===X.hourElement?(e.preventDefault(),X.minuteElement.select()):e.target===X.minuteElement&&(X.secondElement||X.amPM)?(e.preventDefault(),void 0!==X.secondElement?X.secondElement.focus():void 0!==X.amPM&&X.amPM.focus()):e.target===X.secondElement&&X.amPM&&(e.preventDefault(),X.amPM.focus());break;case X.l10n.amPM[0].charAt(0):void 0!==X.amPM&&e.target===X.amPM&&(X.amPM.textContent=X.l10n.amPM[0],w(),Q());break;case X.l10n.amPM[1].charAt(0):void 0!==X.amPM&&e.target===X.amPM&&(X.amPM.textContent=X.l10n.amPM[1],w(),Q())}z("onKeyDown",e)}}function R(e){if(1===X.selectedDates.length&&e.classList.contains("flatpickr-day")&&void 0!==X.minRangeDate&&void 0!==X.maxRangeDate){for(var t=e.dateObj,n=X.parseDate(X.selectedDates[0],void 0,!0),a=Math.min(t.getTime(),X.selectedDates[0].getTime()),i=Math.max(t.getTime(),X.selectedDates[0].getTime()),o=!1,r=a;r<i;r+=d.DAY)if(!j(new Date(r))){o=!0;break}for(var l=0,c=X.days.childNodes[l].dateObj;l<42;l++,c=X.days.childNodes[l]&&X.days.childNodes[l].dateObj)!function(r,l){var c=l.getTime(),d=c<X.minRangeDate.getTime()||c>X.maxRangeDate.getTime(),s=X.days.childNodes[r];if(d)return s.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(e){s.classList.remove(e)}),"continue";if(o&&!d)return"continue";["startRange","inRange","endRange","notAllowed"].forEach(function(e){s.classList.remove(e)});var u=Math.max(X.minRangeDate.getTime(),a),f=Math.min(X.maxRangeDate.getTime(),i);e.classList.add(t<X.selectedDates[0]?"startRange":"endRange"),n<t&&c===n.getTime()?s.classList.add("startRange"):n>t&&c===n.getTime()&&s.classList.add("endRange"),c>=u&&c<=f&&s.classList.add("inRange")}(l,c)}}function W(e){return function(t){var n=X.config["_"+e+"Date"]=X.parseDate(t),a=X.config["_"+("min"===e?"max":"min")+"Date"];void 0!==n&&(X["min"===e?"minDateHasTime":"maxDateHasTime"]=n.getHours()>0||n.getMinutes()>0||n.getSeconds()>0),X.selectedDates&&(X.selectedDates=X.selectedDates.filter(function(e){return j(e)}),X.selectedDates.length||"min"!==e||M(n),Q()),X.daysContainer&&(J(),void 0!==n?X.currentYearElement[e]=n.getFullYear().toString():X.currentYearElement.removeAttribute(e),X.currentYearElement.disabled=!!a&&void 0!==n&&a.getFullYear()===n.getFullYear())}}function B(e){if(void 0===e&&(e=X._positionElement),void 0!==X.calendarContainer){var t=X.calendarContainer.offsetHeight,a=X.calendarContainer.offsetWidth,i=X.config.position,o=e.getBoundingClientRect(),r=window.innerHeight-o.bottom,l="above"===i||"below"!==i&&r<t&&o.top>t,c=window.pageYOffset+o.top+(l?-t-2:e.offsetHeight+2);if(n(X.calendarContainer,"arrowTop",!l),n(X.calendarContainer,"arrowBottom",l),!X.config.inline){var d=window.pageXOffset+o.left,s=window.document.body.offsetWidth-o.right,u=d+a>window.document.body.offsetWidth;n(X.calendarContainer,"rightMost",u),X.config.static||(X.calendarContainer.style.top=c+"px",u?(X.calendarContainer.style.left="auto",X.calendarContainer.style.right=s+"px"):(X.calendarContainer.style.left=d+"px",X.calendarContainer.style.right="auto"))}}}function J(){X.config.noCalendar||X.isMobile||(O(),Z(),_())}function K(t){t.preventDefault(),t.stopPropagation();var n=i(t.target,function(e){return e.classList&&e.classList.contains("flatpickr-day")&&!e.classList.contains("disabled")&&!e.classList.contains("notAllowed")});if(void 0!==n){var a=n,o=X.latestSelectedDateObj=new Date(a.dateObj.getTime()),r=o.getMonth()!==X.currentMonth&&"range"!==X.config.mode;if(X.selectedDateElem=a,"single"===X.config.mode)X.selectedDates=[o];else if("multiple"===X.config.mode){var l=V(o);l?X.selectedDates.splice(parseInt(l),1):X.selectedDates.push(o)}else"range"===X.config.mode&&(2===X.selectedDates.length&&X.clear(),X.selectedDates.push(o),0!==e(o,X.selectedDates[0],!0)&&X.selectedDates.sort(function(e,t){return e.getTime()-t.getTime()}));if(w(),r){var c=X.currentYear!==o.getFullYear();X.currentYear=o.getFullYear(),X.currentMonth=o.getMonth(),c&&z("onYearChange"),z("onMonthChange")}if(_(),X.config.minDate&&X.minDateHasTime&&X.config.enableTime&&0===e(o,X.config.minDate)&&M(X.config.minDate),Q(),X.config.enableTime&&setTimeout(function(){return X.showTimeInput=!0},50),"range"===X.config.mode&&(1===X.selectedDates.length?(R(a),X._hidePrevMonthArrow=X._hidePrevMonthArrow||void 0!==X.minRangeDate&&X.minRangeDate>X.days.childNodes[0].dateObj,X._hideNextMonthArrow=X._hideNextMonthArrow||void 0!==X.maxRangeDate&&X.maxRangeDate<new Date(X.currentYear,X.currentMonth+1,1)):Z()),z("onChange"),r?Y(function(){return X.selectedDateElem&&X.selectedDateElem.focus()}):I(a.$i,0),void 0!==X.hourElement&&setTimeout(function(){return void 0!==X.hourElement&&X.hourElement.select()},451),X.config.closeOnSelect){var d="single"===X.config.mode&&!X.config.enableTime,s="range"===X.config.mode&&2===X.selectedDates.length&&!X.config.enableTime;(d||s)&&X.close()}}}function U(e,t){var n=[];if(e instanceof Array)n=e.map(function(e){return X.parseDate(e,t)});else if(e instanceof Date||"number"==typeof e)n=[X.parseDate(e,t)];else if("string"==typeof e)switch(X.config.mode){case"single":n=[X.parseDate(e,t)];break;case"multiple":n=e.split(X.config.conjunction).map(function(e){return X.parseDate(e,t)});break;case"range":n=e.split(X.l10n.rangeSeparator).map(function(e){return X.parseDate(e,t)})}else X.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(e)));X.selectedDates=n.filter(function(e){return e instanceof Date&&j(e,!1)}),X.selectedDates.sort(function(e,t){return e.getTime()-t.getTime()})}function $(e){return e.map(function(e){return"string"==typeof e||"number"==typeof e||e instanceof Date?X.parseDate(e,void 0,!0):e&&"object"==typeof e&&e.from&&e.to?{from:X.parseDate(e.from,void 0),to:X.parseDate(e.to,void 0)}:e}).filter(function(e){return e})}function q(e,t,n){if(0===e||e){var a,i=e;if(e instanceof Date)a=new Date(e.getTime());else if("string"!=typeof e&&void 0!==e.toFixed)a=new Date(e);else if("string"==typeof e){var o=t||(X.config||C.defaultConfig).dateFormat,r=String(e).trim();if("today"===r)a=new Date,n=!0;else if(/Z$/.test(r)||/GMT$/.test(r))a=new Date(e);else if(X.config&&X.config.parseDate)a=X.config.parseDate(e,o);else{a=X.config&&X.config.noCalendar?new Date((new Date).setHours(0,0,0,0)):new Date((new Date).getFullYear(),0,1,0,0,0,0);for(var l=void 0,c=[],d=0,s=0,u="";d<o.length;d++){var f=o[d],m="\\"===f,g="\\"===o[d-1]||m;if(v[f]&&!g){u+=v[f];var p=new RegExp(u).exec(e);p&&(l=!0)&&c["Y"!==f?"push":"unshift"]({fn:h[f],val:p[++s]})}else m||(u+=".");c.forEach(function(e){var t=e.fn,n=e.val;return a=t(a,n,X.l10n)||a})}a=l?a:void 0}}if(a instanceof Date)return!0===n&&a.setHours(0,0,0,0),a;X.config.errorHandler(new Error("Invalid date provided: "+i))}}function z(e,t){var n=X.config[e];if(void 0!==n&&n.length>0)for(var a=0;n[a]&&a<n.length;a++)n[a](X.selectedDates,X.input.value,X,t);"onChange"===e&&(X.input.dispatchEvent(G("change")),X.input.dispatchEvent(G("input")))}function G(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!0),t}function V(t){for(var n=0;n<X.selectedDates.length;n++)if(0===e(X.selectedDates[n],t))return""+n;return!1}function Z(){X.config.noCalendar||X.isMobile||!X.monthNav||(X.currentMonthElement.textContent=c(X.currentMonth,X.config.shorthandCurrentMonth,X.l10n)+" ",X.currentYearElement.value=X.currentYear.toString(),X._hidePrevMonthArrow=void 0!==X.config.minDate&&(X.currentYear===X.config.minDate.getFullYear()?X.currentMonth<=X.config.minDate.getMonth():X.currentYear<X.config.minDate.getFullYear()),X._hideNextMonthArrow=void 0!==X.config.maxDate&&(X.currentYear===X.config.maxDate.getFullYear()?X.currentMonth+1>X.config.maxDate.getMonth():X.currentYear>X.config.maxDate.getFullYear()))}function Q(e){if(void 0===e&&(e=!0),!X.selectedDates.length)return X.clear(e);void 0!==X.mobileInput&&X.mobileFormatStr&&(X.mobileInput.value=void 0!==X.latestSelectedDateObj?X.formatDate(X.latestSelectedDateObj,X.mobileFormatStr):"");var t="range"!==X.config.mode?X.config.conjunction:X.l10n.rangeSeparator;X.input.value=X.selectedDates.map(function(e){return X.formatDate(e,X.config.dateFormat)}).join(t),void 0!==X.altInput&&(X.altInput.value=X.selectedDates.map(function(e){return X.formatDate(e,X.config.altFormat)}).join(t)),!1!==e&&z("onValueUpdate")}var X={};return X.parseDate=q,X.formatDate=function(e,t){return void 0!==X.config&&void 0!==X.config.formatDate?X.config.formatDate(e,t):t.split("").map(function(t,n,a){return D[t]&&"\\"!==a[n-1]?D[t](e,X.l10n,X.config):"\\"!==t?t:""}).join("")},X._animationLoop=[],X._handlers=[],X._bind=y,X._setHoursFromDate=M,X.changeMonth=P,X.changeYear=A,X.clear=function(e){void 0===e&&(e=!0),X.input.value="",X.altInput&&(X.altInput.value=""),X.mobileInput&&(X.mobileInput.value=""),X.selectedDates=[],X.latestSelectedDateObj=void 0,X.showTimeInput=!1,X.redraw(),e&&z("onChange")},X.close=function(){X.isOpen=!1,X.isMobile||(X.calendarContainer.classList.remove("open"),X._input.classList.remove("active")),z("onClose")},X._createElement=a,X.destroy=function(){void 0!==X.config&&z("onDestroy");for(var e=X._handlers.length;e--;){var t=X._handlers[e];t.element.removeEventListener(t.event,t.handler)}X._handlers=[],X.mobileInput?(X.mobileInput.parentNode&&X.mobileInput.parentNode.removeChild(X.mobileInput),X.mobileInput=void 0):X.calendarContainer&&X.calendarContainer.parentNode&&X.calendarContainer.parentNode.removeChild(X.calendarContainer),X.altInput&&(X.input.type="text",X.altInput.parentNode&&X.altInput.parentNode.removeChild(X.altInput),delete X.altInput),X.input&&(X.input.type=X.input._type,X.input.classList.remove("flatpickr-input"),X.input.removeAttribute("readonly"),X.input.value=""),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(e){try{delete X[e]}catch(e){}})},X.isEnabled=j,X.jumpToDate=k,X.open=function(e,t){if(void 0===t&&(t=X._input),X.isMobile)return e&&(e.preventDefault(),e.target&&e.target.blur()),setTimeout(function(){void 0!==X.mobileInput&&X.mobileInput.click()},0),void z("onOpen");if(!X._input.disabled&&!X.config.inline){var n=X.isOpen;X.isOpen=!0,B(t),X.calendarContainer.classList.add("open"),X._input.classList.add("active"),!n&&z("onOpen")}},X.redraw=J,X.set=function(e,t){null!==e&&"object"==typeof e?Object.assign(X.config,e):X.config[e]=t,X.redraw(),k()},X.setDate=function(e,t,n){if(void 0===t&&(t=!1),0!==e&&!e)return X.clear(t);U(e,n),X.showTimeInput=X.selectedDates.length>0,X.latestSelectedDateObj=X.selectedDates[0],X.redraw(),k(),M(),Q(t),t&&z("onChange")},X.toggle=function(){if(X.isOpen)return X.close();X.open()},function(){X.element=X.input=r,X.isOpen=!1,function(){var e=["wrap","weekNumbers","allowInput","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],t=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange"];X.config=l({},C.defaultConfig);var n=l({},s,JSON.parse(JSON.stringify(r.dataset||{}))),a={};for(Object.defineProperty(X.config,"enable",{get:function(){return X.config._enable||[]},set:function(e){X.config._enable=$(e)}}),Object.defineProperty(X.config,"disable",{get:function(){return X.config._disable||[]},set:function(e){X.config._disable=$(e)}}),!n.dateFormat&&n.enableTime&&(a.dateFormat=n.noCalendar?"H:i"+(n.enableSeconds?":S":""):C.defaultConfig.dateFormat+" H:i"+(n.enableSeconds?":S":"")),n.altInput&&n.enableTime&&!n.altFormat&&(a.altFormat=n.noCalendar?"h:i"+(n.enableSeconds?":S K":" K"):C.defaultConfig.altFormat+" h:i"+(n.enableSeconds?":S":"")+" K"),Object.defineProperty(X.config,"minDate",{get:function(){return X.config._minDate},set:W("min")}),Object.defineProperty(X.config,"maxDate",{get:function(){return X.config._maxDate},set:W("max")}),Object.assign(X.config,a,n),i=0;i<e.length;i++)X.config[e[i]]=!0===X.config[e[i]]||"true"===X.config[e[i]];for(i=t.length;i--;)void 0!==X.config[t[i]]&&(X.config[t[i]]=g(X.config[t[i]]||[]).map(u));for(var i=0;i<X.config.plugins.length;i++){var o=X.config.plugins[i](X)||{};for(var c in o)~t.indexOf(c)?X.config[c]=g(o[c]).map(u).concat(X.config[c]):void 0===n[c]&&(X.config[c]=o[c])}X.isMobile=!X.config.disableMobile&&!X.config.inline&&"single"===X.config.mode&&!X.config.disable.length&&!X.config.enable.length&&!X.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),z("onParseConfig")}(),"object"!=typeof X.config.locale&&void 0===C.l10ns[X.config.locale]&&X.config.errorHandler(new Error("flatpickr: invalid locale "+X.config.locale)),X.l10n=l({},C.l10ns.default,"object"==typeof X.config.locale?X.config.locale:"default"!==X.config.locale?C.l10ns[X.config.locale]:void 0),v.K="("+X.l10n.amPM[0]+"|"+X.l10n.amPM[1]+"|"+X.l10n.amPM[0].toLowerCase()+"|"+X.l10n.amPM[1].toLowerCase()+")",X.input=X.config.wrap?r.querySelector("[data-input]"):r,X.input?(X.input._type=X.input.type,X.input.type="text",X.input.classList.add("flatpickr-input"),X._input=X.input,X.config.altInput&&(X.altInput=a(X.input.nodeName,X.input.className+" "+X.config.altInputClass),X._input=X.altInput,X.altInput.placeholder=X.input.placeholder,X.altInput.disabled=X.input.disabled,X.altInput.required=X.input.required,X.altInput.type="text",X.input.type="hidden",!X.config.static&&X.input.parentNode&&X.input.parentNode.insertBefore(X.altInput,X.input.nextSibling)),X.config.allowInput||X._input.setAttribute("readonly","readonly"),X._positionElement=X.config.positionElement||X._input):X.config.errorHandler(new Error("Invalid input element specified")),function(){X.selectedDates=[],X.now=new Date;var e=X.config.defaultDate||X.input.value;e&&U(e,X.config.dateFormat);var t=X.selectedDates.length?X.selectedDates[0]:X.config.minDate&&X.config.minDate.getTime()>X.now.getTime()?X.config.minDate:X.config.maxDate&&X.config.maxDate.getTime()<X.now.getTime()?X.config.maxDate:X.now;X.currentYear=t.getFullYear(),X.currentMonth=t.getMonth(),X.selectedDates.length&&(X.latestSelectedDateObj=X.selectedDates[0]),X.minDateHasTime=!!X.config.minDate&&(X.config.minDate.getHours()>0||X.config.minDate.getMinutes()>0||X.config.minDate.getSeconds()>0),X.maxDateHasTime=!!X.config.maxDate&&(X.config.maxDate.getHours()>0||X.config.maxDate.getMinutes()>0||X.config.maxDate.getSeconds()>0),Object.defineProperty(X,"showTimeInput",{get:function(){return X._showTimeInput},set:function(e){X._showTimeInput=e,X.calendarContainer&&n(X.calendarContainer,"showTimeInput",e),B()}})}(),X.utils={getDaysInMonth:function(e,t){return void 0===e&&(e=X.currentMonth),void 0===t&&(t=X.currentYear),1===e&&(t%4==0&&t%100!=0||t%400==0)?29:X.l10n.daysInMonth[e]}},X.isMobile||function(){var e=window.document.createDocumentFragment();if(X.calendarContainer=a("div","flatpickr-calendar"),X.calendarContainer.tabIndex=-1,!X.config.noCalendar){if(e.appendChild(function(){var e=window.document.createDocumentFragment();X.monthNav=a("div","flatpickr-month"),X.prevMonthNav=a("span","flatpickr-prev-month"),X.prevMonthNav.innerHTML=X.config.prevArrow,X.currentMonthElement=a("span","cur-month"),X.currentMonthElement.title=X.l10n.scrollTitle;var t=o("cur-year");return X.currentYearElement=t.childNodes[0],X.currentYearElement.title=X.l10n.scrollTitle,X.config.minDate&&(X.currentYearElement.min=X.config.minDate.getFullYear().toString()),X.config.maxDate&&(X.currentYearElement.max=X.config.maxDate.getFullYear().toString(),X.currentYearElement.disabled=!!X.config.minDate&&X.config.minDate.getFullYear()===X.config.maxDate.getFullYear()),X.nextMonthNav=a("span","flatpickr-next-month"),X.nextMonthNav.innerHTML=X.config.nextArrow,X.navigationCurrentMonth=a("div","flatpickr-current-month"),X.navigationCurrentMonth.appendChild(X.currentMonthElement),X.navigationCurrentMonth.appendChild(t),e.appendChild(X.prevMonthNav),e.appendChild(X.navigationCurrentMonth),e.appendChild(X.nextMonthNav),X.monthNav.appendChild(e),Object.defineProperty(X,"_hidePrevMonthArrow",{get:function(){return X.__hidePrevMonthArrow},set:function(e){X.__hidePrevMonthArrow!==e&&(X.prevMonthNav.style.display=e?"none":"block"),X.__hidePrevMonthArrow=e}}),Object.defineProperty(X,"_hideNextMonthArrow",{get:function(){return X.__hideNextMonthArrow},set:function(e){X.__hideNextMonthArrow!==e&&(X.nextMonthNav.style.display=e?"none":"block"),X.__hideNextMonthArrow=e}}),Z(),X.monthNav}()),X.innerContainer=a("div","flatpickr-innerContainer"),X.config.weekNumbers){var t=function(){X.calendarContainer.classList.add("hasWeeks");var e=a("div","flatpickr-weekwrapper");e.appendChild(a("span","flatpickr-weekday",X.l10n.weekAbbreviation));var t=a("div","flatpickr-weeks");return e.appendChild(t),{weekWrapper:e,weekNumbers:t}}(),i=t.weekWrapper,r=t.weekNumbers;X.innerContainer.appendChild(i),X.weekNumbers=r,X.weekWrapper=i}X.rContainer=a("div","flatpickr-rContainer"),X.rContainer.appendChild(O()),X.daysContainer||(X.daysContainer=a("div","flatpickr-days"),X.daysContainer.tabIndex=-1),_(),X.rContainer.appendChild(X.daysContainer),X.innerContainer.appendChild(X.rContainer),e.appendChild(X.innerContainer)}X.config.enableTime&&e.appendChild(function(){X.calendarContainer.classList.add("hasTime"),X.config.noCalendar&&X.calendarContainer.classList.add("noCalendar"),X.timeContainer=a("div","flatpickr-time"),X.timeContainer.tabIndex=-1;var e=a("span","flatpickr-time-separator",":"),t=o("flatpickr-hour");X.hourElement=t.childNodes[0];var n=o("flatpickr-minute");if(X.minuteElement=n.childNodes[0],X.hourElement.tabIndex=X.minuteElement.tabIndex=-1,X.hourElement.value=f(X.latestSelectedDateObj?X.latestSelectedDateObj.getHours():X.config.time_24hr?X.config.defaultHour:function(e){switch(e%24){case 0:case 12:return 12;default:return e%12}}(X.config.defaultHour)),X.minuteElement.value=f(X.latestSelectedDateObj?X.latestSelectedDateObj.getMinutes():X.config.defaultMinute),X.hourElement.step=X.config.hourIncrement.toString(),X.minuteElement.step=X.config.minuteIncrement.toString(),X.hourElement.min=X.config.time_24hr?"0":"1",X.hourElement.max=X.config.time_24hr?"23":"12",X.minuteElement.min="0",X.minuteElement.max="59",X.hourElement.title=X.minuteElement.title=X.l10n.scrollTitle,X.timeContainer.appendChild(t),X.timeContainer.appendChild(e),X.timeContainer.appendChild(n),X.config.time_24hr&&X.timeContainer.classList.add("time24hr"),X.config.enableSeconds){X.timeContainer.classList.add("hasSeconds");var i=o("flatpickr-second");X.secondElement=i.childNodes[0],X.secondElement.value=f(X.latestSelectedDateObj?X.latestSelectedDateObj.getSeconds():X.config.defaultSeconds),X.secondElement.step=X.minuteElement.step,X.secondElement.min=X.minuteElement.min,X.secondElement.max=X.minuteElement.max,X.timeContainer.appendChild(a("span","flatpickr-time-separator",":")),X.timeContainer.appendChild(i)}return X.config.time_24hr||(X.amPM=a("span","flatpickr-am-pm",X.l10n.amPM[m((X.latestSelectedDateObj?X.hourElement.value:X.config.defaultHour)>11)]),X.amPM.title=X.l10n.toggleTitle,X.amPM.tabIndex=-1,X.timeContainer.appendChild(X.amPM)),X.timeContainer}()),n(X.calendarContainer,"rangeMode","range"===X.config.mode),n(X.calendarContainer,"animate",X.config.animate),X.calendarContainer.appendChild(e);var l=void 0!==X.config.appendTo&&X.config.appendTo.nodeType;if((X.config.inline||X.config.static)&&(X.calendarContainer.classList.add(X.config.inline?"inline":"static"),X.config.inline&&(!l&&X.element.parentNode?X.element.parentNode.insertBefore(X.calendarContainer,X._input.nextSibling):void 0!==X.config.appendTo&&X.config.appendTo.appendChild(X.calendarContainer)),X.config.static)){var c=a("div","flatpickr-wrapper");X.element.parentNode&&X.element.parentNode.insertBefore(c,X.element),c.appendChild(X.element),X.altInput&&c.appendChild(X.altInput),c.appendChild(X.calendarContainer)}X.config.static||X.config.inline||(void 0!==X.config.appendTo?X.config.appendTo:window.document.body).appendChild(X.calendarContainer)}(),function(){if(X.config.wrap&&["open","close","toggle","clear"].forEach(function(e){Array.prototype.forEach.call(X.element.querySelectorAll("[data-"+e+"]"),function(t){return y(t,"click",X[e])})}),X.isMobile)!function(){var e=X.config.enableTime?X.config.noCalendar?"time":"datetime-local":"date";X.mobileInput=a("input",X.input.className+" flatpickr-mobile"),X.mobileInput.step=X.input.getAttribute("step")||"any",X.mobileInput.tabIndex=1,X.mobileInput.type=e,X.mobileInput.disabled=X.input.disabled,X.mobileInput.placeholder=X.input.placeholder,X.mobileFormatStr="datetime-local"===e?"Y-m-d\\TH:i:S":"date"===e?"Y-m-d":"H:i:S",X.selectedDates.length&&(X.mobileInput.defaultValue=X.mobileInput.value=X.formatDate(X.selectedDates[0],X.mobileFormatStr)),X.config.minDate&&(X.mobileInput.min=X.formatDate(X.config.minDate,"Y-m-d")),X.config.maxDate&&(X.mobileInput.max=X.formatDate(X.config.maxDate,"Y-m-d")),X.input.type="hidden",void 0!==X.altInput&&(X.altInput.type="hidden");try{X.input.parentNode&&X.input.parentNode.insertBefore(X.mobileInput,X.input.nextSibling)}catch(e){}y(X.mobileInput,"change",function(e){X.setDate(e.target.value,!1,X.mobileFormatStr),z("onChange"),z("onClose")})}();else{var e=t(function(){!X.isOpen||X.config.static||X.config.inline||B()},50);X._debouncedChange=t(E,300),"range"===X.config.mode&&X.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&y(X.daysContainer,"mouseover",function(e){return R(e.target)}),y(window.document.body,"keydown",H),X.config.static||y(X._input,"keydown",H),X.config.inline||X.config.static||y(window,"resize",e),void 0!==window.ontouchstart&&y(window.document.body,"touchstart",L),y(window.document.body,"mousedown",x(L)),y(X._input,"blur",L),!0===X.config.clickOpens&&(y(X._input,"focus",X.open),y(X._input,"mousedown",x(X.open))),void 0!==X.daysContainer&&(X.monthNav.addEventListener("wheel",function(e){return e.preventDefault()}),y(X.monthNav,"wheel",t(function(e){e.preventDefault();var t=X.currentYearElement.parentNode&&X.currentYearElement.parentNode.contains(e.target);if(e.target===X.currentMonthElement||t){var n=function(e){return(e.wheelDelta||-e.deltaY)>=0?1:-1}(e);t?(A(X.currentYear+n),e.target.value=X.currentYear.toString()):X.changeMonth(n,!0,!1)}},10)),y(X.monthNav,"mousedown",x(function(e){var t=X.prevMonthNav.contains(e.target),n=X.nextMonthNav.contains(e.target);t||n?P(t?-1:1):e.target===X.currentYearElement?(e.preventDefault(),X.currentYearElement.select()):"arrowUp"===e.target.className?X.changeYear(X.currentYear+1):"arrowDown"===e.target.className&&X.changeYear(X.currentYear-1)})),y(X.monthNav,["keyup","increment"],function(e){var t=parseInt(e.target.value)+(e.delta||0);4!==t.toString().length&&"Enter"!==e.key||(X.currentYearElement.blur(),/[^\d]/.test(t.toString())||A(t))}),y(X.daysContainer,"mousedown",x(K)),X.config.animate&&(y(X.daysContainer,["webkitAnimationEnd","animationend"],function(e){if(X.daysContainer&&X.daysContainer.childNodes.length>1)switch(e.animationName){case"fpSlideLeft":X.daysContainer.lastChild&&X.daysContainer.lastChild.classList.remove("slideLeftNew"),X.daysContainer.removeChild(X.daysContainer.firstChild),X.days=X.daysContainer.firstChild,N();break;case"fpSlideRight":X.daysContainer.firstChild&&X.daysContainer.firstChild.classList.remove("slideRightNew"),X.daysContainer.removeChild(X.daysContainer.lastChild),X.days=X.daysContainer.firstChild,N()}}),y(X.monthNav,["webkitAnimationEnd","animationend"],function(e){switch(e.animationName){case"fpSlideLeftNew":case"fpSlideRightNew":X.navigationCurrentMonth.classList.remove("slideLeftNew"),X.navigationCurrentMonth.classList.remove("slideRightNew");for(var t=X.navigationCurrentMonth;t.nextSibling&&/curr/.test(t.nextSibling.className);)X.monthNav.removeChild(t.nextSibling);for(;t.previousSibling&&/curr/.test(t.previousSibling.className);)X.monthNav.removeChild(t.previousSibling);X.oldCurMonth=void 0}}))),void 0!==X.timeContainer&&void 0!==X.minuteElement&&void 0!==X.hourElement&&(y(X.timeContainer,["wheel","input","increment"],p),y(X.timeContainer,"mousedown",x(function(e){~e.target.className.indexOf("arrow")&&S(e,e.target.classList.contains("arrowUp")?1:-1)})),y(X.timeContainer,["wheel","increment"],X._debouncedChange),y(X.timeContainer,"input",E),y([X.hourElement,X.minuteElement],["focus","click"],function(e){return e.target.select()}),void 0!==X.secondElement&&y(X.secondElement,"focus",function(){return X.secondElement&&X.secondElement.select()}),void 0!==X.amPM&&y(X.amPM,"mousedown",x(function(e){p(e),E()})))}}(),(X.selectedDates.length||X.config.noCalendar)&&(X.config.enableTime&&M(X.config.noCalendar?X.latestSelectedDateObj||X.config.minDate:void 0),Q(!1)),X.showTimeInput=X.selectedDates.length>0||X.config.noCalendar,void 0!==X.weekWrapper&&void 0!==X.daysContainer&&(X.calendarContainer.style.width=X.daysContainer.offsetWidth+X.weekWrapper.offsetWidth+"px"),X.isMobile||B(),z("onReady")}(),X}(M,s||{}),p.push(M._flatpickr)}catch(e){console.error(e)}}return 1===p.length?p[0]:p}var l=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},c=function(e,t,n){return n.months[t?"shorthand":"longhand"][e]},d={DAY:864e5},s={_disable:[],_enable:[],allowInput:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:"object"==typeof window&&-1===window.navigator.userAgent.indexOf("MSIE"),ariaDateFormat:"F j, Y",clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enable:[],enableSeconds:!1,enableTime:!1,errorHandler:console.warn,getWeek:function(e){var t=new Date(e.getFullYear(),0,1);return Math.ceil(((e.getTime()-t.getTime())/864e5+t.getDay()+1)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},u={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(e){var t=e%100;if(t>3&&t<21)return"th";switch(t%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"]},f=function(e){return("0"+e).slice(-2)},m=function(e){return!0===e?1:0},g=function(e){return e instanceof Array?e:[e]},p=function(){},h={D:p,F:function(e,t,n){e.setMonth(n.months.longhand.indexOf(t))},G:function(e,t){e.setHours(parseFloat(t))},H:function(e,t){e.setHours(parseFloat(t))},J:function(e,t){e.setDate(parseFloat(t))},K:function(e,t,n){e.setHours(e.getHours()%12+12*m(new RegExp(n.amPM[1],"i").test(t)))},M:function(e,t,n){e.setMonth(n.months.shorthand.indexOf(t))},S:function(e,t){e.setSeconds(parseFloat(t))},U:function(e,t){return new Date(1e3*parseFloat(t))},W:function(e,t){var n=parseInt(t);return new Date(e.getFullYear(),0,2+7*(n-1),0,0,0,0)},Y:function(e,t){e.setFullYear(parseFloat(t))},Z:function(e,t){return new Date(t)},d:function(e,t){e.setDate(parseFloat(t))},h:function(e,t){e.setHours(parseFloat(t))},i:function(e,t){e.setMinutes(parseFloat(t))},j:function(e,t){e.setDate(parseFloat(t))},l:p,m:function(e,t){e.setMonth(parseFloat(t)-1)},n:function(e,t){e.setMonth(parseFloat(t)-1)},s:function(e,t){e.setSeconds(parseFloat(t))},w:p,y:function(e,t){e.setFullYear(2e3+parseFloat(t))}},v={D:"(\\w+)",F:"(\\w+)",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"(\\w+)",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"(\\w+)",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},D={Z:function(e){return e.toISOString()},D:function(e,t,n){return t.weekdays.shorthand[D.w(e,t,n)]},F:function(e,t,n){return c(D.n(e,t,n)-1,!1,t)},G:function(e,t,n){return f(D.h(e,t,n))},H:function(e){return f(e.getHours())},J:function(e,t){return void 0!==t.ordinal?e.getDate()+t.ordinal(e.getDate()):e.getDate()},K:function(e,t){return t.amPM[m(e.getHours()>11)]},M:function(e,t){return c(e.getMonth(),!0,t)},S:function(e){return f(e.getSeconds())},U:function(e){return e.getTime()/1e3},W:function(e,t,n){return n.getWeek(e)},Y:function(e){return e.getFullYear()},d:function(e){return f(e.getDate())},h:function(e){return e.getHours()%12?e.getHours()%12:12},i:function(e){return f(e.getMinutes())},j:function(e){return e.getDate()},l:function(e,t){return t.weekdays.longhand[e.getDay()]},m:function(e){return f(e.getMonth()+1)},n:function(e){return e.getMonth()+1},s:function(e){return e.getSeconds()},w:function(e){return e.getDay()},y:function(e){return String(e.getFullYear()).substring(2)}};"function"!=typeof Object.assign&&(Object.assign=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(!e)throw TypeError("Cannot convert undefined or null to object");for(var a=0,i=t;a<i.length;a++)!function(t){t&&Object.keys(t).forEach(function(n){return e[n]=t[n]})}(i[a]);return e}),"undefined"!=typeof HTMLElement&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(e){return r(this,e)},HTMLElement.prototype.flatpickr=function(e){return r([this],e)});var C;return C=function(e,t){return e instanceof NodeList?r(e,t):"string"==typeof e?r(window.document.querySelectorAll(e),t):r([e],t)},"object"==typeof window&&(window.flatpickr=C),C.defaultConfig=s,C.l10ns={en:l({},u),default:l({},u)},C.localize=function(e){C.l10ns.default=l({},C.l10ns.default,e)},C.setDefaults=function(e){C.defaultConfig=l({},C.defaultConfig,e)},"undefined"!=typeof jQuery&&(jQuery.fn.flatpickr=function(e){return r(this,e)}),Date.prototype.fp_incr=function(e){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+("string"==typeof e?parseInt(e,10):e))},C});
(function ($){
"use strict";
function starsOutput(firstStar, secondStar, thirdStar, fourthStar, fifthStar){
return(''+
'<span class="'+firstStar+'"></span>'+
'<span class="'+secondStar+'"></span>'+
'<span class="'+thirdStar+'"></span>'+
'<span class="'+fourthStar+'"></span>'+
'<span class="'+fifthStar+'"></span>');
}
$.fn.numericalRating=function(){
this.each(function(){
var dataRating=$(this).attr('data-rating');
if(dataRating >=4.0){
$(this).addClass('high');
}else if(dataRating >=3.0){
$(this).addClass('mid');
}else if(dataRating < 3.0){
$(this).addClass('low');
}});
};
$.fn.starRating=function(){
this.each(function(){
var dataRating=$(this).attr('data-rating');
if(dataRating > 0){
var fiveStars=starsOutput('star','star','star','star','star');
var fourHalfStars=starsOutput('star','star','star','star','star half');
var fourStars=starsOutput('star','star','star','star','star empty');
var threeHalfStars=starsOutput('star','star','star','star half','star empty');
var threeStars=starsOutput('star','star','star','star empty','star empty');
var twoHalfStars=starsOutput('star','star','star half','star empty','star empty');
var twoStars=starsOutput('star','star','star empty','star empty','star empty');
var oneHalfStar=starsOutput('star','star half','star empty','star empty','star empty');
var oneStar=starsOutput('star','star empty','star empty','star empty','star empty');
if(dataRating >=4.75){
$(this).append(fiveStars);
}else if(dataRating >=4.25){
$(this).append(fourHalfStars);
}else if(dataRating >=3.75){
$(this).append(fourStars);
}else if(dataRating >=3.25){
$(this).append(threeHalfStars);
}else if(dataRating >=2.75){
$(this).append(threeStars);
}else if(dataRating >=2.25){
$(this).append(twoHalfStars);
}else if(dataRating >=1.75){
$(this).append(twoStars);
}else if(dataRating >=1.25){
$(this).append(oneHalfStar);
}else if(dataRating < 1.25){
$(this).append(oneStar);
}}
});
};})(jQuery);
(function($){
"use strict";
$(document).ready(function(){
$(function(){
function mmenuInit(){
var wi=$(window).width();
if(wi <='1024'){
$(".mmenu-init").remove();
$("#navigation").clone().addClass("mmenu-init").insertBefore("#navigation").removeAttr('id').removeClass('style-1 style-2').find('ul').removeAttr('id');
$(".mmenu-init").mmenu({
"counters": true,
navbar: {
title: listeo_core.mmenuTitle
}}, {
offCanvas: {
pageNodetype: "#wrapper"
}});
var mmenuAPI=$(".mmenu-init").data("mmenu");
var $icon=$(".hamburger");
mmenuAPI.close();
$icon.removeClass("is-active");
$(".mmenu-trigger").click(function(){
mmenuAPI.open();
});
mmenuAPI.bind("open:finish", function(){
setTimeout(function(){
$icon.addClass("is-active");
});
});
mmenuAPI.bind("close:finish", function(){
setTimeout(function(){
$icon.removeClass("is-active");
});
});
}
$(".mm-next").addClass("mm-fullsubopen");
}
mmenuInit();
$(window).resize(function(){ mmenuInit(); });
});
$('.stars a').on("click", function(){
$('.stars a').removeClass('prevactive');
$(this).prevAll().addClass('prevactive');
}).hover(function(){
$('.stars a').removeClass('prevactive');
$(this).addClass('prevactive').prevAll().addClass('prevactive');
}, function(){
$('.stars a').removeClass('prevactive');
$('.stars a.active').prevAll().addClass('prevactive');
}
);
$('body').on('click', '.user-menu', function(){
$(this).toggleClass('active');
});
var user_mouse_is_inside=false;
$("body").on("mouseenter", ".user-menu", function(){
user_mouse_is_inside=true;
});
$("body").on("mouseleave", ".user-menu" ,function(){
user_mouse_is_inside=false;
});
$("body").mouseup(function(){
if(! user_mouse_is_inside) $(".user-menu").removeClass('active');
});
if($('#header-container').hasClass('sticky-header')){
$("#header").not("#header.not-sticky").clone(true).addClass('cloned unsticky').insertAfter("#header");
var reg_logo=$("#header.cloned #logo").data('logo-sticky');
$("#header.cloned #logo img").attr('src',reg_logo);
var headerOffset=100;
$(window).scroll(function(){
if($(window).scrollTop() > headerOffset){
$("#header.cloned").addClass('sticky').removeClass("unsticky");
$("#navigation.style-2.cloned").addClass('sticky').removeClass("unsticky");
}else{
$("#header.cloned").addClass('unsticky').removeClass("sticky");
$("#navigation.style-2.cloned").addClass('unsticky').removeClass("sticky");
}});
}
$(document.body).on("added_to_cart", function (){
$('body').addClass('listeo_adding_to_cart');
setTimeout(function (){
$("body").removeClass("listeo_adding_to_cart");
}, 2000);
});
var pxShow=600;
var scrollSpeed=500;
$(window).scroll(function(){
if($(window).scrollTop() >=pxShow){
$("#backtotop").addClass('visible');
}else{
$("#backtotop").removeClass('visible');
}});
$('#backtotop a').on('click', function(){
$('html, body').animate({scrollTop:0}, scrollSpeed);
return false;
});
function inlineCSS(){
$(".main-search-container, section.fullwidth, .listing-slider .item, .listing-slider-small .item, .address-container, .img-box-background, .image-edge, .edge-bg").each(function(){
var attrImageBG=$(this).attr('data-background-image');
var attrColorBG=$(this).attr('data-background-color');
if(attrImageBG!==undefined){
$(this).css('background-image', 'url('+attrImageBG+')');
}
if(attrColorBG!==undefined){
$(this).css('background', ''+attrColorBG+'');
}});
}
inlineCSS();
function parallaxBG(){
$('.parallax,.vc_parallax').prepend('<div class="parallax-overlay"></div>');
$('.parallax,.vc_parallax').each(function(){
var attrImage=$(this).attr('data-background');
var attrColor=$(this).attr('data-color');
var attrOpacity=$(this).attr('data-color-opacity');
if(attrImage!==undefined){
$(this).css('background-image', 'url('+attrImage+')');
}
if(attrColor!==undefined){
$(this).find(".parallax-overlay").css('background-color', ''+attrColor+'');
}
if(attrOpacity!==undefined){
$(this).find(".parallax-overlay").css('opacity', ''+attrOpacity+'');
}});
}
parallaxBG();
$('.category-box').each(function(){
$(this).append('<div class="category-box-background"></div>');
$(this).children('.category-box-background').css({'background-image': 'url('+ $(this).attr('data-background-image') +')'});
});
$('.img-box').each(function(){
$(this).append('<div class="img-box-background"></div>');
$(this).children('.img-box-background').css({'background-image': 'url('+ $(this).attr('data-background-image') +')'});
});
if("ontouchstart" in window){
document.documentElement.className=document.documentElement.className + " touch";
}
if(!$("html").hasClass("touch")){
$(".parallax").css("background-attachment", "fixed");
}
function fullscreenFix(){
var h=$('body').height();
$(".content-b").each(function(i){
if($(this).innerHeight() > h){ $(this).closest(".fullscreen").addClass("overflow");
}});
}
$(window).resize(fullscreenFix);
fullscreenFix();
function backgroundResize(){
var windowH=$(window).height();
$(".parallax").each(function(i){
var path=$(this);
var contW=path.width();
var contH=path.height();
var imgW=path.attr("data-img-width");
var imgH=path.attr("data-img-height");
var ratio=imgW / imgH;
var diff=100;
diff=diff ? diff:0;
var remainingH=0;
if(path.hasClass("parallax")&&!$("html").hasClass("touch")){
remainingH=windowH - contH;
}
imgH=contH + remainingH + diff;
imgW=imgH * ratio;
if(contW > imgW){
imgW=contW;
imgH=imgW / ratio;
}
path.data("resized-imgW", imgW);
path.data("resized-imgH", imgH);
path.css("background-size", imgW + "px " + imgH + "px");
});
}
$(window).resize(backgroundResize);
$(window).focus(backgroundResize);
backgroundResize();
function parallaxPosition(e){
var heightWindow=$(window).height();
var topWindow=$(window).scrollTop();
var bottomWindow=topWindow + heightWindow;
var currentWindow=(topWindow + bottomWindow) / 2;
$(".parallax").each(function(i){
var path=$(this);
var height=path.height();
var top=path.offset().top;
var bottom=top + height;
if(bottomWindow > top&&topWindow < bottom){
var imgH=path.data("resized-imgH");
var min=0;
var max=- imgH + heightWindow;
var overflowH=height < heightWindow ? imgH - height:imgH - heightWindow;
top=top - overflowH;
bottom=bottom + overflowH;
var value=0;
if($('.parallax').is(".titlebar")){
value=min + (max - min) * (currentWindow - top) / (bottom - top) *2;
}else{
value=min + (max - min) * (currentWindow - top) / (bottom - top);
}
var orizontalPosition=path.attr("data-oriz-pos");
orizontalPosition=orizontalPosition ? orizontalPosition:"50%";
$(this).css("background-position", orizontalPosition + " " + value + "px");
}});
}
if(!$("html").hasClass("touch")){
$(window).resize(parallaxPosition);
$(window).scroll(parallaxPosition);
parallaxPosition();
}
if(navigator.userAgent.match(/Trident\/7\./)){
$('body').on("mousewheel", function (){
event.preventDefault();
var wheelDelta=event.wheelDelta;
var currentScrollPosition=window.pageYOffset;
window.scrollTo(0, currentScrollPosition - wheelDelta);
});
}
$(".dokan-store-products-filter-area select").select2({
dropdownPosition: "below",
dropdownParent: $(".dokan-store-products-ordeby-select"),
minimumResultsForSearch: 20,
width: "100%",
placeholder: $(this).data("placeholder"),
});
$(".select2-single,.woocommerce-ordering select,.dokan-form-group select,#stores_orderby").select2({
dropdownPosition: "below",
minimumResultsForSearch: 20,
width: "100%",
placeholder: $(this).data("placeholder"),
});
$(".select2-multiple").each(function(){
$(this).select2({
dropdownPosition: 'below',
width: "100%",
placeholder: $(this).data('placeholder')
});
});
$('.main-search-inner .select2-single').select2({
minimumResultsForSearch: 20,
dropdownPosition: 'below',
width: "100%",
dropdownParent: $('.main-search-input'),
});
$(".main-search-inner .select2-multiple").each(function(){
$(this).select2({
width: "100%",
dropdownPosition: 'below',
placeholder: $(this).data('placeholder'),
dropdownParent: $('.main-search-input'),
});
});
$('.select2-sortby').select2({
dropdownParent: $('.sort-by'),
minimumResultsForSearch: 20,
width: "100%",
dropdownPosition: 'below',
placeholder: $(this).data('placeholder')
});
$('.select2-bookings').select2({
dropdownParent: $('.sort-by'),
minimumResultsForSearch: 20,
width: "100%",
dropdownPosition: 'below',
placeholder: $(this).data('placeholder')
});
$('.select2-bookings-status').select2({
dropdownParent: $('.sort-by-status'),
minimumResultsForSearch: 20,
width: "100%",
dropdownPosition: 'below',
placeholder: $(this).data('placeholder')
});
$('.mfp-gallery-container').each(function(){
$(this).magnificPopup({
type: 'image',
delegate: 'a.mfp-gallery',
fixedContentPos: true,
fixedBgPos: true,
overflowY: 'auto',
closeBtnInside: false,
preloader: true,
removalDelay: 0,
mainClass: 'mfp-fade',
gallery:{enabled:true, tCounter: ''}});
});
$('.popup-with-zoom-anim').magnificPopup({
type: 'inline',
fixedContentPos: false,
fixedBgPos: true,
overflowY: 'auto',
closeBtnInside: true,
preloader: false,
midClick: true,
removalDelay: 300,
mainClass: 'my-mfp-zoom-in'
});
$('.mfp-image').magnificPopup({
type: 'image',
closeOnContentClick: true,
mainClass: 'mfp-fade',
image: {
verticalFit: true
}});
$('.popup-youtube, .popup-vimeo, .popup-gmaps').magnificPopup({
disableOn: 700,
type: 'iframe',
mainClass: 'mfp-fade',
removalDelay: 160,
preloader: false,
fixedContentPos: false
});
$('.home-search-carousel, .simple-slick-carousel, .simple-fw-slick-carousel, .testimonial-carousel, .fullwidth-slick-carousel').append(""+
"<div class='slider-controls-container'>"+
"<div class='slider-controls'>"+
"<button type='button' class='slide-m-prev'></button>"+
"<div class='slide-m-dots'></div>"+
"<button type='button' class='slide-m-next'></button>"+
"</div>"+
"</div>");
$('.home-search-carousel').each(function(){
$(this).slick({
slide: '.home-search-slide',
centerMode: true,
centerPadding: '15%',
slidesToShow: 1,
dots: true,
arrows: true,
appendDots: $(this).find(".slide-m-dots"),
prevArrow: $(this).find(".slide-m-prev"),
nextArrow: $(this).find(".slide-m-next"),
responsive: [
{
breakpoint: 1940,
settings: {
centerPadding: '13%',
slidesToShow: 1,
}},
{
breakpoint: 1640,
settings: {
centerPadding: '8%',
slidesToShow: 1,
}},
{
breakpoint: 1430,
settings: {
centerPadding: '50px',
slidesToShow: 1,
}},
{
breakpoint: 1370,
settings: {
centerPadding: '20px',
slidesToShow: 1,
}},
{
breakpoint: 767,
settings: {
centerPadding: '20px',
slidesToShow: 1
}}
]
});
});
if(document.readyState=="complete"){
init7Slider();
}
function init7Slider(){
$(".home-search-slider-headlines").each(function(){
var carouselHeadlineHeight=$(this).height();
$(this).css('padding-bottom', carouselHeadlineHeight + 30);
});
$('.home-search-carousel').removeClass('carousel-not-ready');
$('.home-search-carousel-placeholder').addClass('carousel-ready');
if($(window).width() < 992){
$(".home-search-slider-headlines").each(function(){
$(this).css('bottom', $(".main-search-input").height() + 65);
});
}}
$(window).on('load', function(){
init7Slider();
});
$(window).on('load resize', function(){
if($(window).width() < 992){
$(".home-search-slider-headlines").each(function(){
$(this).css('bottom', $(".main-search-input").height() + 65);
});
}});
$('.fullwidth-slick-carousel').each(function(){
$(this).slick({
centerMode: true,
centerPadding: '20%',
slidesToShow: 3,
dots: true,
arrows: true,
slide: '.fw-carousel-item',
appendDots: $(this).find(".slide-m-dots"),
prevArrow: $(this).find(".slide-m-prev"),
nextArrow: $(this).find(".slide-m-next"),
responsive: [
{
breakpoint: 1920,
settings: {
centerPadding: '15%',
slidesToShow: 3
}},
{
breakpoint: 1441,
settings: {
centerPadding: '10%',
slidesToShow: 3
}},
{
breakpoint: 1025,
settings: {
centerPadding: '10px',
slidesToShow: 2,
}},
{
breakpoint: 767,
settings: {
centerPadding: '10px',
slidesToShow: 1
}}
]
});
});
$('.testimonial-carousel').each(function(){
$(this).slick({
centerMode: true,
centerPadding: '34%',
slidesToShow: 1,
dots: true,
arrows: true,
slide: '.fw-carousel-review',
appendDots: $(this).find(".slide-m-dots"),
prevArrow: $(this).find(".slide-m-prev"),
nextArrow: $(this).find(".slide-m-next"),
responsive: [
{
breakpoint: 1025,
settings: {
centerPadding: '10px',
slidesToShow: 2,
}},
{
breakpoint: 767,
settings: {
centerPadding: '10px',
slidesToShow: 1
}}
]
});
});
$('.listing-slider').slick({
centerMode: true,
centerPadding: '20%',
slidesToShow: 2,
responsive: [
{
breakpoint: 1367,
settings: {
centerPadding: '15%'
}},
{
breakpoint: 1025,
settings: {
centerPadding: '0'
}},
{
breakpoint: 767,
settings: {
centerPadding: '0',
slidesToShow: 1
}}
]
});
$('.widget-listing-slider').slick({
dots: true,
infinite: true,
arrows: false,
slidesToShow: 1,
});
$('.listing-slider-small').slick({
centerMode: true,
centerPadding: '0',
slidesToShow: 3,
responsive: [
{
breakpoint: 767,
settings: {
slidesToShow: 1
}}
]
});
$('.simple-slick-carousel').each(function(){
var slides=$(this).data('slides');
if(!slides){ slides=3 }
if($("body").hasClass("page-template-template-dashboard")){
slides=4;
}
$(this)
.slick({
infinite: true,
slidesToShow: slides,
slidesToScroll: 3,
slide: ".fw-carousel-item",
dots: true,
arrows: true,
appendDots: $(this).find(".slide-m-dots"),
prevArrow: $(this).find(".slide-m-prev"),
nextArrow: $(this).find(".slide-m-next"),
responsive: [
{
breakpoint: 1360,
settings: {
slidesToShow: 2,
slidesToScroll: 2,
},
},
{
breakpoint: 769,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
},
},
],
})
.on("init", function (e, slick){});
});
$('.simple-fw-slick-carousel').each(function(){
var slides=$(this).data("slides");
if(!slides){
slides=5;
}
$(this).slick({
infinite: true,
slidesToShow: slides,
slidesToScroll: 1,
dots: true,
arrows: true,
slide: '.fw-carousel-item',
appendDots: $(this).find(".slide-m-dots"),
prevArrow: $(this).find(".slide-m-prev"),
nextArrow: $(this).find(".slide-m-next"),
responsive: [
{
breakpoint: 1610,
settings: {
slidesToShow: 4,
}},
{
breakpoint: 1365,
settings: {
slidesToShow: 3,
}},
{
breakpoint: 1024,
settings: {
slidesToShow: 2,
}},
{
breakpoint: 767,
settings: {
slidesToShow: 1,
}}
]
}).on("init", function(e, slick){
console.log(slick);
});
});
$('.logo-slick-carousel').slick({
infinite: true,
slidesToShow: 5,
slidesToScroll: 4,
dots: true,
arrows: true,
responsive: [
{
breakpoint: 992,
settings: {
slidesToShow: 3,
slidesToScroll: 3
}},
{
breakpoint: 769,
settings: {
slidesToShow: 1,
slidesToScroll: 1
}}
]
});
$(window).on('load resize', function(e){
var carouselListItems=$(".fullwidth-slick-carousel .fw-carousel-item").length;
if(carouselListItems<4){
$('.fullwidth-slick-carousel .slick-slide').css({
'pointer-events': 'all',
'opacity': '1',
});
}});
$(window).on('load resize', function(e){
var carouselListItems=$(".listing-slider-small .slick-track").children().length
if(carouselListItems<2){
$('.listing-slider-small .slick-track').css({
transform: 'none'
});
}});
(function ($){
$.fn.numberPicker=function(){
var dis='disabled';
return this.each(function(){
var picker=$(this),
p=picker.find('button:last-child'),
m=picker.find('button:first-child'),
input=picker.find('input'),
min=parseInt(input.attr('min'), 10),
max=parseInt(input.attr('max'), 10),
inputFunc=function(picker){
var i=parseInt(input.val(), 10);
if((i <=min)||(!i)){
input.val(min);
p.prop(dis, false);
m.prop(dis, true);
}else if(i >=max){
input.val(max);
p.prop(dis, true);
m.prop(dis, false);
}else{
p.prop(dis, false);
m.prop(dis, false);
}},
changeFunc=function(picker, qty){
var q=parseInt(qty, 10),
i=parseInt(input.val(), 10);
if((i < max&&(q > 0))||(i > min&&!(q > 0))){
input.val(i + q);
inputFunc(picker);
}};
m.on('click', function(e){e.preventDefault();changeFunc(picker,-1);});
p.on('click', function(e){e.preventDefault();changeFunc(picker,1);});
input.on('change', function(){inputFunc(picker);});
inputFunc(picker);
});
};}(jQuery));
$('.plusminus').numberPicker();
var $tabsNav=$('.tabs-nav'),
$tabsNavLis=$tabsNav.children('li');
$tabsNav.each(function(){
var $this=$(this);
$this.next().children('.tab-content').stop(true,true).hide()
.first().show();
$this.children('li').first().addClass('active').stop(true,true).show();
});
$tabsNavLis.on('click', function(e){
var $this=$(this);
$this.siblings().removeClass('active').end()
.addClass('active');
$this.parent().next().children('.tab-content').stop(true,true).hide()
.siblings($this.find('a').attr('href')).fadeIn();
e.preventDefault();
});
var hash=window.location.hash;
var anchor=$('.tabs-nav a[href="' + hash + '"]');
if(anchor.length===0){
$(".tabs-nav li:first").addClass("active").show();
$(".tab-content:first").show();
}else{
anchor.parent('li').click();
}
var $accor=$('.accordion');
$accor.each(function(){
$(this).toggleClass('ui-accordion ui-widget ui-helper-reset');
$(this).find('h3').addClass('ui-accordion-header ui-helper-reset ui-state-default ui-accordion-icons ui-corner-all');
$(this).find('div').addClass('ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom');
$(this).find("div").hide();
});
var $trigger=$accor.find('h3');
$trigger.on('click', function(e){
var location=$(this).parent();
if($(this).next().is(':hidden')){
var $triggerloc=$('h3',location);
$triggerloc.removeClass('ui-accordion-header-active ui-state-active ui-corner-top').next().slideUp(300);
$triggerloc.find('span').removeClass('ui-accordion-icon-active');
$(this).find('span').addClass('ui-accordion-icon-active');
$(this).addClass('ui-accordion-header-active ui-state-active ui-corner-top').next().slideDown(300);
}
e.preventDefault();
});
$(".toggle-container").hide();
$('.trigger, .trigger.opened').on('click', function(a){
$(this).toggleClass('active');
a.preventDefault();
});
$(".trigger").on('click', function(){
$(this).next(".toggle-container").slideToggle(300);
});
$(".trigger.opened").addClass("active").next(".toggle-container").show();
$(".tooltip.top").tipTip({
defaultPosition: "top"
});
$(".tooltip.bottom").tipTip({
defaultPosition: "bottom"
});
$(".tooltip.left").tipTip({
defaultPosition: "left"
});
$(".tooltip.right").tipTip({
defaultPosition: "right"
});
$('.more-search-options-trigger').on('click', function(e){
e.preventDefault();
$('.more-search-options, .more-search-options-trigger').toggleClass('active');
$('.more-search-options.relative').animate({height: 'toggle', opacity: 'toggle'}, 300);
});
$(window).on('load resize', function(){
var winWidth=$(window).width();
var headerHeight=$("#header-container").height();
$('.fs-inner-container, .fs-inner-container.map-fixed, #dashboard').css('padding-top', headerHeight);
if(winWidth<992){
$('.fs-inner-container.map-fixed').insertBefore('.fs-inner-container.content');
}else{
$('.fs-inner-container.content').insertBefore('.fs-inner-container.map-fixed');
}});
$(window).on('load', function(){
$(".listeo-dashoard-widgets .dashboard-stat-content h4").counterUp({
delay: 100,
time: 800,
formatter: function (n){
if($("#waller-row").data("numberFormat")=="euro"){
return n.replace(".", ",");
}else{
return n;
}},
});
});
$('.leave-rating input').change(function (){
var $radio=$(this);
$('.leave-rating .selected').removeClass('selected');
$radio.closest('label').addClass('selected');
});
$('.dashboard-nav ul li a').on('click', function(){
if($(this).closest('li').has('ul').length){
$(this).parent('li').toggleClass('active');
}});
$(window).on('load resize', function(){
var wrapperHeight=window.innerHeight;
var headerHeight=$("#header-container").height();
var winWidth=$(window).width();
if(winWidth>992){
$(".dashboard-nav-inner").css('max-height', wrapperHeight-headerHeight);
}else{
$(".dashboard-nav-inner").css('max-height', '');
}});
$(".tip").each(function(){
var tipContent=$(this).attr('data-tip-content');
$(this).append('<div class="tip-content">'+ tipContent + '</div>');
});
$(".verified-badge.with-tip").each(function(){
var tipContent=$(this).attr('data-tip-content');
$(this).append('<div class="tip-content">'+ tipContent + '</div>');
});
$(window).on('load resize', function(){
var verifiedBadge=$('.verified-badge.with-tip');
verifiedBadge.find('.tip-content').css({
'width':verifiedBadge.outerWidth(),
'max-width':verifiedBadge.outerWidth(),
});
});
$('.dashboard-responsive-nav-trigger').on('click', function(e){
e.preventDefault();
$(this).toggleClass('active');
var dashboardNavContainer=$('body').find(".dashboard-nav");
if($(this).hasClass('active')){
$(dashboardNavContainer).addClass('active');
}else{
$(dashboardNavContainer).removeClass('active');
}});
$(window).on('load resize', function(){
var msgContentHeight=$(".message-content").outerHeight();
var msgInboxHeight=$(".messages-inbox ul").height();
if(msgContentHeight > msgInboxHeight){
$(".messages-container-inner .messages-inbox ul").css('max-height', msgContentHeight);
}});
$("a.close").removeAttr("href").on('click', function(){
function slideFade(elem){
var fadeOut={ opacity: 0, transition: 'opacity 0.5s' };
elem.css(fadeOut).slideUp();
}
slideFade($(this).parent());
});
function close_panel_dropdown(){
$('.panel-dropdown').removeClass("active");
$('.fs-inner-container.content').removeClass("faded-out");
}
$('.panel-dropdown a').on('click', function(e){
if($(this).parent().is(".active")){
close_panel_dropdown();
}else{
close_panel_dropdown();
$(this).parent().addClass('active');
$('.fs-inner-container.content').addClass("faded-out");
}
e.preventDefault();
});
$('.panel-buttons button,.panel-buttons span.panel-cancel').on('click', function(e){
$('.panel-dropdown').removeClass('active');
$('.fs-inner-container.content').removeClass("faded-out");
});
var $inputRange=$('input[type="range"].distance-radius');
$inputRange.rangeslider({
polyfill:false,
onInit:function(){
var radiustext=$('.distance-radius').attr('data-title');
this.output=$('<div class="range-output" />').insertBefore(this.$range).html(this.$element.val()).after('<i class="data-radius-title">'+ radiustext + '</i>');;
},
onSlide:function(position, value){
this.output.html(value);
}});
$('.sidebar .panel-disable').on('click', function(e){
var to=$('.sidebar .range-slider');
var enable=$(this).data('enable');
var disable=$(this).data('disable');
to.toggleClass('disabled');
if(to.hasClass('disabled')){
$(to).find("input").prop('disabled', true);
$(this).html(enable);
}else{
$(to).find("input").prop('disabled', false);
$(this).html(disable);
}
$inputRange.rangeslider('update');
});
if(listeo_core.radius_state=='disabled'){
$('.sidebar .panel-disable').each(function(index){
var enable=$(this).data('enable');
$('.sidebar .range-slider').toggleClass('disabled').find("input").prop('disabled', true);
$inputRange.rangeslider('update');
$(this).html(enable);
});
$('.panel-buttons span.panel-disable').each(function(index){
var to=$(this).parent().parent();
var enable=$(this).data('enable');
var disable=$(this).data('disable');
to.toggleClass('disabled');
if(to.hasClass('disabled')){
$(to).find("input").prop('disabled', true);
$(this).html(enable);
}else{
$(to).find("input").prop('disabled', false);
$(this).html(disable);
}
$inputRange.rangeslider('update');
});
}
$('.panel-buttons span.panel-disable').on('click', function(e){
var to=$(this).parent().parent();
var enable=$(this).data('enable');
var disable=$(this).data('disable');
to.toggleClass('disabled');
if(to.hasClass('disabled')){
$(to).find("input").prop('disabled', true);
$(this).html(enable);
}else{
$(to).find("input").prop('disabled', false);
$(this).html(disable);
}
$inputRange.rangeslider('update');
});
var mouse_is_inside=false;
$('.panel-dropdown').hover(function(){
mouse_is_inside=true;
}, function(){
mouse_is_inside=false;
});
$("body").mouseup(function(){
if(! mouse_is_inside) close_panel_dropdown();
});
$('.checkboxes.categories input').on('change', function(){
if($(this).hasClass('all')){
$(this).parents('.checkboxes').find('input').prop('checked', false);
$(this).prop('checked', true);
}else{
$('.checkboxes input.all').prop('checked', false);
}});
function ThousandSeparator(nStr){
nStr +='';
var x=nStr.split('.');
var x1=x[0];
var x2=x.length > 1 ? '.' + x[1]:'';
var rgx=/(\d+)(\d{3})/;
while (rgx.test(x1)){
x1=x1.replace(rgx, '$1' + ',' + '$2');
}
return x1 + x2;
}
var currencyAttr=$(".bootstrap-range-slider").attr('data-slider-currency');
$(".bootstrap-range-slider").slider({
formatter: function(value){
if(listeo_core.currency_position=='before'){
return currencyAttr + " " + ThousandSeparator(parseFloat(value[0])) + " - " + ThousandSeparator(parseFloat(value[1]));
}else{
return ThousandSeparator(parseFloat(value[0])) + " - " + ThousandSeparator(parseFloat(value[1])) + " " + currencyAttr;
}}
})
if(!$(".range-slider-container").hasClass('no-to-disable')){
$(".bootstrap-range-slider").slider("disable").prop('disabled', true).toggleClass('disabled');
}else{
var dis=$(".slider-disable").data('disable');
$(".slider-disable").html(dis);
}
$('.range-slider-container:not(".no-to-disable")').toggleClass('disabled');
$(".slider-disable").click(function(){
var to=$('.range-slider-container');
var enable=$(this).data('enable');
var disable=$(this).data('disable');
to.toggleClass('disabled');
if(to.hasClass('disabled')){
$(".bootstrap-range-slider").slider("disable");
$(to).find("input").prop('disabled', true);
$(this).html(enable);
}else{
$(".bootstrap-range-slider").slider("enable");
$(to).find("input").prop('disabled', false);
$(this).html(disable);
}});
$('.show-more-button').on('click', function(e){
e.preventDefault();
$(this).toggleClass('active');
$('.show-more').toggleClass('visible');
if($('.show-more').is(".visible")){
var el=$('.show-more'),
curHeight=el.height(),
autoHeight=el.css('height', 'auto').height();
el.height(curHeight).animate({height: autoHeight}, 400);
}else{ $('.show-more').animate({height: '450px'}, 400); }});
if(document.getElementById("listing-nav")!==null){
$(window).scroll(function(){
var window_top=$(window).scrollTop();
var div_top=$('.listing-nav').not('.listing-nav-container.cloned .listing-nav').offset().top + 90;
if(window_top > div_top){
$('.listing-nav-container.cloned').addClass('stick');
}else{
$('.listing-nav-container.cloned').removeClass('stick');
}});
}
$(".listing-nav-container").clone(true).addClass('cloned').prependTo("body");
$('.listing-nav li.scrollto a, a.listing-address, .star-rating a.scrollto').on('click', function(e){
e.preventDefault();
$('html,body').scrollTo(this.hash, this.hash, { gap: {y: -20}});
});
$(".listing-nav li.scrollto:first-child a, a.add-review-btn, a[href='#add-review']").on('click', function(e){
e.preventDefault();
$('html,body').scrollTo(this.hash, this.hash, { gap: {y: -100}});
});
$(window).on('load resize', function(){
var aChildren=$(".listing-nav li.scrollto").children();
var aArray=[];
for (var i=0; i < aChildren.length; i++){
var aChild=aChildren[i];
var ahref=$(aChild).attr('href');
aArray.push(ahref);
}
$(window).scroll(function(){
var windowPos=$(window).scrollTop();
for (var i=0; i < aArray.length; i++){
var theID=aArray[i];
if($(theID).length>0){
var divPos=$(theID).offset().top - 150;
var divHeight=$(theID).height();
if(windowPos >=divPos&&windowPos < (divPos + divHeight)){
$("a[href='" + theID + "']").addClass("active");
}else{
$("a[href='" + theID + "']").removeClass("active");
}}
}});
});
var time24=false;
if(listeo_core.clockformat){
time24=true;
}
$(".listeo-flatpickr").flatpickr({
enableTime: true,
noCalendar: true,
dateFormat: "H:i",
time_24hr: time24,
disableMobile: true
});
$('.day_hours_reset').on('click', function(e){
$(this).parent().parent().find('input').val('');
});
var radios=document.querySelectorAll('.payment-tab-trigger > input');
for (var i=0; i < radios.length; i++){
radios[i].addEventListener('change', expandAccordion);
}
function expandAccordion (event){
var allTabs=document.querySelectorAll('.payment-tab');
for (var i=0; i < allTabs.length; i++){
allTabs[i].classList.remove('payment-tab-active');
}
event.target.parentNode.parentNode.classList.add('payment-tab-active');
}
function ratingOverview(ratingElem){
$(ratingElem).each(function(){
var dataRating=$(this).attr('data-rating');
if(dataRating >=4.0){
$(this).addClass('high');
$(this).find('.rating-bars-rating-inner').css({ width: (dataRating/5)*100 + "%", });
}else if(dataRating >=3.0){
$(this).addClass('mid');
$(this).find('.rating-bars-rating-inner').css({ width: (dataRating/5)*80 + "%", });
}else if(dataRating < 3.0){
$(this).addClass('low');
$(this).find('.rating-bars-rating-inner').css({ width: (dataRating/5)*60 + "%", });
}});
} ratingOverview('.rating-bars-rating');
$(window).on('resize', function(){
ratingOverview('.rating-bars-rating');
});
$('.message-vendor').on('click', function(){
$('.captcha-holder').addClass('visible')
});
if(listeo_core.map_provider=='google'){
$('.show-map-button').on('click', function(event){
event.preventDefault();
$(".hide-map-on-mobile").toggleClass("map-active");
var text_enabled=$(this).data('enabled');
var text_disabled=$(this).data('disabled');
if($(".hide-map-on-mobile").hasClass('map-active')){
$(this).text(text_disabled);
}else{
$(this).text(text_enabled);
}});
}
$(window).on('load resize', function(){
$(".fs-inner-container.map-fixed").addClass("hide-map-on-mobile");
$("#map-container").addClass("hide-map-on-mobile");
});
$('.numerical-rating').numericalRating();
$('.star-rating').starRating();
});
})(this.jQuery);