/*
* # Fomantic UI - 2.9.3
* https://github.com/fomantic/Fomantic-UI
* https://fomantic-ui.com/
*
* Copyright 2023 Contributors
* Released under the MIT license
* https://opensource.org/licenses/MIT
*
*/
!function(j,z,$){"use strict";function I(e){return"function"==typeof e&&"number"!=typeof e.nodeType}z=void 0!==z&&z.Math===Math?z:globalThis,j.fn.form=function(V){var A,D=j(this),F=j(z),R=Date.now(),S=[],T=V,L="string"==typeof T,O=[].slice.call(arguments,1);return D.each(function(){var i,f,e,t,m,c,g,p,h,n,u,r,a,l,o,s,d,v=j(this),b=this,y=[],x=!1,k=!1,E=!1,C=["clean","clean"],w={initialize:function(){w.get.settings(),v.addClass(h.initial),L?(void 0===d&&w.instantiate(),w.invoke(T)):(void 0!==d&&(d.invoke("destroy"),w.refresh()),w.verbose("Initializing form validation",v,m),w.bindEvents(),w.set.defaults(),m.autoCheckRequired&&w.set.autoCheck(),w.instantiate())},instantiate:function(){w.verbose("Storing instance of module",w),d=w,v.data(a,w)},destroy:function(){w.verbose("Destroying previous module",d),w.removeEvents(),v.removeData(a)},refresh:function(){w.verbose("Refreshing selector cache"),i=v.find(p.field),f=v.find(p.group),e=v.find(p.message),v.find(p.prompt),t=v.find(p.submit),v.find(p.clear),v.find(p.reset)},refreshEvents:function(){w.removeEvents(),w.bindEvents()},submit:function(e){w.verbose("Submitting form",v),k=!0,v.trigger("submit"),e&&e.preventDefault()},attachEvents:function(e,t){t=t||"submit",j(e).on("click"+l,function(e){w[t](),e.preventDefault()}),o=e,s=t},bindEvents:function(){w.verbose("Attaching form events"),v.on("submit"+l,w.validate.form).on("blur"+l,p.field,w.event.field.blur).on("click"+l,p.submit,w.submit).on("click"+l,p.reset,w.reset).on("click"+l,p.clear,w.clear),i.on("invalid"+l,w.event.field.invalid),m.keyboardShortcuts&&v.on("keydown"+l,p.field,w.event.field.keydown),i.each(function(e,t){var t=j(t),n=t.prop("type"),n=w.get.changeEvent(n,t);t.on(n+l,w.event.field.change)}),m.preventLeaving&&F.on("beforeunload"+l,w.event.beforeUnload),i.on("change"+l+" click"+l+" keyup"+l+" keydown"+l+" blur"+l,function(e){w.determine.isDirty()}),v.on("dirty"+l,function(e){m.onDirty.call()}),v.on("clean"+l,function(e){m.onClean.call()}),o&&w.attachEvents(o,s)},clear:function(){i.each(function(e,t){var t=j(t),n=t.parent(),r=t.closest(f),i=r.find(p.prompt),a=t.closest(p.uiCalendar),o=t.data(g.defaultValue)||"",l=t.is(p.checkbox),s=n.is(p.uiDropdown)&&w.can.useElement("dropdown"),u=0"))},fields:function(e,n){var r=j();return j.each(e,function(e,t){r=r.add(w.get.field(t,n))}),r},fieldLabel:function(e,t){var n="string"==typeof e?w.get.field(e):e,r=n.closest(p.group).find("label:not(:empty)").eq(0);return 1===r.length?r.text():n.prop("placeholder")||(t?e:m.text.unspecifiedField)},validation:function(r){var i,a;return!!c&&(j.each(c,function(e,n){a=n.identifier||e,j.each(w.get.field(a),function(e,t){if(t==r[0])return n.identifier=a,i=n,!1})}),i||!1)},value:function(e,t){var n=[];return n.push(e),e=w.get.values.call(b,n,t),0<(n=Object.keys(e)).length?e[n[0]]:void 0},values:function(e,t){var e=Array.isArray(e)&&0").addClass(h.label),o||i.css("display","none"),i.appendTo(r)),i.html(m.templates.prompt(t)),a||(o?(w.verbose("Displaying error with css transition",m.transition),i.transition(m.transition+" in",m.duration)):(w.verbose("Displaying error with fallback javascript animation"),i.fadeIn(m.duration)))):w.verbose("Inline errors are disabled, no inline error added",e))},errors:function(t){var r,i;!1!==(t=w.checkErrors(t))&&(w.debug("Adding form error messages",t),w.set.error(),r=[],j.isPlainObject(t)?j.each(Object.keys(t),function(e,n){!1!==w.checkErrors(t[n],!0)&&(m.inline?w.add.prompt(n,t[n]):!1!==(i=w.checkErrors(t[n]))&&j.each(i,function(e,t){r.push(m.prompt.addErrors.replace(/{name}/g,w.get.fieldLabel(n)).replace(/{error}/g,t))}))}):r=t,0"+t+""}),n+=""},prompt:function(e){if(1===e.length)return e[0];var n='';return j.each(e,function(e,t){n+="- "+t+"
"}),n+="
"}},formatter:{date:function(e){return Intl.DateTimeFormat("en-GB").format(e)},datetime:function(e){return Intl.DateTimeFormat("en-GB",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(e)},time:function(e){return Intl.DateTimeFormat("en-GB",{hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(e)},month:function(e){return Intl.DateTimeFormat("en-GB",{month:"2-digit",year:"numeric"}).format(e)},year:function(e){return Intl.DateTimeFormat("en-GB",{year:"numeric"}).format(e)}},rules:{empty:function(e){return!(void 0===e||""===e||Array.isArray(e)&&0===e.length)},checked:function(){return 0=t)},exactCount:function(e,t){return 0===(t=Number(t))?""===e:1===t?""!==e&&-1===e.search(","):e.split(",").length===t},maxCount:function(e,t){return 0!==(t=Number(t))&&(1===t?-1===e.search(","):e.split(",").length<=t)}}}}(jQuery,window,document);