(self.webpackChunk=self.webpackChunk||[]).push([[2209],{34965:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>i}),n(37092),n(80153);var o=n(65311),s=n.n(o);function i(e){var t=s()(e),n=t.find(".form-control"),o=t.find(".autocomplete-container"),i=t.data("endpoint"),a=t.data("scale"),u=n.parent("form"),l=!1;function r(){a&&0==l&&(c(),n.val(""))}function c(){setTimeout((function(){t.removeClass("is-scaled")}),250)}a&&(n.on("focus",(function(){t.addClass("is-scaled")})),n.on("focusout",c),u.on("blur",r)),n.autocomplete({serviceUrl:i,dataType:"json",groupBy:"type",width:"auto",maxHeight:400,minChars:2,deferRequestBy:500,triggerSelectOnValidInput:!1,appendTo:o,beforeRender:function(e){a?s()(e).addClass("is-open"):s()(e).css({"margin-top":"20px"})},transformResult:function(e,t){return{suggestions:e.results.map((function(e){return{value:e.title,data:e}}))}},formatResult:function(e,t,n){return''+o.title+"";var o},onSelect:function(e){window.location.href=e.data.url,setTimeout(r,500)},onSearchStart:function(e){l=!0,n.parent().addClass("loading")},onSearchComplete:function(e,t){n.parent().removeClass("loading")},onHide:function(){l=!1}})}n(88542)},88542:(e,t,n)=>{var o,s,i;!function(a){"use strict";s=[n(65311)],o=function(e){var t={escapeRegExChars:function(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&")},createNode:function(e){var t=document.createElement("div");return t.className=e,t.style.position="absolute",t.style.display="none",t}},n=27,o=9,s=13,i=38,a=39,u=40,l=e.noop;function r(t,n){var o=this;o.element=t,o.el=e(t),o.suggestions=[],o.badQueries=[],o.selectedIndex=-1,o.currentValue=o.element.value,o.timeoutId=null,o.cachedResponse={},o.onChangeTimeout=null,o.onChange=null,o.isLocal=!1,o.suggestionsContainer=null,o.noSuggestionsContainer=null,o.options=e.extend(!0,{},r.defaults,n),o.classes={selected:"autocomplete-selected",suggestion:"autocomplete-suggestion"},o.hint=null,o.hintValue="",o.selection=null,o.initialize(),o.setOptions(n)}r.utils=t,e.Autocomplete=r,r.defaults={ajaxSettings:{},autoSelectFirst:!1,appendTo:"body",serviceUrl:null,lookup:null,onSelect:null,width:"auto",minChars:1,maxHeight:300,deferRequestBy:0,params:{},formatResult:function(e,n){if(!n)return e.value;var o="("+t.escapeRegExChars(n)+")";return e.value.replace(new RegExp(o,"gi"),"$1").replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/<(\/?strong)>/g,"<$1>")},formatGroup:function(e,t){return'
'+t+"
"},delimiter:null,zIndex:9999,type:"GET",noCache:!1,onSearchStart:l,onSearchComplete:l,onSearchError:l,preserveInput:!1,containerClass:"autocomplete-suggestions",tabDisabled:!1,dataType:"text",currentRequest:null,triggerSelectOnValidInput:!0,preventBadQueries:!0,lookupFilter:function(e,t,n){return-1!==e.value.toLowerCase().indexOf(n)},paramName:"query",transformResult:function(t){return"string"==typeof t?e.parseJSON(t):t},showNoSuggestionNotice:!1,noSuggestionNotice:"No results",orientation:"bottom",forceFixPosition:!1},r.prototype={initialize:function(){var t,n=this,o="."+n.classes.suggestion,s=n.classes.selected,i=n.options;n.element.setAttribute("autocomplete","off"),n.noSuggestionsContainer=e('').html(this.options.noSuggestionNotice).get(0),n.suggestionsContainer=r.utils.createNode(i.containerClass),(t=e(n.suggestionsContainer)).appendTo(i.appendTo||"body"),"auto"!==i.width&&t.css("width",i.width),t.on("mouseover.autocomplete",o,(function(){n.activate(e(this).data("index"))})),t.on("mouseout.autocomplete",(function(){n.selectedIndex=-1,t.children("."+s).removeClass(s)})),t.on("click.autocomplete",o,(function(){n.select(e(this).data("index"))})),t.on("click.autocomplete",(function(){clearTimeout(n.blurTimeoutId)})),n.fixPositionCapture=function(){n.visible&&n.fixPosition()},e(window).on("resize.autocomplete",n.fixPositionCapture),n.el.on("keydown.autocomplete",(function(e){n.onKeyPress(e)})),n.el.on("keyup.autocomplete",(function(e){n.onKeyUp(e)})),n.el.on("blur.autocomplete",(function(){n.onBlur()})),n.el.on("focus.autocomplete",(function(){n.onFocus()})),n.el.on("change.autocomplete",(function(e){n.onKeyUp(e)})),n.el.on("input.autocomplete",(function(e){n.onKeyUp(e)}))},onFocus:function(){var e=this;e.disabled||(e.fixPosition(),e.el.val().length>=e.options.minChars&&e.onValueChange())},onBlur:function(){var t=this,n=t.options,o=t.el.val(),s=t.getQuery(o);t.blurTimeoutId=setTimeout((function(){t.hide(),t.selection&&t.currentValue!==s&&(n.onInvalidateSelection||e.noop).call(t.element)}),200)},abortAjax:function(){var e=this;e.currentRequest&&(e.currentRequest.abort(),e.currentRequest=null)},setOptions:function(t){var n=this,o=e.extend({},n.options,t);n.isLocal=Array.isArray(o.lookup),n.isLocal&&(o.lookup=n.verifySuggestionsFormat(o.lookup)),o.orientation=n.validateOrientation(o.orientation,"bottom"),e(n.suggestionsContainer).css({"max-height":o.maxHeight+"px",width:o.width+"px","z-index":o.zIndex}),this.options=o},clearCache:function(){this.cachedResponse={},this.badQueries=[]},clear:function(){this.clearCache(),this.currentValue="",this.suggestions=[]},disable:function(){var e=this;e.disabled=!0,clearTimeout(e.onChangeTimeout),e.abortAjax()},enable:function(){this.disabled=!1},fixPosition:function(){var t=this,n=e(t.suggestionsContainer),o=n.parent().get(0);if(o===document.body||t.options.forceFixPosition){var s=t.options.orientation,i=n.outerHeight(),a=t.el.outerHeight(),u=t.el.offset(),l={top:u.top,left:u.left};if("auto"===s){var r=e(window).height(),c=e(window).scrollTop(),g=-c+u.top-i,d=c+r-(u.top+a+i);s=Math.max(g,d)===g?"top":"bottom"}if(l.top+="top"===s?-i:a,o!==document.body){var p,h=n.css("opacity");t.visible||n.css("opacity",0).show(),p=n.offsetParent().offset(),l.top-=p.top,l.top+=o.scrollTop,l.left-=p.left,t.visible||n.css("opacity",h).hide()}"auto"===t.options.width&&(l.width=t.el.outerWidth()+"px"),n.css(l)}},isCursorAtEnd:function(){var e,t=this.el.val().length,n=this.element.selectionStart;return"number"==typeof n?n===t:!document.selection||((e=document.selection.createRange()).moveStart("character",-t),t===e.text.length)},onKeyPress:function(e){var t=this;if(t.disabled||t.visible||e.which!==u||!t.currentValue){if(!t.disabled&&t.visible){switch(e.which){case n:t.el.val(t.currentValue),t.hide();break;case a:if(t.hint&&t.options.onHint&&t.isCursorAtEnd()){t.selectHint();break}return;case o:if(t.hint&&t.options.onHint)return void t.selectHint();if(-1===t.selectedIndex)return void t.hide();if(t.select(t.selectedIndex),!1===t.options.tabDisabled)return;break;case s:if(-1===t.selectedIndex)return void t.hide();t.select(t.selectedIndex);break;case i:t.moveUp();break;case u:t.moveDown();break;default:return}e.stopImmediatePropagation(),e.preventDefault()}}else t.suggest()},onKeyUp:function(e){var t=this;if(!t.disabled){switch(e.which){case i:case u:return}clearTimeout(t.onChangeTimeout),t.currentValue!==t.el.val()&&(t.findBestHint(),t.options.deferRequestBy>0?t.onChangeTimeout=setTimeout((function(){t.onValueChange()}),t.options.deferRequestBy):t.onValueChange())}},onValueChange:function(){if(this.ignoreValueChange)this.ignoreValueChange=!1;else{var t=this,n=t.options,o=t.el.val(),s=t.getQuery(o);t.selection&&t.currentValue!==s&&(t.selection=null,(n.onInvalidateSelection||e.noop).call(t.element)),clearTimeout(t.onChangeTimeout),t.currentValue=o,t.selectedIndex=-1,n.triggerSelectOnValidInput&&t.isExactMatch(s)?t.select(0):s.lengtha&&(n.suggestions=n.suggestions.slice(0,a)),n},getSuggestions:function(t){var n,o,s,i,a=this,u=a.options,l=u.serviceUrl;u.params[u.paramName]=t,!1!==u.onSearchStart.call(a.element,u.params)&&(o=u.ignoreParams?null:u.params,e.isFunction(u.lookup)?u.lookup(t,(function(e){a.suggestions=e.suggestions,a.suggest(),u.onSearchComplete.call(a.element,t,e.suggestions)})):(a.isLocal?n=a.getSuggestionsLocal(t):(e.isFunction(l)&&(l=l.call(a.element,t)),s=l+"?"+e.param(o||{}),n=a.cachedResponse[s]),n&&Array.isArray(n.suggestions)?(a.suggestions=n.suggestions,a.suggest(),u.onSearchComplete.call(a.element,t,n.suggestions)):a.isBadQuery(t)?u.onSearchComplete.call(a.element,t,[]):(a.abortAjax(),i={url:l,data:o,type:u.type,dataType:u.dataType},e.extend(i,u.ajaxSettings),a.currentRequest=e.ajax(i).done((function(e){var n;a.currentRequest=null,n=u.transformResult(e,t),a.processResponse(n,t,s),u.onSearchComplete.call(a.element,t,n.suggestions)})).fail((function(e,n,o){u.onSearchError.call(a.element,t,e,n,o)})))))},isBadQuery:function(e){if(!this.options.preventBadQueries)return!1;for(var t=this.badQueries,n=t.length;n--;)if(0===e.indexOf(t[n]))return!0;return!1},hide:function(){var t=this,n=e(t.suggestionsContainer);e.isFunction(t.options.onHide)&&t.visible&&t.options.onHide.call(t.element,n),t.visible=!1,t.selectedIndex=-1,clearTimeout(t.onChangeTimeout),e(t.suggestionsContainer).hide(),t.signalHint(null)},suggest:function(){if(this.suggestions.length){var t,n=this,o=n.options,s=o.groupBy,i=o.formatResult,a=n.getQuery(n.currentValue),u=n.classes.suggestion,l=n.classes.selected,r=e(n.suggestionsContainer),c=e(n.noSuggestionsContainer),g=o.beforeRender,d="";o.triggerSelectOnValidInput&&n.isExactMatch(a)?n.select(0):(e.each(n.suggestions,(function(e,n){s&&(d+=function(e,n){var i=e.data[s];return t===i?"":(t=i,o.formatGroup(e,t))}(n,0)),d+=''+i(n,a,e)+"
"})),this.adjustContainerWidth(),c.detach(),r.html(d),e.isFunction(g)&&g.call(n.element,r,n.suggestions),n.fixPosition(),r.show(),o.autoSelectFirst&&(n.selectedIndex=0,r.scrollTop(0),r.children("."+u).first().addClass(l)),n.visible=!0,n.findBestHint())}else this.options.showNoSuggestionNotice?this.noSuggestions():this.hide()},noSuggestions:function(){var t=this,n=t.options.beforeRender,o=e(t.suggestionsContainer),s=e(t.noSuggestionsContainer);this.adjustContainerWidth(),s.detach(),o.empty(),o.append(s),e.isFunction(n)&&n.call(t.element,o,t.suggestions),t.fixPosition(),o.show(),t.visible=!0},adjustContainerWidth:function(){var t,n=this,o=n.options,s=e(n.suggestionsContainer);"auto"===o.width?(t=n.el.outerWidth(),s.css("width",t>0?t:300)):"flex"===o.width&&s.css("width","")},findBestHint:function(){var t=this,n=t.el.val().toLowerCase(),o=null;n&&(e.each(t.suggestions,(function(e,t){var s=0===t.value.toLowerCase().indexOf(n);return s&&(o=t),!s})),t.signalHint(o))},signalHint:function(t){var n="",o=this;t&&(n=o.currentValue+t.value.substr(o.currentValue.length)),o.hintValue!==n&&(o.hintValue=n,o.hint=t,(this.options.onHint||e.noop)(n))},verifySuggestionsFormat:function(t){return t.length&&"string"==typeof t[0]?e.map(t,(function(e){return{value:e,data:null}})):t},validateOrientation:function(t,n){return t=e.trim(t||"").toLowerCase(),-1===e.inArray(t,["auto","bottom","top"])&&(t=n),t},processResponse:function(e,t,n){var o=this,s=o.options;e.suggestions=o.verifySuggestionsFormat(e.suggestions),s.noCache||(o.cachedResponse[n]=e,s.preventBadQueries&&!e.suggestions.length&&o.badQueries.push(t)),t===o.getQuery(o.currentValue)&&(o.suggestions=e.suggestions,o.suggest())},activate:function(t){var n,o=this,s=o.classes.selected,i=e(o.suggestionsContainer),a=i.find("."+o.classes.suggestion);return i.find("."+s).removeClass(s),o.selectedIndex=t,-1!==o.selectedIndex&&a.length>o.selectedIndex?(n=a.get(o.selectedIndex),e(n).addClass(s),n):null},selectHint:function(){var t=this,n=e.inArray(t.hint,t.suggestions);t.select(n)},select:function(e){this.hide(),this.onSelect(e)},moveUp:function(){var t=this;if(-1!==t.selectedIndex)return 0===t.selectedIndex?(e(t.suggestionsContainer).children("."+t.classes.suggestion).first().removeClass(t.classes.selected),t.selectedIndex=-1,t.ignoreValueChange=!1,t.el.val(t.currentValue),void t.findBestHint()):void t.adjustScroll(t.selectedIndex-1)},moveDown:function(){var e=this;e.selectedIndex!==e.suggestions.length-1&&e.adjustScroll(e.selectedIndex+1)},adjustScroll:function(t){var n=this,o=n.activate(t);if(o){var s,i,a,u=e(o).outerHeight();s=o.offsetTop,a=(i=e(n.suggestionsContainer).scrollTop())+n.options.maxHeight-u,sa&&e(n.suggestionsContainer).scrollTop(s-n.options.maxHeight+u),n.options.preserveInput||(n.ignoreValueChange=!0,n.el.val(n.getValue(n.suggestions[t].value))),n.signalHint(null)}},onSelect:function(t){var n=this,o=n.options.onSelect,s=n.suggestions[t];n.currentValue=n.getValue(s.value),n.currentValue===n.el.val()||n.options.preserveInput||n.el.val(n.currentValue),n.signalHint(null),n.suggestions=[],n.selection=s,e.isFunction(o)&&o.call(n.element,s)},getValue:function(e){var t,n,o=this.options.delimiter;return o?1===(n=(t=this.currentValue).split(o)).length?e:t.substr(0,t.length-n[n.length-1].length)+e:e},dispose:function(){var t=this;t.el.off(".autocomplete").removeData("autocomplete"),e(window).off("resize.autocomplete",t.fixPositionCapture),e(t.suggestionsContainer).remove()}},e.fn.devbridgeAutocomplete=function(t,n){var o="autocomplete";return arguments.length?this.each((function(){var s=e(this),i=s.data(o);"string"==typeof t?i&&"function"==typeof i[t]&&i[t](n):(i&&i.dispose&&i.dispose(),i=new r(this,t),s.data(o,i))})):this.first().data(o)},e.fn.autocomplete||(e.fn.autocomplete=e.fn.devbridgeAutocomplete)},void 0===(i=o.apply(t,s))||(e.exports=i)}()}}]);