/*
* # Fomantic UI - 2.9.2
* https://github.com/fomantic/Fomantic-UI
* https://fomantic-ui.com/
*
* Copyright 2023 Contributors
* Released under the MIT license
* https://opensource.org/licenses/MIT
*
*/
!function(Q,W,U){"use strict";function X(e){return"function"==typeof e&&"number"!=typeof e.nodeType}W=void 0!==W&&W.Math===Math?W:globalThis,Q.fn.flyout=function(M){var O,e=Q(this),D=Q(W),N=Q(U),L=Q("html"),B=Q("head"),z=Q("body"),I=e.selector||"",j=Date.now(),R=[],q=M,K="string"==typeof q,V=[].slice.call(arguments,1);return e.each(function(){var n,e,o,s,t,i,r,a=Q.isPlainObject(M)?Q.extend(!0,{},Q.fn.flyout.settings,M):Q.extend({},Q.fn.flyout.settings),l=a.selector,c=a.className,u=a.namespace,d=a.fields,f=a.regExp,h=a.error,g="."+u,p="module-"+u,v=Q(this),b=[W,U].indexOf(a.context)<0?N.find(a.context):z,m=v.find(l.close),y=v.children(l.flyout),k=b.children(l.pusher),x=v.hasClass("flyout"),S=this,A=x?v.data(p):void 0,C=!1,w=b[0]===z[0],T="",F="",H=!1,P=!1,E={initialize:function(){var s;E.debug("Initializing flyout",M),E.create.id(),x||(E.create.flyout(),X(a.onHidden)||(a.onHidden=function(){E.destroy(),v.remove()}),a.autoShow||(a.autoShow=!0)),v.addClass(a.class),""!==a.title&&v.find(l.header).html(E.helpers.escape(a.title,a.preserveHTML)).addClass(a.classTitle),""!==a.content&&v.find(l.content).html(E.helpers.escape(a.content,a.preserveHTML)).addClass(a.classContent),E.has.configActions()&&(0===(s=v.find(l.actions).addClass(a.classActions)).length?s=Q("
",{class:c.actions+" "+(a.classActions||"")}).appendTo(v):s.empty(),a.actions.forEach(function(e){var t=e[d.icon]?"':"",n=E.helpers.escape(e[d.text]||"",a.preserveHTML),i=E.helpers.deQuote(e[d.class]||""),o=e[d.click]&&X(e[d.click])?e[d.click]:function(){};s.append(Q("",{html:t+n,"aria-label":(e[d.text]||e[d.icon]||"").replace(/<[^>]+(>|$)/g,""),class:c.button+" "+i,on:{click:function(){!1!==o.call(S,v)&&E.hide()}}}))})),a.delaySetup?requestAnimationFrame(E.setup.layout):E.setup.layout(),requestAnimationFrame(function(){E.setup.cache()}),"left"!==E.get.direction()&&"right"!==E.get.direction()||(E.setup.heights(),E.bind.resize()),E.bind.events(),E.observeChanges(),E.instantiate(),a.autoShow&&E.show()},instantiate:function(){E.verbose("Storing instance of module",E),A=E,v.data(p,A)},create:{flyout:function(){var e;E.verbose("Programmaticaly create flyout",b),v=Q("",{class:c.flyout,role:"dialog","aria-modal":a.dimPage}),a.closeIcon&&(m=Q("",{class:c.close,role:"button",tabindex:0,"aria-label":a.text.close}),v.append(m)),""!==a.title&&(e="_"+E.get.id()+"title",v.attr("aria-labelledby",e),Q("",{class:c.header,id:e}).appendTo(v)),""!==a.content&&(e="_"+E.get.id()+"desc",v.attr("aria-describedby",e),Q("",{class:c.content,id:e}).appendTo(v)),E.has.configActions()&&Q("",{class:c.actions}).appendTo(v),v.prependTo(b),S=v[0]},id:function(){t=(Math.random().toString(16)+"000000000").slice(2,10),s="."+t,E.verbose("Creating unique id for element",t)}},destroy:function(){i&&i.disconnect(),E.verbose("Destroying previous module for",v),v.off(g).removeData(p),E.is.ios()&&E.remove.ios(),m.off(s),n&&n.off(s),b.off(s),D.off(s),N.off(s)},event:{keyboard:function(e){e.which===a.keys.escape&&(a.closable?(E.debug("Escape key pressed hiding flyout"),E.hide()):E.debug("Escape key pressed, but closable is set to false"),e.preventDefault())},resize:function(){E.setup.heights()},focus:function(){E.is.visible()&&a.autofocus&&a.dimPage&&requestAnimationFrame(E.set.autofocus)},clickaway:function(e){var t;a.closable&&(t=0=S.scrollHeight&&(S.scrollTop=S.scrollHeight-S.offsetHeight-1)},scroll:function(e){0===Q(e.target).closest(l.flyout).length&&e.preventDefault()}},bind:{resize:function(){E.verbose("Adding resize event to window",D),D.on("resize"+s,E.event.resize)},events:function(){E.verbose("Attaching events"),v.on("click"+g,l.close,E.event.close).on("click"+g,l.approve,E.event.approve).on("click"+g,l.deny,E.event.deny),m.on("keyup"+s,E.event.closeKeyUp),D.on("focus"+s,E.event.focus)},clickaway:function(){E.verbose("Adding clickaway events to context",b),b.on("click"+s,E.event.clickaway).on("touchend"+s,E.event.clickaway)},scrollLock:function(){a.scrollLock&&(E.debug("Disabling page scroll"),(H=E.has.scrollbar())&&(E.save.bodyMargin(),E.set.bodyMargin()),b.addClass(c.locked)),E.verbose("Adding events to contain flyout scroll"),N.on("touchmove"+s,E.event.touch),v.on("scroll"+g,E.event.containScroll)}},unbind:{clickaway:function(){E.verbose("Removing clickaway events from context",b),b.off(s)},scrollLock:function(){E.verbose("Removing scroll lock from page"),H&&E.restore.bodyMargin(),b.removeClass(c.locked),N.off(s),v.off("scroll"+g)}},add:{inlineCSS:function(){var e=E.cache.width||v.outerWidth(),t=E.cache.height||v.outerHeight(),n=E.is.rtl(),i=E.get.direction(),t={left:e,right:-e,top:t,bottom:-t};n&&(E.verbose("RTL detected, flipping widths"),t.left=-e,t.right=e),n="").appendTo(B),E.debug("Adding sizing css to head",o)},keyboardShortcuts:function(){E.verbose("Adding keyboard shortcuts"),N.on("keydown"+g,E.event.keyboard)}},observeChanges:function(){"MutationObserver"in W&&((i=new MutationObserver(function(e){function o(e){for(var t=[],n=0,i=e.length;n'),b.children().not(l.omitted).not(y).wrapAll(k),E.refresh()),0!==v.nextAll(l.pusher).length&&v.nextAll(l.pusher)[0]===k[0]||(E.debug("Moved flyout to correct parent element"),E.error(h.movedFlyout,S),v.detach().prependTo(b),E.refresh()),E.is.mobile()&&v.addClass(c.fullscreen),E.clear.cache(),E.set.pushable(),E.set.direction()},heights:function(){E.debug("Setting up heights",v);var e=v.children(l.header),t=v.children(l.content),n=v.children(l.actions),e=(b.height()||0)-(e.outerHeight()||0)-(n.outerHeight()||0);0":">",'"':""","'":"'","`":"`"};return/["&'<>`]/.test(e)?(e=e.replace(/&(?![\d#a-z]{1,12};)/gi,"&")).replace(/["'<>`]/g,function(e){return n[e]}):e}},setting:function(e,t){if(E.debug("Changing setting",e,t),Q.isPlainObject(e))Q.extend(!0,a,e);else{if(void 0===t)return a[e];Q.isPlainObject(a[e])?Q.extend(!0,a[e],t):a[e]=t}},internal:function(e,t){if(Q.isPlainObject(e))Q.extend(!0,E,e);else{if(void 0===t)return E[e];E[e]=t}},debug:function(){!a.silent&&a.debug&&(a.performance?E.performance.log(arguments):(E.debug=Function.prototype.bind.call(console.info,console,a.name+":"),E.debug.apply(console,arguments)))},verbose:function(){!a.silent&&a.verbose&&a.debug&&(a.performance?E.performance.log(arguments):(E.verbose=Function.prototype.bind.call(console.info,console,a.name+":"),E.verbose.apply(console,arguments)))},error:function(){a.silent||(E.error=Function.prototype.bind.call(console.error,console,a.name+":"),E.error.apply(console,arguments))},performance:{log:function(e){var t,n;a.performance&&(n=(t=Date.now())-(j||t),j=t,R.push({Name:e[0],Arguments:[].slice.call(e,1)||"",Element:S,"Execution Time":n})),clearTimeout(E.performance.timer),E.performance.timer=setTimeout(E.performance.display,500)},display:function(){var e=a.name+":",n=0;j=!1,clearTimeout(E.performance.timer),Q.each(R,function(e,t){n+=t["Execution Time"]}),e+=" "+n+"ms",I&&(e+=" '"+I+"'"),0 .ui.fixed.menu, > .ui.right.toast-container, > .ui.right.sidebar, > .ui.right.flyout, > .ui.fixed.nag, > .ui.fixed.nag > .close",fixed:".fixed",omitted:"script, link, style, .ui.modal, .ui.dimmer, .ui.nag, .ui.fixed",pusher:".pusher",flyout:".ui.flyout",header:".ui.header",content:".content",actions:".actions",close:".close",approve:".actions .positive, .actions .approve, .actions .ok",deny:".actions .negative, .actions .deny, .actions .cancel"},regExp:{ios:/(iPad|iPhone|iPod)/g,mobileChrome:/(CriOS)/g,mobile:/Mobile|iP(hone|od|ad)|Android|BlackBerry|IEMobile|Kindle|NetFront|Silk-Accelerated|(hpw|web)OS|Fennec|Minimo|Opera M(obi|ini)|Blazer|Dolfin|Dolphin|Skyfire|Zune/g},error:{method:"The method you called is not defined.",pusher:"Had to add pusher element. For optimal performance make sure body content is inside a pusher element",movedFlyout:"Had to move flyout. For optimal performance make sure flyout and pusher are direct children of your body tag",notFound:"There were no elements that matched the specified selector"},text:{ok:"Ok",cancel:"Cancel",close:"Close"}},Q.fn.flyout.settings.templates={getArguments:function(e){e=[].slice.call(e);return Q.isPlainObject(e[0])?Q.extend({handler:function(){},content:"",title:""},e[0]):(X(e[e.length-1])||e.push(function(){}),{handler:e.pop(),content:e.pop()||"",title:e.pop()||""})},alert:function(){var e=this.get.settings(),t=e.templates.getArguments(arguments);return{title:t.title,content:t.content,actions:[{text:e.text.ok,class:e.className.ok,click:t.handler}]}},confirm:function(){var e=this.get.settings(),t=e.templates.getArguments(arguments);return{title:t.title,content:t.content,actions:[{text:e.text.ok,class:e.className.ok,click:function(){t.handler(!0)}},{text:e.text.cancel,class:e.className.cancel,click:function(){t.handler(!1)}}]}},prompt:function(){var t=this,e=this.get.settings(),n=e.templates.getArguments(arguments);return 0===Q(Q.parseHTML(n.content)).filter(".ui.input").length&&(n.content+=''),{title:n.title,content:n.content,actions:[{text:e.text.ok,class:e.className.ok,click:function(){var e=t.get.settings(),e=t.get.element().find(e.selector.prompt)[0];n.handler(Q(e).val())}},{text:e.text.cancel,class:e.className.cancel,click:function(){n.handler(null)}}]}}}}(jQuery,window,document);