!function(t){"function"==typeof define&&define.amd?define(["jquery","moment"],t):t(jQuery,moment)}(function(o,m){function a(t,e){var a=t.data("livestampdata");"number"==typeof e&&(e*=1e3),t.removeAttr("data-livestamp").removeData("livestamp"),e=m(e),m.isMoment(e)&&!isNaN(+e)&&((a=o.extend({},{original:t.contents()},a)).moment=m(e),t.data("livestampdata",a).empty(),u.push(t[0]))}function t(){n||(i.update(),setTimeout(t,e))}var e=1e3,n=!1,u=o([]),i={update:function(){o("[data-livestamp]").each(function(){var t=o(this);a(t,t.data("livestamp"))});var i=[];u.each(function(){var t,e,a=o(this),n=a.data("livestampdata");void 0===n?i.push(this):m.isMoment(n.moment)&&(t=a.html())!=(n=n.moment.fromNow())&&(e=o.Event("change.livestamp"),a.trigger(e,[t,n]),e.isDefaultPrevented()||a.html(n))}),delete(u=u.not(i)).prevObject},pause:function(){n=!0},resume:function(){n=!1,t()},interval:function(t){if(void 0===t)return e;e=t}},r={add:function(t,e){return"number"==typeof e&&(e*=1e3),e=m(e),m.isMoment(e)&&!isNaN(+e)&&(t.each(function(){a(o(this),e)}),i.update()),t},destroy:function(a){return u=u.not(a),a.each(function(){var t=o(this),e=t.data("livestampdata");if(void 0===e)return a;t.html(e.original||"").removeData("livestampdata")}),a},isLivestamp:function(t){return void 0!==t.data("livestampdata")}};o.livestamp=i,o(function(){i.resume()}),o.fn.livestamp=function(t,e){return r[t]||(e=t,t="add"),r[t](this,e)}}); ;!function(e,o){"function"==typeof define&&define.amd?define(["jquery"],function(t){return e.returnExportsGlobal=o(t)}):"object"==typeof exports?module.exports=o(require("jquery")):o(jQuery)}(this,function(i){"use strict";var n,r,s,a,p,u,h,l;function t(t){this.$inputor=t,this.domInputor=this.$inputor[0]}function e(t){this.$inputor=t,this.domInputor=this.$inputor[0]}function o(t){this.$inputor=t}t.prototype.setPos=function(t){var p,l,c,f;return(f=h.getSelection())&&(c=0,l=!1,(p=function(t,e){for(var o,n,r=e.childNodes,i=[],s=0,a=r.length;s=t){l=!0,(n=u.createRange()).setStart(o,t-c),f.removeAllRanges(),f.addRange(n);break}i.push(c+=o.length)}else i.push(p(t,o));return i})(t,this.domInputor)),this.domInputor},t.prototype.getIEPosition=function(){return this.getPosition()},t.prototype.getPosition=function(){var t=this.getOffset(),e=this.$inputor.offset();return t.left-=e.left,t.top-=e.top,t},t.prototype.getOldIEPos=function(){var t=u.selection.createRange(),e=u.body.createTextRange();return e.moveToElementText(this.domInputor),e.setEndPoint("EndToEnd",t),e.text.length},t.prototype.getPos=function(){var t,e;return(e=this.range())?((t=e.cloneRange()).selectNodeContents(this.domInputor),t.setEnd(e.endContainer,e.endOffset),e=t.toString().length,t.detach(),e):u.selection?this.getOldIEPos():void 0},t.prototype.getOldIEOffset=function(){var t=u.selection.createRange().duplicate();return t.moveStart("character",-1),{height:(t=t.getBoundingClientRect()).bottom-t.top,left:t.left,top:t.top}},t.prototype.getOffset=function(t){var e,o,n,r;return h.getSelection&&(r=this.range())?(0|`|"|&/g,"?").replace(/\r\n|\r|\n/g,"
"),t=/firefox/i.test(navigator.userAgent)?t.replace(/\s/g," "):t};return void 0===t&&(t=this.getPos()),e=o.val().slice(0,t),t=o.val().slice(t),e=""+n(e)+"",e=(e+="|")+(""+n(t)+""),new s(o).create(e).rect()},e.prototype.getIEPosition=function(t){var t=this.getIEOffset(t),e=this.$inputor.offset();return{left:t.left-e.left,top:t.top-e.top,height:t.height}},r=e,o.prototype.css_attr=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle","borderTopWidth","boxSizing","fontFamily","fontSize","fontWeight","height","letterSpacing","lineHeight","marginBottom","marginLeft","marginRight","marginTop","outlineWidth","overflow","overflowX","overflowY","paddingBottom","paddingLeft","paddingRight","paddingTop","textAlign","textOverflow","textTransform","whiteSpace","wordBreak","wordWrap"],o.prototype.mirrorCss=function(){var o=this,n={position:"absolute",left:-9999,top:0,zIndex:-2e4};return"TEXTAREA"===this.$inputor.prop("tagName")&&this.css_attr.push("width"),i.each(this.css_attr,function(t,e){return n[e]=o.$inputor.css(e)}),n},o.prototype.create=function(t){return this.$mirror=i("
"),this.$mirror.css(this.mirrorCss()),this.$mirror.html(t),this.$inputor.after(this.$mirror),this},o.prototype.rect=function(){var t=this.$mirror.find("#caret"),e=t.position(),e={left:e.left,top:e.top,height:t.height()};return this.$mirror.remove(),e},s=o,a={contentEditable:function(t){return!(!t[0].contentEditable||"true"!==t[0].contentEditable)}},p={pos:function(t){return t||0===t?this.setPos(t):this.getPos()},position:function(t){return u.selection?this.getIEPosition(t):this.getPosition(t)},offset:function(t){return this.getOffset(t)}},h=u=null,l=function(t){return u=(t=null!=t?t.iframe:void 0)?(h=t.contentWindow,t.contentDocument||h.document):(h=window,document)},i.fn.caret=function(t,e,o){return p[t]?(i.isPlainObject(e)?(l(e),e=void 0):l(o),o=new(a.contentEditable(this)?n:r)(this),p[t].apply(o,[e])):i.error("Method "+t+" does not exist on jQuery.caret")},i.fn.caret.EditableCaret=n,i.fn.caret.InputCaret=r,i.fn.caret.Utils=a,i.fn.caret.apis=p}); ;!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof exports?module.exports=t(require("jquery")):t(jQuery)}(function(a){var i,s;function t(t){this.currentFlag=null,this.controllers={},this.aliasMaps={},this.$inputor=a(t),this.setupRootElement(),this.listen()}s={ESC:27,TAB:9,ENTER:13,CTRL:17,A:65,P:80,N:78,LEFT:37,UP:38,RIGHT:39,DOWN:40,BACKSPACE:8,SPACE:32},i={beforeSave:function(t){return n.arrayToDefaultHash(t)},matcher:function(t,e,i,r){var n;return t=t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),i&&(t="(?:^|\\s)"+t),i=decodeURI("%C3%80"),n=decodeURI("%C3%BF"),(i=new RegExp(t+"([A-Za-z"+i+"-"+n+"0-9_"+(r?" ":"")+"'.+-]*)$|"+t+"([^\\x00-\\xff]*)$","gi").exec(e))?i[2]||i[1]:null},filter:function(t,e,i){for(var r,n=[],o=0,s=e.length;o\\s*([^<]*?)("+e.replace("+","\\+")+")([^<]*)\\s*<","ig"),t.replace(e,function(t,e,i,r){return"> "+e+""+i+""+r+" <"})):t},beforeInsert:function(t,e,i){return t},beforeReposition:function(t){return t},afterMatchFailed:function(t,e){}},t.prototype.createContainer=function(t){var e;return null!=(e=this.$el)&&e.remove(),a(t.body).append(this.$el=a("
"))},t.prototype.setupRootElement=function(e,t){if(null==t&&(t=!1),e)this.window=e.contentWindow,this.document=e.contentDocument||this.window.document,this.iframe=e;else{this.document=this.$inputor[0].ownerDocument,this.window=this.document.defaultView||this.document.parentWindow;try{this.iframe=this.window.frameElement}catch(t){if(e=t,this.iframe=null,a.fn.atwho.debug)throw new Error("iframe auto-discovery is failed.\nPlease use `setIframe` to set the target iframe manually.\n"+e)}}return this.createContainer((this.iframeAsRoot=t)?this.document:document)},t.prototype.controller=function(t){var e,i,r,n;if(this.aliasMaps[t])i=this.controllers[this.aliasMaps[t]];else for(r in n=this.controllers)if(e=n[r],r===t){i=e;break}return i||this.controllers[this.currentFlag]},t.prototype.setContextFor=function(t){return this.currentFlag=t,this},t.prototype.reg=function(t,e){var i=(i=this.controllers)[t]||(i[t]=new(this.$inputor.is("[contentEditable]")?u:d)(this,t));return e.alias&&(this.aliasMaps[e.alias]=t),i.init(e),this},t.prototype.listen=function(){return this.$inputor.on("compositionstart",(a=this,function(t){var e;return null!=(e=a.controller())&&e.view.hide(),a.isComposing=!0,null})).on("compositionend",(s=this,function(t){return s.isComposing=!1,setTimeout(function(t){return s.dispatch(t)}),null})).on("keyup.atwhoInner",(o=this,function(t){return o.onKeyup(t)})).on("keydown.atwhoInner",(r=this,function(t){return r.onKeydown(t)})).on("blur.atwhoInner",(i=this,function(t){var e;if(e=i.controller())return e.expectedQueryCBId=null,e.view.hide(t,e.getOpt("displayTimeout"))})).on("click.atwhoInner",(e=this,function(t){return e.dispatch(t)})).on("scroll.atwhoInner",(n=this,function(){var r=n.$inputor.scrollTop();return function(t){var e,i=t.target.scrollTop;return r!==i&&null!=(e=n.controller())&&e.view.hide(t),r=i,!0}}()));var n,e,i,r,o,s,a},t.prototype.shutdown=function(){var t,e=this.controllers;for(t in e)e[t].destroy(),delete this.controllers[t];return this.$inputor.off(".atwhoInner"),this.$el.remove()},t.prototype.dispatch=function(t){var e,i,r=this.controllers,n=[];for(e in r)i=r[e],n.push(i.lookUp(t));return n},t.prototype.onKeyup=function(t){var e;switch(t.keyCode){case s.ESC:t.preventDefault(),null!=(e=this.controller())&&e.view.hide();break;case s.DOWN:case s.UP:case s.CTRL:case s.ENTER:a.noop();break;case s.P:case s.N:t.ctrlKey||this.dispatch(t);break;default:this.dispatch(t)}},t.prototype.onKeydown=function(t){var e,i=null!=(e=this.controller())?e.view:void 0;if(i&&i.visible())switch(t.keyCode){case s.ESC:t.preventDefault(),i.hide(t);break;case s.UP:t.preventDefault(),i.prev();break;case s.DOWN:t.preventDefault(),i.next();break;case s.P:t.ctrlKey&&(t.preventDefault(),i.prev());break;case s.N:t.ctrlKey&&(t.preventDefault(),i.next());break;case s.TAB:case s.ENTER:case s.SPACE:!i.visible()||!this.controller().getOpt("spaceSelectsMatch")&&t.keyCode===s.SPACE||!this.controller().getOpt("tabSelectsMatch")&&t.keyCode===s.TAB||(i.highlighted()?(t.preventDefault(),i.choose(t)):i.hide(t));break;default:a.noop()}};var o=t,r=[].slice;function e(t,e){this.app=t,this.at=e,this.$inputor=this.app.$inputor,this.id=this.$inputor[0].id||this.uid(),this.expectedQueryCBId=null,this.setting=null,this.query=null,this.pos=0,this.range=null,0===(this.$el=a("#atwho-ground-"+this.id,this.app.$el)).length&&this.app.$el.append(this.$el=a("
")),this.model=new c(this),this.view=new p(this)}e.prototype.uid=function(){return(Math.random().toString(16)+"000000000").substr(2,8)+(new Date).getTime()},e.prototype.init=function(t){return this.setting=a.extend({},this.setting||a.fn.atwho.default,t),this.view.init(),this.model.reload(this.setting.data)},e.prototype.destroy=function(){return this.trigger("beforeDestroy"),this.model.destroy(),this.view.destroy(),this.$el.remove()},e.prototype.callDefault=function(){var e=arguments[0],t=2<=arguments.length?r.call(arguments,1):[];try{return i[e].apply(this,t)}catch(t){return a.error(t+" Or maybe At.js doesn't have function "+e)}},e.prototype.trigger=function(t,e){var i;return(e=null==e?[]:e).push(this),i=this.getOpt("alias"),this.$inputor.trigger(i?t+"-"+i+".atwho":t+".atwho",e)},e.prototype.callbacks=function(t){return this.getOpt("callbacks")[t]||i[t]},e.prototype.getOpt=function(t,e){try{return this.setting[t]}catch(t){return null}},e.prototype.insertContentFor=function(t){var e=this.getOpt("insertTpl"),t=a.extend({},t.data("item-data"),{"atwho-at":this.at});return this.callbacks("tplEval").call(this,e,t,"onInsert")},e.prototype.renderView=function(t){var e=this.getOpt("searchKey");return t=this.callbacks("sorter").call(this,this.query.text,t.slice(0,1001),e),this.view.render(t.slice(0,this.getOpt("limit")))},e.arrayToDefaultHash=function(t){var e,i,r,n;if(!Array.isArray(t))return t;for(n=[],e=0,r=t.length;e
    "),this.$elUl=this.$el.children(),this.timeoutID=null,this.context.$el.append(this.$el),this.bindEvent()}(function(t,e){for(var i in e)l.call(e,i)&&(t[i]=e[i]);function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype})(g,n),g.prototype._getRange=function(){var t=this.app.window.getSelection();if(0",this.app.document).attr(this.getOpt("editableAtwhoQueryAttrs")).addClass("atwho-query"),o.surroundContents(e.get(0)),r=e.contents().last().get(0))&&(/firefox/i.test(navigator.userAgent)?(o.setStart(r,r.length),o.setEnd(r,r.length),this._clearRange(o)):this._setRange("after",r,o)),!(i&&n.lengtha(e).height()&&(t.bottom=t.top-this.$el.height()),t.left>(e=a(e).width()-this.$el.width()-5)&&(t.left=e),e={left:t.left,top:t.bottom},null!=(t=this.context.callbacks("beforeReposition"))&&t.call(this.context,e),this.$el.offset(e),this.context.trigger("reposition",[e])},v.prototype.next=function(){var t=this.$el.find(".cur").removeClass("cur").next();return(t=t.length?t:this.$el.find("li:first")).addClass("cur"),t=(t=t[0]).offsetTop+t.offsetHeight+(t.nextSibling?t.nextSibling.offsetHeight:0),this.scrollTop(Math.max(0,t-this.$el.height()))},v.prototype.prev=function(){var t=this.$el.find(".cur").removeClass("cur").prev();return(t=t.length?t:this.$el.find("li:last")).addClass("cur"),t=(t=t[0]).offsetTop+t.offsetHeight+(t.nextSibling?t.nextSibling.offsetHeight:0),this.scrollTop(Math.max(0,t-this.$el.height()))},v.prototype.scrollTop=function(t){var e=this.context.getOpt("scrollDuration");return e?this.$elUl.animate({scrollTop:t},e):this.$elUl.scrollTop(t)},v.prototype.show=function(){var t;if(!this.stopShowing)return this.visible()||(this.$el.show(),this.$el.scrollTop(0),this.context.trigger("shown")),(t=this.context.rect())?this.reposition(t):void 0;this.stopShowing=!1},v.prototype.hide=function(t,e){var i;if(this.visible())return isNaN(e)?(this.$el.hide(),this.context.trigger("hidden",[t])):(i=this,t=function(){return i.hide()},clearTimeout(this.timeoutID),this.timeoutID=setTimeout(t,e))},v.prototype.render=function(t){var e,i,r,n,o,s;if(Array.isArray(t)&&0${name}",insertTpl:"${atwho-at}${name}",headerTpl:null,callbacks:i,functionOverrides:{},searchKey:"name",suffix:void 0,hideWithoutSuffix:!1,startWithSpace:!0,acceptSpaceBar:!1,highlightFirst:!0,limit:5,maxLen:20,minLen:0,displayTimeout:300,delay:null,spaceSelectsMatch:!1,tabSelectsMatch:!0,editableAtwhoQueryAttrs:{},scrollDuration:150,suspendOnComposing:!0,lookUpOnClick:!0},a.fn.atwho.debug=!1}); ;window.bp=window.bp||{},function(t,r){var o,a=[];t.mentions=t.mentions||{},t.mentions.users=window.bp.mentions.users||[],"object"==typeof window.BP_Suggestions&&(t.mentions.users=window.BP_Suggestions.friends||t.mentions.users),r.fn.bp_mentions=function(t){Array.isArray(t)&&(t={data:t});var e={delay:200,hideWithoutSuffix:!0,insertTpl:"@${ID}",limit:10,startWithSpace:!1,suffix:"",callbacks:{filter:function(t,e,i){for(var n,s=[],r=new RegExp("^"+t+"| "+t,"ig"),o=0,a=e.length;o(\\s*|[\\w\\s]*)("+this.at.replace("+","\\+")+"?"+e.replace("+","\\+")+")([\\w ]*)\\s*<","ig"),t.replace(e,function(t,e,i,n){return">"+e+""+i+""+n+"<"})):t},before_reposition:function(t){var e,i=r("#atwho-ground-"+this.id+" .atwho-view"),n=r("body"),s=this.$inputor.data("atwho");"undefined"!==s&&"undefined"!==s.iframe&&null!==s.iframe?(e=this.$inputor.caret("offset",{iframe:s.iframe}),"undefined"!==(s=r(s.iframe).offset())&&(e.left+=s.left,e.top+=s.top)):e=this.$inputor.caret("offset"),s=e.left>n.width()/2?(i.addClass("right"),e.left-t.left-this.view.$el.width()):(i.removeClass("right"),e.left-t.left+1),n.width()<=400&&r(document).scrollTop(e.top-6),i=parseInt(this.$inputor.css("line-height").substr(0,this.$inputor.css("line-height").length-2),10),t.top=e.top+(i=!i||i<5?19:i),t.left+=s},inserting_wrapper:function(t,e,i){return""+e+i}}},i={callbacks:{remoteFilter:function(e,i){var t,n=r(this),s={};"object"==typeof(o=a[e])?i(o):(n.xhr&&n.xhr.abort(),s={action:"bp_get_suggestions",term:e,type:"members"},"number"!=typeof(t=this.$inputor.data("suggestions-group-id"))&&"string"!=typeof t||isNaN(t-parseFloat(t))||(s["group-id"]=parseInt(this.$inputor.data("suggestions-group-id"),10)),n.xhr=r.getJSON(ajaxurl,s).done(function(t){t.success&&(t=r.map(t.data,function(t){return t.search=t.search||t.ID+" "+t.name,t}),a[e]=t,i(t))}))}},data:r.map(t.data,function(t){return t.search=t.search||t.ID+" "+t.name,t}),at:"@",searchKey:"search",displayTpl:'
  • @${ID}${name}
  • '},e=r.extend(!0,{},e,i,t);return r.fn.atwho.call(this,e)},r(document).ready(function(){r(".bp-suggestions, #comments form textarea, .wp-editor-area").bp_mentions(t.mentions.users)}),t.mentions.tinyMCEinit=function(){void 0!==window.tinyMCE&&null!==window.tinyMCE.activeEditor&&void 0!==window.tinyMCE.activeEditor&&r(window.tinyMCE.activeEditor.contentDocument.activeElement).atwho("setIframe",r(".wp-editor-wrap iframe")[0]).bp_mentions(t.mentions.users)}}(bp,jQuery); ;(()=>{"use strict";var t={d:(e,i)=>{for(var s in i)t.o(i,s)&&!t.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:i[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function i(t){if(this.formData={},this.tree={},!(t instanceof FormData))return this;this.formData=t;const e=()=>{const t=new Map;return t.largestIndex=0,t.set=function(e,i){""===e?e=t.largestIndex++:/^[0-9]+$/.test(e)&&(e=parseInt(e),t.largestIndex<=e&&(t.largestIndex=e+1)),Map.prototype.set.call(t,e,i)},t};this.tree=e();const i=/^(?[a-z][-a-z0-9_:]*)(?(?:\[(?:[a-z][-a-z0-9_:]*|[0-9]*)\])*)/i;for(const[t,s]of this.formData){const o=t.match(i);if(o)if(""===o.groups.array)this.tree.set(o.groups.name,s);else{const t=[...o.groups.array.matchAll(/\[([a-z][-a-z0-9_:]*|[0-9]*)\]/gi)].map((([t,e])=>e));t.unshift(o.groups.name);const i=t.pop();t.reduce(((t,i)=>{if(/^[0-9]+$/.test(i)&&(i=parseInt(i)),t.get(i)instanceof Map)return t.get(i);const s=e();return t.set(i,s),s}),this.tree).set(i,s)}}}t.r(e),t.d(e,{all:()=>D,any:()=>M,date:()=>f,dayofweek:()=>u,email:()=>r,enum:()=>h,file:()=>m,maxdate:()=>z,maxfilesize:()=>$,maxitems:()=>v,maxlength:()=>x,maxnumber:()=>b,mindate:()=>A,minfilesize:()=>j,minitems:()=>w,minlength:()=>g,minnumber:()=>y,number:()=>c,required:()=>n,requiredfile:()=>a,tel:()=>l,time:()=>d,url:()=>p}),i.prototype.entries=function(){return this.tree.entries()},i.prototype.get=function(t){return this.tree.get(t)},i.prototype.getAll=function(t){if(!this.has(t))return[];const e=t=>{const i=[];if(t instanceof Map)for(const[s,o]of t)i.push(...e(o));else""!==t&&i.push(t);return i};return e(this.get(t))},i.prototype.has=function(t){return this.tree.has(t)},i.prototype.keys=function(){return this.tree.keys()},i.prototype.values=function(){return this.tree.values()};const s=i;function o({rule:t,field:e,error:i,...s}){this.rule=t,this.field=e,this.error=i,this.properties=s}const n=function(t){if(0===t.getAll(this.field).length)throw new o(this)},a=function(t){if(0===t.getAll(this.field).length)throw new o(this)},r=function(t){if(!t.getAll(this.field).every((t=>{if((t=t.trim()).length<6)return!1;if(-1===t.indexOf("@",1))return!1;if(t.indexOf("@")!==t.lastIndexOf("@"))return!1;const[e,i]=t.split("@",2);if(!/^[a-zA-Z0-9!#$%&\'*+\/=?^_`{|}~\.-]+$/.test(e))return!1;if(/\.{2,}/.test(i))return!1;if(/(?:^[ \t\n\r\0\x0B.]|[ \t\n\r\0\x0B.]$)/.test(i))return!1;const s=i.split(".");if(s.length<2)return!1;for(const t of s){if(/(?:^[ \t\n\r\0\x0B-]|[ \t\n\r\0\x0B-]$)/.test(t))return!1;if(!/^[a-z0-9-]+$/i.test(t))return!1}return!0})))throw new o(this)},p=function(t){const e=t.getAll(this.field);if(!e.every((t=>{if(""===(t=t.trim()))return!1;try{return(t=>-1!==["http","https","ftp","ftps","mailto","news","irc","irc6","ircs","gopher","nntp","feed","telnet","mms","rtsp","sms","svn","tel","fax","xmpp","webcal","urn"].indexOf(t))(new URL(t).protocol.replace(/:$/,""))}catch{return!1}})))throw new o(this)},l=function(t){if(!t.getAll(this.field).every((t=>(t=(t=t.trim()).replaceAll(/[()/.*#\s-]+/g,""),/^[+]?[0-9]+$/.test(t)))))throw new o(this)},c=function(t){if(!t.getAll(this.field).every((t=>(t=t.trim(),!!/^[-]?[0-9]+(?:[eE][+-]?[0-9]+)?$/.test(t)||!!/^[-]?(?:[0-9]+)?[.][0-9]+(?:[eE][+-]?[0-9]+)?$/.test(t)))))throw new o(this)},f=function(t){if(!t.getAll(this.field).every((t=>{if(t=t.trim(),!/^[0-9]{4,}-[0-9]{2}-[0-9]{2}$/.test(t))return!1;const e=new Date(t);return!Number.isNaN(e.valueOf())})))throw new o(this)},d=function(t){if(!t.getAll(this.field).every((t=>{const e=t.trim().match(/^([0-9]{2})\:([0-9]{2})(?:\:([0-9]{2}))?$/);if(!e)return!1;const i=parseInt(e[1]),s=parseInt(e[2]),o=e[3]?parseInt(e[3]):0;return 0<=i&&i<=23&&0<=s&&s<=59&&0<=o&&o<=59})))throw new o(this)},m=function(t){if(!t.getAll(this.field).every((t=>t instanceof File&&this.accept?.some((e=>/^\.[a-z0-9]+$/i.test(e)?t.name.toLowerCase().endsWith(e.toLowerCase()):(t=>{const e=[],i=t.match(/^(?[a-z]+)\/(?[*]|[a-z0-9.+-]+)$/i);if(i){const t=i.groups.toplevel.toLowerCase(),s=i.groups.sub.toLowerCase();for(const[o,n]of(()=>{const t=new Map;return t.set("jpg|jpeg|jpe","image/jpeg"),t.set("gif","image/gif"),t.set("png","image/png"),t.set("bmp","image/bmp"),t.set("tiff|tif","image/tiff"),t.set("webp","image/webp"),t.set("ico","image/x-icon"),t.set("heic","image/heic"),t.set("asf|asx","video/x-ms-asf"),t.set("wmv","video/x-ms-wmv"),t.set("wmx","video/x-ms-wmx"),t.set("wm","video/x-ms-wm"),t.set("avi","video/avi"),t.set("divx","video/divx"),t.set("flv","video/x-flv"),t.set("mov|qt","video/quicktime"),t.set("mpeg|mpg|mpe","video/mpeg"),t.set("mp4|m4v","video/mp4"),t.set("ogv","video/ogg"),t.set("webm","video/webm"),t.set("mkv","video/x-matroska"),t.set("3gp|3gpp","video/3gpp"),t.set("3g2|3gp2","video/3gpp2"),t.set("txt|asc|c|cc|h|srt","text/plain"),t.set("csv","text/csv"),t.set("tsv","text/tab-separated-values"),t.set("ics","text/calendar"),t.set("rtx","text/richtext"),t.set("css","text/css"),t.set("htm|html","text/html"),t.set("vtt","text/vtt"),t.set("dfxp","application/ttaf+xml"),t.set("mp3|m4a|m4b","audio/mpeg"),t.set("aac","audio/aac"),t.set("ra|ram","audio/x-realaudio"),t.set("wav","audio/wav"),t.set("ogg|oga","audio/ogg"),t.set("flac","audio/flac"),t.set("mid|midi","audio/midi"),t.set("wma","audio/x-ms-wma"),t.set("wax","audio/x-ms-wax"),t.set("mka","audio/x-matroska"),t.set("rtf","application/rtf"),t.set("js","application/javascript"),t.set("pdf","application/pdf"),t.set("swf","application/x-shockwave-flash"),t.set("class","application/java"),t.set("tar","application/x-tar"),t.set("zip","application/zip"),t.set("gz|gzip","application/x-gzip"),t.set("rar","application/rar"),t.set("7z","application/x-7z-compressed"),t.set("exe","application/x-msdownload"),t.set("psd","application/octet-stream"),t.set("xcf","application/octet-stream"),t.set("doc","application/msword"),t.set("pot|pps|ppt","application/vnd.ms-powerpoint"),t.set("wri","application/vnd.ms-write"),t.set("xla|xls|xlt|xlw","application/vnd.ms-excel"),t.set("mdb","application/vnd.ms-access"),t.set("mpp","application/vnd.ms-project"),t.set("docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"),t.set("docm","application/vnd.ms-word.document.macroEnabled.12"),t.set("dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"),t.set("dotm","application/vnd.ms-word.template.macroEnabled.12"),t.set("xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),t.set("xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"),t.set("xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"),t.set("xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"),t.set("xltm","application/vnd.ms-excel.template.macroEnabled.12"),t.set("xlam","application/vnd.ms-excel.addin.macroEnabled.12"),t.set("pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"),t.set("pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"),t.set("ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"),t.set("ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"),t.set("potx","application/vnd.openxmlformats-officedocument.presentationml.template"),t.set("potm","application/vnd.ms-powerpoint.template.macroEnabled.12"),t.set("ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"),t.set("sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"),t.set("sldm","application/vnd.ms-powerpoint.slide.macroEnabled.12"),t.set("onetoc|onetoc2|onetmp|onepkg","application/onenote"),t.set("oxps","application/oxps"),t.set("xps","application/vnd.ms-xpsdocument"),t.set("odt","application/vnd.oasis.opendocument.text"),t.set("odp","application/vnd.oasis.opendocument.presentation"),t.set("ods","application/vnd.oasis.opendocument.spreadsheet"),t.set("odg","application/vnd.oasis.opendocument.graphics"),t.set("odc","application/vnd.oasis.opendocument.chart"),t.set("odb","application/vnd.oasis.opendocument.database"),t.set("odf","application/vnd.oasis.opendocument.formula"),t.set("wp|wpd","application/wordperfect"),t.set("key","application/vnd.apple.keynote"),t.set("numbers","application/vnd.apple.numbers"),t.set("pages","application/vnd.apple.pages"),t})())("*"===s&&n.startsWith(t+"/")||n===i[0])&&e.push(...o.split("|"))}return e})(e).some((e=>(e="."+e.trim(),t.name.toLowerCase().endsWith(e.toLowerCase())))))))))throw new o(this)},h=function(t){if(!t.getAll(this.field).every((t=>this.accept?.some((e=>t===String(e))))))throw new o(this)},u=function(t){if(!t.getAll(this.field).every((t=>{const e=0===(i=new Date(t).getDay())?7:i;var i;return this.accept?.some((t=>e===parseInt(t)))})))throw new o(this)},w=function(t){if(t.getAll(this.field).length{"string"==typeof t&&(i+=t.length)})),0!==i&&i{"string"==typeof t&&(i+=t.length)})),parseInt(this.threshold)!(parseFloat(t)!(parseFloat(this.threshold)(t=t.trim(),!(/^[0-9]{4,}-[0-9]{2}-[0-9]{2}$/.test(t)&&/^[0-9]{4,}-[0-9]{2}-[0-9]{2}$/.test(this.threshold)&&t(t=t.trim(),!(/^[0-9]{4,}-[0-9]{2}-[0-9]{2}$/.test(t)&&/^[0-9]{4,}-[0-9]{2}-[0-9]{2}$/.test(this.threshold)&&this.threshold{t instanceof File&&(i+=t.size)})),i{t instanceof File&&(i+=t.size)})),parseInt(this.threshold){const{rule:s,...o}=t;return"function"==typeof e[s]&&("function"!=typeof e[s].matches||e[s].matches(o,i))},O=({ruleObj:t,formDataTree:i,options:s})=>{const{rule:o}=t;e[o].call(t,i,s)},E=[],k=t=>[...E].reduce(((t,e)=>i=>e(i,t)),t),D=function(t,e={}){const i=(this.rules??[]).filter((t=>I({ruleObj:t,options:e}))),s=k(O);if(!i.every((i=>{try{s({ruleObj:i,formDataTree:t,options:e})}catch(t){if(!(t instanceof o))throw t;if(void 0!==t.error)throw t;return!1}return!0})))throw new o(this)},M=function(t,e={}){const i=(this.rules??[]).filter((t=>I({ruleObj:t,options:e}))),s=k(O);if(!i.some((i=>{try{s({ruleObj:i,formDataTree:t,options:e})}catch(t){if(!(t instanceof o))throw t;return!1}return!0})))throw new o(this)};var F;window.swv={validators:e,validate:(t,e,i={})=>{const n=(t.rules??[]).filter((t=>I({ruleObj:t,options:i})));if(!n.length)return new Map;const a=k(O),r=new s(e),p=n.reduce(((t,e)=>{try{a({ruleObj:e,formDataTree:r,options:i})}catch(e){if(!(e instanceof o))throw e;if(void 0!==e.field&&!t.has(e.field)&&void 0!==e.error)return t.set(e.field,e)}return t}),new Map);for(const t of r.keys())p.has(t)||p.set(t,{validInputs:r.getAll(t)});return p},use:t=>{E.push(t)},...null!==(F=window.swv)&&void 0!==F?F:{}}})();