1(function(){"use strict";function i(){return i=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var o=arguments[e];for(var r in o)({}).hasOwnProperty.call(o,r)&&(t[r]=o[r])}return t},i.apply(null,arguments)}const d=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),f=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,p=(t,e)=>{const o=t.nodeName.toLowerCase();return e.includes(o)?d.has(o)?!!f.test(t.nodeValue):!0:e.filter(r=>r instanceof RegExp).some(r=>r.test(o))};function J(t,e,o){if(!t.length)return t;if(o&&typeof o=="function")return o(t);const a=new window.DOMParser().parseFromString(t,"text/html"),n=[].concat(...a.body.querySelectorAll("*"));for(const l of n){const m=l.nodeName.toLowerCase();if(!Object.keys(e).includes(m)){l.remove();continue}const h=[].concat(...l.attributes),g=[].concat(e["*"]||[],e[m]||[]);for(const u of h)p(u,g)||l.removeAttribute(u.nodeName)}return a.body.innerHTML}/** 2* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org> 3* @license GNU General Public License version 2 or later; see LICENSE.txt 4*/const c={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i,/^data-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[],button:["type"],input:["accept","alt","autocomplete","autofocus","capture","checked","dirname","disabled","height","list","max","maxlength","min","minlength","multiple","type","name","pattern","placeholder","readonly","required","size","src","step","value","width","inputmode"],select:["name"],textarea:["name"],option:["value","selected"],details:["open"],summary:[]};window.Joomla=window.Joomla||{},Joomla.editors=Joomla.editors||{},Joomla.editors.instances=Joomla.editors.instances||{},Joomla.Modal=Joomla.Modal||{current:"",setCurrent:t=>{Joomla.Modal.current=t},getCurrent:()=>Joomla.Modal.current},Joomla.extend=(t,e)=>{let o=t;return t===null&&(o={}),Object.keys(e).forEach(r=>{o[r]=e[r]}),t},Joomla.optionsStorage=Joomla.optionsStorage||null,Joomla.getOptions=(t,e)=>(Joomla.optionsStorage||Joomla.loadOptions(),Joomla.optionsStorage[t]!==void 0?Joomla.optionsStorage[t]:e),Joomla.loadOptions=t=>{if(!t){let e=0;if(document.querySelectorAll(".joomla-script-options.new").forEach(o=>{const r=o.text||o.textContent,a=JSON.parse(r);a&&(Joomla.loadOptions(a),e+=1),o.className=o.className.replace(" new"," loaded")}),e)return}Joomla.optionsStorage?t&&Object.keys(t).forEach(e=>{t[e]!==null&&typeof Joomla.optionsStorage[e]=="object"&&typeof t[e]=="object"?Joomla.optionsStorage[e]=Joomla.extend(Joomla.optionsStorage[e],t[e]):Joomla.optionsStorage[e]=t[e]}):Joomla.optionsStorage=t||{}},Joomla.Text={strings:{},_:(t,e)=>{let o=t,r=e;const a=Joomla.getOptions("joomla.jtext");return a&&(Joomla.Text.load(a),Joomla.loadOptions({"joomla.jtext":null})),r=r===void 0?o:r,o=o.toUpperCase(),Joomla.Text.strings[o]!==void 0?Joomla.Text.strings[o]:r},load:t=>(Object.keys(t).forEach(e=>{Joomla.Text.strings[e.toUpperCase()]=t[e]}),Joomla.Text)},Joomla.JText=Joomla.Text,Joomla.submitform=(t,e,o)=>{let r=e;const a=t;r||(r=document.getElementById("adminForm")),a&&(r.task.value=a),r.noValidate=!o,o?r.hasAttribute("novalidate")&&r.removeAttribute("novalidate"):r.setAttribute("novalidate","");const n=document.createElement("input");n.classList.add("hidden"),n.type="submit",r.appendChild(n).click(),r.removeChild(n)},Joomla.submitbutton=(t,e,o)=>{let r=document.querySelector(e||"form.form-validate"),a=o;if(typeof e=="string"&&r===null&&(r=document.querySelector(`#${e}`)),r){if(a==null){const n=t.split(".");let l=r.getAttribute("data-cancel-task");l||(l=`${n[0]}.cancel`),a=t!==l}(!a||document.formvalidator.isValid(r))&&Joomla.submitform(t,r)}else Joomla.submitform(t)},Joomla.checkAll=(t,e)=>{if(!t.form)return!1;const o=e||"cb",r=[].slice.call(t.form.elements);let a=0;return r.forEach(n=>{n.type===t.type&&n.id.indexOf(o)===0&&(n.checked=t.checked,a+=n.checked?1:0)}),t.form.boxchecked&&(t.form.boxchecked.value=a,t.form.boxchecked.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!0}))),!0},Joomla.isChecked=(t,e)=>{let o=e;if(typeof o>"u"?o=document.getElementById("adminForm"):typeof e=="string"&&(o=document.getElementById(e)),o.boxchecked.value=t?parseInt(o.boxchecked.value,10)+1:parseInt(o.boxchecked.value,10)-1,o.boxchecked.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!0})),!o.elements["checkall-toggle"])return;let r=!0,a,n,l;for(a=0,l=o.elements.length;a<l;a++)if(n=o.elements[a],n.type==="checkbox"&&n.name!=="checkall-toggle"&&!n.checked){r=!1;break}o.elements["checkall-toggle"].checked=r},Joomla.tableOrdering=(t,e,o,r)=>{let a=r;typeof a>"u"?a=document.getElementById("adminForm"):typeof r=="string"&&(a=document.getElementById(r)),a.filter_order.value=t,a.filter_order_Dir.value=e,Joomla.submitform(o,a)},Joomla.listItemTask=(t,e,o=null)=>{let r=o;o!==null?r=document.getElementById(o):r=document.adminForm;const a=r[t];let n=0,l;if(!a)return!1;for(;l=r[`cb${n}`],!!l;)l.checked=!1,n+=1;return a.checked=!0,r.boxchecked.value=1,Joomla.submitform(e,r),!1},Joomla.replaceTokens=t=>{/^[0-9A-F]{32}$/i.test(t)&&document.querySelectorAll('input[type="hidden"]').forEach(e
4=>{e.value==="1"&&e.name.length===32&&(e.name=t)})},Joomla.request=t=>{const e=Joomla.extend({url:"",method:"GET",data:null,perform:!0,promise:!1},t),o=(r,a)=>{const n=new XMLHttpRequest;if(n.open(e.method,e.url,!0),n.setRequestHeader("X-Requested-With","XMLHttpRequest"),n.setRequestHeader("X-Ajax-Engine","Joomla!"),e.method!=="GET"){const l=Joomla.getOptions("csrf.token","");l&&(!e.url.startsWith("http:")&&!e.url.startsWith("https:")||e.url.startsWith(window.location.origin))&&n.setRequestHeader("X-CSRF-Token",l),typeof e.data=="string"&&(!e.headers||!e.headers["Content-Type"])&&n.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}if(e.headers&&Object.keys(e.headers).forEach(l=>{l==="Content-Type"&&e.headers["Content-Type"]==="false"||n.setRequestHeader(l,e.headers[l])}),n.onreadystatechange=()=>{n.readyState===4&&(n.status===200?e.promise?r.call(window,n):r.call(window,n.responseText,n):a.call(window,n),e.onComplete&&!e.promise&&e.onComplete.call(window,n))},e.perform){if(e.onBefore&&e.onBefore.call(window,n)===!1)return e.promise&&r.call(window,n),n;n.send(e.data)}return n};if(e.promise)return new Promise((r,a)=>{e.perform=!0,o(r,a)});try{return o(e.onSuccess||(()=>{}),e.onError||(()=>{}))}catch(r){return console.error(r),!1}};let s;Joomla.enqueueRequest=t=>{if(!t.promise)throw new Error("Joomla.enqueueRequest supports only Joomla.request as Promise");return s?s=s.then(()=>Joomla.request(t)):s=Joomla.request(t),s},Joomla.sanitizeHtml=(t,e,o)=>{const r=e==null?c:i({},c,e);return J(t,r,o)},Joomla.ajaxErrorsMessages=(t,e)=>{const o={};if(e==="parsererror"){const r=[];let a=t.responseText.trim();for(let n=a.length-1;n>=0;n--)r.unshift(["&#",a[n].charCodeAt(),";"].join(""));a=r.join(""),o.error=[Joomla.Text._("JLIB_JS_AJAX_ERROR_PARSE").replace("%s",a)]}else e==="nocontent"?o.error=[Joomla.Text._("JLIB_JS_AJAX_ERROR_NO_CONTENT")]:e==="timeout"?o.error=[Joomla.Text._("JLIB_JS_AJAX_ERROR_TIMEOUT")]:e==="abort"?o.error=[Joomla.Text._("JLIB_JS_AJAX_ERROR_CONNECTION_ABORT")]:t.responseJSON&&t.responseJSON.message?o.error=[`${Joomla.Text._("JLIB_JS_AJAX_ERROR_OTHER").replace("%s",t.status)} <em>${t.responseJSON.message}</em>`]:t.statusText?o.error=[`${Joomla.Text._("JLIB_JS_AJAX_ERROR_OTHER").replace("%s",t.status)} <em>${t.statusText}</em>`]:o.error=[Joomla.Text._("JLIB_JS_AJAX_ERROR_OTHER").replace("%s",t.status)];return o}})(); 5 6/** 7* @copyright (C) 2019 Open Source Matters, Inc. <https://www.joomla.org> 8* @license GNU General Public License version 2 or later; see LICENSE.txt 9*/(()=>{function f(n,s){const e=n.querySelector("ul");e&&(e.setAttribute("aria-hidden","false"),e.classList.add(s.menuHoverClass))}function h(n,s){const e=n.querySelector("ul");e&&(e.setAttribute("aria-hidden","true"),e.classList.remove(s.menuHoverClass))}function m(n){const s={menuHoverClass:"show-menu"};n.querySelectorAll(":scope > li").forEach(e=>{const o=e.querySelector("a");o&&(o.tabIndex="0",o.addEventListener("mouseover",f(e,s)),o.addEventListener("mouseout",h(e,s)));const l=e.querySelector("span");l&&(l.parentNode.nodeName!=="A"&&(l.tabIndex="0"),l.addEventListener("mouseover",f(e,s)),l.addEventListener("mouseout",h(e,s))),e.addEventListener("mouseover",({currentTarget:r})=>{const t=r.querySelector("ul");t&&(t.setAttribute("aria-hidden","false"),t.classList.add(s.menuHoverClass))}),e.addEventListener("mouseout",({currentTarget:r})=>{const t=r.querySelector("ul");t&&(t.setAttribute("aria-hidden","true"),t.classList.remove(s.menuHoverClass))}),e.addEventListener("focus",({currentTarget:r})=>{const t=r.querySelector("ul");t&&(t.setAttribute("aria-hidden","true"),t.classList.add(s.menuHoverClass))}),e.addEventListener("blur",({currentTarget:r})=>{const t=r.querySelector("ul");t&&(t.setAttribute("aria-hidden","false"),t.classList.remove(s.menuHoverClass))}),e.addEventListener("keydown",r=>{const t=r.key,i=r.target.parentElement,d=i.parentElement;let c=i.previousElementSibling,u=i.nextElementSibling;switch(c||(c=d.children[d.children.length-1]),u||([u]=d.children),t){case"ArrowLeft":r.preventDefault(),c.children[0].focus();break;case"ArrowRight":r.preventDefault(),u.children[0].focus();break;case"ArrowUp":{r.preventDefault();const a=i.parentElement.parentElement;a.nodeName==="LI"?a.children[0].focus():c.children[0].focus();break}case"ArrowDown":if(r.preventDefault(),i.classList.contains("parent")){const a=i.querySelector("ul");a!=null?a.querySelector("li").children[0].focus():u.children[0].focus()}else u.children[0].focus();break}})})}document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll(".nav").forEach(n=>m(n))})})(); 10
vendor: 22,881 bytes, lines 11-12
11/*! jQuery v3.7.1 | (c) OpenJS Foundation and other contributors | jquery.org/license */ 12!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(ie,e){"use strict";var oe=[],r=Object.getPrototypeOf,ae=oe.slice,g=oe.flat?function(e){return oe.flat.call(e)}:function(e){return oe.concat.apply([],e)},s=oe.push,se=oe.indexOf,n={},i=n.toString,ue=n.hasOwnProperty,o=ue.toString,a=o.call(Object),le={},v=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},y=function(e){return null!=e&&e===e.window},C=ie.document,u={type:!0,src:!0,nonce:!0,noModule:!0};function m(e,t,n){var r,i,o=(n=n||C).createElement("script");if(o.text=e,t)for(r in u)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[i.call(e)]||"object":typeof e}var t="3.7.1",l=/HTML$/i,ce=function(e,t){return new ce.fn.init(e,t)};function c(e){var t=!!e&&"length"in e&&e.length,n=x(e);return!v(e)&&!y(e)&&("array"===n||0===t||"number"==typeof t&&0<t&&t-1 in e)}function fe(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}ce.fn=ce.prototype={jquery:t,constructor:ce,length:0,toArray:function(){return ae.call(this)},get:function(e){return null==e?ae.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=ce.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return ce.each(this,e)},map:function(n){return this.pushStack(ce.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(ae.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(ce.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(ce.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:s,sort:oe.sort,splice:oe.splice},ce.extend=ce.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||v(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(l&&r&&(ce.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||ce.isPlainObject(n)?n:{},i=!1,a[t]=ce.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},ce.extend({expando:"jQuery"+(t+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==i.call(e))&&(!(t=r(e))||"function"==typeof(n=ue.call(t,"constructor")&&t.constructor)&&o.call(n)===a)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){m(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(c(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},text:function(e){var t,n="",r=0,i=e.nodeType;if(!i)while(t=e[r++])n+=ce.text(t);return 1===i||11===i?e.textContent:9===i?e.documentElement.textContent:3===i||4===i?e.nodeValue:n},makeArray:function(e,t){var n=t||[];return null!=e&&(c(Object(e))?ce.merge(n,"string"==typeof e?[e]:e):s.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:se.call(t,e,n)},isXMLDoc:function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!l.test(t||n&&n.nodeName||"HTML")},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(c(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return g(a)},guid:1,support:le}),"function"==typeof Symbol&&(ce.fn[Symbol.iterator]=oe[Symbol.iterator]),ce.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){n["[object "+t+"]"]=t.toLowerCase()});var pe=oe.pop,de=oe.sort,he=oe.splice,ge="[\\x20\\t\\r\\n\\f]",ve=new RegExp("^"+ge+"+|((?:^|[^\\\\])(?:\\\\.)*)"+ge+"+$","g");ce.contains=function(e,t){var n=t&&t.parentNode;return e===n||!(!n||1!==n.nodeType||!(e.contains?e.contains(n):e.compareDocumentPosition&&16&e.compareDocumentPosition(n)))};var f=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;function p(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e}ce.escapeSelector=function(e){return(e+"").replace(f,p)};var ye=C,me=s;!function(){var e,b,w,o,a,T,r,C,d,i,k=me,S=ce.expando,E=0,n=0,s=W(),c=W(),u=W(),h=W(),l=function(e,t){return e===t&&(a=!0),0},f="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",t="(?:\\\\[\\da-fA-F]{1,6}"+ge+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",p="\\["+ge+"*("+t+")(?:"+ge+"*([*^$|!~]?=)"+ge+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+t+"))|)"+ge+"*\\]",g=":("+t+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+p+")*)|.*)\\)|)",v=new RegExp(ge+"+","g"),y=new RegExp("^"+ge+"*,"+ge+"*"),m=new RegExp("^"+ge+"*([>+~]|"+ge+")"+ge+"*"),x=new RegExp(ge+"|>"),j=new RegExp(g),A=new RegExp("^"+t+"$"),D={ID:new RegExp("^#("+t+")"),CLASS:new RegExp("^\\.("+t+")"),TAG:new RegExp("^("+t+"|[*])"),ATTR:new RegExp("^"+p),PSEUDO:new RegExp("^"+g),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ge+"*(even|odd|(([+-]|)(\\d*)n|)"+ge+"*(?:([+-]|)"+ge+"*(\\d+)|))"+ge+"*\\)|)","i"),bool:new RegExp("^(?:"+f+")$","i"),needsContext:new RegExp("^"+ge+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ge+"*((?:-\\d)?\\d*)"+ge+"*\\)|)(?=[^-]|$)","i")},N=/^(?:input|select|textarea|button)$/i,q=/^h\d$/i,L=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,H=/[+~]/,O=new RegExp("\\\\[\\da-fA-F]{1,6}"+ge+"?|\\\\([^\\r\\n\\f])","g"),P=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},M=function(){V()},R=J(function(e){return!0===e.disabled&&fe(e,"fieldset")},{dir:"parentNode",next:"legend"});try{k.apply(oe=ae.call(ye.childNodes),ye.childNodes),oe[ye.childNodes.length].nodeType}catch(e){k={apply:function(e,t){me.apply(e,ae.call(t))},call:function(e){me.apply(e,ae.call(arguments,1))}}}function I(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(V(e),e=e||T,C)){if(11!==p&&(u=L.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return k.call(n,a),n}else if(f&&(a=f.getElementById(i))&&I.contains(e,a)&&a.id===i)return k.call(n,a),n}else{if(u[2])return k.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&e.getElementsByClassName)return k.apply(n,e.getElementsByClassName(i)),n}if(!(h[t+" "]||d&&d.test(t))){if(c=t,f=e,1===p&&(x.test(t)||m.test(t))){(f=H.test(t)&&U(e.parentNode)||e)==e&&le.scope||((s=e.getAttribute("id"))?s=ce.escapeSelector(s):e.setAttribute("id",s=S)),o=(l=Y(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+Q(l[o]);c=l.join(",")}try{return k.apply(n,f.querySelectorAll(c)),n}catch(e){h(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return re(t.replace(ve,"$1"),e,n,r)}function W(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function F(e){return e[S]=!0,e}function $(e){var t=T.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function B(t){return function(e){return fe(e,"input")&&e.type===t}}function _(t){return function(e){return(fe(e,"input")||fe(e,"button"))&&e.type===t}}function z(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&R(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function X(a){return F(function(o){return o=+o,F(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function U(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function V(e){var t,n=e?e.ownerDocument||e:ye;return n!=T&&9===n.nodeType&&n.documentElement&&(r=(T=n).documentElement,C=!ce.isXMLDoc(T),i=r.matches||r.webkitMatchesSelector||r.msMatchesSelector,r.msMatchesSelector&&ye!=T&&(t=T.defaultView)&&t.top!==t&&t.addEventListener("unload",M),le.getById=$(function(e){return r.appendChild(e).id=ce.expando,!T.getElementsByName||!T.getElementsByName(ce.expando).length}),le.disconnectedMatch=$(function(e){return i.call(e,"*")}),le.scope=$(function(){return T.querySelectorAll(":scope")}),le.cssHas=$(function(){try{return T.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}}),le.getById?(b.filter.ID=function(e){var t=e.replace(O,P);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&C){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(O,P);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&C){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):t.querySelectorAll(e)},b.find.CLASS=function(e,t){if("undefined"!=typeof t.getElementsByClassName&&C)return t.getElementsByClassName(e)},d=[],$(function(e){var t;r.appendChild(e).innerHTML="<a id='"+S+"' href='' disabled='disabled'></a><select id='"+S+"-\r\\' disabled='disabled'><option selected=''></option></select>",e.querySelectorAll("[selected]").length||d.push("\\["+ge+"*(?:value|"+f+")"),e.querySelectorAll("[id~="+S+"-]").length||d.push("~="),e.querySelectorAll("a#"+S+"+*").length||d.push(".#.+[+~]"),e.querySelectorAll(":checked").length||d.push(":checked"),(t=T.createElement("input")).setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),r.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&d.push(":enabled",":disabled"),(t=T.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||d.push("\\["+ge+"*name"+ge+"*="+ge+"*(?:''|\"\")")}),le.cssHas||d.push(":has"),d=d.length&&new RegExp(d.join("|")),l=function(e,t){if(e===t)return a=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!le.sortDetached&&t.compareDocumentPosition(e)===n?e===T||e.ownerDocument==ye&&I.contains(ye,e)?-1:t===T||t.ownerDocument==ye&&I.contains(ye,t)?1:o?se.call(o,e)-se.call(o,t):0:4&n?-1:1)}),T}for(e in I.matches=function(e,t){return I(e,null,null,t)},I.matchesSelector=function(e,t){if(V(e),C&&!h[t+" "]&&(!d||!d.test(t)))try{var n=i.call(e,t);if(n||le.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){h(t,!0)}return 0<I(t,T,null,[e]).length},I.contains=function(e,t){return(e.ownerDocument||e)!=T&&V(e),ce.contains(e,t)},I.attr=function(e,t){(e.ownerDocument||e)!=T&&V(e);var n=b.attrHandle[t.toLowerCase()],r=n&&ue.call(b.attrHandle,t.toLowerCase())?n(e,t,!C):void 0;return void 0!==r?r:e.getAttribute(t)},I.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},ce.uniqueSort=function(e){var t,n=[],r=0,i=0;if(a=!le.sortStable,o=!le.sortStable&&ae.call(e,0),de.call(e,l),a){while(t=e[i++])t===e[i]&&(r=n.push(i));while(r--)he.call(e,n[r],1)}return o=null,e},ce.fn.uniqueSort=function(){return this.pushStack(ce.uniqueSort(ae.apply(this)))},(b=ce.expr={cacheLength:50,createPseudo:F,match:D,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(O,P),e[3]=(e[3]||e[4]||e[5]||"").replace(O,P),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||I.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&I.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return D.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&j.test(n)&&(t=Y(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(O,P).toLowerCase();return"*"===e?function(){return!0}:function(e){return fe(e,t)}},CLASS:function(e){var t=s[e+" "];return t||(t=new RegExp("(^|"+ge+")"+e+"("+ge+"|$)"))&&s(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=I.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1<t.indexOf(i):"$="===r?i&&t.slice(-i.length)===i:"~="===r?-1<(" "+t.replace(v," ")+" ").indexOf(i):"|="===r&&(t===i||t.slice(0,i.length+1)===i+"-"))}},CHILD:function(d,e,t,h,g){var v="nth"!==d.slice(0,3),y="last"!==d.slice(-4),m="of-type"===e;return 1===h&&0===g?function(e){return!!e.parentNode}:function(e,t,n){var r,i,o,a,s,u=v!==y?"nextSibling":"previousSibling",l=e.parentNode,c=m&&e.nodeName.toLowerCase(),f=!n&&!m,p=!1;if(l){if(v){while(u){o=e;while(o=o[u])if(m?fe(o,c):1===o.nodeType)return!1;s=u="only"===d&&!s&&"nextSibling"}return!0}if(s=[y?l.firstChild:l.lastChild],y&&f){p=(a=(r=(i=l[S]||(l[S]={}))[d]||[])[0]===E&&r[1])&&r[2],o=a&&l.childNodes[a];while(o=++a&&o&&o[u]||(p=a=0)||s.pop())if(1===o.nodeType&&++p&&o===e){i[d]=[E,a,p];break}}else if(f&&(p=a=(r=(i=e[S]||(e[S]={}))[d]||[])[0]===E&&r[1]),!1===p)while(o=++a&&o&&o[u]||(p=a=0)||s.pop())if((m?fe(o,c):1===o.nodeType)&&++p&&(f&&((i=o[S]||(o[S]={}))[d]=[E,p]),o===e))break;return(p-=g)===h||p%h==0&&0<=p/h}}},PSEUDO:function(e,o){var t,a=b.pseudos[e]||b.setFilters[e.toLowerCase()]||I.error("unsupported pseudo: "+e);return a[S]?a(o):1<a.length?(t=[e,e,"",o],b.setFilters.hasOwnProperty(e.toLowerCase())?F(function(e,t){var n,r=a(e,o),i=r.length;while(i--)e[n=se.call(e,r[i])]=!(t[n]=r[i])}):function(e){return a(e,0,t)}):a}},pseudos:{not:F(function(e){var r=[],i=[],s=ne(e.replace(ve,"$1"));return s[S]?F(function(e,t,n,r){var i,o=s(e,null,r,[]),a=e.length;while(a--)(i=o[a])&&(e[a]=!(t[a]=i))}):function(e,t,n){return r[0]=e,s(r,null,n,i),r[0]=null,!i.pop()}}),has:F(function(t){return function(e){return 0<I(t,e).length}}),contains:F(function(t){return t=t.replace(O,P),function(e){return-1<(e.textContent||ce.text(e)).indexOf(t)}}),lang:F(function(n){return A.test(n||"")||I.error("unsupported lang: "+n),n=n.replace(O,P).toLowerCase(),function(e){var t;do{if(t=C?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(t=t.toLowerCase())===n||0===t.indexOf(n+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=ie.location&&ie.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===r},focus:function(e){return e===function(){try{return T.activeElement}catch(e){}}()&&T.hasFocus()&&!!(e.type||e.href||~e.tabIndex)},enabled:z(!1),disabled:z(!0),checked:function(e){return fe(e,"input")&&!!e.checked||fe(e,"option")&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!b.pseudos.empty(e)},header:function(e){return q.test(e.nodeName)},input:function(e){return N.test(e.nodeName)},button:function(e){return fe(e,"input")&&"button"===e.type||fe(e,"button")},text:function(e){var t;return fe(e,"input")&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:X(function(){return[0]}),last:X(function(e,t){return[t-1]}),eq:X(function(e,t,n){return[n<0?n+t:n]}),even:X(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:X(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:X(function(e,t,n){var r;for(r=n<0?n+t:t<n?t:n;0<=--r;)e.push(r);return e}),gt:X(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=b.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})b.pseudos[e]=B(e);for(e in{submit:!0,reset:!0})b.pseudos[e]=_(e);function G(){}function Y(e,t){var n,r,i,o,a,s,u,l=c[e+" "];if(l)return t?0:l.slice(0);a=e,s=[],u=b.preFilter;while(a){for(o in n&&!(r=y.exec(a))||(r&&(a=a.slice(r[0].length)||a),s.push(i=[])),n=!1,(r=m.exec(a))&&(n=r.shift(),i.push({value:n,type:r[0].replace(ve," ")}),a=a.slice(n.length)),b.filter)!(r=D[o].exec(a))||u[o]&&!(r=u[o](r))||(n=r.shift(),i.push({value:n,type:o,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?I.error(e):c(e,s).slice(0)}function Q(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function J(a,e,t){var s=e.dir,u=e.next,l=u||s,c=t&&"parentNode"===l,f=n++;return e.first?function(e,t,n){while(e=e[s])if(1===e.nodeType||c)return a(e,t,n);return!1}:function(e,t,n){var r,i,o=[E,f];if(n){while(e=e[s])if((1===e.nodeType||c)&&a(e,t,n))return!0}else while(e=e[s])if(1===e.nodeType||c)if(i=e[S]||(e[S]={}),u&&fe(e,u))e=e[s]||e;else{if((r=i[l])&&r[0]===E&&r[1]===f)return o[2]=r[2];if((i[l]=o)[2]=a(e,t,n))return!0}return!1}}function K(i){return 1<i.length?function(e,t,n){var r=i.length;while(r--)if(!i[r](e,t,n))return!1;return!0}:i[0]}function Z(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),l&&t.push(s)));return a}function ee(d,h,g,v,y,e){return v&&!v[S]&&(v=ee(v)),y&&!y[S]&&(y=ee(y,e)),F(function(e,t,n,r){var i,o,a,s,u=[],l=[],c=t.length,f=e||function(e,t,n){for(var r=0,i=t.length;r<i;r++)I(e,t[r],n);return n}(h||"*",n.nodeType?[n]:n,[]),p=!d||!e&&h?f:Z(f,u,d,n,r);if(g?g(p,s=y||(e?d:c||v)?[]:t,n,r):s=p,v){i=Z(s,l),v(i,[],n,r),o=i.length;while(o--)(a=i[o])&&(s[l[o]]=!(p[l[o]]=a))}if(e){if(y||d){if(y){i=[],o=s.length;while(o--)(a=s[o])&&i.push(p[o]=a);y(null,s=[],i,r)}o=s.length;while(o--)(a=s[o])&&-1<(i=y?se.call(e,a):u[o])&&(e[i]=!(t[i]=a))}}else s=Z(s===t?s.splice(c,s.length):s),y?y(null,t,s,r):k.apply(t,s)})}function te(e){for(var i,t,n,r=e.length,o=b.relative[e[0].type],a=o||b.relative[" "],s=o?1:0,u=J(function(e){return e===i},a,!0),l=J(function(e){return-1<se.call(i,e)},a,!0),c=[function(e,t,n){var r=!o&&(n||t!=w)||((i=t).nodeType?u(e,t,n):l(e,t,n));return i=null,r}];s<r;s++)if(t=b.relative[e[s].type])c=[J(K(c),t)];else{if((t=b.filter[e[s].type].apply(null,e[s].matches))[S]){for(n=++s;n<r;n++)if(b.relative[e[n].type])break;return ee(1<s&&K(c),1<s&&Q(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(ve,"$1"),t,s<n&&te(e.slice(s,n)),n<r&&te(e=e.slice(n)),n<r&&Q(e))}c.push(t)}return K(c)}function ne(e,t){var n,v,y,m,x,r,i=[],o=[],a=u[e+" "];if(!a){t||(t=Y(e)),n=t.length;while(n--)(a=te(t[n]))[S]?i.push(a):o.push(a);(a=u(e,(v=o,m=0<(y=i).length,x=0<v.length,r=function(e,t,n,r,i){var o,a,s,u=0,l="0",c=e&&[],f=[],p=w,d=e||x&&b.find.TAG("*",i),h=E+=null==p?1:Math.random()||.1,g=d.length;for(i&&(w=t==T||t||i);l!==g&&null!=(o=d[l]);l++){if(x&&o){a=0,t||o.ownerDocument==T||(V(o),n=!C);while(s=v[a++])if(s(o,t||T,n)){k.call(r,o);break}i&&(E=h)}m&&((o=!s&&o)&&u--,e&&c.push(o))}if(u+=l,m&&l!==u){a=0;while(s=y[a++])s(c,f,t,n);if(e){if(0<u)while(l--)c[l]||f[l]||(f[l]=pe.call(r));f=Z(f)}k.apply(r,f),i&&!e&&0<f.length&&1<u+y.length&&ce.uniqueSort(r)}return i&&(E=h,w=p),c},m?F(r):r))).selector=e}return a}function re(e,t,n,r){var i,o,a,s,u,l="function"==typeof e&&e,c=!r&&Y(e=l.selector||e);if(n=n||[],1===c.length){if(2<(o=c[0]=c[0].slice(0)).length&&"ID"===(a=o[0]).type&&9===t.nodeType&&C&&b.relative[o[1].type]){if(!(t=(b.find.ID(a.matches[0].replace(O,P),t)||[])[0]))return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}i=D.needsContext.test(e)?0:o.length;while(i--){if(a=o[i],b.relative[s=a.type])break;if((u=b.find[s])&&(r=u(a.matches[0].replace(O,P),H.test(o[0].type)&&U(t.parentNode)||t))){if(o.splice(i,1),!(e=r.length&&Q(o)))return k.apply(n,r),n;break}}}return(l||ne(e,c))(r,t,!C,n,!t||H.test(e)&&U(t.parentNode)||t),n}G.prototype=b.filters=b.pseudos,b.setFilters=new G,le.sortStable=S.split("").sort(l).join("")===S,V(),le.sortDetached=$(function(e){return 1&e.compareDocumentPosition(T.createElement("fieldset"))}),ce.find=I,ce.expr[":"]=ce.expr.pseudos,ce.unique=ce.uniqueSort,I.compile=ne,I.select=re,I.setDocument=V,I.tokenize=Y,I.escape=ce.escapeSelector,I.getText=ce.text,I.isXML=ce.isXMLDoc,I.selectors=ce.expr,I.support=ce.support,I.uniqueSort=ce.uniqueSort}();var d=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&ce(e).is(n))break;r.push(e)}return r},h=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},b=ce.expr.match.needsContext,w=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function T(e,n,r){return v(n)?ce.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?ce.grep(e,function(e){return e===n!==r}):"string"!=typeof n?ce.grep(e,function(e){return-1<se.call(n,e)!==r}):ce.filter(n,e,r)}ce.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?ce.find.matchesSelector(r,e)?[r]:[]:ce.find.matches(e,ce.grep(t,function(e){return 1===e.nodeType}))},ce.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(ce(e).filter(function(){for(t=0;t<r;t++)if(ce.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)ce.find(e,i[t],n);return 1<r?ce.uniqueSort(n):n},filter:function(e){return this.pushStack(T(this,e||[],!1))},not:function(e){return this.pushStack(T(this,e||[],!0))},is:function(e){return!!T(this,"string"==typeof e&&b.test(e)?ce(e):e||[],!1).length}});var k,S=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(ce.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||k,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:S.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof ce?t[0]:t,ce.merge(this,ce.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:C,!0)),w.test(r[1])&&ce.isPlainObject(t))for(r in t)v(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=C.getElementById(r[2]))&&(this[0]=i,this.length=1),this}
vendor: 1,967 bytes, line 12
12return e.nodeType?(this[0]=e,this.length=1,this):v(e)?void 0!==n.ready?n.ready(e):e(ce):ce.makeArray(e,this)}).prototype=ce.fn,k=ce(C);var E=/^(?:parents|prev(?:Until|All))/,j={children:!0,contents:!0,next:!0,prev:!0};function A(e,t){while((e=e[t])&&1!==e.nodeType);return e}ce.fn.extend({has:function(e){var t=ce(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(ce.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&ce(e);if(!b.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?-1<a.index(n):1===n.nodeType&&ce.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(1<o.length?ce.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?se.call(ce(e),this[0]):se.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(ce.uniqueSort(ce.merge(this.get(),ce(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),ce.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return d(e,"parentNode")},parentsUntil:function(e,t,n){return d(e,"parentNode",n)},next:function(e){return A(e,"nextSibling")},prev:function(e){return A(e,"previousSibling")},nextAll:function(e){return d(e,"nextSibling")},prevAll:function(e){return d(e,"previousSibling")},nextUntil:function(e,t,n){return d(e,"nextSibling",n)},prevUntil:function(e,t,n){return d(e,"previousSibling",n)},siblings:function(e){return h((e.parentNode||{}).firstChild,e)},children:function(e){return h(e.firstChild)},contents:function(e){return null!=e.contentDocument&&r(e.contentDocument)?e.contentDocument:(fe(e,"template")&&(e=e.content||e),ce.merge([],e.childNodes))}},function(r,i){ce.fn[r]=function(e,t){var n=ce.map(this,i,e);return"Until"!==r.slice(-5)&&(t=e),t&&"string"==typeof t&&(n=ce.filter(t,n)),1<this.length&&(j[r]||
vendor: 9,546 bytes, line 12
12ce.uniqueSort(n),E.test(r)&&n.reverse()),this.pushStack(n)}});var D=/[^\x20\t\r\n\f]+/g;function N(e){return e}function q(e){throw e}function L(e,t,n,r){var i;try{e&&v(i=e.promise)?i.call(e).done(t).fail(n):e&&v(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}ce.Callbacks=function(r){var e,n;r="string"==typeof r?(e=r,n={},ce.each(e.match(D)||[],function(e,t){n[t]=!0}),n):ce.extend({},r);var i,t,o,a,s=[],u=[],l=-1,c=function(){for(a=a||r.once,o=i=!0;u.length;l=-1){t=u.shift();while(++l<s.length)!1===s[l].apply(t[0],t[1])&&r.stopOnFalse&&(l=s.length,t=!1)}r.memory||(t=!1),i=!1,a&&(s=t?[]:"")},f={add:function(){return s&&(t&&!i&&(l=s.length-1,u.push(t)),function n(e){ce.each(e,function(e,t){v(t)?r.unique&&f.has(t)||s.push(t):t&&t.length&&"string"!==x(t)&&n(t)})}(arguments),t&&!i&&c()),this},remove:function(){return ce.each(arguments,function(e,t){var n;while(-1<(n=ce.inArray(t,s,n)))s.splice(n,1),n<=l&&l--}),this},has:function(e){return e?-1<ce.inArray(e,s):0<s.length},empty:function(){return s&&(s=[]),this},disable:function(){return a=u=[],s=t="",this},disabled:function(){return!s},lock:function(){return a=u=[],t||i||(s=t=""),this},locked:function(){return!!a},fireWith:function(e,t){return a||(t=[e,(t=t||[]).slice?t.slice():t],u.push(t),i||c()),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!o}};return f},ce.extend({Deferred:function(e){var o=[["notify","progress",ce.Callbacks("memory"),ce.Callbacks("memory"),2],["resolve","done",ce.Callbacks("once memory"),ce.Callbacks("once memory"),0,"resolved"],["reject","fail",ce.Callbacks("once memory"),ce.Callbacks("once memory"),1,"rejected"]],i="pending",a={state:function(){return i},always:function(){return s.done(arguments).fail(arguments),this},"catch":function(e){return a.then(null,e)},pipe:function(){var i=arguments;return ce.Deferred(function(r){ce.each(o,function(e,t){var n=v(i[t[4]])&&i[t[4]];s[t[1]](function(){var e=n&&n.apply(this,arguments);e&&v(e.promise)?e.promise().progress(r.notify).done(r.resolve).fail(r.reject):r[t[0]+"With"](this,n?[e]:arguments)})}),i=null}).promise()},then:function(t,n,r){var u=0;function l(i,o,a,s){return function(){var n=this,r=arguments,e=function(){var e,t;if(!(i<u)){if((e=a.apply(n,r))===o.promise())throw new TypeError("Thenable self-resolution");t=e&&("object"==typeof e||"function"==typeof e)&&e.then,v(t)?s?t.call(e,l(u,o,N,s),l(u,o,q,s)):(u++,t.call(e,l(u,o,N,s),l(u,o,q,s),l(u,o,N,o.notifyWith))):(a!==N&&(n=void 0,r=[e]),(s||o.resolveWith)(n,r))}},t=s?e:function(){try{e()}catch(e){ce.Deferred.exceptionHook&&ce.Deferred.exceptionHook(e,t.error),u<=i+1&&(a!==q&&(n=void 0,r=[e]),o.rejectWith(n,r))}};i?t():(ce.Deferred.getErrorHook?t.error=ce.Deferred.getErrorHook():ce.Deferred.getStackHook&&(t.error=ce.Deferred.getStackHook()),ie.setTimeout(t))}}return ce.Deferred(function(e){o[0][3].add(l(0,e,v(r)?r:N,e.notifyWith)),o[1][3].add(l(0,e,v(t)?t:N)),o[2][3].add(l(0,e,v(n)?n:q))}).promise()},promise:function(e){return null!=e?ce.extend(e,a):a}},s={};return ce.each(o,function(e,t){var n=t[2],r=t[5];a[t[1]]=n.add,r&&n.add(function(){i=r},o[3-e][2].disable,o[3-e][3].disable,o[0][2].lock,o[0][3].lock),n.add(t[3].fire),s[t[0]]=function(){return s[t[0]+"With"](this===s?void 0:this,arguments),this},s[t[0]+"With"]=n.fireWith}),a.promise(s),e&&e.call(s,s),s},when:function(e){var n=arguments.length,t=n,r=Array(t),i=ae.call(arguments),o=ce.Deferred(),a=function(t){return function(e){r[t]=this,i[t]=1<arguments.length?ae.call(arguments):e,--n||o.resolveWith(r,i)}};if(n<=1&&(L(e,o.done(a(t)).resolve,o.reject,!n),"pending"===o.state()||v(i[t]&&i[t].then)))return o.then();while(t--)L(i[t],a(t),o.reject);return o.promise()}});var H=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;ce.Deferred.exceptionHook=function(e,t){ie.console&&ie.console.warn&&e&&H.test(e.name)&&ie.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},ce.readyException=function(e){ie.setTimeout(function(){throw e})};var O=ce.Deferred();function P(){C.removeEventListener("DOMContentLoaded",P),ie.removeEventListener("load",P),ce.ready()}ce.fn.ready=function(e){return O.then(e)["catch"](function(e){ce.readyException(e)}),this},ce.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--ce.readyWait:ce.isReady)||(ce.isReady=!0)!==e&&0<--ce.readyWait||O.resolveWith(C,[ce])}}),ce.ready.then=O.then,"complete"===C.readyState||"loading"!==C.readyState&&!C.documentElement.doScroll?ie.setTimeout(ce.ready):(C.addEventListener("DOMContentLoaded",P),ie.addEventListener("load",P));var M=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===x(n))for(s in i=!0,n)M(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,v(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(ce(e),n)})),t))for(;s<u;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):u?t(e[0],n):o},R=/^-ms-/,I=/-([a-z])/g;function W(e,t){return t.toUpperCase()}function F(e){return e.replace(R,"ms-").replace(I,W)}var $=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function B(){this.expando=ce.expando+B.uid++}B.uid=1,B.prototype={cache:function(e){var t=e[this.expando];return t||(t={},$(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[F(t)]=n;else for(r in t)i[F(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][F(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(F):(t=F(t))in r?[t]:t.match(D)||[]).length;while(n--)delete r[t[n]]}(void 0===t||ce.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!ce.isEmptyObject(t)}};var _=new B,z=new B,X=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,U=/[A-Z]/g;function V(e,t,n){var r,i;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(U,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n="true"===(i=n)||"false"!==i&&("null"===i?null:i===+i+""?+i:X.test(i)?JSON.parse(i):i)}catch(e){}z.set(e,t,n)}else n=void 0;return n}ce.extend({hasData:function(e){return z.hasData(e)||_.hasData(e)},data:function(e,t,n){return z.access(e,t,n)},removeData:function(e,t){z.remove(e,t)},_data:function(e,t,n){return _.access(e,t,n)},_removeData:function(e,t){_.remove(e,t)}}),ce.fn.extend({data:function(n,e){var t,r,i,o=this[0],a=o&&o.attributes;if(void 0===n){if(this.length&&(i=z.get(o),1===o.nodeType&&!_.get(o,"hasDataAttrs"))){t=a.length;while(t--)a[t]&&0===(r=a[t].name).indexOf("data-")&&(r=F(r.slice(5)),V(o,r,i[r]));_.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof n?this.each(function(){z.set(this,n)}):M(this,function(e){var t;if(o&&void 0===e)return void 0!==(t=z.get(o,n))?t:void 0!==(t=V(o,n))?t:void 0;this.each(function(){z.set(this,n,e)})},null,e,1<arguments.length,null,!0)},removeData:function(e){return this.each(function(){z.remove(this,e)})}}),ce.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=_.get(e,t),n&&(!r||Array.isArray(n)?r=_.access(e,t,ce.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=ce.queue(e,t),r=n.length,i=n.shift(),o=ce._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){ce.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return _.get(e,n)||_.access(e,n,{empty:ce.Callbacks("once memory").add(function(){_.remove(e,[t+"queue",n])})})}}),ce.fn.extend({queue:function(t,n){var e=2;return"string"!=typeof t&&(n=t,t="fx",e--),arguments.length<e?ce.queue(this[0],t):void 0===n?this:this.each(function(){var e=ce.queue(this,t,n);ce._queueHooks(this,t),"fx"===t&&"inprogress"!==e[0]&&ce.dequeue(this,t)})},dequeue:function(e){return this.each(function(){ce.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=ce.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};"string"!=typeof e&&(t=e,e=void 0),e=e||"fx";while(a--)(n=_.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var G=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,Y=new RegExp("^(?:([+-])=|)("+G+")([a-z%]*)$","i"),Q=["Top","Right","Bottom","Left"],J=C.documentElement,K=function(e){return ce.contains(e.ownerDocument,e)},Z={composed:!0};J.getRootNode&&(K=function(e){return ce.contains(e.ownerDocument,e)||e.getRootNode(Z)===e.ownerDocument});var ee=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&K(e)&&"none"===ce.css(e,"display")};function te(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return ce.css(e,t,"")},u=s(),l=n&&n[3]||(ce.cssNumber[t]?"":"px"),c=e.nodeType&&(ce.cssNumber[t]||"px"!==l&&+u)&&Y.exec(ce.css(e,t));if(c&&c[3]!==l){u/=2,l=l||c[3],c=+u||1;while(a--)ce.style(e,t,c+l),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),c/=o;c*=2,ce.style(e,t,c+l),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}var ne={};function re(e,t){for(var n,r,i,o,a,s,u,l=[],c=0,f=e.length;c<f;c++)(r=e[c]).style&&(n=r.style.display,t?("none"===n&&(l[c]=_.get(r,"display")||null,l[c]||(r.style.display="")),""===r.style.display&&ee(r)&&(l[c]=(u=a=o=void 0,a=(i=r).ownerDocument,s=i.nodeName,(u=ne[s])||
vendor: 8,814 bytes, line 12
12(o=a.body.appendChild(a.createElement(s)),u=ce.css(o,"display"),o.parentNode.removeChild(o),"none"===u&&(u="block"),ne[s]=u)))):"none"!==n&&(l[c]="none",_.set(r,"display",n)));for(c=0;c<f;c++)null!=l[c]&&(e[c].style.display=l[c]);return e}ce.fn.extend({show:function(){return re(this,!0)},hide:function(){return re(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ee(this)?ce(this).show():ce(this).hide()})}});var xe,be,we=/^(?:checkbox|radio)$/i,Te=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,Ce=/^$|^module$|\/(?:java|ecma)script/i;xe=C.createDocumentFragment().appendChild(C.createElement("div")),(be=C.createElement("input")).setAttribute("type","radio"),be.setAttribute("checked","checked"),be.setAttribute("name","t"),xe.appendChild(be),le.checkClone=xe.cloneNode(!0).cloneNode(!0).lastChild.checked,xe.innerHTML="<textarea>x</textarea>",le.noCloneChecked=!!xe.cloneNode(!0).lastChild.defaultValue,xe.innerHTML="<option></option>",le.option=!!xe.lastChild;var ke={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function Se(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&fe(e,t)?ce.merge([e],n):n}function Ee(e,t){for(var n=0,r=e.length;n<r;n++)_.set(e[n],"globalEval",!t||_.get(t[n],"globalEval"))}ke.tbody=ke.tfoot=ke.colgroup=ke.caption=ke.thead,ke.th=ke.td,le.option||(ke.optgroup=ke.option=[1,"<select multiple='multiple'>","</select>"]);var je=/<|&#?\w+;/;function Ae(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d<h;d++)if((o=e[d])||0===o)if("object"===x(o))ce.merge(p,o.nodeType?[o]:o);else if(je.test(o)){a=a||f.appendChild(t.createElement("div")),s=(Te.exec(o)||["",""])[1].toLowerCase(),u=ke[s]||ke._default,a.innerHTML=u[1]+ce.htmlPrefilter(o)+u[2],c=u[0];while(c--)a=a.lastChild;ce.merge(p,a.childNodes),(a=f.firstChild).textContent=""}else p.push(t.createTextNode(o));f.textContent="",d=0;while(o=p[d++])if(r&&-1<ce.inArray(o,r))i&&i.push(o);else if(l=K(o),a=Se(f.appendChild(o),"script"),l&&Ee(a),n){c=0;while(o=a[c++])Ce.test(o.type||"")&&n.push(o)}return f}var De=/^([^.]*)(?:\.(.+)|)/;function Ne(){return!0}function qe(){return!1}function Le(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Le(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=qe;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return ce().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=ce.guid++)),e.each(function(){ce.event.add(this,t,i,r,n)})}function He(e,r,t){t?(_.set(e,r,!1),ce.event.add(e,r,{namespace:!1,handler:function(e){var t,n=_.get(this,r);if(1&e.isTrigger&&this[r]){if(n)(ce.event.special[r]||{}).delegateType&&e.stopPropagation();else if(n=ae.call(arguments),_.set(this,r,n),this[r](),t=_.get(this,r),_.set(this,r,!1),n!==t)return e.stopImmediatePropagation(),e.preventDefault(),t}else n&&(_.set(this,r,ce.event.trigger(n[0],n.slice(1),this)),e.stopPropagation(),e.isImmediatePropagationStopped=Ne)}})):void 0===_.get(e,r)&&ce.event.add(e,r,Ne)}ce.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=_.get(t);if($(t)){n.handler&&(n=(o=n).handler,i=o.selector),i&&ce.find.matchesSelector(J,i),n.guid||(n.guid=ce.guid++),(u=v.events)||(u=v.events=Object.create(null)),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof ce&&ce.event.triggered!==e.type?ce.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(D)||[""]).length;while(l--)d=g=(s=De.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=ce.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=ce.event.special[d]||{},c=ce.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&ce.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),ce.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=_.hasData(e)&&_.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(D)||[""]).length;while(l--)if(d=g=(s=De.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=ce.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||ce.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)ce.event.remove(e,d+t[l],n,r,!0);ce.isEmptyObject(u)&&_.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=new Array(arguments.length),u=ce.event.fix(e),l=(_.get(this,"events")||Object.create(null))[u.type]||[],c=ce.event.special[u.type]||{};for(s[0]=u,t=1;t<arguments.length;t++)s[t]=arguments[t];if(u.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,u)){a=ce.event.handlers.call(this,u,l),t=0;while((i=a[t++])&&!u.isPropagationStopped()){u.currentTarget=i.elem,n=0;while((o=i.handlers[n++])&&!u.isImmediatePropagationStopped())u.rnamespace&&!1!==o.namespace&&!u.rnamespace.test(o.namespace)||(u.handleObj=o,u.data=o.data,void 0!==(r=((ce.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s))&&!1===(u.result=r)&&(u.preventDefault(),u.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,u),u.result}},handlers:function(e,t){var n,r,i,o,a,s=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!("click"===e.type&&1<=e.button))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n<u;n++)void 0===a[i=(r=t[n]).selector+" "]&&(a[i]=r.needsContext?-1<ce(i,this).index(l):ce.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u<t.length&&s.push({elem:l,handlers:t.slice(u)}),s},addProp:function(t,e){Object.defineProperty(ce.Event.prototype,t,{enumerable:!0,configurable:!0,get:v(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(e){return e[ce.expando]?e:new ce.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return we.test(t.type)&&t.click&&fe(t,"input")&&He(t,"click",!0),!1},trigger:function(e){var t=this||e;return we.test(t.type)&&t.click&&fe(t,"input")&&He(t,"click"),!0},_default:function(e){var t=e.target;return we.test(t.type)&&t.click&&fe(t,"input")&&_.get(t,"click")||fe(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},ce.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},ce.Event=function(e,t){if(!(this instanceof ce.Event))return new ce.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Ne:qe,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&ce.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[ce.expando]=!0},ce.Event.prototype={constructor:ce.Event,isDefaultPrevented:qe,isPropagationStopped:qe,isImmediatePropagationStopped:qe,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Ne,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Ne,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Ne,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},ce.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},ce.event.addProp),ce.each({focus:"focusin",blur:"focusout"},function(r,i){function o(e){if(C.documentMode){var t=_.get(this,"handle"),n=ce.event.fix(e);
vendor: 14,182 bytes, line 12
12n.type="focusin"===e.type?"focus":"blur",n.isSimulated=!0,t(e),n.target===n.currentTarget&&t(n)}else ce.event.simulate(i,e.target,ce.event.fix(e))}ce.event.special[r]={setup:function(){var e;if(He(this,r,!0),!C.documentMode)return!1;(e=_.get(this,i))||this.addEventListener(i,o),_.set(this,i,(e||0)+1)},trigger:function(){return He(this,r),!0},teardown:function(){var e;if(!C.documentMode)return!1;(e=_.get(this,i)-1)?_.set(this,i,e):(this.removeEventListener(i,o),_.remove(this,i))},_default:function(e){return _.get(e.target,r)},delegateType:i},ce.event.special[i]={setup:function(){var e=this.ownerDocument||this.document||this,t=C.documentMode?this:e,n=_.get(t,i);n||(C.documentMode?this.addEventListener(i,o):e.addEventListener(r,o,!0)),_.set(t,i,(n||0)+1)},teardown:function(){var e=this.ownerDocument||this.document||this,t=C.documentMode?this:e,n=_.get(t,i)-1;n?_.set(t,i,n):(C.documentMode?this.removeEventListener(i,o):e.removeEventListener(r,o,!0),_.remove(t,i))}}}),ce.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,i){ce.event.special[e]={delegateType:i,bindType:i,handle:function(e){var t,n=e.relatedTarget,r=e.handleObj;return n&&(n===this||ce.contains(this,n))||(e.type=r.origType,t=r.handler.apply(this,arguments),e.type=i),t}}}),ce.fn.extend({on:function(e,t,n,r){return Le(this,e,t,n,r)},one:function(e,t,n,r){return Le(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,ce(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=qe),this.each(function(){ce.event.remove(this,e,n,t)})}});var Oe=/<script|<style|<link/i,Pe=/checked\s*(?:[^=]|=\s*.checked.)/i,Me=/^\s*<!\[CDATA\[|\]\]>\s*$/g;function Re(e,t){return fe(e,"table")&&fe(11!==t.nodeType?t:t.firstChild,"tr")&&ce(e).children("tbody")[0]||e}function Ie(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function We(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Fe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(_.hasData(e)&&(s=_.get(e).events))for(i in _.remove(t,"handle events"),s)for(n=0,r=s[i].length;n<r;n++)ce.event.add(t,i,s[i][n]);z.hasData(e)&&(o=z.access(e),a=ce.extend({},o),z.set(t,a))}}function $e(n,r,i,o){r=g(r);var e,t,a,s,u,l,c=0,f=n.length,p=f-1,d=r[0],h=v(d);if(h||1<f&&"string"==typeof d&&!le.checkClone&&Pe.test(d))return n.each(function(e){var t=n.eq(e);h&&(r[0]=d.call(this,e,t.html())),$e(t,r,i,o)});if(f&&(t=(e=Ae(r,n[0].ownerDocument,!1,n,o)).firstChild,1===e.childNodes.length&&(e=t),t||o)){for(s=(a=ce.map(Se(e,"script"),Ie)).length;c<f;c++)u=e,c!==p&&(u=ce.clone(u,!0,!0),s&&ce.merge(a,Se(u,"script"))),i.call(n[c],u,c);if(s)for(l=a[a.length-1].ownerDocument,ce.map(a,We),c=0;c<s;c++)u=a[c],Ce.test(u.type||"")&&!_.access(u,"globalEval")&&ce.contains(l,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?ce._evalUrl&&!u.noModule&&ce._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},l):m(u.textContent.replace(Me,""),u,l))}return n}function Be(e,t,n){for(var r,i=t?ce.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||ce.cleanData(Se(r)),r.parentNode&&(n&&K(r)&&Ee(Se(r,"script")),r.parentNode.removeChild(r));return e}ce.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=K(e);if(!(le.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||ce.isXMLDoc(e)))for(a=Se(c),r=0,i=(o=Se(e)).length;r<i;r++)s=o[r],u=a[r],void 0,"input"===(l=u.nodeName.toLowerCase())&&we.test(s.type)?u.checked=s.checked:"input"!==l&&"textarea"!==l||(u.defaultValue=s.defaultValue);if(t)if(n)for(o=o||Se(e),a=a||Se(c),r=0,i=o.length;r<i;r++)Fe(o[r],a[r]);else Fe(e,c);return 0<(a=Se(c,"script")).length&&Ee(a,!f&&Se(e,"script")),c},cleanData:function(e){for(var t,n,r,i=ce.event.special,o=0;void 0!==(n=e[o]);o++)if($(n)){if(t=n[_.expando]){if(t.events)for(r in t.events)i[r]?ce.event.remove(n,r):ce.removeEvent(n,r,t.handle);n[_.expando]=void 0}n[z.expando]&&(n[z.expando]=void 0)}}}),ce.fn.extend({detach:function(e){return Be(this,e,!0)},remove:function(e){return Be(this,e)},text:function(e){return M(this,function(e){return void 0===e?ce.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return $e(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Re(this,e).appendChild(e)})},prepend:function(){return $e(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Re(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return $e(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return $e(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(ce.cleanData(Se(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return ce.clone(this,e,t)})},html:function(e){return M(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Oe.test(e)&&!ke[(Te.exec(e)||["",""])[1].toLowerCase()]){e=ce.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(ce.cleanData(Se(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var n=[];return $e(this,arguments,function(e){var t=this.parentNode;ce.inArray(this,n)<0&&(ce.cleanData(Se(this)),t&&t.replaceChild(e,this))},n)}}),ce.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,a){ce.fn[e]=function(e){for(var t,n=[],r=ce(e),i=r.length-1,o=0;o<=i;o++)t=o===i?this:this.clone(!0),ce(r[o])[a](t),s.apply(n,t.get());return this.pushStack(n)}});var _e=new RegExp("^("+G+")(?!px)[a-z%]+$","i"),ze=/^--/,Xe=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=ie),t.getComputedStyle(e)},Ue=function(e,t,n){var r,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in r=n.call(e),t)e.style[i]=o[i];return r},Ve=new RegExp(Q.join("|"),"i");function Ge(e,t,n){var r,i,o,a,s=ze.test(t),u=e.style;return(n=n||Xe(e))&&(a=n.getPropertyValue(t)||n[t],s&&a&&(a=a.replace(ve,"$1")||void 0),""!==a||K(e)||(a=ce.style(e,t)),!le.pixelBoxStyles()&&_e.test(a)&&Ve.test(t)&&(r=u.width,i=u.minWidth,o=u.maxWidth,u.minWidth=u.maxWidth=u.width=a,a=n.width,u.width=r,u.minWidth=i,u.maxWidth=o)),void 0!==a?a+"":a}function Ye(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(l){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",l.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",J.appendChild(u).appendChild(l);var e=ie.getComputedStyle(l);n="1%"!==e.top,s=12===t(e.marginLeft),l.style.right="60%",o=36===t(e.right),r=36===t(e.width),l.style.position="absolute",i=12===t(l.offsetWidth/3),J.removeChild(u),l=null}}function t(e){return Math.round(parseFloat(e))}var n,r,i,o,a,s,u=C.createElement("div"),l=C.createElement("div");l.style&&(l.style.backgroundClip="content-box",l.cloneNode(!0).style.backgroundClip="",le.clearCloneStyle="content-box"===l.style.backgroundClip,ce.extend(le,{boxSizingReliable:function(){return e(),r},pixelBoxStyles:function(){return e(),o},pixelPosition:function(){return e(),n},reliableMarginLeft:function(){return e(),s},scrollboxSize:function(){return e(),i},reliableTrDimensions:function(){var e,t,n,r;return null==a&&(e=C.createElement("table"),t=C.createElement("tr"),n=C.createElement("div"),e.style.cssText="position:absolute;left:-11111px;border-collapse:separate",t.style.cssText="box-sizing:content-box;border:1px solid",t.style.height="1px",n.style.height="9px",n.style.display="block",J.appendChild(e).appendChild(t).appendChild(n),r=ie.getComputedStyle(t),a=parseInt(r.height,10)+parseInt(r.borderTopWidth,10)+parseInt(r.borderBottomWidth,10)===t.offsetHeight,J.removeChild(e)),a}}))}();var Qe=["Webkit","Moz","ms"],Je=C.createElement("div").style,Ke={};function Ze(e){var t=ce.cssProps[e]||Ke[e];return t||(e in Je?e:Ke[e]=function(e){var t=e[0].toUpperCase()+e.slice(1),n=Qe.length;while(n--)if((e=Qe[n]+t)in Je)return e}(e)||e)}var et=/^(none|table(?!-c[ea]).+)/,tt={position:"absolute",visibility:"hidden",display:"block"},nt={letterSpacing:"0",fontWeight:"400"};function rt(e,t,n){var r=Y.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function it(e,t,n,r,i,o){var a="width"===t?1:0,s=0,u=0,l=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(l+=ce.css(e,n+Q[a],!0,i)),r?("content"===n&&(u-=ce.css(e,"padding"+Q[a],!0,i)),"margin"!==n&&(u-=ce.css(e,"border"+Q[a]+"Width",!0,i))):(u+=ce.css(e,"padding"+Q[a],!0,i),"padding"!==n?u+=ce.css(e,"border"+Q[a]+"Width",!0,i):s+=ce.css(e,"border"+Q[a]+"Width",!0,i));return!r&&0<=o&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))||0),u+l}function ot(e,t,n){var r=Xe(e),i=(!le.boxSizingReliable()||n)&&"border-box"===ce.css(e,"boxSizing",!1,r),o=i,a=Ge(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(_e.test(a)){if(!n)return a;a="auto"}return(!le.boxSizingReliable()&&i||!le.reliableTrDimensions()&&fe(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===ce.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===ce.css(e,"boxSizing",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+it(e,t,n||(i?"border":"content"),o,r,a)+"px"}function at(e,t,n,r,i){return new at.prototype.init(e,t,n,r,i)}ce.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Ge(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=F(t),u=ze.test(t),l=e.style;if(u||(t=Ze(s)),a=ce.cssHooks[t]||ce.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"===(o=typeof n)&&(i=Y.exec(n))&&i[1]&&(n=te(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(ce.cssNumber[s]?"":"px")),le.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=F(t);return ze.test(t)||(t=Ze(s)),(a=ce.cssHooks[t]||ce.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Ge(e,t,r)),"normal"===i&&t in nt&&(i=nt[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),ce.each(["height","width"],function(e,u){ce.cssHooks[u]={get:function(e,t,n){if(t)return!et.test(ce.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?ot(e,u,n):Ue(e,tt,function(){return ot(e,u,n)})},set:function(e,t,n){var r,i=Xe(e),o=!le.scrollboxSize()&&"absolute"===i.position,a=(o||n)&&"border-box"===ce.css(e,"boxSizing",!1,i),s=n?it(e,u,n,a,i):0;return a&&o&&(s-=Math.ceil(e["offset"+u[0].toUpperCase()+u.slice(1)]-parseFloat(i[u])-it(e,u,"border",!1,i)-.5)),s&&(r=Y.exec(t))&&"px"!==(r[3]||"px")&&(e.style[u]=t,t=ce.css(e,u)),rt(0,t,s)}}}),ce.cssHooks.marginLeft=Ye(le.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Ge(e,"marginLeft"))||e.getBoundingClientRect().left-Ue(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),ce.each({margin:"",padding:"",border:"Width"},function(i,o){ce.cssHooks[i+o]={expand:function(e){for(var t=0,n={},r="string"==typeof e?e.split(" "):[e];t<4;t++)n[i+Q[t]+o]=r[t]||r[t-2]||r[0];return n}},"margin"!==i&&(ce.cssHooks[i+o].set=rt)}),ce.fn.extend({css:function(e,t){return M(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Xe(e),i=t.length;a<i;a++)o[t[a]]=ce.css(e,t[a],!1,r);return o}return void 0!==n?ce.style(e,t,n):ce.css(e,t)},e,t,1<arguments.length)}}),((ce.Tween=at).prototype={constructor:at,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||ce.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(ce.cssNumber[n]?"":"px")},cur:function(){var e=at.propHooks[this.prop];return e&&e.get?e.get(this):at.propHooks._default.get(this)},run:function(e){var t,n=at.propHooks[this.prop];return this.options.duration?this.pos=t=ce.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):at.propHooks._default.set(this),this}}).init.prototype=at.prototype,(at.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=ce.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){ce.fx.step[e.prop]?ce.fx.step[e.prop](e):1!==e.elem.nodeType||!ce.cssHooks[e.prop]&&null==e.elem.style[Ze(e.prop)]?e.elem[e.prop]=e.now:ce.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=at.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},ce.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},ce.fx=at.prototype.init,ce.fx.step={};var st,ut,lt,ct,ft=/^(?:toggle|show|hide)$/,pt=/queueHooks$/;function dt(){ut&&(!1===C.hidden&&ie.requestAnimationFrame?ie.requestAnimationFrame(dt):ie.setTimeout(dt,ce.fx.interval),ce.fx.tick())}function ht(){return ie.setTimeout(function(){st=void 0}),st=Date.now()}function gt(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=Q[r])]=i["padding"+n]=e;
vendor: 4,590 bytes, line 12
12return t&&(i.opacity=i.width=e),i}function vt(e,t,n){for(var r,i=(yt.tweeners[t]||[]).concat(yt.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function yt(o,e,t){var n,a,r=0,i=yt.prefilters.length,s=ce.Deferred().always(function(){delete u.elem}),u=function(){if(a)return!1;for(var e=st||ht(),t=Math.max(0,l.startTime+l.duration-e),n=1-(t/l.duration||0),r=0,i=l.tweens.length;r<i;r++)l.tweens[r].run(n);return s.notifyWith(o,[l,n,t]),n<1&&i?t:(i||s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l]),!1)},l=s.promise({elem:o,props:ce.extend({},e),opts:ce.extend(!0,{specialEasing:{},easing:ce.easing._default},t),originalProperties:e,originalOptions:t,startTime:st||ht(),duration:t.duration,tweens:[],createTween:function(e,t){var n=ce.Tween(o,l.opts,e,t,l.opts.specialEasing[e]||l.opts.easing);return l.tweens.push(n),n},stop:function(e){var t=0,n=e?l.tweens.length:0;if(a)return this;for(a=!0;t<n;t++)l.tweens[t].run(1);return e?(s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l,e])):s.rejectWith(o,[l,e]),this}}),c=l.props;for(!function(e,t){var n,r,i,o,a;for(n in e)if(i=t[r=F(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=ce.cssHooks[r])&&"expand"in a)for(n in o=a.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,l.opts.specialEasing);r<i;r++)if(n=yt.prefilters[r].call(l,o,c,l.opts))return v(n.stop)&&(ce._queueHooks(l.elem,l.opts.queue).stop=n.stop.bind(n)),n;return ce.map(c,vt,l),v(l.opts.start)&&l.opts.start.call(o,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),ce.fx.timer(ce.extend(u,{elem:o,anim:l,queue:l.opts.queue})),l}ce.Animation=ce.extend(yt,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return te(n.elem,e,Y.exec(t),n),n}]},tweener:function(e,t){v(e)?(t=e,e=["*"]):e=e.match(D);for(var n,r=0,i=e.length;r<i;r++)n=e[r],yt.tweeners[n]=yt.tweeners[n]||[],yt.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,a,s,u,l,c,f="width"in t||"height"in t,p=this,d={},h=e.style,g=e.nodeType&&ee(e),v=_.get(e,"fxshow");for(r in n.queue||(null==(a=ce._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,ce.queue(e,"fx").length||a.empty.fire()})})),t)if(i=t[r],ft.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!v||void 0===v[r])continue;g=!0}d[r]=v&&v[r]||ce.style(e,r)}if((u=!ce.isEmptyObject(t))||!ce.isEmptyObject(d))for(r in f&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(l=v&&v.display)&&(l=_.get(e,"display")),"none"===(c=ce.css(e,"display"))&&(l?c=l:(re([e],!0),l=e.style.display||l,c=ce.css(e,"display"),re([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===ce.css(e,"float")&&(u||(p.done(function(){h.display=l}),null==l&&(c=h.display,l="none"===c?"":c)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),u=!1,d)u||(v?"hidden"in v&&(g=v.hidden):v=_.access(e,"fxshow",{display:l}),o&&(v.hidden=!g),g&&re([e],!0),p.done(function(){for(r in g||re([e]),_.remove(e,"fxshow"),d)ce.style(e,r,d[r])})),u=vt(g?v[r]:0,r,p),r in v||(v[r]=u.start,g&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?yt.prefilters.unshift(e):yt.prefilters.push(e)}}),ce.speed=function(e,t,n){var r=e&&"object"==typeof e?ce.extend({},e):{complete:n||!n&&t||v(e)&&e,duration:e,easing:n&&t||t&&!v(t)&&t};return ce.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in ce.fx.speeds?r.duration=ce.fx.speeds[r.duration]:r.duration=ce.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){v(r.old)&&r.old.call(this),r.queue&&ce.dequeue(this,r.queue)},r},ce.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ee).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(t,e,n,r){var i=ce.isEmptyObject(t),o=ce.speed(e,n,r),a=function(){var e=yt(this,ce.extend({},t),o);(i||_.get(this,"finish"))&&e.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(i,e,o){var a=function(e){var t=e.stop;delete e.stop,t(o)};return"string"!=typeof i&&(o=e,e=i,i=void 0),e&&this.queue(i||"fx",[]),this.each(function(){var e=!0,t=null!=i&&i+"queueHooks",n=ce.timers,r=_.get(this);if(t)r[t]&&r[t].stop&&a(r[t]);else for(t in r)r[t]&&r[t].stop&&pt.test(t)&&a(r[t]);for(t=n.length;t--;)n[t].elem!==this||null!=i&&n[t].queue!==i||(n[t].anim.stop(o),e=!1,n.splice(t,1)
vendor: 13,972 bytes, line 12
12);!e&&o||ce.dequeue(this,i)})},finish:function(a){return!1!==a&&(a=a||"fx"),this.each(function(){var e,t=_.get(this),n=t[a+"queue"],r=t[a+"queueHooks"],i=ce.timers,o=n?n.length:0;for(t.finish=!0,ce.queue(this,a,[]),r&&r.stop&&r.stop.call(this,!0),e=i.length;e--;)i[e].elem===this&&i[e].queue===a&&(i[e].anim.stop(!0),i.splice(e,1));for(e=0;e<o;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete t.finish})}}),ce.each(["toggle","show","hide"],function(e,r){var i=ce.fn[r];ce.fn[r]=function(e,t,n){return null==e||"boolean"==typeof e?i.apply(this,arguments):this.animate(gt(r,!0),e,t,n)}}),ce.each({slideDown:gt("show"),slideUp:gt("hide"),slideToggle:gt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,r){ce.fn[e]=function(e,t,n){return this.animate(r,e,t,n)}}),ce.timers=[],ce.fx.tick=function(){var e,t=0,n=ce.timers;for(st=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||ce.fx.stop(),st=void 0},ce.fx.timer=function(e){ce.timers.push(e),ce.fx.start()},ce.fx.interval=13,ce.fx.start=function(){ut||(ut=!0,dt())},ce.fx.stop=function(){ut=null},ce.fx.speeds={slow:600,fast:200,_default:400},ce.fn.delay=function(r,e){return r=ce.fx&&ce.fx.speeds[r]||r,e=e||"fx",this.queue(e,function(e,t){var n=ie.setTimeout(e,r);t.stop=function(){ie.clearTimeout(n)}})},lt=C.createElement("input"),ct=C.createElement("select").appendChild(C.createElement("option")),lt.type="checkbox",le.checkOn=""!==lt.value,le.optSelected=ct.selected,(lt=C.createElement("input")).value="t",lt.type="radio",le.radioValue="t"===lt.value;var mt,xt=ce.expr.attrHandle;ce.fn.extend({attr:function(e,t){return M(this,ce.attr,e,t,1<arguments.length)},removeAttr:function(e){return this.each(function(){ce.removeAttr(this,e)})}}),ce.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?ce.prop(e,t,n):(1===o&&ce.isXMLDoc(e)||(i=ce.attrHooks[t.toLowerCase()]||(ce.expr.match.bool.test(t)?mt:void 0)),void 0!==n?null===n?void ce.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=ce.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!le.radioValue&&"radio"===t&&fe(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(D);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),mt={set:function(e,t,n){return!1===t?ce.removeAttr(e,n):e.setAttribute(n,n),n}},ce.each(ce.expr.match.bool.source.match(/\w+/g),function(e,t){var a=xt[t]||ce.find.attr;xt[t]=function(e,t,n){var r,i,o=t.toLowerCase();return n||(i=xt[o],xt[o]=r,r=null!=a(e,t,n)?o:null,xt[o]=i),r}});var bt=/^(?:input|select|textarea|button)$/i,wt=/^(?:a|area)$/i;function Tt(e){return(e.match(D)||[]).join(" ")}function Ct(e){return e.getAttribute&&e.getAttribute("class")||""}function kt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(D)||[]}ce.fn.extend({prop:function(e,t){return M(this,ce.prop,e,t,1<arguments.length)},removeProp:function(e){return this.each(function(){delete this[ce.propFix[e]||e]})}}),ce.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&ce.isXMLDoc(e)||(t=ce.propFix[t]||t,i=ce.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=ce.find.attr(e,"tabindex");return t?parseInt(t,10):bt.test(e.nodeName)||wt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),le.optSelected||(ce.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),ce.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){ce.propFix[this.toLowerCase()]=this}),ce.fn.extend({addClass:function(t){var e,n,r,i,o,a;return v(t)?this.each(function(e){ce(this).addClass(t.call(this,e,Ct(this)))}):(e=kt(t)).length?this.each(function(){if(r=Ct(this),n=1===this.nodeType&&" "+Tt(r)+" "){for(o=0;o<e.length;o++)i=e[o],n.indexOf(" "+i+" ")<0&&(n+=i+" ");a=Tt(n),r!==a&&this.setAttribute("class",a)}}):this},removeClass:function(t){var e,n,r,i,o,a;return v(t)?this.each(function(e){ce(this).removeClass(t.call(this,e,Ct(this)))}):arguments.length?(e=kt(t)).length?this.each(function(){if(r=Ct(this),n=1===this.nodeType&&" "+Tt(r)+" "){for(o=0;o<e.length;o++){i=e[o];while(-1<n.indexOf(" "+i+" "))n=n.replace(" "+i+" "," ")}a=Tt(n),r!==a&&this.setAttribute("class",a)}}):this:this.attr("class","")},toggleClass:function(t,n){var e,r,i,o,a=typeof t,s="string"===a||Array.isArray(t);return v(t)?this.each(function(e){ce(this).toggleClass(t.call(this,e,Ct(this),n),n)}):"boolean"==typeof n&&s?n?this.addClass(t):this.removeClass(t):(e=kt(t),this.each(function(){if(s)for(o=ce(this),i=0;i<e.length;i++)r=e[i],o.hasClass(r)?o.removeClass(r):o.addClass(r);else void 0!==t&&"boolean"!==a||((r=Ct(this))&&_.set(this,"__className__",r),this.setAttribute&&this.setAttribute("class",r||!1===t?"":_.get(this,"__className__")||""))}))},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&-1<(" "+Tt(Ct(n))+" ").indexOf(t))return!0;return!1}});var St=/\r/g;ce.fn.extend({val:function(n){var r,e,i,t=this[0];return arguments.length?(i=v(n),this.each(function(e){var t;1===this.nodeType&&(null==(t=i?n.call(this,e,ce(this).val()):n)?t="":"number"==typeof t?t+="":Array.isArray(t)&&(t=ce.map(t,function(e){return null==e?"":e+""})),(r=ce.valHooks[this.type]||ce.valHooks[this.nodeName.toLowerCase()])&&"set"in r&&void 0!==r.set(this,t,"value")||(this.value=t))})):t?(r=ce.valHooks[t.type]||ce.valHooks[t.nodeName.toLowerCase()])&&"get"in r&&void 0!==(e=r.get(t,"value"))?e:"string"==typeof(e=t.value)?e.replace(St,""):null==e?"":e:void 0}}),ce.extend({valHooks:{option:{get:function(e){var t=ce.find.attr(e,"value");return null!=t?t:Tt(ce.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r<u;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!fe(n.parentNode,"optgroup"))){if(t=ce(n).val(),a)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=ce.makeArray(t),a=i.length;while(a--)((r=i[a]).selected=-1<ce.inArray(ce.valHooks.option.get(r),o))&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),ce.each(["radio","checkbox"],function(){ce.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=-1<ce.inArray(ce(e).val(),t)}},le.checkOn||(ce.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Et=ie.location,jt={guid:Date.now()},At=/\?/;ce.parseXML=function(e){var t,n;if(!e||"string"!=typeof e)return null;try{t=(new ie.DOMParser).parseFromString(e,"text/xml")}catch(e){}return n=t&&t.getElementsByTagName("parsererror")[0],t&&!n||ce.error("Invalid XML: "+(n?ce.map(n.childNodes,function(e){return e.textContent}).join("\n"):e)),t};var Dt=/^(?:focusinfocus|focusoutblur)$/,Nt=function(e){e.stopPropagation()};ce.extend(ce.event,{trigger:function(e,t,n,r){var i,o,a,s,u,l,c,f,p=[n||C],d=ue.call(e,"type")?e.type:e,h=ue.call(e,"namespace")?e.namespace.split("."):[];if(o=f=a=n=n||C,3!==n.nodeType&&8!==n.nodeType&&!Dt.test(d+ce.event.triggered)&&(-1<d.indexOf(".")&&(d=(h=d.split(".")).shift(),h.sort()),u=d.indexOf(":")<0&&"on"+d,(e=e[ce.expando]?e:new ce.Event(d,"object"==typeof e&&e)).isTrigger=r?2:3,e.namespace=h.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:ce.makeArray(t,[e]),c=ce.event.special[d]||{},r||!c.trigger||!1!==c.trigger.apply(n,t))){if(!r&&!c.noBubble&&!y(n)){for(s=c.delegateType||d,Dt.test(s+d)||(o=o.parentNode);o;o=o.parentNode)p.push(o),a=o;a===(n.ownerDocument||C)&&p.push(a.defaultView||a.parentWindow||ie)}i=0;while((o=p[i++])&&!e.isPropagationStopped())f=o,e.type=1<i?s:c.bindType||d,(l=(_.get(o,"events")||Object.create(null))[e.type]&&_.get(o,"handle"))&&l.apply(o,t),(l=u&&o[u])&&l.apply&&$(o)&&(e.result=l.apply(o,t),!1===e.result&&e.preventDefault());return e.type=d,r||e.isDefaultPrevented()||c._default&&!1!==c._default.apply(p.pop(),t)||!$(n)||u&&v(n[d])&&!y(n)&&((a=n[u])&&(n[u]=null),ce.event.triggered=d,e.isPropagationStopped()&&f.addEventListener(d,Nt),n[d](),e.isPropagationStopped()&&f.removeEventListener(d,Nt),ce.event.triggered=void 0,a&&(n[u]=a)),e.result}},simulate:function(e,t,n){var r=ce.extend(new ce.Event,n,{type:e,isSimulated:!0});ce.event.trigger(r,null,t)}}),ce.fn.extend({trigger:function(e,t){return this.each(function(){ce.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return ce.event.trigger(e,t,n,!0)}});var qt=/\[\]$/,Lt=/\r?\n/g,Ht=/^(?:submit|button|image|reset|file)$/i,Ot=/^(?:input|select|textarea|keygen)/i;function Pt(n,e,r,i){var t;if(Array.isArray(e))ce.each(e,function(e,t){r||qt.test(n)?i(n,t):Pt(n+"["+("object"==typeof t&&null!=t?e:"")+"]",t,r,i)});else if(r||"object"!==x(e))i(n,e);else for(t in e)Pt(n+"["+t+"]",e[t],r,i)}ce.param=function(e,t){var n,r=[],i=function(e,t){var n=v(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!ce.isPlainObject(e))ce.each(e,function(){i(this.name,this.value)});else for(n in e)Pt(n,e[n],t,i);return r.join("&")},ce.fn.extend({serialize:function(){return ce.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=ce.prop(this,"elements");return e?ce.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!ce(this).is(":disabled")&&Ot.test(this.nodeName)&&!Ht.test(e)&&(this.checked||!we.test(e))}).map(function(e,t){var n=ce(this).val();return null==n?null:Array.isArray(n)?ce.map(n,function(e){return{name:t.name,value:e.replace(Lt,"\r\n")}}):{name:t.name,value:n.replace(Lt,"\r\n")}}).get()}});var Mt=/%20/g,Rt=/#.*$/,It=/([?&])_=[^&]*/,Wt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ft=/^(?:GET|HEAD)$/,$t=/^\/\//,Bt={},_t={},zt="*/".concat("*"),Xt=C.createElement("a");function Ut(o){return function(e,t){"string"!=typeof e&&(t=e,e="*");var n,r=0,i=e.toLowerCase().match(D)||[];if(v(t))while(n=i[r++])"+"===n[0]?(n=n.slice(1)||"*",(o[n]=o[n]||[]).unshift(t)):(o[n]=o[n]||[]).push(t)}}function Vt(t,i,o,a){var s={},u=t===_t;function l(e){var r;return s[e]=!0,ce.each(t[e]||[],function(e,t){var n=t(i,o,a);return"string"!=typeof n||u||s[n]?u?!(r=n):void 0:(i.dataTypes.unshift(n),l(n),!1)}),r}return l(i.dataTypes[0])||!s["*"]&&l("*")}function Gt(e,t){var n,r,i=ce.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&ce.extend(!0,e,r),e}Xt.href=Et.href,ce.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Et.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Et.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":zt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":ce.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Gt(Gt(e,ce.ajaxSettings),t):Gt(ce.ajaxSettings,e)},ajaxPrefilter:Ut(Bt),ajaxTransport:Ut(_t),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var c,f,p,n,d,r,h,g,i,o,v=ce.ajaxSetup({},t),y=v.context||v,m=v.context&&(y.nodeType||y.jquery)?ce(y):ce.event,x=ce.Deferred(),b=ce.Callbacks("once memory"),w=v.statusCode||{},a={},s={},u="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(h){if(!n){n={};while(t=Wt.exec(p))n[t[1].toLowerCase()+" "]=(n[t[1].toLowerCase()+" "]||[]).concat(t[2])}t=n[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return h?p:null},setRequestHeader:function(e,t){return null==h&&(e=s[e.toLowerCase()]=s[e.toLowerCase()]||e,a[e]=t),this},overrideMimeType:function(e){return null==h&&(v.mimeType=e),this},statusCode:function(e){var t;if(e)if(h)T.always(e[T.status]);else for(t in e)w[t]=[w[t],e[t]];return this},abort:function(e){var t=e||u;return c&&c.abort(t),l(0,t),this}};if(x.promise(T),v.url=((e||v.url||Et.href)+"").replace($t,Et.protocol+"//"),v.type=t.method||t.type||v.method||v.type,v.dataTypes=(v.dataType||"*").toLowerCase().match(D)||[""],null==v.crossDomain){r=C.createElement("a");try{r.href=v.url,r.href=r.href,v.crossDomain=Xt.protocol+"//"+Xt.host!=r.protocol+"//"+r.host}catch(e){v.crossDomain=!0}}if(v.data&&v.processData&&"string"!=typeof v.data&&(v.data=ce.param(v.data,v.traditional)),Vt(Bt,v,t,T),h)return T;for(i in(g=ce.event&&v.global)&&0==ce.active++&&ce.event.trigger("ajaxStart"),v.type=v.type.toUpperCase(),v.hasContent=!Ft.test(v.type),f=v.url.replace(Rt,""),v.hasContent?v.data&&v.processData&&0===(v.contentType||"").indexOf("application/x-www-form-urlencoded")&&(v.data=v.data.replace(Mt,"+")):(o=v.url.slice(f.length),v.data&&(v.processData||"string"==typeof v.data)&&(f+=(At.test(f)?"&":"?")+v.data,delete v.data),!1===v.cache&&(f=f.replace(It,"$1"),o=(At.test(f)?"&":"?")+"_="+jt.guid+++o),v.url=f+o),v.ifModified&&(ce.lastModified[f]&&T.setRequestHeader("If-Modified-Since",ce.lastModified[f]),ce.etag[f]&&T.setRequestHeader("If-None-Match",ce.etag[f])),(v.data&&v.hasContent&&!1!==v.contentType||t.contentType)&&T.setRequestHeader("Content-Type",v.contentType),T.setRequestHeader("Accept",v.dataTypes[0]&&v.accepts[v.dataTypes[0]]?v.accepts[v.dataTypes[0]]+("*"!==v.dataTypes[0]?", "+zt+"; q=0.01":""):v.accepts["*"]),v.headers)T.setRequestHeader(i,v.headers[i]);
vendor: 9,033 bytes, line 12
12if(v.beforeSend&&(!1===v.beforeSend.call(y,T,v)||h))return T.abort();if(u="abort",b.add(v.complete),T.done(v.success),T.fail(v.error),c=Vt(_t,v,t,T)){if(T.readyState=1,g&&m.trigger("ajaxSend",[T,v]),h)return T;v.async&&0<v.timeout&&(d=ie.setTimeout(function(){T.abort("timeout")},v.timeout));try{h=!1,c.send(a,l)}catch(e){if(h)throw e;l(-1,e)}}else l(-1,"No Transport");function l(e,t,n,r){var i,o,a,s,u,l=t;h||(h=!0,d&&ie.clearTimeout(d),c=void 0,p=r||"",T.readyState=0<e?4:0,i=200<=e&&e<300||304===e,n&&(s=function(e,t,n){var r,i,o,a,s=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(v,T,n)),!i&&-1<ce.inArray("script",v.dataTypes)&&ce.inArray("json",v.dataTypes)<0&&(v.converters["text script"]=function(){}),s=function(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(v,s,T,i),i?(v.ifModified&&((u=T.getResponseHeader("Last-Modified"))&&(ce.lastModified[f]=u),(u=T.getResponseHeader("etag"))&&(ce.etag[f]=u)),204===e||"HEAD"===v.type?l="nocontent":304===e?l="notmodified":(l=s.state,o=s.data,i=!(a=s.error))):(a=l,!e&&l||(l="error",e<0&&(e=0))),T.status=e,T.statusText=(t||l)+"",i?x.resolveWith(y,[o,l,T]):x.rejectWith(y,[T,l,a]),T.statusCode(w),w=void 0,g&&m.trigger(i?"ajaxSuccess":"ajaxError",[T,v,i?o:a]),b.fireWith(y,[T,l]),g&&(m.trigger("ajaxComplete",[T,v]),--ce.active||ce.event.trigger("ajaxStop")))}return T},getJSON:function(e,t,n){return ce.get(e,t,n,"json")},getScript:function(e,t){return ce.get(e,void 0,t,"script")}}),ce.each(["get","post"],function(e,i){ce[i]=function(e,t,n,r){return v(t)&&(r=r||n,n=t,t=void 0),ce.ajax(ce.extend({url:e,type:i,dataType:r,data:t,success:n},ce.isPlainObject(e)&&e))}}),ce.ajaxPrefilter(function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")}),ce._evalUrl=function(e,t,n){return ce.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){ce.globalEval(e,t,n)}})},ce.fn.extend({wrapAll:function(e){var t;return this[0]&&(v(e)&&(e=e.call(this[0])),t=ce(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(n){return v(n)?this.each(function(e){ce(this).wrapInner(n.call(this,e))}):this.each(function(){var e=ce(this),t=e.contents();t.length?t.wrapAll(n):e.append(n)})},wrap:function(t){var n=v(t);return this.each(function(e){ce(this).wrapAll(n?t.call(this,e):t)})},unwrap:function(e){return this.parent(e).not("body").each(function(){ce(this).replaceWith(this.childNodes)}),this}}),ce.expr.pseudos.hidden=function(e){return!ce.expr.pseudos.visible(e)},ce.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},ce.ajaxSettings.xhr=function(){try{return new ie.XMLHttpRequest}catch(e){}};var Yt={0:200,1223:204},Qt=ce.ajaxSettings.xhr();le.cors=!!Qt&&"withCredentials"in Qt,le.ajax=Qt=!!Qt,ce.ajaxTransport(function(i){var o,a;if(le.cors||Qt&&!i.crossDomain)return{send:function(e,t){var n,r=i.xhr();if(r.open(i.type,i.url,i.async,i.username,i.password),i.xhrFields)for(n in i.xhrFields)r[n]=i.xhrFields[n];for(n in i.mimeType&&r.overrideMimeType&&r.overrideMimeType(i.mimeType),i.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest"),e)r.setRequestHeader(n,e[n]);o=function(e){return function(){o&&(o=a=r.onload=r.onerror=r.onabort=r.ontimeout=r.onreadystatechange=null,"abort"===e?r.abort():"error"===e?"number"!=typeof r.status?t(0,"error"):t(r.status,r.statusText):t(Yt[r.status]||r.status,r.statusText,"text"!==(r.responseType||"text")||"string"!=typeof r.responseText?{binary:r.response}:{text:r.responseText},r.getAllResponseHeaders()))}},r.onload=o(),a=r.onerror=r.ontimeout=o("error"),void 0!==r.onabort?r.onabort=a:r.onreadystatechange=function(){4===r.readyState&&ie.setTimeout(function(){o&&a()})},o=o("abort");try{r.send(i.hasContent&&i.data||null)}catch(e){if(o)throw e}},abort:function(){o&&o()}}}),ce.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),ce.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return ce.globalEval(e),e}}}),ce.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),ce.ajaxTransport("script",function(n){var r,i;if(n.crossDomain||n.scriptAttrs)return{send:function(e,t){r=ce("<script>").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),C.head.appendChild(r[0])},abort:function(){i&&i()}}});var Jt,Kt=[],Zt=/(=)\?(?=&|$)|\?\?/;ce.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Kt.pop()||ce.expando+"_"+jt.guid++;return this[e]=!0,e}}),ce.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Zt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Zt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=v(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Zt,"$1"+r):!1!==e.jsonp&&(e.url+=(At.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||ce.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=ie[r],ie[r]=function(){o=arguments},n.always(function(){void 0===i?ce(ie).removeProp(r):ie[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Kt.push(r)),o&&v(i)&&i(o[0]),o=i=void 0}),"script"}),le.createHTMLDocument=((Jt=C.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Jt.childNodes.length),ce.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(le.createHTMLDocument?((r=(t=C.implementation.createHTMLDocument("")).createElement("base")).href=C.location.href,t.head.appendChild(r)):t=C),o=!n&&[],(i=w.exec(e))?[t.createElement(i[1])]:(i=Ae([e],t,o),o&&o.length&&ce(o).remove(),ce.merge([],i.childNodes)));var r,i,o},ce.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1<s&&(r=Tt(e.slice(s)),e=e.slice(0,s)),v(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),0<a.length&&ce.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?ce("<div>").append(ce.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},ce.expr.pseudos.animated=function(t){return ce.grep(ce.timers,function(e){return t===e.elem}).length},ce.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=ce.css(e,"position"),c=ce(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=ce.css(e,"top"),u=ce.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),v(t)&&(t=t.call(e,n,ce.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},ce.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){ce.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===ce.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===ce.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=ce(e).offset()).top+=ce.css(e,"borderTopWidth",!0),i.left+=ce.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-ce.css(r,"marginTop",!0),left:t.left-i.left-ce.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===ce.css(e,"position"))e=e.offsetParent;return e||J})}}),ce.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;ce.fn[t]=function(e){return
vendor: 2,807 bytes, lines 12-19
12M(this,function(e,t,n){var r;if(y(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),ce.each(["top","left"],function(e,n){ce.cssHooks[n]=Ye(le.pixelPosition,function(e,t){if(t)return t=Ge(e,n),_e.test(t)?ce(e).position()[n]+"px":t})}),ce.each({Height:"height",Width:"width"},function(a,s){ce.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){ce.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return M(this,function(e,t,n){var r;return y(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?ce.css(e,t,i):ce.style(e,t,n,i)},s,n?e:void 0,n)}})}),ce.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){ce.fn[t]=function(e){return this.on(t,e)}}),ce.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.on("mouseenter",e).on("mouseleave",t||e)}}),ce.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){ce.fn[n]=function(e,t){return 0<arguments.length?this.on(n,null,e,t):this.trigger(n)}});var en=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;ce.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),v(e))return r=ae.call(arguments,2),(i=function(){return e.apply(t||this,r.concat(ae.call(arguments)))}).guid=e.guid=e.guid||ce.guid++,i},ce.holdReady=function(e){e?ce.readyWait++:ce.ready(!0)},ce.isArray=Array.isArray,ce.parseJSON=JSON.parse,ce.nodeName=fe,ce.isFunction=v,ce.isWindow=y,ce.camelCase=F,ce.type=x,ce.now=Date.now,ce.isNumeric=function(e){var t=ce.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},ce.trim=function(e){return null==e?"":(e+"").replace(en,"$1")},"function"==typeof define&&define.amd&&define("jquery",[],function(){return ce});var tn=ie.jQuery,nn=ie.$;return ce.noConflict=function(e){return ie.$===ce&&(ie.$=nn),e&&ie.jQuery===ce&&(ie.jQuery=tn),ce},"undefined"==typeof e&&(ie.jQuery=ie.$=ce),ce}); 13 14var $=jQuery.noConflict(); 15 16/** 17* @copyright (C) 2021 Open Source Matters, Inc. <https://www.joomla.org> 18* @license GNU General Public License version 2 or later; see LICENSE.txt 19*/if(!window.Joomla)throw new Error("Joomla API was not properly initialised");
19const initScheduler=()=>{const t=Joomla.getOptions("plg_system_schedulerunner"),o=Joomla.getOptions("system.paths"),n=(t&&t.interval?parseInt(t.interval,10):300)*1e3,e=`${o?`${o.root}/index.php`:window.location.pathname}?option=com_ajax&format=raw&plugin=RunSchedulerLazy&group=system`;setInterval(()=>fetch(e,{method:"GET"}),n),fetch(e,{method:"GET"})};(t=>{t.addEventListener("DOMContentLoaded",initScheduler)})(document); 20 21try { 22jQuery.event.special.touchstart={ 23setup: function( _, ns, handle ){ 24this.addEventListener("touchstart", handle, { passive: !ns.includes("noPreventDefault") }); 25} 26}; 27jQuery.event.special.touchmove={ 28setup: function( _, ns, handle ){ 29this.addEventListener("touchmove", handle, { passive: !ns.includes("noPreventDefault") }); 30} 31}; 32jQuery.event.special.scroll={ 33setup: function( _, ns, handle ){ 34this.addEventListener("scroll", handle, { passive: true }); 35} 36}; 37jQuery.event.special.wheel={ 38setup: function( _, ns, handle ){ 39this.addEventListener("wheel", handle, { passive: true }); 40} 41}; 42jQuery.event.special.mousewheel={ 43setup: function( _, ns, handle ){ 44this.addEventListener("mousewheel", handle, { passive: true }); 45} 46}; 47} catch (e){ 48console.info(e) 49} 50document.addEventListener('DOMContentLoaded', function(){ 51jQuery(document).off('click.bs.tab.data-api click.bs.modal.data-api click.bs.collapse.data-api click.dropdown.data-api'); 52!function ($){ 53"use strict"; 54var toggle='[data-toggle=dropdown]', 55Dropdown=function(element){ 56var $el=$(element).on('click.dropdown.data-api', this.toggle) 57.on('mouseover.dropdown.data-api', this.toggle) 58$('html').on('click.dropdown.data-api', function (){ 59$el.parent().parent().removeClass('nav-hover') 60$el.parent().removeClass('open'); 61}); 62} 63Dropdown.prototype={ 64constructor: Dropdown, 65toggle: function(e){ 66var $this=$(this), 67$parent, isActive, url, isHover; 68if ($this.is('.disabled, :disabled')) return; 69$parent=getParent($this); 70isActive=$parent.hasClass('open'); 71isHover=$parent.parent().hasClass('nav-hover'); 72if (!isHover&&e.type=='mouseover') return; 73url=$this.attr('href'); 74if (e.type=='click'&&(url)&&(url !=='#')){ 75window.location=url; 76return; 77} 78clearMenus() 79if ((!isActive&&e.type !='mouseover') || (isHover&&e.type=='mouseover')){ 80if ('ontouchstart' in document.documentElement){ 81$('<div class="dropdown-backdrop"/>').insertBefore($(this)).on('click', clearMenus); 82$this.on('hover', function (){ 83$('.dropdown-backdrop').remove() 84}); 85} 86$parent.parent().toggleClass('nav-hover'); 87$parent.toggleClass('open') 88} 89$this.focus() 90return false 91}, 92keydown: function (e){ 93var $this, $items, $active, $parent, isActive, index; 94if (!/(38|40|27)/.test(e.keyCode)) return 95$this=$(this); 96e.preventDefault() 97e.stopPropagation() 98if ($this.is('.disabled, :disabled')) return 99$parent=getParent($this) 100isActive=$parent.hasClass('open') 101if (!isActive || (isActive&&e.keyCode==27)){ 102if (e.which==27) $parent.find(toggle).focus() 103return $this.click() 104} 105$items=$('[role=menu] li:not(.divider):visible a', $parent) 106if (!$items.length) return 107index=$items.index($items.filter(':focus')) 108if (e.keyCode==38&&index > 0) index-- 109if (e.keyCode==40&&index < $items.length - 1) index++ 110if (!~index) index=0 111$items.eq(index).focus(); 112} 113} 114function clearMenus(){ 115$(toggle).parent().parent().removeClass('nav-hover') 116$('.dropdown-backdrop').remove() 117$(toggle).each(function (){ 118getParent($(this)).removeClass('open') 119}) 120} 121function getParent($this){ 122var selector=$this.attr('data-target'), 123$parent; 124if (!selector){ 125selector=$this.attr('href') 126selector=selector&&/#/.test(selector)&&selector.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 127} 128selector=selector==='#' ? [] : selector; 129$parent=selector&&$(document).find(selector) 130if (!$parent || !$parent.length) $parent=$this.parent() 131return $parent 132} 133var old=$.fn.dropdown 134$.fn.dropdown=function (option){ 135return this.each(function (){ 136var $this=$(this), 137data=$this.data('dropdown'); 138if (!data) $this.data('dropdown', (data=new Dropdown(this))) 139if (typeof option=='string') data[option].call($this) 140}); 141} 142$.fn.dropdown.Constructor=Dropdown 143$.fn.dropdown.noConflict=function (){ 144$.fn.dropdown=old 145return this 146} 147$(document) 148.on('click.dropdown.data-api', clearMenus) 149.on('click.dropdown.data-api', '.dropdown form', function (e){ e.stopPropagation() }) 150.on('click.dropdown.data-api' , toggle, Dropdown.prototype.toggle) 151.on('keydown.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown) 152.on('mouseover.dropdown.data-api', toggle, Dropdown.prototype.toggle) 153}(window.$g ? window.$g : window.jQuery); 154!function ($){ 155"use strict"; 156var dismiss='[data-dismiss="alert"]', 157Alert=function(el){ 158$(el).on('click', dismiss, this.close) 159} 160Alert.prototype.close=function(e){ 161var $this=$(this), 162selector=$this.attr('data-target'), 163$parent; 164if (!selector){ 165selector=$this.attr('href') 166selector=selector==='#' ? '' : selector 167} 168$parent=$(document).find(selector); 169e&&e.preventDefault() 170$parent.length || ($parent=$this.hasClass('alert') ? $this : $this.parent()) 171$parent.trigger(e=$.Event('close')) 172if (e.isDefaultPrevented()) return 173$parent.removeClass('in') 174function removeElement(){ 175$parent.trigger('closed').remove() 176} 177$.support.transition&&$parent.hasClass('fade') ? 178$parent.on($.support.transition.end, removeElement) : removeElement() 179} 180var old=$.fn.alert 181$.fn.alert=function (option){ 182return this.each(function (){ 183var $this=$(this), 184data=$this.data('alert');
185if (!data) $this.data('alert', (data=new Alert(this))) 186if (typeof option=='string') data[option].call($this) 187}); 188} 189$.fn.alert.Constructor=Alert; 190$.fn.alert.noConflict=function(){ 191$.fn.alert=old; 192return this 193} 194$(document).on('click.alert.data-api', dismiss, Alert.prototype.close); 195}(window.$g ? window.$g : window.jQuery); 196!function ($){ 197"use strict"; 198$(function(){ 199$.support.transition=(function(){ 200var transitionEnd=(function(){ 201var el=document.createElement('bootstrap'), 202transEndEventNames={ 203'WebkitTransition' : 'webkitTransitionEnd', 204'MozTransition' : 'transitionend', 205'OTransition' : 'oTransitionEnd otransitionend', 206'transition' : 'transitionend' 207}, 208name 209for (name in transEndEventNames){ 210if (el.style[name] !==undefined){ 211return transEndEventNames[name] 212} 213} 214}()) 215return transitionEnd&&{ 216end: transitionEnd 217} 218})() 219}) 220}(window.$g ? window.$g : window.jQuery); 221!function ($){ 222"use strict"; 223var Tab=function(element){ 224this.element=$(element); 225} 226Tab.prototype={ 227constructor: Tab, 228show: function(){ 229var $this=this.element, 230$ul=$this.closest('ul:not(.dropdown-menu)'), 231selector=$this.attr('data-target'), 232previous, $target, e; 233if (!selector){ 234selector=$this.attr('href'); 235} 236if ($this.parent('li').hasClass('active')) return; 237previous=$ul.find('.active:last a')[0]; 238e=$.Event('show', { 239relatedTarget: previous 240}); 241$this.trigger(e); 242if (e.isDefaultPrevented()) return; 243$target=$(selector); 244this.activate($this.parent('li'), $ul); 245this.activate($target, $target.parent(), function(){ 246$this.trigger({ 247type: 'shown', 248relatedTarget: previous 249}); 250}); 251}, 252activate: function(element, container, callback){ 253var $active=container.find('> .active'), 254transition=callback&&$.support.transition&&$active.hasClass('fade'); 255function next(){ 256$active.removeClass('active').find('> .dropdown-menu > .active').removeClass('active'); 257element.addClass('active') 258if (transition){ 259element[0].offsetWidth; 260element.addClass('in'); 261} else { 262element.removeClass('fade'); 263} 264if (element.parent('.dropdown-menu')){ 265element.closest('li.dropdown').addClass('active'); 266} 267callback&&callback(); 268} 269transition ? $active.one($.support.transition.end, next) : next(); 270$active.removeClass('in'); 271} 272} 273var old=$.fn.tab; 274$.fn.tab=function(option){ 275return this.each(function(){ 276var $this=$(this), 277data=$this.data('tab'); 278if (!data) $this.data('tab', (data=new Tab(this))); 279if (typeof option=='string') data[option](); 280}); 281} 282$.fn.tab.Constructor=Tab; 283$.fn.tab.noConflict=function(){ 284$.fn.tab=old; 285return this; 286} 287$(document).off('click.tab.data-api').on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function(e){ 288e.preventDefault(); 289$(this).tab('show'); 290}); 291}(window.$g ? window.$g : window.jQuery); 292!function ($){ 293"use strict"; 294var Modal=function(element, options){ 295this.options=options; 296this.$element=$(element).delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this)); 297this.options.remote&&this.$element.find('.modal-body').load(this.options.remote); 298} 299Modal.prototype={ 300constructor: Modal, 301toggle: function(){ 302return this[!this.isShown ? 'show' : 'hide'](); 303}, 304show: function(){ 305var that=this, 306e=$.Event('show'); 307this.$element.trigger(e); 308if (this.isShown || e.isDefaultPrevented()) return; 309this.$element.trigger('show-gridbox-modal'); 310this.isShown=true; 311this.escape(); 312this.backdrop(function(){ 313var transition=$.support.transition&&that.$element.hasClass('fade'); 314if (!that.$element.parent().length){ 315that.$element.appendTo(document.body); 316} 317that.$element.show(); 318if (transition){ 319that.$element[0].offsetWidth; 320} 321that.$element.addClass('in').attr('aria-hidden', false); 322transition ? 323that.$element.one($.support.transition.end, function(){that.$element.focus().trigger('shown')}) : 324that.$element.focus().trigger('shown'); 325}); 326}, 327hide: function(e){ 328e&&e.preventDefault(); 329var that=this; 330e=$.Event('hide'); 331this.$element.trigger(e); 332if (!this.isShown || e.isDefaultPrevented()) return; 333this.isShown=false; 334this.escape(); 335this.$element.removeClass('in').attr('aria-hidden', true); 336$.support.transition&&this.$element.hasClass('fade') ? this.hideWithTransition() : this.hideModal(); 337}, 338escape: function(){ 339var that=this; 340if (this.isShown&&this.options.keyboard){ 341this.$element.on('keyup.dismiss.modal', function(e){ 342e.which==27&&that.hide(); 343}); 344} else if (!this.isShown){ 345this.$element.off('keyup.dismiss.modal'); 346} 347}, 348hideWithTransition: function(){ 349var that=this, 350timeout=setTimeout(function(){ 351that.$element.off($.support.transition.end); 352that.hideModal(); 353}, 500); 354this.$element.one($.support.transition.end, function(){ 355clearTimeout(timeout); 356that.hideModal(); 357}); 358}, 359hideModal: function(){ 360var that=this; 361this.$element.hide(); 362this.backdrop(function(){ 363that.removeBackdrop(); 364that.$element.trigger('hidden'); 365that.$element.trigger('hidden-gridbox-modal'); 366}); 367}, 368removeBackdrop: function(){ 369if (!this.outBackdrop){ 370return; 371} 372this.outBackdrop.remove(); 373this.outBackdrop=null; 374}, 375backdrop: function(callback){ 376var that=this, 377animate=this.$element.hasClass('fade') ? 'fade' : ''; 378if (this.$backdrop){ 379this.outBackdrop=this.$backdrop; 380this.$backdrop=null; 381} 382if (this.isShown&&this.options.backdrop){ 383var doAnimate=$.support.transition&&animate; 384this.$backdrop=$('<div class="modal-backdrop '+animate+'" />').appendTo(document.body); 385this.$backdrop.click(this.options.backdrop=='static' ? 386$.proxy(this.$element[0].focus, this.$element[0]) : $.proxy(this.hide, this)); 387if (doAnimate) this.$backdrop[0].offsetWidth; 388this.$backdrop.addClass('in'); 389if (!callback) return; 390doAnimate ? this.$backdrop.one($.support.transition.end, callback) : callback(); 391} else if (!this.isShown&&this.outBackdrop){ 392this.outBackdrop.removeClass('in'); 393$.support.transition&&this.$element.hasClass('fade') ? 394this.outBackdrop.one($.support.transition.end, callback) : setTimeout(callback, 300); 395} else if (callback){ 396callback(); 397} 398} 399} 400var old=$.fn.modal; 401$.fn.modal=function(option){ 402return this.each(function(){ 403var $this=$(this), 404data=$this.data('modal'), 405options=$.extend({}, $.fn.modal.defaults, $this.data(), typeof option=='object'&&option); 406if (!data){ 407$this.data('modal', (data=new Modal(this, options))) 408} 409if (typeof option=='string'){ 410data[option](); 411} else if (options.show){ 412data.show(); 413} 414}); 415} 416$.fn.modal.defaults={ 417backdrop: true, 418keyboard: true, 419show: true 420} 421$.fn.modal.Constructor=Modal;
422$.fn.modal.noConflict=function(){ 423$.fn.modal=old; 424return this; 425} 426$(document).off('click.modal.data-api').on('click.modal.data-api', '[data-toggle="modal"]', function(e){ 427var $this=$(this), 428href=$this.attr('href'), 429$target=$($this.attr('data-target') || (href&&href.replace(/.*(?=#[^\s]+$)/, ''))), //strip for ie7 430option=$target.data('modal') ? 'toggle' : $.extend({ remote:!/#/.test(href)&&href }, $target.data(), $this.data()); 431e.preventDefault(); 432$target.modal(option).one('hide', function(){ 433$this.focus(); 434}); 435}); 436}(window.$g ? window.$g : window.jQuery); 437!function ($){ 438"use strict"; 439var Collapse=function(element, options){ 440this.$element=$(element); 441this.options=$.extend({}, $.fn.collapse.defaults, options); 442if (this.options.parent){ 443this.$parent=$(this.options.parent); 444} 445this.options.toggle&&this.toggle(); 446} 447Collapse.prototype={ 448constructor: Collapse, 449dimension: function(){ 450var hasWidth=this.$element.hasClass('width'); 451return hasWidth ? 'width' : 'height'; 452}, 453show: function(){ 454var dimension, scroll, actives, hasData; 455if (this.transitioning || this.$element.hasClass('in')) return; 456dimension=this.dimension(); 457scroll=$.camelCase(['scroll', dimension].join('-')); 458actives=this.$parent&&this.$parent.find('> .accordion-group > .in'); 459if (actives&&actives.length){ 460hasData=actives.data('collapse'); 461if (hasData&&hasData.transitioning) return; 462actives.collapse('hide'); 463hasData || actives.data('collapse', null); 464} 465this.$element[dimension](0); 466this.transition('addClass', $.Event('show'), 'shown'); 467$.support.transition&&this.$element[dimension](this.$element[0][scroll]); 468}, 469hide: function(){ 470var dimension; 471if (this.transitioning || !this.$element.hasClass('in')) return; 472dimension=this.dimension(); 473this.reset(this.$element[dimension]()); 474this.transition('removeClass', $.Event('hide'), 'hidden'); 475this.$element[dimension](0); 476}, 477reset: function(size){ 478var dimension=this.dimension(); 479this.$element.removeClass('collapse')[dimension](size || 'auto')[0].offsetWidth; 480this.$element[size !==null ? 'addClass' : 'removeClass']('collapse'); 481return this; 482}, 483transition: function(method, startEvent, completeEvent){ 484var that=this, 485complete=function(){ 486if (startEvent.type=='show') that.reset(); 487that.transitioning=0; 488that.$element.trigger(completeEvent); 489}; 490this.$element.trigger(startEvent); 491if (startEvent.isDefaultPrevented()) return; 492this.transitioning=1; 493this.$element[method]('in'); 494$.support.transition&&this.$element.hasClass('collapse') ? this.$element.one($.support.transition.end, complete) : complete(); 495}, 496toggle: function(){ 497this[this.$element.hasClass('in') ? 'hide' : 'show'](); 498} 499} 500var old=$.fn.collapse; 501$.fn.collapse=function(option){ 502return this.each(function(){ 503var $this=$(this), 504data=$this.data('collapse'), 505options=$.extend({}, $.fn.collapse.defaults, $this.data(), typeof option=='object'&&option); 506if (!data) $this.data('collapse', (data=new Collapse(this, options))); 507if (typeof option=='string') data[option](); 508}); 509} 510$.fn.collapse.defaults={ 511toggle: true 512} 513$.fn.collapse.Constructor=Collapse; 514$.fn.collapse.noConflict=function(){ 515$.fn.collapse=old; 516return this; 517} 518$(document).off('click.collapse.data-api').on('click.collapse.data-api', '[data-toggle=collapse]', function(e){ 519var $this=$(this), href, 520target=$this.attr('data-target') || e.preventDefault() || (href=$this.attr('href')), 521option=$(target).data('collapse') ? 'toggle' : $this.data(); 522$this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed'); 523$(target).collapse(option); 524}); 525}(window.$g ? window.$g : window.jQuery); 526!function ($){ 527"use strict"; 528var Tooltip=function (element, options){ 529this.init('tooltip', element, options); 530} 531Tooltip.prototype={ 532constructor: Tooltip, 533init: function (type, element, options){ 534var eventIn, eventOut, triggers, trigger, i; 535this.type=type; 536this.$element=$(element); 537this.options=this.getOptions(options); 538this.enabled=true; 539triggers=this.options.trigger.split(' '); 540for (i=triggers.length; i--;){ 541trigger=triggers[i]; 542if (trigger=='click'){ 543this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this)); 544} else if (trigger !='manual'){ 545eventIn=trigger=='hover' ? 'mouseenter' : 'focus'; 546eventOut=trigger=='hover' ? 'mouseleave' : 'blur'; 547this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this)); 548this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this)); 549} 550} 551this.options.selector ? 552(this._options=$.extend({}, this.options, { trigger: 'manual', selector: '' })) : this.fixTitle() 553}, 554getOptions: function (options){ 555options=$.extend({}, $.fn[this.type].defaults, this.$element.data(), options); 556if (options.delay&&typeof options.delay=='number'){ 557options.delay={ 558show: options.delay, 559hide: options.delay 560} 561} 562return options 563}, 564enter: function (e){ 565var defaults=$.fn[this.type].defaults, 566options={}, self; 567this._options&&$.each(this._options, function (key, value){ 568if (defaults[key] !=value) options[key]=value; 569}, this); 570self=$(e.currentTarget)[this.type](options).data(this.type) 571if (!self.options.delay || !self.options.delay.show) return self.show(); 572clearTimeout(this.timeout) 573self.hoverState='in' 574this.timeout=setTimeout(function(){ 575if (self.hoverState=='in') self.show() 576}, self.options.delay.show) 577}, 578leave: function (e){ 579var self=$(e.currentTarget)[this.type](this._options).data(this.type) 580if (this.timeout) clearTimeout(this.timeout) 581if (!self.options.delay || !self.options.delay.hide) return self.hide() 582self.hoverState='out' 583this.timeout=setTimeout(function(){ 584if (self.hoverState=='out') self.hide() 585}, self.options.delay.hide) 586}, 587show: function (){ 588var $tip, pos, actualWidth, actualHeight, placement, tp, e=$.Event('show'); 589if (this.hasContent()&&this.enabled){ 590this.$element.trigger(e) 591if (e.isDefaultPrevented()) return 592$tip=this.tip() 593this.setContent() 594if (this.options.animation){ 595$tip.addClass('fade') 596} 597placement=typeof this.options.placement=='function' ? 598this.options.placement.call(this, $tip[0], this.$element[0]) : this.options.placement; 599$tip.detach().css({ top: 0, left: 0, display: 'block' }); 600this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element) 601pos=this.getPosition() 602actualWidth=$tip[0].offsetWidth 603actualHeight=$tip[0].offsetHeight 604switch (placement){ 605case 'bottom': 606tp={top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2} 607break 608case 'top': 609tp={top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2} 610break 611case 'left': 612tp={top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth} 613break 614case 'right': 615tp={top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width} 616break 617} 618this.applyPlacement(tp, placement) 619this.$element.trigger('shown') 620} 621}, 622applyPlacement: function(offset, placement){ 623var $tip=this.tip(), 624width=$tip[0].offsetWidth, 625height=$tip[0].offsetHeight, 626actualWidth, actualHeight, delta, replace; 627$tip.offset(offset).addClass(placement).addClass('in'); 628actualWidth=$tip[0].offsetWidth 629actualHeight=$tip[0].offsetHeight 630if (placement=='top'&&actualHeight !=height){ 631offset.top=offset.top + height - actualHeight 632replace=true 633} 634if (placement=='bottom' || placement=='top'){ 635delta=0 636if (offset.left < 0){ 637delta=offset.left * -2 638offset.left=0 639$tip.offset(offset) 640actualWidth=$tip[0].offsetWidth 641actualHeight=$tip[0].offsetHeight 642} 643this.replaceArrow(delta - width + actualWidth, actualWidth, 'left') 644} else { 645this.replaceArrow(actualHeight - height, actualHeight, 'top') 646} 647if (replace) $tip.offset(offset) 648}, 649replaceArrow: function(delta, dimension, position){ 650this.arrow().css(position, delta ? (50 * (1 - delta / dimension) + "%") : ''); 651}, 652setContent: function (){ 653var $tip=this.tip(), 654title=this.getTitle(); 655$tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title) 656$tip.removeClass('fade in top bottom left right') 657}, 658hide: function (){ 659var that=this, 660$tip=this.tip(), 661e=$.Event('hideme'); 662this.$element.trigger(e) 663if (e.isDefaultPrevented()) return 664$tip.removeClass('in') 665function removeWithAnimation(){ 666var timeout=setTimeout(function (){
667$tip.off($.support.transition.end).detach() 668}, 500); 669$tip.one($.support.transition.end, function (){ 670clearTimeout(timeout) 671$tip.detach() 672}) 673} 674$.support.transition&&this.$tip.hasClass('fade') ? removeWithAnimation() : $tip.detach(); 675this.$element.trigger('hidden') 676return this 677}, 678fixTitle: function (){ 679var $e=this.$element 680if ($e.attr('title') || typeof($e.attr('data-original-title')) !='string'){ 681$e.attr('data-original-title', $e.attr('title') || '').attr('title', '') 682} 683}, 684hasContent: function (){ 685return this.getTitle() 686}, 687getPosition: function (){ 688var el=this.$element[0] 689return $.extend({}, (typeof el.getBoundingClientRect=='function') ? el.getBoundingClientRect() : { 690width: el.offsetWidth, 691height: el.offsetHeight 692}, this.$element.offset()) 693}, 694getTitle: function (){ 695var title, 696$e=this.$element, 697o=this.options 698title=$e.attr('data-original-title') || (typeof o.title=='function' ? o.title.call($e[0]) : o.title) 699return title 700}, 701tip: function (){ 702return this.$tip=this.$tip || $(this.options.template) 703}, 704arrow: function(){ 705return this.$arrow=this.$arrow || this.tip().find(".tooltip-arrow") 706}, 707validate: function (){ 708if (!this.$element[0].parentNode){ 709this.hide() 710this.$element=null 711this.options=null 712} 713}, 714enable: function (){ 715this.enabled=true 716}, 717disable: function (){ 718this.enabled=false 719}, 720toggleEnabled: function (){ 721this.enabled=!this.enabled 722}, 723toggle: function (e){ 724var self=e ? $(e.currentTarget)[this.type](this._options).data(this.type) : this 725self.tip().hasClass('in') ? self.hide() : self.show() 726}, 727destroy: function (){ 728this.hide().$element.off('.' + this.type).removeData(this.type) 729} 730} 731var old=$.fn.tooltip 732$.fn.tooltip=function(option){ 733return this.each(function(){ 734var $this=$(this), 735data=$this.data('tooltip'), 736options=typeof option=='object'&&option; 737if (!data) $this.data('tooltip', (data=new Tooltip(this, options))) 738if (typeof option=='string') data[option]() 739}); 740} 741$.fn.tooltip.Constructor=Tooltip 742$.fn.tooltip.defaults={ 743animation: true, 744placement: 'top', 745selector: false, 746template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>', 747trigger: 'hover focus', 748title: '', 749delay: 0, 750html: true, 751container: false 752} 753$.fn.tooltip.noConflict=function(){ 754$.fn.tooltip=old 755return this 756} 757}(window.$g ? window.$g : window.jQuery); 758}); 759class ImportHelper { 760static dir='components/com_gridbox/assets/modules/'; 761static getPath(source){ 762return `${JUri}${source}${this.dir}`; 763} 764static resolve(filename, source='administrator/'){ 765return new Promise(resolve=> { 766const path=this.getPath(source); 767import((`${path}${filename}.js`)).then((module)=> { 768resolve(module.default); 769}); 770}); 771} 772} 773/** 774* @package Gridbox template 775* @author Balbooa http://www.balbooa.com/ 776* @copyright Copyright @ Balbooa 777* @license http://www.gnu.org/licenses/gpl.html GNU/GPL 778*/ 779class GridboxCaptcha { 780static captcha=null; 781static loaded=false; 782static type=''; 783static queue=[]; 784static data={}; 785static setCaptcha(captcha){ 786this.captcha=captcha; 787this.loaded=true; 788this.init(); 789} 790static check(id){ 791return app.items[id]&&app.items[id].recaptcha==this.type; 792} 793static init(){ 794this.queue.forEach(element=> { 795this.create(element); 796}); 797} 798static create(element){ 799if (element.rendered){ 800return; 801} 802this.set(element); 803} 804static set(element){ 805const div=document.createElement('div'); 806div.id=`gridbox-recaptcha-${Date.now()}`; 807div.className='gridbox-recaptcha'; 808div.dataset.captcha=this.type; 809element.append(div); 810this.render(div); 811element.rendered=true; 812} 813static render(div){ 814throw new Error('Implement method render in child class') 815} 816static getSetting(key){ 817return window.gridboxCaptchaSettings[key] ?? ''; 818} 819static async getResponse(id, element){ 820return ''; 821} 822static reset(id){ 823} 824} 825class GridboxGoogleRecaptcha extends GridboxCaptcha { 826static type='recaptcha'; 827static async getResponse(id, element){ 828const token=await this.captcha.execute(this.getSetting('public_key'), { 829action: 'submit' 830}); 831element.innerHTML=`<input type="hidden" name="g-recaptcha-response" value="${token}">`; 832return token; 833} 834static render(div){ 835GridboxCaptcha.data[div.id]=this.captcha.render(div, {
836sitekey: this.getSetting('public_key'), 837theme: this.getSetting('theme'), 838size: this.getSetting('size'), 839callback: GridboxCaptchaHelper.clearAlerts 840}); 841} 842} 843class GridboxInvisibleRecaptcha extends GridboxGoogleRecaptcha { 844static type='recaptcha_invisible'; 845static render(div){ 846GridboxCaptcha.data[div.id]=this.captcha.render(div, { 847sitekey: this.getSetting('public_key'), 848badge: this.getSetting('badge'), 849size: 'invisible', 850callback: GridboxCaptchaHelper.clearAlerts 851}); 852this.captcha.execute(GridboxCaptcha.data[div.id]); 853} 854} 855class GridboxTurnstileCaptcha extends GridboxCaptcha { 856static type='turnstile'; 857static async getResponse(id, element){ 858return !this.captcha.isExpired(id) ? this.captcha.getResponse(id) : ''; 859} 860static render(div){ 861GridboxCaptcha.data[div.id]=this.captcha.render(div, { 862sitekey: this.getSetting('site_key'), 863theme: this.getSetting('theme'), 864size: this.getSetting('size'), 865callback: GridboxCaptchaHelper.clearAlerts 866}); 867} 868static reset(id){ 869const widgetId=GridboxCaptcha.data[id]; 870this.captcha.reset(widgetId); 871} 872} 873class GridboxCaptchaFactory { 874/** @type {Object<string, typeof GridboxCaptcha>} */ 875static map={ 876turnstile: GridboxTurnstileCaptcha, 877recaptcha: GridboxGoogleRecaptcha, 878recaptcha_invisible: GridboxInvisibleRecaptcha 879} 880/** @param {string} key */ 881static has(key){ 882return key in this.map; 883} 884/** 885* @param {string} key 886* @returns {typeof GridboxCaptcha} 887*/ 888static get(key){ 889return this.map[key]; 890} 891} 892class GridboxCaptchaHelper { 893static factory=GridboxCaptchaFactory; 894static getIfExist(element){ 895const captcha=element.dataset.type; 896if (!this.factory.has(captcha)){ 897return null; 898} 899return this.factory.get(captcha) 900} 901static createIfExist(element){ 902const captcha=this.getIfExist(element); 903if (!captcha){ 904return; 905} 906if (!captcha.loaded){ 907captcha.queue.push(element); 908return; 909} 910captcha.create(element); 911} 912static async #isValidResponse(element){ 913if (!this.factory.has(element.dataset.captcha)){ 914return false; 915} 916const widgetId=GridboxCaptcha.data[element.id]; 917const captcha=this.factory.get(element.dataset.captcha); 918const response=await captcha.getResponse(widgetId, element); 919return response !=''; 920} 921static async checkResponse(element){ 922if (!element){ 923return true; 924} 925const recaptcha=element.querySelector('.gridbox-recaptcha'); 926if (!recaptcha){ 927return false; 928} 929return await this.#isValidResponse(recaptcha); 930} 931static clearAlerts(){ 932const instance='login' in app ? app.login : app.checkoutForm; 933if (!instance){ 934return; 935} 936document.querySelectorAll('.gridbox-recaptcha').forEach(element=> { 937instance.removeAlertTooltip(element); 938}); 939} 940static setCaptcha(type, captcha){ 941const instance=GridboxCaptchaHelper.factory.get(type); 942instance.setCaptcha(captcha); 943instance.loaded=true; 944} 945} 946function gridboxTurnstileOnload(){ 947GridboxCaptchaHelper.setCaptcha('turnstile', turnstile); 948} 949function gridboxRecaptchaOnload(){ 950GridboxCaptchaHelper.setCaptcha('recaptcha', grecaptcha); 951} 952function gridboxInvisibleRecaptchaOnload(){ 953GridboxCaptchaHelper.setCaptcha('recaptcha_invisible', grecaptcha); 954} 955if (window.integrations&&window.integrations.facebook){ 956window.fbAsyncInit=()=> { 957app.facebook.initialize(); 958} 959} 960var $g=jQuery, 961delay='', 962itemsInit=[], 963app={ 964hash: window.location.hash, 965view : 'desktop', 966modules : {}, 967loading : {}, 968edit : {}, 969items : {}, 970isExternal: function(link){ 971return link.indexOf('https://') !=-1 || link.indexOf('http://') !=-1; 972}, 973facebook: { 974load: ()=> { 975app.loading.facebook=true; 976let js=document.createElement('script'); 977if (document.getElementById('facebook-jssdk')) return; 978js.id='facebook-jssdk'; 979js.src="https://connect.facebook.net/en_US/sdk.js"; 980js.crossorigin='anonymous'; 981document.head.append(js); 982}, 983initialize: ()=> { 984FB.init({ 985appId : window.integrations.facebook, 986autoLogAppEvents : true, 987xfbml : true, 988version : 'v25.0' 989}); 990}, 991getUserInfo: (response)=> { 992return new Promise((resolve, reject)=> { 993if (response.status==='connected'){ 994FB.api('/'+response.authResponse.userID+'/?fields=id,name,email,picture', 'GET', {}, (fields)=> { 995let data={ 996name: fields.name, 997email: fields.email, 998avatar: fields.picture.data.url, 999id: fields.id 1000} 1001resolve(data); 1002}); 1003} 1004}); 1005} 1006}, 1007google: { 1008load: (callback, selector, options)=> { 1009let js=document.createElement('script'); 1010js.src='https://accounts.google.com/gsi/client' 1011js.onload=()=> { 1012app.google.initialize(callback, selector, options); 1013} 1014document.head.append(js); 1015}, 1016initialize: (callback, selector, options)=> { 1017google.accounts.id.initialize({ 1018client_id: window.integrations.google, 1019callback: callback 1020}); 1021setTimeout(()=> { 1022document.querySelectorAll(selector).forEach((parent)=> { 1023google.accounts.id.renderButton(parent, options); 1024}); 1025}, 1000); 1026}, 1027renderButton: (selector, options)=> { 1028document.querySelectorAll(selector).forEach((parent)=> { 1029google.accounts.id.renderButton(parent, options); 1030}); 1031}, 1032JSONWebToken: (token)=> { 1033let url=token.split('.')[1], 1034base=url.replace(/-/g, '+').replace(/_/g, '/'), 1035json=decodeURIComponent(window.atob(base).split('').map(function(c){
1036return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2); 1037}).join('')); 1038return JSON.parse(json); 1039}, 1040getUserInfo: function(profile){ 1041let data={ 1042name: profile.name, 1043email: profile.email, 1044avatar: profile.picture, 1045id: profile.sub 1046} 1047return data; 1048} 1049}, 1050decimalAdjust: function(type, value, exp){ 1051if (typeof exp==='undefined' || +exp===0){ 1052return Math[type](value); 1053} 1054value=+value; 1055exp=+exp; 1056if (isNaN(value) || !(typeof exp==='number'&&exp % 1===0)){ 1057return NaN; 1058} 1059value=value.toString().split('e'); 1060value=Math[type](+(value[0] + 'e' + (value[1] ? (+value[1] - exp) : -exp))); 1061value=value.toString().split('e'); 1062return +(value[0]+'e'+(value[1] ? (+value[1] + exp) : exp)); 1063}, 1064strrev: function(string){ 1065let ret='', i=0; 1066for (i=string.length - 1; i >=0; i--){ 1067ret +=string[i]; 1068} 1069return ret; 1070}, 1071renderPrice: function(value, thousand, separator, decimals, rate){ 1072rate=!rate ? 1 : rate; 1073value *=rate; 1074value=app.decimalAdjust('round', value, decimals * -1); 1075value=String(value); 1076let delta=value < 0 ? '-' : '', 1077priceArray=value.replace('-', '').trim().split('.'), 1078priceThousand=priceArray[0], 1079priceDecimal=priceArray[1] ? priceArray[1] : '', 1080price=''; 1081if (priceThousand.length > 3&&thousand !=''){ 1082for (let i=0; i < priceThousand.length; i++){ 1083if (i % 3==0&&i !=0){ 1084price +=thousand; 1085} 1086price +=priceThousand[priceThousand.length - 1 - i]; 1087} 1088price=app.strrev(price); 1089} else { 1090price +=priceThousand; 1091} 1092if (decimals !=0){ 1093price +=separator; 1094for (let i=0; i < decimals; i++){ 1095price +=priceDecimal[i] ? priceDecimal[i] : '0'; 1096} 1097} 1098return delta+price; 1099}, 1100getObject: function(key){ 1101var object=$g.extend(true, {}, app.items[key].desktop); 1102if (app.view !='desktop'){ 1103for (var ind in breakpoints){ 1104if (!app.items[key][ind]){ 1105app.items[key][ind]={}; 1106} 1107object=$g.extend(true, {}, object, app.items[key][ind]); 1108if (ind==app.view){ 1109break; 1110} 1111} 1112} 1113return object; 1114}, 1115hideNotice:function(){ 1116app.notification.classList.remove('notification-in'); 1117app.notification.classList.add('animation-out'); 1118}, 1119checkOverlay: function(obj, key){ 1120$g('.ba-item-overlay-section').each(function(){ 1121$g(this).find('.ba-overlay-section-backdrop').appendTo(document.body); 1122}); 1123}, 1124_: function(key){ 1125return gridboxLanguage[key] ?? key; 1126}, 1127checkGridboxPaymentError: function(){ 1128let gridbox_payment_error=localStorage.getItem('gridbox_payment_error'); 1129if (gridbox_payment_error){ 1130app.showNotice(gridbox_payment_error, 'ba-alert'); 1131localStorage.removeItem('gridbox_payment_error'); 1132} 1133}, 1134loadNotice: function(){ 1135return new Promise(function(resolve, reject){ 1136fetch(JUri+'components/com_gridbox/libraries/css/plugins/notification.css').then(function(request){ 1137return request.text(); 1138}).then(function(text){ 1139let style=document.createElement('style'); 1140document.head.append(style); 1141style.innerHTML=text; 1142app.notification=document.createElement('div'); 1143app.notification.id='ba-notification'; 1144app.notification.innerHTML='<i class="zmdi zmdi-close"></i><h4>'+app._('ERROR')+'</h4><p></p>'; 1145app.notification.querySelector('.zmdi-close').addEventListener('click', function(){ 1146app.hideNotice(); 1147}); 1148document.body.appendChild(app.notification); 1149resolve(); 1150}); 1151}); 1152}, 1153showNotice: function(message, className){ 1154if (!app.notification){ 1155app.loadNotice().then(()=> { 1156app.showNotice(message, className); 1157}); 1158return false; 1159} 1160app.notification.showCallback=function(){}; 1161if (!className){ 1162className=''; 1163} 1164if (app.notification.classList.contains('notification-in')){ 1165app.notification.showCallback=function(){ 1166app.notification.showCallback=function(){}; 1167app.addNoticeText(message, className); 1168}; 1169} else { 1170app.addNoticeText(message, className); 1171} 1172}, 1173addNoticeText: function(message, className){ 1174var time=3000; 1175if (className=='ba-alert'){ 1176time=6000; 1177} 1178app.notification.querySelector('p').innerHTML=message; 1179if (className){ 1180app.notification.classList.add(className); 1181} else { 1182app.notification.classList.remove('ba-alert'); 1183} 1184app.notification.classList.remove('animation-out') 1185app.notification.classList.add('notification-in'); 1186clearTimeout(app.notification.hideDelay); 1187app.notification.hideDelay=setTimeout(function(){ 1188app.hideNotice(); 1189setTimeout(function(){ 1190if (className){ 1191app.notification.classList.remove(className); 1192} 1193app.notification.showCallback(); 1194}, 400); 1195}, time); 1196}, 1197disabledAnimation: { 1198'sticky-header': true, 1199'lightbox': true 1200}, 1201checkAnimation: function(){ 1202app.viewportItems=[]; 1203app.motionItems=[]; 1204$g('.ba-section, .ba-row, .ba-grid-column').each(function(){ 1205if (!app.items[this.id]){ 1206return; 1207} 1208let object=$g.extend(true, {}, app.items[this.id].desktop.animation); 1209let motion=$g.extend(true, {}, app.items[this.id].desktop.motions ?? {}); 1210let inMotion=false; 1211const canAnimate=!app.disabledAnimation[app.items[this.id].type]; 1212const motions={ 1213desktop: motion 1214}; 1215if (app.view !='desktop'){ 1216for (let ind in breakpoints){ 1217if (!app.items[this.id][ind]){ 1218app.items[this.id][ind]={ 1219animation : {} 1220} 1221} 1222object=$g.extend(true, {}, object, app.items[this.id][ind].animation); 1223if (ind==app.view){ 1224break; 1225} 1226} 1227} 1228for (let ind in breakpoints){ 1229if (!app.items[this.id][ind]){ 1230app.items[this.id][ind]={ 1231animation : {} 1232} 1233} 1234motion=$g.extend(true, {}, motion, app.items[this.id][ind]?.motions ?? motion); 1235motions[ind]=motion; 1236} 1237if (object.effect&&canAnimate){ 1238app.viewportItems.push({ 1239animation: object, 1240item: $g(this) 1241}); 1242} else if (!object.effect&&canAnimate&&$g(this).viewportChecker){ 1243$g(this).viewportChecker(object) 1244} else if (object.effect){ 1245this.classList.add('visible'); 1246} 1247for (let ind in motions){ 1248for (let key in motions[ind]){ 1249if (motions[ind][key].enable){ 1250app.motionItems.push({ 1251motions: motions, 1252item: $g(this) 1253}); 1254inMotion=true; 1255break; 1256} 1257} 1258if (inMotion){ 1259break; 1260} 1261} 1262if ($g(this).motion&&!inMotion){ 1263$g(this).motion(motions); 1264} 1265}); 1266$g('.ba-item').each(function(){ 1267if (app.items[this.id]&&app.items[this.id].desktop&&app.items[this.id].desktop.appearance){ 1268let object=$g.extend(true, {}, app.items[this.id].desktop.appearance), 1269motion=app.items[this.id].desktop.motions ? $g.extend(true, {}, app.items[this.id].desktop.motions) : {}, 1270inMotion=false, 1271motions={ 1272desktop: motion 1273}; 1274if (app.view !='desktop'){ 1275for (let ind in breakpoints){ 1276if (!app.items[this.id][ind]){ 1277app.items[this.id][ind]={ 1278appearance : {} 1279}; 1280} 1281object=$g.extend(true, {}, object, app.items[this.id][ind].appearance); 1282if (ind==app.view){ 1283break; 1284} 1285} 1286} 1287for (let ind in breakpoints){ 1288motion=app.items[this.id][ind].motions ? $g.extend(true, {}, motion, app.items[this.id][ind].motions) : motion; 1289motions[ind]=motion; 1290} 1291if (object.effect){ 1292app.viewportItems.push({ 1293animation: object, 1294item: $g(this) 1295}); 1296} else if (!object.effect&&$g(this).viewportChecker){ 1297$g(this).viewportChecker(object) 1298} else if (object.effect){ 1299this.classList.add('visible'); 1300} 1301for (let ind in motions){ 1302for (let key in motions[ind]){ 1303if (motions[ind][key].enable){ 1304app.motionItems.push({ 1305motions: motions, 1306item: $g(this) 1307}); 1308inMotion=true; 1309break; 1310} 1311} 1312if (inMotion){ 1313break; 1314} 1315} 1316if ($g(this).motion&&!inMotion){ 1317$g(this).motion(motions); 1318} 1319} 1320}); 1321if (app.viewportItems.length > 0 || app.motionItems.length > 0){ 1322app.checkModule('loadAnimations'); 1323} 1324}, 1325checkModule : function(name, obj){ 1326if (name=='loadVideoApi'&&app.modules[name]&&obj&&obj.data.type !='youtube+vimeo' 1327&&app.modules[name].data.type !='youtube+vimeo'&&app.modules[name].data.type !=obj.data.type){ 1328obj.data.type='youtube+vimeo'; 1329} else if (typeof(obj) !='undefined'){ 1330app.modules[name]=obj; 1331} 1332if (typeof(app[name])=='undefined'&&!app.loading[name]){ 1333app.loading[name]=true; 1334app.loadModule(name); 1335} else if (typeof(app[name]) !='undefined'){ 1336if (typeof(obj) !='undefined'){ 1337app[name](obj.data, obj.selector); 1338} else { 1339app[name](); 1340} 1341} 1342},
1343checkVideoBackground : function(){ 1344let flag=false; 1345$g('.ba-section, .ba-row, .ba-grid-column').each(function(){ 1346if (app.items[this.id]&&app.items[this.id].desktop.background.type=='video'){ 1347flag=true; 1348return false; 1349} 1350}); 1351$g('.ba-item-flipbox').each(function(){ 1352if (app.items[this.id]&&app.items[this.id].sides.frontside.desktop.background 1353&&app.items[this.id].sides.frontside.desktop.background.type=='video'){ 1354flag=true; 1355return false; 1356} 1357if (app.items[this.id]&&app.items[this.id].sides.backside.desktop.background 1358&&app.items[this.id].sides.backside.desktop.background.type=='video'){ 1359flag=true; 1360return false; 1361} 1362}); 1363if (app.theme.desktop.background.type=='video'){ 1364flag=true; 1365} 1366if (flag){ 1367app.checkModule('createVideo', {}); 1368} 1369}, 1370loadModule : function(key){ 1371if (key !='setCalendar'&&key !='defaultElementsStyle'&&key !='gridboxLanguage'&& 1372key !='shapeDividers'&&key !='presetsPatern'){ 1373var script=document.createElement('script'); 1374script.src=JUri+'components/com_gridbox/libraries/modules/'+key+'.js?'+gridboxVersion; 1375document.head.append(script); 1376return false; 1377} 1378$g.ajax({ 1379type:"POST", 1380dataType:'text', 1381url:"index.php?option=com_gridbox&task=editor.loadModule&module="+key+"&"+gridboxVersion, 1382data:{ 1383module : key 1384}, 1385complete: function(msg){ 1386let script=document.createElement('script'); 1387document.head.append(script); 1388script.innerHTML=msg.responseText; 1389} 1390}); 1391}, 1392checkView: function(){ 1393var width=$g(window).width(); 1394app.view='desktop'; 1395for (var ind in breakpoints){ 1396if (width <=breakpoints[ind]){ 1397app.view=ind; 1398} 1399} 1400}, 1401resize: function(){ 1402clearTimeout(delay); 1403app.checkView(); 1404delay=setTimeout(function(){ 1405if ('setPostMasonryHeight' in window){ 1406$g('.ba-blog-posts-wrapper.ba-masonry-layout').each(function(){ 1407var key=$g(this).closest('.ba-item').attr('id'); 1408setPostMasonryHeight(key); 1409}); 1410} 1411if ('setGalleryMasonryHeight' in window){ 1412$g('.gridbox-gallery-wrapper.simple-gallery-masonry-layout').each(function(){ 1413setGalleryMasonryHeight(this.closest('.ba-item').id); 1414}); 1415} 1416}, 300); 1417}, 1418checkCommentInTabs: function(hash){ 1419$g('a.'+hash.replace('#', '')).first().each(function(){ 1420let tab=this.closest('.tab-pane, .accordion-body'); 1421if (tab&&!tab.classList.contains('active')&&!tab.classList.contains('in')){ 1422$g('a[href="#'+tab.id+'"]').trigger('click'); 1423} 1424}); 1425}, 1426gridboxLoaded: function(){ 1427app.checkView(); 1428app.checkAnimation(); 1429checkOnePage(); 1430$g(window).on('resize', app.resize); 1431if (!$g('body').hasClass('gridbox')){ 1432$g(window).on('scroll.onepage', checkOnePageActive); 1433} 1434$g(window).on('scroll', function(){ 1435var top=window.pageYOffset; 1436if (!('lastPageYOffset' in window)){ 1437window.lastPageYOffset=top; 1438} 1439$g('header')[top > 40 ? 'addClass' : 'removeClass']('fixed-header'); 1440$g('.ba-sticky-header').each(function(){ 1441this.closest('header, footer, .body').classList.add('ba-sticky-header-parent'); 1442if (this.querySelector('.ba-sticky-header > .ba-section')){ 1443var section=this.querySelector('.ba-sticky-header > .ba-section'), 1444obj=app.items[section.id], 1445offset=obj.desktop.offset; 1446if (app.view !='desktop'){ 1447for (var ind in breakpoints){ 1448if (!obj[ind]){ 1449obj[ind]={}; 1450} 1451offset=obj[ind].offset ? obj[ind].offset : offset; 1452if (ind==app.view){ 1453break; 1454} 1455} 1456} 1457if (!this.classList.contains('visible-sticky-header')){ 1458if (top >=offset * 1&& 1459(!obj.scrollup || (obj.scrollup&&top - window.lastPageYOffset < 0))){ 1460this.classList.add('visible-sticky-header'); 1461document.body.classList.add('sticky-header-opened'); 1462if (obj.desktop.animation.effect){ 1463section.classList.add(obj.desktop.animation.effect); 1464setTimeout(function(){ 1465section.classList.remove(obj.desktop.animation.effect); 1466}, obj.desktop.animation.delay * 1000 + obj.desktop.animation.duration * 1000); 1467} 1468$g(window).trigger('scroll'); 1469} 1470} 1471if ((top < offset * 1&&!obj.scrollup) || (obj.scrollup&&(top - window.lastPageYOffset > 0 || top <=offset * 1))){ 1472this.classList.remove('visible-sticky-header'); 1473document.body.classList.remove('sticky-header-opened'); 1474} 1475} 1476}); 1477window.lastPageYOffset=top; 1478}); 1479$g(window).trigger('scroll'); 1480$g('.ba-item [contenteditable]').removeAttr('contenteditable'); 1481if ($g('.ba-item-overlay-section').length > 0){ 1482app.checkModule('checkOverlay'); 1483} 1484$g('.ba-item-main-menu, .ba-item-one-page-menu, .ba-item-overlay-section').each(function(){ 1485if (app.items[this.id]){ 1486var obj={ 1487data : app.items[this.id], 1488selector : this.id 1489}; 1490itemsInit.push(obj); 1491} 1492}); 1493$g('.ba-item').not('.ba-item-main-menu, .ba-item-one-page-menu, .ba-item-overlay-section').each(function(){ 1494if (app.items[this.id]){ 1495var obj={ 1496data : app.items[this.id], 1497selector : this.id 1498}; 1499itemsInit.push(obj); 1500} 1501}); 1502if (itemsInit.length > 0){ 1503itemsInit.reverse(); 1504app.checkModule('initItems', itemsInit.pop()); 1505}
1506app.checkVideoBackground(); 1507$g('.ba-lightbox-backdrop').on('keyup', function(event){ 1508if (event.key=='Escape'){ 1509$g(this).find('.ba-lightbox-close').first().click(); 1510} 1511}).find('.ba-lightbox-close').on('click keyup', function(event){ 1512app.AccessibilityHelper.processAction(event, ()=> { 1513const lightbox=this.closest('.ba-lightbox-backdrop'); 1514lightboxVideoClose(lightbox); 1515lightbox.classList.remove('visible-lightbox'); 1516app.AccessibilityHelper.releaseTrap(lightbox.querySelector('.ba-wrapper')); 1517document.body.classList.remove('lightbox-open'); 1518}); 1519}); 1520$g('.ba-lightbox-backdrop').each(function(){ 1521let obj=app.items[this.dataset.id]; 1522if (obj.type=='cookies' || !obj.session.enable){ 1523initLightbox(this, obj); 1524} else { 1525let flag=true; 1526if (localStorage[this.dataset.id]){ 1527let date=new Date().getTime(), 1528expires=new Date(localStorage[this.dataset.id]); 1529expires.getTime(); 1530if (date >=expires){ 1531flag=true; 1532localStorage.removeItem(this.dataset.id); 1533} else { 1534flag=false; 1535} 1536} 1537if (flag){ 1538let expiration=new Date(); 1539expiration.setDate(expiration.getDate() + obj.session.duration * 1); 1540localStorage.setItem(this.dataset.id, expiration); 1541initLightbox(this, obj); 1542} 1543} 1544}); 1545$g('.ba-section, .ba-row, .ba-grid-column').each(function(){ 1546if (app.items[this.id]&&app.items[this.id].parallax&&app.items[this.id].parallax.enable){ 1547app.checkModule('loadParallax'); 1548return false; 1549} 1550}); 1551if (document.querySelector('.open-calendar-dialog')){ 1552app.loadModule('calendar'); 1553} 1554} 1555}; 1556app.fetch=async function(url, data, isFile){ 1557const module=await import(`${JUri}components/com_gridbox/assets/modules/Request.js`) 1558return await module.default.post(url, data, isFile); 1559} 1560app.getFormData=async function(data, isFile){ 1561const module=await import(`${JUri}components/com_gridbox/assets/modules/Request.js`) 1562return await module.default.getBody(data, isFile); 1563} 1564app.preloaded={ 1565total: 0, 1566loaded: 0, 1567loadGridbox: function(){ 1568app.lazyLoad ? app.lazyLoad.check() : ''; 1569app.preloaded.end=true; 1570app.gridboxLoaded(); 1571}, 1572callback: function(){ 1573app.preloaded.loaded++; 1574if (app.preloaded.total <=app.preloaded.loaded&&!app.preloaded.end&&document.readyState !='loading'){ 1575app.preloaded.loadGridbox(); 1576} 1577} 1578} 1579document.querySelectorAll('link[rel="preload"][as="style"]').forEach(function(link){ 1580link.onload=app.preloaded.callback; 1581link.onerror=app.preloaded.callback; 1582app.preloaded.total++; 1583}); 1584class CustomSelect { 1585constructor(element){ 1586this.$select=$g(element); 1587this.$textInput=this.$select.find('input[type="text"]'); 1588this.$hiddenInput=this.$select.find('input[type="hidden"]'); 1589this.$list=this.$select.find('ul'); 1590this.currentIndex=-1; 1591this.setupAria(); 1592this.attachEvents(); 1593} 1594getOptions(){ 1595return this.$list.find('li'); 1596} 1597setupAria(){ 1598const listId='listbox-' + Math.random().toString(36).substr(2, 6); 1599this.$select.attr({ 1600'role': 'combobox', 1601'aria-haspopup': 'listbox', 1602'aria-expanded': 'false', 1603}); 1604this.$list.attr({ 1605'role': 'listbox', 1606'tabindex': '-1', 1607'id': listId 1608}); 1609this.$textInput.attr({ 1610'readonly': 'true', 1611'aria-controls': listId 1612}); 1613} 1614attachEvents(){ 1615this.$select.on('click', 'i, input', ()=> { 1616if (!this.$list.hasClass('visible-select')){ 1617setTimeout(()=> this.openList(), 100); 1618} 1619}); 1620this.$select.on('click', 'li', (event)=> { 1621const index=this.getOptions().index(event.currentTarget); 1622this.selectOption(index); 1623}); 1624this.$select.on('keydown', (e)=> this.handleKeydown(e)); 1625} 1626openList(){ 1627const options=this.getOptions(); 1628this.$list.addClass('visible-select'); 1629this.$select.attr('aria-expanded', 'true'); 1630options.removeClass('focused'); 1631const selectedIndex=options.index(options.filter('.selected')); 1632this.currentIndex=selectedIndex >=0 ? selectedIndex : 0; 1633if (options.length > 0){ 1634options.eq(this.currentIndex).addClass('focused'); 1635} 1636this.$select.trigger('show'); 1637} 1638closeList(){ 1639this.$list.removeClass('visible-select'); 1640this.$select.attr('aria-expanded', 'false'); 1641this.getOptions().removeClass('focused'); 1642} 1643selectOption(index){ 1644const options=this.getOptions(); 1645const $opt=options.eq(index); 1646options.removeClass('selected'); 1647$opt.addClass('selected'); 1648this.$textInput.val($opt.text().trim()); 1649this.$hiddenInput.val($opt.data('value')).trigger('change'); 1650this.currentIndex=index; 1651this.$select.trigger('customAction'); 1652this.closeList(); 1653} 1654handleKeydown(e){ 1655const options=this.getOptions(); 1656if (options.length===0) return; 1657if (e.key===' ' || e.key==='Enter'){ 1658e.preventDefault(); 1659if (!this.$list.hasClass('visible-select')){ 1660this.openList(); 1661} else { 1662this.selectOption(this.currentIndex); 1663} 1664} else if (e.key==='ArrowDown'){ 1665e.preventDefault(); 1666if (!this.$list.hasClass('visible-select')){ 1667this.openList(); 1668} else { 1669this.currentIndex=(this.currentIndex + 1) % options.length; 1670this.updateFocus(); 1671} 1672} else if (e.key==='ArrowUp'){ 1673e.preventDefault(); 1674if (!this.$list.hasClass('visible-select')){ 1675this.openList(); 1676} else { 1677this.currentIndex=(this.currentIndex - 1 + options.length) % options.length; 1678this.updateFocus(); 1679} 1680} else if (e.key==='Escape'){ 1681this.closeList(); 1682} 1683} 1684updateFocus(){ 1685const options=this.getOptions(); 1686options.removeClass('focused'); 1687options.eq(this.currentIndex).addClass('focused'); 1688} 1689static initAll(selector='.ba-custom-select'){ 1690$g(selector).each(function (){ 1691new CustomSelect(this); 1692}); 1693} 1694} 1695document.addEventListener("DOMContentLoaded", function(){ 1696$g('link[rel="preload"][as="style"]').attr('rel', 'stylesheet'); 1697document.body.style.opacity=''; 1698document.body.style.overflow=''; 1699document.body.style.margin=''; 1700let preloader=document.querySelector('.ba-item-preloader'); 1701if (preloader){ 1702setTimeout(function(){ 1703preloader.classList.add('preloader-animation-out'); 1704app.checkGridboxPaymentError(); 1705}, preloader.dataset.delay * 1000); 1706} else { 1707app.checkGridboxPaymentError(); 1708} 1709if ('setPostMasonryHeight' in window){ 1710$g('.ba-blog-posts-wrapper.ba-masonry-layout').each(function(){ 1711var key=$g(this).closest('.ba-item').attr('id'); 1712setPostMasonryHeight(key); 1713}); 1714} 1715if ('setGalleryMasonryHeight' in window){ 1716$g('.gridbox-gallery-wrapper.simple-gallery-masonry-layout').each(function(){ 1717setGalleryMasonryHeight(this.closest('.ba-item').id); 1718}); 1719} 1720if (app.hash=='#total-count-wrapper' || app.hash=='#total-reviews-count-wrapper'){ 1721let item=$g('a.'+app.hash.replace('#', '')); 1722app.checkCommentInTabs(app.hash); 1723app.scrollIntoView(item); 1724} 1725$g('body').on('click', function(){ 1726$g('.visible-select').removeClass('visible-select'); 1727if (app.storeSearch&&app.storeSearch.visible){ 1728app.storeSearch.clearSearch(); 1729} 1730}).on('hide', '.modal', function(){ 1731this.classList.add('ba-modal-close'); 1732setTimeout(function(){ 1733$g('.ba-modal-close').removeClass('ba-modal-close'); 1734}, 500); 1735}); 1736CustomSelect.initAll(); 1737$g('.intro-post-reviews a, .intro-post-comments a').on('click', function(){ 1738let item=$g('a.'+this.hash.replace('#', '')); 1739app.checkCommentInTabs(this.hash); 1740app.scrollIntoView(item); 1741}); 1742$g('li.megamenu-item').on('mouseenter', function(){ 1743var rectangle=this.getBoundingClientRect(), 1744left=rectangle.left * -1, 1745wrapper=$g(this).find(' > div.tabs-content-wrapper'), 1746width=document.documentElement.clientWidth, 1747maxwidth=width - rectangle.right; 1748if (wrapper.hasClass('megamenu-center')&&wrapper.hasClass('ba-container')){ 1749left=$g(this).width() / 2; 1750} 1751if (rectangle.left < maxwidth){ 1752maxwidth=rectangle.left; 1753} 1754if (!wrapper.hasClass('megamenu-center')){ 1755maxwidth=width - rectangle.left; 1756} else if (wrapper.hasClass('ba-container')){ 1757left -=wrapper.outerWidth() / 2; 1758} 1759if (wrapper.hasClass('megamenu-center')){ 1760maxwidth=(maxwidth + (rectangle.right - rectangle.left) / 2) * 2; 1761} 1762if ($g(this).closest('.ba-menu-wrapper').hasClass('vertical-menu')){ 1763maxwidth=width - rectangle.right; 1764} 1765wrapper.css({ 1766'margin-left' : left+'px', 1767'width' : width+'px', 1768'max-width' : maxwidth+'px' 1769}); 1770}); 1771$g('.ba-item-main-menu').closest('.ba-row').addClass('row-with-menu'); 1772for (var key in gridboxItems){ 1773if (key !='theme'){ 1774app.items=$g.extend(true, app.items, gridboxItems[key]); 1775} 1776} 1777app.theme=gridboxItems.theme; 1778if (app.preloaded.total==0){ 1779app.gridboxLoaded(); 1780} else if (app.preloaded.total <=app.preloaded.loaded&&!app.preloaded.end){ 1781app.preloaded.loadGridbox(); 1782} 1783}); 1784var lightboxVideo={}; 1785function lightboxVideoClose(item){ 1786var iframes=item.querySelectorAll('.ba-item-custom-html iframe, .ba-item-video iframe'); 1787for (var i=0; i < iframes.length; i++){ 1788var src=iframes[i].src, 1789videoId=iframes[i].id; 1790if (src&&src.indexOf('youtube.com') !==-1&&'pauseVideo' in lightboxVideo[videoId]){ 1791lightboxVideo[videoId].pauseVideo(); 1792} else if (src&&src.indexOf('vimeo.com') !==-1&&'pause' in lightboxVideo[videoId]){ 1793lightboxVideo[videoId].pause(); 1794} 1795} 1796iframes=item.querySelectorAll('.ba-item-video video, .ba-item-custom-html video'); 1797for (var i=0; i < iframes.length; i++){ 1798var videoId=iframes[i].id; 1799lightboxVideo[videoId].pause(); 1800} 1801} 1802function lightboxVideoOpen(item){
1803if (item.querySelectorAll('.video-lazy-load-thumbnail')){ 1804$g(item).find('.video-lazy-load-thumbnail').trigger('click'); 1805} 1806var iframes=item.querySelectorAll('.ba-item-custom-html iframe, .ba-item-video iframe'), 1807youtube=false, 1808vimeo=false, 1809id=+new Date(); 1810for (var i=0; i < iframes.length; i++){ 1811var src=iframes[i].src, 1812videoId; 1813if (src&&src.indexOf('youtube.com') !==-1){ 1814if (!app.youtube){ 1815youtube=true; 1816} else { 1817if (src.indexOf('enablejsapi=1')===-1){ 1818if (src.indexOf('?')===-1){ 1819src +='?'; 1820} else { 1821src +='&' 1822} 1823src +='enablejsapi=1'; 1824iframes[i].src=src; 1825} 1826if (!iframes[i].id){ 1827iframes[i].id=id++; 1828} 1829videoId=iframes[i].id; 1830if (!lightboxVideo[videoId] || !('playVideo' in lightboxVideo[videoId])){ 1831lightboxVideo[videoId]=new YT.Player(videoId, { 1832events: { 1833onReady: function(event){ 1834lightboxVideo[videoId].playVideo(); 1835} 1836} 1837}); 1838} else { 1839lightboxVideo[videoId].playVideo(); 1840} 1841} 1842} else if (src&&src.indexOf('vimeo.com') !==-1){ 1843if (!app.vimeo){ 1844vimeo=true; 1845} else { 1846if (!iframes[i].id){ 1847iframes[i].id=id++; 1848} 1849videoId=iframes[i].id; 1850if (!lightboxVideo[videoId] || !('play' in lightboxVideo[videoId])){ 1851src=src.split('/'); 1852src=src.slice(-1); 1853src=src[0].split('?'); 1854src=src[0]; 1855var options={ 1856id: src * 1, 1857loop: true, 1858}; 1859lightboxVideo[videoId]=new Vimeo.Player(videoId, options); 1860} 1861lightboxVideo[videoId].play(); 1862} 1863} 1864} 1865iframes=item.querySelectorAll('.ba-item-video video, .ba-item-custom-html video'); 1866for (var i=0; i < iframes.length; i++){ 1867if (!iframes[i].id){ 1868iframes[i].id=id++; 1869} 1870videoId=iframes[i].id; 1871if (!lightboxVideo[videoId]){ 1872lightboxVideo[videoId]=iframes[i]; 1873} 1874lightboxVideo[videoId].play(); 1875} 1876if (youtube || vimeo){ 1877var object={ 1878data : {} 1879}; 1880if (youtube&&!vimeo){ 1881object.data.type='youtube'; 1882} else if (vimeo&&!youtube){ 1883object.data.type='vimeo'; 1884} else { 1885object.data.type='youtube+vimeo'; 1886} 1887app.checkModule('loadVideoApi', object); 1888} 1889if (youtube){ 1890lightboxVideo.overlay=item; 1891} else if (vimeo){ 1892lightboxVideo.overlay=item; 1893} 1894return !youtube&&!vimeo; 1895} 1896function initLightbox($this, obj){ 1897var obj=app.items[$this.dataset.id]; 1898if (obj.type=='cookies'){ 1899if (localStorage['ba-item-cookie']){ 1900return false; 1901} 1902$g($this).find('.ba-item-button[data-cookie="accept"]').on('click', function(event){ 1903event.preventDefault(); 1904localStorage.setItem('ba-item-cookie', 'accept'); 1905$g(this).closest('.ba-lightbox-backdrop').removeClass('visible-lightbox'); 1906$g('body').removeClass('lightbox-open'); 1907}); 1908showLightbox($this); 1909} else if (obj.trigger.type=='time-delay'){ 1910setTimeout(function(){ 1911showLightbox($this); 1912}, obj.trigger.time); 1913} else if (obj.trigger.type=='scrolling'){ 1914lightboxScroll($this, obj.trigger.scroll * 1); 1915} else if (obj.trigger.type=='exit-intent'){ 1916$g(document).one('mouseleave.ba-lightbox'+$this.dataset.id, function(){ 1917showLightbox($this); 1918}); 1919} else { 1920lightboxScroll($this, 100); 1921} 1922} 1923function lightboxScroll($this, scroll){ 1924let top, docHeight, htmlHeight; 1925$g(window).on('scroll.ba-lightbox'+$this.dataset.id+' load.ba-lightbox'+$this.dataset.id, function(){ 1926top=$g(window).scrollTop(); 1927docHeight=document.documentElement.clientHeight 1928htmlHeight=Math.max( 1929document.body.scrollHeight, document.documentElement.scrollHeight, 1930document.body.offsetHeight, document.documentElement.offsetHeight, 1931document.body.clientHeight, document.documentElement.clientHeight 1932); 1933let x=(docHeight + top) * 100 / htmlHeight; 1934if (x >=scroll || (scroll > 97&&x >=97)){ 1935$g(window).off('scroll.ba-lightbox'+$this.dataset.id+' load.ba-lightbox'+$this.dataset.id); 1936showLightbox($this); 1937} 1938}); 1939} 1940function showLightbox($this){ 1941const obj=app.getObject($this.dataset.id); 1942if (!lightboxVideoOpen($this) || obj.disable==1){ 1943return false; 1944} 1945const section=$this.querySelector(':scope > .ba-wrapper > .ba-section') 1946$this.querySelector('.close-lightbox .ba-lightbox-close')?.setAttribute('tabindex', 0); 1947$this.classList.add('visible-lightbox'); 1948if (obj.animation.effect){ 1949section.classList.add(obj.animation.effect); 1950setTimeout(function(){ 1951section.classList.remove(obj.animation.effect); 1952}, obj.animation.delay * 1000 + obj.animation.duration * 1000); 1953} 1954if (obj.position=='lightbox-center'){ 1955document.body.classList.add('lightbox-open'); 1956} 1957if (app.AccessibilityHelper){ 1958app.AccessibilityHelper.trapFocus($this.querySelector('.ba-wrapper'), 350); 1959} 1960} 1961function compileOnePageValue(item){ 1962if (item.length==0){ 1963return 0; 1964} 1965var value=item.offset().top, 1966header=$g('header.header'), 1967comp=header[0] ? getComputedStyle(header[0]) : {}, 1968top=window.pageYOffset, 1969stickies=$g('.ba-sticky-header'), 1970sticky=0; 1971if (item.closest('.ba-wrapper').parent().hasClass('header')){ 1972value=0; 1973} else { 1974stickies.each(function(){ 1975if (this.offsetHeight > 0){ 1976let section=this.querySelector('.ba-sticky-header > .ba-section'), 1977obj=app.items[section.id], 1978offset=obj ? obj.desktop.offset : 0; 1979if (app.view !='desktop'){ 1980for (var ind in breakpoints){ 1981if (!obj[ind]){ 1982obj[ind]={}; 1983} 1984offset=obj[ind].offset ? obj[ind].offset : offset; 1985if (ind==app.view){ 1986break; 1987} 1988} 1989} 1990if (obj&&((!obj.scrollup&&offset < value) || (obj.scrollup&&offset < value&&value < top))){ 1991sticky=this.offsetHeight > sticky ? this.offsetHeight : sticky; 1992} 1993} 1994}); 1995if ((!header.hasClass('sidebar-menu') || (app.view !='desktop'&&app.view !='laptop')) 1996&&comp.position=='fixed'){ 1997sticky=header[0].offsetHeight > sticky ? header[0].offsetHeight : sticky; 1998if (header.find('.resizing-header').length > 0){ 1999var resizingSection=getComputedStyle(header.find('.resizing-header')[0]); 2000value +=resizingSection.paddingTop.replace('px', '') * 1; 2001value +=resizingSection.paddingBottom.replace('px', '') * 1; 2002} 2003} 2004value -=sticky; 2005} 2006return Math.ceil(value); 2007} 2008function checkOnePage(){ 2009var alias=location.hash.replace('#', ''); 2010alias=decodeURIComponent(alias); 2011if (alias&&document.querySelector('.main-menu a[data-alias="'+alias+'"]')){ 2012$g('.main-menu a[data-alias="'+alias+'"]').each(function(){ 2013const id=(this.dataset.anchor || this.hash).replace('#', ''); 2014let item=$g('#' + id); 2015if ($g(this.parentNode).height() > 0&&id&&item.length > 0){ 2016$g(this).closest('ul').find('.active').removeClass('active'); 2017$g('.main-menu ul.nav.menu').find(`a[href*="#${id}"], a[data-anchor="${id}"]`) 2018.parent().addClass('active'); 2019app.scrollIntoView(item); 2020return false;
2021} 2022}); 2023} else if ((alias=='total-reviews-count-wrapper' || alias=='total-count-wrapper') 2024&&document.querySelector('a.'+alias)){ 2025let item=$g('a.'+alias); 2026app.scrollIntoView(item); 2027} else { 2028checkOnePageActive(); 2029} 2030} 2031app.scrollIntoView=function(item){ 2032let value=compileOnePageValue(item); 2033if (window.pageYOffset !=value){ 2034$g('html, body').stop().animate({ 2035'scrollTop' : value 2036}, 1000); 2037} 2038} 2039window.onePageScroll=true; 2040function checkOnePageActive(){ 2041if (!window.onePageScroll){ 2042return; 2043} 2044var items=[], 2045alias='', 2046replace=null, 2047flag=false; 2048$g('.main-menu ul li a[data-alias]').each(function(){ 2049const id=this.dataset.anchor ? '#' + this.dataset.anchor : this.hash; 2050if (this.offsetHeight > 0&&id&&$g(id).height() > 0){ 2051var computed=getComputedStyle(document.querySelector(id)); 2052if (computed.display !='none'){ 2053items.push(this); 2054} 2055} 2056}); 2057items.sort(function(item1, item2){ 2058var target1=$g(item1.dataset.anchor ? '#' + item1.dataset.anchor : item1.hash), 2059target2=$g(item2.dataset.anchor ? '#' + item2.dataset.anchor : item2.hash), 2060top1=target1.closest('header.header').length==0 ? target1.offset().top : 0, 2061top2=target2.closest('header.header').length==0 ? target2.offset().top : 0; 2062if (top1 > top2){ 2063return 1; 2064} else if (top1 < top2){ 2065return -1; 2066} else { 2067return 0; 2068} 2069}); 2070let url='' 2071for (var i=items.length - 1; i >=0; i--){ 2072alias=items[i].dataset.alias; 2073if (decodeURI(window.location.hash)=='#'+alias){ 2074replace=location.href.replace(window.location.hash, ''); 2075} 2076const id=(items[i].dataset.anchor || items[i].hash).replace('#', '') 2077const item=$g('#' + id); 2078let value=compileOnePageValue(item); 2079if (value <=Math.ceil(window.pageYOffset) + 1){ 2080flag=true; 2081url=location.href.replace(window.location.hash, '')+'#'+alias; 2082$g('.main-menu ul').find(`a[href*="#${id}"], a[data-anchor="${id}"]`) 2083.closest('ul') 2084.find('.active').removeClass('active current'); 2085$g('.main-menu ul').find(`a[href*="#${id}"], a[data-anchor="${id}"]`) 2086.parent().addClass('active'); 2087break; 2088} 2089} 2090if (!flag){ 2091$g('.main-menu ul.nav.menu .active').removeClass('active'); 2092replace ? window.history.replaceState(null, null, replace) : ''; 2093} else if (decodeURI(window.location.hash) !='#'+alias){ 2094window.history.replaceState(null, null, url); 2095} 2096} 2097window.addEventListener('resize', function(){ 2098document.documentElement.style.setProperty('--vh', window.innerHeight * 0.01+'px'); 2099}); 2100jQuery(window).on('popstate.onepage', function(){ 2101window.onePageScroll=false; 2102setTimeout(function(){ 2103window.onePageScroll=true; 2104}, 300); 2105}); 2106/* 2107Default joomla 2108*/ 2109document.addEventListener('DOMContentLoaded', function(){ 2110ImportHelper.resolve('AccessibilityHelper', '').then(module=> { 2111/** @type {typeof import('../../../components/com_gridbox/assets/modules/AccessibilityHelper.js').default} */ 2112app.AccessibilityHelper=module; 2113}); 2114document.documentElement.style.setProperty('--vh', window.innerHeight * 0.01+'px'); 2115$g('*[rel=tooltip]').tooltip(); 2116$g('.radio.btn-group label').addClass('btn'); 2117$g('fieldset.btn-group').each(function(){ 2118if (this.disabled){ 2119$g(this).css('pointer-events', 'none').off('click'); 2120$g(this).find('.btn').addClass('disabled'); 2121} 2122}); 2123$g(".btn-group label:not(.active)").click(function(){ 2124var label=$g(this), 2125input=$g('#'+label.attr('for')); 2126if (!this.checked){ 2127label.closest('.btn-group').find("label").removeClass('active btn-success btn-danger btn-primary'); 2128if (input.val()==''){ 2129label.addClass('active btn-primary'); 2130} else if (input.val()==0){ 2131label.addClass('active btn-danger'); 2132} else { 2133label.addClass('active btn-success'); 2134} 2135input.prop('checked', true).trigger('change'); 2136} 2137}); 2138$g(".btn-group input[checked=checked]").each(function(){ 2139if (this.value==''){ 2140$g("label[for="+this.id+"]").addClass('active btn-primary'); 2141} else if (this.value==0){ 2142$g("label[for="+this.id+"]").addClass('active btn-danger'); 2143} else { 2144$g("label[for="+this.id+"]").addClass('active btn-success'); 2145} 2146}); 2147}); 2148/*jQuery(document).on('ready', function(){ 2149jQuery('.nav-hover-effect .main-menu .nav.menu > li a').each(function(index, el){ 2150var elVal=jQuery(el).text(); 2151jQuery(el).attr('data-hover', elVal); 2152}); 2153jQuery(".nav-hover-effect .main-menu .nav.menu > li a").wrapInner("<span></span>"); 2154jQuery('.nav-hover-effect .main-menu .nav.menu > li a').each(function(){ 2155let style=getComputedStyle(this), 2156color=style.backgroundColor, 2157borderColor=style.borderTopColor; 2158this.style.setProperty('--button-background-color', color); 2159this.style.setProperty('--button-border-color', borderColor); 2160}).on('mouseenter', function(){ 2161let color=getComputedStyle(this).backgroundColor; 2162this.style.setProperty('--button-background-hover', color); 2163}); 2164}); 2165/* 2166document.addEventListener('DOMContentLoaded', function(){ 2167var script=document.createElement('script'); 2168script.src='https://cdn.jsdelivr.net/particles.js/2.0.0/particles.min.js'; 2169script.onload=function(){ 2170particlesJS("snow", { 2171"particles": { 2172"number": { 2173"value": 200, 2174"density": { 2175"enable": true, 2176"value_area": 800 2177} 2178}, 2179"color": { 2180"value": "#ffffff" 2181}, 2182"opacity": { 2183"value": 0.7, 2184"random": false, 2185"anim": { 2186"enable": false 2187} 2188}, 2189"size": { 2190"value": 5, 2191"random": true, 2192"anim": { 2193"enable": false 2194} 2195}, 2196"line_linked": { 2197"enable": false 2198}, 2199"move": { 2200"enable": true, 2201"speed": 5, 2202"direction": "bottom", 2203"random": true, 2204"straight": false, 2205"out_mode": "out",
2206"bounce": false, 2207"attract": { 2208"enable": true, 2209"rotateX": 300, 2210"rotateY": 1200 2211} 2212} 2213}, 2214"interactivity": { 2215"events": { 2216"onhover": { 2217"enable": false 2218}, 2219"onclick": { 2220"enable": false 2221}, 2222"resize": false 2223} 2224}, 2225"retina_detect": true 2226}); 2227} 2228document.head.append(script); 2229});*/ 2230 2231/** 2232* @package BaForms 2233* @author Balbooa http://www.balbooa.com/ 2234* @copyright Copyright @ Balbooa 2235* @license http://www.gnu.org/licenses/gpl.html GNU/GPL 2236*/ 2237var $f=jQuery, 2238formsApp={ 2239loaded: {} 2240}; 2241!function($){ 2242class formsModal 2243{ 2244constructor(element){ 2245this.element=$(element); 2246this.position=element.dataset.position ? element.dataset.position : ''; 2247this.setEvents(); 2248if (element.parentNode !=document.body){ 2249$('body').append(this.element); 2250} 2251} 2252setEvents(){ 2253this.element.on('click keyup', (event)=> { 2254FormsAccessibilityHelper.processAction(event, ()=> { 2255this.hide(event) 2256}) 2257}) 2258this.element.on('keyup', event=> { 2259if (event.key=='Escape'){ 2260this.hide(); 2261} 2262}) 2263} 2264show(){ 2265this.element.css({ 2266'opacity': '', 2267'pointer-events': '' 2268}); 2269this.setScroll(); 2270this.element.addClass('visible-forms-modal'); 2271setTimeout(()=> { 2272this.element.addClass('motion-start'); 2273}, 1) 2274FormsAccessibilityHelper.trapFocus(this.element[0], 100); 2275let scroll=this.element[0].offsetWidth - this.element[0].clientWidth; 2276this.element[0].style.setProperty('--forms-modal-scroll-width', scroll + 'px'); 2277} 2278setScroll(){ 2279document.body.classList.add('forms-modal-position-' + this.position); 2280if (!document.body.classList.contains('forms-modal-opened')){ 2281let scroll=window.innerWidth - document.documentElement.clientWidth; 2282document.body.classList.add('forms-modal-opened'); 2283document.body.style.setProperty('--forms-body-scroll-width', scroll + 'px'); 2284} 2285} 2286hide(event){ 2287if (!event || event.target.dataset.dismiss=='formsModal'){ 2288let $this=this; 2289this.element.removeClass('motion-start') 2290setTimeout(()=> { 2291this.element.removeClass('visible-forms-modal'); 2292}, 800) 2293FormsAccessibilityHelper.releaseTrap(this.element[0]) 2294setTimeout(function (){ 2295$this.hideScroll(); 2296}, 300); 2297} 2298} 2299hideScroll(){ 2300document.body.classList.remove('forms-modal-position-' + this.position); 2301if (!document.querySelector('.visible-forms-modal')){ 2302document.body.classList.remove('forms-modal-opened'); 2303document.body.style.removeProperty('--forms-body-scroll-width'); 2304} 2305} 2306} 2307$.fn.formsModal=function(option){ 2308return this.each(function(){ 2309let data=$(this).data('formsModal'); 2310if (!data){ 2311$(this).data('formsModal', (data=new formsModal(this))); 2312} 2313if (typeof option=='string'){ 2314data[option](); 2315} else { 2316data.show(); 2317} 2318}); 2319} 2320$.fn.formsModal.Constructor=formsModal; 2321}(window.$f); 2322class FormsAccessibilityHelper 2323{ 2324static focusableSelectors=[ 2325'a[href]:not([tabindex="-1"])', 2326'area[href]:not([tabindex="-1"])', 2327'input:not([disabled]):not([tabindex="-1"])', 2328'select:not([disabled]):not([tabindex="-1"])', 2329'textarea:not([disabled]):not([tabindex="-1"])', 2330'button:not([disabled]):not([tabindex="-1"])', 2331'iframe:not([tabindex="-1"])', 2332'object:not([tabindex="-1"])', 2333'embed:not([tabindex="-1"])', 2334'[tabindex]:not([tabindex="-1"])', 2335'[contenteditable]:not([tabindex="-1"])', 2336]; 2337constructor(wrapper, timeout=0){ 2338this.wrapper=wrapper; 2339this.timeout=timeout; 2340this.handleKeydown=this.handleTrappedKeydown.bind(this); 2341} 2342getVisibleFocusableElements(){ 2343const elements=Array.from( 2344this.wrapper.querySelectorAll(FormsAccessibilityHelper.focusableSelectors.join(',')) 2345); 2346return elements.filter(element=> 2347element.offsetParent !==null&&getComputedStyle(element).visibility !=='hidden' 2348); 2349} 2350trap(){ 2351const elements=this.getVisibleFocusableElements(); 2352if (elements.length===0) return; 2353this.focusedElement=document.activeElement; 2354this.focusedElement.blur(); 2355this.wrapper.setAttribute('tabindex', '-1'); 2356this.wrapper.style.outline='none'; 2357setTimeout(()=> { 2358this.wrapper.focus(); 2359this.wrapper.addEventListener('keydown', this.handleKeydown); 2360}, this.timeout); 2361} 2362handleTrappedKeydown(event){ 2363if (event.key !=='Tab'){ 2364return; 2365} 2366const elements=this.getVisibleFocusableElements(); 2367if (elements.length===0) return; 2368const first=elements[0]; 2369const last=elements[elements.length - 1]; 2370if (event.shiftKey&&document.activeElement===first){ 2371event.preventDefault(); 2372last.focus(); 2373} else if (!event.shiftKey&&document.activeElement===last){ 2374event.preventDefault(); 2375first.focus(); 2376} 2377} 2378release(){ 2379this.wrapper.removeEventListener('keydown', this.handleKeydown); 2380this.wrapper.removeAttribute('tabindex'); 2381this.wrapper.style.outline=''; 2382clearTimeout(this.delay); 2383this.delay=setTimeout(()=> { 2384this.focusedElement.focus(); 2385}, 300); 2386} 2387static trapFocus(wrapper, timeout=0){ 2388if (!wrapper.accessibility){ 2389wrapper.accessibility=new this(wrapper, timeout); 2390} 2391wrapper.accessibility.trap(); 2392} 2393static releaseTrap(wrapper){ 2394if (!wrapper.accessibility) return; 2395setTimeout(()=> { 2396wrapper.accessibility.release() 2397}, 100); 2398} 2399static isClick(event){ 2400return event.type=="click" || event.type=="touchend" 2401} 2402static processAction(event, callback, eventsList){ 2403if (eventsList&&eventsList.indexOf(event.type)==-1) return; 2404if (this.isClick(event) || (event.type=="keyup"&&event.key=='Enter')){ 2405callback.call(); 2406} 2407} 2408} 2409formsApp.renderFormsCalendar=function(input){ 2410if (input){ 2411formsApp.calendar.formInput=input; 2412} 2413formsApp.fetch.request(JUri+'index.php?option=com_baforms&task=form.renderFormsCalendar', { 2414start: formsApp.calendar.start, 2415year: formsApp.calendar.year, 2416month: formsApp.calendar.month * 1 + 1 2417}).then(function(text){ 2418let data=JSON.parse(text), 2419disable=formsApp.calendar.disable, 2420input=formsApp.calendar.formInput, 2421div=document.createElement('div'); 2422div.innerHTML=data.body; 2423for (let i=0; i < disable.days.length; i++){ 2424div.querySelectorAll('.ba-date-cell[data-day-number="'+disable.days[i]+'"]').forEach((cell)=> { 2425cell.classList.add('disabled-date'); 2426cell.setAttribute('tabindex', -1); 2427}); 2428} 2429for (let i=0; i < disable.dates.length; i++){ 2430div.querySelectorAll('.ba-date-cell[data-day-date="'+disable.dates[i]+'"]').forEach((cell)=> { 2431cell.classList.add('disabled-date'); 2432cell.setAttribute('tabindex', -1); 2433}) 2434} 2435for (let i=0; i < disable.range.length; i++){ 2436let minMax=disable.range[i].split(' - '); 2437div.querySelectorAll('.ba-date-cell:not(.disabled-date)').forEach((cell)=> { 2438if (cell.dataset.dayDate >=minMax[0]&&cell.dataset.dayDate <=minMax[1]){ 2439cell.classList.add('disabled-date'); 2440cell.setAttribute('tabindex', -1); 2441} 2442}); 2443} 2444div.querySelectorAll('.ba-curent-date').forEach(($this)=> { 2445let today=formsApp.calendar.querySelector('.ba-forms-today-btn'), 2446action=$this.classList.contains('disabled-date') ? 'add' : 'remove'; 2447today.dataset.date=$this.dataset.date; 2448today.dataset.dayDate=$this.dataset.dayDate; 2449today.classList[action]('disabled-date'); 2450today.setAttribute('tabindex', (action=='add' ? -1 : 0)); 2451}); 2452if (input.rangeBtn&&input.dataset.index==1){ 2453let date=input.rangeBtn.dataset.value; 2454div.querySelectorAll('.ba-date-cell:not(.disabled-date)').forEach((cell)=> { 2455if (cell.dataset.dayDate <=date){ 2456cell.classList.add('disabled-date'); 2457cell.setAttribute('tabindex', -1); 2458} 2459}); 2460} 2461formsApp.calendar.querySelector('.ba-forms-calendar-title').textContent=data.title; 2462formsApp.calendar.querySelector('.ba-forms-calendar-header').innerHTML=data.header; 2463formsApp.calendar.querySelector('.ba-forms-calendar-body').innerHTML=div.innerHTML; 2464if (!formsApp.calendar.classList.contains('visible-forms-calendar')){ 2465formsApp.calendar.classList.add('visible-forms-calendar'); 2466FormsAccessibilityHelper.trapFocus(formsApp.calendar); 2467} 2468}
2468); 2469} 2470formsApp.setFormsCalendarEvents=function(){ 2471let $calendar=$f(formsApp.calendar); 2472$calendar.find('.ba-forms-today-btn').on('click keyup', function(event){ 2473if (this.classList.contains('disabled-date')) return; 2474FormsAccessibilityHelper.processAction(event, ()=> { 2475formsApp.calendar.formInput.value=this.dataset.date; 2476formsApp.calendar.formInput.dataset.value=this.dataset.dayDate; 2477$f(formsApp.calendar.formInput).trigger('input'); 2478formsApp.hideCalendar(); 2479}); 2480}); 2481$calendar.find('i[data-action]').on('click keyup', function(event){ 2482FormsAccessibilityHelper.processAction(event, ()=> { 2483let year=formsApp.calendar.year * 1, 2484month=formsApp.calendar.month * 1; 2485if (this.dataset.action=='next'){ 2486year=(month===11) ? year + 1 : year; 2487month=(month + 1) % 12; 2488} else if (this.dataset.action=='prev'){ 2489year=(month===0) ? year - 1 : year; 2490month=(month===0) ? 11 : month - 1; 2491} else if (this.dataset.action=='next-year'){ 2492year=year + 1; 2493} else if (this.dataset.action=='prev-year'){ 2494year=year - 1; 2495} 2496formsApp.calendar.year=year; 2497formsApp.calendar.month=month; 2498formsApp.renderFormsCalendar(); 2499}); 2500}); 2501$calendar.on('click keyup', '.ba-date-cell', function(event){ 2502FormsAccessibilityHelper.processAction(event, ()=> { 2503if (!(formsApp.calendar.classList.contains('disable-previous-date')&&this.classList.contains('ba-previous-date')) 2504&&!this.classList.contains('disabled-date')){ 2505formsApp.calendar.formInput.value=this.dataset.date; 2506formsApp.calendar.formInput.dataset.value=this.dataset.dayDate; 2507$f(formsApp.calendar.formInput).trigger('input'); 2508formsApp.hideCalendar(); 2509} 2510}); 2511}); 2512$calendar.on('keyup', function(event){ 2513if (event.key=='Escape'){ 2514formsApp.hideCalendar(); 2515} 2516}); 2517$calendar.find('.ba-close-calendar').on('click', function(){ 2518formsApp.hideCalendar(); 2519}); 2520} 2521formsApp.hideCalendar=function(){ 2522formsApp.calendar.classList.add('forms-calendar-out'); 2523FormsAccessibilityHelper.releaseTrap(formsApp.calendar); 2524setTimeout(function(){ 2525formsApp.calendar.classList.remove('visible-forms-calendar'); 2526formsApp.calendar.classList.remove('forms-calendar-out'); 2527}, 600); 2528} 2529formsApp.createCalendar=function($this){ 2530formsApp.calendar=document.createElement('div'); 2531formsApp.calendar.className='forms-calendar-wrapper'; 2532formsApp.calendar.innerHTML=`<div class="ba-forms-calendar"> 2533<div class="ba-forms-calendar-title-wrapper"> 2534<span class="forms-calendar-btn"> 2535<i class="ba-form-icons ba-icon-chevron-left" tabindex="0" data-action="prev-year"></i> 2536<span class="ba-tooltip ba-bottom ba-hide-element"> 2537${formsApp._('YEAR')} 2538</span> 2539</span> 2540<span class="forms-calendar-btn"> 2541<i class="ba-form-icons ba-icon-chevron-left" tabindex="0" data-action="prev"></i> 2542<span class="ba-tooltip ba-bottom ba-hide-element"> 2543${formsApp._('MONTH')} 2544</span> 2545</span> 2546<span class="ba-forms-calendar-title"></span> 2547<span class="forms-calendar-btn"> 2548<i class="ba-form-icons ba-icon-chevron-right" tabindex="0" data-action="next"></i> 2549<span class="ba-tooltip ba-bottom ba-hide-element"> 2550${formsApp._('MONTH')} 2551</span> 2552</span> 2553<span class="forms-calendar-btn"> 2554<i class="ba-form-icons ba-icon-chevron-right" tabindex="0" data-action="next-year"></i> 2555<span class="ba-tooltip ba-bottom ba-hide-element"> 2556${formsApp._('YEAR')} 2557</span> 2558</span> 2559</div> 2560<div class="ba-forms-calendar-header"></div> 2561<div class="ba-forms-calendar-body"></div> 2562<div class="ba-forms-calendar-footer"> 2563<span class="ba-forms-today-btn" tabindex="0"> 2564${formsApp._('TODAY')} 2565</span> 2566</div> 2567</div> 2568<div class="ba-close-calendar"></div>` 2569document.body.appendChild(formsApp.calendar); 2570formsApp.calendar.year=$this.dataset.year; 2571formsApp.calendar.month=$this.dataset.month; 2572formsApp.setFormsCalendarEvents(); 2573} 2574formsApp.hideNotice=function(){ 2575this.notification.classList.remove('notification-in'); 2576this.notification.classList.add('animation-out'); 2577} 2578formsApp.showNotice=function(message, className=''){ 2579if (!this.notification){ 2580this.notification=document.createElement('div'); 2581this.notification.id='ba-forms-notification'; 2582this.notification.innerHTML='<i class="ba-form-icons ba-icon-close"></i><h4>'+this._('ERROR')+'</h4><p></p>'; 2583this.notification.querySelector('.ba-icon-close').addEventListener('click', function(){ 2584formsApp.hideNotice(); 2585}); 2586document.body.append(this.notification); 2587} 2588this.notification.showCallback=function(){}; 2589if (this.notification.classList.contains('notification-in')){ 2590this.notification.showCallback=function(){ 2591formsApp.notification.showCallback=function(){}; 2592formsApp.addNoticeText(message, className); 2593}; 2594} else { 2595this.addNoticeText(message, className); 2596} 2597} 2598formsApp.addNoticeText=function(message, className){ 2599$f(this.notification).find(' > p').html(message); 2600if (className){ 2601this.notification.classList.add(className); 2602} else { 2603this.notification.classList.remove('ba-alert'); 2604} 2605this.notification.classList.remove('animation-out') 2606this.notification.classList.add('notification-in'); 2607clearTimeout(this.notification.hideDelay); 2608this.notification.hideDelay=setTimeout(function(){ 2609formsApp.hideNotice(); 2610setTimeout(function(){ 2611if (className){ 2612formsApp.notification.classList.remove(className); 2613} 2614formsApp.notification.showCallback(); 2615}, 400); 2616}, 6000); 2617} 2618formsApp.getLocalStorage=function(){ 2619let storage=localStorage.getItem('forms-progress'), 2620date=+new Date(), 2621expire=false; 2622if (!storage){ 2623storage='{}'; 2624} 2625formsApp.storage=JSON.parse(storage); 2626for (let ind in formsApp.storage){ 2627let page=formsApp.storage[ind]; 2628for (let key in page){ 2629let data=page[key]; 2630if (Math.floor((date - data.date) / (1000 * 60 * 60 * 24)) > 30){ 2631expire=true; 2632delete formsApp.storage[ind][key]; 2633} 2634} 2635} 2636if (expire){ 2637localStorage.setItem('forms-progress', JSON.stringify(formsApp.storage)); 2638} 2639} 2640formsApp.fetch={ 2641getErrorText: function(text){ 2642let div=document.createElement('div'); 2643div.innerHTML=text; 2644if (div.querySelector('title')){ 2645text=div.querySelector('title').textContent; 2646} 2647return text; 2648}, 2649request: async function(url, data){ 2650let request=await fetch(url, { 2651headers: { 2652'Content-Type': 'application/x-www-form-urlencoded', 2653}, 2654method: 'POST', 2655cache: 'no-cache', 2656body: this.getFormData(data) 2657}
2657), 2658response=null; 2659if (request.ok){ 2660response=await request.text(); 2661} else { 2662let utf8Decoder=new TextDecoder("utf-8"), 2663reader=request.body.getReader(), 2664textData=await reader.read(), 2665text=utf8Decoder.decode(textData.value); 2666console.info(this.getErrorText(text)); 2667} 2668return response; 2669}, 2670getFormData: function(data){ 2671let formData=new URLSearchParams(); 2672formData.append(formsApp.token, '1'); 2673if (data){ 2674for (let ind in data){ 2675if (Array.isArray(data[ind])){ 2676data[ind].forEach(v=> { 2677formData.append(`${ind}[]`, v); 2678}) 2679} else if (typeof data[ind]=='object'){ 2680for (let i in data[ind]){ 2681formData.append(`${ind}[${i}]`, data[ind][i]); 2682} 2683} else { 2684formData.append(ind, data[ind]); 2685} 2686} 2687} 2688return formData; 2689}, 2690} 2691formsApp.countries={ 2692append: function(){ 2693document.querySelectorAll('.ba-form-phone-field .ba-phone-countries-list').forEach(function(ul){ 2694if (!ul.querySelector('li')){ 2695ul.innerHTML=formsApp.countries.html; 2696} 2697}) 2698}, 2699check: function(){ 2700if (this.data){ 2701this.append() 2702} else if (document.querySelector('.ba-form-phone-field')&&!this.loading){ 2703this.load(); 2704} 2705}, 2706readCountries: function(){ 2707return new Promise(function(resolve){ 2708fetch(JUri+'index.php?option=com_baforms&task=form.readCountries').then(function(response){ 2709if (response.ok){ 2710response.json().then(function(json){ 2711resolve(json); 2712}); 2713} else { 2714console.info(response) 2715} 2716}); 2717}); 2718}, 2719load: function(){ 2720this.loading=true; 2721fetch(JUri+'components/com_baforms/libraries/countries/countries.json').then(function(response){ 2722if (!response.ok){ 2723return formsApp.countries.readCountries() 2724} else { 2725return response.json(); 2726} 2727}).then(function(json){ 2728formsApp.countries.set(json); 2729}); 2730}, 2731set: function(data){ 2732let html=''; 2733for (let ind in data){ 2734const prefix=data[ind].prefix; 2735const title=data[ind].title; 2736const placeholder=data[ind].placeholder.replace(/X/g, '_'); 2737html +=`<li class="ba-phone-country-item" data-prefix="+${prefix}" tabindex="0" 2738data-flag="${ind}" data-title="${title}" data-placeholder="${placeholder}"> 2739<span class="ba-phone-flag ba-phone-flag-${ind}"></span> 2740<span class="ba-phone-country-title">${title}</span> 2741<span class="ba-phone-country-prefix">+${prefix}</span> 2742</li>`; 2743} 2744this.html=html; 2745this.data=data; 2746this.append(); 2747}, 2748hide: ()=> { 2749const wrapper=$f('.visible-countries-list').removeClass('visible-countries-list'); 2750const list=wrapper.find('.ba-phone-countries-list-wrapper')[0]; 2751if (!list) return; 2752FormsAccessibilityHelper.releaseTrap(list); 2753} 2754} 2755formsApp.createForms=function(){ 2756FormsSignature.boot(); 2757formsApp.refreshToken() 2758formsApp.checkGoogleMaps(); 2759formsApp.checkLanguage(); 2760formsApp.countries.check(); 2761formsApp.getLocalStorage(); 2762CaptchaHelper.loadIfExist(); 2763$f('.com-baforms-wrapper').each(formsApp.createForm) 2764.closest('.ba-form-lightbox-layout').each(formsApp.renderLightbox); 2765} 2766formsApp.renderLightbox=function(){ 2767if (!this.trigger){ 2768this.trigger=JSON.parse(this.dataset.trigger); 2769this.session=JSON.parse(this.dataset.session); 2770$f(this).removeAttr('data-trigger').removeAttr('data-session') 2771} 2772if (!this.session.enable){ 2773formsApp.initLightbox(this); 2774} else if (this.session.enable&&this.trigger.type !=''){ 2775let flag=true; 2776if (localStorage['formsModal-'+this.dataset.id]){ 2777let date=new Date().getTime(), 2778expires=new Date(localStorage[this.dataset.id]); 2779expires.getTime(); 2780if (date >=expires){ 2781flag=true; 2782localStorage.removeItem(this.dataset.id); 2783} else { 2784flag=false; 2785} 2786} 2787if (flag){ 2788formsApp.initLightbox(this); 2789} 2790} 2791} 2792formsApp.showLightbox=function($this){ 2793if ($this.session.enable){ 2794const expiration=new Date(); 2795expiration.setDate(expiration.getDate()+$this.session.duration); 2796localStorage.setItem('formsModal-'+$this.dataset.id, expiration); 2797} 2798$f($this).formsModal().find('.ba-form-submit-btn').each(function(){ 2799CaptchaHelper.createIfExist(this); 2800}); 2801} 2802formsApp.initLightbox=function($this){ 2803if ($this.trigger.type=='time-delay'){ 2804setTimeout(function(){ 2805formsApp.showLightbox($this); 2806}, $this.trigger.time); 2807} else if ($this.trigger.type=='scrolling'){ 2808formsApp.lightboxScroll($this, $this.trigger.scroll * 1); 2809} else if ($this.trigger.type=='exit-intent'){ 2810$f(document).one('mouseleave', function(){ 2811formsApp.showLightbox($this); 2812}); 2813} else if ($this.trigger.type=='bottom-of-page'){ 2814formsApp.lightboxScroll($this, 100); 2815} 2816} 2817formsApp.lightboxScroll=function($this, scroll){ 2818let top, 2819docHeight, 2820htmlHeight; 2821$f(window).on('scroll.ba-lightbox'+$this.dataset.id+' load.ba-lightbox'+$this.dataset.id, function(){ 2822top=$f(window).scrollTop(); 2823docHeight=document.documentElement.clientHeight 2824htmlHeight=Math.max( 2825document.body.scrollHeight, document.documentElement.scrollHeight, 2826document.body.offsetHeight, document.documentElement.offsetHeight, 2827document.body.clientHeight, document.documentElement.clientHeight 2828); 2829const x=(docHeight + top) * 100 / htmlHeight; 2830if (x >=scroll || (scroll > 97&&x >=97)){ 2831$f(window).off('scroll.ba-lightbox'+$this.dataset.id+' load.ba-lightbox'+$this.dataset.id); 2832formsApp.showLightbox($this) 2833} 2834}); 2835} 2836formsApp.checkAlert=function(form){ 2837form.find('.confirm-email-wrapper').find('input').each(function(){ 2838let alert=!this.value.trim(), 2839key='THIS_FIELD_REQUIRED'; 2840if (this.value){ 2841alert=!(/@/g.test(this.value)&&this.value.match(/@/g).length==1); 2842key='ENTER_VALID_VALUE'; 2843if (!alert){ 2844let email=this.closest('.ba-form-field-item').querySelector('.ba-input-wrapper input').value.trim(); 2845alert=!(email==this.value.trim()); 2846key='EMAIL_ADDRESSES_NOT_MATCH'; 2847} 2848} 2849formsApp.toggleAlertTooltip(alert, this, this.closest('.ba-field-container'), key); 2850}); 2851form.find('.ba-form-signature-field').each(function(){ 2852if (this.dataset.required){ 2853let alert=this.instance.isEmpty(), 2854container=this.querySelector('.ba-field-container'); 2855formsApp.toggleAlertTooltip(alert, container, container, 'THIS_FIELD_REQUIRED'); 2856} 2857}) 2858form.find('.confirm-password-wrapper').find('input').each(function(){ 2859let password=this.closest('.ba-form-field-item').querySelector('.ba-input-wrapper input').value.trim(), 2860alert=this.required&&!this.value.trim(), 2861key='THIS_FIELD_REQUIRED'; 2862if (password){ 2863alert=!(password==this.value.trim()); 2864key='PASSWORDS_NOT_MATCH'; 2865} 2866formsApp.toggleAlertTooltip(alert, this, this.closest('.ba-field-container'), key); 2867}); 2868form.find('.ba-form-input-field, .ba-form-address-field').find(' > .ba-input-wrapper').find('input, textarea').each(function(){ 2869let alert=this.required&&!this.value.trim(), 2870key='THIS_FIELD_REQUIRED'; 2871if (this.formsInputMask){ 2872alert=this.required&&this.value==this.formsInputMask; 2873} 2874if (this.value&&this.characters&&this.characters.key=='min'){ 2875alert=!(this.value.length >=this.characters.length); 2876key='ENTER_VALID_VALUE'; 2877} else if (this.value&&this.dataset.validation=='email'){ 2878alert=!(/@/g.test(this.value)&&this.value.match(/@/g).length==1); 2879key='ENTER_VALID_VALUE'; 2880} else if (this.value&&this.dataset.validation=='numbers'){ 2881alert=!(/\d+\.{0,1}\d{0,}/.test(this.value)); 2882key='ENTER_VALID_VALUE'; 2883} else if (this.value&&this.dataset.validation=='url'){ 2884alert=!(/\b(?:(?:https?|ftp):\/\/|www\.)[-a-z0-9+&@#\/%?=~_|!:,.;]*[-a-z0-9+&@#\/%=~_|]/i.test(this.value)); 2885key='ENTER_VALID_VALUE'; 2886} else if (!alert&&this.value&&this.formsInputMask){ 2887alert=this.value !=this.formsInputMask&&this.value.indexOf('_') !=-1; 2888key='ENTER_VALID_VALUE'; 2889} 2890formsApp.toggleAlertTooltip(alert, this, this.closest('.ba-field-container'), key); 2891}); 2892form.find('.ba-form-phone-field input.ba-phone-number-input').each(function(){ 2893let alert=this.required&&this.value==this.formsInputMask, 2894key='THIS_FIELD_REQUIRED'; 2895if (!alert&&this.value){ 2896alert=this.value !=this.formsInputMask&&this.value.indexOf('_') !=-1; 2897key='ENTER_VALID_VALUE'; 2898} 2899formsApp.toggleAlertTooltip(alert, this, this.closest('.ba-field-container'), key); 2900}); 2901form.find('.ba-form-upload-field').find('input[type="file"]').each(function(){ 2902const alert=this.required&&this.uploads.count==0; 2903formsApp.toggleAlertTooltip(alert, this, this.closest('.upload-file-input'), 'THIS_FIELD_REQUIRED'); 2904}); 2905form.find('.ba-form-field-item').find('.ba-form-rating-group-wrapper').each(function(){ 2906if (this.dataset.required){ 2907let alert=false; 2908$f(this).find('input').each(function(){ 2909alert=!this.checked; 2910if (this.checked){ 2911return false;
2912} 2913}) 2914formsApp.toggleAlertTooltip(alert, this, this.closest('.ba-form-rating-group-wrapper'), 'THIS_FIELD_REQUIRED'); 2915} 2916}); 2917form.find('.ba-form-field-item').find('.ba-form-checkbox-group-wrapper').each(function(){ 2918if (this.dataset.required){ 2919let alert=false; 2920$f(this).find('input').each(function(){ 2921alert=!this.checked; 2922if (this.checked){ 2923return false; 2924} 2925}) 2926formsApp.toggleAlertTooltip(alert, this, this.closest('.ba-form-checkbox-group-wrapper'),'THIS_FIELD_REQUIRED'); 2927} 2928}); 2929form.find('.ba-form-dropdown-field, .ba-form-select-multiple-field').find('select').each(function(){ 2930let alert=this.required&&!this.value.trim(); 2931formsApp.toggleAlertTooltip(alert, this, this.closest('.ba-field-container'), 'THIS_FIELD_REQUIRED'); 2932}); 2933form.find('.ba-form-acceptance-field').find('.ba-field-container').each(function(){ 2934if (this.dataset.required){ 2935let alert=false; 2936$f(this).find('input').each(function(){ 2937alert=!this.checked; 2938if (this.checked){ 2939return false; 2940} 2941}) 2942formsApp.toggleAlertTooltip(alert, this, this, 'THIS_FIELD_REQUIRED'); 2943} 2944}); 2945form.find('.ba-form-calendar-field input[required]').each(function(){ 2946formsApp.toggleAlertTooltip(!this.value.trim(), this, this.closest('.calendar-field-wrapper'), 'THIS_FIELD_REQUIRED'); 2947}) 2948let tooltip=form.find('.ba-form-field-item .ba-alert-tooltip'); 2949if (tooltip.length){ 2950tooltip[0].closest('.ba-form-field-item').scrollIntoView({ 2951block: 'center' 2952}); 2953return false; 2954} 2955} 2956formsApp.toggleAlertTooltip=function(alert, $this, parent, key){ 2957if (alert&&!$this.alertTooltip&&!$this.closest('.hidden-condition-field')){ 2958$this.alertTooltip=document.createElement('span'); 2959$this.alertTooltip.className='ba-alert-tooltip'; 2960$this.alertTooltip.textContent=formsApp._(key); 2961let str='.ba-input-wrapper, .confirm-email-wrapper, .confirm-password-wrapper, .forms-recaptcha,'+ 2962' .calendar-field-wrapper, .ba-forms-authorize-field-wrapper'; 2963parent.closest(str).classList.add('ba-alert'); 2964parent.appendChild($this.alertTooltip); 2965} else if (alert&&$this.alertTooltip){ 2966$this.alertTooltip.textContent=formsApp._(key); 2967} else if (!alert&&$this.alertTooltip){ 2968formsApp.removeAlertTooltip($this); 2969} 2970} 2971formsApp.removeAlertTooltip=function($this){ 2972if ($this.alertTooltip){ 2973$this.alertTooltip.remove(); 2974$this.alertTooltip=null; 2975$this.closest('.ba-alert').classList.remove('ba-alert'); 2976} 2977} 2978formsApp.checkLanguage=function(){ 2979if (!formsApp.language){ 2980fetch(JUri+'index.php?option=com_baforms&task=form.getFormsLanguage').then(function(response){ 2981return response.json(); 2982}).then(function(json){ 2983formsApp.language=json; 2984}); 2985} 2986} 2987formsApp._=function(key){ 2988if (formsApp.language&&formsApp.language[key]){ 2989return formsApp.language[key]; 2990} 2991return key; 2992} 2993class FormsSignature 2994{ 2995static loading=false; 2996static loaded=false; 2997static selector='.ba-form-signature-field'; 2998static boot(){ 2999if (!document.querySelector(this.selector)) return; 3000if (!this.loaded&&!this.loading){ 3001this.loadScript(); 3002} else if (this.loaded){ 3003this.make(); 3004} 3005} 3006static loadScript(){ 3007this.loading=true; 3008const script=document.createElement('script'); 3009script.src=`${JUri}components/com_baforms/assets/js/signature.js`; 3010script.onload=()=> { 3011this.loaded=true; 3012this.make(); 3013} 3014document.head.append(script); 3015} 3016constructor(element){ 3017this.element=element; 3018this.container=this.element.querySelector('.ba-field-container'); 3019this.clearButton=this.element.querySelector('.ba-clear-signature-canvas'); 3020this.textarea=this.element.querySelector('textarea'); 3021this.$textarea=$f(this.textarea); 3022this.signature=this.create(); 3023this.setEvents(); 3024} 3025isEmpty(){ 3026return this.signature.isEmpty(); 3027} 3028create(){ 3029const canvas=this.element.querySelector('canvas'); 3030canvas.width=canvas.offsetWidth; 3031canvas.height=canvas.offsetHeight; 3032return new SignaturePad(canvas, { 3033backgroundColor: canvas.dataset.bg, 3034penColor: canvas.dataset.color 3035}); 3036} 3037setEvents(){ 3038this.signature.addEventListener('beginStroke', this.beginStroke.bind(this)); 3039this.signature.addEventListener('endStroke', this.endStroke.bind(this)); 3040this.clearButton.addEventListener('click', this.clear.bind(this)); 3041} 3042beginStroke(){ 3043formsApp.removeAlertTooltip(this.container); 3044} 3045endStroke(){ 3046const str=JSON.stringify({ 3047image: this.signature.toDataURL('image/jpeg') 3048}); 3049this.updateTextarea(str) 3050} 3051clear(){ 3052this.signature.clear(); 3053this.updateTextarea() 3054} 3055updateTextarea(value=''){ 3056this.textarea.value=value; 3057this.$textarea.trigger('input'); 3058} 3059static make(){ 3060document.querySelectorAll(this.selector).forEach(field=> { 3061if (field.instance || field.closest('.ba-hidden-form-page')){ 3062return; 3063} 3064field.instance=new this(field); 3065}); 3066} 3067} 3068formsApp.checkGoogleMaps=function(){
3069if (loadFormsMap.load&&!formsApp.googleMaps&&!loadFormsMap.loading){ 3070loadFormsMap.loading=true; 3071let script=document.createElement('script'); 3072script.src=JUri+'components/com_baforms/assets/js/mapStyles.js'; 3073script.onload=function(){ 3074formsApp.mapScript=document.createElement('script'); 3075formsApp.mapScript.onload=function(){ 3076formsApp.googleMaps=true; 3077$f('.ba-form-map-field .ba-map-wrapper').each(function(){ 3078formsApp.createGoogleMap(this, this.options); 3079}); 3080$f('.ba-form-address-field input').each(function(){ 3081this.createAutocomplete(); 3082}); 3083} 3084formsApp.mapScript.src='https://maps.googleapis.com/maps/api/js?libraries=places&key='+loadFormsMap.api_key; 3085document.head.append(formsApp.mapScript); 3086} 3087document.head.append(script); 3088} 3089} 3090formsApp.createGoogleMap=function(div, obj){ 3091div.map=new google.maps.Map(div, obj.map); 3092div.map.setOptions({styles: mapStyles[obj.styleType]}); 3093if (obj.marker.position){ 3094let object={ 3095position : obj.marker.position, 3096map : div.map 3097} 3098if (obj.marker.icon){ 3099object.icon=JUri+obj.marker.icon; 3100} 3101let marker=new google.maps.Marker(object); 3102if (obj.marker.description){ 3103marker.infoWindow=new google.maps.InfoWindow({ 3104content : obj.marker.description 3105}); 3106if (obj.marker.infobox==1){ 3107marker.infoWindow.open(div.map, marker); 3108} 3109marker.addListener('click', function(){ 3110this.infoWindow.open(div.map, this); 3111}); 3112} 3113} 3114} 3115formsApp.removeTmpAttachment=function(attachment, input, $this){ 3116if (attachment.dataset.id){ 3117delete input.uploads[attachment.dataset.id]; 3118input.uploads.count--; 3119formsApp.updateFieldsValues($this.fields, input, input.fieldId); 3120formsApp.calculation($this); 3121formsApp.fetch.request(JUri+'index.php?option=com_baforms&task=form.removeTmpAttachment', { 3122id: attachment.dataset.id 3123}).then(()=> attachment.remove()); 3124} 3125} 3126formsApp.getAttachmentHTML=function(input, type, name, $this){ 3127let attachment=document.createElement('div'), 3128str=''; 3129attachment.className='ba-form-xhr-attachment'; 3130if (type=='file'){ 3131str +='<i class="ba-form-icons ba-icon-attachment"></i>'; 3132} else { 3133str +='<span class="attachment-intro-image"></span>'; 3134} 3135str +='<span class="forms-attachment-title">'+name; 3136str +='</span><span class="forms-attachment-progress-bar-wrapper"><span class="forms-attachment-progress-bar">'; 3137str +='</span></span><i class="ba-form-icons ba-icon-delete" tabindex="0"></i>'; 3138attachment.innerHTML=str; 3139$f(attachment).find('.ba-icon-delete').on('click keyup', function(event){ 3140FormsAccessibilityHelper.processAction(event, ()=> { 3141formsApp.removeTmpAttachment(attachment, input, $this); 3142}) 3143}); 3144return attachment; 3145} 3146formsApp.uploadAttachmentFile=function(files, input, $this){ 3147if (files.length&& 3148(input.options.count=='' || (input.options.count !=''&&input.uploads.count < input.options.count))){ 3149let file=files.shift(), 3150type=input.options.images.indexOf(file.ext)==-1 ? 'file' : 'image', 3151attachment=formsApp.getAttachmentHTML(input, type, file.name, $this), 3152xhr=new XMLHttpRequest(), 3153formData=new FormData(); 3154if (type=='image'){ 3155let reader=new FileReader(); 3156reader.onloadend=function(){ 3157attachment.querySelector('.attachment-intro-image').style.backgroundImage='url('+reader.result+')'; 3158} 3159reader.readAsDataURL(file); 3160} 3161const { token }=formsApp; 3162formData.append(token, "1"); 3163formData.append('file', file); 3164formData.append('id', input.options.id); 3165formData.append('field_id', input.dataset.id); 3166formData.append('option', 'com_balbooa_forms'); 3167formData.append('task', 'form.uploadAttachmentFile'); 3168xhr.upload.onprogress=function(e){ 3169const bar=attachment.querySelector('.forms-attachment-progress-bar'); 3170bar.style.width=Math.round(e.loaded / e.total * 100) + "%"; 3171} 3172xhr.onload=xhr.onerror=function(){ 3173try { 3174const response=JSON.parse(this.responseText); 3175if (response.id){ 3176input.uploads[response.id]=response; 3177attachment.dataset.id=response.id; 3178input.uploads.count++; 3179} else { 3180attachment.remove() 3181} 3182} catch (error){ 3183console.info(error) 3184console.info(this.responseText) 3185} 3186formsApp.uploadAttachmentFile(files, input, $this); 3187setTimeout(function(){ 3188attachment.classList.add('forms-attachment-file-uploaded') 3189}, 300); 3190}; 3191input.options[type+'Container'].appendChild(attachment); 3192xhr.open("POST", JUri+"index.php", true); 3193xhr.send(formData); 3194} else { 3195input.uploading=''; 3196formsApp.updateFieldsValues($this.fields, input, input.fieldId); 3197formsApp.calculation($this); 3198} 3199} 3200formsApp.sendAjaxForm=function(form, $this){ 3201$this.form.find('.ba-form-total-field .ba-cart-total-row .field-price-value').each(function(){ 3202let object={ 3203products: $f.extend(true, {}, this.calculation.products), 3204total: this.calculation.total, 3205resultTotal : this.calculation.resultTotal 3206} 3207for (let ind in object.products){ 3208for (let i in object.products[ind]){ 3209delete object.products[ind][i].input; 3210} 3211} 3212if (this.calculation.shipping){ 3213this.calculation.shipping.forEach(function(input){ 3214if (input.checked){ 3215object.shipping={ 3216price: input.price * 1, 3217ind: input.dataset.ind, 3218title: input.dataset.title 3219} 3220} 3221}); 3222} 3223if (this.calculation.promo){ 3224object.promo=this.calculation.promo.code; 3225} 3226this.calculation.input.value=JSON.stringify(object); 3227}); 3228let clone=form.cloneNode(true),
3229payments=['authorize', 'cloudpayments', 'paypal_sdk'], 3230submitBtn=form.submitBtn; 3231clone['submit-btn'].value=submitBtn.options.id; 3232clone.task.value='form.message'; 3233$this.form.find('.upload-file-input .ba-forms-attachment').each(function(){ 3234let obj=$f.extend(true, {}, this.uploads), 3235str, 3236name=this.dataset.id; 3237delete obj.count; 3238str=JSON.stringify(obj); 3239clone.querySelector('textarea[name="'+name+'"]').value=str; 3240}); 3241$this.form.find('select[name]').each(function(){ 3242let cloneOptions=$f(clone).find('select[name="'+this.name+'"] option'); 3243this.querySelectorAll('option').forEach(function(element, ind){ 3244cloneOptions.get(ind).selected=element.selected; 3245}); 3246}); 3247$f(clone).find('.hidden-condition-field').remove(); 3248if (!(submitBtn.options.onclick=='payment'&&payments.indexOf(submitBtn.options.payment) !=-1)){ 3249submitBtn.classList.add('ba-thank-you-animation-in'); 3250} 3251if (submitBtn.options.onclick=='payment'&&submitBtn.options.payment=='stripe'){ 3252formsApp.executeStripePayment(form, clone, $this); 3253} else if (submitBtn.options.onclick=='payment'&&submitBtn.options.payment=='paypal_sdk'){ 3254formsApp.executePaypalPayment(form, clone, $this); 3255} else if (submitBtn.options.onclick=='payment'&&submitBtn.options.payment=='authorize'){ 3256formsApp.executeAuthorizePayment(form, clone, $this); 3257} else if (submitBtn.options.onclick=='payment'&&submitBtn.options.payment=='cloudpayments'){ 3258formsApp.executeCloudPayments(form, clone, $this); 3259} else if (submitBtn.options.onclick=='payment'){ 3260const tokenInput=document.createElement('input'); 3261tokenInput.name=formsApp.token; 3262tokenInput.value='1'; 3263clone.append(tokenInput); 3264clone.style.display='none'; 3265document.body.append(clone); 3266clone.submit(); 3267} else { 3268formsApp.XMLHttpRequestForm(form, clone, $this); 3269} 3270} 3271formsApp.executeCloudPayments=function(form, clone, $this){ 3272if (!('cp' in window)){ 3273let script=document.createElement('script'); 3274script.onload=function(){ 3275formsApp.loadCloudPaymentsData(form, clone, $this); 3276} 3277script.src="https://widget.cloudpayments.ru/bundles/cloudpayments"; 3278document.head.append(script); 3279} else { 3280let object={}, 3281title=[], 3282code='RUB', 3283widget=new cp.CloudPayments(), 3284invoiceId=+(new Date()); 3285$this.form.find('.ba-form-total-field .ba-cart-total-row .field-price-value').each(function(){ 3286if (!this.closest('.hidden-condition-field')){ 3287code=this.calculation.code; 3288object=JSON.parse(this.calculation.input.value); 3289} 3290}); 3291for (let ind in object.products){ 3292for (let i in object.products[ind]){ 3293title.push(object.products[ind][i].title) 3294} 3295} 3296if (object.shipping){ 3297title.push(object.shipping.title); 3298} 3299const options={ 3300publicId: formsApp.cloudPayments.public_id, 3301description: title.join(', '), 3302amount: object.resultTotal, 3303invoiceId: invoiceId, 3304currency: code, 3305skin: 'modern' 3306} 3307if (formsApp.cloudPayments.fiscalization){ 3308const receipt={ 3309email: form.querySelector('input[type="email"]')?.value ?? '', 3310taxationSystem: formsApp.cloudPayments.taxationSystem, 3311Items: [ 3312{ 3313"label": options.description, 3314"price": object.resultTotal, 3315"quantity": 1.00, 3316"amount": object.resultTotal, 3317"vat": formsApp.cloudPayments.vat=='null' ? null : formsApp.cloudPayments.vat, 3318"method": formsApp.cloudPayments.method, 3319"object": formsApp.cloudPayments.object 3320} 3321] 3322} 3323options.data={ 3324CloudPayments: { 3325CustomerReceipt: receipt, 3326} 3327}; 3328} 3329widget.charge(options, function(){ 3330let input=document.createElement('input'); 3331form.submitBtn.classList.add('ba-thank-you-animation-in'); 3332input.type='hidden'; 3333input.name='invoiceId'; 3334input.value=invoiceId; 3335clone.append(input); 3336formsApp.XMLHttpRequestForm(form, clone, $this); 3337}, function(){ 3338form.status=''; 3339}); 3340} 3341} 3342formsApp.showMessagePopup=(btn, html, animation, $this)=> { 3343if (!btn.popup){ 3344let div=document.createElement('div'), 3345properties=['width', 'radius', 'background-color', 'backdrop-color', 'icon-color'], 3346wrapper=btn.closest('.ba-form-submit-wrapper'); 3347div.innerHTML='<div class="ba-forms-modal-backdrop" data-dismiss="formsModal"></div>'+ 3348'<div class="ba-forms-modal">'+ 3349'<i class="ba-form-icons ba-icon-close" data-dismiss="formsModal" tabindex="0"></i>'+ 3350'<div class="ba-forms-modal-body"></div>'+ 3351'</div>'; 3352div.className='ba-forms-modal-wrapper ba-form-message-popup '+animation; 3353div.dataset.form=$this.formId;
3354properties.forEach((property)=> { 3355div.style.setProperty('--submit-popup-'+property, wrapper.style.getPropertyValue('--submit-popup-'+property)); 3356}) 3357btn.popup=$f(div); 3358document.body.append(div); 3359} 3360btn.popup.find('.ba-forms-modal-body').html(html); 3361setTimeout(()=> { 3362btn.popup.formsModal(); 3363btn.popup.find('.ba-forms-modal').each(function(){ 3364this.style.setProperty('--popup-modal-height', this.offsetHeight+'px'); 3365}); 3366}, 300); 3367} 3368formsApp.executeAuthorizePayment=function(form, clone, $this){ 3369if (!formsApp.authorize){ 3370let div=document.createElement('div'), 3371btn; 3372div.innerHTML='<div class="ba-forms-modal-backdrop" data-dismiss="formsModal"></div>'+ 3373'<div class="ba-forms-modal">'+ 3374'<div class="ba-forms-modal-header"><span class="ba-forms-modal-title">Authorize.Net</span>'+ 3375'<i class="ba-form-icons ba-icon-close" data-dismiss="formsModal" tabindex="0"></i></div>'+ 3376'<div class="ba-forms-modal-body">'+ 3377'<div class="ba-forms-authorize-field-wrapper">'+ 3378'<input type="text" class="ba-forms-authorize-card-number"><i class="ba-form-icons ba-icon-card"></i></div>'+ 3379'<div class="ba-forms-authorize-field-wrapper">'+ 3380'<input type="text" class="ba-forms-authorize-expiration-date"><i class="ba-form-icons ba-icon-calendar"></i>'+ 3381'</div>'+ 3382'<div class="ba-forms-authorize-field-wrapper">'+ 3383'<input type="text" class="ba-forms-authorize-card-code"><i class="ba-form-icons ba-icon-lock"></i></div>'+ 3384'</div><div class="ba-forms-modal-footer"><span class="ba-forms-authorize-pay-btn">'+ 3385'<span class="ba-forms-authorize-pay">'+formsApp._('PAY')+'</span>'+ 3386'<span class="field-price-currency"></span><span class="field-price-value"></span>'+ 3387'</span></div></div>'; 3388div.className='ba-forms-modal-wrapper ba-form-authorize-modal'; 3389btn=div.querySelector('.ba-forms-authorize-pay-btn'); 3390btn.cardNumber=div.querySelector('.ba-forms-authorize-card-number'); 3391btn.expirationDate=div.querySelector('.ba-forms-authorize-expiration-date'); 3392btn.cardCode=div.querySelector('.ba-forms-authorize-card-code'); 3393btn.cardNumber.placeholder='Card Number'; 3394btn.expirationDate.placeholder='MM / YY'; 3395btn.cardCode.placeholder='CVC'; 3396btn.cardNumber.addEventListener('input', function(){ 3397let value=this.value.replace(/\s/g, ''), 3398match=value.match(/\d{1,16}/); 3399if (!match){ 3400this.value=''; 3401} else { 3402let str='', 3403j=1; 3404for (let i=0; i < match[0].length; i++){ 3405if (j==5){ 3406j=1; 3407str +=' '; 3408} 3409str +=match[0][i]; 3410j++; 3411} 3412if (str !=this.value){ 3413this.value=str; 3414} 3415} 3416this.filled=this.value.length >=14; 3417}); 3418btn.expirationDate.addEventListener('input', function(){ 3419formsApp.executeMask(this, '##/##'); 3420this.filled=!!this.value.match(/\d\d\/\d{2}/); 3421}); 3422btn.cardCode.addEventListener('input', function(){ 3423let match=this.value.match(/\d{1,4}/); 3424if (!match){ 3425this.value=''; 3426} else if (match[0] !=this.value){ 3427this.value=match[0]; 3428} 3429this.filled=this.value.length >=3; 3430}); 3431btn.cardNumber.addEventListener('focus', function(){ 3432formsApp.removeAlertTooltip(this); 3433}); 3434btn.expirationDate.addEventListener('focus', function(){ 3435formsApp.removeAlertTooltip(this); 3436}); 3437btn.cardCode.addEventListener('focus', function(){ 3438formsApp.removeAlertTooltip(this); 3439}); 3440formsApp.authorize=$f(div); 3441document.body.append(div); 3442} 3443formsApp.authorize.attr('data-form', $this.formId); 3444let price=symbol='', 3445position=false, 3446total=0; 3447$this.form.find('.ba-form-total-field .ba-cart-total-row .field-price-value').each(function(){ 3448if (!this.closest('.hidden-condition-field')){ 3449total=this.calculation.resultTotal; 3450price=this.textContent; 3451symbol=this.calculation.symbol; 3452position=this.closest('.ba-field-container').classList.contains('right-currency-position'); 3453} 3454}); 3455formsApp.authorize.find('input').val('').each(function(){ 3456this.filled=false; 3457formsApp.removeAlertTooltip(this); 3458}); 3459formsApp.authorize.find('.ba-forms-authorize-pay-btn').each(function(){ 3460this.classList[position ? 'add' : 'remove']('right-currency-position'); 3461this.querySelector('.field-price-currency').textContent=symbol; 3462this.querySelector('.field-price-value').textContent=price; 3463this.total=total; 3464}).off('click').on('click', function(){ 3465let btn=this; 3466if (!btn.status&&btn.cardNumber.filled&&btn.expirationDate.filled&&btn.cardCode.filled){ 3467btn.status='pending'; 3468btn.classList.add('ba-thank-you-animation-in'); 3469formsApp.fetch.request(JUri+'index.php?option=com_baforms&task=form.payAuthorize', { 3470id : $this.formId, 3471cardNumber: btn.cardNumber.value,
3472expirationDate: btn.expirationDate.value, 3473cardCode: btn.cardCode.value, 3474total : total 3475}).then(function(text){ 3476let obj=JSON.parse(text), 3477input=document.createElement('input'), 3478flag=obj.transactionResponse&&obj.transactionResponse.transId !='' 3479&&obj.transactionResponse.transId !=0; 3480setTimeout(function(){ 3481btn.classList.remove('ba-thank-you-animation-in'); 3482btn.classList.add('ba-thank-you-animation-out'); 3483setTimeout(function(){ 3484btn.classList.remove('ba-thank-you-animation-out'); 3485if (!flag){ 3486msg=''; 3487if (obj.transactionResponse){ 3488obj.transactionResponse.errors.forEach(function(error){ 3489msg +=(msg ? ', ' : '')+error.errorText; 3490}); 3491} 3492msg=msg ? msg : 'Transaction failed'; 3493formsApp.showNotice(msg, 'ba-alert'); 3494} 3495setTimeout(function(){ 3496btn.status=''; 3497if (flag){ 3498input.type='hidden'; 3499input.name='transId'; 3500input.value=obj.transactionResponse.transId; 3501clone.append(input); 3502form.submitBtn.options.authorize_return_url=obj.return_url; 3503form.submitBtn.classList.add('ba-thank-you-animation-in'); 3504formsApp.authorize.formsModal('hide'); 3505formsApp.XMLHttpRequestForm(form, clone, $this); 3506} 3507}, 600); 3508}, 300); 3509}, 2000); 3510}) 3511} else if (!btn.status){ 3512['cardNumber', 'expirationDate', 'cardCode'].forEach(function(el){ 3513if (!btn[el].filled){ 3514let key=btn[el].value ? 'ENTER_VALID_VALUE' : 'THIS_FIELD_REQUIRED'; 3515formsApp.toggleAlertTooltip(true, btn[el], btn[el].closest('.ba-forms-authorize-field-wrapper'), key); 3516} 3517}); 3518} 3519}); 3520form.status=''; 3521setTimeout(function(){ 3522formsApp.authorize.formsModal(); 3523}, 100); 3524} 3525formsApp.executePaypalPayment=function(form, clone, $this){ 3526let obj=null; 3527$this.form.find('.ba-form-total-field .ba-cart-total-row .field-price-value').each(function(){ 3528if (!this.closest('.hidden-condition-field')){ 3529obj=this.calculation; 3530} 3531}); 3532if (!formsApp.paypalData){ 3533formsApp.loadPaypalData(form, clone, $this); 3534} else if (!('paypal' in window)){ 3535let script=document.createElement('script'); 3536script.onload=function(){ 3537formsApp.executePaypalPayment(form, clone, $this); 3538} 3539script.src='https://www.paypal.com/sdk/js?client-id='+formsApp.paypalData.client_id+'¤cy='+obj.code; 3540document.head.append(script); 3541} else { 3542if (!formsApp.paypal){ 3543let div=document.createElement('div'); 3544div.innerHTML='<div class="ba-forms-modal-backdrop" data-dismiss="formsModal"></div>'+ 3545'<div class="ba-forms-modal">'+ 3546'<div class="ba-forms-modal-header"><span class="ba-forms-modal-title">PayPal</span>'+ 3547'<i class="ba-form-icons ba-icon-close" data-dismiss="formsModal" tabindex="0"></i></div>'+ 3548'<div class="ba-forms-modal-body">'+ 3549'<div id="paypal-buttons-wrapper"></div>'+ 3550'</div></div>'; 3551div.className='ba-forms-modal-wrapper ba-form-paypal-modal'; 3552formsApp.paypal=$f(div); 3553document.body.append(div); 3554} 3555formsApp.paypal.attr('data-form', $this.formId); 3556formsApp.paypal.find('#paypal-buttons-wrapper')[0].innerHTML=''; 3557let total=obj.total, 3558item_total=0, 3559discount=obj.promo ? (obj.promo.unit=='%' ? total * obj.promo.discount / 100 : obj.promo.discount) : 0, 3560tax=obj.taxResult ? (total - discount) * obj.tax / 100 : 0, 3561shipping=0, 3562purchase_units=[{ 3563amount: { 3564currency: obj.code, 3565breakdown: { 3566item_total: { 3567currency_code: obj.code, 3568value: 0 3569} 3570}, 3571value: obj.resultTotal 3572}, 3573items: [], 3574}]; 3575for (let i in obj.products){ 3576for (let ind in obj.products[i]){ 3577purchase_units[0].items.push({ 3578name: obj.products[i][ind].title, 3579unit_amount: { 3580currency_code: obj.code, 3581value: formsApp.decimalAdjust('round', obj.products[i][ind].price * 1, -2), 3582}, 3583quantity: obj.products[i][ind].quantity 3584}); 3585item_total +=obj.products[i][ind].total; 3586} 3587} 3588purchase_units[0].amount.breakdown.item_total.value=formsApp.decimalAdjust('round', item_total, -2); 3589if (tax){ 3590tax=formsApp.decimalAdjust('round', tax, -2); 3591purchase_units[0].amount.breakdown.tax_total={ 3592currency_code: obj.code, 3593value: tax 3594} 3595} 3596if (discount){ 3597discount=formsApp.decimalAdjust('round', discount, -2); 3598purchase_units[0].amount.breakdown.discount={ 3599currency_code: obj.code, 3600value: discount 3601} 3602} 3603if (obj.shipping){ 3604obj.shipping.forEach(function(input){ 3605if (input.checked){ 3606shipping=formsApp.decimalAdjust('round', input.price * 1, -2); 3607purchase_units[0].amount.breakdown.shipping={ 3608currency_code: obj.code, 3609value: shipping 3610} 3611} 3612}); 3613} 3614purchase_units[0].amount.value=formsApp.decimalAdjust('round', total + tax + shipping - discount, -2); 3615paypal.Buttons({ 3616createOrder: function (data, actions){ 3617return actions.order.create({ 3618purchase_units: purchase_units 3619}); 3620}, 3621onApprove: function(data, actions){ 3622return actions.order.capture().then(function(){ 3623formsApp.paypal.formsModal('hide'); 3624form.submitBtn.classList.add('ba-thank-you-animation-in'); 3625formsApp.XMLHttpRequestForm(form, clone, $this); 3626}); 3627} 3628}).render('#paypal-buttons-wrapper').then(function(){ 3629formsApp.paypal.formsModal(); 3630}); 3631form.status=''; 3632} 3633} 3634formsApp.executeStripePayment=function(form, clone, $this){ 3635if (!('Stripe' in window)){ 3636let script=document.createElement('script'); 3637script.onload=function(){ 3638formsApp.loadStripeData(form, clone, $this); 3639} 3640script.src="https://js.stripe.com/v3"; 3641document.head.append(script); 3642} else if (!formsApp.stripeData){ 3643formsApp.loadStripeData(form, clone, $this); 3644} else { 3645let object='{}', 3646name=0; 3647formsApp.stripe=Stripe(formsApp.stripeData.api_key); 3648$this.form.find('.ba-form-total-field .ba-cart-total-row .field-price-value').last().each(function(){ 3649if (!this.closest('.hidden-condition-field')){ 3650name=this.calculation.input.name; 3651object=this.calculation.input.value; 3652} 3653}); 3654formsApp.fetch.request(JUri+'index.php?option=com_baforms&task=form.stripeCharges', { 3655object : object, 3656name: name, 3657id : $this.formId 3658}).then(function(text){ 3659let obj=JSON.parse(text), 3660input=document.createElement('input'); 3661if (obj.error){ 3662console.error(obj.error.message); 3663form.status=''; 3664form.submitBtn.classList.remove('ba-thank-you-animation-in'); 3665form.submitBtn.classList.add('ba-thank-you-animation-out'); 3666setTimeout(function(){ 3667form.submitBtn.classList.remove('ba-thank-you-animation-out'); 3668}, 300); 3669} else { 3670formsApp.stripeData.sessionId=obj.id; 3671input.type='hidden'; 3672input.name='payment_id'; 3673input.value=obj.payment_intent; 3674clone.append(input); 3675formsApp.XMLHttpRequestForm(form, clone, $this); 3676} 3677}); 3678} 3679} 3680formsApp.loadPaypalData=function(form, clone, $this){ 3681fetch(JUri+'index.php?option=com_baforms&task=form.getPaypalData').then(function(response){ 3682return response.json(); 3683}).then(function(json){ 3684formsApp.paypalData=json; 3685formsApp.executePaypalPayment(form, clone, $this); 3686}); 3687} 3688formsApp.loadStripeData=function(form, clone, $this){ 3689fetch(JUri+'index.php?option=com_baforms&task=form.getStripeData').then(function(response){ 3690return response.json(); 3691}).then(function(json){ 3692formsApp.stripeData=json; 3693formsApp.executeStripePayment(form, clone, $this); 3694}); 3695} 3696formsApp.loadCloudPaymentsData=function(form, clone, $this){ 3697fetch(JUri+'index.php?option=com_baforms&task=form.getCloudPaymentsData').then(function(response){ 3698return response.json(); 3699}).then(function(json){ 3700formsApp.cloudPayments=json; 3701formsApp.executeCloudPayments(form, clone, $this); 3702}); 3703} 3704formsApp.XMLHttpRequestForm=async function(form, clone, $this){ 3705let btn=form.submitBtn, 3706xhr=new XMLHttpRequest(), 3707data=new FormData(clone); 3708const { token }=formsApp; 3709data.append(token, "1"); 3710xhr.onload=xhr.onerror=function(){ 3711if (xhr.readyState==4){ 3712setTimeout(function(){ 3713btn.classList.remove('ba-thank-you-animation-in'); 3714btn.classList.add('ba-thank-you-animation-out'); 3715setTimeout(function(){ 3716btn.classList.remove('ba-thank-you-animation-out'); 3717setTimeout(function(){ 3718form.status=''; 3719if (formsApp.debug || xhr.status !=200){ 3720console.info(xhr.responseText); 3721} 3722let response=btn.options.onclick=='payment' ? { 3723status: true 3724} : JSON.parse(xhr.responseText); 3725if (!response.status){ 3726formsApp.showNotice(response.message, 'ba-alert'); 3727return; 3728} 3729formsApp.clearFields($this); 3730$this.form.find('.ba-form-page') 3731.addClass('ba-hidden-form-page') 3732.first() 3733.removeClass('ba-hidden-form-page'); 3734$f(btn).trigger('success-submit'); 3735if (response.isClosed){ 3736$this.form.html('<div class="ba-form-expiration-message">'+response.closedMessage+'</div>') 3737} 3738if (btn.options.onclick=='message'&&btn.options.messageType=='advanced'){ 3739formsApp.showMessagePopup(btn, response.message, btn.options.popupAnimation, $this); 3740} else if (btn.options.onclick=='message'){ 3741formsApp.showNotice(response.message); 3742} else if (btn.options.onclick=='redirect'){ 3743window.location.href=response.message; 3744} else if (btn.options.payment=='stripe'){ 3745formsApp.stripe.redirectToCheckout({ 3746sessionId: formsApp.stripeData.sessionId 3747}).then(function(result){ 3748console.info(result) 3749}); 3750} else if (btn.options.payment=='authorize'&&btn.options.authorize_return_url){ 3751window.location.href=btn.options.authorize_return_url; 3752} else if (btn.options.payment=='cloudpayments'){ 3753window.location.href=formsApp.cloudPayments.return_url; 3754} else if (btn.options.payment=='paypal_sdk'){ 3755window.location.href=formsApp.paypalData.return_url; 3756} 3757}, 500); 3758}, 300); 3759}, 1500); 3760} 3761};
3762xhr.open("POST", clone.action, true); 3763xhr.send(data); 3764} 3765formsApp.clearFields=function($this){ 3766if (formsApp.storage[$this.formURL]&&formsApp.storage[$this.formURL][$this.formId]){ 3767delete formsApp.storage[$this.formURL][$this.formId]; 3768localStorage.setItem('forms-progress', JSON.stringify(formsApp.storage)); 3769} 3770let not='[data-type="submit"],[data-type="map"],[data-type="html"],[data-type="text"],[data-type="image"],'+ 3771'[data-type="headline"]'; 3772$this.form.find('.forms-recaptcha[data-captcha="turnstile"]').each(function(){ 3773CaptchaFactory.get('turnstile').reset(this.id); 3774}) 3775$this.form.find('.ba-form-field-item').not(not).each(function(){ 3776let input=$f(this).find('[name]'); 3777switch (this.dataset.type){ 3778case 'signature': 3779this.instance.clear(); 3780input.value=''; 3781break; 3782case 'poll': 3783let id=0; 3784this.querySelectorAll('input').forEach(function(input){ 3785id=input.name.replace('[]', ''); 3786}); 3787if (id !=0){ 3788let item=this.querySelector('.ba-form-checkbox-group-wrapper'); 3789formsApp.fetch.request(JUri+'index.php?option=com_baforms&task=form.getPollResults', { 3790id: id, 3791form_id: $this.formId 3792}).then(function(text){ 3793let div=document.createElement('div'); 3794div.innerHTML=text; 3795item.querySelectorAll('.ba-form-checkbox-wrapper').forEach(function(wrapper){ 3796wrapper.remove(); 3797}); 3798div.querySelectorAll('.ba-form-checkbox-wrapper').forEach(function(wrapper){ 3799item.append(wrapper); 3800}); 3801formsApp.sortPoll(item); 3802item.classList.add('ba-poll-results'); 3803if ($this.form.find('.ba-poll-results').length !=0){ 3804setTimeout(function(){ 3805$this.form.find('.ba-form-submit-btn').remove(); 3806}, 200); 3807} 3808}); 3809} 3810break; 3811case 'input': 3812case 'address': 3813case 'calendar': 3814input.val('').trigger('input'); 3815if (this.dataset.type=='calendar'){ 3816$f(this).find('input').val(''); 3817} 3818if (this.querySelector('.confirm-email-wrapper')){ 3819this.querySelector('.confirm-email-wrapper input').value=''; 3820} 3821if (this.querySelector('.confirm-password-wrapper')){ 3822this.querySelector('.confirm-password-wrapper input').value=''; 3823this.querySelector('.confirm-password-wrapper input').type='password'; 3824} 3825if (this.querySelector('.ba-input-password-icons')){ 3826input[0].type='password'; 3827} 3828break; 3829case 'phone': 3830let parent=input.closest('.ba-field-container'), 3831flag=parent.find('.ba-phone-selected-country').attr('data-default'); 3832parent.find(`li.ba-phone-country-item[data-flag="${flag}"]`).trigger('click'); 3833break; 3834case 'radio': 3835case 'checkbox': 3836case 'rating': 3837input.prop('checked', false).trigger('change'); 3838break; 3839case 'select': 3840case 'selectMultiple': 3841input.find('option').prop('selected', false); 3842input.trigger('change'); 3843break; 3844case 'acceptance': 3845input[0].checked=false; 3846break; 3847case 'slider': 3848input.val(''); 3849$f(this).find('input[type="range"]').each(function(){ 3850if ('index' in this.dataset){ 3851this.value=this.dataset.index==0 ? this.min : this.max; 3852} else { 3853this.value=this.min; 3854} 3855}).trigger('input'); 3856break; 3857case 'upload': 3858input.val(''); 3859this.classList.remove('has-uploaded-file'); 3860this.querySelector('.ba-forms-attachment').uploads={ 3861count: 0 3862} 3863$f(this).find('.ba-forms-xhr-attachment-wrapper').empty(); 3864break; 3865} 3866}
3866); 3867} 3868class FormProgressHelper { 3869static #disabledFields={ 3870submit: true, 3871map: true, 3872html: true, 3873text: true, 3874image: true, 3875headline: true, 3876upload: true 3877} 3878static setSavedProgress(formWrapper){ 3879const { formURL, formId }=formWrapper; 3880const data=formsApp.storage[formURL]?.[formId] ?? null; 3881if (!data){ 3882return; 3883} 3884data.fields.forEach(field=> { 3885const input=formWrapper.form.find(`[name="${field.name}"]`); 3886if (!input.length){ 3887return; 3888} 3889switch (field.type){ 3890case 'input' : 3891case 'address': 3892if (input[0].formsInputMask){ 3893input[0].setSelectionRange(0, 0); 3894input[0].setRangeText(field.data.value); 3895} else { 3896input.val(field.data.value); 3897} 3898input.trigger('input'); 3899if ('confirm' in field.data){ 3900input.closest('.ba-form-field-item').find('.confirm-email-wrapper input').val(field.data.confirm); 3901} 3902if ('password' in field.data){ 3903input.closest('.ba-form-field-item').find('.confirm-password-wrapper input').val(field.data.password); 3904} 3905break; 3906case 'phone': 3907let parent=input.closest('.ba-field-container'); 3908parent.find('.ba-phone-country-item[data-flag="'+field.data.flag+'"]').trigger('click'); 3909parent.find('.ba-phone-number-input').each(function(){ 3910this.setSelectionRange(0, 0); 3911this.setRangeText(field.data.value); 3912}).trigger('input'); 3913break; 3914case 'calendar': 3915let value=field.data.value.split(' - '); 3916input.closest('.ba-field-container').find('input[type="text"]').each(function(i){ 3917this.value=value[i]; 3918}).trigger('input'); 3919break; 3920case 'radio': 3921case 'checkbox': 3922case 'rating': 3923input.each(function(){ 3924if (field.data.checked.indexOf(this.value) !=-1){ 3925this.checked=true; 3926$f(this).trigger('change'); 3927} 3928}); 3929break; 3930case 'select': 3931case 'selectMultiple': 3932input.find('option').each(function(){ 3933if (field.data.selected.indexOf(this.value) !=-1){ 3934this.selected=true; 3935input.trigger('change'); 3936} 3937}); 3938break; 3939case 'acceptance': 3940if (field.data.selected){ 3941input.prop('checked', field.data.selected); 3942} 3943break; 3944case 'slider': 3945let range=input.closest('.ba-field-container').find('input[type="range"]'); 3946input.value=field.data.value; 3947if (field.data.type=='range'){ 3948range.val(field.data.value).trigger('input'); 3949} else { 3950let array=field.data.value.split(' '); 3951range.first().val(array[0]).trigger('input'); 3952range.last().val(array[1]).trigger('input'); 3953} 3954break; 3955} 3956}) 3957} 3958static getData(formWrapper){ 3959const progress={ 3960id: formWrapper.formId, 3961date: +new Date(), 3962url: formWrapper.formURL, 3963fields: [] 3964}
3965Array.from(formWrapper.form.find('.ba-form-field-item')).forEach(item=> { 3966const { type }=item.dataset; 3967if (this.#disabledFields[type]){ 3968return; 3969} 3970const input=item.querySelector('[name]'); 3971const field={ 3972name: input.name, 3973type: type, 3974data: {} 3975} 3976switch (type){ 3977case 'input' : 3978case 'address': 3979case 'calendar': 3980field.data.value=input.value; 3981if (input.formsInputMask){ 3982field.data.value=''; 3983for (let i=0; i < input.value.length; i++){ 3984if (input.formsInputMask[i]=='_'){ 3985field.data.value +=input.value[i]; 3986} 3987} 3988} 3989if (item.querySelector('.confirm-email-wrapper')){ 3990field.data.confirm=item.querySelector('.confirm-email-wrapper input').value; 3991} 3992if (item.querySelector('.confirm-password-wrapper')){ 3993field.data.password=item.querySelector('.confirm-password-wrapper input').value; 3994} 3995break; 3996case 'phone': 3997const parent=input.closest('.ba-field-container'); 3998const flag=parent.querySelector('.ba-phone-selected-country .ba-phone-flag'); 3999const match=flag.className.match(/ba-phone-flag-\w+/); 4000const phoneNumber=parent.querySelector('.ba-phone-number-input'); 4001field.data.value=''; 4002field.data.flag=match[0].replace('ba-phone-flag-', ''); 4003for (let i=0; i < phoneNumber.value.length; i++){ 4004if (phoneNumber.placeholder[i]=='_'){ 4005field.data.value +=phoneNumber.value[i]; 4006} 4007} 4008break; 4009case 'radio': 4010case 'checkbox': 4011case 'rating': 4012field.data.checked=[]; 4013item.querySelectorAll('[name]').forEach(checkbox=> { 4014if (checkbox.checked){ 4015field.data.checked.push(checkbox.value) 4016} 4017}) 4018break; 4019case 'select': 4020case 'selectMultiple': 4021field.data.selected=[]; 4022item.querySelectorAll('select[name] option').forEach(option=> { 4023if (option.selected){ 4024field.data.selected.push(option.value) 4025} 4026}) 4027break; 4028case 'acceptance': 4029field.data.selected=input.checked; 4030break; 4031case 'slider': 4032field.data.type=item.querySelector('.form-range-wrapper') ? 'range' : 'slider'; 4033field.data.value=input.value; 4034break; 4035} 4036progress.fields.push(field); 4037}); 4038return progress; 4039} 4040} 4041formsApp.checkAutoNavigation=function($this, field){ 4042if ($this.autoNavigation.enable){ 4043let page=field.closest('.ba-form-page'), 4044next=true; 4045page.querySelectorAll('.ba-form-field-item').forEach(function(el){ 4046let empty=true; 4047if ($this.autoNavigation.fields.indexOf(el.dataset.type)==-1){ 4048} else if (el.dataset.type=='select'){ 4049empty=el.querySelector('select').value==''; 4050} else { 4051el.querySelectorAll('input').forEach(function(input){ 4052if (input.checked){ 4053empty=false; 4054return false; 4055} 4056}); 4057} 4058if (empty){ 4059next=false; 4060return false; 4061} 4062}); 4063if (next){ 4064$f(page).find('.ba-form-page-break-button[data-action="next"]').trigger('click'); 4065} 4066} 4067} 4068formsApp.submitData=()=> { 4069const form=formsApp.submitForm.form; 4070if (form.find('.ba-form-field-item:not(.hidden-condition-field)').find('.ba-alert-tooltip').length==0){ 4071form[0].status='pending'; 4072formsApp.sendAjaxForm(form[0], formsApp.submitForm); 4073} 4074formsApp.submitForm=null; 4075} 4076formsApp.createForm=function(){ 4077if (this.formId){ 4078return true; 4079} 4080let $this=this, 4081defaultValues={}; 4082$this.carts=[]; 4083$this.products={}; 4084$this.fields={}; 4085$this.calculation={}; 4086$this.items={}; 4087$this.autoNavigation={ 4088enable : false, 4089fields: ['select', 'radio', 'rating'] 4090}; 4091this.formId=this.querySelector('input[name="form-id"]').value * 1; 4092formsApp.loaded[this.formId]=this; 4093this.querySelector('input[name="page-title"]').value=document.querySelector('title').textContent; 4094this.querySelector('input[name="page-url"]').value=window.location.href; 4095this.querySelectorAll('input[name="page-id"]').forEach(function(el){ 4096if (el.value==0&&window.themeData){ 4097el.value=window.themeData.id; 4098} 4099}); 4100this.formURL=window.location.host.replace('www.', '')+window.location.pathname.replace('/index.php', ''); 4101if (this.formURL[this.formURL.length - 1] !='/'){ 4102this.formURL +='/'; 4103} 4104this.form=$f(this).find('form').on('submit', function(event){ 4105event.preventDefault(); 4106}); 4107this.form.find('.ba-form-submit-btn').each(function(){ 4108this.options={ 4109id: this.dataset.id, 4110onclick: this.dataset.onclick, 4111payment: this.dataset.payment, 4112popupAnimation: this.dataset.popupAnimation, 4113messageType: this.dataset.messageType, 4114productTitle: this.dataset.productTitle, 4115productPrice: this.dataset.productPrice 4116} 4117}).removeAttr('data-payment').removeAttr('data-id').removeAttr('data-message-type') 4118.removeAttr('data-popup-animation').on('click', async function (event){ 4119event.preventDefault(); 4120let form=$this.form[0]; 4121if (form.status !='pending'){ 4122form.submitBtn=this; 4123formsApp.submitForm=$this; 4124formsApp.checkAlert($this.form); 4125const canSubmit=await CaptchaHelper.checkResponse(this); 4126if (canSubmit){ 4127formsApp.submitData(); 4128} 4129} 4130}).removeAttr('data-onclick').removeAttr('data-message'); 4131this.form.find('.ba-poll-results').each(function(){ 4132formsApp.sortPoll(this); 4133}) 4134this.form.find('.ba-form-page-break-button').each(function(){ 4135if (this.dataset.action=='next'&&this.dataset.auto){ 4136$this.autoNavigation.enable=true; 4137} 4138}).on('click keyup', function(event){ 4139FormsAccessibilityHelper.processAction(event, ()=> { 4140let page=$f(this).closest('.ba-form-page'), 4141rect=$this.form[0].getBoundingClientRect(), 4142pageKey=page[0].dataset.pageKey; 4143if (this.dataset.action=='next'){ 4144formsApp.checkAlert(page); 4145if (page.find('.ba-form-field-item').not('.hidden-condition-field').find('.ba-alert-tooltip').length){ 4146return false;
4147} 4148} 4149page.addClass('ba-hidden-form-page'); 4150if ($this.pages&&$this.pages[pageKey]&&this.dataset.action=='next'){ 4151page=$f($this.pages[pageKey].next).removeClass('ba-hidden-form-page'); 4152page.find('.ba-form-page-break-button[data-action="back"]')[0].prevPage=pageKey; 4153} else if (this.dataset.action=='back'&&this.prevPage){ 4154page=$f($this.pages[this.prevPage].prev).removeClass('ba-hidden-form-page'); 4155this.prevPage=null; 4156} else { 4157page=page[this.dataset.action=='next' ? 'next': 'prev']().removeClass('ba-hidden-form-page'); 4158} 4159if (rect.top < 0){ 4160$this.form[0].scrollIntoView(true); 4161} 4162if (this.dataset.action=='next'){ 4163page.find('.ba-form-submit-btn').each(function(){ 4164CaptchaHelper.createIfExist(this); 4165}); 4166FormsSignature.make(); 4167} 4168}) 4169}); 4170this.form.find('.upload-file-btn').each(function(){ 4171this.file=this.closest('.upload-file-input').querySelector('input[type="file"]'); 4172}).on('click keyup', function(event){ 4173FormsAccessibilityHelper.processAction(event, ()=> { 4174formsApp.removeAlertTooltip(this.file); 4175if (this.file.uploading !='pending'){ 4176this.file.click(); 4177} 4178}); 4179}); 4180this.form.find('.drag-drop-upload-file').on('dragenter dragover', function(event){ 4181event.preventDefault(); 4182event.stopPropagation(); 4183this.classList.add('upload-file-drag-over'); 4184return false; 4185}).on('dragleave', function(event){ 4186event.preventDefault(); 4187event.stopPropagation(); 4188this.classList.remove('upload-file-drag-over'); 4189return false; 4190}).on('drop', function(event){ 4191event.preventDefault(); 4192event.stopPropagation(); 4193this.classList.remove('upload-file-drag-over'); 4194var files=event.originalEvent.target.files || event.originalEvent.dataTransfer.files; 4195$f(this).find('.ba-forms-attachment').each(function(){ 4196this.files=files; 4197}).trigger('change'); 4198}); 4199this.form.find('input[type="file"].ba-forms-attachment').each(function(){ 4200let name='.ba-forms-xhr-attachment-wrapper'; 4201this.options={ 4202id: $this.formId, 4203size: this.dataset.size * 1000, 4204types: this.dataset.types.replace(/\s/g, '').split(','), 4205count: this.multiple ? this.dataset.count : 1, 4206images: ['gif', 'jpg', 'jpeg', 'png', 'svg', 'webp'], 4207fileContainer: this.closest('.ba-field-container').querySelector(name+'[data-type="file"]'), 4208imageContainer: this.closest('.ba-field-container').querySelector(name+'[data-type="image"]') 4209} 4210this.uploads={ 4211count: 0 4212} 4213}).on('change', function(){ 4214this.uploading='pending'; 4215let files=[].slice.call(this.files), 4216uploaded={}, 4217msg=''; 4218for (let ind in this.uploads){ 4219if (ind=='count'){ 4220continue; 4221} 4222uploaded[this.uploads[ind].name]=true; 4223} 4224if (this.options.count !=''&&this.uploads.count==this.options.count * 1){ 4225msg='MAXIMUM_FILES_NUMBER_EXCEEDED'; 4226} else { 4227for (let i=0; i < files.length; i++){ 4228let name=files[i].name.split('.'); 4229files[i].ext=name[name.length - 1].toLowerCase() 4230if (this.options.size < files[i].size){ 4231msg='NOT_ALLOWED_FILE_SIZE'; 4232break; 4233} else if (this.options.types.indexOf(files[i].ext)==-1){ 4234msg='NOT_SUPPORTED_FILE'; 4235break; 4236} else if (uploaded[files[i].name]){ 4237msg='FILES_ALREADY_UPLOADED'; 4238break; 4239} 4240} 4241} 4242this.value=''; 4243if (msg !=''){ 4244this.uploading=''; 4245formsApp.showNotice(formsApp._(msg), 'ba-alert'); 4246} else { 4247formsApp.uploadAttachmentFile(files, this, $this); 4248} 4249}); 4250this.form.find('.ba-form-save-progress-link').on('click', function(){ 4251const progress=FormProgressHelper.getData($this); 4252if (!formsApp.storage[progress.url]){ 4253formsApp.storage[progress.url]={}; 4254} 4255formsApp.storage[progress.url][progress.id]=progress; 4256localStorage.setItem('forms-progress', JSON.stringify(formsApp.storage)); 4257formsApp.showNotice(formsApp._('PROGRESS_SAVED_MESSAGE')); 4258}); 4259this.form.find('.ba-form-map-field .ba-map-wrapper').each(function(){ 4260this.options={ 4261map: JSON.parse(this.dataset.map), 4262marker: JSON.parse(this.dataset.marker), 4263controls: Boolean(this.dataset.controls * 1), 4264styleType: this.dataset.styleType 4265} 4266if (formsApp.googleMaps || (('google' in window)&&google.maps)){ 4267formsApp.createGoogleMap(this, this.options); 4268} 4269}).removeAttr('data-map').removeAttr('data-marker').removeAttr('data-controls').removeAttr('data-style-type'); 4270this.form.find('.ba-input-password-icons i').on('click', function(){ 4271let input=this.closest('.ba-field-container').querySelector('input'), 4272icons=this.closest('.ba-input-password-icons').querySelectorAll('i'); 4273this.style.display='hide'; 4274if (this.dataset.action=='show'){ 4275input.type='text'; 4276icons[1].style.display=''; 4277} else { 4278input.type='password'; 4279icons[0].style.display=''; 4280} 4281}); 4282this.form.find('.ba-form-calendar-field input[type="text"]').each(function(){ 4283this.rangeBtn=$f(this).closest('.calendar-range-type').find('input[type="text"]').not(this)[0]; 4284this.hiddenInput=this.closest('.ba-field-container').querySelector('input[type="hidden"]'); 4285}); 4286this.form.find('.ba-form-calendar-field input[type="text"]').on('click keyup', function(event){ 4287FormsAccessibilityHelper.processAction(event, ()=> { 4288formsApp.removeAlertTooltip(this); 4289if (this.rangeBtn&&this.dataset.index==1&&!this.rangeBtn.value){ 4290this.rangeBtn.click(); 4291return false;
4292} 4293if (!formsApp.calendar){ 4294formsApp.createCalendar(this); 4295} 4296formsApp.calendar.disable={ 4297days: [], 4298dates: [], 4299range: [] 4300}; 4301if (this.dataset.disableDays){ 4302formsApp.calendar.disable.days=this.dataset.disableDays.split(','); 4303let pos=formsApp.calendar.disable.days.indexOf('0'); 4304if (this.dataset.start==1&&pos !=-1){ 4305formsApp.calendar.disable.days[pos]='7'; 4306} 4307} 4308if (this.dataset.disableDates){ 4309formsApp.calendar.disable.dates=this.dataset.disableDates.split(','); 4310} 4311if (this.dataset.disableRangeDates){ 4312formsApp.calendar.disable.range=this.dataset.disableRangeDates.split(','); 4313} 4314if (this.dataset.disablePrevious==1){ 4315formsApp.calendar.classList.add('disable-previous-date'); 4316} else { 4317formsApp.calendar.classList.remove('disable-previous-date'); 4318} 4319formsApp.calendar.dataset.form=$this.form.attr('data-id'); 4320formsApp.calendar.start=this.dataset.start; 4321formsApp.calendar.current={ 4322year: this.dataset.year, 4323month: this.dataset.month 4324} 4325formsApp.renderFormsCalendar(this); 4326}) 4327}).on('input', function(){ 4328if (this.rangeBtn&&this.dataset.index==0){ 4329this.rangeBtn.value=''; 4330} 4331this.hiddenInput.price=0; 4332if (!this.rangeBtn){ 4333this.hiddenInput.value=this.value; 4334} else if (this.rangeBtn&&this.dataset.index==0){ 4335this.hiddenInput.value=this.value+' - '+this.rangeBtn.value; 4336} else { 4337this.hiddenInput.value=this.rangeBtn.value+' - '+this.value; 4338var date1=new Date(this.rangeBtn.dataset.value), 4339date2=new Date(this.dataset.value); 4340this.hiddenInput.price=Math.ceil(Math.abs(date2.getTime() - date1.getTime()) / (1000 * 3600 * 24)) 4341} 4342formsApp.updateFieldsValues($this.fields, this.hiddenInput, this.hiddenInput.fieldId); 4343formsApp.checkConditionLogic($this); 4344formsApp.calculation($this); 4345}); 4346this.form.find('.ba-form-address-field input').each(function(){ 4347this.createAutocomplete=function(){ 4348let autocomplete=new google.maps.places.Autocomplete(this), 4349input=this; 4350autocomplete.addListener('place_changed', function(){ 4351formsApp.updateFieldsValues($this.fields, input, input.fieldId); 4352formsApp.checkConditionLogic($this); 4353}); 4354} 4355if (formsApp.googleMaps || (('google' in window)&&google.maps)){ 4356this.createAutocomplete(); 4357} 4358}).on('input', function(){ 4359formsApp.updateFieldsValues($this.fields, this, this.fieldId); 4360formsApp.checkConditionLogic($this); 4361}).on('focus', function(){ 4362formsApp.removeAlertTooltip(this); 4363}); 4364this.form.find('.ba-form-slider-field .form-range-wrapper input').each(function(){ 4365let parent=this.closest('.ba-field-container'); 4366this.linear=parent.querySelector('.ba-form-range-liner'); 4367this.number=parent.querySelector('.form-slider-input-wrapper input[data-type="range"]'); 4368this.input=parent.querySelector('.form-slider-input-wrapper input[type="hidden"][name]'); 4369this.number.range=this; 4370}).on('input', function(){ 4371var max=this.max * 1, 4372min=this.min * 1, 4373value=this.value * 1, 4374sx=(value - min) * 100 / (max - min); 4375this.input.value=value; 4376this.number.value=this.value; 4377this.linear.style.width=sx+'%'; 4378formsApp.updateFieldsValues($this.fields, this.input, this.input.fieldId); 4379formsApp.checkConditionLogic($this); 4380formsApp.calculation($this); 4381}); 4382this.form.find('.ba-form-slider-field .form-slider-input-wrapper input[data-type="range"]').on('input', function(){ 4383var max=this.range.max * 1, 4384min=this.range.min * 1, 4385value=this.value * 1; 4386if (value > max){ 4387this.value=value=max; 4388} 4389if (value >=min){ 4390this.range.value=value; 4391$f(this.range).trigger('input'); 4392} 4393}); 4394this.form.find('.ba-form-slider-field .form-slider-wrapper input[type="range"]').each(function(){ 4395let parent=this.closest('.ba-field-container'); 4396this.linear=parent.querySelector('.ba-form-range-liner'); 4397this.slides=parent.querySelectorAll('input[type="range"]'); 4398this.numbers=parent.querySelectorAll('.form-slider-input-wrapper input[data-type="slider"]'); 4399this.numbers[0].slides=this.slides; 4400this.numbers[1].slides=this.slides; 4401this.input=parent.querySelector('.form-slider-input-wrapper input[type="hidden"][name]'); 4402if (!this.input.values){ 4403this.input.values=[]; 4404} 4405this.input.values.push(this.value); 4406}).on('input', function(){ 4407var max=this.max * 1, 4408min=this.min * 1, 4409ind=this.dataset.index * 1, 4410index=ind==0 ? 1 : 0, 4411value=this.value * 1, 4412value2=this.slides[index].value * 1, 4413sx=left=0; 4414if (this.slides[0].value * 1 > this.slides[1].value * 1){ 4415ind=ind==0 ? 1 : 0; 4416index=index==0 ? 1 : 0; 4417} 4418this.input.values[index]=value2;
4419this.numbers[index].value=value2; 4420this.numbers[ind].value=value; 4421this.input.values[ind]=value; 4422this.input.value=this.input.values[0]+' '+this.input.values[1]; 4423sx=(this.input.values[1] * 1 - this.input.values[0] * 1) * 100 / (max - min) 4424left=(max - this.input.values[1] * 1) * 100 / (max - min); 4425this.linear.style.width=sx+'%'; 4426this.linear.style.marginLeft=(100 - sx - left)+'%'; 4427formsApp.updateFieldsValues($this.fields, this.input, this.input.fieldId); 4428formsApp.checkConditionLogic($this); 4429}); 4430this.form.find('.ba-form-slider-field .form-slider-input-wrapper input[data-type="slider"]').on('input', function(){ 4431let $this=this 4432clearTimeout(this.delay); 4433this.delay=setTimeout(function(){ 4434if ($this.value){ 4435let value=$this.value * 1, 4436values=$this.slides[0].input.values, 4437index=$this.dataset.index * 1; 4438if (index==0&&value > values[1] * 1){ 4439index=1; 4440$this.slides[1].numbers[1].focus(); 4441$this.value=values[1]; 4442$this.slides[0].input.values[0]=$this.value; 4443$f($this.slides[0]).val($this.value); 4444} else if (index==1&&value < values[0] * 1){ 4445index=0; 4446$this.slides[0].numbers[0].focus(); 4447$this.value=values[0]; 4448$this.slides[0].input.values[1]=$this.value; 4449$f($this.slides[1]).val($this.value); 4450} 4451$this.slides[index].value=value; 4452$f($this.slides[index]).trigger('input'); 4453} 4454}, 500); 4455}); 4456this.form.find('.ba-form-phone-field').on('click', function(){ 4457formsApp.removeAlertTooltip(this.querySelector('input.ba-phone-number-input')); 4458}).on('keyup', '.ba-phone-countries-list-wrapper', function(event){ 4459if (event.key=='Escape'){ 4460formsApp.countries.hide(); 4461} 4462}).on('click keydown', '.ba-phone-selected-country', function(event){ 4463if (event.type !='click'&&!(event.type=='keydown'&&event.key=='ArrowDown')) return; 4464event.preventDefault(); 4465let wrapper=this.closest('.ba-phone-countries-wrapper'), 4466search=wrapper.querySelector('.ba-phone-countries-search'); 4467setTimeout(function(){ 4468wrapper.querySelectorAll('li').forEach(function(li){ 4469li.style.display=''; 4470}); 4471wrapper.classList.remove('top-countries-list'); 4472wrapper.classList.add('visible-countries-list'); 4473const countriesList=wrapper.querySelector('.ba-phone-countries-list-wrapper'); 4474FormsAccessibilityHelper.trapFocus(countriesList); 4475const rect=wrapper.querySelector('ul').getBoundingClientRect(); 4476if (window.innerHeight < rect.bottom){ 4477wrapper.classList.add('top-countries-list'); 4478} 4479search.value=''; 4480setTimeout(()=> { 4481search.focus(); 4482}, 50); 4483$f('body').off('click.selected-country').one('click.selected-country', function(){ 4484formsApp.countries.hide();; 4485}); 4486}, 100); 4487}).on('input', '.ba-phone-countries-search', function(){ 4488var li=this.closest('.ba-phone-countries-wrapper').querySelectorAll('li'), 4489search=this.value.toLowerCase(); 4490clearTimeout(this.delay); 4491this.delay=setTimeout(function(){ 4492li.forEach(function(el){ 4493let title=el.dataset.title.toLowerCase(); 4494el.style.display=!search || title.indexOf(search) !=-1 ? '' : 'none'; 4495}); 4496}, 300); 4497}).on('click', '.ba-phone-countries-search', function(event){ 4498event.stopPropagation(); 4499}).on('click keyup', '.ba-phone-countries-list li.ba-phone-country-item', function(event){ 4500FormsAccessibilityHelper.processAction(event, ()=> { 4501event.stopPropagation(); 4502let wrapper=this.closest('.ba-field-container'); 4503if (!wrapper.phoneInput){ 4504wrapper.countryFlag=wrapper.querySelector('.ba-phone-selected-country .ba-phone-flag'); 4505wrapper.countryPrefix=wrapper.querySelector('.ba-phone-selected-country .ba-phone-prefix'); 4506wrapper.phoneInput=wrapper.querySelector('input.ba-phone-number-input'); 4507} 4508wrapper.countryFlag.className='ba-phone-flag ba-phone-flag-'+this.dataset.flag; 4509wrapper.countryPrefix.textContent=this.dataset.prefix; 4510wrapper.phoneInput.placeholder=this.dataset.placeholder; 4511wrapper.phoneInput.value=''; 4512wrapper.phoneInput.formsInputMask=this.dataset.placeholder; 4513wrapper.phoneInput.dataset.prefix=this.dataset.prefix; 4514wrapper.phoneInput.dispatchEvent(wrapper.phoneInput.inputEvent); 4515formsApp.prepareInputMask(wrapper.phoneInput, wrapper.phoneInput.formsInputMask); 4516formsApp.countries.hide(); 4517}) 4518}).on('keydown', 'input.ba-phone-number-input', function(event){ 4519formsApp.prepareInputMask(this, this.formsInputMask, event); 4520}).on('input', 'input.ba-phone-number-input', function(){ 4521formsApp.executeInputMask(this, this.formsInputMask); 4522let value=this.dataset.prefix+' '+this.value, 4523placeholder=this.dataset.prefix+' '+this.placeholder; 4524this.hiddenInput.value=this.value&&value !=placeholder ? value : ''; 4525this.hiddenInput.dispatchEvent(this.inputEvent); 4526}).find('input.ba-phone-number-input').each(function(){ 4527this.prefix=this.dataset.prefix; 4528this.formsInputMask=this.placeholder; 4529formsApp.prepareInputMask(this, this.formsInputMask); 4530this.hiddenInput=this.closest('.ba-field-container').querySelector('input[type="hidden"]'); 4531this.hiddenInput.addEventListener('input', function(){ 4532formsApp.updateFieldsValues($this.fields, this, this.fieldId); 4533formsApp.checkConditionLogic($this); 4534formsApp.calculation($this); 4535});
4536this.inputEvent=new Event('input'); 4537}); 4538this.form.find('.ba-form-input-field > .ba-input-wrapper').find('[data-mask]').each(function(){ 4539this.formsInputMask=this.dataset.mask.replace(/#/g, '_'); 4540formsApp.prepareInputMask(this, this.formsInputMask); 4541}).on('keydown', function(event){ 4542formsApp.prepareInputMask(this, this.formsInputMask, event); 4543}).on('input', function(event){ 4544formsApp.executeInputMask(this, this.formsInputMask); 4545}); 4546this.form.find('.characters-wrapper').each(function(){ 4547let input=this.closest('.ba-field-container').querySelector('input, textarea'); 4548input.characters={ 4549div: this, 4550key: this.dataset.direction, 4551length: this.dataset.length 4552} 4553}); 4554this.form.find('.ba-form-input-field > .ba-input-wrapper').find('input, textarea').on('input', function(){ 4555if (this.dataset.validation=='numbers'){ 4556let match=this.value.match(/\d+\.{0,1}\d{0,}/); 4557if (!match){ 4558this.value=''; 4559} else if (match[0] !=this.value){ 4560this.value=match[0]; 4561} 4562} 4563if (this.characters){ 4564let length=this.value.length; 4565this.characters.div.querySelector('.current-characters').textContent=length; 4566} 4567formsApp.updateFieldsValues($this.fields, this, this.fieldId); 4568formsApp.checkConditionLogic($this); 4569formsApp.calculation($this); 4570}).on('focus', function(){ 4571formsApp.removeAlertTooltip(this); 4572}); 4573this.form.find('.ba-form-signature-field textarea').on('input', function(){ 4574formsApp.updateFieldsValues($this.fields, this, this.fieldId); 4575formsApp.checkConditionLogic($this); 4576}); 4577this.form.find('.confirm-email-wrapper, .confirm-password-wrapper').find('input').on('focus', function(){ 4578formsApp.removeAlertTooltip(this); 4579}); 4580this.form.find('.ba-form-dropdown-field, .ba-form-select-multiple-field').find('select').on('focus', function(){ 4581formsApp.removeAlertTooltip(this); 4582}).on('change', function(){ 4583$this.fields[this.fieldId]={ 4584value: '', 4585price: 0 4586} 4587formsApp.updateFieldsValues($this.fields, this, this.fieldId); 4588formsApp.checkConditionLogic($this); 4589formsApp.calculation($this); 4590formsApp.checkAutoNavigation($this, this); 4591if (this.product){ 4592formsApp.productChange($this, this.name); 4593} 4594}); 4595this.form.find('.ba-form-rating-group-wrapper').on('change', function(){ 4596formsApp.removeAlertTooltip(this); 4597let input=this.querySelectorAll('input'); 4598$this.fields[input[0].fieldId]={ 4599value: '', 4600price: 0 4601} 4602this.classList.remove('active'); 4603$f(this).find('label.active').removeClass('active'); 4604for (let i=0; i < input.length; i++){ 4605formsApp.updateFieldsValues($this.fields, input[i], input[i].fieldId); 4606if (input[i].checked){ 4607this.classList.add('active'); 4608input[i].closest('label').classList.add('active'); 4609} 4610} 4611formsApp.checkConditionLogic($this); 4612formsApp.calculation($this); 4613formsApp.checkAutoNavigation($this, this); 4614}); 4615this.form.find('.ba-form-checkbox-group-wrapper').each(function(){ 4616if (this.querySelector('.ba-checkbox-image')){ 4617this.classList.add('checkbox-image-group-wrapper'); 4618} 4619let checkbox=this.querySelector('.ba-form-checkbox-wrapper:last-child'); 4620if (checkbox&&!checkbox.classList.contains('last-row-checkbox-wrapper')){ 4621checkbox.classList.add('last-row-checkbox-wrapper') 4622} 4623}).on('change', function(){ 4624formsApp.removeAlertTooltip(this); 4625let input=this.querySelectorAll('input'), 4626name=product=null, 4627image=this.classList.contains('checkbox-image-group-wrapper'); 4628$this.fields[input[0].fieldId]={ 4629value: '', 4630price: 0 4631} 4632if (image){ 4633$f(this).find('.checked-image-container').removeClass('checked-image-container'); 4634} 4635for (let i=0; i < input.length; i++){ 4636formsApp.updateFieldsValues($this.fields, input[i], input[i].fieldId); 4637name=input[i].name; 4638product=input[i].product; 4639if (input[i].checked){ 4640input[i].closest('.ba-form-checkbox-wrapper').classList.add('checked-image-container'); 4641} 4642} 4643formsApp.checkConditionLogic($this); 4644formsApp.calculation($this); 4645formsApp.checkAutoNavigation($this, this); 4646if (product&&name){ 4647formsApp.productChange($this, name); 4648} 4649}).find('.ba-form-checkbox-wrapper').on('click', function(event){ 4650if (!event.target.classList.contains('ba-form-checkbox')&&!event.target.closest('.ba-form-checkbox')&& 4651!event.target.closest('.ba-form-radio')){ 4652$f(this).find('> .ba-checkbox-wrapper input').each(function(){
4653if (this.type=='radio'&&!this.checked){ 4654this.checked=true; 4655} else if (this.type=='checkbox'){ 4656this.checked=!this.checked; 4657} 4658}).trigger('change'); 4659} 4660}); 4661this.form.find('.ba-form-acceptance-field .ba-field-container').on('change', function(){ 4662formsApp.removeAlertTooltip(this); 4663let input=this.querySelector('input'); 4664$this.fields[input.fieldId]={ 4665value: '', 4666price: 0 4667} 4668formsApp.updateFieldsValues($this.fields, input, input.fieldId); 4669formsApp.checkConditionLogic($this); 4670}); 4671this.form.find('[data-price]').each(function(){ 4672this.price=this.dataset.price; 4673}).removeAttr('data-price'); 4674this.form.find('[data-field-id]').each(function(){ 4675this.fieldId=this.dataset.fieldId; 4676$this.items[this.fieldId]=this.closest('.ba-form-field-item'); 4677if (this.classList.contains('ba-form-submit-btn')){ 4678return true; 4679} 4680if (!$this.fields[this.fieldId]){ 4681$this.fields[this.fieldId]={ 4682value: '', 4683price: 0 4684} 4685} 4686formsApp.updateFieldsValues($this.fields, this, this.fieldId); 4687}).removeAttr('data-field-id'); 4688this.form.find('[data-default]').each(function(){ 4689let match=this.dataset.default.match(/\[Field ID=\d+\]/) || this.dataset.default.match(/\[Page Title\]/); 4690match=match || this.dataset.default.match(/\[Page URL\]/); 4691if (this.dataset.default&&match){ 4692let key=this.fieldId ? this.fieldId : +new Date(), 4693obj={ 4694item: this, 4695value: this.dataset.default 4696} 4697defaultValues[key]=obj; 4698} 4699}); 4700this.form.find('.ba-form-calculation-field .field-price-value').each(function(){ 4701let name='.ba-form-calculation-price-wrapper'; 4702this.calculation=$f.extend({}, this.dataset); 4703this.calculation.result=this; 4704this.calculation.input=this.closest('.ba-field-container').querySelector('input'); 4705this.calculation.product=this.closest(name).querySelector('input').dataset.product=='product'; 4706for (ind in this.dataset){ 4707$f(this).removeAttr('data-'+ind) 4708} 4709$this.calculation[this.calculation.input.fieldId]=this.calculation; 4710}); 4711this.form.find('.ba-form-calculation-field input[type="hidden"]').on('change', function(){ 4712formsApp.updateFieldsValues($this.fields, this, this.fieldId); 4713formsApp.checkConditionLogic($this); 4714if (this.product){ 4715formsApp.productChange($this, this.name); 4716} 4717}); 4718this.form.find('.ba-form-total-field .ba-cart-total-row .field-price-value').each(function(){ 4719this.calculation=$f.extend({}, this.dataset); 4720let calculation=this.calculation, 4721name='.ba-cart-subtotal-row .field-price-value'; 4722calculation.subtotal=this.closest('.ba-cart-total-container').querySelector(name); 4723calculation.result=this; 4724calculation.input=this.closest('.ba-form-calculation-price-wrapper').querySelector('textarea'); 4725calculation.cart=this.closest('.ba-input-wrapper').querySelector('.ba-form-products-cart'); 4726calculation.products={}; 4727calculation.total=0; 4728calculation.resultTotal=0; 4729name='.ba-cart-discount-row .field-price-value'; 4730calculation.discount=this.closest('.ba-cart-total-container').querySelector(name); 4731name='.ba-cart-tax-row .field-price-value'; 4732calculation.taxResult=this.closest('.ba-cart-total-container').querySelector(name); 4733name='.ba-cart-shipping-row input[type="radio"]'; 4734calculation.shipping=this.closest('.ba-cart-total-container').querySelectorAll(name); 4735calculation.shipping.forEach(function(el){ 4736el.addEventListener('change', function(){ 4737formsApp.calculateCartTotal(calculation); 4738}) 4739}); 4740$this.carts.push(this); 4741for (ind in this.dataset){ 4742$f(this).removeAttr('data-'+ind) 4743} 4744}); 4745this.form.find('.ba-form-total-field textarea').on('change', function(){ 4746let calc=this.closest('.ba-form-calculation-price-wrapper').querySelector('.field-price-value').calculation; 4747if ($this.fields[this.fieldId].price !=calc.resultTotal){ 4748$this.fields[this.fieldId]={ 4749value: calc.resultTotal, 4750price: calc.resultTotal 4751} 4752formsApp.calculation($this, true); 4753} 4754}); 4755this.form.find('.ba-cart-promo-code-btn').each(function(){ 4756this.promo={ 4757input: this.closest('.ba-cart-promo-code-container').querySelector('.ba-cart-promo-code-input'), 4758total: this.closest('.ba-field-container').querySelector('.ba-cart-total-row .field-price-value'), 4759discount: this.closest('.ba-field-container').querySelector('.ba-cart-discount-row') 4760} 4761}).on('click keyup', function(event){ 4762if (this.status=='pending'){ 4763return; 4764} 4765FormsAccessibilityHelper.processAction(event, ()=> { 4766this.status='pending'; 4767let btn=this; 4768formsApp.fetch.request(JUri+'index.php?option=com_baforms&task=form.checkCoupon', { 4769coupon: btn.promo.input.value.trim(), 4770id: btn.dataset.name 4771}).then(function(text){ 4772btn.status=''; 4773if (!text || !btn.promo.input.value.trim()){ 4774formsApp.showNotice(formsApp._('PROMO_CODE_NOT_VALID'), 'ba-alert'); 4775btn.promo.total.calculation.promo=null; 4776btn.promo.discount.style.display='none'; 4777} else { 4778btn.promo.total.calculation.promo=JSON.parse(text); 4779btn.promo.discount.style.display=''; 4780} 4781formsApp.calculateCartTotal(btn.promo.total.calculation); 4782}); 4783}) 4784}) 4785this.form.find('[data-product]').each(function(){ 4786if (this.dataset.product){ 4787this.product=this.dataset.product; 4788let name=this.name; 4789if (!$this.products[name]){ 4790$this.products[name]=[]; 4791} 4792if (this.localName=='select'){ 4793this.querySelectorAll('option').forEach(function(option){ 4794$this.products[name].push(option); 4795}); 4796} else { 4797$this.products[name].push(this); 4798} 4799} 4800}).removeAttr('data-product'); 4801formsApp.updateFieldsDefaultValues($this, defaultValues); 4802FormProgressHelper.setSavedProgress($this); 4803formsApp.checkConditionLogic($this); 4804formsApp.calculation($this); 4805formsApp.updateCarts($this); 4806} 4807formsApp.productChange=function($this, name){ 4808for (let i=0; i < $this.carts.length; i++){ 4809if (!$this.carts[i].calculation.products[name]){ 4810continue; 4811} 4812let calculation=$this.carts[i].calculation; 4813formsApp.updateProducts($this, calculation, name); 4814} 4815} 4816formsApp.updateCarts=function($this){ 4817for (let i=0; i < $this.carts.length; i++){ 4818let calculation=$this.carts[i].calculation; 4819for (let name in $this.products){ 4820if (!calculation.products[name]){ 4821calculation.products[name]={}; 4822} 4823formsApp.updateProducts($this, calculation, name); 4824} 4825} 4826} 4827formsApp.updateProducts=function($this, calculation, name){ 4828let products=$this.products[name], 4829object={}; 4830for (let i=0; i < products.length; i++){ 4831if (products[i].closest('.hidden-condition-field')){ 4832continue; 4833} 4834if (products[i].price !=''&& 4835(((products[i].type=='radio' || products[i].type=='checkbox')&&products[i].checked) 4836|| (products[i].localName=='option'&&products[i].selected) || products[i].type=='hidden')){ 4837let obj={ 4838key: products[i].dataset.key ?? '0', 4839input: products[i], 4840quantity: 1, 4841title: products[i].dataset.title ? products[i].dataset.title : products[i].value, 4842price: products[i].price 4843} 4844obj.total=obj.price * obj.quantity; 4845object[i]=obj; 4846} 4847} 4848for (let ind in calculation.products[name]){ 4849if (!object[ind] || calculation.products[name][ind].input.type=='hidden'){ 4850calculation.total -=calculation.products[name][ind].total; 4851if (calculation.cart){ 4852calculation.cart.querySelector('.ba-form-product-row[data-name="'+name+'"][data-ind="'+ind+'"]').remove(); 4853} 4854delete calculation.products[name][ind]; 4855} 4856} 4857for (let ind in object){ 4858if (!calculation.products[name][ind]){ 4859if (Number.isNaN(object[ind].total)){ 4860object[ind].total=0; 4861} 4862calculation.total +=object[ind].total; 4863if (calculation.cart){ 4864let div=formsApp.getProductCartHTML(object[ind], name, ind, calculation); 4865calculation.cart.append(div); 4866} 4867calculation.products[name][ind]=object[ind]; 4868} 4869} 4870calculation.total=formsApp.decimalAdjust('round', calculation.total, calculation.decimals * -1); 4871formsApp.calculateCartTotal(calculation); 4872} 4873formsApp.calculateCartTotal=function(calculation){ 4874let decimals=calculation.decimals, 4875price=formsApp.renderPrice(String(calculation.total), calculation.thousand, calculation.separator, decimals), 4876total=calculation.total, 4877tax=0, 4878discount=calculation.promo ? calculation.promo.discount * 1 : 0; 4879if (calculation.subtotal){ 4880calculation.subtotal.textContent=price; 4881} 4882if (calculation.promo&&calculation.promo.unit=='%'){ 4883discount=total * discount / 100; 4884} 4885total -=discount; 4886if (calculation.taxResult){ 4887tax=total * calculation.tax / 100 4888price=formsApp.renderPrice(String(tax), calculation.thousand, calculation.separator, decimals) 4889calculation.taxResult.textContent=price; 4890} 4891total +=tax; 4892if (calculation.discount){ 4893price=formsApp.renderPrice(String(discount), calculation.thousand, calculation.separator, decimals); 4894calculation.discount.textContent='-'+price; 4895} 4896if (calculation.shipping){ 4897calculation.shipping.forEach(function(input){ 4898if (input.checked){ 4899total +=input.price * 1; 4900} 4901}); 4902} 4903calculation.resultTotal=total; 4904price=formsApp.renderPrice(String(total), calculation.thousand, calculation.separator, decimals) 4905calculation.result.textContent=price; 4906$f(calculation.input).trigger('change'); 4907} 4908formsApp.getProductCartHTML=function(product, name, ind, calculation){ 4909let div=document.createElement('div'), 4910decimals=calculation.decimals, 4911price=formsApp.renderPrice(String(product.total), calculation.thousand, calculation.separator, decimals), 4912image=product.input.closest('.checkbox-image-wrapper'); 4913div.className='ba-form-product-row'; 4914div.dataset.name=name; 4915div.dataset.ind=ind; 4916div.innerHTML='<div class="ba-form-product-title-cell">'+product.title+'</div>'+ 4917'<div class="ba-form-product-quantity-cell"><i class="ba-form-icons ba-icon-minus-circle '+ 4918(product.quantity==1 ? 'ba-disabled' : '')+'" data-action="-"></i>'+ 4919'<input type="number" value="'+product.quantity+'" min="1" step="1">'+ 4920'<i class="ba-form-icons ba-icon-plus-circle" data-action="+"></i></div>'+ 4921'<div class="ba-form-product-total-cell"><div class="ba-form-calculation-price-wrapper">'+ 4922'<span class="field-price-currency">'+calculation.symbol+'</span><span class="field-price-value">'+price+ 4923'</span></div>'+ 4924'</div><div class="ba-form-product-remove-cell"><i class="ba-form-icons ba-icon-delete" tabindex="0"></i></div>'; 4925if (image){ 4926let img=document.createElement('div'); 4927img.className='ba-form-product-image-cell'; 4928img.append(image.querySelector('img').cloneNode()); 4929div.insertBefore(img, div.querySelector('.ba-form-product-title-cell')); 4930} 4931let input=div.querySelector('.ba-form-product-quantity-cell input'), 4932trash=div.querySelector('.ba-form-product-remove-cell i'), 4933quantityBtns=div.querySelectorAll('.ba-form-product-quantity-cell i[data-action]'); 4934quantityBtns.forEach(function(element){ 4935element.addEventListener('click', function(){ 4936if (this.classList.contains('ba-disabled')){ 4937return false;
4938} 4939if (this.dataset.action=='+'){ 4940input.value=input.value * 1 + 1; 4941} else { 4942input.value=input.value * 1 - 1; 4943} 4944let event=new Event('input'); 4945input.dispatchEvent(event); 4946}); 4947}); 4948input.addEventListener('input', function(){ 4949if (this.value !=''){ 4950quantityBtns[0].classList[this.value==1 ? 'add' : 'remove']('ba-disabled'); 4951let match=this.value.match(/\d+/), 4952decimals=calculation.decimals; 4953if (!match || match[0]==0){ 4954this.value=1; 4955} else if (match[0] !=this.value){ 4956this.value=match[0]; 4957} 4958if (this.value * 1 > 0){ 4959calculation.total -=product.total; 4960product.quantity=this.value * 1; 4961product.total=product.price * product.quantity; 4962price=formsApp.renderPrice(String(product.total), calculation.thousand, calculation.separator, decimals); 4963div.querySelector('.field-price-value').textContent=price; 4964calculation.total +=product.total; 4965formsApp.calculateCartTotal(calculation); 4966} 4967} 4968}); 4969$f(trash).on('click keyup', function(event){ 4970FormsAccessibilityHelper.processAction(event, ()=> { 4971if (product.input.type=='hidden'){ 4972calculation.total -=product.total; 4973delete calculation.products[name][ind]; 4974div.remove(); 4975let decimals=calculation.decimals; 4976price=formsApp.renderPrice(String(calculation.total), calculation.thousand, calculation.separator, decimals); 4977calculation.result.textContent=price; 4978} else { 4979product.input[product.input.localName=='option' ? 'selected' : 'checked']=false; 4980$f(product.input).trigger('change'); 4981} 4982}); 4983}); 4984return div; 4985} 4986formsApp.decimalAdjust=function(type, value, exp){ 4987if (typeof exp==='undefined' || +exp===0){ 4988return Math[type](value); 4989} 4990value=+value; 4991exp=+exp; 4992if (isNaN(value) || !(typeof exp==='number'&&exp % 1===0)){ 4993return NaN; 4994} 4995value=value.toString().split('e'); 4996value=Math[type](+(value[0] + 'e' + (value[1] ? (+value[1] - exp) : -exp))); 4997value=value.toString().split('e'); 4998return +(value[0] + 'e' + (value[1] ? (+value[1] + exp) : exp)); 4999} 5000formsApp.calculation=function($this, fromCart){ 5001formsApp.calculated={}; 5002for (let i in $this.calculation){ 5003if (fromCart&&$this.calculation[i].product){ 5004continue; 5005} 5006let calc=$this.calculation[i], 5007total=formsApp.calculate(calc.formula, $this), 5008price=String(total); 5009total=formsApp.decimalAdjust('round', total, calc.decimals * -1); 5010price=String(total); 5011calc.input.price=total; 5012formsApp.calculated[i]=total; 5013if (total !=calc.input.value * 1){ 5014price=formsApp.renderPrice(price, calc.thousand, calc.separator, calc.decimals); 5015calc.input.value=total; 5016calc.result.textContent=price; 5017$f(calc.input).trigger('change'); 5018} 5019} 5020} 5021formsApp.calculate=function(formula, $this){ 5022if (formula==''){ 5023return 0; 5024} 5025formula=formula.replace(/\s/g, '').replace(/elseif/g, 'else if'); 5026let matches=formula.match(/\[FieldID=\d+\]/g), 5027total=0; 5028if (matches){ 5029for (let i=0; i < matches.length; i++){ 5030let match=matches[i].match(/\d+/g), 5031price=$this.fields['baform-'+match[0]] ? $this.fields['baform-'+match[0]].price : 0; 5032if (!$this.items['baform-'+match[0]] || $this.items['baform-'+match[0]].closest('.hidden-condition-field')){ 5033price=0; 5034} else if ('baform-'+match[0] in formsApp.calculated){ 5035price=formsApp.calculated['baform-'+match[0]]; 5036} else if ($this.calculation['baform-'+match[0]]){ 5037price=formsApp.calculate($this.calculation['baform-'+match[0]].formula, $this) 5038formsApp.calculated['baform-'+match[0]]=price; 5039} 5040formula=formula.replace(matches[i], price); 5041} 5042} 5043const method='ZXZhbA=='; 5044try { 5045total=window[window.atob(method)](formula); 5046} catch (error){ 5047console.error(error) 5048} 5049if (total==-Infinity || total==Infinity || Number.isNaN(total)){ 5050total=0; 5051} 5052return total; 5053} 5054formsApp.updateFieldsDefaultValues=function($this, defaultValues){ 5055let object={}; 5056for (let ind in defaultValues){ 5057object[ind]=''; 5058object[ind]=formsApp.updateFieldsDefaultValue($this, defaultValues, defaultValues[ind].value, object); 5059defaultValues[ind].item.value=object[ind]; 5060} 5061} 5062formsApp.updateFieldsDefaultValue=function($this, defaultValues, value, object){ 5063let matches=value.match(/\[Field ID=\d+\]/g), 5064title=$this.querySelector('input[name="page-title"]').value, 5065url=$this.querySelector('input[name="page-url"]').value; 5066if (matches){ 5067for (let i=0; i < matches.length; i++){ 5068let match=matches[i].match(/\d+/g), 5069key='baform-'+match[0], 5070val=$this.fields[key].value; 5071if (key in object){ 5072val=object[match[0]]; 5073} else if (key in defaultValues){ 5074object[key]=''; 5075val=formsApp.updateFieldsDefaultValue($this, defaultValues, defaultValues[key].value, object); 5076object[key]=val; 5077} 5078} 5079} 5080value=value.replace(/\[Page Title\]/g, title); 5081value=value.replace(/\[Page URL\]/g, url); 5082return value; 5083} 5084formsApp.updateFieldsValues=function(fields, $this, id){ 5085if ($this.type=='radio'&&$this.checked){ 5086fields[id]={ 5087value: $this.value, 5088price: $this.price * 1 5089} 5090} else if ($this.type=='checkbox'&&$this.checked){ 5091fields[id].value +=fields[id].value !='' ? ' '+$this.value : $this.value; 5092fields[id].price +=$this.price * 1; 5093} else if ($this.localName=='select'){ 5094$f($this).find('option').each(function(){ 5095if (this.selected){ 5096fields[id].value +=fields[id].value !='' ? ' '+this.value : this.value; 5097fields[id].price +=this.price * 1; 5098} 5099}); 5100} else if ($this.dataset.calendar){ 5101fields[id].value=$this.value; 5102fields[id].price=$this.price * 1; 5103} else if ($this.type=='hidden' || $this.type=='text' || $this.type=='number' 5104|| $this.localName=='textarea' || $this.type=='email'){ 5105fields[id].value=$this.value; 5106fields[id].price=$this.value.replace(/,/g, '.') * 1; 5107} else if ($this.type=='file'){ 5108fields[id].value=''; 5109fields[id].price=$this.uploads.count; 5110$this.closest('.ba-form-upload-field').classList[$this.uploads.count > 0 ? 'add' : 'remove']('has-uploaded-file'); 5111} 5112if (String(fields[id].price)=='NaN'){ 5113fields[id].price=0; 5114} 5115} 5116formsApp.checkConditionLogic=function($this){ 5117$this.pages={}; 5118$this.querySelectorAll('.hidden-condition-field').forEach((div)=> { 5119div.classList.remove('hidden-condition-field'); 5120});
5121conditionLogic[$this.formId].forEach(function(el){ 5122if (!el.publish){ 5123return true; 5124} 5125let flags=[], 5126page=null, 5127value; 5128el.when.forEach(function(obj){ 5129if (!obj.field || !obj.state){ 5130return true; 5131} 5132if (!$this.fields['baform-'+obj.field]){ 5133return true; 5134} 5135page=$this.items['baform-'+obj.field].closest('.ba-form-page'); 5136if ($this.items['baform-'+obj.field].classList.contains('hidden-condition-field') 5137|| $this.items['baform-'+obj.field].closest('.hidden-condition-field')){ 5138flags.push(false); 5139return true; 5140} 5141value=$this.fields['baform-'+obj.field].value; 5142if ($this.items['baform-'+obj.field].dataset.type=='checkbox' 5143|| $this.items['baform-'+obj.field].dataset.type=='selectMultiple'){ 5144value=[]; 5145$this.items['baform-'+obj.field].querySelectorAll('input[name], option').forEach(function(input){ 5146input.checked || input.selected ? value.push(input.value) : ''; 5147}); 5148} 5149switch (obj.state){ 5150case 'equal': 5151if (typeof value=='string'){ 5152flags.push(value==obj.value); 5153} else { 5154flags.push(value.indexOf(obj.value) !=-1); 5155} 5156break; 5157case 'not-equal': 5158if (typeof value=='string'){ 5159flags.push(value !=obj.value); 5160} else { 5161flags.push(value.indexOf(obj.value)==-1); 5162} 5163break; 5164case 'not-empty': 5165if (typeof value=='string'){ 5166flags.push(value !=''); 5167} else { 5168flags.push(value.length !=0); 5169} 5170break; 5171case 'empty': 5172if (typeof value=='string'){ 5173flags.push(value==''); 5174} else { 5175flags.push(value.length==0); 5176} 5177break; 5178case 'greater': 5179flags.push((!isNaN(value) ? value * 1 : value) > (!isNaN(obj.value) ? obj.value * 1 : obj.value)); 5180break; 5181case 'less': 5182flags.push((!isNaN(value) ? value * 1 : value) < (!isNaN(obj.value) ? obj.value * 1 : obj.value)); 5183break; 5184case 'contain': 5185flags.push(value.indexOf(obj.value) !=-1); 5186break; 5187case 'not-contain': 5188flags.push(value.indexOf(obj.value)==-1); 5189break; 5190} 5191}
5191); 5192if (!flags.length){ 5193return true; 5194} 5195let method=el.operation=='OR' ? 'some' : 'every', 5196flag=flags[method](function(state){return state}); 5197el.do.forEach(function(obj){ 5198if (obj.field&&obj.action){ 5199let item=$this.items['baform-'+obj.field] 5200|| $this.form[0].querySelector('.ba-form-page[data-page-key="'+obj.field+'"]'); 5201if (!item){ 5202return true; 5203} 5204if (obj.action=='show' || obj.action=='hide'){ 5205let method=(obj.action=='show'&&flag) || (obj.action=='hide'&&!flag) ? 'remove' : 'add'; 5206item.classList[method]('hidden-condition-field'); 5207item.querySelectorAll('input[name], select[name], textarea[name]').forEach(function(itm){ 5208if (itm.product){ 5209formsApp.productChange($this, itm.name); 5210} 5211}); 5212if (item.classList.contains('ba-form-submit-field')&&method=='remove'){ 5213CaptchaHelper.createIfExist(item.querySelector('.ba-form-submit-btn')); 5214} 5215} else if (obj.action=='move'&&flag){ 5216$this.pages[page.dataset.pageKey]={ 5217prev: page, 5218next: item 5219} 5220let hidden=[]; 5221$f(page).nextAll('.ba-form-page').each(function(){ 5222if (this==item){ 5223this.classList.remove('hidden-condition-field'); 5224return false; 5225} 5226this.classList.add('hidden-condition-field'); 5227hidden.push(this.dataset.pageKey); 5228}); 5229$this.pages[page.dataset.pageKey].hidden=hidden; 5230} 5231} 5232}); 5233$f(window).trigger('scroll'); 5234}); 5235} 5236formsApp.strrev=function(string){ 5237var ret='', i=0; 5238for (i=string.length - 1; i >=0; i--){ 5239ret +=string[i]; 5240} 5241return ret; 5242} 5243formsApp.renderPrice=function(value, thousand, separator, decimals){ 5244let delta=value < 0 ? '-' : '', 5245priceArray=value.replace('-', '').trim().split('.'), 5246priceThousand=priceArray[0], 5247priceDecimal=priceArray[1] ? priceArray[1] : '', 5248price=''; 5249if (priceThousand.length > 3&&thousand !=''){ 5250for (let i=0; i < priceThousand.length; i++){ 5251if (i % 3==0&&i !=0){ 5252price +=thousand; 5253} 5254price +=priceThousand[priceThousand.length - 1 - i]; 5255} 5256price=formsApp.strrev(price); 5257} else { 5258price +=priceThousand; 5259} 5260if (decimals !=0){ 5261price +=separator; 5262for (let i=0; i < decimals; i++){ 5263price +=priceDecimal[i] ? priceDecimal[i] : '0'; 5264} 5265} 5266return delta + price; 5267} 5268function formsHCaptchaOnload(){ 5269CaptchaFactory.get('hcaptcha').setCaptcha(hcaptcha); 5270} 5271function formsTurnstileOnload(){ 5272CaptchaFactory.get('turnstile').setCaptcha(turnstile); 5273} 5274class FormsCaptcha { 5275static captcha=null; 5276static loaded=false; 5277static type=''; 5278static src=''; 5279static settings={ 5280site_key: '', 5281secret_key: '' 5282} 5283static data={}; 5284static setCaptcha(captcha){ 5285this.captcha=captcha; 5286this.loaded=true; 5287this.init(); 5288} 5289static loadSettings(){ 5290formsApp.fetch.request(JUri + 'index.php?option=com_baforms&task=form.loadCaptchaSettings', { 5291type: this.type 5292}).then(text=> { 5293const settings=JSON.parse(text); 5294this.setSettings(settings); 5295this.createScript(); 5296document.head.append(this.script); 5297}); 5298} 5299static setSettings(settings){ 5300this.settings=settings; 5301} 5302static check(id){ 5303return app.items[id]&&app.items[id].recaptcha==this.type; 5304} 5305static createScript(){ 5306this.script=document.createElement('script'); 5307this.script.src=this.src; 5308} 5309static load(){ 5310if (this.loaded){ 5311this.init(); 5312} else if (!this.loaded&&!this.loading){ 5313this.loading=true; 5314this.loadSettings(); 5315} 5316} 5317static init(){ 5318document.querySelectorAll(`.ba-form-submit-btn[data-captcha="${this.type}"]`).forEach(btn=> { 5319this.create(btn); 5320}); 5321} 5322static create(btn){ 5323if (!this.loaded){ 5324return; 5325} 5326const element=btn.closest('.ba-form-submit-field'); 5327if (element.offsetHeight==0 || element.rendered){ 5328return; 5329} 5330this.set(element); 5331} 5332static set(element){ 5333const div=document.createElement('div'); 5334const parent=element.querySelector('.ba-form-submit-recaptcha-wrapper'); 5335div.id=`forms-recaptcha-${Date.now()}`; 5336div.className='forms-recaptcha'; 5337div.dataset.captcha=this.type; 5338parent.append(div); 5339this.render(div); 5340element.rendered=true; 5341} 5342static render(div){ 5343} 5344static get(key){ 5345return this.settings[key]; 5346} 5347static async getResponse(id, element){ 5348return new Promise(resolve=> { 5349resolve(''); 5350}) 5351} 5352} 5353class FormsTurnstileCaptcha extends FormsCaptcha { 5354static src='https://challenges.cloudflare.com/turnstile/v0/api.js?onload=formsTurnstileOnload'; 5355static type='turnstile'; 5356static async getResponse(id, element){ 5357return new Promise(resolve=> { 5358resolve(!this.captcha.isExpired(id) ? this.captcha.getResponse(id) : ''); 5359}) 5360} 5361static render(div){ 5362FormsCaptcha.data[div.id]=this.captcha.render(div, { 5363sitekey: this.settings.site_key, 5364theme: this.settings.theme, 5365size: this.settings.size, 5366callback: CaptchaHelper.clearAlerts 5367}); 5368} 5369static reset(id){ 5370const widgetId=FormsCaptcha.data[id]; 5371this.captcha.reset(widgetId); 5372} 5373} 5374class FormsHCaptcha extends FormsCaptcha { 5375static src='https://js.hcaptcha.com/1/api.js?onload=formsHCaptchaOnload'; 5376static type='hcaptcha'; 5377static async getResponse(id, element){ 5378if (!this.settings.invisible){ 5379return await this.captcha.getResponse(id); 5380} 5381const token=await this.captcha.getResponse(); 5382if (!token){ 5383await this.captcha.execute(id); 5384} 5385return await this.captcha.getResponse(); 5386} 5387static render(div){ 5388const size=this.settings.invisible ? 'invisible' : 'normal' 5389div.dataset.size=size; 5390FormsCaptcha.data[div.id]=this.captcha.render(div, { 5391sitekey: this.settings.site_key, 5392theme: this.settings.theme, 5393size: size, 5394callback: CaptchaHelper.clearAlerts 5395}); 5396} 5397} 5398class FormsGoogleRecaptcha extends FormsCaptcha { 5399static src='https://www.google.com/recaptcha/api.js?render='; 5400static type='grecaptcha'; 5401static createScript(){ 5402super.createScript(); 5403this.script.src=this.src + this.settings.site_key; 5404this.script.onload=()=> { 5405grecaptcha.ready(function (){ 5406CaptchaFactory.get('grecaptcha').setCaptcha(grecaptcha); 5407}); 5408} 5409} 5410static async getResponse(id, element){ 5411return new Promise(resolve=> { 5412this.execute().then(token=> { 5413element.innerHTML=`<input type="hidden" name="g-recaptcha-response" value="${token}">`; 5414resolve(token); 5415}); 5416}) 5417} 5418static render(div){ 5419this.execute() 5420} 5421static async execute(){ 5422return await this.captcha.execute(this.settings.site_key, { 5423action: 'submit' 5424}) 5425} 5426} 5427class CaptchaFactory { 5428/** @type {Object<string, typeof FormsCaptcha>} */ 5429static map={ 5430hcaptcha: FormsHCaptcha, 5431turnstile: FormsTurnstileCaptcha, 5432grecaptcha: FormsGoogleRecaptcha 5433} 5434/** @param {string} key */ 5435static has(key){ 5436return key in this.map; 5437} 5438/** 5439* @param {string} key 5440* @returns {typeof FormsCaptcha} 5441*/ 5442static get(key){ 5443return this.map[key]; 5444} 5445} 5446class CaptchaHelper { 5447static getIfExist(element){ 5448const captcha=element.dataset.captcha; 5449if (!captcha || !CaptchaFactory.has(captcha)){ 5450return null; 5451} 5452return CaptchaFactory.get(captcha) 5453} 5454static loadIfExist(){
5455document.querySelectorAll('.ba-form-submit-btn').forEach(btn=> { 5456const captcha=this.getIfExist(btn); 5457if (captcha){ 5458captcha.load(); 5459} 5460}); 5461} 5462static createIfExist(btn){ 5463const captcha=this.getIfExist(btn); 5464if (captcha){ 5465captcha.create(btn); 5466} 5467} 5468static async isValidResponse(element){ 5469if (!CaptchaFactory.has(element.dataset.captcha)){ 5470return; 5471} 5472const widgetId=FormsCaptcha.data[element.id]; 5473const captcha=CaptchaFactory.get(element.dataset.captcha); 5474const response=await captcha.getResponse(widgetId, element); 5475const isValid=response !=''; 5476formsApp.toggleAlertTooltip(!isValid, element, element, 'THIS_FIELD_REQUIRED'); 5477return isValid; 5478} 5479static async checkResponse(btn){ 5480let isValid=true; 5481const recaptcha=btn.closest('.ba-form-submit-wrapper').querySelector('.forms-recaptcha'); 5482if (recaptcha){ 5483isValid=await CaptchaHelper.isValidResponse(recaptcha); 5484} 5485return isValid; 5486} 5487static clearAlerts(){ 5488$f('.forms-recaptcha').each(function (){ 5489formsApp.removeAlertTooltip(this); 5490}); 5491} 5492} 5493formsApp.executeInputMask=function(input, mask){ 5494let n=input.beforeData.start + Math.abs(input.beforeData.value.length - input.value.length), 5495pos=mask.indexOf('_'), 5496text=[], 5497delData=[], 5498start=null, 5499updateStart=null, 5500value=mask; 5501if (input.value.length > input.beforeData.value.length || input.value.length==input.beforeData.value.length){ 5502let i=0; 5503for (i; i < input.beforeData.start; i++){ 5504if (mask[i]=='_'&&/\d/.test(input.beforeData.value[i])){ 5505text.push(input.beforeData.value[i]); 5506} 5507} 5508i=input.beforeData.start; 5509n=input.value.length > input.beforeData.value.length ? n : input.beforeData.end; 5510for (i; i < n; i++){ 5511if (/\d/.test(input.value[i])){ 5512text.push(input.value[i]); 5513} 5514} 5515start=pos; 5516for (i=0; i < text.length; i++){ 5517start=mask.indexOf('_', start + 1); 5518if (start==-1){ 5519start=mask.length; 5520} 5521} 5522for (i=input.beforeData.end; i < input.beforeData.value.length; i++){ 5523if (mask[i]=='_'&&/\d/.test(input.beforeData.value[i])){ 5524text.push(input.beforeData.value[i]); 5525} 5526} 5527} else if (input.beforeData.start==0&&input.beforeData.end==mask.length){ 5528for (let i=0; i < input.value.length; i++){ 5529if (/\d/.test(input.value[i])){ 5530text.push(input.value[i]); 5531} 5532} 5533updateStart=true; 5534} else if (input.beforeData.start < input.selectionStart){ 5535let i=0; 5536for (i; i < input.selectionStart; i++){ 5537if (mask[i]=='_'&&/\d/.test(input.value[i])){ 5538text.push(input.value[i]); 5539} 5540} 5541start=i; 5542for (let j=input.beforeData.end; j < input.beforeData.value.length; j++){ 5543if (mask[j]=='_'&&/\d/.test(input.beforeData.value[j])){ 5544text.push(input.beforeData.value[j]); 5545} 5546} 5547} else { 5548let i=input.selectionStart < input.beforeData.start ? input.selectionStart : input.beforeData.start; 5549n=input.selectionStart < input.beforeData.start ? input.beforeData.start : n; 5550for (i; i < n; i++){ 5551delData.push(i); 5552} 5553} 5554if (delData.length==1&&mask[delData[0]] !='_'&&input.selectionStart < input.beforeData.start){ 5555for (let i=input.selectionStart; i >=0; i--){ 5556if (mask[i]=='_'){ 5557delData[0]=i; 5558break; 5559} 5560} 5561} else if (delData.length==1&&mask[delData[0]] !='_'){ 5562for (let i=input.selectionStart; i < mask.length; i++){ 5563if (mask[i]=='_'){ 5564delData[0]=i; 5565break; 5566} 5567} 5568} 5569if (delData.length){ 5570start=delData[0]; 5571for (let i=0; i < input.beforeData.value.length; i++){ 5572if (delData.indexOf(i)==-1&&mask[i]=='_'){ 5573text.push(input.beforeData.value[i]); 5574} 5575} 5576} 5577input.value=value; 5578text.forEach(function(el){ 5579if (pos !=-1){ 5580input.setSelectionRange(pos, ++pos); 5581input.setRangeText(el); 5582if (updateStart){ 5583start=pos; 5584} 5585} 5586pos=input.value.indexOf('_'); 5587}); 5588if (start !==null){ 5589input.setSelectionRange(start, start); 5590} 5591} 5592formsApp.prepareInputMask=function(input, mask, event){ 5593let value=input.value ? input.value : mask; 5594if (event){ 5595input.beforeData={ 5596start: input.selectionStart, 5597end: input.selectionEnd, 5598value: value 5599}; 5600} else { 5601input.beforeData={ 5602start: 0, 5603end: 0, 5604value: value 5605}; 5606input.value=value; 5607} 5608} 5609formsApp.executeMask=function(input, mask){ 5610let i=0, 5611flag=true, 5612value=''; 5613for (i=0; i < input.value.length; i++){ 5614flag=input.value[i]==mask[i] || mask[i]=='#'&&/\d/.test(input.value[i]) 5615if (flag){ 5616value +=input.value[i]; 5617} else { 5618break; 5619} 5620} 5621if (!flag){ 5622let subValue=input.value.substr(i), 5623match=subValue.match(/\d+/), 5624ind=0; 5625for (i; i < mask.length; i++){ 5626if (mask[i] !='#'){ 5627value +=mask[i]; 5628} else if (match&&match[0][ind]){ 5629value +=match[0][ind++]; 5630} else { 5631break; 5632} 5633} 5634input.value=value; 5635} 5636} 5637formsApp.sortPoll=function(field){ 5638let array=Array.apply(null, field.querySelectorAll('.ba-form-checkbox-wrapper')), 5639last=null, 5640count=field.style.getPropertyValue('--checkbox-field-count') * 1, 5641index=1; 5642array.sort(function(a, b){ 5643if (a.style.getPropertyValue('--poll-order') * 1 > b.style.getPropertyValue('--poll-order') * 1){ 5644return 1; 5645} else if (a.style.getPropertyValue('--poll-order') * 1 < b.style.getPropertyValue('--poll-order') * 1){ 5646return -1; 5647} else { 5648return 0; 5649} 5650}); 5651array.forEach(function(div){ 5652if (index==count){ 5653div.classList.add('last-row-checkbox-wrapper'); 5654index=0; 5655} else { 5656div.classList.remove('last-row-checkbox-wrapper'); 5657} 5658index++; 5659}); 5660last=array.pop(); 5661last ? last.classList.add('last-row-checkbox-wrapper') : ''; 5662} 5663formsApp.refreshToken=async function(){ 5664const endPoint=`${JUri}index.php?option=com_baforms&task=form.getFormToken`; 5665const token=await formsApp.fetch.request(endPoint); 5666this.token=token.trim(); 5667} 5668document.addEventListener('DOMContentLoaded', formsApp.createForms); 5669if (document.readyState=='complete'){ 5670formsApp.createForms(); 5671} 5672/** 5673* @package Gridbox 5674* @author Balbooa http://www.balbooa.com/ 5675* @copyright Copyright @ Balbooa 5676* @license http://www.gnu.org/licenses/gpl.html GNU/GPL 5677*/ 5678$g.easing['jswing']=$g.easing['swing']; 5679$g.extend($g.easing, { 5680def: 'easeOutQuad', 5681swing: function (x, t, b, c, d){ 5682return $g.easing[$g.easing.def](x, t, b, c, d); 5683}, 5684easeOutQuad: function (x, t, b, c, d){ 5685return -c *(t /=d) * (t - 2) + b; 5686}, 5687easeOutCubic: function (x, t, b, c, d){ 5688return c * ((t=t / d - 1) * t * t + 1) + b; 5689}, 5690easeInQuart: function (x, t, b, c, d){ 5691return c * (t /=d) * t * t * t + b; 5692}, 5693easeOutQuart: function (x, t, b, c, d){ 5694return -c * ((t=t / d - 1) * t * t * t - 1) + b; 5695}, 5696easeInSine: function (x, t, b, c, d){ 5697return -c * Math.cos(t / d * (Math.PI / 2)) + c + b; 5698}, 5699easeOutSine: function (x, t, b, c, d){ 5700return c * Math.sin(t / d * (Math.PI / 2)) + b; 5701}, 5702easeInExpo: function (x, t, b, c, d){ 5703return (t==0) ? b : c * Math.pow(2, 10 * (t / d - 1)) + b; 5704}, 5705easeOutExpo: function (x, t, b, c, d){ 5706return (t==d) ? b + c : c * (-Math.pow(2, -10 * t / d) + 1) + b; 5707} 5708}); 5709app.getCorrectColor=function(key){ 5710return key.indexOf('@')===-1 ? key : 'var('+key.replace('@', '--')+')'; 5711} 5712app.initItems=function(obj, key){ 5713presetsCompatibility(obj); 5714var object={ 5715data : obj, 5716selector : key 5717}; 5718switch (obj.type){ 5719case 'submission-form': 5720app.checkModule('initSubmissionForm', object); 5721break; 5722case 'checkout-order-form': 5723app.checkModule('initCheckoutOrderForm', object); 5724break; 5725case 'lottie-animations': 5726app.checkModule('initLottieAnimations', object); 5727break; 5728case 'language-switcher': 5729app.checkModule('initLanguageSwitcher', object); 5730break; 5731case 'currency-switcher': 5732app.checkModule('initCurrencySwitcher', object); 5733break; 5734case 'button': 5735case 'icon': 5736app.checkModule('initButton', object); 5737break; 5738case 'submit-button': 5739app.checkModule('initSubmitButton', object); 5740break; 5741case 'add-to-cart': 5742app.checkModule('initAddToCart', object); 5743break; 5744case 'cart': 5745app.checkModule('initCart', object); 5746break; 5747case 'login': 5748app.checkModule('initLogin', object); 5749break; 5750case 'wishlist': 5751app.checkModule('initWishlist', object); 5752break; 5753case 'text': 5754app.checkModule('initText', object); 5755break; 5756case 'vk-comments': 5757app.checkModule('initvkcomments', object); 5758break; 5759case 'comments-box': 5760app.checkModule('initCommentsBox', object); 5761break; 5762case 'reviews': 5763app.checkModule('initReviews', object); 5764break; 5765case 'facebook-comments': 5766app.checkModule('initfacebookcomments', object); 5767break; 5768case 'progress-pie': 5769app.checkModule('initprogressPie', object); 5770break; 5771case 'before-after-slider': 5772app.checkModule('initBeforeAfterSlider', object); 5773break; 5774case 'hotspot': 5775app.checkModule('initHotspot', object); 5776break; 5777case 'reading-progress-bar': 5778app.checkModule('initReadingProgressBar', object); 5779break; 5780case 'progress-bar': 5781app.checkModule('initprogressBar', object); 5782break; 5783case 'yandex-maps': 5784app.checkModule('initYandexMaps', object); 5785break; 5786case 'openstreetmap': 5787app.checkModule('initOpenstreetmap', object); 5788break; 5789case 'image-field': 5790app.checkModule('initimage', object); 5791break; 5792case 'field-google-maps': 5793case 'google-maps-places': 5794app.checkModule('initmap', object); 5795break; 5796case 'scroll-to' : 5797case 'star-ratings' : 5798case 'scroll-to-top' : 5799case 'disqus' : 5800case 'image' : 5801case 'countdown' : 5802case 'counter' : 5803case 'map' : 5804case 'weather' : 5805case 'menu' : 5806case 'accordion' : 5807case 'tabs' : 5808case 'one-page' : 5809case 'social' : 5810case 'overlay-button' : 5811case 'video' : 5812case 'hypercomments' : 5813case 'headline' : 5814case 'flipbox' : 5815app.checkModule('init'+obj.type, object); 5816break; 5817case 'search': 5818case 'store-search': 5819app.checkModule('initStoreSearch', object); 5820break; 5821case 'content-slider' : 5822case 'slideshow' :
5823case 'field-slideshow' : 5824case 'product-slideshow' : 5825app.checkModule('initslideshow', object); 5826break; 5827case 'simple-gallery': 5828case 'field-simple-gallery': 5829case 'product-gallery': 5830app.checkModule('initSimpleGallery', object); 5831break; 5832case 'slideset' : 5833case 'carousel' : 5834case 'recent-posts-slider' : 5835case 'related-posts-slider' : 5836case 'recently-viewed-products' : 5837app.checkModule('initslideset', object); 5838break; 5839case 'testimonials-slider' : 5840app.checkModule('initTestimonials', object); 5841break; 5842case 'categories': 5843app.checkModule('initCategories', object); 5844case 'blog-posts': 5845case 'search-result': 5846case 'store-search-result': 5847case 'recent-posts': 5848case 'post-navigation': 5849case 'related-posts': 5850case 'recent-reviews': 5851app.checkModule('initMasonryBlog', object); 5852break; 5853case 'event-calendar' : 5854app.checkModule('initEventCalendar', object); 5855break; 5856case 'fields-filter' : 5857app.checkModule('initItemsFilter', object); 5858break; 5859default : 5860initItems(); 5861break; 5862} 5863} 5864function initItems(){ 5865if (itemsInit.length > 0){ 5866app.checkModule('initItems', itemsInit.shift()); 5867} 5868} 5869function presetsCompatibility(obj){ 5870switch (obj.type){ 5871case 'button': 5872case 'overlay-button': 5873case 'scroll-to': 5874case 'scroll-to-top': 5875if (!obj.desktop.icons){ 5876obj.desktop.icons={ 5877size : obj.desktop.size 5878} 5879delete(obj.desktop.size); 5880if (obj.type=='scroll-to'){ 5881obj.desktop.icons.align='center'; 5882} 5883for (var ind in breakpoints){ 5884if (obj[ind]&&obj[ind].size){ 5885obj[ind].icons={ 5886size : obj[ind].size 5887}; 5888delete(obj[ind].size); 5889} 5890} 5891} 5892if (obj.type=='scroll-to-top'&&!obj.text){ 5893obj.text={ 5894align: obj["scrolltop-align"] 5895} 5896delete(obj["scrolltop-align"]); 5897} 5898if (obj.type=='scroll-to'&&!obj.desktop.typography){ 5899obj.desktop.icons.position='after'; 5900obj.desktop.typography={ 5901"font-family":"@default", 5902"font-size":10, 5903"font-style":"normal", 5904"font-weight":"700", 5905"letter-spacing":4, 5906"line-height":26, 5907"text-align":obj.desktop.icons.align, 5908"text-decoration":"none", 5909"text-transform":"uppercase" 5910} 5911delete(obj.desktop.icons.align); 5912for (var ind in breakpoints){ 5913if (obj[ind]&&obj[ind].icons&&obj[ind].icons.align){ 5914obj[ind].typography={ 5915"text-align": obj[ind].icons.align 5916}; 5917delete(obj[ind].icons.align); 5918} 5919} 5920} 5921case 'tags': 5922case 'post-tags': 5923case 'icon': 5924case 'social-icons': 5925if (!obj.desktop.normal){ 5926obj.desktop.normal={ 5927color: obj.desktop.color, 5928'background-color' : obj.desktop['background-color'] 5929} 5930delete(obj.desktop.color); 5931delete(obj.desktop['background-color']); 5932for (var ind in breakpoints){ 5933if (obj[ind]){ 5934if (obj[ind].color || obj[ind]['background-color']){ 5935obj[ind].normal={}; 5936if (obj[ind].color){ 5937obj[ind].normal.color=obj[ind].color; 5938delete(obj[ind].color); 5939} 5940if (obj[ind]['background-color']){ 5941obj[ind].normal['background-color']=obj[ind]['background-color']; 5942delete(obj[ind]['background-color']); 5943} 5944} 5945} 5946} 5947} 5948break; 5949case 'counter': 5950case 'countdown': 5951if (!obj.desktop.background){ 5952obj.desktop.background={ 5953color: obj.desktop.color 5954} 5955delete(obj.desktop.color); 5956for (var ind in breakpoints){ 5957if (obj[ind]&&obj[ind].color){ 5958obj[ind].background={ 5959color: obj[ind].color 5960}; 5961delete(obj[ind].color); 5962} 5963} 5964} 5965break; 5966case 'categories': 5967if (!obj.desktop.view){ 5968obj.desktop.view={ 5969counter: obj.desktop.counter, 5970sub: obj.desktop.sub 5971} 5972delete(obj.desktop.counter); 5973delete(obj.desktop.sub); 5974for (var ind in breakpoints){ 5975if (obj[ind]){ 5976if ('counter' in obj[ind] || 'sub' in obj[ind]){ 5977obj[ind].view={}; 5978if ('counter' in obj[ind]){ 5979obj[ind].view.counter=obj[ind].counter; 5980delete(obj[ind].counter); 5981} 5982if ('sub' in obj[ind]){ 5983obj[ind].view.sub=obj[ind].sub; 5984delete(obj[ind].sub); 5985} 5986} 5987} 5988} 5989} 5990break; 5991case 'carousel': 5992case 'slideset': 5993if (!obj.desktop.view){ 5994obj.desktop.view={ 5995dots: obj.desktop.dots.enable, 5996arrows: obj.desktop.arrows.enable, 5997height: obj.desktop.height, 5998size: obj.desktop.size 5999} 6000obj.desktop.overlay={ 6001color: obj.desktop.caption.color 6002} 6003obj.desktop.gutter=obj.gutter !=''; 6004delete(obj.desktop.dots.enable); 6005delete(obj.desktop.arrows.enable); 6006delete(obj.desktop.caption.color); 6007delete(obj.gutter); 6008delete(obj.desktop.overflow); 6009delete(obj.desktop.height); 6010delete(obj.desktop.size); 6011for (var ind in breakpoints){ 6012if (obj[ind]){ 6013if ('overflow' in obj[ind] || 'height' in obj[ind] || 'size' in obj[ind]){ 6014obj[ind].view={}; 6015if ('overflow' in obj[ind]){ 6016obj[ind].view.overflow=obj[ind].overflow; 6017delete(obj[ind].overflow); 6018} 6019if ('height' in obj[ind]){ 6020obj[ind].view.height=obj[ind].height; 6021delete(obj[ind].height); 6022} 6023if ('size' in obj[ind]){ 6024obj[ind].view.size=obj[ind].size; 6025delete(obj[ind].size); 6026} 6027} 6028} 6029} 6030} 6031break; 6032case 'slideshow': 6033if (!obj.desktop.view){ 6034obj.desktop.view={ 6035dots: obj.desktop.dots.enable, 6036arrows: obj.desktop.arrows.enable, 6037fullscreen: obj.desktop.fullscreen, 6038height: obj.desktop.height, 6039size: obj.desktop.size 6040} 6041delete(obj.desktop.dots.enable); 6042delete(obj.desktop.arrows.enable); 6043delete(obj.desktop.fullscreen); 6044delete(obj.desktop.height); 6045delete(obj.desktop.size); 6046for (var ind in breakpoints){ 6047if (obj[ind]){ 6048if ('fullscreen' in obj[ind] || 'height' in obj[ind] || 'size' in obj[ind]){ 6049obj[ind].view={}; 6050if ('fullscreen' in obj[ind]){ 6051obj[ind].view.fullscreen=obj[ind].fullscreen; 6052delete(obj[ind].fullscreen); 6053} 6054if ('height' in obj[ind]){ 6055obj[ind].view.height=obj[ind].height; 6056delete(obj[ind].height); 6057} 6058if ('size' in obj[ind]){ 6059obj[ind].view.size=obj[ind].size; 6060delete(obj[ind].size); 6061} 6062} 6063} 6064} 6065} 6066break; 6067case 'accordion': 6068if (!obj.desktop.icon){ 6069obj.desktop.icon={ 6070position : obj['icon-position'], 6071size: obj.desktop.size 6072} 6073obj.desktop.background={ 6074color: obj.desktop.background 6075} 6076delete(obj['icon-position']); 6077delete(obj.desktop.size); 6078for (var ind in breakpoints){ 6079if (obj[ind]){ 6080if (obj[ind].size){ 6081obj[ind].icon={ 6082size: obj[ind].size 6083} 6084delete(obj[ind].size); 6085} 6086if (obj[ind].background){ 6087obj[ind].background={ 6088color: obj[ind].background 6089} 6090} 6091} 6092} 6093} 6094break; 6095case 'tabs': 6096if (!obj.desktop.icon){ 6097obj.desktop.icon={ 6098position : obj['icon-position'], 6099size: obj.desktop.size 6100} 6101obj.desktop.background={ 6102color: obj.desktop.background 6103} 6104delete(obj['icon-position']); 6105delete(obj.desktop.size); 6106for (var ind in breakpoints){ 6107if (obj[ind]){ 6108if (obj[ind].size){ 6109obj[ind].icon={ 6110size: obj[ind].size 6111} 6112delete(obj[ind].size); 6113} 6114if (obj[ind].background){ 6115obj[ind].background={ 6116color: obj[ind].background 6117} 6118} 6119} 6120} 6121} 6122break; 6123case 'image': 6124if (!obj.desktop.style){ 6125if (!obj.desktop.width){ 6126obj.desktop.width=obj.width; 6127delete(obj.width); 6128} 6129obj.popup=Boolean(obj.lightbox.enable * 1); 6130obj.desktop.style={ 6131width: obj.desktop.width, 6132align: obj.align 6133} 6134delete(obj.desktop.width);
6135delete(obj.desktop.align); 6136delete(obj.lightbox.enable); 6137for (var ind in breakpoints){ 6138if (obj[ind]){ 6139if ('width' in obj[ind] || 'align' in obj[ind]){ 6140obj[ind].style={}; 6141if ('width' in obj[ind]){ 6142obj[ind].style.width=obj[ind].width; 6143delete(obj[ind].width); 6144} 6145if ('align' in obj[ind]){ 6146obj[ind].style.align=obj[ind].align; 6147delete(obj[ind].align); 6148} 6149} 6150} 6151} 6152} 6153break; 6154case 'simple-gallery': 6155if (!obj.desktop.view){ 6156obj.desktop.view={ 6157"height": obj.desktop.height 6158} 6159delete(obj.desktop.height); 6160for (var ind in breakpoints){ 6161if (obj[ind]){ 6162if ('height' in obj[ind]){ 6163obj[ind].view={}; 6164obj[ind].view.height=obj[ind].height; 6165delete(obj[ind].height); 6166} 6167} 6168} 6169} 6170break; 6171case 'weather': 6172if (!obj.desktop.view){ 6173obj.desktop.view={ 6174"layout" : obj.layout, 6175"forecast" : obj.desktop.forecast, 6176"wind" : obj.desktop.wind, 6177"humidity" : obj.desktop.humidity, 6178"pressure" : obj.desktop.pressure, 6179"sunrise-wrapper" : obj.desktop['sunrise-wrapper'] 6180} 6181delete(obj.layout); 6182delete(obj.desktop.forecast); 6183delete(obj.desktop.wind); 6184delete(obj.desktop.humidity); 6185delete(obj.desktop.pressure); 6186delete(obj.desktop['sunrise-wrapper']); 6187for (var ind in breakpoints){ 6188if (obj[ind]){ 6189if ('forecast' in obj[ind] || 'wind' in obj[ind] || 'humidity' in obj[ind] || 6190'pressure' in obj[ind] || 'sunrise-wrapper' in obj[ind]){ 6191obj[ind].view={}; 6192if ('forecast' in obj[ind]){ 6193obj[ind].view.forecast=obj[ind].forecast; 6194delete(obj[ind].forecast); 6195} 6196if ('wind' in obj[ind]){ 6197obj[ind].view.wind=obj[ind].wind; 6198delete(obj[ind].wind); 6199} 6200if ('humidity' in obj[ind]){ 6201obj[ind].view.humidity=obj[ind].humidity; 6202delete(obj[ind].humidity); 6203} 6204if ('pressure' in obj[ind]){ 6205obj[ind].view.pressure=obj[ind].pressure; 6206delete(obj[ind].pressure); 6207} 6208if ('sunrise-wrapper' in obj[ind]){ 6209obj[ind].view['sunrise-wrapper']=obj[ind]['sunrise-wrapper']; 6210delete(obj[ind]['sunrise-wrapper']); 6211} 6212} 6213} 6214} 6215} 6216break; 6217case "menu": 6218if (!obj.desktop.background){ 6219obj.desktop.background={ 6220color: obj.desktop['background-color'] 6221} 6222delete(obj.desktop['background-color']); 6223for (var ind in breakpoints){ 6224if (obj[ind]&&'background-color' in obj[ind]){ 6225obj[ind].background={ 6226color: obj[ind]['background-color'] 6227} 6228delete(obj[ind]['background-color']); 6229} 6230} 6231obj.layout={ 6232layout: obj.layout 6233} 6234} 6235break; 6236case "one-page": 6237if (typeof(obj.layout)=='string'){ 6238obj.layout={ 6239layout: obj.layout, 6240type: obj['menu-type'] 6241} 6242delete(obj['menu-type']); 6243} 6244break; 6245case 'social': 6246if (!obj.view){ 6247obj.view={ 6248"layout" : obj.layout, 6249"size" : obj.size, 6250"style" : obj.style, 6251"counters" : obj.counters 6252} 6253delete(obj.layout); 6254delete(obj.size); 6255delete(obj.style); 6256delete(obj.counters); 6257} 6258break; 6259case 'recent-posts-slider': 6260if (!obj.desktop.reviews){ 6261obj.desktop.reviews={ 6262margin: { 6263top: 0, 6264bottom: 25 6265}, 6266"hover": { 6267"color" : "@primary" 6268}, 6269"typography": { 6270"color":"@title", 6271"font-family":"@default", 6272"font-size":"12", 6273"font-style":"normal", 6274"font-weight":"900", 6275"letter-spacing":"0", 6276"line-height":"18", 6277"text-decoration":"none", 6278"text-align":"left", 6279"text-transform":"none" 6280} 6281} 6282} 6283break; 6284case 'recent-posts': 6285case 'search-result': 6286case 'store-search-result': 6287case 'post-navigation': 6288case 'related-posts': 6289case 'blog-posts': 6290if (!obj.desktop.reviews){ 6291obj.desktop.reviews={ 6292margin: { 6293top: 0, 6294bottom: 25 6295}, 6296"hover": { 6297"color" : "@primary" 6298}, 6299"typography": { 6300"color":"@title", 6301"font-family":"@default", 6302"font-size":"12", 6303"font-style":"normal", 6304"font-weight":"900", 6305"letter-spacing":"0", 6306"line-height":"18", 6307"text-decoration":"none", 6308"text-align":"left", 6309"text-transform":"none" 6310} 6311} 6312} 6313if (obj.type=='blog-posts'&&obj.desktop.image.show==undefined){ 6314obj.desktop.image.show=true; 6315obj.desktop.title.show=true; 6316obj.desktop.date=true; 6317obj.desktop.category=true; 6318obj.desktop.intro.show=true; 6319obj.desktop.button.show=true; 6320obj.desktop.hits=true; 6321} else if (obj.type !='blog-posts'&&obj.desktop.hits==undefined){ 6322obj.desktop.hits=false; 6323} 6324if (!obj.desktop.title.hover){ 6325obj.desktop.title.hover={ 6326"color" : '#fc5859' 6327} 6328obj.desktop.info.hover={ 6329"color" : '#fc5859' 6330} 6331} 6332if (!obj.desktop.background){ 6333obj.desktop.background={ 6334"color" : "rgba(242, 250, 250, 0)" 6335}; 6336obj.desktop.shadow={ 6337"value":0, 6338"color":"rgba(0, 0, 0, 0.15)" 6339}; 6340obj.desktop.border={ 6341"color" : "#000000", 6342"radius" : "0", 6343"style" : "solid", 6344"width" : "0" 6345} 6346} 6347if (!obj.desktop.view){ 6348obj.desktop.view={ 6349"count" : obj.desktop.count, 6350"gutter" : obj.desktop.gutter, 6351"date" : obj.desktop.date, 6352"category" : obj.desktop.category, 6353"image": obj.desktop.image.show, 6354"title": obj.desktop.title.show, 6355"intro": obj.desktop.intro.show, 6356"button": obj.desktop.button.show, 6357"hits" : obj.desktop.hits 6358} 6359delete(obj.desktop.count); 6360delete(obj.desktop.gutter); 6361delete(obj.desktop.date); 6362delete(obj.desktop.category); 6363delete(obj.desktop.title.show); 6364delete(obj.desktop.intro.show); 6365delete(obj.desktop.button.show); 6366obj.desktop.overlay={ 6367color: obj.desktop.overlay 6368} 6369for (var ind in breakpoints){ 6370if (obj[ind]){ 6371obj[ind].view={}; 6372if ('count' in obj[ind]){ 6373obj[ind].view.count=obj[ind].count; 6374delete(obj[ind].count); 6375} 6376if ('gutter' in obj[ind]){ 6377obj[ind].view.gutter=obj[ind].gutter;
6378delete(obj[ind].gutter); 6379} 6380if ('date' in obj[ind]){ 6381obj[ind].view.date=obj[ind].date; 6382delete(obj[ind].date); 6383} 6384if ('category' in obj[ind]){ 6385obj[ind].view.category=obj[ind].category; 6386delete(obj[ind].category); 6387} 6388if ('hits' in obj[ind]){ 6389obj[ind].view.hits=obj[ind].hits; 6390delete(obj[ind].hits); 6391} 6392if (obj[ind].image&&'show' in obj[ind].image){ 6393obj[ind].view.image=obj[ind].image.show; 6394} 6395if (obj[ind].title&&'show' in obj[ind].title){ 6396obj[ind].view.title=obj[ind].title.show; 6397delete(obj[ind].title.show); 6398} 6399if (obj[ind].intro&&'show' in obj[ind].intro){ 6400obj[ind].view.intro=obj[ind].intro.show; 6401delete(obj[ind].intro.show); 6402} 6403if (obj[ind].button&&'show' in obj[ind].button){ 6404obj[ind].view.button=obj[ind].button.show; 6405delete(obj[ind].button.show); 6406} 6407} 6408} 6409obj.layout={ 6410layout: obj.layout 6411} 6412} 6413break; 6414case 'search': 6415if (!obj.desktop.icons){ 6416obj.desktop.icons={ 6417size: obj.desktop.size, 6418position: obj.icon.position 6419} 6420delete(obj.desktop.size); 6421delete(obj.icon.position); 6422for (var ind in breakpoints){ 6423if (obj[ind]){ 6424obj[ind].icons={}; 6425if ('size' in obj[ind]){ 6426obj[ind].icons.size=obj[ind].size; 6427delete(obj[ind].size); 6428} 6429} 6430} 6431} 6432break; 6433case 'category-intro': 6434case 'post-intro': 6435if (!obj.desktop.info.hover){ 6436obj.desktop.info.hover={ 6437color : '#fc5859' 6438}; 6439} 6440if (obj.desktop.image.show==undefined){ 6441obj.desktop.image.show=true; 6442obj.desktop.title.show=true; 6443obj.desktop.date=true; 6444obj.desktop.category=true; 6445obj.desktop.hits=true; 6446} 6447if (!obj.desktop.view){ 6448obj.desktop.view={ 6449"date": obj.desktop.date, 6450"category": obj.desktop.category, 6451"hits": obj.desktop.hits 6452} 6453delete(obj.desktop.date); 6454delete(obj.desktop.date); 6455delete(obj.desktop.date); 6456obj.layout={ 6457"layout": obj.layout 6458} 6459for (var ind in breakpoints){ 6460if (obj[ind]){ 6461obj[ind].view={}; 6462if ('date' in obj[ind]){ 6463obj[ind].view.date=obj[ind].date; 6464delete(obj[ind].date); 6465} 6466if ('category' in obj[ind]){ 6467obj[ind].view.category=obj[ind].category; 6468delete(obj[ind].category); 6469} 6470if ('hits' in obj[ind]){ 6471obj[ind].view.hits=obj[ind].hits; 6472delete(obj[ind].hits); 6473} 6474} 6475} 6476} 6477break; 6478} 6479if (obj.type=='icon' || obj.type=='social-icons'){ 6480if (!obj.desktop.icon){ 6481obj.desktop.icon={ 6482'size' : obj.desktop.size, 6483'text-align': obj.desktop['text-align'], 6484} 6485delete(obj.desktop.size); 6486delete(obj.desktop['text-align']); 6487for (var ind in breakpoints){ 6488if (obj[ind]){ 6489obj[ind].icon={}; 6490if (obj[ind].size){ 6491obj[ind].icon.size=obj[ind].size; 6492delete(obj[ind].size); 6493} 6494if (obj[ind]['text-align']){ 6495obj[ind].icon['text-align']=obj[ind]['text-align']; 6496delete(obj[ind]['text-align']); 6497} 6498} 6499} 6500} 6501} 6502} 6503if (app.modules.initItems){ 6504app.initItems(app.modules.initItems.data, app.modules.initItems.selector); 6505} 6506/** 6507* @package Gridbox 6508* @author Balbooa http://www.balbooa.com/ 6509* @copyright Copyright @ Balbooa 6510* @license http://www.gnu.org/licenses/gpl.html GNU/GPL 6511*/ 6512app.initText=function(obj, key){ 6513$g('#'+key).on('click', 'a[href]', function(event){ 6514if (this.hash&&this.href==window.location.href.replace(window.location.hash, '')+this.hash){ 6515let target=$g(this.hash+', [name="'+this.hash.replace('#', '')+'"]'); 6516if (target.length){ 6517event.preventDefault(); 6518window.history.replaceState(null, null, this.href); 6519let position=window.compileOnePageValue ? compileOnePageValue(target) : target.offset().top; 6520$g('html, body').stop().animate({ 6521scrollTop: position 6522}, 500); 6523} 6524} 6525}).on('click', '.ba-copy-to-clipboard', function(event){ 6526var textarea=document.createElement('textarea'), 6527text=this.closest('pre').querySelector('code').textContent; 6528document.body.appendChild(textarea); 6529textarea.value=text; 6530textarea.select() 6531document.execCommand('copy'); 6532textarea.remove(); 6533app.showNotice(app._('SUCCESSFULLY_COPIED_TO_CLIPBOARD')); 6534}).on('paste', function(event){ 6535if (!this.querySelector('.content-text').classList.contains('cke_editable_inline')){ 6536event.preventDefault(); 6537let text=event.originalEvent.clipboardData.getData('text/plain').trim(); 6538document.execCommand('insertText', false, text); 6539} 6540}).find('pre').each(function(){ 6541if (themeData.page.view !='gridbox'&&this.querySelector('code')){ 6542let span=document.createElement('span'); 6543span.className='ba-copy-to-clipboard'; 6544span.innerHTML='<i class="ba-icons ba-icon-copy"></i><span class="ba-tooltip">'+ 6545app._('COPY_TO_CLIPBOARD')+'</span>'; 6546this.append(span); 6547} 6548}); 6549initItems(); 6550} 6551if (app.modules.initText){ 6552app.initText(app.modules.initText.data, app.modules.initText.selector); 6553} 6554/** 6555* @package Gridbox 6556* @author Balbooa http://www.balbooa.com/ 6557* @copyright Copyright @ Balbooa 6558* @license http://www.gnu.org/licenses/gpl.html GNU/GPL 6559*/ 6560var overlayVideo={}; 6561function overlayClose(item){ 6562var iframes=item.querySelectorAll('.ba-item-custom-html iframe, .ba-item-video iframe, .ba-item-field-video iframe'); 6563for (var i=0; i < iframes.length; i++){ 6564let src=iframes[i].src, 6565videoId=iframes[i].id; 6566if (src&&src.indexOf('youtube.com') !==-1&&'pauseVideo' in overlayVideo[videoId]){ 6567overlayVideo[videoId].pauseVideo(); 6568} else if (src&&src.indexOf('vimeo.com') !==-1&&'pause' in overlayVideo[videoId]){ 6569overlayVideo[videoId].pause(); 6570} else if (src&&src.indexOf('youtube-nocookie.com') !==-1){ 6571iframes[i].closest('.ba-video-wrapper').innerHTML=iframes[i].closest('.ba-video-wrapper').innerHTML; 6572} 6573} 6574iframes=item.querySelectorAll('.ba-item-video video, .ba-item-custom-html video, .ba-item-field-video video'); 6575for (var i=0; i < iframes.length; i++){ 6576let videoId=iframes[i].id; 6577overlayVideo[videoId].pause(); 6578} 6579} 6580function overlayOpen(item){
6581if (item.querySelectorAll('.video-lazy-load-thumbnail')){ 6582$g(item).find('.video-lazy-load-thumbnail').trigger('click'); 6583} 6584var iframes=item.querySelectorAll('.ba-item-custom-html iframe, .ba-item-video iframe, .ba-item-field-video iframe'), 6585youtube=false, 6586vimeo=false, 6587id=+new Date(); 6588for (var i=0; i < iframes.length; i++){ 6589var src=iframes[i].src, 6590videoId; 6591if (src&&src.indexOf('youtube.com') !==-1){ 6592if (!app.youtube){ 6593youtube=true; 6594} else { 6595if (src.indexOf('enablejsapi=1')===-1){ 6596if (src.indexOf('?')===-1){ 6597src +='?'; 6598} else { 6599src +='&' 6600} 6601src +='enablejsapi=1'; 6602iframes[i].src=src; 6603} 6604if (!iframes[i].id){ 6605iframes[i].id=id++; 6606} 6607videoId=iframes[i].id; 6608if (!overlayVideo[videoId] || !('playVideo' in overlayVideo[videoId])){ 6609overlayVideo[videoId]=new YT.Player(videoId, { 6610events: { 6611onReady: function(event){ 6612if (item.classList.contains('visible-section')){ 6613overlayVideo[videoId].playVideo(); 6614} 6615} 6616} 6617}); 6618} else { 6619overlayVideo[videoId].playVideo(); 6620} 6621} 6622} else if (src&&src.indexOf('vimeo.com') !==-1){ 6623if (!app.vimeo){ 6624vimeo=true; 6625} else { 6626if (!iframes[i].id){ 6627iframes[i].id=id++; 6628} 6629videoId=iframes[i].id; 6630if (!overlayVideo[videoId] || !('play' in overlayVideo[videoId])){ 6631src=src.split('/'); 6632src=src.slice(-1); 6633src=src[0].split('?'); 6634src=src[0]; 6635var options={ 6636id: src * 1, 6637loop: true, 6638}; 6639overlayVideo[videoId]=new Vimeo.Player(videoId, options); 6640} 6641overlayVideo[videoId].play(); 6642} 6643} 6644} 6645iframes=item.querySelectorAll('.ba-item-video video, .ba-item-custom-html video, .ba-item-field-video video'); 6646for (var i=0; i < iframes.length; i++){ 6647if (!iframes[i].id){ 6648iframes[i].id=id++; 6649} 6650videoId=iframes[i].id; 6651if (!overlayVideo[videoId]){ 6652overlayVideo[videoId]=iframes[i]; 6653} 6654overlayVideo[videoId].play(); 6655} 6656if (youtube || vimeo){ 6657var object={ 6658data : {} 6659}; 6660if (youtube&&!vimeo){ 6661object.data.type='youtube'; 6662} else if (vimeo&&!youtube){ 6663object.data.type='vimeo'; 6664} else { 6665object.data.type='youtube+vimeo'; 6666} 6667app.checkModule('loadVideoApi', object); 6668} 6669if (youtube){ 6670overlayVideo.overlay=item; 6671} else if (vimeo){ 6672overlayVideo.overlay=item; 6673} 6674return !youtube&&!vimeo; 6675} 6676app['initoverlay-button']=function(obj, key){ 6677var button=$g('#'+key)[0], 6678id=button.id, 6679overlay=button.dataset.overlay; 6680$g(button).find('> .ba-button-wrapper > a, > .ba-image-wrapper').attr('tabindex', 0) 6681$g(button).on('click keyup', ' > .ba-button-wrapper > a, > .ba-image-wrapper', function(event){ 6682app.AccessibilityHelper.processAction(event, ()=> { 6683event.preventDefault(); 6684openOverlaySection(button); 6685}) 6686}); 6687$g(`.ba-overlay-section-backdrop[data-id="${overlay}"]`).on('keyup', function(event){ 6688if (event.key=='Escape'){ 6689$g(this).find('.ba-overlay-section-close').first().click(); 6690} 6691}).each(function(){ 6692$g(this).find('.close-overlay-section .ba-overlay-section-close').attr('tabindex', 0); 6693}).find(`.ba-overlay-section-close`).on('click keyup', function(event){ 6694app.AccessibilityHelper.processAction(event, ()=> { 6695const item=$g(this).closest('.ba-overlay-section-backdrop'); 6696item.removeClass('visible-section').addClass('overlay-section-backdrop-out'); 6697app.AccessibilityHelper.releaseTrap(item[0]); 6698setTimeout(function(){ 6699item.removeClass('overlay-section-backdrop-out'); 6700}, 400); 6701if (!$g('.ba-overlay-section-backdrop').not(item).hasClass('visible-section')){ 6702document.body.classList.remove('lightbox-open'); 6703document.body.classList.remove('ba-not-default-header'); 6704document.body.style.width=''; 6705$g('body > header.header').css('width', ''); 6706} 6707item.find('div.ba-overlay-section-close').css('width', ''); 6708$g('.ba-sticky-header').css('width', ''); 6709overlayClose(item[0]); 6710}) 6711}).on('mouseover', function(event){ 6712event.stopPropagation(); 6713}); 6714initItems(); 6715} 6716function openOverlaySection(button){ 6717let overlay=button.dataset.overlay, 6718item=document.querySelector('.ba-overlay-section-backdrop[data-id="'+overlay+'"]'); 6719if (app.items[overlay][app.view].disable==1&&!document.body.classList.contains('show-hidden-elements')){ 6720item.classList.remove('visible-section'); 6721document.body.classList.remove('lightbox-open'); 6722document.body.classList.remove('ba-not-default-header'); 6723} else { 6724overlayOpen(item) ? openOverlay(item) : ''; 6725} 6726} 6727function openOverlay(item){ 6728var header=document.querySelector('body > header.header'), 6729style=header ? getComputedStyle(header): {}, 6730width=window.innerWidth - document.documentElement.clientWidth, 6731hWidth=width + (themeData.page.view=='gridbox'&&app.view=='desktop' ? 103 : 0), 6732calc='calc(100% - '+width+'px)', 6733headerWidth='calc(100% - '+hWidth+'px)'; 6734document.body.style.width=calc; 6735item.querySelector('div.ba-overlay-section-close').style.width=calc; 6736if (header&&header.classList.contains('sidebar-menu')&&(app.view=='desktop' || app.view=='laptop')){ 6737headerWidth='calc(100% - '+hWidth+'px - var(--sidebar-menu-width))'; 6738} 6739$g('.ba-sticky-header').css('width', headerWidth); 6740item.classList.add('visible-section'); 6741document.body.classList.add('lightbox-open'); 6742if (style.position=='fixed'){ 6743$g('body > header.header').css('width', 'calc(100% - '+hWidth+'px)'); 6744} 6745if (style.position !='relative'){ 6746document.body.classList.add('ba-not-default-header'); 6747} 6748app.AccessibilityHelper.trapFocus(item, 350); 6749$g(window).trigger("scroll"); 6750} 6751if (app.modules['initoverlay-button']){ 6752app['initoverlay-button'](app.modules['initoverlay-button'].data, app.modules['initoverlay-button'].selector); 6753} 6754/** 6755* @package Gridbox 6756* @author Balbooa http://www.balbooa.com/ 6757* @copyright Copyright @ Balbooa 6758* @license http://www.gnu.org/licenses/gpl.html GNU/GPL 6759*/ 6760app.initimage=function(obj, key){ 6761$g('#'+key+' .ba-image-wrapper').off('click.lightbox').on('click.lightbox', function(){ 6762var $this=this.querySelector('img'); 6763if (app.items[key].popup&&$this.parentNode.localName !='a'){ 6764var div=document.createElement('div'), 6765width=$this.width, 6766height=$this.height, 6767offset=$g(this).offset(), 6768top=offset.top - $g(window).scrollTop(), 6769imgHeight=$this.naturalHeight,
6770imgWidth=$this.naturalWidth, 6771modal=$g(div), 6772comp=getComputedStyle(document.body), 6773wWidth=document.body.clientWidth, 6774wHeigth=window.innerHeight, 6775percent=imgWidth / imgHeight, 6776img=document.createElement('img'), 6777$img=$g(img); 6778if (document.body.classList.contains('blog-post-editor')){ 6779top -=65; 6780wWidth -=(415 + 51); 6781} 6782img.style.borderRadius=getComputedStyle($this).borderRadius; 6783img.src=$this.src; 6784div.className='ba-image-modal gridbox-gallery-modal'; 6785img.style.top=top+'px'; 6786img.style.left=offset.left+'px'; 6787img.style.width=width+'px'; 6788img.style.height=height+'px'; 6789div.style.backgroundColor=app.getCorrectColor(app.items[key].lightbox.color); 6790div.appendChild(img); 6791modal.on('click', function(){ 6792modal.addClass('image-lightbox-out'); 6793$img.css({ 6794'width' : width, 6795'height' : height, 6796'left' : offset.left, 6797'top' : top 6798}); 6799setTimeout(function(){ 6800modal.remove(); 6801}, 500); 6802}); 6803$g('body').append(div); 6804if (wWidth > 1024){ 6805if (imgWidth < wWidth&&imgHeight < wHeigth){ 6806} else { 6807if (imgWidth > imgHeight){ 6808imgWidth=wWidth - 100; 6809imgHeight=imgWidth / percent; 6810} else { 6811imgHeight=wHeigth - 100; 6812imgWidth=percent * imgHeight; 6813} 6814if (imgHeight > wHeigth){ 6815imgHeight=wHeigth - 100; 6816imgWidth=percent * imgHeight; 6817} 6818if (imgWidth > wWidth){ 6819imgWidth=wWidth - 100; 6820imgHeight=imgWidth / percent; 6821} 6822} 6823} else { 6824percent=imgWidth / imgHeight; 6825if (percent >=1){ 6826imgWidth=wWidth * 0.90; 6827imgHeight=imgWidth / percent; 6828if (wHeigth - imgHeight < wHeigth * 0.1){ 6829imgHeight=wHeigth * 0.90; 6830imgWidth=imgHeight * percent; 6831} 6832} else { 6833imgHeight=wHeigth * 0.90; 6834imgWidth=imgHeight * percent; 6835if (wWidth - imgWidth < wWidth * 0.1){ 6836imgWidth=wWidth * 0.90; 6837imgHeight=imgWidth / percent; 6838} 6839} 6840} 6841var modalTop=(wHeigth - imgHeight) / 2, 6842left=(wWidth - imgWidth) / 2 + comp.borderLeftWidth.replace('px', '') * 1; 6843if (document.body.classList.contains('blog-post-editor')){ 6844left +=51; 6845} 6846setTimeout(function(){ 6847$img.css({ 6848'width' : Math.round(imgWidth), 6849'height' : Math.round(imgHeight), 6850'left' : Math.round(left), 6851'top' : Math.round(modalTop) 6852}); 6853}, 100); 6854} 6855}); 6856initItems(); 6857} 6858if (app.modules.initimage){ 6859app.initimage(app.modules.initimage.data, app.modules.initimage.selector); 6860} 6861/** 6862* @package Gridbox 6863* @author Balbooa http://www.balbooa.com/ 6864* @copyright Copyright @ Balbooa 6865* @license http://www.gnu.org/licenses/gpl.html GNU/GPL 6866*/ 6867function compileValue(item){ 6868var value=item.offset().top, 6869header=$g('header.header'), 6870comp=header[0] ? getComputedStyle(header[0]) : {}, 6871top=window.scrollY, 6872stickies=$g('.ba-sticky-header'), 6873sticky=0; 6874if (item.closest('.ba-wrapper').parent().hasClass('header')){ 6875value=0; 6876} else { 6877stickies.each(function(){ 6878if (this.offsetHeight > 0){ 6879let section=this.querySelector('.ba-sticky-header > .ba-section'), 6880obj=app.items[section.id], 6881offset=obj.desktop.offset; 6882if (app.view !='desktop'){ 6883for (var ind in breakpoints){ 6884if (!obj[ind]){ 6885obj[ind]={}; 6886} 6887offset=obj[ind].offset ? obj[ind].offset : offset; 6888if (ind==app.view){ 6889break; 6890} 6891} 6892} 6893if ((!obj.scrollup&&offset < value) || (obj.scrollup&&offset < value&&value < top)){ 6894sticky=this.offsetHeight > sticky ? this.offsetHeight : sticky; 6895} 6896} 6897}); 6898if ((!header.hasClass('sidebar-menu') || (app.view !='desktop'&&app.view !='laptop')) 6899&&comp.position=='fixed'){ 6900sticky=header[0].offsetHeight > sticky ? header[0].offsetHeight : sticky; 6901if (header.find('.resizing-header').length > 0){ 6902let resizingSection=getComputedStyle(header.find('.resizing-header')[0]); 6903value +=resizingSection.paddingTop.replace('px', '') * 1; 6904value +=resizingSection.paddingBottom.replace('px', '') * 1; 6905} 6906} 6907value -=sticky; 6908} 6909return Math.ceil(value); 6910} 6911app.initmenu=function(obj, key){ 6912$g('#'+key).find('li[class*="item-"].current, li[class*="item-"].active').each(function(){ 6913this.classList.add('active'); 6914$g(this).parents('li').addClass('active visible-nav-child'); 6915}); 6916$g(`#${key} li[class*="item-"] a[data-anchor]`).on('click', function(event){ 6917const id=this.dataset.anchor 6918if (!document.getElementById(id)){ 6919return; 6920} 6921event.preventDefault(); 6922$g(this).closest('ul').find('.active').removeClass('active current'); 6923this.parentNode.classList.add('active'); 6924const item=$g('#' + id); 6925let value=compileValue(item),
6926speed=1000, 6927alias=this.dataset.alias, 6928url=location.href.replace(location.hash, '') + '#' + alias; 6929$g(`.ba-item-main-menu a[data-anchor="${id}"]`).not(this).each(function(){ 6930$g(this).closest('ul').find('.active').removeClass('active'); 6931this.parentNode.classList.add('active'); 6932}); 6933if (window.scrollY !=value){ 6934window.onePageScroll=false; 6935$g('html, body').stop().animate({ 6936'scrollTop' : value 6937}, speed, function(){ 6938setTimeout(function(){ 6939window.onePageScroll=true; 6940}, 200); 6941}); 6942} 6943window.history.replaceState(null, null, url); 6944}) 6945$g('#'+key+' > .ba-menu-wrapper > .open-menu i').on('mousedown', function(event){ 6946if (event.button&&event.button !=0){ 6947return false; 6948} 6949event.stopPropagation(); 6950setTimeout(function(){ 6951var width=window.innerWidth - document.documentElement.clientWidth; 6952$g('#'+key+' > .ba-menu-wrapper > .main-menu') 6953.find('li.deeper.parent > ul, .ba-wrapper[data-megamenu]').css('max-height', ''); 6954$g('#'+key+' > .ba-menu-wrapper > .main-menu').addClass('visible-menu').removeClass('hide-menu') 6955.css('right', -width+'px').closest('.column-wrapper').addClass('column-with-menu') 6956.parents('.ba-row-wrapper').addClass('row-with-menu'); 6957if (themeData.page.view=='gridbox'){ 6958var computed=getComputedStyle(document.querySelector('header.header')); 6959document.querySelector('header.header').classList.add('ba-header-position-'+computed.position); 6960} 6961$g('#'+key+' > .ba-menu-backdrop').addClass('ba-visible-menu-backdrop'); 6962$g('body').addClass('ba-opened-menu'); 6963}, 50); 6964}); 6965$g('#'+key+' > .ba-menu-backdrop, #'+key+' > .ba-menu-wrapper > .main-menu > .close-menu i').off('click').on('click', function(){ 6966if (!document.body.classList.contains('body-megamenu-editing')){ 6967$g('.visible-menu').addClass('hide-menu').removeClass('visible-menu').css('right', '') 6968.closest('.column-wrapper').removeClass('column-with-menu'); 6969$g('.ba-menu-backdrop').removeClass('ba-visible-menu-backdrop').addClass('ba-menu-backdrop-out'); 6970setTimeout(function(){ 6971$g('.ba-menu-backdrop.ba-menu-backdrop-out').removeClass('ba-menu-backdrop-out'); 6972}, 300); 6973$g('#'+key+' > .ba-menu-wrapper > .main-menu') 6974.find('li.deeper.parent > ul, .ba-wrapper[data-megamenu]').css('max-height', ''); 6975setTimeout(function(){ 6976if (themeData.page.view=='gridbox'){ 6977var computed=getComputedStyle(document.querySelector('header.header')); 6978document.querySelector('header.header').classList.remove('ba-header-position-'+computed.position); 6979} 6980$g('body').removeClass('ba-opened-menu'); 6981$g('.row-with-menu').removeClass('row-with-menu'); 6982}, 500); 6983} 6984}); 6985if (themeData.page.view=='gridbox'){ 6986$g('#'+key+' .ba-menu-wrapper').on('click', '.ba-edit-item', function(event){ 6987event.preventDefault(); 6988event.stopPropagation(); 6989}); 6990var addNewItem=$g('#'+key+' > .ba-menu-wrapper > .main-menu > .add-new-item'); 6991if (addNewItem.length==0){ 6992addNewItem='<div class="add-new-item"><span><i class="zmdi zmdi-layers"></i>'+ 6993'<span class="ba-tooltip ba-top">'+top.app._('ADD_NEW_ITEM')+'</span></span></div>'; 6994$g('#'+key+' > .ba-menu-wrapper > .main-menu').append(addNewItem); 6995addNewItem=$g('#'+key+' > .ba-menu-wrapper > .main-menu > .add-new-item'); 6996} 6997addNewItem.find('i').on('click', function(){ 6998app.edit=this.closest('.ba-item').id; 6999window.parent.app.checkModule('addPlugins'); 7000}); 7001if ($g('#'+key+' > .ba-edit-item .open-mobile-menu').length==0){ 7002var str='<span class="ba-edit-wrapper"><i class="zmdi zmdi-open-in-new open-mobile-menu"></i>'+ 7003'<span class="ba-tooltip tooltip-delay settings-tooltip">'+top.app._('OPEN')+ 7004'</span></span>'; 7005$g('#'+key+' > .ba-edit-item .ba-buttons-wrapper .ba-edit-wrapper').first().before(str); 7006} 7007$g('.edit-mobile-menu-item').off('mousedown').on('mousedown', function(event){ 7008if (event.button&&event.button !=0){ 7009return false; 7010} 7011event.stopPropagation(); 7012$g(this).closest('.ba-item').find('> .ba-edit-item .edit-item').trigger('mousedown'); 7013}); 7014$g('.open-mobile-menu').off('mousedown').on('mousedown', function(event){ 7015if (event.button&&event.button !=0){ 7016return false; 7017} 7018event.stopPropagation(); 7019$g(this).closest('.ba-item').find('> .ba-menu-wrapper > .open-menu i').first().trigger('mousedown'); 7020}); 7021} 7022$g('#'+key+' > .ba-menu-wrapper .tabs-content-wrapper[data-megamenu]').each(function(){ 7023var li=$g('#'+key+' > .ba-menu-wrapper > .main-menu > .integration-wrapper > ul > li.'+this.dataset.megamenu); 7024if (li.length !=0&&$g(this).closest('li').length==0){ 7025li.prepend(this); 7026} 7027}); 7028const parents=document.querySelectorAll(`#${key} li.deeper.parent`);
7029parents.forEach(parent=> { 7030const trigger=parent.querySelector(':scope > a, :scope > span'); 7031const submenu=parent.querySelector(':scope > ul, :scope > .ba-wrapper'); 7032if (!trigger || !submenu) return; 7033submenu.setAttribute('aria-hidden', 'true'); 7034trigger.addEventListener('keydown', e=> { 7035if (e.key==='ArrowDown'){ 7036e.preventDefault(); 7037e.stopPropagation(); 7038submenu.classList.add('show-menu'); 7039submenu.setAttribute('aria-hidden', 'false'); 7040if (submenu.classList.contains('ba-wrapper')){ 7041setMegamenuPosition(parent); 7042} 7043} else if (e.key==='Escape'){ 7044submenu.classList.remove('show-menu'); 7045submenu.setAttribute('aria-hidden', 'true'); 7046} 7047}); 7048submenu.addEventListener('keydown', e=> { 7049if (e.key==='Escape'){ 7050e.stopPropagation(); 7051submenu.classList.remove('show-menu'); 7052submenu.setAttribute('aria-hidden', 'true'); 7053const parentLi=submenu.closest('li.deeper.parent'); 7054const parentTrigger=parentLi?.querySelector(':scope > a, :scope > span'); 7055if (parentTrigger) parentTrigger.focus(); 7056} 7057}); 7058parent.addEventListener('focusout', ()=> { 7059setTimeout(()=> { 7060if (!parent.contains(document.activeElement)){ 7061submenu.classList.remove('show-menu'); 7062submenu.setAttribute('aria-hidden', 'true'); 7063} 7064}, 10); 7065}); 7066}); 7067$g('#'+key).on('mouseenter', 'li.megamenu-item', function(){ 7068setMegamenuPosition(this); 7069}); 7070$g('#'+key).off('click.deeper') 7071.on('click.deeper', 'li.deeper.parent > a > i.ba-icons, li.deeper.parent > span > i.ba-icons', function(event){ 7072event.preventDefault(); 7073event.stopPropagation(); 7074let li=$g(this).closest('li.deeper.parent'); 7075if (li.hasClass('visible-nav-child')){ 7076li.removeClass('visible-nav-child').addClass('hidden-nav-child'); 7077} else { 7078$g('#'+key+' .visible-nav-child').find(' > ul, > .ba-wrapper').css('max-height', ''); 7079li.addClass('visible-nav-child').removeClass('hidden-nav-child'); 7080setTimeout(function(){ 7081$g('#'+key+' .visible-nav-child').find(' > ul, > .ba-wrapper').each(function(){ 7082this.style.maxHeight=$g(this).outerHeight()+'px'; 7083}); 7084}, 500); 7085} 7086}); 7087$g('#'+key).on('mouseenter.test', '.integration-wrapper > ul > li.deeper.parent:not(.megamenu-item)', function(){ 7088let vertical=this.closest('.ba-menu-wrapper').classList.contains('vertical-menu'), 7089ul=this.querySelector('ul'), 7090rect=this.getBoundingClientRect(); 7091if (!vertical&&document.documentElement.clientWidth < rect.left + ul.clientWidth){ 7092ul.classList.add('dropdown-left-direction'); 7093} else if (vertical&&document.documentElement.clientHeight < rect.bottom + ul.clientHeight){ 7094ul.classList.add('dropdown-top-direction'); 7095ul.style.setProperty('--dropdown-top-diff', (rect.bottom + ul.clientHeight - document.documentElement.clientHeight)+'px'); 7096} 7097}); 7098$g('#'+key).on('mouseenter.test', 'li.deeper.parent > ul li.deeper.parent', function(){ 7099let vertical=this.closest('.ba-menu-wrapper').classList.contains('vertical-menu'), 7100ul=this.querySelector('ul'), 7101rect=this.getBoundingClientRect(); 7102if (!vertical&&document.documentElement.clientWidth < rect.right + ul.clientWidth){ 7103ul.classList.add('child-dropdown-left-direction'); 7104} else if (vertical&&document.documentElement.clientHeight < rect.bottom + ul.clientHeight){ 7105ul.classList.add('dropdown-top-direction'); 7106ul.style.setProperty('--dropdown-top-diff', (rect.bottom + ul.clientHeight - document.documentElement.clientHeight)+'px'); 7107} 7108}); 7109if (themeData.page.view !='gridbox'){ 7110let endCoords={}; 7111let startCoords={} 7112$g('#'+key).on('touchstart', function(event){ 7113endCoords=event.originalEvent.targetTouches[0]; 7114startCoords=event.originalEvent.targetTouches[0]; 7115}).on('touchmove', function(event){ 7116endCoords=event.originalEvent.targetTouches[0]; 7117}).on('touchend', function(){
7118let hDistance=endCoords.pageX - startCoords.pageX, 7119xAbs=Math.abs(endCoords.pageX - startCoords.pageX), 7120yAbs=Math.abs(endCoords.pageY - startCoords.pageY); 7121if (hDistance >=100&&xAbs >=yAbs * 2){ 7122$g('#'+key+' .ba-menu-backdrop').trigger('click'); 7123} 7124}); 7125} 7126initItems(); 7127} 7128function setMegamenuPosition(li){ 7129let rectangle=li.getBoundingClientRect(), 7130comp=getComputedStyle(document.body), 7131borderLeft=comp.borderLeftWidth.replace('px', '') * 1, 7132left=rectangle.left - borderLeft, 7133wrapper=$g(li).find(' > div.tabs-content-wrapper'), 7134width=document.body.clientWidth; 7135wrapper[0].style.setProperty('--menu-item-left-offset', left+'px'); 7136wrapper[0].style.setProperty('--menu-item-width', li.offsetWidth+'px'); 7137wrapper.css({ 7138'margin-left': '', 7139'width': width+'px', 7140'max-width': '' 7141}); 7142const itemsSelectors=[ 7143'.ba-item-slideshow', 7144'.ba-item-slideset', 7145'.ba-item-carousel', 7146'.ba-item-map', 7147'.ba-item-recent-posts-slider', 7148'.ba-item-openstreetmap', 7149'.ba-item-recent-posts' 7150] 7151wrapper.find(itemsSelectors.join(', ')).each(function(){ 7152let object={ 7153data: app.items[this.id], 7154selector: this.id 7155}; 7156app.checkModule('initItems', object); 7157}); 7158} 7159if (app.modules.initmenu){ 7160app.initmenu(app.modules.initmenu.data, app.modules.initmenu.selector); 7161}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.